/* =========================================================
   多聚AI — 网页对话（chat.html）样式：布局、间距、菜单参照 claude.ai（2026-11）测量
   设计变量见 docs/claude-ui/SPEC-frontend.md §2；字体：界面用系统字体，回答用 Source Serif 4（OFL）
   ========================================================= */
@font-face {
  font-family: "Source Serif 4";
  font-style: normal; font-weight: 200 900; font-display: swap;
  src: url(../fonts/source-serif-4/ss4-latin.woff2) format("woff2-variations"), url(../fonts/source-serif-4/ss4-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic; font-weight: 200 900; font-display: swap;
  src: url(../fonts/source-serif-4/ss4-latin-italic.woff2) format("woff2-variations"), url(../fonts/source-serif-4/ss4-latin-italic.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- 设计变量 ---------- */
:root {
  --bg-page: #ffffff; --bg-sidebar: #fafafa; --bg-elevated: #ffffff; --bg-hover: rgba(0, 0, 0, .04);
  --bg-active: rgba(0, 0, 0, .06); --bg-bubble: rgba(11, 11, 11, .05); --bg-subtle: rgba(0, 0, 0, .03); --bg-inverse: #141414;
  --text: rgba(0, 0, 0, .9); --text-2: rgba(0, 0, 0, .6); --text-3: rgba(0, 0, 0, .47); --text-inverse: #fff;
  --border: rgba(0, 0, 0, .1); --border-2: rgba(0, 0, 0, .12); --brand: #d97757; --brand-strong: #c6613f;
  --brand-bg: rgba(217, 119, 87, .12);
  --accent: #2c84db; --accent-bg: rgba(44, 132, 219, .1); --danger: #b53333; --danger-bg: rgba(181, 51, 51, .08); --success: #2f7d1f;
  --warn: #9a5a00; --warn-bg: rgba(232, 153, 0, .16);
  --shadow-composer: 0 4px 20px rgba(0, 0, 0, .075), 0 0 0 1px rgba(0, 0, 0, .12);
  --shadow-menu: 0 8px 28px rgba(0, 0, 0, .12), 0 0 0 1px rgba(0, 0, 0, .08);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .04), 0 0 0 1px rgba(0, 0, 0, .08);
  --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-composer: 14px;
  --scrim: rgba(0, 0, 0, .32); --tip-bg: #141414; --tip-text: #fff;
  --code-bg: #f7f7f6; --code-head: rgba(0, 0, 0, .035); --mark-bg: rgba(232, 179, 0, .28);
  --font-ui: system-ui, "Segoe UI Variable Text", "Segoe UI", Roboto, Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, "Microsoft YaHei", monospace;
  --font-chat: var(--font-serif);
  --side-w: 288px; --ease: cubic-bezier(.2, .7, .2, 1);
  /* markdown.css（与控制台共用）里用到的变量，映射到本页的设计变量 */
  --fill: rgba(0, 0, 0, .05); --surface-2: var(--code-bg); --border-strong: var(--border-2);
  --good: var(--success); --bad: var(--danger); --mono: var(--font-mono); --radius-sm: 12px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg-page: #1a1a1a; --bg-sidebar: #141414; --bg-elevated: #262626; --bg-hover: rgba(255, 255, 255, .05);
  --bg-active: rgba(255, 255, 255, .08); --bg-bubble: rgba(255, 255, 255, .08); --bg-subtle: rgba(255, 255, 255, .04); --bg-inverse: #f5f5f5;
  --text: rgba(255, 255, 255, .92); --text-2: rgba(255, 255, 255, .62); --text-3: rgba(255, 255, 255, .45); --text-inverse: #141414;
  --border: rgba(255, 255, 255, .1); --border-2: rgba(255, 255, 255, .14); --accent: #5da9f5; --accent-bg: rgba(93, 169, 245, .14);
  --danger: #f07a7a; --danger-bg: rgba(240, 122, 122, .12); --success: #7cc96b; --warn: #f2b45a; --warn-bg: rgba(242, 180, 90, .16);
  --brand-bg: rgba(217, 119, 87, .18);
  --shadow-composer: 0 4px 20px rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 255, 255, .1);
  --shadow-menu: 0 8px 28px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .1);
  --shadow-card: 0 0 0 1px rgba(255, 255, 255, .1);
  --scrim: rgba(0, 0, 0, .55); --tip-bg: #3a3a3a; --tip-text: #fff;
  --code-bg: #202020; --code-head: rgba(255, 255, 255, .04); --mark-bg: rgba(232, 179, 0, .3);
  --fill: rgba(255, 255, 255, .07);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-page: #1a1a1a; --bg-sidebar: #141414; --bg-elevated: #262626; --bg-hover: rgba(255, 255, 255, .05);
    --bg-active: rgba(255, 255, 255, .08); --bg-bubble: rgba(255, 255, 255, .08); --bg-subtle: rgba(255, 255, 255, .04); --bg-inverse: #f5f5f5;
    --text: rgba(255, 255, 255, .92); --text-2: rgba(255, 255, 255, .62); --text-3: rgba(255, 255, 255, .45); --text-inverse: #141414;
    --border: rgba(255, 255, 255, .1); --border-2: rgba(255, 255, 255, .14); --accent: #5da9f5; --accent-bg: rgba(93, 169, 245, .14);
    --danger: #f07a7a; --danger-bg: rgba(240, 122, 122, .12); --success: #7cc96b; --warn: #f2b45a; --warn-bg: rgba(242, 180, 90, .16);
    --brand-bg: rgba(217, 119, 87, .18);
    --shadow-composer: 0 4px 20px rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 255, 255, .1);
    --shadow-menu: 0 8px 28px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .1);
    --shadow-card: 0 0 0 1px rgba(255, 255, 255, .1);
    --scrim: rgba(0, 0, 0, .55); --tip-bg: #3a3a3a; --tip-text: #fff;
    --code-bg: #202020; --code-head: rgba(255, 255, 255, .04); --mark-bg: rgba(232, 179, 0, .3);
    --fill: rgba(255, 255, 255, .07);
    color-scheme: dark;
  }
}
/* 对话字体（设置 → 外观） */
:root[data-chat-font="sans"] { --font-chat: var(--font-ui); }
:root[data-chat-font="system"] { --font-chat: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "PingFang SC", "Microsoft YaHei", sans-serif; }
:root[data-chat-font="dyslexic"] { --font-chat: "Atkinson Hyperlegible", Verdana, "Microsoft YaHei", sans-serif; }

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg-page); color: var(--text);
  font: 400 14px/20px var(--font-ui); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow: hidden; overscroll-behavior: none;
}
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; margin: 0; text-align: inherit; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3, p { margin: 0; }
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent); }
::selection { background: rgba(44, 132, 219, .22); }
mark { background: var(--mark-bg); color: inherit; border-radius: 2px; padding: 0 1px; }
.cl-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
.cl-i { flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; display: block; }
.cl-brand-mark { color: var(--brand); stroke-width: 1.6; }
* { scrollbar-width: thin; scrollbar-color: rgba(128, 128, 128, .35) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(128, 128, 128, .3); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(128, 128, 128, .5); }
::-webkit-scrollbar-track { background: transparent; }
.cl-noscript { padding: 40px; text-align: center; color: var(--text-2); }

/* ---------- 布局 ---------- */
.cl-app { display: flex; height: 100vh; height: 100dvh; width: 100%; overflow: hidden; }
.cl-main { flex: 1 1 auto; min-width: 0; display: flex; position: relative; background: var(--bg-page); }
.cl-col { flex: 1 1 auto; min-width: 0; height: 100%; position: relative; display: flex; flex-direction: column; }
.cl-view { flex: 1 1 auto; min-width: 0; min-height: 0; position: relative; display: flex; flex-direction: column; }
body:not(.has-panel) #artifactPanel { display: none; }
.cl-scrim { display: none; }

/* ---------- 按钮 ---------- */
.cl-ibtn {
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; flex: none;
  border-radius: var(--r-md); color: var(--text-2); transition: background-color .12s, color .12s;
}
.cl-ibtn:hover, .cl-ibtn.is-menu-open { background: var(--bg-hover); color: var(--text); }
.cl-ibtn:active { background: var(--bg-active); }
.cl-ibtn.is-on { color: var(--text); background: var(--bg-active); }
.cl-ibtn.is-sm { width: 24px; height: 24px; border-radius: var(--r-sm); }
.cl-ibtn:disabled { opacity: .45; background: none; }
.cl-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none;
  height: 32px; padding: 0 12px; border-radius: var(--r-md); font-weight: 500; white-space: nowrap;
  transition: background-color .12s, opacity .12s, box-shadow .12s;
}
.cl-btn .cl-i { width: 16px; height: 16px; }
.cl-btn.is-sm { height: 28px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.cl-btn-primary { background: var(--bg-inverse); color: var(--text-inverse); }
.cl-btn-primary:hover { opacity: .88; }
.cl-btn-secondary { box-shadow: inset 0 0 0 1px var(--border-2); background: var(--bg-elevated); }
.cl-btn-secondary:hover { background: var(--bg-hover); }
.cl-btn-ghost { color: var(--text); }
.cl-btn-ghost:hover, .cl-btn-ghost.is-menu-open { background: var(--bg-hover); }
.cl-btn-soft { background: var(--bg-active); }
.cl-btn-soft:hover { background: rgba(128, 128, 128, .16); }
.cl-btn-danger { background: var(--danger); color: #fff; }
.cl-btn-danger:hover { opacity: .9; }
.cl-btn:disabled { opacity: .45; cursor: default; }
.cl-link-btn { color: var(--text-2); font-size: 13px; border-radius: 6px; padding: 2px 4px; }
.cl-link-btn:hover { color: var(--text); background: var(--bg-hover); }
.cl-spin {
  display: inline-block; flex: none; border-radius: 50%; border: 1.75px solid currentColor; border-right-color: transparent;
  opacity: .7; animation: cl-rot .8s linear infinite;
}
@keyframes cl-rot { to { transform: rotate(360deg); } }
.cl-avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 600; line-height: 1; font-family: var(--font-ui);
}
.cl-badge {
  display: inline-flex; align-items: center; gap: 3px; height: 18px; padding: 0 6px; border-radius: 5px;
  font-size: 11px; font-weight: 500; line-height: 18px; white-space: nowrap; flex: none;
}
.cl-badge-neutral { background: var(--bg-active); color: var(--text-2); }
.cl-badge-warn { background: var(--warn-bg); color: var(--warn); }
.cl-badge-accent { background: var(--accent-bg); color: var(--accent); }
.cl-badge .cl-i { width: 11px; height: 11px; }
.cl-switch {
  position: relative; display: inline-block; flex: none; width: 30px; height: 18px; border-radius: 9px;
  background: rgba(128, 128, 128, .35); transition: background-color .15s;
}
.cl-switch > span {
  position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s var(--ease);
}
.cl-switch.is-on { background: var(--accent); }
.cl-switch.is-on > span { transform: translateX(12px); }
.cl-switch-btn { display: inline-flex; padding: 4px; border-radius: 12px; }
.cl-switch-btn:disabled { opacity: .45; }

/* ---------- 侧边栏 ---------- */
.cl-side {
  width: var(--side-w); flex: none; height: 100%; display: flex; flex-direction: column;
  background: var(--bg-sidebar); border-right: 1px solid var(--border); position: relative; z-index: 20;
  transition: width .18s var(--ease);
}
.cl-side-top { height: 44px; flex: none; display: flex; align-items: center; gap: 4px; padding: 0 8px 0 11px; }
.cl-wordmark {
  font: 400 19px/1 var(--font-serif); letter-spacing: -.01em; color: var(--text); white-space: nowrap;
  padding: 4px 4px; border-radius: 6px; margin-left: 0;
}
.cl-side-top .cl-grow { flex: 1; }
.cl-nav { padding: 6px 11px 0 8px; display: flex; flex-direction: column; gap: 2px; flex: none; }
.cl-nav-item, .cl-row-link, .cl-viewall {
  display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; border-radius: var(--r-md);
  color: var(--text); font-weight: 450; white-space: nowrap; min-width: 0; width: 100%;
  transition: background-color .1s;
}
.cl-nav-item:hover, .cl-row:hover .cl-row-link, .cl-viewall:hover { background: var(--bg-hover); }
.cl-nav-item.is-active, .cl-row.is-active .cl-row-link { background: var(--bg-active); }
.cl-nav-item .cl-i { width: 16px; height: 16px; color: var(--text); }
.cl-nav-label { overflow: hidden; text-overflow: ellipsis; }
.cl-side-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 0 3px 12px 8px; scrollbar-gutter: stable; scrollbar-color: transparent transparent; }
.cl-side-scroll:hover { scrollbar-color: rgba(128, 128, 128, .35) transparent; }
.cl-side-scroll::-webkit-scrollbar-thumb { background-color: transparent; }
.cl-side-scroll:hover::-webkit-scrollbar-thumb { background-color: rgba(128, 128, 128, .3); }
.cl-sec { margin-top: 20px; }
.cl-sec-head {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; margin-bottom: 2px; border-radius: 6px;
  font-size: 12px; line-height: 20px; font-weight: 500; color: var(--text-2);
}
.cl-sec-head:hover { color: var(--text); }
.cl-sec-head .cl-i { width: 12px; height: 12px; transition: transform .15s; }
.cl-sec.is-collapsed .cl-sec-head .cl-i { transform: rotate(-90deg); }
.cl-sec.is-collapsed .cl-sec-body { display: none; }
.cl-sec-body { display: flex; flex-direction: column; gap: 2px; }
.cl-row { position: relative; display: flex; align-items: center; }
.cl-row-link { padding-right: 10px; }
.cl-row:hover .cl-row-link, .cl-row.is-active .cl-row-link, .cl-row.is-menu-open .cl-row-link { padding-right: 34px; }
.cl-row-link .cl-i { width: 16px; height: 16px; color: var(--text-2); }
.cl-row-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-row-title.is-untitled { color: var(--text-3); }
.cl-row .cl-spin { width: 12px; height: 12px; color: var(--text-2); }
.cl-row-more {
  position: absolute; right: 4px; top: 4px; width: 24px; height: 24px; border-radius: 6px; display: none;
  align-items: center; justify-content: center; color: var(--text-2);
}
.cl-row-more:hover, .cl-row-more.is-menu-open { background: var(--bg-active); color: var(--text); }
.cl-row:hover .cl-row-more, .cl-row.is-active .cl-row-more, .cl-row.is-menu-open .cl-row-more, .cl-row-more:focus-visible { display: inline-flex; }
.cl-row.is-menu-open .cl-row-link { background: var(--bg-hover); }
.cl-row.is-active.is-menu-open .cl-row-link { background: var(--bg-active); }
.cl-row-rename {
  width: 100%; height: 32px; padding: 0 9px; border-radius: var(--r-md); border: 1px solid var(--accent);
  background: var(--bg-elevated); outline: none; font-weight: 450;
}
.cl-viewall { color: var(--text-2); }
.cl-viewall:hover { color: var(--text); }
.cl-side-note { padding: 6px 10px; color: var(--text-3); font-size: 13px; }
.cl-side-note button { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; }
.cl-skel { height: 32px; margin: 2px 0; border-radius: var(--r-md); background: linear-gradient(90deg, var(--bg-subtle), var(--bg-active), var(--bg-subtle)); background-size: 200% 100%; animation: cl-skel 1.4s ease-in-out infinite; }
@keyframes cl-skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.cl-side-foot { flex: none; height: 48px; display: flex; align-items: center; gap: 4px; padding: 0 8px 0 8px; }
.cl-acct {
  flex: 1; min-width: 0; height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 6px 0 6px; border-radius: var(--r-md);
}
.cl-acct:hover, .cl-acct.is-menu-open { background: var(--bg-hover); }
.cl-acct-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 450; }
.cl-acct-plan { color: var(--text-3); font-size: 12px; white-space: nowrap; flex: none; }
.cl-acct .cl-i-chevron-down { width: 12px; height: 12px; color: var(--text-3); }

