/* 推广调度 · 值守台
   设计语言：账房纸面 + 值守灯。深墨侧栏、石白纸面、朱砂只用于待放行与风险。
   结构靠栏线，不靠圆角卡片堆叠。 */

:root {
  --ink: #18201c;
  --ink-2: #3e4a44;
  --muted: #6c7771;
  --faint: #8b948e;
  --paper: #eef0ea;
  --surface: #f7f8f3;
  --surface-2: #f1f3ed;
  --line: #d5dad2;
  --line-strong: #b6beb5;
  --rail: #141a17;
  --rail-2: #1c2420;
  --rail-text: #e7eae3;
  --rail-muted: #8c978f;
  --accent: #a93a2b;
  --accent-2: #8b2c20;
  --accent-soft: #f1e2dd;
  --pine: #2f6b4f;
  --pine-soft: #e2ece5;
  --amber: #96631a;
  --amber-soft: #f3e9d7;
  --blue: #35507f;
  --blue-soft: #e4e9f2;
  --danger: #a52f23;
  --danger-soft: #f4e1dd;
  --shadow: rgba(20, 26, 23, 0.16);
  --font-ui: "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", "PingFang SC", sans-serif;
  --font-display: "Source Han Serif SC", "Noto Serif SC", "Songti SC", STSong, SimSun, "Palatino Linotype", serif;
  --font-data: Bahnschrift, "DIN Alternate", "Consolas", "Courier New", monospace;
  --radius: 5px;
  --rail-w: 232px;
  --topbar-h: 64px;
  --gap: 24px;
  color-scheme: light;
}

