@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;700&display=swap');

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

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

body {
  margin: 0;
  overflow-x: clip;
  background: #ffffff;
  color: #000000;
  font-family: 'Space Grotesk', system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.75;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.04; letter-spacing: -0.045em; }
p { margin: 0 0 1em; }
menu { list-style: none; margin: 0; padding: 0; }

:focus-visible {
  outline: 3px solid #000;
  outline-offset: 3px;
}

/* ---------- 顶栏 ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  min-height: 60px;
  padding: 0.25rem 0.9rem;
  background: #fff;
  border-bottom: 2px solid #000;
}

.brand {
  justify-self: center;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  text-decoration: none;
  padding: 0.6rem 0.3rem;
  white-space: nowrap;
}

.menu summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.35rem 0.6rem 0.35rem 0;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  user-select: none;
}
.menu summary::-webkit-details-marker { display: none; }

.bars {
  display: block;
  width: 20px;
  height: 2px;
  background: #000;
  box-shadow: 0 -6px 0 #000, 0 6px 0 #000;
}

.menu[open] {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  color: #fff;
  padding: 1rem;
  overflow-y: auto;
}
.menu[open] summary {
  position: fixed;
  top: 0.9rem;
  right: 0.9rem;
  color: #fff;
  padding: 0.4rem 0.5rem;
}
.menu[open] .bars {
  background: #fff;
  box-shadow: 0 -6px 0 #fff, 0 6px 0 #fff;
}

.drawer {
  display: flex;
  flex-direction: column;
  max-width: 1000px;
  margin: 4.5rem auto 3rem;
}
.drawer a {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  min-height: 56px;
  padding: 0.7rem 0;
  color: #fff;
  text-decoration: none;
  font-size: clamp(1.5rem, 5.5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}
.n { font-size: 0.78rem; letter-spacing: 0.06em; opacity: 0.55; font-weight: 400; }

.search {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.search input {
  width: 86px;
  min-height: 40px;
  padding: 0.2rem 0.25rem;
  border: 0;
  border-bottom: 2px solid #000;
  border-radius: 0;
  background: transparent;
  color: #000;
  font: inherit;
  font-size: 16px;
}
.search button {
  min-height: 40px;
  padding: 0 0.7rem;
  border: 0;
  border-radius: 999px;
  background: #000;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* ---------- 锚点条 ---------- */
.anchors {
  position: sticky;
  top: 60px;
  z-index: 40;
  display: flex;
  gap: 0.15rem;
  padding: 0.3rem 0.9rem;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  overflow-x: auto;
  scrollbar-width: none;
}
.anchors::-webkit-scrollbar { display: none; }
.anchors a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 0.7rem;
  border-radius: 999px;
  font-size: 16px;
  text-decoration: none;
  white-space: nowrap;
}
.anchors a.on { background: #000; color: #fff; }

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: end;
  gap: 2rem;
  min-height: 45vh;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1rem 2rem;
}

.ghost {
  position: absolute;
  left: -0.03em;
  top: -0.12em;
  z-index: 0;
  margin: 0;
  font-size: clamp(4rem, 19vw, 14rem);
  font-weight: 700;
  line-height: 0.8;
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(0, 0, 0, 0.22);
  pointer-events: none;
  user-select: none;
}

