/* Hallmark · redesign · genre: editorial workbench · theme: Atelier Zero (Open Design direction B)
 * structure: top hairline nav + centered paper sheet + roman-numbered chapters
 * pre-emit critique: P5 H5 E5 S5 R5 V5
 * honest: pass · chrome: pass · tokens: pass · responsive: 320/375/390/414/768/1440
 */

@font-face {
  font-family: "Inter Tight";
  src: url("/fonts/inter-tight-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-var.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("/fonts/playfair-italic-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #efe7d2;
  --paper-warm: #ece4cf;
  --paper-dark: #ddd2b6;
  --bone: #f7f1de;
  --surface-field: #fffdf6;
  --ink: #15140f;
  --ink-soft: #2a2620;
  --ink-mute: #5a5448;
  --ink-faint: #8b8676;
  --coral: #ed6f5c;
  --coral-soft: #f08e7c;
  --coral-dark: #a94031;
  --mustard: #e9b94a;
  --gold-dark: #7c5b0a;
  --olive: #6e7448;
  --danger: #a64236;
  --danger-soft: #f5e3df;
  --success-soft: #e6eee4;
  --line: rgba(21, 20, 15, .16);
  --line-soft: rgba(21, 20, 15, .08);
  --line-strong: rgba(21, 20, 15, .38);
  --backdrop: rgba(23, 22, 17, .5);
  --shadow-sheet: 0 30px 60px -30px rgba(21, 20, 15, .16);
  --shadow-float: 0 24px 70px rgba(62, 48, 30, .24);
  --sans: "Inter Tight", -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", system-ui, sans-serif;
  --body: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", system-ui, sans-serif;
  --serif: "Playfair Display", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { min-width: 320px; overflow-x: clip; scroll-behavior: smooth; scroll-padding-top: 90px; background: var(--paper); }
body {
  margin: 0; min-height: 100dvh; overflow-x: clip;
  background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: 15px; line-height: 1.62;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: 60; pointer-events: none;
  background-image:
    radial-gradient(ellipse 60% 40% at 18% 8%, rgba(106, 92, 56, .06), transparent 70%),
    radial-gradient(ellipse 50% 45% at 86% 88%, rgba(106, 92, 56, .06), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  background-blend-mode: multiply;
  opacity: .06;
}
::selection { background: var(--coral); color: var(--bone); }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
button, select, a, .choice { -webkit-tap-highlight-color: rgba(237, 111, 92, .2); touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--coral); outline-offset: 3px; }
[hidden] { display: none !important; }

.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; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; padding: 10px 14px; background: var(--ink); color: var(--bone); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

/* ============ 顶部元信息条 ============ */
.meta-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 7px 64px; border-bottom: 1px solid var(--line);
  font-family: var(--sans); font-size: 10.5px; letter-spacing: .06em; color: var(--ink-faint);
}
.meta-strip .mid { color: var(--ink-mute); }
.meta-strip .right { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 10px; letter-spacing: .04em; }
.connection-dot { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--mustard); animation: pulse 2.4s ease-in-out infinite; }
.connection-dot.ok { background: var(--olive); }
.connection-dot.error { background: var(--danger); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ============ 顶部细导航 ============ */
.topnav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
  height: 58px; padding: 0 64px;
  background: var(--paper); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 10px; font-family: var(--sans); font-weight: 800; font-size: 15px; letter-spacing: -.02em; white-space: nowrap; }
.brand .mark { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 20px; color: var(--coral); transform: translateY(2px); }
.brand .sub { font-family: var(--mono); font-weight: 400; font-size: 9.5px; letter-spacing: .14em; color: var(--ink-faint); }
.topnav-links { display: flex; gap: 30px; margin: 0; padding: 0; list-style: none; }
.nav-item {
  position: relative; display: inline-block;
  font-family: var(--sans); font-weight: 600; font-size: 12.5px; letter-spacing: .04em;
  color: var(--ink-mute); padding: 20px 0 18px; white-space: nowrap;
  transition: color .18s ease;
}
.nav-item:hover { color: var(--ink); }
.nav-item.is-active { color: var(--ink); }
.nav-item.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--coral); }
.identity { display: flex; align-items: center; gap: 10px; min-width: 0; flex-shrink: 1; }
.identity select {
  max-width: 220px; min-width: 0; min-height: 36px; padding: 4px 30px 4px 12px;
  border: 1px solid var(--line); border-radius: 999px; background: transparent;
  color: var(--ink-mute); font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238b8676' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  cursor: pointer;
}
.identity select:hover { border-color: var(--line-strong); color: var(--ink); }

