:root {
  --color-bg: #07080a;
  --color-surface: #0b0c0e;
  --color-card: #0f1015;
  --color-card-border: rgba(255, 255, 255, 0.06);
  --color-card-border-hover: rgba(168, 85, 247, 0.25);
  --color-violet: #a855f7;
  --color-violet-subtle: #c084fc;
  --color-text: #f8fafc;
  --color-text-muted: #94a3b8;
  --color-text-subtle: #64748b;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;
  --sidebar-width: 260px;
  --toc-width: 230px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  background: var(--color-bg);
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--color-text);
  line-height: 1.6;
}

.ambient-glow {
  position: fixed;
  top: -120px;
  left: 30%;
  width: 600px;
  height: 400px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.08) 0%, rgba(99, 102, 241, 0.02) 50%, transparent 80%);
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
}

.docs-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 60px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: rgba(7, 8, 10, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--color-card-border);
}

.header-left {
  display: flex;
  align-items: center;
  min-width: 220px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.brand img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.brand-text {
  font-weight: 700;
  color: #fff;
}

.brand-text .dot {
  color: var(--color-violet-subtle);
}

.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
  max-width: 440px;
  margin: 0 auto;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-box input {
  width: 100%;
  padding: 8px 64px 8px 36px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--color-card-border);
  border-radius: 9px;
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: all 0.2s ease;
}

.search-box input:focus {
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--color-text-subtle);
  pointer-events: none;
}

.search-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 600;
  font-family: inherit;
  color: #71717a;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 5px;
  pointer-events: none;
}

.header-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 220px;
  gap: 10px;
}

.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--color-card-border);
  color: var(--color-text-muted);
}

.btn-pill:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-primary {
  background: rgba(168, 85, 247, 0.14);
  color: #e9d5ff !important;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.btn-primary:hover {
  background: rgba(168, 85, 247, 0.25);
  border-color: rgba(168, 85, 247, 0.5);
}

.docs-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--toc-width);
  max-width: 1400px;
  margin: 0 auto;
  min-height: calc(100vh - 60px);
  position: relative;
  z-index: 10;
}

.docs-sidebar {
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 24px 16px;
  border-right: 1px solid var(--color-card-border);
}

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

.nav-group-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-subtle);
  margin-bottom: 8px;
  padding: 0 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  color: #92949a;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 2px;
  transition: all 0.15s ease;
  position: relative;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.055);
  color: #fff;
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--color-violet);
}

.nav-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.docs-main {
  padding: 36px 44px 80px;
  max-width: 820px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text-subtle);
  margin-bottom: 18px;
}

.breadcrumb-separator {
  color: rgba(255, 255, 255, 0.2);
}

.breadcrumb-active {
  color: #e2e8f0;
  font-weight: 500;
}

.article h1 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: 12px;
  line-height: 1.2;
}

.article .lead {
  font-size: 15px;
  line-height: 1.65;
  color: var(--color-text-muted);
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-card-border);
}

.article h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  margin-top: 36px;
  margin-bottom: 12px;
}

.article h3 {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin-top: 24px;
  margin-bottom: 10px;
}

.article p {
  font-size: 14px;
  line-height: 1.7;
  color: #cbd5e1;
  margin-bottom: 16px;
}

.article ul, .article ol {
  padding-left: 20px;
  margin-bottom: 18px;
  font-size: 14px;
  line-height: 1.7;
  color: #cbd5e1;
}

.article li {
  margin-bottom: 8px;
}

.article strong {
  color: #fff;
}

.article code:not(pre code) {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 5px;
  color: #e2e8f0;
}

.callout {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 10px;
  margin: 22px 0;
  font-size: 13.5px;
  line-height: 1.6;
  border: 1px solid transparent;
}

.callout-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.callout-content {
  color: #cbd5e1;
}

.callout-tip {
  background: rgba(168, 85, 247, 0.06);
  border-color: rgba(168, 85, 247, 0.2);
}

.callout-info {
  background: rgba(59, 130, 246, 0.06);
  border-color: rgba(59, 130, 246, 0.2);
}

.callout-warning {
  background: rgba(245, 158, 11, 0.06);
  border-color: rgba(245, 158, 11, 0.2);
}

.code-block {
  position: relative;
  background: #0b0c10;
  border: 1px solid var(--color-card-border);
  border-radius: 10px;
  margin: 20px 0;
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--color-card-border);
  font-size: 12px;
  color: var(--color-text-subtle);
}

.copy-btn {
  background: none;
  border: none;
  color: var(--color-text-subtle);
  cursor: pointer;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

pre {
  padding: 16px;
  margin: 0;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #e2e8f0;
}

.docs-toc {
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 36px 16px;
  border-left: 1px solid var(--color-card-border);
}

.toc-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-subtle);
  margin-bottom: 12px;
  padding-left: 8px;
}

.toc-link {
  display: block;
  font-size: 12.5px;
  color: var(--color-text-muted);
  padding: 6px 8px;
  border-radius: 6px;
  line-height: 1.4;
  margin-bottom: 2px;
}

.toc-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.03);
}

.toc-link.active {
  color: var(--color-violet-subtle);
  font-weight: 500;
}

@media (max-width: 1080px) {
  .docs-toc {
    display: none;
  }
  .docs-layout {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }
}

@media (max-width: 768px) {
  .docs-header {
    padding: 0 16px;
  }
  .search-box {
    display: none;
  }
  .docs-layout {
    grid-template-columns: 1fr;
  }
  .docs-sidebar {
    display: none;
  }
  .docs-main {
    padding: 24px 16px 60px;
  }
}
