/* 拾萤论文工作台 —— 编辑部式的克制版面
   字体全部取自系统：界面用黑体系，标题用宋体系，稿件原文用西文衬线 + 中文宋体。 */

:root {
  --paper: #f5f2ea;
  --surface: #fffdf8;
  --surface-2: #faf7ef;
  --ink: #1c1b18;
  --ink-2: #47443d;
  --ink-3: #777267;
  --rule: #d8d2c3;
  --rule-2: #e8e3d6;
  --accent: #1f4a5c;
  --accent-ink: #ffffff;
  --accent-soft: #e2ebee;
  --ok: #2f5f47;
  --ok-soft: #e3eee7;
  --warn: #7c5a12;
  --warn-soft: #f6ecd2;
  --err: #96281b;
  --err-soft: #f6e2de;
  --mark: #f6e6a3;
  --focus: #b3541e;

  --font-ui: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei",
    "Noto Sans CJK SC", "Source Han Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-title: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "STSong", "SimSun",
    Georgia, "Times New Roman", serif;
  --font-ms: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia,
    "Times New Roman", "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "STSong", "SimSun", serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-base: 0.9375rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.625rem;
  --fs-xxl: 2rem;
  --measure: 46rem;
  --radius: 3px;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }

h1, h2, h3, h4 { font-family: var(--font-title); font-weight: 600; line-height: 1.35; margin: 0; color: var(--ink); }
h1 { font-size: var(--fs-xl); letter-spacing: 0.01em; }
h2 { font-size: var(--fs-lg); margin: 2.2rem 0 0.7rem; padding-bottom: 0.35rem; border-bottom: 1px solid var(--rule); }
h3 { font-size: var(--fs-md); margin: 1.3rem 0 0.4rem; }
h4 { font-size: var(--fs-base); margin: 1rem 0 0.3rem; font-family: var(--font-ui); }
p { margin: 0 0 0.8rem; }
a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
code { font-family: var(--font-mono); font-size: 0.88em; background: var(--surface-2); border: 1px solid var(--rule-2); padding: 0 0.3em; border-radius: 2px; word-break: break-all; }
strong { font-weight: 600; }
ul, ol { margin: 0 0 0.8rem; padding-left: 1.4rem; }
ul.plain { list-style: none; padding-left: 0; }
ul.plain > li { padding-left: 1em; position: relative; margin-bottom: 0.3rem; }
ul.plain > li::before { content: "·"; position: absolute; left: 0.2em; color: var(--ink-3); }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.blk:focus-visible, .cmt:focus-visible { outline-offset: 4px; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 0.5rem 1rem; z-index: 50; }
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

.nums, .num, td.when, .count { font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1, "lnum" 1; }
.muted { color: var(--ink-3); }
.hint { color: var(--ink-3); font-size: var(--fs-sm); line-height: 1.65; margin: 0.25rem 0 0.6rem; }
.opt { color: var(--ink-3); font-weight: 400; font-size: var(--fs-xs); margin-left: 0.4em; }
.err-text { color: var(--err); }
.warn-text { color: var(--warn); }
.eyebrow { font-size: var(--fs-xs); letter-spacing: 0.16em; color: var(--ink-3); margin: 0 0 0.3rem; text-transform: uppercase; }
.lede { color: var(--ink-2); max-width: var(--measure); font-size: var(--fs-base); }

