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

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --bg: #0f0f1a;
  --bg-card: #1a1a2e;
  --bg-sidebar: #13131f;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: #2d2d4e;
  --code-bg: #0d1117;
  --success: #10b981;
  --warning: #f59e0b;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

/* Layout */
.layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s;
}

.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo .logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: white;
}

.sidebar-logo span {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.sidebar-logo .badge {
  font-size: 10px;
  background: var(--primary);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
}

nav {
  padding: 16px 0;
}

.nav-section {
  margin-bottom: 8px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 8px 20px 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  border-left: 2px solid transparent;
  transition: all 0.2s;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(99, 102, 241, 0.08);
}

.nav-link.active {
  color: var(--primary);
  border-left-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.nav-link .icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

/* Main content */
.main {
  margin-left: 260px;
  flex: 1;
  min-height: 100vh;
}

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  background: rgba(15, 15, 26, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 50;
}

.breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.breadcrumb span { color: var(--text); }

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

.btn {
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-outline:hover { color: var(--text); border-color: var(--primary); }

/* Page content */
.page {
  display: none;
  padding: 48px 40px;
  max-width: 860px;
}

.page.active { display: block; }

.page-hero {
  margin-bottom: 48px;
}

.page-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  background: rgba(99, 102, 241, 0.12);
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 16px;
}

h1 {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #e2e8f0, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-desc {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 600px;
}

h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 40px 0 16px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

h2::before {
  content: '';
  display: block;
  width: 3px;
  height: 20px;
  background: var(--primary);
  border-radius: 2px;
}

h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 24px 0 10px;
  color: var(--text);
}

p {
  color: var(--text-muted);
  margin-bottom: 14px;
  font-size: 15px;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}

.card-icon {
  font-size: 28px;
  margin-bottom: 12px;
}

.card h3 {
  font-size: 15px;
  margin: 0 0 6px;
  color: var(--text);
}

.card p {
  font-size: 13px;
  margin: 0;
  color: var(--text-muted);
}

/* Steps */
.steps {
  counter-reset: step;
  margin: 24px 0;
}

.step {
  display: flex;
  gap: 20px;
  margin-bottom: 32px;
  position: relative;
}

.step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 19px;
  top: 44px;
  bottom: -16px;
  width: 2px;
  background: var(--border);
}

.step-num {
  counter-increment: step;
  width: 40px;
  height: 40px;
  min-width: 40px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: white;
}

.step-content { flex: 1; }

.step-content h3 {
  margin-top: 8px;
  font-size: 16px;
}

/* Code blocks */
.code-block {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 16px 0;
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

.code-dots {
  display: flex;
  gap: 6px;
}

.code-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.code-dots span:nth-child(1) { background: #ff5f57; }
.code-dots span:nth-child(2) { background: #febc2e; }
.code-dots span:nth-child(3) { background: #28c840; }

.copy-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.copy-btn:hover { color: var(--text); border-color: var(--primary); }

pre {
  padding: 20px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.7;
}

code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  color: #e2e8f0;
}

.inline-code {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: monospace;
}

/* Syntax highlighting */
.kw { color: #c792ea; }
.fn { color: #82aaff; }
.str { color: #c3e88d; }
.cm { color: #546e7a; font-style: italic; }
.num { color: #f78c6c; }
.tag { color: #f07178; }
.attr { color: #ffcb6b; }
.var { color: #eeffff; }

/* Callouts */
.callout {
  border-radius: 10px;
  padding: 16px 20px;
  margin: 20px 0;
  display: flex;
  gap: 12px;
  font-size: 14px;
}

.callout-info {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.callout-tip {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.callout-warn {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.callout-icon { font-size: 18px; flex-shrink: 0; }

.callout p { margin: 0; color: var(--text); }

/* Tabs */
.tabs {
  margin: 20px 0;
}

.tab-list {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.tab-btn {
  padding: 8px 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.2s;
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-panel {
  display: none;
}

.tab-panel.active { display: block; }

/* Feature list */
.feature-list {
  list-style: none;
  margin: 16px 0;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.feature-list li::before {
  content: '✓';
  color: var(--success);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Example cards */
.example-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 24px 0;
  overflow: hidden;
}

.example-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.example-card-header h3 {
  margin: 0;
  font-size: 15px;
}

.tag-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.tag-react { background: rgba(97, 218, 251, 0.15); color: #61dafb; }
.tag-python { background: rgba(255, 212, 59, 0.15); color: #ffd43b; }
.tag-node { background: rgba(104, 160, 99, 0.15); color: #68a063; }
.tag-ai { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; }

.example-card-body { padding: 20px; }

/* Platform badges */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.platform-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  transition: all 0.2s;
}

.platform-card:hover {
  border-color: var(--primary);
}

.platform-card .platform-icon { font-size: 32px; margin-bottom: 8px; }
.platform-card .platform-name { font-size: 14px; font-weight: 600; color: var(--text); }
.platform-card .platform-desc { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Mobile menu */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

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

  .main {
    margin-left: 0;
  }

  .topbar {
    padding: 12px 20px;
  }

  .page {
    padding: 32px 20px;
  }

  .menu-toggle {
    display: block;
  }

  .platform-grid {
    grid-template-columns: 1fr;
  }

  h1 { font-size: 28px; }
}

/* Table */
.table-wrap {
  overflow-x: auto;
  margin: 16px 0;
  border-radius: 10px;
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead tr {
  background: rgba(99, 102, 241, 0.08);
}

th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 11px 16px;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

tr:last-child td { border-bottom: none; }

tbody tr:hover { background: rgba(255,255,255,0.02); }
