/* 高能暂现源 · 每日文献综述 — "warm-paper academic journal" reading design (#4a).
   Colors are authoritative in oklch; the token table lives here as CSS variables. */
:root {
  --paper:      oklch(0.985 0.011 88);
  --ai-tint:    oklch(0.973 0.012 86);
  --surface:    oklch(0.972 0.012 88);
  --fold:       oklch(0.965 0.012 88);
  --ink-title:  oklch(0.23 0.013 60);
  --ink-mast:   oklch(0.25 0.013 60);
  --ink-zh:     oklch(0.30 0.014 60);
  --ink-body:   oklch(0.37 0.012 62);
  --ink-meta:   oklch(0.50 0.015 66);
  --ink-faint:  oklch(0.60 0.015 66);
  --ink-abs:    oklch(0.55 0.014 62);
  --numeral:    oklch(0.72 0.02 68);
  --accent:     oklch(0.42 0.045 265);
  --accent-sub: oklch(0.55 0.02 265);
  --cite:       oklch(0.5 0.03 265);
  --cite-rule:  oklch(0.72 0.045 265);
  --hair:       oklch(0.87 0.012 82);
  --hair-soft:  oklch(0.86 0.012 82);
  --divider:    oklch(0.82 0.01 80);
  --link-rule:  oklch(0.75 0.04 265);

  --cn: "Noto Serif SC", serif;
  --latin: "Source Serif 4", "Noto Serif SC", serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--cn);
  color: var(--ink-mast);
  background-color: var(--paper);
  /* very subtle fractal-noise paper grain (~2.6% opacity) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.026'/%3E%3C/svg%3E");
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }

/* ---------- sticky slim header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 14px 40px;
  background: oklch(0.985 0.011 88 / 0.92);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--hair);
}
.sh-left { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.sh-title {
  font-weight: 600; font-size: 15px; letter-spacing: 0.08em;
  color: var(--ink-zh); white-space: nowrap;
}
.sh-vol { font-family: var(--latin); font-style: italic; font-size: 12.5px; color: var(--accent-sub); white-space: nowrap; }
.sh-right { display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--ink-meta); }
.sh-meta { display: flex; align-items: center; gap: 14px; }
.sh-div { color: var(--divider); }
.sh-count { color: var(--accent); white-space: nowrap; }
.sh-arch { color: var(--accent); }

/* ---------- page shell ---------- */
.body-wrap { position: relative; padding: 56px 48px 60px; }
.reading { max-width: 700px; margin: 0 auto; }

/* ---------- masthead ---------- */
.masthead {
  text-align: center; padding-bottom: 30px;
  border-bottom: 3px double var(--accent);
}
.masthead h1 {
  font-weight: 600; font-size: 34px; margin: 0 0 10px;
  letter-spacing: 0.1em; color: var(--ink-mast); white-space: nowrap;
}
.masthead-sub { font-family: var(--latin); font-size: 12px; letter-spacing: 0.2em; color: var(--accent-sub); }
.masthead-meta { margin-top: 14px; font-size: 12.5px; color: var(--ink-meta); letter-spacing: 0.06em; }

/* ---------- section headings (roman-numeral pattern) ---------- */
.sec { margin-top: 40px; }
.sec-head { display: flex; align-items: baseline; gap: 14px; margin: 44px 0 0; }
.sec-head#core, .sec-head#related { scroll-margin-top: 70px; }
.sec-num { font-family: var(--latin); font-style: italic; font-size: 28px; color: var(--accent); }
.sec-head h2 { font-weight: 600; font-size: 21px; margin: 0; letter-spacing: 0.06em; color: var(--ink-mast); }
.sec-count { font-family: var(--latin); font-size: 13px; color: var(--ink-meta); }
#overview { scroll-margin-top: 70px; }
.overview { margin: 18px 0 0; font-size: 16px; line-height: 2.0; color: var(--ink-zh); text-align: justify; }

/* ---------- editorial headline ---------- */
.editorial-lead {
  margin-top: 20px; padding: 22px 24px 24px;
  background: var(--ai-tint); border-top: 3px solid var(--accent);
}
.editorial-lead.breaking { border-top-color: oklch(0.48 0.16 28); }
.headline-kicker {
  font-family: var(--latin); font-size: 11px; font-weight: 700;
  letter-spacing: 0.16em; color: var(--accent); text-transform: uppercase;
}
.editorial-lead.breaking .headline-kicker { color: oklch(0.48 0.16 28); }
.editorial-lead.none .headline-kicker { color: var(--ink-meta); }
.editorial-lead h3 {
  margin: 9px 0 0; font-size: 23px; line-height: 1.45; font-weight: 600;
  color: var(--ink-title);
}
.editorial-lead p { margin: 12px 0 0; font-size: 15px; line-height: 1.9; color: var(--ink-zh); }
.headline-jump { display: inline-block; margin-top: 12px; font-size: 13px; border-bottom: 1px solid var(--link-rule); }
.news-list, .watch-list { margin-top: 26px; }
.news-list h3, .watch-list h3 {
  margin: 0 0 10px; font-size: 14px; letter-spacing: 0.12em; color: var(--ink-meta);
}
.news-list ol, .watch-list ul { margin: 0; padding-left: 1.4em; }
.news-list li, .watch-list li { margin: 9px 0; padding-left: 4px; color: var(--ink-zh); line-height: 1.75; }
.news-list li a { font-weight: 600; color: var(--ink-title); }
.news-list li span { display: block; margin-top: 2px; font-size: 14px; color: var(--ink-body); }
.watch-list li { font-size: 14px; color: var(--ink-body); }

