@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400&family=Source+Serif+4:ital,wght@0,300;0,400;0,600;1,300&display=swap');

:root {
  --paper: #fdfbf7;
  --wash: #f5f5f5;
  --ink: #1a1a1a;
  --rule: #e0e0e0;
  --mute: #5c5852;
  --serif: "Source Serif 4", "Songti SC", "Noto Serif SC", Georgia, serif;
  --disp: "Playfair Display", "Songti SC", "Noto Serif SC", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;
  color-scheme: light;
}

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

html {
  background: var(--paper);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.74;
  font-weight: 400;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: .38;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.32'/%3E%3C/svg%3E");
}

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

a { color: var(--ink); }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 80;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 16px;
  font-size: 16px;
  text-decoration: none;
}
.skip:focus { left: 10px; top: 10px; }

/* ── 页头 ───────────────────────────────────────── */
.top {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 10px clamp(14px, 4vw, 44px);
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  min-width: 0;
}

.mark { display: block; line-height: 0; }
.logo {
  width: 34px;
  height: 34px;
  display: block;
  object-fit: contain;
  filter: grayscale(1) contrast(1.1);
}

.wordmark {
  font-family: var(--disp);
  font-weight: 900;
  font-size: 21px;
  letter-spacing: .02em;
  color: var(--ink);
  text-decoration: none;
  padding: 8px 0;
  display: inline-block;
  min-height: 44px;
}
.wordmark:hover { text-decoration: underline; text-underline-offset: 5px; }

.nav { min-width: 0; }

.navline {
  display: flex;
  flex-wrap: wrap;
  gap: 0 2px;
  margin: 0;
}

.navlink {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 9px;
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.navlink:hover {
  background: var(--wash);
  border-bottom-color: var(--ink);
}

.fold { position: relative; }

.fold > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--ink);
  font-size: 16px;
  color: var(--ink);
  user-select: none;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after {
  content: "+";
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1;
}
.fold[open] > summary { background: var(--ink); color: var(--paper); }
.fold[open] > summary::after { content: "−"; }

.fold-body {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(76vw, 290px);
  display: grid;
  gap: 6px;
  padding: 14px;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 0 14px 30px rgba(26, 26, 26, .16);
  z-index: 55;
}

.fold-tag {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .16em;
  color: var(--mute);
}

.fold-group {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 4px;
}

.foldlink {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--rule);
}
.foldlink:hover { border-color: var(--ink); background: var(--wash); }

.find {
  display: flex;
  align-items: stretch;
  min-height: 44px;
  border: 1px solid var(--ink);
  background: var(--wash);
}

.find input {
  flex: 1 1 96px;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0 11px;
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ink);
}
.find input::placeholder { color: var(--mute); }
.find input:focus {
  outline: 2px solid var(--ink);
  outline-offset: -3px;
}
.find input::-webkit-search-cancel-button { filter: grayscale(1); }

.find button {
  border: 0;
  border-left: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  min-height: 44px;
  padding: 0 15px;
  font-family: var(--serif);
  font-size: 16px;
  cursor: pointer;
}
.find button:hover { background: var(--paper); color: var(--ink); }

/* ── 首屏 ───────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: clamp(22px, 4vw, 60px);
  align-items: center;
  min-height: 100vh;
  padding: clamp(26px, 5vw, 72px) clamp(16px, 5vw, 56px);
  border-bottom: 1px solid var(--ink);
}

.hero-copy { max-width: 32ch; }

.hero-title {
  margin: 0 0 30px;
  font-family: var(--disp);
  font-weight: 900;
  font-size: clamp(34px, 7vw, 70px);
  line-height: 1.06;
  letter-spacing: -.02em;
  text-wrap: balance;
}

.hero-jump {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid var(--ink);
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
}
.hero-jump:hover { background: var(--ink); color: var(--paper); }

.hero-media {
  position: relative;
  height: min(62vh, 520px);
  border: 1px solid var(--ink);
  background: var(--wash);
  overflow: hidden;
  box-shadow: 0 22px 46px rgba(26, 26, 26, .13);
}

.hero-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.06);
}

.hero-plate { display: block; height: 100%; background: var(--wash); }

/* ── 正文骨架 ───────────────────────────────────── */
.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 236px;
  gap: clamp(22px, 4vw, 52px);
  max-width: 1140px;
  margin: 0 auto;
  padding: clamp(26px, 5vw, 60px) clamp(16px, 5vw, 40px);
}

.body {
  min-width: 0;
  max-width: 66ch;
}

.body > section {
  padding: 30px 0 8px;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 96px;
}
.body > section:first-child { border-top: 0; padding-top: 0; }

.body section.hit {
  background: var(--wash);
  box-shadow: inset 3px 0 0 var(--ink);
}

.body p { margin: 0 0 1.05em; }
.body ul, .body ol { margin: 0 0 1.1em; padding-left: 1.35em; }
.body li { margin: 0 0 .4em; }

