/* ─────────────────────────────────────────────────────────────
   paper.css — a journal-article design system.
   Plain HTML. No JavaScript. No third-party requests.
   ───────────────────────────────────────────────────────────── */

:root {
  --paper:  #fbfaf6;
  --ink:    #1c1c1c;
  --muted:  #4c4c48;
  --faint:  #8b8b82;
  --rule:   #1c1c1c;               /* booktabs heavy rule */
  --hair:   #d9d6cb;               /* hairline */
  --accent: #7a1f1f;               /* section numbers, labels (journal maroon) */
  --link:   #17498f;               /* classic navy hyperlink */
  --serif:  'Charter', 'Bitstream Charter', 'Sitka Text', 'Iowan Old Style',
            Cambria, Georgia, 'Times New Roman', 'Songti SC', 'SimSun', serif;
  --mono:   ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas,
            'Liberation Mono', monospace;
  --measure: 41.5rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.62;
  font-kerning: normal;
  font-variant-numeric: oldstyle-nums;
  -webkit-font-smoothing: antialiased;
}
::selection { background: #e9e2cf; }

.sheet { max-width: var(--measure); margin: 0 auto; padding: 0 1.35rem 4.5rem; }

a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2.5px; }
a:hover { color: var(--accent); }
a.quiet { color: inherit; text-decoration: none; }
a.quiet:hover { color: var(--link); }

/* ── top nav — one discreet line ─────────────────────────── */
nav.line {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 0.35rem 1.2rem;
  padding: 1.05rem 0 0.75rem;
  border-bottom: 1px solid var(--hair);
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em;
}
nav.line .mark { color: var(--accent); font-weight: 500; text-decoration: none; }
nav.line .mark:hover { color: var(--link); }
nav.line ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem 1.05rem; margin: 0; padding: 0; }
nav.line a { color: var(--muted); text-decoration: none; text-transform: lowercase; }
nav.line a:hover { color: var(--ink); }
nav.line a[aria-current="page"] { color: var(--ink); border-bottom: 1px solid var(--ink); }

/* ── title block (\maketitle) ────────────────────────────── */
header.title { text-align: center; padding: 3.3rem 0 0; }
header.title h1 {
  font-size: 2.15rem; font-weight: 700; letter-spacing: 0.005em;
  margin: 0 0 0.55rem; line-height: 1.15;
}
header.title .role { font-size: 1.02rem; font-style: italic; color: var(--muted); margin: 0 0 0.4rem; }
header.title .affil { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; color: var(--faint); margin: 0 0 0.85rem; }
header.title .links { font-family: var(--mono); font-size: 0.73rem; letter-spacing: 0.02em; color: var(--muted); margin: 0; }
header.title .links a { color: var(--link); text-decoration: none; }
header.title .links a:hover { text-decoration: underline; }
header.title .links .sep { color: var(--hair); margin: 0 0.35rem; }
header.title .rev { font-family: var(--mono); font-size: 0.68rem; color: var(--faint); margin: 0.9rem 0 0; }

/* ── abstract ─────────────────────────────────────────────── */
.abstract {
  margin: 2.5rem auto 0; max-width: 36.5rem;
  font-size: 0.94rem; line-height: 1.7;
  text-align: justify; hyphens: auto; -webkit-hyphens: auto;
}
.abstract .lbl { font-weight: 700; }
.abstract .lbl::after { content: '\2002'; }

/* theorem-style environment */
.premise {
  margin: 1.5rem auto 0; max-width: 36.5rem;
  font-size: 0.94rem; line-height: 1.7; font-style: italic;
  text-align: justify; hyphens: auto;
}
.premise .lbl { font-style: normal; font-weight: 700; }
.premise .lbl::after { content: '\2002'; }

