:root {
  color-scheme: dark;
  --bg: #080806;
  --surface: #10100c;
  --ink: #fbf7e9;
  --muted: rgba(251, 247, 233, 0.62);
  --faint: rgba(251, 247, 233, 0.36);
  --line: rgba(251, 247, 233, 0.1);
  --line-strong: rgba(251, 247, 233, 0.18);
  --yellow: #f6b71b;
  --yellow-soft: rgba(246, 183, 27, 0.12);
  --green: #34d37f;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 58% -12%, rgba(246, 183, 27, 0.13), transparent 32rem),
    linear-gradient(180deg, #080806, #0c0c09 52%, #080806);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background-image:
    linear-gradient(rgba(251, 247, 233, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(251, 247, 233, 0.022) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

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

:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 4px;
  border-radius: 3px;
}

.skip-link {
  position: fixed;
  top: 0;
  left: 18px;
  z-index: 50;
  padding: 9px 16px;
  border-radius: 0 0 8px 8px;
  background: var(--yellow);
  color: #0b0a07;
  font-weight: 750;
  transform: translateY(-110%);
}

.skip-link:focus {
  transform: translateY(0);
}

.docs-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 max(24px, calc((100vw - 1240px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(8, 8, 6, 0.82);
  backdrop-filter: blur(18px);
}

.docs-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 780;
}

.docs-brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.docs-brand small {
  padding-left: 11px;
  border-left: 1px solid var(--line-strong);
  color: var(--faint);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.docs-topnav {
  display: flex;
  gap: 24px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.docs-topnav a:hover,
.docs-sidebar a:hover,
.docs-toc a:hover {
  color: var(--ink);
}

.docs-shell {
  display: grid;
  grid-template-columns: 190px minmax(0, 720px) 180px;
  gap: clamp(34px, 5vw, 72px);
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
}

.docs-sidebar,
.docs-toc {
  position: sticky;
  top: 100px;
  align-self: start;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.docs-sidebar {
  padding: 52px 0;
}

.docs-sidebar h2,
.docs-toc h2 {
  margin: 0 0 14px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 780;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.docs-sidebar nav,
.docs-toc nav {
  display: grid;
  gap: 7px;
}

.docs-sidebar a {
  padding: 7px 11px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  transition: 0.2s ease;
}

.docs-sidebar a[aria-current="page"] {
  border-left-color: var(--yellow);
  background: linear-gradient(90deg, var(--yellow-soft), transparent);
  color: var(--ink);
}

.docs-toc {
  padding: 52px 0;
}

.docs-toc a {
  color: var(--faint);
  font-size: 12px;
  line-height: 1.45;
}

.docs-content {
  min-width: 0;
  padding: 78px 0 96px;
}

.docs-kicker {
  margin: 0 0 16px;
  color: var(--yellow);
  font-size: 11px;
  font-weight: 780;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.docs-content h1 {
  margin: 0;
  font-size: clamp(42px, 6vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.docs-lead {
  max-width: 660px;
  margin: 24px 0 54px;
  color: rgba(251, 247, 233, 0.72);
  font-size: 19px;
  line-height: 1.75;
}

.docs-content section {
  scroll-margin-top: 94px;
  padding: 34px 0;
  border-top: 1px solid var(--line);
}

.docs-content h2 {
  margin: 0 0 16px;
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.docs-content h3 {
  margin: 28px 0 10px;
  font-size: 17px;
}

.docs-content p,
.docs-content li {
  color: var(--muted);
}

.docs-content p {
  margin: 0 0 16px;
}

.docs-content ul,
.docs-content ol {
  margin: 14px 0 0;
  padding-left: 22px;
}

.docs-content li + li {
  margin-top: 9px;
}

.docs-content a:not(.docs-card):not(.pager-link) {
  color: var(--yellow);
  text-decoration: underline;
  text-decoration-color: rgba(246, 183, 27, 0.35);
  text-underline-offset: 4px;
}

.docs-note {
  margin: 24px 0;
  padding: 18px 20px;
  border: 1px solid rgba(246, 183, 27, 0.2);
  border-radius: 8px;
  background: var(--yellow-soft);
}

.docs-note strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
}

.docs-note p {
  margin: 0;
}

.docs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.docs-card {
  display: block;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}

.docs-card:hover {
  border-color: rgba(246, 183, 27, 0.32);
  transform: translateY(-2px);
}

.docs-card strong {
  display: block;
  margin-bottom: 7px;
}

.docs-card span {
  color: var(--muted);
  font-size: 13px;
}

.price-state {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 8px 0 26px;
  padding: 8px 12px;
  border: 1px solid rgba(52, 211, 127, 0.22);
  border-radius: 999px;
  background: rgba(52, 211, 127, 0.08);
  color: #93e8b9;
  font-size: 13px;
  font-weight: 700;
}

.price-state::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  content: "";
  box-shadow: 0 0 14px rgba(52, 211, 127, 0.55);
}

.license-text {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  color: rgba(251, 247, 233, 0.66);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.docs-pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.pager-link {
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.pager-link:last-child {
  text-align: right;
}

.pager-link small {
  color: var(--faint);
}

.pager-link strong {
  margin-top: 3px;
}

.pager-link:hover {
  border-color: rgba(246, 183, 27, 0.32);
}

.docs-footer {
  padding: 26px 24px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 12px;
  text-align: center;
}

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

  .docs-toc {
    display: none;
  }
}

@media (max-width: 720px) {
  .docs-header {
    min-height: 62px;
    padding: 0 16px;
  }

  .docs-brand small,
  .docs-topnav a:first-child {
    display: none;
  }

  .docs-topnav {
    gap: 14px;
  }

  .docs-shell {
    display: block;
    width: min(100% - 32px, 720px);
  }

  .docs-sidebar {
    position: static;
    max-height: none;
    padding: 24px 0 0;
  }

  .docs-sidebar nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .docs-sidebar h2 {
    display: none;
  }

  .docs-sidebar a {
    flex: 0 0 auto;
    padding: 7px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
  }

  .docs-sidebar a[aria-current="page"] {
    border-color: rgba(246, 183, 27, 0.4);
    background: var(--yellow-soft);
  }

  .docs-content {
    padding: 54px 0 76px;
  }

  .docs-lead {
    margin-bottom: 42px;
    font-size: 17px;
  }

  .docs-grid,
  .docs-pager {
    grid-template-columns: 1fr;
  }

  .pager-link:last-child {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