/* ============ 侧栏竖轨（桌面装饰） ============ */
.session-chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; color: var(--ink-mute);
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; min-height: 36px;
}
.session-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--olive); }
.session-logout {
  border: 0; background: none; cursor: pointer;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; color: var(--ink-faint);
  padding: 6px 2px; border-bottom: 1px solid transparent;
}
.session-logout:hover { color: var(--coral-dark); border-bottom-color: var(--coral); }

/* ============ 登录 ============ */
.login-wrap { display: grid; place-items: start center; padding-top: clamp(12px, 4vh, 48px); }
.login-card { width: min(560px, 100%); }
.login-card h1 {
  margin: 0 0 18px; font-family: var(--sans); font-weight: 800;
  font-size: clamp(30px, 4vw, 44px); line-height: 1.12; letter-spacing: -.028em;
  text-wrap: balance; overflow-wrap: anywhere;
}
.login-card h1 em { font-family: var(--serif); font-style: italic; font-weight: 500; }
.login-card form { margin-top: 34px; display: grid; gap: 10px; }
.login-label {
  margin-top: 12px; font-family: var(--mono); font-size: 10px;
  letter-spacing: .18em; text-transform: uppercase; color: var(--ink-faint);
}
.login-card input {
  width: 100%; min-height: 48px; padding: 10px 16px;
  border: 1px solid var(--line-strong); border-radius: 0; background: transparent;
  color: var(--ink); font-family: var(--mono); font-size: 15px; letter-spacing: .06em;
}
.login-card input:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; }
.login-code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: stretch; }
.login-code-row .button { white-space: nowrap; min-height: 48px; }
.login-submit { margin-top: 22px; min-height: 52px; font-size: 14px; }
.login-note { margin: 8px 0 0; font-size: 12px; color: var(--ink-faint); }

body[data-view="login"] .topnav-links,
body[data-view="login"] .identity,
body[data-view="login"] .bottombar { display: none; }

.rail { position: fixed; top: 0; bottom: 0; width: 36px; display: flex; align-items: center; justify-content: center; z-index: 30; pointer-events: none; }
.rail.left { left: 0; border-right: 1px solid var(--line-soft); }
.rail.right { right: 0; border-left: 1px solid var(--line-soft); }
.rail span { writing-mode: vertical-rl; font-family: var(--sans); font-weight: 600; font-size: 10px; letter-spacing: .42em; text-transform: uppercase; color: var(--ink-faint); white-space: nowrap; }

/* ============ 大纸面 ============ */
.sheet-wrap { max-width: 1080px; margin: 56px auto 120px; padding: 0 48px; }
.sheet {
  background: var(--bone); border: 1px solid var(--line); border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(21, 20, 15, .04), var(--shadow-sheet);
  padding: 72px 72px 88px;
}
.status-banner { margin: 0 0 22px; padding: 10px 16px; border: 1px solid var(--line); border-left: 3px solid var(--mustard); background: var(--paper-warm); font-size: 13px; }
.status-banner.error { border-left-color: var(--danger); background: var(--danger-soft); }
.status-banner.success { border-left-color: var(--olive); background: var(--success-soft); }

.page-enter { animation: page-in 190ms ease-out both; }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ============ 卷首与章节规则 ============ */
.section-rule { display: flex; align-items: baseline; gap: 18px; border-top: 1px solid var(--ink); padding-top: 14px; margin: 0 0 40px; }
.section-rule .roman { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 14px; color: var(--coral); }
.section-rule .meta { flex: 1; text-align: center; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.section-rule .page { font-family: var(--sans); font-size: 11px; color: var(--ink-faint); letter-spacing: .08em; }
.section-rule.sub { margin: 72px 0 40px; }

.folio-head { margin-bottom: 56px; }
.eyebrow { display: flex; align-items: center; gap: 12px; margin: 0 0 22px; font-family: var(--sans); font-weight: 600; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--coral); }
.eyebrow::before { content: ""; width: 18px; height: 1px; flex: none; background: var(--coral); }
.folio-head h1, .question-card h1 {
  min-width: 0; max-width: 16em; margin: 0 0 18px;
  font-family: var(--sans); font-weight: 800;
  font-size: clamp(34px, 4.6vw, 56px); line-height: 1.08; letter-spacing: -.03em;
  text-wrap: balance; overflow-wrap: anywhere; scroll-margin-top: 90px;
}
.folio-head h1 em, .sec-title em { font-family: var(--serif); font-style: italic; font-weight: 500; letter-spacing: -.01em; }
.folio-head .dot, .sec-title .dot { color: var(--coral); font-style: normal; }
.folio-lede { max-width: 44em; margin: 0; color: var(--ink-mute); font-size: 15px; }
.folio-meta { display: flex; flex-wrap: wrap; gap: 8px 34px; margin-top: 26px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; color: var(--ink-faint); }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