[data-theme="dark"] {
  --ink: #e6eae2;
  --ink-2: #b8c1b9;
  --muted: #909a93;
  --faint: #727c75;
  --paper: #111613;
  --surface: #171d19;
  --surface-2: #1c2320;
  --line: #2b342f;
  --line-strong: #3d4841;
  --rail: #0c110e;
  --rail-2: #141a16;
  --rail-text: #e7eae3;
  --rail-muted: #7f8a82;
  --accent: #d06652;
  --accent-2: #e08270;
  --accent-soft: #33201c;
  --pine: #6faa86;
  --pine-soft: #1b2a21;
  --amber: #d0a25a;
  --amber-soft: #2c2518;
  --blue: #8ba4d0;
  --blue-soft: #1d2533;
  --danger: #d0695a;
  --danger-soft: #33201d;
  --shadow: rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

[data-accent="pine"] { --accent: #2f6b4f; --accent-2: #24543d; --accent-soft: #e1ebe4; }
[data-theme="dark"][data-accent="pine"] { --accent: #74ad8b; --accent-2: #8fc2a2; --accent-soft: #1b2a21; }
[data-accent="indigo"] { --accent: #3b4f86; --accent-2: #2e3f6c; --accent-soft: #e4e8f1; }
[data-theme="dark"][data-accent="indigo"] { --accent: #93a7d6; --accent-2: #a9b9e0; --accent-soft: #1e2434; }
[data-accent="ochre"] { --accent: #8d641c; --accent-2: #725015; --accent-soft: #f2e8d4; }
[data-theme="dark"][data-accent="ochre"] { --accent: #cc9e50; --accent-2: #dbb36e; --accent-soft: #2b2417; }
[data-accent="graphite"] { --accent: #4b5550; --accent-2: #3a423e; --accent-soft: #e5e9e5; }
[data-theme="dark"][data-accent="graphite"] { --accent: #a7b2ab; --accent-2: #bcc7c0; --accent-soft: #232a26; }

[data-density="compact"] { --gap: 16px; --topbar-h: 56px; --rail-w: 216px; }
[data-density="compact"] .page { padding-top: 20px; }
[data-scale="small"] { font-size: 13px; }
[data-scale="large"] { font-size: 15.5px; }

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { font-size: 14px; }
body {
  font-family: var(--font-ui);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 16px; height: 16px; flex: none; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

/* ------------------------------------------------------------- 基础排版 */
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { font-weight: 600; }
.display { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.01em; }
.mono { font-family: var(--font-data); font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.strong { font-weight: 600; color: var(--ink); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.kicker { font-size: 11.5px; letter-spacing: 0.08em; color: var(--muted); }
.serif { font-family: var(--font-display); }
hr.rule { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.link { color: var(--accent); background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------- 启动占位 */
.boot-screen { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: var(--rail); color: var(--rail-text); z-index: 200; }
.boot-mark { font-family: var(--font-display); font-size: 26px; letter-spacing: .1em; }
.boot-line { display: inline-flex; align-items: center; gap: 9px; color: var(--rail-muted); font-size: 12.5px; }

/* ------------------------------------------------------------------ 布局 */
#app { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100vh; }
.workspace { min-width: 0; display: flex; flex-direction: column; }
.page { flex: 1; width: 100%; max-width: 1560px; margin: 0 auto; padding: 28px clamp(20px, 3vw, 44px) 64px; }

/* ------------------------------------------------------------------ 侧栏 */
.rail {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--rail); color: var(--rail-text);
  display: flex; flex-direction: column; padding: 20px 12px 14px;
  border-right: 1px solid #000;
  scrollbar-width: thin;
}
.rail-brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 20px; }
.rail-seal {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center;
  background: var(--accent); color: #fbf8f1; font-family: var(--font-display);
  font-size: 20px; font-weight: 700; border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.rail-brand b { display: block; font-family: var(--font-display); font-size: 17px; letter-spacing: 0.04em; line-height: 1.2; }
.rail-brand span { display: block; font-size: 10.5px; color: var(--rail-muted); letter-spacing: 0.12em; margin-top: 2px; }
.rail-nav { display: flex; flex-direction: column; gap: 18px; }
.rail-group-title { padding: 0 10px 7px; font-size: 10.5px; color: var(--rail-muted); letter-spacing: 0.14em; }
.nav-item {
  width: 100%; display: flex; align-items: center; gap: 11px;
  background: transparent; border: 0; border-radius: 4px;
  padding: 9px 10px; color: #cdd4cd; text-align: left; position: relative;
  transition: background .15s ease, color .15s ease;
}
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: .8; }
.nav-item span.label { flex: 1; font-size: 13.5px; }
.nav-item:hover { background: rgba(255,255,255,.055); color: #fff; }
.nav-item[aria-current="page"] { background: var(--rail-2); color: #fff; }
.nav-item[aria-current="page"]::before {
  content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px;
  width: 3px; background: var(--accent); border-radius: 0 2px 2px 0;
}
.nav-item[aria-current="page"] svg { color: var(--accent); opacity: 1; }
.nav-badge {
  min-width: 20px; height: 19px; padding: 0 6px; border-radius: 10px;
  background: #2c3732; color: #dfe5de; font-size: 11px; line-height: 19px;
  text-align: center; font-variant-numeric: tabular-nums;
}
.nav-item[aria-current="page"] .nav-badge { background: var(--accent); color: #fff; }
.nav-badge.quiet { background: transparent; color: var(--rail-muted); }
.rail-spacer { flex: 1; min-height: 20px; }
.rail-foot { border-top: 1px solid #2a332e; padding-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.rail-agent {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px;
  border-radius: 4px; background: rgba(255,255,255,.035); font-size: 12px;
}
.rail-agent .dot { width: 7px; height: 7px; }
.rail-agent b { font-weight: 500; color: #eef1ec; }
.rail-agent span { color: var(--rail-muted); font-size: 11px; }
.rail-agent .grow { flex: 1; min-width: 0; }
.rail-link {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: none; border: 0; color: var(--rail-muted); padding: 8px 10px;
  border-radius: 4px; font-size: 12.5px;
}
.rail-link:hover { background: rgba(255,255,255,.055); color: #fff; }
.rail-link svg { width: 15px; height: 15px; }

/* ------------------------------------------------------------------ 顶栏 */
.topbar {
  height: var(--topbar-h); flex: none; display: flex; align-items: center; gap: 20px;
  padding: 0 clamp(20px, 3vw, 44px); border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 30;
}
.topbar-title { font-family: var(--font-display); font-size: 21px; line-height: 1; letter-spacing: 0.02em; }
.topbar-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.topbar-left { flex: 1; min-width: 0; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.cmd-trigger {
  display: flex; align-items: center; gap: 8px; min-width: 190px;
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius);
  padding: 6px 9px; color: var(--muted); font-size: 12px;
}
.cmd-trigger:hover { border-color: var(--line-strong); color: var(--ink); }
.cmd-trigger kbd {
  margin-left: auto; font-family: var(--font-data); font-size: 10px;
  border: 1px solid var(--line); border-bottom-color: var(--line-strong);
  border-radius: 3px; padding: 1px 4px; color: var(--faint); background: var(--paper);
}
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); display: inline-block; flex: none; }
.dot.online { background: var(--pine); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pine) 15%, transparent); }
.dot.busy { background: var(--amber); box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 16%, transparent); }
.dot.offline { background: var(--faint); }
.dot.seal { background: var(--accent); }
.pulse { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--pine); display: inline-block; }
.pulse::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1px solid var(--pine); opacity: .5; animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse { 0% { transform: scale(.6); opacity: .55; } 80%, 100% { transform: scale(1.5); opacity: 0; } }
.icon-btn {
  width: 34px; height: 34px; display: inline-grid; place-items: center;
  border: 1px solid transparent; background: transparent; border-radius: var(--radius);
  color: var(--ink-2); position: relative;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn .count {
  position: absolute; top: 1px; right: 0; min-width: 15px; height: 15px;
  border-radius: 8px; background: var(--accent); color: #fff; font-size: 9.5px;
  line-height: 15px; text-align: center; padding: 0 3px;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line-strong);
  display: grid; place-items: center; font-family: var(--font-display);
  background: var(--surface-2); font-size: 13px; color: var(--ink-2);
}
.avatar:hover { border-color: var(--accent); color: var(--accent); }

/* --------------------------------------------------------------- 登录页 */
.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, 0.9fr); }
.login-side {
  background: var(--rail); color: var(--rail-text); padding: clamp(32px, 6vw, 72px);
  display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.login-side::after {
  content: "值"; position: absolute; right: -30px; bottom: -110px;
  font-family: var(--font-display); font-size: 360px; line-height: 1;
  color: rgba(255,255,255,.028); pointer-events: none;
}
.login-side .brand { display: flex; align-items: center; gap: 12px; }
.login-side .brand b { font-family: var(--font-display); font-size: 19px; letter-spacing: .05em; }
.login-copy h1 { font-family: var(--font-display); font-size: clamp(38px, 5vw, 62px); line-height: 1.08; font-weight: 500; max-width: 11em; margin: 32px 0 18px; }
.login-copy p { color: #aab4ac; max-width: 34em; font-size: 14px; line-height: 1.9; }
.login-points { margin-top: 30px; display: grid; gap: 12px; max-width: 30em; }
.login-point { display: flex; gap: 11px; align-items: flex-start; color: #c8d0c9; font-size: 13px; }
.login-point i { width: 18px; height: 18px; border: 1px solid #46524a; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 10px; color: #9faaa2; flex: none; margin-top: 1px; }
.login-side footer { color: #6f7b73; font-size: 11.5px; }
.login-form-wrap { display: grid; place-items: center; padding: 40px; background: var(--surface); }
.login-form { width: min(368px, 100%); }
.login-form .kicker { color: var(--accent); letter-spacing: .16em; }
.login-form h2 { font-family: var(--font-display); font-size: 30px; margin: 10px 0 8px; }
.login-form > p { color: var(--muted); font-size: 13.5px; margin-bottom: 26px; }
.login-form .field { margin-bottom: 16px; }
.login-note { margin-top: 18px; padding: 12px 14px; border-left: 2px solid var(--line-strong); color: var(--muted); font-size: 12px; line-height: 1.7; }
.login-status { margin-top: 26px; display: flex; align-items: center; justify-content: space-between; color: var(--faint); font-size: 11.5px; }
.login-error { margin-top: 12px; color: var(--danger); font-size: 12.5px; min-height: 18px; }

/* ------------------------------------------------------------------ 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 36px; padding: 0 14px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-size: 13px; line-height: 1; white-space: nowrap; text-decoration: none;
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .08s ease;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); background: transparent; }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-sm { min-height: 29px; padding: 0 10px; font-size: 12px; }
.btn-lg { min-height: 44px; padding: 0 20px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-group { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ------------------------------------------------------------------ 标签 */
.status {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px;
  border: 1px solid var(--line); border-radius: 3px; font-size: 11.5px;
  color: var(--muted); background: var(--surface); white-space: nowrap;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pending_approval { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: var(--accent-soft); }
.status-queued { color: var(--blue); border-color: color-mix(in srgb, var(--blue) 30%, var(--line)); background: var(--blue-soft); }
.status-running { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 35%, var(--line)); background: var(--amber-soft); }
.status-sent, .status-done { color: var(--pine); border-color: color-mix(in srgb, var(--pine) 35%, var(--line)); background: var(--pine-soft); }
.status-skipped { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 30%, var(--line)); background: var(--amber-soft); }
.status-failed, .status-rejected { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); background: var(--danger-soft); }
.status-cancelled { color: var(--faint); }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px;
  border-radius: 3px; border: 1px solid var(--line); font-size: 11.5px;
  color: var(--ink-2); background: var(--surface); white-space: nowrap;
}
.chip.seal { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); background: var(--accent-soft); }
.chip.pine { color: var(--pine); border-color: color-mix(in srgb, var(--pine) 30%, var(--line)); background: var(--pine-soft); }
.chip.plain { border-color: transparent; background: transparent; padding-left: 0; padding-right: 0; color: var(--muted); }
.tag {
  display: inline-block; font-size: 10.5px; color: var(--muted); background: var(--surface-2);
  border-radius: 3px; padding: 1px 6px; border: 1px solid var(--line);
}
.chip-list { display: flex; flex-wrap: wrap; gap: 5px; }
.role-promo { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 28%, var(--line)); background: var(--accent-soft); }
.role-scan_source { color: var(--blue); border-color: color-mix(in srgb, var(--blue) 28%, var(--line)); background: var(--blue-soft); }
.role-qr_forward, .role-lead_forward { color: var(--pine); border-color: color-mix(in srgb, var(--pine) 28%, var(--line)); background: var(--pine-soft); }
.role-dedup_test { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 28%, var(--line)); background: var(--amber-soft); }

/* ------------------------------------------------------------- 页面通用 */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.page-head h1 { font-family: var(--font-display); font-size: clamp(28px, 3vw, 36px); font-weight: 500; line-height: 1.15; }
.page-head p { color: var(--muted); font-size: 13px; margin-top: 7px; max-width: 64em; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }
.search-field { position: relative; display: inline-flex; align-items: center; min-width: 210px; }
.search-field svg { position: absolute; left: 10px; width: 14px; height: 14px; color: var(--faint); pointer-events: none; }
.search-field input { width: 100%; padding-left: 31px; }
.input, select.input, textarea.input {
  min-height: 34px; width: 100%; padding: 6px 10px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink);
  transition: border-color .15s ease, background .15s ease;
}
.input:hover { border-color: var(--line-strong); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
select.input { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 14px, calc(100% - 10px) 14px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.7; }
.input::placeholder { color: var(--faint); }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; }
.field > label, .field-label { font-size: 12px; color: var(--ink-2); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.field .help { font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.field .error-text { font-size: 11.5px; color: var(--danger); }
.field.has-error .input { border-color: var(--danger); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; cursor: pointer; padding: 3px 0; }
.check input { margin: 3px 0 0; accent-color: var(--accent); width: 14px; height: 14px; flex: none; }
.check.compact { padding: 0; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 12.5px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch i { width: 34px; height: 19px; border-radius: 10px; background: var(--line-strong); position: relative; transition: background .15s ease; flex: none; }
.switch i::after { content: ""; position: absolute; left: 2px; top: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: transform .15s ease; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(15px); }
.segmented { display: inline-flex; align-self: flex-start; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.segmented button { background: none; border: 0; padding: 7px 12px; font-size: 12px; color: var(--muted); border-right: 1px solid var(--line); white-space: nowrap; }
.segmented button:last-child { border-right: 0; }
.segmented button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.segmented button:hover:not([aria-pressed="true"]) { background: var(--surface-2); color: var(--ink); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  background: none; border: 0; border-bottom: 2px solid transparent; padding: 9px 14px;
  color: var(--muted); font-size: 13px; white-space: nowrap; margin-bottom: -1px;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.tabs .tab-count { font-size: 10.5px; color: var(--faint); margin-left: 4px; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- 面板 */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.panel-head h2, .panel-head h3 { font-size: 14px; font-weight: 600; }
.panel-head .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.panel-body { padding: 16px; }
.panel-foot { padding: 12px 16px; border-top: 1px solid var(--line); }
.panel.flat { background: transparent; border-left: 0; border-right: 0; border-radius: 0; }
.section-label { font-size: 11px; letter-spacing: .12em; color: var(--muted); margin-bottom: 10px; }
.rule-list { border-top: 1px solid var(--line); }
.rule-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rule-row dt { color: var(--muted); font-size: 12.5px; }
.rule-row dd { margin: 0; font-size: 13px; }
.rule-row .value { text-align: right; font-family: var(--font-data); font-size: 12.5px; }
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 56px 24px; color: var(--muted); text-align: center;
}
.empty .mark { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; color: var(--faint); margin-bottom: 4px; }
.empty b { color: var(--ink-2); font-weight: 500; font-size: 14px; }
.empty p { font-size: 12px; max-width: 34em; }
.empty .btn { margin-top: 8px; }
.loading { display: grid; gap: 10px; padding: 24px; }
.skeleton { height: 14px; border-radius: 3px; background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.skeleton.w40 { width: 40%; } .skeleton.w60 { width: 60%; } .skeleton.h32 { height: 32px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.inline-error { padding: 12px 14px; border-left: 3px solid var(--danger); background: var(--danger-soft); color: var(--danger); font-size: 12.5px; margin-bottom: 14px; }
.notice { padding: 10px 13px; border-left: 2px solid var(--line-strong); background: var(--surface-2); color: var(--muted); font-size: 12px; line-height: 1.65; }
.notice.warn { border-left-color: var(--amber); background: var(--amber-soft); color: var(--ink-2); }
.notice.seal { border-left-color: var(--accent); background: var(--accent-soft); color: var(--ink-2); }

/* -------------------------------------------------------------- 今日页 */
.today-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.hero-main { padding: 26px 30px 26px 0; border-right: 1px solid var(--line); position: relative; }
.hero-eyebrow { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11.5px; letter-spacing: .08em; }
.hero-eyebrow .dot { background: var(--accent); }
.hero-number { display: flex; align-items: baseline; gap: 12px; margin: 12px 0 4px; }
.hero-number b { font-family: var(--font-display); font-size: clamp(64px, 8vw, 96px); font-weight: 500; line-height: .95; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.hero-number span { font-size: 15px; color: var(--muted); }
.hero-lead { max-width: 38em; color: var(--ink-2); font-size: 14px; line-height: 1.8; margin: 10px 0 20px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-side { padding: 24px 0 24px 28px; display: flex; flex-direction: column; justify-content: space-between; gap: 16px; }
.trend-title { display: flex; align-items: baseline; justify-content: space-between; }
.trend-title b { font-size: 12.5px; font-weight: 600; }
.trend-title span { font-size: 11px; color: var(--muted); }
.trend { display: flex; align-items: flex-end; gap: 8px; height: 86px; padding-top: 8px; }
.trend-bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; height: 100%; position: relative; }
.trend-bar i { display: block; background: var(--ink-2); border-radius: 1px 1px 0 0; min-height: 2px; }
.trend-bar i.skip { background: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.trend-bar em { font-style: normal; font-size: 9.5px; color: var(--faint); text-align: center; margin-top: 5px; }
.trend-legend { display: flex; gap: 14px; font-size: 10.5px; color: var(--muted); }
.trend-legend i { display: inline-block; width: 8px; height: 8px; margin-right: 4px; border-radius: 1px; background: var(--ink-2); vertical-align: -1px; }
.trend-legend i.skip { background: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.metric-ledger { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 22px; }
.metric { padding: 15px 18px; border-right: 1px solid var(--line); min-width: 0; }
.metric:last-child { border-right: 0; }
.metric .name { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11.5px; }
.metric .num { font-family: var(--font-display); font-size: 30px; line-height: 1.15; margin-top: 7px; font-variant-numeric: tabular-nums; }
.metric .num small { font-family: var(--font-ui); font-size: 11px; color: var(--muted); margin-left: 4px; }
.metric .note { font-size: 10.5px; color: var(--faint); margin-top: 3px; }
.metric .note.up { color: var(--pine); }
.metric .note.down { color: var(--accent); }
.today-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 22px; align-items: start; }
.agents-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-bottom: 22px; }
.agent-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 13px 14px; display: flex; flex-direction: column; gap: 8px; }
.agent-card.offline { background: transparent; border-style: dashed; }
.agent-card-top { display: flex; align-items: center; gap: 8px; }
.agent-card-top b { flex: 1; }
.agent-card b { font-size: 12.5px; font-weight: 600; }
.agent-card .wechat { font-size: 11.5px; color: var(--muted); }
.agent-card .meta { display: flex; align-items: center; justify-content: space-between; font-size: 10.5px; color: var(--faint); }
.activity { display: flex; flex-direction: column; }
.activity-item { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 11px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.activity-item:last-child { border-bottom: 0; }
.activity-icon { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.activity-icon svg { width: 13px; height: 13px; }
.activity-icon.sent { background: var(--pine-soft); color: var(--pine); }
.activity-icon.skipped { background: var(--amber-soft); color: var(--amber); }
.activity-icon.failed, .activity-icon.rejected { background: var(--danger-soft); color: var(--danger); }
.activity-icon.scan { background: var(--blue-soft); color: var(--blue); }
.activity-icon.lead { background: var(--accent-soft); color: var(--accent); }
.activity-title { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; }
.activity-room { color: var(--muted); font-weight: 400; }
.activity-detail { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.55; }
.activity-time { font-size: 10.5px; color: var(--faint); white-space: nowrap; margin-top: 2px; }
.reminder-list { display: flex; flex-direction: column; }
.reminder { display: flex; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.reminder:last-child { border-bottom: 0; }
.reminder .icon { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; margin-top: 1px; }
.reminder .icon svg { width: 12px; height: 12px; }
.reminder b { font-size: 12.5px; font-weight: 600; }
.reminder p { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.coverage { display: flex; flex-direction: column; gap: 12px; }
.coverage-row { display: flex; flex-direction: column; gap: 6px; }
.coverage-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; }
.coverage-top span { color: var(--muted); font-size: 10.5px; }
.coverage-bar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.coverage-bar i { display: block; height: 100%; background: var(--pine); border-radius: 2px; }
.coverage-bar i.low { background: var(--amber); }
.coverage-bar i.zero { background: var(--accent); }
.reason-bars { display: flex; flex-direction: column; gap: 9px; }
.reason-bar { display: grid; grid-template-columns: minmax(0, 1fr) 36px; gap: 10px; align-items: center; font-size: 11.5px; }
.reason-bar .track { grid-column: 1 / -1; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.reason-bar .track i { display: block; height: 100%; background: var(--amber); }
.reason-bar b { font-family: var(--font-data); text-align: right; color: var(--muted); font-weight: 400; }

/* -------------------------------------------------------------- 待放行页 */
.approval-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 20px; align-items: start; }
.queue { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); position: sticky; top: calc(var(--topbar-h) + 16px); max-height: calc(100vh - var(--topbar-h) - 40px); display: flex; flex-direction: column; }
.queue-head { padding: 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 9px; }
.queue-list { overflow-y: auto; flex: 1; padding: 4px; }
.queue-item { width: 100%; text-align: left; background: none; border: 0; border-radius: 3px; padding: 10px 10px; display: flex; flex-direction: column; gap: 6px; position: relative; }
.queue-item + .queue-item { border-top: 1px solid var(--line); border-radius: 0; }
.queue-item:hover { background: var(--surface-2); }
.queue-item[aria-current="true"] { background: var(--accent-soft); }
.queue-item[aria-current="true"]::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 2px; background: var(--accent); }
.queue-top { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.queue-room { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-text { font-size: 11.5px; color: var(--muted); line-height: 1.55; }
.queue-meta { display: flex; align-items: center; gap: 6px; color: var(--faint); font-size: 10.5px; flex-wrap: wrap; }
.risk-badge { font-size: 10.5px; padding: 1px 6px; border-radius: 3px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.risk-badge.ok { color: var(--pine); border-color: color-mix(in srgb, var(--pine) 30%, var(--line)); background: var(--pine-soft); }
.risk-badge.warn { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 35%, var(--line)); background: var(--amber-soft); }
.risk-badge.bad { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); background: var(--danger-soft); }
.review { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.review-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.review-head h2 { font-family: var(--font-display); font-size: 25px; font-weight: 500; line-height: 1.25; }
.review-head .meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11.5px; margin-top: 7px; flex-wrap: wrap; }
.review-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 0; }
.review-col { padding: 20px 22px; min-width: 0; }
.review-col + .review-col { border-left: 1px solid var(--line); background: var(--surface-2); }
.review-col h3 { font-size: 12px; letter-spacing: .05em; color: var(--muted); margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.review-text { min-height: 150px; font-size: 13.5px; line-height: 1.85; }
.text-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 7px; color: var(--faint); font-size: 10.5px; }
.image-preview { border: 1px solid var(--line); border-radius: 3px; overflow: hidden; background: var(--paper); }
.image-preview img { display: block; width: 100%; max-height: 210px; object-fit: contain; }
.image-empty { padding: 28px 14px; text-align: center; color: var(--muted); font-size: 11.5px; }
.image-strip { display: flex; gap: 7px; margin-top: 8px; flex-wrap: wrap; }
.image-thumb { width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; background: var(--paper); padding: 0; }
.image-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-thumb[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.verdict { display: flex; gap: 10px; padding: 12px; border-radius: 3px; border: 1px solid var(--line); margin-bottom: 12px; }
.verdict.ok { border-color: color-mix(in srgb, var(--pine) 30%, var(--line)); background: var(--pine-soft); }
.verdict.bad { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: var(--accent-soft); }
.verdict .mark { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 12px; }
.verdict.ok .mark { background: var(--pine); color: #fff; }
.verdict.bad .mark { background: var(--accent); color: #fff; }
.verdict b { font-size: 12.5px; }
.verdict p { font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.55; }
.reason-list { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.reason-list li { display: flex; gap: 7px; font-size: 11.5px; color: var(--ink-2); line-height: 1.55; }
.reason-list li::before { content: "—"; color: var(--accent); flex: none; }
.match-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); margin-top: 10px; }
.match { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 11.5px; }
.match-top { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10.5px; }
.match p { margin-top: 2px; color: var(--ink-2); line-height: 1.5; }
.match b { color: var(--accent); font-family: var(--font-data); font-weight: 500; }
.rules-mini { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 10px; color: var(--muted); font-size: 10.5px; }
.review-form { margin-top: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.review-form .field { margin: 0; }
.review-actions { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 22px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(8px); }
.review-actions .hint { color: var(--faint); font-size: 11px; }
.review-actions .buttons { display: flex; gap: 8px; }
.bulkbar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--accent); background: var(--accent-soft); border-radius: var(--radius); margin-bottom: 12px; font-size: 12px; flex-wrap: wrap; }
.bulkbar .bulk-info { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 200px; }
.bulkbar .bulk-info b { font-family: var(--font-data); }
.bulkbar .bulk-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.bulkbar .grow { flex: 1; }
.queue-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.queue-select-all { white-space: nowrap; color: var(--ink-2); }
.check-col { width: 26px; }
select.agent-select { min-height: 32px; }

/* ---------------------------------------------------------------- 任务页 */
.task-table-wrap { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data th {
  text-align: left; font-weight: 500; font-size: 10.5px; color: var(--muted);
  padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2);
  white-space: nowrap; letter-spacing: .03em;
}
table.data td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr.selected { background: var(--accent-soft); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.actions { text-align: right; white-space: nowrap; }
table.data .room-cell b { display: block; font-weight: 600; font-size: 12.5px; }
table.data .room-cell span { display: block; color: var(--faint); font-size: 10.5px; margin-top: 1px; }
.table-foot { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11.5px; }
.pager { display: flex; gap: 5px; }
.pager button { min-width: 28px; height: 28px; border: 1px solid var(--line); background: var(--surface); border-radius: 3px; color: var(--muted); font-size: 11.5px; }
.pager button[aria-current="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pager button:hover:not([aria-current="true"]) { border-color: var(--ink-2); color: var(--ink); }
.task-title { font-weight: 600; display: block; }
.task-sub { color: var(--faint); font-size: 10.5px; margin-top: 1px; display: block; }
.result-text { color: var(--muted); font-size: 11.5px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-text.bad { color: var(--danger); }
.result-text.ok { color: var(--pine); }

/* -------------------------------------------------------------- 群与记录 */
.group-summary { display: flex; gap: 20px; flex-wrap: wrap; color: var(--muted); font-size: 12px; margin-bottom: 14px; }
.group-summary b { color: var(--ink); font-family: var(--font-data); font-weight: 500; }
.group-name { display: flex; align-items: flex-start; gap: 9px; }
.group-seal { width: 26px; height: 26px; border-radius: 3px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); font-family: var(--font-display); font-size: 12px; color: var(--muted); flex: none; }
.group-cell b { display: block; font-weight: 600; font-size: 12.5px; }
.group-cell span { display: block; color: var(--faint); font-size: 10.5px; margin-top: 1px; }
.group-agents { display: flex; gap: 4px; flex-wrap: wrap; }
.agent-chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 3px; padding: 1px 6px; font-size: 10.5px; color: var(--muted); background: var(--surface); }
.agent-chip .dot { width: 5px; height: 5px; }
.group-note { color: var(--faint); font-size: 11px; max-width: 280px; }
.record-detail { display: flex; flex-direction: column; gap: 14px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.detail-item .k { font-size: 10.5px; color: var(--faint); }
.detail-item .v { font-size: 12.5px; margin-top: 2px; word-break: break-word; }
.quote-block { padding: 12px 14px; background: var(--surface-2); border-left: 2px solid var(--line-strong); font-size: 12.5px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }
.lead-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 15px 16px; display: flex; flex-direction: column; gap: 10px; }
.lead-card.picked { border-color: var(--accent); box-shadow: inset 2px 0 0 var(--accent); }
.lead-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lead-head .lead-intent { margin-right: 2px; }
.lead-head .lead-meta { margin-left: auto; }
.lead-intent { font-family: var(--font-display); font-size: 17px; }
.lead-meta { color: var(--faint); font-size: 10.5px; }
.lead-quote { font-size: 12.5px; line-height: 1.7; background: var(--surface-2); padding: 10px 12px; border-radius: 3px; }
.lead-context { font-size: 11.5px; line-height: 1.7; color: var(--muted); padding: 8px 12px; border-left: 2px solid var(--line-strong); background: var(--paper); white-space: pre-wrap; }
.lead-context span { display: block; font-size: 10px; color: var(--faint); margin-bottom: 3px; }
.lead-card.muted { opacity: .72; }
.lead-reply { font-size: 12.5px; line-height: 1.7; padding: 10px 12px; border-left: 2px solid var(--pine); background: var(--pine-soft); white-space: pre-wrap; }
.lead-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.record-empty { padding: 40px; text-align: center; color: var(--muted); font-size: 12.5px; }
.log-list { display: flex; flex-direction: column; }
.log-row { display: grid; grid-template-columns: 130px 90px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.log-row time { color: var(--faint); font-family: var(--font-data); font-size: 11px; }
.log-row .action { color: var(--ink-2); font-weight: 600; }
.log-row .detail { color: var(--muted); overflow-wrap: anywhere; }

/* ------------------------------------------------------ 新建任务（批次） */
.composer-step { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; background: var(--surface-2); }
.composer-step .step-head { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 10px; }
.composer-step .step-head b { font-size: 13.5px; font-weight: 600; }
.composer-step .step-head p { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.composer-step .step-head > div { flex: 1; min-width: 0; }
.step-no {
  width: 20px; height: 20px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: var(--paper); font-family: var(--font-data); font-size: 11px;
}
.row-gap { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.row-gap .grow { flex: 1; min-width: 0; }
.pick-list {
  max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); display: flex; flex-direction: column;
}
.pick-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer;
  border-bottom: 1px solid var(--line); font-size: 12.5px;
}
.pick-row:last-child { border-bottom: 0; }
.pick-row:hover { background: var(--surface-2); }
.pick-row.on { background: var(--accent-soft); }
.pick-row input { accent-color: var(--accent); width: 14px; height: 14px; }
.pick-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-tags { display: flex; gap: 4px; }
.quote-box {
  padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 12.5px; line-height: 1.8; white-space: pre-wrap; max-height: 120px; overflow-y: auto;
}
.pool-chip { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; background: var(--surface); }
.pool-chip.on { border-color: var(--accent); background: var(--accent-soft); }
.pool-name { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 5px 9px; font-size: 11.5px; color: var(--ink-2); text-align: left; max-width: 260px; }
.pool-name .tick { width: 12px; color: var(--accent); font-size: 11px; }
.pool-edit { border: 0; border-left: 1px solid var(--line); background: transparent; padding: 0 7px; color: var(--muted); display: inline-flex; align-items: center; }
.pool-edit:hover { background: var(--surface-2); color: var(--ink); }
.pool-edit svg { width: 12px; height: 12px; }
.image-thumb-wrap { position: relative; display: inline-block; }
.image-remove {
  position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--danger);
  font-size: 12px; line-height: 1; display: grid; place-items: center; padding: 0;
}
.image-remove:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.image-strip .image-thumb[disabled] { opacity: .35; pointer-events: none; }

/* --------------------------------------------------------- 微信群目录 */
.catalog-panel { margin-bottom: 18px; }
.sync-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.sync-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; }
.sync-top { display: flex; align-items: center; gap: 7px; font-size: 12.5px; }
.sync-top b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sync-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chip.ok { color: var(--pine); border-color: color-mix(in srgb, var(--pine) 30%, var(--line)); background: var(--pine-soft); }
.chip.bad { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); background: var(--danger-soft); }
.chip.quiet { color: var(--muted); }
.pick-chip { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; padding: 4px 9px; }
.pick-chip input { accent-color: var(--accent); width: 13px; height: 13px; margin: 0; }
.catalog-new { border-top: 1px dashed var(--line); margin-top: 12px; padding-top: 4px; }
.catalog-filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.catalog-filters .grow { flex: 1; min-width: 200px; }
.catalog-filters select.input { width: auto; min-width: 118px; }
.catalog-result-line { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 8px; font-size: 12px; color: var(--muted); }
.catalog-result-line b { color: var(--ink); font-family: var(--font-data); font-weight: 500; }
.catalog-table { font-size: 12px; }
.catalog-table td { padding: 7px 10px; }
.catalog-table th { padding: 8px 10px; }
.catalog-table .check-col { width: 30px; }
.catalog-table input[type="checkbox"] { accent-color: var(--accent); width: 14px; height: 14px; }
.catalog-table tbody tr:hover { background: var(--surface-2); }

/* ---------------------------------------------------------------- 规则页 */
.rules-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 28px; align-items: start; }
.rules-nav { position: sticky; top: calc(var(--topbar-h) + 16px); display: flex; flex-direction: column; gap: 1px; }
.rules-nav button { text-align: left; border: 0; background: none; border-left: 2px solid transparent; padding: 8px 12px; color: var(--muted); font-size: 12.5px; }
.rules-nav button:hover { color: var(--ink); background: var(--surface-2); }
.rules-nav button[aria-current="true"] { color: var(--ink); border-left-color: var(--accent); font-weight: 600; background: var(--surface); }
.rules-nav .group { font-size: 10px; letter-spacing: .1em; color: var(--faint); padding: 16px 12px 5px; }
.rules-main { min-width: 0; padding-bottom: 80px; }
.rule-block { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 18px; overflow: hidden; }
.rule-block > header { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.rule-block > header h2 { font-family: var(--font-display); font-size: 21px; font-weight: 500; }
.rule-block > header p { color: var(--muted); font-size: 12px; margin-top: 4px; max-width: 60em; }
.rule-block .body { padding: 20px; }
.rule-block .body + .body { border-top: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .span2 { grid-column: 1 / -1; }
.number-field { display: flex; align-items: center; gap: 8px; }
.number-field .input { width: 100%; }
.number-field .unit { color: var(--muted); font-size: 12px; white-space: nowrap; }
.summary-line { padding: 12px 14px; background: var(--surface-2); border-left: 2px solid var(--accent); font-size: 12.5px; line-height: 1.7; color: var(--ink-2); }
.summary-line b { color: var(--ink); }
.save-bar {
  position: sticky; bottom: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  margin-top: 18px; padding: 12px 16px; background: var(--ink); color: var(--paper);
  border-radius: var(--radius); box-shadow: 0 6px 24px var(--shadow);
}
.save-bar .state { flex: 1; font-size: 12px; color: color-mix(in srgb, var(--paper) 70%, transparent); }
.save-bar .state b { color: var(--paper); }
.save-bar .btn { border-color: color-mix(in srgb, var(--paper) 25%, transparent); background: transparent; color: var(--paper); }
.save-bar .btn:hover { background: color-mix(in srgb, var(--paper) 12%, transparent); }
.save-bar .btn-primary { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.material-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.material-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 12px 13px; display: flex; flex-direction: column; gap: 8px; }
.material-card.inactive { opacity: .55; }
.material-card .name { font-size: 11px; color: var(--muted); font-family: var(--font-data); display: flex; justify-content: space-between; gap: 8px; }
.material-card .preview { font-size: 12px; line-height: 1.65; color: var(--ink-2); white-space: pre-wrap; max-height: 100px; overflow: hidden; }
.material-card .meta { font-size: 10.5px; color: var(--faint); display: flex; justify-content: space-between; align-items: center; }
.material-card .ops { display: flex; gap: 5px; flex-wrap: wrap; }
.material-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.material-image { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.material-image img { width: 100%; height: 110px; object-fit: cover; display: block; background: var(--paper); }
.material-image .info { padding: 8px 9px; display: flex; flex-direction: column; gap: 4px; }
.material-image .info b { font-size: 10.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.material-image .info span { font-size: 10px; color: var(--faint); }
.material-image .ops { display: flex; gap: 4px; margin-top: 2px; }
.intent-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 12px; overflow: hidden; }
.intent-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.intent-head .intent-label { font-family: var(--font-display); font-size: 17px; flex: 1; }
.intent-body { padding: 14px; display: grid; gap: 13px; }
.intent-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.tag-input { display: flex; flex-wrap: wrap; gap: 5px; padding: 5px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); min-height: 36px; align-items: center; }
.tag-input input { border: 0; background: none; outline: none; flex: 1; min-width: 90px; font-size: 12px; padding: 2px 4px; }
.tag-input .tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; }
.tag-input .tag button { border: 0; background: none; color: var(--faint); padding: 0 1px; font-size: 13px; line-height: 1; }
.sim-output { margin-top: 14px; }
.sim-metrics { display: flex; gap: 18px; flex-wrap: wrap; margin: 10px 0; color: var(--muted); font-size: 11.5px; }
.sim-metrics b { font-family: var(--font-data); color: var(--ink); font-weight: 500; }
.raw-config { font-family: var(--font-data); font-size: 11.5px; line-height: 1.7; white-space: pre-wrap; max-height: 60vh; overflow: auto; background: var(--surface-2); padding: 14px; border-radius: 3px; }
.section-anchor { scroll-margin-top: calc(var(--topbar-h) + 16px); }

/* ------------------------------------------------------------ 抽屉/弹窗 */
.scrim { position: fixed; inset: 0; background: rgba(12, 16, 14, .48); z-index: 80; animation: fade .16s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 94vw); z-index: 90;
  background: var(--surface); border-left: 1px solid var(--line-strong);
  box-shadow: -18px 0 48px var(--shadow); display: flex; flex-direction: column;
  animation: drawer-in .22s cubic-bezier(.2,.8,.25,1);
}
@keyframes drawer-in { from { transform: translateX(30px); opacity: .4; } to { transform: none; opacity: 1; } }
.drawer.wide { width: min(720px, 96vw); }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-family: var(--font-display); font-size: 23px; font-weight: 500; line-height: 1.3; }
.drawer-head .sub { color: var(--muted); font-size: 11.5px; margin-top: 4px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.drawer-foot { padding: 13px 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; background: var(--surface); }
.modal-wrap { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 22px; }
.modal {
  position: relative; z-index: 90; /* 必须高于 .scrim，否则点击会被遮罩拦下 */
  width: min(560px, 100%); max-height: min(86vh, 820px); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 6px; box-shadow: 0 24px 70px var(--shadow);
  display: flex; flex-direction: column; animation: modal-in .18s ease;
}
.modal.wide { width: min(760px, 100%); }
@keyframes modal-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-family: var(--font-display); font-size: 22px; font-weight: 500; }
.modal-head p { color: var(--muted); font-size: 12px; margin-top: 3px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast {
  pointer-events: auto; min-width: 220px; max-width: 380px; padding: 11px 14px;
  background: var(--ink); color: var(--paper); border-radius: 4px; box-shadow: 0 10px 30px var(--shadow);
  font-size: 12.5px; line-height: 1.5; animation: toast-in .2s ease; display: flex; gap: 9px; align-items: flex-start;
}
.toast.success { background: var(--pine); }
.toast.error { background: var(--danger); }
.toast.warn { background: var(--amber); }
.toast .close { margin-left: auto; background: none; border: 0; color: inherit; opacity: .6; padding: 0; font-size: 15px; line-height: 1; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.palette-wrap { position: fixed; inset: 0; z-index: 110; background: rgba(10, 14, 12, .45); padding-top: 12vh; display: flex; justify-content: center; align-items: flex-start; }
.palette { width: min(560px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; box-shadow: 0 24px 70px var(--shadow); overflow: hidden; animation: modal-in .16s ease; }
.palette input { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 15px 18px; font-size: 14px; outline: none; }
.palette-list { max-height: 50vh; overflow-y: auto; padding: 6px; }
.palette-item { width: 100%; text-align: left; background: none; border: 0; border-radius: 3px; padding: 9px 11px; display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 12.5px; }
.palette-item:hover, .palette-item[aria-selected="true"] { background: var(--surface-2); color: var(--ink); }
.palette-item svg { width: 15px; height: 15px; color: var(--muted); }
.palette-item .hint { margin-left: auto; font-size: 10px; color: var(--faint); }
.palette-group { font-size: 10px; letter-spacing: .1em; color: var(--faint); padding: 8px 11px 4px; }
.palette-empty { padding: 24px; text-align: center; color: var(--muted); font-size: 12px; }

/* ------------------------------------------------------------ 偏好设置 */
.pref-section { margin-bottom: 22px; }
.pref-section > h3 { font-size: 11px; letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; }
.pref-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.pref-row:last-child { border-bottom: 0; }
.pref-row .label b { display: block; font-size: 12.5px; font-weight: 500; }
.pref-row .label span { display: block; color: var(--faint); font-size: 10.5px; margin-top: 1px; }
.swatches { display: flex; gap: 6px; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; padding: 0; position: relative; }
.swatch[aria-pressed="true"] { border-color: var(--ink); }
.swatch.seal { background: #a93a2b; } .swatch.pine { background: #2f6b4f; } .swatch.indigo { background: #3b4f86; }
.swatch.ochre { background: #8d641c; } .swatch.graphite { background: #4b5550; }
.pref-note { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--faint); font-size: 11px; line-height: 1.7; }

/* ------------------------------------------- 列表：勾选、批量栏、分页 */
/* 勾选靠栏线表达，不加圆角卡片：选中行用朱砂左侧 2px 与淡底，和审阅队列的当前项同一套语言。 */
td.check-col, th.check-col { width: 34px; padding-right: 0; }
td.check-col input[type="checkbox"], th.check-col input[type="checkbox"] {
  width: 14px; height: 14px; accent-color: var(--accent); margin: 0; vertical-align: middle;
}
td.check-col input:disabled { opacity: .35; }
tr.is-picked td { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
tr.is-picked td:first-child { box-shadow: inset 2px 0 0 var(--accent); }

.bulkbar {
  position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 6;
  animation: bulkbar-in .16s ease-out both;
}
@keyframes bulkbar-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.listbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line);
}
.listbar .btn[disabled] { opacity: .4; cursor: default; }
.listbar .mono b { font-weight: 600; }

.input-compact { height: 28px; padding: 0 6px; font-size: 11.5px; }
/* 批量栏和分页里的下拉不该吃掉整行宽度 */
.bulkbar .bulk-actions select.input, .listbar select.input { width: auto; min-width: 104px; }
.listbar .search-field { min-width: 180px; }

.queue-foot { padding: 8px 12px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.queue-list:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.keyboard-hint { display: none; }
@media (min-width: 1280px) { .keyboard-hint { display: inline; } }

@media (prefers-reduced-motion: reduce) {
  .bulkbar { animation: none; }
}

/* ------------------------------------------------------------------ 响应式 */
@media (max-width: 1220px) {
  .today-hero { grid-template-columns: 1fr; }
  .hero-main { border-right: 0; border-bottom: 1px solid var(--line); padding-right: 0; }
  .hero-side { padding-left: 0; }
  .metric-ledger { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric:nth-child(3n) { border-right: 0; }
  .metric:nth-child(n+4) { border-top: 1px solid var(--line); }
  .review-body { grid-template-columns: 1fr; }
  .review-col + .review-col { border-left: 0; border-top: 1px solid var(--line); }
  .approval-layout { grid-template-columns: 320px minmax(0, 1fr); }
}
@media (max-width: 960px) {
  :root { --rail-w: 64px; }
  .rail-brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .rail-brand div { display: none; }
  .rail-group-title, .nav-item span.label, .nav-item .nav-badge, .rail-agent .grow, .rail-link span { display: none; }
  .nav-item { justify-content: center; padding: 11px 0; }
  .rail-agent { justify-content: center; padding: 8px 0; }
  .rail-link { justify-content: center; }
  .today-grid, .rules-layout, .approval-layout { grid-template-columns: 1fr; }
  .rules-nav { position: static; flex-direction: row; overflow-x: auto; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
  .rules-nav .group { display: none; }
  .rules-nav button { border-left: 0; border-bottom: 2px solid transparent; white-space: nowrap; }
  .rules-nav button[aria-current="true"] { border-bottom-color: var(--accent); }
  .queue { position: static; max-height: none; }
  .queue-list { max-height: 300px; }
  .cmd-trigger { min-width: 0; }
  .cmd-trigger span, .cmd-trigger kbd { display: none; }
  .topbar-sub { display: none; }
  .login-screen { grid-template-columns: 1fr; }
  .login-side { display: none; }
}
@media (max-width: 720px) {
  .page { padding: 18px 14px 48px; }
  .topbar { padding: 0 14px; gap: 8px; }
  .topbar-title { font-size: 18px; }
  .metric-ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:nth-child(2n) { border-right: 0; }
  .metric:nth-child(n+3) { border-top: 1px solid var(--line); }
  .field-row, .field-row-3, .form-grid, .intent-grid, .review-form, .detail-grid { grid-template-columns: 1fr; }
  .hero-main { padding-top: 18px; }
  .hero-number b { font-size: 70px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .log-row { grid-template-columns: 1fr; gap: 4px; }
  .drawer { width: 100vw; }
  .toolbar .search-field { min-width: 0; flex: 1; }
  .bulkbar .bulk-actions { width: 100%; }
  .bulkbar .bulk-actions .btn { flex: 1; justify-content: center; }
  .queue-tools { gap: 6px; }
  .review-actions { flex-direction: column; align-items: stretch; gap: 8px; }
  .review-actions .hint { display: none; }
  .review-actions .buttons { display: flex; width: 100%; }
  .review-actions .buttons .btn { flex: 1; justify-content: center; }
  .review-head { flex-direction: column; gap: 10px; }
  .review-head h2 { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
[data-reduce-motion="true"] *, [data-reduce-motion="true"] *::before, [data-reduce-motion="true"] *::after {
  animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important;
}

/* 打印：给运营留一份可打印的今日交接 */
@media print {
  .rail, .topbar, .page-actions, .review-actions, .save-bar, .toolbar { display: none !important; }
  #app { display: block; }
  .page { max-width: none; padding: 0; }
  body { background: #fff; color: #000; }
  .panel, .rule-block, .task-table-wrap { border-color: #999; break-inside: avoid; }
}

.code-chip { display: inline; flex: 0 0 auto; font-size: 10.5px; letter-spacing: .06em; color: var(--muted); border-bottom: 1px dashed var(--line-strong); cursor: pointer; }
.code-chip:hover { color: var(--accent); border-color: var(--accent); }
table.data .room-cell .task-sub .code-chip { display: inline; }
.pool-image-tag { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-left: 2px; border-radius: 3px; background: var(--surface-2); color: var(--accent); }
.pool-image-tag svg { width: 11px; height: 11px; }
.material-image-pick { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.material-image-pick .thumb { width: 34px; height: 34px; object-fit: cover; border-radius: 3px; border: 1px solid var(--line); }
.material-image-pick .thumb.empty { display: inline-flex; align-items: center; justify-content: center; font-size: 9.5px; color: var(--faint); background: var(--surface-2); }
.material-image-pick select { flex: 1; min-width: 0; }
.pool-image-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.pool-image-list:empty { display: none; }
.pool-image-title { font-size: 10.5px; color: var(--faint); letter-spacing: .02em; }
.pool-image-row { display: flex; align-items: center; gap: 8px; }
.pool-image-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; color: var(--muted); }
.pool-image-row select { width: 190px; flex: 0 0 auto; }