:root {
  --bg: #f1efe7;
  --panel: #fffdf8;
  --panel-soft: #f8f6ef;
  --ink: #17211d;
  --muted: #6d7972;
  --line: #ddd9cd;
  --line-strong: #c8c3b5;
  --accent: #0d5b4f;
  --accent-deep: #093f37;
  --accent-soft: #e3eee9;
  --amber: #b86a2b;
  --amber-soft: #f8eadc;
  --danger: #ad463b;
  --danger-soft: #f7e5e1;
  --ok: #2f7559;
  --ok-soft: #e3efe8;
  --sidebar: #12231e;
  --sidebar-ink: #eef2e8;
  --sidebar-muted: #9bb0a4;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(23, 33, 29, .05), 0 8px 24px rgba(23, 33, 29, .045);
  --numeric: "SF Mono", "Cascadia Mono", "Roboto Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans", "Avenir Next", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 13.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-underline-offset: 2px; }
code { font-family: var(--numeric); font-size: .92em; }
h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }

.app-body { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100vh; }

/* ---- rail ---- */
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow: auto;
  display: flex; flex-direction: column; gap: 22px;
  padding: 22px 14px 18px;
  background: var(--sidebar); color: var(--sidebar-ink);
  border-right: 1px solid rgba(255,255,255,.08);
}
.side-brand { display: flex; align-items: center; gap: 11px; padding: 0 6px 4px; }
.brand-mark {
  width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto;
  border: 1px solid rgba(238,242,232,.45); border-radius: 7px;
  font-size: 13px; font-weight: 800; letter-spacing: -.04em; color: var(--sidebar-ink);
}
.brand-copy { display: grid; gap: 1px; min-width: 0; }
.brand-copy strong { font-size: 14px; letter-spacing: .01em; }
.brand-copy small { font-size: 11px; color: var(--sidebar-muted); letter-spacing: .04em; }
.side-label {
  padding: 0 10px; color: var(--sidebar-muted); font-size: 10px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
}
.side-nav { display: grid; gap: 2px; }
.tab {
  width: 100%; display: flex; align-items: center; gap: 10px;
  border: 1px solid transparent; background: transparent; color: var(--sidebar-muted);
  padding: 9px 10px; border-radius: 7px; text-align: left; font-size: 12.5px; font-weight: 600;
}
.tab-num { width: 21px; color: #678378; font-family: var(--numeric); font-size: 10px; letter-spacing: .04em; }
.tab:hover { color: var(--sidebar-ink); background: rgba(238,242,232,.06); }
.tab.active { color: var(--sidebar-ink); background: rgba(238,242,232,.11); border-color: rgba(238,242,232,.10); }
.tab.active .tab-num { color: #d6a777; }
.side-footer {
  margin-top: auto; padding: 13px 10px 2px; border-top: 1px solid rgba(238,242,232,.13);
  display: grid; gap: 7px;
}
.env-line { display: flex; align-items: center; gap: 7px; font-size: 10.5px; font-weight: 700; color: #c6d1c4; letter-spacing: .04em; }
.env-dot { width: 6px; height: 6px; border-radius: 50%; background: #d4a264; box-shadow: 0 0 0 3px rgba(212,162,100,.13); }
.side-footer p { color: var(--sidebar-muted); font-size: 11px; line-height: 1.55; }
.side-link {
  justify-self: start; border: 0; background: transparent; color: #c3d2c7; padding: 0;
  font-size: 11px; font-weight: 650; text-decoration: underline; text-underline-offset: 3px;
}

/* ---- main header ---- */
.main { min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 13px 30px 11px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.page-identity { display: grid; gap: 2px; }
.eyebrow, .section-kicker {
  color: var(--amber); font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
}
.topbar h1 { font-size: 21px; line-height: 1.2; letter-spacing: -.035em; font-weight: 700; }
.top-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.role-badge {
  color: var(--muted); border: 1px solid var(--line); padding: 5px 9px; border-radius: 4px;
  font-size: 11px; font-weight: 650; background: var(--panel-soft);
}
.btn {
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink);
  padding: 7px 11px; border-radius: 6px; font-weight: 650; font-size: 12px; line-height: 1.3;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-deep); color: #fff; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .45; cursor: wait; }
.btn:focus-visible, .tab:focus-visible, .snapshot-chip:focus-visible, .quick-card:focus-visible {
  outline: 2px solid var(--amber); outline-offset: 2px;
}

.status-strip {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  min-height: 32px; padding: 5px 30px; background: var(--panel-soft);
  border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11.5px;
}
.snapshot-chip {
  border: 1px solid var(--line); border-radius: 4px; padding: 3px 7px;
  background: var(--panel); color: var(--ink); font-family: var(--numeric); font-size: 10.5px;
  max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.snapshot-chip:hover { border-color: var(--accent); color: var(--accent); }
.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px;
  border: 1px solid var(--line); border-radius: 3px; white-space: nowrap;
  background: var(--panel-soft); color: var(--muted); font-size: 10px; font-weight: 750;
}
.pill.warn { background: var(--amber-soft); border-color: #e8cfb4; color: #865123; }
.pill.ok { background: var(--ok-soft); border-color: #c9dfd1; color: var(--ok); }
.pill.danger { background: var(--danger-soft); border-color: #ebc8c0; color: var(--danger); }
.pill.neutral { background: #f0eee7; border-color: var(--line); color: #5e6962; }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }

.shell { max-width: 1430px; margin: 0 auto; padding: 14px 30px 64px; }
.page-head {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr); gap: 30px;
  align-items: end; padding: 0 0 12px;
}
.page-head h2 { font-size: clamp(20px, 2vw, 25px); line-height: 1.2; letter-spacing: -.045em; font-weight: 700; margin-top: 2px; }
.lead { color: var(--muted); margin-top: 4px; max-width: 790px; font-size: 12px; line-height: 1.55; }
.hero-meta {
  display: grid; grid-template-columns: 1fr; gap: 0; align-self: stretch;
  border-left: 1px solid var(--line); padding-left: 14px;
}
.hero-meta-row {
  display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 8px;
  padding: 3px 0; border-bottom: 1px solid #ebe7dd; font-size: 10px;
}
.hero-meta-row:last-child { border-bottom: 0; }
.hero-meta-row strong { font-family: var(--numeric); font-weight: 500; overflow-wrap: anywhere; text-align: right; font-size: 10.5px; }
.warning {
  border: 1px solid #e7cfb4; border-left: 3px solid var(--amber); background: #fcf4e9;
  color: #6c4b29; border-radius: 5px; padding: 7px 10px; margin: 0 0 12px;
  font-size: 10.5px; line-height: 1.5;
}
.warning::before { content: "口径提示  "; font-weight: 800; letter-spacing: .04em; color: #8b5a2b; }

.action-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin: 0 0 18px; }
.quick-card {
  border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius);
  padding: 11px 13px; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px;
  text-align: left; box-shadow: var(--shadow);
}
.quick-card:hover { border-color: var(--accent); }
.quick-card .quick-label { color: var(--muted); font-size: 11px; font-weight: 650; }
.quick-card .quick-value { grid-row: 1 / span 2; grid-column: 2; font-family: var(--numeric); font-size: 23px; line-height: 1; align-self: center; color: var(--ink); }
.quick-card .quick-note { color: var(--muted); font-size: 10.5px; }
.quick-card.danger .quick-value { color: var(--danger); }
.quick-card.warn .quick-value { color: var(--amber); }
.quick-card.all { background: var(--accent); border-color: var(--accent); color: #fff; }
.quick-card.all .quick-label, .quick-card.all .quick-note { color: #d6e6dc; }
.quick-card.all .quick-value { color: #fff; }

.section { margin: 0 0 12px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 8px; }
.section-head h3 { font-size: 13px; letter-spacing: -.01em; font-weight: 750; }
.section-note { color: var(--muted); font-size: 10.5px; margin-top: 2px; }
.section-meta { color: var(--muted); font-family: var(--numeric); font-size: 10.5px; }
.cohort-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.cohort-card {
  text-align: left; border: 1px solid var(--line); background: var(--panel);
  border-radius: 8px; padding: 7px 9px; min-height: 92px;
  box-shadow: none; transition: border-color .12s, background .12s;
}
.cohort-card:hover { border-color: #aabbb2; background: #fffefa; }
.cohort-card.active { border-color: var(--accent); background: #f6fbf8; box-shadow: inset 0 -2px 0 var(--accent); }
.cohort-top { display: flex; justify-content: space-between; align-items: center; gap: 4px; margin-bottom: 8px; flex-wrap: wrap; }
.cohort-total { font-family: var(--numeric); font-size: 20px; font-weight: 500; letter-spacing: -.04em; }
.cohort-card h4 { font-size: 11px; line-height: 1.35; min-height: 29px; font-weight: 650; color: #34423b; }
.cohort-denom { font-size: 10px; color: var(--muted); margin-top: 3px; line-height: 1.35; }
.cohort-foot { font-size: 9.5px; color: var(--muted); margin-top: 6px; padding-top: 5px; border-top: 1px solid #efebe1; line-height: 1.35; }
.selected-badge { font-size: 8px; font-weight: 800; color: var(--accent); background: var(--accent-soft); border-radius: 2px; padding: 1px 4px; margin-left: auto; }

.active-context {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  border: 1px solid #d8e2da; background: #eff6f1; border-radius: 5px;
  padding: 5px 9px; margin: 7px 0 0; font-size: 10px;
}
.active-context-main { font-weight: 750; color: var(--accent-deep); }
.active-context-detail { color: #5e7568; }

.kpi-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; margin: 8px 0 12px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-height: 73px; box-shadow: var(--shadow); }
.kpi:first-child { background: var(--accent); border-color: var(--accent); color: #fff; }
.kpi-label { display: block; font-size: 9.5px; color: var(--muted); font-weight: 700; letter-spacing: .02em; }
.kpi:first-child .kpi-label { color: #cfe1d6; }
.kpi-value { display: block; font-family: var(--numeric); font-size: 23px; font-weight: 500; letter-spacing: -.05em; margin: 4px 0 1px; line-height: 1; }
.kpi-sub { display: block; font-size: 9px; color: var(--muted); line-height: 1.3; }
.kpi:first-child .kpi-sub { color: #cfe1d6; }
.kpi:first-child .kpi-value { color: #fff; }

.charts-layout { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, .95fr) minmax(0, 1.35fr); gap: 9px; margin-bottom: 10px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 12px; min-width: 0; box-shadow: var(--shadow); }
.panel-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 7px; }
.panel-head h3 { font-size: 12px; font-weight: 750; letter-spacing: -.01em; }
.panel-sub { display: block; color: var(--muted); font-size: 9px; margin-top: 1px; }
.panel-tools { display: flex; gap: 6px; }
.chart-body { min-height: 142px; }
.chart-panel { min-height: 186px; }
.trend-panel { min-height: 186px; }

.donut-wrap { display: grid; grid-template-columns: 148px minmax(0, 1fr); align-items: center; gap: 4px; }
.donut { width: 148px; height: 148px; overflow: visible; }
.donut-track { fill: none; stroke: #efebe1; stroke-width: 17; }
.donut-seg { fill: none; stroke-width: 17; stroke-linecap: butt; }
.donut-center { font-family: var(--numeric); font-size: 20px; fill: var(--ink); font-weight: 500; }
.donut-center-label { font-size: 9px; fill: var(--muted); }
.donut-legend { display: grid; gap: 6px; }
.legend-row { display: grid; grid-template-columns: 7px minmax(0, 1fr) auto; gap: 7px; align-items: center; font-size: 10.5px; }
.legend-button { border: 0; background: transparent; width: 100%; padding: 0; text-align: left; color: inherit; font: inherit; }
.legend-button:hover .legend-label { color: var(--accent); }
.legend-dot { width: 7px; height: 7px; border-radius: 1px; }
.legend-label { color: #45534b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-value { color: var(--muted); font-family: var(--numeric); font-size: 10px; }

.stack-bar { display: flex; height: 17px; width: 100%; border-radius: 3px; overflow: hidden; background: #efebe1; margin: 8px 0 15px; }
.stack-seg { height: 100%; min-width: 2px; }
.stack-legend { display: grid; gap: 7px; }
.stack-legend .legend-row { grid-template-columns: 7px minmax(0, 1fr) auto auto; }
.stack-pct { color: var(--muted); font-family: var(--numeric); font-size: 9.5px; }

.trend-svg { width: 100%; height: 142px; overflow: visible; }
.trend-grid { stroke: #ece8de; stroke-width: 1; }
.trend-area { fill: #e8f0e9; opacity: .75; }
.trend-line { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linejoin: round; }
.trend-dot { fill: var(--panel); stroke: var(--accent); stroke-width: 1.5; }
.trend-label { fill: #7a857e; font-size: 8px; font-family: var(--numeric); }
.trend-axis { fill: #8b958e; font-size: 7px; }
.trend-value { fill: #445249; font-size: 8px; font-family: var(--numeric); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 0 0 9px; }
.notes { margin: 0; padding-left: 16px; color: #4f5e55; font-size: 10.5px; display: grid; gap: 6px; line-height: 1.55; }
.notes.warn-list { color: #855c36; }
.quality-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(94px, 1fr)); gap: 5px; }
.quality-cell { border: 1px solid #ece8de; background: var(--panel-soft); border-radius: 5px; padding: 7px 8px; display: grid; gap: 1px; }
.quality-cell .muted { font-size: 9.5px; }
.quality-cell strong { font-family: var(--numeric); font-size: 15px; font-weight: 500; letter-spacing: -.02em; }
.warn-text { grid-column: 1 / -1; margin: 4px 0 0; color: var(--amber); font-size: 10px; }

.tab-panel { display: grid; gap: 9px; }
.filters { display: flex; flex-wrap: wrap; gap: 7px 9px; align-items: end; padding: 9px; background: var(--panel-soft); border: 1px solid #ece8de; border-radius: 5px; margin-bottom: 9px; }
.filters label { display: grid; gap: 3px; font-size: 9.5px; color: var(--muted); font-weight: 700; }
.filters input, .filters select {
  border: 1px solid var(--line-strong); border-radius: 4px; padding: 5px 7px;
  background: var(--panel); color: var(--ink); min-width: 104px; font-size: 11px;
}
.filters .grow { flex: 1 1 180px; }
.filters .grow input { width: 100%; }
.filters .check { display: flex; flex-direction: row; align-items: center; gap: 5px; white-space: nowrap; font-size: 10px; color: var(--muted); padding-bottom: 6px; }
.filters .check input { width: auto; min-width: 0; accent-color: var(--accent); }
.table-wrap { overflow: auto; border: 1px solid #e8e4d9; border-radius: 5px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 11px; min-width: 780px; }
.data-table th {
  position: sticky; top: 0; z-index: 1; text-align: left; background: var(--panel-soft); color: #606d65;
  font-size: 9.5px; font-weight: 750; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.data-table td { padding: 7px 8px; border-bottom: 1px solid #efebe1; vertical-align: top; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr.clickable { cursor: pointer; }
.data-table tr.clickable:hover td { background: #f6fbf8; }
.data-table td:nth-child(10), .data-table td:nth-child(8) { max-width: 320px; }
.type { font-weight: 700; white-space: nowrap; }
.type.blue { color: #1f6d60; }
.type.red { color: #7a4d6d; }
.type.teal { color: #95672d; }
.type.purple { color: #6d5d91; }
.type.grey { color: #6d7972; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 8px; }
.pager-actions { display: flex; gap: 5px; }

.diff-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(115px, 1fr)); gap: 5px; margin: 9px 0; }
.diff-total { border: 1px solid #ece8de; border-radius: 5px; padding: 7px 8px; display: grid; gap: 1px; }
.diff-total .muted { font-size: 9.5px; }
.diff-total strong { font-family: var(--numeric); font-size: 16px; font-weight: 500; letter-spacing: -.02em; }
.source-list { display: grid; gap: 3px; }
.source-row { display: grid; grid-template-columns: 118px minmax(0, 1fr) auto; gap: 9px; align-items: baseline; border-bottom: 1px solid #efebe1; padding: 6px 0; font-size: 10.5px; }
.source-row:last-child { border-bottom: 0; }
.source-row strong { color: #45534b; font-weight: 700; }
.source-row code { overflow-wrap: anywhere; color: #66736b; font-size: 9.5px; }
.kv { display: grid; gap: 4px; }
.kv-row { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 8px; font-size: 10.5px; align-items: baseline; padding: 3px 0; border-bottom: 1px solid #f1ede4; }
.kv-row:last-child { border-bottom: 0; }
.kv-row strong { font-weight: 600; overflow-wrap: anywhere; font-family: var(--numeric); font-size: 10px; }
.gate-list { display: grid; gap: 2px; }
.gate-row { display: grid; grid-template-columns: 42px 128px minmax(0, 1fr); gap: 8px; padding: 5px 0; border-bottom: 1px solid #efebe1; font-size: 10.5px; }
.gate-row:last-child { border-bottom: 0; }
.gate-row strong { color: var(--accent); font-family: var(--numeric); font-size: 9.5px; }

/* fallback renderer */
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(62px, 38%) 1fr auto; gap: 7px; align-items: center; font-size: 10.5px; }
.bar-label { color: #45534b; overflow-wrap: anywhere; }
.bar-value { color: var(--muted); font-family: var(--numeric); text-align: right; min-width: 26px; }
.bar-progress { width: 100%; height: 7px; border: 0; border-radius: 2px; background: #efebe1; overflow: hidden; appearance: none; }
.bar-progress::-webkit-progress-bar { background: #efebe1; }
.bar-progress::-webkit-progress-value { background: var(--accent); }
.bar-progress::-moz-progress-bar { background: var(--accent); }

.toast {
  position: fixed; right: 18px; bottom: 18px; z-index: 50; max-width: min(440px, calc(100vw - 36px));
  background: var(--sidebar); color: var(--sidebar-ink); padding: 9px 12px; border-radius: 5px;
  box-shadow: 0 12px 30px rgba(23,33,29,.22); font-size: 11px;
}
.toast.danger { background: #5f2924; }
.drawer { position: fixed; inset: 0; z-index: 40; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(18,35,30,.26); }
.drawer-panel {
  position: absolute; top: 0; right: 0; height: 100%; width: min(560px, 95vw);
  background: var(--panel); border-left: 1px solid var(--line);
  box-shadow: -18px 0 42px rgba(23,33,29,.10); display: flex; flex-direction: column;
}
.drawer-head { display: flex; justify-content: space-between; align-items: start; padding: 15px 17px; border-bottom: 1px solid var(--line); }
.drawer-kicker { color: var(--amber); font-size: 9px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.drawer-head h3 { font-size: 15px; margin-top: 1px; letter-spacing: -.02em; }
.drawer-body { overflow: auto; padding: 13px 17px 30px; display: grid; gap: 0; }
.drawer-row { display: grid; grid-template-columns: 145px minmax(0, 1fr); gap: 10px; font-size: 10.5px; border-bottom: 1px solid #efebe1; padding: 6px 0; }
.drawer-key { color: var(--muted); font-weight: 650; }
.drawer-value { overflow-wrap: anywhere; white-space: pre-wrap; line-height: 1.5; }
.drawer-link { display: inline-block; margin-top: 12px; font-size: 11px; font-weight: 650; }
.drawer-body .btn { margin-top: 12px; justify-self: start; }

.login-page {
  min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(410px, .95fr);
  background: var(--panel); padding: 0;
}
.login-story {
  background: var(--sidebar); color: var(--sidebar-ink); padding: clamp(30px, 5vw, 72px);
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
}
.login-story .brand-mark { width: 42px; height: 42px; }
.login-story .brand-copy strong { font-size: 16px; }
.login-story .brand-copy small { color: var(--sidebar-muted); }
.login-story-main { max-width: 520px; }
.login-story h1 { font-size: clamp(26px, 3.6vw, 42px); line-height: 1.12; letter-spacing: -.05em; font-weight: 650; margin: 18px 0 12px; }
.login-story p { color: #bacbc0; font-size: 13px; line-height: 1.7; }
.login-principles { display: grid; gap: 9px; margin-top: 28px; padding-top: 16px; border-top: 1px solid rgba(238,242,232,.14); }
.login-principle { display: grid; grid-template-columns: 24px 1fr; gap: 8px; color: #c9d7cc; font-size: 11.5px; }
.login-principle b { color: #d9aa73; font-family: var(--numeric); font-size: 10px; font-weight: 500; }
.login-foot { color: #738d80; font-size: 10.5px; }
.login-side { display: grid; place-items: center; padding: 32px; background: var(--bg); }
.login-card { width: min(390px, 100%); }
.login-card h2 { font-size: 23px; letter-spacing: -.04em; }
.login-card > .muted { margin-top: 5px; font-size: 12px; }
.login-form { display: grid; gap: 9px; margin: 26px 0 12px; }
.login-form label { font-size: 10.5px; font-weight: 750; color: #536159; }
.login-form input { border: 1px solid var(--line-strong); border-radius: 5px; padding: 11px 12px; background: var(--panel); color: var(--ink); font-size: 14px; letter-spacing: .03em; }
.login-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.login-form .btn { margin-top: 5px; padding: 11px; font-size: 13px; }
.login-help { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 12px; color: var(--muted); font-size: 10.5px; line-height: 1.6; }
.form-error { color: var(--danger); font-size: 11px; min-height: 17px; margin: 0; }

@media (max-width: 1180px) {
  .app-body { grid-template-columns: 190px minmax(0, 1fr); }
  .cohort-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .charts-layout { grid-template-columns: 1fr 1fr; }
  .trend-panel { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .app-body { display: block; }
  .sidebar { position: static; height: auto; padding: 13px 16px; gap: 12px; }
  .side-label { display: none; }
  .side-nav { display: flex; overflow-x: auto; gap: 3px; padding-bottom: 2px; }
  .tab { width: auto; white-space: nowrap; padding: 7px 9px; }
  .tab-num { display: none; }
  .side-footer { display: none; }
  .topbar { padding: 14px 18px; }
  .status-strip { padding: 7px 18px; }
  .shell { padding: 17px 18px 48px; }
  .page-head { grid-template-columns: 1fr; gap: 16px; }
  .hero-meta { border-left: 0; border-top: 1px solid var(--line); padding: 10px 0 0; grid-template-columns: 1fr 1fr; column-gap: 18px; }
  .cohort-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .two-col { grid-template-columns: 1fr; }
  .chart-panel { min-height: 200px; }
  .login-page { grid-template-columns: 1fr; }
  .login-story { padding: 28px 24px; gap: 24px; }
  .login-story h1 { font-size: 28px; }
  .login-principles { display: none; }
  .login-side { padding: 28px 22px 46px; }
}
@media (max-width: 600px) {
  .topbar { align-items: flex-start; }
  .topbar h1 { font-size: 19px; }
  .top-actions { gap: 5px; }
  .role-badge { display: none; }
  .cohort-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .charts-layout { grid-template-columns: 1fr; }
  .donut-wrap { grid-template-columns: 132px minmax(0, 1fr); }
  .donut { width: 132px; height: 132px; }
  .hero-meta { grid-template-columns: 1fr; }
  .source-row { grid-template-columns: 1fr; gap: 1px; }
  .gate-row { grid-template-columns: 38px minmax(0, 1fr); }
  .gate-row .muted { grid-column: 2; }
  .drawer-row { grid-template-columns: 110px minmax(0, 1fr); }
  .login-story { padding: 25px 20px; }
  .login-side { padding: 24px 20px 40px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
/* ---- P6 今日需处理（真实未回复/超时队列） ---- */
.queue-section { margin-top: 16px; }
.queue-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.queue-list { display: grid; gap: 8px; }
.queue-row {
  width: 100%; display: grid; grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 12px; align-items: center; text-align: left;
  padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--amber);
  border-radius: 8px; background: var(--panel); color: var(--ink);
  transition: border-color .15s ease, background .15s ease;
}
.queue-row:hover { border-color: var(--line-strong); background: var(--panel-soft); }
.queue-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.queue-status {
  justify-self: start; border-radius: 999px; padding: 3px 7px;
  font-size: 10px; font-weight: 800; letter-spacing: .03em; white-space: nowrap;
  background: var(--amber-soft); color: var(--amber);
}
.queue-status.danger { background: var(--danger-soft); color: var(--danger); }
.queue-body { min-width: 0; display: grid; gap: 2px; }
.queue-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.queue-meta-line { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
.queue-next { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-size: 11px; }
.queue-cta { color: var(--accent); font-size: 11px; font-weight: 750; white-space: nowrap; }
.queue-empty { padding: 12px; border: 1px dashed var(--line-strong); border-radius: 8px; color: var(--muted); }
@media (max-width: 760px) {
  .queue-row { grid-template-columns: 62px minmax(0, 1fr); }
  .queue-cta { grid-column: 2; justify-self: start; }
}

/* P6 切换非总览页时，先隐藏总览专属块，避免“标题已切换、内容仍是总览” */
body.tab-nonoverview .page-head,
body.tab-nonoverview #kpi-grid,
body.tab-nonoverview #queue-panel,
body.tab-nonoverview .cohort-section,
body.tab-nonoverview #active-context,
body.tab-nonoverview .charts-layout {
  display: none;
}

/* P6 今日需处理：保持原视觉，强化行动入口 */
.queue-section {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  border-radius: 8px;
  background: var(--panel);
}
.queue-section .section-head { margin-bottom: 7px; }
.queue-section .section-head h3 { font-size: 15px; }
.queue-count {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 800;
  font-size: 10.5px;
}
