﻿:root {
  /* Windows 11-inspired: neutral surfaces, Fluent blue accent, restrained depth. */
  --bg: #f3f3f3;
  --surface: #ffffff;
  --surface-soft: #f5f5f5;
  --text: #1f1f1f;
  --muted: #616161;
  --line: #e2e2e2;
  --brand: #0078d4;
  --brand-dark: #005fb8;
  --brand-soft: #e8f3ff;
  --link: #005fb8;
  --warning: #9d5d00;
  --sidebar-width: 282px;
  --outline-width: 226px;
  --radius: 8px;
  --shadow: 0 1.6px 3.6px rgba(0, 0, 0, .10), 0 0.3px .9px rgba(0, 0, 0, .08);
}

:root[data-theme="dark"] {
  --bg: #202020;
  --surface: #292929;
  --surface-soft: #323232;
  --text: #f5f5f5;
  --muted: #c6c6c6;
  --line: #444444;
  --brand: #60cdff;
  --brand-dark: #8edcff;
  --brand-soft: #153e5c;
  --link: #8edcff;
  --warning: #f6c344;
  --shadow: 0 1.6px 4px rgba(0, 0, 0, .32), 0 0.3px 1px rgba(0, 0, 0, .26);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI Variable", "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.76;
}
button, input { font: inherit; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-shell { min-height: 100vh; }
.topbar {
  position: fixed; inset: 0 0 auto; z-index: 30; height: 64px;
  display: flex; align-items: center; gap: 14px; padding: 0 24px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); white-space: nowrap; min-width: 225px; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--brand); color: white; font-size: 18px; font-weight: 800; box-shadow: 0 1.6px 3.6px rgba(0, 0, 0, .18); }
.brand strong { display: block; font-size: 14px; line-height: 1.25; letter-spacing: .02em; }
.brand small { display: block; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .12em; line-height: 1.2; }
.icon-button { display: none; border: 0; color: var(--text); background: transparent; cursor: pointer; border-radius: 8px; padding: 8px; }
.icon-button:hover { background: var(--surface-soft); }
.icon-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.menu-button span { display: block; width: 19px; height: 1.7px; margin: 3.5px 0; background: currentColor; border-radius: 2px; }
.search-box { width: min(500px, 45vw); margin-inline: auto; position: relative; display: flex; align-items: center; gap: 9px; min-height: 37px; padding: 0 9px; background: var(--surface-soft); color: var(--muted); border: 1px solid transparent; border-radius: 6px; cursor: text; }
.search-box:focus-within { border-color: color-mix(in srgb, var(--brand) 50%, var(--line)); background: var(--surface); }
.search-box svg, .dialog-search svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.search-box input { width: 100%; min-width: 0; color: var(--text); border: 0; outline: 0; background: transparent; font-size: 13px; }
kbd { padding: 1px 5px; color: var(--muted); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; font-size: 10px; line-height: 1.5; white-space: nowrap; }
.theme-button { display: inline-grid; place-items: center; }

