/* 纸面档案：暖白纸、墨色字、一枚朱砂印。只用系统字体（宋体做标题、黑体做正文），不加载外部字体。 */
:root {
  color-scheme: light dark;
  --paper: oklch(96.6% 0.011 84);
  --paper-2: oklch(94.2% 0.013 82);
  --sheet: oklch(98.9% 0.005 85);
  --rule: oklch(85.5% 0.014 78);
  --rule-2: oklch(78% 0.016 76);
  --ink: oklch(25% 0.013 62);
  --ink-2: oklch(41% 0.013 62);
  --ink-3: oklch(55% 0.012 64);
  --seal: oklch(53.5% 0.165 31);
  --seal-2: oklch(47% 0.15 30);
  --seal-ink: oklch(97.5% 0.01 80);
  --seal-wash: oklch(93.2% 0.032 40);
  --ok: oklch(48% 0.085 152);
  --ok-wash: oklch(94% 0.03 150);
  --warn: oklch(55% 0.11 70);
  --warn-wash: oklch(94.5% 0.04 85);
  --focus: oklch(53.5% 0.165 31 / 0.45);
  --shadow: 0 1px 0 oklch(80% 0.02 78), 0 14px 30px -18px oklch(40% 0.03 60 / 0.35);

  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif CN", "SimSun", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", system-ui, sans-serif;

  --wrap: 1180px;
  --gut: clamp(16px, 4vw, 40px);
  --r: 3px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: oklch(19.5% 0.008 66);
    --paper-2: oklch(23% 0.009 66);
    --sheet: oklch(25.5% 0.01 68);
    --rule: oklch(34% 0.012 66);
    --rule-2: oklch(42% 0.013 66);
    --ink: oklch(91.5% 0.012 84);
    --ink-2: oklch(78% 0.012 80);
    --ink-3: oklch(64% 0.012 76);
    --seal: oklch(65% 0.16 33);
    --seal-2: oklch(71% 0.15 35);
    --seal-ink: oklch(18% 0.01 60);
    --seal-wash: oklch(30% 0.06 32);
    --ok: oklch(72% 0.11 152);
    --ok-wash: oklch(28% 0.04 152);
    --warn: oklch(78% 0.12 80);
    --warn-wash: oklch(30% 0.05 80);
    --shadow: 0 1px 0 oklch(14% 0.01 60), 0 16px 30px -20px oklch(5% 0 0 / 0.7);
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.7 var(--sans);
  font-feature-settings: "palt" 0;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: inherit; text-decoration-color: var(--rule-2); text-underline-offset: 3px; }
