/* ==========================================
   AI 客服悬浮导航 + 聊天窗 前端样式
   断点约定：手机端 ≤768px ／ 平板端 769~1024px ／ 电脑端 ≥1025px
   ========================================== */
:root {
	--ai-kf-primary: #2664eb;
	--ai-kf-bg-glass: rgba(255, 255, 255, 0.75);
	--ai-kf-border-glass: rgba(255, 255, 255, 0.4);
}

/* ---------- 三端独立显示工具类 ---------- */
@media (min-width: 1025px) {
	.ai-kf-hide-pc { display: none !important; }
}
@media (min-width: 769px) and (max-width: 1024px) {
	.ai-kf-hide-pad { display: none !important; }
}
@media (max-width: 768px) {
	.ai-kf-hide-mobile { display: none !important; }
}

/* ---------- 侧边栏导航 ---------- */
.aikf-sidebar {
	position: fixed;
	right: 0;
	top: 60%;
	transform: translateY(-50%);
	z-index: 2147483640;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 12px;
	font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
	transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
	padding-right: 15px;
	box-sizing: border-box;
}
.aikf-sidebar * { box-sizing: border-box; }

.aikf-nav-group {
	display: flex;
	flex-direction: column;
	gap: 12px;
	align-items: flex-end;
	transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.aikf-nav-item {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	text-decoration: none;
	color: #1d1d1f;
	background: rgba(255,255,255,0.92);
	border: 1px solid rgba(0,0,0,0.07);
	border-radius: 14px;
	box-shadow: 0 2px 12px rgba(0,0,0,0.08);
	width: 44px;
	height: 44px;
	overflow: hidden;
	cursor: pointer;
	white-space: nowrap;
	/* 只对 width/box-shadow/color 做过渡，不用 transition:all 避免页面渲染时触发闪白 */
	transition: width .32s cubic-bezier(0.165,0.84,0.44,1),
	            box-shadow .2s ease,
	            color .2s ease,
	            background .2s ease;
	/* 加载时禁止动画（由 JS 在 load 后动态移除） */
}

/* JS 加载后给 sidebar 加 .aikf-ready，才启用 nav-item 过渡 */
.aikf-sidebar:not(.aikf-ready) .aikf-nav-item {
	transition: none !important;
}

.aikf-nav-item:hover {
	width: max-content;
	min-width: 120px;
	max-width: 220px;
	background: var(--aikf-hover-bg, #ffffff) !important;
	color: var(--aikf-hover-text, #2664eb) !important;
	transform: translateX(-5px);
	box-shadow: 0 4px 20px rgba(0,0,0,.12);
}

/* 文字区域：初始 width=0，悬停时展开；用 max-width 做过渡动画 */
.aikf-nav-text {
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	max-width: 0;
	overflow: hidden;
	opacity: 0;
	padding-left: 0;
	transition: max-width 0.32s cubic-bezier(0.165, 0.84, 0.44, 1),
	            opacity   0.25s ease,
	            padding   0.32s ease;
}
.aikf-nav-item:hover .aikf-nav-text {
	max-width: 160px;
	opacity: 1;
	padding-left: 14px; /* 文字与左边框的间距 */
}

/* 图标容器：始终固定 44×44，紧贴右侧 */
.aikf-icon-box {
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.aikf-icon { width: 20px; height: 20px; fill: currentColor; }

.aikf-toggle-btn {
	width: 44px; height: 44px;
	backdrop-filter: blur(15px);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 14px;
	display: flex; align-items: center; justify-content: center;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(0,0,0,0.15);
	transition: all 0.4s ease;
}
.aikf-toggle-btn .aikf-btn-label { display: none; }
.aikf-mobile-only { display: none !important; }

/* 展开/收起按钮悬停效果（仅电脑/平板端生效，手机端为触摸操作，:hover 不触发） */
@media (min-width: 769px) {
	.aikf-toggle-btn:hover {
		background: var(--aikf-toggle-hover-bg, #ffffff) !important;
		color: var(--aikf-toggle-hover-text, #2664eb) !important;
	}
}

.aikf-sidebar.aikf-collapsed { padding-right: 0; }
.aikf-sidebar.aikf-collapsed .aikf-nav-group { opacity: 0; transform: translateX(110%); pointer-events: none; }
.aikf-sidebar.aikf-collapsed .aikf-toggle-btn { width: 18px; height: 70px; border-radius: 35px 0 0 35px; border: 1px solid rgba(255, 255, 255, 0.1); border-right: none; }
.aikf-sidebar.aikf-collapsed .aikf-toggle-btn .aikf-arrow-icon { transform: rotate(-90deg); }
.aikf-sidebar:not(.aikf-collapsed) .aikf-toggle-btn .aikf-arrow-icon { transform: rotate(90deg); }

.aikf-back-to-top {
	width: 44px; height: 44px;
	backdrop-filter: blur(10px);
	border-radius: 14px;
	display: flex; align-items: center; justify-content: center;
	cursor: pointer; margin-top: 15px;
	transition: 0.3s; opacity: 0; transform: scale(0.5); pointer-events: none;
}
.aikf-back-to-top.aikf-visible { opacity: 1; transform: scale(1); pointer-events: auto; }
/* 悬停效果仅电脑/平板端生效；手机端为触摸操作，:hover 不会真正触发 */
@media (min-width: 769px) {
	.aikf-back-to-top:hover {
		color: var(--aikf-top-hover-text, var(--ai-kf-primary)) !important;
		background: var(--aikf-top-hover-bg, #ffffff) !important;
	}
}

@media (max-width: 768px) {
	.aikf-sidebar {
		top: auto; bottom: 0; right: 0; left: 0;
		transform: none; padding-right: 0;
		align-items: center; flex-direction: column-reverse;
	}
	.aikf-toggle-btn .aikf-arrow-icon { display: none; }
	.aikf-nav-group {
		position: fixed; bottom: 90px; left: 50%;
		transform: translateX(-50%) translateY(20px) scale(0.9);
		background: none; border: none; box-shadow: none;
		width: 240px; opacity: 0; pointer-events: none;
		transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
		display: flex; flex-direction: column; align-items: center; gap: 15px;
	}
	.aikf-sidebar.aikf-active .aikf-nav-group { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; pointer-events: auto; }
	.aikf-nav-item {
		width: 170px !important; height: 52px;
		background: rgba(20, 20, 20, 0.9) !important;
		backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.1);
		box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
		justify-content: center; flex-direction: row-reverse;
		border-radius: 12px; margin-bottom: 0; padding: 0 20px;
		color: #ffffff !important; transition: none !important;
		-webkit-tap-highlight-color: transparent !important;
	}
	.aikf-nav-item.aikf-mobile-close-btn {
		min-width: 52px !important; width: 52px !important; height: 52px !important;
		border-radius: 50% !important; padding: 0 !important;
		background: rgba(40, 40, 40, 0.95) !important;
		border: 1px solid rgba(255, 255, 255, 0.2) !important;
	}
	.aikf-nav-text { opacity: 1; display: block; font-size: 15px; flex-grow: 0; margin-left: 10px; margin-right: 0; color: #ffffff !important; }
	.aikf-nav-item .aikf-icon { fill: #ffffff !important; }
	.aikf-toggle-btn {
		width: 50vw; height: 40px; border-radius: 100px 100px 0 0;
		backdrop-filter: blur(15px);
		border: 1px solid rgba(255, 255, 255, 0.1); border-bottom: none;
		box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.3); position: fixed;
		bottom: 0; left: 25vw; z-index: 999998;
		opacity: 1; visibility: visible; transition: transform 0.3s, opacity 0.3s;
		display: flex; align-items: center; justify-content: center; padding: 0;
	}
	.aikf-sidebar.aikf-active .aikf-toggle-btn { opacity: 0; visibility: hidden; transform: translateY(100%); pointer-events: none; }
	.aikf-toggle-btn .aikf-btn-label { display: block; font-size: 14px; font-weight: 500; letter-spacing: 2px; margin: 0; line-height: 1; }
	.aikf-back-to-top { position: fixed; right: 16px; bottom: 78px; }
	.aikf-mobile-only { display: flex !important; }
}

/* ---------- AI 聊天窗 ---------- */
@keyframes aikfSlideIn { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes aikfSlideFromRight { from { transform: translateX(100%); } to { transform: translateX(0); } }

#aikf-chatbot-widget {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 14px; line-height: 1.5; box-sizing: border-box;
	z-index: 2147483646;
}
#aikf-chatbot-widget *, #aikf-chatbot-widget *::before, #aikf-chatbot-widget *::after { box-sizing: border-box; }
.aikf-animate-slide-in { animation: aikfSlideIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }

.aikf-chat-container::-webkit-scrollbar { width: 5px; }
.aikf-chat-container::-webkit-scrollbar-thumb { background: #eee; border-radius: 10px; }

.aikf-message-content { line-height: 1.7; font-size: 14px !important; word-wrap: break-word; }
.aikf-message-content p { margin-bottom: 0.8rem; display: block; }
.aikf-message-content p:last-child { margin-bottom: 0 !important; }
.aikf-message-content a { color: #2664eb; text-decoration: none !important; border-bottom: 1px solid #2664eb; display: inline !important; }

.aikf-typing::after { content: '|'; animation: aikfBlink 1s infinite; margin-left: 2px; color: #2664eb; font-weight: bold; }
@keyframes aikfBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

#aikf-chat-window { box-shadow: 0 12px 40px rgba(0,0,0,0.12); }

/* 重要修复：下面媒体查询里给 #aikf-chat-window 设置了 display:flex（ID 选择器），
   优先级高于 Tailwind 的 .hidden（class 选择器，display:none），
   导致即使 JS 加上了 hidden 类也无法真正隐藏聊天窗口（默认打开且关不掉）。
   这里用「ID + class」组合选择器 + !important 把隐藏状态的优先级提到最高，
   确保点击关闭/气泡按钮切换 hidden 类时一定生效。 */
#aikf-chatbot-widget #aikf-chat-window.hidden {
	display: none !important;
}

@media (min-width: 768px) {
	#aikf-chatbot-widget { position: fixed; bottom: 30px; right: 20px; }
	#aikf-chat-window {
		position: absolute; bottom: 0; right: 100%; margin-right: 20px;
		width: 400px; height: 600px; border-radius: 24px;
		display: flex; flex-direction: column; z-index: 1000;
	}
	#aikf-toggle-chat {
		border-radius: 9999px !important; padding: 12px 20px !important;
		display: flex !important; align-items: center; box-shadow: 0 10px 25px rgba(0,0,0,0.2);
		border: none; cursor: pointer;
	}
	#aikf-toggle-chat span { display: inline-block !important; }
}

@media (max-width: 767px) {
	#aikf-chatbot-widget { position: fixed; bottom: 144px; right: 16px; }
	#aikf-toggle-chat {
		width: 44px !important; height: 44px !important; border-radius: 50% !important;
		display: flex !important; align-items: center; justify-content: center;
		box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important; padding: 0 !important;
		border: 1px solid #eee !important; cursor: pointer;
	}
	#aikf-toggle-chat span { display: none !important; }
	#aikf-chat-window {
		position: fixed; left: 0; right: 0; top: 0; bottom: 0;
		width: 100vw; height: 100dvh; border-radius: 0; z-index: 2147483647;
		animation: aikfSlideFromRight 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
		display: flex; flex-direction: column; overflow: hidden;
	}
	#aikf-chat-header { position: absolute !important; top: 0 !important; left: 0 !important; width: 100% !important; height: 60px; background: white; z-index: 2147483647; border-bottom: 1px solid #f3f4f6; }
	#aikf-message-container { margin-top: 60px; padding-bottom: 20px; scroll-behavior: smooth; }
	#aikf-chat-footer { padding-bottom: env(safe-area-inset-bottom, 16px); }
}

.ai-kf-hidden { display: none !important; }

/* 拖拽状态cursor */
#aikf-chatbot-widget.aikf-draggable { cursor: grab; }
#aikf-chatbot-widget.aikf-dragging  { cursor: grabbing; user-select: none; }

/* 位置重置按钮 */
#aikf-pos-reset {
	display: none;
	position: absolute;
	top: -10px;
	left: -10px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #ef4444;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 22px;
	text-align: center;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(0,0,0,.25);
	border: none;
	z-index: 10;
	transition: transform .15s;
	font-style: normal;
}
#aikf-pos-reset:hover { transform: scale(1.15); }
#aikf-chatbot-widget.aikf-pos-moved #aikf-pos-reset { display: block; }


#aikf-chatbot-widget {
	position: fixed;
	bottom: 24px;
	right: 24px;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	z-index: 2147483640;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.aikf-chat-bubble-btn {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 18px;
	border-radius: 30px;
	border: 1px solid rgba(255,255,255,.15);
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: .01em;
	box-shadow: 0 4px 18px rgba(0,0,0,.18);
	transition: opacity .2s, transform .15s;
	white-space: nowrap;
}

.aikf-chat-bubble-btn:hover  { opacity: .9; }
.aikf-chat-bubble-btn:active { transform: scale(.95); }

.aikf-chat-bubble-icon { width: 22px; height: 22px; flex-shrink: 0; }
.aikf-chat-bubble-label { font-size: 14px; }

/* ==================== 聊天窗口 ==================== */
#aikf-chat-window {
	width: 420px;
	height: 600px;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 18px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	margin-bottom: 10px;
	box-shadow: 0 8px 40px rgba(0,0,0,.14), 0 2px 12px rgba(0,0,0,.06);
	transition: width .25s ease, height .25s ease, border-radius .25s ease;
}

/* 展开态：宽680px × 高780px，参考 Claude.ai 聊天窗尺寸 */
#aikf-chat-window.aikf-expanded {
	width: 680px;
	height: 780px;
	border-radius: 20px;
}

#aikf-chat-window.hidden { display: none !important; }

/* 顶部 header */
#aikf-chat-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	border-bottom: 1px solid #f1f5f9;
	flex-shrink: 0;
	background: #fff;
}

.aikf-chat-header-left {
	display: flex;
	align-items: center;
	gap: 10px;
}

/* header 右侧按钮组 */
.aikf-header-actions {
	display: flex;
	align-items: center;
	gap: 2px;
}

.aikf-bot-header-logo {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	object-fit: cover;
}

.aikf-bot-header-name {
	font-size: 14px;
	font-weight: 700;
	color: #1d1d1f;
	margin: 0;
	padding: 0;
}

/* 展开/收缩按钮和关闭按钮共用样式 */
.aikf-close-btn,
.aikf-expand-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border: none;
	background: transparent;
	cursor: pointer;
	color: #94a3b8;
	border-radius: 7px;
	transition: color .15s, background .15s;
	padding: 0;
}

