:root {
  color-scheme: light;
  --background: #f8fafc;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: #f1f5f9;
  --text: #111827;
  --muted: #4b5563;
  --faint: #6b7280;
  --border: rgba(209, 213, 219, 0.68);
  --border-strong: #d1d5db;
  --accent: #14b8a6;
  --accent-strong: #0d9488;
  --accent-soft: #ccfbf1;
  --warning: #9a6700;
  --warning-soft: #fff6d8;
  --code: #171b22;
  --code-text: #f3f5f7;
  --header-height: 72px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

:root.dark {
  color-scheme: dark;
  --background: #020617;
  --surface: rgba(30, 41, 59, 0.68);
  --surface-strong: #1e293b;
  --text: #ffffff;
  --muted: #94a3b8;
  --faint: #64748b;
  --border: rgba(71, 85, 105, 0.62);
  --border-strong: #475569;
  --accent: #2dd4bf;
  --accent-strong: #5eead4;
  --accent-soft: rgba(20, 184, 166, 0.16);
  --warning: #f0bd58;
  --warning-soft: #3c311b;
  --code: #090b0d;
  --code-text: #eef1f4;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: linear-gradient(135deg, #f9fafb 0%, #f0fdfa 48%, #f3f4f6 100%);
  color: var(--text);
  letter-spacing: 0;
}
:root.dark body { background: linear-gradient(135deg, #020617 0%, #0f172a 50%, #020617 100%); }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button:focus-visible, a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 42%, transparent);
  outline-offset: 2px;
}

.page-shell { min-height: 100vh; display: flex; flex-direction: column; }
.content-width { width: min(100% - 48px, 1152px); margin: 0 auto; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-height);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background: color-mix(in srgb, var(--background) 82%, transparent);
  backdrop-filter: blur(12px);
}
.topbar-inner {
  width: min(100% - 48px, 1152px);
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}
.brand-mark, .brand-logo { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; box-shadow: 0 4px 12px rgba(15, 23, 42, 0.14); }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--text);
  color: var(--background);
  font-weight: 800;
}
.brand-logo { object-fit: contain; }
.brand-name {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 700;
}
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.nav-link, .icon-button, .button {
  min-height: 40px;
  border-radius: 9px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}
.nav-link { padding: 0 12px; color: var(--muted); }
.nav-link:hover, .icon-button:hover { background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--text); }
.icon-button {
  width: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
}
.language-button { font-size: 12px; }
.button { padding: 0 16px; }
.button-primary { min-height: 30px; border-radius: 999px; background: #111827; color: #ffffff; }
:root.dark .button-primary { background: #1f2937; color: #ffffff; }
.button-primary:hover { opacity: 0.86; }
.button-secondary { border-color: var(--border-strong); background: var(--background); color: var(--text); }
.button-secondary:hover { background: var(--surface); }

.hero-band { border-bottom: 1px solid color-mix(in srgb, var(--border) 62%, transparent); background: transparent; }
.hero-inner { padding-top: 52px; padding-bottom: 48px; }
.eyebrow, .article-kicker { margin: 0; color: var(--accent-strong); font-size: 13px; font-weight: 750; }
.eyebrow { width: fit-content; border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); border-radius: 999px; padding: 5px 10px; background: color-mix(in srgb, var(--accent-soft) 72%, transparent); }
h1 {
  max-width: 760px;
  margin: 8px 0 0;
  overflow-wrap: anywhere;
  font-size: 44px;
  line-height: 1.15;
  letter-spacing: 0;
}
.hero-copy { max-width: 680px; margin: 14px 0 0; color: var(--muted); font-size: 16px; line-height: 1.75; }
.guide-tabs {
  width: min(100%, 680px);
  margin-top: 28px;
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.07);
  backdrop-filter: blur(12px);
}
.guide-tab {
  min-width: 0;
  min-height: 58px;
  padding: 8px 12px;
  border: 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}