a:hover { color: var(--seal); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
img, svg, canvas { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; letter-spacing: 0.01em; margin: 0; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
.num, .tabular { font-variant-numeric: tabular-nums; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 6px 12px; z-index: 10; }
.skip:focus { left: 8px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }

/* ---------- 页头 ---------- */
.site-head { border-bottom: 1px solid var(--rule); }
.site-head .wrap { display: flex; align-items: center; gap: 24px; min-height: 58px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-weight: 700; font-size: 17px; letter-spacing: 0.04em; }
.brand:hover { color: var(--ink); }
.seal {
  width: 26px; height: 26px; flex: none;
  display: grid; place-items: center;
  background: var(--seal); color: var(--seal-ink);
  border-radius: 2px;
  font: 700 11px/1 var(--sans); letter-spacing: 0.02em;
  box-shadow: inset 0 0 0 2px var(--seal), inset 0 0 0 3px oklch(97% 0.01 80 / 0.55);
}
.site-nav { margin-left: auto; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a { text-decoration: none; color: var(--ink-2); padding: 6px 10px; font-size: 14px; white-space: nowrap; border-radius: var(--r); }
.site-nav a:hover { color: var(--ink); background: var(--paper-2); }
.site-nav a[aria-current="page"] { color: var(--seal); }
@media (max-width: 640px) {
  .site-head .wrap { gap: 10px; }
  .brand span:last-child { display: none; }
  .site-nav a { padding: 6px 8px; }
}

/* ---------- 页脚 ---------- */
.site-foot { margin-top: clamp(56px, 8vw, 96px); border-top: 1px solid var(--rule); background: var(--paper-2); }
.site-foot .wrap { padding-top: 36px; padding-bottom: 28px; }
.foot-index { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px 24px; }
.foot-index h3 { font-size: 13px; color: var(--ink-3); font-family: var(--sans); font-weight: 600; letter-spacing: 0.08em; margin-bottom: 8px; }
.foot-index ul { list-style: none; margin: 0; padding: 0; }
.foot-index li { font-size: 14px; line-height: 2; }
.foot-index a { text-decoration: none; color: var(--ink-2); }
.foot-index a:hover { color: var(--seal); }
.foot-base { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; color: var(--ink-3); }
.foot-base a { color: var(--ink-3); }
.foot-base .sp { margin-left: auto; }
@media (max-width: 820px) { .foot-index { grid-template-columns: repeat(2, minmax(0, 1fr)); } .foot-base .sp { margin-left: 0; } }

/* ---------- 通用按钮与表单 ---------- */
.btn {
  appearance: none; border: 1px solid var(--rule-2); background: transparent; color: var(--ink);
  min-height: 40px; padding: 0 16px; border-radius: var(--r); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .12s var(--ease);
}
.btn:hover { border-color: var(--ink-2); color: var(--ink); background: var(--paper-2); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--seal); border-color: var(--seal); color: var(--seal-ink); font-weight: 600; letter-spacing: 0.04em; }
.btn.primary:hover { background: var(--seal-2); border-color: var(--seal-2); color: var(--seal-ink); }
.btn.block { width: 100%; min-height: 46px; font-size: 16px; }
.btn.small { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn.ghost { border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--paper-2); color: var(--ink); }
.linkish { appearance: none; border: 0; background: none; padding: 0; color: var(--ink-2); cursor: pointer; text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; font-size: 14px; }
.linkish:hover { color: var(--seal); }

.field { display: grid; gap: 6px; }
.field + .field { margin-top: 16px; }
.field > label, .field > .label, .field > legend { font-size: 13px; color: var(--ink-2); font-weight: 600; letter-spacing: 0.02em; padding: 0; }
.field .hint { font-size: 12.5px; color: var(--ink-3); line-height: 1.55; }
fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
.input, select.input, textarea.input {
  width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--rule-2); border-radius: var(--r);
  background: var(--sheet); color: var(--ink); font-size: 15px;
}
textarea.input { min-height: 72px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--seal); outline: none; box-shadow: 0 0 0 3px var(--focus); }
.input[aria-invalid="true"] { border-color: var(--seal); }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; min-width: 0; }
input[type="range"] { width: 100%; accent-color: var(--seal); }
input[type="color"] { width: 44px; height: 40px; padding: 2px; border: 1px solid var(--rule-2); border-radius: var(--r); background: var(--sheet); flex: none; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--seal); width: 16px; height: 16px; margin: 0; flex: none; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink); cursor: pointer; }
.check + .check { margin-top: 6px; }

/* 分段选择：一行几个互斥选项 */
.seg { display: flex; border: 1px solid var(--rule-2); border-radius: var(--r); overflow: hidden; background: var(--sheet); }
.seg label { flex: 1; position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg span { display: flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 8px; font-size: 14px; color: var(--ink-2); text-align: center; line-height: 1.25; }
.seg label + label span { border-left: 1px solid var(--rule); }
.seg input:checked + span { background: var(--ink); color: var(--paper); }
.seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: -2px; }
.seg.stack { flex-direction: column; }
.seg.stack label + label span { border-left: 0; border-top: 1px solid var(--rule); }
.seg.stack span { justify-content: flex-start; padding: 8px 12px; flex-direction: column; align-items: flex-start; gap: 2px; }
.seg.stack span small { font-size: 12px; color: var(--ink-3); }
.seg.stack input:checked + span small { color: color-mix(in oklch, var(--paper) 75%, transparent); }

/* ---------- 工具页 ---------- */
.tool-head { padding: clamp(24px, 4vw, 44px) 0 clamp(18px, 2.5vw, 26px); }
.crumb { font-size: 13px; color: var(--ink-3); display: flex; gap: 8px; }
.crumb a { color: var(--ink-3); text-decoration: none; }
.crumb a:hover { color: var(--seal); }
.title-row { display: flex; align-items: baseline; gap: 14px; margin-top: 10px; }
.tool-no { font: 600 13px/1 var(--sans); color: var(--seal); letter-spacing: 0.08em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tool-head h1 { font-size: clamp(28px, 4.4vw, 44px); line-height: 1.15; }
.lede { margin-top: 10px; font-size: clamp(15px, 1.6vw, 17px); color: var(--ink-2); max-width: 46em; }
.assure { margin-top: 12px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ok); }
.assure svg { width: 14px; height: 14px; }