/* ── sections ─────────────────────────────────────────────── */
section.sec { margin-top: 2.9rem; }
h2.sec-h {
  font-size: 1.22rem; font-weight: 700; margin: 0 0 0.9rem; line-height: 1.3;
}
h2.sec-h .no { color: var(--accent); font-variant-numeric: lining-nums; margin-right: 0.55em; }
h3.sub-h { font-size: 1rem; font-weight: 700; font-style: italic; margin: 1.5rem 0 0.55rem; }
p { margin: 0 0 0.9rem; }
.just { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.small { font-size: 0.9rem; }
.muted { color: var(--muted); }
.fn { font-size: 0.82rem; color: var(--muted); line-height: 1.55; }
.fn .mk { color: var(--accent); }

/* ── booktabs tables ──────────────────────────────────────── */
table.bt {
  width: 100%; border-collapse: collapse;
  font-size: 0.9rem; line-height: 1.5;
  border-top: 1.5px solid var(--rule);
  border-bottom: 1.5px solid var(--rule);
  margin: 0 0 0.75rem;
}
table.bt th {
  font-family: var(--mono); font-weight: 500; font-size: 0.66rem;
  letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted);
  text-align: left; padding: 0.5rem 1rem 0.45rem 0;
  border-bottom: 1px solid var(--rule);
}
table.bt td { padding: 0.52rem 1rem 0.52rem 0; vertical-align: baseline; }
table.bt th:last-child, table.bt td:last-child { padding-right: 0; }
table.bt tr + tr td { border-top: 1px solid var(--hair); }
table.bt .num { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
table.bt .idx { font-family: var(--mono); font-size: 0.75rem; color: var(--accent); white-space: nowrap; }
table.bt .zh  { font-weight: 700; }
table.bt .en  { display: block; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.02em; color: var(--faint); margin-top: 0.1rem; }

/* ── reference list (publications) ────────────────────────── */
ol.refs { list-style: none; margin: 0; padding: 0; counter-reset: ref; }
ol.refs li {
  counter-increment: ref;
  display: grid; grid-template-columns: 2.3rem 1fr; gap: 0 0.4rem;
  font-size: 0.92rem; line-height: 1.6; margin-bottom: 0.7rem;
}
ol.refs li::before { content: '[' counter(ref) ']'; font-family: var(--mono); font-size: 0.78rem; color: var(--accent); padding-top: 0.12em; }
ol.refs .t { font-style: italic; }
ol.refs .v { font-variant: small-caps; letter-spacing: 0.02em; }

/* ── generic numbered list (writing index, notes) ─────────── */
ol.plain { margin: 0; padding-left: 1.4rem; }
ol.plain li { margin-bottom: 0.55rem; font-size: 0.94rem; }
ol.plain li::marker { font-family: var(--mono); font-size: 0.8rem; color: var(--accent); }

dl.kv { margin: 0; font-size: 0.93rem; }
dl.kv div { display: grid; grid-template-columns: 9.5rem 1fr; gap: 0 1rem; padding: 0.45rem 0; border-top: 1px solid var(--hair); }
dl.kv div:last-child { border-bottom: 1px solid var(--hair); }
dl.kv dt { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); padding-top: 0.28em; }
dl.kv dd { margin: 0; }
@media (max-width: 560px) { dl.kv div { grid-template-columns: 1fr; gap: 0.1rem; } }

/* ── article prose (notes) ────────────────────────────────── */
.post-head { text-align: center; padding: 3rem 0 0; }
.post-head h1 { font-size: 1.75rem; font-weight: 700; line-height: 1.22; margin: 0 0 0.55rem; }
.post-head .tagline { font-style: italic; color: var(--muted); font-size: 0.98rem; margin: 0 0 0.6rem; }
.post-head .meta { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.05em; color: var(--faint); }
.post-head .meta .tag { color: var(--muted); }
.post-head + .prose { margin-top: 2.4rem; }

.prose { font-size: 0.98rem; line-height: 1.72; }
.prose p { margin: 0 0 1rem; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.prose h2 { font-size: 1.18rem; font-weight: 700; margin: 2.1rem 0 0.8rem; }
.prose h3 { font-size: 1rem; font-weight: 700; font-style: italic; margin: 1.6rem 0 0.5rem; }
.prose ul, .prose ol { margin: 0 0 1rem; padding-left: 1.5rem; }
.prose li { margin-bottom: 0.45rem; }
.prose hr { border: none; border-top: 1px solid var(--hair); margin: 1.9rem auto; width: 34%; }
.prose blockquote {
  margin: 1.2rem 0; padding: 0.15rem 0 0.15rem 1.1rem;
  border-left: 2.5px solid var(--accent); font-style: italic; color: var(--muted);
}
.prose code {
  font-family: var(--mono); font-size: 0.82em;
  background: #f1efe6; border: 1px solid #e4e1d3; border-radius: 3px; padding: 0.06em 0.32em;
}
.prose pre {
  background: #f4f2ea; border: 1px solid var(--hair); border-radius: 4px;
  padding: 0.9rem 1rem; overflow-x: auto; font-size: 0.8rem; line-height: 1.55; margin: 0 0 1rem;
}
.prose pre code { background: none; border: none; padding: 0; font-size: inherit; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.88rem; margin: 0 0 1rem;
  border-top: 1.5px solid var(--rule); border-bottom: 1.5px solid var(--rule); }
.prose table th { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); text-align: left; padding: 0.45rem 0.9rem 0.4rem 0; border-bottom: 1px solid var(--rule); }
.prose table td { padding: 0.45rem 0.9rem 0.45rem 0; vertical-align: baseline; }
.prose table tr + tr td { border-top: 1px solid var(--hair); }
.prose ul.task { list-style: none; padding-left: 0.2rem; }
.prose ul.task li { display: flex; gap: 0.6rem; align-items: baseline; }
.prose ul.task .cb { flex: none; font-family: var(--mono); }
.prose ul.task .cb::before { content: '\2610'; color: var(--accent); }
.backlink { font-family: var(--mono); font-size: 0.72rem; margin-top: 2.6rem; }

/* ── footer / colophon ────────────────────────────────────── */
footer.colophon {
  margin-top: 3.6rem; padding-top: 1rem; border-top: 1px solid var(--hair);
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.04em;
  color: var(--faint); line-height: 2;
}
footer.colophon a { color: var(--muted); text-decoration: none; }
footer.colophon a:hover { color: var(--link); text-decoration: underline; }
footer.colophon .k { color: var(--accent); }

@media print {
  nav.line, .backlink { display: none; }
  body { background: #fff; }
}
