@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600&family=Cormorant+Garamond:ital,wght@0,300;0,500;0,700;1,300;1,500&family=Crimson+Pro:ital,wght@0,300;0,400;0,600;1,300;1,400&display=swap');

:root {
  --ink: #000000;
  --paper: #ffffff;
  --paper-soft: #f4f2ee;
  --rule: rgba(0, 0, 0, 0.16);
  --rule-soft: rgba(255, 255, 255, 0.28);
  --bar-h: 64px;
  --disp: "Cormorant Garamond", "Cinzel", Georgia, "Songti SC", serif;
  --serif: "Crimson Pro", Georgia, "Songti SC", "SimSun", serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.72;
  padding-bottom: calc(var(--bar-h) + 2.6rem);
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration: none; }

svg { display: block; }

::selection { background: var(--ink); color: var(--paper); }

/* ---------- 报头 ---------- */

.mast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(16px, 4vw, 52px) 14px;
  border-bottom: 3px double var(--ink);
}

.mast-brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--disp);
  font-size: clamp(19px, 3vw, 26px);
  font-weight: 600;
  letter-spacing: 0.24em;
  transition: opacity 0.25s ease;
}

.mast-brand:hover { opacity: 0.62; }

.mast-word { padding-right: 0.06em; }

.mark-img { width: auto; max-height: 34px; }

.mast-fleuron {
  font-family: var(--disp);
  font-size: 22px;
  line-height: 1;
  opacity: 0.7;
}

/* ---------- 首屏 ---------- */

.sheet { padding: 0 clamp(16px, 4vw, 52px); }

.lede {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(14px, 3vw, 34px);
  min-height: 70vh;
  padding: clamp(30px, 6vw, 68px) 0;
  border-bottom: 1px solid var(--ink);
}

.lede-mark {
  width: clamp(32px, 6vw, 58px);
  height: auto;
  align-self: end;
  margin-bottom: 0.9rem;
  animation: slowspin 60s linear infinite;
}

@keyframes slowspin {
  to { transform: rotate(360deg); }
}

.lede-title {
  margin: 0;
  font-family: var(--disp);
  font-weight: 500;
  font-size: clamp(34px, 7.4vw, 82px);
  line-height: 0.99;
  letter-spacing: -0.012em;
  text-align: left;
}

.lede-dek {
  max-width: 46ch;
  margin: 1.15rem 0 0;
  font-size: clamp(17px, 2vw, 21px);
  font-style: italic;
  line-height: 1.6;
  text-align: left;
  border-left: 2px solid var(--ink);
  padding-left: 0.9rem;
}

/* ---------- 非对称栅格 ---------- */

.spread {
  display: grid;
  grid-template-columns: minmax(150px, 198px) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 66px);
  padding: clamp(32px, 6vw, 74px) 0 clamp(44px, 8vw, 96px);
  align-items: start;
}

/* ---------- 左侧索引 ---------- */

.rail {
  position: sticky;
  top: 26px;
  border-top: 2px solid var(--ink);
  padding-top: 10px;
}

.rail-kicker {
  display: block;
  font-family: var(--disp);
  font-size: 15px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.rail-title {
  margin: 0.15rem 0 0.7rem;
  font-family: var(--disp);
  font-weight: 600;
  font-size: 23px;
  line-height: 1.1;
  letter-spacing: 0.12em;
}

.rail-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: idx;
}

.rail-list li { counter-increment: idx; }

.rail-list a {
  position: relative;
  display: block;
  min-height: 44px;
  padding: 10px 6px 10px 2.4em;
  border-bottom: 1px solid var(--rule);
  font-size: 16px;
  line-height: 1.45;
  transition: background 0.22s ease, color 0.22s ease, padding-left 0.22s ease;
}

.rail-list a::before {
  content: counter(idx, decimal-leading-zero) ".";
  position: absolute;
  left: 0.3em;
  top: 10px;
  font-family: var(--disp);
  font-size: 14px;
  letter-spacing: 0.06em;
  opacity: 0.66;
}

.rail-list a:hover,
.rail-list a:focus-visible {
  background: var(--ink);
  color: var(--paper);
  padding-left: 2.7em;
}

.rail-list a:hover::before,
.rail-list a:focus-visible::before { opacity: 1; }

/* ---------- 正文 ---------- */

.content {
  max-width: 70ch;
  min-width: 0;
  counter-reset: sec;
}

.content > div {
  counter-increment: sec;
  margin: 0 0 clamp(2.4rem, 6vw, 4.8rem);
  scroll-margin-top: 2rem;
}

.content > div:last-child { margin-bottom: 0; }

.content h2 {
  margin: 0 0 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--ink);
  font-family: var(--disp);
  font-weight: 600;
  font-size: clamp(24px, 3.3vw, 35px);
  line-height: 1.14;
  letter-spacing: -0.005em;
}

.content h2::before {
  display: block;
  margin-bottom: 0.3rem;
  content: counter(sec, decimal-leading-zero);
  font-family: var(--disp);
  font-size: 14px;
  letter-spacing: 0.26em;
  opacity: 0.7;
}

.content h3 {
  margin: 2rem 0 0.6rem;
  font-family: var(--disp);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.25;
}

.content h4 {
  margin: 1.6rem 0 0.5rem;
  font-size: 18px;
  font-weight: 600;
}

.content p { margin: 0 0 1.15em; }

.content > div:first-child > p:first-of-type::first-letter {
  float: left;
  margin: 0.04em 0.1em 0 0;
  font-family: var(--disp);
  font-weight: 700;
  font-size: 4.4em;
  line-height: 0.76;
}

