:root {
  color-scheme: light dark;
  --bg: #f8fafc;
  --fg: #0f172a;
  --panel: #ffffff;
  --border: #e2e8f0;
  --muted: #64748b;
  --accent-soft: color-mix(in srgb, var(--accent) 15%, transparent);
  --code-bg: #0f172a;
  --code-fg: #e2e8f0;
}

[data-theme="dark"] {
  --bg: #0b1220;
  --fg: #e2e8f0;
  --panel: #111827;
  --border: #1f2937;
  --muted: #94a3b8;
  --code-bg: #020617;
  --code-fg: #f8fafc;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "SF Pro Text", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.page {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  margin-bottom: 24px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
}

.tagline {
  color: var(--muted);
  font-size: 0.9rem;
}

.nav-section-title {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 24px 0 8px;
}

.nav ul,
.nav-links {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.nav li {
  margin: 4px 0;
  font-size: 0.95rem;
}

.nav-link-submenu {
  padding-left: 16px;
  border-left: 1px solid var(--border);
  margin-left: 8px;
  transition: max-height 0.2s ease;
  overflow: hidden;
  max-height: 0;
}

.nav-link-submenu.open {
  transition: max-height 0.2s ease;
  max-height: 1200px;
}

.nav-link-wrapper {
  display: flex;
  flex-direction: column;
}

.nav-link-item {
  display: flex;
}

.nav-link-link {
  flex: 1;
}

.nav-link-icon {
  width: 18px;
  height: 18px;
  fill: var(--fg);
  vertical-align: middle;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.nav-link-icon.open {
  transform: rotate(90deg);
}

.nav-link {
  display: block;
  padding: 0px 10px;
  border-radius: 8px;
  color: var(--fg);
}

.nav-link.active {
  background: var(--accent-soft);
  font-weight: 600;
  color: var(--accent);
}

.content {
  padding: 32px 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.breadcrumbs {
  color: var(--muted);
  font-size: 0.9rem;
}

.topbar-actions {
  display: flex;
  gap: 12px;
}

img {
  width: 100%;
}

.button {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  background: var(--panel);
  color: var(--fg);
  cursor: pointer;
  font-size: 0.85rem;
}

.button.ghost {
  background: transparent;
}

.doc {
  background: var(--panel);
  border-radius: 16px;
  padding: 32px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
}

.doc h1 {
  margin-top: 0;
}

.doc h2 {
  margin-top: 2rem;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
}

.doc table th,
.doc table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.doc pre {
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 16px;
  border-radius: 12px;
  overflow-x: auto;
}

.doc code {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  padding: 2px 4px;
  border-radius: 6px;
}

.doc pre code {
  background: transparent;
  padding: 0;
}

.footer {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 960px) {
  .page {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .content {
    padding: 24px;
  }
}
