/* 官网智能客服（AI + 知识库） —— 右下角入口与对话面板
   入口已并入全站悬浮按钮组（#fsStack：AI 助手 / 客服 / 返回顶部），以细横线分隔；
   窄屏切换为近全屏面板 */

/* 按钮组内的 AI 入口（纵向排列，与客服、返回顶部同宽同高） */
#fsStack .aic-slot { display:flex; flex-direction:column; align-items:center; width:100%; }
#fsStack .aic-btn {
	position:relative; right:auto; bottom:auto; width:45px; height:45px; border:0; border-radius:0;
	background:transparent; box-shadow:none; color:#fff; font-size:19px; cursor:pointer; z-index:auto;
	display:flex; align-items:center; justify-content:center; transition:background .18s;
}
#fsStack .aic-btn:hover { background:rgba(255,255,255,.16); transform:none; box-shadow:none; }
#fsStack .aic-badge {
	top:5px; right:5px; min-width:14px; height:14px; padding:0 4px; border-radius:7px;
	font-size:10px; line-height:14px;
}

/* 独立使用时的兜底样式（不在按钮组内时按悬浮圆钮呈现） */
.aic-btn {
	position: fixed; right: 30px; bottom: 140px; width: 52px; height: 52px; border: 0; border-radius: 50%;
	background: linear-gradient(135deg, #534ab7, #7b68ee); color: #fff; font-size: 20px; cursor: pointer;
	box-shadow: 0 8px 24px rgba(83, 74, 183, .38); z-index: 99995;
	display: flex; align-items: center; justify-content: center;
	transition: transform .2s, box-shadow .2s;
}
.aic-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(83, 74, 183, .48); }
.aic-btn .aic-badge {
	position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
	background: #e24b4a; color: #fff; font-size: 11px; line-height: 18px; font-weight: 600; text-align: center;
	box-shadow: 0 2px 6px rgba(226, 75, 74, .4);
}
.aic-btn .aic-badge[hidden] { display: none; }

.aic-panel {
	position: fixed; right: 30px; bottom: 133px; width: 374px; height: 566px; max-height: calc(100vh - 163px);
	background: #fff; border-radius: 18px; box-shadow: 0 24px 60px rgba(20, 20, 50, .22);
	z-index: 99996; display: none; flex-direction: column; overflow: hidden; border: 1px solid #ececf5;
	font-family: inherit;
}
.aic-panel.aic-open { display: flex; animation: aicIn .22s ease-out; }
@keyframes aicIn {
	from { opacity: 0; transform: translateY(12px); }
	to { opacity: 1; transform: translateY(0); }
}

.aic-head {
	background: linear-gradient(135deg, #534ab7, #7b68ee); color: #fff; padding: 14px 16px;
	display: flex; align-items: center; gap: 10px; flex: none;
}
.aic-avatar {
	width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, .18);
	display: flex; align-items: center; justify-content: center; font-size: 16px; flex: none;
}
.aic-ht { flex: 1; min-width: 0; }
.aic-ht b { display: block; font-size: 15px; font-weight: 700; line-height: 1.3; }
.aic-ht span { display: flex; align-items: center; gap: 5px; font-size: 11.5px; opacity: .92; margin-top: 2px; }
.aic-on { width: 6px; height: 6px; border-radius: 50%; background: #6ee7a8; box-shadow: 0 0 0 2px rgba(110, 231, 168, .3); }
.aic-x { border: 0; background: transparent; color: #fff; font-size: 16px; cursor: pointer; opacity: .85; padding: 4px; }
.aic-x:hover { opacity: 1; }

.aic-body {
	flex: 1; overflow-y: auto; padding: 16px 14px 6px; background: #f7f7fc;
	display: flex; flex-direction: column; gap: 12px;
}
.aic-body::-webkit-scrollbar { width: 5px; }
.aic-body::-webkit-scrollbar-thumb { background: #d9d9e8; border-radius: 3px; }

.aic-msg { display: flex; gap: 8px; max-width: 100%; }
.aic-msg .aic-b {
	padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.72;
	word-break: break-word; white-space: pre-wrap;
}
.aic-ai .aic-b {
	background: #fff; color: #33334a; border: 1px solid #ececf5; border-top-left-radius: 5px;
	box-shadow: 0 2px 8px rgba(20, 20, 50, .04);
}
.aic-me { justify-content: flex-end; }
.aic-me .aic-b { background: #534ab7; color: #fff; border-top-right-radius: 5px; }
.aic-sys .aic-b { background: #fdf3e7; color: #8a6234; border: 1px solid #f6e3cb; font-size: 12.5px; }

.aic-typing { display: inline-flex; gap: 4px; align-items: center; height: 16px; }
.aic-typing i { width: 6px; height: 6px; border-radius: 50%; background: #b9b4e0; animation: aicDot 1.1s infinite; }
.aic-typing i:nth-child(2) { animation-delay: .18s; }
.aic-typing i:nth-child(3) { animation-delay: .36s; }
@keyframes aicDot {
	0%, 60%, 100% { opacity: .35; transform: translateY(0); }
	30% { opacity: 1; transform: translateY(-3px); }
}

.aic-chips { padding: 0 14px 10px; display: flex; flex-wrap: wrap; gap: 7px; background: #f7f7fc; flex: none; }
.aic-chip {
	border: 1px solid #ddd9f3; background: #fff; color: #534ab7; font-size: 12px; padding: 6px 11px;
	border-radius: 999px; cursor: pointer; transition: all .18s; white-space: nowrap;
}
.aic-chip:hover { background: #534ab7; color: #fff; border-color: #534ab7; }

.aic-foot {
	flex: none; border-top: 1px solid #f0f0f8; background: #fff; padding: 10px 12px;
	display: flex; gap: 8px; align-items: flex-end;
}
.aic-input {
	flex: 1; border: 1px solid #e5e6f2; border-radius: 12px; padding: 9px 12px; font-size: 13.5px; color: #33334a;
	resize: none; height: 38px; max-height: 92px; line-height: 1.4; outline: none; font-family: inherit;
}
.aic-input:focus { border-color: #a9a2dc; box-shadow: 0 0 0 3px rgba(83, 74, 183, .09); }
.aic-send {
	width: 38px; height: 38px; flex: none; border: 0; border-radius: 12px; background: #534ab7; color: #fff;
	font-size: 15px; cursor: pointer; display: flex; align-items: center; justify-content: center;
	transition: background .2s;
}
.aic-send:hover { background: #443ba6; }
.aic-send:disabled { background: #c9c6e2; cursor: default; }

.aic-tip {
	flex: none; padding: 0 12px 10px; font-size: 11px; color: #9a9ab5; line-height: 1.6;
	text-align: center; background: #fff;
}
.aic-tip a { color: #534ab7; font-weight: 600; }

@media (max-width: 575px) {
	.aic-btn { right: 16px; bottom: 140px; width: 48px; height: 48px; font-size: 18px; }
	.aic-panel {
		left: 8px; right: 8px; top: 8px; bottom: 8px; width: auto; height: auto;
		max-height: none; border-radius: 16px;
	}
}