.content a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-thickness 0.2s ease, background 0.2s ease;
}

.content a:hover {
  background: var(--ink);
  color: var(--paper);
  text-decoration-thickness: 2px;
}

.content ul,
.content ol {
  margin: 0 0 1.3em;
  padding-left: 1.35em;
}

.content li { margin-bottom: 0.5em; }

.content li::marker {
  font-family: var(--disp);
  font-size: 0.95em;
}

.content blockquote {
  margin: 1.9rem 0;
  padding: 0.15rem 0 0.15rem 1.3rem;
  border-left: 5px solid var(--ink);
  font-family: var(--disp);
  font-size: 1.24em;
  font-style: italic;
  line-height: 1.45;
}

.content blockquote p:last-child { margin-bottom: 0; }

.content figure { margin: 1.9rem 0; }

.content figcaption {
  margin-top: 0.5rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--rule);
  font-size: 15px;
  letter-spacing: 0.03em;
}

.content img { margin: 1.4rem 0; filter: grayscale(1); }

.content hr {
  margin: 2.4rem 0;
  border: 0;
  border-top: 3px double var(--ink);
}

.content table {
  width: 100%;
  margin: 1.6rem 0;
  border-collapse: collapse;
  font-size: 16px;
}

.content th,
.content td {
  padding: 0.55em 0.7em;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

.content th {
  border-bottom: 2px solid var(--ink);
  font-weight: 600;
}

.content code {
  padding: 0.1em 0.35em;
  background: var(--paper-soft);
  font-size: 0.92em;
}

/* ---------- 页脚固定条 ---------- */

.bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: clamp(10px, 2vw, 30px);
  padding: 7px clamp(14px, 3vw, 30px) calc(7px + env(safe-area-inset-bottom));
  background: var(--ink);
  color: var(--paper);
  border-top: 1px solid var(--paper);
}

.bar-brand a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--disp);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.22em;
  transition: opacity 0.25s ease;
}

.bar-brand a:hover { opacity: 0.65; }

.bar-brand .mark-img { filter: invert(1) grayscale(1); }

.bar-nav { position: static; }

.bar-groups {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 10px;
  margin: 0;
}

.bar-groups dt,
.bar-groups dd { margin: 0; }

.bar-groups dt a { font-weight: 600; }

.bar-groups a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 5px;
  font-size: 15px;
  letter-spacing: 0.04em;
  border-bottom: 1px solid transparent;
  transition: border-color 0.22s ease, opacity 0.22s ease;
}

.bar-groups a:hover,
.bar-groups a:focus-visible { border-bottom-color: var(--paper); }

.bar-meta { text-align: center; }

.bar-copy {
  margin: 0;
  font-family: var(--disp);
  font-size: 15px;
  letter-spacing: 0.14em;
  white-space: nowrap;
}

.bar-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.to-top {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 6px;
  font-size: 15px;
  letter-spacing: 0.06em;
  border-bottom: 1px solid transparent;
}

.to-top:hover,
.to-top:focus-visible { border-bottom-color: var(--paper); }

.menu-btn {
  display: none;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--paper);
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: 16px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.22s ease, color 0.22s ease;
}

.menu-btn:hover { background: var(--paper); color: var(--ink); }

body.menu-open .menu-btn { background: var(--paper); color: var(--ink); }

/* ---------- 滚动显现 ---------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- 窄屏 ---------- */

@media (max-width: 859px) {
  :root { --bar-h: 60px; }

  body { font-size: 17px; }

  .bar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    padding: 7px 12px calc(7px + env(safe-area-inset-bottom));
  }

  .bar-nav {
    position: absolute;
    right: 0;
    bottom: 100%;
    left: 0;
    max-height: 0;
    overflow: hidden;
    background: var(--ink);
    border-top: 1px solid var(--rule-soft);
    transition: max-height 0.34s ease;
  }

  body.menu-open .bar-nav {
    max-height: min(62vh, 460px);
    overflow-y: auto;
  }

  .bar-groups {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 6px 4px 12px;
  }

  .bar-groups a {
    display: flex;
    padding: 8px 12px;
    font-size: 16px;
    border-bottom: 1px solid var(--rule-soft);
  }

  .menu-btn { display: inline-flex; align-items: center; }

  .bar-copy { font-size: 14px; letter-spacing: 0.08em; }

  .lede {
    min-height: 62vh;
    padding: clamp(24px, 9vw, 52px) 0;
    gap: 10px;
    align-items: end;
  }

  .lede-mark { align-self: start; margin-top: 0.2rem; }

  .spread {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
    padding: 28px 0 48px;
  }

  .rail { position: static; }

  .rail-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
  }

  .rail-list li { flex: 0 0 auto; }

  .rail-list a {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid var(--ink);
    white-space: nowrap;
  }

  .rail-list a::before {
    position: static;
    margin-right: 0.45em;
  }

  .rail-list a:hover { padding-left: 12px; }

  .content { max-width: none; }

  .content > div:first-child > p:first-of-type::first-letter {
    font-size: 3.6em;
  }

  .content blockquote { font-size: 1.12em; }
}

@media (max-width: 420px) {
  .to-top { display: none; }
  .lede-title { font-size: clamp(30px, 9vw, 42px); }
  .content h2 { font-size: clamp(22px, 6.4vw, 28px); }
}

/* ---------- 减弱动效 ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .lede-mark { animation: none; }

  *,
  *::before,
  *::after { transition-duration: 0.001ms !important; }
}

@media print {
  .bar { position: static; }
  body { padding-bottom: 0; }
  .rail { position: static; }
}

button[aria-expanded]{min-width:44px;min-height:44px}
