/* Heads Up 中文版 — a quiet editorial layout: white paper, navy ink, hairline rules. */

:root {
  --navy: #0C2340;
  --blue: #1D4F91;
  --ink: #23272F;
  --muted: #6A717D;
  --faint: #9AA1AB;
  --rule: #E4E7EC;
  --paper: #FFFFFF;
  --tint: #F4F6F9;
  --serif: "Noto Serif SC", "Songti SC", "Source Han Serif SC", "STSong", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --gutter: 20px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.85 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: underline; text-decoration-color: rgba(29, 79, 145, .35); text-underline-offset: 4px; text-decoration-thickness: 1px; transition: text-decoration-color .15s, color .15s; }
a:hover { color: var(--navy); text-decoration-color: currentColor; }
strong { font-weight: 600; color: var(--navy); }
.serif { font-family: var(--serif); }
.en { color: var(--muted); }
.muted { color: var(--muted); font-size: .92em; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--gutter); top: 12px; z-index: 100; background: var(--paper); padding: 6px 12px; border: 1px solid var(--rule); }

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner { display: flex; align-items: center; gap: 24px; height: 72px; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--navy); text-decoration: none; margin-right: auto; min-width: 0; }
.brand:hover { color: var(--navy); }
.crest { flex: none; width: 38px; height: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; padding-left: 14px; border-left: 1px solid var(--rule); }
.brand-text strong { font: 700 19px/1.2 var(--serif); letter-spacing: .01em; }
.brand-text span { font-size: 12px; color: var(--muted); letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 32px; }
.nav-item { position: relative; }
.nav a { display: block; color: var(--ink); text-decoration: none; font-size: 15px; letter-spacing: .04em; padding: 24px 0; line-height: 24px; white-space: nowrap; }
.nav > ul > li > a { box-shadow: inset 0 -2px 0 transparent; transition: box-shadow .15s, color .15s; }
.nav > ul > li > a:hover, .nav-item.is-active > a { color: var(--navy); box-shadow: inset 0 -2px 0 var(--navy); }
.nav-sub {
  display: none; position: absolute; top: 100%; left: -20px; min-width: 200px;
  background: var(--paper); border: 1px solid var(--rule); border-top: 0; padding: 8px 0;
}
.nav-sub a { padding: 8px 20px; font-size: 14px; color: var(--muted); }
.nav-sub a:hover, .nav-sub a[aria-current="page"] { color: var(--navy); }
.nav-item:hover .nav-sub, .nav-item:focus-within .nav-sub { display: block; }

.menu-btn {
  display: none; font: inherit; font-size: 14px; letter-spacing: .08em; color: var(--navy); cursor: pointer;
  background: none; border: 1px solid var(--rule); padding: 6px 14px;
}

/* ---------- page title ---------- */
.hero { padding: 72px 0 48px; border-bottom: 1px solid var(--rule); }
.kicker { margin: 0 0 16px; color: var(--muted); font-size: 13px; letter-spacing: .12em; }
.hero h1 { margin: 0; font: 700 clamp(34px, 5.2vw, 52px)/1.2 var(--serif); color: var(--navy); letter-spacing: .02em; }
.quick { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 10px 28px; }
.quick a { font-size: 15px; color: var(--navy); text-decoration: none; border-bottom: 1px solid var(--navy); padding-bottom: 2px; }
.quick a::after { content: " ↗"; font-size: .85em; color: var(--muted); }
.quick a:hover { color: var(--blue); border-color: var(--blue); }

/* ---------- layout ---------- */
.layout { padding-top: 56px; padding-bottom: 96px; }
.layout.has-toc { display: grid; grid-template-columns: 220px minmax(0, 700px); gap: 80px; justify-content: space-between; align-items: start; }
.layout:not(.has-toc) .content { max-width: 700px; }
.content { min-width: 0; }

.toc { position: sticky; top: 112px; max-height: calc(100vh - 136px); overflow: auto; font-size: 14px; }
.toc summary { list-style: none; cursor: pointer; color: var(--faint); font-size: 12px; letter-spacing: .16em; padding-bottom: 12px; }
.toc summary::-webkit-details-marker { display: none; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule); }
.toc a { display: block; margin-left: -1px; padding: 7px 0 7px 16px; line-height: 1.55; color: var(--muted); text-decoration: none; border-left: 2px solid transparent; }
.toc a:hover { color: var(--navy); }
.toc a.is-current { color: var(--navy); border-left-color: var(--navy); font-weight: 500; }

/* ---------- articles ---------- */
.article + .article { margin-top: 72px; padding-top: 64px; border-top: 1px solid var(--rule); }
.article-head { margin-bottom: 24px; }
.tag { margin: 0 0 10px; font-size: 13px; letter-spacing: .12em; color: var(--blue); }
.article h2 { margin: 0; font: 700 28px/1.45 var(--serif); color: var(--navy); letter-spacing: .01em; }
.anchor { margin-left: 10px; font: 400 .7em var(--sans); color: var(--faint); text-decoration: none; opacity: 0; transition: opacity .15s; }
.article-head:hover .anchor, .anchor:focus { opacity: 1; }

.article-body > :first-child { margin-top: 0; }
.article-body > :last-child { margin-bottom: 0; }
.article h3 { margin: 40px 0 12px; font: 700 20px/1.5 var(--serif); color: var(--navy); }
.article p { margin: 0 0 18px; }
.article ul, .article ol { padding-left: 1.3em; margin: 0 0 18px; }
.article li { margin: 6px 0; padding-left: 4px; }
.article li::marker { color: var(--faint); }
.article li > ul, .article li > ol { margin: 6px 0 0; }

.fig { margin: 32px 0; }
.fig img { width: 100%; background: var(--tint); }
.fig figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); }