.sec-title { margin: 0 0 10px; font-family: var(--sans); font-weight: 800; font-size: clamp(23px, 2.6vw, 32px); letter-spacing: -.026em; line-height: 1.15; text-wrap: balance; }
.sec-lede { max-width: 46em; margin: 0 0 32px; color: var(--ink-mute); font-size: 14px; }

/* ============ 按钮 ============ */
.button {
  min-height: 44px; padding: 11px 22px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid rgba(21, 20, 15, .24); border-radius: 999px;
  background: transparent; color: var(--ink);
  font-family: var(--sans); font-weight: 600; font-size: 13px; letter-spacing: .01em;
  cursor: pointer; white-space: nowrap;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}
.button:hover { transform: translateY(-1px); background: rgba(21, 20, 15, .05); }
.button:active { transform: translateY(0); }
.button[aria-busy="true"]::after { content: "…"; }
.button.coral, .button.primary { background: var(--coral); border-color: var(--coral); color: #fdfaf2; box-shadow: 0 14px 26px -16px rgba(237, 111, 92, .9); }
.button.coral:hover, .button.primary:hover { background: var(--coral-soft); border-color: var(--coral-soft); }
.button.secondary { background: transparent; }
.button.danger { background: var(--danger); border-color: var(--danger); color: #fdfaf2; }
.button.ghost { padding-inline: 6px; min-height: 40px; border-color: transparent; background: transparent; text-decoration: underline; text-underline-offset: 4px; }
.button:disabled { cursor: not-allowed; opacity: .48; transform: none; box-shadow: none; }

.status-pill {
  width: fit-content; display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; color: var(--ink-soft);
  background: var(--bone); white-space: nowrap;
}
.status-pill::before { content: ""; width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--ink-faint); }
.status-pill.success { color: var(--olive); border-color: rgba(110, 116, 72, .45); }
.status-pill.success::before { background: var(--olive); }
.status-pill.gold { color: var(--gold-dark); border-color: rgba(233, 185, 74, .6); }
.status-pill.gold::before { background: var(--mustard); }
.status-pill.danger { color: var(--danger); border-color: rgba(166, 66, 54, .4); }
.status-pill.danger::before { background: var(--danger); }

/* ============ I. 当前案卷（dossier） ============ */
.case-strip { border: 1px solid var(--line); border-radius: 2px; background: var(--paper-warm); padding: 30px 32px 26px; }
.case-strip-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px 26px; }
.case-owner { min-width: 0; }
.case-owner span, .case-stat span { display: block; margin-bottom: 6px; font-family: var(--sans); font-weight: 600; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); }
.case-owner strong { display: block; font-family: var(--sans); font-weight: 800; font-size: 20px; letter-spacing: -.02em; line-height: 1.25; overflow-wrap: anywhere; }
.case-stat { min-width: 0; }
.case-stat strong { display: block; font-family: var(--mono); font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* ============ II. 运行链（工序表） ============ */
.operating-chain { margin-top: 72px; }
.operating-chain-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.operating-chain-head > div { min-width: 0; }
.chain-index { display: block; margin-bottom: 8px; font-family: var(--mono); font-size: 10px; letter-spacing: .12em; color: var(--coral-dark); }
.operating-chain-head h2 { margin: 0; font-family: var(--sans); font-weight: 800; font-size: clamp(21px, 2.4vw, 28px); letter-spacing: -.024em; }
.operating-chain-head p { margin: 0; color: var(--ink-faint); font-family: var(--mono); font-size: 10.5px; letter-spacing: .05em; white-space: nowrap; }
.operating-map { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); list-style: none; border-top: 1px solid var(--ink); }
.operating-map li { position: relative; padding: 20px 16px 18px 0; border-right: 1px solid var(--line-soft); }
.operating-map li:last-child { border-right: 0; }
.operating-map span { display: block; margin-bottom: 9px; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--ink-faint); }
.operating-map strong { display: block; margin-bottom: 5px; font-family: var(--sans); font-weight: 700; font-size: 14.5px; letter-spacing: -.01em; }
.operating-map small { display: block; font-family: var(--mono); font-size: 9.5px; letter-spacing: .05em; color: var(--ink-faint); }
.operating-map li.done span::after { content: " · 已归档"; color: var(--olive); }
.operating-map li.current { padding-left: 12px; }
.operating-map li.current::before { content: ""; position: absolute; left: 0; right: 12px; top: -1px; height: 2px; background: var(--coral); }
.operating-map li.current span { color: var(--coral); }
.operating-map li.current small { color: var(--ink-soft); }
.operating-map li.pending strong { color: var(--ink-faint); font-weight: 600; }

