#hklhai-root {
	--hklhai-color: #1e88e5;
	--hklhai-text: #1f2933;
	--hklhai-muted: #6b7785;
	--hklhai-bg: #f5f7fa;
	font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
	font-size: 14px;
	line-height: 1.6;
	color: var(--hklhai-text);
}
#hklhai-root *, #hklhai-root *::before, #hklhai-root *::after { box-sizing: border-box; }
#hklhai-root button { font-family: inherit; cursor: pointer; }
#hklhai-root [hidden] { display: none !important; }

/* 悬浮图标 */
#hklhai-root .hklhai-dock {
	position: fixed; z-index: 99990; width: 58px; height: 58px;
	touch-action: none; user-select: none; -webkit-user-select: none;
	transition: transform .3s ease, opacity .3s ease, left .25s ease, top .25s ease;
}
#hklhai-root .hklhai-dock.hklhai-dragging { transition: none; }
#hklhai-root .hklhai-launcher {
	width: 58px; height: 58px; border-radius: 50%; padding: 0; overflow: hidden; margin: 0;
	border: 3px solid #fff; background: #e3f2fd;
	box-shadow: 0 6px 20px rgba(0,0,0,.2);
	display: block; cursor: grab; transition: transform .15s ease; min-width: 0; min-height: 0; line-height: 0;
	animation: hklhai-float 3.2s ease-in-out infinite;
}
#hklhai-root .hklhai-launcher:hover { transform: scale(1.06); animation-play-state: paused; }
#hklhai-root .hklhai-launcher img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; -webkit-user-drag: none; }
#hklhai-root .hklhai-dragging .hklhai-launcher { cursor: grabbing; transform: scale(1.06); }
#hklhai-root .hklhai-dragging .hklhai-launcher, #hklhai-root .hklhai-tucked .hklhai-launcher { animation: none; }
@keyframes hklhai-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -4px; } }

/* 提示气泡 */
#hklhai-root .hklhai-hint {
	position: absolute; top: 50%; transform: translateY(-50%);
	white-space: nowrap; background: #fff; color: var(--hklhai-text);
	font-size: 13px; padding: 7px 12px; border-radius: 16px; cursor: pointer;
	box-shadow: 0 4px 16px rgba(0,0,0,.15);
	animation: hklhai-pop .25s ease-out;
}
#hklhai-root .hklhai-dock[data-side="right"] .hklhai-hint { right: 68px; }
#hklhai-root .hklhai-dock[data-side="left"] .hklhai-hint { left: 68px; }
@keyframes hklhai-pop { from { opacity: 0; } to { opacity: 1; } }

#hklhai-root .hklhai-hide {
	position: absolute; top: -4px; width: 20px; height: 20px; padding: 0; margin: 0; min-width: 0; min-height: 0;
	border-radius: 50%; border: 1px solid #d5dbe1; background: #fff; color: #6b7785;
	font-size: 14px; line-height: 18px; text-align: center;
	box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
#hklhai-root .hklhai-dock[data-side="right"] .hklhai-hide { left: -4px; }
#hklhai-root .hklhai-dock[data-side="left"] .hklhai-hide { right: -4px; }
#hklhai-root .hklhai-hide:hover { color: #1f2933; }
#hklhai-root .hklhai-tucked .hklhai-hide, #hklhai-root .hklhai-dragging .hklhai-hide { display: none; }

/* 收起后的边缘小标签 */
#hklhai-root .hklhai-tab {
	position: fixed; z-index: 99990; width: 42px; height: 48px; padding: 4px; border: 0;
	background: var(--hklhai-color); opacity: .9; overflow: hidden;
	display: flex; align-items: center; justify-content: center;
	box-shadow: 0 2px 10px rgba(0,0,0,.15);
}
#hklhai-root .hklhai-tab:hover { opacity: 1; }
#hklhai-root .hklhai-tab[data-side="right"] { right: 0; border-radius: 24px 0 0 24px; justify-content: flex-start; }
#hklhai-root .hklhai-tab[data-side="left"] { left: 0; border-radius: 0 24px 24px 0; justify-content: flex-end; }
#hklhai-root .hklhai-tab img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #e3f2fd; flex: none; }

