:root {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #f8fafc;
  --text: #111827;
  --muted: #4b5563;
  --line: #e5e7eb;
  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --code-bg: #f3f4f6;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
}
.topbar nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
}
.topbar a.active,
.sidebar a.active { color: var(--brand-strong); font-weight: 700; }
.shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  max-width: 1180px;
  margin: 0 auto;
}
.sidebar {
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  padding: 32px 24px;
  border-right: 1px solid var(--line);
}
.sidebar nav {
  display: grid;
  gap: 8px;
}
.sidebar a {
  display: block;
  padding: 6px 8px;
  color: var(--muted);
  border-radius: 6px;
}
.sidebar a:hover {
  background: var(--panel);
  text-decoration: none;
}
.content {
  width: 100%;
  max-width: 840px;
  padding: 48px 40px 80px;
}
.content.standalone {
  margin: 0 auto;
}
h1, h2, h3, h4 {
  line-height: 1.25;
  letter-spacing: 0;
}
h1 {
  margin: 0 0 16px;
  font-size: 44px;
}
h2 {
  margin-top: 44px;
  padding-top: 8px;
  font-size: 28px;
}
h3 { margin-top: 32px; font-size: 21px; }
p, ul, ol, table, pre { margin: 16px 0; }
ul, ol { padding-left: 24px; }
code {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--code-bg);
  font-size: 0.92em;
}
pre {
  overflow-x: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f172a;
}
pre code {
  padding: 0;
  color: #e5e7eb;
  background: transparent;
}
table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  width: 100%;
}
th, td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th { background: var(--panel); }
.anchor {
  color: #9ca3af;
  font-size: 0.75em;
  opacity: 0;
}
h1:hover .anchor,
h2:hover .anchor,
h3:hover .anchor,
h4:hover .anchor { opacity: 1; }
@media (max-width: 800px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    padding: 16px 20px;
  }
  .topbar nav {
    flex-wrap: wrap;
    gap: 12px;
  }
  .shell {
    display: block;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 18px 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .sidebar nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .content {
    padding: 32px 20px 64px;
  }
  h1 { font-size: 34px; }
}