/* ============ III. 下一步行动 ============ */
.work-grid { margin-top: 72px; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.paper-panel { border: 1px solid var(--line); border-radius: 2px; background: var(--bone); }
.panel-head { padding: 18px 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-family: var(--sans); font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.panel-head p { margin: 3px 0 0; color: var(--ink-faint); font-size: 12px; }
.panel-body { padding: 22px 24px; }
.next-action { min-height: 240px; padding: 30px 32px; display: flex; flex-direction: column; align-items: flex-start; }
.next-action h2 { max-width: 18em; margin: 6px 0 12px; font-family: var(--sans); font-weight: 800; font-size: clamp(23px, 2.6vw, 30px); letter-spacing: -.026em; line-height: 1.2; text-wrap: balance; }
.next-action p { max-width: 40em; margin: 0 0 22px; color: var(--ink-mute); font-size: 14px; }
.next-action .button { margin-top: auto; }
.memo-list { list-style: none; padding: 0; margin: 0; }
.memo-list li { padding: 13px 0; display: grid; grid-template-columns: 44px 1fr; gap: 14px; border-bottom: 1px solid var(--line-soft); }
.memo-list li:last-child { border-bottom: 0; }
.memo-list time { color: var(--coral-dark); font-family: var(--mono); font-size: 10.5px; line-height: 1.9; }
.memo-list strong { display: block; font-size: 13.5px; line-height: 1.5; }
.memo-list p { margin: 3px 0 0; color: var(--ink-mute); font-size: 12.5px; }

/* ============ IV. 权限与用量 ============ */
.oversight-grid { margin-top: 72px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.signal-list { margin: 0 0 16px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.signal-list div { min-width: 0; }
.signal-list dt { margin: 0 0 5px; font-family: var(--sans); font-weight: 600; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }
.signal-list dd { margin: 0; font-size: 13px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.mini-ledger { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line-soft); }
.mini-ledger li { min-height: 40px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; border-bottom: 1px solid var(--line-soft); color: var(--ink-mute); font-size: 13px; }
.mini-ledger li:last-child { border-bottom: 0; }
.mini-ledger strong { color: var(--ink); font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; white-space: nowrap; }
.quiet-note { margin: 14px 0 0; color: var(--ink-faint); font-size: 12px; line-height: 1.65; }
.permission-config { margin-top: 18px; border-top: 1px solid var(--line); }
.permission-config-head { min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line-soft); }
.permission-config-head strong { font-size: 13.5px; }
.permission-config-head span, .permission-subject > div:first-child span { color: var(--ink-faint); font-family: var(--mono); font-size: 9.5px; letter-spacing: .06em; }
.permission-subject { padding: 13px 0; display: grid; grid-template-columns: minmax(130px, .4fr) minmax(0, 1.6fr); gap: 14px; border-bottom: 1px solid var(--line-soft); }
.permission-subject:last-child { border-bottom: 0; }
.permission-subject > div:first-child strong, .permission-subject > div:first-child span { display: block; }
.permission-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.permission-toggle {
  min-height: 34px; max-width: 100%; padding: 5px 12px;
  border: 1px solid var(--line); border-radius: 999px; background: transparent;
  color: var(--ink-faint); font-family: var(--mono); font-size: 9.5px; letter-spacing: .05em;
  cursor: pointer; text-align: left; white-space: nowrap;
}
.permission-toggle:hover { border-color: var(--line-strong); color: var(--ink); }
.permission-toggle.is-on { border-color: rgba(110, 116, 72, .5); color: var(--olive); background: var(--bone); }

/* ============ 能力模块（案卷清单） ============ */
.module-ledger { display: grid; border-top: 1px solid var(--ink); }
.module-row {
  position: relative; min-height: 132px; padding: 24px 0;
  display: grid; grid-template-columns: 48px minmax(0, 1fr) minmax(150px, .42fr) auto; gap: 18px; align-items: center;
  border-bottom: 1px solid var(--line-soft); background: transparent;
  transition: background .16s ease;
}
.module-row:last-child { border-bottom: 1px solid var(--ink); }
.module-row.is-primary { background: var(--paper-warm); padding-left: 18px; padding-right: 18px; margin-inline: -18px; border-left: 2px solid var(--coral); }
.module-row.is-planned { color: var(--ink-mute); }
.module-index { align-self: start; padding-top: 3px; font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--coral); }
.module-copy h2 { margin: 0 0 5px; font-family: var(--sans); font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.module-copy p { max-width: 42em; margin: 0; color: var(--ink-mute); font-size: 13px; }
.package-line { max-width: 100%; margin-top: 11px; display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--ink-faint); font-family: var(--mono); font-size: 9.5px; letter-spacing: .04em; overflow-wrap: anywhere; }
.package-line span { min-width: 0; }
.capability-line { margin-top: 5px !important; font-size: 12px !important; }
.planned-note { max-width: 38em; margin-top: 11px !important; color: var(--ink-faint); font-size: 12px !important; }
.module-value { padding-left: 16px; border-left: 1px solid var(--line-soft); }
.module-value span { display: block; margin-bottom: 4px; font-family: var(--sans); font-weight: 600; font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }
.module-value strong { display: block; font-size: 12.5px; font-weight: 500; line-height: 1.55; }
.module-row.locked { color: var(--ink-mute); }
.lock-note { min-width: 96px; color: var(--ink-faint); font-family: var(--mono); font-size: 10px; letter-spacing: .05em; text-align: right; }

/* ============ 任务与交付 ============ */
.task-list { display: grid; border-top: 1px solid var(--ink); }
.task-row { padding: 24px 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 22px; border-bottom: 1px solid var(--line-soft); }
.task-row > * { min-width: 0; }
.task-row:last-child { border-bottom: 1px solid var(--ink); }
.task-row h2 { margin: 6px 0 6px; font-family: var(--sans); font-weight: 800; font-size: 19px; letter-spacing: -.02em; line-height: 1.3; }
.task-row p { max-width: 52em; margin: 0; color: var(--ink-mute); font-size: 13px; overflow-wrap: anywhere; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--ink-faint); font-family: var(--mono); font-size: 10px; letter-spacing: .04em; }
.task-actions { min-width: 132px; display: flex; flex-direction: column; align-items: end; justify-content: space-between; gap: 14px; }
.timeline { margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); list-style: none; }
.timeline li { position: relative; padding-top: 20px; color: var(--ink-faint); font-family: var(--mono); font-size: 10px; letter-spacing: .04em; text-align: center; }
.timeline li::before { content: ""; position: absolute; z-index: 2; top: 2px; left: calc(50% - 5px); width: 10px; height: 10px; border: 2px solid var(--bone); border-radius: 50%; background: var(--ink-faint); }
.timeline li::after { content: ""; position: absolute; top: 7px; right: 50%; width: 100%; height: 1px; background: var(--line); }
.timeline li:first-child::after { display: none; }
.timeline li.done { color: var(--ink-soft); }
.timeline li.done::before { background: var(--olive); }
.timeline li.current { color: var(--coral-dark); font-weight: 700; }
.timeline li.current::before { background: var(--coral); }

