/* ==========================================================================
   RuChat — 样式
   风格: 温暖、安静 (参考桌面聊天应用的观感), 单一陶土色强调色只用于主要操作。
   8px 网格 · 10–20px 圆角 · 细线边框 · 极淡阴影 · 无外部字体 / 图片 / CDN
   ========================================================================== */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", system-ui, sans-serif;
  --font-serif: "Iowan Old Style", "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --side-w: 288px;
  --rail-w: 56px;
  --col-w: 760px;
  --rtp-w: 400px; /* 讨论侧栏 (ASK-029) */

  /* 浅色 */
  --bg: #FAF9F5;
  --side: #F0EEE6;
  --surface: #FFFFFF;
  --bubble: #F0EEE6;
  --text: #1F1E1D;
  --text-2: #3D3D3A;
  --text-3: #73726C;
  --text-4: #9C9A92;
  --line: rgba(31, 30, 29, .10);
  --line-2: rgba(31, 30, 29, .15);
  --line-3: rgba(31, 30, 29, .26);
  --hover: rgba(31, 30, 29, .05);
  --hover-2: rgba(31, 30, 29, .08);
  --side-hover: rgba(31, 30, 29, .045);
  --side-active: rgba(31, 30, 29, .075);
  --nav-hover: rgba(31, 30, 29, .09); /* 侧栏五项的悬停 / 当前页 (ASK-064) */
  --code-bg: rgba(31, 30, 29, .06);
  --code-block: #F3F1EA;
  --scroll: rgba(31, 30, 29, .18);
  --backdrop: rgba(31, 30, 29, .32);

  --brand: #C96442;
  --brand-hover: #B5573A;
  --brand-text: #A84F33;
  --brand-soft: rgba(201, 100, 66, .10);
  --brand-line: rgba(201, 100, 66, .32);
  --on-brand: #FFFFFF;
  --focus: rgba(201, 100, 66, .55);

  --amber: #9A5B00;
  --amber-bg: #FAF0DC;
  --amber-line: #EBD3A6;
  --danger: #B4372E;
  --run-err: #A2462B;
  --note-text: #6b6a67;
  --note-line: #d9d6cf;
  --danger-bg: #FBECE9;
  --danger-line: #F0C9C2;
  --on-danger: #FFFFFF;
  --ok: #2E7D4F;
  --ok-bg: #E8F3EC;

  /* 模型配色 (与暖色背景协调, 浅深两套) */
  --m0: #3E7BCB; --m1: #2F8F6A; --m2: #B7791F; --m3: #8A63C7;
  --m4: #C2507A; --m5: #2A8E9A; --m6: #7A8A2E; --m7: #6A7587;
  --on-accent: #FFFFFF;
  --accent: var(--m7);

  --shadow-1: 0 1px 2px rgba(31, 30, 29, .04);
  --shadow-composer: 0 1px 2px rgba(31, 30, 29, .03), 0 6px 20px rgba(31, 30, 29, .05);
  --shadow-composer-focus: 0 1px 2px rgba(31, 30, 29, .04), 0 8px 28px rgba(31, 30, 29, .08);
  --shadow-pop: 0 10px 32px rgba(31, 30, 29, .12), 0 1px 3px rgba(31, 30, 29, .06);
  --shadow-modal: 0 24px 72px rgba(31, 30, 29, .20), 0 2px 6px rgba(31, 30, 29, .06);

  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

/* 深色: 跟随系统 (未手动指定浅色时) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #262624; --side: #1F1E1D; --surface: #30302E; --bubble: #3A3936;
    --text: #ECEBE4; --text-2: #CFCDC4; --text-3: #A3A199; --text-4: #7C7A73;
    --line: rgba(236, 235, 228, .10); --line-2: rgba(236, 235, 228, .15); --line-3: rgba(236, 235, 228, .26);
    --hover: rgba(236, 235, 228, .06); --hover-2: rgba(236, 235, 228, .09);
    --side-hover: rgba(236, 235, 228, .05); --side-active: rgba(236, 235, 228, .085); --nav-hover: rgba(236, 235, 228, .09);
    --code-bg: rgba(236, 235, 228, .09); --code-block: #1F1E1D; --scroll: rgba(236, 235, 228, .18); --backdrop: rgba(0, 0, 0, .5);
    --brand-text: #E5906F; --brand-soft: rgba(217, 119, 87, .15); --brand-line: rgba(217, 119, 87, .4); --focus: rgba(229, 144, 111, .6);
    --amber: #E5B061; --amber-bg: rgba(229, 176, 97, .12); --amber-line: rgba(229, 176, 97, .32);
    --run-err: #E3967C; --seg-on: #4A4946;
    --danger: #F09084; --danger-bg: rgba(240, 144, 132, .12); --danger-line: rgba(240, 144, 132, .32); --on-danger: #1A1A19;
    --ok: #7CC79A; --ok-bg: rgba(124, 199, 154, .12);
    --m0: #74A3E6; --m1: #62BE96; --m2: #DDA54A; --m3: #B092E8; --m4: #E681A4; --m5: #5DBAC4; --m6: #ADBD5E; --m7: #9CA6B6;
    --on-accent: #1A1A19;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .2);
    --shadow-composer: 0 1px 2px rgba(0, 0, 0, .2), 0 6px 20px rgba(0, 0, 0, .18);
    --shadow-composer-focus: 0 1px 2px rgba(0, 0, 0, .25), 0 8px 28px rgba(0, 0, 0, .28);
    --shadow-pop: 0 10px 32px rgba(0, 0, 0, .4), 0 1px 3px rgba(0, 0, 0, .3);
    --shadow-modal: 0 24px 72px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
/* 深色: 手动指定 */
:root[data-theme="dark"] {
  --bg: #262624; --side: #1F1E1D; --surface: #30302E; --bubble: #3A3936;
  --text: #ECEBE4; --text-2: #CFCDC4; --text-3: #A3A199; --text-4: #7C7A73;
  --line: rgba(236, 235, 228, .10); --line-2: rgba(236, 235, 228, .15); --line-3: rgba(236, 235, 228, .26);
  --hover: rgba(236, 235, 228, .06); --hover-2: rgba(236, 235, 228, .09);
  --side-hover: rgba(236, 235, 228, .05); --side-active: rgba(236, 235, 228, .085); --nav-hover: rgba(236, 235, 228, .09);
  --code-bg: rgba(236, 235, 228, .09); --code-block: #1F1E1D; --scroll: rgba(236, 235, 228, .18); --backdrop: rgba(0, 0, 0, .5);
  --brand-text: #E5906F; --brand-soft: rgba(217, 119, 87, .15); --brand-line: rgba(217, 119, 87, .4); --focus: rgba(229, 144, 111, .6);
  --amber: #E5B061; --amber-bg: rgba(229, 176, 97, .12); --amber-line: rgba(229, 176, 97, .32);
  --run-err: #E3967C; --seg-on: #4A4946;
  --danger: #F09084; --danger-bg: rgba(240, 144, 132, .12); --danger-line: rgba(240, 144, 132, .32); --on-danger: #1A1A19;
  --ok: #7CC79A; --ok-bg: rgba(124, 199, 154, .12);
  --m0: #74A3E6; --m1: #62BE96; --m2: #DDA54A; --m3: #B092E8; --m4: #E681A4; --m5: #5DBAC4; --m6: #ADBD5E; --m7: #9CA6B6;
  --on-accent: #1A1A19;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .2);
  --shadow-composer: 0 1px 2px rgba(0, 0, 0, .2), 0 6px 20px rgba(0, 0, 0, .18);
  --shadow-composer-focus: 0 1px 2px rgba(0, 0, 0, .25), 0 8px 28px rgba(0, 0, 0, .28);
  --shadow-pop: 0 10px 32px rgba(0, 0, 0, .4), 0 1px 3px rgba(0, 0, 0, .3);
  --shadow-modal: 0 24px 72px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ==========================================================================
   基础
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.65 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }
h1, h2, h3, h4, p { margin: 0; }
kbd { font-family: var(--font-sans); }
.ic { width: 18px; height: 18px; flex: none; display: block; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--brand-soft); }

* { scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 12px; top: -48px; z-index: 200; padding: 8px 12px; border-radius: 8px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); text-decoration: none; transition: top .15s var(--ease); }
.skip-link:focus { top: 12px; }

/* 通用小部件 */
.icon-btn {
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: 8px; color: var(--text-3);
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn .ic { width: 18px; height: 18px; }
.icon-btn-sm { width: 26px; height: 26px; border-radius: 6px; }
.icon-btn-sm .ic { width: 15px; height: 15px; }

.link-btn {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  color: var(--brand-text); font-weight: 500; border-radius: 6px; padding: 0 2px;
}
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.link-btn .ic { width: 14px; height: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none;
  height: 36px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), opacity .15s;
}
.btn:hover:not(:disabled) { background: var(--hover-2); }
.btn .ic { width: 16px; height: 16px; }
.btn:disabled { opacity: .5; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-primary:hover:not(:disabled) { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: var(--on-danger); }
.btn-danger:hover:not(:disabled) { filter: brightness(.94); background: var(--danger); }
.btn-danger-ghost { background: transparent; border-color: transparent; color: var(--danger); padding: 0 10px; }
.btn-danger-ghost:hover:not(:disabled) { background: var(--danger-bg); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.is-loading { cursor: progress; opacity: .7; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px;
  border-radius: 6px; background: var(--hover); color: var(--text-2);
  font-size: 11.5px; font-weight: 500; line-height: 1; white-space: nowrap;
}
.badge .ic { width: 12px; height: 12px; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-bad { background: var(--danger-bg); color: var(--danger); }
.badge-muted { color: var(--text-3); }

/* 本地 / 远程: 18×18 的图标徽标, 不带文字 (ASK-076); .loc-gone「连接已删除」仍是文字, 自己加横向 padding */
.loc {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  min-width: 18px; height: 18px;
  border-radius: 5px; border: 1px solid var(--line); color: var(--text-3);
  font-size: 11px; font-weight: 500; line-height: 1; white-space: nowrap;
}
.loc .ic { width: 12px; height: 12px; }
.loc-remote { color: var(--amber); border-color: var(--amber-line); background: var(--amber-bg); }
.loc-gone { padding: 0 6px; color: var(--text-4); border-style: dashed; }

.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent);
  font: 600 11px/1 var(--font-sans); letter-spacing: 0; user-select: none;
}
.avatar.xs { width: 20px; height: 20px; font-size: 9.5px; }
.avatar.sm { width: 20px; height: 20px; font-size: 10px; }
.avatar.lg { width: 32px; height: 32px; font-size: 12.5px; }
.avatar.off { filter: grayscale(1); opacity: .5; }

.dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.spinner {
  display: inline-block; flex: none; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite;
}

/* 悬停提示 (仅在有悬停能力的设备上) */
@media (hover: hover) {
  [data-tip]:hover::after {
    content: attr(data-tip); position: absolute; z-index: 60; pointer-events: none;
    top: calc(100% + 6px); left: 50%; transform: translateX(-50%);
    padding: 4px 8px; border-radius: 6px; background: var(--text); color: var(--bg);
    font: 500 12px/1.4 var(--font-sans); white-space: nowrap; box-shadow: var(--shadow-1);
    animation: tip-in .12s .4s both;
  }
  [data-tip-pos="top"]:hover::after { top: auto; bottom: calc(100% + 6px); }
  [data-tip-pos="top-start"]:hover::after { top: auto; bottom: calc(100% + 6px); left: 0; transform: none; }
  [data-tip-pos="bottom-end"]:hover::after { left: auto; right: 0; transform: none; }
  [data-tip-pos="top-end"]:hover::after { top: auto; bottom: calc(100% + 6px); left: auto; right: 0; transform: none; }
  [data-tip-pos="right"]:hover::after { top: 50%; left: calc(100% + 8px); transform: translateY(-50%); }
}

/* ==========================================================================
   整体布局
   ========================================================================== */
#app { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }

/* ---------------- 侧边栏 ---------------- */
.sidebar {
  flex: none; width: var(--side-w); height: 100%;
  display: flex; flex-direction: column;
  background: var(--side); border-right: 1px solid var(--line);
  transition: width .2s var(--ease), transform .25s var(--ease);
  overflow: hidden;
}
.side-top {
  flex: none; height: 56px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 10px 0 16px; gap: 8px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { display: block; width: 39px; height: 24px; flex: none; }
.brand-mark img, .brand-mark svg { object-fit: contain; display: block; width: 100%; height: 100%; }
.brand-name { font: 500 17px/1.2 var(--font-serif); color: var(--text); white-space: nowrap; letter-spacing: .01em; }

/* 五项照 Claude 桌面 (ASK-064 P0, 截图 1.5 倍缩放已换算): 32px 行 / 2px 间距 / 8px 圆角 / 20px 图标 / 文字起点 38px / 14px 400 黑字 */
.side-nav { flex: none; display: flex; flex-direction: column; gap: 2px; padding: 4px 8px 0; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 10px; width: 100%;
  height: 32px; padding: 0 8px; border-radius: 8px;
  color: var(--text); font-size: 14px; font-weight: 400; text-align: left; white-space: nowrap;
  transition: background-color .15s var(--ease);
}
.nav-item:hover, .nav-item[aria-current="page"] { background: var(--nav-hover); }
.nav-ic { display: inline-grid; place-items: center; width: 20px; height: 20px; flex: none; color: inherit; }
.nav-ic .ic { width: 20px; height: 20px; stroke-width: 1.75; }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.kbd-hint { margin-left: auto; font-size: 11px; color: var(--text-4); opacity: 0; transition: opacity .15s; }
.nav-item:hover .kbd-hint, .nav-item:focus-visible .kbd-hint { opacity: 1; }
@media (hover: none) { .nav-item { height: 40px; } }

/* 「已置顶」「最近」两节在同一个滚动区里一起滚 (照 Claude 桌面) */
.side-section { flex: 1; min-height: 0; overflow-y: auto; margin-top: 16px; }
.side-label { padding: 0 16px 4px; font-size: 12px; font-weight: 500; color: var(--text-3); }
.history { padding: 2px 8px 16px; }
#pinned { padding-bottom: 8px; }
.hist-item {
  position: relative; display: flex; align-items: center; height: 32px; border-radius: 8px;
  transition: background-color .12s var(--ease);
}
.hist-item:hover { background: var(--side-hover); }
.hist-item.active { background: var(--side-active); }
.hist-open { flex: 1; min-width: 0; height: 100%; padding: 0 8px; text-align: left; border-radius: 8px; color: var(--text-2); font-size: 13.5px; }
.hist-item.active .hist-open { color: var(--text); }
.hist-title { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hist-live { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); margin: 0 4px; animation: pulse 1.4s ease-in-out infinite; }
.hist-more {
  flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 3px;
  border-radius: 6px; color: var(--text-3); opacity: 0; transition: opacity .12s, background-color .12s;
}
.hist-more .ic { width: 16px; height: 16px; }
.hist-more:hover { background: var(--hover-2); color: var(--text); }
.hist-item:hover .hist-more, .hist-item:focus-within .hist-more, .hist-more[aria-expanded="true"] { opacity: 1; }
@media (hover: none) { .hist-more { opacity: .6; } }
.hist-empty { padding: 8px; font-size: 13px; color: var(--text-3); }
.hist-rename {
  width: 100%; height: 30px; padding: 0 8px; border-radius: 8px;
  border: 1px solid var(--brand-line); background: var(--surface); font-size: 13.5px;
  box-shadow: 0 0 0 3px var(--brand-soft); outline: none;
}

.side-foot {
  flex: none; display: flex; align-items: center; gap: 8px;
  padding: 8px 8px 10px 16px; border-top: 1px solid var(--line);
}

.scrim { display: none; }

/* 宽屏收起: 窄图标栏 */
@media (min-width: 861px) {
  :root[data-side="collapsed"] .sidebar { width: var(--rail-w); }
  :root[data-side="collapsed"] .side-top { justify-content: center; padding: 0; }
  :root[data-side="collapsed"] .brand,
  :root[data-side="collapsed"] .nav-label,
  :root[data-side="collapsed"] .kbd-hint,
  :root[data-side="collapsed"] .side-section { display: none; }
  :root[data-side="collapsed"] .side-nav { align-items: center; padding: 4px 0 0; }
  :root[data-side="collapsed"] .nav-item { width: 36px; justify-content: center; padding: 0; }
  :root[data-side="collapsed"] .side-foot { justify-content: center; padding: 8px 0 10px; margin-top: auto; }
  :root[data-side="collapsed"] .side-nav { flex: 1; }
}
@media (min-width: 861px) and (hover: hover) {
  :root[data-side="collapsed"] [data-rail-tip]:hover::after {
    content: attr(data-rail-tip); position: absolute; z-index: 60; pointer-events: none;
    top: 50%; left: calc(100% + 8px); transform: translateY(-50%);
    padding: 4px 8px; border-radius: 6px; background: var(--text); color: var(--bg);
    font: 500 12px/1.4 var(--font-sans); white-space: nowrap; animation: tip-in .12s .3s both;
  }
  :root[data-side="collapsed"] .sidebar { overflow: visible; }
}

/* ---------------- 主区 ---------------- */
.main { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; position: relative; background: var(--bg); }
.topbar {
  flex: none; height: 56px; display: flex; align-items: center; gap: 4px; padding: 0 12px 0 16px;
  border-bottom: 1px solid transparent; transition: border-color .2s;
  position: relative; z-index: 5; background: var(--bg);
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar-side-btn { display: none; }
.title-wrap { min-width: 0; display: flex; align-items: center; }
.room-title {
  min-width: 0; max-width: min(56vw, 560px); padding: 4px 8px; border-radius: 8px;
  font: 400 16.5px/1.4 var(--font-serif); color: var(--text); text-align: left;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  transition: background-color .15s;
}
.room-title:hover:not(:disabled) { background: var(--hover); }
.room-title:disabled { cursor: default; }
.main.is-draft .room-title { visibility: hidden; }
.room-title-input {
  width: min(440px, 60vw); height: 32px; padding: 0 8px; border-radius: 8px;
  border: 1px solid var(--brand-line); background: var(--surface); box-shadow: 0 0 0 3px var(--brand-soft);
  font: 400 16px/1.4 var(--font-serif); outline: none;
}
.topbar-spacer { flex: 1; }
.avatars-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px 0 6px;
  border-radius: 9px; color: var(--text-2); font-size: 13px; transition: background-color .15s;
}
.avatars-btn:hover { background: var(--hover); }
.stack { display: inline-flex; align-items: center; }
.stack > * { box-shadow: 0 0 0 2px var(--bg); }
.stack > * + * { margin-left: -6px; }
.stack .more { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 10px; background: var(--hover-2); color: var(--text-3); font-size: 10.5px; font-weight: 600; }
.stack .more .ic { width: 13px; height: 13px; }

.scroller { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; scroll-padding-bottom: 24px; }
.column { width: 100%; max-width: var(--col-w); margin: 0 auto; }
.thread { padding: 16px 24px 40px; }

/* 首页: 问候语与输入框作为一组在垂直方向居中 */
.main.is-home .scroller { flex: 0 0 auto; margin-top: auto; overflow: visible; }
.main.is-home .thread { padding-bottom: 24px; }
.main.is-home .composer-zone { margin-bottom: auto; padding-bottom: max(10vh, 24px); }
.main.is-home .composer-zone::before { display: none; }
.main.is-home #input { min-height: 52px; }

.welcome { text-align: center; animation: fade-up .35s var(--ease) both; }
.welcome-row { display: inline-flex; align-items: center; gap: 14px; max-width: 100%; }
.welcome-mark { display: block; width: 55px; height: 34px; flex: none; }
.welcome-mark img, .welcome-mark svg { object-fit: contain; display: block; width: 100%; height: 100%; }
.greeting { font: 400 clamp(26px, 3.6vw, 38px)/1.2 var(--font-serif); color: var(--text); letter-spacing: -.005em; }
.tagline { margin-top: 12px; color: var(--text-3); font-size: 14.5px; }

/* ==========================================================================
   消息
   ========================================================================== */
.turn { margin-bottom: 40px; }
.turn:last-child { margin-bottom: 8px; }
.turn-user { display: flex; flex-direction: column; align-items: flex-end; }
.user-msg { max-width: min(85%, 600px); display: flex; flex-direction: column; align-items: flex-end; }
.bubble {
  padding: 10px 16px; border-radius: 18px; background: var(--bubble); color: var(--text);
  font-size: 15.5px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere;
}
.user-refs { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-bottom: 8px; }
.ref-link {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 26px; padding: 0 10px;
  border-radius: 999px; border: 1px solid var(--line); color: var(--text-3); font-size: 12.5px;
  transition: background-color .15s, border-color .15s;
}
.ref-link:hover { background: var(--hover); border-color: var(--line-2); color: var(--text-2); }
.ref-link .ic { width: 13px; height: 13px; }
.ref-link .dot { width: 7px; height: 7px; }
.ref-link .ref-text { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 280px; }
.ref-link b { font-weight: 600; color: var(--text-2); }
.user-meta { display: flex; align-items: center; gap: 2px; margin-top: 4px; min-height: 28px; color: var(--text-4); font-size: 12px; opacity: 0; transition: opacity .15s; }
.user-msg:hover .user-meta, .user-msg:focus-within .user-meta { opacity: 1; }
@media (hover: none) { .user-meta { opacity: 1; } }

/* 「全部 / 单个模型」切换 */
.turn-tabs {
  display: flex; width: max-content; max-width: 100%; overflow-x: auto; gap: 2px;
  margin-top: 24px; padding: 3px; border-radius: 10px; background: var(--hover); border: 1px solid var(--line);
  scrollbar-width: none;
}
.turn-tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 6px; flex: none; height: 28px; padding: 0 10px;
  border-radius: 7px; color: var(--text-3); font-size: 13px; white-space: nowrap;
  transition: background-color .15s, color .15s, box-shadow .15s;
}
.tab:hover { color: var(--text); }
.tab.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
.tab .dot { width: 7px; height: 7px; }
.tab-n { font-size: 11px; color: var(--text-4); font-variant-numeric: tabular-nums; }
.tab-st { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.tab-st.busy { background: var(--brand); animation: pulse 1.2s ease-in-out infinite; }
.tab-st.bad { width: auto; height: auto; background: none; color: var(--danger); font-weight: 700; font-size: 12px; line-height: 1; }
.tab-st.off { background: var(--text-4); }

.turn-answers { margin-top: 20px; }
.turn-tabs:not([hidden]) + .turn-answers { margin-top: 16px; }
.answer { position: relative; border-radius: 8px; }
.answer + .answer { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.turn.single .answer { margin-top: 0; padding-top: 0; border-top: 0; }
.answer.is-filtered { display: none; }

.ans-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-height: 24px; margin-bottom: 8px; font-size: 13px; color: var(--text-3); }
.ans-name { font-weight: 600; color: var(--text); font-size: 13.5px; }
.status { font-size: 12.5px; color: var(--text-3); }
.st-generating { color: var(--brand-text); }
.st-failed { color: var(--danger); }
.st-cancelled { color: var(--text-4); }
.picked-tag { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 6px; background: var(--brand-soft); color: var(--brand-text); font-size: 11.5px; font-weight: 500; }
.picked-tag .ic { width: 12px; height: 12px; }
.ans-time { margin-left: auto; font-size: 12px; color: var(--text-4); opacity: 0; transition: opacity .15s; }
.answer:hover .ans-time, .answer:focus-within .ans-time { opacity: 1; }

.ans-body { font-size: 16px; line-height: 1.7; color: var(--text); overflow-wrap: anywhere; }
.ans-empty { color: var(--text-4); font-size: 14px; }
.ans-wait { display: flex; align-items: center; height: 28px; }
.dots { display: inline-flex; gap: 5px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); opacity: .3; animation: dot 1.2s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
.caret {
  display: inline-block; width: 8px; height: 1.05em; margin-left: 3px; vertical-align: -.16em;
  border-radius: 2px; background: var(--accent); animation: blink 1s steps(1) infinite;
}

/* 轻量 Markdown */
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 .8em; white-space: pre-wrap; }
.md h3 { font: 600 1.12em/1.4 var(--font-serif); margin: 1.3em 0 .5em; color: var(--text); }
.md h4 { font-size: 1em; font-weight: 600; margin: 1.1em 0 .4em; }
.md ul, .md ol { margin: 0 0 .8em; padding-left: 1.5em; }
.md li { margin: .25em 0; padding-left: .15em; white-space: pre-wrap; }
.md li::marker { color: var(--text-3); }
.md li > ul, .md li > ol { margin: .25em 0 0; }
.md strong { font-weight: 600; }
.md a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: var(--text-3); overflow-wrap: anywhere; }
.md a:hover { text-decoration-color: currentColor; }
.md blockquote { margin: 0 0 .8em; padding: 2px 0 2px 14px; border-left: 3px solid var(--line-2); color: var(--text-2); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1.2em 0; }
/* Markdown 表格 (ASK-094): 细线、表头加粗、无斑马纹; 宽表在自己的容器里横向滚动 */
.md-table-wrap { margin: 0 0 .8em; max-width: 100%; overflow-x: auto; }
.md-table { border-collapse: collapse; font-size: .94em; line-height: 1.55; }
.md-table th, .md-table td { padding: 7px 14px 7px 0; min-width: 5em; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; white-space: normal; overflow-wrap: break-word; }
.md-table th:last-child, .md-table td:last-child { padding-right: 0; }
.md-table th { font-weight: 600; color: var(--text); border-bottom-color: var(--line-2); }
.md-table tbody tr:last-child td { border-bottom: 0; }
.md code { font-family: var(--font-mono); font-size: .86em; padding: .12em .38em; border-radius: 5px; background: var(--code-bg); }
.code-block { margin: .9em 0; border: 1px solid var(--line); border-radius: 12px; background: var(--code-block); overflow: hidden; }
.code-head { display: flex; align-items: center; justify-content: space-between; height: 36px; padding: 0 6px 0 14px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--text-3); }
.code-lang { font-family: var(--font-mono); }
.code-block pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-size: 13.5px; line-height: 1.6; }
.code-block pre code { padding: 0; background: none; border-radius: 0; font-size: inherit; white-space: pre; }
.code-head .tool { height: 26px; font-size: 12px; }
/* 代码块运行 (ASK-129 P1b): 头上「▶ 运行」在「复制」左边; 输出区在代码下方 (同作品输出区, 小号) */
.code-tools { display: flex; align-items: center; gap: 2px; }
.code-head .code-run .ic { width: 13px; height: 13px; }
.code-head .code-run:disabled { opacity: .4; cursor: default; }
.code-head .code-run:disabled:hover { background: none; color: inherit; }
.code-out { border-top: 1px solid var(--line); background: var(--bg); }
.code-out-scroll { max-height: 320px; overflow: auto; padding: 8px 16px 2px; }
.code-out-scroll:focus { outline: none; }
.code-block pre.code-out-text { margin: 0; padding: 0; overflow: visible; font-size: 12.5px; line-height: 1.55; } /* 不吃 .code-block pre 的内边距 / 字号 */
.code-block pre.code-out-text[hidden] { display: none; }
.code-out-foot { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 6px 2px 16px; font-size: 12px; color: var(--text-4); font-variant-numeric: tabular-nums; }
.code-out-status { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.code-out-status.bad { color: var(--text-3); }

.err-panel {
  display: flex; align-items: flex-start; gap: 8px; margin-top: 4px; padding: 8px 12px;
  border-radius: 10px; background: var(--danger-bg); border: 1px solid var(--danger-line); color: var(--danger);
  font-size: 14px; line-height: 1.55;
}
.err-panel > .ic { width: 16px; height: 16px; margin-top: 3px; }
.err-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.err-text b { font-weight: 600; }
.err-panel .link-btn { color: var(--danger); margin-top: 1px; }
.note {
  display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; padding: 6px 10px;
  border-radius: 8px; background: var(--hover); color: var(--text-3); font-size: 13.5px; line-height: 1.55; width: fit-content; max-width: 100%;
}
.note > .ic { width: 15px; height: 15px; margin-top: 3px; }
.note.warn { background: var(--amber-bg); color: var(--amber); }

.ans-tools { display: flex; align-items: center; gap: 2px; margin: 8px 0 0 -6px; opacity: 0; transition: opacity .15s var(--ease); }
.answer:hover .ans-tools, .answer:focus-within .ans-tools, .ans-tools.pinned { opacity: 1; }
@media (hover: none) { .ans-tools { opacity: 1; } }
.tool {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 28px; height: 28px; padding: 0 6px; border-radius: 7px;
  color: var(--text-3); font-size: 13px; white-space: nowrap;
  transition: background-color .15s, color .15s;
}
.tool .ic { width: 16px; height: 16px; }
.tool:hover { background: var(--hover-2); color: var(--text); }
.tool.on { background: var(--brand-soft); color: var(--brand-text); }
.tool.danger:hover { background: var(--danger-bg); color: var(--danger); }

.flash { animation: flash 1.4s var(--ease); }

/* ==========================================================================
   输入区
   ========================================================================== */
.composer-zone { flex: none; position: relative; padding: 0 24px calc(12px + env(safe-area-inset-bottom)); background: var(--bg); }
.composer-zone::before { content: ""; position: absolute; left: 0; right: 0; top: -24px; height: 24px; background: linear-gradient(to bottom, transparent, var(--bg)); pointer-events: none; }
.composer-column { position: relative; container-type: inline-size; }
.jump-btn {
  position: absolute; top: -48px; left: 50%; transform: translateX(-50%); z-index: 3;
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--text-2); box-shadow: var(--shadow-pop);
}
.jump-btn .ic { width: 16px; height: 16px; }
.jump-btn:hover { color: var(--text); }
/* 多模型综合的提示胶囊 (ASK-109): 与「到底部」同位置居中; 两个都在时「到底部」移到它上方 */
.flow-pill {
  position: absolute; top: -48px; left: 50%; transform: translateX(-50%); z-index: 3;
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; border-radius: 16px; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--text-2); font-size: 13px; box-shadow: var(--shadow-pop);
  animation: fade .2s var(--ease);
}
.flow-pill[hidden] { display: none; }
.flow-pill:hover { color: var(--text); }
.flow-pill-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); flex: none; }
.flow-pill.running .flow-pill-dot { animation: pulse 1.2s ease-in-out infinite; }
.flow-pill.ready { color: var(--brand-text); }
.composer-column.has-flow-pill .jump-btn { top: -88px; }