.story-group { margin-top: 22px; }
.story-group + .story-group { margin-top: 32px; }
.story-group-title {
  margin: 0; padding-bottom: 8px; border-bottom: 2px solid var(--accent);
  font-family: var(--latin); font-size: 12px; letter-spacing: 0.16em;
  color: var(--accent);
}
.story-group-title.breaking { border-bottom-color: oklch(0.48 0.16 28); color: oklch(0.48 0.16 28); }
.news-story {
  padding: 22px 0 24px; border-bottom: 1px solid var(--hair-soft);
}
.news-story h3 { margin: 8px 0 0; font-size: 20px; line-height: 1.5; font-weight: 600; }
.news-story h3 a { color: var(--ink-title); }
.news-story p { margin: 10px 0 0; font-size: 14px; line-height: 1.8; color: var(--ink-body); }
.news-story p strong { margin-right: 0.8em; font-size: 12px; letter-spacing: 0.1em; color: var(--ink-meta); }
.news-story .story-reason { color: var(--ink-zh); }
.news-empty {
  margin-top: 20px; padding: 20px 22px; background: var(--ai-tint); border-top: 2px solid var(--hair-soft);
}
.news-empty strong { font-size: 18px; color: var(--ink-title); }
.news-empty p { margin: 8px 0 0; font-size: 14px; color: var(--ink-body); }

/* ---------- paper card ---------- */
.card {
  display: grid; grid-template-columns: 44px 1fr; gap: 22px;
  padding: 30px 0; border-top: 1px solid var(--hair-soft);
  scroll-margin-top: 70px;
}
.card-seq { font-family: var(--latin); font-size: 24px; color: var(--numeral); }
.card-body { min-width: 0; }

.tagline {
  font-family: var(--latin); font-size: 12px; letter-spacing: 0.08em;
  color: var(--accent); margin-bottom: 10px;
}
.en-title {
  font-family: var(--latin); font-weight: 600; font-size: 18.5px;
  line-height: 1.4; margin: 0; color: var(--ink-title);
}
.zh-title { margin: 6px 0 0; font-size: 16px; font-weight: 500; line-height: 1.5; color: var(--ink-zh); }
.authors { margin: 12px 0 0; font-family: var(--latin); font-size: 13px; line-height: 1.65; color: var(--ink-meta); }
.authors .affil { color: var(--ink-faint); }
.authors .etal, .etal { font-style: italic; color: oklch(0.62 0.015 66); }
.corr-mark { color: var(--accent); }

/* ---------- abstract ---------- */
.abstract-block { margin-top: 16px; }
.abstract-label { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.lbl-cn { font-size: 11px; letter-spacing: 0.2em; font-weight: 600; color: var(--ink-faint); }
.lbl-en { font-family: var(--latin); font-style: italic; font-size: 11px; color: oklch(0.66 0.012 68); }
.abstract-wrap { position: relative; }
.abstract {
  margin: 0; font-family: var(--latin); font-size: 13px; line-height: 1.75; color: var(--ink-abs);
}
.abstract.clamped {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.abstract-toggle {
  position: absolute; right: 0; bottom: 0; padding-left: 48px;
  background: linear-gradient(90deg, transparent, var(--paper) 44%);
  cursor: pointer; font-family: var(--cn); font-size: 13px; color: var(--accent);
  user-select: none;
}
.abstract:not(.clamped) + .abstract-toggle { position: static; padding-left: 0; background: none; display: inline-block; margin-top: 4px; }

/* ---------- AI review zone ---------- */
.ai-zone {
  margin-top: 18px; padding: 18px 20px;
  background: var(--ai-tint); border-left: 2px solid var(--accent);
}
.ai-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.ai-title { font-size: 11px; letter-spacing: 0.22em; font-weight: 600; color: var(--accent); }
.ai-cap { font-family: var(--latin); font-size: 11px; color: var(--ink-faint); }
.ai-block + .ai-block { margin-top: 16px; }
.ai-label { display: block; font-size: 11px; letter-spacing: 0.2em; font-weight: 600; color: var(--accent-sub); margin-bottom: 5px; }
.ai-body { margin: 0; font-size: 15px; line-height: 1.95; color: var(--ink-body); text-align: justify; }
.ai-body .cite, a.cite {
  color: var(--cite); border-bottom: 1px dotted var(--cite-rule);
  text-decoration: none; white-space: nowrap;
}
a.cite:hover { border-bottom-style: solid; }

/* ---------- source links ---------- */
.source-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 16px; }
.paper-link, .arxiv-link {
  display: inline-block; font-family: var(--latin); font-size: 13px;
  color: var(--accent); border-bottom: 1px solid var(--link-rule);
}

/* ---------- edge fold & revisions ---------- */
.edge-fold { margin-top: 32px; }
.fold-bar {
  list-style: none; cursor: pointer;
  padding: 15px 20px; background: var(--fold); border: 1px solid var(--hair);
  font-family: var(--latin); font-style: italic; font-size: 13.5px; color: var(--ink-meta);
  display: flex; justify-content: space-between; align-items: center;
}
.fold-bar::-webkit-details-marker { display: none; }
.fold-plus { color: var(--accent); font-style: normal; }
details[open] .fold-plus { }
details[open] .fold-plus::after { }
.fold-body { padding-top: 6px; }
.card.edge { display: block; opacity: 0.92; }
.card.edge .en-title { font-size: 16px; }
.zh-title-sm { margin: 12px 0 0; font-size: 14px; color: var(--ink-zh); }

.revisions { margin-top: 12px; }
.revision { border-left: 3px solid var(--hair); padding-left: 14px; margin: 14px 0; }
.revision h4 { margin: 0 0 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-meta); }
.revision p { margin: 6px 0; font-size: 13.5px; line-height: 1.8; color: var(--ink-body); }

