:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #58a6ff;
  --border: #30363d;
  --unpublished: #d29922;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

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

.sidebar {
  width: 280px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
  flex-shrink: 0;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.site-title a {
  color: var(--text);
  text-decoration: none;
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-link {
  display: block;
  padding: 0.4rem 0.75rem;
  color: var(--muted);
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.9rem;
}

.nav-link:hover { color: var(--accent); background: rgba(88, 166, 255, 0.08); }
.nav-link.active { color: var(--accent); background: rgba(88, 166, 255, 0.12); }

.nav-category {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  padding: 1.1rem 0.75rem 0.3rem;
  list-style: none;
  border-top: 1px solid var(--border);
  margin-top: 0.25rem;
}

.nav-list > .nav-category:first-child,
.nav-list > .nav-link:first-child + .nav-category {
  border-top: none;
  margin-top: 0;
  padding-top: 0.25rem;
}

.content {
  flex: 1;
  padding: 2rem 3rem;
  max-width: 900px;
}

article h1 { margin-top: 0; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
article h2 { margin-top: 2rem; color: var(--accent); }
article h3 { margin-top: 1.5rem; }

article a { color: var(--accent); }
article blockquote {
  border-left: 3px solid var(--accent);
  margin: 1rem 0;
  padding: 0.5rem 1rem;
  color: var(--muted);
  background: rgba(88, 166, 255, 0.05);
}

article table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
}

article th, article td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

article th { background: var(--surface); }

article code {
  background: var(--surface);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
}

article pre {
  background: var(--surface);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  border: 1px solid var(--border);
}

article img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1rem 0;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.link-unpublished {
  color: var(--unpublished);
  border-bottom: 1px dashed var(--unpublished);
  cursor: help;
}

@media (max-width: 768px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .content { padding: 1.5rem; }
}
