/**
 * 浮动联系图标 - 前台样式
 * v2.0：悬停时图标从右边缘向左“变长”展开成胶囊形并显示提示文字，
 *       右边缘始终贴住屏幕边缘，不会脱离边缘。
 */

.fci-bar {
	position: fixed;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	z-index: var(--fci-z, 99999);
	display: flex;
	flex-direction: column;
	/* 右对齐：任何图标变长展开时，其余图标仍紧贴右边缘不动 */
	align-items: flex-end;
	gap: var(--fci-gap, 8px);
	line-height: 1;
}

/* 顶部 / 底部模式 */
.fci-bar.fci-top {
	top: 0;
	transform: none;
}

.fci-bar.fci-bottom {
	top: auto;
	transform: none;
}

/* 单个图标按钮：
   默认是一个圆形贴靠在右侧边缘；
   悬停时向左“变长”展开成胶囊形并显示提示文字，右边缘保持贴住屏幕边缘。 */
.fci-item {
	position: relative;
	display: inline-flex;
	flex-direction: row-reverse; /* 图标在右、文字在左，右边缘不动 */
	align-items: center;
	width: auto;
	max-width: var(--fci-size, 36px);
	height: var(--fci-size, 36px);
	background: var(--fci-bg, #ffffff);
	color: #333333;
	border-radius: 999px 0 0 999px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
	text-decoration: none;
	overflow: hidden;
	transition: max-width 0.35s ease, box-shadow 0.2s ease, background 0.2s ease;
}

/* 图标本体：固定为圆形区域，保证默认收起状态是正圆 */
.fci-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--fci-size, 36px);
	height: var(--fci-size, 36px);
	flex-shrink: 0;
	font-size: calc(var(--fci-size, 36px) * 0.5);
}

.fci-item img {
	display: block;
	width: 55%;
	height: 55%;
	object-fit: contain;
}

/* 悬停 / 键盘聚焦：长度变长、向左展开，边缘不移动 */
.fci-item:hover,
.fci-item:focus {
	max-width: 400px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
}

/* 提示文字：默认完全收起，悬停时在图标左侧平滑展开 */
.fci-tip {
	max-width: 0;
	opacity: 0;
	padding: 0;
	overflow: hidden;
	white-space: nowrap;
	font-size: 13px;
	line-height: 1.5;
	transition: max-width 0.35s ease, opacity 0.3s ease, padding 0.35s ease;
}

.fci-item:hover .fci-tip,
.fci-item:focus .fci-tip {
	max-width: 260px;
	opacity: 1;
	padding: 0 14px 0 10px;
}

/* 移动端（无悬停）保持圆形收起状态 */
@media (max-width: 600px) {
	.fci-tip {
		display: none;
	}
}