.aikf-close-btn:hover,
.aikf-expand-btn:hover { color: #374151; background: #f1f5f9; }

/* 消息区域 */
.aikf-chat-container {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	background: #fafafa;
	display: flex;
	flex-direction: column;
}

/* 底部输入框 */
#aikf-chat-footer {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 16px;
	border-top: 1px solid #f3f4f6;
	background: #fff;
	flex-shrink: 0;
}

.aikf-chat-input {
	flex: 1;
	/* textarea 自动扩展：height 由 JS 动态设置，overflow-y 按需显示 */
	resize: none;
	overflow-y: hidden;
	min-height: 24px;
	max-height: 180px; /* 超过此高度显示滚动条，防止撑破聊天窗 */
	line-height: 1.5;
	border: none;
	background: transparent;
	outline: none;
	font-size: 15px;
	font-family: inherit;
	color: #374151;
	padding: 2px 0;
	display: block;
	/* 当 textarea 超过 max-height 后才启用滚动 */
	transition: height 0.1s ease;
}

.aikf-chat-input::placeholder { color: #9ca3af; }

/* 底部输入区：允许随 textarea 高度伸展 */
#aikf-chat-footer {
	display: flex;
	align-items: flex-end; /* 发送按钮始终对齐到底部 */
	gap: 8px;
	padding: 10px 16px;
	border-top: 1px solid #f3f4f6;
	background: #fff;
	flex-shrink: 0;
}

