:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-soft: #edf1ec;
  --surface-strong: #17201c;
  --text: #16211d;
  --muted: #5f6f67;
  --faint: #8a9890;
  --line: #dce3dc;
  --line-strong: #c6d1c8;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --accent-soft: #d9eee9;
  --gold: #b7791f;
  --gold-soft: #fff3d5;
  --rose: #c2414b;
  --rose-soft: #fde7e8;
  --ink: #101715;
  --code-bg: #111816;
  --code-text: #e8f2ee;
  --shadow: 0 18px 50px rgba(26, 36, 31, 0.08);
  --font: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --mono: "SFMono-Regular", "Cascadia Code", Consolas, monospace;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1412;
  --surface: #171f1c;
  --surface-soft: #111916;
  --surface-strong: #e9f1ed;
  --text: #eef5f1;
  --muted: #a7b5ae;
  --faint: #72827a;
  --line: #293631;
  --line-strong: #3a4a44;
  --accent: #63c7b4;
  --accent-strong: #86dccd;
  --accent-soft: rgba(99, 199, 180, 0.14);
  --gold: #f0bd62;
  --gold-soft: rgba(240, 189, 98, 0.15);
  --rose: #ff8b92;
  --rose-soft: rgba(255, 139, 146, 0.14);
  --ink: #f4faf7;
  --code-bg: #070b0a;
  --code-text: #f0faf6;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.07) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(15, 118, 110, 0.06) 0 1px, transparent 1px 100%),
    var(--bg);
  background-size: 44px 44px;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

body.no-scroll {
  overflow: hidden;
}

img {
  max-width: 100%;
  display: block;
}

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

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

::selection {
  background: var(--accent-soft);
  color: var(--text);
}

.progress {
  position: fixed;
  inset: 0 auto auto 0;
  width: 0;
  height: 3px;
  z-index: 90;
  background: linear-gradient(90deg, var(--accent), var(--gold), var(--rose));
}

.site-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
  padding: 0 clamp(18px, 4vw, 54px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  color: var(--text);
  font-weight: 780;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--accent-strong);
  font-size: 15px;
  flex: 0 0 auto;
}

.brand span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 13px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
  transition: background 0.2s ease, color 0.2s ease;
}

.main-nav a:hover,
.main-nav a.is-active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button,
.menu-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.icon-button:hover,
.menu-button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  color: var(--text);
}

