/* ============================================================
   ZIYES AI 对话助手（v6.5.4）
   收起态：底部悬浮圆角搜索条（开始体验大模型 / 有什么问题都可以问我 + 黑色纸飞机）
   hover / 聚焦：工具栏展开（文件 / 图片 / 语音 + 主力模型下拉）
   发送后：输入条上方展开对话记录。
   视觉：极简黑白、发丝线边框、大圆角、克制阴影。
   ============================================================ */
.zc-chat {
	--zc-ink: #2b2b2c;
	--zc-line: #e4e4e0;
	--zc-paper: #ffffff;
	--zc-soft: #f6f6f3;
	--zc-muted: #9a9a94;
	--zc-radius: 16px;
	position: fixed;
	left: 50%;
	bottom: 30px;
	transform: translateX(-50%);
	width: min(760px, calc(100vw - 40px));
	z-index: 260;
	font-family: inherit;
}
.zc-chat[hidden] { display: none; }
/* v6.4.9：展开对话后整块切成深灰底白字，与页面浅色内容区隔（双端一致）。
   仅覆盖变量 + 少数需单独指定的表面色，收起态仍是原来的浅色悬浮条。 */
.zc-chat.is-open {
	--zc-ink: #f4f4f2;        /* 展开态主文字=白 */
	--zc-line: #44444a;       /* 深灰描边 */
	--zc-paper: #2b2b30;      /* 深灰面板 */
	--zc-soft: #38383f;       /* 深灰按钮底 */
	--zc-muted: #8c8c96;      /* 暗场占位色 */
}

/* ---------- 收起态/展开态共用的输入条 ---------- */
.zc-composer {
	background: var(--zc-paper);
	border: 1px solid var(--zc-line);
	border-radius: var(--zc-radius);
	box-shadow: 0 6px 28px rgba(30,30,30,.08);
	padding: 10px 12px 10px 22px;
	transition: box-shadow .3s var(--ease, ease), transform .3s var(--ease, ease);
}
.zc-chat:hover .zc-composer,
.zc-chat:focus-within .zc-composer,
.zc-chat.is-open .zc-composer {
	box-shadow: 0 12px 40px rgba(30,30,30,.16);
	transform: translateY(-2px);
}

