/* 衣证 · 最小可用样式（阶段 2 功能优先，视觉稿后置）
 * 目标：不 404、能读、能点、能打印。三视图 + 五态卡片的基本排版。
 */

:root {
  --ink: #1c1b19;
  --ink2: #4a463e;
  --muted: #7a7468;
  --line: #ddd6c8;
  --line2: #eae4d8;
  --bg: #f3efe6;
  --card: #fffdf8;
  --paper: #fbf8f1;
  --accent: #a8452f;
  --deep: #3f5f52;
  --warn: #8a5a1e;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(28, 27, 25, .06), 0 10px 28px rgba(28, 27, 25, .05);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }
.is-hidden { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
a { color: inherit; }

.wrap { width: min(1160px, calc(100% - 48px)); margin: 0 auto; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; }

/* ---------------- 顶栏 ---------------- */

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 24px;
  padding: 12px 24px;
  background: rgba(250, 247, 240, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-seal {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--accent); color: #fff; font-weight: 700;
}
.brand-seal.sm { width: 26px; height: 26px; border-radius: 7px; font-size: 13px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text b { font-size: 16px; }
.brand-text small { color: var(--muted); font-size: 11px; letter-spacing: .08em; }

.topnav { display: flex; gap: 4px; margin-left: 8px; }
.navlink {
  border: 0; background: transparent; padding: 8px 12px;
  border-radius: 8px; color: var(--ink2); cursor: pointer;
}
.navlink:hover { background: rgba(28, 27, 25, .05); }
.navlink.is-active { background: var(--ink); color: #fff; }

.top-actions { margin-left: auto; display: flex; gap: 8px; }

/* ---------------- 按钮 ---------------- */

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid transparent; border-radius: 10px;
  padding: 10px 16px; background: transparent; cursor: pointer;
  transition: transform .06s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-lg { padding: 13px 22px; font-size: 16px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #933a27; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: #000; }
.btn-line { border-color: var(--line); background: var(--card); }
.btn-line:hover { border-color: var(--ink2); }
.btn-ghost { border-color: transparent; color: var(--ink2); }
.btn-ghost:hover { background: rgba(28, 27, 25, .05); }
.linkbtn { border: 0; background: none; color: var(--ink2); cursor: pointer; padding: 4px 0; text-align: left; }
.linkbtn:hover { color: var(--accent); }

.icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------------- 首页 ---------------- */

.view { padding: 40px 0 64px; }

.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.kicker { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.kicker-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

.hero-copy h1 { font-size: clamp(30px, 4vw, 46px); line-height: 1.22; margin: 14px 0 16px; }
.hero-copy .mark { color: var(--accent); }
.lede { color: var(--ink2); font-size: 17px; max-width: 34em; }

.hero-cta { display: flex; gap: 12px; margin: 26px 0 22px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 28px; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats b { font-size: 22px; }
.hero-stats span { color: var(--muted); font-size: 12px; }

.hero-visual { position: relative; min-height: 300px; }
.dossier {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px;
  transform: rotate(-1.2deg);
}
.dossier-back { position: absolute; inset: 12px -10px -12px 10px; background: #e9e3d5; border-radius: var(--radius); transform: rotate(2deg); }
.dossier-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); }
.mini-stamp { border: 1px solid var(--accent); color: var(--accent); border-radius: 4px; padding: 1px 6px; font-size: 11px; }
.dossier-title { font-size: 20px; font-weight: 700; margin: 12px 0 10px; line-height: 1.35; }
.dossier-tags { display: flex; gap: 6px; }
.dossier-tags span { background: #eee8da; border-radius: 999px; padding: 2px 10px; font-size: 12px; color: var(--ink2); }
.dossier-score { display: flex; align-items: center; gap: 12px; margin: 16px 0; }
.mini-ring { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--deep) 86%, #e6e0d2 0); }
.mini-ring span { width: 42px; height: 42px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-weight: 700; }
.dossier-score-copy { display: flex; flex-direction: column; }
.dossier-score-copy small { color: var(--muted); }
.dossier-rows div { display: flex; justify-content: space-between; padding: 6px 0; border-top: 1px dashed var(--line); font-size: 13px; }
.is-accent { color: var(--accent); }
.dossier-doc { display: flex; justify-content: space-between; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--ink2); font-size: 13px; }
.seal { position: absolute; right: -8px; bottom: -14px; width: 74px; height: 74px; border: 2px solid var(--accent); color: var(--accent); border-radius: 50%; display: grid; place-items: center; font-weight: 700; transform: rotate(-8deg); background: rgba(251, 248, 241, .8); }
.seal small { display: block; font-size: 9px; font-weight: 400; }
.hero-note { position: absolute; left: -4px; bottom: -30px; color: var(--muted); font-size: 12px; }

.demo-strip { margin-top: 56px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.demo-strip-label { color: var(--muted); font-size: 13px; }
.demo-strip-list { display: flex; gap: 10px; flex-wrap: wrap; }
.demo-chip {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  border: 1px solid var(--line); background: var(--card); border-radius: 10px;
  padding: 8px 14px; cursor: pointer; text-align: left;
}
.demo-chip:hover { border-color: var(--ink2); }
.demo-chip b { font-size: 13px; }
.demo-chip small { color: var(--muted); font-size: 11px; }

.home-band { margin-top: 48px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.band-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.band-no { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.band-item b { display: block; margin: 6px 0 4px; font-size: 16px; }
.band-item p { color: var(--ink2); font-size: 13px; }

/* ---------------- 工作台 ---------------- */

.work-grid { display: grid; grid-template-columns: 236px 1fr; gap: 28px; align-items: start; }

.rail { position: sticky; top: 76px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.rail-case { display: flex; flex-direction: column; gap: 2px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.rail-case small { color: var(--muted); font-size: 12px; }
.rail-steps { margin: 12px 0; display: flex; flex-direction: column; gap: 2px; }
.rail-steps li { display: flex; gap: 10px; padding: 8px; border-radius: 8px; color: var(--muted); }
.rail-steps li span { font-family: var(--mono); font-size: 11px; padding-top: 3px; }
.rail-steps li b { display: block; font-size: 13px; color: var(--ink2); }
.rail-steps li small { font-size: 11px; }
.rail-steps li.is-active { background: #f0ebdf; }
.rail-steps li.is-active b { color: var(--ink); }
.rail-steps li.is-done b { color: var(--deep); }
.rail-foot { display: flex; flex-direction: column; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.rail-disclaimer { color: var(--muted); font-size: 11px; margin-top: 4px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.step { padding: 24px; }
.step + .step { margin-top: 20px; }

.step-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.step-no { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--muted); }
.step-head h2 { font-size: 22px; margin-top: 6px; }
.step-badge { background: #efe9dc; color: var(--ink2); border-radius: 999px; padding: 4px 10px; font-size: 12px; white-space: nowrap; }
.step-lead { color: var(--ink2); margin-bottom: 16px; }

.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.field label { font-weight: 600; font-size: 13px; }
textarea, input[type="text"], input[type="number"], input[type="url"], input[type="password"], select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  padding: 10px 12px; font: inherit; color: var(--ink);
}
textarea { resize: vertical; min-height: 120px; }
textarea:focus, input:focus, select:focus { outline: 2px solid rgba(168, 69, 47, .25); border-color: var(--accent); }
.field-foot { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; gap: 12px; }

.demo-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; color: var(--muted); font-size: 13px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 12px; cursor: pointer; font-size: 12px; }
.chip:hover { border-color: var(--accent); color: var(--accent); }

.form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }

.upload-head { display: flex; justify-content: space-between; align-items: baseline; margin: 18px 0 10px; }
.upload-head h3 { font-size: 15px; }
.upload-head span { color: var(--muted); font-size: 12px; }
.upload-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.up-slot {
  position: relative; display: flex; flex-direction: column; gap: 4px;
  border: 1px dashed var(--line); border-radius: 10px; padding: 14px; cursor: pointer;
  background: #fbf9f3; min-height: 92px; justify-content: flex-end;
}
.up-slot:hover { border-color: var(--accent); }
.up-slot.has-img { border-style: solid; }
.up-plus { font-size: 20px; color: var(--muted); line-height: 1; }
.up-slot b { font-size: 13px; }
.up-slot small { color: var(--muted); font-size: 11px; }
.up-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 10px; opacity: .28; }

.step-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line2); flex-wrap: wrap; }
.step-actions .hint { color: var(--muted); font-size: 12px; flex: 1; min-width: 200px; }
.action-group { display: flex; gap: 8px; }

/* 路由 */
.route-list { display: flex; flex-direction: column; gap: 10px; }
.route-card {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: #fff;
}
.route-card:hover { border-color: var(--ink2); }
.route-card.is-on { border-color: var(--deep); box-shadow: inset 0 0 0 1px var(--deep); background: #f7faf8; }
.route-card input, .route-chip input, .ev-row input { accent-color: var(--accent); width: 16px; height: 16px; }
.route-glyph { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-weight: 700; flex: none; }
.route-body { display: flex; flex-direction: column; flex: 1; }
.route-body b { font-size: 15px; }
.route-body small { color: var(--muted); font-size: 12px; }
.route-conf { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.route-more { border: 1px dashed var(--line); border-radius: 12px; padding: 12px; }
.route-more-label { color: var(--muted); font-size: 12px; display: block; margin-bottom: 8px; }
.route-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.route-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: 13px; background: #fff; }
.route-chip.is-on { border-color: var(--deep); background: #f7faf8; }

/* 定性 */
.verdict { background: #f6f1e6; border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 18px; }
.verdict-lean { display: inline-block; font-weight: 700; margin-right: 10px; }
.verdict-lean.lean-merchant { color: var(--accent); }
.verdict-lean.lean-negotiate { color: var(--warn); }
.verdict-lean.lean-insufficient { color: var(--muted); }
.verdict-lean.lean-reference { color: var(--deep); }
.verdict-conf { color: var(--muted); font-size: 12px; }
.verdict p { margin-top: 8px; color: var(--ink2); }

.diag-list { display: flex; flex-direction: column; gap: 14px; }
.diag-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: #fff; }
.diag-card header { display: flex; align-items: center; gap: 10px; }
.diag-glyph { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-weight: 700; }
.diag-card header div { display: flex; flex-direction: column; line-height: 1.3; }
.diag-card header small { color: var(--muted); font-size: 12px; }
.diag-card h3 { font-size: 16px; margin: 10px 0 8px; }
.diag-reasons li { position: relative; padding-left: 14px; color: var(--ink2); font-size: 14px; margin-bottom: 4px; }
.diag-reasons li::before { content: "·"; position: absolute; left: 2px; color: var(--accent); }
.diag-caveat { margin-top: 8px; background: #fdf6ec; border-left: 3px solid var(--warn); padding: 8px 10px; color: var(--warn); font-size: 13px; }
.diag-rules { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
.diag-rules-label { font-size: 12px; color: var(--muted); }
.diag-rules li { font-size: 13px; margin-top: 4px; }
.diag-rules li b { color: var(--ink); }
.diag-rules li span { color: var(--ink2); margin-left: 6px; }
/* 依据区「官方原文」链接（多分册标准按人群给出；打印时隐藏） */
.rule-src { margin-left: 8px; font-size: 12px; color: var(--accent); text-decoration: none; border-bottom: 1px dashed currentColor; }
.rule-src:hover { color: var(--deep); }
@media print { .rule-src { display: none; } }

/* 取证 */
.evidence-top { display: flex; gap: 24px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.score-ring { position: relative; width: 120px; height: 120px; flex: none; }
.score-ring svg { transform: rotate(-90deg); }
.ring-bg, .ring-fg { fill: none; stroke-width: 10; }
.ring-bg { stroke: #e8e2d4; }
.ring-fg { stroke: var(--deep); stroke-linecap: round; stroke-dasharray: 327; stroke-dashoffset: 127; transition: stroke-dashoffset .3s ease; }
.score-copy { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; }
.score-copy b { font-size: 28px; line-height: 1; }
.score-copy span { font-size: 11px; color: var(--muted); }
.evidence-copy { flex: 1; min-width: 240px; }
.score-label { font-weight: 700; }
.score-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.chip-stat { background: #eee8da; border-radius: 999px; padding: 3px 10px; font-size: 12px; }
.missing-callout { background: #fdf6ec; border: 1px solid #ecd9bd; border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 2px; }
.missing-callout b { color: var(--warn); }
.missing-callout span { color: var(--ink2); font-size: 13px; }
.evidence-list { display: flex; flex-direction: column; gap: 6px; }
.ev-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line2); border-radius: 10px; cursor: pointer; background: #fff; }
.ev-row.is-on { border-color: var(--deep); background: #f7faf8; }
.ev-main { display: flex; flex-direction: column; flex: 1; }
.ev-main b { font-size: 14px; }
.ev-main small { color: var(--muted); font-size: 12px; }
.ev-meta { color: var(--muted); font-size: 12px; white-space: nowrap; }
.ev-meta em { color: var(--accent); font-style: normal; }
.l0-panel { margin-top: 16px; border: 1px dashed var(--line); border-radius: 10px; padding: 12px; }
.l0-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.l0-badge { background: var(--ink); color: #fff; border-radius: 4px; padding: 1px 6px; font-size: 11px; }
.l0-items { display: flex; gap: 14px; flex-wrap: wrap; margin: 8px 0; color: var(--deep); font-size: 12px; }
.l0-panel p { color: var(--muted); font-size: 12px; }

/* 文书 */
.doc-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.doc-tab { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: 13px; }
.doc-tab.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.paper-wrap { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); overflow: hidden; }
.paper { padding: 28px 32px; min-height: 420px; max-height: 62vh; overflow: auto; white-space: pre-wrap; font-family: "Songti SC", "Noto Serif SC", Georgia, serif; font-size: 14px; line-height: 1.9; outline: none; }
.doc-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.doc-actions .hint { color: var(--muted); font-size: 12px; flex: 1; min-width: 180px; }
.plan-head { margin: 26px 0 12px; }
.plan-head h3 { font-size: 18px; margin: 4px 0; }
.plan-head p { color: var(--muted); font-size: 13px; }
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.plan-step { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fff; }
.plan-step span { font-family: var(--mono); font-size: 11px; color: var(--accent); }
.plan-step b { display: block; margin: 4px 0; font-size: 14px; }
.plan-step p { color: var(--ink2); font-size: 12px; }
.final-actions { display: flex; gap: 10px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line2); }

/* ---------------- 方法页 ---------------- */

.method-wrap { display: flex; flex-direction: column; gap: 32px; }
.method-head h1 { font-size: clamp(26px, 3.4vw, 38px); line-height: 1.3; margin: 10px 0 12px; }
.method-section h2 { display: flex; align-items: center; gap: 10px; font-size: 19px; margin-bottom: 12px; }
.method-section h2 span { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.method-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.method-table th, .method-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line2); font-size: 13px; vertical-align: top; }
.method-table th { background: #f2ecdf; font-size: 12px; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.method-note { color: var(--muted); font-size: 12px; margin-top: 8px; }
.tag { border-radius: 999px; padding: 2px 8px; font-size: 11px; white-space: nowrap; }
.tag-deep { background: #e5efe9; color: var(--deep); }
.tag-beta { background: #f6ecdc; color: var(--warn); }
.tag-out { background: #efe9e2; color: var(--muted); }
.flow-grid, .dual-grid, .bench-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.dual-grid { grid-template-columns: repeat(2, 1fr); }
.flow-card, .dual-card, .bench-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.flow-card span { font-family: var(--mono); font-size: 11px; color: var(--accent); }
.flow-card b, .bench-card b { display: block; margin: 4px 0; }
.flow-card p, .bench-card p, .dual-card p { color: var(--ink2); font-size: 13px; }
.dual-tag { display: inline-block; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; margin-bottom: 6px; }
.dual-card ul { margin: 8px 0; }
.dual-card li { font-size: 13px; color: var(--ink2); padding-left: 12px; position: relative; }
.dual-card li::before { content: "·"; position: absolute; left: 2px; color: var(--accent); }
.formula { background: var(--ink); color: #f6f1e6; border-radius: 10px; padding: 14px 16px; font-family: var(--mono); font-size: 13px; margin-top: 10px; }
.thresholds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.thresholds div { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px; text-align: center; }
.thresholds b { display: block; font-size: 17px; }
.thresholds span { color: var(--muted); font-size: 12px; }
.redlines { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.redlines div { background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; padding: 12px; }
.redlines b { display: block; }
.redlines span { color: var(--ink2); font-size: 12px; }
.tech-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tech-row span { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 4px 12px; font-size: 12px; color: var(--ink2); }
/* 方法页「不做」行：虚线 + 弱化，与已实现栈区分 */
.tech-row-off { margin-top: 8px; }
.tech-row-off span { border-style: dashed; background: transparent; color: var(--muted); }
.method-note + .tech-row-off { margin-top: 10px; }
.method-cta { margin-top: 14px; }

/* ---------------- 页脚 ---------------- */

.site-footer { border-top: 1px solid var(--line); background: #efe9dc; padding: 28px 0 18px; margin-top: 20px; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 24px; }
.footer-brand { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.site-footer p, .site-footer span { color: var(--ink2); font-size: 12px; }
.footer-links { display: flex; flex-direction: column; gap: 4px; }
.footer-links b { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.footer-links a { font-size: 12px; text-decoration: none; color: var(--ink2); }
.footer-links a:hover { color: var(--accent); }
.footer-bottom { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }

/* ---------------- 弹窗 / Toast ---------------- */

.dlg { border: 1px solid var(--line); border-radius: 16px; padding: 0; width: min(520px, calc(100% - 32px)); background: var(--card); box-shadow: 0 24px 64px rgba(0, 0, 0, .18); }
.dlg::backdrop { background: rgba(28, 27, 25, .35); }
.dlg form { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.dlg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.dlg-head h3 { font-size: 18px; margin-top: 2px; }
.dlg-lead { color: var(--ink2); font-size: 13px; }
.dlg-field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.checkline { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.checkline input { width: 16px; height: 16px; accent-color: var(--accent); }
.dlg-note { color: var(--muted); font-size: 11px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.iconbtn { border: 0; background: transparent; cursor: pointer; padding: 4px; border-radius: 8px; }
.iconbtn:hover { background: rgba(28, 27, 25, .06); }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 12px);
  background: var(--ink); color: #fff; border-radius: 999px; padding: 10px 20px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: all .2s ease; z-index: 60;
  max-width: min(560px, calc(100% - 32px)); text-align: center;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- 响应式 ---------------- */

@media (max-width: 900px) {
  .hero-grid, .work-grid { grid-template-columns: 1fr; }
  .rail { position: static; }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .upload-grid, .plan-grid, .flow-grid, .bench-grid, .redlines { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
}
@media (max-width: 560px) {
  .wrap { width: calc(100% - 28px); }
  .topbar { padding: 10px 14px; gap: 10px; }
  .topnav { display: none; }
  .form-grid, .upload-grid, .plan-grid, .flow-grid, .dual-grid, .bench-grid, .redlines, .thresholds { grid-template-columns: 1fr; }
  .step { padding: 16px; }
}

/* ---------------- 打印 ---------------- */

@media print {
  body { background: #fff; }
  .topbar, .site-footer, .rail, .doc-tabs, .doc-actions, .plan-head, .plan-grid,
  .final-actions, .step-head .step-badge, .toast, .dlg, .step-actions { display: none !important; }
  .work-grid { display: block; }
  .step { border: 0; box-shadow: none; padding: 0; }
  .paper-wrap { border: 0; background: #fff; }
  .paper { max-height: none; overflow: visible; padding: 0; font-size: 12pt; }
  .view:not(#view-work) { display: none !important; }
}
