
:root {
  --bg: #ffffff;
  --bg-secondary: #f7fafc;
  --bg-tertiary: #edf2f7;
  --text: #1a202c;
  --text-light: #4a5568;
  --text-muted: #718096;
  --border: #e2e8f0;
  --accent: #2c5282;
  --accent-light: #4299e1;
  --code-bg: #f7fafc;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --radius: 8px;
  --max-w: 720px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a202c;
    --bg-secondary: #2d3748;
    --bg-tertiary: #4a5568;
    --text: #f7fafc;
    --text-light: #e2e8f0;
    --text-muted: #a0aec0;
    --border: #4a5568;
    --accent: #63b3ed;
    --accent-light: #90cdf4;
    --code-bg: #2d3748;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
}

header.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

header.top .brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent);
  text-decoration: none;
}

header.top nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

header.top nav a {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.9rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

header.top nav a.active {
  background: var(--bg-secondary);
  color: var(--accent);
  font-weight: 600;
}

header.top nav a:hover {
  background: var(--bg-tertiary);
}

main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

h1 { font-size: 1.75rem; margin: 1rem 0 0.75rem; line-height: 1.25; }
h2 { font-size: 1.35rem; margin: 1.75rem 0 0.5rem; line-height: 1.3; border-bottom: 1px solid var(--border); padding-bottom: 0.25rem; }
h3 { font-size: 1.15rem; margin: 1.25rem 0 0.4rem; }
h4 { font-size: 1rem; margin: 1rem 0 0.4rem; color: var(--text-light); }

p { margin: 0.6rem 0; }

a { color: var(--accent); }

ul { padding-left: 1.25rem; }
li { margin: 0.25rem 0; }

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
}

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

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

blockquote {
  border-left: 3px solid var(--accent);
  margin: 1rem 0;
  padding: 0.25rem 1rem;
  color: var(--text-light);
  background: var(--bg-secondary);
  border-radius: 0 var(--radius) var(--radius) 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}

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

th { background: var(--bg-secondary); font-weight: 600; }

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

.doc-list li {
  margin: 0.5rem 0;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.doc-list a {
  font-weight: 600;
  text-decoration: none;
  display: block;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.doc-list .meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.doc-list .badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.1em 0.4em;
  margin-right: 0.25em;
  background: var(--bg-tertiary);
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

footer.bottom {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

@media (max-width: 600px) {
  html, body { font-size: 16px; }
  h1 { font-size: 1.45rem; }
  h2 { font-size: 1.2rem; }
  header.top { padding: 0.5rem 0.75rem; gap: 0.5rem; }
  header.top .brand { font-size: 1rem; }
  header.top nav a { padding: 0.5rem 0.6rem; font-size: 0.85rem; }
  main { padding: 1rem 0.75rem 3rem; }
  pre { font-size: 0.78rem; padding: 0.6rem; }
  .doc-list li { padding: 0.6rem; }
}
