:root {
  --coal: #151310;
  --coal-2: #211d19;
  --paper: #f3eee3;
  --paper-deep: #e7decd;
  --ink: #1d1915;
  --muted: #6f675e;
  --ember: #ef642f;
  --amber: #d7a451;
  --line: rgba(57,46,37,.17);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", STSong, serif;
  --sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; }
.progress { position: fixed; inset: 0 auto auto 0; z-index: 90; width: 0; height: 3px; background: linear-gradient(90deg,var(--ember),#ffbd62); }
.topbar { position: sticky; top: 0; z-index: 50; display: grid; grid-template-columns: 1fr auto 1fr; height: 58px; padding: 0 clamp(18px,4vw,64px); align-items: center; color: #e9e0d3; background: rgba(18,16,14,.96); border-bottom: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(14px); }
.brand { display: flex; width: max-content; align-items: center; gap: 10px; text-decoration: none; font: 15px var(--serif); letter-spacing: .06em; }
.brand i { position: relative; width: 19px; height: 24px; background: var(--ember); border-radius: 70% 20% 60% 45%; transform: rotate(45deg); box-shadow: 0 0 18px rgba(239,100,47,.38); }
.top-status { color: #81796e; font: 9px var(--mono); letter-spacing: .16em; }
.topbar button { justify-self: end; padding: 7px 11px; color: #bdb3a6; background: transparent; border: 1px solid rgba(255,255,255,.13); cursor: pointer; }
.topbar button:hover { color: white; border-color: var(--ember); }

.cover { position: relative; display: grid; min-height: 610px; padding: 86px clamp(22px,9vw,145px); grid-template-columns: minmax(0,1fr) 250px; align-items: end; gap: 50px; color: #f5ecde; background: radial-gradient(circle at 76% 32%,rgba(239,100,47,.22),transparent 25%), linear-gradient(135deg,#181512 0%,#0d0c0b 75%); overflow: hidden; }
.cover-grid { position: absolute; inset: 0; opacity: .11; background-image: linear-gradient(rgba(255,255,255,.05) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.05) 1px,transparent 1px); background-size: 56px 56px; mask-image: linear-gradient(90deg,transparent,#000 45%); }
.cover-copy,.score-card { position: relative; z-index: 1; }
.overline { margin: 0 0 27px; color: var(--ember); font: 10px var(--mono); letter-spacing: .18em; }
.cover h1 { margin: 0; font: 700 clamp(50px,7.2vw,94px)/1.04 var(--serif); letter-spacing: -.06em; }
.cover h1 em { color: var(--ember); font-style: normal; }
.lead { max-width: 650px; margin: 30px 0 0; color: #b9b0a4; font: 17px/1.9 var(--serif); }
.score-card { padding: 26px; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.035); }
.score-card > span { color: #8b8277; font: 9px var(--mono); letter-spacing: .12em; }
.score-card strong { display: block; margin: 17px 0 2px; color: #fff6e9; font: 76px/1 var(--serif); letter-spacing: -.07em; }
.score-card small { color: var(--ember); font-size: 24px; }
.score-card p { margin: 8px 0 0; color: #8f867b; font-size: 11px; }

.decision-sheet { padding: 72px clamp(22px,9vw,145px) 83px; background: #ece4d6; border-bottom: 1px solid var(--line); }
.decision-sheet header { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 32px; align-items: end; }
.decision-sheet header p { grid-column: 1 / -1; margin: 0 0 10px; color: var(--ember); font: 9px var(--mono); letter-spacing: .16em; }
.decision-sheet h2 { margin: 0; font: 700 36px var(--serif); letter-spacing: -.03em; }
.decision-sheet header span { justify-self: end; max-width: 340px; color: var(--muted); font-size: 13px; line-height: 1.7; text-align: right; }
.decision-grid { display: grid; grid-template-columns: repeat(5,1fr); border: 1px solid var(--line); }
.decision-grid > div { min-height: 225px; padding: 22px 19px; border-right: 1px solid var(--line); }
.decision-grid > div:last-child { border-right: 0; }
.decision-grid b { display: block; margin-bottom: 35px; color: var(--ember); font: 10px var(--mono); }
.decision-grid strong { display: block; margin-bottom: 10px; font: 19px var(--serif); }
.decision-grid p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.75; }

.reader-layout { display: grid; width: min(1280px,calc(100% - 44px)); margin: 0 auto; grid-template-columns: 245px minmax(0,840px); justify-content: center; gap: 54px; padding: 78px 0 110px; }
.toc-wrap { position: relative; }
.toc-wrap > p { position: sticky; top: 88px; margin: 0 0 15px; color: #a2998e; font: 9px var(--mono); letter-spacing: .16em; }
#toc { position: sticky; top: 116px; max-height: calc(100vh - 145px); padding-bottom: 30px; overflow-y: auto; }
.toc-link { display: block; padding: 7px 10px; color: #776f65; border-left: 1px solid #cec4b4; font-size: 11px; line-height: 1.45; text-decoration: none; }
.toc-link.sub { padding-left: 22px; font-size: 10px; }
.toc-link:hover { color: var(--ember); border-left-color: var(--ember); }
.paper { min-width: 0; }
.paper-status { display: flex; margin-bottom: 33px; padding: 17px 19px; align-items: center; gap: 15px; background: #211d19; }
.paper-status span { padding: 4px 7px; color: #160e09; background: var(--ember); font: 9px var(--mono); letter-spacing: .1em; }
.paper-status p { margin: 0; color: #aa9f91; font-size: 12px; }
.markdown { font-size: 16px; line-height: 1.92; }
.markdown > h1:first-child { display: none; }
.markdown h2,.markdown h3 { scroll-margin-top: 85px; font-family: var(--serif); }
.markdown h2 { margin: 65px 0 22px; padding-bottom: 14px; border-bottom: 1px solid var(--line); font-size: 30px; letter-spacing: -.025em; }
.markdown h3 { margin: 39px 0 16px; font-size: 22px; }
.markdown p { margin: 0 0 18px; }
.markdown strong { color: #111; }
.markdown ul,.markdown ol { margin: 8px 0 23px; padding-left: 1.35em; }
.markdown li { margin: 7px 0; padding-left: .2em; }
.markdown li::marker { color: var(--ember); }
.markdown blockquote { margin: 29px 0; padding: 22px 25px; background: rgba(222,209,188,.42); border-left: 3px solid var(--ember); }
.markdown code { padding: .1em .35em; color: #78331b; background: #e8ddca; font-family: var(--mono); font-size: .88em; }
.markdown table { display: block; width: 100%; margin: 25px 0; border-collapse: collapse; overflow-x: auto; font-size: 13px; }
.markdown th,.markdown td { min-width: 135px; padding: 11px 13px; text-align: left; vertical-align: top; border: 1px solid var(--line); }
.markdown thead { color: #f1e8db; background: var(--coal-2); }
.markdown hr { height: 1px; margin: 45px 0; background: var(--line); border: 0; }
.loading { padding: 100px 0; color: var(--muted); text-align: center; }
footer { display: flex; padding: 28px clamp(22px,7vw,100px); justify-content: space-between; color: #7d756c; background: var(--coal); font-size: 11px; }
footer a { color: #cfb99f; text-decoration: none; }
.toast { position: fixed; right: 22px; bottom: 22px; padding: 10px 15px; color: #17110b; background: var(--amber); opacity: 0; transform: translateY(10px); transition: .2s; }
.toast.show { opacity: 1; transform: none; }

@media (max-width: 980px) {
  .decision-grid { grid-template-columns: repeat(2,1fr); }
  .decision-grid > div { border-bottom: 1px solid var(--line); }
  .decision-grid > div:nth-child(2n) { border-right: 0; }
  .decision-grid > div:last-child { border-bottom: 0; }
  .reader-layout { grid-template-columns: 1fr; }
  .toc-wrap { display: none; }
}

@media (max-width: 700px) {
  .topbar { grid-template-columns: 1fr auto; }
  .top-status { display: none; }
  .cover { min-height: 570px; padding: 62px 20px 40px; grid-template-columns: 1fr; gap: 36px; }
  .cover h1 { font-size: clamp(47px,15vw,66px); }
  .score-card { width: 205px; padding: 18px; }
  .score-card strong { font-size: 55px; }
  .decision-sheet { padding: 48px 20px 55px; }
  .decision-sheet header { display: block; }
  .decision-sheet h2 { font-size: 30px; }
  .decision-sheet header span { display: block; margin-top: 10px; text-align: left; }
  .decision-grid { grid-template-columns: 1fr; }
  .decision-grid > div { min-height: 0; padding: 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .decision-grid b { margin-bottom: 15px; }
  .reader-layout { width: auto; margin: 0 20px; padding: 48px 0 80px; }
  .markdown { font-size: 15px; line-height: 1.86; }
  .markdown h2 { margin-top: 51px; font-size: 26px; }
  .markdown h3 { font-size: 20px; }
  .paper-status { align-items: flex-start; }
}