.theme-icon {
  position: relative;
  width: 17px;
  height: 17px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.theme-icon::after {
  content: "";
  position: absolute;
  inset: -3px -7px -3px 7px;
  border-radius: 50%;
  background: var(--surface);
}

[data-theme="dark"] .theme-icon::after {
  inset: 3px 3px auto auto;
  width: 5px;
  height: 5px;
  background: currentColor;
}

.menu-button {
  display: none;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.hamburger {
  position: relative;
}

.hamburger::before,
.hamburger::after {
  content: "";
  position: absolute;
  left: 0;
}

.hamburger::before {
  top: -6px;
}

.hamburger::after {
  top: 6px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(280px, 0.78fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  width: min(1180px, calc(100% - 36px));
  min-height: calc(100vh - 68px);
  margin: 0 auto;
  padding: clamp(38px, 7vw, 86px) 0 clamp(32px, 5vw, 64px);
}

.hero::after {
  content: "";
  position: absolute;
  right: 34%;
  bottom: 26px;
  width: min(360px, 45vw);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 780;
  letter-spacing: 0;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
}

.hero h1 {
  max-width: 780px;
  margin: 0;
  color: var(--ink);
  font-size: 68px;
  line-height: 1.05;
  letter-spacing: 0;
}

.hero h1 .muted-word {
  color: var(--muted);
}

.hero-lede {
  max-width: 710px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.72;
}

.hero-actions,
.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 780;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.button.primary {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: #ffffff;
}

[data-theme="dark"] .button.primary {
  color: #08201b;
}

.button.warning {
  border-color: color-mix(in srgb, var(--gold) 45%, var(--line));
  background: var(--gold-soft);
  color: var(--gold);
}

.button.danger {
  border-color: color-mix(in srgb, var(--rose) 45%, var(--line));
  background: var(--rose-soft);
  color: var(--rose);
}

.button .button-icon {
  width: 18px;
  text-align: center;
  font-family: var(--mono);
}

.hero-panel {
  align-self: stretch;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 460px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 56px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.hero-panel-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.window-dots {
  display: flex;
  gap: 7px;
}

.window-dots span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--line-strong);
}

.window-dots span:nth-child(1) {
  background: var(--rose);
}

.window-dots span:nth-child(2) {
  background: var(--gold);
}

.window-dots span:nth-child(3) {
  background: var(--accent);
}

.hero-stack {
  display: grid;
  gap: 16px;
  align-content: center;
  padding: 18px;
}

.preview-shot {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.preview-shot img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.hero-stack .preview-shot:nth-child(2) {
  margin-left: 44px;
}

.hero-stack .preview-shot:nth-child(3) {
  margin-right: 34px;
}

.quick-strip {
  width: min(1180px, calc(100% - 36px));
  margin: -30px auto 44px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.quick-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 76px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.quick-item strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  line-height: 1.25;
}

.quick-item span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.quick-item code {
  color: var(--accent-strong);
  font-family: var(--mono);
  font-size: 13px;
}

.layout {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr) 270px;
  gap: clamp(20px, 4vw, 44px);
  width: min(1240px, calc(100% - 36px));
  margin: 0 auto;
  padding: 28px 0 72px;
}

.side-nav,
.toolbox {
  position: sticky;
  top: 88px;
  align-self: start;
  max-height: calc(100vh - 112px);
  overflow: auto;
}

.side-nav {
  display: grid;
  gap: 18px;
}

.side-group,
.toolbox-panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.side-label,
.toolbox-label {
  margin: 0 0 10px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 800;
}

.side-group a,
.toc a {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.25;
}

.side-group a:hover,
.side-group a.is-active,
.toc a:hover,
.toc a.is-active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.content {
  min-width: 0;
}

.doc-section {
  padding: clamp(32px, 5vw, 56px) 0;
  border-top: 1px solid var(--line);
}

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

.section-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 820;
}

.doc-section h2 {
  margin: 12px 0 10px;
  color: var(--ink);
  font-size: 42px;
  line-height: 1.08;
  letter-spacing: 0;
}

.doc-section h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: 0;
}

.doc-section p {
  margin: 0;
  color: var(--muted);
}

.section-intro {
  max-width: 760px;
  margin-bottom: 24px;
  font-size: 17px;
}

.steps {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.step {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.step-number,
.mini-number {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 850;
  line-height: 1;
}

.step-body {
  min-width: 0;
}

.step-body > p + p {
  margin-top: 8px;
}

.step-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.guide-card,
.download-card,
.notice,
.endpoint,
.mini-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.guide-card,
.download-card,
.mini-card {
  padding: 18px;
}

.download-card {
  display: grid;
  gap: 14px;
}

.download-card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.pill.hot {
  background: var(--rose-soft);
  color: var(--rose);
}

.pill.ok {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.notice {
  display: flex;
  gap: 14px;
  padding: 16px;
  margin-top: 20px;
  box-shadow: none;
}

.notice.warning {
  border-color: color-mix(in srgb, var(--gold) 35%, var(--line));
  background: var(--gold-soft);
}

.notice.danger {
  border-color: color-mix(in srgb, var(--rose) 35%, var(--line));
  background: var(--rose-soft);
}

.notice strong {
  color: var(--text);
}

.notice-mark {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent-strong);
  font-weight: 850;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.media-grid.single {
  grid-template-columns: minmax(0, 1fr);
}

.shot {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.shot button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.shot img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--surface-soft);
  transition: transform 0.25s ease;
}

.shot:hover img {
  transform: scale(1.015);
}

.shot figcaption {
  min-height: 48px;
  padding: 11px 13px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.code-card {
  overflow: hidden;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--code-bg);
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px 10px 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 45%, transparent);
  color: #aebbb5;
  font-size: 13px;
  font-weight: 760;
}

.code-card pre {
  margin: 0;
  padding: 16px;
  overflow: auto;
  color: var(--code-text);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre;
}

.inline-code,
code {
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.9em;
  padding: 2px 5px;
}

.copy-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  margin-top: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
}