.hero-txt { position: relative; z-index: 1; padding-bottom: 0.4rem; }
.hero h1 {
  font-size: clamp(2.5rem, 9.5vw, 6.5rem);
  line-height: 0.92;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.hero-media { position: relative; z-index: 1; }
.hero-img {
  width: 100%;
  height: 100%;
  max-height: 46vh;
  object-fit: cover;
  border-radius: 28px;
}

/* ---------- 主体 ---------- */
main {
  display: grid;
  grid-template-columns: 222px minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
  padding: 3.5rem 1rem 5rem;
}

.toc {
  position: sticky;
  top: 118px;
  padding: 1.5rem 1.2rem 1.6rem;
  border-radius: 28px;
  background: #000;
  color: #fff;
}
.toc h2 { font-size: 1.4rem; letter-spacing: -0.03em; }
.toc .subtitle {
  margin: 0.3rem 0 1.1rem;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  opacity: 0.62;
}
.toc-list { display: grid; }
.toc-list a {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  min-height: 42px;
  padding: 0.5rem 0;
  color: #fff;
  text-decoration: none;
  font-size: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}
.toc-list a:hover { opacity: 0.72; }
.toc-list a.on { font-weight: 700; }

/* ---------- 正文 ---------- */
.doc { min-width: 0; }

.doc section[id] { scroll-margin-top: 116px; }
.doc section {
  padding: 4.5rem 0;
  border-top: 1px solid rgba(0, 0, 0, 0.16);
}
.doc section:first-child { padding-top: 0; border-top: 0; }

.doc h2 {
  font-size: clamp(1.6rem, 4.2vw, 2.7rem);
  margin-bottom: 0.7rem;
  text-wrap: balance;
}
.doc h3 {
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  margin: 2rem 0 0.4rem;
  letter-spacing: -0.02em;
}
.doc p, .doc ul, .doc ol, .doc blockquote { max-width: 66ch; }
.doc ul, .doc ol { padding-left: 1.15rem; }
.doc li { margin: 0.4rem 0; }
.doc a { text-decoration: underline; text-underline-offset: 3px; }
.doc h2 + p { margin-top: 0; }

.doc blockquote {
  margin: 2rem 0;
  padding: 1.5rem 1.4rem;
  border-radius: 28px;
  background: #000;
  color: #fff;
}
.doc blockquote p:last-child { margin-bottom: 0; }

.doc figure { margin: 2rem 0; }
.doc img { border-radius: 28px; }
.doc time {
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  opacity: 0.68;
}
.doc table { width: 100%; border-collapse: collapse; font-size: 16px; }
.doc th, .doc td { padding: 0.6rem 0.4rem; border-bottom: 1px solid rgba(0, 0, 0, 0.16); text-align: left; }

/* ---------- 页脚 ---------- */
.foot {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem 1rem;
  align-items: start;
  padding: 4rem 1rem 2.4rem;
  background: #000;
  color: #fff;
}
.foot-brand {
  grid-column: 1 / 3;
  margin: 0;
  font-size: clamp(2.1rem, 9vw, 5.5rem);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.055em;
}
.foot-col { margin: 0; display: grid; align-content: start; }
.foot-col a {
  display: flex;
  align-items: center;
  min-height: 40px;
  color: #fff;
  text-decoration: none;
  font-size: 16px;
}
.foot-col a:hover { opacity: 0.7; }
.foot-copy {
  grid-column: 1 / 3;
  align-self: end;
  font-size: 0.9rem;
  opacity: 0.62;
}
.foot-top { grid-column: 3 / 5; justify-self: end; margin: 0; }
.foot-top a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid #fff;
  font-size: 16px;
}

/* ---------- 动效 ---------- */
.js .rv {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.62s ease, transform 0.62s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.js .rv.in { opacity: 1; transform: none; }

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

/* ---------- 窄屏 ---------- */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    min-height: 0;
    padding: 3rem 1rem 1.5rem;
  }
  .ghost { font-size: clamp(3.2rem, 17vw, 7rem); top: -0.05em; }
  .hero-img { aspect-ratio: 16 / 11; max-height: none; }
  main {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2.5rem 1rem 3.5rem;
  }
  .toc { position: static; }
  .doc section { padding: 3.2rem 0; }
  .doc section:first-child { padding-top: 0; }
  .doc section[id] { scroll-margin-top: 108px; }
  .search input { width: 70px; }
  .foot { grid-template-columns: 1fr 1fr; padding-top: 3rem; }
  .foot-brand { grid-column: 1 / 3; }
  .foot-copy { grid-column: 1 / 2; }
  .foot-top { grid-column: 2 / 3; }
}

@media (max-width: 420px) {
  body { font-size: 16.5px; }
  .brand { font-size: 1rem; }
  .search input { width: 62px; }
}

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