.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 32px 0; }
.g-item img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--tint); transition: opacity .15s; }
.g-item:hover img { opacity: .88; }

.table-wrap { overflow-x: auto; margin: 24px 0 28px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.7; }
caption { caption-side: bottom; text-align: left; padding-top: 10px; font-size: 13px; color: var(--muted); }
th, td { text-align: left; vertical-align: top; padding: 12px 20px 12px 0; border-bottom: 1px solid var(--rule); }
th { font-size: 13px; font-weight: 500; letter-spacing: .06em; color: var(--muted); border-bottom-color: var(--navy); white-space: nowrap; }
td p, td ul { margin: 0; }

.sched { border-top: 1px solid var(--navy); }
.sched-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 24px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.sched-date { font: 700 16px/1.85 var(--serif); color: var(--navy); white-space: nowrap; }
.sched ul { list-style: none; padding: 0; margin: 0; }
.sched li { margin: 0; padding: 0; }
.sched li + li { margin-top: 4px; }
.sched-row:last-child { border-bottom: 0; }

.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); margin: 24px 0 28px; border-top: 1px solid var(--navy); }
.kv dt, .kv dd { margin: 0; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.kv dt { padding-right: 32px; font-size: 14px; letter-spacing: .06em; color: var(--muted); line-height: 1.85; padding-top: 13px; }

.sign { margin-top: 28px !important; color: var(--muted); font-size: 15px; line-height: 1.8; }
.sign a { font-weight: 500; }

.btn-row { margin: 28px 0; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  background: var(--navy); color: #fff; padding: 12px 24px; font-size: 15px; letter-spacing: .06em;
  transition: background .15s;
}
.btn:hover { background: var(--blue); color: #fff; }
.btn .arrow { transition: transform .15s; }
.btn:hover .arrow { transform: translateX(3px); }

.note { margin: 24px 0; padding: 18px 22px; background: var(--tint); font-size: 16px; }
.note > :last-child { margin-bottom: 0; }
blockquote { margin: 32px 0; padding: 0 0 0 24px; border-left: 2px solid var(--navy); }
blockquote p { margin: 0 !important; font: 500 20px/1.75 var(--serif); color: var(--navy); }
blockquote cite { display: block; margin-top: 10px; font-style: normal; font-size: 14px; color: var(--muted); }
blockquote cite::before { content: "—— "; }

.source { margin-top: 80px; padding-top: 24px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 13px; word-break: break-all; }
.source a { color: var(--muted); }

/* ---------- archive ---------- */
.month-row { margin: 36px 0 4px !important; }
.month { font: 700 17px var(--serif); color: var(--navy); }
.issues { list-style: none !important; padding: 0 !important; margin: 0 !important; border-top: 1px solid var(--navy); }
.issue { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 24px; margin: 0 !important; padding: 12px 0 !important; border-bottom: 1px solid var(--rule); }
.issue-date { min-width: 96px; }
.issue-date a { color: var(--ink); font-weight: 500; }
.chips { list-style: none !important; display: flex; flex-wrap: wrap; gap: 4px 20px; padding: 0 !important; margin: 0 !important; }
.chips li { margin: 0 !important; padding: 0 !important; }
.chips a { font-size: 15px; }

/* ---------- footer ---------- */
.footer { background: var(--navy); color: rgba(255, 255, 255, .78); padding: 64px 0 40px; font-size: 14px; line-height: 1.9; }
.footer a { color: #fff; text-decoration-color: rgba(255, 255, 255, .35); }
.footer a:hover { color: #fff; text-decoration-color: #fff; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.footer p { margin: 0; }
.footer-title { margin-bottom: 12px !important; color: #fff; font-size: 13px; letter-spacing: .14em; }
.footer-title.serif { font-size: 20px; letter-spacing: .02em; }
.plain { list-style: none; padding: 0; margin: 0; }
.disclaimer { margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .16); color: rgba(255, 255, 255, .6); font-size: 13px; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .has-toc-page .hero { border-bottom: 0; padding-bottom: 36px; }
  .layout.has-toc { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { position: static; max-height: none; margin-bottom: 48px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
  .toc summary { padding: 14px 0; display: flex; justify-content: space-between; }
  .toc summary::after { content: "+"; font-size: 16px; line-height: 1; color: var(--muted); }
  .toc details[open] summary::after { content: "−"; }
  .toc ol { border-left: 0; padding-bottom: 12px; }
  .toc a { padding-left: 0; border-left: 0; }
  .content { max-width: 700px; }
}

@media (max-width: 820px) {
  .menu-btn { display: inline-block; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--paper); border-bottom: 1px solid var(--rule); }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; gap: 0; padding: 8px var(--gutter) 16px; }
  .nav a { padding: 12px 0; }
  .nav > ul > li > a:hover, .nav-item.is-active > a { box-shadow: none; }
  .nav-item.is-active > a { font-weight: 600; }
  .nav-sub { display: block; position: static; border: 0; padding: 0 0 4px 16px; min-width: 0; }
  .nav-sub a { padding: 8px 0; }
}

@media (max-width: 600px) {
  :root { --gutter: 20px; }
  body { font-size: 16px; }
  .topbar-inner { height: 64px; }
  .brand-text span { display: none; }
  .hero { padding: 48px 0 36px; }
  .layout { padding-top: 36px; padding-bottom: 72px; }
  .article + .article { margin-top: 56px; padding-top: 48px; }
  .article h2 { font-size: 23px; }
  .anchor { display: none; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sched-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .kv dt { padding: 12px 0 0; border-bottom: 0; }
  .kv dd { padding-top: 2px; }
  .footer-inner { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}

@media print {
  .topbar, .toc, .footer { display: none; }
  .article { break-inside: avoid; }
}
