@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700&family=Syne:wght@400;500;600;700&display=swap');

:root {
  --paper: #fdfbf7;
  --panel: #f5f5f5;
  --ink: #1a1a1a;
  --ink-soft: #4a4a4a;
  --line: #e0e0e0;
  --line-strong: #cfcfcf;
}

*,
*::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: "Manrope", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: .01em;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  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='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.32'/%3E%3C/svg%3E");
}

img { max-width: 100%; }

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

[id] { scroll-margin-top: 130px; }

.page {
  position: relative;
  z-index: 2;
}

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

.masthead {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
}

.brandline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px clamp(14px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
}

.mark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 0;
  font-family: "Syne", "Manrope", sans-serif;
  font-weight: 700;
  font-size: 1.06rem;
  letter-spacing: .08em;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
}

.tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}

.find {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 220px;
}

.find input {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 0;
  appearance: none;
}

.find input:focus {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.burger {
  min-height: 42px;
  padding: 8px 14px;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
  transition: background-color 120ms linear;
}

.burger:hover { background: var(--panel); }

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

.menubar nav {
  overflow-x: auto;
  scrollbar-width: thin;
}

.menubar p {
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0 clamp(8px, 3vw, 34px);
}

.menubar a {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 10px 12px;
  font-size: 1rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: background-color 120ms linear, border-color 120ms linear;
}

.menubar a:hover,
.menubar a:focus-visible {
  background: var(--panel);
  border-bottom-color: var(--ink);
}

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

.drawer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: clamp(18px, 5vw, 48px);
  overflow: auto;
  background: var(--paper);
}

.drawer[hidden] { display: none; }

.drawer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ink);
}

.drawer-top span {
  font-family: "Syne", sans-serif;
  letter-spacing: .26em;
  font-size: 1rem;
}

.drawer-close {
  min-height: 44px;
  padding: 8px 16px;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
}

.drawer-close:hover { background: var(--panel); }

.drawer nav p {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.drawer nav a {
  display: flex;
  align-items: center;
  min-height: 58px;
  padding: 8px 4px;
  font-family: "Syne", sans-serif;
  font-size: clamp(1.15rem, 4.4vw, 1.85rem);
  letter-spacing: .01em;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: padding-left 120ms linear, background-color 120ms linear;
}

.drawer nav a:hover {
  padding-left: 14px;
  background: var(--panel);
}

body.menu-on { overflow: hidden; }

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

.hero {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  padding: clamp(30px, 6vw, 78px) clamp(16px, 5vw, 64px) 0;
  border-bottom: 1px solid var(--line);
  background-color: var(--paper);
  background-image: radial-gradient(var(--line-strong) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: 0 0;
}

.hero-inner {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  text-align: right;
}

.hero-title {
  margin: 0 0 18px;
  font-family: "Syne", sans-serif;
  font-weight: 700;
  font-size: clamp(2.05rem, 7.4vw, 4.8rem);
  line-height: 1.04;
  letter-spacing: -.02em;
  text-wrap: balance;
}

.hero-lead {
  max-width: 44ch;
  margin: 0 0 14px auto;
  color: var(--ink-soft);
}

.hero-cue { margin: 0; }

.hero-cue a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 0;
  font-size: 1rem;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
}

.hero-media {
  width: 100%;
  max-width: 1100px;
  margin: clamp(24px, 5vw, 58px) auto 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-bottom: 0;
  background: var(--panel);
}

.hero-media img {
  display: block;
  width: 100%;
  height: clamp(180px, 32vh, 350px);
  object-fit: cover;
  filter: grayscale(1) contrast(1.06);
  transform-origin: center top;
}

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

.wrap {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: clamp(22px, 4vw, 56px);
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(30px, 5vw, 74px) clamp(16px, 5vw, 48px) 0;
}

.rail {
  position: sticky;
  top: 132px;
  padding: 18px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 var(--line), 0 8px 20px rgba(26, 26, 26, .05);
}

.eyebrow {
  display: block;
  margin: 0 0 4px;
  font-size: 1rem;
  letter-spacing: .2em;
  color: var(--ink-soft);
}

.rail h2 {
  margin: 0 0 12px;
  font-family: "Syne", sans-serif;
  font-size: 1.12rem;
  letter-spacing: .02em;
}

.rail-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.rail-list li { border-bottom: 1px dotted var(--line-strong); }

.rail-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 2px;
  font-size: 1rem;
  color: var(--ink);
  text-decoration: none;
  transition: padding-left 120ms linear, background-color 120ms linear;
}

