:root {
  --accent: #0F6FB9;
  --accent-strong: #0D5B9D;
  --accent-soft: #E8F1FA;
  --warn: #E07E00;
  --warn-soft: #FDF3E6;
  --danger: #C0392B;
  --danger-soft: #FBECEA;
  --ok: #2E7D4F;
  --ok-soft: #E9F5EE;
  --text: #152238;
  --muted: #5B6779;
  --line: #DDE3EA;
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --code: #EEF2F6;
  --shadow: 0 1px 2px rgba(21, 34, 56, .06), 0 4px 14px rgba(21, 34, 56, .06);
  --topbar: 56px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #4BA3E8; --accent-strong: #7DBDF0; --accent-soft: #15283D;
    --warn: #F0A040; --warn-soft: #33270F; --danger: #F07A6C; --danger-soft: #3A1D1A; --ok: #6CC795; --ok-soft: #15301F;
    --text: #E4E9F0; --muted: #9AA6B6; --line: #2A3442; --bg: #11161D; --surface: #18202A; --code: #212B37;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --accent: #4BA3E8; --accent-strong: #7DBDF0; --accent-soft: #15283D;
  --warn: #F0A040; --warn-soft: #33270F; --danger: #F07A6C; --danger-soft: #3A1D1A; --ok: #6CC795; --ok-soft: #15301F;
  --text: #E4E9F0; --muted: #9AA6B6; --line: #2A3442; --bg: #11161D; --surface: #18202A; --code: #212B37;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--topbar) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar);
  display: flex; align-items: center; gap: 16px; padding: 0 16px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand b { font-weight: 650; }
.brand-sub { color: var(--muted); font-size: 14px; }
.menu-toggle { display: none; background: none; border: 0; color: var(--text); padding: 6px; border-radius: 6px; cursor: pointer; }
.search { position: relative; margin-left: auto; width: min(440px, 100%); display: flex; align-items: center; }
.search > svg { position: absolute; left: 10px; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; height: 38px; padding: 0 12px 0 36px; font: inherit; font-size: 15px;
  color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; outline: none;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.results {
  position: absolute; top: 44px; left: 0; right: 0; max-height: 70vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px;
}
.results a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--text); }
.results a:hover, .results a.active { background: var(--accent-soft); text-decoration: none; }
.results .r-title { font-weight: 600; }
.results .r-path { font-size: 12px; color: var(--muted); }
.results .r-snip { font-size: 13px; color: var(--muted); }
.results mark { background: var(--warn-soft); color: inherit; padding: 0 1px; border-radius: 2px; }
.results .r-none { padding: 10px; color: var(--muted); }