.sidebar { position: fixed; inset: 64px auto 0 0; z-index: 20; width: var(--sidebar-width); overflow-y: auto; padding: 25px 16px 22px; background: var(--surface); border-right: 1px solid var(--line); }
.nav-label { margin: 0 10px 7px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.nav-group { margin: 0 0 20px; }
.nav-link { display: block; padding: 6px 10px; border-radius: 7px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.nav-link:hover { background: var(--surface-soft); color: var(--text); text-decoration: none; }
.nav-link.active { color: var(--brand-dark); background: var(--brand-soft); font-weight: 700; }
.nav-link.home-link { display: flex; align-items: center; gap: 7px; margin-bottom: 17px; color: var(--text); font-weight: 700; }
.nav-link.home-link svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.nav-link .dot { display: inline-block; width: 5px; height: 5px; margin-right: 7px; vertical-align: 2px; border-radius: 50%; background: #a8b3aa; }
.nav-link.active .dot { background: var(--brand); }
.sidebar-footer { margin: 35px 8px 0; padding: 15px 0 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.6; }
.sidebar-footer p { margin: 0 0 8px; }
.sidebar-footer a { font-weight: 700; color: var(--brand-dark); }
.sidebar-footer span { font-size: 16px; }

.main-content { position: relative; min-height: 100vh; margin-left: var(--sidebar-width); padding: 110px calc(var(--outline-width) + 60px) 90px min(7vw, 105px); }
.article { max-width: 820px; min-height: 440px; }
.reading-progress { position: fixed; top: 63px; left: var(--sidebar-width); right: 0; z-index: 40; height: 2px; background: transparent; }
.reading-progress i { display: block; width: 0; height: 100%; background: var(--brand); transition: width .08s linear; }

.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 16px; color: var(--muted); font-size: 13px; }
.breadcrumbs span { color: var(--line); }
.article h1 { margin: 0 0 14px; font-size: clamp(30px, 4vw, 43px); letter-spacing: -.035em; line-height: 1.2; }
.article h2 { margin: 54px 0 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 24px; letter-spacing: -.02em; line-height: 1.35; scroll-margin-top: 90px; }
.article h3 { margin: 34px 0 12px; font-size: 18px; scroll-margin-top: 90px; }
.article h2 .heading-anchor, .article h3 .heading-anchor { color: transparent; margin-left: 8px; font-weight: 500; }
.article h2:hover .heading-anchor, .article h3:hover .heading-anchor { color: var(--muted); text-decoration: none; }
.article p { margin: 0 0 18px; }
.article hr { border: 0; border-top: 1px solid var(--line); margin: 34px 0; }
.article ul, .article ol { padding-left: 24px; margin: 0 0 18px; }
.article li { margin: 5px 0; }
.article blockquote { margin: 18px 0 24px; padding: 12px 15px; border-left: 3px solid var(--brand); background: var(--brand-soft); color: var(--text); border-radius: 0 8px 8px 0; }
.article blockquote p { margin: 0; }
.article code { padding: 2px 5px; background: var(--surface-soft); border-radius: 4px; font-family: "Cascadia Code", Consolas, monospace; font-size: .86em; }
.article pre { overflow-x: auto; margin: 20px 0; padding: 16px; background: #152119; color: #e7f1e9; border-radius: 10px; line-height: 1.6; }
.article pre code { padding: 0; background: transparent; color: inherit; }
.article table { width: 100%; overflow: hidden; margin: 20px 0 25px; border: 1px solid var(--line); border-radius: 9px; border-spacing: 0; border-collapse: separate; font-size: 13px; }
.article th, .article td { padding: 10px 12px; text-align: left; vertical-align: top; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.article th:last-child, .article td:last-child { border-right: 0; }
.article tr:last-child td { border-bottom: 0; }
.article th { background: var(--surface-soft); font-size: 12px; }
.article details { margin: 20px 0; padding: 0 14px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 9px; }
.article summary { padding: 12px 0; cursor: pointer; font-weight: 700; }
.article details > :not(summary) { margin-bottom: 15px; }
.article .meta-card { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 24px 0 30px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--line); }
.meta-row { min-height: 61px; padding: 10px 13px; background: var(--surface); }
.meta-row small { display: block; margin-bottom: 3px; color: var(--muted); font-size: 11px; font-weight: 700; }
.meta-row strong { display: block; font-size: 13px; font-weight: 650; line-height: 1.45; }
.status { display: inline-block; padding: 2px 8px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-dark); font-size: 12px; font-weight: 800; line-height: 1.55; }
.status.uncertain { background: color-mix(in srgb, var(--warning) 13%, var(--surface)); color: var(--warning); }

.home-hero { padding: 12px 0 34px; }
.home-eyebrow { display: flex; align-items: center; gap: 9px; margin-bottom: 17px; color: var(--brand); font-size: 12px; font-weight: 800; letter-spacing: .11em; }
.home-eyebrow::before { width: 23px; height: 2px; content: ""; background: currentColor; }
.home-hero h1 { max-width: 700px; margin-bottom: 18px; font-size: clamp(37px, 5vw, 54px); }
.home-hero > p { max-width: 680px; color: var(--muted); font-size: 17px; }
.home-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.button { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); font-size: 13px; font-weight: 750; }
.button.primary { border-color: var(--brand); background: var(--brand); color: white; }
.button:hover { text-decoration: none; filter: brightness(.97); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0 44px; }
.stat { padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.stat strong { display: block; font-size: 25px; line-height: 1.1; }
.stat small { color: var(--muted); font-size: 12px; }
.collection-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin: 17px 0 30px; }
.collection-card { display: flex; flex-direction: column; min-height: 178px; padding: 19px; color: var(--text); border: 1px solid var(--line); border-radius: 8px; background: var(--surface); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease; }
.collection-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); box-shadow: var(--shadow); text-decoration: none; }
.collection-card .card-count { color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.collection-card h3 { margin: 10px 0 8px; font-size: 20px; }
.collection-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.collection-card .card-arrow { margin-top: auto; padding-top: 12px; color: var(--brand-dark); font-weight: 800; }
.callout { display: flex; gap: 14px; margin: 28px 0; padding: 17px 18px; border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--line)); border-radius: 8px; background: var(--brand-soft); }
.callout-badge { display: grid; flex: 0 0 auto; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--brand); color: white; font-weight: 850; }
.callout p { margin: 0; font-size: 13px; }