/* 聊天窗口 */
#hklhai-root .hklhai-panel {
	position: fixed; z-index: 99991;
	width: 370px; height: min(600px, calc(100vh - 40px));
	background: #fff; border-radius: 16px; overflow: hidden;
	box-shadow: 0 12px 40px rgba(0,0,0,.18);
	display: flex; flex-direction: column;
}
#hklhai-root .hklhai-head {
	background: var(--hklhai-color); color: #fff;
	padding: 14px 16px; display: flex; align-items: center; gap: 10px;
	cursor: move; touch-action: none; user-select: none; -webkit-user-select: none;
}
#hklhai-root .hklhai-head.hklhai-moving { cursor: grabbing; }
#hklhai-root .hklhai-avatar {
	width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex: none;
	border: 2px solid rgba(255,255,255,.8); background: #e3f2fd;
}
#hklhai-root .hklhai-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
#hklhai-root .hklhai-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#hklhai-root .hklhai-title strong { font-size: 16px; line-height: 1.3; }
#hklhai-root .hklhai-title span { font-size: 12px; opacity: .9; display: flex; align-items: center; gap: 5px; }
#hklhai-root .hklhai-title i { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; display: inline-block; }
#hklhai-root .hklhai-close {
	background: transparent; border: 0; color: #fff; font-size: 26px; line-height: 1;
	width: 32px; height: 32px; border-radius: 8px; padding: 0;
}
#hklhai-root .hklhai-close:hover { background: rgba(255,255,255,.15); }

#hklhai-root .hklhai-bar { display: flex; gap: 8px; padding: 8px 12px; border-bottom: 1px solid #edf0f3; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
#hklhai-root .hklhai-bar .hklhai-chip { white-space: nowrap; flex: none; }

#hklhai-root .hklhai-chip {
	border: 1px solid color-mix(in srgb, var(--hklhai-color) 35%, #fff);
	background: color-mix(in srgb, var(--hklhai-color) 7%, #fff);
	color: var(--hklhai-color);
	border-radius: 999px; padding: 4px 12px; font-size: 13px; line-height: 1.5;
}
#hklhai-root .hklhai-chip:hover { background: color-mix(in srgb, var(--hklhai-color) 14%, #fff); }
#hklhai-root .hklhai-chip-main { background: var(--hklhai-color); color: #fff; border-color: var(--hklhai-color); }
#hklhai-root .hklhai-chip-main:hover { background: var(--hklhai-color); filter: brightness(1.08); }

#hklhai-root .hklhai-body { flex: 1; overflow-y: auto; padding: 14px 12px; background: var(--hklhai-bg); overscroll-behavior: contain; }

#hklhai-root .hklhai-msg { display: flex; margin: 0 0 10px; }
#hklhai-root .hklhai-user { justify-content: flex-end; }
#hklhai-root .hklhai-bubble {
	max-width: 86%; padding: 9px 12px; border-radius: 14px; word-break: break-word;
	background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
#hklhai-root .hklhai-user .hklhai-bubble { background: var(--hklhai-color); color: #fff; border-bottom-right-radius: 4px; }
#hklhai-root .hklhai-assistant .hklhai-bubble { border-bottom-left-radius: 4px; }
#hklhai-root .hklhai-bubble p { margin: 0; }
#hklhai-root .hklhai-bubble ul { margin: 2px 0; padding-left: 18px; }
#hklhai-root .hklhai-bubble li { margin: 1px 0; }
#hklhai-root .hklhai-gap { height: 6px; }

#hklhai-root .hklhai-quickbar {
	display: flex; gap: 6px; padding: 8px 12px 0; background: #fff; border-top: 1px solid #edf0f3;
	overflow-x: auto; scrollbar-width: thin; flex: none;
}
#hklhai-root .hklhai-quickbar .hklhai-chip { white-space: nowrap; flex: none; font-size: 12.5px; padding: 3px 10px; }

#hklhai-root .hklhai-typing { display: flex; gap: 4px; align-items: center; padding: 12px 14px; }
#hklhai-root .hklhai-typing span { width: 6px; height: 6px; border-radius: 50%; background: #9aa5b1; animation: hklhai-dot 1.2s infinite ease-in-out; }
#hklhai-root .hklhai-typing span:nth-child(2) { animation-delay: .15s; }
#hklhai-root .hklhai-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes hklhai-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

