:root,
html[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --bg-soft: #f6f6f7;
  --sidebar: #f6f6f7;
  --panel: #ffffff;
  --panel-strong: #f3f4f6;
  --panel-soft: #fafafa;
  --line: #e2e2e3;
  --line-soft: rgba(60, 60, 67, 0.12);
  --text: #213547;
  --heading: #1b1b1f;
  --muted: rgba(60, 60, 67, 0.78);
  --subtle: rgba(60, 60, 67, 0.56);
  --blue: #3e86ff;
  --blue-strong: #1e80ff;
  --cyan: #20c8d8;
  --green: #23b981;
  --amber: #d9a100;
  --red: #e5484d;
  --code: #f6f8fa;
  --topbar: rgba(255, 255, 255, 0.9);
  --nav-hover: rgba(60, 60, 67, 0.08);
  --hero-glow: rgba(30, 128, 255, 0.14);
  --shadow: 0 20px 50px rgba(31, 35, 45, 0.08);
  --font-sans:
    "Inter var", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "Noto Sans SC", "Helvetica Neue", Arial, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1b1b1f;
    --bg-soft: #202127;
    --sidebar: #161618;
    --panel: #202127;
    --panel-strong: #25262d;
    --panel-soft: #1f2026;
    --line: #303038;
    --line-soft: rgba(255, 255, 255, 0.08);
    --text: rgba(255, 255, 245, 0.86);
    --heading: rgba(255, 255, 245, 0.92);
    --muted: rgba(235, 235, 245, 0.62);
    --subtle: rgba(235, 235, 245, 0.42);
    --blue: #3e86ff;
    --blue-strong: #1e80ff;
    --cyan: #20c8d8;
    --green: #35c88f;
    --amber: #ffd166;
    --red: #ff7d90;
    --code: #16171d;
    --topbar: rgba(27, 27, 31, 0.92);
    --nav-hover: rgba(255, 255, 255, 0.07);
    --hero-glow: rgba(30, 128, 255, 0.34);
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  }
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1b1b1f;
  --bg-soft: #202127;
  --sidebar: #161618;
  --panel: #202127;
  --panel-strong: #25262d;
  --panel-soft: #1f2026;
  --line: #303038;
  --line-soft: rgba(255, 255, 255, 0.08);
  --text: rgba(255, 255, 245, 0.86);
  --heading: rgba(255, 255, 245, 0.92);
  --muted: rgba(235, 235, 245, 0.62);
  --subtle: rgba(235, 235, 245, 0.42);
  --blue: #3e86ff;
  --blue-strong: #1e80ff;
  --cyan: #20c8d8;
  --green: #35c88f;
  --amber: #ffd166;
  --red: #ff7d90;
  --code: #16171d;
  --topbar: rgba(27, 27, 31, 0.92);
  --nav-hover: rgba(255, 255, 255, 0.07);
  --hero-glow: rgba(30, 128, 255, 0.34);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  font-synthesis: none;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 50%;
  z-index: -1;
  width: min(760px, 58vw);
  height: 520px;
  transform: translateX(4%);
  background:
    radial-gradient(circle at 42% 24%, var(--hero-glow), transparent 56%),
    radial-gradient(circle at 70% 42%, rgba(32, 200, 216, 0.16), transparent 60%);
  filter: blur(10px);
  opacity: 0.9;
  pointer-events: none;
}

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

img {
  max-width: 100%;
}

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

p code,
li code,
td code {
  padding: 0.12em 0.36em;
  border-radius: 5px;
  color: var(--blue);
  background: rgba(79, 140, 255, 0.12);
  font-size: 0.92em;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line-soft);
  background: var(--topbar);
  backdrop-filter: blur(18px);
}

.topbar-inner {
  width: min(1480px, calc(100% - 48px));
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 210px;
  color: var(--heading);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.08;
}

.brand img {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
}

.brand small {
  display: block;
  margin-top: 4px;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 700;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.top-nav a,
.theme-toggle {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.top-nav a {
  padding: 0 12px;
}

.top-nav a:hover,
.top-nav a.active,
.theme-toggle:hover {
  color: var(--heading);
  background: var(--nav-hover);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 12px;
  border-left: 1px solid var(--line-soft);
}

.theme-menu {
  position: relative;
}

.theme-toggle {
  gap: 7px;
  border: 0;
  padding: 0 11px;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}

.theme-icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--blue);
  font-size: 12px;
  line-height: 1;
}

.theme-caret {
  width: 0;
  height: 0;
  border-top: 5px solid var(--subtle);
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  font-size: 0;
  line-height: 0;
}

