:root {
  --doc-sidebar-bg: #1a1d2e;
  --doc-sidebar-text: #e2e4e9;
  --doc-sidebar-active: #8e5ce6;
  --doc-sidebar-hover: rgba(142, 92, 230, 0.15);
  --doc-body-bg: #f8f9fc;
  --doc-text: #2a2d4a;
  --doc-text-muted: #5c5f7a;
  --doc-link: #5a4dbf;
  --doc-link-hover: #8e5ce6;
  --doc-code-bg: #1a1d2e;
  --doc-code-text: #e2e4e9;
  --doc-border: #e8eaef;
  --doc-card-bg: #fff;
  --doc-font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --doc-font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --doc-radius: 8px;
  --doc-sidebar-width: 280px;
  --doc-header-height: 56px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--doc-font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--doc-text);
  background: var(--doc-body-bg);
  min-height: 100vh;
}

.doc-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--doc-header-height);
  background: var(--doc-sidebar-bg);
  color: var(--doc-sidebar-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 200;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.doc-header a {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.doc-header a:hover {
  color: var(--doc-sidebar-active);
}

.doc-nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--doc-sidebar-text);
  cursor: pointer;
  padding: 0.5rem;
  font-size: 1.25rem;
}

.doc-layout {
  display: flex;
  padding-top: var(--doc-header-height);
  min-height: 100vh;
}

.doc-sidebar {
  position: fixed;
  top: var(--doc-header-height);
  left: 0;
  width: var(--doc-sidebar-width);
  height: calc(100vh - var(--doc-header-height));
  background: var(--doc-sidebar-bg);
  overflow-y: auto;
  padding: 1.25rem 0;
  z-index: 100;
  border-right: 1px solid rgba(255,255,255,0.06);
}

.doc-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.doc-sidebar a {
  display: block;
  padding: 0.5rem 1.25rem;
  color: var(--doc-sidebar-text);
  text-decoration: none;
  font-size: 0.9375rem;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.doc-sidebar a:hover {
  background: var(--doc-sidebar-hover);
  color: var(--doc-sidebar-text);
}

.doc-sidebar a.active {
  background: var(--doc-sidebar-hover);
  color: var(--doc-sidebar-active);
  border-left-color: var(--doc-sidebar-active);
  font-weight: 600;
}

.doc-sidebar .nav-group {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--doc-text-muted);
  padding: 1rem 1.25rem 0.35rem;
  margin-top: 0.5rem;
}

.doc-sidebar .nav-group:first-child {
  margin-top: 0;
}

.doc-main {
  flex: 1;
  margin-left: var(--doc-sidebar-width);
  padding: 2rem 3rem 4rem;
  max-width: 900px;
}

.doc-main h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--doc-text);
  margin: 0 0 0.5rem;
  line-height: 1.25;
}

.doc-main .doc-lead {
  font-size: 1.125rem;
  color: var(--doc-text-muted);
  margin: 0 0 2rem;
  line-height: 1.5;
}

.doc-main h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--doc-border);
  color: var(--doc-text);
}

.doc-main h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 1.75rem 0 0.75rem;
  color: var(--doc-text);
}

.doc-main h4 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
  color: var(--doc-text);
}

.doc-main p {
  margin: 0 0 1rem;
  color: var(--doc-text);
}

.doc-main ul, .doc-main ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}

.doc-main li {
  margin-bottom: 0.35rem;
}

.doc-main a {
  color: var(--doc-link);
  text-decoration: none;
}

.doc-main a:hover {
  color: var(--doc-link-hover);
  text-decoration: underline;
}

.doc-main pre,
.doc-main code {
  font-family: var(--doc-font-mono);
  font-size: 0.9em;
}

.doc-main code {
  background: var(--doc-border);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: var(--doc-text);
}

.doc-main pre {
  background: var(--doc-code-bg);
  color: var(--doc-code-text);
  padding: 1.25rem 1.5rem;
  border-radius: var(--doc-radius);
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid rgba(0,0,0,0.08);
}

.doc-main pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.doc-main table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9375rem;
}

.doc-main th,
.doc-main td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border: 1px solid var(--doc-border);
}

.doc-main th {
  background: var(--doc-body-bg);
  font-weight: 600;
  color: var(--doc-text);
}

.doc-main tr:nth-child(even) {
  background: rgba(0,0,0,0.02);
}

.doc-main blockquote {
  margin: 1rem 0;
  padding: 0.75rem 1.25rem;
  border-left: 4px solid var(--doc-sidebar-active);
  background: rgba(142, 92, 230, 0.06);
  border-radius: 0 var(--doc-radius) var(--doc-radius) 0;
  color: var(--doc-text-muted);
}

.doc-main .badge {
  display: inline-block;
  padding: 0.2em 0.5em;
  font-size: 0.8em;
  font-weight: 600;
  border-radius: 4px;
  background: var(--doc-sidebar-active);
  color: #fff;
}

@media (max-width: 1024px) {
  .doc-sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s;
  }

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

  .doc-main {
    margin-left: 0;
    padding: 1.5rem 1.25rem 3rem;
  }

  .doc-nav-toggle {
    display: block;
  }
}

@media (max-width: 640px) {
  .doc-main {
    padding: 1.25rem 1rem 2rem;
  }

  .doc-main h1 {
    font-size: 1.5rem;
  }

  .doc-main h2 {
    font-size: 1.25rem;
  }
}
