:root {
  --bg: #ffffff;
  --panel: #f6f7f9;
  --text: #1d2330;
  --muted: #5d6677;
  --line: #dde1e8;
  --accent: #c8102e;
  --accent-soft: #fdecef;
  --link: #1f5fbf;
  --code: #eef0f4;
  --tip: #e8f6ee;
  --tip-line: #2f9e5b;
  --note: #e9f1fd;
  --note-line: #3b7ddd;
  --warn: #fff4e0;
  --warn-line: #d98a00;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121b2c;
    --panel: #172238;
    --text: #e4e8ee;
    --muted: #a0a8b6;
    --line: #343a45;
    --accent: #ff5a6e;
    --accent-soft: #3a2228;
    --link: #79a9ff;
    --code: #2c313b;
    --tip: #1d3227;
    --tip-line: #4cc27e;
    --note: #1f2a3d;
    --note-line: #6d9ff0;
    --warn: #3a2f1a;
    --warn-line: #f0b44c;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
}
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
a {
  color: var(--link);
}
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
}
.brand span {
  color: var(--accent);
}
.back-to-app {
  margin-left: auto;
  font-size: 14px;
}
.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  border-radius: 6px;
  font-size: 18px;
  width: 36px;
  height: 34px;
  cursor: pointer;
}
.layout {
  display: flex;
  height: calc(100% - 52px);
}
.sidebar {
  width: 300px;
  flex: none;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--panel);
  padding: 12px 8px 40px;
}
.search input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 15px;
}
.tree-tools {
  display: flex;
  gap: 6px;
  margin: 10px 4px 6px;
}
.tree-tools button {
  border: 0;
  background: none;
  color: var(--link);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 2px 4px;
}
.toc,
.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.toc ul {
  padding-left: 14px;
  border-left: 1px solid var(--line);
  margin-left: 12px;
}
.toc .group > button {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-weight: 650;
  font-size: 15px;
  text-align: left;
  padding: 6px 6px;
  border-radius: 6px;
  cursor: pointer;
}
.toc .group > button:hover {
  background: var(--line);
}
.toc .caret {
  display: inline-block;
  width: 12px;
  transition: transform 0.15s;
  color: var(--muted);
  font-size: 11px;
}
.toc .group.open > button .caret {
  transform: rotate(90deg);
}
.toc .group:not(.open) > ul {
  display: none;
}
.toc a {
  display: block;
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 14.5px;
}
.toc a:hover {
  background: var(--line);
}
.toc a.current {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
#results {
  margin: 10px 0;
}
#results .hit {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
}
#results .hit:hover,
#results .hit:focus {
  background: var(--line);
}
#results .hit b {
  display: block;
  font-size: 14.5px;
}
#results .hit small {
  color: var(--muted);
  font-size: 12.5px;
}
#results .none {
  padding: 8px 10px;
  color: var(--muted);
}
main {
  flex: 1;
  overflow-y: auto;
  padding: 24px 40px 80px;
}
main:focus {
  outline: none;
}
.crumbs {
  font-size: 13px;
  color: var(--muted);
  max-width: 860px;
  margin: 0 auto 4px;
}
.content {
  max-width: 860px;
  margin: 0 auto;
}
.content h1 {
  font-size: 30px;
  line-height: 1.25;
  margin: 4px 0 8px;
}
.content h1 + p {
  font-size: 17.5px;
  color: var(--muted);
  margin-top: 0;
}
.content h2 {
  font-size: 21px;
  margin: 34px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.content h3 {
  font-size: 17px;
  margin: 24px 0 6px;
}
.content ol.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
}
.content ol.steps > li {
  counter-increment: step;
  position: relative;
  padding: 2px 0 14px 46px;
}
.content ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  line-height: 30px;
  text-align: center;
}
.content ol.steps > li > p:first-child {
  margin-top: 2px;
}
.content ul {
  padding-left: 22px;
}
.content li {
  margin: 3px 0;
}
.content figure {
  margin: 12px 0 16px;
}
.content figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  cursor: zoom-in;
}
.content figcaption {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 6px;
}
kbd {
  display: inline-block;
  padding: 0 6px;
  min-width: 22px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--panel);
  font: 600 13px/1.6 ui-monospace, Consolas, monospace;
  text-align: center;
}
code {
  background: var(--code);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.92em;
}
.menu-path {
  display: inline;
  font-weight: 650;
  white-space: nowrap;
}
.menu-path .sep {
  color: var(--muted);
  font-weight: 400;
  margin: 0 4px;
}
.callout {
  margin: 16px 0;
  padding: 10px 14px;
  border-left: 4px solid var(--note-line);
  background: var(--note);
  border-radius: 0 8px 8px 0;
}
.callout.tip {
  border-color: var(--tip-line);
  background: var(--tip);
}
.callout.warning {
  border-color: var(--warn-line);
  background: var(--warn);
}
.callout p {
  margin: 4px 0;
}
.content table {
  border-collapse: collapse;
  margin: 12px 0 18px;
  width: 100%;
  font-size: 15px;
}
.content th,
.content td {
  border: 1px solid var(--line);
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
}
.content th {
  background: var(--panel);
}
.content hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 28px 0;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.cards a {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  background: var(--panel);
}
.cards a:hover {
  border-color: var(--accent);
}
.cards a b {
  display: block;
  margin-bottom: 2px;
}
.cards a span {
  font-size: 14px;
  color: var(--muted);
}
.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  max-width: 860px;
  margin: 40px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.pager a {
  display: block;
  max-width: 48%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
}
.pager a small {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
}
.pager .next {
  margin-left: auto;
  text-align: right;
}
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.82);
  cursor: zoom-out;
  padding: 16px;
}
.lightbox[hidden] {
  display: none;
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
}
.loading,
.missing {
  color: var(--muted);
}
@media (max-width: 860px) {
  .nav-toggle {
    display: block;
  }
  .sidebar {
    position: fixed;
    top: 52px;
    bottom: 0;
    left: 0;
    z-index: 20;
    width: min(320px, 88vw);
    transform: translateX(-105%);
    transition: transform 0.2s;
    box-shadow: var(--shadow);
  }
  body.nav-open .sidebar {
    transform: none;
  }
  main {
    padding: 16px 16px 60px;
  }
  .content h1 {
    font-size: 25px;
  }
  .content ol.steps > li {
    padding-left: 40px;
  }
}
@media print {
  .top,
  .sidebar,
  .pager,
  .crumbs {
    display: none;
  }
  .layout,
  main {
    display: block;
    height: auto;
    overflow: visible;
  }
}
