@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;
  --paper-2: #f5f5f5;
  --ink: #1a1a1a;
  --line: #e2ded6;
  --line-2: #cdc7bc;
  --muted: #6a655d;
  --rail: 232px;
  --pad: clamp(16px, 4vw, 44px);
  --max: 1180px;
  --serif: 'Source Serif 4', 'Songti SC', 'Noto Serif SC', 'SimSun', serif;
  --disp: 'Playfair Display', 'Songti SC', 'SimSun', serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Courier New', monospace;
}

*, *::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: 17px;
  line-height: 1.75;
  font-weight: 400;
  overflow-x: hidden;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  opacity: .32;
  mix-blend-mode: multiply;
  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='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

body.is-locked { overflow: hidden; }

a { color: inherit; }

.skip {
  position: fixed;
  left: 12px;
  top: -90px;
  z-index: 80;
  padding: 12px 20px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  background: var(--ink);
  color: var(--paper);
  border-radius: 10px;
  text-decoration: none;
  transition: none;
}
.skip:focus { top: 12px; }

/* ---------- 页头 ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px var(--pad);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: none;
  border: 1px solid var(--ink);
  border-radius: 10px;
  font-family: var(--disp);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  color: var(--ink);
}

.mast-title {
  font-size: 15px;
  letter-spacing: .12em;
  white-space: nowrap;
}

.mast-spacer { flex: 1 1 auto; }

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  flex: none;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 10px;
  font-size: 15px;
  letter-spacing: .06em;
  text-decoration: none;
  transition: none;
}

.burger,
.close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  flex: none;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 10px;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: .1em;
  cursor: pointer;
  transition: none;
}

.burger:hover,
.close:hover,
.cta:hover { background: var(--ink); color: var(--paper); }
.burger:hover, .close:hover { background: var(--ink); color: var(--paper); }

/* ---------- 全屏菜单 ---------- */

.veil {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  flex-direction: column;
  padding: clamp(16px, 4vw, 48px);
  overflow: auto;
  background: var(--paper);
  visibility: hidden;
  opacity: 0;
  transition: none;
}

.veil.is-open { visibility: visible; opacity: 1; }

.veil-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.veil-brand { font-size: 16px; letter-spacing: .16em; }

.veil nav {
  margin: auto 0;
  padding: 4vh 0;
  max-width: 760px;
  width: 100%;
}

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

.veil li {
  counter-increment: idx;
  border-top: 1px solid var(--line);
}
.veil li:last-child { border-bottom: 1px solid var(--line); }

.veil li > a {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 12px 4px;
  font-family: var(--disp);
  font-size: clamp(20px, 2.6vw, 30px);
  line-height: 1.3;
  text-decoration: none;
  color: var(--ink);
}

.veil li > a::before {
  content: counter(idx, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--muted);
  margin-right: 16px;
  flex: none;
}

.veil li > a:hover { padding-left: 12px; }

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

.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: clamp(20px, 3vw, 44px);
  align-content: center;
  padding: clamp(22px, 5vw, 56px) var(--pad);
  min-height: calc(100svh - 62px);
  border-bottom: 1px solid var(--line);
}

.ghost {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.ghost span {
  position: absolute;
  right: -3vw;
  bottom: -6vh;
  font-family: var(--disp);
  font-weight: 900;
  font-size: clamp(160px, 34vw, 420px);
  line-height: .8;
  letter-spacing: -.05em;
  color: var(--ink);
  opacity: 0;
  animation: turn 13.5s steps(1, end) infinite;
}
.ghost span:nth-child(1) { animation-delay: 0s; }
.ghost span:nth-child(2) { animation-delay: 4.5s; }
.ghost span:nth-child(3) { animation-delay: 9s; }

@keyframes turn {
  0%, 32.9% { opacity: .055; }
  33%, 100% { opacity: 0; }
}

.hero-fig {
  position: relative;
  z-index: 2;
  margin: 0;
  min-height: 30vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--paper-2);
}

.hero-fig img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-body {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.hero-body h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(32px, 6vw, 60px);
  line-height: 1.12;
  letter-spacing: -.01em;
  max-width: 20ch;
}

.hero-body h1::after {
  content: "";
  display: block;
  width: 58px;
  height: 2px;
  margin: 22px auto 0;
  background: var(--ink);
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 26px;
  border: 1px solid var(--ink);
  border-radius: 10px;
  font-size: 16px;
  letter-spacing: .14em;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
  transition: none;
}
.hero-btn:hover { background: var(--ink); color: var(--paper); }