.composer {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 20px;
  box-shadow: var(--shadow-composer); padding: 12px 12px 10px 16px;
  transition: border-color .15s, box-shadow .2s;
}
.composer:focus-within { border-color: var(--line-3); box-shadow: var(--shadow-composer-focus); }
#input {
  display: block; width: 100%; min-height: 28px; max-height: 240px; padding: 4px 4px 8px 2px;
  border: 0; outline: none; background: transparent; resize: none;
  font-size: 16px; line-height: 1.6; color: var(--text);
}
#input::placeholder { color: var(--text-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* 一行放不下 (窄屏的英文) 时省略, 不折到被裁掉的第二行 */

.composer-bar { display: flex; align-items: center; gap: 8px; min-height: 34px; }
.cb-left { flex: 1 0 auto; display: flex; align-items: center; gap: 6px; }
.cb-right { flex: 0 1 auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.cb-btn {
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--line-2); color: var(--text-2);
  transition: background-color .15s, border-color .15s, color .15s;
}
.cb-btn:hover { background: var(--hover); color: var(--text); }
.cb-btn .ic { width: 17px; height: 17px; }
.cb-btn.attn { border-color: var(--brand-line); color: var(--brand-text); animation: ring 2s ease-out infinite; }
.cb-btn[aria-expanded="true"] { background: var(--hover-2); color: var(--text); }

/* 状态胶囊: 只在偏离默认时出现, 点主体开对应菜单, × 恢复默认 (ASK-044) */
.state-pills { display: flex; align-items: center; gap: 6px; min-width: 0; }
.state-pills[hidden] { display: none; }
.state-pill {
  display: inline-flex; align-items: center; flex: none; height: 28px; border-radius: 8px;
  background: var(--brand-soft); color: var(--text); font-size: 13px; font-weight: 500; white-space: nowrap;
}
.sp-main { display: inline-flex; align-items: center; gap: 5px; height: 100%; padding: 0 2px 0 9px; border-radius: 8px 0 0 8px; color: inherit; }
.sp-main:hover, .sp-main[aria-expanded="true"] { background: var(--brand-soft); }
.sp-main .ic { width: 14px; height: 14px; color: var(--brand-text); }
.sp-x { display: inline-grid; place-items: center; width: 20px; height: 20px; margin: 0 4px 0 2px; border-radius: 6px; color: var(--text-3); }
.sp-x:hover { background: var(--hover-2); color: var(--text); }
.sp-x .ic { width: 12px; height: 12px; stroke-width: 2.2; }

/* 齿轮菜单: 三行 (联网开关 / 思考强度 / 上下文范围), 行列表由 GEAR_ROWS 提供 */
.gear-menu { width: 300px; padding: 6px; }
.gear-row { height: 40px; }
.gear-row .ic { width: 17px; height: 17px; color: var(--text-2); }
.gear-row .pr-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.gear-row .pr-val { font-size: 13px; color: var(--text-3); }
.gear-row .pr-chev { width: 14px; height: 14px; color: var(--text-4); }
.menu-item.gear-row[aria-checked="true"] { background: transparent; }
.menu-item.gear-row[aria-checked="true"]:focus-visible { background: var(--hover-2); }
.gear-sw { display: inline-flex; align-items: center; flex: none; width: 34px; height: 20px; padding: 2px; box-sizing: border-box; border-radius: 10px; background: var(--line-2); transition: background-color .15s; }
.gear-sw::after { content: ""; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); transition: transform .15s var(--ease); }
[aria-checked="true"] > .gear-sw { background: var(--brand); }
[aria-checked="true"] > .gear-sw::after { background: #fff; transform: translateX(14px); }

.model-pills { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.model-pills::-webkit-scrollbar { display: none; }
.model-pills.fade { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent); }
.pill {
  display: inline-flex; align-items: center; gap: 6px; flex: none; height: 30px; padding: 0 10px;
  border-radius: 8px; border: 1px solid var(--line); color: var(--text-3); font-size: 13px; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.pill:hover:not(:disabled) { background: var(--hover); color: var(--text-2); }
.pill .dot { width: 8px; height: 8px; background: transparent; box-shadow: inset 0 0 0 1.5px var(--accent); }
.pill[aria-pressed="true"] { color: var(--text); background: var(--hover); border-color: var(--line-2); }
@supports (background: color-mix(in srgb, red 10%, transparent)) {
  .pill[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 10%, transparent); border-color: color-mix(in srgb, var(--accent) 38%, transparent); }
}
.pill[aria-pressed="true"] .dot { background: var(--accent); box-shadow: none; }
.pill:disabled { opacity: .45; }
.pill:disabled .pill-name { text-decoration: line-through; }
.pill .ic.remote { width: 13px; height: 13px; color: var(--amber); }
.pills-empty { font-size: 13px; color: var(--text-3); white-space: nowrap; display: inline-flex; gap: 4px; }
.mini-btn { flex: none; height: 28px; padding: 0 8px; border-radius: 7px; color: var(--text-3); font-size: 12.5px; white-space: nowrap; }
.mini-btn:hover { background: var(--hover); color: var(--text); }

.ref-chips { display: flex; align-items: center; gap: 4px; max-width: 280px; overflow-x: auto; scrollbar-width: none; }
.ref-chips::-webkit-scrollbar { display: none; }
.ref-chip {
  display: inline-flex; align-items: center; gap: 5px; flex: none; height: 28px; padding: 0 3px 0 8px;
  border-radius: 8px; background: var(--brand-soft); color: var(--brand-text); font-size: 12.5px; font-weight: 500;
}
.ref-chip > .ic { width: 13px; height: 13px; }
.ref-chip .dot { width: 7px; height: 7px; }
.ref-name { max-width: 104px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ref-chip button { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: inherit; opacity: .75; }
.ref-chip button:hover { opacity: 1; background: var(--brand-soft); }
.ref-chip button .ic { width: 13px; height: 13px; }

.send-btn {
  display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: var(--brand); color: var(--on-brand);
  transition: background-color .15s, opacity .15s, transform .1s;
}
.send-btn:hover:not(:disabled) { background: var(--brand-hover); }
.send-btn:active:not(:disabled) { transform: scale(.94); }
.send-btn:disabled { opacity: .35; }
.send-btn .ic { width: 18px; height: 18px; stroke-width: 2.2; }
.send-btn .stop-ic { display: none; width: 12px; height: 12px; }
.send-btn.is-stop { background: var(--text); color: var(--bg); }
.send-btn.is-stop:hover { background: var(--text-2); }
.send-btn.is-stop .send-ic { display: none; }
.send-btn.is-stop .stop-ic { display: block; }
.send-btn.is-busy { cursor: progress; opacity: .6; }

/* 输入框下方: 只在有内容时出现 (没有可用的 master 告警 / 生成中状态行), 平时不占高度 (ASK-044) */
.composer-hint { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 16px; padding: 0 8px; font-size: 12px; color: var(--text-4); }
.scope-hint, .activity { margin-top: 8px; min-height: 18px; }
.scope-hint { display: inline-flex; align-items: center; gap: 5px; color: var(--text-3); }
.scope-hint:empty { display: none; }
.scope-hint .ic { width: 13px; height: 13px; }
.scope-hint .scope-link { margin-left: 4px; }
.activity { display: inline-flex; align-items: center; gap: 8px; color: var(--text-3); }
.activity[hidden] { display: none; }
.activity-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); animation: pulse 1.2s ease-in-out infinite; }
.activity .link-btn { font-size: 12px; color: var(--text-3); text-decoration: underline; text-underline-offset: 2px; }
.activity .link-btn:hover:not(:disabled) { color: var(--text); }
/* 按输入框自身宽度调整 (ASK-029: 讨论侧栏打开时主栏变窄, 视口宽度已不能代表输入框宽度) */
@container (max-width: 640px) {
  .ref-chips { max-width: 40%; }
  .state-pill .sp-k { display: none; } /* 只留图标与值 (完整文字在 title / aria-label 里) */
}
@container (max-width: 480px) {
  /* 手机宽度: + / 胶囊 / master / 麦克风 / 发送 一行放下, master 名字被省略号截断 */
  .composer-bar { gap: 6px; }
  .cb-left { flex: none; }
  .cb-right { flex: 1; gap: 6px; }
  .cb-right .chip-btn-master { flex: 1; justify-content: flex-start; padding: 0 6px 0 8px; }
  .chip-btn-master .chip-label { max-width: none; }
  /* 两个以上胶囊时一行放不下: 胶囊一行, master / 麦克风 / 发送 折到下一行 */
  .composer.has-pills-2 .composer-bar { flex-wrap: wrap; row-gap: 6px; }
  .composer.has-pills-2 .cb-right { flex: 1 1 auto; }
}

.suggest { margin-top: 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; animation: fade-up .35s .05s var(--ease) both; }
.examples { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.example {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
  border-radius: 10px; border: 1px solid var(--line); color: var(--text-2); font-size: 13.5px;
  transition: background-color .15s, border-color .15s, color .15s;
}
.example .ic { width: 16px; height: 16px; color: var(--text-3); }
.example:hover { background: var(--hover); border-color: var(--line-2); color: var(--text); }
.hint-card {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px;
  border-radius: 10px; border: 1px dashed var(--line-3); color: var(--text-2); font-size: 13.5px;
}
.hint-card:hover { background: var(--hover); }
.hint-card .ic { width: 16px; height: 16px; color: var(--text-3); }
.setup-card {
  display: flex; align-items: center; gap: 16px; width: 100%; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-1); text-align: left;
}
.setup-ic { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-text); }
.setup-ic .ic { width: 20px; height: 20px; }
.setup-main { flex: 1; min-width: 0; }
.setup-main h3 { font-size: 15px; font-weight: 600; }
.setup-main p { margin-top: 2px; font-size: 13.5px; color: var(--text-3); line-height: 1.6; }
.setup-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: 12.5px; color: var(--text-3); }
.setup-steps > span { display: inline-flex; align-items: center; gap: 6px; }
.setup-steps b { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--hover-2); color: var(--text-2); font-size: 11px; }
.setup-steps .ic { width: 12px; height: 12px; color: var(--text-4); }

/* ==========================================================================
   弹出层
   ========================================================================== */
.popover {
  position: fixed; z-index: 50; min-width: 200px; max-width: calc(100vw - 16px);
  padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-2);
  box-shadow: var(--shadow-pop); animation: pop-in .14s var(--ease);
}
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px;
  border-radius: 8px; color: var(--text); font-size: 14px; text-align: left; white-space: nowrap;
}
.menu-item .ic { width: 16px; height: 16px; color: var(--text-3); }
.menu-item:hover:not(:disabled), .menu-item:focus-visible { background: var(--hover-2); outline: none; }
.menu-item:disabled { opacity: .45; }
.menu-item.danger, .menu-item.danger .ic { color: var(--danger); }
.menu-aux { margin-left: auto; font-size: 12px; color: var(--text-3); }
.lang-menu { min-width: 150px; } /* 账户行「语言」图标的两行小菜单 (ASK-182): ✓ 在左 */
.menu-lang-opt .menu-check { margin-left: 0; }
.menu-sep { height: 1px; margin: 4px 6px; background: var(--line); }

.picker { width: 340px; padding: 6px; }
.picker-head { padding: 8px 10px 8px; }
.picker-head h3 { font-size: 14px; font-weight: 600; }
.picker-head p { margin-top: 2px; font-size: 12.5px; color: var(--text-3); line-height: 1.5; }
.picker-list { max-height: 320px; overflow-y: auto; }
.picker-empty { padding: 12px 10px; font-size: 13px; color: var(--text-3); }
.pick {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 10px; text-align: left;
  transition: background-color .12s;
}
.pick:hover { background: var(--hover); }
.pick-main { flex: 1; min-width: 0; }
.pick-name { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; color: var(--text); }
.pick-meta { font: 12px/1.5 var(--font-mono); color: var(--text-3); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.check { display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-3); color: var(--on-brand); transition: background-color .12s, border-color .12s; }
.check .ic { width: 13px; height: 13px; opacity: 0; }
.pick[aria-checked="true"] .check { background: var(--brand); border-color: var(--brand); }
.pick[aria-checked="true"] .check .ic { opacity: 1; }
.picker-foot { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); }

/* ==========================================================================
   对话框
   ========================================================================== */
dialog.modal {
  padding: 0; border: 0; border-radius: 16px; background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-modal); width: min(560px, calc(100vw - 32px)); max-height: min(88dvh, 860px);
  overflow: hidden;
}
dialog.modal[open] { display: flex; flex-direction: column; animation: modal-in .18s var(--ease); }
dialog.modal > form[method="dialog"] { display: contents; }
dialog.modal::backdrop { background: var(--backdrop); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); animation: fade .18s; }
.modal-sm { width: min(420px, calc(100vw - 32px)) !important; }
.modal-md { width: min(560px, calc(100vw - 32px)) !important; }
.modal-xl { width: min(940px, calc(100vw - 32px)) !important; }
.modal-head { flex: none; display: flex; align-items: flex-start; gap: 12px; padding: 20px 16px 12px 24px; }
.modal-head > div:not(.modal-icon) { flex: 1; min-width: 0; }
.modal-head h2 { font: 500 20px/1.35 var(--font-serif); color: var(--text); }
.modal-sub { margin-top: 4px; font-size: 13.5px; color: var(--text-3); line-height: 1.55; }
.modal-x { margin: -2px 0 0 auto; }
.modal-icon { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-text); }
.modal-icon .ic { width: 18px; height: 18px; }
.modal-icon.danger { background: var(--danger-bg); color: var(--danger); }
.modal-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 24px 8px; }
.modal-foot { flex: none; display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px 20px; }

/* 搜索聊天 (ASK-064 P0, 照 Claude 桌面): 屏幕中间, 固定高度 (输入时不跳), 上面输入框, 下面结果 */
dialog.search-modal { width: min(640px, calc(100vw - 32px)); height: min(480px, calc(100dvh - 64px)); border-radius: 14px; }
.search-head { flex: none; display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 12px 0 18px; border-bottom: 1px solid var(--line); }
.search-ic { width: 18px; height: 18px; flex: none; color: var(--text-3); }
.search-head input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--text); font-size: 15px; outline: none; }
.search-head input::-webkit-search-cancel-button { display: none; }
.search-head input::placeholder { color: var(--text-4); }
.search-label { flex: none; padding: 12px 18px 4px; font-size: 12px; font-weight: 500; color: var(--text-3); }
.search-results { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 8px; }
.search-label[hidden] + .search-results { padding-top: 8px; }
.sr-item { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 10px; border-radius: 8px; color: var(--text); font-size: 14px; cursor: pointer; }
.sr-item:hover, .sr-item[aria-selected="true"] { background: var(--nav-hover); }
.sr-item > .ic { width: 16px; height: 16px; flex: none; color: var(--text-3); }
.sr-title { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sr-time { flex: none; font-size: 12px; color: var(--text-4); }
.sr-empty { padding: 12px 10px; font-size: 13.5px; color: var(--text-3); }

/* 发送前确认 */
.pv-label { margin-bottom: 6px; font-size: 12px; font-weight: 500; color: var(--text-3); }
.callout { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; padding: 10px 14px; border-radius: 10px; background: var(--hover); color: var(--text-2); font-size: 13.5px; line-height: 1.6; }
.callout > .ic { width: 16px; height: 16px; margin-top: 3px; }
.callout.warn { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-line); }
.callout b { font-weight: 600; }
.pv-foot-note { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12.5px; color: var(--text-3); }
.pv-foot-note .ic { width: 14px; height: 14px; }