/* ---------- 报头 ---------- */
.masthead { background: var(--surface); border-bottom: 1px solid var(--rule); }
.masthead-in { max-width: 78rem; margin: 0 auto; padding: 0 1.25rem; min-height: 3.25rem; display: flex; align-items: center; gap: 1.5rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); }
.brand-mark { width: 1.75rem; height: 1.75rem; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-family: var(--font-title); font-size: 1rem; border-radius: 2px; }
.brand-name { font-family: var(--font-title); font-size: var(--fs-md); font-weight: 600; letter-spacing: 0.06em; white-space: nowrap; }
.brand-sub { font-weight: 400; color: var(--ink-3); font-size: var(--fs-sm); letter-spacing: 0.1em; margin-left: 0.3em; }
.mainnav { display: flex; gap: 0.25rem; flex: 1; }
.mainnav a { color: var(--ink-2); text-decoration: none; padding: 0.85rem 0.7rem; border-bottom: 2px solid transparent; white-space: nowrap; }
.mainnav a:hover { color: var(--ink); }
.mainnav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.who { display: flex; align-items: center; gap: 0.9rem; font-size: var(--fs-sm); margin-left: auto; }
.who form { margin: 0; }
.who-name { color: var(--ink-2); max-width: 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 论文栏与步骤 ---------- */
.paperbar { background: var(--surface-2); border-bottom: 1px solid var(--rule); }
.paperbar-in { max-width: 78rem; margin: 0 auto; padding: 0.6rem 1.25rem 0; }
.paperbar-title { font-size: var(--fs-sm); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb { color: var(--ink-3); }
.crumb-sep { margin: 0 0.4em; }
.paper-title { font-family: var(--font-title); font-size: var(--fs-md); color: var(--ink); text-decoration: none; font-weight: 600; }
.steps { display: flex; gap: 0.25rem; margin-top: 0.4rem; overflow-x: auto; scrollbar-width: thin; }
.steps a { display: flex; align-items: baseline; gap: 0.4rem; padding: 0.5rem 0.9rem 0.55rem; text-decoration: none; color: var(--ink-2); border: 1px solid transparent; border-bottom: none; border-radius: var(--radius) var(--radius) 0 0; white-space: nowrap; }
.steps a:hover { background: var(--surface); }
.steps a[aria-current="page"] { background: var(--paper); border-color: var(--rule); color: var(--ink); position: relative; top: 1px; }
.step-no { font-family: var(--font-title); color: var(--accent); font-weight: 600; }
.step-name { font-weight: 600; }
.step-meta { font-size: var(--fs-xs); color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ---------- 页面骨架 ---------- */
.page { max-width: 78rem; margin: 0 auto; padding: 1.75rem 1.25rem 3rem; }
.page > section { margin-bottom: 1.5rem; }
.narrow { max-width: 40rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head h1 { margin-bottom: 0.4rem; }
.twocol { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.twocol h2:first-child { margin-top: 0.5rem; }
.colophon { max-width: 78rem; margin: 0 auto; padding: 1.25rem; color: var(--ink-3); font-size: var(--fs-xs); border-top: 1px solid var(--rule-2); }
.colophon p { margin: 0; }
.empty { border: 1px dashed var(--rule); background: var(--surface); padding: 1.75rem 1.5rem; border-radius: var(--radius); max-width: var(--measure); }
.empty h2 { border: none; margin-top: 0; padding: 0; }

/* ---------- 提示条 ---------- */
.flashes { margin: 0 0 1.25rem; }
.flash { margin: 0 0 0.5rem; padding: 0.6rem 0.9rem; border-left: 3px solid var(--accent); background: var(--accent-soft); font-size: var(--fs-sm); }
.flash-ok { border-color: var(--ok); background: var(--ok-soft); }
.flash-err { border-color: var(--err); background: var(--err-soft); }
.notice { padding: 0.8rem 1rem; border: 1px solid var(--rule); background: var(--surface); border-left-width: 3px; margin: 0 0 1.25rem; font-size: var(--fs-sm); max-width: var(--measure); }
.notice-warn { border-left-color: var(--warn); background: var(--warn-soft); }

/* ---------- 表单 ---------- */
label { font-weight: 600; font-size: var(--fs-sm); color: var(--ink-2); }
.stack { display: grid; gap: 0.35rem; max-width: 34rem; }
.stack > label { margin-top: 0.7rem; }
.stack > .btn { margin-top: 0.9rem; justify-self: start; }
.stack > .btn-block { justify-self: stretch; }
input[type="text"], input[type="password"], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 0.5rem 0.65rem; width: 100%; min-height: 2.5rem;
}
input[type="file"] { font: inherit; font-size: var(--fs-sm); max-width: 100%; padding: 0.4rem 0; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
fieldset { border: 1px solid var(--rule); border-radius: var(--radius); padding: 0.8rem 1rem 0.9rem; margin: 0.9rem 0; min-width: 0; }
legend { font-weight: 600; font-size: var(--fs-sm); padding: 0 0.4em; color: var(--ink-2); }
.radios { display: grid; gap: 0.3rem; }
fieldset.radios { border-style: dashed; }
.check { display: flex; align-items: flex-start; gap: 0.5rem; font-weight: 400; font-size: var(--fs-base); color: var(--ink); line-height: 1.6; }
.check input { margin-top: 0.35em; width: 1rem; height: 1rem; flex: none; accent-color: var(--accent); }
.model-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: 0.65rem 1rem;
  max-width: 34rem;
  margin: 0.8rem 0 0.35rem;
}
.model-fields label { display: block; margin-bottom: 0.25rem; }
.model-fields select { width: 100%; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  font: inherit; font-size: var(--fs-sm); font-weight: 600; line-height: 1.2; letter-spacing: 0.02em;
  min-height: 2.5rem; padding: 0.5rem 1.05rem; border-radius: var(--radius);
  border: 1px solid var(--ink-2); background: var(--surface); color: var(--ink); text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #173947; }
.btn-danger { border-color: var(--err); color: var(--err); }
.btn-danger:hover { background: var(--err-soft); }
.btn-small { min-height: 2rem; padding: 0.3rem 0.7rem; font-size: var(--fs-xs); }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-busy="true"] { opacity: 0.5; cursor: not-allowed; }
.linklike { font: inherit; font-size: inherit; background: none; border: none; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; }
.linklike.danger { color: var(--err); }
.inline-form, .actions form { display: inline; }
.inline-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 0.6rem 0; }
.inline-actions form { margin: 0; }
.danger-zone { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px dashed var(--rule); }
.narrow-form { max-width: 26rem; }

details.panel { border: 1px solid var(--rule); background: var(--surface); border-radius: var(--radius); padding: 0.6rem 1rem; margin: 0.9rem 0; max-width: var(--measure); }
details.panel[open] { padding-bottom: 1rem; }
summary { cursor: pointer; font-weight: 600; font-size: var(--fs-sm); color: var(--ink-2); }
details.inline-details { display: inline-block; vertical-align: top; font-size: var(--fs-sm); }
details.inline-details[open] { display: block; margin-top: 0.3rem; }
details.inline-details summary { font-weight: 400; color: var(--accent); text-decoration: underline; }

/* ---------- 登录页 ---------- */
body.gate { background: var(--paper); }
body.gate .page { display: grid; place-items: start center; padding-top: 3.5rem; }
.gate-card { width: 100%; max-width: 27rem; background: var(--surface); border: 1px solid var(--rule); border-top: 3px solid var(--accent); padding: 2rem 2rem 1.6rem; }
.gate-card h1 { font-size: var(--fs-xxl); line-height: 1.3; margin-bottom: 0.8rem; }
.gate-card .lede { font-size: var(--fs-sm); margin-bottom: 1rem; }
.gate-alt { margin: 1.4rem 0 0; font-size: var(--fs-sm); color: var(--ink-3); padding-top: 1rem; border-top: 1px solid var(--rule-2); }
body.gate .flashes { width: 100%; max-width: 27rem; }

/* ---------- 标签 ---------- */
.tag { display: inline-block; font-size: var(--fs-xs); line-height: 1.5; padding: 0 0.5em; border: 1px solid var(--rule); border-radius: 2px; background: var(--surface); color: var(--ink-2); white-space: nowrap; vertical-align: 0.08em; font-weight: 400; font-family: var(--font-ui); }
.tag-ok { border-color: #a9c9b7; background: var(--ok-soft); color: var(--ok); }
.tag-warn { border-color: #dcc78d; background: var(--warn-soft); color: var(--warn); }
.tag-err { border-color: #dfb1a9; background: var(--err-soft); color: var(--err); }
.tag-run { border-color: #a9c1ca; background: var(--accent-soft); color: var(--accent); }
.tag-empirical { border-color: var(--ink-2); color: var(--ink); }
.tag-contribution { border-color: var(--accent); color: var(--accent); }
.tag-pri-high { background: var(--err); border-color: var(--err); color: #fff; }
.tag-pri-medium { border-color: var(--warn); color: var(--warn); }
.tag-pri-low { color: var(--ink-3); }
.tag-fix { border-style: dashed; }
.tag-need { border-color: #dcc78d; background: var(--warn-soft); color: var(--warn); }
.tag-state { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }
.code { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 600; color: var(--accent); border: 1px solid var(--accent); padding: 0 0.35em; border-radius: 2px; white-space: nowrap; }

/* ---------- 数据表 ---------- */
.tbl-wrap { overflow-x: auto; max-width: 100%; }
table.data { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); background: var(--surface); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); }
table.data th, table.data td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--rule-2); vertical-align: top; }
table.data thead th { font-size: var(--fs-xs); font-weight: 600; color: var(--ink-3); letter-spacing: 0.06em; border-bottom: 1px solid var(--ink); white-space: nowrap; }
table.data tbody th { font-weight: 600; }
table.data .num { text-align: right; white-space: nowrap; }
table.data td.when { white-space: nowrap; color: var(--ink-2); }
table.data tbody tr:last-child th, table.data tbody tr:last-child td { border-bottom: none; }
.title-cell a { font-family: var(--font-title); font-size: var(--fs-md); }
.row-links { display: flex; gap: 1rem; font-size: var(--fs-xs); font-weight: 400; margin-top: 0.2rem; flex-wrap: wrap; }
.ver { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--accent); margin-right: 0.3em; }
.actions { display: flex; gap: 0.8rem; flex-wrap: wrap; align-items: baseline; }
td.actions { display: table-cell; }
td.actions > * { margin-right: 0.7rem; }
.tabs { display: flex; gap: 0.25rem; }
.tabs a { padding: 0.4rem 0.9rem; text-decoration: none; color: var(--ink-2); border-bottom: 2px solid transparent; }
.tabs a[aria-current="page"] { border-bottom-color: var(--accent); color: var(--ink); font-weight: 600; }
dl.kv { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 0.45rem 1rem; margin: 0 0 1rem; max-width: var(--measure); }
dl.kv dt { color: var(--ink-3); font-size: var(--fs-sm); }
dl.kv dd { margin: 0; }

/* ---------- 步骤卡、列表 ---------- */
.stepcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.stepcard { background: var(--surface); border: 1px solid var(--rule); border-top: 3px solid var(--ink); padding: 1.1rem 1.2rem 1.2rem; display: flex; flex-direction: column; }
.stepcard h2 { border: none; margin: 0 0 0.4rem; padding: 0; }
.stepcard p { font-size: var(--fs-sm); color: var(--ink-2); }
.step-kicker { font-size: var(--fs-xs); letter-spacing: 0.14em; color: var(--accent); margin-bottom: 0.2rem; }
.stepcard-state { margin-top: auto; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.stepcard .btn { align-self: flex-start; }
.cardlist { list-style: none; padding: 0; margin: 0; }
.cardlist li { background: var(--surface); border: 1px solid var(--rule); padding: 0.8rem 1rem; margin-bottom: 0.7rem; }
.cardlist p { margin: 0.15rem 0 0; font-size: var(--fs-sm); }
.card-link { display: inline-flex; gap: 0.6rem; align-items: baseline; }
.card-title { font-family: var(--font-title); font-size: var(--fs-md); font-weight: 600; }
.filelist { list-style: none; padding: 0; margin: 0 0 0.6rem; }
.filelist li { display: flex; gap: 0.7rem; flex-wrap: wrap; align-items: baseline; padding: 0.5rem 0; border-bottom: 1px solid var(--rule-2); }
.file-name { font-weight: 600; word-break: break-all; }
.filelist .actions { margin-left: auto; }
.formatnote { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 0.6rem 0; }
.formatnote > div { background: var(--surface); border: 1px solid var(--rule-2); padding: 0.7rem 0.9rem; }
.formatnote h3 { margin: 0 0 0.2rem; font-size: var(--fs-sm); font-family: var(--font-ui); }
.formatnote p { font-size: var(--fs-sm); color: var(--ink-2); margin: 0; }

/* ---------- 作业状态 ---------- */
.job { border: 1px solid var(--rule); border-left: 3px solid var(--accent); background: var(--surface); padding: 0.8rem 1rem; margin: 0 0 1.5rem; max-width: var(--measure); }
.job-failed { border-left-color: var(--err); background: var(--err-soft); }
.job-warn { border-left-color: var(--warn); background: var(--warn-soft); }
.job-head { display: flex; gap: 0.7rem; align-items: center; flex-wrap: wrap; }
.job-kind { font-size: var(--fs-xs); color: var(--ink-3); }
.job-stage { margin: 0.35rem 0 0.2rem; font-size: var(--fs-base); }
.job form { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; margin-top: 0.4rem; }
.spinner { width: 0.9rem; height: 0.9rem; border: 2px solid var(--rule); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; border-top-color: var(--accent); } }

/* ---------- 对读版面 ---------- */
body.reading { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
body.reading .masthead, body.reading .paperbar { flex: none; }
.reader-main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.reader-main .flashes { margin: 0.6rem 1.25rem 0; }
.reader { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.reader-bar { flex: none; display: flex; align-items: center; gap: 1rem; padding: 0.5rem 1.25rem; border-bottom: 1px solid var(--rule); background: var(--paper); flex-wrap: wrap; }
.reader-bar-title { display: flex; gap: 0.8rem; align-items: baseline; flex-wrap: wrap; min-width: 0; font-size: var(--fs-sm); }
.reader-bar-title strong { font-family: var(--font-title); font-size: var(--fs-md); }
.reader-bar-actions { margin-left: auto; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.pane-switch { display: none; border: 1px solid var(--ink-2); border-radius: var(--radius); overflow: hidden; }
.pane-switch button { font: inherit; font-size: var(--fs-sm); font-weight: 600; border: none; background: var(--surface); color: var(--ink-2); padding: 0.4rem 1.1rem; min-height: 2.25rem; cursor: pointer; }
.pane-switch button[aria-selected="true"] { background: var(--ink); color: #fff; }
.reader-panes { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); }
.pane { overflow-y: auto; min-height: 0; overscroll-behavior: contain; scroll-behavior: smooth; }
.pane + .pane { border-left: 1px solid var(--rule); }
.pane-ms { background: var(--surface); }
.back-to-notes { position: absolute; right: 1rem; bottom: 1rem; z-index: 5; font: inherit; font-size: var(--fs-sm); font-weight: 600; background: var(--ink); color: #fff; border: none; border-radius: 999px; padding: 0.6rem 1.1rem; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .pane { scroll-behavior: auto; } }

/* ---------- 稿件原文 ---------- */
.ms { padding: 1.5rem 1.75rem 4rem; max-width: 46rem; margin: 0 auto; font-family: var(--font-ms); font-size: 1.03rem; line-height: 1.78; color: var(--ink); }
.ms[lang="zh-CN"] { line-height: 1.9; }
.ms-standalone { background: var(--surface); border: 1px solid var(--rule); margin-top: 1rem; }
.blk { position: relative; padding: 0.15rem 0 0.15rem 0.9rem; margin: 0 0 0.55rem -0.9rem; border-left: 3px solid transparent; scroll-margin-top: 4rem; }
.blk-meta { font-family: var(--font-ui); font-size: 0.6875rem; line-height: 1.4; color: var(--ink-3); letter-spacing: 0.02em; font-variant-numeric: tabular-nums; user-select: none; }
.blk-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; hyphens: manual; }
.blk-heading .blk-text { font-family: var(--font-title); font-weight: 600; line-height: 1.4; }
.blk-heading { margin-top: 1.5rem; }
.blk-heading.lv0 .blk-text { font-size: 1.45rem; }
.blk-heading.lv1 .blk-text { font-size: 1.2rem; }
.blk-heading.lv2 .blk-text { font-size: 1.07rem; }
.blk-heading.lv3 .blk-text { font-size: 1rem; }
.blk-caption .blk-text { font-weight: 600; font-size: 0.95rem; }
.blk-tablenote .blk-text, .blk-footnote .blk-text, .blk-reference .blk-text { font-size: 0.875rem; line-height: 1.65; color: var(--ink-2); }
.blk-reference .blk-text { padding-left: 1.5em; text-indent: -1.5em; }
.blk.is-target, .blk:target { border-left-color: var(--focus); background: linear-gradient(to right, rgba(179, 84, 30, 0.07), transparent 70%); }
mark.hit { background: var(--mark); color: inherit; padding: 0.08em 0; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.ms-table { border-collapse: collapse; font-family: var(--font-ms); font-size: 0.84rem; line-height: 1.45; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); margin: 0.2rem 0; min-width: 60%; }
.ms-table td { padding: 0.22rem 0.7rem; vertical-align: top; text-align: left; white-space: pre-line; }
.ms-table td.num { text-align: right; font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1, "lnum" 1; white-space: nowrap; }
.ms-table tr:first-child td { border-bottom: 1px solid var(--ink); font-weight: 600; }
.ms-table tr.note-row td { border-top: 1px solid var(--ink); font-size: 0.8rem; color: var(--ink-2); white-space: normal; }
.ms-table tr.hit-row td, .ms-table td.hit-cell { background: var(--mark); }
.tbl-text { font-family: var(--font-mono); font-size: 0.78rem; line-height: 1.5; overflow-x: auto; white-space: pre; margin: 0.2rem 0; padding: 0.5rem 0.6rem; background: var(--surface-2); border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); font-variant-numeric: tabular-nums; }
.blk.hit-block .tbl-text, .blk.hit-block .blk-text { background: var(--mark); }
.att-group { margin-top: 2.5rem; border-top: 2px solid var(--ink); padding-top: 0.6rem; }
.att-group > summary { font-family: var(--font-ui); margin-bottom: 0.8rem; }

/* ---------- 审稿意见 ---------- */
.report, .checks { padding: 1.25rem 1.5rem 4rem; max-width: 44rem; margin: 0 auto; }
.report h2, .checks h2 { font-size: var(--fs-md); margin-top: 1.8rem; display: flex; align-items: baseline; gap: 0.7rem; flex-wrap: wrap; }
.report h2:first-child, .checks h2:first-child, .overall h2 { margin-top: 0; }
.count { font-family: var(--font-ui); font-weight: 400; font-size: var(--fs-xs); color: var(--ink-3); }
.assessment { font-size: var(--fs-base); line-height: 1.85; }
.toplist { padding-left: 1.3rem; }
.toplist li { margin-bottom: 0.45rem; }
.toplist a { font-weight: 600; }
.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin: 1.5rem 0 0.5rem; padding: 0.6rem 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); position: sticky; top: 0; background: var(--paper); z-index: 2; }
.chip { font: inherit; font-size: var(--fs-sm); border: 1px solid var(--rule); background: var(--surface); color: var(--ink-2); padding: 0.25rem 0.8rem; border-radius: 999px; cursor: pointer; text-decoration: none; min-height: 2rem; display: inline-flex; align-items: center; gap: 0.4rem; }
.chip[aria-pressed="true"], .chip[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip-check { margin-left: auto; font-size: var(--fs-sm); align-items: center; }
.chip-check input { margin-top: 0; }
.cmt, .change { background: var(--surface); border: 1px solid var(--rule); border-left: 3px solid var(--ink-2); padding: 1rem 1.1rem 0.8rem; margin: 0 0 1rem; scroll-margin-top: 4rem; }
.cmt[data-track="contribution"] { border-left-color: var(--accent); }
.cmt[data-status="dismissed"] { opacity: 0.6; }
.cmt.is-target { box-shadow: 0 0 0 2px var(--focus); }
.cmt-head { display: flex; gap: 0.6rem; align-items: baseline; }
.cmt-head h3 { margin: 0; font-size: var(--fs-md); line-height: 1.45; }
.cmt-tags { margin: 0.45rem 0 0.6rem; display: flex; gap: 0.35rem; flex-wrap: wrap; }
.cmt-problem { margin-bottom: 0.7rem; }
.cmt-row { margin: 0 0 0.5rem; font-size: var(--fs-base); }
.row-label { display: inline-block; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-3); letter-spacing: 0.08em; margin-right: 0.7em; min-width: 4.2em; }
.calc { font-family: var(--font-ms); font-variant-numeric: tabular-nums lining-nums; background: var(--surface-2); padding: 0.05em 0.4em; border: 1px solid var(--rule-2); }
.crosscheck { font-size: var(--fs-sm); color: var(--ink-2); border-top: 1px dashed var(--rule); padding-top: 0.5rem; }
.cmt-foot { font-size: var(--fs-xs); text-align: right; margin-top: 0.3rem; }
.cmt-foot form { margin: 0; }
.locs { list-style: none; padding: 0; margin: 0 0 0.7rem; }
.loc { margin-bottom: 0.5rem; }
.loc-head { display: flex; gap: 0.5rem; align-items: baseline; flex-wrap: wrap; font-size: var(--fs-sm); }
.loc-kind { font-size: var(--fs-xs); font-weight: 600; color: var(--ink-3); letter-spacing: 0.08em; }
.loc-jump { font: inherit; font-size: var(--fs-sm); text-align: left; background: var(--accent-soft); border: 1px solid #b9cdd4; color: var(--accent); border-radius: 2px; padding: 0.1rem 0.5rem; cursor: pointer; font-variant-numeric: tabular-nums; min-height: 1.75rem; }
.loc-jump:hover { background: #d4e2e7; }
.loc-jump::after { content: " ↗"; font-size: 0.85em; }
.loc-nojump { color: var(--ink-3); }
.quote { margin: 0.3rem 0 0; padding: 0.3rem 0.8rem; border-left: 2px solid var(--rule); font-family: var(--font-ms); font-size: 0.95rem; line-height: 1.65; color: var(--ink-2); overflow-wrap: anywhere; }
.sources { border-top: 1px solid var(--rule-2); margin-top: 0.7rem; padding-top: 0.2rem; }
.source { padding: 0.5rem 0 0.6rem; border-bottom: 1px dotted var(--rule); }
.source:last-child { border-bottom: none; }
.source-title { font-family: var(--font-ms); font-size: 1rem; margin: 0 0 0.15rem; line-height: 1.5; }
.source-meta { font-size: var(--fs-sm); color: var(--ink-2); margin: 0 0 0.3rem; display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: baseline; }
.support { margin: 0.4rem 0; }
table.compare { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); margin-top: 0.5rem; }
table.compare caption { text-align: left; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-3); letter-spacing: 0.08em; padding-bottom: 0.2rem; }
table.compare th { width: 5.5em; text-align: left; font-weight: 600; color: var(--ink-2); vertical-align: top; padding: 0.25rem 0.5rem 0.25rem 0; border-top: 1px solid var(--rule-2); white-space: nowrap; }
table.compare td { padding: 0.25rem 0; border-top: 1px solid var(--rule-2); }
.limits { font-size: var(--fs-sm); color: var(--ink-2); }
.srclist { font-size: var(--fs-sm); padding-left: 1.4rem; }
.srclist li { margin-bottom: 0.35rem; }
.filter-empty { padding: 1rem 0; }

/* ---------- 引言编辑与核对 ---------- */
.editor { padding: 1.25rem 1.5rem 3rem; max-width: 46rem; margin: 0 auto; display: grid; gap: 0.5rem; }
.editor-label { font-size: var(--fs-sm); }
.editor-text { font-family: var(--font-ms); font-size: 1.05rem; line-height: 1.8; padding: 1.1rem 1.25rem; min-height: 24rem; resize: vertical; background: var(--surface); }
.editor-text[lang="zh-CN"] { line-height: 1.95; }
.editor-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.adopt { background: var(--surface); margin-top: 1.2rem; display: grid; gap: 0.4rem; }
.adopt label { margin-top: 0.5rem; }
.adopt .btn { justify-self: start; margin-top: 0.8rem; }
.adopt .notice { margin: 0.3rem 0; }
.checklist { list-style: none; padding: 0; margin: 0 0 1rem; }
.checklist li { padding: 0.5rem 0.7rem; border: 1px solid var(--rule-2); border-left: 3px solid var(--ok); background: var(--surface); margin-bottom: 0.4rem; }
.checklist li.bad { border-left-color: var(--err); }
.check-head { display: flex; gap: 0.6rem; align-items: baseline; flex-wrap: wrap; }
.num-token { font-family: var(--font-ms); font-size: 1.05rem; font-weight: 600; font-variant-numeric: tabular-nums lining-nums; }
.cite { font-family: var(--font-ms); }
.ctx { font-family: var(--font-ms); font-size: 0.9rem; line-height: 1.6; color: var(--ink-2); margin: 0.2rem 0 0; overflow-wrap: anywhere; }
.ctx.src { color: var(--ink-3); font-family: var(--font-ui); font-size: var(--fs-sm); }
.ctx.src a { font-family: var(--font-ms); font-size: 0.9rem; }
.factlist { list-style: none; padding: 0; margin: 0 0 0.8rem; }
.factlist li { padding: 0.5rem 0; border-bottom: 1px solid var(--rule-2); }
.factlist li p { margin: 0 0 0.2rem; }

/* ---------- 改稿 ---------- */
.revise-form > section { margin-bottom: 1rem; }
.selbar { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-bottom: 0.6rem; position: sticky; top: 0; background: var(--paper); padding: 0.5rem 0; z-index: 2; }
.pick { background: var(--surface); }
.pick legend a { font-weight: 400; margin-left: 0.6em; }
.picklist { list-style: none; padding: 0; margin: 0; }
.picklist li { border-top: 1px solid var(--rule-2); }
.picklist li:first-child { border-top: none; }
.pickitem { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.7rem 0.2rem; font-weight: 400; cursor: pointer; }
.pickitem input { width: 1.15rem; height: 1.15rem; margin-top: 0.3rem; flex: none; accent-color: var(--accent); }
.pick-body { display: grid; gap: 0.25rem; min-width: 0; }
.pick-title { font-family: var(--font-title); font-size: var(--fs-md); font-weight: 600; color: var(--ink); }
.pick-tags { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.pick-fix { font-size: var(--fs-sm); color: var(--ink-2); }
.pick-quote { font-family: var(--font-ms); font-size: 0.9rem; color: var(--ink-3); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.summary-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); background: var(--surface); margin-bottom: 1.5rem; }
.summary-strip > div { padding: 0.8rem 1rem; display: grid; gap: 0.1rem; border-left: 1px solid var(--rule-2); font-size: var(--fs-xs); color: var(--ink-3); }
.summary-strip > div:first-child { border-left: none; }
.big { font-family: var(--font-ms); font-size: var(--fs-xxl); line-height: 1.1; color: var(--ink); }
.dl { list-style: none; padding: 0; display: grid; gap: 0.6rem; }
.dl li { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; }
.dl .hint { margin: 0; }
.change-pending { border-left-color: var(--warn); }
.edit { border-top: 1px solid var(--rule-2); padding: 0.7rem 0 0.4rem; }
.edit-where { font-size: var(--fs-sm); margin-bottom: 0.4rem; font-variant-numeric: tabular-nums; }
.sidebyside { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; }
.sidebyside > div { background: var(--surface-2); border: 1px solid var(--rule-2); padding: 0.5rem 0.8rem 0.6rem; }
.sidebyside .row-label { display: block; margin-bottom: 0.2rem; }
.ms-text { font-family: var(--font-ms); font-size: 1rem; line-height: 1.75; margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.diffline { margin: 0.6rem 0 0; display: flex; gap: 0.4rem; align-items: baseline; }
.diffline .ms-text { font-size: 0.93rem; color: var(--ink-2); }
del { background: var(--err-soft); color: var(--err); text-decoration: line-through; text-decoration-thickness: 1px; }
ins { background: var(--ok-soft); color: var(--ok); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.edit-fail .sidebyside > div:last-child { border-style: dashed; }

/* ---------- 窄屏 ---------- */
@media (max-width: 60rem) {
  .twocol { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .stepcards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 56rem) {
  .pane-switch { display: inline-flex; margin-left: auto; }
  .reader-bar-actions { margin-left: 0; order: 3; width: 100%; }
  .reader-panes { grid-template-columns: minmax(0, 1fr); }
  .pane + .pane { border-left: none; }
  .reader[data-pane="notes"] .pane-ms { display: none; }
  .reader[data-pane="ms"] .pane-notes { display: none; }
  .ms { padding: 1rem 1rem 5rem 1.2rem; font-size: 1rem; }
  .report, .checks, .editor { padding: 1rem 1rem 5rem; }
}
@media (min-width: 56.0625rem) {
  .back-to-notes { display: none !important; }
}
@media (max-width: 40rem) {
  body { font-size: 1rem; }
  .masthead-in { flex-wrap: wrap; gap: 0.2rem 1rem; padding: 0.4rem 1rem 0; }
  .brand-sub { display: none; }
  .mainnav { order: 3; width: 100%; overflow-x: auto; }
  .mainnav a { padding: 0.55rem 0.7rem; }
  .page { padding: 1.25rem 1rem 2.5rem; }
  .paperbar-in { padding: 0.5rem 1rem 0; }
  .gate-card { padding: 1.5rem 1.25rem; }
  .gate-card h1 { font-size: var(--fs-xl); }
  .formatnote, .sidebyside { grid-template-columns: minmax(0, 1fr); }
  .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-strip > div { border-left: none; border-top: 1px solid var(--rule-2); }
  dl.kv { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
  dl.kv dd { margin-bottom: 0.6rem; }
  .btn { min-height: 2.75rem; }
  .btn-small { min-height: 2.25rem; }
  .diffline { flex-direction: column; }
  .reader-bar { padding: 0.5rem 1rem; }
}

@media print {
  .masthead, .paperbar, .reader-bar, .filters, .colophon, .cmt-foot, .back-to-notes { display: none !important; }
  body.reading { height: auto; overflow: visible; display: block; }
  .reader-panes { display: block; }
  .pane { overflow: visible; }
  .pane-ms { display: none; }
}


/* 逐步修稿 */
.guided{--guided-ink:#1d2a44;--guided-navy:#1f3a68;--guided-paper:#fbf8f1;--guided-line:#d9d2c2;--guided-muted:#5f6675;--guided-warn:#8c3b2a;max-width:52rem;margin:0 auto;padding:1rem 1rem 3rem;color:var(--guided-ink);line-height:1.7}
.guided-head{margin:0 0 1.25rem}
.guided-back{display:inline-block;margin-bottom:.5rem;color:var(--guided-navy);text-decoration:none;font-size:.9rem}
.guided-back:hover{text-decoration:underline}
.guided-eyebrow{margin:0 0 .25rem;font-size:.8rem;letter-spacing:.08em;color:var(--guided-muted)}
.guided-eyebrow-warn{color:var(--guided-warn)}
.guided-title,.guided-h{font-family:'Songti SC','Noto Serif SC','Source Han Serif SC',SimSun,serif;color:var(--guided-navy);font-weight:700;line-height:1.35}
.guided-title{margin:0 0 .5rem;font-size:1.6rem}
.guided-h{margin:0 0 .5rem;font-size:1.2rem}
.guided-h-sm{font-size:1.05rem}
.guided-lead{margin:0;color:var(--guided-muted)}
.guided-text{margin:.35rem 0}
.guided-note{margin:.35rem 0;font-size:.9rem;color:var(--guided-muted)}
.guided-meta{margin:.35rem 0 .75rem;font-size:.85rem;color:var(--guided-muted)}
.guided-link{color:var(--guided-navy);text-decoration:underline;text-underline-offset:.2em}
.guided-link:focus-visible,.guided-btn:focus-visible,.guided-sum:focus-visible,.guided-after:focus-visible,.guided-task-link:focus-visible,.guided-back:focus-visible{outline:2px solid var(--guided-navy);outline-offset:2px}
.guided-card,.guided-risk{margin:0 0 1.25rem;padding:1rem;background:var(--guided-paper);border:1px solid var(--guided-line);border-radius:4px}
.guided-risk{border-left:3px solid var(--guided-warn)}
.guided-risk-compact{padding:.5rem .75rem;background:transparent}
.guided-rec,.guided-focus{border-top:3px solid var(--guided-navy)}
.guided-recent,.guided-pending{background:transparent}
.guided-kind{margin:0 0 .25rem;font-size:.9rem;font-weight:600}
.guided-code{display:inline-block;margin:0 .5rem 0 0;padding:0 .4rem;border:1px solid var(--guided-line);border-radius:2px;font-size:.75rem;font-weight:400;color:var(--guided-muted);font-variant-numeric:tabular-nums}
.guided-problem{margin:.25rem 0 .5rem;font-size:1.05rem}
.guided-tag{display:inline-block;margin:0 .5rem 0 0;padding:0 .4rem;border:1px solid currentColor;border-radius:2px;font-size:.75rem}
.guided-kind .guided-tag{margin:0 0 0 .5rem;font-weight:400}
.guided-tag-warn,.guided-tag-need{color:var(--guided-warn)}
.guided-need{margin:.6rem 0;padding:.5rem .75rem;border:1px dashed var(--guided-line)}
.guided-more{margin:.6rem 0}
.guided-others{margin:0 0 1.25rem;padding-top:.75rem;border-top:1px solid var(--guided-line)}
.guided-sum{padding:.5rem 0;min-height:1.75rem;cursor:pointer;color:var(--guided-navy);font-size:.95rem}
.guided-quotes,.guided-edits,.guided-tasks{margin:.5rem 0;padding:0;list-style:none}
.guided-quote{margin:0 0 .75rem}
.guided-plain{margin:.35rem 0;padding-left:1.2rem}
.guided-loc,.guided-page{margin-right:.6rem;font-size:.8rem;color:var(--guided-muted)}
.guided-label{display:block;margin:0 0 .25rem;font-size:.8rem;color:var(--guided-muted)}
.guided-text .guided-label{display:inline;margin-right:.5rem}
.guided-src{margin:.25rem 0;padding:.5rem .75rem;border-left:2px solid var(--guided-line);background:rgba(255,255,255,.6);white-space:pre-wrap;overflow-wrap:anywhere}
.guided-src-after{border-left-color:var(--guided-navy)}
.guided-sample{margin:.5rem 0 1rem}
.guided-item{padding:.75rem 0;border-top:1px solid var(--guided-line)}
.guided-actions{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem 1rem;margin-top:.75rem}
.guided-inline{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem 1rem;margin:0}
.guided-state{margin:0;font-size:.9rem;color:var(--guided-warn)}
.guided-btn{display:inline-flex;align-items:center;justify-content:center;min-height:2.75rem;padding:.4rem 1rem;border:1px solid var(--guided-navy);border-radius:3px;background:transparent;color:var(--guided-navy);font:inherit;text-decoration:none;cursor:pointer}
.guided-btn:hover{background:rgba(31,58,104,.08)}
.guided-btn-primary{background:var(--guided-navy);color:#fff}
.guided-btn-primary:hover{background:var(--guided-ink)}
.guided-form{margin:.5rem 0 0}
.guided-edit{padding:1rem 0;border-top:1px solid var(--guided-line)}
.guided-pick{display:inline-flex;align-items:center;gap:.5rem;min-height:2.75rem;font-weight:600;cursor:pointer}
.guided-pick input{width:1.15rem;height:1.15rem;accent-color:var(--guided-navy)}
.guided-where{margin:0 0 .5rem}
.guided-pair{display:grid;grid-template-columns:minmax(0,1fr);gap:.75rem}
.guided-side{min-width:0}
.guided-after{display:block;box-sizing:border-box;width:100%;min-height:7rem;padding:.5rem .75rem;border:1px solid var(--guided-line);border-radius:3px;background:#fff;color:inherit;font:inherit;line-height:1.7;resize:vertical}
.guided-task{padding:.6rem 0;border-top:1px solid var(--guided-line)}
.guided-task-link{color:var(--guided-navy);font-weight:600;text-decoration:none}
.guided-task-link:hover{text-decoration:underline}
.guided-notice{margin:0 0 1.25rem;padding:.6rem .75rem;border:1px solid var(--guided-line);font-size:.95rem}
.guided-next{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem 1rem;margin:0 0 1.25rem}
.guided-foot{padding-top:1rem;border-top:1px solid var(--guided-line);font-size:.9rem}
@media (min-width:720px){.guided{padding:2rem 1.5rem 4rem}.guided-title{font-size:2rem}.guided-card,.guided-risk{padding:1.5rem}.guided-risk-compact{padding:.5rem 1rem}.guided-pair{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:1.25rem}}