/* ---------- 主体 ---------- */

main { display: block; }

.paper {
  display: grid;
  gap: clamp(20px, 3vw, 48px);
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(26px, 5vw, 64px) var(--pad) clamp(40px, 7vw, 80px);
}

.rail {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-2);
  padding: 16px 16px 8px;
}

.rail small {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .3em;
  color: var(--muted);
}

.rail h2 {
  margin: 4px 0 14px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1.3;
}

.rail ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.rail li { border-top: 1px solid var(--line); }

.rail li a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 2px;
  font-size: 16px;
  line-height: 1.4;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 0;
}
.rail li a:hover { padding-left: 8px; }

.rail li {
  animation: rise .32s steps(4, end) both;
}
.rail li:nth-child(1) { animation-delay: .02s; }
.rail li:nth-child(2) { animation-delay: .06s; }
.rail li:nth-child(3) { animation-delay: .1s; }
.rail li:nth-child(4) { animation-delay: .14s; }
.rail li:nth-child(5) { animation-delay: .18s; }
.rail li:nth-child(6) { animation-delay: .22s; }
.rail li:nth-child(7) { animation-delay: .26s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

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

.prose { min-width: 0; }

.prose > section {
  padding-bottom: clamp(26px, 4vw, 44px);
  margin-bottom: clamp(26px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 92px;
}
.prose > section:last-child { border-bottom: 0; margin-bottom: 0; }

.prose small {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .3em;
  color: var(--muted);
  margin-bottom: 8px;
}

.prose h2 {
  margin: 0 0 .6em;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(23px, 3.4vw, 34px);
  line-height: 1.28;
  letter-spacing: -.005em;
}
.prose small + h2 { margin-top: 0; }

.prose h3 {
  margin: 1.5em 0 .5em;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
}

.prose p {
  margin: 0 0 1.05em;
  line-height: 1.85;
  max-width: 66ch;
}

.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.prose ul,
.prose ol {
  margin: 0 0 1.1em;
  padding-left: 1.4em;
}
.prose li { margin-bottom: .45em; line-height: 1.8; }

.prose blockquote {
  margin: 1.5em 0;
  padding: 2px 0 2px 18px;
  border-left: 3px solid var(--ink);
  font-style: italic;
  color: #363330;
}

.prose code {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
}

.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.3em 0;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.prose figure { margin: 1.4em 0; }

.prose figcaption {
  margin-top: 6px;
  font-size: 15px;
  color: var(--muted);
}

.prose table {
  width: 100%;
  margin: 1.3em 0;
  border-collapse: collapse;
  font-size: 16px;
}
.prose th,
.prose td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
.prose th { background: var(--paper-2); font-weight: 600; }

.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2em 0;
}

/* ---------- 页脚 ---------- */

footer {
  border-top: 2px solid var(--ink);
  padding: clamp(28px, 5vw, 56px) var(--pad) clamp(24px, 4vw, 40px);
  text-align: center;
  background: var(--paper);
}

.foot-cta { margin: 0 0 26px; }

.foot-cta a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 30px;
  border: 1px solid var(--ink);
  border-radius: 10px;
  font-size: 18px;
  letter-spacing: .16em;
  text-decoration: none;
  color: var(--ink);
  transition: none;
}
.foot-cta a:hover { background: var(--ink); color: var(--paper); }

.foot-brand {
  margin: 0 0 8px;
  font-size: 16px;
  letter-spacing: .2em;
}

footer small {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .16em;
  color: var(--muted);
}

/* ---------- 断点 ---------- */

@media (min-width: 880px) {
  .hero {
    grid-template-columns: 1.02fr 1fr;
    align-items: center;
    min-height: calc(100svh - 62px);
  }
  .hero-fig { min-height: min(56vh, 520px); }
}

@media (min-width: 900px) {
  .paper {
    grid-template-columns: var(--rail) minmax(0, 1fr);
    align-items: start;
  }
  .rail {
    position: sticky;
    top: 78px;
  }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .mast-title { display: none; }
  .cta { font-size: 14px; padding: 0 12px; }
  .ghost span { bottom: auto; top: 6vh; right: -6vw; }
  .hero { gap: 22px; }
  .hero-fig { min-height: 26vh; }
  .hero-body h1::after { margin-top: 16px; }
  .paper { padding-top: 22px; }
}

@media (max-width: 380px) {
  .mark { width: 40px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ghost span { animation: none; opacity: .055; }
  .ghost span:nth-child(2),
  .ghost span:nth-child(3) { opacity: 0; }
  .rail li { animation: none; }
}

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