.theme-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  min-width: 148px;
  display: none;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.theme-menu.is-open .theme-dropdown {
  display: grid;
}

.theme-dropdown button {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 0;
  border-radius: 7px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.theme-dropdown button:hover,
.theme-dropdown button.active {
  color: var(--heading);
  background: var(--nav-hover);
}

.theme-dropdown button.active::after {
  content: "✓";
  color: var(--blue);
  font-weight: 900;
}

.home-page {
  min-height: calc(100vh - 64px);
}

.home-shell {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 86px 0 96px;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 86px;
  align-items: center;
}

.home-copy h1 {
  max-width: 740px;
  margin: 0 0 18px;
  font-size: clamp(48px, 6vw, 82px);
  line-height: 0.98;
}

.home-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 22px;
  font-weight: 780;
  line-height: 1.55;
}

.home-copy .lead {
  margin: 18px 0 0;
  max-width: 680px;
  font-size: 18px;
}

.home-visual {
  min-width: 0;
  display: grid;
  place-items: center;
}

.hero-illustration {
  width: min(640px, 100%);
  border-radius: 18px;
  filter: drop-shadow(0 30px 70px rgba(30, 128, 255, 0.18));
}

.home-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 64px;
}

.home-card {
  min-width: 0;
  min-height: 182px;
  padding: 24px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.home-card-icon {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 7px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  font-weight: 900;
}

.home-card h3 {
  margin: 0 0 10px;
}

.home-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.72;
}

.docs-layout {
  width: min(1480px, calc(100% - 48px));
  display: grid;
  grid-template-columns: 260px minmax(0, 860px) 220px;
  gap: 40px;
  align-items: start;
  margin: 0 auto;
  padding: 40px 0 72px;
}

.sidebar,
.toc {
  position: sticky;
  top: 88px;
  min-width: 0;
}

.sidebar {
  min-height: calc(100vh - 112px);
  padding: 12px 18px 28px 0;
  border-right: 1px solid var(--line-soft);
  background: transparent;
}

.sidebar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
  color: var(--heading);
  font-size: 15px;
  font-weight: 800;
}

.sidebar-title img {
  width: 24px;
  height: 24px;
}

.nav-group {
  margin: 0 0 28px;
}

.nav-group strong,
.toc strong {
  display: block;
  margin-bottom: 10px;
  color: var(--heading);
  font-size: 13px;
  font-weight: 800;
}

.nav-group a,
.toc a {
  display: block;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.nav-group a {
  padding: 8px 12px;
  font-weight: 700;
}

.nav-group a:hover,
.nav-group a.active {
  color: var(--blue);
  background: transparent;
}

.toc {
  padding-left: 20px;
  border-left: 1px solid var(--line-soft);
}

.toc a {
  position: relative;
  padding: 7px 0;
}

.toc a:hover {
  color: var(--heading);
}

.toc a.active {
  color: var(--heading);
  font-weight: 800;
}

.toc a.active::before {
  content: "";
  position: absolute;
  left: -21px;
  top: 8px;
  width: 3px;
  height: 18px;
  border-radius: 999px;
  background: var(--blue);
}

.docs-main {
  min-width: 0;
}

.doc-hero {
  padding: 14px 0 38px;
  text-align: center;
}

.doc-logo {
  width: 112px;
  height: 112px;
  display: inline-grid;
  place-items: center;
  margin-bottom: 22px;
  border: 1px solid var(--line-soft);
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(79, 140, 255, 0.18), rgba(43, 210, 230, 0.08));
  box-shadow: var(--shadow);
}

.doc-logo img {
  width: 68px;
  height: 68px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 6px 12px;
  border: 1px solid rgba(79, 140, 255, 0.34);
  border-radius: 999px;
  color: var(--blue);
  background: rgba(30, 128, 255, 0.08);
  font-size: 13px;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1,
h2,
h3 {
  color: var(--heading);
}

h1 {
  margin: 0 auto 18px;
  max-width: 780px;
  font-size: clamp(42px, 5.2vw, 76px);
  font-weight: 800;
  line-height: 1.02;
}

.gradient-title {
  color: transparent;
  background: linear-gradient(90deg, #1e80ff 0%, #20c8d8 56%, var(--heading) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.lead {
  max-width: 760px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.78;
  overflow-wrap: anywhere;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  color: var(--heading);
  font-weight: 800;
}

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

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

.doc-section {
  padding: 34px 0;
  border-top: 1px solid var(--line-soft);
}

.doc-section:first-of-type {
  border-top: 0;
}

.doc-section h2 {
  margin: 0 0 16px;
  font-size: clamp(25px, 3vw, 36px);
  line-height: 1.16;
}

.doc-section h3 {
  margin: 0 0 10px;
  font-size: 19px;
  line-height: 1.35;
}

.doc-section p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.82;
}

.feature-list,
.check-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.feature-list li,
.check-list li {
  position: relative;
  padding-left: 24px;
  color: var(--muted);
  line-height: 1.72;
}

.feature-list li::before,
.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--blue);
}

