:root {
  --accent: #5046e5;
  --accent-soft: #efefff;
  --teal: #0ca88f;
  --ink: #20262e;
  --muted: #66717f;
  --line: #e2e6eb;
  --paper: #fff;
  --sidebar: #f7f8fa;
  --code: #17212b;
  --topbar: 64px;
  --sidebar-width: 304px;
  --article-font: 17px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar) + 22px); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: var(--article-font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input { font: inherit; }

.reading-progress {
  position: fixed;
  z-index: 100;
  inset: 0 auto auto 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--accent));
}

.topbar {
  position: fixed;
  z-index: 90;
  inset: 0 0 auto 0;
  height: var(--topbar);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(14px);
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.wordmark { display: flex; align-items: baseline; gap: 10px; text-decoration: none; white-space: nowrap; }
.wordmark strong { font-family: Georgia, serif; font-size: 23px; font-style: italic; letter-spacing: -.06em; }
.wordmark strong span { color: var(--teal); }
.wordmark small { color: var(--muted); font-size: 12px; letter-spacing: .06em; }
.topbar-center { max-width: 440px; overflow: hidden; color: #596473; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.topbar-tools { justify-self: end; display: flex; align-items: center; gap: 6px; }
.topbar-tools button,
.topbar-tools a,
.icon-button {
  min-width: 36px;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #4f5b68;
  background: transparent;
  text-decoration: none;
  cursor: pointer;
}
.topbar-tools button:hover,
.topbar-tools a:hover { border-color: var(--line); background: #f7f8fa; }
.topbar-tools a { display: inline-flex; align-items: center; padding: 0 11px; font-size: 14px; }
.menu-button { display: none; padding: 8px; }
.menu-button span { display: block; width: 18px; height: 2px; margin: 3px 0; background: currentColor; }

.layout { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); padding-top: var(--topbar); }
.book-sidebar {
  position: sticky;
  top: var(--topbar);
  height: calc(100vh - var(--topbar));
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
  scrollbar-width: thin;
}
.sidebar-search { position: sticky; z-index: 3; top: 0; padding: 22px 20px 14px; background: linear-gradient(var(--sidebar) 86%, rgba(247,248,250,.78)); }
.sidebar-search label { display: block; margin-bottom: 8px; color: #7d8792; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.sidebar-search div { position: relative; }
.sidebar-search svg { position: absolute; top: 11px; left: 12px; width: 17px; fill: none; stroke: #8b95a1; stroke-width: 1.8; stroke-linecap: round; }
.sidebar-search input { width: 100%; height: 40px; padding: 0 38px; border: 1px solid #d9dee4; border-radius: 8px; outline: 0; color: var(--ink); background: #fff; font-size: 14px; }
.sidebar-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(80,70,229,.1); }
.sidebar-search kbd { position: absolute; top: 10px; right: 10px; padding: 2px 6px; border: 1px solid #dce1e6; border-radius: 5px; color: #8a94a0; background: #f8f9fa; font: 11px/1.4 ui-monospace, monospace; }
.book-summary { padding: 0 14px 24px; }
.summary-home { display: flex; align-items: center; justify-content: space-between; margin: 2px 6px 20px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 750; text-decoration: none; }
.summary-home small { color: #8a94a0; font-size: 11px; font-weight: 500; }
.book-summary section { margin-bottom: 22px; }
.book-summary section p { margin: 0 8px 7px; color: #939ca7; font: 700 11px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; }
.book-summary section a { display: flex; align-items: center; min-height: 40px; margin: 1px 0; padding: 8px 10px; border-radius: 7px; color: #57616e; font-size: 14px; line-height: 1.45; text-decoration: none; }
.book-summary section a:hover { color: var(--ink); background: #eef0f3; }
.book-summary section a.is-active { color: var(--accent); background: var(--accent-soft); font-weight: 720; box-shadow: inset 3px 0 var(--accent); }
.book-summary section a[hidden] { display: none; }
.sidebar-empty { margin: 0 22px; padding: 14px; border: 1px dashed #ccd2d9; border-radius: 8px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.sidebar-brand { display: block; margin: 8px 22px 30px; padding-top: 18px; border-top: 1px solid var(--line); color: #68727d; font-size: 13px; font-weight: 720; text-decoration: none; }
.sidebar-brand span { color: var(--teal); }
.sidebar-scrim { display: none; }

.page { min-width: 0; }
.article { width: min(820px, calc(100% - 64px)); margin: 0 auto; padding: 52px 0 100px; line-height: 1.82; }
.breadcrumbs { display: flex; gap: 8px; align-items: center; margin-bottom: 38px; color: #8b95a1; font-size: 13px; }
.breadcrumbs a { color: var(--accent); text-decoration: none; }
.article-header { padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.chapter-label { margin: 0 0 13px; color: var(--accent); font: 700 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; }
.article-header h1 { margin: 0; font-size: clamp(38px, 5vw, 58px); line-height: 1.18; letter-spacing: -.045em; }
.article-lede { max-width: 700px; margin: 22px 0 18px; color: #55616f; font-size: 20px; line-height: 1.7; }
.article-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; color: #929aa5; font-size: 12px; }

.on-this-page { margin: 36px 0 48px; padding: 19px 22px; border: 1px solid var(--line); border-radius: 8px; background: #fbfbfc; }
.on-this-page strong { font-size: 14px; }
.on-this-page ol { columns: 2; gap: 36px; margin: 12px 0 0; padding-left: 21px; }
.on-this-page li { break-inside: avoid; padding: 3px 0; color: #85909c; font-size: 14px; }
.on-this-page a { color: #4d5967; text-decoration: none; }
.on-this-page a:hover { color: var(--accent); text-decoration: underline; }

.article-content { margin-top: 44px; }
.article-content h2 { position: relative; margin: 58px 0 18px; padding-top: 8px; font-size: 29px; line-height: 1.35; letter-spacing: -.025em; }
.article-content h2:first-child { margin-top: 0; }
.article-content h3 { margin: 34px 0 14px; font-size: 21px; line-height: 1.45; }
.article-content h4 { margin: 26px 0 10px; font-size: 18px; }
.article-content p { margin: 0 0 18px; color: #3f4955; }
.article-content strong { color: #20262e; }
.article-content a { color: #335fca; text-underline-offset: 3px; }
.article-content a:hover { color: var(--accent); }
.article-content ul,
.article-content ol { margin: 16px 0 24px; padding-left: 25px; color: #3f4955; }
.article-content li { margin: 8px 0; padding-left: 3px; }
.article-content img { display: block; width: auto; max-width: 100%; height: auto; margin: 22px auto 8px; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 14px 32px rgba(24,34,46,.08); }
.article-content figure { margin: 24px 0 34px; }
.article-content figure img { margin-bottom: 10px; }
.article-content figcaption { color: #818b97; font-size: 13px; line-height: 1.65; text-align: center; }
.article-content code { padding: .15em .38em; border-radius: 4px; color: #b83b5e; background: #f4f5f7; font: .88em/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.article-content pre { margin: 22px 0; padding: 19px 22px; overflow-x: auto; border-radius: 8px; color: #d8e2ea; background: var(--code); font: 14px/1.75 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.article-content pre code { padding: 0; color: inherit; background: transparent; font: inherit; }
.article-content hr { height: 1px; margin: 48px 0; border: 0; background: var(--line); }

.article-content blockquote { margin: 24px 0; padding: 17px 20px; border: 0; border-left: 4px solid var(--accent); border-radius: 0 8px 8px 0; background: #f5f4ff; color: #45505c; }
.article-content blockquote p { margin: 4px 0; color: inherit; }
.article-content blockquote.quick-answer-markdown { margin: 34px 0 42px; padding: 22px 24px; border: 1px solid #cfdae4; border-left: 4px solid var(--teal); background: #f5fbfa; }
.article-content blockquote.quick-answer-markdown::before { content: "✓"; float: left; display: grid; place-items: center; width: 30px; height: 30px; margin: 1px 15px 8px 0; border-radius: 50%; color: #fff; background: var(--teal); font-weight: 800; }
.article-content blockquote.warning { border-left-color: #e2a111; background: #fff9eb; }
.article-content blockquote.result { border-left-color: var(--teal); background: #f4fbf9; }
.article-content .step-kicker { display: inline-flex; margin: 26px 0 0; padding: 4px 9px; border-radius: 999px; color: var(--accent); background: var(--accent-soft); font: 700 11px/1.5 ui-monospace, monospace; letter-spacing: .05em; }
.article-content .step-kicker + h3 { margin-top: 10px; }

.table-scroll { overflow-x: auto; margin: 24px 0; border: 1px solid var(--line); border-radius: 8px; }
.table-scroll table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 14px; line-height: 1.55; }
.table-scroll th,
.table-scroll td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table-scroll thead th { color: #697582; background: #f7f8fa; font-size: 12px; letter-spacing: .03em; }
.table-scroll tbody tr:last-child th,
.table-scroll tbody tr:last-child td { border-bottom: 0; }

.search-faq { margin: 72px 0 0; padding-top: 8px; }
.section-eyebrow { margin: 0 0 8px; color: var(--accent); font: 700 11px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .1em; }
.search-faq h2 { margin: 0 0 10px; font-size: 29px; line-height: 1.35; letter-spacing: -.025em; }
.search-faq-intro { margin: 0 0 22px; color: var(--muted); }
.search-faq details { border-top: 1px solid var(--line); }
.search-faq details:last-of-type { border-bottom: 1px solid var(--line); }
.search-faq summary { position: relative; padding: 17px 42px 17px 0; cursor: pointer; font-weight: 720; list-style: none; }
.search-faq summary::-webkit-details-marker { display: none; }
.search-faq summary::after { content: "+"; position: absolute; top: 11px; right: 8px; color: #7a8591; font-size: 25px; font-weight: 400; }
.search-faq details[open] summary::after { content: "−"; }
.search-faq details > p { margin: -2px 40px 18px 0; color: #53606d; line-height: 1.75; }
.article-references { margin-top: 30px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc; }
.article-references h3 { margin: 0 0 9px; font-size: 15px; }
.article-references ul { margin: 0; padding-left: 20px; }
.article-references li { margin: 5px 0; color: #65717e; font-size: 13px; }
.article-references a { color: #335fca; text-underline-offset: 3px; }

.page-navigation { display: grid; grid-template-columns: 1fr 1fr; margin-top: 70px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.page-navigation a,
.page-navigation > span { min-width: 0; min-height: 76px; padding: 17px 20px; text-decoration: none; }
.page-navigation a + a,
.page-navigation > span + a { border-left: 1px solid var(--line); text-align: right; }
.page-navigation small { display: block; margin-bottom: 4px; color: #939ca6; font-size: 11px; }
.page-navigation span { display: block; overflow: hidden; color: #4a5663; font-size: 14px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.page-navigation a:hover { background: #f8f9fa; }
.page-navigation a:hover span { color: var(--accent); }
.article-footer { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line); text-align: center; }
.article-footer p { margin: 0 0 12px; font-size: 14px; font-weight: 700; }
.article-footer button { margin: 0 3px; padding: 7px 13px; border: 1px solid #d8dde3; border-radius: 7px; color: #596572; background: #fff; cursor: pointer; font-size: 13px; }
.article-footer button:hover,
.article-footer button[data-selected] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.article-footer small { display: block; margin-top: 24px; color: #9aa2ab; font-size: 11px; }

.network-setup-card { margin: 24px 0 30px; padding: 24px; border: 1px solid #d9e2ef; border-radius: 12px; background: linear-gradient(135deg, #f7f9ff, #f4fbfa); box-shadow: 0 12px 30px rgba(24,34,46,.06); }
.network-setup-card .step-kicker { margin-top: 0; }
.network-setup-card h3 { margin-top: 12px; }
.article-content .article-cta { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; padding: 11px 17px; border-radius: 9px; color: #fff; background: var(--accent); box-shadow: 0 8px 18px rgba(93,83,211,.2); text-decoration: none; font-size: 14px; font-weight: 750; }
.article-content .article-cta:hover,.article-content .article-cta:focus-visible { color: #fff; background: #4d45bd; }

@media (max-width: 980px) {
  .topbar { grid-template-columns: 1fr auto; padding: 0 16px; }
  .topbar-center { display: none; }
  .menu-button { display: block; }
  .layout { display: block; }
  .book-sidebar { position: fixed; z-index: 80; top: var(--topbar); bottom: 0; left: 0; width: min(86vw, var(--sidebar-width)); height: auto; transform: translateX(-102%); transition: transform .2s ease; box-shadow: 18px 0 50px rgba(25,34,44,.15); }
  body.sidebar-open { overflow: hidden; }
  body.sidebar-open .book-sidebar { transform: translateX(0); }
  .sidebar-scrim { position: fixed; z-index: 70; inset: var(--topbar) 0 0; width: 100%; border: 0; background: rgba(20,28,36,.28); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  body.sidebar-open .sidebar-scrim { display: block; opacity: 1; pointer-events: auto; }
  .article { width: min(820px, calc(100% - 40px)); padding-top: 38px; }
}

@media (max-width: 620px) {
  :root { --topbar: 58px; --article-font: 16px; }
  .topbar-tools button { display: none; }
  .topbar-tools a { padding: 0 8px; font-size: 12px; }
  .wordmark small { display: none; }
  .article { width: calc(100% - 32px); padding: 30px 0 70px; }
  .breadcrumbs { margin-bottom: 28px; }
  .article-header h1 { font-size: clamp(34px, 10vw, 44px); }
  .article-lede { font-size: 18px; }
  .on-this-page ol { columns: 1; }
  .article-content h2 { font-size: 25px; }
  .search-faq h2 { font-size: 25px; }
  .article-content blockquote.quick-answer-markdown { padding: 19px; }
  .network-setup-card { padding: 20px; }
  .article-content .article-cta { width: 100%; justify-content: center; text-align: center; }
  .page-navigation { grid-template-columns: 1fr; }
  .page-navigation a + a,
  .page-navigation > span + a { border-top: 1px solid var(--line); border-left: 0; }
}

@media print {
  .topbar, .book-sidebar, .sidebar-scrim, .reading-progress, .article-footer button { display: none !important; }
  .layout { display: block; padding: 0; }
  .article { width: 100%; max-width: none; padding: 0; font-size: 11pt; }
  .page-navigation { break-inside: avoid; }
  a { text-decoration: none; }
}