.body h2 {
  margin: .1em 0 .55em;
  font-family: var(--disp);
  font-weight: 700;
  font-size: clamp(25px, 3.4vw, 34px);
  line-height: 1.2;
  letter-spacing: -.012em;
  text-wrap: balance;
}

.body h3 {
  margin: 1.2em 0 .45em;
  font-family: var(--disp);
  font-weight: 700;
  font-size: clamp(20px, 2.4vw, 24px);
  line-height: 1.3;
}

.body h4 {
  margin: 1.1em 0 .4em;
  font-size: 17px;
  font-weight: 600;
}

.body a { text-underline-offset: 3px; }
.body a:hover { background: var(--wash); }

.body blockquote {
  margin: 1.2em 0;
  padding: 4px 0 4px 18px;
  border-left: 3px solid var(--ink);
  font-style: italic;
  color: var(--mute);
}

.body figure { margin: 1.2em 0; }
.body figcaption {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--mute);
  margin-top: 8px;
}

.body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 16px;
}
.body th, .body td {
  border: 1px solid var(--rule);
  padding: 9px 11px;
  text-align: left;
  vertical-align: top;
}
.body th { background: var(--wash); font-weight: 600; }

.body code, .body pre { font-family: var(--mono); font-size: 15px; }
.body pre {
  padding: 14px;
  border: 1px solid var(--rule);
  background: var(--wash);
  overflow-x: auto;
}

.body time {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .07em;
  color: var(--mute);
}

small {
  display: block;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: .2em;
  color: var(--mute);
  margin-bottom: 4px;
}

/* ── 侧栏 ───────────────────────────────────────── */
.rail {
  position: sticky;
  top: 96px;
  align-self: start;
  padding: 18px;
  border: 1px solid var(--rule);
  background: var(--wash);
  box-shadow: 0 12px 26px rgba(26, 26, 26, .07);
}

.rail-h {
  margin: 0 0 12px;
  font-family: var(--disp);
  font-weight: 700;
  font-size: 21px;
  line-height: 1.2;
}

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

.rail-list li {
  counter-increment: rail;
  border-top: 1px solid var(--rule);
}
.rail-list li:first-child { border-top: 0; }

.rail-list a {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  font-size: 16px;
  line-height: 1.35;
  color: var(--ink);
  text-decoration: none;
}
.rail-list a::before {
  content: counter(rail, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mute);
  flex: none;
}
.rail-list a:hover { text-decoration: underline; text-underline-offset: 3px; }

.rail-top {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 12px;
  font-size: 16px;
  color: var(--ink);
  text-underline-offset: 3px;
}

/* ── 页脚 ───────────────────────────────────────── */
.foot {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 0 clamp(22px, 4vw, 52px);
  padding: clamp(28px, 5vw, 64px) clamp(16px, 5vw, 44px) 0;
  border-top: 1px solid var(--ink);
  background: var(--wash);
}

.foot-cta {
  grid-column: 1 / -1;
  padding: clamp(22px, 4vw, 44px);
  margin-bottom: clamp(24px, 4vw, 44px);
  border: 1px solid var(--ink);
  background: var(--paper);
  box-shadow: 0 22px 46px rgba(26, 26, 26, .11);
}

.cta-h {
  margin: 0 0 20px;
  font-family: var(--disp);
  font-weight: 900;
  font-size: clamp(30px, 6.4vw, 56px);
  line-height: 1.04;
  letter-spacing: -.02em;
}

.cta-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--ink);
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
}
.cta-link:hover { background: var(--ink); color: var(--paper); }

.foot-brand, .foot-nav { padding-bottom: 28px; min-width: 0; }

.foot-h {
  margin: 0 0 10px;
  font-family: var(--disp);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.2;
}

.foot-desc {
  margin: 0;
  max-width: 42ch;
  font-size: 16px;
  color: var(--mute);
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 2px;
  margin: 0;
}

.footlink {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 9px;
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
}
.footlink:hover { background: var(--paper); text-decoration: underline; text-underline-offset: 3px; }

.foot-bar {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 20px;
  padding: 12px 0;
  border-top: 1px solid var(--rule);
  font-size: 15px;
  color: var(--mute);
}
.foot-bar p { margin: 0; }
.foot-bar a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  text-underline-offset: 3px;
}

/* ── 断点 ───────────────────────────────────────── */
@media (max-width: 900px) {
  .stage { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; }
  .body { max-width: none; }
}

@media (max-width: 860px) {
  .top { position: static; }
  .brand { margin-right: 0; width: 100%; }
  .nav { width: 100%; }
  .navline { gap: 0; }
  .navlink { padding: 0 10px 0 0; }
  .find { flex: 1 1 100%; }
  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding-top: 28px;
    gap: 26px;
  }
  .hero-media { height: 40vh; min-height: 210px; }
  .hero-title { margin-bottom: 22px; }
  .body > section { scroll-margin-top: 16px; }
  .foot { grid-template-columns: minmax(0, 1fr); }
  .foot-bar { justify-content: space-between; }
}

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

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