:root {
  --bg: #f6f3ee;
  --bg-strong: #efe8dc;
  --surface: rgba(255, 252, 247, 0.88);
  --surface-strong: #fffdf9;
  --surface-muted: #f2ede4;
  --line: rgba(122, 93, 48, 0.16);
  --line-strong: rgba(122, 93, 48, 0.3);
  --text: #2f2a23;
  --muted: #6f6558;
  --accent: #0f766e;
  --accent-soft: #d7efe8;
  --accent-strong: #0b5a54;
  --warm: #d97706;
  --warm-soft: #fbe7c7;
  --shadow: 0 18px 50px rgba(53, 42, 28, 0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --sidebar-width: 290px;
  --toc-width: 250px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI Variable", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 36%),
    radial-gradient(circle at top right, rgba(217, 119, 6, 0.12), transparent 30%),
    linear-gradient(180deg, #fcfaf7 0%, #f6f3ee 100%);
  color: var(--text);
  line-height: 1.7;
}

body.sidebar-open {
  overflow: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-strong);
}

code,
pre {
  font-family: "Cascadia Code", "JetBrains Mono", Consolas, monospace;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  background: rgba(252, 250, 247, 0.82);
  border-bottom: 1px solid rgba(122, 93, 48, 0.08);
}

.site-header-inner {
  max-width: 1640px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(122, 93, 48, 0.1);
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.12);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-title {
  font-size: 18px;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-link,
.menu-toggle {
  appearance: none;
  border: 1px solid rgba(122, 93, 48, 0.12);
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.top-link:hover,
.menu-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 118, 110, 0.24);
  background: #fffdf9;
}

.menu-toggle {
  display: none;
}

.site-shell {
  max-width: 1640px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 24px;
}

.sidebar {
  position: sticky;
  top: 92px;
  align-self: start;
  max-height: calc(100vh - 116px);
  overflow: auto;
  padding: 18px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(122, 93, 48, 0.08);
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.96), rgba(248, 243, 236, 0.92));
  box-shadow: var(--shadow);
}

.sidebar-intro {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.1), rgba(217, 119, 6, 0.14));
  margin-bottom: 18px;
}

.sidebar-intro h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.sidebar-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.sidebar-group + .sidebar-group {
  margin-top: 18px;
}

.sidebar-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-group-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.sidebar-links {
  display: grid;
  gap: 8px;
}

.sidebar-link {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--muted);
  border: 1px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(15, 118, 110, 0.12);
  color: var(--text);
  transform: translateX(3px);
}

.sidebar-link.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(15, 118, 110, 0.18);
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.08);
}

.sidebar-link-title {
  font-size: 14px;
  font-weight: 600;
}

.sidebar-link-meta {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 12px;
}

.content-shell {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--toc-width);
  gap: 24px;
}

.article {
  min-width: 0;
}

.doc-hero {
  position: relative;
  overflow: hidden;
  padding: 34px;
  border-radius: 32px;
  border: 1px solid rgba(122, 93, 48, 0.08);
  background:
    linear-gradient(145deg, rgba(255, 253, 249, 0.96), rgba(248, 243, 236, 0.9)),
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), transparent 48%);
  box-shadow: var(--shadow);
}