.bench {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px; grid-template-areas: "result result" "stage panel";
  border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule);
}
.bench > .result { grid-area: result; }
.bench > .stage { grid-area: stage; padding: 22px 24px 26px 0; min-width: 0; }
.bench > .panel { grid-area: panel; padding: 22px 0 26px 24px; border-left: 1px solid var(--rule); }
.panel-title { font: 600 12px/1 var(--sans); letter-spacing: 0.14em; color: var(--ink-3); margin-bottom: 16px; }
.panel .actions { margin-top: 22px; display: grid; gap: 10px; }
.panel .why { font-size: 12.5px; color: var(--ink-3); text-align: center; min-height: 1.5em; }
@media (max-width: 900px) {
  .bench { grid-template-columns: minmax(0, 1fr); grid-template-areas: "result" "stage" "panel"; }
  .bench > .stage { padding: 18px 0; }
  .bench > .panel { padding: 18px 0 22px; border-left: 0; border-top: 1px solid var(--rule); }
}

/* 投放区：一张折了角的纸 */
.drop {
  position: relative; display: grid; place-items: center; text-align: center;
  min-height: clamp(220px, 32vw, 300px); padding: 28px 20px;
  background: var(--sheet); box-shadow: var(--shadow);
  clip-path: polygon(0 0, calc(100% - 28px) 0, 100% 28px, 100% 100%, 0 100%);
  cursor: pointer; transition: background-color .2s var(--ease);
}
.drop::after {
  content: ""; position: absolute; top: 0; right: 0; width: 28px; height: 28px;
  background: linear-gradient(225deg, transparent 50%, var(--rule) 50%, var(--paper-2) 100%);
}
.drop::before { content: ""; position: absolute; inset: 12px; border: 1px dashed var(--rule-2); pointer-events: none; transition: border-color .2s var(--ease), inset .25s var(--ease); clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%); }
.drop:hover::before, .drop.over::before { border-color: var(--seal); }
.drop.over { background: var(--seal-wash); }
.drop.over::before { inset: 8px; }
.drop .drop-in { display: grid; gap: 10px; justify-items: center; }
.drop .drop-mark { width: 44px; height: 54px; color: var(--seal); }
.drop .drop-title { font: 700 19px/1.35 var(--serif); }
.drop .drop-hint { font-size: 13px; color: var(--ink-3); }
.drop .btn { margin-top: 6px; }
.drop input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.drop.compact { min-height: 0; padding: 14px 16px; place-items: stretch; text-align: left; clip-path: none; box-shadow: none; border: 1px dashed var(--rule-2); background: transparent; }
.drop.compact::before, .drop.compact::after { display: none; }
.drop.compact .drop-in { grid-auto-flow: column; justify-content: start; align-items: center; gap: 12px; }
.drop.compact .drop-mark { width: 18px; height: 22px; }
.drop.compact .drop-title { font: 600 14px/1.4 var(--sans); }
.drop.compact .drop-hint, .drop.compact .btn { display: none; }