/* ============ 问卷 ============ */
.question-wrap { display: grid; }
.question-card { width: min(100%, 760px); margin: 0 auto; padding: 8px 0 0; }
.question-progress { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.progress-track { height: 3px; margin: 16px 0 30px; background: var(--line-soft); overflow: hidden; }
.progress-track span { display: block; height: 100%; background: var(--coral); transition: width 220ms ease; }
.progress-track .progress-5 { width: 5%; } .progress-track .progress-17 { width: 17%; } .progress-track .progress-33 { width: 33%; }
.progress-track .progress-50 { width: 50%; } .progress-track .progress-67 { width: 67%; } .progress-track .progress-83 { width: 83%; }
.progress-track .progress-100 { width: 100%; }
.why-box { margin: 18px 0 24px; padding: 12px 16px; border-left: 2px solid var(--mustard); background: var(--paper-warm); color: var(--ink-mute); font-size: 12.5px; }
.scope-question-title { margin: 20px 0 10px; font-family: var(--sans); font-weight: 800; font-size: clamp(21px, 2.6vw, 27px); letter-spacing: -.024em; line-height: 1.28; text-wrap: balance; overflow-wrap: anywhere; }
.field { margin-top: 18px; }
.field label, .field legend { display: block; margin-bottom: 8px; font-weight: 700; font-size: 13.5px; }
.field input, .field textarea { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 2px; background: var(--surface-field); color: var(--ink); font-size: 15px; }
.field textarea { min-height: 128px; resize: vertical; }
.choice-list { display: grid; gap: 10px; }
.field .choice {
  min-height: 60px; padding: 14px 18px; display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--line); border-radius: 2px; background: transparent; cursor: pointer;
  font-weight: 500; font-size: 19px; line-height: 1.45; letter-spacing: 0;
}
.field .choice:hover { border-color: var(--line-strong); }
.field .choice:has(input:checked) { border-color: var(--coral-dark); background: var(--paper-warm); }
.field .choice input { flex: none; width: 22px; height: 22px; min-height: 0; padding: 0; margin: 0; border: 0; background: none; accent-color: var(--coral-dark); }
.question-actions { margin-top: 28px; display: flex; justify-content: space-between; gap: 12px; }
.field-error { margin: 7px 0 0; color: var(--danger); font-size: 12.5px; }