/* 收起的侧边栏：56px 的图标栏 */
:root[data-side="collapsed"] .cl-app .cl-side { width: 56px; }
:root[data-side="collapsed"] .cl-app .cl-side-top { padding: 0 14px; }
:root[data-side="collapsed"] .cl-app .cl-wordmark, :root[data-side="collapsed"] .cl-app .cl-side-top .cl-grow, :root[data-side="collapsed"] .cl-app .cl-console-btn,
:root[data-side="collapsed"] .cl-app .cl-side-scroll, :root[data-side="collapsed"] .cl-app .cl-nav-label, :root[data-side="collapsed"] .cl-app .cl-acct-name,
:root[data-side="collapsed"] .cl-app .cl-acct-plan, :root[data-side="collapsed"] .cl-app .cl-acct .cl-i-chevron-down, :root[data-side="collapsed"] .cl-app .cl-theme-btn { display: none; }
:root[data-side="collapsed"] .cl-app .cl-nav-item { width: 40px; padding: 0 12px; }
:root[data-side="collapsed"] .cl-app .cl-side-foot { padding: 0 8px; margin-top: auto; }
:root[data-side="collapsed"] .cl-app .cl-acct { flex: none; width: 40px; justify-content: center; padding: 0; }

/* ---------- 菜单 ---------- */
.cl-menu {
  position: fixed; z-index: 1000; min-width: 160px; max-width: min(360px, calc(100vw - 16px)); padding: 6px;
  background: var(--bg-elevated); border-radius: var(--r-lg); box-shadow: var(--shadow-menu); overflow-y: auto;
  font-size: 14px; line-height: 20px; animation: cl-pop .1s ease-out; outline: none;
}
@keyframes cl-pop { from { opacity: 0; transform: translateY(-2px); } to { opacity: 1; transform: none; } }
.cl-mi {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 28px; padding: 4px 10px; border-radius: var(--r-md);
  color: var(--text); text-align: left; white-space: nowrap; cursor: pointer; outline: none;
}
.cl-mi.has-desc { padding-top: 6px; padding-bottom: 6px; align-items: center; }
.cl-mi:hover, .cl-mi.is-active, .cl-mi.is-open { background: var(--bg-hover); }
.cl-mi:focus-visible { box-shadow: none; background: var(--bg-hover); }
.cl-mi:disabled, .cl-mi[aria-disabled="true"] { opacity: 1; cursor: default; background: none; }
.cl-mi:disabled .cl-mi-label, .cl-mi[aria-disabled="true"] .cl-mi-label, .cl-mi:disabled .cl-mi-icon { color: var(--text-3); }
.cl-mi-icon { width: 16px; height: 16px; color: var(--text-2); }
.cl-mi.is-danger, .cl-mi.is-danger .cl-mi-icon { color: var(--danger); }
.cl-mi-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cl-mi-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cl-mi-label { overflow: hidden; text-overflow: ellipsis; }
.cl-mi-desc { font-size: 12px; line-height: 16px; color: var(--text-2); white-space: normal; margin-top: 1px; }
.cl-mi-value { color: var(--text-2); font-size: 13px; flex: none; }
.cl-mi-kbd { color: var(--text-3); font-size: 12px; flex: none; margin-left: 8px; }
.cl-mi-check { width: 16px; height: 16px; color: var(--accent); }
.cl-mi-chev { width: 14px; height: 14px; color: var(--text-2); margin-right: -2px; }
.cl-menu-sep { height: 1px; background: var(--border); margin: 4px 2px; }
.cl-menu-head { padding: 4px 10px 4px; font-size: 12px; line-height: 16px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-menu-head.is-wrap { white-space: normal; padding: 6px 10px 8px; }
.cl-menu-search { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px 0 10px; margin-bottom: 2px; color: var(--text-3); }
.cl-menu-search-input { flex: 1; min-width: 0; border: 0; background: none; outline: none; height: 28px; font-size: 14px; color: var(--text); }
.cl-menu-search-input::placeholder { color: var(--text-3); }
.cl-menu-list { display: flex; flex-direction: column; }
.cl-menu-empty { padding: 6px 10px; color: var(--text-3); font-size: 13px; }
.cl-menu.is-models { width: 300px; }
.cl-menu.is-effort { width: 320px; }
.cl-menu.is-plus { width: 250px; }
.cl-menu.is-projects { width: 320px; }
.cl-menu.is-wide { width: 300px; }

/* ---------- 对话框 ---------- */
.cl-dlg-back {
  position: fixed; inset: 0; z-index: 900; background: var(--scrim); display: flex; align-items: center; justify-content: center;
  padding: 16px; animation: cl-fade .12s ease-out;
}
.cl-dlg-back.is-closing { animation: cl-fade-out .12s ease-in forwards; }
@keyframes cl-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cl-fade-out { to { opacity: 0; } }
.cl-dlg {
  max-width: 100%; max-height: calc(100dvh - 32px); display: flex; flex-direction: column; background: var(--bg-elevated);
  border-radius: 16px; box-shadow: var(--shadow-menu); outline: none; animation: cl-dlg-in .14s var(--ease);
}
@keyframes cl-dlg-in { from { opacity: 0; transform: scale(.98) translateY(4px); } to { opacity: 1; transform: none; } }
.cl-dlg-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 20px 0 24px; }
.cl-dlg-head.is-bare { padding: 12px 12px 0; }
.cl-dlg-title { flex: 1; font: 400 21px/28px var(--font-serif); letter-spacing: -.01em; padding-top: 2px; }
.cl-dlg-x { margin-top: 0; margin-right: -4px; }
.cl-dlg-body { padding: 14px 24px 8px; overflow-y: auto; min-height: 0; }
.cl-dlg-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 14px 24px 20px; flex-wrap: wrap; }
.cl-dlg-foot .is-start { margin-right: auto; }
.cl-dlg-text { color: var(--text-2); line-height: 22px; white-space: pre-wrap; overflow-wrap: anywhere; }
.cl-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.cl-field:last-child { margin-bottom: 4px; }
.cl-label { font-size: 14px; font-weight: 500; color: var(--text); }
.cl-help { font-size: 13px; color: var(--text-2); line-height: 18px; }
.cl-err { font-size: 13px; color: var(--danger); min-height: 0; }
.cl-input-text, .cl-textarea, .cl-select {
  width: 100%; border-radius: var(--r-md); border: 1px solid var(--border-2); background: var(--bg-page);
  padding: 0 12px; height: 38px; outline: none; transition: border-color .12s, box-shadow .12s; color: var(--text);
}
.cl-textarea { height: auto; min-height: 96px; padding: 10px 12px; line-height: 22px; resize: vertical; }
.cl-select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.cl-input-text:focus, .cl-textarea:focus, .cl-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.cl-input-text::placeholder, .cl-textarea::placeholder { color: var(--text-3); }
.cl-counter { font-size: 12px; color: var(--text-3); text-align: right; }
.cl-counter.is-over { color: var(--danger); }