/* 模型连接 */
.conn-head { border-bottom: 1px solid var(--line); padding-bottom: 16px; }
.conn-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 300px 1fr; height: min(620px, 72dvh); }
.conn-left { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--side); }
:root[data-theme="dark"] .conn-left { background: rgba(0, 0, 0, .12); }
.conn-left-head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 8px 16px; }
.section-label { font-size: 12px; font-weight: 500; color: var(--text-3); }
.conn-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 12px; display: flex; flex-direction: column; gap: 2px; }
/* 连接卡 = .conn-item (外层, 画底色 / 选中态) > 按钮 .conn-card (点它编辑) + 可选的 .cc-pick (管理员的「我用」型号下拉; 按钮里不能嵌下拉) */
.conn-item { border-radius: 10px; transition: background-color .12s; }
.conn-item:hover { background: var(--side-hover); }
.conn-item.cur { background: var(--surface); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
.conn-card { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 10px; border-radius: 10px; text-align: left; }
.cc-pick { display: flex; align-items: center; gap: 8px; padding: 0 10px 10px 28px; }
.cc-pick-l { flex: none; font-size: 12px; color: var(--text-3); }
.cc-pick .model-variant { flex: 1; min-width: 0; margin-top: 0; height: 28px; }
.status-dot { flex: none; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; }
.status-dot.on { background: var(--ok); }
.status-dot.idle { background: var(--ok); opacity: .45; }
.status-dot.bad { background: var(--danger); }
.status-dot.off { background: transparent; box-shadow: inset 0 0 0 1.5px var(--text-4); }
.cc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cc-name { font-size: 14px; font-weight: 500; color: var(--text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cc-meta { font: 12px/1.5 var(--font-mono); color: var(--text-3); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cc-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
/* Claude 订阅连接的状态行 (ASK-243): 表单里在密钥框的位置, 连接卡上在型号下面 */
.ccode-status { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; font-size: 12.5px; line-height: 1.5; color: var(--text-2); }
.ccode-status[hidden] { display: none; }
.ccode-line { display: block; }
.ccode-status .bad { color: var(--danger); }
.ccode-status .warn { color: var(--amber); }
.ccode-status .fix { color: var(--text-3); }
.cc-main .ccode-status { margin: 3px 0 0; font-size: 12px; }
.conn-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 32px 16px; text-align: center; font-size: 13.5px; color: var(--text-2); }
.conn-empty .ic { width: 24px; height: 24px; color: var(--text-4); margin-bottom: 4px; }
.muted { color: var(--text-3); font-size: 12.5px; }

.conn-form { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.conn-form-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 24px 8px; }
.form-head { margin-bottom: 16px; }
.form-head h3 { font: 500 17px/1.4 var(--font-serif); }
.form-sub { margin-top: 2px; font-size: 13px; color: var(--text-3); }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field-label { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.field input, .field select {
  width: 100%; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--bg); color: var(--text); font-size: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: var(--text-4); }
.field input:focus, .field select:focus { border-color: var(--brand-line); box-shadow: 0 0 0 3px var(--brand-soft); }
.field textarea {
  width: 100%; min-height: 76px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.55; outline: none; resize: vertical;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea::placeholder { color: var(--text-4); }
.field textarea:focus { border-color: var(--brand-line); box-shadow: 0 0 0 3px var(--brand-soft); }
.field-hint { font-size: 12px; color: var(--text-3); line-height: 1.5; }
.field-hint-block { margin: -6px 0 14px; }
.fsep { display: flex; align-items: center; gap: 8px; margin: 10px 0 12px; font-size: 12px; font-weight: 500; color: var(--text-3); }
.fsep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.switch-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.switch {
  appearance: none; -webkit-appearance: none; position: relative; flex: none; margin: 2px 0 0;
  width: 36px; height: 20px; border-radius: 999px; background: var(--line-3); cursor: pointer; transition: background-color .15s;
}
.switch::before { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .18s var(--ease); }
.switch:checked { background: var(--brand); }
.switch:checked::before { transform: translateX(16px); }
.switch:indeterminate { background: var(--brand-line); }
.switch:indeterminate::before { transform: translateX(8px); } /* 「部分」(ASK-237): 圆点在中间 */
.switch-title { display: block; font-size: 14px; font-weight: 500; }
.switch-row .field-hint { display: block; }
.test-result { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; margin-bottom: 8px; border-radius: 10px; background: var(--hover); color: var(--text-2); font-size: 13.5px; line-height: 1.55; }
.test-result > .ic { width: 16px; height: 16px; margin-top: 3px; }
.test-result.ok { background: var(--ok-bg); color: var(--ok); }
.test-result.bad { background: var(--danger-bg); color: var(--danger); }
.tr-sample { display: block; margin-top: 2px; font-size: 12.5px; color: var(--text-2); }
.form-msg { color: var(--danger); font-size: 13px; }
.form-msg:empty { display: none; }
.conn-foot { flex: none; display: flex; align-items: center; gap: 8px; padding: 12px 24px 16px; border-top: 1px solid var(--line); }
.conn-foot-right { display: flex; gap: 8px; margin-left: auto; }

/* 提示条 */
.toast {
  position: fixed; left: 50%; bottom: 112px; transform: translateX(-50%); z-index: 120;
  display: inline-flex; align-items: center; gap: 8px; max-width: calc(100vw - 32px);
  padding: 9px 14px; border-radius: 10px; background: var(--text); color: var(--bg);
  font-size: 13.5px; box-shadow: var(--shadow-pop); animation: toast-in .2s var(--ease);
}
.toast .ic { width: 16px; height: 16px; }
.toast.error .ic { color: #F2A196; }
.toast.ok .ic { color: #8ED1A5; }

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 860px) {
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 40; width: min(var(--side-w), 86vw);
    transform: translateX(-102%); box-shadow: none;
  }
  #app.drawer-open .sidebar { transform: none; box-shadow: var(--shadow-modal); }
  #app.drawer-open .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: var(--backdrop); animation: fade .2s; }
  .topbar-side-btn { display: inline-grid; }
  .topbar { padding: 0 8px; }
  #btn-collapse .ic { transform: scaleX(-1); }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .thread { padding: 12px 16px 32px; }
  .composer-zone { padding: 0 12px calc(8px + env(safe-area-inset-bottom)); }
  .composer { border-radius: 18px; padding: 10px 10px 8px 14px; }
  .composer-hint { justify-content: center; text-align: center; }
  .user-msg { max-width: 92%; }
  .avatars-btn .av-label { display: none; }
  .room-title { max-width: 52vw; font-size: 15.5px; }
  .ans-body { font-size: 15.5px; }
  .turn { margin-bottom: 32px; }
  .setup-card { flex-direction: column; align-items: flex-start; }
  .main.is-home .composer-zone { padding-bottom: 16px; }
  .conn-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: min(720px, 78dvh); }
  .conn-left { border-right: 0; border-bottom: 1px solid var(--line); max-height: 190px; }
  .fgrid { grid-template-columns: 1fr; }
  .modal-head { padding: 16px 12px 10px 18px; }
  .modal-body { padding: 4px 18px 8px; }
  .modal-foot { padding: 12px 18px 16px; }
  .conn-form-scroll { padding: 14px 18px 8px; }
  .conn-foot { padding: 10px 18px 14px; }
  .toast { bottom: 96px; }
}

/* ==========================================================================
   动画
   ========================================================================== */
/* 连接表单: 预设 / 模型 / 高级设置 (ASK-013) */
.field select { appearance: auto; }
.key-link { align-self: flex-start; font-size: 12.5px; color: var(--brand); text-decoration: none; }
.key-link:hover { text-decoration: underline; }
.model-row { display: flex; gap: 8px; align-items: center; min-width: 0; }
.model-row input, .model-row .model-select { flex: 1; min-width: 0; }
.model-row .btn { flex: none; white-space: nowrap; }
.model-select {
  height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--bg); color: var(--text); font-size: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.model-select:focus { border-color: var(--brand-line); box-shadow: 0 0 0 3px var(--brand-soft); }
.link-btn { align-self: flex-start; padding: 0; border: 0; background: none; color: var(--brand); font-size: 12.5px; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.conn-adv { margin: 4px 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.conn-adv > summary {
  display: flex; align-items: center; padding: 10px 14px; font-size: 13px; font-weight: 500; color: var(--text-2);
  cursor: pointer; list-style: none; user-select: none; border-radius: 12px;
}
.conn-adv > summary::-webkit-details-marker { display: none; }
.conn-adv > summary::before {
  content: ""; width: 6px; height: 6px; margin-right: 10px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg); transition: transform .15s var(--ease);
}
.conn-adv[open] > summary::before { transform: rotate(45deg); }
.conn-adv > summary:hover { background: var(--hover); }
.conn-adv > summary:focus-visible { box-shadow: 0 0 0 3px var(--brand-soft); outline: none; }
.adv-sum { margin-left: 4px; font-weight: 400; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conn-adv-body { padding: 14px 14px 0; border-top: 1px solid var(--line); }
@media (max-width: 560px) { .model-row { flex-wrap: wrap; } }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes dot { 0%, 80%, 100% { opacity: .25; transform: scale(.85); } 40% { opacity: 1; transform: scale(1); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes ring { 0% { box-shadow: 0 0 0 0 var(--brand-soft); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-3px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes tip-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes flash { 0% { background: var(--brand-soft); box-shadow: 0 0 0 8px var(--brand-soft); } 100% { background: transparent; box-shadow: 0 0 0 8px transparent; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .caret, .dots i { opacity: 1 !important; }
}

/* ==========================================================================
   v2: master / @ 点名 / 语音 / 圆桌 / 设置
   ========================================================================== */
/* 输入区工具栏: master 芯片、范围、麦克风 */
.chip-btn {
  display: inline-flex; align-items: center; gap: 6px; flex: none; min-width: 0; max-width: 100%; height: 30px; padding: 0 8px 0 10px;
  border-radius: 8px; border: 1px solid var(--line-2); color: var(--text-2); font-size: 13px; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.chip-btn:hover { background: var(--hover); color: var(--text); }
.chip-btn[aria-expanded="true"] { background: var(--hover-2); }
.chip-btn .ic { flex: none; width: 14px; height: 14px; color: var(--text-3); }
.chip-btn b { font-weight: 600; color: var(--text); }
.chip-btn .dot { flex: none; }
.chip-label { overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.chip-btn.attn { border-color: var(--brand-line); color: var(--brand-text); }
.chip-btn-master { flex: 0 1 auto; border-color: transparent; } /* 空间不够时先截断 master 名字 */
.cb-mic {
  position: relative; display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 10px;
  border: 1px solid var(--line-2); color: var(--text-2); transition: background-color .15s, border-color .15s, color .15s;
}
.cb-mic:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.cb-mic .ic { width: 17px; height: 17px; }
.cb-mic.is-busy { opacity: .55; cursor: progress; }

/* 附件条 (ASK-045): 图片 56px 缩略图, 文件一行条; 窄屏横向滚动不换行; 上传中压暗并显示百分比, 失败变红并给「重试」 */
.attach-strip { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; min-width: 0; margin: 0 0 8px; padding: 2px 2px 6px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.at-item { position: relative; flex: none; }
.at-image { width: 56px; height: 56px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); background: var(--hover); }
.at-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.at-ov, .at-retry-ov { position: absolute; inset: 0; display: none; place-items: center; }
.at-ov { background: rgba(20, 20, 19, .5); color: #fff; font: 600 12px/1 var(--font-sans); font-variant-numeric: tabular-nums; }
.at-item.is-uploading .at-ov { display: grid; }
.at-retry-ov { background: rgba(120, 30, 25, .72); color: #fff; }
.at-retry-ov:not([hidden]) { display: grid; }
.at-retry-ov .ic { width: 20px; height: 20px; }
.at-image .at-x { position: absolute; top: 3px; right: 3px; z-index: 2; width: 18px; height: 18px; border-radius: 50%; background: rgba(20, 20, 19, .62); color: #fff; }
.at-image .at-x:hover { background: rgba(20, 20, 19, .85); }
.at-x { display: inline-grid; place-items: center; flex: none; }
.at-x .ic { width: 11px; height: 11px; stroke-width: 2.4; }
.at-file { display: inline-flex; align-items: center; gap: 6px; max-width: 260px; height: 36px; padding: 0 4px 0 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--hover); color: var(--text); font-size: 13px; }
.at-file > .ic { width: 15px; height: 15px; flex: none; color: var(--text-3); }
.at-file .at-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.at-file .at-meta { flex: none; color: var(--text-3); white-space: nowrap; }
.at-file .at-x { width: 22px; height: 22px; border-radius: 6px; color: var(--text-3); }
.at-file .at-x:hover { background: var(--hover-2); color: var(--text); }
.at-retry { flex: none; padding: 0 4px; border-radius: 6px; color: var(--danger); font-size: 12.5px; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.at-retry[hidden] { display: none; }
.at-item.is-error.at-file { border-color: var(--danger-line); background: var(--danger-bg); }
.at-item.is-error.at-file .at-meta { color: var(--danger); }
.at-item.is-full.at-file { max-width: min(420px, 100%); height: auto; min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
.at-item.is-full.at-file .at-meta { flex: 1 1 auto; min-width: 0; white-space: normal; line-height: 1.4; }
.at-item.is-full.at-file .at-name { flex: none; max-width: 45%; }
.at-item.is-error.at-image { border-color: var(--danger-line); }
/* 拖文件到输入框上: 品牌色描边 */
.composer.is-drop { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft), var(--shadow-composer); background: var(--brand-soft); }

/* 消息里的附件 (ASK-045): 图片在气泡上方, 文件是下载条 */
.user-atts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; max-width: 100%; margin-bottom: 6px; }
.msg-img { display: block; min-width: 24px; max-width: 100%; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--hover); }
.msg-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.msg-file { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 36px; padding: 0 12px; border-radius: 12px; background: var(--bubble); color: var(--text); font-size: 13.5px; text-decoration: none; }
.msg-file:hover { background: var(--hover-2); }
.msg-file .ic { width: 15px; height: 15px; flex: none; color: var(--text-3); }
.msg-file .mf-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-file .mf-size { flex: none; color: var(--text-3); white-space: nowrap; }
.msg-file.is-deleted { color: var(--text-3); cursor: default; }
.msg-file.is-deleted:hover { background: var(--bubble); }
/* ASK-049: 按类型的图标方块 + 打开/下载 + 音频转写摘录 */
.ft { display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 6px; color: #fff; background: #8b8a85; }
.ft .ic { width: 13px; height: 13px; stroke-width: 2; color: #fff; }
.at-file > .ft { margin-left: -4px; }
.ft-pdf { background: #d9473f; } .ft-docx { background: #2f6fd6; } .ft-xlsx { background: #1f8a4c; } .ft-pptx { background: #d4692a; }
.ft-audio { background: #7c5cd6; } .ft-video { background: #1b8f99; }
.msg-file .ft .ic, .at-file .ft .ic { color: #fff; }
.msg-att { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; max-width: 100%; }
.msg-att-row { display: flex; align-items: center; gap: 4px; max-width: 100%; }
.mf-dl { display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 8px; color: var(--text-3); }
.mf-dl:hover { background: var(--hover-2); color: var(--text); }
.mf-dl .ic { width: 15px; height: 15px; }
.mf-transcript { max-width: min(420px, 100%); color: var(--text-3); font-size: 12.5px; line-height: 1.5; text-align: right; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.at-item.is-busy .at-meta { color: var(--text-2); }

/* 点名: 已选芯片 + @ 浮层 */
.mention-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 8px 2px; }
.mention-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 3px 0 9px; border-radius: 8px;
  background: var(--brand-soft); color: var(--text); font-size: 13px; font-weight: 500;
}
@supports (background: color-mix(in srgb, red 10%, transparent)) {
  .mention-chip { background: color-mix(in srgb, var(--accent) 13%, transparent); }
}
.mention-chip .dot { width: 7px; height: 7px; }
.mention-chip button { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; color: var(--text-3); }
.mention-chip button:hover { background: var(--hover-2); color: var(--text); }
.mention-chip button .ic { width: 12px; height: 12px; }
.at-picker {
  position: absolute; left: 10px; bottom: calc(100% + 8px); z-index: 20; width: min(420px, calc(100% - 20px)); max-height: 260px; overflow-y: auto;
  padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); animation: pop-in .12s var(--ease);
}
.at-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.at-item.active { background: var(--hover-2); }
.at-name { font-weight: 500; color: var(--text); white-space: nowrap; }
.at-model { flex: 1; min-width: 0; font: 12px/1.5 var(--font-mono); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.at-empty { padding: 10px; font-size: 13px; color: var(--text-3); }
.at-foot { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 4px; padding: 8px 10px; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; font-size: 13px; color: var(--text-3); text-align: left; }
.at-foot:hover { color: var(--text); background: var(--hover); }
.at-foot .ic { width: 14px; height: 14px; }
/* 用户自己添加的模型: 列表里的小标签 (ASK-051) */
.mine-tag { flex: none; display: inline-flex; align-items: center; height: 16px; padding: 0 5px; border-radius: 5px; background: var(--hover-2); color: var(--text-3); font-size: 11px; font-weight: 500; line-height: 1; white-space: nowrap; }

/* 内联录音 (替换输入行) */
/* ASK-092: 录音 / 转写时输入框外形不变, 工具栏留在原位; 波形行占文本框的位置 (高度同空输入框 ≈38px), 麦克风 / 发送让给 ✓ */
.composer.is-recording #input, .composer.is-recording #btn-mic, .composer.is-recording #btn-send { display: none; }
.composer.is-recording .rec-row { min-height: 38px; padding: 1px 0 5px; }
.main.is-home .composer.is-recording .rec-row { min-height: 52px; } /* 首页输入框更高 (见 .main.is-home #input) */
.rec-row { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.rec-x { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border: 0; background: none; border-radius: 50%; color: var(--text-3); }
.rec-x:hover { color: var(--text); }
.rec-x .ic { width: 15px; height: 15px; }
.rec-wave { flex: 1; min-width: 0; width: 100%; height: 28px; display: block; color: var(--text); }
.rec-time { flex: none; min-width: 34px; margin-right: 2px; font: 13.5px/1 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--accent); }
.rec-time.late { filter: brightness(1.25); font-weight: 600; }
.rec-ok, .rec-spin { flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; }
.rec-ok { border: 0; background: #22c55e; color: #fff; }
.rec-ok:hover { background: #16a34a; }
.rec-ok .ic { width: 16px; height: 16px; }
.rec-row.is-busy .rec-ok { display: none; }
.rec-spin { background: var(--hover); color: var(--text-2); }
.rec-spin[hidden] { display: none; }
/* 实时转写的文字 (ASK-081): 与输入框同字号、同最大高度; 定稿正常色, 未定稿的临时段 --text-3 */
.rec-live { max-height: 240px; overflow-y: auto; padding: 6px 4px 6px 6px; font-size: 16px; line-height: 1.6; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.rec-partial { color: var(--text-3); }
.rec-note { margin: 6px 4px 0; font-size: 12.5px; line-height: 1.5; color: var(--text-3); }
.rec-note.err { color: var(--danger); }
.rec-note .link-btn { margin-left: 6px; }
.voice-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 4px 0; font-size: 13px; color: var(--text-2); }
.vc-q b { color: var(--text); font-weight: 600; }
.vc-chip { height: 26px; padding: 0 10px; border-radius: 13px; border: 1px solid var(--line-2); font-size: 12.5px; color: var(--text-2); }
.vc-chip:hover { background: var(--hover); color: var(--text); }
.vc-chip.primary { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-text); }

/* 标签 / 菜单 */
.phase-tag { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; margin-left: 6px; border-radius: 5px; background: var(--brand-soft); color: var(--brand-text); font-size: 11px; font-weight: 600; letter-spacing: .02em; }
.menu-head { padding: 8px 10px 6px; font-size: 12px; color: var(--text-3); line-height: 1.5; max-width: 300px; white-space: normal; }
.menu-item .loc { margin-left: auto; }
.menu-item .loc .ic { width: 12px; height: 12px; color: inherit; } /* 压过 .menu-item .ic 的 16px / text-3, 好让云图标是琥珀色 */
.menu-check { margin-left: 4px; color: var(--brand-text) !important; }
.menu-item[aria-checked="true"] { background: var(--hover); }
.menu-item-2 { height: auto; padding: 8px 10px; }
/* master 菜单的行 (ASK-071): .menu-row > 选 master 按钮 + › 按钮 (兄弟节点); 底色画在整行上。› 只在悬停 / 键盘焦点时显示 (opacity, 节点一直在, 行高与布局不变); 没有 › 的行放同宽空位, 胶囊在整列里对齐 */
.menu-row { display: flex; align-items: center; border-radius: 8px; }
.menu-row.on { background: var(--hover); }
.menu-row:hover, .menu-row:focus-within { background: var(--hover-2); }
.menu-row > .menu-item, .menu-row > .menu-item[aria-checked="true"], .menu-row > .menu-item:hover:not(:disabled), .menu-row > .menu-item:focus-visible { flex: 1 1 auto; width: auto; min-width: 0; background: transparent; } /* 底色只画在整行上 (.menu-row), 按钮自己不再叠一层 */
.menu-check.ph { display: inline-block; flex: none; width: 16px; height: 16px; }
.menu-arrow, .menu-arrow-ph { flex: none; width: 28px; height: 28px; margin-right: 4px; }
.menu-arrow { display: inline-grid; place-items: center; border-radius: 6px; color: var(--text-3); opacity: 0; transition: opacity .12s var(--ease), background .12s var(--ease); }
.menu-arrow .ic { width: 16px; height: 16px; }
.menu-row:hover .menu-arrow, .menu-row:focus-within .menu-arrow, .menu-arrow[aria-expanded="true"] { opacity: 1; }
.menu-arrow:hover, .menu-arrow[aria-expanded="true"] { color: var(--text); background: var(--line); }
.menu-arrow:focus-visible { outline: 2px solid var(--brand-line); outline-offset: -2px; }
@media (hover: none) { .menu-arrow { opacity: 1; } }
/* 型号子菜单: master 菜单行里的后代 (点它不算点菜单外面), 绝对定位到行右侧 / 行下方 (位置由脚本算) */
.menu-sub { position: absolute; z-index: 2; min-width: 200px; max-width: min(340px, calc(100vw - 16px)); padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); animation: pop-in .14s var(--ease); }
.menu-sub .menu-item { font: 13px/1.4 var(--font-mono); }
.menu-sub .menu-check { margin-left: auto; }
.menu-sub[aria-busy="true"] { opacity: .7; } /* 保存中仍接收指针事件 (不能穿透到下面的行); 重复点选由 pickMasterVariant 的 busy 守卫挡住 */
.mr-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mi-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; white-space: normal; }
.mi-name { font-weight: 500; }
.mi-desc { font-size: 12px; color: var(--text-3); line-height: 1.45; max-width: 260px; }

/* 设置弹层 / 步进器 */
.settings-pop { width: 340px; padding: 6px; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; cursor: default; }
label.set-row { cursor: pointer; }
.set-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.set-title { font-size: 14px; font-weight: 500; }
.set-desc { font-size: 12px; color: var(--text-3); line-height: 1.5; }
.set-foot { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 4px; padding: 8px 10px 6px; border-top: 1px solid var(--line); }
.stepper { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--line-2); border-radius: 9px; }
.stepper-val { min-width: 26px; text-align: center; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stepper-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.kbd-inline { margin-left: 6px; padding: 0 5px; border-radius: 4px; background: rgba(255, 255, 255, .22); font-size: 11px; line-height: 16px; }

/* 发送前确认: 上下文构成 */
.callout.ok { background: var(--ok-bg); color: var(--ok); }
.callout.info { background: var(--hover); }

/* 连接表单: 别名 */
.alias-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.alias-chip { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 7px; background: var(--hover); border: 1px dashed var(--line-2); color: var(--text-2); font-size: 12.5px; }
.alias-chip.more { border-style: solid; color: var(--text-3); }

/* 语音安装对话框 */
.stt-body:empty { display: none; }
.stt-progress { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; background: var(--hover); font-size: 13.5px; color: var(--text-2); }

/* 圆桌讨论 (ASK-029): 主栏 = 一行状态 + master 汇总; 各轮发言在讨论侧栏 */
.turn-rt:empty { display: none; }
.rt { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.rt-line { display: flex; align-items: center; gap: 10px; min-height: 32px; }
.rt-open {
  display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; height: 32px;
  margin-left: -8px; padding: 0 10px 0 8px; border-radius: 8px;
  color: var(--text-3); font-size: 13px; transition: background-color .15s, color .15s;
}
.rt-open:hover, .rt.viewing .rt-open { background: var(--hover); color: var(--text-2); }
.rt-mark { display: inline-grid; place-items: center; flex: none; width: 16px; height: 16px; }
.rt-mark .ic { width: 15px; height: 15px; }
.rt.running .rt-mark .ic { display: none; }
.rt.running .rt-mark::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); animation: pulse 1.2s ease-in-out infinite; }
.rt.running .rt-line-text { color: var(--brand-text); }
.rt-line-text { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rt-go { display: inline-flex; align-items: center; gap: 2px; flex: none; color: var(--text-2); font-weight: 500; }
.rt-go::before { content: "·"; margin-right: 6px; color: var(--text-4); font-weight: 400; }
.rt-go .ic { width: 14px; height: 14px; }
.rt-stop { align-self: center; font-size: 13px; color: var(--danger); }
.rt-sum:not(:empty) { margin-top: 14px; }
/* 多模型综合 (ASK-109): 首答下方一行安静的状态 (不加分隔线), 第二个答案在它下面 */
.rt.flow { margin-top: 10px; padding-top: 0; border-top: 0; }
.rt.flow .rt-open { font-size: 12.5px; }
.rt.flow .rt-go::before { content: none; }
.rt.flow .rt-go { color: var(--text-4); }
.rt.flow.running .rt-line-text { color: inherit; } /* 只有脉冲点用品牌色: 正在读首答时不抢眼 */
.rt.flow .rt-sum:not(:empty) { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }

/* 右侧栏位 .side-panel (讨论侧栏 #rt-panel 与作品面板 #art-panel 共用, 一次只开一个): 宽屏与主栏并排 (主栏仍最宽 760px 居中) */
.rt-scrim { display: none; }
.side-panel {
  flex: none; height: 100%; min-width: 0;
  display: flex; flex-direction: column;
  background: var(--bg); border-left: 1px solid var(--line);
}
.side-panel:focus { outline: none; }
.rt-panel { width: var(--rtp-w); }
/* 作品面板 (ASK-064 P2): 宽屏时与主栏平分 (约一半), 最窄 420px, 最宽 760px */
.art-panel { flex: 1 1 0; width: auto; min-width: 420px; max-width: 760px; }
.rtp-head { flex: none; display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--line); }
.rtp-ic { width: 16px; height: 16px; flex: none; color: var(--text-3); }
.rtp-title { font: 500 15.5px/1.4 var(--font-serif); color: var(--text); white-space: nowrap; }
.rtp-select {
  min-width: 0; flex: 0 1 auto; max-width: 190px; height: 30px; padding: 0 6px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-size: 13px; appearance: auto;
}
.rtp-select:focus { outline: none; border-color: var(--brand-line); box-shadow: 0 0 0 3px var(--brand-soft); }
.rtp-status { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.rtp-status.running { color: var(--brand-text); }
.rtp-status.running::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); animation: pulse 1.2s ease-in-out infinite; }
.rtp-status.done { color: var(--ok); }
.rtp-status.stopped { color: var(--amber); }
.rtp-spacer { flex: 1; }
.rtp-stop { align-self: center; font-size: 13px; color: var(--danger); }
.rtp-body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 0 16px 28px; }
.rt-notes { margin-top: 12px; }
.rt-note-line { display: flex; align-items: flex-start; gap: 6px; font-size: 12.5px; color: var(--text-3); line-height: 1.55; }
.rt-note-line .ic { width: 13px; height: 13px; margin-top: 3px; }
.rt-empty { padding: 20px 0; color: var(--text-4); font-size: 13.5px; }
.rt-round { margin-top: 4px; }
.rt-round-title {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 10px;
  padding: 12px 0 10px; background: var(--bg); font-size: 12px; font-weight: 600; color: var(--text-3); letter-spacing: .04em;
}
.rt-round-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.rt-list .answer + .answer { margin-top: 18px; padding-top: 18px; }
.rt-panel .ans-body { font-size: 15px; line-height: 1.65; }

/* 860–1199px: 从右侧滑出、覆盖主栏的抽屉; ≤860px: 全宽底部抽屉 (与左侧栏在窄屏的做法一致) */
@media (max-width: 1199px) {
  .side-panel {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 38; height: auto;
    box-shadow: var(--shadow-modal); animation: rtp-in-right .22s var(--ease);
  }
  .rt-panel { width: min(var(--rtp-w), 92vw); }
  .art-panel { width: min(720px, 92vw); min-width: 0; max-width: none; }
  #app.rtp-open .rt-scrim, #app.artp-open .rt-scrim { display: block; position: fixed; inset: 0; z-index: 37; background: var(--backdrop); animation: fade .2s; }
}
@media (max-width: 860px) {
  .side-panel {
    top: auto; left: 0; width: auto; height: min(88dvh, 100%); border-left: 0; border-radius: 16px 16px 0 0;
    padding-bottom: env(safe-area-inset-bottom); animation: rtp-in-up .25s var(--ease);
  }
  .rtp-head { border-radius: 16px 16px 0 0; }
}
@keyframes rtp-in-right { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes rtp-in-up { from { opacity: 0; transform: translateY(32px); } to { opacity: 1; transform: none; } }

@media (max-width: 640px) {
  .chip-label { max-width: 120px; }
  .at-picker { left: 6px; }
  .rtp-body { padding: 0 14px 24px; }
  .rec-row { gap: 8px; }
}

/* ==========================================================================
   账户与认证 (R12–R15): 登录页 / 账户行 / 后台管理
   ========================================================================== */
body[data-view="boot"] #app, body[data-view="auth"] #app { display: none; }
body[data-view="boot"] .auth-screen { display: none; }

.auth-screen {
  position: fixed; inset: 0; z-index: 80; overflow-y: auto; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px;
}
.auth-screen[hidden] { display: none; }
.auth-card {
  width: min(400px, 100%); display: flex; flex-direction: column; gap: 0;
  padding: 36px 32px 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-1);
}
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.auth-mark { display: inline-grid; width: 58px; height: 36px; }
.auth-mark img, .auth-mark svg { object-fit: contain; width: 100%; height: 100%; }
.auth-brand-name { font: 500 17px/1.3 var(--font-serif); color: var(--text); }
.auth-title { font: 500 24px/1.3 var(--font-serif); color: var(--text); margin-bottom: 6px; }
.auth-sub { font-size: 14px; line-height: 1.65; color: var(--text-3); margin-bottom: 20px; }
.auth-form { display: flex; flex-direction: column; }
.auth-title + .auth-form, .auth-notice + .auth-form { margin-top: 14px; }
.auth-notice { margin: 8px 0 4px; }
.auth-btn { width: 100%; height: 40px; margin-top: 6px; font-size: 14.5px; }
.auth-msg { min-height: 0; margin: 2px 0 4px; line-height: 1.55; }
.auth-foot { margin-top: 18px; font-size: 12.5px; line-height: 1.6; color: var(--text-3); text-align: center; }
/* 登录页右上角的语言切换 (ASK-088 §6.2): 只是一个文字按钮, 显示另一种语言的自称 */
.auth-lang {
  position: absolute; top: 12px; right: 12px; padding: 4px 8px; border: 0; border-radius: 6px; background: none;
  color: var(--text-3); font-size: 13px; line-height: 20px; cursor: pointer;
}
.auth-lang:hover { text-decoration: underline; text-underline-offset: 3px; }
.auth-lang:focus-visible { outline: 2px solid var(--brand-line); outline-offset: 1px; }
/* 桌面版的「应用设置…」(ASK-221): 同样的文字按钮, 放左上角 */
.auth-desk { left: 12px; right: auto; }
.auth-desk[hidden] { display: none; }
/* 版本号 (ASK-144): 登录卡片下方居中的小灰字 */
.auth-ver { margin-top: 14px; text-align: center; font-size: 12px; line-height: 18px; color: var(--text-3); }
.auth-ver[hidden] { display: none; }
/* ASK-264 S2: 设置新密码页 (登录页样式); 管理员确认自己密码的框 (按钮旁边, 需要时才出现); 后台「审计记录」; 账户菜单「安全记录」 */
.mc-reset { margin-bottom: 4px; color: var(--text-2); }
.mc-out { align-self: center; font-size: 12.5px; }
.pw-confirm .field { margin-bottom: 4px; }
.pwc-msg { margin-bottom: 8px; color: var(--danger); font-size: 13px; line-height: 1.5; }
.pwc-msg:empty { display: none; }
.asr-actions .pw-confirm, .sup-foot .pw-confirm { flex: 0 1 260px; min-width: 180px; }
.asr-actions .pw-confirm .field, .sup-foot .pw-confirm .field { margin-bottom: 0; }
.asr-actions .pw-confirm .pwc-msg, .sup-foot .pw-confirm .pwc-msg { margin: 4px 0 0; }
.sup-foot-mid .pw-confirm { display: inline-block; width: min(260px, 100%); text-align: left; vertical-align: top; }
.audit-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 12px; }
.audit-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: -2px 0 12px; }
.audit-tools .form-msg { flex: 1; min-width: 0; }
.audit-table td { font-size: 13.5px; }
.audit-table td.audit-detail { min-width: 180px; color: var(--text-2); line-height: 1.5; }
.audit-table td.audit-ip { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text-3); }
.audit-more { display: block; margin: 12px auto 0; }
.sec-list { display: flex; flex-direction: column; }
.sec-row { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 2px 12px; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.sec-row:last-child { border-bottom: 0; }
.sec-act { flex: 1 1 200px; min-width: 0; font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
.sec-row.is-note .sec-act { font-weight: 500; }
.sec-meta { display: flex; gap: 10px; flex: none; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.sec-more { display: block; margin: 10px auto 4px; }
@media (max-width: 720px) {
  .audit-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .audit-table td.audit-detail { min-width: 0; text-align: right; }
  .sup-foot-mid .pw-confirm { width: 100%; }
}

.pw-meter { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-3); }
.pw-bar { display: inline-flex; gap: 3px; flex: none; }
.pw-bar i { width: 22px; height: 4px; border-radius: 2px; background: var(--line-2); }
.pw-meter[data-level="1"] .pw-bar i:nth-child(-n+1) { background: var(--danger); }
.pw-meter[data-level="2"] .pw-bar i:nth-child(-n+2) { background: var(--amber); }
.pw-meter[data-level="3"] .pw-bar i:nth-child(-n+3) { background: var(--ok); }
.pw-meter[data-level="4"] .pw-bar i { background: var(--ok); }
.pw-meter[data-level="1"] .pw-text { color: var(--danger); }
.dlg-form { display: contents; }
.dlg-fields { padding-top: 8px; }
.flip { display: inline-grid; transform: scaleX(-1); }
.flip .ic { width: 16px; height: 16px; }

/* 侧边栏账户行 */
/* 一行 (ASK-182): [头像 名字… 角色 ⌄] [外观 语言 用量]; 名字先截断, 图标不换行 */
.side-foot { flex-direction: row; align-items: center; gap: 2px; padding: 8px 8px 10px; }
.side-account {
  position: relative; display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; padding: 6px 6px 6px 8px; border-radius: 10px; text-align: left;
  transition: background-color .15s var(--ease);
}
.acct-tools { flex: none; display: flex; align-items: center; gap: 0; }
.acct-tool { width: 30px; height: 30px; color: var(--text-3); }
.acct-tool .ic { width: 17px; height: 17px; }
.acct-tool[aria-expanded="true"] { background: var(--hover); color: var(--text); }
.acct-tool[hidden] { display: none; }
.acct-tool[aria-expanded="true"]::after { display: none !important; } /* 菜单开着时不出提示 (会盖住选项) */
@media (min-width: 861px) and (hover: hover) { /* 窄图标栏: 提示改到右侧, 同其它图标栏项 */
  :root[data-side="collapsed"] .acct-tool[data-tip]:hover::after { top: 50%; bottom: auto; left: calc(100% + 8px); right: auto; transform: translateY(-50%); }
}
.side-account[hidden] { display: none; }
.side-account:hover, .side-account[aria-expanded="true"] { background: var(--side-hover); }
.acct-av {
  display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-text); font: 600 13px/1 var(--font-sans); text-transform: uppercase;
}
.acct-av.lg { width: 36px; height: 36px; font-size: 15px; }
.acct-main { flex: 1; min-width: 0; display: flex; }
.acct-name { font-size: 14px; font-weight: 500; color: var(--text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.acct-chev { display: inline-grid; color: var(--text-4); }
.acct-chev .ic { width: 14px; height: 14px; }
.role-badge {
  flex: none; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 500; line-height: 1.6; white-space: nowrap;
  background: var(--hover); color: var(--text-3);
}
.role-badge.is-admin { background: var(--brand-soft); color: var(--brand-text); }
.acct-menu { min-width: 230px; }
.acct-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 6px; }
.acct-head-name { font-size: 14px; font-weight: 600; color: var(--text); word-break: break-all; }
.acct-head-role { font-size: 12px; color: var(--text-3); }
.acct-storage { padding: 2px 10px 6px; font-size: 12.5px; line-height: 18px; color: var(--amber); }
.acct-ver { padding: 6px 10px 4px; font-size: 11.5px; line-height: 16px; color: var(--text-3); user-select: text; }
/* 有新版本 (ASK-226): 版本号旁的小链接 */
.page-upd { display: inline; margin-left: 6px; padding: 0; font-size: inherit; line-height: inherit; font-weight: 500; user-select: none; }
/* ASK-225: 桌面版里版本号可点 (同样的小灰字), 有更新时旁边一个小圆点 +「有更新」 */
.ver-btn { padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; border-radius: 4px; }
.ver-btn:hover:not(:disabled) { color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; }
.ver-btn:focus-visible { outline: 2px solid var(--brand-line); outline-offset: 1px; }
.ver-btn:disabled { cursor: default; }
.ver-sign { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; color: var(--brand-text); }
.ver-sign[hidden] { display: none; }
/* ASK-241: 「更新到 {v}」是按钮: 点它就开始更新 */
button.ver-sign { padding: 0; border: 0; background: none; font: inherit; font-weight: 500; cursor: pointer; border-radius: 4px; }
button.ver-sign:hover:not(:disabled) { text-decoration: underline; text-underline-offset: 3px; }
button.ver-sign:focus-visible { outline: 2px solid var(--brand-line); outline-offset: 1px; }
button.ver-sign:disabled { cursor: default; }
.ver-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.ver-msg:not(:empty) { margin-left: 8px; }
/* 账户按钮头像右上角一个小点: 页面有新版本 (ASK-226) 或应用有更新 (ASK-225), 两者共用一个点 */
.side-account.has-page-update .acct-av, .side-account.has-update .acct-av { position: relative; }
.side-account.has-page-update .acct-av::after, .side-account.has-update .acct-av::after {
  content: ""; position: absolute; top: -1px; right: -1px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand); box-shadow: 0 0 0 2px var(--side);
}
@media (min-width: 861px) {
  :root[data-side="collapsed"] .acct-main, :root[data-side="collapsed"] .acct-chev, :root[data-side="collapsed"] .side-account .role-badge { display: none; }
  :root[data-side="collapsed"] .side-account { width: 40px; justify-content: center; padding: 6px 0; margin: 0 auto; }
  :root[data-side="collapsed"] .side-foot { flex-direction: column; align-items: center; gap: 4px; padding: 8px 0 10px; }
  :root[data-side="collapsed"] .acct-tools { flex-direction: column; gap: 2px; order: -1; } /* 窄图标栏: 三个图标竖排在头像上面 */
  :root[data-side="collapsed"] .acct-tool { width: 36px; height: 32px; }
  :root[data-side="collapsed"] .side-account { flex: none; }
}

/* 普通用户的只读模型列表 */
.models-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.models-list .model-row { gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); }
.models-list .model-row.off .model-name { color: var(--text-3); }
.models-sec + .models-sec { margin-top: 18px; }
.models-sec-h { margin-bottom: 8px; font-size: 12px; font-weight: 500; color: var(--text-3); }
.models-empty { padding: 10px 2px 4px; font-size: 13.5px; }
.model-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.model-name { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 500; }
.model-alias input {
  width: 100%; height: 28px; margin-top: 4px; padding: 0 8px; font-size: 12.5px; color: var(--text);
  border: 1px solid transparent; border-radius: 7px; background: var(--hover);
}
.model-alias input:focus { border-color: var(--brand-line); box-shadow: 0 0 0 3px var(--brand-soft); background: var(--surface); outline: none; }

/* 型号变体 (ASK-053 / ASK-055): 管理员表单里的「用户可选型号」多选下拉 (触发按钮 + 弹层 + 已选胶囊); 用户「模型」里的型号下拉 */
.variants-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; height: 38px; padding: 0 12px;
  border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font-size: 14px; text-align: left; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.variants-trigger:focus-visible, .variants-trigger[aria-expanded="true"] { border-color: var(--brand-line); box-shadow: 0 0 0 3px var(--brand-soft); outline: none; }
.variants-trigger .ic { flex: none; width: 14px; height: 14px; color: var(--text-3); transition: transform .15s var(--ease); }
.variants-trigger[aria-expanded="true"] .ic { transform: rotate(180deg); }
.variants-trigger-text.is-empty { color: var(--text-4); }
.variants-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.variants-chips[hidden] { display: none; }
.variant-chip { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; height: 26px; padding: 0 2px 0 9px; border-radius: 8px; background: var(--hover); }
.variant-chip .variant-id { flex: 0 1 auto; }
.variant-chip button { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: var(--text-3); }
.variant-chip button:hover { background: var(--hover-2); color: var(--text); }
.variant-chip button .ic { width: 12px; height: 12px; }
.field-hint-warn { color: var(--danger); }
.field-hint-warn[hidden] { display: none; }
.variants-pop { display: flex; flex-direction: column; gap: 4px; width: min(400px, calc(100vw - 16px)); padding: 6px; }
.variants-pop[hidden] { display: none; }
.variants-filter, .variants-add {
  width: 100%; height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font-size: 13px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.variants-filter::placeholder, .variants-add::placeholder { color: var(--text-4); }
.variants-filter:focus, .variants-add:focus { border-color: var(--brand-line); box-shadow: 0 0 0 3px var(--brand-soft); }
.variants-list { display: flex; flex-direction: column; max-height: 240px; overflow-y: auto; }
.variants-list:empty { display: none; }
.variants-status { padding: 4px 8px; font-size: 12.5px; color: var(--text-3); line-height: 1.5; }
.variants-status[hidden] { display: none; }
.variants-status-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.variants-status-row.bad { color: var(--danger); }
.variants-status-row .link-btn { align-self: auto; }
.variant-opt { height: 32px; gap: 8px; min-width: 0; }
.variant-opt .vbox { flex: none; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--text-4); }
.variant-opt .vbox .ic { width: 12px; height: 12px; color: var(--on-brand); opacity: 0; }
.variant-opt.is-on .vbox { background: var(--brand); border-color: var(--brand); }
.variant-opt.is-on .vbox .ic { opacity: 1; }
.variant-opt.is-default:disabled { opacity: 1; cursor: default; }
.variant-opt.is-default:disabled .vbox { opacity: .55; }
.variant-opt.is-full { opacity: .5; cursor: not-allowed; }
.variant-id { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 12.5px/1.5 var(--font-mono); color: var(--text); text-align: left; }
.model-variant { width: 100%; max-width: 100%; height: 30px; margin-top: 2px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font: 12.5px/1.5 var(--font-mono); outline: none; appearance: auto; }
.model-variant:focus { border-color: var(--brand-line); box-shadow: 0 0 0 3px var(--brand-soft); }
.model-variant:disabled { opacity: .6; }

/* 后台管理 */
.admin-view { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; background: var(--bg); color: var(--text); }
.admin-view[hidden] { display: none; }
.admin-top { flex: none; border-bottom: 1px solid var(--line); background: var(--bg); padding: 12px 24px 0; }
.admin-top-in { max-width: 1080px; margin: 0 auto; display: flex; align-items: center; gap: 16px; }
.admin-title { font: 500 22px/1.3 var(--font-serif); }
.admin-tabs { max-width: 1080px; margin: 10px auto 0; display: flex; gap: 4px; }
.admin-tab {
  position: relative; padding: 8px 14px 10px; font-size: 14px; color: var(--text-3); border-radius: 8px 8px 0 0;
}
.admin-tab:hover { color: var(--text); background: var(--hover); }
.admin-tab[aria-selected="true"] { color: var(--text); font-weight: 500; }
.admin-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand); }
.admin-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 24px; }
.admin-panel { max-width: 1080px; margin: 0 auto; padding-bottom: 40px; }
.admin-sec-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.admin-sec-head h2 { font: 500 19px/1.4 var(--font-serif); }
.admin-sec-head p { margin-top: 4px; max-width: 640px; font-size: 13.5px; line-height: 1.6; color: var(--text-3); }
.admin-foot { margin-top: 12px; }
/* 用量 (ASK-161) */
.td-num { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.usage-table .usage-total td { font-weight: 500; background: var(--hover); }
.usage-table .link-btn { font-size: inherit; font-weight: 500; }
/* 用量图表 (ASK-189; ASK-245 按付费方与币种): 三张卡片 + 按时间的堆叠柱 (服务器付费 / 自己的密钥的估算) + 表格 */
.usage-body { --u-srv: color-mix(in srgb, var(--m0) 74%, var(--surface)); --u-est: color-mix(in srgb, var(--m0) 34%, var(--surface)); }
.usage-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 10px; margin-bottom: 16px; }
.usage-tiles-3 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); }
.usage-tile { min-width: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.usage-tile-v { font-size: 22px; line-height: 1.25; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usage-tile-main .usage-tile-v { font-size: 26px; }
.usage-unit { font-size: 13px; font-weight: 400; color: var(--text-3); }
.usage-tile-k { margin-top: 2px; font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usage-tile-unk { margin-left: 6px; font-size: 11.5px; font-weight: 400; color: var(--text-4); white-space: nowrap; }
.usage-tile-sub { margin-top: 10px; font-size: 12px; color: var(--text-4); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usage-sec-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 10px; }
.usage-sec-h h3 { font-size: 14px; font-weight: 500; color: var(--text-2); }
.usage-legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.usage-legend span { display: inline-flex; align-items: center; gap: 6px; }
.usage-sw { width: 10px; height: 10px; border-radius: 3px; }
.usage-sw-srv { background: var(--u-srv); }
.usage-sw-est { background: var(--u-est); }
.usage-card { padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.usage-chart { margin-bottom: 22px; }
.usage-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.usage-chart-h { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.usage-chart-note { font-size: 12px; color: var(--text-4); }
.usage-readout { min-height: 20px; font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.usage-plot { position: relative; display: flex; align-items: stretch; gap: 3px; height: 150px; padding: 18px 0 22px; border-radius: 6px; outline: none; }
.usage-plot:focus-visible { box-shadow: 0 0 0 3px var(--brand-soft); }
.usage-grid { position: absolute; inset: 18px 0 22px; border-top: 1px dashed var(--line-2); border-bottom: 1px solid var(--line-3); pointer-events: none; }
.usage-grid span { position: absolute; right: 0; top: -17px; font-size: 11px; color: var(--text-4); font-variant-numeric: tabular-nums; }
.usage-col { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; cursor: default; }
.usage-stack { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; border-radius: 4px 4px 0 0; }
.usage-col:hover .usage-stack, .usage-col.is-active .usage-stack { background: var(--hover); }
.usage-seg { display: block; min-height: 2px; width: 76%; max-width: 44px; margin: 0 auto; }
.usage-seg:first-child { border-radius: 3px 3px 0 0; }
.usage-col.is-active .usage-seg, .usage-col:hover .usage-seg { filter: brightness(1.15); }
.usage-xl { position: absolute; left: 50%; bottom: -20px; transform: translateX(-50%); font-size: 11px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.usage-xl.is-first { left: 0; transform: none; }
.usage-xl.is-last { left: auto; right: 0; transform: none; }
.usage-xl.is-hidden { display: none; }
.usage-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 16px; margin-bottom: 22px; border: 1px dashed var(--line-2); border-radius: 14px; color: var(--text-3); font-size: 14px; }
.usage-empty svg { width: 28px; height: 28px; color: var(--text-4); }
/* 分段按钮: 查看方式 (按用户 / 按组 / 按服务商 / 按型号) 与币种 (¥ / $) */
.usage-switch { display: inline-flex; flex: none; max-width: 100%; overflow-x: auto; padding: 2px; border-radius: 8px; background: var(--hover-2); }
.usage-switch-btn { flex: none; height: 28px; padding: 0 12px; border-radius: 6px; font-size: 13px; color: var(--text-3); white-space: nowrap; transition: background-color .15s, color .15s; }
.usage-switch-btn:hover { color: var(--text); }
.usage-switch-btn:focus-visible { box-shadow: 0 0 0 3px var(--brand-soft); outline: none; }
.usage-switch-btn[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .usage-switch-btn[aria-pressed="true"] { background: var(--seg-on); } }
:root[data-theme="dark"] .usage-switch-btn[aria-pressed="true"] { background: var(--seg-on); }
.usage-cur .usage-switch-btn { height: 22px; padding: 0 8px; font-size: 12px; }
.usage-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
/* 表格里的钱与次要数字 */
.usage-money { white-space: nowrap; font-variant-numeric: tabular-nums; }
.usage-tok-sub { font-size: 12px; color: var(--text-4); }
.usage-est { color: var(--text-3); font-style: italic; white-space: nowrap; }
.usage-model { font-family: var(--font-mono); font-size: 13px; }
.usage-qty-table td:first-child { white-space: nowrap; }
.usage-qty-table th, .usage-qty-table td { padding-left: 10px; padding-right: 10px; }
.usage-qty-table th:first-child, .usage-qty-table td:first-child { padding-left: 14px; }
.usage-qty-table th:last-child, .usage-qty-table td:last-child { padding-right: 14px; }
.usage-payer { white-space: nowrap; }
.badge-own { color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); }
.usage-table .usage-region td { font-size: 12.5px; font-weight: 500; color: var(--text-2); background: color-mix(in srgb, var(--hover) 60%, transparent); }
.usage-row-link { cursor: pointer; }
.usage-row-link:hover td { background: var(--hover); }
.usage-table td.usage-go, .usage-table th.usage-go { width: 28px; padding-left: 0; padding-right: 10px; color: var(--text-4); }
.usage-go svg { width: 14px; height: 14px; vertical-align: middle; }
.usage-grp { color: var(--text-2); }
@media (max-width: 720px) {
  .usage-table td.usage-go, .usage-table td.usage-blank, .usage-qty-table td.usage-nil { display: none; }
  .usage-qty-table td.usage-model { text-align: right; overflow-wrap: anywhere; }
  .usage-qty-table td, .usage-qty-table td:first-child, .usage-qty-table td:last-child { padding: 5px 14px; }
}
@media (max-width: 600px) {
  .usage-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .usage-tiles-3 .usage-tile-main { grid-column: 1 / -1; }
  .usage-tile-v, .usage-tile-main .usage-tile-v { font-size: 19px; }
  .usage-tile-sub { white-space: normal; }
  .usage-card { padding: 12px; }
  .usage-card-top { flex-direction: column; align-items: flex-start; gap: 6px; }
  .usage-plot { gap: 1px; height: 140px; }
  .usage-seg { width: 84%; }
  .usage-toolbar .usage-switch { flex: 1 1 100%; }
  .modal-head .usage-csv-t { display: none; }
}
.modal-head .usage-period, .modal-head .usage-csv { flex: none; margin-top: 2px; }
/* 后台用量页 (ASK-234): 月份翻页、可排序的按用户表、没有用量的用户 */
.usage-controls { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; flex: none; }
.usage-month { display: inline-flex; align-items: center; gap: 2px; }
.usage-month-label { min-width: 8.5em; text-align: center; font-size: 13.5px; font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.usage-month-btn:disabled { opacity: .35; cursor: default; }
.usage-sort { display: inline-flex; align-items: center; gap: 3px; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
.usage-sort:hover, .usage-sort.is-on { color: var(--text); }
.usage-sort:focus-visible { box-shadow: 0 0 0 3px var(--brand-soft); outline: none; border-radius: 4px; }
.usage-sort svg { width: 12px; height: 12px; }
.usage-table .usage-idle td { color: var(--text-4); }
.usage-idle-toggle { margin: 8px 2px 22px; font-size: 12.5px; color: var(--text-3); }
.usage-users { margin-bottom: 4px; }
.usage-users .usage-idle-toggle { margin-bottom: 0; }
@media (max-width: 600px) {
  .admin-sec-head:has(.usage-controls) { flex-direction: column; }
  .usage-controls { justify-content: flex-start; }
}
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { padding: 10px 14px; text-align: left; font-size: 12px; font-weight: 500; color: var(--text-3); border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr.is-off .u-name { color: var(--text-3); }
.u-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; overflow-wrap: break-word; } /* break-word (不是 break-all): 短名字不被挤成一列一个字母 */
.u-models { font-size: 12px; font-weight: 400; color: var(--text-3); white-space: nowrap; }
.u-store { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: left; } /* ASK-265 S3: 用户表「存储」列; 来源一行在下面, 列窄一些 */
.u-store.is-near { color: var(--amber); }
.u-store.is-over { color: var(--danger); }
.u-store-src { font-size: 12px; color: var(--text-3); }
.u-store-sum { margin: 0 0 10px; font-variant-numeric: tabular-nums; }
.store-gb .bud-sym { border-right: 0; border-left: 1px solid var(--line-2); }
.grp-store { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.grp-store .bud-acts { margin-top: 0; }
.grp-store-ro { margin: 0; font-size: 13.5px; }
.sys-quota-ctl { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; }
.sys-quota-ctl .bud-acts { margin-top: 0; }
@media (max-width: 720px) { .set-quota { flex-wrap: wrap; } .sys-quota-ctl { justify-content: flex-start; } }
.td-time { font-size: 13px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.td-actions { text-align: right; }
/* 用户组 (ASK-233): 表里的概要; 「选择模型」对话框每个系统连接一块, 停用的变淡 */
.grp-pick { font-size: 13.5px; }
.grp-count { white-space: nowrap; font-variant-numeric: tabular-nums; }
.grp-sum { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.grp-lost { cursor: help; } td > .grp-lost { margin-left: 6px; }
.grp-conns { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.grp-conn { padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.grp-conn.is-off .grp-conn-name, .grp-conn.is-off .grp-models { opacity: .55; }
.grp-conn-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.grp-conn-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grp-all, .grp-model { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.grp-all { flex: none; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.grp-models { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.grp-model { min-height: 28px; min-width: 0; }
.grp-model:has(input:disabled) { cursor: default; }
.conn-embed { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface); }
.conn-embed .conn-layout { height: min(660px, calc(100dvh - 260px)); min-height: 440px; }
.admin-card { margin-bottom: 16px; padding: 18px 20px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.admin-card h3 { font: 500 16px/1.4 var(--font-serif); margin-bottom: 6px; }
.admin-card .set-row { padding: 12px 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.admin-card .set-row:last-of-type { border-bottom: 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin-top: 10px; }
.fact { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--hover); }
.fact-k { font-size: 12px; color: var(--text-3); }
.fact-v { font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.about-note { margin-top: 12px; max-width: 640px; line-height: 1.65; }
/* 系统设置 › 存储加密 (ASK-264 S3a): 审计记录一行; 不一致时用警示色; 「说明」最后一段留出底边 */
.vault-audit { margin: 12px 0 4px; font-size: 14px; }
.vault-audit.is-bad { color: var(--danger); }
.vault-help { margin-top: 14px; }
.vault-help > .sys-adv-desc { max-width: 680px; line-height: 1.65; }
.vault-help > .sys-adv-desc:last-child { padding-bottom: 12px; }
.fact-v { overflow-wrap: anywhere; }
/* S4 (块 C): 后台加密旧数据的几行; 在跑时一条细进度条 (同页面的安静风格: 没有动画、没有大色块) */
.vault-job { margin: 12px 0 2px; display: flex; flex-direction: column; gap: 6px; }
.vault-job:empty { display: none; }
.vault-line { margin: 0; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.vault-line.muted { font-size: 13px; color: var(--text-3); }
.vault-line.is-bad { color: var(--danger); }
.vault-line.is-warn { color: var(--amber); }
/* S5: 上次加密备份一行 (开着关着都有) */
.vault-backup { margin: 12px 0 2px; display: flex; flex-direction: column; gap: 4px; }
.vault-prog { display: flex; flex-direction: column; gap: 6px; max-width: 520px; }
.vault-prog-head { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.vault-prog-n { color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.vault-bar { height: 4px; border-radius: 2px; background: var(--hover); overflow: hidden; }
.vault-bar > i { display: block; height: 100%; border-radius: 2px; background: var(--text-2); transition: width .4s ease; }
/* 系统设置 (ASK-237): 左侧分区列表 + 一次一个分区; 手机上列表换成顶部的下拉 */
.sys-layout { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; align-items: start; }
.sys-nav { position: sticky; top: 0; display: flex; flex-direction: column; gap: 2px; }
.sys-nav-item { width: 100%; padding: 8px 12px; border-radius: 8px; text-align: left; font-size: 14px; color: var(--text-2); }
.sys-nav-item:hover { background: var(--hover); color: var(--text); }
.sys-nav-item[aria-current="page"] { background: var(--hover-2); color: var(--text); font-weight: 500; }
.sys-nav-item:focus-visible, .sys-ov-row:focus-visible { box-shadow: 0 0 0 3px var(--brand-soft); outline: none; }
.sys-nav-select { display: none; width: 100%; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg); font-size: 14px; appearance: auto; }
.sys-body { min-width: 0; }
.sys-sec-desc { margin: -2px 0 12px; font-size: 13px; }
.sys-group { margin-top: 8px; }
.sys-group + .sys-group, .sys-sec .set-row + .sys-group, .sys-group + .set-row { margin-top: 14px; }
.sys-group-title { margin: 12px 0 4px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.sys-group-desc { margin-bottom: 12px; }
.sys-adv { margin-top: 12px; }
.sys-adv > .set-row, .sys-adv > .field, .sys-adv > .sys-adv-desc { padding-left: 14px; padding-right: 14px; }
.sys-adv > .field:first-of-type, .sys-adv > .sys-adv-desc { padding-top: 12px; }
.sys-adv > .set-row.set-sub { padding-left: 24px; }
.sys-adv > .sys-adv-desc { margin: 0; }
.sys-partial { flex: none; font-size: 12px; color: var(--text-3); }
.sys-mark { display: block; font-size: 12px; line-height: 1.5; }
.sys-mark:empty { display: none; }
.asr-actions .sys-mark { display: inline; }
.sys-mark.is-ok { color: var(--ok); animation: sys-mark-fade .4s ease 2.6s forwards; }
.sys-mark.is-note { color: var(--text-2); }
.sys-mark.is-err { color: var(--danger); }
@keyframes sys-mark-fade { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sys-mark.is-ok { animation: none; } }
.sys-ov { display: flex; flex-direction: column; }
.sys-ov-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 4px; border-bottom: 1px solid var(--line); text-align: left; }
.sys-ov-row:last-child { border-bottom: 0; }
.sys-ov-row:hover { background: var(--hover); }
.sys-ov-k { flex: none; width: 96px; font-size: 14px; font-weight: 500; }
.sys-ov-v { flex: 1; min-width: 0; font-size: 13px; color: var(--text-3); line-height: 1.5; }
.sys-ov-row .ic { flex: none; width: 16px; height: 16px; color: var(--text-4); }
/* 价格 (ASK-245 piece 1b, 图 8): 来源卡片 + 价格表 + 没有价格的提示 + 重算; 手机上表格变成一项一张卡片 (data-table 的规则) */
.price-card { padding: 4px 16px 12px; border: 1px solid var(--line); border-radius: 12px; }
.price-card > .sys-group-title { margin-bottom: 2px; }
.price-src-row { display: flex; align-items: baseline; gap: 6px 14px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.price-src-name { flex: none; width: 168px; color: var(--text); }
.price-src-desc { flex: 1; min-width: 0; font-size: 12.5px; color: var(--text-3); }
.price-src-st { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--text-3); text-align: right; }
.price-src-st .ic { width: 13px; height: 13px; color: var(--ok); }
.price-src-st.is-bad { color: var(--amber); }
.price-src-st .link-btn { align-self: auto; font-size: 13px; }
.price-legacy { padding: 8px 0 4px; border-bottom: 1px solid var(--line); }
.price-legacy-item { padding: 8px 0; border-top: 1px dashed var(--line); }
.price-legacy-item:first-of-type { border-top: 0; }
.price-legacy-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.price-legacy-sups { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0; font-size: 13px; }
.price-legacy-sup { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.price-legacy-act { display: flex; gap: 8px; }
.price-ctl { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-top: 12px; }
.price-ctl-gap { flex: 1; }
.price-auto { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.price-auto.is-off { color: var(--text-4); cursor: default; }
.price-card .field-hint { margin-top: 8px; }
.price-mark { margin: 8px 0; }
.prices .callout { margin-top: 12px; }
.price-list { margin: 6px 0 0; padding-left: 18px; }
.price-list li { margin: 2px 0; }
.price-list .link-btn, .price-act .link-btn { align-self: auto; font-size: 12.5px; }
.price-wrap { margin-top: 12px; }
.price-table { font-size: 13px; }
.price-table th, .price-table td { padding: 9px 8px; white-space: nowrap; }
.price-table th:first-child, .price-table td:first-child { padding-left: 14px; }
.price-table code, .prices code { font-family: var(--font-mono); font-size: 12px; }
.price-old { margin-right: 6px; color: var(--text-4); }
.price-table td.price-other { min-width: 110px; max-width: 150px; white-space: normal; font-size: 12px; line-height: 1.45; color: var(--text-2); }
.price-src { white-space: nowrap; }
.price-tag { height: 18px; padding: 0 5px; font-size: 11px; }
.price-manual { color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); }
.price-table td.price-act { width: 1%; padding: 4px 8px 4px 0; text-align: right; }
.price-act .icon-btn { width: 28px; height: 28px; }
.price-act .icon-btn .ic { width: 15px; height: 15px; }
.price-src .link-btn { margin-left: 4px; }
.price-recalc-box { margin-top: 18px; }
.price-month { height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg); font-size: 13px; appearance: auto; }
@media (max-width: 720px) {
  .price-src-row { flex-wrap: wrap; }
  .price-src-name { width: auto; }
  .price-src-desc { flex-basis: 100%; order: 3; }
  .price-src-st { margin-left: auto; }
  .price-table td { justify-content: flex-start; gap: 6px; } /* 标签靠左, 一格里的几样 (划掉的价 + 现价, 手动 + 恢复自动) 挨在一起靠右 */
  .price-table td::before { margin-right: auto; }
  .price-table td.price-act { width: 100%; padding: 2px 10px; }
  .price-table td.price-other { min-width: 0; max-width: none; text-align: right; }
}
@media (max-width: 720px) {
  .sys-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .sys-nav { display: none; }
  .sys-nav-select { display: block; }
  .sys-ov-row { flex-wrap: wrap; gap: 2px 12px; }
  .sys-ov-k { width: auto; }
  .sys-ov-v { flex-basis: 100%; order: 3; }
}
@media (max-width: 860px) {
  .admin-top { padding: 10px 12px 0; }
  .admin-scroll { padding: 16px 12px; }
  .admin-sec-head { flex-direction: column; }
  .admin-tabs { overflow-x: auto; }
  .admin-tab { flex: none; white-space: nowrap; } /* 5 个标签 (ASK-175): 窄屏横向滚动, 不逐字折行 */
  .conn-embed .conn-layout { grid-template-columns: 1fr; height: auto; }
  .conn-embed .conn-left { border-right: 0; border-bottom: 1px solid var(--line); max-height: 220px; }
}
@media (max-width: 720px) {
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .data-table tr:last-child { border-bottom: 0; }
  .data-table td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 14px; border: 0; }
  .data-table td::before { content: attr(data-label); flex: none; font-size: 12px; color: var(--text-3); }
  .data-table td.td-actions { display: block; text-align: left; }
  .data-table td.td-actions::before { display: block; margin-bottom: 6px; }
  .row-actions { justify-content: flex-start; }
  .auth-card { padding: 28px 20px 22px; }
  .auth-screen { padding-top: 48px; } /* 卡片比屏幕高时不顶到右上角的语言切换 */
}

/* 语音识别设置 / 录音去向提示 (R11) */
.asr-card .kv-row, #hdr-field .kv-row { display: flex; gap: 6px; margin-bottom: 6px; }
.asr-card .kv-row input, #hdr-field .kv-row input { flex: 1; min-width: 0; }
.asr-card .kv-row .btn, #hdr-field .kv-row .btn { flex: none; }
.asr-card .kv > div > .btn, #hdr-field > div > .btn { margin-top: 2px; }
.asr-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 12px; }
.asr-card select { max-width: 100%; }

.asr-adv { margin: 4px 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.asr-adv > summary {
  display: flex; align-items: center; padding: 10px 14px; font-size: 13px; font-weight: 500; color: var(--text-2);
  cursor: pointer; list-style: none; user-select: none; border-radius: 12px;
}
.asr-adv > summary::-webkit-details-marker { display: none; }
.asr-adv > summary::before {
  content: ""; width: 6px; height: 6px; margin-right: 10px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg); transition: transform .15s var(--ease);
}
.asr-adv[open] > summary::before { transform: rotate(45deg); }
.asr-adv > summary:hover { background: var(--hover); }
.asr-adv > summary:focus-visible { box-shadow: 0 0 0 3px var(--brand-soft); outline: none; }
.asr-adv[open] > summary { border-bottom: 1px solid var(--line); border-radius: 12px 12px 0 0; }
.asr-adv > .field { padding: 14px 14px 0; }

/* 思考过程 (ASK-018) */
.ans-think { margin: 4px 0 8px; font-size: 13px; color: var(--note-text); }
.ans-think > summary { cursor: pointer; user-select: none; list-style: none; }
.ans-think > summary::before { content: '▸ '; }
.ans-think[open] > summary::before { content: '▾ '; }
.ans-think > summary::-webkit-details-marker { display: none; }
.think-text { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 4px; padding: 6px 10px; border-left: 2px solid var(--note-line); max-height: 260px; overflow: auto; }

.scope-info { padding: 8px 12px 6px; margin-top: 4px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.5; color: var(--text-3); max-width: 320px; }

:root[data-theme="dark"] .rec-ok { background: #2fbf71; }
:root[data-theme="dark"] .rec-ok:hover { background: #26a862; }
:root[data-theme="dark"] .rec-time { color: #8fb8ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rec-ok { background: #2fbf71; } :root:not([data-theme="light"]) .rec-time { color: #8fb8ff; } }

/* 联网搜索 (ASK-023) */
.ans-tool { margin: 2px 0 6px; font-size: 13px; line-height: 1.5; color: var(--text-3); }
.ans-sources { margin: 10px 0 4px; font-size: 13px; color: var(--text-3); }
.ans-sources > summary { cursor: pointer; user-select: none; list-style: none; }
.ans-sources > summary::-webkit-details-marker { display: none; }
.ans-sources > summary::before { content: '▸ '; }
.ans-sources[open] > summary::before { content: '▾ '; }
.src-list { margin: 6px 0 0; padding: 0 0 0 22px; display: flex; flex-direction: column; gap: 4px; }
.src-list li { overflow-wrap: anywhere; }
.src-list a { color: var(--text-2); text-decoration: none; }
.src-list a:hover .src-title { text-decoration: underline; }
.src-list a:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--brand-soft); border-radius: 4px; }
.src-host { margin-left: 8px; color: var(--text-3); font-size: 12px; }
/* 应用指令 (ASK-207): 回答下「已发起圆桌讨论 …」等一行说明 (同 .note); 能打开圆桌的那行是按钮 */
.app-act + .app-act { margin-top: 4px; }
button.app-act { text-align: left; cursor: pointer; transition: color .15s; }
button.app-act:hover { color: var(--text-2); }
button.app-act:hover > span { text-decoration: underline; text-underline-offset: 3px; }
button.app-act:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
/* 本地文件 (ASK-211): 连续多次读取收成一行可展开的摘要; 展开后每次一行 */
.ws-group { display: block; }
.ws-group > summary { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; user-select: none; list-style: none; }
.ws-group > summary::-webkit-details-marker { display: none; }
.ws-group > summary > .ic { width: 15px; height: 15px; margin-top: 3px; flex: none; }
.ws-group > summary:hover > span { color: var(--text-2); }
.ws-group > summary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--brand-soft); border-radius: 6px; }
.ws-group-body { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; padding-left: 23px; }
.ws-group-body > .note { margin: 0; padding: 2px 0; background: none; }
/* 本地命令 (ASK-211 §11.10): 命令用等宽字; 运行中有停止按钮与实时输出; 运行完的输出折叠 */
.ws-cmd { flex-wrap: wrap; }
.ws-cmd-line { min-width: 0; overflow-wrap: anywhere; }
.ws-cmd-text { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.ws-cmd-stop { margin-left: 4px; display: inline-flex; align-items: center; gap: 4px; }
.ws-cmd-done { display: block; }
.ws-cmd-done > summary { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; list-style: none; }
.ws-cmd-done > summary::-webkit-details-marker { display: none; }
.ws-cmd-done > summary > .ic { width: 15px; height: 15px; margin-top: 3px; flex: none; }
.ws-cmd-done > summary:hover .ws-cmd-line > span { color: var(--text-2); }
.ws-cmd-done > summary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--brand-soft); border-radius: 6px; }
.ws-cmd-out, .ws-cmd-full {
  flex-basis: 100%; margin: 6px 0 0; padding: 8px 10px; max-height: 320px; overflow: auto; border-radius: 6px;
  background: var(--bg, transparent); color: var(--text-2); font-family: var(--font-mono); font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere;
}
.ws-cmd-full { max-height: 160px; }
.ws-cmd-none { margin-top: 4px; padding-left: 23px; font-size: 12.5px; }
/* 后台「允许模型调用应用指令」下的每个指令: 缩进; 总开关关着时变淡 */
.admin-card .set-row.set-group { border-bottom: 0; padding-bottom: 4px; }
.admin-card .set-row.set-sub { padding: 8px 0 8px 20px; border-bottom: 0; }
.set-row.set-sub .set-title { font-weight: 400; }
.set-row.set-sub.is-off { opacity: .55; cursor: default; }
.search-card select { max-width: 100%; }
.search-test-list { margin: 6px 0 0; padding-left: 18px; }
/* 后台「联网搜索」(ASK-175): 有序的搜索服务列表, 每行一块; 窄屏时网格自动变一列 */
.svc-list { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 4px; }
.search-svc { padding: 12px 14px 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.search-svc.is-off .svc-grid, .search-svc.is-off .svc-name { opacity: .55; }
.svc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.svc-head .switch { margin: 0; }
.svc-name { flex: 1; min-width: 0; height: 32px; padding: 0 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-weight: 500; outline: none; }
.svc-name:hover { border-color: var(--line); }
.svc-name:focus { border-color: var(--brand-line); box-shadow: 0 0 0 3px var(--brand-soft); }
.svc-name::placeholder { color: var(--text-2); }
.svc-st { flex: none; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.svc-st.is-ok { color: var(--ok); }
.svc-btns { display: flex; flex: none; gap: 2px; }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 12px; }
.svc-grid .field { margin-bottom: 10px; }
.svc-actions { margin: 0 0 10px; }
.svc-result { margin-bottom: 12px; }
.my-search-none { font-size: 14px; color: var(--text-2); line-height: 1.6; }
/* 账户菜单「桌面设备」(ASK-211): 每台一行, 在线时绿点 */
.desk-devs { display: flex; flex-direction: column; gap: 2px; }
.desk-dev { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.desk-dev:last-child { border-bottom: 0; }
.desk-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--text-4); }
.desk-dot.on { background: var(--ok); }
.desk-dev-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.desk-dev-name { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 14px; color: var(--text); }
.desk-dev-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.desk-dev-tag { flex: none; padding: 0 6px; border-radius: 6px; background: var(--hover-2); color: var(--text-3); font-size: 11.5px; line-height: 18px; }
.desk-dev-meta { font-size: 12px; color: var(--text-4); }
/* 任务文件夹 (ASK-253): 输入框工具栏里的胶囊 + 它的小菜单; 删除聊天确认框里的「移到回收站」 */
.desk-task { display: flex; min-width: 0; }
.desk-task[hidden] { display: none; }
.desk-task-btn { flex: 0 1 auto; min-width: 0; border-color: transparent; }
.desk-task-btn.is-static { cursor: default; }
.desk-task-btn.is-static:hover { background: none; color: var(--text-2); }
.desk-task-pop { width: 400px; padding: 12px 14px; }
.dtp-head { font-size: 12.5px; color: var(--text-3); }
.dtp-name { margin-top: 6px; font: 13px/1.4 var(--font-mono); color: var(--text); overflow-wrap: anywhere; }
.dtp-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.dtp-foot .btn { flex: none; }
.dtp-hint { min-width: 0; font-size: 12.5px; color: var(--text-3); line-height: 1.45; }
.confirm-extra { margin-top: 12px; }
.confirm-extra[hidden] { display: none; }
.confirm-check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--text); cursor: pointer; }
.confirm-check-box { flex: none; margin-top: 3px; }
.confirm-check-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.confirm-check-sub { font-size: 12.5px; color: var(--text-3); overflow-wrap: anywhere; }
@media (max-width: 480px) { .svc-head { flex-wrap: wrap; } .svc-name { flex-basis: calc(100% - 50px); } .svc-st { margin-left: 46px; margin-right: auto; } }

/* 输出被截断 (ASK-026): 一行 muted 小字 + 次级按钮 */
.ans-trunc { display: flex; align-items: center; gap: 8px; margin: 8px 0 2px; font-size: 12.5px; color: var(--text-3); }
.ans-trunc .link-btn { align-self: auto; display: inline-flex; align-items: center; gap: 6px; }
.ans-trunc .link-btn:disabled { color: var(--text-3); cursor: default; text-decoration: none; }

.ans-trunc-err { color: var(--text-3); }
.conn-notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 12.5px; color: var(--text-2); }
.conn-notice[hidden] { display: none; }

/* ==========================================================================
   项目 (ASK-064 P1, 照 Claude 桌面): 列表 (卡片) / 新建表单 / 项目页 (左: 输入框 + 聊天; 右: 项目知识)
   ========================================================================== */
.main.in-proj .scroller, .main.in-proj > .composer-zone, .main.in-proj .title-wrap, .main.in-proj #btn-participants, .main.in-proj #btn-menu { display: none; }
.proj-view { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 8px 24px 48px; }
.proj-view[hidden] { display: none; }
.pj-wrap { max-width: 880px; margin: 0 auto; padding-top: 24px; }
.pj-wrap-narrow { max-width: 600px; }
.pj-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.pj-h1 { flex: 1; min-width: 0; margin: 0; font: 400 28px/1.25 var(--font-serif); color: var(--text); overflow-wrap: anywhere; }
.pj-h2 { margin: 28px 0 8px; font-size: 13px; font-weight: 500; color: var(--text-3); }
.pj-search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; margin-bottom: 20px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--text-3); }
.pj-search:focus-within { border-color: var(--brand-line); box-shadow: 0 0 0 3px var(--brand-soft); }
.pj-search .ic { width: 16px; height: 16px; flex: none; }
.pj-search-input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--text); font-size: 14px; outline: none; }
.pj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.pj-card {
  display: flex; flex-direction: column; gap: 6px; min-height: 120px; padding: 16px; text-align: left;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.pj-card:hover { border-color: var(--line-2); box-shadow: var(--shadow-1); }
.pj-card-name { font-size: 15px; font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pj-card-desc { font-size: 13px; color: var(--text-3); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pj-card-time { margin-top: auto; font-size: 12px; color: var(--text-4); }
/* 列表卡片上的 ⋯ (ASK-195): 与作品卡 .art-tile-more 一样, 悬停 / 键盘焦点才出现; 触屏与手机宽度常驻 */
.pj-tile { position: relative; min-width: 0; }
.pj-tile > .pj-card { width: 100%; height: 100%; }
.pj-tile .pj-card-name { padding-right: 28px; }
.pj-tile-more { position: absolute; top: 12px; right: 10px; opacity: 0; transition: opacity .15s; }
.pj-tile:hover .pj-tile-more, .pj-tile:focus-within .pj-tile-more, .pj-tile-more[aria-expanded="true"] { opacity: 1; }
@media (hover: none), (max-width: 640px) { .pj-tile-more { opacity: .6; } }
.pj-empty { padding: 48px 0; text-align: center; color: var(--text-3); font-size: 14px; line-height: 1.6; }
.pj-empty-title { margin: 0 0 4px; font: 400 18px/1.4 var(--font-serif); color: var(--text-2); }
.pj-form { display: flex; flex-direction: column; }
.pj-form .pj-h1 { margin-bottom: 24px; }
.pj-input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px; outline: none;
}
.pj-input:focus { border-color: var(--brand-line); box-shadow: 0 0 0 3px var(--brand-soft); }
.pj-input::placeholder { color: var(--text-4); }
.pj-textarea { resize: vertical; min-height: 88px; line-height: 1.55; }
.pj-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.pj-edit-form { margin: 4px 0 8px; }
/* 项目页 */
.pj-page { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; max-width: 1120px; margin: 0 auto; padding-top: 16px; }
.pj-main { min-width: 0; }
.pj-back { margin-bottom: 12px; color: var(--text-3); font-weight: 400; font-size: 13px; }
.pj-back-ic { transform: rotate(180deg); }
.pj-title-row { display: flex; align-items: center; gap: 8px; }
.pj-desc { margin: 6px 0 0; color: var(--text-3); font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.pj-composer { margin-top: 20px; }
.pj-composer .composer-column { max-width: none; }
.pj-composer .composer-hint:empty, .pj-composer #suggest { display: none; }
.pj-chats { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.pj-chat {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 8px; text-align: left;
  border-bottom: 1px solid var(--line); color: var(--text); font-size: 14px; border-radius: 0;
}
.pj-chat:hover { background: var(--hover); }
.pj-chat-title { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pj-chat-time { flex: none; font-size: 12.5px; color: var(--text-4); }
.pj-muted { margin: 8px 0; color: var(--text-3); font-size: 13px; line-height: 1.55; }
.pj-side { align-self: start; position: sticky; top: 0; padding-top: 4px; }
.pj-side-head { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 36px; padding: 0 2px; color: var(--text); cursor: default; }
.pj-side-title { font-size: 15px; font-weight: 500; }
.pj-side-chev { display: none; width: 16px; height: 16px; color: var(--text-3); transition: transform .15s var(--ease); }
.pj-side-body { display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }
.pj-card-box, .pj-files { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.pj-box-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.pj-box-title { font-size: 13px; font-weight: 500; color: var(--text-2); }
.pj-count { font-size: 12px; color: var(--text-4); }
.pj-instr-text { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 240px; overflow-y: auto; }
.pj-instr .pj-textarea { min-height: 160px; }
.pj-file-list { display: flex; flex-direction: column; gap: 2px; }
.pj-file { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 4px 0 6px; border-radius: 8px; }
.pj-file:hover { background: var(--hover); }
.pj-file > .ic { width: 16px; height: 16px; flex: none; color: var(--text-3); }
.pj-file-name { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text); font-size: 13.5px; text-decoration: none; }
.pj-file-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.pj-file-meta { flex: none; font-size: 12px; color: var(--text-4); }
.pj-file.no-text .pj-file-meta { color: var(--text-3); }
.pj-file-del { opacity: 0; }
.pj-file:hover .pj-file-del, .pj-file-del:focus-visible { opacity: 1; }
@media (hover: none) { .pj-file-del { opacity: .6; } }
.pj-file-busy { color: var(--text-3); }
.pj-cap { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.pj-cap-bar { height: 6px; border-radius: 3px; background: var(--hover-2); overflow: hidden; }
.pj-cap-fill { display: block; height: 100%; border-radius: 3px; background: var(--text-3); }
.pj-cap.over .pj-cap-fill { background: var(--brand); }
.pj-cap-text { font-size: 12px; color: var(--text-3); }
/* 项目页「本地文件夹」(ASK-211, 只在桌面版里) */
.pj-folder-link { display: inline-flex; align-items: center; gap: 6px; }
.pj-folder-link .ic { width: 15px; height: 15px; }
.pj-folder-row:hover { background: none; }
.pj-folder-row .pj-file-name:hover { text-decoration: none; }
.pj-folder-off { margin-bottom: 0; }
.pj-folder-export { flex: none; display: inline-flex; align-items: center; gap: 6px; }
.pj-folder-export .spinner { width: 12px; height: 12px; border-width: 1.5px; }
/* 保存到工作区 (ASK-211 §11.9, 只在桌面版里) */
.desk-save .spinner { width: 13px; height: 13px; border-width: 1.5px; }
.pj-file > .desk-save:not(.busy) { opacity: 0; }
.pj-file:hover > .desk-save, .pj-file > .desk-save:focus-visible { opacity: 1; }
@media (hover: none) { .pj-file > .desk-save:not(.busy) { opacity: .6; } }
.artp-save:empty { display: none; }
.artp-out-files li { display: flex; align-items: center; gap: 2px; }
.pj-cap.over .pj-cap-text { color: var(--brand-text); }
/* 聊天顶栏「项目名 /」 */
.room-proj { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 30vw; padding: 4px 4px 4px 8px; border-radius: 8px; color: var(--text-3); font-size: 14px; }
.room-proj:hover { background: var(--hover); color: var(--text); }
.room-proj[hidden] { display: none; }
.room-proj-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.room-proj-sep { color: var(--text-4); }
/* 侧栏条目: 标题占满一行; 「已置顶」里项目聊天多一行灰色小字的项目名 (ASK-139) */
.hist-open { display: flex; align-items: center; gap: 6px; }
.hist-open .hist-title { flex: 1; min-width: 0; }
.hist-item.has-sub { height: auto; min-height: 44px; }
.hist-item.has-sub .hist-open { padding-top: 5px; padding-bottom: 5px; }
.hist-text { display: block; flex: 1; min-width: 0; }
.hist-sub { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; line-height: 1.35; color: var(--text-3); }
/* 侧栏「项目」节 (ASK-139, 照 ChatGPT): 项目行 = 图标 + 名称 (打开项目页) + 展开箭头; 展开后缩进列它的聊天 */
#proj-list { padding-bottom: 8px; }
.proj-ic { width: 16px; height: 16px; flex: none; color: var(--text-3); }
.proj-name { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.proj-row .hist-open { gap: 8px; }
.proj-toggle {
  flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 3px;
  border-radius: 6px; color: var(--text-3); transition: background-color .12s;
}
.proj-toggle:hover { background: var(--hover-2); color: var(--text); }
.proj-chev { width: 14px; height: 14px; transition: transform .15s var(--ease); }
.proj-toggle[aria-expanded="true"] .proj-chev { transform: rotate(90deg); }
.proj-chats { padding-left: 16px; }
.proj-more-row {
  display: block; width: 100%; height: 30px; padding: 0 8px; border-radius: 8px; text-align: left;
  color: var(--text-3); font-size: 13px; transition: background-color .12s var(--ease);
}
.proj-more-row:hover { background: var(--side-hover); color: var(--text-2); }
.menu-title { padding: 6px 10px 4px; font-size: 12px; color: var(--text-3); }
@media (max-width: 1023px) {
  .pj-page { grid-template-columns: minmax(0, 1fr) 280px; gap: 28px; }
}
/* 窄屏: 「项目知识」移到聊天列表上面, 可收起 */
@media (max-width: 860px) {
  .proj-view { padding: 4px 16px 32px; }
  .pj-wrap { padding-top: 8px; }
  .pj-h1 { font-size: 24px; }
  .pj-page { display: flex; flex-direction: column; gap: 0; padding-top: 4px; }
  .pj-main { display: contents; }
  .pj-back { order: 1; align-self: flex-start; }
  .pj-title-row, .pj-edit-form { order: 2; }
  .pj-desc { order: 3; }
  .pj-composer { order: 4; }
  .pj-side { order: 5; position: static; align-self: stretch; margin-top: 20px; }
  .pj-h2 { order: 6; }
  .pj-chats { order: 7; }
  .pj-side-head { cursor: pointer; border-radius: 8px; }
  .pj-side-chev { display: block; }
  .pj-page.side-closed .pj-side-body { display: none; }
  .pj-page.side-closed .pj-side-chev { transform: rotate(-90deg); }
  .room-proj { max-width: 28vw; }
}

/* ==========================================================================
   作品 (ASK-064 P2, 照 Claude 桌面): 回答里的卡片 / 右侧作品面板 / 作品页
   ========================================================================== */
.art-card {
  display: flex; align-items: center; gap: 12px; width: 100%; max-width: 460px; margin: .9em 0; padding: 10px 12px 10px 10px;
  border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); color: var(--text); text-align: left;
  font-size: 14px; line-height: 1.4; transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.md > .art-card:first-child { margin-top: 0; }
.md > .art-card:last-child { margin-bottom: 0; }
.art-card:hover { border-color: var(--line-3); box-shadow: var(--shadow-1); }
.art-card:focus-visible { box-shadow: 0 0 0 3px var(--brand-soft); border-color: var(--brand-line); }
.art-card.viewing { border-color: var(--brand-line); }
.art-card-ic { position: relative; display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 9px; background: var(--hover-2); color: var(--text-3); }
.art-card-ic .ic { width: 20px; height: 20px; }
.art-card.writing .art-card-ic::after { content: ""; position: absolute; right: -2px; top: -2px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 2px var(--surface); animation: pulse 1.2s ease-in-out infinite; }
.art-card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.art-card-title { font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.art-card-meta { font-size: 12.5px; color: var(--text-3); }
.art-card.writing .art-card-meta { color: var(--brand-text); }
.art-card-open { flex: none; display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 8px; font-size: 13px; color: var(--text-2); transition: background-color .15s; }
.art-card:hover .art-card-open { background: var(--hover-2); }
.rt-panel .art-card { max-width: none; }

/* 面板: 头部与圆桌侧栏同一套 (.rtp-head) */
.artp-head { gap: 6px; padding-right: 8px; }
.artp-title { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.artp-vers { display: inline-flex; align-items: center; gap: 0; flex: none; color: var(--text-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.artp-vlabel { padding: 0 2px; white-space: nowrap; }
.artp-seg { display: inline-flex; flex: none; padding: 2px; border-radius: 8px; background: var(--hover-2); }
.artp-seg-btn { height: 26px; padding: 0 10px; border-radius: 6px; font-size: 12.5px; color: var(--text-3); transition: background-color .15s, color .15s; }
.artp-seg-btn:hover { color: var(--text); }
.artp-seg-btn[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
/* 深色下 --surface 比轨道还暗, 选中项看不出来: 用更亮的底 */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .artp-seg-btn[aria-pressed="true"] { background: var(--seg-on); } }
:root[data-theme="dark"] .artp-seg-btn[aria-pressed="true"] { background: var(--seg-on); }
.artp-head .tool { flex: none; text-decoration: none; }
.artp-head .tool:disabled { opacity: .4; cursor: default; }
/* Office 文件的「下载 ▾」(ASK-125): 按钮本身 + 窄的 ▾; 文件还没生成好时按钮变灰 */
.artp-dlsplit { display: inline-flex; align-items: center; flex: none; }
.artp-dlsplit .artp-dl:not([hidden]) + .artp-dl-more { min-width: 20px; margin-left: -4px; padding: 0 3px; }
.artp-head .artp-dl[aria-disabled="true"] { opacity: .4; cursor: default; }
.artp-dl-more .ic { width: 14px; height: 14px; }
.artp-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.artp-frame { flex: 1; width: 100%; min-height: 0; border: 0; background: #FFFFFF; }
.artp-frame-stopped { flex: 1; min-height: 0; } /* ASK-120 P4: 页面一直跳走, 停下后代替 iframe 的空白 */
.artp-md { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 20px 28px; font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
.artp-code {
  flex: 1; min-height: 0; margin: 0; padding: 14px 16px 24px; overflow: auto; background: var(--code-block);
  font: 13px/1.6 var(--font-mono); color: var(--text); white-space: pre; tab-size: 4;
}
.artp-code code { font: inherit; }
.artp-msg { padding: 24px 16px; color: var(--text-3); font-size: 13.5px; }
.artp-wait { margin: auto 0; text-align: center; } /* Office 文件还在生成: 居中一行 */
/* 预览出错 (ASK-120 P2): 正文下一行安静的提示 + 「让模型修复」 */
.artp-err { flex: none; display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-3); }
.artp-err-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.artp-err-fix { flex: none; height: 26px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; transition: background-color .15s; }
.artp-err-fix:hover { background: var(--hover-2); }
/* 页面运行时能力 (ASK-120 P4): 页面跳转到了别处的一行 / 脚注「本页已调用模型 N 次」/ 最近的调用 */
.artp-note { flex: none; display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-3); }
.artp-note-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.artp-note-btn { flex: none; height: 26px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; transition: background-color .15s; }
.artp-note-btn:hover { background: var(--hover-2); }
.artp-asks { padding: 0 2px; border-radius: 4px; font-size: 12px; color: var(--text-3); text-decoration: underline dotted; text-underline-offset: 2px; }
.artp-asks:hover { color: var(--text-2); }
.artp-asks-list { min-width: 260px; max-width: 360px; padding: 2px 0; }
.artp-ask-row { display: flex; align-items: baseline; gap: 8px; padding: 5px 10px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.artp-ask-time { flex: none; color: var(--text-3); font-variant-numeric: tabular-nums; }
.artp-ask-model { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.artp-ask-chars { flex: none; color: var(--text-3); }
.artp-ask-out { flex: none; color: var(--danger); }
.artp-foot { flex: none; padding: 8px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 手改 (ASK-120 P3): 等宽编辑区 + 代替脚注的一行「有未保存的修改 [放弃] [保存为新版本]」 */
.artp-head .artp-edit-btn.on { background: var(--hover-2); color: var(--text); }
.artp-edit {
  flex: 1; min-height: 0; width: 100%; margin: 0; padding: 14px 16px 24px; border: 0; border-radius: 0; outline: none; resize: none; overflow: auto;
  background: var(--code-block); font: 13px/1.6 var(--font-mono); color: var(--text); white-space: pre; overflow-wrap: normal; tab-size: 4;
}
.artp-editbar { flex: none; display: flex; align-items: center; gap: 8px; min-height: 41px; padding: 5px 8px 5px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-3); }
.artp-edit-note { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.artp-editbar.ask .artp-edit-note, .artp-edit-msg { color: var(--text); font-weight: 500; }
/* 审好的新版本 (面板被动过时不自动换): 版本条上「v2 已审好 · 查看」 */
.artp-pending { display: inline-flex; align-items: center; gap: 6px; height: 24px; margin-left: 6px; padding: 0 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-text); font-size: 12px; white-space: nowrap; }
.artp-pending:hover { text-decoration: underline; }
.artp-pending-go::before { content: "·"; margin-right: 6px; }
/* 运行代码 (ASK-129): 面板头「▶ 运行」; 代码下方的输出区 (面板 ≥ 520px: 代码 60% / 输出 40%, 中间可拖; 更矮: 盖住代码下半, 可收起) */
.artp-run .ic { width: 13px; height: 13px; }
.artp-main { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.artp-main > .artp-body { flex: 1 1 60%; }
.artp-split { flex: none; height: 6px; margin: -3px 0; position: relative; z-index: 1; cursor: row-resize; }
.artp-split::after { content: ""; position: absolute; left: 0; right: 0; top: 2px; height: 1px; background: var(--line); transition: background-color .15s; }
.artp-split:hover::after, .artp-split:focus-visible::after { height: 2px; top: 2px; background: var(--line-3); }
.artp-split:focus { outline: none; }
body.artp-dragging { cursor: row-resize; user-select: none; }
body.artp-dragging iframe { pointer-events: none; }
.artp-out {
  flex: 0 0 40%; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg); border-top: 1px solid var(--line);
}
.artp-out.collapsed { flex: none; }
.artp-out-head { flex: none; display: flex; align-items: center; gap: 4px; height: 34px; padding: 0 6px 0 8px; font-size: 12.5px; color: var(--text-3); }
.artp-out-title { height: 26px; padding: 0 8px; border-radius: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.artp-out-title:hover, .artp-out-tg:hover { background: var(--hover-2); }
.artp-out-tg { display: inline-flex; align-items: center; gap: 2px; height: 26px; padding: 0 6px 0 8px; border-radius: 6px; font-size: 12.5px; color: var(--text-3); }
.artp-out-tg .ic { width: 13px; height: 13px; }
.artp-out-tg[aria-expanded="true"] { color: var(--text); }
.artp-out-attlist { flex: none; margin: 0; padding: 2px 16px 6px; list-style: none; font-size: 12px; color: var(--text-3); max-height: 96px; overflow-y: auto; }
.artp-out-attitem { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.artp-out-inbox { flex: none; padding: 0 12px 8px; }
.artp-stdin {
  display: block; width: 100%; min-height: 56px; max-height: 160px; resize: vertical; padding: 8px 10px;
  border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); color: var(--text);
  font: 12.5px/1.5 var(--font-mono);
}
.artp-stdin:focus { outline: none; border-color: var(--line-3); }
.artp-out-scroll { flex: 1; min-height: 0; overflow: auto; padding: 2px 16px 8px; }
.artp-out-scroll:focus { outline: none; }
.artp-out-text { margin: 0; font: 12.5px/1.55 var(--font-mono); color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4; }
.artp-out-text .artp-e { color: var(--run-err); }
.artp-out-note { margin-top: 6px; font-size: 12px; color: var(--text-3); }
.artp-out-imgs { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.artp-out-img { display: block; }
.artp-out-img img { display: block; max-width: 100%; height: auto; border-radius: 6px; background: #FFFFFF; }
.artp-out-files { margin: 10px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.artp-out-file { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 6px; margin-left: -6px; border-radius: 6px; font-size: 12.5px; color: var(--text-2); text-decoration: none; }
.artp-out-file:hover { background: var(--hover-2); }
.artp-out-file.is-deleted { color: var(--text-3); }
.artp-out-file.is-deleted:hover { background: none; }
.artp-out-file .ic { flex: none; width: 14px; height: 14px; }
.artp-out-fname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.artp-out-fsize { flex: none; color: var(--text-4); }
.artp-out-foot { flex: none; padding: 4px 16px 6px; font-size: 12px; color: var(--text-4); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.artp-out-foot.bad { color: var(--text-3); }
/* 面板矮: 输出区盖住代码的下半 (不分割), 收起后只剩头部与状态行 */
.art-panel.artp-short .artp-split { display: none; }
.art-panel.artp-short .artp-out { position: absolute; left: 0; right: 0; bottom: 0; max-height: 62%; flex: none; box-shadow: 0 -6px 16px rgba(0, 0, 0, .06); }

/* 主栏里审稿的一行状态 (ASK-120 P1b): 审稿中 / 无需修改 (淡出) / 没完成 / 已停止 */
.art-review { display: flex; align-items: center; gap: 8px; min-height: 28px; margin: 6px 0 2px; font-size: 13px; color: var(--text-3); }
.art-review .ic { width: 14px; height: 14px; flex: none; }
.art-review .spinner { width: 12px; height: 12px; border-width: 1.5px; }
.art-review.fade { animation: art-fade 4s ease-in forwards; }
@keyframes art-fade { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
@media (max-width: 640px) {
  .artp-tlabel { display: none; }
  .artp-seg-btn { padding: 0 8px; }
}

/* 作品页 (#artifacts): 版式照项目列表 */
.main.in-art .scroller, .main.in-art > .composer-zone, .main.in-art .title-wrap, .main.in-art #btn-participants, .main.in-art #btn-menu { display: none; }
.art-head { flex-wrap: wrap; }
.art-head .pj-search { width: 280px; max-width: 100%; margin: 0; }
.art-tile { position: relative; min-width: 0; }
.art-tile-main { width: 100%; height: 100%; }
.art-tag { align-self: flex-start; padding: 1px 8px; border-radius: 6px; background: var(--hover-2); color: var(--text-2); font-size: 12px; line-height: 20px; }
.art-tile-title { font-size: 15px; font-weight: 500; line-height: 1.45; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.art-tile-meta { margin-top: auto; font-size: 12px; color: var(--text-4); }
.art-tile-more { position: absolute; top: 10px; right: 10px; opacity: 0; transition: opacity .15s; }
.art-tile:hover .art-tile-more, .art-tile-more:focus-visible, .art-tile-more[aria-expanded="true"] { opacity: 1; }
@media (hover: none) { .art-tile-more { opacity: .6; } }
@media (max-width: 860px) {
  .art-head .pj-search { width: 100%; }
}

/* 新建作品 / 灵感 / 作品聊天 (ASK-120) */
.art-new { flex: none; }
.art-tabs { display: flex; gap: 20px; margin: -4px 0 20px; border-bottom: 1px solid var(--line); }
.art-tab { height: 36px; margin-bottom: -1px; padding: 0 2px; border-bottom: 2px solid transparent; font-size: 14px; color: var(--text-3); transition: color .15s; }
.art-tab:hover { color: var(--text); }
.art-tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); }
.art-insp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.art-insp { min-height: 0; gap: 8px; }
.art-insp-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.art-insp-ic { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 8px; background: var(--hover-2); color: var(--text-3); }
.art-insp-ic .ic { width: 18px; height: 18px; }
.art-insp-title { font-size: 15px; font-weight: 500; line-height: 1.4; }
.art-insp-line { font-size: 13px; line-height: 1.5; color: var(--text-3); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.art-insp-hint { margin-top: auto; font-size: 12px; line-height: 1.4; color: var(--text-4); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* 灵感页分组 (ASK-149): 安静的小标题 */
.art-insp-sec + .art-insp-sec { margin-top: 28px; }
.art-insp-sec > .art-insp-h { margin-bottom: 10px; }
/* 草稿屏输入框下方: 类型快捷项 + 一行灵感 (三张小卡片) */
.art-type-chip[aria-pressed="true"] { background: var(--hover-2); border-color: var(--line-3); color: var(--text); }
.art-insp-row { width: 100%; margin-top: 8px; }
.art-insp-h { margin: 0 0 8px; font-size: 13px; font-weight: 500; color: var(--text-3); }
.art-insp-grid-sm { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.art-insp-grid-sm .art-insp { padding: 12px 14px; border-radius: 12px; }
.art-insp-grid-sm .art-insp-line, .art-insp-grid-sm .art-insp-hint { display: none; }
.art-insp-grid-sm .art-insp-title { font-size: 14px; }
@media (max-width: 640px) { .art-insp-grid-sm { grid-template-columns: minmax(0, 1fr); } }
.art-type-btn { flex: 0 1 auto; min-width: 0; border-color: transparent; }
.art-reopen { flex: none; margin-right: 4px; }
/* 作品聊天: 宽屏时作品面板占大半 (≈62%, 最窄 480px), 聊天 ≈38% (最窄 360px); 更窄时照普通作品面板 (抽屉 / 全屏) */
@media (min-width: 1200px) {
  body.art-room #app.artp-open #main { flex: 38 1 0; min-width: 360px; }
  body.art-room .art-panel { flex: 62 1 0; min-width: 480px; max-width: none; }
}

/* ==========================================================================
   定时任务 (ASK-064 P3, 照 Claude 桌面): 列表 (行: 名称 / 频率 / 下次 / 开关; 上次 / ⋯) + 主区原地的新建 / 编辑表单
   ========================================================================== */
.main.in-sched .scroller, .main.in-sched > .composer-zone, .main.in-sched .title-wrap, .main.in-sched #btn-participants, .main.in-sched #btn-menu { display: none; }
.sch-off-note { margin: -8px 0 16px; font-size: 13px; color: var(--text-3); }
.sch-list { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.sch-row { display: flex; align-items: flex-start; gap: 12px; padding: 14px 12px 12px 16px; border-top: 1px solid var(--line); }
.sch-row:first-child { border-top: 0; }
.sch-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sch-line1 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 16px; min-width: 0; }
.sch-name { min-width: 0; font-size: 15px; font-weight: 500; color: var(--text); overflow-wrap: anywhere; }
.sch-row.off .sch-name { color: var(--text-3); }
.sch-freq, .sch-next { font-size: 13px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sch-line2 { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-height: 26px; font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.sch-line2 > span { overflow-wrap: anywhere; }
.sch-ok { color: var(--ok); font-weight: 600; }
.sch-fail { color: var(--danger); }
.sch-muted { color: var(--text-4); }
.sch-spin { width: 12px; height: 12px; border-width: 1.5px; color: var(--text-3); }
.sch-open { font-size: 12.5px; }
.sch-err { font-size: 12.5px; color: var(--danger); overflow-wrap: anywhere; }
.sch-ctl { flex: none; display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 1px; }
.sch-ctl .switch { margin: 0; }
/* 表单: 宽屏标签在左, 窄屏上下排 */
.sch-field { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 6px 12px; align-items: start; margin-bottom: 14px; }
.sch-label { padding-top: 10px; }
.sch-control { min-width: 0; }
.sch-select { width: auto; max-width: 100%; height: 38px; padding: 0 10px; }
.sch-models { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.sch-model { display: flex; align-items: center; gap: 6px; max-width: 100%; }
.sch-model .sch-select { min-width: 200px; }
.sch-model-add { margin-top: 2px; font-size: 13px; }
.sch-place { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }
.sch-radio, .sch-radio-in { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--text); }
.sch-place input[type="radio"] { margin: 0; accent-color: var(--brand); }
.sch-when { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.sch-when-item { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.sch-when-item[hidden] { display: none; }
.sch-when-label { font-size: 13px; color: var(--text-3); }
.sch-time, .sch-date { width: auto; height: 38px; padding: 0 10px; }
.sch-form .form-msg { margin: -4px 0 8px; }
@media (max-width: 600px) {
  .sch-field { grid-template-columns: minmax(0, 1fr); }
  .sch-label { padding-top: 0; }
  .sch-model { width: 100%; }
  .sch-model .sch-select { flex: 1; min-width: 0; }
  .sch-row { padding: 12px 10px 10px 12px; gap: 8px; }
  .sch-line1 { gap: 2px 10px; }
  .sch-freq, .sch-next { white-space: normal; }
}

/* ==========================================================================
   文件舱 (ASK-192): 搜索 + 两个筛选; 选择栏 (全选 / 已选 N 个 / 下载所选); 列表行 (勾选、类型图标、名字、来源 · 大小 · 日期 · 聊天、下载)
   ========================================================================== */
.main.in-files .scroller, .main.in-files > .composer-zone, .main.in-files .title-wrap, .main.in-files #btn-participants, .main.in-files #btn-menu { display: none; }
.files-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.files-tools .pj-search { flex: 1 1 260px; min-width: 0; margin: 0; }
.files-select {
  flex: none; height: 40px; max-width: 100%; padding: 0 28px 0 12px; border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px; outline: none;
}
.files-select:focus { border-color: var(--brand-line); box-shadow: 0 0 0 3px var(--brand-soft); }
.files-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-height: 40px; padding: 0 4px 0 16px; margin-bottom: 8px; }
.files-all { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; cursor: pointer; }
.files-note { flex: 1 1 auto; min-width: 0; font-size: 13px; color: var(--text-3); overflow-wrap: anywhere; }
.files-del { margin-left: auto; }
.files-dl { margin-left: 0; }
/* 用量行 (ASK-265 S2): 标题右边「已用 x / 上限」+ 细条; 90% 起琥珀色; 点开在下面列出各部分 */
.files-head { flex-wrap: wrap; row-gap: 6px; }
.files-usage { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; max-width: 100%; }
.files-usage-line { display: inline-flex; align-items: center; gap: 10px; padding: 4px 6px; margin: -4px -6px; border: 0; border-radius: 8px; background: none; color: var(--text-3); font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; cursor: pointer; }
.files-usage-line:hover { color: var(--text-2); }
.files-usage-bar { position: relative; flex: none; width: 96px; height: 4px; border-radius: 2px; background: var(--hover-2); overflow: hidden; }
.files-usage-fill { position: absolute; inset: 0 auto 0 0; border-radius: 2px; background: var(--text-4); }
.files-usage.warn .files-usage-line { color: var(--amber); }
.files-usage.warn .files-usage-fill { background: var(--amber); }
.files-usage-parts { font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }
.files-nospace { color: var(--text-4); }
.files-spin { width: 12px; height: 12px; border-width: 1.5px; }
.files-check { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--brand); cursor: pointer; }
.files-list { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.files-row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 12px 10px 16px; border-top: 1px solid var(--line); transition: background-color .15s var(--ease); }
.files-row:first-child { border-top: 0; }
.files-row:hover { background: var(--hover); }
.files-row.sel { background: var(--hover); }
.files-ic { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 8px; background: var(--hover-2); color: var(--text-3); }
.files-ic .ic { width: 17px; height: 17px; }
.files-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.files-name { font-size: 14.5px; font-weight: 500; color: var(--text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.files-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; min-width: 0; font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.files-meta > * + *::before { content: '·'; margin: 0 6px; color: var(--text-4); }
.files-room { display: inline-block; text-align: left; min-width: 0; max-width: 100%; padding: 0; font-size: 12.5px; font-weight: 400; color: var(--text-3); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.files-room:hover { color: var(--text); }
.files-pending { color: var(--text-4); }
.files-row-dl { flex: none; }
.files-more { display: flex; justify-content: center; padding: 16px 0 0; }
.files-empty { padding: 48px 0; }
@media (max-width: 600px) {
  .files-tools .pj-search { flex-basis: 100%; }
  .files-select { flex: 1 1 0; min-width: 0; }
  .files-bar { padding-left: 12px; }
  .files-usage { flex-basis: 100%; align-items: flex-start; }
  .files-usage-parts { text-align: left; }
  .files-row { gap: 10px; padding: 10px 8px 10px 12px; }
  .files-ic { width: 28px; height: 28px; }
  .files-meta > .files-room { flex-basis: 100%; }
  .files-meta > .files-room::before { content: none; }
}

/* ==========================================================================
   后台 › 服务商 (ASK-245 piece 3): 按地区的列表 / 原地打开的卡片 / 添加对话框
   ========================================================================== */
.sup-region { margin-bottom: 18px; }
.sup-region-h { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 12.5px; font-weight: 500; color: var(--text-3); }
.sup-region-h::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sup-rows { display: flex; flex-direction: column; gap: 8px; }
.sup-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 13px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); text-align: left; font: inherit; cursor: pointer; transition: border-color .15s; }
.sup-row:hover { border-color: var(--line-3); }
.sup-row:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.sup-row.is-off .sup-main, .sup-row.is-off .sup-health { opacity: .55; }
.sup-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sup-line1, .sup-card-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.sup-name { font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.sup-chip { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; border: 1px solid color-mix(in srgb, currentColor 45%, transparent); font-size: 11.5px; line-height: 1; white-space: nowrap; color: var(--m0); }
.sup-chip-voice { color: var(--m3); }
.sup-chip-search { color: var(--m1); }
.sup-line2 { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; color: var(--text-3); }
.sup-model { font-family: var(--font-mono); color: var(--text-2); overflow-wrap: anywhere; }
.sup-nmore { color: var(--text-3); }
.sup-who { display: inline-flex; gap: 5px; padding-left: 10px; border-left: 1px solid var(--line-2); }
.sup-k { color: var(--text-4); }
.sup-noregion, .sup-warn { color: var(--amber); }
.sup-health { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); }
.sup-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--text-4); }
.sup-health.is-warn { color: var(--amber); }
.sup-health.is-warn .sup-dot { background: var(--amber); }
.sup-health.is-bad { color: var(--danger); }
.sup-health.is-bad .sup-dot { background: var(--danger); }
.sup-health.is-ok .sup-dot { background: var(--ok); }
.sup-go { flex: none; width: 16px; height: 16px; color: var(--text-4); }
/* 卡片 */
.sup-crumb { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 13px; color: var(--text-3); }
.sup-crumb .link-btn { font-size: 13px; }
.sup-card-head { margin-bottom: 16px; }
.sup-card-head h2 { font: 500 21px/1.35 var(--font-serif); overflow-wrap: anywhere; }
.sup-sec, .sup-foot, .sup-more, .sup-plan-embed { max-width: 820px; }
.sup-sec h3 { margin-bottom: 10px; }
.sup-f { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: center; padding: 6px 0; }
.sup-f-l { font-size: 13px; color: var(--text-3); }
.sup-f-v { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.sup-f-v > input, .sup-f-v > select, .sup-key-new input, .sup-fetch input, .sup-sec .field input, .sup-sec .field select, .sup-sec .field textarea, .sup-sec .kv-row input {
  min-width: 0; height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.sup-sec .field textarea { height: auto; padding: 9px 12px; }
.sup-f-v > input { flex: 1 1 320px; }
.sup-f-v > select { flex: 0 1 180px; appearance: auto; }
.sup-sec input:focus, .sup-sec select:focus, .sup-sec textarea:focus { border-color: var(--brand-line); box-shadow: 0 0 0 3px var(--brand-soft); }
.sup-f-v > input[readonly] { color: var(--text-3); background: var(--hover); }
.sup-url, .sup-fetch input, .sup-sec .variant-id { font-family: var(--font-mono); font-size: 13px; }
.sup-tag { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.sup-key { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.sup-key-st { display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); font-size: 13.5px; color: var(--text-2); white-space: nowrap; }
.sup-key-st.is-empty { color: var(--text-4); }
.sup-key-new { flex: 1 1 100%; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.sup-key-new input { flex: 1 1 260px; }
.sup-hint { margin: 4px 0 10px calc(96px + 12px); }
.sup-switch { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0 4px; cursor: pointer; }
.sup-switch .field-hint { display: block; }
.sup-sec .test-result { margin: 4px 0 8px; }
.sup-sec .test-result[hidden] { display: none; }
.sup-adv { margin-top: 8px; border-top: 1px solid var(--line); }
.sup-adv > summary { padding: 10px 0 4px; font-size: 13px; color: var(--text-3); cursor: pointer; }
.sup-adv-body { padding-top: 10px; }
.sup-more { margin: -6px 0 16px; padding: 0 20px; border-top: 0; }
.sup-sec .kv-row { display: flex; gap: 6px; margin-bottom: 6px; }
.sup-sec .kv-row input { flex: 1; }
.sup-sec .kv-row .btn { flex: none; }
.sup-entry-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.sup-entry-name { font-size: 14px; font-weight: 500; }
.sup-pick { margin-left: auto; padding: 0; }
.sup-pick .model-variant { width: auto; max-width: 260px; }
.sup-models-wrap { overflow-x: auto; margin: 0 -4px; }
.sup-models { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.sup-models th { padding: 8px 10px; text-align: left; font-size: 12px; font-weight: 500; color: var(--text-3); border-bottom: 1px solid var(--line); white-space: nowrap; }
.sup-models td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.sup-models .c { width: 84px; text-align: center; }
.sup-models tr.is-off .variant-id { color: var(--text-4); }
.sup-models input[type="radio"] { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); cursor: pointer; }
.sup-mid .variant-id { display: inline; white-space: normal; overflow-wrap: anywhere; }
.sup-mid .badge { margin-left: 8px; vertical-align: 1px; }
.sup-fetch { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin: 10px 0 6px; }
.sup-fetch .link-btn { align-self: center; }
.sup-fetch input { flex: 0 1 280px; height: 32px; }
.sup-fetch-note { flex: 1 1 100%; }
.sup-limits { margin-top: 10px; }
.sup-limits .field { margin-bottom: 4px; }
.sup-radios { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.sup-radio { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.sup-radio input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
.sup-some { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 10px; font-size: 13.5px; color: var(--text-2); }
.sup-sec > .field-hint { margin-top: 8px; }
.sup-sec > .field-hint[hidden] { display: none; }
.sup-sec > .sup-health { font-size: 13.5px; }
.sup-fixed { font-size: 14px; }
.sup-foot { display: flex; align-items: center; gap: 12px; padding: 4px 0 8px; }
.sup-foot-mid { flex: 1; min-width: 0; text-align: right; }
.sup-note { font-size: 13px; color: var(--ok); }
.sup-note.sup-warn { color: var(--amber); }
.sup-note:empty, .sup-msg:empty { display: none; }
/* Claude 订阅的卡片: 连接表单单列嵌入, 不要左边的连接列表与「提供商」下拉 */
.sup-plan-embed { margin-bottom: 16px; }
.sup-plan-embed .conn-layout { display: block; height: auto; min-height: 0; }
.sup-plan-embed .conn-left, .sup-plan-embed #preset-field { display: none; }
.sup-plan-embed .conn-form-scroll { overflow: visible; }
/* 添加对话框 */
.sup-kinds { margin-bottom: 14px; }
.sup-kind-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.sup-kind { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); text-align: left; font: inherit; font-size: 13.5px; cursor: pointer; }
.sup-kind:hover { border-color: var(--line-3); }
.sup-kind:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.sup-kind-l { min-width: 0; overflow-wrap: anywhere; }
.sup-add-dlg .sup-fetch { margin: 2px 0 0; }
.sup-foot-gap { flex: 1; }
/* ASK-245 piece 4: 服务商页的 本站可用的地区 / 用户自带; 卡片「只限这些组」的标签; 用户组的组页 */
.sup-region.is-closed .sup-rows { opacity: .6; }
.sup-region-off, .grp-region-off { margin: -2px 0 8px; font-size: 12.5px; color: var(--text-3); }
.sup-pol { max-width: 820px; margin-top: 22px; }
.sup-pol-h { margin-bottom: 10px; font-size: 15px; font-weight: 500; }
.admin-card.sup-pol-card { padding: 16px 18px 12px; }
.sup-pol-sub { margin-bottom: 8px; font-size: 13.5px; color: var(--text-2); }
.sup-pol-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; }
.sup-pol-row .sup-pol-l { flex: 1; }
.sup-pol-l { font-size: 13.5px; color: var(--text-2); }
.sup-pol-checks, .grp-region-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.sup-pol-check { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 9px; font-size: 13.5px; cursor: pointer; }
.sup-pol-check.is-dis { opacity: .6; cursor: default; }
.sup-pol-card > .field-hint { margin-top: 10px; }
.sup-pol-note { margin-top: 8px; font-size: 12.5px; color: var(--ok); }
.sup-pol-note.is-bad { color: var(--amber); }
.sup-pol-note:empty { display: none; }
.sup-own-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: center; padding: 6px 0; }
.sup-own-row.sup-own-top { align-items: start; }
.sup-own-row.sup-own-top .sup-pol-l { padding-top: 8px; }
.sup-own-sep { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.sup-own-v { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; min-width: 0; }
.sup-own-col { flex-direction: column; align-items: stretch; }
.sup-own-v > select, .grp-own select { height: 34px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--bg); color: var(--text); font: inherit; font-size: 13.5px; appearance: auto; }
.sup-own-fixed { display: inline-flex; align-items: center; height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 13.5px; color: var(--text-3); }
.sup-own-max { width: 90px; height: 34px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--bg); color: var(--text); font: inherit; font-size: 13.5px; }
.sup-own-hosts { width: 100%; max-width: 420px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--bg); color: var(--text); font: 13px/1.5 var(--font-mono); resize: vertical; }
.sup-own-builtin > summary { font-size: 12.5px; color: var(--text-3); cursor: pointer; }
.sup-own-hostlist { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 6px 0 2px; font: 12px/1.5 var(--font-mono); color: var(--text-3); }
.sup-gchips { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; flex-basis: 100%; }
.sup-sec > .sup-gchips { margin-top: 10px; }
.sup-gchips[hidden] { display: none; }
.sup-gchip { display: inline-flex; align-items: center; gap: 2px; height: 28px; padding: 0 4px 0 10px; border-radius: 8px; background: var(--hover); font-size: 13px; }
.sup-gchip-x { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: var(--text-3); }
.sup-gchip-x:hover { background: var(--side-hover); color: var(--text); }
.sup-gchip-x .ic { width: 13px; height: 13px; }
.sup-gadd { height: 28px; padding: 0 8px; border: 1px dashed var(--line-3); border-radius: 8px; background: transparent; color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; }
.grp-def-hint { display: block; font-size: 12px; color: var(--text-3); }
.grp-name.link-btn { color: var(--text); font-weight: 500; }
.grp-page-head { margin-bottom: 14px; }
.grp-page-head h2 { font: 500 21px/1.35 var(--font-serif); overflow-wrap: anywhere; }
.grp-page-sub { font-size: 13px; color: var(--text-3); }
.grp-regions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.grp-follow { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; cursor: pointer; }
.grp-region { margin-bottom: 10px; }
.grp-region .sup-region-h { margin-top: 4px; }
.grp-sup { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 8px 12px; align-items: start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.grp-sup:last-of-type { border-bottom: 0; }
.grp-sup-name { display: flex; align-items: center; gap: 9px; min-height: 30px; font-size: 14px; cursor: pointer; overflow-wrap: anywhere; }
.grp-sup-models { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.grp-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 9px; border: 1px solid var(--line-2); border-radius: 8px; font-size: 12.5px; cursor: pointer; }
.grp-chip:not(.is-on) .variant-id { color: var(--text-4); }
.grp-chip .variant-id { font-family: var(--font-mono); }
.grp-sup.is-off .grp-sup-name, .grp-sup.is-off .grp-sup-models { opacity: .55; }
.grp-region.is-dis .grp-sup { opacity: .5; }
.grp-region.is-dis label { cursor: default; }
.grp-owns { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.grp-own { display: inline-flex; align-items: center; gap: 8px; }
.grp-own-l { font-size: 13px; color: var(--text-3); }
.grp-foot { justify-content: flex-end; }
/* 用户侧: 被规则停用的自己的模型 / 搜索密钥 (灰着, 一句说明) */
.conn-item.is-blocked .cc-name, .conn-item.is-blocked .cc-meta, .conn-item.is-blocked .cc-badges { opacity: .55; }
.cc-blocked { display: block; margin-top: 3px; font-size: 12px; line-height: 1.5; color: var(--text-3); white-space: normal; }
.cc-health { display: flex; flex-wrap: wrap; margin-top: 3px; font-size: 12px; white-space: normal; }
.cc-health-err { flex-basis: 100%; color: var(--text-3); line-height: 1.5; overflow-wrap: anywhere; }
.url-refused { color: var(--amber); }
.field-hint.is-blocked { color: var(--text-3); }
.models-search { margin-top: 18px; }
.models-search[hidden] { display: none; }
.my-search-row { display: flex; align-items: center; gap: 12px; padding: 8px 2px; }
.my-search-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.my-search-name { font-size: 14px; font-weight: 500; }
.my-search-st { font-size: 12.5px; color: var(--text-3); }
.my-search-row.is-blocked .my-search-name { opacity: .55; }
.okey-search-row .okey { flex: none; }
/* ASK-245 piece 8: 搜索顺序 / 语音顺序 (列表下面, 宽屏并排), 卡片上的「联网搜索」「语音输入」块, 添加对话框按能力分组 */
.sup-orders { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 18px; max-width: 820px; }
@media (min-width: 900px) { .sup-orders { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sup-orders > .sup-pol { max-width: none; }
.sup-ochips { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 6px; }
.sup-ochip { display: inline-flex; align-items: center; gap: 6px; min-width: 0; height: 34px; padding: 0 2px 0 8px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface); font-size: 13.5px; cursor: grab; }
.sup-ochip.is-off .sup-oname { color: var(--text-4); }
.sup-ograb { color: var(--text-4); font-size: 12px; }
.sup-onum { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--hover); font-size: 11.5px; color: var(--text-3); }
.sup-oname { min-width: 0; overflow-wrap: anywhere; }
.sup-omove { width: 24px; height: 24px; color: var(--text-3); }
.sup-omove .ic { width: 14px; height: 14px; }
.sup-omove[disabled] { opacity: .3; }
.sup-oarrow { color: var(--text-4); font-size: 13px; }
.sup-order-empty { font-size: 13.5px; color: var(--text-3); }
.sup-pos { color: var(--text-3); }
.sup-sec > .sup-pos { margin-top: 6px; font-size: 13px; }
.sup-abil-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.sup-abil .field { margin-top: 10px; }
.sup-abil .asr-adv { margin-top: 10px; }
.sup-abil-h { margin: 4px 0 10px; font-size: 14px; font-weight: 500; }
.sup-kinds h4.sup-region-h { font-size: 12.5px; }
.search-sup-note { margin: -4px 0 14px; }
@media (pointer: coarse) { .sup-ograb { display: none; } .sup-ochip { cursor: default; } }
@media (max-width: 600px) {
  .sup-row { align-items: flex-start; flex-wrap: wrap; gap: 10px 12px; padding: 12px; }
  .sup-main { flex-basis: calc(100% - 44px); }
  .sup-health { margin-left: 44px; }
  .sup-go { display: none; }
  .sup-who { padding-left: 0; border-left: 0; }
  .sup-f { grid-template-columns: 1fr; gap: 6px; }
  .sup-hint { margin-left: 0; }
  .sup-f-v > input, .sup-f-v > select { flex: 1 1 100%; }
  .sup-models .c { width: 64px; }
  .sup-pick { margin-left: 0; flex: 1 1 100%; }
  .sup-foot { flex-wrap: wrap; }
  .sup-foot-mid { order: 3; flex-basis: 100%; text-align: left; }
  .sup-foot .btn-primary { margin-left: auto; }
  .admin-card.sup-sec { padding: 14px 14px 10px; }
  .sup-own-row { grid-template-columns: 1fr; gap: 6px; }
  .sup-own-row.sup-own-top .sup-pol-l { padding-top: 0; }
  .grp-sup { grid-template-columns: 1fr; }
  .admin-card.sup-pol-card { padding: 14px 14px 10px; }
}
/* 每月预算 (ASK-245 piece 5): 组页的卡片, 用量页的「本月预算」列, 我的用量 / 「模型」顶上的条, 回答下的提醒线与拒绝块 */
.bud-per { margin: -2px 0 4px; font-size: 13.5px; font-weight: 500; color: var(--text-2); }
.bud-money { display: inline-flex; align-items: stretch; height: 32px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); overflow: hidden; }
.bud-money:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.bud-sym { display: grid; place-items: center; padding: 0 10px; border-right: 1px solid var(--line-2); font-size: 13px; color: var(--text-3); }
.bud-money input { width: 84px; min-width: 0; padding: 0 10px; border: 0; background: transparent; font: inherit; font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; outline: none; }
.bud-money.is-dis { opacity: .5; }
.bud-off { font-size: 12.5px; color: var(--text-3); }
.bud-acts { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 8px; }
.bud-acts-l { font-size: 13px; color: var(--text-3); }
.bud-act { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.bud-act input { accent-color: var(--brand); margin: 0; }
.bud-sum { margin: 12px 0 2px; padding: 8px 12px; border-radius: 8px; background: var(--hover); font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.bud-noprice { margin-top: 8px; color: var(--amber); }
/* ASK-245 piece 7: 回答方式 (组页 + 系统设置的「为：」) */
.grp-chip.is-flow { border-color: var(--amber); }
.grp-flow-used { font-size: 11.5px; color: var(--amber); white-space: nowrap; }
.flow-follow { flex-direction: row; flex-wrap: wrap; gap: 8px 20px; margin: 4px 0 12px; }
.grp-flow .field { margin-top: 10px; }
.flow-for .flow-for-sel { max-width: 320px; }
.bud-track { position: relative; display: block; flex: none; width: 120px; height: 4px; border-radius: 2px; background: var(--hover-2); overflow: hidden; }
.bud-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: var(--text-3); }
.bud-track.is-warn .bud-fill { background: var(--amber); }
.bud-track.is-stop .bud-fill { background: var(--danger); opacity: .75; }
.bud-cell { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.bud-bars { display: flex; flex-direction: column; gap: 6px; }
.bud-line { display: flex; align-items: center; gap: 10px; }
.bud-v { font-size: 12.5px; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bud-tags { display: inline-flex; align-items: center; gap: 8px; }
.bud-chip { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 11.5px; white-space: nowrap; }
.bud-chip.is-warn { background: var(--amber-bg); color: var(--amber); }
.bud-chip.is-stop { background: var(--danger-bg); color: var(--danger); }
.bud-chip.is-muted { background: var(--hover); color: var(--text-3); }
.bud-release { font-size: 12.5px; color: var(--brand); white-space: nowrap; }
.bud-none { font-size: 13px; color: var(--text-3); }
.usage-table th.usage-bud, .usage-table td.usage-bud { min-width: 220px; }
.admin-tab .tab-dot { display: inline-block; width: 6px; height: 6px; margin-left: 5px; border-radius: 50%; background: var(--amber); vertical-align: 2px; }
.admin-tab .tab-dot.is-bad { background: var(--danger); }
.bud-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.bud-head .bud-line { gap: 12px; font-size: 13px; }
.bud-head .bud-k { flex: none; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bud-head .bud-track { flex: 1 1 auto; width: auto; min-width: 60px; }
.bud-head .bud-tail { flex: none; font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.bud-zone { font-size: 12px; color: var(--text-3); }
.models-bud:empty { display: none; }
.models-bud .bud-head { margin-bottom: 16px; }
.bud-warn { display: flex; align-items: baseline; gap: 8px; margin-top: 10px; font-size: 12.5px; line-height: 1.55; color: var(--text-3); }
.bud-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); transform: translateY(-1px); }
.bud-stop { margin-top: 2px; padding: 14px 16px 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); width: fit-content; max-width: 100%; }
.bud-stop-t { font-size: 14.5px; line-height: 1.6; color: var(--text); }
.bud-stop-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.bud-stop-sub { margin-top: 8px; font-size: 12.5px; color: var(--text-3); }
@media (max-width: 720px) {
  .usage-table td.usage-bud { min-width: 0; }
  .usage-table td.usage-bud .bud-cell { justify-content: flex-end; }
  .bud-track { width: 90px; }
}
@media (max-width: 600px) {
  .bud-head .bud-line { flex-wrap: wrap; gap: 4px 10px; }
  .bud-head .bud-track { flex-basis: 100%; order: 3; }
  .bud-head .bud-tail { white-space: normal; }
}

/* ---- ASK-245 piece 6: 「模型」对话框 (图 4): 地区小标题 / 自己的密钥那一格与小窗 / 默认模型 / 底部的额度条; 服务商卡片的「用户自己的密钥」---- */
.models-region + .models-region { margin-top: 4px; }
.models-region-h { display: flex; align-items: center; gap: 10px; margin: 6px 2px 6px; font-size: 12px; font-weight: 400; color: var(--text-4); }
.models-region-h::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.okey { flex: none; display: flex; align-items: center; gap: 8px; max-width: 46%; font-size: 12.5px; }
.okey.is-muted { color: var(--text-4); }
.okey-note { line-height: 1.45; }
.okey-chip { padding: 2px 8px; border-radius: 6px; font-size: 12px; line-height: 1.5; white-space: nowrap; }
.okey-chip.is-ok { background: var(--brand-soft); color: var(--brand-text); }
.okey-chip.is-warn { background: var(--amber-bg); color: var(--amber); }
.okey-chip.is-bad { background: var(--danger-bg); color: var(--danger); }
.okey-act { align-self: center; white-space: nowrap; }
.okey-act[disabled] { color: var(--text-3); cursor: default; text-decoration: none; }
.okey-use { padding: 4px 10px; border: 1px solid var(--brand-line); border-radius: 8px; background: none; color: var(--brand); font-size: 12.5px; white-space: nowrap; cursor: pointer; }
.okey-use:hover, .okey-use[aria-expanded="true"] { background: var(--brand-soft); }
.okey-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding: 0 12px 6px 60px; font-size: 12.5px; color: var(--text-3); }
.okey-only .model-name { color: var(--text-3); }
.okey-pop { margin: 2px 0 8px 48px; padding: 14px 16px 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; gap: 10px; }
.okey-pop-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.okey-x { width: 28px; height: 28px; }
.okey-input { width: 100%; height: 36px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); color: var(--text); font: 13px var(--font-mono); }
.okey-input:focus { border-color: var(--brand-line); box-shadow: 0 0 0 3px var(--brand-soft); outline: none; }
.okey-btns { display: flex; justify-content: flex-end; gap: 8px; }
.okey-btns .okey-del { margin-right: auto; }
.okey-res { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; line-height: 1.5; color: var(--text-3); }
.okey-res.is-ok { color: var(--ok); }
.okey-res.is-bad { color: var(--danger); }
.okey-res-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.okey-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: currentColor; transform: translateY(-1px); }
.okey-err summary { cursor: pointer; color: var(--text-3); }
.okey-err pre { margin-top: 4px; padding: 8px 10px; max-height: 160px; overflow: auto; border-radius: 8px; background: var(--code-bg); color: var(--text-2); font: 12px/1.5 var(--font-mono); white-space: pre-wrap; word-break: break-word; }
.okey-msg:empty { display: none; }
.okey-explain { font-size: 12.5px; line-height: 1.6; color: var(--text-3); }
.models-def { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.models-def[hidden] { display: none; }
.models-def-row { display: flex; align-items: center; gap: 16px; }
.models-def-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.models-def-l { font-size: 14px; font-weight: 500; }
.models-def-hint { font-size: 12.5px; color: var(--text-3); }
.models-def-sel { flex: none; max-width: 50%; height: 34px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 13.5px; }
.models-sec ~ .models-bud { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.models-bud .bud-head { margin-bottom: 0; }
.sup-switch.is-dis { cursor: default; opacity: .6; }
.sup-ukeys-n { margin-top: 8px; font-size: 13.5px; color: var(--text-2); }
@media (max-width: 480px) {
  .models-list .model-row { flex-wrap: wrap; }
  .okey { max-width: none; flex-basis: 100%; padding-left: 48px; flex-wrap: wrap; }
  .okey-line { padding-left: 12px; }
  .okey-pop { margin-left: 0; border-radius: 12px; box-shadow: none; }
  .okey-btns { flex-wrap: wrap; }
  .models-def-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .models-def-sel { max-width: none; width: 100%; }
}

/* ASK-285 S1: 后台 › 隐私保护 */
.privacy-h { font-size: 14px; font-weight: 500; color: var(--text-2); margin: 18px 0 10px; }
.privacy-table td.num { font-variant-numeric: tabular-nums; }
/* ASK-285 S2: 规则表 (类别 × 地区) */
.pv-rules select { height: 32px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; font-size: 13px; appearance: auto; }
.pv-rule { font-weight: 500; }
.pv-more { display: inline-flex; align-items: center; gap: 2px; margin-left: 8px; font-size: 12.5px; color: var(--text-3); }
.pv-more .ic { width: 13px; height: 13px; }
.pv-rules tr.pv-cat td:first-child { padding-left: 30px; }
.pv-cat-n { display: block; color: var(--text-2); }
.pv-sub { display: block; font-size: 12px; color: var(--text-3); }
.pv-fixed { font-size: 13px; color: var(--text-3); }
.pv-off { margin-bottom: 10px; }
.privacy-policy .field-hint { margin-top: 8px; }
.pv-foot { margin-top: 10px; }
.pv-foot .btn:disabled { opacity: .5; cursor: default; }
@media (max-width: 720px) {
  .pv-rules td.pv-na { display: none; }
  .pv-rules tr.pv-cat td:first-child { padding-left: 14px; }
  .pv-rules tr.pv-cat { background: var(--hover); }
  .pv-foot { flex-wrap: wrap; }
  .pv-foot .sup-foot-mid { flex-basis: 100%; text-align: left; }
}
/* ASK-285 S2: 用户消息下一行「已遮盖：…」与点开的小面板; 回答被阻止的一行 */
.pv-line { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; margin-top: 6px; padding: 0; border: 0; background: none; color: var(--text-3); font-size: 12.5px; line-height: 1.5; cursor: pointer; text-align: left; }
.pv-line:hover { color: var(--text-2); }
.pv-line .ic { width: 13px; height: 13px; flex: none; }
.pv-line-t { min-width: 0; overflow-wrap: anywhere; }
.pv-panel { max-width: 100%; margin-top: 6px; padding: 8px 12px; border-radius: 10px; background: var(--hover); color: var(--text-2); font-size: 13px; line-height: 1.55; text-align: left; }
.pv-panel p { margin: 0 0 4px; }
.pv-to { color: var(--text-2); }
.pv-cats { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 6px; padding: 0; list-style: none; }
.pv-hint { color: var(--text-3); font-size: 12.5px; }
.pv-panel .btn { margin-top: 6px; }
.pv-err { color: var(--danger); font-size: 12.5px; margin-top: 6px !important; }
/* ASK-285 S3: 后台 › 隐私保护 › 自定义规则、允许名单、试一试、按用户组; 用户的「隐私保护」对话框 */
.pv-ext-line { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin: 18px 0 4px; font-size: 13.5px; }
.pv-ext-link { display: inline-flex; align-items: center; gap: 2px; color: var(--text-2); }
.pv-ext-link .ic { width: 13px; height: 13px; }
.pv-dot { color: var(--text-3); }
.pv-sec { margin-top: 6px; }
.pv-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pv-sec-head .btn .ic { width: 14px; height: 14px; }
.pv-state { display: block; margin-top: 2px; font-size: 12px; color: var(--amber); }
.pv-rlist td { vertical-align: top; }
.pv-empty { margin: 4px 0 8px; font-size: 13.5px; }
.pv-editor, .pv-test { margin: 12px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.pv-ed-h { margin: 0 0 10px; font-size: 13.5px; font-weight: 500; color: var(--text-2); }
.pv-editor .sup-f-v input[type="text"], .pv-editor .sup-f-v input[type="number"], .pv-editor select, .pv-ed-area {
  max-width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; font-size: 13.5px; box-sizing: border-box; }
.pv-editor .sup-f-v > .pv-ed-num { flex: 0 0 110px; }
.pv-ed-mono { font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace) !important; }
textarea.pv-ed-area { display: block; width: 100%; height: auto; min-height: 80px; padding: 8px 10px; line-height: 1.5; resize: vertical; }
.pv-ed-tick { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; color: var(--text-2); }
.pv-editor .sup-f-v .field-hint { flex-basis: 100%; margin-top: 0; }
.pv-ed-acts { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.pv-ed-act { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.pv-ed-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.pv-test-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.pv-test-out { margin-top: 10px; }
.pv-test-sum { margin: 0 0 6px; font-size: 13px; color: var(--text-2); }
.pv-sample { padding: 10px 12px; border-radius: 10px; background: var(--hover); font-size: 13.5px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
.pv-mark { padding: 1px 2px; border-radius: 4px; background: var(--amber-bg); color: var(--text); }
.pv-chip { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: var(--surface); color: var(--text-3); font-size: 11px; line-height: 1.6; vertical-align: 1px; white-space: nowrap; }
.pv-groups .pv-grp { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.pv-grp-name { min-width: 120px; font-weight: 500; }
.pv-grp-sel { height: 32px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; font-size: 13px; }
.pv-grp-ed { padding: 10px 0 14px; border-bottom: 1px solid var(--line); }
.grp-pv { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; font-size: 13.5px; }
.me-pv-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.me-pv-table th, .me-pv-table td { padding: 7px 6px; text-align: center; border-bottom: 1px solid var(--line); }
.me-pv-table thead th { font-weight: 500; font-size: 12.5px; color: var(--text-3); }
.me-pv-table th[scope="row"], .me-pv-table thead th:first-child { text-align: left; font-weight: 400; color: var(--text); }
.me-pv-table input:disabled { opacity: .55; }
.me-pv + .field-hint { margin-top: 8px; }
/* ASK-307: 后台「全站屏蔽名单」与「新建」并排; 用户对话框里的「我的屏蔽名单」 */
.pv-sec-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.me-pv-list { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.me-pv-h { margin: 0 0 8px; font-size: 13.5px; font-weight: 500; color: var(--text-2); }
.me-pv-list .pv-ed-area { border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; font-size: 13.5px; box-sizing: border-box; }
.me-pv-list .field-hint { margin-top: 6px; }
.me-pv-list-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.me-pv-list-foot .sup-note { flex: 1; min-width: 0; margin: 0; overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .pv-editor, .pv-test { padding: 12px; }
  .pv-sec-head { flex-wrap: wrap; }
  .pv-grp-name { min-width: 0; flex-basis: 100%; }
}

/* ASK-285 S4: 后台 › 隐私保护 › 人名与地址识别 */
.pv-ner { margin-top: 22px; }
.pv-ner .field-hint { margin: 2px 0; }
.pv-ner-eval { margin: 8px 0; }
.pv-ner-h { margin: 0 0 2px; font-size: 13px; color: var(--text-2); }
/* ASK-285 S5: 检查模型 (连接、最多等、检查不了时、同时检查: 一行排开, 窄屏换行) */
.pv-ck-grid { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 10px 0 6px; }
.pv-ck-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; max-width: 100%; }
.pv-ck-l { font-size: 12px; color: var(--text-3); }
.pv-ck-f select { max-width: 100%; height: 32px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; font-size: 13px; appearance: auto; }