/* ============ Review Desk ============ */
.review-layout { display: grid; grid-template-columns: minmax(260px, .62fr) minmax(0, 1.38fr); gap: 20px; align-items: start; }
.review-queue { display: grid; gap: 8px; align-content: start; }
.review-item { width: 100%; padding: 15px 16px; display: block; text-align: left; border: 1px solid var(--line); border-radius: 2px; background: transparent; cursor: pointer; }
.review-item:hover { border-color: var(--line-strong); }
.review-item.is-active { border-color: var(--mustard); box-shadow: inset 3px 0 0 var(--mustard); background: var(--paper-warm); }
.review-item strong { display: block; font-size: 13.5px; }
.review-item span { color: var(--ink-faint); font-family: var(--mono); font-size: 10px; letter-spacing: .04em; }
.review-document { position: relative; padding: 40px 44px 36px; border-radius: 2px; }
.review-document::before, .review-document::after { content: ""; position: absolute; width: 20px; height: 20px; border: 1px solid var(--ink-faint); }
.review-document::before { top: 7px; left: 7px; border-right: 0; border-bottom: 0; }
.review-document::after { top: 7px; right: 7px; border-left: 0; border-bottom: 0; }
.review-document h2 { margin: 5px 0 14px; font-family: var(--sans); font-weight: 800; font-size: clamp(21px, 2.4vw, 26px); letter-spacing: -.024em; text-wrap: balance; overflow-wrap: anywhere; }
.review-section { padding: 18px 0; display: grid; grid-template-columns: minmax(110px, .28fr) minmax(0, 1fr); gap: 22px; border-top: 1px solid var(--line-soft); }
.review-section h3 { margin: 0; font-family: var(--sans); font-weight: 600; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }
.review-section p { max-width: 48em; margin: 0; color: var(--ink-mute); font-size: 13.5px; }
.review-section .risk-list, .review-section .diff-list { margin-top: 0; }
.risk-list { margin: 0; padding-left: 20px; font-size: 13.5px; color: var(--ink-mute); }
.review-actions { padding-top: 20px; display: flex; flex-wrap: wrap; gap: 10px; border-top: 1px dashed var(--line); }