/* layout */
.layout { display: grid; grid-template-columns: 290px minmax(0, 1fr) 220px; max-width: 1500px; margin: 0 auto; }
.nav {
  position: sticky; top: var(--topbar); height: calc(100vh - var(--topbar)); overflow: auto;
  padding: 16px 8px 40px 12px; border-right: 1px solid var(--line); font-size: 14.5px;
}
.nav ul { list-style: none; margin: 0; padding: 0; }
.nav ul ul { padding-left: 14px; border-left: 1px solid var(--line); margin-left: 9px; }
.nav li { margin: 1px 0; }
.nav .row { display: flex; align-items: center; }
.nav .twisty {
  width: 18px; height: 22px; flex: none; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.nav .twisty svg { transition: transform .15s; }
.nav li.open > .row .twisty svg { transform: rotate(90deg); }
.nav .twisty.leaf { visibility: hidden; }
.nav a { display: block; flex: 1; padding: 3px 8px; border-radius: 6px; color: var(--text); line-height: 1.35; }
.nav a:hover { background: var(--accent-soft); text-decoration: none; }
.nav a.current { background: var(--accent); color: #fff; }
.nav li:not(.open) > ul { display: none; }
.nav > ul > li > .row a { font-weight: 600; }

.content { padding: 24px 40px 40px; min-width: 0; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 4px; min-height: 20px; }
.crumbs a { color: var(--muted); }
.crumbs span.sep { margin: 0 6px; opacity: .6; }
article { max-width: 900px; }
article h1, .page-title { font-size: 30px; line-height: 1.2; margin: 4px 0 18px; letter-spacing: -.01em; }
article h2 { font-size: 22px; margin: 36px 0 10px; padding-top: 8px; border-top: 1px solid var(--line); }
article h3 { font-size: 18px; margin: 26px 0 8px; }
article h4 { font-size: 16px; margin: 20px 0 6px; }
article p, article li { max-width: 78ch; }
article ol, article ul { padding-left: 24px; }
article li { margin: 4px 0; }
article code, article kbd {
  font-family: "Cascadia Mono", Consolas, monospace; font-size: .88em; background: var(--code);
  padding: 1px 5px; border-radius: 4px;
}
article kbd { border: 1px solid var(--line); border-bottom-width: 2px; background: var(--surface); }
article hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
article blockquote { margin: 16px 0; padding: 4px 16px; border-left: 3px solid var(--line); color: var(--muted); }

.table-wrap { overflow-x: auto; margin: 14px 0 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th, td { text-align: left; vertical-align: top; padding: 8px 12px; border-bottom: 1px solid var(--line); }
th { background: var(--bg); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 550; }

figure { margin: 18px 0 22px; }
figure img, article img {
  max-width: 100%; height: auto; display: block; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); box-shadow: var(--shadow);
}
figure a.zoom { display: inline-block; cursor: zoom-in; }
figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* callouts: > [!NOTE] / [!TIP] / [!IMPORTANT] / [!WARNING] / [!CAUTION] */
.markdown-alert { margin: 16px 0; padding: 10px 16px; border-radius: 8px; border-left: 4px solid var(--accent); background: var(--accent-soft); }
.markdown-alert p { margin: 6px 0; }
.markdown-alert-title { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 14px; }
.markdown-alert-title svg { fill: currentColor; }
.markdown-alert-note .markdown-alert-title { color: var(--accent-strong); }
.markdown-alert-tip { border-color: var(--ok); background: var(--ok-soft); }
.markdown-alert-tip .markdown-alert-title { color: var(--ok); }
.markdown-alert-important { border-color: #7B5BB6; background: color-mix(in srgb, #7B5BB6 10%, var(--surface)); }
.markdown-alert-important .markdown-alert-title { color: #7B5BB6; }
.markdown-alert-warning { border-color: var(--warn); background: var(--warn-soft); }
.markdown-alert-warning .markdown-alert-title { color: var(--warn); }
.markdown-alert-caution { border-color: var(--danger); background: var(--danger-soft); }
.markdown-alert-caution .markdown-alert-title { color: var(--danger); }

/* start page cards: a list inside ::: cards */
.cards ul { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.cards li { margin: 0; max-width: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; box-shadow: var(--shadow); }
.cards li a { font-weight: 650; display: block; margin-bottom: 4px; }
.cards li p { margin: 0; }

/* steps: an ordered list inside ::: steps */
.steps ol { counter-reset: step; list-style: none; padding-left: 0; }
.steps ol > li { counter-increment: step; position: relative; padding-left: 40px; margin: 10px 0; }
.steps ol > li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}

.toc { position: sticky; top: var(--topbar); height: calc(100vh - var(--topbar)); overflow: auto; padding: 28px 12px 40px 8px; font-size: 13px; }
.toc .toc-title { font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-size: 11.5px; margin-bottom: 6px; }
.toc a { display: block; padding: 3px 8px; color: var(--muted); border-left: 2px solid var(--line); }
.toc a.lvl3 { padding-left: 18px; }
.toc a.active { color: var(--accent-strong); border-left-color: var(--accent); }

.pager { display: flex; gap: 12px; justify-content: space-between; max-width: 900px; margin-top: 40px; }
.pager a { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: var(--surface); }
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager a.next { text-align: right; }
.pager small { display: block; color: var(--muted); font-size: 12px; }
.foot { max-width: 900px; margin-top: 32px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

.subpages { margin: 24px 0; }
.notice { padding: 10px 14px; border-radius: 8px; background: var(--warn-soft); border-left: 4px solid var(--warn); margin-bottom: 16px; font-size: 14px; }

.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(10, 15, 22, .86); display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }

@media (max-width: 1200px) { .layout { grid-template-columns: 270px minmax(0, 1fr); } .toc { display: none; } }
@media (max-width: 860px) {
  .menu-toggle { display: block; }
  .brand-sub { display: none; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .nav { position: fixed; top: var(--topbar); left: 0; bottom: 0; width: min(320px, 86vw); z-index: 15; background: var(--surface); transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  body.nav-open .nav { transform: none; }
  .content { padding: 16px 16px 32px; }
  article h1, .page-title { font-size: 25px; }
  .search { width: auto; flex: 1; }
}

@media print {
  .topbar, .nav, .toc, .pager, .crumbs, .foot { display: none !important; }
  .layout { display: block; }
  .content { padding: 0; }
  body { background: #fff; color: #000; font-size: 11pt; }
  figure img { box-shadow: none; max-height: 120mm; width: auto; }
  .print-page { break-before: page; }
  a { color: inherit; }
}
body.single .content { max-width: 960px; margin: 0 auto; }