.guide-tab:hover { background: var(--surface); color: var(--text); }
.guide-tab[aria-selected="true"] { background: linear-gradient(135deg, #14b8a6, #0d9488); color: #ffffff; box-shadow: 0 8px 18px rgba(20, 184, 166, 0.2); }
.guide-icon, .article-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 10px;
  font-weight: 800;
}
.guide-icon { width: 38px; height: 38px; background: var(--surface-strong); color: var(--text); }
.guide-tab[aria-selected="true"] .guide-icon {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}
.guide-icon-terminal { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; }
.guide-label { min-width: 0; }
.guide-label strong, .guide-label small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.guide-label strong { font-size: 15px; }
.guide-label small { margin-top: 2px; font-size: 12px; opacity: 0.78; }

.docs-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 52px;
  padding-top: 48px;
  padding-bottom: 72px;
}
.sidebar-sticky { position: sticky; top: calc(var(--header-height) + 28px); }
.sidebar-label { margin: 0 0 12px; color: var(--faint); font-size: 12px; font-weight: 750; text-transform: uppercase; }
.toc { border-left: 1px solid var(--border); }
.toc-button {
  width: 100%;
  min-height: 38px;
  margin-left: -1px;
  padding: 8px 12px;
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-size: 13px;
  line-height: 1.5;
  cursor: pointer;
}
.toc-button:hover, .toc-button.active { color: var(--text); }
.toc-button.active { border-left-color: var(--accent); color: var(--accent-strong); font-weight: 700; }
.sidebar-action { width: 100%; margin-top: 22px; padding-right: 10px; padding-left: 10px; }
.article-column { min-width: 0; max-width: 850px; }
.article-header {
  margin-bottom: 30px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 15px;
}
.article-icon { width: 48px; height: 48px; border-radius: 12px; background: linear-gradient(135deg, #14b8a6, #0d9488); box-shadow: 0 8px 18px rgba(20, 184, 166, 0.22); color: #ffffff; }
.article-header h2 { margin: 3px 0 0; font-size: 28px; line-height: 1.25; }
.article-header p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.mobile-toc { display: none; }
.status-panel {
  min-height: 120px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-align: center;
}
.status-error { flex-direction: column; gap: 12px; border-color: #ddada9; color: #8e2d27; }
.status-error p { margin: 0; }

.markdown-content { overflow-wrap: anywhere; color: var(--text); font-size: 15px; line-height: 1.78; }
.markdown-content h2, .markdown-content h3 {
  scroll-margin-top: calc(var(--header-height) + 20px);
  letter-spacing: 0;
}
.markdown-content h2 {
  margin: 48px 0 16px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--border);
  font-size: 25px;
  line-height: 1.3;
}
.markdown-content h2:first-child { margin-top: 0; }
.markdown-content h3 { margin: 32px 0 12px; font-size: 19px; line-height: 1.4; }
.markdown-content p { margin: 0 0 16px; color: var(--muted); }
.markdown-content strong { color: var(--text); font-weight: 700; }
.markdown-content a { color: var(--accent-strong); font-weight: 650; text-underline-offset: 3px; }
.markdown-content ul, .markdown-content ol { margin: 0 0 20px; padding-left: 24px; color: var(--muted); }
.markdown-content li + li { margin-top: 5px; }
.markdown-content blockquote {
  margin: 24px 0;
  padding: 13px 16px;
  border-left: 4px solid var(--warning);
  border-radius: 0 8px 8px 0;
  background: var(--warning-soft);
  color: var(--text);
}
.markdown-content blockquote p:last-child { margin-bottom: 0; color: inherit; }
.markdown-content code {
  border-radius: 5px;
  padding: 2px 6px;
  background: var(--surface-strong);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}
.markdown-content pre {
  position: relative;
  max-width: 100%;
  margin: 20px 0;
  padding: 18px 78px 18px 18px;
  overflow-x: auto;
  border-radius: 8px;
  background: var(--code);
  color: var(--code-text);
  line-height: 1.65;
}
.markdown-content pre code { padding: 0; background: transparent; color: inherit; }
.copy-button {
  position: absolute;
  top: 9px;
  right: 9px;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid #ffffff2e;
  border-radius: 6px;
  background: #ffffff14;
  color: #ffffff;
  font-size: 12px;
  cursor: pointer;
}
.copy-button:hover { background: #ffffff26; }
.table-scroll { width: 100%; margin: 24px 0; overflow-x: auto; }
.markdown-content table { width: 100%; border-collapse: collapse; font-size: 14px; }
.markdown-content th, .markdown-content td {
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  vertical-align: top;
  text-align: left;
}
.markdown-content th { background: var(--surface); color: var(--text); white-space: nowrap; }
.markdown-content td { color: var(--muted); }
.markdown-content img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 680px;
  margin: 24px 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.1);
  object-fit: contain;
}
.markdown-content hr { margin: 40px 0; border: 0; border-top: 1px solid var(--border); }
.site-footer { margin-top: auto; border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent); color: var(--faint); background: color-mix(in srgb, var(--background) 78%, transparent); }
.footer-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
}
noscript { display: block; padding: 20px; background: #fff4ce; color: #5b3b00; text-align: center; }

@media (max-width: 840px) {
  .docs-layout { display: block; padding-top: 28px; }
  .sidebar { display: none; }
  .mobile-toc {
    margin: 0 0 26px;
    padding-bottom: 12px;
    display: flex;
    gap: 7px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
    scrollbar-width: thin;
  }
  .mobile-toc .toc-button {
    width: auto;
    min-width: max-content;
    min-height: 36px;
    margin: 0;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--background);
  }
  .mobile-toc .toc-button.active { border-color: var(--accent); background: var(--accent-soft); }
}

@media (max-width: 620px) {
  .content-width, .topbar-inner { width: min(100% - 24px, 1152px); }
  .brand-name, .nav-link { display: none; }
  .topbar-actions { gap: 2px; }
  .button-primary { padding: 0 12px; }
  .hero-inner { padding-top: 30px; padding-bottom: 30px; }
  h1 { font-size: 32px; }
  .guide-tabs { grid-template-columns: 1fr; }
  .guide-tab { min-height: 54px; }
  .article-header { gap: 12px; }
  .article-icon { width: 42px; height: 42px; }
  .article-header h2 { font-size: 24px; }
  .markdown-content pre { padding-right: 18px; padding-top: 52px; }
  .footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; gap: 4px; }
}

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