.zc-input-row { display: flex; align-items: center; gap: 14px; min-height: 44px; }
/* v6.4.5 标题再加粗一号（600→800）+ 每 1 秒换一色（六色 step-end，6s 循环） */
@keyframes zcTitleFlash {
	0%      { color: #2b2b2c; }
	16.667% { color: #d6006c; }
	33.333% { color: #7028c8; }
	50%     { color: #0a53d8; }
	66.667% { color: #00877a; }
	83.333% { color: #c77b00; }
	100%    { color: #2b2b2c; }
}
/* v6.5.0：标题不再带「小箭头下拉」入口（用户反馈比三个点更难用）。
   手机端点对话区域任意处即自动展开全部功能；标题仅作标题与闪烁提示。 */
/* v6.6.4：桌面端标题与输入框占位统一到 18px（前后一样大），配合 input-row 的 align-items:center 上下居中 */
.zc-composer__title {
	display: inline-block; flex: 0 0 auto;
	font-family: inherit; font-size: 18px; font-weight: 800; letter-spacing: .02em;
	color: var(--zc-ink); white-space: nowrap; cursor: pointer;
	animation: zcTitleFlash 6s step-end infinite;
}
@media (prefers-reduced-motion: reduce) {
	.zc-composer__title { animation: none; color: var(--zc-ink); }
}
.zc-input {
	flex: 1 1 auto; resize: none; max-height: 140px; min-height: 24px;
	border: 0; background: transparent; padding: 8px 0; margin: 0;
	font-family: inherit; font-size: 18px; line-height: 1.5; color: var(--zc-ink);
}
.zc-input::placeholder { color: var(--zc-muted); }
.zc-input:focus { outline: none; }
/* v6.5.4：隐藏输入框 textarea 自身的原生滚动条。
   输入内容超过 max-height 时，浏览器会在绿框右侧冒出一条白底+上下三角箭头的原生条，
   紧贴绿色发送按钮、极其突兀（用户反馈的"问题框右边上下箭头模块"）。输入框内容会
   自动增高，正常输入不会触及；即便偶尔超出也可用方向键查看，故直接隐藏该滚动条。 */
.zc-input { scrollbar-width: none; -ms-overflow-style: none; }
.zc-input::-webkit-scrollbar { width: 0 !important; height: 0 !important; display: none !important; }
.zc-send {
	flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; border: 0;
	background: var(--zc-ink); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
	transition: opacity .2s ease, transform .2s ease;
}
.zc-send:hover { transform: scale(1.04); }
.zc-send:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.zc-send.is-loading svg { animation: zcSpin 1.1s linear infinite; }

/* ---------- 工具栏：hover/聚焦/有对话时展开 ---------- */
.zc-toolbar {
	display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
	max-height: 0; opacity: 0; overflow: hidden; margin-top: 0;
	transition: max-height .32s var(--ease, ease), opacity .28s ease, margin-top .32s var(--ease, ease), padding-top .32s ease;
	padding-top: 0;
}
.zc-chat:hover .zc-toolbar,
.zc-chat:focus-within .zc-toolbar,
.zc-chat.is-open .zc-toolbar {
	max-height: 80px; opacity: 1; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--zc-line);
	/* v6.4.5：展开时放开裁剪，否则自定义模型下拉（绝对定位）会被 overflow:hidden 切掉 */
	overflow: visible;
}
.zc-toolbar__left { display: flex; gap: 8px; }
.zc-tool {
	display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px;
	border: 1px solid var(--zc-line); border-radius: 8px; background: var(--zc-soft); color: #555;
	font-size: 12px; cursor: pointer;
}
.zc-tool:hover { background: #efeFec; color: var(--zc-ink); }
.zc-tool.is-active { background: var(--zc-ink); color: #fff; border-color: var(--zc-ink); }
.zc-model { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: #777; }
.zc-model > span:first-child { white-space: nowrap; }
/* v6.4.5 自定义模型下拉：原生 select 会被 .zc-toolbar 的 overflow:hidden 裁剪，
   只能露出前几行、无法滚动选全部；改用可滚动面板，完整展示所有模型。 */
.zc-model-select { position: relative; display: inline-block; }
.zc-model-select__btn {
	display: inline-flex; align-items: center; justify-content: space-between; gap: 12px;
	min-width: 200px; max-width: 260px; padding: 6px 10px;
	border: 1px solid var(--zc-line); border-radius: 8px;
	background: #fff; color: var(--zc-ink); font-size: 12px; font-family: inherit; cursor: pointer;
}
.zc-model-select__btn.is-open { border-color: #9a9a94; }
.zc-model-select__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zc-model-select__caret {
	flex: 0 0 auto; width: 7px; height: 7px; border-right: 1.5px solid #777; border-bottom: 1.5px solid #777;
	transform: rotate(45deg) translateY(-2px); transition: transform .2s ease;
}
.zc-model-select__btn.is-open .zc-model-select__caret { transform: rotate(225deg) translateY(-2px); }
.zc-model-select__menu {
	position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 300;
	display: block; width: 100%; max-width: 260px; min-width: 200px;
	max-height: 260px; overflow-y: auto; overscroll-behavior: contain;
	background: #fff; border: 1px solid var(--zc-line); border-radius: 10px;
	box-shadow: 0 12px 34px rgba(30,30,30,.16); padding: 6px;
}
.zc-model-select__menu[hidden] { display: none; }
.zc-model-opt {
	display: block; padding: 8px 10px; border-radius: 6px; cursor: pointer;
	font-size: 12px; line-height: 1.35; color: var(--zc-ink); white-space: normal;
}
.zc-model-opt:hover { background: var(--zc-soft); }
.zc-model-opt.is-selected { background: var(--zc-ink); color: #fff; }
.zc-model-opt.is-off { color: #b8b8b3; cursor: not-allowed; background: transparent; }
.zc-model-opt.is-off:hover { background: #fafafa; }
.zc-model-wrap { display: inline-flex; align-items: center; gap: 8px; }
.zc-model__status { font-size: 11px; color: #3f9e6a; white-space: nowrap; }
.zc-model__status.is-checking { color: #9a9a94; }
.zc-model__status.is-warn { color: #c77b00; }
.zc-model__refresh {
	width: 24px; height: 24px; border: 1px solid var(--zc-line); border-radius: 7px;
	background: #fff; color: #777; cursor: pointer; font-size: 15px; line-height: 1;
	display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.zc-model__refresh:hover { background: var(--zc-soft); color: var(--zc-ink); }
.zc-model__refresh.is-loading { animation: zcSpin .8s linear infinite; }
@keyframes zcSpin { to { transform: rotate(360deg); } }

/* ---------- 拖拽边条：调整对话窗口高度 ---------- */
.zc-resizer {
	height: 16px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
	cursor: ns-resize; touch-action: none; background: var(--zc-paper);
	border-radius: var(--zc-radius) var(--zc-radius) 0 0;
}
.zc-resizer__grip {
	width: 40px; height: 4px; border-radius: 3px; background: #d8d8d3;
	transition: background .2s ease, width .2s ease;
}
.zc-resizer:hover .zc-resizer__grip,
.zc-chat.is-resizing .zc-resizer__grip { background: #9a9a94; width: 56px; }
.zc-chat.is-resizing .zc-history { transition: none; }
.zc-chat.is-resizing { user-select: none; }

/* ---------- 对话记录（展开在输入条上方） ---------- */
.zc-history {
	position: relative; /* v6.5.2：自定义滚动条相对本容器定位 */
	background: var(--zc-paper);
	border: 1px solid var(--zc-line);
	border-bottom: 0;
	border-radius: var(--zc-radius) var(--zc-radius) 0 0;
	box-shadow: 0 -2px 24px rgba(30,30,30,.06);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	max-height: min(60vh, 520px);
	margin-bottom: -1px; /* 与输入条边框贴合 */
}
.zc-history[hidden] { display: none; }
.zc-chat.is-open .zc-composer {
	border-radius: 0 0 var(--zc-radius) var(--zc-radius);
	border-top-color: var(--zc-line);
}
.zc-history__head {
	position: relative; display: flex; align-items: center; justify-content: center;
	padding: 14px 18px; border-bottom: 1px solid var(--zc-line);
}
.zc-history__brand { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--zc-ink); letter-spacing: .04em; }
.zc-history__brand strong { font-weight: 700; letter-spacing: .12em; }
/* v6.5.9：ZIYES 矢量字标主标识 + 绿色 AI智能体 副标题；两者再收紧成一个整体，工具按钮放大且保持右侧角落上下居中 */
.zc-history__brand-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 0; }
.zc-history__brand-logo { display: block; width: auto; height: 32px; max-width: 122px; object-fit: contain; margin-bottom: -7px; }
.zc-history__brand-text { white-space: nowrap; font-size: 13px; line-height: 1; color: #4ec98f; letter-spacing: .14em; }
.zc-history__dot { width: 10px; height: 10px; flex: 0 0 10px; align-self: flex-start; margin-top: 11px; border-radius: 50%; background: #3f9e6a; box-shadow: 0 0 0 3px rgba(63,158,106,.16); }
.zc-history__tools { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); display: flex; gap: 8px; }
.zc-history__new, .zc-history__close {
	width: 34px; height: 34px; border: 1px solid var(--zc-line); background: #fff; color: var(--zc-ink);
	border-radius: 8px; cursor: pointer; font-size: 18px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.zc-history__new:hover, .zc-history__close:hover { background: var(--zc-soft); }

.zc-history__body { flex: 1 1 auto; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; background: #fcfcfa; }
.zc-msg { display: flex; gap: 10px; max-width: 88%; }
.zc-msg--ai { align-self: flex-start; }
.zc-msg--user { align-self: flex-end; flex-direction: row-reverse; }
.zc-msg__bubble {
	padding: 11px 15px; border-radius: 13px; font-size: 14px; line-height: 1.8;
	white-space: pre-wrap; word-break: break-word;
}
.zc-msg--ai .zc-msg__bubble { background: #fff; border: 1px solid var(--zc-line); color: #333; border-top-left-radius: 4px; }
.zc-msg--user .zc-msg__bubble { background: var(--zc-ink); color: #fff; border-top-right-radius: 4px; }
.zc-msg--hello .zc-msg__bubble { color: #555; }
.zc-msg__bubble strong { font-weight: 700; }
.zc-msg__bubble code { background: rgba(0,0,0,.05); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.zc-msg--user .zc-msg__bubble code { background: rgba(255,255,255,.2); }
.zc-caret { display: inline-block; width: 6px; height: 15px; background: currentColor; vertical-align: -2px; margin-left: 2px; animation: zcBlink 1s steps(2) infinite; }
@keyframes zcBlink { 0%,50% { opacity: 1; } 51%,100% { opacity: 0; } }
/* ---------- 等待模型回复：思考中反馈（避免用户误以为断网退出） ---------- */
.zc-msg__bubble--thinking { min-width: 132px; }
.zc-thinking { display: inline-flex; align-items: center; gap: 10px; color: #6f6f69; font-size: 13px; line-height: 1.5; }
.zc-thinking__dots { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.zc-thinking__dots i {
	width: 6px; height: 6px; border-radius: 50%; background: #9a9a94;
	animation: zcThinkBounce 1.25s infinite ease-in-out;
}
.zc-thinking__dots i:nth-child(2) { animation-delay: .16s; }
.zc-thinking__dots i:nth-child(3) { animation-delay: .32s; }
.zc-thinking__text { white-space: nowrap; }
@keyframes zcThinkBounce { 0%,60%,100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-5px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .zc-thinking__dots i { animation: none; opacity: .8; } }
.zc-attach-thumb { max-width: 180px; max-height: 120px; border-radius: 8px; display: block; margin-top: 8px; }

/* ---------- 已选附件 ---------- */
.zc-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.zc-attachments[hidden] { display: none; }
.zc-attachment {
	position: relative; display: flex; align-items: center; gap: 6px;
	background: var(--zc-soft); border: 1px solid var(--zc-line); border-radius: 8px;
	padding: 4px 8px; font-size: 12px; color: #444; max-width: 220px;
}
.zc-attachment img { width: 34px; height: 34px; object-fit: cover; border-radius: 5px; }
.zc-attachment__x { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; background: var(--zc-ink); color: #fff; border: 0; font-size: 12px; line-height: 18px; text-align: center; cursor: pointer; }
.zc-attachment__name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ---------- 移动端 ---------- */
@media (max-width: 640px) {
	/* v6.4.5：悬浮条抬到底部 tabbar（请进/家居/焕新案例/菜单）之上，避免遮挡导航。
	   tabbar 高 = --tabbar-h(58/62px) + safe-bottom，再留 12px 间隙。 */
	/* v6.6.3：略加宽对话条（左右留白 10px→6px），配合下方内边距收紧，
	   为放大后的 20px 标题腾出空间，使 16px 占位文字仍能单行完整显示。 */
	.zc-chat { width: calc(100vw - 12px); bottom: calc(var(--tabbar-h, 58px) + env(safe-area-inset-bottom, 0px) + 12px); }
	.zc-history { max-height: 62vh; }
	.zc-composer { padding: 8px 8px; }
	/* v6.4.7：手机端聚焦/悬停不再改变输入条的位置与阴影，避免打字时的视觉跳变 */
	.zc-chat:hover .zc-composer,
	.zc-chat:focus-within .zc-composer,
	.zc-chat.is-open .zc-composer { transform: none; box-shadow: 0 6px 28px rgba(30,30,30,.08); }
	.zc-input-row { gap: 6px; }
	/* v6.6.5：手机端前后统一为 16px——标题与占位文字一样大（用户要求）。
	   16px 同时也是 iOS Safari 不自动放大整页的安全阈值，勿调小。 */
	.zc-composer__title { font-size: 16px; }
	/* 关键：iOS Safari 会对 font-size < 16px 的输入框自动放大整页，
	   导致"一点输入框整页就变大、标题被裁"。16px 可彻底规避，勿调小。 */
	.zc-input { font-size: 16px; }
	.zc-history__body { padding: 14px; }
	.zc-msg { max-width: 94%; }
	/* v6.5.9：手机端标题栏两个按钮放大到 44px 触控目标，间距加到 10px；仍由 tools 的 translateY(-50%) 保持垂直居中 */
	.zc-history__tools { right: 18px; gap: 10px; }
	.zc-history__new, .zc-history__close { width: 40px; height: 40px; font-size: 21px; border-radius: 10px; }
	/* v6.5.9：手机端工具栏「文件 / 图片 / 语音」三按钮加大到 44px 高触控目标，间距 8px */
	.zc-toolbar__left { gap: 8px; }
	.zc-tool { min-height: 44px; min-width: 46px; padding: 8px 10px; font-size: 13px; justify-content: center; }
	/* v6.5.0：手机端改为「手指点对话区域即自动展开全部功能」——
	   点输入条任意处（用 JS 的 touchstart/click 加 is-tools-open）展开工具栏，
	   不再用小箭头下拉。桌面端仍由 :hover 自动展开（见上方通用规则）。
	   未展开时工具栏默认收起。 */
	.zc-chat .zc-toolbar,
	.zc-chat:hover .zc-toolbar,
	.zc-chat:focus-within .zc-toolbar,
	.zc-chat.is-open .zc-toolbar {
		max-height: 0; opacity: 0; margin-top: 0; padding-top: 0;
		border-top-color: transparent; overflow: hidden;
	}
	.zc-chat.is-tools-open .zc-toolbar {
		max-height: 240px; opacity: 1; margin-top: 10px; padding-top: 12px;
		border-top: 1px solid var(--zc-line); overflow: visible;
	}
	.zc-chat.is-tools-open .zc-history { max-height: 48vh; }
	.zc-toolbar { justify-content: flex-start; }
	.zc-model { width: 100%; justify-content: space-between; gap: 6px; }
	.zc-model__status { font-size: 10px; }
	.zc-model-select__btn { min-width: 0; max-width: 52vw; }
	.zc-model-select__menu { min-width: 0; max-width: 52vw; right: 0; left: auto; }
	.zc-tool span { display: none; }
	/* 软键盘弹起时压缩历史区，让「输入条 + 键盘」完整可见（配合 JS 平移） */
	.zc-chat.is-keyboard .zc-history { max-height: 34vh; }
}

/* ============================================================
   v6.4.9 展开态深灰底白字：单独指定硬编码的浅色表面
   ============================================================ */
/* 标题闪烁动画在深底上首/末帧改为白色，避免黑字看不见 */
@keyframes zcTitleFlashDark {
	0%      { color: #f4f4f2; }
	16.667% { color: #ff5fa2; }
	33.333% { color: #b48cff; }
	50%     { color: #5aa9ff; }
	66.667% { color: #3dd6c0; }
	83.333% { color: #ffc65c; }
	100%    { color: #f4f4f2; }
}
.zc-chat.is-open .zc-composer__title { animation-name: zcTitleFlashDark; }
@media (prefers-reduced-motion: reduce) {
	.zc-chat.is-open .zc-composer__title { animation: none; color: #f4f4f2; }
}
/* 输入条、历史区、拖拽条 */
.zc-chat.is-open .zc-composer,
.zc-chat.is-open .zc-history { background: var(--zc-paper); border-color: var(--zc-line); }
.zc-chat.is-open .zc-history__body { background: #25252a; }
.zc-chat.is-open .zc-resizer { background: var(--zc-paper); }
.zc-chat.is-open .zc-resizer__grip { background: #5a5a64; }
.zc-chat.is-open .zc-composer { box-shadow: 0 12px 40px rgba(0,0,0,.4); }
.zc-chat.is-open .zc-history { box-shadow: 0 -2px 24px rgba(0,0,0,.3); }
/* 历史头部按钮 */
.zc-chat.is-open .zc-history__head { border-bottom-color: var(--zc-line); }
.zc-chat.is-open .zc-history__new,
.zc-chat.is-open .zc-history__close { background: var(--zc-soft); color: var(--zc-ink); border-color: var(--zc-line); }
.zc-chat.is-open .zc-history__new:hover,
.zc-chat.is-open .zc-history__close:hover { background: #484851; }
/* 气泡：AI=深灰卡白字，用户=白底深字（反色突出） */
.zc-chat.is-open .zc-msg--ai .zc-msg__bubble {
	background: #35353d; border-color: #45454f; color: #ededf0;
}
.zc-chat.is-open .zc-msg--hello .zc-msg__bubble { color: #cfcfd6; }
.zc-chat.is-open .zc-msg--user .zc-msg__bubble { background: #f4f4f2; color: #242428; }
.zc-chat.is-open .zc-msg__bubble code { background: rgba(255,255,255,.1); }
.zc-chat.is-open .zc-msg--user .zc-msg__bubble code { background: rgba(0,0,0,.08); }
/* 思考中提示 */
.zc-chat.is-open .zc-thinking { color: #c4c4cd; }
.zc-chat.is-open .zc-thinking__dots i { background: #9a9aa6; }
/* 工具栏与工具按钮 */
.zc-chat.is-open .zc-toolbar { border-top-color: var(--zc-line); }
.zc-chat.is-open .zc-tool {
	background: var(--zc-soft); color: #d6d6dd; border-color: var(--zc-line);
}
.zc-chat.is-open .zc-tool:hover { background: #484851; color: #fff; }
.zc-chat.is-open .zc-tool.is-active { background: #f4f4f2; color: #242428; border-color: #f4f4f2; }
/* 语音录音中：红色描边呼吸提示 */
.zc-chat.is-open .zc-tool.is-active[data-zc-voice] {
	background: #7a2334; color: #fff; border-color: #c04a60;
	animation: zcRecPulse 1.1s ease-in-out infinite;
}
@keyframes zcRecPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(192,74,96,.5); } 50% { box-shadow: 0 0 0 5px rgba(192,74,96,0); } }
.zc-tool.is-unsupported { opacity: .45; cursor: not-allowed; }
/* 模型下拉：按钮 / 面板 / 选项 */
.zc-chat.is-open .zc-model-select__btn {
	background: var(--zc-soft); color: var(--zc-ink); border-color: var(--zc-line);
}
.zc-chat.is-open .zc-model-select__btn.is-open { border-color: #8c8c96; }
.zc-chat.is-open .zc-model-select__caret { border-color: #c4c4cd; }
.zc-chat.is-open .zc-model-select__menu {
	background: #32323a; border-color: #4a4a54; box-shadow: 0 12px 34px rgba(0,0,0,.5);
}
.zc-chat.is-open .zc-model-opt { color: #eaeaf0; }
.zc-chat.is-open .zc-model-opt:hover { background: #43434d; }
.zc-chat.is-open .zc-model-opt.is-selected { background: #f4f4f2; color: #242428; }
.zc-chat.is-open .zc-model-opt.is-off { color: #7a7a86; }
.zc-chat.is-open .zc-model-opt.is-off:hover { background: transparent; }
.zc-chat.is-open .zc-model { color: #b9b9c2; }
.zc-chat.is-open .zc-model__refresh { background: var(--zc-soft); color: #c4c4cd; border-color: var(--zc-line); }
.zc-chat.is-open .zc-model__refresh:hover { background: #484851; color: #fff; }
/* 附件 chip */
.zc-chat.is-open .zc-attachment { background: var(--zc-soft); color: #d6d6dd; border-color: var(--zc-line); }
/* v6.5.0：深色态发送按钮改绿底白箭头，避免白底(#f4f4f2)+白箭头看不清。
   收起态仍是原来的黑底白箭头，仅展开(对话)态变绿。绿色取克制而醒目的品牌绿。 */
.zc-chat.is-open .zc-send { background: #1fae6a; color: #fff; }
.zc-chat.is-open .zc-send:hover { background: #199a5d; }
.zc-chat.is-open .zc-send:disabled { background: #1fae6a; color: #fff; opacity: .45; }
/* v6.5.2：展开态输入条顶部一条清晰白色实线，与上方对话内容区隔（用户要求"白线"）。
   桌面端与手机端一致；收起态仍用原来的发丝线。 */
.zc-chat.is-open .zc-composer { border-top: 1px solid rgba(255,255,255,.72) !important; }

/* v6.5.3：深色对话态输入框视觉增强——回复后输入框要一眼可辨、光标清晰。
   之前输入框透明无边框、占位符暗灰(#8c8c96)，在深灰底上几乎看不见光标与输入位置。
   现在给输入框一个淡淡的可视容器 + 高对比占位符 + 品牌绿光标，聚焦时边框点亮。 */
/* v6.6.6：输入框外层容器——承载「未聚焦也显示」的绿色跳动假光标（textarea 自身无法用伪元素） */
.zc-input-field { position: relative; flex: 1 1 auto; display: flex; min-width: 0; }
.zc-input-field .zc-input { flex: 1 1 auto; width: 100%; min-width: 0; }
.zc-chat.is-open .zc-input {
	background: rgba(255,255,255,.06);
	/* v6.6.6：深色展开态输入框外框「一直」是绿色——不再灰、也不再只在 :focus 才绿。
	   手机端为防软键盘弹出刻意不聚焦输入框，之前因此永远看不到绿框；改常绿后与电脑端观感一致。 */
	border: 1px solid #2eb872;
	border-radius: 10px;
	padding: 9px 12px;
	caret-color: #3ddc84;
	transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.zc-chat.is-open .zc-input::placeholder { color: #c2c2cc; opacity: 1; }
.zc-chat.is-open .zc-input:focus {
	border-color: #43d98c;
	background: rgba(255,255,255,.10);
	box-shadow: 0 0 0 2px rgba(61,220,132,.18);
}
/* v6.6.6：绿色跳动假光标——手机端未聚焦时也显示，模拟「可输入」状态，与电脑端自动聚焦的观感一致。
   textarea 是替换元素无法用 ::before，故用相邻 span；定位相对 .zc-input-field。
   显示条件：深色展开态 + 输入框为空(:placeholder-shown) + 未聚焦(真光标尚未接管)。
   用户一点聚焦或输入文字即自动隐藏，交由浏览器真实绿色光标(caret-color)接管，绝无双光标。 */
.zc-input__fake-caret {
	display: none;
	position: absolute;
	left: 12px; top: 50%;
	width: 2px; height: 18px;
	background: #3ddc84;
	border-radius: 1px;
	transform: translateY(-50%);
	pointer-events: none;
	z-index: 2;
	animation: zcBlink 1s steps(2) infinite;
}
/* 假光标出现时，占位文字右移 12px 给光标让位，避免压住第一个字；聚焦/输入后自动复位。 */
.zc-chat.is-open .zc-input:placeholder-shown:not(:focus) + .zc-input__fake-caret { display: block; }
.zc-chat.is-open .zc-input:placeholder-shown:not(:focus) { padding-left: 26px; }
@media (prefers-reduced-motion: reduce) { .zc-input__fake-caret { animation: none; } }

/* v6.5.4：滚动条按端分化。
   手机浏览器不渲染 CSS 定制的原生滚动条（会回退成深色细条看不清），手机端仍用自定义
   DOM 滚动条（白底 + 灰滑块 + 灰上下箭头）。
   桌面端浏览器原生滚动条本就清晰、尺寸与系统一致、圆角滑块与绿框发送按钮协调；v6.5.2 的
   自定义白条替换掉原生条后显得窄小、箭头凸出、与绿框割裂，故桌面端改回原生条并隐藏自定义条。 */

/* 自定义 DOM 滚动条基础样式（默认隐藏；仅手机端按 .is-visible 打开） */
.zc-sb {
	display: none; position: absolute; right: 0; width: 14px; z-index: 9;
	flex-direction: column; align-items: center;
	background: #f4f4f2; border-left: 1px solid #d6d6d0;
	box-shadow: -2px 0 6px rgba(0,0,0,.12);
}
.zc-sb.is-visible { display: flex; }
.zc-sb__arrow {
	flex: 0 0 16px; width: 14px; height: 16px; padding: 0; margin: 0; border: 0;
	background: #f4f4f2; color: #7f7f86; cursor: pointer;
	display: flex; align-items: center; justify-content: center;
	-webkit-tap-highlight-color: transparent;
}
.zc-sb__arrow:active { background: #e4e4de; }
.zc-sb__arrow svg { width: 10px; height: 6px; display: block; fill: none; stroke: #7f7f86; stroke-width: 2; }
.zc-sb__track { position: relative; flex: 1 1 auto; width: 10px; margin: 2px 0; }
.zc-sb__thumb {
	position: absolute; left: 1px; right: 1px; top: 0; min-height: 22px;
	background: #a9a9ad; border-radius: 5px; cursor: pointer; touch-action: none;
}
.zc-sb__thumb:active { background: #8d8d92; }

/* 手机端：隐藏原生滚动条（用自定义条替代） */
@media (max-width: 640px) {
	.zc-chat.is-open .zc-history__body { scrollbar-width: none; -ms-overflow-style: none; }
	.zc-chat.is-open .zc-history__body::-webkit-scrollbar { width: 0 !important; height: 0 !important; display: none !important; }
}

/* 桌面端：恢复原生滚动条（白底轨道 + 灰圆角滑块），隐藏自定义 DOM 条。
   原生条不再紧贴输入框显示突兀白底箭头，尺寸与系统一致、与绿框发送按钮自然协调。 */
@media (min-width: 641px) {
	.zc-sb.is-visible { display: none !important; }
	.zc-chat.is-open .zc-history__body::-webkit-scrollbar { width: 12px; height: 12px; }
	.zc-chat.is-open .zc-history__body::-webkit-scrollbar-track {
		background: #f4f4f2; border-left: 1px solid #d6d6d0;
	}
	.zc-chat.is-open .zc-history__body::-webkit-scrollbar-thumb {
		background: #a9a9ad; border: 2px solid #f4f4f2; border-radius: 8px;
	}
	.zc-chat.is-open .zc-history__body::-webkit-scrollbar-thumb:hover { background: #8d8d92; }
}

