:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --ink: #1d1b1a;
  --muted: #5f5a56;
  --line: #e6e1dc;
  --accent: #c41230;
  --accent-ink: #a30e27;
  --code-bg: #f3f0ec;
  --pre-bg: #1f1d1c;
  --pre-ink: #f3efe9;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151413;
    --surface: #1d1b1a;
    --ink: #ece8e3;
    --muted: #a8a19a;
    --line: #34302d;
    --accent: #ff5a6e;
    --accent-ink: #ff7a8a;
    --code-bg: #2a2725;
    --pre-bg: #0f0e0d;
  }
}

* {
  box-sizing: border-box;
}
html {
  scroll-padding-top: 76px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--accent-ink);
  text-underline-offset: 3px;
}

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px max(16px, calc((100vw - 1180px) / 2));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
}
.brand em {
  font-style: normal;
  font-weight: 500;
  font-size: 14px;
  color: var(--muted);
}
.cta {
  flex: none;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}
.cta:hover {
  filter: brightness(1.08);
}

.wrap {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 48px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 16px 80px;
}
.toc {
  position: sticky;
  top: 84px;
  align-self: start;
  font-size: 14px;
}
.toc p {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--line);
}
.toc a {
  display: block;
  padding: 5px 12px;
  margin-left: -2px;
  border-left: 2px solid transparent;
  color: var(--muted);
  text-decoration: none;
}
.toc a:hover {
  color: var(--ink);
  border-left-color: var(--accent);
}

.doc {
  max-width: 780px;
  min-width: 0;
}
.doc > p:first-child {
  font-size: 19px;
  color: var(--muted);
  margin-top: 0;
}
.doc h2 {
  font-size: 26px;
  line-height: 1.25;
  margin: 8px 0 14px;
  letter-spacing: -0.01em;
}
.doc h3 {
  font-size: 19px;
  margin: 32px 0 8px;
}
.doc h2,
.doc h3 {
  position: relative;
}
.anchor {
  position: absolute;
  left: -0.9em;
  color: var(--line);
  text-decoration: none;
  opacity: 0;
}
h2:hover .anchor,
h3:hover .anchor {
  opacity: 1;
}
.doc hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 44px 0;
}
.doc li {
  margin: 4px 0;
}
.doc li > ul {
  margin-top: 4px;
}
.doc code {
  font: 0.88em/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 5px;
}
.doc pre {
  position: relative;
  background: var(--pre-bg);
  color: var(--pre-ink);
  padding: 16px 18px;
  border-radius: 10px;
  overflow-x: auto;
}
.doc pre code {
  background: none;
  padding: 0;
  color: inherit;
}
.copy {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 10px;
  border: 1px solid #4a4542;
  border-radius: 6px;
  background: #2c2927;
  color: #e8e3dd;
  font: 600 12px/1.4 ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
  opacity: 0;
}
pre:hover .copy,
.copy:focus-visible {
  opacity: 1;
}
.table {
  overflow-x: auto;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.doc table {
  border-collapse: collapse;
  width: 100%;
  font-size: 15px;
}
.doc th,
.doc td {
  text-align: left;
  vertical-align: top;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
}
.doc tr:last-child td {
  border-bottom: 0;
}
.doc th {
  font-size: 13px;
  color: var(--muted);
  background: var(--code-bg);
}
.doc th:empty {
  display: none;
}
.doc sub {
  font-size: 13px;
  color: var(--muted);
}
.updated {
  margin-top: 40px;
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .wrap {
    grid-template-columns: 1fr;
    gap: 8px;
    padding-top: 20px;
  }
  .toc {
    position: static;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
  }
  .brand em {
    display: none;
  }
  .anchor {
    display: none;
  }
}