/* ---------- footer ---------- */
.paper-footer {
  margin-top: 44px; padding-top: 18px; border-top: 3px double var(--accent);
  font-family: var(--latin); font-size: 11.5px; color: oklch(0.55 0.012 66);
  line-height: 1.9; letter-spacing: 0.03em; text-align: center;
}

/* ---------- archive list ---------- */
.archive { list-style: none; padding: 0; margin: 24px 0 0; columns: 2; column-gap: 40px; }
.archive li { margin: 0 0 10px; font-family: var(--latin); font-size: 15px; }
.archive a { border-bottom: 1px solid var(--link-rule); }

/* ---------- TOC drawer (left-margin bookmark tab + slide-out panel) ---------- */
.toc-drawer { position: absolute; left: 20px; top: 56px; z-index: 12; }
.toc-tab {
  position: relative; z-index: 2; width: 30px; padding: 16px 0;
  border: 1px solid var(--hair-soft); border-radius: 3px; background: var(--surface);
  color: var(--accent); font-family: var(--cn); font-size: 13px; letter-spacing: 0.3em;
  writing-mode: vertical-rl; cursor: pointer;
  box-shadow: 0 1px 6px oklch(0.4 0.02 70 / 0.06);
}
.toc-arrow { font-family: var(--latin); }
.toc-panel {
  position: absolute; left: 40px; top: 0;
  background: var(--surface); border: 1px solid var(--hair);
  border-radius: 4px; box-shadow: 0 8px 30px oklch(0.4 0.02 70 / 0.1);
}
.toc-panel[hidden] { display: none; }
.toc-panel-inner { width: 200px; padding: 18px 20px; }
.toc-panel-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--hair);
}
.toc-panel-title { font-family: var(--latin); font-size: 14px; color: var(--accent); letter-spacing: 0.06em; }
.toc-close { cursor: pointer; font-size: 17px; color: var(--ink-faint); line-height: 1; }
.toc-overview { display: block; padding: 4px 0; color: var(--accent); font-weight: 500; }
.toc-group { margin-top: 14px; font-size: 11px; letter-spacing: 0.16em; color: var(--accent-sub); }
.toc-group-plain { margin-top: 14px; font-size: 12.5px; color: var(--ink-faint); }
.toc-group-plain a { color: var(--ink-faint); }
.toc-link {
  display: block; padding: 3px 0; color: oklch(0.46 0.012 64); font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.toc-link:hover, .toc-overview:hover { color: var(--accent); }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .site-header { padding: 12px 16px; gap: 10px; }
  .sh-title { font-size: 14px; letter-spacing: 0.04em; white-space: normal; }
  .sh-vol, .sh-meta { display: none; }
  .body-wrap { padding: 40px 18px 48px; }
  .reading { max-width: 100%; }
  .masthead h1 { font-size: 25px; white-space: normal; letter-spacing: 0.06em; }
  .masthead-sub { letter-spacing: 0.12em; }
  .card { grid-template-columns: 26px 1fr; gap: 12px; }
  .card-seq { font-size: 18px; }
  .toc-drawer { position: fixed; left: 0; top: auto; bottom: 22%; }
  .toc-panel { left: 30px; box-shadow: 0 10px 40px oklch(0.4 0.02 70 / 0.2); }
}
