:root {
  color-scheme: light;
  --text: #1f2937;
  --muted: #64748b;
  --border: #e2e8f0;
  --background: #ffffff;
  --sidebar: #f8fafc;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --code: #f1f5f9;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--text);
  background: var(--background);
  line-height: 1.6;
  overflow-wrap: break-word;
}

a {
  color: var(--accent);
  text-underline-offset: 2px;
}

a:hover {
  color: #1d4ed8;
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  width: 100%;
  height: 56px;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--background);
  border-bottom: 1px solid var(--border);
}

.brand {
  color: #111827;
  font-size: 0.95rem;
  font-weight: 650;
  text-decoration: none;
}

.brand:hover {
  color: #111827;
}

.topbar-link {
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: none;
}

.page-shell {
  display: grid;
  width: 100%;
  min-height: calc(100vh - 56px);
  grid-template-columns: 240px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 56px;
  display: flex;
  width: 240px;
  height: calc(100vh - 56px);
  align-self: start;
  flex-direction: column;
  padding: 28px 18px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.sidebar nav {
  display: grid;
  gap: 2px;
}

.sidebar nav a {
  display: block;
  padding: 7px 10px;
  color: #475569;
  border-radius: 5px;
  font-size: 0.86rem;
  line-height: 1.4;
  text-decoration: none;
}

.sidebar nav a:hover {
  color: #1f2937;
  background: #f1f5f9;
}

.sidebar nav a[aria-current="page"] {
  color: #1d4ed8;
  background: var(--accent-soft);
  font-weight: 600;
}

.nav-label {
  margin: 20px 10px 5px;
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-label:first-child {
  margin-top: 0;
}

.content {
  min-width: 0;
  width: 100%;
  padding: 44px clamp(28px, 5vw, 72px) 72px;
}

.content > * {
  width: 100%;
  max-width: 820px;
  margin-right: auto;
  margin-left: auto;
}

.home-content {
  display: flex;
  min-height: calc(100vh - 56px);
  flex-direction: column;
  justify-content: flex-start;
}

.page-intro {
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.page-intro h1,
.not-found h1 {
  margin: 0 0 12px;
  color: #111827;
  font-size: clamp(2rem, 4vw, 2.65rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.page-intro p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.docs-section {
  margin-top: 34px;
}

.docs-section h2 {
  margin: 0 0 14px;
  color: #111827;
  font-size: 1.15rem;
}

.doc-item {
  padding: 18px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.doc-item h3 {
  margin: 0 0 5px;
  font-size: 1rem;
}

.doc-item h3 a {
  color: #1f2937;
  text-decoration: none;
}

.doc-item h3 a:hover {
  color: var(--accent);
}

.doc-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.doc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 12px;
}

.doc-links a {
  font-size: 0.84rem;
  font-weight: 600;
}

.article {
  color: #334155;
}

.article > h1 {
  margin: 0 0 14px;
  color: #111827;
  font-size: clamp(2rem, 4vw, 2.7rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.article > h1 + p {
  margin-top: 0;
  color: var(--muted);
  font-size: 1rem;
}

.article h2 {
  margin: 46px 0 14px;
  padding-top: 18px;
  color: #111827;
  border-top: 1px solid var(--border);
  font-size: 1.4rem;
  line-height: 1.35;
}

.article p,
.article li {
  font-size: 0.94rem;
}

.article ul,
.article ol {
  padding-left: 24px;
}

.article li + li {
  margin-top: 5px;
}

.article blockquote {
  margin: 22px 0;
  padding: 14px 16px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
}

.article blockquote p {
  margin: 0;
}

.download-link {
  font-weight: 600;
}

.article table {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 20px 0 28px;
  overflow-x: auto;
  border-collapse: collapse;
}

.article th,
.article td {
  min-width: 115px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  font-size: 0.8rem;
  line-height: 1.5;
  text-align: left;
  vertical-align: top;
}

.article th {
  color: #334155;
  background: var(--sidebar);
  font-weight: 650;
}

code {
  padding: 0.12em 0.3em;
  color: #0f172a;
  background: var(--code);
  border-radius: 3px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.87em;
}

pre {
  width: 100%;
  max-width: 100%;
  margin: 18px 0;
  padding: 14px 16px;
  overflow-x: auto;
  background: var(--code);
  border: 1px solid var(--border);
}

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

img,
video {
  max-width: 100%;
  height: auto;
}

.not-found {
  padding-top: 40px;
}

.not-found > p:first-child {
  color: var(--muted);
}

@media (max-width: 760px) {
  .topbar {
    padding: 0 16px;
  }

  .page-shell {
    display: block;
    min-height: auto;
  }

  .sidebar {
    position: sticky;
    z-index: 9;
    top: 56px;
    display: block;
    width: 100%;
    height: auto;
    padding: 8px 12px;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .sidebar nav {
    display: flex;
    width: max-content;
    min-width: 100%;
    gap: 4px;
  }

  .sidebar nav a {
    white-space: nowrap;
  }

  .nav-label {
    display: none;
  }

  .content {
    padding: 32px 18px 56px;
  }

  .home-content {
    min-height: auto;
  }

  .article h2 {
    margin-top: 38px;
  }
}

@media (max-width: 420px) {
  .topbar-link {
    display: none;
  }

  .content {
    padding-right: 15px;
    padding-left: 15px;
  }
}