/* ============ 版本 ============ */
.version-board { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.version-card { padding: 22px; border: 1px solid var(--line); border-top: 3px solid var(--ink-faint); border-radius: 2px; background: var(--bone); }
.version-card.published { border-top-color: var(--olive); }
.version-card.candidate { border-top-color: var(--mustard); }
.version-card h3 { margin: 8px 0 10px; font-family: var(--sans); font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.version-card p { margin: 0; color: var(--ink-mute); font-size: 13px; overflow-wrap: anywhere; }
.diff-list { margin: 14px 0 0; padding: 0; list-style: none; }
.diff-list li { padding: 7px 0 7px 18px; position: relative; border-top: 1px solid var(--line-soft); font-size: 12.5px; color: var(--ink-mute); }
.diff-list li::before { content: "+"; position: absolute; left: 0; color: var(--olive); font-family: var(--mono); }
.version-context { margin: 0 0 18px; color: var(--ink-faint); font-family: var(--mono); font-size: 10px; letter-spacing: .05em; }

/* ============ Token 账本 ============ */
.ledger-summary { display: grid; grid-template-columns: 1.2fr repeat(3, .7fr); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.ledger-summary > div { padding: 18px 18px 16px 0; border-right: 1px solid var(--line-soft); }
.ledger-summary > div:last-child { border-right: 0; }
.ledger-summary span { display: block; margin-bottom: 5px; font-family: var(--sans); font-weight: 600; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }
.ledger-summary strong { display: block; font-family: var(--mono); font-weight: 600; font-size: 18px; font-variant-numeric: tabular-nums; }
.table-wrap { margin-top: 26px; overflow-x: auto; overscroll-behavior-inline: contain; border-top: 1px solid var(--ink); -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 760px; font-size: 12.5px; }
th, td { padding: 12px 14px 12px 0; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: baseline; font-variant-numeric: tabular-nums; color: var(--ink-soft); }
th { font-family: var(--sans); font-weight: 600; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); border-bottom: 1px solid var(--line); }
td code { font-family: var(--mono); font-size: 11px; }
tbody tr:last-child td { border-bottom: 0; }
.ledger-footnote { margin-top: 14px; color: var(--ink-faint); font-family: var(--mono); font-size: 10px; letter-spacing: .04em; }

/* ============ 空状态（案卷样张） ============ */
.empty-state { padding: 64px 32px; border: 1px solid var(--line); border-radius: 2px; background: var(--paper-warm); text-align: center; }
.empty-state-mark { display: block; margin-bottom: 18px; color: var(--ink-faint); font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; }
.empty-state-mark i { display: block; width: 34px; height: 1px; margin: 12px auto 0; background: var(--coral); }
.empty-state-copy h2 { max-width: 18em; margin: 0 auto 10px; font-family: var(--sans); font-weight: 800; font-size: clamp(22px, 3vw, 28px); letter-spacing: -.025em; text-wrap: balance; }
.empty-state-copy p { max-width: 34em; margin: 0 auto; color: var(--ink-mute); font-size: 13.5px; }
.empty-state-action { margin-top: 26px; }
.empty-state-action .button { margin: 0 auto; }
.empty-state-note { max-width: 30em; margin: 22px auto 0; padding-top: 14px; border-top: 1px dashed var(--line); color: var(--ink-faint); font-family: var(--serif); font-style: italic; font-size: 12.5px; line-height: 1.7; }
.loading-sheet { max-width: 640px; }
.loading-sheet h1 { font-family: var(--sans); font-weight: 800; font-size: 32px; letter-spacing: -.026em; }
.skeleton-line { width: 88%; height: 9px; margin: 18px 0; background: var(--line-soft); }
.skeleton-line.short { width: 52%; }

/* ============ 弹层 ============ */
.sheet-dialog { width: min(680px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line-strong); border-radius: 2px; background: var(--bone); color: var(--ink); box-shadow: var(--shadow-float); overscroll-behavior: contain; }
.sheet-dialog::backdrop { background: var(--backdrop); }
.dialog-head { padding: 20px 26px; display: flex; align-items: start; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 4px 0 0; font-family: var(--sans); font-weight: 800; font-size: 22px; letter-spacing: -.022em; }
.dialog-head .eyebrow { margin-bottom: 0; }
.dialog-body { max-height: calc(100dvh - 180px); padding: 22px 26px; overflow-y: auto; }
.dialog-body > p { margin: 0 0 6px; color: var(--ink-mute); font-size: 13.5px; }
.dialog-foot { padding: 16px 26px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); }
.icon-button { width: 42px; height: 42px; flex: none; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 999px; background: transparent; cursor: pointer; font-size: 17px; }
.icon-button:hover { border-color: var(--line-strong); }

/* ============ 移动端底部条 ============ */
.bottombar { display: none; }

/* ============ 响应式 ============ */
@media (max-width: 1279px) {
  .rail { display: none; }
  .meta-strip, .topnav { padding-left: 44px; padding-right: 44px; }
}
@media (max-width: 1080px) {
  .meta-strip, .topnav { padding-left: 32px; padding-right: 32px; }
  .meta-strip .mid { display: none; }
  .topnav-links { gap: 20px; }
  .sheet { padding: 56px 44px 72px; }
  .work-grid, .oversight-grid, .review-layout { grid-template-columns: 1fr; }
  .case-strip-grid { grid-template-columns: 1fr 1fr; }
  .module-row { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .module-value { grid-column: 2 / -1; padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--line-soft); }
}
@media (max-width: 879px) {
  .topnav-links { display: none; }
  .topnav { height: 54px; }
  .meta-strip { font-size: 9.5px; }
  .brand .sub { display: none; }
  .identity select { max-width: 168px; }
  .sheet-wrap { margin: 26px auto 0; padding: 0 16px calc(104px + env(safe-area-inset-bottom)); }
  .sheet { padding: 40px 22px 56px; }
  .folio-head { margin-bottom: 40px; }
  .folio-head h1, .question-card h1 { font-size: clamp(30px, 9vw, 38px); line-height: 1.12; }
  .section-rule.sub { margin: 56px 0 30px; }
  .operating-chain, .work-grid, .oversight-grid { margin-top: 56px; }
  .operating-chain-head { display: block; }
  .operating-chain-head p { margin-top: 6px; white-space: normal; }
  .operating-map { grid-template-columns: 1fr 1fr 1fr; }
  .operating-map li { border-bottom: 1px solid var(--line-soft); padding: 14px 10px 12px 0; }
  .operating-map li.current { padding-left: 10px; }
  .case-strip { padding: 20px 18px; }
  .signal-list { grid-template-columns: 1fr; gap: 12px; }
  .permission-config-head, .permission-subject { display: block; }
  .permission-config-head { padding: 11px 0; }
  .permission-config-head span { display: block; margin-top: 3px; }
  .permission-actions { margin-top: 10px; }
  .permission-toggle { min-height: 40px; }
  .next-action { min-height: 0; padding: 24px 22px; }
  .module-row { min-height: 0; padding: 18px 0; grid-template-columns: 32px 1fr; gap: 10px 12px; }
  .module-row.is-primary { margin-inline: 0; padding-inline: 14px; }
  .module-row > :last-child { grid-column: 2; justify-self: start; text-align: left; }
  .module-value { grid-column: 2; }
  .task-row { grid-template-columns: 1fr; padding: 20px 0; }
  .task-actions { min-width: 0; flex-direction: row; align-items: center; }
  .timeline { overflow-x: auto; grid-template-columns: repeat(4, minmax(88px, 1fr)); }
  .question-actions { flex-direction: column-reverse; }
  .question-actions .button { width: 100%; }
  .login-code-row { grid-template-columns: 1fr; }
  .login-code-row .button { width: 100%; }
  .version-board { grid-template-columns: 1fr; }
  .review-document { padding: 28px 20px 24px; }
  .review-section { grid-template-columns: 1fr; gap: 8px; }
  .ledger-summary { grid-template-columns: 1fr 1fr; }
  .ledger-summary > div { padding: 14px 14px 12px 0; }
  .ledger-summary strong { font-size: 15px; }
  .empty-state { padding: 44px 20px; }
  .sheet-dialog { width: calc(100% - 16px); max-height: calc(100dvh - 16px); }
  .dialog-body { padding: 18px; }
  .dialog-head { padding: 16px 18px; }
  .dialog-foot { padding: 14px 18px; flex-direction: column-reverse; }
  .dialog-foot .button { width: 100%; }
  .page-actions .button { width: 100%; }

  .bottombar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: var(--bone); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bottombar .nav-item {
    flex: 1; padding: 13px 0 11px; text-align: center;
    font-size: 11px; border-top: 2px solid transparent; margin-top: -1px;
  }
  .bottombar .nav-item.is-active::after { display: none; }
  .bottombar .nav-item.is-active { border-top-color: var(--coral); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .connection-dot { animation: none; }
}