.stage-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; font-size: 13px; color: var(--ink-3); }
.stage-bar .sp { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.stage-bar b { color: var(--ink); font-weight: 600; }

/* 文件清单：账簿行 */
.ledger { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); counter-reset: led; }
.ledger li { display: grid; grid-template-columns: 28px 26px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--rule); background: var(--paper); }
.ledger li.sortable-ghost { opacity: .35; }
.ledger li.sortable-chosen { background: var(--paper-2); }
.ledger .idx { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; text-align: right; }
.ledger .grip { cursor: grab; color: var(--ink-3); display: grid; place-items: center; height: 32px; touch-action: none; }
.ledger .grip svg { width: 14px; height: 14px; }
.ledger .nm { min-width: 0; }
.ledger .nm b { display: block; font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger .nm small { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.ledger .nm small.err { color: var(--seal); }
.ledger .thumb { width: 34px; height: 44px; object-fit: contain; background: var(--sheet); border: 1px solid var(--rule); }
.ledger .ops { display: flex; gap: 2px; }
.icon-btn { appearance: none; border: 0; background: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r); cursor: pointer; color: var(--ink-3); }
.icon-btn:hover { background: var(--paper-2); color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn[disabled] { opacity: .3; cursor: default; }

/* 页面缩略图网格 */
.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 16px 14px; }
@media (max-width: 520px) { .pages { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; } }
.pg { position: relative; display: grid; gap: 6px; justify-items: center; user-select: none; -webkit-user-select: none; }
.pg .sheet { position: relative; width: 100%; aspect-ratio: 0.74; display: grid; place-items: center; background: var(--sheet); box-shadow: var(--shadow); cursor: pointer; overflow: hidden; transition: box-shadow .2s var(--ease); }
.pg .sheet canvas, .pg .sheet img { max-width: 92%; max-height: 92%; width: auto; height: auto; transition: transform .25s var(--ease); background: #fff; }
.pg .sheet .ph { font-size: 12px; color: var(--ink-3); }
.pg .cap { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; display: flex; gap: 6px; align-items: center; }
.pg .tick { position: absolute; z-index: 1; pointer-events: none; top: 6px; left: 6px; width: 20px; height: 20px; border: 1.5px solid var(--rule-2); background: var(--sheet); border-radius: 2px; display: grid; place-items: center; color: var(--seal-ink); }
.pg .tick svg { width: 12px; height: 12px; opacity: 0; }
.pg.sel .sheet { box-shadow: 0 0 0 2px var(--seal), var(--shadow); }
.pg.sel .tick { background: var(--seal); border-color: var(--seal); }
.pg.sel .tick svg { opacity: 1; }
.pg.gone .sheet { opacity: .3; }
.pg.gone .sheet::after { content: "删除"; position: absolute; inset: auto 0 40%; text-align: center; font: 700 14px/1 var(--serif); color: var(--seal); letter-spacing: .3em; }
.pg .pg-ops { position: absolute; top: 4px; right: 4px; display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.pg:hover .pg-ops, .pg:focus-within .pg-ops { opacity: 1; }
@media (hover: none) { .pg .pg-ops { opacity: 1; } }
.pg .pg-ops .icon-btn { width: 28px; height: 28px; background: var(--sheet); box-shadow: 0 0 0 1px var(--rule); }
.pg.sortable-ghost { opacity: .3; }
.pg.sortable-drag .sheet { box-shadow: 0 0 0 2px var(--ink), var(--shadow); }

/* 进度 */
.progress { margin-top: 14px; }
.progress .bar { height: 4px; background: var(--rule); overflow: hidden; }
.progress .bar i { display: block; height: 100%; width: 0; background: var(--seal); transition: width .2s linear; }
.progress .bar.indet i { width: 30% !important; animation: indet 1.1s var(--ease) infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
.progress .txt { margin-top: 6px; font-size: 12.5px; color: var(--ink-3); display: flex; justify-content: space-between; gap: 10px; font-variant-numeric: tabular-nums; }

/* 结果：回执单 */
.receipt { padding: 20px 0 22px; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 20px; align-items: start; animation: rise .45s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.stamp { grid-row: span 3; width: 64px; height: 64px; border: 2px solid var(--seal); color: var(--seal); border-radius: 50%; display: grid; place-items: center; font: 700 15px/1 var(--serif); letter-spacing: .12em; transform: rotate(-12deg); box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 4px var(--seal); padding-left: .12em; }
.receipt.error .stamp, .receipt.empty .stamp { border-color: var(--ink-3); color: var(--ink-2); box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 4px var(--ink-3); }
.receipt h2 { font-size: 20px; }
.receipt .meta { color: var(--ink-2); font-size: 14px; }
.receipt .meta b { color: var(--ink); font-variant-numeric: tabular-nums; }
.receipt .dl { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.receipt .files { list-style: none; padding: 0; margin: 10px 0 0; max-height: 220px; overflow: auto; border-top: 1px solid var(--rule); }
.receipt .files li { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--rule); font-size: 13px; }
.receipt .files li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.receipt .files li small { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.receipt .next { margin-top: 14px; font-size: 13px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.receipt .next button { font-size: 13px; }
.receipt .preview { margin-top: 12px; max-height: 360px; overflow: auto; border: 1px solid var(--rule); background: var(--sheet); }
.receipt .preview img { margin: 0 auto; }
@media (max-width: 520px) { .stamp { width: 52px; height: 52px; font-size: 13px; } .receipt { gap: 4px 14px; } }

.notice { margin-top: 12px; padding: 10px 12px; font-size: 13.5px; line-height: 1.6; background: var(--warn-wash); color: var(--ink); border-left: 0; border-radius: var(--r); }
.notice.info { background: var(--paper-2); color: var(--ink-2); }
.notice.err { background: var(--seal-wash); }
.notice a, .notice button { color: inherit; }

/* ---------- 正文 ---------- */
.doc { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 0 56px; padding-top: clamp(36px, 5vw, 56px); }
.doc > * { grid-column: 1; }
.doc > .related { grid-column: 2; grid-row: 1 / span 6; align-self: start; position: sticky; top: 20px; }
.doc > section + section { margin-top: 40px; }
.doc > .related { margin-top: 0; }
.doc h2 { font-size: 21px; margin-bottom: 14px; }
.doc .intro p { font-size: 16px; line-height: 1.85; color: var(--ink); max-width: 40em; }
.doc .intro p + p { margin-top: 12px; }
.doc .steps ol { list-style: none; margin: 0; padding: 0; counter-reset: st; }
.doc .steps li { counter-increment: st; display: grid; grid-template-columns: 34px minmax(0, 1fr); padding: 10px 0; border-top: 1px solid var(--rule); }
.doc .steps li:last-child { border-bottom: 1px solid var(--rule); }
.doc .steps li::before { content: counter(st, decimal-leading-zero); font: 600 13px/1.9 var(--sans); color: var(--seal); font-variant-numeric: tabular-nums; }
.doc .scen ul, .doc .limits ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.doc .scen li { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 16px; padding: 11px 0; border-top: 1px solid var(--rule); }
.doc .scen li:last-child { border-bottom: 1px solid var(--rule); }
.doc .scen li b { font-weight: 600; }
.doc .scen li span { color: var(--ink-2); }
.doc .limits li { position: relative; padding: 4px 0 4px 18px; color: var(--ink-2); }
.doc .limits li::before { content: ""; position: absolute; left: 2px; top: 0.95em; width: 7px; height: 1px; background: var(--ink-3); }
.faq details { border-top: 1px solid var(--rule); }
.faq details:last-of-type { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; list-style: none; padding: 13px 28px 13px 0; font-weight: 600; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 9px; height: 9px; border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3); transform: translateY(-70%) rotate(45deg); transition: transform .2s var(--ease); }
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { padding: 0 0 16px; color: var(--ink-2); max-width: 42em; }
.related h2 { font-size: 15px; font-family: var(--sans); color: var(--ink-3); letter-spacing: .1em; font-weight: 600; }
.related ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.related li a { display: grid; gap: 2px; padding: 11px 0; border-bottom: 1px solid var(--rule); text-decoration: none; }
.related li a b { font-weight: 600; }
.related li a span { font-size: 13px; color: var(--ink-3); line-height: 1.5; }
.related li a:hover b { color: var(--seal); }
@media (max-width: 900px) {
  .doc { grid-template-columns: minmax(0, 1fr); }
  .doc > .related { grid-column: 1; grid-row: auto; position: static; margin-top: 48px; order: 10; }
  .doc .scen li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* ---------- 首页 ---------- */
.home-head { padding: clamp(32px, 6vw, 72px) 0 clamp(20px, 3vw, 32px); display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px 56px; align-items: end; }
.home-head h1 { font-size: clamp(32px, 5.4vw, 58px); line-height: 1.12; letter-spacing: 0.01em; }
.home-head h1 em { font-style: normal; color: var(--seal); }
.home-head .lede { max-width: 30em; }
.home-head .count { margin-top: 18px; font-size: 13px; color: var(--ink-3); letter-spacing: .06em; }
.home-drop .drop { min-height: 210px; }
.pick { margin-top: 14px; }
.pick h3 { font: 600 13px/1.4 var(--sans); color: var(--ink-2); margin-bottom: 8px; }
.pick .opts { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 860px) { .home-head { grid-template-columns: minmax(0, 1fr); } }

.toc { border-top: 2px solid var(--ink); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 56px; }
.toc-group { padding-top: 22px; }
.toc-group h2 { display: flex; align-items: baseline; gap: 10px; font-size: 22px; padding-bottom: 10px; border-bottom: 1px solid var(--rule); }
.toc-group h2 small { font: 400 12px/1 var(--sans); color: var(--ink-3); letter-spacing: .08em; }
.toc-group ol { list-style: none; margin: 0 0 18px; padding: 0; }
.toc-group li a { display: grid; grid-template-columns: 26px auto minmax(24px, 1fr) auto; align-items: baseline; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--rule); text-decoration: none; }
.toc-group li a .no { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.toc-group li a b { font-weight: 600; font-size: 16px; white-space: nowrap; }
.toc-group li a i { border-bottom: 1px dotted var(--rule-2); transform: translateY(-4px); }
.toc-group li a .d { font-size: 13.5px; color: var(--ink-3); max-width: 21em; line-height: 1.5; }
.toc-group li a:hover b { color: var(--seal); }
.toc-group li a:hover .no { color: var(--seal); }
@media (max-width: 860px) {
  .toc { grid-template-columns: minmax(0, 1fr); }
  .toc-group li a { grid-template-columns: 26px minmax(0, 1fr); gap: 2px 10px; }
  .toc-group li a i { display: none; }
  .toc-group li a .d { grid-column: 2; text-align: left; max-width: none; }
}
.points { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 40px; border-top: 1px solid var(--rule); }
.points li { padding: 18px 0; display: grid; gap: 6px; }
.points li b { font: 700 17px/1.4 var(--serif); }
.points li span { color: var(--ink-2); font-size: 14px; }
@media (max-width: 760px) { .points { grid-template-columns: minmax(0, 1fr); } .points li + li { border-top: 1px solid var(--rule); } }
.home-sec { margin-top: clamp(40px, 6vw, 64px); }
.home-sec > h2 { font-size: 22px; margin-bottom: 12px; }
.home-faq { max-width: 760px; }

/* 页面载入：目录逐组浮现 */
@media (prefers-reduced-motion: no-preference) {
  .toc-group { animation: rise .5s var(--ease) both; }
  .toc-group:nth-child(2) { animation-delay: .05s; }
  .toc-group:nth-child(3) { animation-delay: .1s; }
  .toc-group:nth-child(4) { animation-delay: .15s; }
  .toc-group:nth-child(5) { animation-delay: .2s; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- 说明页 ---------- */
.infopage { max-width: 760px; padding-top: clamp(28px, 5vw, 56px); }
.infopage h1 { font-size: clamp(28px, 4vw, 40px); }
.infopage .updated { margin-top: 8px; font-size: 13px; color: var(--ink-3); }
.infopage section { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--rule); }
.infopage section h2 { font-size: 19px; margin-bottom: 10px; }
.infopage section p, .infopage section li { color: var(--ink-2); }
.infopage section p + p { margin-top: 10px; }
.infopage section ul { padding-left: 1.2em; margin: 10px 0 0; }

/* ---------- 工具专用的小部件 ---------- */
.canvas-pad { position: relative; border: 1px solid var(--rule-2); background: var(--sheet); touch-action: none; }
.canvas-pad canvas { width: 100%; height: 180px; cursor: crosshair; }
.canvas-pad .pad-hint { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); font-size: 14px; pointer-events: none; }
.place { position: relative; margin: 0 auto; background: #fff; box-shadow: var(--shadow); touch-action: pan-x pan-y pinch-zoom; user-select: none; -webkit-user-select: none; }
.place canvas.page { width: 100%; height: auto; }
.place .box { position: absolute; border: 1.5px dashed var(--seal); cursor: move; touch-action: none; }
.place .box img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.place .box .h { position: absolute; right: -7px; bottom: -7px; width: 14px; height: 14px; background: var(--seal); border: 2px solid var(--sheet); cursor: nwse-resize; touch-action: none; }
.place .crop-shade { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.place .crop-shade i { position: absolute; box-shadow: 0 0 0 9999px oklch(25% 0.01 60 / 0.42); }
.place .crop { position: absolute; border: 1.5px solid var(--seal); cursor: move; touch-action: none; }
.place .crop .h { position: absolute; width: 16px; height: 16px; background: var(--seal); border: 2px solid var(--sheet); touch-action: none; }
.place .crop .h.nw { left: -8px; top: -8px; cursor: nwse-resize; }
.place .crop .h.ne { right: -8px; top: -8px; cursor: nesw-resize; }
.place .crop .h.sw { left: -8px; bottom: -8px; cursor: nesw-resize; }
.place .crop .h.se { right: -8px; bottom: -8px; cursor: nwse-resize; }
.pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.textout { width: 100%; min-height: 280px; font: 13px/1.6 var(--sans); padding: 12px; border: 1px solid var(--rule); background: var(--sheet); color: var(--ink); resize: vertical; white-space: pre-wrap; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; font-size: 13px; color: var(--ink-2); margin-top: 12px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
