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

:root {
  --paper: #fdfbf7;
  --ash: #f5f5f5;
  --ink: #1a1a1a;
  --line: #ded9cf;
  --mute: #6b6459;
}

*,
*::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: Georgia, "Songti SC", "Source Han Serif SC", "Noto Serif CJK SC", serif;
  font-size: 17px;
  line-height: 1.8;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  opacity: .055;
  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)'/%3E%3C/svg%3E");
}

h1, h2, h3, h4,
.brand, .badge, summary, button, .foot label, .side-kick, .side-h2 {
  font-family: "Space Grotesk", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

img { max-width: 100%; }

/* ---------- 顶栏 ---------- */
.bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 64px;
  padding: 0 14px;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
}

.brand {
  justify-self: center;
  padding: 10px 8px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .05em;
  text-decoration: none;
  white-space: nowrap;
}

.brand:hover {
  background: var(--ink);
  color: var(--paper);
}

.drawer-l { justify-self: start; }
.drawer-r { justify-self: end; }

.drawer > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 10px;
  cursor: pointer;
  font-size: 14px;
  letter-spacing: .14em;
}

.drawer > summary::-webkit-details-marker { display: none; }

.sum-txt { display: inline-block; }

.burger {
  position: relative;
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
}

.burger::before,
.burger::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: var(--ink);
}

.burger::before { top: -6px; }
.burger::after { top: 6px; }

details[open] .burger { background: transparent; }
details[open] .burger::before { top: 0; transform: rotate(45deg); }
details[open] .burger::after { top: 0; transform: rotate(-45deg); }

.drawer menu {
  position: fixed;
  top: 64px;
  bottom: 0;
  width: 50%;
  margin: 0;
  padding: 18px 20px 40px;
  list-style: none;
  background: var(--paper);
  border-top: 1px solid var(--ink);
  overflow-y: auto;
}

.drawer-l menu { left: 0; border-right: 1px solid var(--line); }
.drawer-r menu { right: 0; text-align: right; }

.drawer menu li a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 8px 4px;
  font-size: 17px;
  line-height: 1.4;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.drawer-r menu li a { justify-content: flex-end; }

.drawer menu li a:hover,
.drawer menu li a:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- 主视觉 ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  min-height: 70vh;
  border-bottom: 2px solid var(--ink);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 26px;
  padding: clamp(36px, 6vw, 84px) clamp(18px, 4vw, 56px);
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 7vw, 4.6rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -.025em;
  text-wrap: balance;
}

.lede {
  margin: 0;
  max-width: 44ch;
  font-size: clamp(1rem, 1.4vw, 1.1rem);
  line-height: 1.78;
}

.hero-media {
  position: relative;
  overflow: hidden;
  background: var(--ash);
  border-left: 1px solid var(--ink);
  min-height: 240px;
}

.hero-img {
  position: absolute;
  top: -80px;
  left: 0;
  width: 100%;
  height: calc(100% + 160px);
  object-fit: cover;
  display: block;
  z-index: 0;
}

.hero-media::after {
  content: "";
  position: absolute;
  right: 9%;
  bottom: 12%;
  z-index: 1;
  width: 84px;
  height: 84px;
  border: 2px solid var(--ink);
  border-radius: 28px;
}

.badge {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 2;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .16em;
  border-radius: 999px;
}

/* ---------- 文档区 ---------- */
.doc {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  max-width: 1160px;
  margin: 0 auto;
  padding: clamp(36px, 6vw, 76px) clamp(16px, 4vw, 32px) 64px;
}

.side {
  align-self: start;
  position: sticky;
  top: 88px;
  border-left: 3px solid var(--ink);
  padding-left: 14px;
}

.side-kick {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  letter-spacing: .24em;
  color: var(--mute);
}

.side-h2 {
  margin: 0 0 12px;
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: -.01em;
}

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

.side li a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 0;
  font-size: 14px;
  line-height: 1.45;
  color: #3d3830;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.side li a:hover,
.side li a:focus-visible {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.doc-main {
  min-width: 0;
  max-width: 70ch;
}

.doc-main [id] { scroll-margin-top: 88px; }

.doc-main section {
  margin-top: 46px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.doc-main section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.doc-main h2 {
  margin: 2.1em 0 .55em;
  font-size: clamp(1.45rem, 3vw, 1.95rem);
  line-height: 1.24;
  letter-spacing: -.015em;
}

.doc-main h2:first-child { margin-top: 0; }

.doc-main h3 {
  margin: 1.8em 0 .5em;
  font-size: 1.15rem;
  line-height: 1.4;
  letter-spacing: -.01em;
}

.doc-main p { margin: 0 0 1.15em; }

.doc-main ul,
.doc-main ol {
  margin: 0 0 1.2em;
  padding-left: 1.35em;
}

.doc-main li { margin: .38em 0; }

.doc-main a {
  text-underline-offset: 3px;
}

.doc-main a:hover { background: var(--ink); color: var(--paper); }

.doc-main img {
  height: auto;
  border: 1px solid var(--line);
  border-radius: 28px;
}

.doc-main figure { margin: 1.6em 0; }

.doc-main figcaption {
  margin-top: 8px;
  font-size: 14px;
  color: var(--mute);
}

.doc-main blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 18px;
  border-left: 4px solid var(--ink);
}

.doc-main table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.2em;
  font-size: 15px;
}

.doc-main th,
.doc-main td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
}

.doc-main code {
  font-size: .92em;
  background: var(--ash);
  padding: 1px 5px;
}

.doc-main pre {
  overflow-x: auto;
  background: var(--ash);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 16px 18px;
}

/* ---------- 页脚 ---------- */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 26px clamp(16px, 4vw, 32px) 40px;
  border-top: 2px solid var(--ink);
}

.foot p {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.foot label {
  font-size: 13px;
  letter-spacing: .14em;
}

.foot input {
  min-width: 190px;
  height: 44px;
  padding: 0 12px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 999px;
}

.foot input::placeholder { color: var(--mute); }

.foot button {
  height: 44px;
  padding: 0 22px;
  font-size: 15px;
  letter-spacing: .12em;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
}

.foot button:hover { background: var(--paper); color: var(--ink); }

.foot small {
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--mute);
}

/* ---------- 回到顶部 ---------- */
.totop {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  display: none;
  min-height: 44px;
  padding: 0 18px;
  font-size: 13px;
  letter-spacing: .13em;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
}

.totop.on { display: block; }
.totop:hover { background: var(--ink); color: var(--paper); }

/* ---------- 移动端 ---------- */
@media (max-width: 780px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero-copy { padding: 30px 18px 34px; gap: 18px; }

  .hero-media {
    order: 2;
    border-left: 0;
    border-top: 1px solid var(--ink);
    min-height: 210px;
  }

  .hero-img { top: -60px; height: calc(100% + 120px); }

  .doc {
    grid-template-columns: 1fr;
    padding-top: 30px;
  }

  .side {
    position: static;
    border-left: 0;
    border-top: 2px solid var(--ink);
    padding: 14px 0 0;
  }

  .side ul {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px;
  }

  .side li a { font-size: 13px; }

  .foot { flex-direction: column; align-items: flex-start; }

  .foot input { min-width: 0; flex: 1 1 120px; }
}

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

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