.doc-hero::after {
  content: "";
  position: absolute;
  inset: auto -90px -90px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.12), transparent 68%);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-title {
  margin: 0;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.hero-lead {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.badge-row {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
}

.hero-stats {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.doc-hero .badge-row,
.doc-hero .hero-stats {
  display: none;
}

.hero-stat {
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(122, 93, 48, 0.08);
}

.hero-stat-label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-stat-value {
  margin-top: 6px;
  font-size: 18px;
  font-weight: 750;
}

.doc-section {
  margin-top: 24px;
  padding: 28px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(122, 93, 48, 0.08);
  background: rgba(255, 252, 247, 0.9);
  box-shadow: var(--shadow);
}

.section-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.section-summary {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 760px;
}

.section-anchor {
  color: rgba(15, 118, 110, 0.3);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.08em;
}

.rich-text p,
.rich-text ul,
.rich-text ol {
  margin: 0 0 16px;
}

.rich-text ul,
.rich-text ol {
  padding-left: 22px;
}

.rich-text li + li {
  margin-top: 10px;
}

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

.inline-note {
  color: var(--muted);
  font-size: 14px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.info-card,
.mini-card {
  display: block;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(122, 93, 48, 0.08);
  background: rgba(255, 255, 255, 0.76);
  color: inherit;
  box-shadow: 0 12px 26px rgba(53, 42, 28, 0.05);
}

.info-card:hover {
  border-color: rgba(15, 118, 110, 0.2);
  transform: translateY(-2px);
}

.card-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-title {
  margin-top: 10px;
  font-size: 18px;
  font-weight: 700;
}

.card-text {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.card-meta {
  margin-top: 14px;
  color: var(--warm);
  font-size: 13px;
  font-weight: 700;
}

.step-list {
  display: grid;
  gap: 14px;
}

.step-item,
.step {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(122, 93, 48, 0.08);
  background: rgba(255, 255, 255, 0.72);
}

.step-number,
.step-num {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.14), rgba(217, 119, 6, 0.18));
  color: var(--accent-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
}

.step-item h3,
.step h3 {
  margin: 2px 0 8px;
  font-size: 18px;
}

.step-item p,
.step p {
  margin: 0;
  color: var(--muted);
}

.code-panel {
  margin: 16px 0 0;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(20, 27, 26, 0.08);
  background: #182323;
}

.code-caption {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(236, 246, 243, 0.76);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.code-panel pre {
  margin: 0;
  padding: 18px 20px;
  overflow: auto;
  color: #dcefed;
  font-size: 13px;
  line-height: 1.7;
}

.rich-text pre {
  overflow: auto;
  margin: 16px 0;
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid rgba(20, 27, 26, 0.08);
  background: #182323;
  color: #dcefed;
  font-size: 13px;
  line-height: 1.7;
}

.rich-text pre code {
  color: inherit;
}

.rich-text h3 {
  margin: 24px 0 12px;
  font-size: 20px;
}

.code-inline {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
  color: var(--accent-strong);
  font-size: 0.95em;
}

.callout {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(122, 93, 48, 0.08);
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(255, 255, 255, 0.6));
}

.callout.warn {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.12), rgba(255, 255, 255, 0.7));
}

.callout h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.callout p,
.callout ul {
  margin: 0;
  color: var(--muted);
}

.callout ul {
  padding-left: 20px;
}

.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.platform-panel {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(122, 93, 48, 0.08);
  background: rgba(255, 255, 255, 0.76);
}

.platform-panel h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.platform-panel p {
  margin: 0;
  color: var(--muted);
}

.platform-panel .code-panel {
  margin-top: 14px;
}

.table-wrap {
  overflow: auto;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(122, 93, 48, 0.08);
  background: rgba(255, 255, 255, 0.7);
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

.doc-table th,
.doc-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(122, 93, 48, 0.08);
  vertical-align: top;
}

.doc-table th {
  background: rgba(15, 118, 110, 0.08);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.doc-table tr:last-child td {
  border-bottom: 0;
}

.toc {
  position: sticky;
  top: 92px;
  align-self: start;
  padding: 18px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(122, 93, 48, 0.08);
  background: rgba(255, 252, 247, 0.82);
  box-shadow: var(--shadow);
}

.toc h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.toc a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--muted);
  font-size: 14px;
  transition: background 0.2s ease, color 0.2s ease;
}

.toc a:hover {
  background: rgba(15, 118, 110, 0.08);
  color: var(--text);
}

.footer-nav {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.footer-nav-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(122, 93, 48, 0.08);
  background: rgba(255, 255, 255, 0.76);
}

.footer-nav-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-nav-title {
  margin-top: 8px;
  font-size: 18px;
  font-weight: 700;
}

.footer-nav-text {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.site-footer {
  max-width: 1640px;
  margin: 0 auto;
  padding: 0 24px 32px;
}

.site-footer-inner {
  padding: 18px 22px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(122, 93, 48, 0.08);
  background: rgba(255, 252, 247, 0.82);
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.muted-link {
  color: var(--muted);
}

.muted-link:hover {
  color: var(--accent-strong);
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 1280px) {
  .content-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .toc {
    display: none;
  }
}

@media (max-width: 980px) {
  .menu-toggle {
    display: inline-flex;
  }

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

  .sidebar {
    position: fixed;
    top: 84px;
    left: 16px;
    width: min(88vw, 360px);
    max-height: calc(100vh - 100px);
    z-index: 60;
    transform: translateX(-120%);
    transition: transform 0.24s ease;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    display: block;
    background: rgba(24, 35, 35, 0.34);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease;
    z-index: 50;
  }

  body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 720px) {
  .site-header-inner,
  .site-shell,
  .site-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .doc-hero,
  .doc-section {
    padding: 22px;
  }

  .section-head {
    flex-direction: column;
    gap: 10px;
  }

  .hero-title {
    font-size: 30px;
  }

  .hero-lead {
    font-size: 16px;
  }

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

  .step-number {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }
}
