/* 控制台主题：浅灰画布 + 近白卡片 + 黑色主操作 + 薄荷绿数据强调。
   只做视觉覆盖，不改布局结构与脚本逻辑；在 ui.css / app.css 之后加载。 */

:root {
  --canvas: #f0f0f0;
  --surface: #fbfbfb;
  --surface-2: #f6f6f3;
  --line: #e6e6e4;
  --line-2: #efefec;
  --ink: #161817;
  --ink-2: #2d312d;
  --muted: #6e726d;
  --muted-2: #666b64;
  --accent: #171918;
  --accent-strong: #000000;
  --accent-soft: #eaf4e7;
  --accent-line: #cfe6cb;
  --green: #7cc47a;
  --green-bar: #c8f0c8;
  --radius: 16px;
  --radius-sm: 9px;
  --radius-xs: 7px;
  --shadow-1: 0 1px 2px rgba(22, 24, 22, .03);
  --shadow-2: 0 2px 6px rgba(22, 24, 22, .05), 0 16px 36px -24px rgba(22, 24, 22, .28);
  --shadow-3: 0 28px 64px -32px rgba(22, 24, 22, .35);
}

body { background: var(--canvas); }

/* ---------- 侧栏 ---------- */
.shell { grid-template-columns: 272px minmax(0, 1fr); }
.sidebar { gap: 24px; padding: 22px 16px; border-color: var(--line); background: transparent; }
.sidebar__brand { gap: 9px; padding: 2px 6px; font-size: 15px; font-weight: 650; }
.brand-mark { width: 30px; height: 30px; flex-basis: 30px; border-radius: 9px; background: #171918; box-shadow: 0 4px 10px -4px rgba(20, 22, 20, .6); }
.sidebar nav { gap: 2px; }
.nav-item { min-height: 36px; gap: 10px; padding: 8px 10px; border-radius: 9px; color: #5c605b; font-size: 13px; font-weight: 500; }
.nav-item svg { width: 17px; height: 17px; flex-basis: 17px; stroke-width: 1.7; opacity: .75; }
.nav-item:hover { background: #e9e9e6; color: var(--ink); }
.nav-item.is-active { background: #fff; color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px #e2e2de, 0 1px 2px rgba(20, 22, 20, .05); }
.nav-item.is-active svg { opacity: 1; }
.nav-item__count { font-size: 10.5px; color: var(--muted-2); }
.nav-item.is-active .nav-item__count { color: #3f7a44; }
.sidebar__foot { gap: 10px; }
.quota { padding: 11px 12px; border-radius: 12px; border-color: var(--line); background: var(--surface); }
.quota__row span { font-size: 10.5px; letter-spacing: .01em; }
.quota__row strong { font-size: 12.5px; }
.quota .track { margin: 8px 0 6px; }
.quota__note { font-size: 10px; }
.user-chip { padding: 6px; }
.user-chip:hover { background: #e9e9e6; }
.user-chip__meta b { font-size: 12.5px; }
.user-chip__meta span { font-size: 10.5px; }
.user-actions .btn { min-height: 28px; padding: 3px 8px; font-size: 10.5px; }
.conn { padding: 0 6px; font-size: 10.5px; }
.conn .dot { width: 6px; height: 6px; background: var(--green); }

/* ---------- 主区 ---------- */
.main { padding: 24px 30px 40px; }
.content { max-width: 1580px; }
.page-head { align-items: center; margin-bottom: 16px; }
.page-head__text h1 { font-size: 18px; font-weight: 650; letter-spacing: -.02em; }
.page-head__meta { margin-top: 4px; font-size: 11.5px; }
.page-head__actions { gap: 8px; }
.range-controls, .head-tools { gap: 6px; }
.inline-field { font-size: 11.5px; gap: 6px; }
.inline-field input { min-height: 29px; padding: 3px 8px; font-size: 11.5px; }

/* ---------- 按钮与表单 ---------- */
.btn { min-height: 32px; padding: 6px 12px; border-radius: 9px; border-color: #dcdcd8; background: #fff; color: var(--ink-2); font-size: 12px; font-weight: 550; box-shadow: 0 1px 1px rgba(20, 22, 20, .03); }
.btn:hover { border-color: #cecec9; background: #f7f7f4; color: var(--ink); }
.btn--sm { min-height: 28px; padding: 4px 10px; font-size: 11px; border-radius: 8px; }
.btn--primary { border-color: #171918; background: #171918; color: #fff; box-shadow: 0 4px 10px -6px rgba(20, 22, 20, .55); }
.btn--primary:hover { border-color: #000; background: #000; color: #fff; }
.btn--ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn--ghost:hover { border-color: transparent; background: #e9e9e6; }
.btn--danger { border-color: #f0cdc9; color: #a34940; }
.btn--danger:hover { background: #fbeeec; border-color: #e9b9b3; color: #8f3d35; }
.icon-button { width: 33px; height: 33px; flex-basis: 33px; border-radius: 9px; background: #fff; box-shadow: none; }
.icon-button:hover { border-color: var(--accent-line); background: var(--accent-soft); color: #3f7a44; }
.link-btn { color: #3f7a44; font-size: 12px; font-weight: 550; }
.link-btn:hover { color: #2f6b33; }

input, select, textarea { min-height: 33px; padding: 6px 10px; border-radius: 9px; border-color: #dededa; background: #fff; font-size: 12.5px; }
:is(input, select, textarea):focus-visible,
.search-field input:focus-visible,
.keys-search input:focus,
.job-search input:focus,
.cat-select:focus-visible,
.hs-map__select:focus-visible {
  outline: 2px solid #3f7a44;
  outline-offset: 2px;
  border-color: #3f7a44;
  box-shadow: none;
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
.field { margin-bottom: 14px; }
.field > span, .field > label, label.field-label { margin-bottom: 6px; font-size: 11.5px; font-weight: 600; }
.field-help, .form-help { font-size: 11.5px; }
.field-help { font-size: 10.5px; }
.head-tools select { min-height: 29px; padding: 3px 9px; border-radius: 9px; font-size: 11px; }
.inline-field input { border-radius: 9px; }
.cat-sync select { border-radius: 9px; }
.search-field { width: clamp(210px, 19vw, 290px); height: 33px; padding: 0 10px; border-radius: 9px; background: #fff; box-shadow: none; }
.search-field svg { width: 14px; height: 14px; flex-basis: 14px; }
.search-field input { font-size: 12px; }
.search-field kbd { padding: 2px 4px; border-radius: 4px; border-color: #e3e3df; background: #f4f4f1; font-size: 10px; }
.search-field:focus-within { border-color: #a9cfa5; box-shadow: 0 0 0 3px rgba(124, 196, 122, .18); }

/* ---------- 卡片与分节 ---------- */
.card, .sec, .table-wrap { border-color: var(--line); background: var(--surface); box-shadow: 0 1px 2px rgba(22, 24, 22, .03); }
.sec > h2, .sec > h3 { gap: 8px; padding: 11px 16px; border-bottom: 1px solid var(--line-2); font-size: 12.5px; font-weight: 650; }
.sec > h2 small, .sec > h3 small { font-size: 10.5px; }
.sec__body { padding: 14px 16px 16px; }
.section-head { margin-bottom: 12px; }
.section-head h2 { font-size: 14px; }
.count { font-size: 10.5px; }

/* ---------- 标签、分数、进度 ---------- */
.tag, .badge { padding: 2px 8px; border-radius: 6px; background: #f1f1ee; color: #666a65; font-size: 10.5px; font-weight: 550; }
.tag--muted, .badge--muted { color: #666b64; }
.tag--accent, .badge--accent { background: #eaf4e7; color: #3f7a44; }
.tag--success, .badge--success { background: #e9f6e6; color: #3f7a44; }
.tag--warn, .badge--warn, .tag--warning { background: #fbf2da; color: #7d5a16; }
.tag--danger, .badge--danger { background: #fbeeec; color: #a34940; }
.pill { padding: 3px 9px; border-radius: 6px; font-size: 12.5px; font-weight: 650; }
.pill--hi { background: #e9f6e6; color: #2f6b33; }
.pill--mid { background: #fbf2da; color: #7d5a16; }
.pill--low { background: #fbeeec; color: #a34940; }
.pill--none { background: #f1f1ee; color: var(--muted); font-size: 11px; padding: 4px 9px; }
.score { font-size: 14px; font-weight: 650; }
.high { color: #2f6b33; }
.mid { color: #8a5f16; }
.low { color: #a34940; }
.track { height: 6px; background: #e9e9e5; }
.track > i { background: #7cc47a; }
.avatar { width: 30px; height: 30px; flex-basis: 30px; font-size: 11px; }
.avatar--sm { width: 24px; height: 24px; flex-basis: 24px; font-size: 10px; }

/* ---------- 数据表 ---------- */
th { padding: 8px 12px; border-bottom: 1px solid #e9e9e5; background: #f4f4f1; color: #71756f; font-size: 10.5px; font-weight: 600; }
td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); font-size: 12px; color: var(--ink-2); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #f7f7f4; }
.table--jobs td, .table--companies td, .table--users td { padding: 9px 12px; }
.table--jobs th, .table--companies th, .table--users th { padding: 8px 12px; }
.table--jobs td:first-child, .table--jobs th:first-child, .table--companies td:first-child, .table--companies th:first-child { padding-left: 16px; }
.table--jobs td:last-child, .table--jobs th:last-child, .table--companies td:last-child, .table--companies th:last-child { padding-right: 16px; }
.table--ai-keys { width: 100%; }
.table--ai-keys th { background: #f4f4f1; font-size: 10.5px; }
.table--ai-keys tbody tr:hover { background: #f7f7f4; }
.cat-table th { padding: 8px 12px; background: #f4f4f1; border-bottom: 1px solid #e9e9e5; font-size: 10.5px; }
.cat-table td { padding: 9px 12px; font-size: 12px; border-bottom-color: var(--line-2); }
.company-heading td { background: #f4f4f1; color: var(--ink-2); font-size: 10.5px; }
.candidate { font-size: 12.5px; font-weight: 600; }
.subline { margin-top: 2px; font-size: 10.5px; }
.empty { padding: 34px 16px !important; font-size: 12px; }

/* ---------- 分段与筛选 ---------- */
.seg { gap: 1px; padding: 2px; border-radius: 9px; border-color: #e3e3df; background: #fff; }
.seg__item { min-height: 24px; padding: 3px 10px; border-radius: 7px; font-size: 11px; font-weight: 550; }
.seg__item.is-active { background: #171918; color: #fff; box-shadow: none; }
.chip { min-height: 29px; padding: 4px 12px; border-radius: 999px; border-color: #dededa; background: #fff; color: var(--ink-2); font-size: 11.5px; font-weight: 550; box-shadow: none; }
.chip:hover { border-color: #c9cfc7; background: #fff; color: var(--ink); }
.chip.is-active { border-color: #171918; background: #171918; color: #fff; box-shadow: none; }
.chip.is-active b { color: inherit; }

/* ---------- 总览 ---------- */
.kpis, .kpis--overview { gap: 12px; margin-bottom: 12px; }
.kpi { padding: 14px 15px; border-radius: 14px; background: var(--surface); box-shadow: none; }
.kpi--accent { border-color: var(--line); background: var(--surface); box-shadow: none; }
.kpi--accent .kpi__label { color: var(--muted); }
.kpi__label { font-size: 11.5px; }
.kpi__value { margin-top: 7px; }
.kpi__value b { font-size: 26px; font-weight: 650; }
.kpi__value small { font-size: 10.5px; }
.kpi__delta { padding: 1px 7px; border-radius: 5px; font-size: 10.5px; }
.kpi__meta { margin-top: 5px; font-size: 10.5px; }
.kpi__spark { margin-top: 8px; }
.kpi__spark svg { height: 26px; }
.grid-2 { gap: 12px; margin-bottom: 12px; }
.rank-row { padding: 9px 8px; border-radius: 8px; }
.rank-row + .rank-row { border-top-color: var(--line-2); }
.rank-row:hover { background: #f4f4f1; }
.rank-row__name { font-size: 12px; }
.rank-line { grid-template-columns: 80px minmax(0, 1fr); gap: 8px; }
.rank-line__lab { font-size: 10.5px; }
.rank-bar { height: 5px; background: #e9e9e5; }
.rank-bar .is-request { background: var(--green-bar); }
.rank-bar .is-ai { background: var(--green); }
.rank-cache { font-size: 10.5px; }
.rank-cache b { color: #3f7a44; }
.rank-row__value { font-size: 13px; }
.rank-note { font-size: 10.5px; }
.rank-row__no { font-size: 11px; }
.chart-days li { border-radius: 8px; font-size: 10.5px; }
.chart-days b { font-size: 12.5px; }
.chart-line { stroke: var(--green); }
.chart-dot { stroke: var(--green); }

dialog:modal { overscroll-behavior: contain; }
dialog::backdrop { overflow: hidden; overscroll-behavior: contain; }

/* ---------- 登录 ---------- */
.login-view {
  background:
    radial-gradient(760px 460px at 50% 58%, rgba(200, 240, 200, .55), transparent 68%),
    var(--canvas);
}
.login-card { width: min(392px, 100%); padding: 30px 30px 26px; border-radius: 20px; border-color: #e4e4e0; background: #fbfbfb; box-shadow: 0 30px 70px -40px rgba(22, 24, 22, .4); }
.login-brand { margin-bottom: 18px; font-size: 15px; font-weight: 650; }
.login-card h1 { margin-bottom: 18px; font-size: 20px; }
.login-submit { min-height: 38px; }

/* ---------- 自适应 ---------- */
@media (max-width: 1180px) {
  .shell { grid-template-columns: 232px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .sidebar { background: rgba(240, 240, 240, .94); backdrop-filter: blur(10px); }
  .main { padding: 16px 16px 32px; }
  .page-head__text h1 { font-size: 17px; }
  .nav-item.is-active { box-shadow: none; background: #fff; }
}
@media (max-width: 760px) {
  .kpi { padding: 12px 13px; }
  .page-head { margin-bottom: 14px; }
  .chip { font-size: 11px; }
}

/* 状态色与旧版强调色统一到控制台主题 */
:root {
  --ok: #6fb56c;
  --ok-soft: #eaf4e7;
  --ok-line: #cfe6cb;
  --warn: #b07a2a;
  --warn-soft: #f7f0e1;
  --warn-line: #e6d3ad;
  --bad: #c0554d;
  --bad-soft: #f8ecea;
  --bad-line: #e6c4bf;
}
.keys-hero {
  background:
    radial-gradient(680px 220px at 96% -20%, rgba(124, 196, 122, .10), transparent 60%),
    linear-gradient(180deg, #fff 0%, #f7f7f4 100%);
  box-shadow: 0 10px 30px rgba(22, 24, 22, .05);
}
.keys-hero__icon { border-color: #d8e6d3; background: linear-gradient(145deg, #eef6ea, #e2efdd); color: #3f7a44; }
.keys-badge.is-ok { color: #3f7a44; background: #eaf4e7; }
.keys-badge.is-fail { background: #f8ecea; }
.keys-stat.is-accent b { color: #3f7a44; }
.keys-stat.is-warn { border-color: #e7d3cf; background: #fbf6f4; }
.rank-row__no.is-top { color: #b07a2a; }

/* 头像色改成低饱和的绿/石色，避免紫粉撞色 */
.a-1 { background: linear-gradient(140deg, #8fc98c, #4e8c4b); }
.a-2 { background: linear-gradient(140deg, #b7c9b1, #6f8c6c); }
.a-3 { background: linear-gradient(140deg, #c9b79a, #9a7f5b); }
.a-4 { background: linear-gradient(140deg, #a9b0a7, #6e726d); }
.a-5 { background: linear-gradient(140deg, #5d9f5a, #2f6b33); }
.a-6 { background: linear-gradient(140deg, #9aa09a, #4a4f4a); }

/* ═══════════════════════════════════════════════════════════════════
   控制台结构层：顶栏 + 侧栏 + 卡片头 + 表格化档案 + 设置侧栏 + 分栏登录
   ═══════════════════════════════════════════════════════════════════ */

/* ---------- 侧栏 ---------- */
.sidebar { gap: 14px; padding: 18px 14px 16px; background: var(--canvas); border-right: 1px solid var(--line); }
.side-head { display: grid; gap: 10px; padding: 0 2px; }
.sidebar__brand { padding: 0 6px; }
.side-head .user-chip { padding: 7px 8px; border: 1px solid transparent; border-radius: 11px; text-align: left; }
.side-head .user-chip:hover { background: #fbfbfb; border-color: var(--line); }
.workspace { display: flex; align-items: center; gap: 7px; padding: 0 7px; color: var(--muted-2); font-size: 10.5px; }
.workspace i { width: 5px; height: 5px; flex: 0 0 5px; border-radius: 50%; background: var(--green); }
.nav-label { padding: 0 10px; color: var(--muted-2); font-size: 10px; font-weight: 600; letter-spacing: .08em; }
.sidebar nav { gap: 2px; }
.nav-item { min-height: 35px; }
.sidebar__foot { gap: 10px; }
.side-version { display: flex; align-items: center; justify-content: space-between; padding: 2px 7px 0; color: var(--muted-2); font-size: 10px; }

/* ---------- 顶栏 ---------- */
.main { min-height: 100dvh; padding: 0; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; height: 52px; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(240, 240, 240, .88); backdrop-filter: blur(12px); }
.crumb { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--muted-2); font-size: 12px; white-space: nowrap; }
.crumb b { overflow: hidden; color: var(--ink); font-size: 12.5px; font-weight: 600; text-overflow: ellipsis; }
.crumb__sep { color: #c3c6c1; }
.topbar__right { display: flex; align-items: center; gap: 8px; min-width: 0; margin-left: auto; }
.sync-state { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10.5px; white-space: nowrap; }
.sync-state .dot { width: 6px; height: 6px; margin: 0; background: var(--green); }
.sync-state .dot.is-offline { background: var(--bad); }
.topbar .search-field { width: 232px; height: 30px; padding: 0 9px; border-radius: 8px; background: var(--surface); box-shadow: none; }
.topbar .search-field svg { width: 13px; height: 13px; flex-basis: 13px; }
.topbar .search-field input { font-size: 11.5px; }
.topbar .search-field kbd { display: none; }
.topbar .icon-button { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px; background: var(--surface); box-shadow: none; }
.content { max-width: 1580px; margin: 0 auto; padding: 22px 28px 40px; }
#loadingBar { margin: 12px 28px 0; }

/* ---------- 视图头 ---------- */
.view-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.view-head h2 { font-size: 17px; font-weight: 650; letter-spacing: -.015em; }
.view-head p { margin-top: 4px; max-width: 100ch; color: var(--muted); font-size: 11.5px; line-height: 1.6; font-variant-numeric: tabular-nums; }
.view-head p:empty { display: none; }
.view-head__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }

/* ---------- 卡片头 ---------- */
.card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.card__head h2 { font-size: 14px; font-weight: 650; letter-spacing: -.01em; }
.card__head p { margin-top: 4px; max-width: 92ch; color: var(--muted); font-size: 11.5px; line-height: 1.6; font-variant-numeric: tabular-nums; }
.card__head p:empty { display: none; }
.card__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.view-card { overflow: hidden; background: var(--surface); }
.view-card > .card__head { background: var(--surface); }
.table-wrap--flush { border: 0; border-radius: 0; box-shadow: none; }

/* ---------- 指标条 ---------- */
.kpi-card { margin-bottom: 12px; overflow: hidden; }
.subhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line-2); color: #6a6e69; font-size: 10.5px; font-weight: 600; letter-spacing: .03em; }
.subhead .mini { color: var(--muted-2); font-size: 10px; font-weight: 500; letter-spacing: 0; }
.kpi-card .kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin: 0; }
.kpi-card .kpi { padding: 13px 16px 14px; border: 0; border-right: 1px solid var(--line-2); border-radius: 0; background: transparent; box-shadow: none; }
.kpi-card .kpi:last-child { border-right: 0; }
.kpi-card .kpi--accent { border-color: var(--line-2); background: transparent; box-shadow: none; }
.kpi-card .kpi__value b { font-size: 24px; }

/* ---------- 档案表格 ---------- */
.dir-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--line-2); background: var(--surface); }
.dir-toolbar .head-tools { gap: 6px; }
.dir-toolbar .head-tools select { min-height: 28px; }
.dir-toolbar .chip { min-height: 27px; padding: 3px 11px; font-size: 11px; }
.dir-card .table-wrap { overflow: auto; }
.dir-card .pager { margin: 0; padding: 10px 16px; border-top: 1px solid var(--line-2); background: var(--surface); }
.rec-list { max-block-size: calc(100dvh - 250px); border: 0; border-radius: 0; background: var(--surface); box-shadow: none; overflow: auto; }
.rec-list table { display: table; width: 100%; min-width: 980px; border-collapse: collapse; table-layout: fixed; }
.rec-list thead { display: table-header-group; }
.rec-list thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); box-shadow: inset 0 -1px 0 var(--line-2); }
.rec-list tbody { display: table-row-group; }
.rec-list tr.rec { display: table-row; margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; cursor: pointer; }
.rec-list td, .rec-list tbody th { display: table-cell; padding: 9px 13px; border: 0; border-bottom: 1px solid var(--line-2); background: transparent; color: var(--ink-2); font-size: 12px; vertical-align: middle; }
.rec-list tbody th { font-weight: inherit; text-align: left; }
.rec-list .rec-open { display: flex; align-items: center; gap: 9px; width: 100%; padding: 0; border: 0; border-radius: 7px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.rec-list .rec-open:focus-visible { outline: 2px solid #171918; outline-offset: 3px; }
.rec-list .rec-open:hover .dir-who__copy b { color: var(--accent-strong); }
.rec-list .rec__job-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-list .rec__time { white-space: nowrap; color: var(--muted); font-size: 11.5px; }
.rec-list .rec__usage { white-space: nowrap; }
.rec-list td:first-child, .rec-list tbody th:first-child { padding-left: 16px; }
.rec-list td:last-child { padding-right: 16px; }
.rec-list td::before { display: none !important; }
.rec-list tbody tr:hover td, .rec-list tbody tr:hover th { background: #f7f7f4; }
.rec-list tr.is-selected td, .rec-list tr.is-selected th { background: var(--accent-soft); }
.rec-list tr.is-selected:hover td, .rec-list tr.is-selected:hover th { background: #e3f0df; }
.dir-who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.dir-who__copy { display: grid; gap: 3px; min-width: 0; }
.dir-who__copy b { overflow: hidden; color: var(--ink); font-size: 12.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.dir-who .rec__tags { overflow: hidden; gap: 4px; }
.rec-list .rec__job { color: var(--muted); font-size: 11.5px; }
.rec-list .rec__job b { color: var(--ink-2); font-weight: 600; }
.rec-list .rec__sum { max-width: none; color: var(--muted); font-size: 11.5px; line-height: 1.55; }
.rec-list .rec__sum .clamp-2 { max-width: 46ch; }
.rec-list .rec__score { text-align: left; }
.rec-list td.rec__usage { text-align: left; }
.rec-list .rec__usage { display: flex; justify-content: flex-start; text-align: left; }
.rec-list .rec__meta { text-align: left; }
.rec-list .rec__time { color: var(--muted-2); font-size: 10.5px; }
.rec-list .rec__credits { height: 20px; padding: 0 6px; border-radius: 5px; font-size: 10.5px; }
.rec-list .rec__usage-tokens { font-size: 10px; }
.rec-list .empty { display: table-cell; padding: 34px 16px !important; text-align: center; color: var(--muted); }
.rec-list td.rec__job { display: table-cell; overflow: visible; -webkit-line-clamp: unset; }

/* ---------- 岗位 / 公司 / 账号卡内边距 ---------- */
.jobs-card .job-toolbar { padding: 12px 16px; }
.jobs-card .job-active-filters { padding: 0 16px 8px; }
.jobs-card .job-groups { padding: 12px 16px 16px; border-top: 1px solid var(--line-2); background: var(--surface); }
.jg-company { margin-top: 10px; border-color: var(--line); }
.jg-company-head { background: #f7f7f4; border-bottom-color: var(--line-2); }
.jg-company-head:hover { background: #f1f1ee; }
.jg-company-count { background: #efefec; }
.jg-company-miss { background: #fbf2da; color: #7d5a16; }
.view-card > .table-wrap--flush table th:first-child, .view-card > .table-wrap--flush table td:first-child { padding-left: 16px; }
.view-card > .table-wrap--flush table th:last-child, .view-card > .table-wrap--flush table td:last-child { padding-right: 16px; }
.view-card > .credit-queue { margin: 0; padding: 12px 16px 0; }
.view-card > .credit-queue:empty { display: none; }

/* ---------- 设置 ---------- */
.settings-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 16px; align-items: start; }
.set-rail { position: sticky; top: 68px; display: grid; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.set-tabs { display: flex; flex-direction: column; align-items: stretch; gap: 2px; max-width: none; padding: 0; border: 0; border-radius: 0; background: transparent; overflow: visible; }
.set-tab { justify-content: flex-start; min-height: 34px; padding: 7px 10px; border-radius: 8px; color: var(--muted); font-size: 12px; font-weight: 550; text-align: left; }
.set-tab:hover { background: #f2f2ef; color: var(--ink); }
.set-tab.is-active { background: #171918; color: #fff; box-shadow: none; }
.set-rail__note { padding: 4px 4px 6px; color: var(--muted-2); font-size: 10px; line-height: 1.6; }
.set-panels { display: grid; gap: 12px; min-width: 0; }
.keys-hero { background: linear-gradient(180deg, #fdfdfc 0%, #f7f8f5 100%); box-shadow: 0 1px 2px rgba(22, 24, 22, .03); }
#settingsView { gap: 0; }

dialog:modal { overscroll-behavior: contain; }
dialog::backdrop { overflow: hidden; overscroll-behavior: contain; }

/* ---------- 登录 ---------- */
.login-view { display: grid; place-items: center; min-height: 100dvh; padding: 36px 24px; background: radial-gradient(900px 520px at 28% 30%, rgba(200, 240, 200, .5), transparent 66%), var(--canvas); }
.login-frame { display: grid; grid-template-columns: minmax(0, 1fr) 384px; gap: 32px; align-items: center; width: min(960px, 100%); }
.login-hero { padding: 8px 6px; }
.login-hero .login-brand { margin-bottom: 26px; }
.login-hero h2 { max-width: 15ch; font-size: 30px; font-weight: 650; line-height: 1.22; letter-spacing: -.03em; }
.login-hero > p { max-width: 38ch; margin-top: 12px; color: var(--muted); font-size: 13px; line-height: 1.75; }
.login-points { display: grid; gap: 9px; margin: 24px 0 0; padding: 0; list-style: none; }
.login-points li { display: flex; align-items: center; gap: 9px; color: var(--ink-2); font-size: 12px; }
.login-points i { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(124, 196, 122, .16); }
.login-card { width: 100%; padding: 28px 28px 24px; border-radius: 20px; }
.login-mobile-brand { display: none; }
.login-card h1 { margin-bottom: 18px; }

/* ---------- 窄屏 ---------- */
@media (max-width: 1180px) {
  .kpi-card .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-card .kpi { border-bottom: 1px solid var(--line-2); }
  .kpi-card .kpi:nth-child(3n) { border-right: 0; }
  .kpi-card .kpi:nth-last-child(-n+2) { border-bottom: 0; }
}
@media (max-width: 1000px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .set-rail { position: static; justify-items: stretch; }
  .set-tabs { flex-direction: row; overflow-x: auto; }
  .set-tab { flex: 0 0 auto; text-align: center; }
  .set-rail__note { display: none; }
}
@media (max-width: 900px) {
  .topbar { position: static; height: 48px; padding: 0 16px; }
  .content { padding: 16px 16px 32px; }
  #loadingBar { margin: 10px 16px 0; }
  .side-head { display: flex; align-items: center; gap: 10px; }
  .side-head .user-chip, .workspace, .nav-label, .side-version { display: none; }
  .sidebar { gap: 10px; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .login-frame { grid-template-columns: minmax(0, 384px); justify-content: center; }
  .login-hero { display: none; }
  .login-mobile-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 20px; font-size: 15px; font-weight: 650; }
}
@media (max-width: 760px) {
  .sync-state { display: none; }
  .topbar .search-field { width: auto; flex: 1 1 auto; min-width: 0; }
  .crumb__root, .crumb__sep { display: none; }
  .view-head h2 { font-size: 16px; }
  .card__head { padding: 13px 14px; }
  .card__actions { width: 100%; justify-content: flex-start; margin-left: 0; }
  .dir-toolbar { padding: 9px 14px; }
  .kpi-card .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-card .kpi { border-right: 0; border-bottom: 1px solid var(--line-2); }
  .kpi-card .kpi:nth-child(odd) { border-right: 1px solid var(--line-2); }
  .kpi-card .kpi:nth-child(3n) { border-right: 1px solid var(--line-2); }
  .kpi-card .kpi:nth-last-child(-n+2) { border-bottom: 1px solid var(--line-2); }
  .kpi-card .kpi:last-child { border-bottom: 0; }
  .rec-list table { min-width: 900px; }
  .login-view { padding: 24px 18px; }
  .login-card { padding: 24px 22px 20px; }
}

/* 移动端：档案表格还原为两列卡片，保证关键信息不用横向滚动 */
@media (max-width: 760px) {
  .topbar .search-field { order: 0; }
  .rec-list { overflow: visible; }
  .rec-list table { display: block; width: 100%; min-width: 0; }
  .rec-list thead { display: none; }
  .rec-list tbody { display: block; }
  .rec-list tr.rec {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "who score" "job usage" "sum sum" "meta time";
    gap: 6px 12px;
    margin: 0;
    padding: 12px 14px;
    border: 0;
    border-bottom: 1px solid var(--line-2);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .rec-list tr.rec:last-child { border-bottom: 0; }
  .rec-list td, .rec-list tbody th { display: block; padding: 0; border: 0; }
  .rec-list .rec__who { grid-area: who; }
  .rec-list td.rec__score { grid-area: score; justify-self: end; align-self: start; text-align: right; }
  .rec-list td.rec__job { grid-area: job; display: block; overflow: visible; -webkit-line-clamp: unset; }
  .rec-list td.rec__usage { grid-area: usage; justify-self: end; justify-content: flex-end; }
  .rec-list td.rec__sum { grid-area: sum; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  .rec-list td.rec__meta { grid-area: meta; align-self: end; }
  .rec-list td.rec__time { grid-area: time; justify-self: end; align-self: end; text-align: right; }
  .rec-list tbody tr:hover td, .rec-list tbody tr:hover th { background: transparent; }
  .rec-list tr.is-selected td, .rec-list tr.is-selected th { background: transparent; }
  .rec-list tr.is-selected { background: var(--accent-soft); }
  .rec-list td.rec__sum { max-width: none; }
  .rec-list td[data-label]::before { display: block !important; content: attr(data-label); margin-bottom: 3px; color: var(--muted-2); font-size: 10px; line-height: 1.3; }
  .rec-list .rec__who::before { display: none !important; }
  .rec-list { max-block-size: none; }
}

/* 移动端：配置链改为带标签的条目卡，操作按钮保持可见 */
@media (max-width: 760px) {
  .table-wrap.keys-table-wrap { overflow: visible; padding: 0; }
  .table-wrap.keys-table-wrap table { display: block; width: 100%; min-width: 0; }
  .table-wrap.keys-table-wrap thead { display: none; }
  .table-wrap.keys-table-wrap tbody { display: block; }
  .table-wrap.keys-table-wrap tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 10px;
    margin: 0;
    padding: 12px 14px;
    border: 0;
    border-bottom: 1px solid var(--line-2);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .table-wrap.keys-table-wrap tr:last-child { border-bottom: 0; }
  .table-wrap.keys-table-wrap td { display: block; min-width: 0; padding: 0; border: 0; }
  .table-wrap.keys-table-wrap td:nth-child(1) { grid-column: 1; grid-row: 1; align-self: center; }
  .table-wrap.keys-table-wrap td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; padding-top: 2px; }
  .table-wrap.keys-table-wrap td:nth-child(3) { grid-column: 1 / -1; grid-row: 3; margin-top: 2px; font-size: 12px; color: var(--muted); }
  .table-wrap.keys-table-wrap td:nth-child(4) { grid-column: 2; grid-row: 1; justify-self: end; align-self: center; }
  .table-wrap.keys-table-wrap td:nth-child(5) { grid-column: 1 / -1; grid-row: 4; margin-top: 2px; font-size: 12px; color: var(--muted); }
  .table-wrap.keys-table-wrap td:nth-child(6) { display: none; }
  .table-wrap.keys-table-wrap td:nth-child(7) { grid-column: 1 / -1; grid-row: 5; display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 6px; }
  .table-wrap.keys-table-wrap td::before { content: none; display: none; }
  .table-wrap.keys-table-wrap td.keys-empty { grid-column: 1 / -1; padding: 8px 0; text-align: center; }
  .table-wrap.keys-table-wrap .keys-time { display: inline; margin-left: 6px; }
  .table-wrap.keys-table-wrap .row-actions .link-btn { padding: 2px 0; }
}

/* 卡头按钮全部隐藏时不要再占一行 */
.card__actions:not(:has(> :not([hidden]))) { display: none; }

/* 移动端积分格：标签独占一行，数值不折行 */
@media (max-width: 760px) {
  .table-wrap td.credit-cell { display: block; white-space: nowrap; }
  .table-wrap td.credit-cell::before { display: block; margin-bottom: 2px; }
  .table-wrap td.credit-cell .credit-sep { margin: 0 5px; }
}

/* 移动端空态行不要再套一层卡片 */
@media (max-width: 760px) {
  .table-wrap tr:has(> td[colspan]) { margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .table-wrap td[colspan] { display: block; padding: 28px 14px; text-align: center; }
  .table-wrap td[colspan]::before { display: none; }
}

/* 档案页：筛选收进卡片、两行标签式筛选（对齐设计稿） */
.dir-card > .card__head { border-bottom: 0; padding-bottom: 6px; }
.dir-card .card__actions { align-items: center; }
.dir-actions .head-tools { display: flex; align-items: center; gap: 6px; }
.dir-actions select { min-height: 30px; padding: 3px 26px 3px 10px; font-size: 11.5px; }
.dir-actions .btn { min-height: 30px; font-size: 11.5px; }
.dir-filters { display: flex; flex-direction: column; gap: 7px; padding: 2px 16px 12px; }
.dir-filters .frow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.dir-filters .flabel { flex: none; width: 26px; color: var(--muted-2); font-size: 10.5px; letter-spacing: .02em; }
.dir-filters .filters { flex: 1; gap: 6px; }
.dir-filters .chip { min-height: 26px; padding: 3px 10px; font-size: 11px; }
.dir-filters .chip b { color: var(--muted-2); font-weight: 500; font-variant-numeric: tabular-nums; }
.dir-filters .chip.is-active b { color: rgba(255, 255, 255, .62); }

/* 档案表：评分数字 + 紧凑结论标签 */
.rec-list td.rec__score .score { font-size: 13px; font-weight: 650; letter-spacing: -.01em; }
.rec-list td.rec__score { vertical-align: middle; }
.rec-list td.rec__sum { vertical-align: middle; }
.rec-list td.rec__sum .verdict { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rec-list td.rec__sum .verdict > .tag { flex: none; }
.rec-list td.rec__sum .verdict__text { min-width: 0; overflow: hidden; color: var(--muted); font-size: 11.5px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.rec-list .tag .dot { width: 4px; height: 4px; background: currentColor; box-shadow: none; opacity: .65; }

@media (max-width: 760px) {
  .dir-filters { padding: 2px 14px 10px; }
  .dir-filters .flabel { width: 22px; }
}

/* 顶栏账号菜单（替代全局搜索） */
.topbar .user-menu { position: relative; }
.topbar .user-chip { display: flex; align-items: center; gap: 7px; height: 32px; padding: 3px 8px 3px 3px; border-radius: 9px; list-style: none; cursor: pointer; }
.topbar .user-chip::-webkit-details-marker { display: none; }
.topbar .user-chip:hover, .user-menu[open] .user-chip { background: var(--surface); }
.topbar .user-chip .avatar { width: 26px; height: 26px; flex: 0 0 26px; font-size: 10px; }
.topbar .user-chip .user-chip__meta { display: grid; gap: 0; line-height: 1.25; }
.topbar .user-chip .user-chip__meta b { color: var(--ink); font-size: 11.5px; font-weight: 600; }
.topbar .user-chip .user-chip__meta span { color: var(--muted-2); font-size: 9.5px; }
.user-menu__pop { position: absolute; top: calc(100% + 6px); right: 0; z-index: 60; min-width: 128px; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); box-shadow: var(--shadow-2); }
.user-menu__pop button { display: block; width: 100%; padding: 7px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-2); font: inherit; font-size: 11.5px; text-align: left; cursor: pointer; }
.user-menu__pop button:hover { background: #f4f4f1; color: var(--ink); }
.user-menu__pop #logout { color: var(--bad); }

/* 档案页搜索收进卡片头 */
.dir-actions { gap: 8px; }
.dir-actions .dir-search { width: 220px; height: 30px; padding: 0 9px; border-radius: 8px; background: var(--surface); box-shadow: none; }
.dir-actions .dir-search svg { width: 13px; height: 13px; flex-basis: 13px; }
.dir-actions .dir-search input { font-size: 11.5px; }
.dir-actions .dir-search kbd { display: none; }

/* 主配置 Key：压缩成一行，避免设置页再叠一张大卡 */
.keys-hero--compact { padding: 13px 16px; border-radius: 12px; }
.keys-hero--compact .keys-hero__main { align-items: center; gap: 14px; }
.keys-hero--compact .keys-hero__title { gap: 8px; }
.keys-hero--compact .keys-hero__title h2 { font-size: 13px; }
.keys-hero--compact .keys-hero__title code { min-height: 24px; padding: 2px 8px; font-size: 11.5px; }
.keys-hero--compact .keys-hero__meta { margin-top: 5px; }
.keys-hero--compact .keys-hero__actions { padding-top: 0; }

/* 设置页：竖向大 tab 改成顶部横向胶囊，给表格腾出宽度 */
.settings-layout { display: block; }
.set-rail { position: static; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 0; border: 0; background: transparent; }
.set-tabs { flex-direction: row; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--canvas); }
.set-tab { min-height: 31px; padding: 5px 15px; border-radius: 999px; text-align: center; }
.set-tab.is-active { background: #171918; color: #fff; }
.set-rail__note { display: none; }

/* 触控设备：把常用控件提到 44px */
@media (pointer: coarse) {
  .nav-item, .chip, .set-tab, .dir-actions select, .dir-actions .btn, #refresh, #themeToggle, .topbar .user-chip { min-height: 44px; }
  #refresh, #themeToggle { width: 44px; height: 44px; flex-basis: 44px; }
  .topbar .user-chip { height: 44px; }
  .chip { padding-inline: 12px; }
}

/* ═══════════════════════════════════════════════════════════════════
   V3 视觉精修层：清晰整数阶梯 + 纯白浮层卡片 + 动效 + 双主题
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --canvas: #f4f5f4;
  --surface: #ffffff;
  --surface-2: #f8f9f8;
  --line: #e4e7e5;
  --line-2: #eef0ee;
  --ink: #111412;
  --ink-2: #2c332e;
  --muted: #626b65;
  --muted-2: #7a837d;
  --accent: #141715;
  --accent-strong: #000000;
  --accent-soft: #ecfdf5;
  --accent-line: #a7f3d0;
  --green: #10b981;
  --green-strong: #059669;
  --green-bar: #bbf7d0;
  --max-accent: #6366f1;
  --max-soft: #eef2ff;
  --max-line: #c7d2fe;
  --ok: #059669;
  --ok-soft: #ecfdf5;
  --ok-line: #a7f3d0;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --warn-line: #fde68a;
  --bad: #dc2626;
  --bad-soft: #fef2f2;
  --bad-line: #fecaca;
  --card-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 0 0 1px rgba(15, 23, 42, .045);
  --card-shadow-hover: 0 6px 20px -10px rgba(15, 23, 42, .14), 0 0 0 1px rgba(15, 23, 42, .07);
}

/* 表面与卡片质感 */
body { background: var(--canvas); color: var(--ink); font-size: 13px; }
.card, .sec, .table-wrap, .keys-panel, .keys-hero {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--card-shadow);
}
.table-wrap--flush { border: 0; box-shadow: none; }
.view-card { border: 1px solid var(--line); box-shadow: var(--card-shadow); }

/* 侧栏分组与导航精修 */
.shell { grid-template-columns: 244px minmax(0, 1fr); }
.sidebar { gap: 18px; padding: 18px 12px 16px; background: color-mix(in srgb, var(--surface) 58%, var(--canvas)); border-right: 1px solid var(--line); }
.side-head { gap: 0; padding: 2px 4px; }
.sidebar__brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px; font-size: 15px; font-weight: 700; letter-spacing: -.02em; }
.sidebar__brand-copy { display: grid; gap: 2px; min-width: 0; line-height: 1.15; }
.sidebar__brand-copy > span { color: var(--ink); font-size: 14.5px; font-weight: 720; letter-spacing: -.02em; }
.brand-mark { width: 32px; height: 32px; flex-basis: 32px; border-radius: 10px; background: linear-gradient(145deg, #222824, #0d100e); box-shadow: 0 5px 14px -5px rgba(15, 23, 42, .48), inset 0 1px 0 rgba(255, 255, 255, .12); }
.workspace { display: inline-flex; align-items: center; gap: 6px; padding: 0; font-size: 11px; font-weight: 500; color: var(--muted); }
.workspace i { width: 6px; height: 6px; flex-basis: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(16, 185, 129, .18); }
.sidebar nav { display: grid; gap: 0; }
.nav-group { display: grid; gap: 2px; }
.nav-group + .nav-group { margin-top: 14px; }
.nav-group__title { padding: 0 10px 5px; color: var(--muted-2); font-size: 11px; font-weight: 600; letter-spacing: .05em; }
.nav-item { position: relative; min-height: 36px; gap: 10px; padding: 8px 10px 8px 12px; border-radius: 9px; color: var(--muted); font-size: 13.5px; font-weight: 520; transition: background .15s ease, color .15s ease, box-shadow .15s ease; }
.nav-item svg { width: 17px; height: 17px; flex-basis: 17px; stroke-width: 1.75; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; opacity: .74; transition: opacity .15s ease, color .15s ease; }
.nav-item:hover { background: rgba(17, 20, 18, .055); color: var(--ink); }
.nav-item:hover svg { opacity: .95; }
.nav-item.is-active { background: var(--surface); color: var(--ink); font-weight: 640; box-shadow: var(--card-shadow); }
.nav-item.is-active::before { content: ""; position: absolute; left: 4px; top: 8px; bottom: 8px; width: 3px; border-radius: 99px; background: var(--green); }
.nav-item.is-active svg { opacity: 1; color: var(--green-strong); }
.nav-item__count {
  margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: rgba(17, 20, 18, .055);
  color: var(--muted); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.nav-item__count:empty { display: none; }
.nav-item.is-active .nav-item__count { background: var(--ok-soft); color: var(--green-strong); }
.quota { padding: 12px 13px; border-radius: 13px; background: var(--surface); box-shadow: var(--card-shadow); }
.quota__row span { font-size: 12px; color: var(--muted); font-weight: 550; }
.quota__row strong { font-size: 13px; font-weight: 680; color: var(--ink); }
.quota .track { height: 6px; margin: 9px 0 7px; background: var(--line-2); }
.quota .track > i { background: linear-gradient(90deg, #34d399, #10b981); }
.quota__note { font-size: 11px; color: var(--muted-2); }
.side-version { padding: 2px 6px 0; font-size: 11px; color: var(--muted-2); }
html[data-theme="dark"] .nav-item__count { background: rgba(255, 255, 255, .07); color: var(--muted); }
html[data-theme="dark"] .nav-item.is-active .nav-item__count { background: var(--ok-soft); color: var(--green); }
@media (max-width: 900px) {
  .sidebar nav { display: flex; }
  .nav-group { display: contents; }
  .nav-group__title { display: none; }
  .nav-item.is-active::before { display: none; }
}

/* 顶栏与内联图标按钮 */
.topbar { height: 54px; padding: 0 26px; background: color-mix(in srgb, var(--canvas) 86%, transparent); backdrop-filter: blur(14px); }
.crumb { font-size: 13px; }
.crumb b { font-size: 13.5px; }
.sync-state { font-size: 12px; }
.topbar .icon-button { width: 32px; height: 32px; flex-basis: 32px; border-radius: 8px; border-color: var(--line); background: var(--surface); color: var(--ink-2); transition: background .15s, border-color .15s, color .15s; }
.topbar .icon-button svg, .drawer-head .icon-button svg { width: 16px; height: 16px; }
.topbar .icon-button:hover { border-color: var(--accent-line); background: var(--accent-soft); color: var(--green-strong); }
.theme-icon--sun { display: none; }
html[data-theme="dark"] .theme-icon--moon { display: none; }
html[data-theme="dark"] .theme-icon--sun { display: block; }
.topbar .user-chip { height: 34px; padding: 3px 9px 3px 4px; }
.topbar .user-chip .user-chip__meta b { font-size: 12.5px; }
.topbar .user-chip .user-chip__meta span { font-size: 11px; }
.user-menu__pop button { font-size: 12.5px; }

/* 标题与清晰整数阶梯 */
.content { padding: 24px 28px 44px; }
.view-head { margin-bottom: 16px; }
.view-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -.025em; }
.view-head p { margin-top: 5px; font-size: 12.5px; color: var(--muted); }
.card__head { padding: 16px 18px; }
.card__head h2 { font-size: 15px; font-weight: 680; }
.card__head p { font-size: 12.5px; }
.sec > h2, .sec > h3, .ov-card-head h2 { font-size: 14.5px; font-weight: 660; }
.ov-card-head small, .sec > h2 small, .sec > h3 small { font-size: 12px; color: var(--muted); }
.rank-note, .chart-foot { font-size: 12px; color: var(--muted); }

/* 按钮、表单与筛选器 */
.btn { min-height: 34px; padding: 6px 13px; font-size: 13px; font-weight: 560; border-color: var(--line); background: var(--surface); color: var(--ink-2); }
.btn:hover { background: var(--surface-2); border-color: #cfd5d1; color: var(--ink); }
.btn--sm { min-height: 30px; padding: 4px 11px; font-size: 12px; }
.btn--primary { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: 0 2px 6px rgba(15, 23, 42, .16); }
.btn--primary:hover { border-color: var(--accent-strong); background: var(--accent-strong); color: #fff; }
.btn--ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--muted); }
.btn--ghost:hover { background: rgba(17, 20, 18, .06); color: var(--ink); }
.link-btn { color: var(--green-strong); font-size: 12.5px; font-weight: 580; }
.link-btn:hover { color: #047857; }
input, select, textarea { min-height: 34px; font-size: 13px; border-color: var(--line); background: var(--surface); color: var(--ink); }
.search-field { height: 34px; border-color: var(--line); background: var(--surface); }
.search-field input { font-size: 13px; }
.dir-actions .dir-search { width: 240px; height: 32px; }
.dir-actions .dir-search input { font-size: 12.5px; }
.dir-actions select, .user-filter-select { width: auto; min-height: 32px; padding: 4px 28px 4px 10px; font-size: 12.5px; }
.users-actions { align-items: center; }
.inline-field { font-size: 12.5px; }
.inline-field input { min-height: 30px; font-size: 12.5px; }

/* 胶囊与标签规范 */
.seg { padding: 3px; border-radius: 10px; border-color: var(--line); background: var(--surface-2); }
.seg__item { min-height: 26px; padding: 4px 12px; border-radius: 7px; font-size: 12px; font-weight: 560; color: var(--muted); transition: background .15s, color .15s; }
.seg__item:hover { color: var(--ink); }
.seg__item.is-active { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .15); }
.chip { min-height: 30px; padding: 4px 12px; font-size: 12px; font-weight: 560; border-color: var(--line); background: var(--surface); color: var(--ink-2); box-shadow: none; }
.chip:hover { border-color: #c5ccc7; background: var(--surface-2); }
.chip.is-active { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: 0 2px 6px rgba(15, 23, 42, .14); }
.dir-filters { gap: 8px; padding: 4px 18px 14px; }
.dir-filters .flabel { width: 32px; font-size: 12px; color: var(--muted); }
.dir-filters .chip { min-height: 28px; padding: 3px 11px; font-size: 12px; }
.tag, .badge { padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 560; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line-2); }
.tag--accent, .badge--accent, .tag--success, .badge--success { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.tag--warn, .badge--warn, .tag--warning { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.tag--danger, .badge--danger { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }
.tag--info { background: var(--max-soft); color: var(--max-accent); border-color: var(--max-line); }
.pill { padding: 3px 9px; border-radius: 6px; font-size: 13px; font-weight: 680; }

/* 总览 KPI 与 MAX 能力卡 */
.kpi-card { margin-bottom: 14px; border-radius: 16px; }
.kpi-card--max { border-color: var(--max-line); background: linear-gradient(180deg, color-mix(in srgb, var(--max-soft) 55%, var(--surface)) 0%, var(--surface) 44%); }
.subhead { padding: 11px 18px; font-size: 12px; color: var(--muted); }
.subhead .mini { font-size: 12px; color: var(--muted-2); }
.subhead__max { display: inline-flex; align-items: center; gap: 7px; color: var(--max-accent); font-weight: 650; }
.max-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--max-accent); box-shadow: 0 0 0 3px rgba(99, 102, 241, .18); }
.kpi-card .kpi { padding: 16px 18px 15px; transition: background .15s ease; }
.kpi-card .kpi:hover { background: var(--surface-2); }
.kpi__label { font-size: 12.5px; font-weight: 560; color: var(--muted); }
.kpi-card .kpi__value { margin-top: 8px; gap: 6px; }
.kpi-card .kpi__value b { font-size: 28px; font-weight: 700; letter-spacing: -.035em; line-height: 1.1; color: var(--ink); }
.kpi-card .kpi__value small { font-size: 12px; font-weight: 500; color: var(--muted-2); }
.kpi__meta { margin-top: 6px; font-size: 12px; color: var(--muted); }
.kpi__delta { padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 620; }
.kpi__spark { margin-top: 10px; }
.kpi__spark svg { height: 32px; }
.ov-chart-card, .ov-rank-card { margin-bottom: 14px; }
.ov-row3, .ov-row4 { gap: 14px; margin-bottom: 14px; }
.chart-summary { font-size: 12.5px; }
.rank-bar .is-ai { background: var(--green); }
.rank-bar .is-request { background: var(--green-bar); }
.chart-line { stroke: var(--green); }
.chart-dot { stroke: var(--green); }

/* 表格可读性升级 */
th { padding: 10px 14px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--line); }
td { padding: 11px 14px; font-size: 13px; color: var(--ink-2); border-bottom: 1px solid var(--line-2); }
tbody tr:hover td { background: var(--surface-2); }
.candidate { font-size: 13px; font-weight: 620; color: var(--ink); }
.subline { font-size: 12px; color: var(--muted); }
.rec-list td, .rec-list tbody th { padding: 11px 13px; font-size: 13px; }
.dir-who__copy b { font-size: 13px; }
.rec-list .rec__job { font-size: 12.5px; }
.rec-list .rec__sum, .rec-list td.rec__sum .verdict__text { font-size: 12.5px; }
.rec-list .rec__time { font-size: 12px; color: var(--muted); }
.rec-list .rec__credits { height: 22px; padding: 0 7px; font-size: 11.5px; }
.rec-list .rec__usage-tokens { font-size: 11px; }
.rec-list td.rec__usage { overflow: hidden; }
.rec-list td.rec__meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-list td.rec__score .score { font-size: 14px; font-weight: 700; }
.pager__controls { display: inline-flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.pager__size { width: auto; min-height: 30px; padding: 3px 26px 3px 10px; font-size: 12px; }

/* 抽屉头部连续审阅条 + 丝滑入场动效 */
.drawer-head__tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.drawer-nav { display: inline-flex; align-items: center; gap: 4px; padding: 2px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.drawer-nav .icon-button { width: 28px; height: 28px; flex-basis: 28px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-2); }
.drawer-nav .icon-button:hover:not(:disabled) { background: var(--surface); color: var(--ink); }
.drawer-nav .icon-button:disabled { opacity: .35; cursor: not-allowed; }
.drawer-nav__pos { min-width: 44px; padding: 0 4px; text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); }

dialog.drawer {
  transition: transform .24s cubic-bezier(.22, 1, .36, 1), opacity .2s ease, overlay .24s allow-discrete, display .24s allow-discrete;
}
dialog.drawer:not([open]) { transform: translateX(36px); opacity: 0; }
@starting-style {
  dialog.drawer[open] { transform: translateX(36px); opacity: 0; }
}
dialog.modal {
  transition: transform .18s cubic-bezier(.22, 1, .36, 1), opacity .18s ease, overlay .18s allow-discrete, display .18s allow-discrete;
}
dialog.modal:not([open]) { transform: translateY(8px) scale(.98); opacity: 0; }
@starting-style {
  dialog.modal[open] { transform: translateY(8px) scale(.98); opacity: 0; }
}
dialog::backdrop {
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(2px);
  transition: opacity .2s ease, overlay .2s allow-discrete, display .2s allow-discrete;
}
@starting-style {
  dialog[open]::backdrop { opacity: 0; }
}

/* 星猎 MAX 发布页推荐卡片 */
.release-max-card {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  margin-bottom: 14px; padding: 18px 20px; border-radius: 16px;
  border: 1px solid #272c3a;
  background:
    radial-gradient(520px 180px at 95% -20%, rgba(99, 102, 241, .32), transparent 62%),
    linear-gradient(135deg, #12151c 0%, #191d28 100%);
  color: #f3f5f8;
  box-shadow: 0 12px 30px -18px rgba(15, 23, 42, .65);
}
.release-max-card__copy { display: grid; gap: 6px; max-width: 64ch; }
.release-max-pill {
  justify-self: start; padding: 2px 9px; border-radius: 999px;
  background: rgba(99, 102, 241, .2); border: 1px solid rgba(129, 140, 248, .4);
  color: #c7d2fe; font-size: 11px; font-weight: 650; letter-spacing: .04em;
}
.release-max-card h3 { font-size: 16px; font-weight: 700; color: #fff; }
.release-max-card p { font-size: 13px; color: #b5bece; line-height: 1.6; }
.release-max-card .btn--primary { background: #fff; border-color: #fff; color: #111412; }
.release-max-card .btn--primary:hover { background: #e8ecf5; border-color: #e8ecf5; color: #000; }

/* 统一 Toast 轻提示 */
.toast-stack {
  position: fixed; top: 66px; right: 24px; z-index: 90;
  display: grid; gap: 8px; max-width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-size: 13px; font-weight: 540; line-height: 1.45;
  box-shadow: 0 14px 34px -14px rgba(15, 23, 42, .35), 0 0 0 1px rgba(15, 23, 42, .05);
  animation: toastIn .2s cubic-bezier(.22, 1, .36, 1) both;
}
.toast::before { content: ""; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--green); }
.toast--error::before { background: var(--bad); }
.toast--warn::before { background: var(--warn); }
.toast.is-out { opacity: 0; transform: translateY(-6px); transition: opacity .18s ease, transform .18s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }

/* 自定义确认弹框 */
.confirm-dialog { width: min(420px, calc(100vw - 32px)); }
.confirm-dialog__msg { font-size: 13.5px; line-height: 1.65; color: var(--ink-2); }

/* ═══════════════════════════════════════════════════════════════════
   深色主题（呼应星猎 MAX 行星主题）
   ═══════════════════════════════════════════════════════════════════ */
html[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #0d100f;
  --surface: #151918;
  --surface-2: #1c211f;
  --line: #262d2a;
  --line-2: #1f2523;
  --ink: #eef2ef;
  --ink-2: #c5cec8;
  --muted: #8b9690;
  --muted-2: #6d7872;
  --accent: #eef2ef;
  --accent-strong: #ffffff;
  --accent-soft: rgba(16, 185, 129, .14);
  --accent-line: rgba(52, 211, 153, .32);
  --green: #34d399;
  --green-strong: #34d399;
  --green-bar: rgba(52, 211, 153, .32);
  --max-accent: #818cf8;
  --max-soft: rgba(99, 102, 241, .16);
  --max-line: rgba(129, 140, 248, .32);
  --ok: #34d399;
  --ok-soft: rgba(16, 185, 129, .14);
  --ok-line: rgba(52, 211, 153, .3);
  --warn: #fbbf24;
  --warn-soft: rgba(245, 158, 11, .14);
  --warn-line: rgba(251, 191, 36, .3);
  --bad: #f87171;
  --bad-soft: rgba(239, 68, 68, .15);
  --bad-line: rgba(248, 113, 113, .32);
  --card-shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 255, 255, .04);
}
html[data-theme="dark"] .btn--primary { background: #eef2ef; border-color: #eef2ef; color: #111412; }
html[data-theme="dark"] .btn--primary:hover { background: #ffffff; border-color: #ffffff; color: #000; }
html[data-theme="dark"] .btn--primary img { filter: none; }
html[data-theme="dark"] .btn:not(.btn--primary) img,
html[data-theme="dark"] .icon-button img { filter: invert(1) opacity(.82); }
html[data-theme="dark"] .btn--danger { border-color: var(--bad-line); background: transparent; color: var(--bad); }
html[data-theme="dark"] .btn--danger:hover { background: var(--bad-soft); border-color: var(--bad-line); color: #fca5a5; }
html[data-theme="dark"] .btn--ghost:hover { background: rgba(255, 255, 255, .07); color: var(--ink); }
html[data-theme="dark"] .icon-button { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
html[data-theme="dark"] .icon-button:hover { background: var(--accent-soft); border-color: var(--accent-line); color: var(--green); }
html[data-theme="dark"] .link-btn { color: var(--green); }
html[data-theme="dark"] .link-btn:hover { color: #6ee7b7; }
html[data-theme="dark"] .seg__item.is-active,
html[data-theme="dark"] .chip.is-active,
html[data-theme="dark"] .set-tab.is-active { background: #eef2ef; border-color: #eef2ef; color: #111412; }
html[data-theme="dark"] .chip:hover { border-color: #3a4540; background: var(--surface-2); color: var(--ink); }
html[data-theme="dark"] .dir-filters .chip.is-active b { color: rgba(17, 20, 18, .65); }
html[data-theme="dark"] .set-tab:hover { background: rgba(255, 255, 255, .06); color: var(--ink); }
html[data-theme="dark"] .set-tabs { background: var(--surface-2); border-color: var(--line); }
html[data-theme="dark"] .nav-item:hover { background: rgba(255, 255, 255, .06); }
html[data-theme="dark"] .brand-mark { background: linear-gradient(145deg, #272f2c, #171c1a); border: 1px solid var(--line); }
html[data-theme="dark"] .btn:hover { border-color: #36403c; background: #212725; color: var(--ink); }
html[data-theme="dark"] .user-menu__pop { background: var(--surface); border-color: var(--line); }
html[data-theme="dark"] .user-menu__pop button:hover { background: #212725; }
html[data-theme="dark"] .crumb__sep { color: var(--muted-2); }
html[data-theme="dark"] .search-field kbd { background: var(--surface-2); border-color: var(--line); color: var(--muted); }
html[data-theme="dark"] code { background: var(--surface-2); border-color: var(--line); color: var(--ink); }

/* 暗色：表格、档案、抽屉与标准简历 */
html[data-theme="dark"] th,
html[data-theme="dark"] .table--ai-keys th,
html[data-theme="dark"] .cat-table th,
html[data-theme="dark"] .company-heading td,
html[data-theme="dark"] .job-overrides-table th { background: #1a201e; border-bottom-color: var(--line); color: var(--muted); }
html[data-theme="dark"] tbody tr:hover td,
html[data-theme="dark"] .table--ai-keys tbody tr:hover,
html[data-theme="dark"] .table--jobs tbody tr.job-row:hover > td,
html[data-theme="dark"] .rank-row:hover,
html[data-theme="dark"] .ov-rank-table tr.rank-item:hover,
html[data-theme="dark"] .rec-list tbody tr:hover td,
html[data-theme="dark"] .rec-list tbody tr:hover th { background: #1b221f; }
html[data-theme="dark"] .rec-list tr.is-selected td,
html[data-theme="dark"] .rec-list tr.is-selected th { background: rgba(16, 185, 129, .14); }
html[data-theme="dark"] .rec-list tr.is-selected:hover td,
html[data-theme="dark"] .rec-list tr.is-selected:hover th { background: rgba(16, 185, 129, .2); }
html[data-theme="dark"] .rec__usage.is-cache .rec__credits,
html[data-theme="dark"] .api-pill,
html[data-theme="dark"] .cmp-mark--no,
html[data-theme="dark"] .keys-source.is-fallback { background: #222926; color: var(--muted); }
html[data-theme="dark"] .api-pill--max { background: var(--max-soft); color: var(--max-accent); }
html[data-theme="dark"] .rec-pill--greet { background: var(--ok-soft); color: var(--ok); }
html[data-theme="dark"] .rv-tabs { background: var(--surface-2); border-color: var(--line); }
html[data-theme="dark"] .rv-tab { color: var(--muted); }
html[data-theme="dark"] .rv-tab.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
html[data-theme="dark"] .drawer,
html[data-theme="dark"] .drawer-head,
html[data-theme="dark"] .modal { background: var(--surface); color: var(--ink); }
html[data-theme="dark"] .drawer-head { border-bottom-color: var(--line); }
html[data-theme="dark"] .detail-rule,
html[data-theme="dark"] .json-pre,
html[data-theme="dark"] .std-sheet,
html[data-theme="dark"] .std-card,
html[data-theme="dark"] .rv-summary,
html[data-theme="dark"] .rv-card,
html[data-theme="dark"] .rv-evidence,
html[data-theme="dark"] details.rv-fold,
html[data-theme="dark"] .rv-drawer-sec { background: var(--surface-2); border-color: var(--line); color: var(--ink-2); }

/* 暗色：总览排行榜与图表 */
html[data-theme="dark"] .ov-rank-table tr.rank-item,
html[data-theme="dark"] .ov-rank-table tr.rank-item.is-top { background: transparent; border-color: var(--line-2); }
html[data-theme="dark"] .ov-rank-table .rank-name,
html[data-theme="dark"] .ov-rank-table .rank-stat__val,
html[data-theme="dark"] .ov-legend b { color: var(--ink); }
html[data-theme="dark"] .ov-rank-table .rank-stat__lab,
html[data-theme="dark"] .ov-rank-table .rank-stat__sub,
html[data-theme="dark"] .ov-rank-table .ov-share__pct,
html[data-theme="dark"] .ov-legend__pct { color: var(--muted); }
html[data-theme="dark"] .ov-rank-table .ov-share__bar,
html[data-theme="dark"] .rank-bar,
html[data-theme="dark"] .hour-row.is-zero .hour-row__track { background: #252c29; }
html[data-theme="dark"] .ov-rank-table .ov-share__bar > i,
html[data-theme="dark"] .hour-row.is-peak .hour-row__bar,
html[data-theme="dark"] .job-heat__bar > i { background: var(--green); }
html[data-theme="dark"] .rank-no.is-1 { background: rgba(245, 158, 11, .18); color: #fbbf24; }
html[data-theme="dark"] .rank-no.is-2 { background: #252c29; color: #cbd5e1; }
html[data-theme="dark"] .rank-no.is-3 { background: rgba(234, 88, 12, .18); color: #fb923c; }
html[data-theme="dark"] .rank-tag { background: var(--surface-2); border-color: var(--line); color: var(--ink-2); }
html[data-theme="dark"] .rank-tag--ok { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
html[data-theme="dark"] .rank-tag--warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
html[data-theme="dark"] .rank-tag--accent { background: var(--max-soft); border-color: var(--max-line); color: var(--max-accent); }
html[data-theme="dark"] .chart-tip { background: #1a1f1d !important; border-color: var(--line) !important; color: var(--ink) !important; box-shadow: 0 12px 28px -10px rgba(0, 0, 0, .65) !important; }
html[data-theme="dark"] .chart-days li { background: var(--surface-2); border-color: var(--line); }

/* 暗色：岗位管理、公司管理、账号管理 */
html[data-theme="dark"] .job-groups { background: var(--canvas); border-top-color: var(--line); }
html[data-theme="dark"] .jg-company { background: var(--surface); border-color: var(--line); }
html[data-theme="dark"] .jg-company-head { background: #1a201e; border-bottom-color: var(--line-2); }
html[data-theme="dark"] .jg-company-head:hover { background: #212825; }
html[data-theme="dark"] .jg-company-count { background: #252c29; color: var(--ink-2); }
html[data-theme="dark"] .jg-company-miss { background: var(--warn-soft); color: var(--warn); }
html[data-theme="dark"] .jg-job:hover { background: #1b221f; }
html[data-theme="dark"] .job-search,
html[data-theme="dark"] .job-filter-btn,
html[data-theme="dark"] .job-sort,
html[data-theme="dark"] .job-filter-popover { background: var(--surface); border-color: var(--line); color: var(--ink); }
html[data-theme="dark"] .job-filter-btn:hover,
html[data-theme="dark"] .job-filter-btn.is-open { background: var(--surface-2); border-color: #36403c; }
html[data-theme="dark"] .job-active-chip { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
html[data-theme="dark"] .job-plus { background: var(--surface-2); border-color: var(--line); color: var(--ink-2); }
html[data-theme="dark"] .job-plus.is-ghost { background: transparent; border-color: var(--line-2); color: var(--muted-2); }
html[data-theme="dark"] .job-overrides-row td,
html[data-theme="dark"] .job-overrides-panel { background: #121615; border-color: var(--line-2); }
html[data-theme="dark"] .override-detail__warning { background: var(--warn-soft); border-left-color: var(--warn); color: var(--warn); }
html[data-theme="dark"] .credit-total { color: var(--ink); }
html[data-theme="dark"] .credit-used { color: var(--bad); }
html[data-theme="dark"] .credit-left { color: var(--ok); }

/* 暗色：设置页、数据同步、数据推送、发布页 */
html[data-theme="dark"] .keys-hero { background: linear-gradient(180deg, #191f1d 0%, #151918 100%); border-color: var(--line); }
html[data-theme="dark"] .keys-hero__icon { border-color: var(--ok-line); background: var(--ok-soft); color: var(--green); }
html[data-theme="dark"] .keys-hero__title code,
html[data-theme="dark"] .keys-hero__key code { background: #1e2522; border-color: var(--line); color: var(--ink); }
html[data-theme="dark"] .keys-badge.is-ok { background: var(--ok-soft); color: var(--ok); }
html[data-theme="dark"] .keys-badge.is-fail { background: var(--bad-soft); color: var(--bad); }
html[data-theme="dark"] .keys-badge.is-unknown { background: #222926; color: var(--muted); }
html[data-theme="dark"] .keys-stat { background: var(--surface-2); border-color: var(--line); }
html[data-theme="dark"] .keys-stat.is-accent b { color: var(--green); }
html[data-theme="dark"] .keys-stat.is-warn { background: var(--bad-soft); border-color: var(--bad-line); }
html[data-theme="dark"] .keys-tabs { background: var(--surface-2); border-color: var(--line); }
html[data-theme="dark"] .keys-tabs button { color: var(--muted); }
html[data-theme="dark"] .keys-tabs button.is-on { background: var(--surface); color: var(--ink); }
html[data-theme="dark"] .keys-search input { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
html[data-theme="dark"] .release-banner { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
html[data-theme="dark"] .release-banner b { color: #fde68a; }
html[data-theme="dark"] .install-guide code { background: #1e2522; color: var(--ink); }
html[data-theme="dark"] .login-view { background: radial-gradient(860px 500px at 28% 30%, rgba(16, 185, 129, .14), transparent 66%), var(--canvas); }
html[data-theme="dark"] .login-card { background: var(--surface); border-color: var(--line); }
html[data-theme="dark"] .pill--hi { background: var(--ok-soft); color: var(--ok); }
html[data-theme="dark"] .pill--mid { background: var(--warn-soft); color: var(--warn); }
html[data-theme="dark"] .pill--low { background: var(--bad-soft); color: var(--bad); }
html[data-theme="dark"] .pill--none { background: var(--surface-2); color: var(--muted); }
html[data-theme="dark"] .high { color: var(--ok); }
html[data-theme="dark"] .mid { color: var(--warn); }
html[data-theme="dark"] .low { color: var(--bad); }
html[data-theme="dark"] .track { background: #252c29; }

@media (prefers-reduced-motion: reduce) {
  dialog.drawer, dialog.modal, dialog::backdrop, .toast { transition: none !important; animation: none !important; }
}

/* ═══════════════════════════════════════════════════════════════════
   候选人档案 2.0：清晰拆分 详情深评 / 列表初筛 / 简历快照 + MAX 抽屉
   ═══════════════════════════════════════════════════════════════════ */
.dir-typebar {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line);
  width: fit-content; margin-bottom: 10px;
}
.dir-tab {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px; border-radius: 7px; border: 0;
  background: transparent; color: var(--muted);
  font-size: 12.5px; font-weight: 560; cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.dir-tab:hover { color: var(--ink); }
.dir-tab b {
  font-size: 11px; font-weight: 650; padding: 1px 6px; border-radius: 999px;
  background: rgba(128, 128, 128, .12); color: inherit;
  font-variant-numeric: tabular-nums;
}
.dir-tab.is-active {
  background: var(--surface); color: var(--ink);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 0 0 1px var(--line);
}
.dir-tab.is-active b {
  background: var(--accent-soft); color: var(--green-strong);
}
.dir-subbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
}
.dir-subbar .frow { margin: 0; }
.rec__job-wrap {
  display: flex; align-items: center; gap: 6px; min-width: 0;
}
.rec__job-wrap .rec__job-text {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rec-badge--multi {
  flex: none; display: inline-flex; align-items: center;
  height: 20px; padding: 0 6px; border-radius: 6px;
  background: var(--max-soft, rgba(99, 102, 241, .1));
  color: var(--max-accent, #4f46e5);
  border: 1px solid var(--max-line, rgba(99, 102, 241, .24));
  font-size: 10.5px; font-weight: 650; white-space: nowrap;
}
.api-pill--max2 {
  background: var(--ok-soft, rgba(16, 185, 129, .12)) !important;
  color: var(--ok, #059669) !important;
  border-color: var(--ok-line, rgba(16, 185, 129, .28)) !important;
}
.rec__score-stack {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px;
}
.rec__list-stat {
  display: flex; flex-direction: column; gap: 2px; font-size: 12px;
}
.rec__list-stat b {
  font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums;
}
.rec__substat {
  font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.avatar--list {
  background: var(--max-soft, rgba(99, 102, 241, .12)) !important;
  color: var(--max-accent, #4f46e5) !important;
  font-size: 11px !important; font-weight: 700;
}

/* MAX 多岗详情抽屉：PK 对比矩阵 */
.max-pk-list { display: flex; flex-direction: column; gap: 6px; }
.max-pk-row {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) 44px 38px;
  align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 8px 10px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); cursor: pointer;
  transition: border-color .14s ease, background .14s ease;
}
.max-pk-row:hover { border-color: var(--accent-line); background: var(--surface-2); }
.max-pk-row.is-active {
  border-color: var(--green); background: var(--accent-soft);
}
.max-pk-rank {
  font-size: 11px; font-weight: 700; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.max-pk-main { display: flex; flex-direction: column; min-width: 0; }
.max-pk-main b { font-size: 13px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.max-pk-main small { font-size: 11.5px; color: var(--muted); }
.max-pk-delta {
  text-align: right; font-size: 11px; font-weight: 650; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.max-pk-row:first-child .max-pk-delta { color: var(--green-strong); }

/* MAX 列表初筛抽屉：统计条 + 候选人榜单卡片 */
.max-list-kpis {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px;
  margin-bottom: 10px;
}
.max-list-kpi {
  padding: 9px 11px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface-2);
  display: flex; flex-direction: column; gap: 2px;
}
.max-list-kpi span { font-size: 11px; color: var(--muted); }
.max-list-kpi b { font-size: 16px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.max-list-kpi.is-ok b { color: var(--green-strong); }
.max-list-cards { display: flex; flex-direction: column; gap: 10px; }
.max-list-card {
  padding: 11px 13px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface);
  display: flex; flex-direction: column; gap: 7px;
}
.max-list-card__head { display: flex; align-items: center; gap: 8px; }
.max-list-card__rank {
  font-size: 11px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums;
}
.max-list-card__jobs { display: flex; flex-wrap: wrap; gap: 5px; }
.max-job-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--surface-2);
  font-size: 11.5px; color: var(--ink-2);
}
.max-job-chip b { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.max-job-chip.is-best {
  border-color: var(--ok-line); background: var(--ok-soft); color: var(--green-strong);
}
.max-job-chip.is-best b { color: var(--green-strong); }
.max-list-card__reason { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--ink-2); }

/* 暗色主题兼容 */
html[data-theme="dark"] .dir-typebar { background: var(--surface-2); border-color: var(--line); }
html[data-theme="dark"] .dir-tab.is-active { background: #eef2ef; color: #111412; box-shadow: none; }
html[data-theme="dark"] .dir-tab.is-active b { background: rgba(17, 20, 18, .12); color: #111412; }
html[data-theme="dark"] .max-pk-row,
html[data-theme="dark"] .max-list-card { background: var(--surface-2); border-color: var(--line); }
html[data-theme="dark"] .max-pk-row.is-active { background: var(--accent-soft); border-color: var(--green); }
html[data-theme="dark"] .max-list-kpi { background: #121615; border-color: var(--line); }
html[data-theme="dark"] .max-job-chip { background: #121615; border-color: var(--line); }

/* ═══════════════════════════════════════════════════════════════════
   控制台 V4 统一视觉重构：候选人档案 · 岗位管理 · 公司管理 · 账号管理
   ═══════════════════════════════════════════════════════════════════ */
.v4-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 14px;
}
.v4-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); margin: 0; }
.v4-head p { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.v4-head .dir-typebar { margin-bottom: 0; }

/* 4-KPI 轻量指标条 */
.v4-stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px; margin-bottom: 14px;
}
.v4-stat {
  display: flex; flex-direction: column; gap: 3px;
  padding: 13px 16px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--card-shadow);
}
.v4-stat span { font-size: 12px; font-weight: 540; color: var(--muted); }
.v4-stat b {
  font-size: 22px; font-weight: 720; letter-spacing: -.03em; line-height: 1.2;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.v4-stat small { font-size: 11.5px; color: var(--muted-2); }
.v4-stat.is-ok b { color: var(--green-strong); }
.v4-stat.is-warn b { color: var(--warn); }
.v4-stat.is-accent b { color: var(--max-accent, #4f46e5); }

/* 统一主卡片与工具栏 */
.v4-surface { padding: 0 !important; overflow: hidden; }
.v4-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-2);
  background: var(--surface);
}
.v4-search {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; min-width: 210px; flex: 1 1 220px; max-width: 310px;
  padding: 0 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--muted);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.v4-search:focus-within {
  border-color: var(--green); background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.v4-search svg { width: 14px; height: 14px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; }
.v4-search input {
  width: 100%; border: 0; outline: 0; background: transparent;
  font-size: 12.5px; color: var(--ink);
}
.v4-filter-group {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px; height: 32px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.v4-seg {
  display: inline-flex; align-items: center; gap: 5px;
  height: 26px; padding: 0 10px; border: 0; border-radius: 6px;
  background: transparent; color: var(--muted);
  font-size: 12px; font-weight: 540; cursor: pointer; white-space: nowrap;
  transition: background .14s ease, color .14s ease, box-shadow .14s ease;
}
.v4-seg:hover { color: var(--ink); }
.v4-seg b { font-size: 11px; font-weight: 650; opacity: .72; font-variant-numeric: tabular-nums; }
.v4-seg.is-active {
  background: var(--surface); color: var(--ink);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08), 0 0 0 1px var(--line);
}
.v4-seg.is-active b { opacity: 1; color: var(--green-strong); }
.v4-select {
  height: 32px; padding: 0 26px 0 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font-size: 12px; font-weight: 520; cursor: pointer;
}
.v4-toolbar__end {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px;
}

/* 统一 V4 表格排版：呼吸感 + 2行可读 + 零错位 */
.v4-table-wrap { overflow-x: auto; }
.v4-table,
.dir-card .rec-list table.v4-table {
  width: 100% !important; min-width: 0 !important;
  border-collapse: collapse; table-layout: fixed;
}
.v4-table thead th {
  padding: 10px 12px; font-size: 11.5px; font-weight: 600;
  color: var(--muted); text-align: left; letter-spacing: .01em;
  background: var(--surface-2); border-bottom: 1px solid var(--line);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.v4-table thead th.r, .v4-table tbody td.r { text-align: right; }
.v4-table tbody tr.v4-row > th,
.v4-table tbody tr.v4-row > td {
  padding: 13px 12px; vertical-align: middle;
  border-bottom: 1px solid var(--line-2);
  font-size: 13px; color: var(--ink);
  overflow: hidden;
}
@media (min-width: 761px) {
  .v4-table tbody tr.v4-row > th:not(.headseek-col),
  .v4-table tbody tr.v4-row > td:not(.hs-link-cell):not(.headseek-col) {
    display: table-cell !important;
  }
}
.v4-table .hs-link-cell,
.v4-table .headseek-col { display: none !important; }
.v4-table tbody tr.v4-row:last-child > th,
.v4-table tbody tr.v4-row:last-child > td { border-bottom: 0; }
.v4-table tbody tr.v4-row:hover { background: color-mix(in srgb, var(--surface-2) 65%, transparent); }
.v4-table tbody tr.v4-row.is-disabled { opacity: .62; }

/* 候选人档案：用量单元格垂直紧凑堆叠，严禁撑破相邻列 */
.v4-usage-td { overflow: hidden; }
.v4-usage {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  min-width: 0; max-width: 100%;
}
.v4-usage .rec__credits {
  display: inline-flex; align-items: baseline; gap: 2px;
  height: 21px; padding: 0 7px; border-radius: 5px;
  background: var(--surface-2); border: 1px solid var(--line-2);
  font-size: 11.5px; color: var(--ink); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.v4-usage .rec__credits b { font-weight: 680; }
.v4-usage .rec__credits small { font-size: 10px; color: var(--muted); }
.v4-usage__tok {
  display: block; max-width: 100%;
  font-size: 11px; line-height: 1.35; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.v4-usage.is-cache .rec__credits { background: var(--surface-2); color: var(--muted); }
.v4-usage.is-cache .v4-usage__tok { color: var(--muted-2); }

/* 公司管理：超长城市标签单行省略，绝不覆盖右侧列 */
.v4-city-tag {
  display: inline-block; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  vertical-align: middle;
}

/* 候选人档案专用单元格 */
.v4-job-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.v4-job-cell__title {
  font-size: 13px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.v4-job-cell__sub {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  font-size: 11.5px; color: var(--muted);
}
.v4-job-cell__sub > span:first-child {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.v4-verdict { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0; }
.v4-verdict__text {
  margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  word-break: break-word;
}
.v4-actor { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 3px; max-width: 100%; }
.v4-actor b { font-size: 12.5px; font-weight: 560; color: var(--ink); max-width: 100%; }
.v4-actor span.mono { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* 实体身份单元格（公司/账号通用） */
.v4-entity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.v4-entity__copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.v4-entity__name {
  font-size: 13px; font-weight: 620; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.v4-entity__sub {
  font-size: 11.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.v4-clamp-2 {
  margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* 岗位管理分组卡片 V4 */
#jobsView .job-groups { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.v4-company-group {
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: var(--surface);
}
.v4-company-head {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; background: var(--surface-2);
  border-bottom: 1px solid var(--line-2); cursor: pointer;
}
.v4-company-head__copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.v4-company-head__top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.v4-company-head__intro {
  margin: 0; font-size: 12px; line-height: 1.45; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.v4-job-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 16px !important;
  border-bottom: 1px solid var(--line-2);
}
.v4-job-row:last-child { border-bottom: 0; }
.v4-job-row__main { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.v4-job-title-btn {
  align-self: flex-start; border: 0; padding: 0; background: transparent;
  font-size: 13.5px; font-weight: 600; color: var(--ink); text-align: left;
  cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.v4-job-title-btn:hover { color: var(--green-strong); }
.v4-job-row__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.v4-live-dot {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 560; color: var(--green-strong);
}
.v4-live-dot i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.v4-meta-txt { font-size: 11.5px; color: var(--muted); }
.v4-job-row__right { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.v4-pill-btn {
  display: inline-flex; align-items: center; height: 24px; padding: 0 9px;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink-2);
  font-size: 11.5px; font-weight: 560; cursor: pointer; white-space: nowrap;
  transition: border-color .14s ease, background .14s ease, color .14s ease;
}
.v4-pill-btn.is-accent {
  background: var(--accent-soft); border-color: var(--accent-line); color: var(--green-strong);
}
.v4-pill-btn:hover { filter: brightness(.96); }
.v4-muted-chip { font-size: 11.5px; color: var(--muted-2); white-space: nowrap; }

/* 账号管理：身份 + 可视化积分条 + 永不换行的操作栏 */
.v4-user-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.v4-role-pill {
  flex: none; display: inline-flex; align-items: center; height: 18px; padding: 0 6px;
  border-radius: 5px; font-size: 10.5px; font-weight: 600;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
}
.v4-role-pill.is-admin {
  background: var(--max-soft, rgba(99, 102, 241, .1));
  color: var(--max-accent, #4f46e5); border-color: var(--max-line, rgba(99, 102, 241, .24));
}
.v4-status-dot {
  flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--green);
}
.v4-status-dot.is-off { background: var(--bad); }
.v4-ver-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.v4-ver-cell__api { font-size: 11px; color: var(--muted); }
.v4-credit { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.v4-credit__top { display: flex; align-items: baseline; gap: 4px; font-size: 12px; font-variant-numeric: tabular-nums; }
.v4-credit__top b { font-size: 13px; font-weight: 680; color: var(--ink); }
.v4-credit__top span { color: var(--muted); font-size: 11.5px; }
.v4-credit__top em {
  margin-left: auto; font-style: normal; font-size: 10.5px; font-weight: 650;
  padding: 1px 5px; border-radius: 4px;
  background: var(--warn-soft); color: var(--warn);
}
.v4-credit__track {
  height: 5px; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--line-2); overflow: hidden;
}
.v4-credit__track i { display: block; height: 100%; border-radius: 999px; transition: width .25s ease; }
.v4-credit__track i.is-ok { background: var(--green); }
.v4-credit__track i.is-warn { background: var(--warn); }
.v4-credit__track i.is-bad { background: var(--bad); }
.v4-credit__sub { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

.v4-actions {
  display: inline-flex; align-items: center; justify-content: flex-end;
  gap: 6px; flex-wrap: nowrap; white-space: nowrap;
}
.v4-action-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 26px; padding: 0 9px; border-radius: 7px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); font-size: 12px; font-weight: 540;
  cursor: pointer; white-space: nowrap;
  transition: border-color .14s ease, background .14s ease, color .14s ease;
}
.v4-action-btn:hover { border-color: var(--accent-line); background: var(--accent-soft); color: var(--green-strong); }

/* 精致克制的待审批临时额度卡片（替代刺眼黄底） */
.v4-credit-queue {
  margin: 0 0 14px !important; padding: 14px 16px !important;
  border-radius: 12px !important;
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  border-left: 3px solid var(--warn) !important;
  box-shadow: var(--card-shadow);
}
.v4-credit-queue .credit-queue__row {
  background: var(--surface-2) !important;
  border: 1px solid var(--line-2) !important;
  border-radius: 9px !important;
}

/* 暗色主题全面适配 V4 */
html[data-theme="dark"] .v4-stat,
html[data-theme="dark"] .v4-toolbar,
html[data-theme="dark"] .v4-company-group,
html[data-theme="dark"] .v4-select,
html[data-theme="dark"] .v4-action-btn,
html[data-theme="dark"] .v4-credit-queue {
  background: var(--surface) !important; border-color: var(--line) !important; color: var(--ink);
}
html[data-theme="dark"] .v4-credit-queue { border-left-color: var(--warn) !important; }
html[data-theme="dark"] .v4-search,
html[data-theme="dark"] .v4-filter-group,
html[data-theme="dark"] .v4-company-head,
html[data-theme="dark"] .v4-table thead th,
html[data-theme="dark"] .v4-credit__track,
html[data-theme="dark"] .v4-credit-queue .credit-queue__row {
  background: var(--surface-2) !important; border-color: var(--line) !important;
}
html[data-theme="dark"] .v4-seg.is-active {
  background: #eef2ef; color: #111412; box-shadow: none;
}
html[data-theme="dark"] .v4-seg.is-active b { color: #111412; }
html[data-theme="dark"] .v4-table tbody tr.v4-row:hover { background: rgba(255, 255, 255, .03); }
html[data-theme="dark"] .v4-action-btn:hover { background: var(--accent-soft) !important; border-color: var(--accent-line) !important; color: var(--green) !important; }

@media (max-width: 960px) {
  .v4-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