#hklhai-root .hklhai-card {
	width: 100%; background: #fff; border-radius: 12px; padding: 12px;
	border: 1px solid color-mix(in srgb, var(--hklhai-color) 25%, #fff);
	display: flex; flex-direction: column; gap: 8px; margin: 0 0 10px;
}
#hklhai-root .hklhai-card strong { font-size: 14px; }
#hklhai-root .hklhai-card p { margin: 0; color: var(--hklhai-muted); font-size: 13px; }
#hklhai-root .hklhai-card small { color: var(--hklhai-muted); font-size: 12px; }
#hklhai-root .hklhai-card input, #hklhai-root .hklhai-card textarea {
	width: 100%; border: 1px solid #d5dbe1; border-radius: 8px; padding: 8px 10px;
	font: inherit; font-size: 14px; color: var(--hklhai-text); background: #fff; resize: vertical;
}
#hklhai-root .hklhai-card input:focus, #hklhai-root .hklhai-card textarea:focus { outline: 2px solid color-mix(in srgb, var(--hklhai-color) 40%, #fff); border-color: var(--hklhai-color); }
#hklhai-root .hklhai-card .hklhai-check { display: flex; align-items: center; gap: 6px; font-size: 13px; }
#hklhai-root .hklhai-card .hklhai-check input { width: auto; }
#hklhai-root .hklhai-card button[type=submit] {
	border: 0; border-radius: 8px; padding: 9px; background: var(--hklhai-color); color: #fff; font-size: 14px;
}
#hklhai-root .hklhai-card button[disabled] { opacity: .6; cursor: default; }
#hklhai-root .hklhai-hp { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; }
#hklhai-root .hklhai-wx { align-items: center; text-align: center; }
#hklhai-root .hklhai-links { display: flex; flex-wrap: wrap; gap: 6px; }
#hklhai-root .hklhai-links a {
	border: 1px solid color-mix(in srgb, var(--hklhai-color) 35%, #fff); color: var(--hklhai-color);
	border-radius: 999px; padding: 3px 12px; font-size: 13px; text-decoration: none;
}
#hklhai-root .hklhai-links a:hover { background: color-mix(in srgb, var(--hklhai-color) 8%, #fff); }
#hklhai-root .hklhai-wx img { width: 160px; height: auto; border-radius: 6px; }

#hklhai-root .hklhai-foot { display: flex; gap: 8px; padding: 8px 12px 10px; border-top: 0; background: #fff; align-items: flex-end; margin: 0; }
#hklhai-root .hklhai-foot textarea {
	flex: 1; border: 1px solid #d5dbe1; border-radius: 20px; padding: 9px 14px;
	font: inherit; font-size: 14px; resize: none; max-height: 110px; color: var(--hklhai-text); background: #fff;
}
#hklhai-root .hklhai-foot textarea:focus { outline: none; border-color: var(--hklhai-color); }
#hklhai-root .hklhai-send {
	width: 40px; height: 40px; border-radius: 50%; border: 0; flex: none; padding: 0;
	background: var(--hklhai-color); color: #fff; display: flex; align-items: center; justify-content: center;
}
#hklhai-root .hklhai-send svg { width: 18px; height: 18px; }
#hklhai-root .hklhai-send[disabled] { opacity: .5; cursor: default; }

@media (max-width: 480px) {
	#hklhai-root.hklhai-open .hklhai-dock, #hklhai-root.hklhai-open .hklhai-tab { display: none !important; }
	#hklhai-root .hklhai-panel { left: 0 !important; top: 0 !important; width: 100%; height: 100%; border-radius: 0; }
	#hklhai-root .hklhai-head { cursor: default; }
	#hklhai-root .hklhai-foot textarea { font-size: 16px; } /* 防止 iOS 自动放大 */
}

@media (prefers-reduced-motion: reduce) {
	#hklhai-root .hklhai-typing span { animation: none; }
	#hklhai-root .hklhai-launcher, #hklhai-root .hklhai-dock { transition: none; animation: none; }
}