.outline { position: fixed; top: 105px; right: 28px; width: calc(var(--outline-width) - 25px); max-height: calc(100vh - 135px); overflow: auto; padding-left: 15px; border-left: 1px solid var(--line); }
.outline-label { margin: 0 0 8px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.outline a { display: block; padding: 4px 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.outline a.level-3 { padding-left: 11px; font-size: 11px; }
.outline a:hover, .outline a.active { color: var(--brand-dark); text-decoration: none; }

.search-panel { position: fixed; inset: 0; z-index: 100; }
.search-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(13, 22, 15, .48); cursor: default; }
.search-dialog { position: relative; width: min(650px, calc(100vw - 32px)); max-height: min(600px, calc(100vh - 60px)); overflow: auto; margin: 12vh auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.dialog-search { display: flex; align-items: center; gap: 10px; padding: 14px 15px; border-bottom: 1px solid var(--line); color: var(--muted); }
.dialog-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 15px; }
.search-results { padding: 8px; }
.search-result { display: block; padding: 12px; border-radius: 8px; color: var(--text); }
.search-result:hover, .search-result.selected { background: var(--surface-soft); text-decoration: none; }
.search-result small { display: block; color: var(--brand); font-size: 11px; font-weight: 800; }
.search-result strong { display: block; margin: 2px 0; font-size: 14px; }
.search-result p { overflow: hidden; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
.empty-result { padding: 23px 12px; color: var(--muted); text-align: center; font-size: 13px; }

@media (max-width: 1180px) {
  :root { --outline-width: 0px; }
  .outline { display: none; }
  .main-content { padding-right: min(7vw, 80px); }
}
@media (max-width: 820px) {
  :root { --sidebar-width: 0px; }
  .topbar { height: 57px; padding: 0 13px; gap: 8px; }
  .brand { min-width: auto; }
  .brand strong { font-size: 13px; }
  .brand small { display: none; }
  .menu-button { display: block; }
  .theme-button { margin-left: auto; }
  .search-box { width: auto; flex: 1; margin: 0; }
  .search-box kbd { display: none; }
  .sidebar { transform: translateX(-100%); top: 57px; width: min(300px, 86vw); box-shadow: var(--shadow); transition: transform .22s ease; }
  body.sidebar-open { overflow: hidden; }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open::after { position: fixed; z-index: 15; inset: 57px 0 0; content: ""; background: rgba(0, 0, 0, .28); }
  .main-content { margin-left: 0; padding: 86px 19px 60px; }
  .reading-progress { top: 56px; left: 0; }
  .article h2 { margin-top: 38px; }
  .article .meta-card { grid-template-columns: 1fr; }
  .collection-grid { grid-template-columns: 1fr; }
  .stats { gap: 8px; }
  .stat { padding: 11px; }
  .stat strong { font-size: 20px; }
}
@media (max-width: 490px) {
  .brand-mark { width: 30px; height: 30px; border-radius: 8px; font-size: 16px; }
  .brand strong { max-width: 124px; overflow: hidden; text-overflow: ellipsis; }
  .search-box input { font-size: 12px; }
  .search-box { padding: 0 7px; }
  .article h1 { font-size: 31px; }
  .article table { display: block; overflow-x: auto; }
}

