:root {
  color-scheme: light;
  --paper: #f4f6f3;
  --surface: #ffffff;
  --ink: #17251f;
  --muted: #64726a;
  --faint: #96a29a;
  --line: #d8e0da;
  --line-strong: #b9c7be;
  --blue: #245c7a;
  --blue-soft: #e7f0f5;
  --coral: #e5674e;
  --coral-soft: #fcebe7;
  --yellow: #d8a52a;
  --shadow: 0 20px 48px rgba(25, 45, 34, .10);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.site-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); background: rgba(244, 246, 243, .95); backdrop-filter: blur(16px); }
.header-inner { width: min(1220px, calc(100% - 48px)); min-height: 70px; margin: auto; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 18px; font-weight: 800; text-decoration: none; }
.brand img { flex: 0 0 34px; }
.brand em { color: var(--coral); font-style: normal; font-weight: 600; }
.main-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-link { padding: 8px 10px; color: var(--muted); font-size: 13px; text-decoration: none; white-space: nowrap; }
.nav-link:hover, .nav-link.is-active { color: var(--ink); }
.nav-link.is-active { font-weight: 800; }
.nav-link span { display: inline-grid; min-width: 19px; height: 19px; margin-left: 3px; place-items: center; border-radius: 50%; background: var(--coral-soft); color: var(--coral); font-size: 11px; }
.icon-button { width: 38px; height: 38px; display: inline-grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: var(--muted); font-size: 19px; transition: border-color .2s, color .2s, transform .2s; }
.icon-button:hover { border-color: var(--coral); color: var(--coral); transform: translateY(-1px); }

