:root { color-scheme: light dark; --ink: #223540; --paper: #fff; --accent: #087f8c; --muted: #526775; --panel: #f1f5f7; }
html { scroll-behavior: smooth; scroll-padding-top: 1rem; }
body { max-width: 76rem; margin: auto; padding: 3rem 2rem; color: var(--ink); background: var(--paper); font: 1.06rem/1.7 Georgia, 'Times New Roman', serif; overflow-wrap: anywhere; }
header { padding-bottom: 2rem; border-bottom: 3px solid var(--accent); }
h1,h2,h3,h4,nav,figcaption,caption,.author,.date { font-family: system-ui, sans-serif; }
h1 { line-height: 1.18; font-size: 2.6rem; }
h2 { margin-top: 2.5rem; font-size: 1.8rem; line-height: 1.3; }
h3 { font-size: 1.3rem; color: var(--accent); }
a { color: var(--accent); text-underline-offset: .15em; }
#TOC { padding: 1.2rem 1.5rem; background: var(--panel); border-radius: .3rem; margin: 2rem 0; font-size: .92rem; }
#TOC ul { list-style: none; padding-left: 1.2rem; }
#TOC > ul { padding-left: 0; columns: 2; column-gap: 2rem; }
#TOC > ul > li { break-inside: avoid; margin-bottom: .45rem; }
.table-scroll { width: 100%; overflow-x: auto; margin: 1.8rem 0; }
table { width: 100% !important; border-collapse: collapse; font: .92rem/1.5 system-ui, sans-serif; }
th,td { text-align: left; vertical-align: top; padding: .65rem .75rem; border-bottom: 1px solid #c7d8df; }
th { background: #123047; color: white; }
tr:nth-child(even) { background: var(--panel); }
caption,figcaption { text-align: left; font-size: .88rem; line-height: 1.5; padding: .7rem 0; color: var(--muted); }
pre { overflow-x: auto; background: var(--panel); border: 1px solid #c7d8df; border-radius: .25rem; padding: 1rem; font-size: .84rem; line-height: 1.55; }
code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
pre code { white-space: pre; }
blockquote { margin: 1.5rem 0; padding: .3rem 1.4rem; border-left: 4px solid var(--accent); background: var(--panel); }
figure { margin: 2rem 0; }
figure img { display: block; max-width: 100%; max-height: 45rem; width: auto; height: auto; margin: auto; background: white; }
.math-display { display: block; max-width: 100%; overflow-x: auto; padding: 1rem .3rem; font-size: 1.03rem; }
.math-display math { display: block; width: max-content; min-width: max-content; margin-inline: auto; }
.csl-entry { margin-bottom: 1rem; }
.csl-left-margin { float: left; min-width: 2.4rem; }
.csl-right-inline { margin-left: 2.4rem; }
@media (prefers-color-scheme: dark) { :root { --ink: #e0e9ee; --paper: #15212a; --accent: #73d5dd; --muted: #b5c5ce; --panel: #20313d; } }
@media (max-width: 700px) { body { padding: 1.3rem 1rem; font-size: 1rem; } h1 { font-size: 1.9rem; } h2 { font-size: 1.5rem; } #TOC > ul { columns: 1; } table { min-width: 38rem; } }
@media print { body { max-width: none; padding: 0; color: black; background: white; } nav { display: none; } h1,h2,h3 { break-after: avoid; } figure { break-inside: avoid; } a { color: inherit; } }

.paper-links { position:sticky; top:0; z-index:2; display:flex; flex-wrap:wrap; gap:.6rem 1.2rem; padding:.8rem 0; background:var(--paper); border-bottom:1px solid var(--muted); font-size:.9rem; }
.paper-links a { min-height:28px; display:inline-flex; align-items:center; }
.reader-contents { margin:1.5rem 0; padding:.8rem 1rem; border:1px solid var(--accent); border-radius:.4rem; }
.reader-contents summary { cursor:pointer; font:600 1rem system-ui,sans-serif; color:var(--accent); padding:.4rem 0; }
.reader-contents #TOC { margin:.5rem 0; padding:.5rem; }
:target { scroll-margin-top:6rem; }
@media(max-width:700px) { .paper-links { gap:.3rem 1rem; font-size:.8rem; } .table-scroll table { min-width:38rem; } }
@media(prefers-reduced-motion:reduce) { html { scroll-behavior:auto; } }
@media print { .paper-links,.reader-contents { display:none; } }
