@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;
  --paper2: #f5f5f5;
  --ink: #1a1a1a;
  --ink-soft: #57524c;
  --rule: #e0ded6;
  --ghost: #efece3;
  --serif: 'Source Serif 4', 'Songti SC', 'Noto Serif SC', Georgia, 'Times New Roman', serif;
  --display: 'Playfair Display', 'Songti SC', 'Noto Serif SC', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, 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;
  transition: none;
}

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

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

img { max-width: 100%; }

/* ---------- 页头 ---------- */
.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.mast-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.brand {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 10px;
  font-family: var(--display);
  font-weight: 900;
  font-size: 23px;
  letter-spacing: .16em;
  line-height: 1.1;
}

.logo-mark {
  width: 32px;
  height: 32px;
  border: 1px solid var(--ink);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: 0;
}

.menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 2px;
}

.menu--l ul { justify-content: flex-end; }
.menu--r ul { justify-content: flex-start; }

.menu a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  font-size: 16px;
  letter-spacing: .05em;
  line-height: 1.3;
  white-space: nowrap;
}

.menu a:hover,
.menu a:focus-visible { text-decoration: underline; text-underline-offset: 6px; }

.has-sub { position: relative; }

.sub {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 190px;
  display: none;
  flex-direction: column;
  gap: 0;
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 6px;
  z-index: 45;
}

.menu--r .sub { left: auto; right: 0; }

.has-sub:hover .sub,
.has-sub:focus-within .sub { display: flex; }

.sub a { min-height: 42px; width: 100%; }

/* ---------- 粘性锚点条 ---------- */
.rail {
  position: sticky;
  top: 0;
  z-index: 35;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.rail-list {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
  list-style: none;
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.rail-list::-webkit-scrollbar { display: none; }

.rail-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  font-size: 16px;
  letter-spacing: .04em;
  color: var(--ink-soft);
  white-space: nowrap;
}

.rail-list a:hover,
.rail-list a[aria-current] {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 6px;
}

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 45vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 54px 24px 58px;
  border-bottom: 1px solid var(--rule);
  --py: 0px;
}

.hero-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, calc(-50% + var(--py)));
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(96px, 21vw, 230px);
  line-height: 1;
  letter-spacing: .08em;
  color: var(--ghost);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  z-index: 0;
}

.hero-inner { position: relative; z-index: 1; }

.hero-glyph {
  width: 44px;
  height: 44px;
  display: block;
  margin: 0 auto 16px;
  stroke: var(--ink);
  fill: none;
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.hero h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(28px, 5vw, 50px);
  line-height: 1.24;
  letter-spacing: .01em;
}

.hero-desc {
  margin: 18px auto 0;
  max-width: 46ch;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.7;
}

/* ---------- 主体骨架 ---------- */
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 212px minmax(0, 1fr);
  gap: 52px;
  align-items: start;
}

.side {
  position: sticky;
  top: 68px;
  align-self: start;
  padding: 44px 0 60px;
}

.side h2 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .16em;
  line-height: 1.3;
}

.side hr {
  border: 0;
  border-top: 1px solid var(--ink);
  margin: 0 0 16px;
}

.side nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: side;
}

.side li { counter-increment: side; }

.side a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 40px;
  padding: 8px 0;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink-soft);
}

.side a::before {
  content: counter(side, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--ink);
  opacity: .5;
  flex: none;
}

.side a:hover,
.side a[aria-current] { color: var(--ink); }

.side a[aria-current] { text-decoration: underline; text-underline-offset: 5px; }

.main {
  min-width: 0;
  padding-bottom: 76px;
}

/* ---------- 正文 ---------- */
div.prose > section {
  padding: 62px 0;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 76px;
}

div.prose > section:first-child {
  border-top: 0;
  padding-top: 54px;
}

.prose h2 {
  margin: 0 0 18px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(24px, 3.2vw, 33px);
  line-height: 1.28;
  letter-spacing: .01em;
}

.prose h3 {
  margin: 34px 0 12px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 21px;
  line-height: 1.35;
}

.prose h2 + hr,
.prose h3 + hr {
  margin: -4px 0 22px;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 28px 0;
}

.prose p { margin: 0 0 18px; }

.prose ul,
.prose ol {
  margin: 0 0 18px;
  padding-left: 1.25em;
}

.prose li { margin: 0 0 8px; }

.prose strong { font-weight: 600; }

.prose blockquote {
  margin: 26px 0;
  padding: 2px 0 2px 20px;
  border-left: 3px solid var(--ink);
  font-style: italic;
  color: var(--ink-soft);
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.prose img {
  display: block;
  height: auto;
  margin: 26px 0;
  border: 1px solid var(--rule);
}

.prose code,
.prose pre { font-family: var(--mono); font-size: 15px; }

/* ---------- 页脚 ---------- */
.foot {
  border-top: 1px solid var(--ink);
  background: var(--paper2);
}

.foot-cta {
  max-width: 1180px;
  margin: 0 auto;
  padding: 58px 24px 44px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  border-bottom: 1px solid var(--rule);
}

.cta-word {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(34px, 7vw, 72px);
  line-height: 1;
  letter-spacing: .07em;
}

.cta-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--ink);
  font-size: 16px;
  letter-spacing: .1em;
}

.cta-link:hover,
.cta-link:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

.foot-row {
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.foot-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-family: var(--display);
  font-weight: 900;
  font-size: 19px;
  letter-spacing: .14em;
}

.foot-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 9px;
  font-size: 16px;
  color: var(--ink-soft);
}

.foot-nav a:hover,
.foot-nav a:focus-visible { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; }

.foot-base { border-top: 1px solid var(--rule); }

.foot-base p {
  margin: 0;
  padding: 20px 24px;
  text-align: center;
  font-size: 16px;
  letter-spacing: .12em;
  color: var(--ink-soft);
}

/* ---------- 入场 ---------- */
.reveal { opacity: .001; transform: translateY(10px); }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- 窄屏 ---------- */
@media (max-width: 880px) {
  .mast-inner {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 14px 12px 8px;
  }

  .brand { justify-self: center; order: -1; }

  .menu { overflow-x: auto; scrollbar-width: none; }
  .menu::-webkit-scrollbar { display: none; }

  .menu ul,
  .menu--l ul,
  .menu--r ul {
    justify-content: flex-start;
    flex-wrap: nowrap;
  }

  .has-sub { display: flex; align-items: center; }

  .sub {
    position: static;
    display: flex;
    flex-direction: row;
    min-width: 0;
    border: 0;
    padding: 0;
    gap: 2px;
    background: transparent;
  }

  .hero { min-height: 45vh; padding: 44px 18px 46px; }
  .hero-mark { font-size: clamp(84px, 30vw, 150px); }

  .wrap {
    grid-template-columns: 1fr;
    padding: 0 18px;
    gap: 0;
  }

  .side { display: none; }

  div.prose > section { padding: 48px 0; scroll-margin-top: 68px; }
  div.prose > section:first-child { padding-top: 40px; }

  .foot-cta { padding: 44px 18px 34px; }
  .foot-row { padding: 24px 18px; flex-direction: column; align-items: flex-start; }
  .foot-base p { padding: 18px; }
}

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