.copy-chip::after {
  content: "复制";
  margin-left: auto;
  color: var(--accent-strong);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 820;
}

.copy-chip.is-copied::after,
.copy-button.is-copied::after {
  content: "已复制";
}

.copy-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #dff6f0;
  cursor: pointer;
  font-size: 12px;
  font-weight: 820;
}

.copy-button::after {
  content: "复制";
}

.tabs {
  margin-top: 22px;
}

.tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.tab-button {
  min-height: 36px;
  padding: 7px 13px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
}

.tab-button:hover,
.tab-button.is-active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.tab-panel {
  display: none;
  margin-top: 18px;
}

.tab-panel.is-active {
  display: block;
}

.toolbox {
  display: grid;
  gap: 14px;
}

.toolbox-panel {
  display: grid;
  gap: 10px;
}

.endpoint {
  display: grid;
  gap: 6px;
  padding: 12px;
  box-shadow: none;
}

.endpoint span {
  color: var(--faint);
  font-size: 12px;
  font-weight: 800;
}

.endpoint button {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
  word-break: break-all;
}

.toc {
  display: grid;
  gap: 2px;
}

.footer {
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 50%, transparent);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 28px 0;
  color: var(--muted);
  font-size: 14px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-links a {
  color: var(--text);
  font-weight: 700;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  padding: 28px;
  background: rgba(6, 10, 9, 0.78);
}

.lightbox.is-open {
  display: grid;
}

.lightbox button {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.lightbox img {
  max-width: min(1180px, 96vw);
  max-height: 88vh;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.44);
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1120px) {
  .layout {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .toolbox {
    grid-column: 1 / -1;
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
  }
}

@media (max-width: 900px) {
  .topbar {
    min-height: 62px;
  }

  .menu-button {
    display: inline-grid;
  }

  .main-nav {
    position: fixed;
    top: 70px;
    left: 18px;
    right: 18px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    border-radius: 8px;
    box-shadow: var(--shadow);
  }

  .main-nav.is-open {
    display: flex;
  }

  .main-nav a {
    border-radius: 8px;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero h1 {
    font-size: 54px;
  }

  .doc-section h2 {
    font-size: 36px;
  }

  .hero-panel {
    min-height: auto;
  }

  .quick-strip {
    grid-template-columns: 1fr;
    margin-top: 0;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .side-nav,
  .toolbox {
    position: static;
    max-height: none;
  }

  .side-nav {
    order: -1;
  }

  .toolbox {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  body {
    background-size: 34px 34px;
  }

  .topbar {
    padding-inline: 14px;
  }

  .brand span:last-child {
    max-width: 150px;
  }

  .hero,
  .quick-strip,
  .layout,
  .footer-inner {
    width: min(100% - 28px, 1180px);
  }

  .hero h1 {
    font-size: 42px;
  }

  .hero-lede {
    font-size: 17px;
  }

  .doc-section h2 {
    font-size: 30px;
  }

  .hero-actions,
  .section-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .step {
    grid-template-columns: 1fr;
  }

  .step-grid,
  .media-grid {
    grid-template-columns: 1fr;
  }

  .hero-stack .preview-shot:nth-child(2),
  .hero-stack .preview-shot:nth-child(3) {
    margin: 0;
  }

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
