:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f7f8fb;
  --ink: #111827;
  --muted: #667085;
  --subtle: #8a94a6;
  --line: #e5e7eb;
  --line-strong: #d6dbe3;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --code: #0f172a;
  --code-line: #1e293b;
  --green: #15803d;
  --header-height: 64px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.7;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.header-inner {
  display: flex;
  min-height: var(--header-height);
  align-items: center;
  gap: 24px;
  padding: 0 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 10px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.search-box {
  display: flex;
  width: min(360px, 36vw);
  height: 36px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 0 10px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.kbd {
  min-width: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  padding: 1px 6px;
  color: var(--subtle);
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", monospace;
  font-size: 12px;
  text-align: center;
}

.top-nav {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}

.top-nav a {
  color: var(--muted);
}

.top-nav a:hover {
  color: var(--ink);
}

.doc-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 220px;
  gap: 36px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 28px;
}

.sidebar,
.toc {
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: 28px 0;
}

.sidebar {
  border-right: 1px solid var(--line);
  padding-right: 24px;
}

.toc {
  border-left: 1px solid var(--line);
  padding-left: 24px;
}

.side-section + .side-section {
  margin-top: 26px;
}

.side-title,
.toc-title {
  margin-bottom: 8px;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.side-link,
.toc a {
  display: block;
  border-radius: 7px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.side-link {
  padding: 7px 10px;
}

.side-link:hover,
.toc a:hover {
  color: var(--ink);
  text-decoration: none;
}

.side-link.active {
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 650;
}

.side-link.child {
  margin-left: 12px;
  font-size: 13px;
}

.toc a {
  padding: 5px 0;
}

.doc-content {
  min-width: 0;
  padding: 42px 0 72px;
}

.breadcrumbs {
  margin-bottom: 18px;
  color: var(--subtle);
  font-size: 14px;
}

.breadcrumbs a {
  color: var(--subtle);
}

article {
  max-width: 780px;
}

.doc-hero {
  margin-bottom: 34px;
}

h1 {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin: 42px 0 14px;
  padding-top: 4px;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: 0;
}

h3 {
  margin: 28px 0 10px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: 0;
}

p {
  margin: 0 0 15px;
}

ul,
ol {
  margin: 0 0 16px;
  padding-left: 24px;
}

li + li {
  margin-top: 4px;
}

.lead {
  max-width: 720px;
  color: var(--muted);
  font-size: 18px;
}

.callout {
  margin: 18px 0;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #f8fbff;
  padding: 14px 16px;
  color: #1e3a8a;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.card-link {
  display: block;
  height: 100%;
  color: var(--ink);
}

.card-link:hover {
  border-color: #bfdbfe;
  text-decoration: none;
}

.card-link h3,
.card-link h2 {
  margin-top: 0;
}

.muted {
  color: var(--muted);
}

.ok {
  color: var(--green);
  font-weight: 700;
}

section {
  scroll-margin-top: 92px;
}

pre {
  overflow-x: auto;
  margin: 14px 0 18px;
  border: 1px solid var(--code-line);
  border-radius: 8px;
  background: var(--code);
  color: #e5eefb;
  padding: 16px;
  font-size: 13px;
  line-height: 1.6;
}

code {
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", monospace;
}

:not(pre) > code {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-soft);
  padding: 1px 5px;
  color: #1d4ed8;
  font-size: 0.94em;
}

table {
  width: 100%;
  margin: 14px 0 20px;
  border-collapse: collapse;
  overflow-wrap: anywhere;
  font-size: 14px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 650;
}

.doc-footer {
  max-width: 780px;
  margin-top: 56px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 1120px) {
  .doc-shell {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .toc {
    display: none;
  }
}

@media (max-width: 820px) {
  .header-inner {
    flex-wrap: wrap;
    padding: 12px 18px;
  }

  .search-box {
    order: 3;
    width: 100%;
    margin-left: 0;
  }

  .top-nav {
    margin-left: auto;
  }

  .doc-shell {
    display: block;
    padding: 0 18px;
  }

  .sidebar {
    position: static;
    height: auto;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 18px 0;
  }

  .doc-content {
    padding-top: 30px;
  }

  article,
  .doc-footer {
    max-width: none;
  }

  .grid,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}