/* ---------- 提示 ---------- */
.cl-toasts { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 1100; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.cl-toast {
  pointer-events: auto; display: flex; align-items: center; gap: 8px; max-width: min(520px, calc(100vw - 32px));
  padding: 9px 14px; border-radius: 10px; background: var(--bg-inverse); color: var(--text-inverse); font-size: 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .18); animation: cl-toast-in .16s var(--ease);
}
.cl-toast.is-error .cl-i { color: #ff9b9b; }
.cl-toast.is-out { opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s; }
.cl-toast-act { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; margin-left: 4px; }
@keyframes cl-toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.cl-tip {
  position: fixed; z-index: 1200; pointer-events: none; display: flex; align-items: center; gap: 8px;
  padding: 4px 8px; border-radius: 6px; background: var(--tip-bg); color: var(--tip-text); font-size: 12px; line-height: 16px;
  white-space: nowrap; max-width: 320px; animation: cl-fade .1s ease-out;
}
.cl-tip-kbd { opacity: .65; }

/* ---------- 顶部工具栏（首页 / 页面）---------- */
.cl-topbar { position: absolute; top: 0; left: 0; right: 0; height: 44px; display: flex; align-items: center; padding: 0 8px; z-index: 5; pointer-events: none; }
.cl-topbar > * { pointer-events: auto; }
.cl-topbar .cl-grow { flex: 1; pointer-events: none; }
.cl-menu-btn { display: none; }

/* ---------- 首页 ---------- */
.cl-home { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center; padding: 0 16px; }
.cl-home-main { width: 100%; max-width: 656px; display: flex; flex-direction: column; align-items: stretch; padding-top: max(56px, calc(40vh - 20px)); padding-bottom: 48px; }
.cl-greet { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 24px; min-height: 40px; }
.cl-greet h1 { font: 360 32px/1.2 var(--font-serif); letter-spacing: -.015em; color: var(--text); text-align: center; overflow-wrap: anywhere; }
.cl-greet .cl-brand-mark { width: 32px; height: 32px; }
.cl-incog-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; margin-bottom: 24px; }
.cl-incog-hero .cl-i { width: 32px; height: 32px; color: var(--text); stroke-width: 1.5; }
.cl-incog-hero h1 { font: 360 32px/1.2 var(--font-serif); letter-spacing: -.015em; }
.cl-incog-hero p { color: var(--text-2); font-size: 14px; }
.cl-incog-btn.is-on { background: var(--bg-active); color: var(--text); }
.cl-home-extra { margin-top: 64px; padding: 0 9px; }
.cl-sec-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; padding: 0 8px; }
.cl-sec-row h2 { font-size: 13px; font-weight: 400; color: var(--text-2); }
.cl-sec-row a, .cl-sec-row button { font-size: 13px; color: var(--text-2); border-radius: 6px; padding: 2px 6px; margin-right: -6px; }
.cl-sec-row a:hover, .cl-sec-row button:hover { color: var(--text); background: var(--bg-hover); }
.cl-starters { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.cl-starter {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--r-md);
  box-shadow: inset 0 0 0 1px var(--border-2); color: var(--text-2); font-size: 14px; background: var(--bg-page);
}
.cl-starter:hover, .cl-starter.is-on { color: var(--text); background: var(--bg-hover); }
.cl-starter .cl-i { width: 15px; height: 15px; }
.cl-starter-list { margin-top: 12px; display: flex; flex-direction: column; border-radius: var(--r-lg); overflow: hidden; }
.cl-starter-item { padding: 10px 12px; border-top: 1px solid var(--border); color: var(--text-2); text-align: left; line-height: 20px; }
.cl-starter-item:first-child { border-top: 0; }
.cl-starter-item:hover { color: var(--text); background: var(--bg-hover); border-radius: var(--r-md); }

/* ---------- 输入框 ---------- */
.cl-composer { position: relative; width: 100%; }
.cl-box {
  position: relative; display: flex; flex-direction: column; background: var(--bg-elevated); border-radius: var(--r-composer);
  box-shadow: var(--shadow-composer); transition: box-shadow .15s; cursor: text;
}
.cl-box:focus-within { box-shadow: 0 4px 20px rgba(0, 0, 0, .085), 0 0 0 1px rgba(0, 0, 0, .2); }
:root[data-theme="dark"] .cl-box:focus-within { box-shadow: 0 4px 20px rgba(0, 0, 0, .4), 0 0 0 1px rgba(255, 255, 255, .18); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cl-box:focus-within { box-shadow: 0 4px 20px rgba(0, 0, 0, .4), 0 0 0 1px rgba(255, 255, 255, .18); } }
.cl-ta {
  display: block; width: 100%; resize: none; border: 0; outline: none; background: transparent; color: var(--text);
  font: 400 15px/22px var(--font-ui); padding: 11px 16px; margin: 0; overflow-y: hidden; max-height: 40vh; min-height: 44px;
}
.cl-ta::placeholder { color: var(--text-3); opacity: 1; }
.cl-ta:disabled { cursor: not-allowed; }
.cl-ta:focus-visible { box-shadow: none; }
.cl-composer.is-home .cl-ta, .cl-composer.is-project .cl-ta { min-height: 63px; padding-bottom: 4px; }
.cl-box-bar { display: flex; align-items: flex-end; gap: 6px; padding: 0 8px 8px 8px; cursor: default; }
.cl-box-left { flex: 1; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.cl-plus { color: var(--text-2); }
.cl-send {
  width: 32px; height: 32px; border-radius: var(--r-md); display: inline-flex; align-items: center; justify-content: center; flex: none;
  color: var(--text-3); transition: background-color .12s, color .12s, opacity .12s;
}
.cl-send .cl-i { width: 16px; height: 16px; }
.cl-send.is-ready { background: var(--brand); color: #fff; }
.cl-send.is-ready:hover { background: var(--brand-strong); }
.cl-send.is-stop { background: var(--brand); color: #fff; }
.cl-send.is-stop:hover { background: var(--brand-strong); }
.cl-send:disabled { cursor: default; }
.cl-send.is-ready .cl-i, .cl-send.is-stop .cl-i { stroke-width: 2.25; }
.cl-composer.is-chat .cl-box { flex-direction: column; }
.cl-composer.is-chat .cl-ta { padding-right: 52px; }
.cl-composer.is-chat .cl-send { position: absolute; right: 6px; bottom: 6px; }
.cl-chip {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 6px 0 8px; border-radius: var(--r-md);
  font-size: 13px; color: var(--text-2); max-width: 220px; white-space: nowrap;
}
.cl-chip > span { overflow: hidden; text-overflow: ellipsis; }
.cl-chip .cl-i { width: 14px; height: 14px; }
.cl-chip:hover { background: var(--bg-hover); }
.cl-chip.is-accent { color: var(--accent); }
.cl-chip.is-accent:hover { background: var(--accent-bg); }
.cl-chip-x { opacity: .7; margin-left: 1px; }
.cl-under { display: flex; align-items: center; gap: 4px; padding: 7px 8px 0; min-height: 35px; }
.cl-under .cl-grow { flex: 1; min-width: 0; }
.cl-tool-btn {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 8px; border-radius: var(--r-md);
  color: var(--text); font-size: 14px; white-space: nowrap; max-width: 260px; min-width: 0;
}
.cl-tool-btn:hover, .cl-tool-btn.is-menu-open { background: var(--bg-hover); }
.cl-tool-btn > span { overflow: hidden; text-overflow: ellipsis; }
.cl-tool-btn .cl-i { width: 14px; height: 14px; color: var(--text-2); }
.cl-tool-btn .cl-i-folder { width: 15px; height: 15px; }
.cl-model-btn .cl-model-effort { color: var(--text-2); margin-left: 2px; }
.cl-disclaimer { min-width: 0; text-align: center; font-size: 13px; line-height: 18px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 8px; }
.cl-composer.is-chat .cl-under { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.cl-composer.is-chat .cl-disclaimer { max-width: 440px; }
.cl-tools-left { display: flex; align-items: center; gap: 2px; min-width: 0; }
.cl-tools-right { display: flex; align-items: center; justify-content: flex-end; min-width: 0; }
.cl-banner {
  display: flex; align-items: center; gap: 10px; margin: 0 0 8px; padding: 8px 10px 8px 12px; border-radius: var(--r-lg);
  background: var(--bg-subtle); box-shadow: inset 0 0 0 1px var(--border); color: var(--text-2); font-size: 13px; line-height: 18px;
}
.cl-banner .cl-i { width: 16px; height: 16px; }
.cl-banner > span { flex: 1; min-width: 0; }
.cl-banner.is-warn { color: var(--warn); background: var(--warn-bg); box-shadow: none; }
.cl-banner.is-error { color: var(--danger); background: var(--danger-bg); box-shadow: none; }
.cl-banner .cl-btn { height: 28px; font-size: 13px; }
/* 附件 */
.cl-atts { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 10px 0; cursor: default; }
.cl-atts:empty { display: none; }
.cl-att {
  position: relative; display: flex; align-items: center; gap: 10px; width: 160px; height: 56px; padding: 0 10px; flex: none;
  border-radius: var(--r-md); background: var(--bg-page); box-shadow: inset 0 0 0 1px var(--border-2); overflow: visible; text-align: left;
}
.cl-att.is-image { width: 64px; height: 64px; padding: 0; }
.cl-att.is-image img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--r-md); display: block; }
.cl-att.is-pasted { width: 200px; height: 76px; align-items: flex-start; padding: 8px 10px; flex-direction: column; gap: 4px; }
.cl-att-paste { font-size: 12px; line-height: 16px; color: var(--text-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: pre-wrap; word-break: break-all; }
.cl-att-badge {
  flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 4px;
  border-radius: 6px; background: var(--bg-active); color: var(--text-2); font-size: 10px; font-weight: 600; letter-spacing: .02em;
}
.cl-att-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cl-att-name { font-size: 13px; line-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.cl-att-sub { font-size: 12px; line-height: 16px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-att.is-error .cl-att-sub { color: var(--danger); }
.cl-att-sub button { color: var(--accent); }
.cl-att-x {
  position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; border-radius: 50%; display: none; align-items: center; justify-content: center;
  background: var(--bg-inverse); color: var(--text-inverse); box-shadow: 0 0 0 2px var(--bg-elevated); z-index: 1;
}
.cl-att-x .cl-i { width: 12px; height: 12px; stroke-width: 2.25; }
.cl-att:hover .cl-att-x, .cl-att:focus-within .cl-att-x { display: inline-flex; }
.cl-ring { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .55); border-radius: var(--r-md); }
:root[data-theme="dark"] .cl-ring { background: rgba(0, 0, 0, .45); }
.cl-ring svg { width: 24px; height: 24px; transform: rotate(-90deg); }
.cl-ring circle { fill: none; stroke-width: 3; }
.cl-ring .bg { stroke: rgba(128, 128, 128, .3); }
.cl-ring .fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .15s; }
.cl-att:not(.is-image) .cl-ring { position: static; background: none; width: 34px; height: 34px; flex: none; }
.cl-drop {
  position: absolute; inset: 8px; z-index: 50; display: none; align-items: center; justify-content: center; flex-direction: column; gap: 6px;
  border-radius: 16px; background: color-mix(in srgb, var(--bg-page) 86%, transparent); box-shadow: inset 0 0 0 2px var(--accent);
  backdrop-filter: blur(2px); pointer-events: none; text-align: center; padding: 24px;
}
.cl-drop.is-on { display: flex; }
.cl-drop .cl-i { width: 28px; height: 28px; color: var(--accent); margin-bottom: 6px; }
.cl-drop b { font: 400 22px/1.3 var(--font-serif); }
.cl-drop span { color: var(--text-2); }

/* ---------- 对话页 ---------- */
.cl-chat { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.cl-head {
  flex: none; height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 8px; border-bottom: 1px solid var(--border);
  background: var(--bg-page); position: relative; z-index: 6;
}
.cl-head-left { flex: 1; min-width: 0; display: flex; align-items: center; gap: 2px; }
.cl-head-right { flex: none; display: flex; align-items: center; gap: 4px; }
.cl-crumb { color: var(--text-2); padding: 4px 6px; border-radius: 6px; white-space: nowrap; max-width: 30%; overflow: hidden; text-overflow: ellipsis; flex: none; }
.cl-crumb:hover { color: var(--text); background: var(--bg-hover); }
.cl-crumb-sep { color: var(--text-3); flex: none; }
.cl-title { display: flex; align-items: center; min-width: 0; border-radius: var(--r-md); }
.cl-title:hover { background: var(--bg-hover); }
.cl-title-text { min-width: 0; padding: 4px 2px 4px 12px; height: 28px; font-weight: 450; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: var(--r-md) 0 0 var(--r-md); }
.cl-title-chev { width: 26px; height: 28px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); border-radius: 0 var(--r-md) var(--r-md) 0; flex: none; }
.cl-title-chev:hover, .cl-title-chev.is-menu-open { color: var(--text); background: var(--bg-active); }
.cl-title-chev .cl-i { width: 14px; height: 14px; }
.cl-title-input { height: 30px; width: min(420px, 60vw); padding: 0 10px; border-radius: var(--r-md); border: 1px solid var(--accent); background: var(--bg-elevated); font-weight: 450; outline: none; }
.cl-incog-badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: 6px; background: var(--bg-active); color: var(--text-2); font-size: 12px; flex: none; margin-left: 6px; }
.cl-incog-badge .cl-i { width: 14px; height: 14px; }
.cl-share-btn { height: 28px; padding: 0 8px; gap: 6px; font-weight: 400; color: var(--text); }
.cl-share-btn .cl-i { width: 15px; height: 15px; }
.cl-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overflow-anchor: none; position: relative; }
.cl-thread { max-width: 768px; margin: 0 auto; padding: 36px 16px 32px; }
.cl-thread.is-center { min-height: 100%; display: flex; align-items: center; justify-content: center; }
.cl-center { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--text-2); text-align: center; padding: 40px 16px; }
.cl-center .cl-i { width: 22px; height: 22px; }
.cl-dock { flex: none; position: relative; padding: 0 16px 7px; }
.cl-dock-inner { max-width: 768px; margin: 0 auto; position: relative; }
.cl-dock .cl-under { padding: 6px 6px 0; min-height: 34px; }
.cl-to-bottom {
  position: absolute; left: 50%; top: -48px; transform: translateX(-50%); width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; background: var(--bg-elevated); color: var(--text-2);
  box-shadow: var(--shadow-menu); opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 4;
}
.cl-to-bottom.is-on { opacity: 1; pointer-events: auto; }
.cl-to-bottom:hover { color: var(--text); }