.feature-grid,
.screenshot-grid,
.doc-links,
.manual-grid,
.starter-grid {
  display: grid;
  gap: 16px;
}

.feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.manual-grid,
.starter-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.doc-links {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.screenshot-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.feature-card,
.doc-card,
.manual-card,
.starter-card {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel);
}

.feature-card {
  min-height: 188px;
}

.card-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  margin-bottom: 16px;
  padding: 0 9px;
  border-radius: 7px;
  color: var(--blue);
  background: rgba(79, 140, 255, 0.14);
  font-size: 13px;
  font-weight: 900;
}

.feature-card p,
.doc-card p,
.manual-card p,
.starter-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.72;
}

.browser-shot {
  min-width: 0;
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel);
}

.browser-shot img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 1px solid var(--line-soft);
  background: #111318;
}

.browser-shot figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  color: var(--muted);
  font-size: 13px;
}

.browser-shot strong {
  color: var(--heading);
}

.article-image {
  margin: 22px 0 0;
}

.image-link {
  display: block;
  cursor: zoom-in;
}

.article-image img,
.image-link img {
  display: block;
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #111318;
}

.article-image figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.article-image figcaption strong {
  color: var(--heading);
}

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

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 36px;
  background: rgba(6, 8, 12, 0.84);
  backdrop-filter: blur(12px);
}

.lightbox img {
  max-width: min(1180px, 94vw);
  max-height: 86vh;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0f1116;
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.52);
}

.lightbox button {
  position: fixed;
  top: 22px;
  right: 24px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: var(--panel);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.code-panel {
  max-width: 100%;
  overflow-x: auto;
  margin: 18px 0 0;
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--code);
  color: var(--text);
  font-size: 13px;
  line-height: 1.72;
}

.code-panel code {
  white-space: pre;
}

.config-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
}

.config-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  background: var(--panel-soft);
}

.config-table th,
.config-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

.config-table th {
  color: var(--heading);
  background: var(--panel-strong);
}

.config-table td {
  color: var(--muted);
}

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

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--text);
  background: var(--panel-soft);
  font-size: 13px;
  font-weight: 800;
}

.notice {
  padding: 16px 18px;
  border: 1px solid rgba(79, 140, 255, 0.34);
  border-radius: 10px;
  color: var(--text);
  background: rgba(79, 140, 255, 0.1);
}

.site-footer {
  width: min(1480px, calc(100% - 48px));
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto;
  padding: 28px 0 42px;
  border-top: 1px solid var(--line-soft);
  color: var(--subtle);
  font-size: 14px;
}

.site-footer a {
  color: var(--muted);
  font-weight: 800;
}

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

  .toc {
    display: none;
  }
}

@media (max-width: 900px) {
  .topbar-inner,
  .docs-layout,
  .site-footer {
    width: min(100% - 28px, 1480px);
  }

  .docs-layout {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-top: 24px;
  }

  .sidebar {
    position: static;
    min-height: auto;
    padding: 18px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: var(--panel);
  }

  .nav-group {
    margin-bottom: 18px;
  }

  .nav-group a {
    display: inline-flex;
    margin: 0 6px 8px 0;
  }

  .feature-grid,
  .screenshot-grid,
  .manual-grid,
  .starter-grid,
  .doc-links,
  .image-grid,
  .home-hero,
  .home-cards {
    grid-template-columns: 1fr;
  }

  .home-shell {
    padding-top: 54px;
  }

  .home-visual {
    order: -1;
  }
}

@media (max-width: 720px) {
  .topbar {
    position: static;
  }

  .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
  }

  .brand {
    min-width: 0;
  }

  .top-nav {
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .top-nav a {
    flex: 0 0 auto;
  }

  .top-actions {
    width: 100%;
    padding-left: 0;
    border-left: 0;
  }

  .theme-toggle {
    width: 100%;
    justify-content: flex-start;
  }

  .theme-menu {
    width: 100%;
  }

  .theme-dropdown {
    left: 0;
    right: auto;
    width: 100%;
  }

  .doc-logo {
    width: 92px;
    height: 92px;
  }

  .doc-logo img {
    width: 56px;
    height: 56px;
  }

  h1 {
    font-size: 40px;
  }

  .lead {
    font-size: 17px;
  }

  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

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