:root {
  color-scheme: light;
  --paper: #f8f6f1;
  --ink: #292b28;
  --muted: #6b6b63;
  --line: #d9d7ce;
  --accent: #9a4228;
  --wash: #eeebe3;
  --article-size: 18px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--paper);
  color: var(--ink);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #191c1b;
  --ink: rgba(255,255,255,.85);
  --muted: #b3b5ac;
  --line: #424640;
  --accent: #efa587;
  --wash: #252a26;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 100px; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: 5px; }
button, output { font: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { opacity: .4; cursor: default; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
::selection { background: var(--accent); color: var(--paper); }
strong { font-weight: 600; }
.skip-link { position: fixed; top: -80px; left: 16px; padding: 14px; background: var(--paper); z-index: 100; }
.skip-link:focus { top: 12px; }
.topbar { position: sticky; top: 0; z-index: 20; height: 70px; padding: 0 max(28px, calc((100vw - 1160px)/2)); display: flex; justify-content: space-between; align-items: center; background: var(--paper); border-bottom: 1px solid var(--line); }
.wordmark { display: flex; align-items: center; gap: 15px; font-size: 17px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.wordmark span { border-left: 1px solid var(--line); padding-left: 15px; font-size: 10px; font-weight: 500; letter-spacing: .15em; color: var(--muted); }
.reader-tools, .font-tools { display: flex; align-items: center; gap: 2px; }
.reader-tools { gap: 18px; }
.reader-tools button { min-width: 44px; min-height: 44px; border: 0; background: transparent; border-radius: 4px; }
#font-size { min-width: 24px; text-align: center; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
#theme-toggle { display: flex; gap: 8px; align-items: center; padding: 0 10px; font-size: 13px; }
#theme-icon { font-size: 20px; }
.reading-meter { position: absolute; height: 3px; left: 0; right: 0; bottom: -1px; overflow: hidden; }
#progress-fill { width: 100%; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }
main { max-width: 1160px; margin: 0 auto; padding: 0 28px 70px; }
.article-header { padding: 54px 0 0; }
.eyebrow { display: flex; align-items: center; gap: 20px; font-size: 12px; color: var(--accent); letter-spacing: .07em; }
.eyebrow > span:first-child { border-top: 2px solid var(--accent); padding-top: 9px; }
.edition { color: var(--muted); padding-top: 9px; font-variant-numeric: tabular-nums; }
h1 { max-width: 900px; font-size: clamp(32px, 4.5vw, 58px); font-weight: 600; line-height: 1.35; text-wrap: balance; margin: 25px 0 16px; letter-spacing: .015em; }
.original-title { font-size: 19px; color: var(--muted); margin: 0; line-height: 1.5; }
.byline { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 36px; padding: 19px 0; border-top: 1px solid var(--line); font-size: 13px; }
.byline > div { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.byline-label, .handle { color: var(--muted); }
.byline > a { flex-shrink: 0; text-decoration: none; }
.cover { margin: 6px 0 48px; }
.zoom-image { display: block; position: relative; cursor: zoom-in; background: var(--wash); }
.zoom-image img { display: block; width: 100%; height: auto; aspect-ratio: 1731/692; object-fit: contain; }
.zoom-label { position: absolute; right: 16px; bottom: 16px; padding: 7px 10px; border-radius: 4px; background: #191c1be8; color: #fff; font-size: 12px; }
figcaption { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; color: var(--muted); margin-top: 9px; line-height: 1.7; }
.reading-layout { display: grid; grid-template-columns: 224px minmax(0, 736px); column-gap: 68px; align-items: start; }
.sidebar { position: sticky; top: 108px; font-size: 13px; }
.contents summary { display: none; }
.toc-heading { margin: 0 0 19px; font-size: 12px; color: var(--muted); letter-spacing: .12em; }
.contents nav { display: grid; gap: 3px; }
.toc-link { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: baseline; padding: 10px 9px; line-height: 1.6; color: var(--muted); text-decoration: none; border-left: 2px solid transparent; }
.toc-link span { font-size: 10px; font-variant-numeric: tabular-nums; }
.toc-link[aria-current="location"] { color: var(--accent); border-color: var(--accent); background: var(--wash); }
.progress-note { display: flex; justify-content: space-between; margin-top: 28px; padding-top: 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.article-column { min-width: 0; }
article { font-size: var(--article-size); line-height: 1.95; overflow-wrap: anywhere; }
article:focus, article h2:focus { outline: none; }
article p { margin: 0 0 1.45em; }
article .lead { background: var(--wash); border-top: 2px solid var(--accent); padding: 27px 30px; margin-bottom: 2.15em; }
article h2 { position: relative; margin: 2.6em 0 1.15em; padding-top: 24px; border-top: 1px solid var(--line); font-weight: 600; font-size: 1.5em; line-height: 1.55; scroll-margin-top: 18px; text-wrap: pretty; }
article h2::before { content: attr(data-number); display: block; color: var(--accent); font-size: 12px; line-height: 1; font-weight: 500; letter-spacing: .12em; margin-bottom: 15px; }
blockquote { margin: 2em 0; padding: 8px 0 8px 26px; border-left: 3px solid var(--accent); font-size: 1.17em; line-height: 1.85; font-weight: 500; }
blockquote p { margin: 0; }
article .signature { margin-bottom: .45em; }
.attribution { border-top: 1px solid var(--line); margin-top: 65px; padding-top: 22px; }
.end-mark { display: block; text-align: center; color: var(--muted); font-size: 12px; margin-bottom: 48px; }
.attribution h2 { font-size: 16px; font-weight: 500; line-height: 1.6; margin: 0 0 22px; }
.attribution dl { display: grid; gap: 12px; font-size: 13px; line-height: 1.8; }
.attribution dl > div { display: grid; grid-template-columns: 70px 1fr; gap: 14px; }
.attribution dt { color: var(--muted); }
.attribution dd { margin: 0; overflow-wrap: anywhere; }
.attribution dd span { color: var(--muted); }
.source-link { display: inline-flex; gap: 24px; align-items: center; font-size: 13px; margin-top: 12px; padding: 10px 0; color: var(--accent); }
dialog { width: min(1440px, 94vw); max-height: 92dvh; padding: 18px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); color: var(--ink); }
dialog::backdrop { background: #000c; }
dialog img { display: block; width: 100%; max-height: 75dvh; object-fit: contain; }
.dialog-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; font-size: 13px; }
.dialog-toolbar button { border: 1px solid var(--line); border-radius: 4px; background: var(--wash); padding: 10px 14px; min-height: 44px; }
body:has(dialog[open]) { overflow: hidden; }
@media (hover: hover) {
  .reader-tools button:not(:disabled):hover, .toc-link:hover { background: var(--wash); }
  .byline a:hover, .source-link:hover { color: var(--accent); text-decoration: underline; }
}
@media (max-width: 1000px) and (min-width: 761px) {
  .reading-layout { grid-template-columns: 185px minmax(0, 1fr); gap: 32px; }
}
@media (max-width: 760px) {
  html { scroll-padding-top: 134px; }
  .topbar { height: 62px; padding: 0 18px; }
  .wordmark { font-size: 15px; }
  .wordmark span { display: none; }
  .reader-tools { gap: 7px; }
  main { padding: 0 22px 48px; }
  .article-header { padding-top: 32px; }
  h1 { font-size: clamp(31px, 6.5vw, 44px); line-height: 1.45; margin: 22px 0 14px; }
  .eyebrow { gap: 14px; font-size: 11px; }
  .original-title { font-size: 15px; }
  .byline { margin-top: 25px; gap: 12px; align-items: flex-start; font-size: 12px; }
  .byline > div { gap: 4px 8px; }
  .handle { flex-basis: 100%; }
  .cover { margin: 4px 0 24px; }
  .zoom-label { bottom: 10px; right: 10px; }
  .reading-layout { display: block; }
  .sidebar { position: sticky; top: 62px; z-index: 10; background: var(--paper); margin: 0 -22px 25px; border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); }
  .contents summary { min-height: 49px; padding: 13px 22px; display: flex; align-items: center; justify-content: space-between; list-style: none; cursor: pointer; font-size: 13px; }
  .contents summary::-webkit-details-marker { display: none; }
  .contents[open] summary span { transform: rotate(45deg); }
  .contents-inner { padding: 0 20px 16px; max-height: 55dvh; overflow-y: auto; }
  .toc-heading, .progress-note { display: none; }
  .toc-link { padding: 11px 9px; }
  article { line-height: 1.9; }
  article .lead { padding: 21px 20px; margin-bottom: 1.8em; }
  article h2 { margin-top: 2em; font-size: 1.34em; }
  blockquote { padding-left: 20px; font-size: 1.1em; }
  .attribution { margin-top: 48px; }
}
@media (max-width: 359px) {
  main { padding-left: 16px; padding-right: 16px; }
  .sidebar { margin-left: -16px; margin-right: -16px; }
  .topbar { padding: 0 12px; }
  #theme-toggle { padding: 0 4px; }
  #theme-icon { display: none; }
  .reader-tools { gap: 2px; }
  h1 { font-size: 30px; }
}
@media print {
  :root { --paper: #fff; --ink: #000; --muted: #444; --line: #ccc; --wash: #f5f5f5; --accent: #333; }
  .topbar, .sidebar, .zoom-label, dialog { display: none !important; }
  main { padding: 0; }
  .article-header { padding-top: 0; }
  h1 { font-size: 30px; }
  .reading-layout { display: block; }
  article { font-size: 12pt; }
  article h2 { break-after: avoid; }
  .cover { max-width: 75%; }
}
