:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --panel: #ffffff;
  --text: #20232a;
  --muted: #697181;
  --line: #dfe3eb;
  --accent: #0b6bcb;
  --accent-soft: #e7f1fc;
  --code-bg: #111827;
  --code-text: #e5e7eb;
  --shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
}

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

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

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 22px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  font-weight: 800;
}

.brand h1 {
  margin: 0;
  font-size: 19px;
  line-height: 1.25;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.search {
  display: block;
  margin-bottom: 20px;
}

.search span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.search input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  font: inherit;
  outline: none;
}

.search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.nav-section {
  margin-bottom: 20px;
}

.nav-section h2 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.nav-link {
  display: block;
  padding: 9px 10px;
  border-radius: 8px;
  text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-link span,
.nav-link small {
  display: block;
}

.nav-link span {
  font-size: 14px;
  font-weight: 700;
}

.nav-link small {
  color: var(--muted);
  font-size: 12px;
}

.content {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 248, 251, 0.92);
  backdrop-filter: blur(12px);
  padding: 0 32px;
}

.breadcrumb {
  color: var(--muted);
  font-size: 14px;
}

.icon-button {
  display: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.icon-button span {
  display: block;
  width: 16px;
  height: 2px;
  margin: 4px auto;
  background: var(--text);
}

.article {
  width: min(980px, calc(100vw - 380px));
  margin: 0 auto;
  padding: 42px 0 80px;
}

.article h1 {
  margin: 0 0 22px;
  font-size: 34px;
  line-height: 1.2;
}

.article h2 {
  margin: 34px 0 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 23px;
}

.article h3 {
  margin: 24px 0 10px;
  font-size: 18px;
}

.article p,
.article li {
  font-size: 16px;
}

.article blockquote {
  margin: 18px 0;
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  padding: 12px 16px;
  color: #244968;
}

.article code {
  border-radius: 5px;
  background: #edf1f7;
  padding: 2px 5px;
  font-size: 0.92em;
}

.article pre {
  overflow-x: auto;
  border-radius: 8px;
  background: var(--code-bg);
  padding: 16px;
  box-shadow: var(--shadow);
}

.article pre code {
  background: transparent;
  color: var(--code-text);
  padding: 0;
}

.article table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  background: #fff;
}

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

.article th {
  background: #f0f3f8;
}

@media (max-width: 860px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 10;
    width: min(320px, 86vw);
    transform: translateX(-100%);
    transition: transform 180ms ease;
    box-shadow: var(--shadow);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .icon-button {
    display: block;
  }

  .topbar {
    padding: 0 16px;
  }

  .article {
    width: min(100% - 32px, 760px);
    padding-top: 28px;
  }

  .article h1 {
    font-size: 28px;
  }
}