.page-shell { width: min(1220px, calc(100% - 48px)); margin: auto; }
.intro-band { display: flex; align-items: end; justify-content: space-between; gap: 36px; padding: 78px 0 54px; }
.eyebrow { margin: 0 0 12px; color: var(--coral); font-size: 11px; font-weight: 800; letter-spacing: .10em; line-height: 1.4; }
.live-dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--yellow); vertical-align: 1px; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 760px; margin-bottom: 17px; font-size: 58px; line-height: 1.08; font-weight: 800; }
.intro-copy { max-width: 650px; margin-bottom: 22px; color: var(--muted); font-size: 16px; line-height: 1.8; }
.intro-actions { display: flex; align-items: center; gap: 19px; flex-wrap: wrap; }
.primary-link, .quiet-link, .text-link { color: var(--blue); font-size: 13px; font-weight: 800; text-decoration: none; }
.primary-link { display: inline-flex; align-items: center; gap: 9px; padding: 10px 13px; border: 1px solid var(--blue); background: var(--blue); color: #fff; }
.primary-link:hover { background: #1c4a63; }
.quiet-link:hover, .text-link:hover { text-decoration: underline; }
.edition-stamp { min-width: 164px; padding: 15px 17px; border-top: 2px solid var(--coral); border-bottom: 1px solid var(--line-strong); text-align: right; }
.stamp-label, .edition-stamp strong, .edition-stamp span { display: block; }
.stamp-label { color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.edition-stamp strong { margin: 4px 0 7px; font-size: 32px; line-height: 1; }
.edition-stamp span:last-child { color: var(--muted); font-size: 12px; }

.topic-strip { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 17px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.topic-strip .eyebrow { margin-bottom: 4px; }
.topic-hint { margin: 0; color: var(--muted); font-size: 12px; }
.topic-list { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.topic-button { padding: 8px 10px; border: 0; background: transparent; color: var(--muted); font-size: 13px; }
.topic-button span { margin-left: 4px; color: var(--faint); font-size: 11px; }
.topic-button:hover, .topic-button.is-selected { background: var(--blue-soft); color: var(--blue); font-weight: 800; }

.toolbar { display: flex; align-items: center; gap: 18px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.search-box { display: flex; align-items: center; flex: 1; min-width: 200px; height: 43px; padding: 0 12px; border: 1px solid var(--line-strong); background: var(--surface); }
.search-icon { margin-right: 9px; color: var(--coral); font-size: 24px; line-height: 0; transform: rotate(-20deg); }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; }
.search-box kbd { padding: 2px 6px; border: 1px solid var(--line); color: var(--faint); font-size: 11px; }
.result-count { color: var(--muted); font-size: 13px; white-space: nowrap; }

.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 70px; padding: 48px 0 92px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font-size: 27px; line-height: 1.2; }
.section-rule { width: 56px; height: 3px; background: var(--yellow); }
.note-list { border-top: 1px solid var(--line-strong); }
.note-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) 85px; gap: 17px; padding: 23px 0 21px; border-bottom: 1px solid var(--line); }
.note-number { color: var(--coral); font-size: 15px; font-weight: 800; }
.note-row h3 { margin: 0 0 8px; font-size: 20px; line-height: 1.35; }
.note-row h3 button { padding: 0; border: 0; background: transparent; color: inherit; text-align: left; }
.note-row h3 button:hover { color: var(--blue); }
.note-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 11px; color: var(--muted); font-size: 12px; }
.note-meta .topic { color: var(--blue); font-weight: 700; }
.note-summary { max-width: 700px; margin: 0; color: #59675f; font-size: 14px; line-height: 1.75; }
.note-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 13px; }
.note-tag { padding: 3px 7px; background: var(--blue-soft); color: var(--blue); font-size: 11px; }
.note-actions { display: flex; flex-direction: column; align-items: end; gap: 9px; }
.note-actions button, .note-actions a { border: 0; background: transparent; color: var(--faint); font-size: 12px; text-decoration: none; }
.note-actions button:hover, .note-actions a:hover, .note-actions button.is-saved { color: var(--coral); }
.note-actions .read-time { color: var(--ink); font-size: 13px; font-weight: 800; }
.empty-state { padding: 64px 0; border-bottom: 1px solid var(--line); text-align: center; }
.empty-mark { color: var(--coral); font-size: 42px; }
.empty-state h3 { margin: 10px 0 7px; }
.empty-state p { margin: 0; color: var(--muted); }

.side-rail { border-left: 1px solid var(--line); padding-left: 28px; }
.rail-block { padding: 0 0 29px; margin-bottom: 29px; border-bottom: 1px solid var(--line); }
.rail-block h2 { margin-bottom: 13px; font-size: 20px; line-height: 1.35; }
.rail-block p:not(.eyebrow) { color: var(--muted); font-size: 13px; line-height: 1.8; }
.text-link { display: inline-flex; gap: 8px; }
.rail-list a { display: grid; grid-template-columns: 25px 1fr 16px; align-items: center; gap: 8px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 13px; text-decoration: none; }
.rail-list a:last-child { border-bottom: 1px solid var(--line); }
.rail-list a:hover { color: var(--blue); }
.rail-list a span { color: var(--coral); font-size: 11px; font-weight: 800; }
.rail-list a b { color: var(--faint); font-size: 13px; }
.reading-block { border-bottom: 0; padding-bottom: 0; }
.rail-mark { display: inline-block; color: var(--blue); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }

.site-footer { display: flex; align-items: start; justify-content: space-between; gap: 22px; width: min(1220px, calc(100% - 48px)); margin: auto; padding: 24px 0 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.site-footer strong { color: var(--ink); }
.site-footer a { color: var(--blue); text-decoration: none; }
.note-dialog { width: min(720px, calc(100% - 32px)); max-height: min(760px, calc(100% - 32px)); padding: 36px 38px 40px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.note-dialog::backdrop { background: rgba(18, 35, 27, .46); }
.dialog-close { position: absolute; top: 14px; right: 14px; }
.dialog-kicker { margin-bottom: 14px; color: var(--coral); font-size: 11px; font-weight: 800; letter-spacing: .10em; }
.note-dialog h2 { max-width: 620px; margin: 0 0 12px; font-size: 31px; line-height: 1.2; }
.dialog-summary { color: var(--muted); font-size: 16px; line-height: 1.85; }
.dialog-next { margin: 26px 0; padding: 17px; background: var(--blue-soft); color: #25465a; font-size: 13px; line-height: 1.8; }
.dialog-links { display: flex; gap: 18px; flex-wrap: wrap; }
.dialog-links a { color: var(--blue); font-size: 13px; font-weight: 800; text-decoration: none; }
.dialog-links a:hover { text-decoration: underline; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 30; padding: 10px 14px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; background: var(--ink); color: #fff; font-size: 13px; transition: opacity .2s, transform .2s; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

body.dark { --paper: #111816; --surface: #1a2420; --ink: #edf4ef; --muted: #a7b5ab; --faint: #718178; --line: #2d3b33; --line-strong: #46564c; --blue: #8bc6e2; --blue-soft: #203944; --coral: #ff927b; --coral-soft: #402923; --shadow: 0 20px 48px rgba(0, 0, 0, .28); }
body.dark .site-header { background: rgba(17, 24, 22, .95); }
body.dark .note-summary { color: #bdc9c0; }
body.dark .dialog-next { color: #bfe0ef; }

@media (max-width: 900px) {
  .content-layout { grid-template-columns: 1fr; gap: 45px; }
  .side-rail { border-left: 0; border-top: 1px solid var(--line); padding: 38px 0 0; }
  .rail-block { max-width: 650px; }
}

@media (max-width: 640px) {
  .header-inner, .page-shell, .site-footer { width: calc(100% - 28px); }
  .header-inner { gap: 8px; min-height: 60px; }
  .brand { font-size: 15px; }
  .brand img { width: 29px; height: 29px; }
  .main-nav { gap: 0; }
  .nav-link { padding: 7px 5px; font-size: 11px; }
  .intro-band { align-items: start; flex-direction: column; padding: 50px 0 36px; }
  h1 { font-size: 42px; }
  .edition-stamp { align-self: stretch; text-align: left; }
  .topic-strip { align-items: start; flex-direction: column; gap: 13px; }
  .topic-list { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; width: 100%; padding-bottom: 3px; }
  .topic-button { flex: 0 0 auto; }
  .toolbar { align-items: stretch; flex-direction: column; gap: 10px; }
  .content-layout { padding-top: 35px; }
  .note-row { grid-template-columns: 28px minmax(0, 1fr); gap: 11px; }
  .note-actions { grid-column: 2; flex-direction: row; align-items: center; }
  .note-row h3 { font-size: 17px; }
  .note-summary { font-size: 13px; }
  .site-footer { flex-direction: column; }
  .note-dialog { padding: 32px 22px 26px; }
  .note-dialog h2 { font-size: 26px; }
}
