/* ==========================================================================
   个金客户管理分析平台 · AI 智能化升级
   Design system: paper + ink. Dense financial reporting UI.
   ========================================================================== */

:root {
  --paper: #faf9f6;
  --paper-2: #f5f3ed;
  --surface: #ffffff;
  --ink: #161a20;
  --ink-2: #39404a;
  --ink-3: #4d5561;
  --muted: #5f6771;
  --faint: #68707b;
  --line: #e5e1d7;
  --line-2: #efece4;
  --line-3: #f6f4ee;

  --rail: #0f161e;
  --rail-2: #18212b;
  --rail-3: #212c38;
  --rail-line: #26313d;
  --rail-text: #a8b3bf;

  --brand: #1b3a57;
  --brand-hover: #142d45;
  --brand-soft: #eef2f6;
  --up: #a32b24;
  --up-soft: #fbeeec;
  --down: #17705a;
  --down-soft: #ecf4f0;
  --warn: #8a5a12;
  --warn-soft: #faf2e4;
  --focus: #2f6ea5;
  --gold: #b08a4a;

  --r: 3px;
  --r-lg: 4px;
  --sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Source Han Sans SC",
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Songti SC", "Noto Serif SC", "SimSun", "STSong", serif;
  --mono: "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace;

  --rail-w: 212px;
  --top-h: 56px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4, p, figure, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
svg { display: block; }
img { max-width: 100%; }

::selection { background: #dfe6ee; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

.rail :focus-visible { outline-color: #fff; }

.skip {
  position: fixed; top: -48px; left: 12px; z-index: 200;
  background: var(--ink); color: #fff; padding: 8px 14px; border-radius: var(--r);
  font-size: 12px; transition: top 0.15s var(--ease);
}
.skip:focus { top: 12px; text-decoration: none; }

/* ---------------------------------------------------------------- shell */
.shell { display: flex; min-height: 100vh; }

.rail {
  position: fixed; inset: 0 auto 0 0; width: var(--rail-w); z-index: 60;
  background: var(--rail); color: var(--rail-text);
  display: flex; flex-direction: column;
  border-right: 1px solid #0b1117;
}

.rail__brand {
  display: flex; align-items: center; gap: 10px;
  height: var(--top-h); padding: 0 16px; flex: 0 0 auto;
  border-bottom: 1px solid var(--rail-line);
}
.rail__brand:hover { text-decoration: none; }
.rail__brand > span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rail__mark {
  width: 24px; height: 24px; flex: 0 0 auto; color: #e8edf2;
}
.rail__name {
  font-size: 12.5px; font-weight: 600; color: #f2f5f8; letter-spacing: 0.02em;
  line-height: 1.25; white-space: nowrap;
}
.rail__sub {
  font-size: 9.5px; color: #8493a1; letter-spacing: 0.12em; line-height: 1.4;
  text-transform: uppercase;
}

.rail__scroll { flex: 1 1 auto; overflow-y: auto; padding: 14px 0 10px; scrollbar-width: thin; }
.rail__scroll::-webkit-scrollbar { width: 6px; }
.rail__scroll::-webkit-scrollbar-thumb { background: #2c3946; border-radius: 3px; }

.nav__group { padding: 0 0 14px; }
.nav__label {
  padding: 0 16px 6px; font-size: 9.5px; letter-spacing: 0.14em;
  color: #8b99a7; text-transform: uppercase;
}
.nav__item {
  position: relative; display: flex; align-items: center; gap: 9px;
  height: 34px; padding: 0 14px 0 16px;
  color: var(--rail-text); font-size: 12.5px; letter-spacing: 0.01em;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.nav__item:hover { background: rgba(255, 255, 255, 0.045); color: #eef2f6; text-decoration: none; }
.nav__item .i { width: 15px; height: 15px; opacity: 0.66; flex: 0 0 auto; }
.nav__item.is-active { background: var(--rail-2); color: #fff; }
.nav__item.is-active .i { opacity: 0.95; color: #fff; }
.nav__item.is-active::before {
  content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 2px;
  background: var(--up);
}
.nav__count {
  margin-left: auto; font-size: 10.5px; color: #8d99a6;
  background: rgba(255, 255, 255, 0.07); padding: 1px 6px; border-radius: 20px;
}
.nav__item.is-active .nav__count { background: rgba(255, 255, 255, 0.12); color: #dbe3ea; }

.rail__foot {
  flex: 0 0 auto; border-top: 1px solid var(--rail-line); padding: 12px 14px;
  display: flex; align-items: center; gap: 10px;
}
.rail__avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto;
  background: #2a3947; color: #dfe7ee; display: grid; place-items: center;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em;
}
.rail__user { min-width: 0; line-height: 1.3; }
.rail__user b { display: block; font-size: 12px; font-weight: 500; color: #e9eef3; }
.rail__user span { display: block; font-size: 10px; color: #7b8a99; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { flex: 1 1 auto; min-width: 0; margin-left: var(--rail-w); }

/* ---------------------------------------------------------------- topbar */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--top-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px 0 28px;
  background: rgba(250, 249, 246, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__menu { display: none; }
.crumb { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.crumb b { color: var(--ink); font-weight: 500; }
.crumb .i { width: 12px; height: 12px; color: var(--faint); }

.org {
  display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 9px;
  border: 1px solid var(--line); background: #fff; border-radius: var(--r);
  font-size: 11.5px; color: var(--ink-2); cursor: pointer; white-space: nowrap;
}
.org:hover { border-color: #d3cec1; }
.org .i { width: 13px; height: 13px; color: var(--muted); }
.org .i:last-child { width: 11px; height: 11px; }
.org select {
  appearance: none; border: 0; background: transparent; font: inherit; color: inherit;
  padding: 0 2px 0 0; cursor: pointer; max-width: 132px; font-size: 11.5px;
}
.org select:focus { outline: none; border-color: #a9b8c8; box-shadow: 0 0 0 3px rgba(47, 110, 165, 0.12); }
.org select:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.org:focus-within { border-color: #b9c4d0; box-shadow: 0 0 0 3px rgba(47, 110, 165, 0.09); }

.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.gsearch {
  position: relative; width: 236px;
}
.gsearch .i { position: absolute; left: 9px; top: 8px; width: 14px; height: 14px; color: var(--faint); }
.gsearch input {
  width: 100%; height: 30px; padding: 0 46px 0 29px;
  border: 1px solid var(--line); background: #fff; border-radius: var(--r);
  font-size: 11.5px; color: var(--ink); font-family: inherit;
}
.gsearch input::placeholder { color: var(--faint); }
.gsearch input:focus { outline: none; border-color: #b9c4d0; box-shadow: 0 0 0 3px rgba(47, 110, 165, 0.12); }
.gsearch input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: #b9c4d0; }
.gsearch kbd {
  position: absolute; right: 6px; top: 6px; font-family: var(--sans); font-size: 9.5px;
  color: var(--muted); background: var(--paper-2); border: 1px solid var(--line);
  border-radius: 2px; padding: 1px 4px; pointer-events: none;
}

.status-chip {
  display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--muted);
  padding: 0 9px; height: 30px; border: 1px solid var(--line); border-radius: var(--r); background: #fff;
  white-space: nowrap;
}
.status-chip i { width: 5px; height: 5px; border-radius: 50%; background: var(--down); display: block; }

.icon-btn {
  position: relative; width: 30px; height: 30px; display: grid; place-items: center;
  border: 1px solid transparent; background: transparent; border-radius: var(--r);
  color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: #f0ede5; }
.icon-btn .i { width: 16px; height: 16px; }
.icon-btn__dot {
  position: absolute; top: 6px; right: 6px; width: 5px; height: 5px; border-radius: 50%;
  background: var(--up); border: 1.5px solid var(--paper);
}

.topbar__sep { width: 1px; height: 18px; background: var(--line); }

/* ---------------------------------------------------------------- page */
.page {
  padding: 26px 28px 72px;
  max-width: 1560px; margin: 0 auto;
}
.page--wide { max-width: none; }

.page-head {
  display: flex; align-items: flex-start; gap: 24px;
  padding-bottom: 18px; margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.page-head__main { min-width: 0; }
.page-title {
  font-size: 21px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 10px;
}
.page-sub {
  margin-top: 5px; font-size: 11.5px; color: var(--muted);
  display: flex; align-items: center; flex-wrap: wrap; gap: 0 10px;
}
.page-sub .sep { width: 1px; height: 10px; background: var(--line); display: inline-block; }
.page-sub b { font-weight: 500; color: var(--ink-2); }
.page-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: 0 0 auto; padding-top: 2px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 30px; padding: 0 12px; border-radius: var(--r);
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  font-size: 12px; font-weight: 500; letter-spacing: 0.01em; cursor: pointer;
  white-space: nowrap; text-decoration: none;
  transition: background 0.14s var(--ease), border-color 0.14s var(--ease),
    transform 0.08s var(--ease), box-shadow 0.14s var(--ease);
}
.btn .i { width: 14px; height: 14px; }
.btn:hover { border-color: #cfc9ba; background: #fcfbf8; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn--primary {
  background: var(--brand); border-color: var(--brand); color: #fff;
}
.btn--primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--ink-3); }
.btn--ghost:hover { background: var(--paper-2); border-color: transparent; }
.btn--danger { color: var(--up); border-color: #e6cfcb; background: #fff; }
.btn--danger:hover { background: var(--up-soft); border-color: #d9b6b0; }
.btn--sm { height: 26px; padding: 0 9px; font-size: 11.5px; }
.btn--lg { height: 36px; padding: 0 16px; font-size: 13px; }
.btn--block { width: 100%; }
.btn--link { border: 0; background: none; padding: 0; height: auto; color: var(--brand); font-weight: 500; }
.btn--link:hover { background: none; text-decoration: underline; }

.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; border-right-width: 0; }
.btn-group .btn:first-child { border-radius: var(--r) 0 0 var(--r); }
.btn-group .btn:last-child { border-radius: 0 var(--r) var(--r) 0; border-right-width: 1px; }

.link-arrow { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; color: var(--brand); }
.link-arrow .i { width: 12px; height: 12px; }

/* ---------------------------------------------------------------- layout */
.grid { display: grid; gap: 14px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.g-3-2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.g-210 { grid-template-columns: 210px minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.row--wrap { flex-wrap: wrap; }
.spacer { flex: 1 1 auto; }
.mt-0 { margin-top: 0 !important; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }

/* ---------------------------------------------------------------- card */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  min-width: 0;
}
.card--flush { display: flex; flex-direction: column; }
.card__head {
  display: flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 10px 16px; border-bottom: 1px solid var(--line-2);
}
.card__title { font-size: 12.5px; font-weight: 600; letter-spacing: 0.01em; color: var(--ink); }
.card__title span { font-weight: 400; color: var(--muted); margin-left: 6px; font-size: 11px; }
.card__tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.card__body { padding: 16px; }
.card__body--tight { padding: 12px 16px; }
.card__body--flush { padding: 0; }
.card__foot {
  padding: 10px 16px; border-top: 1px solid var(--line-2);
  display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--muted);
}
.card--pad { padding: 16px; }

.section-label {
  font-size: 10.5px; letter-spacing: 0.12em; color: var(--faint);
  text-transform: uppercase; font-weight: 500;
}

/* ---------------------------------------------------------------- kpi */
.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.kpi {
  background: var(--surface); padding: 15px 16px 13px; min-width: 0;
  display: flex; flex-direction: column; gap: 7px;
}
.kpi:hover { background: #fdfcf9; }
.kpi__top { display: flex; align-items: center; gap: 6px; }
.kpi__label { font-size: 11.5px; color: var(--muted); letter-spacing: 0.02em; }
.kpi__hint { margin-left: auto; width: 13px; height: 13px; color: var(--faint); }
.kpi__value {
  font-size: 27px; line-height: 1.05; font-weight: 600; letter-spacing: -0.025em;
  color: var(--ink); display: flex; align-items: baseline; gap: 4px;
}
.kpi__value small { font-size: 11px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.kpi__foot { display: flex; align-items: center; gap: 8px; font-size: 10.5px; color: var(--muted); }
.kpi__delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 500; }
.kpi__delta .i { width: 10px; height: 10px; }
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--muted); }
.kpi__spark { margin-left: auto; width: 62px; height: 22px; opacity: 0.9; }
.kpi__spark.spark-lg { width: 100%; height: auto; margin-left: 0; }

/* ---------------------------------------------------------------- table */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  padding: 8px 12px; text-align: left; font-size: 10.5px; font-weight: 500;
  color: var(--muted); letter-spacing: 0.05em; white-space: nowrap;
  background: #f8f6f1; border-bottom: 1px solid var(--line);
}
.tbl th.num, .tbl td.num { text-align: right; }
.tbl td {
  padding: 9px 12px; border-bottom: 1px solid var(--line-2);
  font-size: 12.5px; color: var(--ink-2); vertical-align: middle;
}
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #fbfaf6; }
.tbl tbody tr.is-selected td { background: #f4f7fa; }
.tbl tfoot td {
  padding: 9px 12px; font-size: 12px; font-weight: 600; color: var(--ink);
  background: #f8f6f1; border-top: 1px solid var(--line);
}
.tbl .name { color: var(--ink); font-weight: 500; }
.tbl .name:hover { color: var(--brand); }
.tbl .sub { display: block; font-size: 10.5px; color: var(--faint); font-weight: 400; line-height: 1.5; }
.tbl--roomy td { padding: 11px 12px; }
.tbl--compact th, .tbl--compact td { padding-left: 9px; padding-right: 9px; }
.tbl--compact .rep-title b { font-size: 12px; }
.tbl--fixed { table-layout: fixed; }
.tbl .cell-actions { display: flex; gap: 4px; justify-content: flex-end; opacity: 0.55; min-width: 44px; }
.tbl tr:hover .cell-actions { opacity: 1; }
.tbl th:last-child, .tbl td:last-child { padding-right: 16px; }
.tbl .muted-cell { color: var(--faint); }
.tbl .bar-cell { min-width: 90px; }
.cellbar { height: 3px; background: var(--line-2); border-radius: 2px; overflow: hidden; margin-top: 4px; }
.cellbar i { display: block; height: 100%; background: #9db0c2; border-radius: 2px; }
.cellbar i.is-up { background: #c0655d; }
.cellbar i.is-down { background: #5e9b87; }

/* horizontal bar list */
.hbar { display: flex; flex-direction: column; gap: 9px; }
.hbar__row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 46px; align-items: center; gap: 10px; }
.hbar__label { font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar__track { height: 7px; background: var(--line-2); border-radius: 1px; overflow: hidden; }
.hbar__track i { display: block; height: 100%; border-radius: 1px; }
.hbar__val { font-size: 11px; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }

/* heat matrix */
.heat { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.heat th {
  padding: 5px 4px; font-weight: 500; color: var(--muted); text-align: center; white-space: nowrap;
  font-size: 10px; border-bottom: 1px solid var(--line);
}
.heat th:first-child { text-align: left; padding-left: 2px; }
.heat td {
  padding: 6px 4px; text-align: center; font-variant-numeric: tabular-nums; font-size: 10.5px;
  border: 1px solid #fff;
}
.heat tbody th { text-align: left; font-weight: 400; color: var(--ink-2); border-bottom: 1px solid var(--line-2); padding-left: 2px; }
.heat td.num, .heat th.num { text-align: right; padding-right: 6px; }

/* ---------------------------------------------------------------- tags */
.tag {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px;
  border-radius: 2px; font-size: 10.5px; font-weight: 500; letter-spacing: 0.02em;
  background: #f2efe8; color: var(--ink-3); white-space: nowrap;
  border: 1px solid transparent;
}
.tag--ok { background: var(--down-soft); color: var(--down); }
.tag--warn { background: var(--warn-soft); color: var(--warn); }
.tag--danger { background: var(--up-soft); color: var(--up); }
.tag--info { background: var(--brand-soft); color: var(--brand); }
.tag--outline { background: #fff; border-color: var(--line); color: var(--muted); }
.tag--dark { background: #26313d; color: #e9eef3; }
.tag .dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }

.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.dot--ok { background: var(--down); }
.dot--danger { background: var(--up); }
.dot--warn { background: #b8862c; }
.dot--idle { background: #b9c0c8; }

.level { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; white-space: nowrap; }
.level::before { content: ""; width: 3px; height: 12px; border-radius: 1px; background: currentColor; opacity: 0.85; }
.level--fatal { color: var(--up); font-weight: 500; }
.level--severe { color: #a8551c; font-weight: 500; }
.level--normal { color: var(--muted); }
.level--tip { color: var(--faint); }

/* ---------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .label {
  font-size: 11px; color: var(--muted); letter-spacing: 0.03em; font-weight: 500;
}
.field__hint { font-size: 10.5px; color: var(--faint); line-height: 1.5; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: var(--r);
  font-family: inherit; font-size: 12.5px; color: var(--ink); padding: 0 10px; height: 32px;
}
.textarea { height: auto; padding: 9px 10px; line-height: 1.7; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: #aeb4bc; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: #a9b8c8; box-shadow: 0 0 0 3px rgba(47, 110, 165, 0.1);
}
.select {
  appearance: none; padding-right: 26px; cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236e7681' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
.searchline { position: relative; }
.searchline .i { position: absolute; left: 9px; top: 9px; width: 14px; height: 14px; color: var(--faint); }
.searchline .input { padding-left: 29px; }

.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filters .select { width: auto; min-width: 96px; height: 30px; font-size: 11.5px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 27px; padding: 0 10px;
  border: 1px solid var(--line); background: #fff; border-radius: var(--r);
  font-size: 11.5px; color: var(--ink-3); cursor: pointer; white-space: nowrap;
  transition: all 0.14s var(--ease);
}
.chip:hover { border-color: #cfc9ba; }
.chip.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip .count { font-size: 10px; opacity: 0.7; }
.chip--sm { height: 24px; padding: 0 8px; font-size: 11px; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12px; color: var(--ink-2); }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track {
  width: 28px; height: 16px; border-radius: 10px; background: #d8d3c7; position: relative;
  transition: background 0.16s var(--ease); flex: 0 0 auto;
}
.switch__track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px;
  border-radius: 50%; background: #fff; transition: transform 0.16s var(--ease);
}
.switch input:checked + .switch__track { background: var(--brand); }
.switch input:checked + .switch__track::after { transform: translateX(12px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--focus); outline-offset: 2px; }

.checkline { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--ink-2); cursor: pointer; }
.checkline input { margin: 3px 0 0; accent-color: var(--brand); width: 13px; height: 13px; }

.seg { display: inline-flex; background: var(--paper-2); padding: 2px; border-radius: var(--r); }
.seg button {
  border: 0; background: transparent; height: 24px; padding: 0 10px; border-radius: 2px;
  font-size: 11.5px; color: var(--muted); cursor: pointer;
}
.seg button.is-on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(22, 26, 32, 0.08); font-weight: 500; }

/* ---------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); }
.tab {
  position: relative; padding: 9px 2px 10px; margin-right: 22px; border: 0; background: none;
  font-size: 12.5px; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.is-on { color: var(--ink); font-weight: 500; }
.tab.is-on::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink);
}
.tab .count { font-size: 10.5px; color: var(--faint); margin-left: 4px; }

/* ---------------------------------------------------------------- chart */
.chart { display: block; overflow: visible; max-width: none; }
.chart text { font-family: var(--sans); font-variant-numeric: tabular-nums; }
.chart .axis { stroke: var(--line-2); stroke-width: 1; }
.chart .grid { stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 2 3; }
.chart .tick { fill: var(--faint); font-size: 10px; }
.chart .tick--strong { fill: var(--muted); font-size: 10.5px; }
.chart .line {
  fill: none; stroke: var(--up); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 0.9s 0.15s var(--ease) forwards;
}
.chart .line--brand { stroke: var(--brand); }
.chart .area { animation: fade 0.8s 0.4s var(--ease) both; }
.chart .bar { animation: fade 0.5s var(--ease) both; }
.chart .dot { animation: fade 0.4s 0.8s var(--ease) both; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 10.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 1px; display: block; }
.legend i.line-mark { width: 14px; height: 2px; border-radius: 1px; }
.legend__note { margin-left: auto; color: var(--faint); min-width: 0; }

.chart-note { font-size: 10.5px; color: var(--faint); line-height: 1.6; }
.chart-scroll-hint { margin: 6px 0 0; font-size: 10.5px; color: var(--faint); letter-spacing: .02em; }
.chart-scroll-hint::before { content: "←"; margin-right: 4px; }
.chart-scroll-hint::after { content: "→"; margin-left: 4px; }

/* ---------------------------------------------------------------- steps */
.steps { display: flex; align-items: flex-start; gap: 0; }
.step {
  flex: 1 1 0; min-width: 0; position: relative; padding-right: 16px;
  display: grid; grid-template-columns: 22px minmax(0, auto) 1fr; column-gap: 10px; align-items: start;
}
/* 连接线只占文字之后的空档，不穿过标题与说明 */
.step::after {
  content: ""; grid-column: 3; grid-row: 1;
  margin: 11px 8px 0 6px; height: 1px; background: var(--line);
}
.step:last-child::after { display: none; }
.step__num {
  width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); background: #fff;
  display: grid; place-items: center; font-size: 10.5px; color: var(--muted); flex: 0 0 auto; z-index: 1;
}
.step__body { padding-top: 1px; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.step__name { font-size: 12px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.step__desc { font-size: 10.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step.is-on .step__num { background: var(--brand); border-color: var(--brand); color: #fff; }
.step.is-on .step__name { color: var(--ink); }
.step.is-done .step__num { background: var(--down-soft); border-color: #bcd6cc; color: var(--down); }
.step.is-done .step__name { color: var(--ink-2); }
.step.is-on::after { background: linear-gradient(90deg, var(--brand) 0%, var(--line) 60%); }

.progress { height: 4px; background: #eeebe3; border-radius: 3px; overflow: hidden; }
.progress i {
  display: block; height: 100%; background: var(--brand); border-radius: 3px;
  transition: width 0.5s var(--ease);
}
.progress--thin { height: 2px; }
.progress--live i { transition: none; }

/* ---------------------------------------------------------------- task list */
.tasklist { display: flex; flex-direction: column; }
.tasklist__item {
  display: flex; align-items: center; gap: 10px; padding: 9px 0;
  border-bottom: 1px dashed var(--line-2); font-size: 12px; color: var(--ink-2);
}
.tasklist__item:last-child { border-bottom: 0; }
.tasklist__icon {
  width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto;
  border: 1px solid var(--line); color: var(--faint);
}
.tasklist__icon .i { width: 10px; height: 10px; }
.tasklist__item.is-run .tasklist__icon { border-color: #a9c1d6; color: var(--brand); }
.tasklist__item.is-done .tasklist__icon { background: var(--down-soft); border-color: #bcd6cc; color: var(--down); }
.tasklist__item.is-fail .tasklist__icon { background: var(--up-soft); border-color: #e0c2bd; color: var(--up); }
.tasklist__meta { margin-left: auto; font-size: 10.5px; color: var(--faint); white-space: nowrap; }
.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- report */
.report-layout { display: grid; grid-template-columns: 168px minmax(0, 1fr) 276px; gap: 20px; align-items: start; }
.outline { position: sticky; top: 76px; }
.outline__label { font-size: 10px; letter-spacing: 0.12em; color: var(--faint); padding: 0 10px 8px; }
.outline a {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px; font-size: 11.5px;
  color: var(--muted); border-left: 2px solid transparent; line-height: 1.45;
}
.outline a:hover { color: var(--ink); background: #f3f0e9; text-decoration: none; }
.outline a.is-on { color: var(--ink); border-left-color: var(--up); background: #fff; font-weight: 500; }
.outline a span { color: var(--faint); font-size: 10px; width: 12px; flex: 0 0 auto; }

.report {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  padding: 44px 48px 56px; min-width: 0;
}
.report__kicker {
  display: flex; align-items: center; gap: 10px; font-size: 10.5px; letter-spacing: 0.14em;
  color: var(--faint); text-transform: uppercase;
}
.report__kicker::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.report h1 {
  font-family: var(--serif); font-size: 27px; line-height: 1.4; font-weight: 600;
  letter-spacing: 0.01em; margin: 14px 0 6px; color: #11151a;
}
.report__sub {
  font-family: var(--serif); font-size: 13px; color: var(--muted); letter-spacing: 0.02em;
}
.report__meta {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 18px;
  margin: 22px 0 0; padding: 14px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line);
}
.report__meta dt { font-size: 10px; color: var(--faint); letter-spacing: 0.08em; margin-bottom: 2px; }
.report__meta dd { font-size: 11.5px; color: var(--ink-2); line-height: 1.5; }

.rep-sec { margin-top: 34px; scroll-margin-top: 76px; }
.rep-sec__head { display: flex; align-items: baseline; gap: 10px; border-bottom: 1px solid var(--ink); padding-bottom: 6px; margin-bottom: 14px; }
.rep-sec__num { font-size: 10px; letter-spacing: 0.12em; color: var(--faint); font-family: var(--sans); }
.rep-sec h2 { font-family: var(--serif); font-size: 18px; font-weight: 600; letter-spacing: 0.02em; }
.rep-sec__tools { margin-left: auto; display: flex; align-items: center; gap: 8px; font-family: var(--sans); }
.rep-ai {
  display: inline-flex; align-items: center; gap: 4px; font-size: 9.5px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 2px; padding: 1px 5px; letter-spacing: 0.04em;
  background: #fcfbf8;
}
.rep-ai .i { width: 9px; height: 9px; color: var(--gold); }

.rep-lead {
  font-family: var(--serif); font-size: 13.5px; line-height: 1.95; color: #262c34;
}
.rep-p { font-family: var(--serif); font-size: 13.5px; line-height: 1.95; color: #2c323a; margin-top: 10px; }
.rep-p b { font-weight: 600; color: #11151a; }
.rep-small { font-size: 10.5px; color: var(--muted); line-height: 1.7; font-family: var(--sans); }

.rep-conclusion {
  border-left: 2px solid var(--up); background: #fcfaf6; padding: 10px 14px; margin: 4px 0 14px;
  font-family: var(--serif); font-size: 12.5px; line-height: 1.85; color: #2c323a;
}
.rep-conclusion b { color: var(--up); }

.rep-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin: 4px 0 14px; }
.rep-card { background: #fff; padding: 10px 12px; }
.rep-card__label { font-size: 10px; color: var(--muted); letter-spacing: 0.04em; }
.rep-card__value { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; margin-top: 2px; }
.rep-card__value small { font-size: 10px; font-weight: 400; color: var(--muted); margin-left: 2px; }
.rep-card__delta { font-size: 10px; margin-top: 1px; }

.rep-table { width: 100%; border-collapse: collapse; margin: 6px 0 8px; font-family: var(--sans); }
.rep-table th {
  font-size: 9.5px; font-weight: 500; color: #4d5561; letter-spacing: 0.03em; text-align: right;
  padding: 6px 7px; background: #f6f3ec; border-top: 1px solid #cfc9ba; border-bottom: 1px solid #ddd8ca;
}
.rep-table th:first-child { text-align: left; }
.rep-table td {
  font-size: 11px; color: #2c323a; padding: 5px 7px; text-align: right;
  border-bottom: 1px solid #f0ede5;
}
.rep-table td:first-child { text-align: left; }
.rep-table tr.is-total td { font-weight: 600; background: #faf8f2; border-top: 1px solid #ddd8ca; }
.rep-table tbody tr:hover td { background: #fbf9f4; }
.rep-table .t-up { color: var(--up); }
.rep-table .t-down { color: var(--down); }

.fn {
  font-size: 8px; vertical-align: super; color: var(--brand); cursor: pointer; margin-left: 1px;
  font-family: var(--sans); border: 0; background: none; padding: 0 1px;
}
.fn:hover { text-decoration: underline; }

.rep-quote {
  border: 1px solid var(--line); background: #fcfbf8; padding: 12px 14px; margin-top: 12px;
  font-family: var(--serif); font-size: 12px; line-height: 1.85; color: #343a43;
}
.rep-quote b { font-weight: 600; }

.rep-list { margin-top: 8px; }
.rep-list li {
  position: relative; padding-left: 13px; font-family: var(--serif); font-size: 13px;
  line-height: 1.9; color: #2c323a; margin-bottom: 2px;
}
.rep-list li::before { content: "—"; position: absolute; left: 0; color: var(--faint); }

.rep-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.rep-figure { border: 1px solid var(--line-2); padding: 10px 12px 8px; background: #fdfcf9; }
.rep-figure__title { font-size: 10.5px; color: var(--ink-2); font-weight: 500; margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.rep-figure__title span { color: var(--faint); font-weight: 400; }

.report-side { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 12px; }
.side-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
.side-card__head { padding: 9px 12px; border-bottom: 1px solid var(--line-2); font-size: 11.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.side-card__head .i { width: 13px; height: 13px; color: var(--muted); }
.side-card__body { padding: 10px 12px; }
.side-item { display: flex; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--line-2); font-size: 11px; line-height: 1.55; }
.side-item:last-child { border-bottom: 0; }
.side-item__mark { flex: 0 0 auto; }
.side-item b { font-weight: 500; color: var(--ink-2); display: block; }
.side-item span { color: var(--faint); font-size: 10.5px; display: block; }

/* ---------------------------------------------------------------- knowledge tree */
.tree { font-size: 12px; }
.tree__group { margin-bottom: 2px; }
.tree__item {
  display: flex; align-items: center; gap: 7px; padding: 5px 8px; border-radius: 2px;
  color: var(--ink-3); cursor: pointer; line-height: 1.5;
}
.tree__item:hover { background: #f3f0e9; }
.tree__item.is-on { background: #eef2f6; color: var(--brand); font-weight: 500; }
.tree__item .i { width: 13px; height: 13px; color: var(--faint); flex: 0 0 auto; }
.tree__item.is-on .i { color: var(--brand); }
.tree__item .count { margin-left: auto; font-size: 10px; color: var(--faint); }
.tree__sub { padding-left: 14px; }
.tree__sub .tree__item { padding-left: 16px; font-size: 11.5px; }
.tree__head { display: flex; align-items: center; gap: 6px; padding: 6px 8px; font-size: 10.5px; color: var(--faint); letter-spacing: 0.06em; }

/* ---------------------------------------------------------------- drawer / modal */
.backdrop {
  position: fixed; inset: 0; background: rgba(15, 22, 30, 0.28); z-index: 80;
  opacity: 0; pointer-events: none; transition: opacity 0.22s var(--ease);
  backdrop-filter: blur(1px);
}
.backdrop.is-open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 520px; max-width: 94vw; z-index: 90;
  background: #fff; border-left: 1px solid var(--line);
  box-shadow: -24px 0 60px rgba(15, 22, 30, 0.14);
  transform: translateX(102%); transition: transform 0.28s var(--ease);
  display: flex; flex-direction: column;
}
.drawer.is-open { transform: none; }
.drawer--wide { width: 720px; }
.drawer__head {
  flex: 0 0 auto; display: flex; align-items: flex-start; gap: 12px;
  padding: 15px 18px 13px; border-bottom: 1px solid var(--line);
}
.drawer__title { font-size: 14px; font-weight: 600; line-height: 1.45; letter-spacing: 0.01em; }
.drawer__sub { font-size: 10.5px; color: var(--muted); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; }
.drawer__close { margin-left: auto; flex: 0 0 auto; }
.drawer__body { flex: 1 1 auto; overflow-y: auto; padding: 18px; }
.drawer__foot {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-top: 1px solid var(--line); background: #fcfbf8;
}

.modal {
  position: fixed; z-index: 90; left: 50%; top: 12vh; transform: translate(-50%, 6px);
  width: 560px; max-width: 92vw; background: #fff; border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: 0 24px 70px rgba(15, 22, 30, 0.18);
  opacity: 0; pointer-events: none; transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.modal.is-open { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.modal__head { padding: 16px 18px 10px; }
.modal__title { font-size: 14px; font-weight: 600; }
.modal__body { padding: 0 18px 16px; }
.modal__foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: #fcfbf8; }

.toast-host { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #161f29; color: #f0f4f8; font-size: 12px; padding: 8px 14px; border-radius: var(--r);
  box-shadow: 0 10px 30px rgba(15, 22, 30, 0.25); display: flex; align-items: center; gap: 8px;
  animation: rise 0.2s var(--ease) both;
}
.toast .i { width: 13px; height: 13px; color: #8fd0b8; }
.toast--error .i { color: #e6a49d; }

/* ---------------------------------------------------------------- misc */
.note {
  border: 1px solid var(--line); background: #fcfbf7; padding: 10px 12px;
  font-size: 11.5px; color: var(--ink-3); line-height: 1.7; display: flex; gap: 9px;
}
.note .i { width: 14px; height: 14px; color: var(--muted); flex: 0 0 auto; margin-top: 2px; }
.note b { font-weight: 600; }
.note--brand { background: var(--brand-soft); border-color: #dbe4ec; }

.divider { height: 1px; background: var(--line-2); margin: 16px 0; }
.divider--strong { background: var(--line); }
.hr-label { display: flex; align-items: center; gap: 10px; font-size: 10.5px; color: var(--faint); letter-spacing: 0.08em; margin: 18px 0 12px; }
.hr-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.ink { color: var(--ink); }
.small { font-size: 11px; }
.xsmall { font-size: 10.5px; }
.strong { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.center { text-align: center; }
.right { text-align: right; }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: -0.01em; }
.kicker { font-size: 10px; letter-spacing: 0.12em; color: var(--faint); text-transform: uppercase; }
.pill-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #f0ede5; font-size: 10px; color: var(--muted); }
.tag-row { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 11.5px; border-bottom: 1px dashed var(--line-2); }
.kv:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); flex: 0 0 auto; }
.kv dd { color: var(--ink-2); text-align: right; }

.stat-strip { display: flex; align-items: stretch; border: 1px solid var(--line); background: #fff; border-radius: var(--r); overflow: hidden; }
.stat { flex: 1 1 0; padding: 11px 14px; border-right: 1px solid var(--line-2); min-width: 0; }
.stat:last-child { border-right: 0; }
.stat__label { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.stat__value { font-size: 18px; font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; }
.stat__value small { font-size: 10px; font-weight: 400; color: var(--muted); margin-left: 2px; }

.timeline { position: relative; padding-left: 16px; }
.timeline::before { content: ""; position: absolute; left: 3px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.timeline__item { position: relative; padding-bottom: 14px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: ""; position: absolute; left: -16px; top: 5px; width: 7px; height: 7px;
  border-radius: 50%; background: #fff; border: 1.5px solid #c3bdae;
}
.timeline__item.is-on::before { border-color: var(--brand); background: var(--brand); }
.timeline__title { font-size: 11.5px; color: var(--ink-2); font-weight: 500; display: flex; gap: 8px; align-items: baseline; }
.timeline__meta { font-size: 10.5px; color: var(--faint); margin-top: 1px; }
.timeline__desc { font-size: 11px; color: var(--muted); margin-top: 3px; line-height: 1.6; }

.flow { width: 100%; }
.flow text { font-family: var(--sans); }

.avatar { width: 24px; height: 24px; border-radius: 50%; background: #e9e4d8; color: var(--ink-3); display: grid; place-items: center; font-size: 10px; font-weight: 600; flex: 0 0 auto; }
.avatar--sm { width: 20px; height: 20px; font-size: 9px; }

.empty { padding: 32px 16px; text-align: center; color: var(--faint); font-size: 12px; }
.empty b { display: block; color: var(--ink-3); font-size: 13px; font-weight: 500; margin-bottom: 4px; }

.pager { display: flex; align-items: center; gap: 4px; }
.pager button {
  min-width: 26px; height: 26px; padding: 0 6px; border: 1px solid var(--line); background: #fff;
  border-radius: 2px; font-size: 11px; color: var(--muted); cursor: pointer;
}
.pager button:hover { border-color: #cfc9ba; color: var(--ink); }
.pager button.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager button:disabled { opacity: 0.4; cursor: default; }

.code {
  font-family: var(--mono); font-size: 11px; background: #f7f5ee; border: 1px solid var(--line-2);
  padding: 8px 10px; border-radius: 2px; color: #33404d; line-height: 1.7; overflow-x: auto;
}

/* ---------------------------------------------------------------- report print */
@media print {
  .rail, .topbar, .outline, .report-side, .page-actions, .no-print { display: none !important; }
  .main { margin-left: 0; }
  .page { padding: 0; max-width: none; }
  .report { border: 0; padding: 0; }
  body { background: #fff; }
}

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1400px) {
  .report-layout { grid-template-columns: 150px minmax(0, 1fr); }
  .report-side { grid-column: 2; position: static; flex-direction: row; flex-wrap: wrap; }
  .report-side .side-card { flex: 1 1 260px; }
}

@media (max-width: 1180px) {
  .g-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-layout { grid-template-columns: minmax(0, 1fr); }
  .outline { display: none; }
  .report-side { grid-column: 1; }
  .gsearch { width: 180px; }
}

@media (max-width: 1080px) {
  :root { --rail-w: 0px; }
  .rail {
    width: 232px; transform: translateX(-102%); visibility: hidden;
    transition: transform 0.24s var(--ease), visibility 0s linear 0.24s;
    box-shadow: 20px 0 60px rgba(15, 22, 30, 0.2);
  }
  body.nav-open .rail { transform: none; visibility: visible; transition: transform 0.24s var(--ease), visibility 0s; }
  body.nav-open::after {
    content: ""; position: fixed; inset: 0; background: rgba(15, 22, 30, 0.3); z-index: 55;
  }
  .main { margin-left: 0; }
  .topbar__menu { display: grid; }
  .g-2-1, .g-1-2, .g-3-2, .g-210 { grid-template-columns: minmax(0, 1fr); }
  .g-2 { grid-template-columns: minmax(0, 1fr); }
  .report { padding: 32px 28px 40px; }
}

@media (max-width: 820px) {
  .page { padding: 18px 16px 56px; }
  .topbar { padding: 0 14px; gap: 8px; }
  .crumb { display: none; }
  .gsearch { display: none; }
  .status-chip { display: none; }
  .topbar__sep { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-4, .g-3, .g-5 { grid-template-columns: minmax(0, 1fr); }
  .page-head { flex-wrap: wrap; gap: 12px; }
  .page-actions { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .page-title { font-size: 19px; }
  .stat-strip { flex-wrap: wrap; }
  .stat { flex: 1 1 45%; border-bottom: 1px solid var(--line-2); }
  .report { padding: 24px 18px 32px; }
  .report h1 { font-size: 21px; }
  .report__meta { grid-template-columns: 1fr 1fr; }
  .rep-cards { grid-template-columns: 1fr 1fr; }
  .rep-grid-2 { grid-template-columns: minmax(0, 1fr); }
  .steps { overflow-x: auto; padding-bottom: 4px; }
  .step { min-width: 148px; grid-template-columns: 22px minmax(0, 1fr) 18px; }
  .step::after { margin: 11px 6px 0 4px; }
  .drawer { width: 100%; max-width: 100%; }
  .report-side { flex-direction: column; }
  .card__head { flex-wrap: wrap; }
}

@media (max-width: 560px) {
  /* 手机上四步两列铺开，不再横向滚动 */
  .steps { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 6px; overflow: visible; }
  .step { min-width: 0; padding-right: 6px; grid-template-columns: 22px minmax(0, 1fr); }
  .step::after { display: none; }
  .step__desc { white-space: normal; overflow: visible; line-height: 1.45; }

  .seg button, .btn, .tab, .chip, .nav__item, .outline a, .topbar__menu, .topbar__icon {
    min-height: 44px;
  }
  .seg button { padding: 0 14px; }
  .topbar__icon { width: 44px; }
  .tbl .btn { min-height: 40px; }
}

@media (max-width: 460px) {
  .kpi-grid { grid-template-columns: minmax(0, 1fr); }
  .kpi__value { font-size: 24px; }
  .rep-cards { grid-template-columns: 1fr; }
  .page-actions .btn { flex: 1 1 auto; }
  .tbl th, .tbl td { padding-left: 9px; padding-right: 9px; }
  .report__meta { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .chart .line { stroke-dashoffset: 0; }
}