.rail-list a:hover {
  padding-left: 8px;
  background: var(--paper);
}

.rail-list li.is-off { display: none; }

.doc { min-width: 0; }

.doc > section {
  padding-top: 22px;
  border-top: 2px solid var(--ink);
}

.body-zone p {
  max-width: 66ch;
  margin: 0 0 1.15em;
}

.body-zone h2,
.body-zone h3 {
  margin: 56px 0 16px;
  font-family: "Syne", sans-serif;
  line-height: 1.18;
  letter-spacing: -.01em;
}

.body-zone h2 {
  padding-top: 20px;
  font-size: clamp(1.4rem, 3.2vw, 2rem);
  border-top: 1px solid var(--line);
}

.body-zone h3 {
  font-size: clamp(1.2rem, 2.4vw, 1.45rem);
}

.body-zone small {
  display: block;
  margin: 52px 0 6px;
  font-size: 1rem;
  letter-spacing: .18em;
  color: var(--ink-soft);
}

.body-zone small + h2,
.body-zone small + h3 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.body-zone > section:first-child small:first-child { margin-top: 0; }

.body-zone ul,
.body-zone ol {
  max-width: 66ch;
  margin: 0 0 1.2em;
  padding-left: 1.25em;
}

.body-zone li { margin: .4em 0; }

.body-zone a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.body-zone img {
  display: block;
  height: auto;
  border: 1px solid var(--line);
  filter: grayscale(1);
}

.body-zone blockquote {
  margin: 26px 0;
  padding: 4px 0 4px 18px;
  color: var(--ink-soft);
  border-left: 3px solid var(--ink);
}

.body-zone table {
  width: 100%;
  margin: 0 0 1.2em;
  border-collapse: collapse;
  font-size: 1rem;
}

.body-zone th,
.body-zone td {
  padding: 9px 11px;
  text-align: left;
  border: 1px solid var(--line);
}

.body-zone th { background: var(--panel); }

.body-zone code {
  padding: 1px 5px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: .95em;
  background: var(--panel);
}

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

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 22px;
  margin-top: clamp(44px, 7vw, 84px);
  padding: 14px clamp(16px, 5vw, 48px) 18px;
  font-size: 1rem;
  border-top: 1px solid var(--ink);
}

.foot-brand a {
  font-family: "Syne", sans-serif;
  font-weight: 600;
  letter-spacing: .06em;
  text-decoration: none;
}

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

.foot nav a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 6px 8px;
  text-decoration: none;
}

.foot nav a:hover { background: var(--panel); }

.foot-copy {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink-soft);
}

.foot-copy a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 6px 0;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

@media (max-width: 860px) {
  .wrap {
    grid-template-columns: minmax(0, 1fr);
    padding-bottom: 0;
  }

  .rail {
    position: static;
    top: auto;
  }

  .doc > section { padding-top: 20px; }
}

@media (max-width: 520px) {
  body { font-size: 16px; }

  .mark { font-size: 1rem; letter-spacing: .04em; }

  .find { max-width: none; }

  .hero { min-height: 100vh; padding-top: 26px; }

  .hero-media img { height: clamp(150px, 24vh, 220px); }

  .foot { justify-content: flex-start; }
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }

  .hero-media img { transform: none !important; }
}

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