/* 全文阅读版：浅色印刷风格，可切换深色 */
:root {
  --bg: #F2EFE8; --bg2: #E8E4DA; --card: #FAF8F4; --ink: #121316; --tx: #1F2024; --tx2: #4A4B51; --tx3: #77777C; --tx4: #A3A2A0;
  --line: rgba(18,19,22,.11); --line2: rgba(18,19,22,.22); --acc: #E5452F; --acc2: #FF6B53; --link: #C4301B; --hl: rgba(229,69,47,.09);
  --alpha: #2E5BFF; --sg: #12A27F;
  --verify: #8a5a00; --verify-bg: rgba(233,164,0,.2);
  --serif: "SG Serif", "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SG Math", serif;
  --sans: "Archivo Variable", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", "SG Math", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", "SG Math", monospace;
  --disp: "Instrument Serif", "SG Serif", Georgia, serif;
  --math: "SG Math", "STIX Two Math", "Cambria Math", "STIX Two Text", math, serif;
  --shadow: 0 1px 2px rgba(18,19,22,.05), 0 14px 40px -20px rgba(30,24,12,.3);
  --ease: cubic-bezier(.2,.7,.1,1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0B0B0E; --bg2: #131318; --card: #16171C; --ink: #F1EDE5; --tx: #E2DED6; --tx2: #B3AFA7; --tx3: #85827C; --tx4: #5A5854;
  --line: rgba(255,255,255,.08); --line2: rgba(255,255,255,.17); --acc: #FF6B53; --acc2: #FF8A75; --link: #FF8A75; --hl: rgba(255,107,83,.11);
  --alpha: #7391FF; --sg: #43E2B9;
  --verify: #FFC64D; --verify-bg: rgba(255,198,77,.12);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 18px 50px -20px rgba(0,0,0,.8);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--tx); font: 400 17px/1.95 var(--serif); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; transition: background .35s, color .35s; }
::selection { background: rgba(229,69,47,.28); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
b, strong { font-weight: 700; color: var(--ink); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 12px; }
:focus-visible { outline: 2px solid var(--acc2); outline-offset: 2px; border-radius: 3px; }
[id] { scroll-margin-top: 84px; }

/* 顶栏 */
.pbar { position: fixed; inset: 0 0 auto 0; z-index: 40; height: 58px; display: flex; align-items: center; gap: 18px; padding: 0 22px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .3s, background .35s; font-family: var(--sans); }
.pbar.scrolled { border-bottom-color: var(--line); }
.pb-back { display: inline-flex; align-items: center; gap: 8px; color: var(--tx); font-size: 14px; font-weight: 500; flex: none; padding: 6px 10px 6px 6px; border-radius: 99px; transition: background .2s; }
.pb-back:hover { text-decoration: none; background: var(--hl); }
.pb-back svg { width: 26px; height: 26px; }
.mk-o { fill: currentColor; }
.mk-a, .mk-b { fill: none; stroke-width: 1.7; stroke-linecap: round; }
.mk-a { stroke: currentColor; }
.mk-b { stroke: var(--acc); }
.pb-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 13.5px/1 var(--sans); color: var(--tx3); text-align: center; transition: opacity .25s; }
.pb-title b { color: var(--tx); font-weight: 600; }
.pb-act { display: flex; gap: 6px; flex: none; }
.pb-btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line2); background: transparent; color: var(--tx); font: 500 13px/1 var(--sans); cursor: pointer; transition: background .2s, border-color .2s; }
.pb-btn:hover { background: var(--hl); border-color: color-mix(in srgb, var(--acc) 45%, transparent); }
.pb-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.pb-btn svg .fillc { fill: currentColor; stroke: none; }
.pb-toc { display: none; }
.pb-prog { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; overflow: hidden; }
.pb-prog i { display: block; height: 100%; background: linear-gradient(90deg, var(--acc), var(--acc2)); transform-origin: 0 50%; transform: scaleX(0); }