.aikf-send-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: none;
	cursor: pointer;
	flex-shrink: 0;
	transition: opacity .2s;
	box-shadow: 0 2px 6px rgba(0,0,0,.12);
}

.aikf-send-btn:hover   { opacity: .85; }
.aikf-send-btn:disabled { opacity: .35; cursor: not-allowed; }

@media (max-width: 400px) {
	#aikf-chat-window { width: calc(100vw - 24px); }
	#aikf-chatbot-widget { right: 12px; bottom: 12px; }
}

/* ==================== 消息布局（纯 CSS）==================== */
.aikf-msg-row {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	width: 100%;
	margin-bottom: 12px;
	animation: aikf-slide-in 0.2s ease;
}
.aikf-msg-row-user {
	/* 不用 row-reverse：用 justify-content 让内容靠右，DOM 顺序 [col][avatar] 自然排列 */
	justify-content: flex-end;
}
.aikf-msg-row-bot  { flex-direction: row; }

.aikf-msg-col {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	max-width: 85%;
}
.aikf-msg-row-user .aikf-msg-col { align-items: flex-end; }

.aikf-msg-avatar {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
	margin-bottom: 4px;
}

.aikf-bubble-user,
.aikf-bubble-bot {
	padding: 10px 14px;
	border-radius: 18px;
	font-size: 14px;
	line-height: 1.6;
	word-break: break-word;
	box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.aikf-bubble-user { border-top-right-radius: 4px; }
.aikf-bubble-bot  { border-top-left-radius: 4px; border: 1px solid #e5e7eb; }

/* ── 加载中气泡（三个跳动圆点，替代原来的文字省略号）── */
.aikf-typing {
	display: flex;
	align-items: center;
	gap: 5px;
	padding: 12px 16px !important;
	min-width: 64px;
}

.aikf-typing::after { content: none; } /* 关闭旧的伪元素动画 */

/* 三个圆点由 JS 插入 span.aikf-dot */
.aikf-dot {
	display: inline-block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #9ca3af;
	animation: aikf-bounce 1.3s ease-in-out infinite;
	flex-shrink: 0;
}
.aikf-dot:nth-child(1) { animation-delay: 0s;    }
.aikf-dot:nth-child(2) { animation-delay: 0.18s; }
.aikf-dot:nth-child(3) { animation-delay: 0.36s; }

@keyframes aikf-bounce {
	0%, 60%, 100% { transform: translateY(0);    opacity: .45; }
	30%            { transform: translateY(-6px); opacity: 1;   }
}
@keyframes aikf-slide-in {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ==================== 消息反馈按钮（点赞/点踩） ==================== */
.aikf-feedback-bar {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 6px;
	padding-left: 4px;
}

.aikf-fb-btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 10px;
	border-radius: 20px;
	border: 1px solid #e5e7eb;
	background: #f9fafb;
	color: #6b7280;
	font-size: 12px;
	cursor: pointer;
	transition: all 0.2s ease;
	line-height: 1;
	white-space: nowrap;
}

.aikf-fb-btn svg {
	width: 13px;
	height: 13px;
	fill: currentColor;
	flex-shrink: 0;
}

.aikf-fb-btn:hover {
	border-color: #2664eb;
	color: #2664eb;
	background: #eff4ff;
}

.aikf-fb-btn.is-active {
	border-color: #2664eb;
	background: #2664eb;
	color: #fff;
}

.aikf-fb-btn.aikf-fb-dislike.is-active {
	border-color: #ef4444;
	background: #ef4444;
	color: #fff;
}

.aikf-fb-thanks {
	font-size: 12px;
	color: #10b981;
	padding-left: 4px;
}

/* 开场问题快捷按钮（来自 Dify opening_statement.suggested_questions） */
.aikf-quick-questions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 8px 0 4px 0;
	padding-left: 38px; /* 对齐 bot 头像右侧气泡起始位置 */
}

.aikf-quick-btn {
	display: inline-flex;
	align-items: center;
	padding: 7px 14px;
	border-radius: 9999px;
	border: 1px solid #dbeafe;
	background: #eff6ff;
	color: #2664eb;
	font-size: 13px;
	cursor: pointer;
	transition: all 0.2s ease;
	white-space: nowrap;
}

.aikf-quick-btn:hover {
	border-color: #2664eb;
	background: #2664eb;
	color: #fff;
}

.aikf-quick-btn:disabled {
	cursor: not-allowed;
	opacity: 0.5;
}

/* ==================== 聊天气泡内 Markdown 排版（缩放至聊天场景合理大小）==================== */
/* 问题：marked.js 直接输出 <h1>~<h6>，浏览器默认 h1=2em≈32px，在气泡里极不协调 */
.aikf-bubble-bot h1,
.aikf-bubble-bot h2,
.aikf-bubble-bot h3,
.aikf-bubble-bot h4,
.aikf-bubble-bot h5,
.aikf-bubble-bot h6 {
	margin: 0.75em 0 0.35em;
	line-height: 1.4;
	font-weight: 700;
	color: inherit;
}
.aikf-bubble-bot h1 { font-size: 1.15em; }  /* ~16px，而非浏览器默认 32px */
.aikf-bubble-bot h2 { font-size: 1.08em; }
.aikf-bubble-bot h3 { font-size: 1.03em; }
.aikf-bubble-bot h4,
.aikf-bubble-bot h5,
.aikf-bubble-bot h6 { font-size: 1em; }

.aikf-bubble-bot p       { margin: 0.4em 0; line-height: 1.65; }
.aikf-bubble-bot ul,
.aikf-bubble-bot ol      { margin: 0.4em 0; padding-left: 1.4em; }
.aikf-bubble-bot li      { margin: 0.2em 0; line-height: 1.6; }
.aikf-bubble-bot pre     { background: #f6f8fa; border-radius: 8px; padding: 12px 14px; overflow-x: auto; margin: 0.6em 0; }
.aikf-bubble-bot code    { font-family: 'SFMono-Regular', Consolas, monospace; font-size: 0.88em; background: #f1f5f9; padding: 1px 5px; border-radius: 4px; }
.aikf-bubble-bot pre code { background: none; padding: 0; font-size: 0.87em; }
.aikf-bubble-bot blockquote { border-left: 3px solid #cbd5e1; margin: 0.5em 0; padding: 4px 12px; color: #64748b; }
.aikf-bubble-bot hr      { border: none; border-top: 1px solid #e2e8f0; margin: 0.8em 0; }
.aikf-bubble-bot table   { border-collapse: collapse; font-size: 0.9em; margin: 0.5em 0; width: 100%; }
.aikf-bubble-bot th,
.aikf-bubble-bot td      { border: 1px solid #e2e8f0; padding: 5px 10px; text-align: left; }
.aikf-bubble-bot th      { background: #f8fafc; font-weight: 600; }
.aikf-bubble-bot a       { color: #2664eb; text-decoration: none; }
.aikf-bubble-bot a:hover { text-decoration: underline; }

/* 展开态适配 */
#aikf-chat-window.aikf-expanded .aikf-bubble-bot { font-size: 14.5px; }

/* 手机端聊天窗满屏处理 */
@media (max-width: 460px) {
	#aikf-chat-window,
	#aikf-chat-window.aikf-expanded {
		position: fixed !important;
		bottom: 0 !important;
		right: 0 !important;
		left: 0 !important;
		width: 100vw !important;
		height: 92dvh !important;
		border-radius: 20px 20px 0 0 !important;
		margin-bottom: 0 !important;
	}
	#aikf-chatbot-widget {
		position: fixed;
		right: 0 !important;
		bottom: 0 !important;
	}
}
