:root {
  --bg: #ffffff;
  --bg-soft: #f7f8fb;
  --text: #111827;
  --muted: #5b6472;
  --line: #e5e7eb;
  --brand: #111827;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --code-bg: #0f172a;
  --code-text: #e5eefc;
  --shadow: 0 10px 30px rgba(17, 24, 39, 0.06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
}
body.menu-open { overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 28px 20px;
  border-right: 1px solid var(--line);
  background: var(--bg-soft);
}

.brand {
  display: inline-block;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 10px;
}

.sidebar-text {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 20px;
}

.search-box { margin-bottom: 22px; }
.search-box input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}

.nav-title {
  margin: 0 0 12px;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.nav-list li + li { margin-top: 8px; }
.nav-list a {
  display: block;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
  transition: background .2s ease, color .2s ease;
}
.nav-list a:hover,
.nav-list a.active {
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}

.content {
  width: 100%;
  max-width: 960px;
  padding: 42px 32px 100px;
}

.hero, .article-header { margin-bottom: 34px; }
.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

h1, h2, h3 { line-height: 1.2; }
h1 { font-size: clamp(2rem, 3vw, 3.2rem); margin: 0 0 14px; }
h2 { font-size: 1.65rem; margin: 0 0 16px; padding-top: 10px; }
h3 { font-size: 1.1rem; margin: 0 0 10px; }

.lead {
  font-size: 1.08rem;
  color: var(--muted);
  max-width: 760px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 18px;
  margin: 30px 0 42px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  background: #fff;
  box-shadow: var(--shadow);
}
.card p { color: var(--muted); }
.card-meta {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.88rem;
  color: var(--muted);
}
.doc-section {
  margin: 36px 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.article-page { display: block; }
.article-page .article-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 22px;
}
.article-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.92rem;
}
.article-page p,
.article-page ul,
.article-page ol { max-width: 760px; }
.article-page section { margin: 34px 0; }

.note,
.warning {
  border-radius: 14px;
  padding: 16px 18px;
  margin: 18px 0;
}
.note { background: #eff6ff; border: 1px solid #bfdbfe; }
.warning { background: #fff7ed; border: 1px solid #fed7aa; }

pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 18px;
  border-radius: 14px;
  overflow-x: auto;
  border: 1px solid rgba(148, 163, 184, 0.18);
}
code {
  font-family: "SFMono-Regular", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.94em;
}
:not(pre) > code {
  background: #eef2ff;
  color: #312e81;
  padding: 0.15rem 0.4rem;
  border-radius: 7px;
}

.tabs {
  width: 100%;
}

.tab-labels {
  display: flex;
  width: 100%;
  border-bottom: 1px solid #e5e7eb;
}

.tab-labels button,
.tab-labels .tab,
.tab-labels label {
  flex: 1;
  text-align: center;
  padding: 12px 16px;
  background: #9b9b9b;
  border: none;
  border-right: 1px solid #e5e7eb;
  cursor: pointer;
  font-weight: 500;
}

.tab-labels button:last-child,
.tab-labels .tab:last-child,
.tab-labels label:last-child {
  border-right: none;
}

.tab-labels .active {
  background: #ffffff;
  border-bottom: 2px solid #2563eb;
  color: #2563eb;
}
.footer-note {
  margin-top: 42px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.94rem;
}
.topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}
.menu-toggle {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  cursor: pointer;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-weight: 500;
}
.scroll-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 1.2rem;
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
  z-index: 40;
}
.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .topbar { display: flex; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(84vw, 320px);
    height: 100vh;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform .2s ease;
    border-right: 1px solid var(--line);
  }
  .sidebar.open { transform: translateX(0); }
  .content { padding: 28px 20px 90px; }
}
