:root {
  --bg: #f6f8fb; --panel: #ffffff; --text: #1d2733; --muted: #5b6876; --line: #dfe5ec;
  --accent: #1f6fb5; --accent-soft: #e6f0fa; --code: #eef2f6; --head: #16324f; --head-text: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11161c; --panel: #171e26; --text: #e3e9ef; --muted: #98a6b5; --line: #2a3541;
    --accent: #6fb6f2; --accent-soft: #1d2c3c; --code: #212b36; --head: #0c1117; --head-text: #e3e9ef;
  }
}
* { box-sizing: border-box; }
html { scroll-padding-top: 4.5rem; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); }
.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1rem;
  padding: 0.6rem 1rem; background: var(--head); color: var(--head-text);
}
.brand { color: inherit; font-weight: 700; font-size: 1.15rem; text-decoration: none; white-space: nowrap; }
.brand span { font-weight: 400; opacity: 0.75; }
.join { margin-left: auto; font-size: 0.9rem; text-align: right; }
.join code { background: rgba(255, 255, 255, 0.14); color: inherit; }
.menu-button {
  display: none; cursor: pointer; padding: 0.3rem 0.7rem; border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 6px; font-size: 0.9rem; user-select: none;
}
#menu-open { position: absolute; opacity: 0; pointer-events: none; }
.frame { display: flex; align-items: flex-start; max-width: 76rem; margin: 0 auto; }
.side {
  flex: 0 0 15rem; position: sticky; top: 3.2rem; max-height: calc(100vh - 3.2rem); overflow-y: auto;
  padding: 1.2rem 1rem 2rem;
}
.side h2 {
  margin: 1.1rem 0 0.3rem; font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.side h2:first-child { margin-top: 0; }
.side a {
  display: block; padding: 0.28rem 0.6rem; border-radius: 6px; color: var(--text); text-decoration: none;
}
.side a:hover { background: var(--accent-soft); }
.side a.here { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
main { flex: 1 1 auto; min-width: 0; padding: 1.5rem 1rem 3rem; }
article {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1.5rem 2rem 2rem;
}
h1 { margin: 0 0 1rem; font-size: 2rem; line-height: 1.2; }
h2 { margin: 2.2rem 0 0.8rem; padding-top: 0.4rem; font-size: 1.45rem; border-top: 1px solid var(--line); }
h3 { margin: 1.6rem 0 0.6rem; font-size: 1.15rem; }
h4, h5, h6 { margin: 1.2rem 0 0.5rem; font-size: 1rem; }
.anchor { margin-left: 0.3rem; color: var(--line); text-decoration: none; font-weight: 400; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus { color: var(--accent); }
p, ul, ol { margin: 0 0 1rem; }
li { margin: 0.25rem 0; }
li > p { margin: 0.5rem 0; }
code {
  padding: 0.1em 0.35em; border-radius: 4px; background: var(--code);
  font: 0.9em ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", Menlo, monospace;
  overflow-wrap: anywhere;
}
pre { margin: 0 0 1rem; padding: 0.9rem 1rem; border-radius: 8px; background: var(--code); overflow-x: auto; }
pre code { padding: 0; background: none; overflow-wrap: normal; white-space: pre; }
.table { margin: 0 0 1rem; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { padding: 0.45rem 0.7rem; border: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--accent-soft); white-space: nowrap; }
.contents {
  margin: 0 0 1.5rem; padding: 0.8rem 1rem; border: 1px solid var(--line); border-radius: 8px; background: var(--bg);
}
.contents strong { display: block; margin-bottom: 0.3rem; font-size: 0.85rem; color: var(--muted); }
.contents ul { margin: 0; padding-left: 1.2rem; columns: 2; column-gap: 2rem; }
.foot { margin: 1.5rem 0.3rem 0; font-size: 0.85rem; color: var(--muted); }
@media (max-width: 800px) {
  .menu-button { display: inline-block; }
  .join span { display: none; }
  .frame { display: block; }
  .side { display: none; position: static; max-height: none; border-bottom: 1px solid var(--line); background: var(--panel); }
  #menu-open:checked ~ .frame .side { display: block; }
  main { padding: 1rem 0.5rem 2rem; }
  article { padding: 1rem 1rem 1.5rem; border-radius: 8px; }
  h1 { font-size: 1.6rem; }
  .contents ul { columns: 1; }
}