/* 布局 */
.layout { display: grid; grid-template-columns: 250px minmax(0, 760px); gap: 72px; justify-content: center; padding: 0 28px; }
.toc { position: sticky; top: 58px; height: calc(100vh - 58px); align-self: start; font-family: var(--sans); }
.toc-in { height: 100%; overflow: auto; padding: 40px 6px 40px 0; scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
.toc-h { margin: 0 0 14px 12px; font: 600 10.5px/1 var(--sans); font-stretch: 125%; letter-spacing: .18em; color: var(--tx3); text-transform: uppercase; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc a { position: relative; display: block; padding: 5px 10px 5px 12px; border-radius: 8px; color: var(--tx2); font-size: 13.5px; line-height: 1.5; transition: color .2s, background .2s; }
.toc a:hover { text-decoration: none; color: var(--ink); background: var(--hl); }
.toc .t2 > a { font-weight: 600; color: var(--tx); margin-top: 6px; }
.toc .t2 ol { margin: 2px 0 6px 12px; border-left: 1px solid var(--line); }
.toc .t3 a { font-size: 12.8px; color: var(--tx3); padding-left: 14px; }
.toc a.cur { color: var(--acc); background: var(--hl); }
.toc .t3 a.cur::before { content: ""; position: absolute; left: -1px; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; background: var(--acc); }
.toc .sn { font: 600 10.5px/1 var(--mono); margin-right: 6px; color: var(--acc); }
.toc math { font-size: 1em; }
.toc-scrim { display: none; }

/* 正文 */
.paper { padding: 120px 0 80px; min-width: 0; }
.p-head { margin-bottom: 40px; }
.p-kicker { display: flex; flex-wrap: wrap; gap: 0; margin: 0 0 26px; font: 600 11px/1 var(--sans); font-stretch: 125%; letter-spacing: .16em; text-transform: uppercase; color: var(--tx3); }
.p-kicker > * { padding: 0 12px; border-left: 1px solid var(--line2); }
.p-kicker > :first-child { padding-left: 0; border-left: 0; color: var(--acc); }
.p-head h1 { margin: 0; font: 700 clamp(28px, 4vw, 42px)/1.32 var(--serif); color: var(--ink); letter-spacing: .01em; }
.p-sub { display: block; margin-top: 12px; font: 400 clamp(19px, 2.3vw, 25px)/1.5 var(--serif); color: var(--tx2); letter-spacing: .02em; }
.p-auth { margin: 30px 0 2px; font-size: 17px; }
.p-auth sup, .p-aff sup { font: 500 .65em/0 var(--mono); color: var(--acc); }
.p-aff { margin: 0; font-size: 14px; color: var(--tx3); }
.abstract { position: relative; margin: 0 0 54px; padding: 26px 30px 26px 30px; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.abstract::before { content: ""; position: absolute; left: 0; top: 24px; bottom: 24px; width: 3px; border-radius: 0 3px 3px 0; background: var(--acc); }
.abs-k { margin: 0 0 10px; font: 600 10.5px/1 var(--sans); font-stretch: 125%; letter-spacing: .22em; color: var(--acc); }
.abstract p:last-child { margin: 0; font-size: 16.5px; line-height: 2; text-align: justify; color: var(--ink); font-weight: 400; }
.body > p, .body li, .body .tcap, .body .tnote { text-align: justify; }
.body p { margin: 0 0 1.05em; }
.body h2 { margin: 2.8em 0 .9em; padding-top: 1.1em; border-top: 1px solid var(--line2); font: 700 28px/1.35 var(--serif); color: var(--ink); letter-spacing: .02em; position: relative; }
.body h2::before { content: ""; position: absolute; left: 0; top: -2px; width: 44px; height: 3px; background: var(--acc); }
.body h3 { margin: 2.1em 0 .7em; font: 700 20.5px/1.5 var(--serif); color: var(--ink); }
.body h2 + h3 { margin-top: 1.2em; }
.anchor { margin-left: .45em; color: var(--tx4); font: 400 .8em/1 var(--mono); opacity: 0; transition: opacity .2s; text-decoration: none !important; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus { opacity: 1; }
.sn { display: inline-block; margin-right: 10px; padding: 4px 8px; border-radius: 7px; font: 600 .62em/1 var(--mono); letter-spacing: .04em; color: #fff; background: var(--acc); vertical-align: .22em; }
:root[data-theme="dark"] .sn { color: #1a0703; }
.body ul, .body ol:not(.refs) { margin: 0 0 1.1em; padding-left: 1.4em; }
.body li { margin: .3em 0; }
.body li::marker { color: var(--acc); }
.body hr { border: 0; height: 1px; background: var(--line2); margin: 3em 0; }
.muted, .note { color: var(--tx3); }
.note { font-size: 14.5px; line-height: 1.85; }
code { font: 400 .86em var(--mono); background: var(--bg2); padding: .12em .38em; border-radius: 5px; color: var(--ink); }
pre { margin: 0 0 1.4em; padding: 16px 18px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); overflow-x: auto; }
pre code { background: none; padding: 0; font-size: 12.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-all; }
sup.cite { font: 500 .64em/0 var(--mono); vertical-align: super; margin-left: 1px; color: var(--acc); white-space: nowrap; }
sup.cite a { color: var(--acc); padding: 0 1px; border-radius: 3px; }
sup.cite a:hover { text-decoration: none; background: var(--hl); }
a.xref { color: var(--link); border-bottom: 1px dotted color-mix(in srgb, var(--link) 60%, transparent); }
a.xref:hover { text-decoration: none; border-bottom-style: solid; }
a.ext { overflow-wrap: anywhere; word-break: break-all; }
.verify { display: inline-block; margin: 0 2px; padding: 2px 5px; border-radius: 5px; font: 600 10.5px/1.2 var(--mono); letter-spacing: .06em; color: var(--verify); background: var(--verify-bg); vertical-align: 1px; }

/* 数学（Temml MathML） */
math { font-family: var(--math); font-style: normal; font-weight: normal; line-height: normal; text-indent: 0; text-transform: none; letter-spacing: normal; word-wrap: normal; direction: ltr; font-feature-settings: "dtls" off; font-size: 1.04em; }
math * { border-color: currentColor; }
math.tml-display { display: block; width: 100%; }
math mtext { font-family: var(--serif); }
.mathscr { font-feature-settings: "ss01"; }
.tml-sml-pad { padding-left: .05em; } .tml-med-pad { padding-left: .1em; } .tml-lrg-pad { padding-left: .15em; }
.tml-tageqn > mtd:last-child { text-align: right; }
.tml-tag { color: var(--tx3); }
.eqn { margin: 1.3em 0 1.5em; padding: 14px 0; overflow-x: auto; overflow-y: hidden; font-size: 1.1em; border-radius: 12px; transition: background .4s; }
.eqn math.tml-display { min-width: max-content; }
.eqn:target { background: var(--hl); }

/* 表 */
.tcap { margin: 2.2em 0 .7em; font-size: 14.5px; line-height: 1.85; color: var(--tx2); transition: background .4s; border-radius: 8px; }
.tcap:target { background: var(--hl); box-shadow: 0 0 0 8px var(--hl); }
.tbl { margin: 0 0 1.2em; overflow-x: auto; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); -webkit-overflow-scrolling: touch; scrollbar-width: thin;
  background: linear-gradient(90deg, var(--bg) 30%, transparent) left / 40px 100% no-repeat local, linear-gradient(270deg, var(--bg) 30%, transparent) right / 40px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0,0,0,.14), transparent) left / 12px 100% no-repeat scroll, radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.14), transparent) right / 12px 100% no-repeat scroll; }
