:root {
  --bg: #f5f9fb;
  --surface: #ffffff;
  --sidebar: #e4f4f8;
  --surface-2: #eef6f9;
  --text: #0b2733;
  --text-2: #23434f;
  --muted: #58747f;
  --border: #d3e5ea;
  --border-strong: #bcd4dc;
  --accent: #0891b2;
  --accent-strong: #0e7490;
  --accent-2: #06b6d4;
  --accent-soft: #cffafe;
  --code-bg: #ecf8fb;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(11 39 51 / 0.05), 0 10px 28px rgb(11 39 51 / 0.07);
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background:
    radial-gradient(1100px 460px at 85% -10%, rgba(8, 145, 178, 0.10), transparent 70%),
    radial-gradient(900px 400px at -10% 0%, rgba(6, 182, 212, 0.08), transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
}

.layout { display: flex; min-height: 100vh; max-width: 1380px; margin: 0 auto; }

/* ---------- sidebar ---------- */
.sidebar {
  width: 300px;
  flex-shrink: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 1.5rem 1rem 3rem;
}
.brand {
  font-weight: 750;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  padding: 0 .5rem 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.brand a {
  background: linear-gradient(100deg, var(--accent-strong), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-decoration: none;
}
.sidenav a {
  display: block;
  color: var(--text-2);
  text-decoration: none;
  padding: .34rem .6rem;
  border-radius: 8px;
  font-size: .92rem;
}
.sidenav a:hover { background: var(--accent-soft); color: var(--accent-strong); }
.nav-top {
  display: flex;
  gap: .25rem;
  padding-bottom: .75rem;
  margin-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}
.nav-top a { font-weight: 600; }
.nav-cat {
  margin-top: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: .7rem;
  color: var(--accent-strong);
}
.nav-cat:hover { background: none; color: var(--accent); }
.nav-page { padding-left: 1.15rem; }

/* ---------- content ---------- */
.content {
  flex: 1;
  min-width: 0;
  max-width: 900px;
  padding: 2.5rem 3rem 5rem;
}
.content h1 {
  font-size: 2.1rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: .2rem 0 .8rem;
  padding-bottom: .45rem;
  border-bottom: 1px solid var(--border);
}
.content h2 { font-size: 1.45rem; letter-spacing: -0.01em; margin: 2.2rem 0 .6rem; }
.content h3 { font-size: 1.15rem; margin: 1.6rem 0 .4rem; }
.content p { margin: .6rem 0; }
.content a { color: var(--accent); text-decoration: none; }
.content a:hover { text-decoration: underline; text-underline-offset: 3px; }
.content ul, .content ol { padding-left: 1.5rem; margin: .6rem 0; }
.content li { margin: .25rem 0; }
.content strong { font-weight: 650; }

.breadcrumb {
  font-size: .85rem;
  color: var(--muted);
  margin: 0 0 1.6rem;
  padding: .5rem .9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }

.content blockquote {
  margin: 1rem 0;
  padding: .6rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  color: var(--text-2);
  border-radius: 0 10px 10px 0;
}
.content blockquote p { margin: .4rem 0; }

.content table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  margin: 1rem 0;
  font-size: .95rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.content th, .content td {
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: .5rem .8rem;
  text-align: left;
  vertical-align: top;
}
.content th:last-child, .content td:last-child { border-right: 0; }
.content tr:last-child th, .content tr:last-child td { border-bottom: 0; }
.content th { background: var(--surface-2); font-weight: 650; }

.content code {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--code-bg);
  padding: .15em .4em;
  border-radius: 6px;
}
.content pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 12px;
  overflow-x: auto;
  border: 1px solid var(--border);
}
.content pre code { background: none; padding: 0; font-size: .85rem; }

.content hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.content img { max-width: 100%; border-radius: 12px; }

@media (max-width: 900px) {
  .layout { flex-direction: column; max-width: none; }
  .sidebar { position: static; width: 100%; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .content { padding: 1.5rem 1.25rem 3rem; max-width: none; }
}