/* 消息 */
/* 不用 content-visibility:auto：屏幕外的消息用占位高度，往上翻时内容会跳动（滚动区关闭了 overflow-anchor 以便贴底） */
.cl-msg { position: relative; }
.cl-user { display: flex; flex-direction: column; align-items: flex-end; margin-top: 24px; }
.cl-thread > .cl-msg:first-child { margin-top: 0; }
.cl-ai { margin-top: 10px; }
.cl-bubble {
  max-width: 85%; padding: 11px 16px; border-radius: var(--r-lg); background: var(--bg-bubble); color: var(--text);
  font: 400 15px/24px var(--font-ui); white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word;
}
.cl-ufiles { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-bottom: 8px; max-width: 85%; }
.cl-uimg { height: 96px; border-radius: var(--r-md); overflow: hidden; background: var(--bg-subtle); box-shadow: inset 0 0 0 1px var(--border); display: block; }
.cl-uimg img { height: 96px; width: auto; max-width: 260px; object-fit: cover; display: block; }
.cl-uimg.is-broken { width: 96px; display: flex; align-items: center; justify-content: center; color: var(--text-3); }
.cl-ufile { width: 160px; height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--border-2); background: var(--bg-page); text-align: left; }
button.cl-ufile:hover, a.cl-ufile:hover { background: var(--bg-hover); }
.cl-acts { display: flex; align-items: center; gap: 0; height: 24px; margin-top: 6px; color: var(--text-2); }
.cl-user .cl-acts { justify-content: flex-end; margin-right: -4px; }
.cl-ai .cl-acts { margin-left: -6px; }
.cl-acts .cl-ibtn { width: 24px; height: 24px; border-radius: 6px; color: var(--text-2); }
.cl-acts .cl-ibtn:hover { color: var(--text); }
.cl-acts .cl-ibtn.is-on { color: var(--text); background: none; }
.cl-acts .cl-ibtn.is-on .cl-i { fill: currentColor; fill-opacity: .14; }
.cl-acts .cl-ibtn.is-bookmarked .cl-i { fill: currentColor; fill-opacity: 1; }
.cl-acts-hover { display: flex; align-items: center; opacity: 0; transition: opacity .12s; }
.cl-msg:hover .cl-acts-hover, .cl-acts:focus-within .cl-acts-hover, .cl-acts.is-always .cl-acts-hover, .cl-acts-hover.has-open { opacity: 1; }
.cl-acts-time { font-size: 12px; color: var(--text-3); padding: 0 6px; white-space: nowrap; opacity: 0; transition: opacity .12s; }
.cl-msg:hover .cl-acts-time, .cl-acts:focus-within .cl-acts-time { opacity: 1; }
.cl-acts-tag { font-size: 12px; color: var(--text-3); padding: 0 6px; }
.cl-branch { display: inline-flex; align-items: center; gap: 0; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.cl-branch .cl-ibtn { width: 22px; }
.cl-branch .cl-ibtn .cl-i { width: 14px; height: 14px; }
.cl-branch-n { padding: 0 2px; min-width: 32px; text-align: center; }
/* 编辑 */
.cl-msg.is-editing { align-items: stretch; }
.cl-edit { width: 100%; border-radius: var(--r-lg); background: var(--bg-elevated); box-shadow: var(--shadow-composer); padding: 4px 8px 8px; }
.cl-edit .cl-ta { padding: 10px 8px; min-height: 48px; }
.cl-edit-foot { display: flex; justify-content: flex-end; gap: 8px; }
/* 回答 */
.cl-blocks { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cl-blocks > .cl-b-text + .cl-b-text { margin-top: -4px; }
.cl-b-text { font-family: var(--font-chat); font-size: 15px; line-height: 1.65; color: var(--text); }
:root[data-chat-font="dyslexic"] .cl-b-text, :root[data-chat-font="dyslexic"] .cl-bubble { letter-spacing: .02em; line-height: 1.8; }
.cl-b-wait { height: 24px; display: flex; align-items: center; }
.cl-pulse { color: var(--brand); animation: cl-pulse 1.3s ease-in-out infinite; }
@keyframes cl-pulse { 0%, 100% { opacity: .35; transform: scale(.88); } 50% { opacity: 1; transform: scale(1); } }
.cl-live-mark { margin-top: 2px; height: 20px; display: flex; align-items: center; }
.cl-live-mark .cl-i { width: 20px; height: 20px; }
.cl-shimmer {
  background: linear-gradient(90deg, var(--text-3) 0%, var(--text-3) 35%, var(--text) 50%, var(--text-3) 65%, var(--text-3) 100%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: cl-shimmer 1.8s linear infinite;
}
@keyframes cl-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.cl-fold { border-radius: var(--r-md); min-width: 0; }
.cl-fold-head {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 4px 8px 4px 2px; margin-left: -2px; border-radius: var(--r-md);
  color: var(--text-2); font-size: 14px; line-height: 20px; text-align: left; font-family: var(--font-ui);
}
.cl-fold-head:hover { color: var(--text); }
.cl-fold-head > .cl-i:first-child { width: 16px; height: 16px; }
.cl-fold-title { flex: none; white-space: nowrap; }
.cl-fold-sub { flex: 1 1 auto; min-width: 0; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-fold-meta { flex: none; color: var(--text-3); font-size: 13px; white-space: nowrap; }
.cl-fold-chev { width: 14px; height: 14px; color: var(--text-3); transition: transform .15s; flex: none; }
.cl-fold.is-open > .cl-fold-head .cl-fold-chev { transform: rotate(180deg); }
.cl-fold-body { display: none; padding: 4px 0 6px 10px; margin-left: 6px; border-left: 2px solid var(--border); }
.cl-fold.is-open > .cl-fold-body { display: block; }
.cl-think-body { font-family: var(--font-ui); font-size: 13.5px; line-height: 1.6; color: var(--text-2); }
.cl-think-body .md { color: var(--text-2); }
.cl-think-body > * + * { margin-top: 10px; }
.cl-src-q { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; margin: 6px 0 4px; font-family: var(--font-ui); }
.cl-src-q:first-child { margin-top: 0; }
.cl-src-q .cl-i { width: 13px; height: 13px; }
/* 搜索块展开后的来源列表：来源可能有几十个，限制高度、在块内滚动 */
.cl-src-body { max-height: 360px; overflow-y: auto; overscroll-behavior: contain; }
.cl-src {
  display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; margin-left: -8px; border-radius: var(--r-sm);
  font-family: var(--font-ui); font-size: 13px; color: var(--text); min-width: 0; max-width: 100%;
}
.cl-src:hover { background: var(--bg-hover); }
.cl-src-badge {
  width: 16px; height: 16px; flex: none; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-active); color: var(--text-2); font-size: 10px; font-weight: 600; text-transform: uppercase; line-height: 1;
}
.cl-src-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-src-domain { flex: none; color: var(--text-3); font-size: 12px; }
.cl-tool-chat { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; margin-left: -8px; border-radius: var(--r-sm); font-size: 13px; font-family: var(--font-ui); }
.cl-tool-chat:hover { background: var(--bg-hover); }
.cl-tool-chat .cl-i { width: 14px; height: 14px; color: var(--text-3); }
.cl-tool-chat span:last-child { color: var(--text-3); font-size: 12px; margin-left: auto; padding-left: 12px; }
a.cl-cite {
  display: inline-flex; align-items: center; height: 18px; padding: 0 7px; margin: 0 1px; border-radius: 999px; vertical-align: 1px;
  background: var(--bg-active); color: var(--text-2) !important; font: 500 11.5px/18px var(--font-ui); text-decoration: none !important;
  white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis;
}
a.cl-cite:hover { background: rgba(128, 128, 128, .2); color: var(--text) !important; }
.cl-b-error { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; color: var(--danger); font-family: var(--font-ui); font-size: 14px; line-height: 20px; }
.cl-b-error .cl-i { width: 16px; height: 16px; }
.cl-b-error > span { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }
.cl-b-stopped { color: var(--text-3); font-size: 13px; font-family: var(--font-ui); }
.cl-art-fallback {
  display: flex; align-items: center; gap: 12px; max-width: 420px; height: 64px; padding: 0 12px; border-radius: var(--r-lg);
  box-shadow: inset 0 0 0 1px var(--border-2); background: var(--bg-page); text-align: left; font-family: var(--font-ui); width: 100%;
}
.cl-art-fallback:hover { background: var(--bg-hover); }
.cl-art-tile { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--bg-subtle); display: flex; align-items: center; justify-content: center; flex: none; color: var(--text-2); box-shadow: inset 0 0 0 1px var(--border); }
.cl-art-meta { min-width: 0; display: flex; flex-direction: column; }
.cl-art-title { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-art-sub { font-size: 12px; color: var(--text-2); }
.cl-art-sub.is-error { color: var(--danger); }

/* Markdown（回答正文）：在 markdown.css 的基础上调整成 Claude 的样子 */
.cl-b-text.md, .md.cl-md { line-height: 1.65; }
.cl-b-text p, .cl-b-text ul, .cl-b-text ol, .cl-b-text blockquote, .cl-b-text .md-code, .cl-b-text .md-table { margin: 0 0 .9em; }
.cl-b-text h1, .cl-b-text h2, .cl-b-text h3, .cl-b-text h4 { font-family: var(--font-chat); font-weight: 600; letter-spacing: -.005em; margin: 1.2em 0 .5em; line-height: 1.35; }
.cl-b-text h1 { font-size: 1.35em; }
.cl-b-text h2 { font-size: 1.2em; }
.cl-b-text h3 { font-size: 1.07em; }
.cl-b-text > :first-child { margin-top: 0; }
.cl-b-text > :last-child { margin-bottom: 0; }
.md a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 2px; }
.md a:hover { text-decoration-color: var(--accent); }
.md :not(pre) > code { font-size: .86em; padding: .1em .35em; border-radius: 5px; background: var(--bg-active); color: var(--text); }
.md .md-code { background: var(--code-bg); border: 0; box-shadow: inset 0 0 0 1px var(--border); border-radius: var(--r-lg); font-family: var(--font-ui); }
.md .md-code-head { min-height: 36px; padding: 0 6px 0 14px; background: var(--code-head); border-bottom: 1px solid var(--border); color: var(--text-2); }
.md .md-code-lang { font-family: var(--font-ui); font-size: 12px; }
.md .md-copy { color: var(--text-2); border-radius: 6px; }
.md .md-copy:hover { background: var(--bg-active); color: var(--text); }
.md .md-copy svg.icon, .md svg.icon { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; display: block; }
.md pre { font-size: 13px; line-height: 1.6; padding: 12px 16px 14px; }
.md .tok-c { color: var(--text-3); }
.md .tok-k { color: #a6409b; }
.md .tok-s { color: #2f7d1f; }
.md .tok-n { color: #b35c00; }
:root[data-theme="dark"] .md .tok-k { color: #e08fd8; }
:root[data-theme="dark"] .md .tok-s { color: #9fd38d; }
:root[data-theme="dark"] .md .tok-n { color: #f0b36b; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .md .tok-k { color: #e08fd8; }
  :root:not([data-theme="light"]) .md .tok-s { color: #9fd38d; }
  :root:not([data-theme="light"]) .md .tok-n { color: #f0b36b; }
}
.md table { font-family: var(--font-ui); font-size: 14px; }
.md th, .md td { border: 0; border-bottom: 1px solid var(--border); padding: 8px 14px 8px 0; }
.md th { background: none; font-weight: 600; border-bottom-color: var(--border-2); }
.md blockquote { border-left: 3px solid var(--border-2); color: var(--text-2); }
.md hr { background: var(--border); }
.md li::marker { color: var(--text-2); }

/* 分享横幅 */
.cl-share-banner { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 10px 16px; background: var(--bg-subtle); border-bottom: 1px solid var(--border); color: var(--text-2); font-size: 13px; }
.cl-share-banner .cl-i { width: 15px; height: 15px; }
.cl-share-link { display: flex; gap: 8px; margin-top: 4px; }
.cl-share-link .cl-input-text { flex: 1; font-size: 13px; }

/* 大图 */
.cl-lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, .8); display: flex; align-items: center; justify-content: center; padding: 32px; animation: cl-fade .12s; }
.cl-lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.cl-lightbox .cl-ibtn { position: absolute; top: 14px; right: 14px; color: #fff; background: rgba(255, 255, 255, .12); }
.cl-preview-pre { margin: 0; max-height: 60vh; overflow: auto; padding: 12px 14px; border-radius: var(--r-md); background: var(--code-bg); box-shadow: inset 0 0 0 1px var(--border); font: 13px/1.6 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- 页面（最近 / 项目 / 设置 / Artifacts） ---------- */
.cl-page { flex: 1; min-height: 0; overflow-y: auto; position: relative; }
.cl-page > .cl-topbar { position: absolute; }
.cl-page-inner { max-width: 1008px; margin: 0 auto; padding: 30px 24px 64px; }
.cl-page-inner.is-narrow { max-width: 816px; }
.cl-page-head { display: flex; align-items: center; gap: 8px; min-height: 36px; margin-bottom: 26px; }
.cl-page-inner.is-projects > .cl-page-head { margin-bottom: 49px; }
.cl-page-title { flex: 1; min-width: 0; font: 400 28px/36px var(--font-serif); letter-spacing: -.015em; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-page-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.cl-page-search { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--border-2); width: 220px; color: var(--text-3); }
.cl-page-search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 13px; color: var(--text); }
.cl-tabs { display: flex; align-items: center; gap: 2px; }
.cl-tab { height: 28px; padding: 0 10px; border-radius: var(--r-md); font-size: 13px; color: var(--text-2); white-space: nowrap; }
.cl-tab:hover { color: var(--text); background: var(--bg-hover); }
.cl-tab[aria-selected="true"] { color: var(--text); background: var(--bg-active); font-weight: 500; }
.cl-toolbar { display: flex; align-items: center; gap: 8px; margin: -8px 0 24px; flex-wrap: wrap; }
.cl-toolbar .cl-grow { flex: 1; }
.cl-list { display: flex; flex-direction: column; }
.cl-li { position: relative; display: flex; align-items: center; min-height: 52px; border-bottom: 1px solid var(--border); margin: 0 -12px; padding: 0 12px; border-radius: 0; }
.cl-li:hover { background: var(--bg-hover); border-radius: var(--r-md); }
.cl-li-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 52px; }
.cl-li-text { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.cl-li-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--text); }
.cl-li-title.is-untitled { color: var(--text-3); }
.cl-li-snip { font-size: 13px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.cl-li-proj { font-size: 12px; color: var(--text-3); display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; }
.cl-li-proj .cl-i { width: 12px; height: 12px; }
.cl-li-time { flex: none; font-size: 13px; color: var(--text-3); white-space: nowrap; }
.cl-li-more { opacity: 0; margin-left: 6px; }
.cl-li:hover .cl-li-more, .cl-li-more.is-menu-open, .cl-li-more:focus-visible { opacity: 1; }
.cl-check {
  width: 18px; height: 18px; flex: none; border-radius: 5px; box-shadow: inset 0 0 0 1.5px var(--border-2); display: inline-flex; align-items: center; justify-content: center; color: #fff;
}
.cl-check.is-on { background: var(--accent); box-shadow: none; }
.cl-check .cl-i { width: 13px; height: 13px; stroke-width: 2.5; }
.cl-selbar {
  position: sticky; bottom: 16px; margin: 16px auto 0; width: max-content; max-width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 6px 6px 6px 14px; border-radius: 12px; background: var(--bg-elevated); box-shadow: var(--shadow-menu); font-size: 14px; z-index: 3;
}
.cl-selbar > span { margin-right: 8px; color: var(--text-2); }
.cl-empty { padding: 56px 16px; text-align: center; color: var(--text-2); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cl-empty .cl-i { width: 26px; height: 26px; color: var(--text-3); }
.cl-empty h3 { font: 400 20px/28px var(--font-serif); color: var(--text); }
.cl-empty p { max-width: 420px; font-size: 14px; line-height: 21px; }
.cl-more-row { display: flex; justify-content: center; padding: 16px; color: var(--text-3); }
/* 项目卡片 */
.cl-pgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cl-pcard {
  position: relative; display: flex; align-items: center; gap: 13px; height: 64px; padding: 0 14px 0 16px; border-radius: var(--r-lg);
  background: var(--bg-subtle); box-shadow: inset 0 0 0 1px var(--border); min-width: 0; transition: background-color .12s;
}
.cl-pcard:hover { background: var(--bg-hover); }
.cl-ptile { width: 30px; height: 30px; border-radius: 8px; background: var(--brand-bg); color: var(--brand); display: flex; align-items: center; justify-content: center; flex: none; }
.cl-ptile .cl-i { width: 16px; height: 16px; }
.cl-pcard-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cl-pcard-name { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-pcard-sub { font-size: 12px; line-height: 16px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-pcard-pin { width: 15px; height: 15px; color: var(--text); fill: currentColor; flex: none; }
.cl-pcard .cl-li-more { position: absolute; right: 10px; top: 50%; margin-top: -14px; background: var(--bg-elevated); box-shadow: var(--shadow-card); }
.cl-pcard:hover .cl-pcard-pin { visibility: hidden; }
.cl-pcard:hover .cl-li-more { opacity: 1; }
/* 项目页 */
.cl-proj { display: grid; grid-template-columns: minmax(0, 640px) 320px; gap: 40px; justify-content: center; align-items: start; }
.cl-back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; height: 28px; padding: 0 8px; margin-left: -8px; border-radius: var(--r-md); margin-bottom: 14px; }
.cl-back-link:hover { color: var(--text); background: var(--bg-hover); }
.cl-back-link .cl-i { width: 14px; height: 14px; }
.cl-proj-title { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.cl-proj-title h1 { font: 400 28px/36px var(--font-serif); letter-spacing: -.015em; min-width: 0; overflow-wrap: anywhere; }
.cl-proj-desc { color: var(--text-2); margin-bottom: 24px; line-height: 21px; white-space: pre-wrap; overflow-wrap: anywhere; }
.cl-proj-chats { margin-top: 32px; }
.cl-proj-chats h2 { font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 4px; }
.cl-proj-side { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 16px; }
.cl-card { border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--border); padding: 14px 16px 16px; background: var(--bg-page); }
.cl-card-head { display: flex; align-items: center; gap: 8px; min-height: 28px; margin-bottom: 6px; }
.cl-card-head h3 { flex: 1; font-size: 14px; font-weight: 500; }
.cl-card-text { color: var(--text-2); font-size: 13px; line-height: 20px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 160px; overflow: hidden; position: relative; }
.cl-card-empty { color: var(--text-3); font-size: 13px; line-height: 19px; }
.cl-card-cta { width: 100%; justify-content: flex-start; margin-top: 4px; color: var(--text-2); font-weight: 400; }
.cl-cap { margin: 4px 0 12px; }
.cl-cap-bar { height: 4px; border-radius: 2px; background: var(--bg-active); overflow: hidden; }
.cl-cap-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.cl-cap-bar.is-high > span { background: var(--danger); }
.cl-cap-txt { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.cl-pfile { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 6px; margin: 0 -6px; border-radius: var(--r-md); }
.cl-pfile:hover { background: var(--bg-hover); }
.cl-pfile .cl-att-badge { min-width: 32px; height: 32px; }
.cl-pfile-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cl-pfile-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-pfile-size { font-size: 12px; color: var(--text-3); }
.cl-pfile .cl-ibtn { opacity: 0; }
.cl-pfile:hover .cl-ibtn, .cl-pfile .cl-ibtn:focus-visible { opacity: 1; }
.cl-proj-composer { margin-top: 4px; }
/* 设置 */
.cl-settings { display: grid; grid-template-columns: 200px minmax(0, 640px); gap: 40px; }
.cl-set-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 24px; align-self: start; }
.cl-set-tab { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; border-radius: var(--r-md); color: var(--text-2); }
.cl-set-tab .cl-i { width: 16px; height: 16px; }
.cl-set-tab:hover { color: var(--text); background: var(--bg-hover); }
.cl-set-tab[aria-selected="true"], .cl-set-tab[aria-current="page"] { color: var(--text); background: var(--bg-active); }
.cl-set-navgroup { display: flex; flex-direction: column; gap: 2px; }
.cl-set-navgroup + .cl-set-navgroup { margin-top: 18px; }
.cl-set-group { font-size: 12px; font-weight: 500; line-height: 16px; color: var(--text-3); padding: 0 10px 6px; }
.cl-settings.is-wide { grid-template-columns: 200px minmax(0, 1fr); }
.cl-set-sec { padding-bottom: 28px; margin-bottom: 28px; border-bottom: 1px solid var(--border); }
.cl-set-sec:last-child { border-bottom: 0; }
.cl-set-sec > h2 { font-size: 16px; font-weight: 600; margin-bottom: 14px; }
.cl-set-row { display: flex; align-items: flex-start; gap: 16px; padding: 14px 0; border-top: 1px solid var(--border); }
.cl-set-row:first-of-type { border-top: 0; padding-top: 0; }
.cl-set-row-main { flex: 1; min-width: 0; }
.cl-set-row-main b { display: block; font-weight: 500; margin-bottom: 2px; }
.cl-set-row-main p { color: var(--text-2); font-size: 13px; line-height: 19px; }
.cl-set-actions { display: flex; justify-content: flex-end; margin-top: 4px; }
.cl-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cl-cards3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cl-cards4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.cl-choice { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 8px 10px; border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--border-2); color: var(--text-2); font-size: 13px; }
.cl-choice:hover { background: var(--bg-hover); color: var(--text); }
.cl-choice[aria-checked="true"] { box-shadow: inset 0 0 0 2px var(--accent); color: var(--text); }
.cl-theme-prev { width: 100%; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; display: flex; box-shadow: inset 0 0 0 1px var(--border); }
.cl-theme-prev i { display: block; }
.cl-theme-prev .s { width: 26%; }
.cl-theme-prev .m { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; padding: 10%; gap: 8%; }
.cl-theme-prev .b { height: 12%; border-radius: 3px; width: 60%; align-self: flex-end; }
.cl-theme-prev .c { height: 22%; border-radius: 4px; }
.cl-theme-prev.is-light { background: #fff; } .cl-theme-prev.is-light .s { background: #f3f3f3; } .cl-theme-prev.is-light .b { background: #ececec; } .cl-theme-prev.is-light .c { background: #fff; box-shadow: 0 0 0 1px #ddd; }
.cl-theme-prev.is-dark { background: #1a1a1a; } .cl-theme-prev.is-dark .s { background: #141414; } .cl-theme-prev.is-dark .b { background: #2e2e2e; } .cl-theme-prev.is-dark .c { background: #262626; box-shadow: 0 0 0 1px #3a3a3a; }
.cl-theme-prev.is-auto { background: linear-gradient(135deg, #fff 50%, #1a1a1a 50%); }
.cl-theme-prev.is-auto .s { background: linear-gradient(135deg, #f3f3f3 50%, #141414 50%); }
.cl-theme-prev.is-auto .b { background: #888; opacity: .35; } .cl-theme-prev.is-auto .c { background: #888; opacity: .25; }
.cl-font-aa { font-size: 26px; line-height: 44px; color: var(--text); }
.cl-style-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.cl-style-row:first-child { border-top: 0; }
.cl-style-row .cl-set-row-main b { display: flex; align-items: center; gap: 8px; }
.cl-seg { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--bg-active); gap: 2px; margin-bottom: 14px; }
.cl-seg button { height: 28px; padding: 0 12px; border-radius: 7px; font-size: 13px; color: var(--text-2); }
.cl-seg button[aria-selected="true"] { background: var(--bg-elevated); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }
/* 搜索对话框 */
.cl-search-dlg { border-radius: 16px; overflow: hidden; }
.cl-search-dlg .cl-dlg-body { padding: 0; display: flex; flex-direction: column; min-height: 0; }
.cl-search-top { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px; border-bottom: 1px solid var(--border); flex: none; }
.cl-search-top .cl-i { width: 18px; height: 18px; color: var(--text-3); }
.cl-search-top input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font-size: 16px; height: 50px; color: var(--text); }
.cl-search-top input:focus-visible, .cl-menu-search-input:focus-visible, .cl-page-search input:focus-visible { box-shadow: none; }
.cl-search-top input::placeholder { color: var(--text-3); }
.cl-search-tabs { padding: 8px 12px 4px; flex: none; }
.cl-search-list { overflow-y: auto; padding: 4px 8px 8px; height: min(420px, 55vh); }
.cl-search-group { font-size: 12px; font-weight: 500; color: var(--text-3); padding: 10px 8px 4px; }
.cl-srow { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 6px 8px; border-radius: var(--r-md); text-align: left; }
.cl-srow.is-active { background: var(--bg-hover); }
.cl-srow > .cl-i { width: 16px; height: 16px; color: var(--text-2); }
.cl-srow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cl-srow-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-srow-snip { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.cl-srow-meta { flex: none; font-size: 12px; color: var(--text-3); }
.cl-search-foot { display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); flex: none; }
.cl-search-foot kbd, .cl-kbd { font: 500 11px/16px var(--font-ui); padding: 0 5px; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--border-2); background: var(--bg-subtle); color: var(--text-2); margin-left: 4px; }
.cl-search-empty { padding: 40px 16px; text-align: center; color: var(--text-3); }
/* 指南 / 快捷键 */
.cl-guide { display: flex; flex-direction: column; gap: 14px; }
.cl-guide-intro { padding: 10px 12px; border-radius: var(--r-md); background: var(--brand-bg); color: var(--text); line-height: 21px; font-size: 13.5px; }
.cl-guide-sec h3 { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cl-guide-sec h3 .cl-badge { font-weight: 500; }
.cl-guide-sec p { color: var(--text-2); font-size: 13.5px; line-height: 21px; margin-top: 3px; }
.cl-kbd-list { display: flex; flex-direction: column; }
.cl-kbd-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 0; border-top: 1px solid var(--border); }
.cl-kbd-row:first-child { border-top: 0; }
.cl-kbd-row span:first-child { color: var(--text); }

/* ---------- 顶部提示条：管理员公告 / 维护模式（SPEC-admin §6） ---------- */
.cl-topbanners { flex: none; display: flex; flex-direction: column; position: relative; z-index: 6; }
.cl-topban {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 8px 48px;
  font-size: 13.5px; line-height: 19px; color: var(--text); background: var(--bg-subtle); border-bottom: 1px solid var(--border);
}
.cl-topban > .cl-i { width: 16px; height: 16px; color: var(--text-2); }
.cl-topban-text { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; column-gap: 10px; text-align: center; overflow-wrap: anywhere; white-space: pre-wrap; }
.cl-topban-link, .cl-topban-go { display: inline-flex; align-items: center; gap: 3px; color: inherit; font-weight: 500; text-decoration: underline; text-decoration-color: rgba(128, 128, 128, .5); text-underline-offset: 3px; white-space: nowrap; border-radius: 4px; }
.cl-topban-link:hover, .cl-topban-go:hover { text-decoration-color: currentColor; }
.cl-topban-link .cl-i { width: 12px; height: 12px; }
.cl-topban-x { position: absolute; right: 10px; top: 50%; margin-top: -12px; }
.cl-topban.is-warning { background: var(--warn-bg); border-bottom-color: transparent; }
.cl-topban.is-warning > .cl-i { color: var(--warn); }
.cl-topban.is-maint { background: var(--warn-bg); color: var(--warn); font-weight: 500; border-bottom-color: transparent; }
.cl-topban.is-maint > .cl-i { color: var(--warn); }
.cl-topban.is-maint + .cl-topban { border-top: 1px solid var(--bg-page); }

/* ---------- 维护中（成员）：代替输入框的说明；首页是大号版本 ---------- */
.cl-maint { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: var(--r-composer); background: var(--bg-elevated); box-shadow: var(--shadow-composer); text-align: left; }
.cl-maint-ic { width: 36px; height: 36px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); display: flex; align-items: center; justify-content: center; flex: none; }
.cl-maint-main { flex: 1; min-width: 0; padding-top: 1px; }
.cl-maint-main b { display: block; font-weight: 600; margin-bottom: 2px; color: var(--text); }
.cl-maint-main p { color: var(--text-2); font-size: 13.5px; line-height: 20px; white-space: pre-wrap; overflow-wrap: anywhere; }
.cl-composer.is-maint .cl-box, .cl-composer.is-maint .cl-under { display: none; }
.cl-maint-wrap { display: flex; justify-content: center; }
.cl-maint.is-hero { flex-direction: column; align-items: center; text-align: center; gap: 16px; padding: 0; background: none; box-shadow: none; }
.cl-maint.is-hero .cl-maint-ic { width: 52px; height: 52px; border-radius: 14px; }
.cl-maint.is-hero .cl-maint-main h1 { font: 360 32px/1.2 var(--font-serif); letter-spacing: -.015em; color: var(--text); margin-bottom: 10px; }
.cl-maint.is-hero .cl-maint-main p { font-size: 15px; line-height: 23px; max-width: 520px; margin: 0 auto; }
.cl-home.is-maint .cl-home-main { padding-top: max(80px, calc(34vh - 40px)); }
.cl-ibtn.is-blocked { opacity: .45; }

/* ---------- 管理后台（设置 → 组织管理） ---------- */
.cl-adm-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.cl-adm-head-main { flex: 1; min-width: 0; }
.cl-adm-head-main h2 { font-size: 16px; font-weight: 600; line-height: 22px; margin-bottom: 4px; }
.cl-adm-head-act { flex: none; display: flex; align-items: center; gap: 8px; }
.cl-adm-h3 { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.cl-adm-block { padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.cl-adm-sep { height: 1px; background: var(--border); margin: 30px 0 28px; }
.cl-adm-loading { display: flex; justify-content: center; padding: 56px 0; color: var(--text-3); }
.cl-adm-error { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 16px; color: var(--text-2); text-align: center; }
.cl-adm-error .cl-i { width: 22px; height: 22px; color: var(--danger); }
.cl-adm-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 44px 16px; color: var(--text-3); text-align: center; }
.cl-adm-empty .cl-i { width: 24px; height: 24px; }
.cl-adm-body.is-busy { opacity: .55; pointer-events: none; transition: opacity .15s; }
.cl-adm-note { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 19px; color: var(--text-2); margin-top: 12px; }
.cl-adm-note > .cl-i { margin-top: 2px; color: var(--text-3); }
.cl-adm-note.is-privacy { margin-top: 22px; color: var(--text-3); }
.cl-adm-note.is-once { color: var(--warn); }
.cl-adm-note.is-once > .cl-i { color: var(--warn); }
.cl-adm-updated { font-size: 12px; line-height: 16px; color: var(--text-3); margin-top: 12px; }
.cl-adm-actions { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.cl-adm-actions .cl-grow { flex: 1; }
.cl-adm-unsaved { font-size: 13px; color: var(--text-3); }
.cl-adm-link { color: var(--accent); white-space: nowrap; border-radius: 4px; }
.cl-adm-link:hover { text-decoration: underline; text-underline-offset: 2px; }
.cl-adm-warn { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: var(--r-md); background: var(--warn-bg); color: var(--warn); font-size: 13px; line-height: 19px; margin: 2px 0 16px; }
.cl-adm-warn > .cl-i { margin-top: 2px; }
.cl-adm-card { border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--border); padding: 14px 16px 16px; margin-top: 16px; }
.cl-adm-card-head { display: flex; align-items: center; gap: 8px; min-height: 22px; margin-bottom: 10px; }
.cl-adm-card-head h3 { flex: 1; font-size: 14px; font-weight: 600; }
.cl-adm-foot { display: flex; margin-top: 16px; }
.cl-adm-more { display: flex; justify-content: center; padding: 14px 0 2px; }
.cl-adm-count { font-size: 12px; line-height: 16px; color: var(--text-3); margin: 16px 0 4px; }
.cl-adm-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cl-adm-search {
  flex: 1 1 220px; max-width: 320px; display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: var(--r-md);
  box-shadow: inset 0 0 0 1px var(--border-2); background: var(--bg-page); color: var(--text-3); transition: box-shadow .12s;
}
.cl-adm-search:focus-within { box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 3px var(--accent-bg); }
.cl-adm-search input { flex: 1; min-width: 0; height: 30px; border: 0; background: none; outline: none; font-size: 13px; color: var(--text); }
.cl-adm-search input:focus-visible { box-shadow: none; }
.cl-adm-search input::placeholder { color: var(--text-3); }
.cl-adm-toolbar-r { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.cl-adm-sort { color: var(--text-2); font-weight: 400; }
.cl-adm-sort .cl-i { width: 14px; height: 14px; }
.cl-pills { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 9px; background: var(--bg-active); flex: none; }
.cl-pill { height: 26px; padding: 0 11px; border-radius: 7px; font-size: 13px; color: var(--text-2); white-space: nowrap; transition: background-color .12s, color .12s; }
.cl-pill:hover { color: var(--text); }
.cl-field > .cl-pills { align-self: flex-start; }
.cl-pill[aria-checked="true"] { background: var(--bg-elevated); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
/* 成员表格 / 用得最多的成员 */
.cl-mt { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.cl-mt th { text-align: left; font-size: 12px; font-weight: 500; line-height: 16px; color: var(--text-3); padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: bottom; }
.cl-mt td { padding: 10px; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-mt tbody tr:last-child td { border-bottom: 0; }
.cl-mt tbody tr:hover td { background: var(--bg-subtle); }
.cl-mt th:first-child, .cl-mt td:first-child { padding-left: 6px; }
.cl-mt .is-num { text-align: right; font-variant-numeric: tabular-nums; }
.cl-mt th:nth-child(2) { width: 150px; }
.cl-mt th:nth-child(3) { width: 104px; }
.cl-mt th:nth-child(4) { width: 96px; }
.cl-mt th.cl-mt-act { width: 44px; }
.cl-mt.is-top th:nth-child(2) { width: 72px; }
.cl-mt.is-top th:nth-child(3) { width: 84px; }
.cl-mt.is-top th:nth-child(4) { width: 64px; }
.cl-mt-who { white-space: normal !important; }
.cl-mt-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cl-mt-names { flex: 1; min-width: 0; }
.cl-mt-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cl-mt-nm { min-width: 0; font-size: 14px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-mt-sub { font-size: 12px; line-height: 16px; color: var(--text-3); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-mt td.cl-mt-act { padding: 6px 2px 6px 0; text-align: right; overflow: visible; }
.cl-mt tr.is-disabled .cl-avatar { opacity: .4; filter: grayscale(1); }
.cl-mt tr.is-disabled .cl-mt-nm { color: var(--text-2); }
/* 用量 */
.cl-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cl-stat { min-width: 0; padding: 12px 14px 13px; border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--border); }
.cl-stat-k { font-size: 12px; line-height: 16px; color: var(--text-2); }
.cl-stat-v { margin-top: 4px; font: 400 24px/32px var(--font-serif); letter-spacing: -.01em; color: var(--text); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-stat-s { margin-top: 1px; font-size: 12px; line-height: 16px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-stat.is-warn .cl-stat-v { color: var(--warn); }
.cl-quota { padding: 9px 0; }
.cl-quota + .cl-quota { border-top: 1px solid var(--border); }
.cl-quota-top { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; margin-bottom: 7px; }
.cl-quota-k { color: var(--text); font-weight: 500; }
.cl-quota-v { color: var(--text-2); font-variant-numeric: tabular-nums; }
.cl-meter { height: 6px; border-radius: 3px; background: var(--bg-active); overflow: hidden; }
.cl-meter > span { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.cl-meter.is-mid > span { background: var(--warn); }
.cl-meter.is-high > span { background: var(--danger); }
.cl-quota-when { margin-top: 6px; font-size: 12px; color: var(--text-3); }
/* 功能与模型 / 限额 */
.cl-mchecks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 12px 0 4px; }
.cl-mcheck { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 40px; padding: 8px 12px; border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--border); cursor: pointer; transition: background-color .12s; }
.cl-mcheck:hover { background: var(--bg-hover); }
.cl-mcheck-name { min-width: 0; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-mcheck-id { margin-left: auto; min-width: 0; font: 12px/16px var(--font-mono); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-check { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--accent); cursor: pointer; }
.cl-adm-inline { flex-direction: row; align-items: center; gap: 12px; margin: 14px 0 0; }
.cl-adm-inline .cl-label { flex: none; }
.cl-adm-inline .cl-select { max-width: 300px; }
.cl-set-row-label { display: block; font-weight: 500; margin-bottom: 2px; }
.cl-adm-block .cl-set-row > .cl-select { width: 160px; flex: none; }
.cl-adm-limits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.cl-adm-limits .cl-field { margin-bottom: 0; }
.cl-adm-switchrow { border-top: 0; padding: 0 0 12px; align-items: center; }
.cl-adm-preview { border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; }
.cl-adm-preview .cl-topban { border-bottom: 0; }
.cl-adm-preview-empty { padding: 11px 14px; font-size: 13px; color: var(--text-3); text-align: center; }
/* 表单：错误提示、可选、输入框 + 按钮、勾选行、账号信息 */
.cl-field-err { font-size: 13px; line-height: 18px; color: var(--danger); }
.cl-label-opt { margin-left: 4px; font-weight: 400; color: var(--text-3); }
.cl-input-text[aria-invalid="true"], .cl-textarea[aria-invalid="true"] { border-color: var(--danger); }
.cl-input-text[aria-invalid="true"]:focus, .cl-textarea[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px var(--danger-bg); }
.cl-mono { font-family: var(--font-mono); letter-spacing: .02em; }
.cl-inrow { display: flex; align-items: center; gap: 8px; }
.cl-inrow > .cl-input-text { flex: 1; min-width: 0; }
.cl-inrow-btns { display: flex; align-items: center; gap: 6px; flex: none; }
.cl-inrow-btns .cl-btn { height: 38px; }
.cl-inrow-ibtn { width: 38px; height: 38px; box-shadow: inset 0 0 0 1px var(--border-2); }
.cl-checkrow { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--border); cursor: pointer; margin-top: 4px; }
.cl-checkrow:hover { background: var(--bg-hover); }
.cl-checkrow .cl-check { margin-top: 2px; }
.cl-checkrow-text b { display: block; font-weight: 500; }
.cl-checkrow-text small { display: block; margin-top: 1px; font-size: 12.5px; line-height: 17px; color: var(--text-2); }
.cl-dlg-sub { margin: -4px 0 14px; font-size: 13px; color: var(--text-3); overflow-wrap: anywhere; }
.cl-dlg-lead { margin-bottom: 14px; }
.cl-dlg-text + .cl-field { margin-top: 14px; }
.cl-cred { margin-top: 14px; padding: 2px 6px 2px 12px; border-radius: var(--r-md); background: var(--bg-subtle); box-shadow: inset 0 0 0 1px var(--border); }
.cl-cred-row { display: flex; align-items: center; gap: 12px; min-height: 40px; }
.cl-cred-row + .cl-cred-row { border-top: 1px solid var(--border); }
.cl-cred-k { flex: none; min-width: 64px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.cl-cred-v { flex: 1; min-width: 0; font: 13.5px/20px var(--font-mono); color: var(--text); overflow-wrap: anywhere; user-select: all; }
.cl-adm-done { display: flex; align-items: flex-start; gap: 10px; }
.cl-adm-done-ic { width: 28px; height: 28px; border-radius: 50%; background: rgba(47, 125, 31, .12); color: var(--success); display: flex; align-items: center; justify-content: center; flex: none; }
.cl-adm-done p { padding-top: 3px; color: var(--text-2); line-height: 21px; }
/* 操作记录 */
.cl-audit { list-style: none; margin: 0; padding: 0; }
.cl-audit-row { border-bottom: 1px solid var(--border); }
.cl-audit-row:last-child { border-bottom: 0; }
.cl-audit-head { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 12px 6px; text-align: left; border-radius: var(--r-md); }
.cl-audit-head.is-toggle:hover { background: var(--bg-hover); }
.cl-audit-ic { width: 28px; height: 28px; border-radius: 8px; background: var(--bg-active); color: var(--text-2); display: flex; align-items: center; justify-content: center; flex: none; }
.cl-audit-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cl-audit-line { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; line-height: 20px; }
.cl-audit-line b { font-weight: 500; color: var(--text); }
.cl-audit-act { color: var(--text-2); }
.cl-audit-target { font: 12.5px/20px var(--font-mono); color: var(--text); overflow-wrap: anywhere; }
.cl-audit-meta { display: flex; flex-wrap: wrap; column-gap: 10px; font-size: 12px; line-height: 16px; color: var(--text-3); }
.cl-audit-chev { margin-top: 6px; color: var(--text-3); transition: transform .15s; }
.cl-audit-head[aria-expanded="true"] .cl-audit-chev { transform: rotate(180deg); }
.cl-audit-detail { list-style: none; margin: 0 6px 12px 46px; padding: 8px 12px; border-radius: var(--r-md); background: var(--bg-subtle); font-size: 13px; line-height: 21px; color: var(--text); overflow-wrap: anywhere; }

/* ---------- 账号池 / Token 统计 / 计费与兑换码（SPEC-pool-billing §C） ---------- */
.cl-badge-danger { background: var(--danger-bg); color: var(--danger); }
.cl-adm .cl-set-row > .cl-select { width: 260px; flex: none; }
.cl-adm-btnrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -4px 0 18px; }
.cl-adm-after { font-size: 13px; color: var(--text-2); margin: 0 0 12px; font-variant-numeric: tabular-nums; }
.cl-adm-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.cl-adm-block.is-last { border-bottom: 0; margin-bottom: 0; }
.cl-tscroll { overflow-x: auto; margin: 0 -2px; padding: 0 2px; }
.cl-mt.is-auto { table-layout: auto; }
.cl-mt.is-auto th { width: auto !important; white-space: nowrap; }
.cl-mt.is-auto td { max-width: 220px; }
.cl-mt .is-neg { color: var(--danger); }
.cl-mt.has-money th:nth-child(2) { width: 128px; }
.cl-mt.has-money th:nth-child(3) { width: 88px; }
.cl-mt.has-money th:nth-child(4) { width: 78px; }
.cl-mt.has-money th:nth-child(5) { width: 78px; }
.cl-mt.has-money th:nth-child(6) { width: 88px; }
.cl-stats.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* 账号池列表 */
.cl-pool { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cl-pool-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 10px 12px 6px; border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--border); background: var(--bg-page); }
.cl-pool-row.is-off .cl-pool-main { opacity: .55; }
.cl-pool-row.is-drag { opacity: .4; }
.cl-pool-row.is-over { box-shadow: inset 0 0 0 2px var(--accent); }
.cl-pool-order { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 22px; flex: none; padding-top: 2px; color: var(--text-3); }
.cl-pool-grip { cursor: grab; display: flex; padding: 2px; border-radius: 4px; }
.cl-pool-grip:hover { background: var(--bg-hover); color: var(--text-2); }
.cl-pool-n { font-size: 12px; font-variant-numeric: tabular-nums; }
.cl-pool-main { flex: 1; min-width: 0; }
.cl-pool-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-height: 26px; }
.cl-pool-label { font-size: 14px; font-weight: 500; color: var(--text); border-radius: 6px; padding: 1px 4px; margin-left: -4px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-pool-label:hover { background: var(--bg-hover); }
.cl-pool-label.is-empty { color: var(--text-3); font-weight: 400; }
.cl-pool-input { height: 28px; width: 220px; max-width: 100%; font-size: 14px; padding: 0 8px; }
.cl-pool-email { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-pool-err { font-size: 12px; color: var(--danger); margin-top: 3px; overflow-wrap: anywhere; }
.cl-pool-bars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 10px; }
.cl-pq-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; margin-bottom: 5px; }
.cl-pq-k { color: var(--text-2); font-weight: 500; }
.cl-pq-v { color: var(--text-2); font-variant-numeric: tabular-nums; }
.cl-pq-when { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
.cl-pool-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--text-3); margin-top: 8px; }
.cl-pool-meta:empty { display: none; }
.cl-pool-meta .is-bad { color: var(--danger); }
.cl-pool-bars.is-one { grid-template-columns: minmax(0, 1fr); max-width: calc(50% - 8px); }
.cl-credit.is-off { opacity: .6; }
.cl-adm-empty.is-sm { padding: 24px 12px; }
.cl-pool-side { display: flex; align-items: center; gap: 4px; flex: none; }
.cl-pool-arrows { display: flex; flex-direction: column; }
.cl-pool-arrows .cl-ibtn { height: 20px; }
.cl-credit { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--border); margin-bottom: 6px; color: var(--text-2); }
.cl-credit-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cl-credit-main b { color: var(--text); font-weight: 500; }
.cl-credit-main span { font-size: 12px; color: var(--text-3); }
.cl-steps { margin: 0; padding: 0 0 0 20px; display: flex; flex-direction: column; gap: 14px; }
.cl-steps > li > b { display: block; font-weight: 600; margin-bottom: 6px; }
.cl-steps-body .cl-adm-btnrow { margin: 8px 0 0; }
.cl-import-fail { margin: 12px 0 0; max-height: 200px; overflow-y: auto; }
.cl-wu-times { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 4px; }
.cl-wu-time { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.cl-time { width: 120px; }
/* 计费：价格表 */
.cl-usd-wrap { display: flex; align-items: center; gap: 6px; max-width: 200px; }
.cl-usd-wrap > span { color: var(--text-2); }
.cl-ptable { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 12px; }
.cl-ptable th { font-size: 12px; font-weight: 500; color: var(--text-3); text-align: left; padding: 6px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.cl-ptable th.is-num { text-align: right; }
.cl-ptable td { padding: 6px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cl-ptable tbody tr:last-child td { border-bottom: 0; }
.cl-ptable tr.is-default td { background: var(--bg-subtle); }
.cl-price { height: 30px; width: 76px; padding: 0 8px; text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }
.cl-price.is-bad { border-color: var(--danger); }
.cl-price-dflt { display: block; text-align: right; color: var(--text-3); font-variant-numeric: tabular-nums; padding-right: 9px; }
.cl-price-model { display: flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap; }
.cl-price-sub { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.cl-price-long { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; color: var(--text-2); }
.cl-price-long .cl-check { width: 13px; height: 13px; }
.cl-price-tag { font-size: 11px; padding: 0 6px; border-radius: 4px; background: var(--bg-active); color: var(--text-2); }
.cl-price-hint { font-size: 11.5px; }
.cl-ptable tr.is-long td { background: var(--bg-subtle); border-bottom-style: dashed; }
.cl-ptable tr.is-default + tr.is-long td { background: var(--bg-subtle); }
.cl-price-longlabel { display: flex; align-items: center; gap: 6px; padding-left: 21px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.cl-price-k { width: 64px; }
.cl-ptable tr.is-inherit td { color: var(--text-3); }
.cl-code-form { display: grid; grid-template-columns: 1.1fr .8fr .9fr .9fr 1.6fr; gap: 12px; margin-top: 14px; align-items: start; }
.cl-code-form .cl-field { margin-bottom: 0; }
.cl-codes { margin-top: 22px; }
.cl-batch-sel { height: 28px; width: auto; font-size: 13px; padding-left: 10px; }
.cl-mt.is-codes td { white-space: normal; max-width: none; }
.cl-mt.is-codes td.is-num { white-space: nowrap; }
.cl-mt.is-codes .cl-mt-name { flex-wrap: nowrap; }
.cl-mt.is-codes .cl-mt-nm { overflow: visible; }
.cl-codes-out { min-height: 0; font-size: 13.5px; line-height: 22px; letter-spacing: .04em; }
/* 成员：余额 */
.cl-wallet-bal { font: 400 26px/34px var(--font-serif); color: var(--text); margin: 2px 0 2px; font-variant-numeric: tabular-nums; }
.cl-wallet-bal.is-neg { color: var(--danger); }
.cl-wallet-redeem { margin-top: 10px; max-width: 520px; flex-wrap: wrap; }
.cl-wallet-redeem > .cl-input-text { flex: 1 1 200px; }
/* 充值（示例收款码） */
.cl-topup .cl-pay-tabs { margin-bottom: 14px; }
.cl-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cl-chipbtn { height: 34px; min-width: 64px; padding: 0 14px; border-radius: 17px; box-shadow: inset 0 0 0 1px var(--border-2); font-weight: 500; font-variant-numeric: tabular-nums; }
.cl-chipbtn:hover { background: var(--bg-hover); }
.cl-chipbtn[aria-checked="true"] { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-bg); color: var(--text); }
.cl-topup .cl-usd { max-width: 200px; margin-top: 8px; }
.cl-qr { --qr-tone: #1677ff; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 16px 16px; border-radius: var(--r-lg); background: var(--bg-subtle); box-shadow: inset 0 0 0 1px var(--border); margin: 4px 0 14px; }
.cl-qr-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; max-width: 240px; }
.cl-qr-brand { font-weight: 600; color: var(--qr-tone); }
.cl-qr-tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); }
.cl-qr-img { width: 196px; height: 196px; padding: 8px; border-radius: 12px; background: #fff; box-shadow: 0 0 0 3px var(--qr-tone); }
.cl-qr-svg { display: block; width: 100%; height: 100%; shape-rendering: crispEdges; }
.cl-qr-amt { font-size: 14px; font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }
.cl-qr-note { font-size: 12px; color: var(--text-3); }
.cl-topup .cl-adm-note + .cl-field { margin-top: 14px; }
.cl-topup-steps { font-size: 13.5px; line-height: 21px; color: var(--text); padding: 10px 12px; border-radius: var(--r-md); background: var(--accent-bg); }

/* ---------- 手机（< 768px） ---------- */
@media (max-width: 767px) {
  .cl-side {
    position: fixed; left: 0; top: 0; bottom: 0; width: min(304px, 86vw); transform: translateX(-102%); box-shadow: none;
    transition: transform .22s var(--ease), box-shadow .22s; z-index: 60;
  }
  :root[data-side="collapsed"] .cl-app .cl-side { width: min(304px, 86vw); }
  :root[data-side="collapsed"] .cl-app .cl-wordmark, :root[data-side="collapsed"] .cl-app .cl-side-scroll, :root[data-side="collapsed"] .cl-app .cl-nav-label,
  :root[data-side="collapsed"] .cl-app .cl-acct-name, :root[data-side="collapsed"] .cl-app .cl-acct-plan, :root[data-side="collapsed"] .cl-app .cl-theme-btn,
  :root[data-side="collapsed"] .cl-app .cl-side-top .cl-grow, :root[data-side="collapsed"] .cl-app .cl-console-btn { display: revert; }
  :root[data-side="collapsed"] .cl-app .cl-nav-item { width: 100%; padding: 0 10px; }
  :root[data-side="collapsed"] .cl-app .cl-acct { flex: 1; width: auto; justify-content: flex-start; padding: 0 6px; }
  .cl-app.nav-open .cl-side { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .2); }
  .cl-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity .22s; }
  .cl-app.nav-open .cl-scrim { opacity: 1; pointer-events: auto; }
  .cl-menu-btn { display: inline-flex; }
  .cl-home-main { padding-top: max(72px, calc(30vh - 40px)); }
  .cl-greet h1, .cl-incog-hero h1 { font-size: 26px; }
  .cl-greet .cl-brand-mark { width: 26px; height: 26px; }
  .cl-home-extra { margin-top: 40px; padding: 0; }
  .cl-thread { padding: 24px 12px 24px; }
  .cl-dock { padding: 0 8px max(6px, env(safe-area-inset-bottom)); }
  .cl-disclaimer { display: none; }
  .cl-composer.is-chat .cl-under { display: flex; }
  .cl-composer.is-chat .cl-tools-left { flex: 1; }
  .cl-head { padding: 0 8px 0 4px; }
  .cl-crumb, .cl-crumb-sep { display: none; }
  .cl-share-btn span { display: none; }
  .cl-bubble { max-width: 92%; }
  .cl-acts .cl-acts-hover, .cl-acts .cl-acts-time { opacity: 1; }
  .cl-page > .cl-topbar { position: sticky; background: var(--bg-page); }
  .cl-page-inner { padding: 4px 16px 48px; }
  .cl-page-head { margin-bottom: 16px; flex-wrap: wrap; }
  .cl-page-title { font-size: 24px; }
  .cl-page-search { width: 100%; order: 5; }
  .cl-pgrid { grid-template-columns: 1fr; }
  .cl-proj { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .cl-proj-side { position: static; }
  .cl-settings { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .cl-set-nav { flex-direction: row; overflow-x: auto; position: static; margin: 0 -16px; padding: 0 16px; }
  .cl-set-tab { flex: none; }
  .cl-cards4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cl-two { grid-template-columns: 1fr; }
  .cl-li-time { display: none; }
  .cl-dlg { border-radius: 16px; }
  .cl-dlg-head { padding: 16px 16px 0 18px; }
  .cl-dlg-body { padding: 12px 18px 6px; }
  .cl-dlg-foot { padding: 12px 18px 16px; }
  .cl-toasts { bottom: 88px; }
  .cl-topbar { padding: 0 4px; }
  /* 管理后台、提示条 */
  .cl-topban { justify-content: flex-start; padding: 8px 42px 8px 12px; font-size: 13px; }
  .cl-topban-text { justify-content: flex-start; text-align: left; }
  .cl-topban-x { right: 8px; }
  .cl-maint.is-hero .cl-maint-main h1 { font-size: 26px; }
  .cl-set-navgroup { display: contents; }
  .cl-set-navgroup + .cl-set-navgroup { margin-top: 0; }
  .cl-set-group { flex: none; align-self: center; padding: 0 6px 0 12px; margin-left: 6px; border-left: 1px solid var(--border); white-space: nowrap; }
  .cl-settings.is-wide { grid-template-columns: minmax(0, 1fr); }
  .cl-adm-head { flex-wrap: wrap; gap: 12px; }
  .cl-adm-search { max-width: none; flex-basis: 100%; }
  .cl-adm-toolbar-r { margin-left: 0; width: 100%; justify-content: space-between; }
  .cl-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cl-stat-v { font-size: 21px; line-height: 28px; }
  .cl-mchecks, .cl-adm-limits { grid-template-columns: minmax(0, 1fr); }
  .cl-adm-inline { flex-direction: column; align-items: stretch; gap: 6px; }
  .cl-adm-inline .cl-select { max-width: none; }
  .cl-adm-block .cl-set-row { flex-wrap: wrap; }
  .cl-adm-block .cl-set-row > .cl-select { width: 100%; }
  .cl-audit-detail { margin-left: 6px; }
  /* 表格 → 卡片 */
  .cl-mt, .cl-mt tbody { display: block; width: 100%; }
  .cl-mt thead { display: none; }
  .cl-mt tr { display: grid; grid-template-columns: 42px minmax(0, 1fr) 36px; padding: 12px 0 10px; border-bottom: 1px solid var(--border); }
  .cl-mt tbody tr:last-child { border-bottom: 0; }
  .cl-mt td { display: block; padding: 0; border: 0; white-space: normal; text-align: left; overflow: visible; }
  .cl-mt td:first-child { padding-left: 0; }
  .cl-mt tbody tr:hover td { background: none; }
  .cl-mt-who { grid-column: 1 / 3; grid-row: 1; }
  .cl-mt.is-top .cl-mt-who { grid-column: 1 / -1; }
  .cl-mt td.cl-mt-act { grid-column: 3; grid-row: 1; padding: 0; align-self: start; }
  .cl-mt td[data-label] { grid-column: 2 / -1; display: flex; justify-content: space-between; gap: 12px; padding-top: 5px; font-size: 12.5px; line-height: 17px; text-align: right; }
  .cl-mt td[data-label]::before { content: attr(data-label); color: var(--text-3); text-align: left; }
  /* 账号池 / 计费 */
  .cl-adm-two, .cl-stats.is-3 { grid-template-columns: minmax(0, 1fr); }
  .cl-stats.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cl-pool-row { flex-wrap: wrap; padding: 12px; }
  .cl-adm .cl-set-row { flex-wrap: wrap; }
  .cl-adm .cl-set-row > .cl-select { width: 100%; }
  .cl-pool-order { flex-direction: row; width: auto; }
  .cl-pool-grip { display: none; }
  .cl-pool-main { flex-basis: calc(100% - 40px); order: 1; }
  .cl-pool-side { order: 2; width: 100%; justify-content: flex-end; border-top: 1px solid var(--border); padding-top: 8px; }
  .cl-pool-arrows { flex-direction: row; gap: 4px; }
  .cl-pool-arrows .cl-ibtn { height: 28px; }
  .cl-pool-bars { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .cl-pool-bars.is-one { max-width: none; }
  .cl-code-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cl-code-form .cl-field:last-child { grid-column: 1 / -1; }
  .cl-ptable { min-width: 560px; }
  .cl-mt.is-auto td { max-width: none; }
  .cl-qr-img { width: 176px; height: 176px; }
}
/* 触屏：消息操作一直显示（没有悬停） */
@media (hover: none) and (pointer: coarse) {
  .cl-acts-hover, .cl-acts-time, .cl-li-more, .cl-pfile .cl-ibtn { opacity: 1 !important; }
  .cl-row-more { display: inline-flex; opacity: .55; }
  .cl-row.is-active .cl-row-more, .cl-row-more.is-menu-open { opacity: 1; }
  .cl-row-link { padding-right: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .cl-shimmer { color: var(--text-2); background: none; }
}