.tbl table { width: 100%; border-collapse: collapse; font-size: 13.5px; line-height: 1.62; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; font-weight: 700; color: var(--ink); padding: 9px 12px; border-bottom: 1px solid var(--ink); vertical-align: bottom; white-space: nowrap; }
.tbl td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; min-width: 4.5em; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--hl); }
.tbl td:first-child { white-space: nowrap; font-weight: 600; color: var(--ink); }
.tnote { margin: 0 0 1.6em; font-size: 13.5px; line-height: 1.8; color: var(--tx3); }

/* 图 */
.fig { margin: 2.4em 0 2.2em; }
.fig-zoom { display: block; width: 100%; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); cursor: zoom-in; transition: transform .35s var(--ease), box-shadow .35s; }
.fig-zoom:hover { transform: translateY(-2px); }
.fig img { display: block; width: 100%; height: auto; }
.fig figcaption { margin-top: 14px; font-size: 14.5px; line-height: 1.85; color: var(--tx2); text-align: justify; }
.fig:target .fig-zoom { box-shadow: 0 0 0 3px var(--acc2), var(--shadow); }

/* 附件 */
.filecard { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; margin: 0 0 1.2em; padding: 14px 18px; border-radius: 14px; border: 1px solid var(--line2); background: var(--card); color: var(--tx); font-family: var(--sans); transition: border-color .2s, transform .25s var(--ease); }
.filecard:hover { text-decoration: none; border-color: var(--acc); transform: translateY(-1px); }
.fc-k { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; font: 700 11px/1 var(--mono); letter-spacing: .06em; color: #fff; background: var(--acc); }
:root[data-theme="dark"] .fc-k { color: #1a0703; }
.fc-n { font: 600 14px/1.4 var(--mono); overflow-wrap: anywhere; }
.fc-n small { display: block; margin-top: 3px; font: 400 12.5px/1.5 var(--sans); color: var(--tx3); }
.fc-s { font: 500 12px var(--mono); color: var(--tx3); }

/* 参考文献 */
ol.refs { list-style: none; margin: 0 0 1em; padding: 0; counter-reset: r; font-size: 14.5px; line-height: 1.8; }
ol.refs li { counter-increment: r; position: relative; padding: 9px 10px 9px 3em; margin: 0 -10px; border-radius: 10px; text-align: left; transition: background .5s; }
ol.refs li::before { content: counter(r) "."; position: absolute; left: 10px; top: 9px; width: 2em; font: 600 13px/1.85 var(--mono); color: var(--acc); }
ol.refs li:target { background: var(--hl); }
ol.refs i { font-style: italic; }

/* 页脚 */
.p-foot { margin-top: 70px; padding-top: 26px; border-top: 1px solid var(--line2); font: 400 13px/1.85 var(--sans); color: var(--tx3); }
.p-foot p { margin: 0 0 8px; }

/* 悬停卡片、灯箱、返回按钮 */
.ptip { position: fixed; z-index: 60; max-width: min(440px, calc(100vw - 24px)); padding: 14px 16px; border-radius: 14px; background: var(--card); color: var(--tx); border: 1px solid var(--line2); box-shadow: 0 18px 50px -12px rgba(0,0,0,.35);
  font: 400 13.5px/1.75 var(--serif); pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity .16s, transform .16s; }
.ptip.on { opacity: 1; transform: none; }
.ptip .pt-r { display: grid; grid-template-columns: 1.8em 1fr; gap: 4px; }
.ptip .pt-r + .pt-r { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line2); }
.ptip .pt-r b { font: 600 12px/1.75 var(--mono); color: var(--acc); }
.ptip a { color: var(--tx2); overflow-wrap: anywhere; }
.ptip img { display: block; width: 100%; max-width: 400px; border-radius: 8px; background: #fff; padding: 6px; margin-bottom: 8px; }
.ptip .pt-k { display: block; margin-bottom: 4px; font: 600 11px/1.4 var(--mono); letter-spacing: .12em; color: var(--acc); }
.ptip .eqn { margin: 0; padding: 4px 0; font-size: 1em; }
.backpos { position: fixed; right: 22px; bottom: 22px; z-index: 45; padding: 11px 16px; border-radius: 99px; border: 1px solid var(--line2); background: var(--ink); color: var(--bg); font: 500 13px/1 var(--sans); cursor: pointer; box-shadow: var(--shadow); animation: pop .3s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }
.lb { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 4vh 3vw; background: rgba(8,8,10,.9); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); cursor: zoom-out; animation: fade .25s; }
.lb[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.lb img { max-width: 100%; max-height: 82vh; border-radius: 10px; background: #fff; padding: 10px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.lb-cap { margin: 0; max-width: 980px; color: #d9d2c4; font: 400 14px/1.7 var(--serif); text-align: center; }
.lb-cap b { color: #fff; }
.lb-x { position: absolute; top: 16px; right: 18px; width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.06); color: #fff; font: 300 26px/1 var(--sans); cursor: pointer; }
body.lb-open { overflow: hidden; }

/* 响应式 */
@media (max-width: 1120px) {
  .layout { grid-template-columns: minmax(0, 760px); gap: 0; }
  .pb-toc { display: inline-flex; }
  .toc { position: fixed; top: 0; left: 0; bottom: 0; z-index: 70; width: min(330px, 86vw); height: 100%; background: var(--card); box-shadow: 0 0 60px rgba(0,0,0,.25); transform: translateX(-104%); transition: transform .35s var(--ease); }
  .toc-in { padding: 24px 14px 40px 12px; }
  body.toc-open .toc { transform: none; }
  .toc-scrim { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(0,0,0,.35); }
  .toc-scrim[hidden] { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 16px; line-height: 1.9; }
  .pbar { padding: 0 12px; gap: 10px; }
  .pb-title { display: none; }
  .pb-act { margin-left: auto; }
  .pb-btn span { display: none; }
  .pb-btn { padding: 0 10px; }
  .pb-toc span { display: inline; }
  .layout { padding: 0 18px; }
  .paper { padding-top: 92px; }
  .abstract { padding: 20px 18px 20px 22px; margin-bottom: 40px; }
  .abstract p:last-child { font-size: 15.5px; }
  .body h2 { font-size: 23px; }
  .body h3 { font-size: 18.5px; }
  .tbl table { font-size: 12.5px; }
  .fig-zoom { padding: 6px; border-radius: 12px; }
  .filecard { grid-template-columns: auto minmax(0, 1fr); }
  .fc-s { grid-column: 2; }
  .body > p, .body li, .body .tcap, .body .tnote { text-align: left; }
}

/* 打印 */
@media print {
  @page { margin: 16mm 15mm; }
  :root, :root[data-theme="dark"] { --bg: #fff; --card: #fff; --ink: #000; --tx: #111; --tx2: #222; --tx3: #444; --line: #bbb; --line2: #888; --acc: #000; --link: #000; --hl: transparent; --shadow: none; color-scheme: light; }
  body { font-size: 10.5pt; line-height: 1.75; background: #fff; }
  .pbar, .toc, .toc-scrim, .backpos, .lb, .ptip, .anchor, .skip { display: none !important; }
  .layout { display: block; padding: 0; }
  .paper { padding: 0; }
  .abstract { box-shadow: none; border: 1px solid #999; break-inside: avoid; }
  .abstract::before, .body h2::before { display: none; }
  .fig, .tbl, .eqn, .filecard, ol.refs li { break-inside: avoid; }
  .tcap, .body h2, .body h3 { break-after: avoid; }
  .fig-zoom { box-shadow: none; border: 0; padding: 0; }
  .tbl { overflow: visible; background: none; }
  .tbl table { font-size: 8.5pt; }
  a.xref, sup.cite a { color: #000; border: 0; }
  .sn, .fc-k { color: #000; background: none; border: 1px solid #000; }
}
a.pb-btn:hover { text-decoration: none; }
