@charset "UTF-8";
/*
 * 事故调查管理台 · 事件调查宿主
 * 全站样式：设计令牌 / 平台外壳 / 内容组件 / 响应式 / 打印
 * 视觉体系对齐 cases/policy-impact-simulator
 */

/* ============================== 1. 设计令牌 ============================== */
:root {
  --ui-font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --doc-font: "Songti SC", "STSong", SimSun, "Noto Serif SC", serif;
  --num-font: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --ink: #16202f;
  --ink-2: #3d4a5c;
  --muted: #6b7686;
  --faint: #9aa4b2;

  --paper: #ffffff;
  --bg: #eef1f6;
  --bg-2: #f7f9fc;
  --bg-3: #f1f4f9;
  --line: #dee3ec;
  --line-2: #eceff5;

  --rail: #101b30;
  --rail-2: #0b1424;
  --rail-line: #22304b;
  --rail-ink: #c8d2e2;
  --rail-faint: #7b8aa3;

  --accent: #2f4dc0;
  --accent-dk: #23399a;
  --accent-soft: #ebeefb;
  --seal: #6d5bd0;
  --seal-soft: #f0edfb;
  --danger: #c2352b;
  --danger-soft: #fceceb;
  --warn: #b7791f;
  --warn-soft: #fdf4e3;
  --ok: #197a4b;
  --ok-soft: #e8f5ee;

  --shadow-1: 0 1px 2px rgba(22, 32, 47, .06);
  --shadow-2: 0 4px 16px rgba(22, 32, 47, .12);
  --shadow-3: 0 18px 48px rgba(11, 20, 36, .28);

  --rail-w: 232px;
  --radius: 10px;
  --radius-sm: 6px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--ui-font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* ============================== 2. 工具类 ============================== */
.u-num { font-family: var(--num-font); font-variant-numeric: tabular-nums; }
.u-id { font-family: var(--num-font); font-size: 12px; color: var(--muted); letter-spacing: .01em; }
.u-hidden { display: none !important; }
.u-muted { color: var(--muted); }
.u-faint { color: var(--faint); }
.u-row { display: flex; align-items: center; gap: 8px; }
.u-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.u-col { display: flex; flex-direction: column; gap: 10px; }
.u-spacer { flex: 1 1 auto; }
.u-sr {
  position: absolute; width: 1px; height: 1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.u-doc { font-family: var(--doc-font); font-size: 15px; line-height: 1.95; color: #101820; }
.u-code {
  font-family: var(--num-font); font-size: 12px; background: var(--bg-3);
  border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 6px; color: var(--ink-2);
  word-break: break-word;
}
.u-strike { text-decoration: line-through; color: var(--faint); }

/* ============================== 3. 平台外壳 ============================== */
.rail {
  position: fixed; inset: 0 auto 0 0; width: var(--rail-w); z-index: 40;
  background: linear-gradient(180deg, var(--rail) 0%, var(--rail-2) 100%);
  border-right: 1px solid var(--rail-line);
  display: flex; flex-direction: column;
}

.rail-head-row { display: flex; align-items: center; flex: 0 0 auto; }
.rail-panel { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }

.rail-brand {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 16px 16px 14px; border-bottom: 1px solid var(--rail-line);
}
.rail-brand:hover { text-decoration: none; }
.rail-brand:hover .rail-brand-text b { color: #d7e2f8; }
.rail-mark {
  width: 34px; height: 34px; flex: 0 0 auto; border-radius: 8px;
  background: rgba(47, 77, 192, .22); border: 1px solid rgba(120, 148, 234, .38);
  display: grid; place-items: center; color: #a8bcf5;
}
.rail-mark .rm-icon { width: 19px; height: 19px; }
.rail-toggle .rt-icon { width: 20px; height: 20px; }
.rail-brand-text { min-width: 0; }
.rail-brand-text b { display: block; font-size: 14px; font-weight: 700; color: #fff; letter-spacing: .02em; }
.rail-brand-text span {
  display: block; font-family: var(--num-font); font-size: 10.5px;
  color: var(--rail-faint); letter-spacing: .08em;
}

.rail-scroll { flex: 1 1 auto; overflow-y: auto; padding: 12px 10px 8px; }
.rail-group-label {
  padding: 4px 8px 6px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .14em; color: var(--rail-faint);
}
.rail-nav { list-style: none; display: flex; flex-direction: column; gap: 2px; }

.rail-link {
  display: flex; align-items: center; gap: 10px; min-height: 44px;
  padding: 8px 10px; border-radius: 7px; color: var(--rail-ink);
  font-size: 13.5px; border-left: 2px solid transparent;
  transition: background .14s, color .14s;
}
.rail-link:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.rail-link .rl-icon { flex: 0 0 auto; width: 17px; height: 17px; color: var(--rail-faint); }
.rail-link .rl-text { flex: 1 1 auto; }
.rail-link .rl-kbd {
  font-family: var(--num-font); font-size: 10px; color: var(--rail-faint);
  border: 1px solid var(--rail-line); border-radius: 3px; padding: 0 4px;
}
.rail-link[aria-current="page"] {
  background: rgba(47, 77, 192, .3); color: #fff; font-weight: 600;
  border-left-color: #7d9cf0;
}
.rail-link[aria-current="page"] .rl-icon { color: #a8bcf5; }
.rail-link:focus-visible { outline-color: #7d9cf0; }

.rail-ext-wrap { margin: 14px 0 4px; padding-top: 12px; border-top: 1px solid var(--rail-line); }
.rail-ext {
  display: block; padding: 10px 11px; border-radius: 8px; color: var(--rail-ink);
  background: rgba(109, 91, 208, .16); border: 1px solid rgba(140, 122, 235, .34);
  transition: background .14s, border-color .14s;
}
.rail-ext:hover { background: rgba(109, 91, 208, .28); border-color: rgba(160, 144, 245, .6); text-decoration: none; }
.rail-ext .re-kind {
  display: flex; align-items: center; gap: 5px;
  font-family: var(--num-font); font-size: 9.5px; letter-spacing: .1em; color: #b9aaf5;
}
.rail-ext .re-kind .rl-icon { width: 12px; height: 12px; color: inherit; }
.rail-ext .re-name { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 13.5px; font-weight: 600; color: #fff; }
.rail-ext .re-name .rl-icon { width: 13px; height: 13px; color: #b9aaf5; }
.rail-ext .re-note { margin-top: 3px; font-size: 11px; line-height: 1.5; color: var(--rail-faint); }
.rail-ext:focus-visible { outline-color: #b9aaf5; }

.rail-foot { padding: 10px 16px 14px; border-top: 1px solid var(--rail-line); }
.rail-status {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--num-font); font-size: 10.5px; color: var(--rail-faint);
}
.rail-status .dot { width: 6px; height: 6px; border-radius: 50%; background: #38c172; flex: 0 0 auto; }
.rail-foot p { margin-top: 5px; font-size: 10.5px; line-height: 1.55; color: #5f6f8b; }

.rail-toggle { display: none; }

/* 主区域 */
.page { margin-left: var(--rail-w); min-height: 100vh; display: flex; flex-direction: column; }

.skip-link {
  position: fixed; top: -60px; left: 14px; z-index: 90;
  padding: 9px 15px; border: 1px solid var(--accent); border-radius: var(--radius-sm);
  background: var(--paper); color: var(--accent-dk); font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-2); transition: top .16s;
}
.skip-link:focus { top: 14px; text-decoration: none; }

.page-head {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); padding: 14px 24px 12px;
}
.page-head-top { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.page-eyebrow {
  display: flex; align-items: center; gap: 7px; margin-bottom: 3px;
  font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--muted);
}
.page-eyebrow .pe-sep { color: var(--line); }
.page-head h1 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; line-height: 1.35; }
.page-lede { margin-top: 4px; font-size: 12.5px; color: var(--muted); max-width: 78ch; line-height: 1.65; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }

.prov-strip { display: flex; flex-wrap: wrap; gap: 0 0; margin-top: 11px; }
.prov-strip .pv { padding: 0 14px; border-left: 1px solid var(--line-2); }
.prov-strip .pv:first-child { padding-left: 0; border-left: none; }
.prov-strip dt { font-size: 10px; letter-spacing: .07em; color: var(--faint); }
.prov-strip dd {
  font-family: var(--num-font); font-size: 12px; font-weight: 600;
  display: flex; align-items: center; gap: 5px;
}
.prov-strip dd .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.prov-strip dd.seal { color: var(--seal); }
.prov-strip dd.ok { color: var(--ok); }

.page-body { flex: 1 1 auto; padding: 18px 24px 40px; display: flex; flex-direction: column; gap: 16px; }
.page-body > section { display: flex; flex-direction: column; gap: 10px; }
.page-body > section.split-main,
.page-body > section.grid { display: grid; }

/* ============================== 4. 基础组件 ============================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 32px; padding: 5px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--paper);
  font-size: 12.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap;
  transition: border-color .14s, color .14s, background .14s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dk); font-weight: 600; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:disabled:hover { border-color: var(--line); color: var(--ink-2); }
.btn svg { width: 14px; height: 14px; flex: 0 0 auto; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dk); border-color: var(--accent-dk); color: #fff; }
.btn-seal { background: var(--seal); border-color: var(--seal); color: #fff; }
.btn-seal:hover { background: #5b49bd; border-color: #5b49bd; color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--bg-3); border-color: transparent; color: var(--accent); }
.btn-sm { min-height: 28px; padding: 3px 9px; font-size: 12px; }
.btn-block { width: 100%; }

.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px;
  border-radius: 4px; font-size: 11.5px; font-weight: 600; line-height: 1.65; white-space: nowrap;
}
.chip svg { width: 11px; height: 11px; flex: 0 0 auto; }
.chip-danger { background: var(--danger-soft); color: var(--danger); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-accent { background: var(--accent-soft); color: var(--accent-dk); }
.chip-seal { background: var(--seal-soft); color: var(--seal); }
.chip-neutral { background: var(--bg-3); color: var(--ink-2); }
.chip-outline { background: transparent; border: 1px solid var(--line); color: var(--muted); }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); scroll-margin-top: 130px; }
.card-hd {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 11px 14px; border-bottom: 1px solid var(--line-2);
}
.card-hd h2, .card-hd h3 { font-size: 14px; font-weight: 700; }
.card-hd p { font-size: 12px; color: var(--muted); }
.card-hd .u-spacer + * { margin-left: auto; }
.card-bd { padding: 14px; }
.card-bd-flush { padding: 0; }
.card-ft {
  padding: 9px 14px; border-top: 1px solid var(--line-2); background: var(--bg-2);
  border-radius: 0 0 var(--radius) var(--radius); font-size: 11.5px; color: var(--muted);
}

.sec-title { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--muted); }

.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.split-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 12px; align-items: start; }

/* 提示条 */
.note {
  display: flex; gap: 8px; padding: 9px 12px; border-radius: var(--radius-sm);
  background: var(--bg-2); border: 1px solid var(--line-2);
  font-size: 12px; line-height: 1.65; color: var(--ink-2);
}
.note svg { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 2px; color: var(--muted); }
.note-seal { background: var(--seal-soft); border-color: #ded6f7; color: #3f3374; }
.note-seal svg { color: var(--seal); }
.note-warn { background: var(--warn-soft); border-color: #f0dfba; color: #7a5312; }
.note-warn svg { color: var(--warn); }
.note-danger { background: var(--danger-soft); border-color: #f0cdca; color: #8c2620; }
.note-danger svg { color: var(--danger); }
.note b { font-weight: 700; }

/* 工具栏 */
.toolbar {
  display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
  padding: 11px 14px; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1);
}
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label, .field > .fld-label { font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--muted); }
.field select, .field input[type="text"], .field input[type="search"] {
  min-height: 32px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 5px 9px; background: var(--paper); font-size: 13px;
}
.field select { padding-right: 24px; }
.search-box { position: relative; }
.search-box input { width: 100%; padding-left: 30px; padding-right: 28px; }
.search-box .sb-icon {
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--faint); pointer-events: none;
}
.search-box .sb-clear {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; display: grid; place-items: center;
  border-radius: 4px; color: var(--faint);
}
.search-box .sb-clear:hover { background: var(--bg-3); color: var(--ink); }
.search-box .sb-clear[hidden] { display: none; }

.seg { display: inline-flex; flex-wrap: wrap; padding: 2px; background: var(--bg-3); border-radius: 7px; gap: 2px; }
.seg button {
  min-height: 28px; padding: 3px 11px; border-radius: 5px;
  font-size: 12.5px; color: var(--ink-2); white-space: nowrap;
  transition: background .14s, color .14s;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--accent-dk); font-weight: 600; box-shadow: var(--shadow-1); }

.result-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.result-line b { font-family: var(--num-font); color: var(--ink); }

/* 指标卡 */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 12px; }
.kpi {
  position: relative; overflow: hidden;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: var(--shadow-1);
  display: flex; flex-direction: column; gap: 3px;
}
.kpi::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--line); }
.kpi.tone-danger::after { background: var(--danger); }
.kpi.tone-warn::after { background: var(--warn); }
.kpi.tone-accent::after { background: var(--accent); }
.kpi.tone-seal::after { background: var(--seal); }
.kpi.tone-ok::after { background: var(--ok); }
.kpi .k-label { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.kpi .k-val {
  font-family: var(--num-font); font-size: 25px; font-weight: 700;
  line-height: 1.15; letter-spacing: -.02em;
}
.kpi .k-val small { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.kpi .k-why { font-size: 11.5px; line-height: 1.5; color: var(--faint); }

/* 表格 */
.tbl-wrap { overflow-x: auto; border-radius: 0 0 var(--radius) var(--radius); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl caption { text-align: left; padding: 9px 14px; font-size: 12px; color: var(--muted); }
table.tbl th {
  position: relative; text-align: left; vertical-align: bottom;
  font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: .03em;
  padding: 8px 10px; background: var(--bg-2);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.tbl tbody tr { transition: background .12s; scroll-margin-top: 130px; }
table.tbl tbody tr:hover { background: #fafbfe; }
table.tbl tbody tr.is-open { background: var(--accent-soft); }
table.tbl tbody tr.row-flag td:first-child { box-shadow: inset 2px 0 0 var(--danger); }
table.tbl tbody tr.row-warn td:first-child { box-shadow: inset 2px 0 0 var(--warn); }
table.tbl td.num, table.tbl th.num {
  font-family: var(--num-font); font-variant-numeric: tabular-nums;
  text-align: right; white-space: nowrap;
}
table.tbl th.num .th-sort { justify-content: flex-end; width: 100%; }
table.tbl .cell-main { font-weight: 600; }
table.tbl .cell-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.th-sort {
  display: inline-flex; align-items: center; gap: 4px; min-height: 24px;
  font: inherit; color: inherit; border-radius: 4px; padding: 0 2px;
}
.th-sort:hover { color: var(--accent); }
.th-sort .si { width: 11px; height: 11px; opacity: .4; }
th[aria-sort] .th-sort { color: var(--accent-dk); font-weight: 700; }
th[aria-sort] .th-sort .si { opacity: 1; }

.link-btn {
  font: inherit; color: var(--accent); text-align: left;
  border-bottom: 1px solid transparent; border-radius: 2px;
}
.link-btn:hover { border-bottom-color: currentColor; }

.empty-state { padding: 40px 20px; text-align: center; color: var(--faint); font-size: 13px; line-height: 1.9; }

/* 扩展上下文 CTA */
.ext-cta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--seal-soft); border: 1px solid #ded6f7;
}
.ext-cta .ec-text { flex: 1 1 180px; min-width: 0; font-size: 11.5px; line-height: 1.55; color: #4b3d86; }
.ext-cta .ec-text b { display: block; font-size: 12.5px; color: #33285f; }
.ext-cta-row { display: inline-flex; align-items: center; gap: 6px; }
.ext-cta-row .ecr-id { font-family: var(--num-font); font-size: 11px; color: var(--muted); }

/* 抽屉 */
.drawer {
  position: fixed; inset: 0 0 0 auto; width: min(520px, 100%);
  max-width: 100%; max-height: 100%; height: 100%; margin: 0;
  padding: 0; border: none; border-left: 1px solid var(--line);
  background: var(--paper); box-shadow: var(--shadow-3);
  flex-direction: column; overflow: hidden;
}
.drawer::backdrop { background: rgba(11, 20, 36, .42); }
/* display must be gated on [open]; bare display:flex overrides UA dialog{display:none} and traps the panel open */
.drawer[open] { display: flex; animation: drawer-in .2s ease; }
@keyframes drawer-in { from { transform: translateX(24px); opacity: .4; } }
.dw-hd {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px 12px; border-bottom: 1px solid var(--line); background: var(--bg-2);
}
.dw-hd > div:first-child { flex: 1 1 auto; min-width: 0; }
.dw-hd .dw-kicker {
  display: flex; align-items: center; gap: 6px; margin-bottom: 3px;
  font-family: var(--num-font); font-size: 11px; color: var(--muted);
}
.dw-hd .dw-kicker svg { width: 13px; height: 13px; flex: 0 0 auto; color: var(--seal); }
.dw-hd h2 { font-size: 15.5px; font-weight: 700; line-height: 1.4; }
.dw-close {
  flex: 0 0 auto; width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: var(--radius-sm); color: var(--muted); border: 1px solid transparent;
}
.dw-close:hover { background: var(--paper); border-color: var(--line); color: var(--ink); }
.dw-bd { flex: 1 1 auto; overflow-y: auto; padding: 14px 16px 24px; display: flex; flex-direction: column; gap: 14px; }
.dw-block > h3 {
  font-size: 11px; font-weight: 700; letter-spacing: .09em;
  color: var(--muted); margin-bottom: 6px;
}
.dw-block p { font-size: 13px; line-height: 1.75; }
.dl-grid { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 5px 12px; font-size: 12.5px; }
.dl-grid dt { color: var(--muted); }
.dl-grid dd { font-weight: 500; word-break: break-word; }
.quote-clause {
  border-left: 3px solid var(--seal); background: var(--bg-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 11px 14px;
}
.ev-list { display: flex; flex-direction: column; gap: 6px; }
.ev-item {
  border: 1px solid var(--line-2); border-left: 2px solid var(--seal);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 7px 10px; background: var(--bg-2);
}
.ev-item .ev-k { font-family: var(--num-font); font-size: 11px; font-weight: 600; color: var(--seal); }
.ev-item .ev-t { font-size: 12px; line-height: 1.6; color: var(--ink-2); }
.tag-list { display: flex; flex-wrap: wrap; gap: 5px; }

/* 确认对话框 */
.dialog {
  border: none; border-radius: var(--radius); padding: 0; max-width: min(440px, calc(100% - 32px));
  box-shadow: var(--shadow-3); background: var(--paper); color: var(--ink);
}
.dialog::backdrop { background: rgba(11, 20, 36, .42); }
.dialog-bd { padding: 18px 20px 14px; }
.dialog-bd h2 { font-size: 15.5px; font-weight: 700; margin-bottom: 7px; }
.dialog-bd p { font-size: 13px; line-height: 1.7; color: var(--ink-2); }
.dialog-ft {
  display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px;
  border-top: 1px solid var(--line-2); background: var(--bg-2);
}

/* 吐司 */
#toast-wrap {
  position: fixed; bottom: 22px; left: calc(var(--rail-w) + 50%); transform: translateX(-50%);
  z-index: 80; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none;
}
.toast {
  background: var(--ink); color: #fff; padding: 8px 15px; border-radius: var(--radius-sm);
  font-size: 12.5px; box-shadow: var(--shadow-2); animation: toast-in .18s ease;
}
.toast.ok { background: var(--ok); }
.toast.warn { background: var(--warn); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ============================== 5. 页面片段 ============================== */
/* 变更提案卡 */
#amd-card {
  display: grid; grid-template-columns: minmax(0, 1fr) 292px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-1); overflow: hidden;
}
.amd-main { padding: 16px 18px 18px; border-left: 3px solid var(--seal); }
.amd-title { font-size: 16px; font-weight: 700; line-height: 1.45; margin-bottom: 8px; }
.amd-text {
  border-left: 2px solid var(--line); padding-left: 12px; margin-bottom: 14px;
  max-width: 68ch;
}
.delta-row { display: flex; gap: 10px; flex-wrap: wrap; }
.delta {
  flex: 1 1 240px; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--bg-2);
}
.delta .d-key { display: block; font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.delta .d-val { display: flex; align-items: baseline; gap: 8px; font-size: 15px; }
.delta .d-arrow { color: var(--faint); font-size: 13px; }
.delta .d-new { font-weight: 700; color: var(--danger); font-size: 17px; }

.amd-side {
  padding: 16px 18px; background: var(--bg-2); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 9px;
}
.amd-side .as-note { font-size: 12px; line-height: 1.65; color: var(--ink-2); }
.amd-side .as-hint { font-size: 11px; line-height: 1.55; color: var(--faint); }
.amd-side .as-meta { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 3px 10px; font-size: 11.5px; margin-top: 2px; }
.amd-side .as-meta dt { color: var(--faint); }
.amd-side .as-meta dd { color: var(--ink-2); word-break: break-all; }

/* 首页风险卡 */
.risk-card {
  display: flex; flex-direction: column; gap: 7px; padding: 13px 14px;
  background: var(--paper); border: 1px solid var(--line); border-left: 3px solid var(--danger);
  border-radius: var(--radius); box-shadow: var(--shadow-1);
}
.risk-card h3 { font-size: 13.5px; font-weight: 700; line-height: 1.5; }
.risk-card .rc-text { font-size: 12px; line-height: 1.7; color: var(--muted); }
.risk-card .btn { align-self: flex-start; margin-top: 2px; }

/* 状态清单 */
.status-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.status-list li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.status-list li i { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.status-list li b { margin-left: auto; font-size: 13px; }
.status-list li span { color: var(--ink-2); }
i.dot-st-todo { background: #c3cddd; }
i.dot-st-doing { background: var(--accent); }
i.dot-st-done { background: var(--ok); }
i.dot-st-blocked { background: var(--danger); }

/* 受阻任务 / 重点事项清单 */
.doc-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.doc-list > li { padding-left: 11px; border-left: 2px solid var(--line); }
.doc-list > li > p { font-size: 11.5px; line-height: 1.6; color: var(--muted); margin-top: 2px; }
.doc-list.tone-danger > li { border-left-color: var(--danger); }

/* 边界清单 */
.check-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.check-list li {
  position: relative; padding-left: 20px; font-size: 12.5px; line-height: 1.7; color: var(--ink-2);
}
.check-list li::before {
  content: ""; position: absolute; left: 3px; top: 8px; width: 7px; height: 7px;
  border-radius: 2px; background: var(--accent);
}
.check-list.tone-seal li::before { background: var(--seal); }

/* 条款卡 */
.clause-card {
  display: flex; flex-direction: column; gap: 9px; padding: 14px 16px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-1); scroll-margin-top: 120px;
}
.clause-card.is-target { border-left: 3px solid var(--danger); }
.clause-card .clause-text {
  border-left: 2px solid var(--line-2); padding-left: 13px; max-width: 76ch;
}
.clause-card b { font-size: 14px; }

/* 冲突卡 */
.conflict-card {
  display: flex; flex-direction: column; gap: 9px; padding: 13px 15px;
  background: var(--paper); border: 1px solid var(--line); border-left: 3px solid var(--danger);
  border-radius: var(--radius); box-shadow: var(--shadow-1); scroll-margin-top: 120px;
}
.conflict-card h3 { font-size: 14px; font-weight: 700; }
.cf-sides { display: grid; grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr); align-items: center; gap: 8px; }
.cf-sides > div > p { font-size: 12px; line-height: 1.65; margin-top: 3px; }
.cf-vs {
  display: grid; place-items: center; font-size: 10.5px; font-weight: 700;
  color: var(--danger); background: var(--danger-soft); border-radius: 999px; padding: 3px 0;
}

/* 本地状态覆盖清单 */
.override-list { list-style: none; display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.override-list li { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.override-list li span { color: var(--ink-2); font-family: var(--num-font); font-size: 11.5px; }

/* 图表脚注 */
.chart-meta {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  font-size: 12px; color: var(--ink-2);
}
.chart-meta b { font-size: 17px; font-weight: 700; color: var(--danger); }

@media (max-width: 1023px) {
  #amd-card { grid-template-columns: minmax(0, 1fr); }
  .amd-side { border-left: none; border-top: 1px solid var(--line); }
}
@media (max-width: 767px) {
  .cf-sides { grid-template-columns: minmax(0, 1fr); }
  .cf-vs { padding: 2px 10px; justify-self: start; }
}

/* ============================== 6. 图表 ============================== */
.chart { width: 100%; overflow-x: auto; }
.chart svg { display: block; width: 100%; height: auto; }
.chart-legend {
  display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px;
  font-size: 11.5px; color: var(--muted);
}
.chart-legend .lg { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend .lg i { width: 16px; height: 10px; border-radius: 2px; display: inline-block; flex: 0 0 auto; }
.chart-legend .lg i.solid-danger { background: var(--danger); }
.chart-legend .lg i.solid-accent { background: var(--accent); }
.chart-legend .lg i.solid-mute { background: #b6c1d2; }
.chart-legend .lg i.solid-ok { background: var(--ok); }
.chart-legend .lg i.solid-warn { background: var(--warn); }
.chart-legend .lg i.solid-seal { background: var(--seal); }
.chart-legend .lg i.out-danger { border: 1.6px solid var(--danger); background: #fffbfa; }
.chart-legend .lg i.out-warn { border: 1.4px dashed var(--warn); background: #fffdf7; }
.chart-legend .lg i.out-line { border: 1.2px solid var(--line); background: #fff; }

.ax-line { stroke: var(--line); stroke-width: 1; }
.ax-grid { stroke: var(--line-2); stroke-width: 1; }
.ax-label { font-size: 10px; fill: var(--muted); font-family: var(--num-font); }
.ax-title { font-size: 10.5px; fill: var(--faint); }
.val-label { font-size: 10.5px; fill: var(--ink-2); font-family: var(--num-font); font-weight: 600; }
.bar-base { fill: #cfd7e6; }
.bar-hot { fill: var(--danger); }
.bar-mid { fill: #e3897f; }
.bar-mute { fill: #b6c1d2; }
.bar-accent { fill: var(--accent); }
.mark-new { stroke: var(--danger); stroke-width: 2; stroke-dasharray: 5 3; }
.mark-old { stroke: var(--faint); stroke-width: 1.4; stroke-dasharray: 3 3; }
.mark-label { font-size: 10.5px; font-weight: 700; font-family: var(--num-font); }
.mark-label.new { fill: var(--danger); }
.mark-label.old { fill: var(--muted); }
.band-shade { fill: rgba(194, 53, 43, .07); }

/* 节点链 */
.chain-node { cursor: pointer; }
.chain-node .cn-box { fill: var(--paper); stroke: var(--line); stroke-width: 1.2; rx: 7; transition: fill .14s, stroke .14s; }
.chain-node .cn-name { font-size: 11.5px; font-weight: 600; fill: var(--ink); }
.chain-node .cn-meta { font-size: 10px; fill: var(--faint); font-family: var(--num-font); }
.chain-node .cn-cond { font-size: 10px; fill: var(--muted); }
.chain-node .cn-bar { rx: 1.5; fill: var(--line); }
.chain-node.risk-high .cn-box { stroke: var(--danger); stroke-width: 1.8; fill: #fffbfa; }
.chain-node.risk-high .cn-bar { fill: var(--danger); }
.chain-node.risk-mid .cn-box { stroke: var(--warn); stroke-width: 1.4; stroke-dasharray: 4 3; fill: #fffdf7; }
.chain-node.risk-mid .cn-bar { fill: var(--warn); }
.chain-node:hover .cn-box { fill: var(--accent-soft); }
.chain-node.is-open .cn-box { stroke: var(--accent); stroke-width: 2.2; fill: var(--accent-soft); }
.chain-node:focus { outline: none; }
.chain-node:focus-visible .cn-box { stroke: var(--accent); stroke-width: 2.4; }
.chain-node .cn-flag { font-size: 9.5px; font-weight: 700; fill: var(--danger); }
.chain-edge { fill: none; stroke: #c1cad9; stroke-width: 1.2; marker-end: url(#arrow-sm); }

/* 关系扇形图 */
.fan-edge { fill: none; stroke-width: 1.3; }
.fan-edge.rel-conflict { stroke: var(--danger); }
.fan-edge.rel-link { stroke: var(--warn); }
.fan-edge.rel-ref { stroke: #c1cad9; }
.fan-node { cursor: pointer; }
.fan-node .fn-box { fill: var(--paper); stroke: var(--line); stroke-width: 1.2; rx: 6; }
.fan-node .fn-name { font-size: 11.5px; fill: var(--ink); }
.fan-node .fn-id { font-size: 10px; fill: var(--faint); font-family: var(--num-font); }
.fan-node:hover .fn-box { fill: var(--accent-soft); stroke: var(--accent); }
.fan-node.rel-conflict .fn-box { stroke: var(--danger); }
.fan-node.rel-link .fn-box { stroke: var(--warn); }
.fan-node:focus-visible .fn-box { stroke: var(--accent); stroke-width: 2.4; }
.fan-core .fn-box { fill: var(--ink); stroke: var(--ink); }
.fan-core .fn-name { fill: #fff; font-weight: 700; }
.fan-core .fn-id { fill: #9fb0cc; }

/* 引用矩阵 */
.matrix { border-collapse: separate; border-spacing: 0; font-size: 12px; }
.matrix th { background: var(--bg-2); border-bottom: 1px solid var(--line); }
.matrix thead th { text-align: center; font-size: 11px; padding: 7px 6px; }
.matrix tbody th { text-align: left; font-weight: 500; color: var(--ink); white-space: nowrap; padding: 6px 10px; }
.matrix td { text-align: center; padding: 4px; border-bottom: 1px solid var(--line-2); }
.mx-cell {
  display: inline-grid; place-items: center; width: 24px; height: 22px;
  border-radius: 4px; font-size: 10px; font-weight: 700; font-family: var(--num-font);
}
.mx-cell.on-danger { background: var(--danger-soft); color: var(--danger); }
.mx-cell.on-warn { background: var(--warn-soft); color: var(--warn); }
.mx-cell.on-ref { background: var(--bg-3); color: var(--muted); }
.mx-cell.off { color: var(--line); }

/* 甘特图 */
.gantt-lane { fill: #fbfcfe; }
.gantt-lane.alt { fill: #fff; }
.gantt-name { font-size: 10.5px; fill: var(--ink-2); }
.gantt-id { font-size: 10px; fill: var(--faint); font-family: var(--num-font); }
.gantt-bar { rx: 3; cursor: pointer; }
.gantt-bar.st-todo { fill: #c3cddd; }
.gantt-bar.st-doing { fill: var(--accent); }
.gantt-bar.st-done { fill: var(--ok); }
.gantt-bar.st-blocked { fill: var(--danger); }
.gantt-bar:hover { opacity: .82; }
.gantt-bar.is-open { stroke: var(--ink); stroke-width: 2; }
.gantt-dep { fill: none; stroke: var(--faint); stroke-width: 1; stroke-dasharray: 3 2; marker-end: url(#arrow-dep); }
.gantt-eff { stroke: var(--seal); stroke-width: 1.6; stroke-dasharray: 4 3; }
.gantt-eff-label { font-size: 10px; fill: var(--seal); font-weight: 700; }

/* 圆环 */
.donut-track { fill: none; stroke: var(--line-2); }
.donut-seg { fill: none; stroke-linecap: butt; }
.donut-seg.st-todo { stroke: #c3cddd; }
.donut-seg.st-doing { stroke: var(--accent); }
.donut-seg.st-done { stroke: var(--ok); }
.donut-seg.st-blocked { stroke: var(--danger); }
.donut-center-val { font-family: var(--num-font); font-size: 22px; font-weight: 700; fill: var(--ink); text-anchor: middle; }
.donut-center-lbl { font-size: 10px; fill: var(--muted); text-anchor: middle; }

/* 散点带 */
.strip-axis { stroke: var(--line); stroke-width: 1; }
.strip-dot { cursor: pointer; stroke: #fff; stroke-width: 1.4; }
.strip-dot.in-new { fill: var(--danger); }
.strip-dot.in-old { fill: #8f9db3; }
.strip-dot.out { fill: #c6cfdd; }
.strip-dot.is-open { stroke: var(--ink); stroke-width: 2.4; }
.strip-dot:focus-visible { stroke: var(--accent); stroke-width: 2.6; }
.strip-label { font-size: 9.5px; fill: var(--muted); font-family: var(--num-font); }
.strip-urgent { fill: none; stroke: var(--warn); stroke-width: 1.6; }

/* 工作量条 */
.effort-row-label { font-size: 11.5px; fill: var(--ink-2); }
.effort-bar { rx: 3; }
.effort-bar.bound { fill: var(--accent); }
.effort-bar.plain { fill: #c3cddd; }
.effort-val { font-size: 10.5px; font-family: var(--num-font); font-weight: 600; fill: var(--ink-2); }

/* 展开行 */
.expand-row td { background: var(--bg-2); padding: 0; }
.expand-inner { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 11px; }
.expand-btn { display: inline-flex; align-items: center; gap: 5px; color: var(--accent); font-size: 12.5px; }
.expand-btn svg { width: 12px; height: 12px; transition: transform .16s; }
.expand-btn[aria-expanded="true"] svg { transform: rotate(90deg); }

/* 时间线（发布窗口 / 任务） */
.timeline { list-style: none; display: flex; flex-direction: column; }
.timeline li { display: flex; gap: 11px; }
.timeline .tl-rail { width: 12px; display: flex; flex-direction: column; align-items: center; flex: 0 0 auto; }
.timeline .tl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--seal); margin-top: 6px; flex: 0 0 auto; }
.timeline .tl-line { flex: 1 1 auto; width: 1px; background: var(--line); min-height: 12px; }
.timeline .tl-body { padding-bottom: 12px; min-width: 0; }
.timeline .tl-body b { font-size: 13px; }
.timeline .tl-body div { font-size: 11.5px; color: var(--muted); font-family: var(--num-font); }

/* 状态选择器 */
select.st-sel {
  min-height: 30px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 3px 6px; font-size: 12px; background: var(--paper);
}
select.st-sel.st-done { color: var(--ok); border-color: #bfe0cd; background: var(--ok-soft); }
select.st-sel.st-blocked { color: var(--danger); border-color: #edc4c0; background: var(--danger-soft); }
select.st-sel.st-doing { color: var(--accent-dk); border-color: #c3cdf0; background: var(--accent-soft); }

/* ============================== 7. 响应式 ============================== */
@media (max-width: 1180px) {
  .split-main { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1023px) {
  .rail {
    position: sticky; inset: 0 0 auto 0; width: auto; height: auto;
    border-right: none; border-bottom: 1px solid var(--rail-line); flex-direction: column;
  }
  .rail-head-row { display: flex; align-items: center; gap: 10px; }
  .rail-brand { flex: 1 1 auto; border-bottom: none; padding: 10px 12px; }
  .rail-toggle {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    width: 44px; height: 44px; margin-right: 10px; flex: 0 0 auto;
    border: 1px solid var(--rail-line); border-radius: 8px; color: var(--rail-ink);
    background: rgba(255, 255, 255, .05);
  }
  .rail-toggle:hover { background: rgba(255, 255, 255, .12); color: #fff; }
  .rail-toggle:focus-visible { outline-color: #7d9cf0; }
  .rail-panel { display: none; border-top: 1px solid var(--rail-line); }
  .rail-panel.is-open { display: block; }
  .rail-scroll { max-height: min(70vh, 460px); padding: 10px 10px 6px; }
  .rail-foot { padding: 8px 12px 12px; }
  .page { margin-left: 0; }
  .page-head { position: static; padding: 12px 16px 10px; backdrop-filter: none; background: var(--paper); }
  .clause-card, .conflict-card { scroll-margin-top: 24px; }
  .page-body { padding: 14px 16px 32px; }
  #toast-wrap { left: 50%; }
}

@media (max-width: 767px) {
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .page-head h1 { font-size: 17px; }
  .page-actions { margin-left: 0; width: 100%; }
  .page-actions .btn { flex: 1 1 auto; }
  .prov-strip .pv { padding: 0 10px 0 0; border-left: none; }
  .toolbar { padding: 10px 12px; }
  .toolbar .field, .toolbar .search-box { width: 100%; }
  .drawer { width: 100%; border-left: none; }

  /* 表格转卡片 */
  .tbl-cards thead { display: none; }
  .tbl-cards tbody tr {
    display: block; margin: 10px; padding: 10px 12px;
    border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
  }
  .tbl-cards tbody tr.is-open { border-color: var(--accent); }
  .tbl-cards tbody tr.row-flag { border-left: 3px solid var(--danger); }
  .tbl-cards tbody tr.row-warn { border-left: 3px solid var(--warn); }
  .tbl-cards tbody tr.expand-row { margin-top: -6px; }
  .tbl-cards td {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 4px 0; border: none; text-align: left;
  }
  table.tbl.tbl-cards td.num { text-align: left; justify-content: flex-start; }
  .tbl-cards td::before {
    content: attr(data-label); flex: 0 0 84px;
    font-size: 11.5px; color: var(--muted); font-family: var(--ui-font);
  }
  .tbl-cards td:empty { display: none; }
  .tbl-cards tbody tr.row-flag td:first-child,
  .tbl-cards tbody tr.row-warn td:first-child { box-shadow: none; }
  .matrix { font-size: 11px; }
}

@media (max-width: 400px) {
  .page-head { padding: 10px 12px 9px; }
  .page-body { padding: 12px 12px 28px; }
  .kpi-grid { grid-template-columns: minmax(0, 1fr); }
  .tbl-cards td::before { flex-basis: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ============================== 8. 打印 ============================== */
@media print {
  @page { size: A4; margin: 14mm 12mm 16mm; }
  body { background: #fff; font-size: 10.5pt; }
  .rail, .rail-toggle, .toolbar, .page-actions, .ext-cta, .btn,
  .expand-btn, .th-sort .si, #toast-wrap, .dialog, .drawer, .chart-legend { display: none !important; }
  .page { margin-left: 0; }
  .page-head { position: static; border-bottom: 2px solid var(--ink); padding: 0 0 8px; background: none; }
  .page-head h1 { font-size: 15pt; }
  .prov-strip { margin-top: 8px; }
  .prov-strip .pv { padding: 0 12px 0 0; border-left: none; }
  .page-body { padding: 10px 0 0; gap: 12px; }
  .card, .kpi, .note { box-shadow: none; break-inside: avoid; }
  table.tbl { font-size: 9pt; }
  table.tbl th, table.tbl td { border: 1px solid #bbb; padding: 3px 5px; }
  .expand-row { display: none; }
  .card-hd { break-after: avoid; }
}
