:root {
  color-scheme: dark;
  --bg: #0a0d14;
  --bg-alt: #0f131d;
  --surface: #151a27;
  --surface-2: #1c2233;
  --surface-3: #0b0e16;
  --ink: #f5f1ec;
  --ink-2: #c5bfb9;
  --ink-3: #9396a3;
  --line: rgba(244, 232, 223, 0.11);
  --line-strong: rgba(244, 232, 223, 0.22);
  --brand: #c83d2e;
  --accent: #ef7862;
  --accent-hover: #f58e7b;
  --accent-ink: #1a0906;
  --accent-soft: rgba(239, 120, 98, 0.13);
  --accent-border: rgba(239, 120, 98, 0.38);
  --teal: #5fd4c3;
  --teal-soft: rgba(95, 212, 195, 0.12);
  --sand: #e0b98f;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  line-height: 1.75;
  font-size: 15.5px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }
img { max-width: 100%; height: auto; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* 极细母品牌归属条 */
.brand-bar {
  background: #07090f;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.brand-bar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 6px 20px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.brand-bar-left, .brand-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.brand-bar-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  display: inline-block;
}
.brand-bar a { color: var(--ink-2); text-decoration: none; }
.brand-bar a:hover { color: var(--accent); text-decoration: none; }
.brand-bar .sep { color: var(--line-strong); }

/* 顶栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(10, 13, 20, 0.9);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-weight: 750;
  font-size: 16px;
  text-decoration: none;
  white-space: nowrap;
}
.topbar-brand:hover { text-decoration: none; }
.topbar-mark { width: 32px; height: 32px; flex-shrink: 0; }
.topbar-title-wrap strong { display: block; line-height: 1.2; }
.topbar-title-wrap em { font-style: normal; color: var(--brand); margin-left: 2px; }
.topbar-title-wrap small { display: block; font-size: 10px; letter-spacing: 0.12em; color: var(--ink-3); font-weight: 500; }

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 14px;
}
.topbar-nav a {
  position: relative;
  color: var(--ink-2);
  padding: 8px 6px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.topbar-nav a:hover { color: var(--ink); text-decoration: none; }
.topbar-nav a.active { color: var(--accent); font-weight: 650; }
.topbar-nav a.active::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-end: 2px;
  border-block-end: 2.5px solid var(--accent);
  border-radius: 2px;
}
.sidebar-toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
}
@media (max-width: 720px) {
  .topbar-inner { flex-wrap: wrap; row-gap: 8px; }
  .topbar-nav { order: 3; width: 100%; border-top: 1px solid var(--line); padding-top: 6px; gap: 10px; overflow-x: auto; }
  .topbar-nav a { font-size: 13.5px; }
}

/* 首页 Hero */
.hero {
  background: radial-gradient(circle at 80% 0%, rgba(200, 61, 46, 0.17), transparent 45%),
              linear-gradient(180deg, #0d111a 0%, #0a0d14 100%);
  color: var(--ink);
  padding: 50px 20px 52px;
  border-bottom: 1px solid var(--line);
}
.hero-inner {
  max-width: 1120px;
  margin: 0 auto;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  margin-bottom: 14px;
}
.hero h1 { font-size: clamp(28px, 3.8vw, 40px); margin: 0 0 10px; line-height: 1.2; letter-spacing: -0.02em; }
.hero p { color: var(--ink-2); margin: 0 0 22px; font-size: 15.5px; max-width: 700px; }
.search-box { max-width: 660px; position: relative; }
.search-input {
  width: 100%;
  height: 48px;
  padding: 0 18px;
  font-size: 15px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-3);
  color: var(--ink);
  outline: none;
}
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-input-light {
  width: 100%;
  max-width: 540px;
  height: 46px;
  padding: 0 16px;
  font-size: 14.5px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface-3);
  color: var(--ink);
  outline: none;
}
.search-input-light:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.quick-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--ink-3);
}
.quick-tag {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink-2);
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.quick-tag:hover { border-color: var(--accent-border); color: var(--accent); background: var(--accent-soft); }

/* 首页容器 */
.home-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 20px 68px;
}
.section-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 32px 0 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 9px;
}
.section-bar h2 { margin: 0; font-size: 20px; color: var(--ink); }
.section-bar span { font-size: 12.5px; color: var(--ink-3); }
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 900px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px) { .card-grid { grid-template-columns: 1fr; } }

a.doc-card {
  display: flex;
  flex-direction: column;
  background: linear-gradient(155deg, var(--surface), #101420);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
a.doc-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-border);
  text-decoration: none;
}
.doc-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.doc-card-tag {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  padding: 2px 9px;
  border-radius: 999px;
  font-weight: 650;
}
.doc-card-title { font-size: 16.5px; font-weight: 700; color: var(--ink); margin-bottom: 7px; line-height: 1.4; }
.doc-card-desc { font-size: 13.5px; color: var(--ink-2); line-height: 1.65; }

.changelog-strip {
  margin-top: 40px;
  background: linear-gradient(130deg, #211518, #121724);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.changelog-strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.changelog-strip-head h2 { margin: 0; font-size: 18px; }
.changelog-mini-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 820px) { .changelog-mini-list { grid-template-columns: 1fr; } }
a.changelog-mini {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-3);
  color: inherit;
  text-decoration: none;
}
a.changelog-mini:hover { border-color: var(--accent-border); text-decoration: none; }
.changelog-mini .ver { font-size: 12px; font-weight: 700; color: var(--accent); }
.changelog-mini .ttl { display: block; font-size: 14.5px; font-weight: 650; margin: 4px 0; color: var(--ink); }
.changelog-mini .dt { font-size: 12px; color: var(--ink-3); }

.empty-state {
  display: none;
  text-align: center;
  color: var(--ink-2);
  padding: 40px 20px;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  margin-top: 24px;
}
.empty-state p { margin: 0 0 12px; }

/* 三栏文档阅读器 */
.reader-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 20px 68px;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr) 210px;
  gap: 26px;
  align-items: start;
}
.sidebar {
  position: sticky;
  top: 86px;
  max-height: calc(100vh - 106px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 14px;
}
.sidebar-group { margin-bottom: 16px; }
.sidebar-group:last-child { margin-bottom: 0; }
.sidebar-group-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  padding: 4px 10px;
  text-transform: uppercase;
}
.sidebar a {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink-2);
  text-decoration: none;
  line-height: 1.45;
}
.sidebar a:hover { background: rgba(255, 255, 255, 0.04); color: var(--ink); text-decoration: none; }
.sidebar a.active { background: var(--accent-soft); color: var(--accent); font-weight: 650; }

.article-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px 36px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
}
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-3);
  margin-bottom: 14px;
}
.breadcrumb a { color: var(--ink-2); }
.breadcrumb a:hover { color: var(--accent); }
.article-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pill {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 650;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}
.pill-muted { background: rgba(255, 255, 255, 0.05); border-color: var(--line); color: var(--ink-2); }

.article-card h1 {
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.3;
  margin: 0 0 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.article-card h2 {
  font-size: 20px;
  margin: 34px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 90px;
  color: var(--ink);
}
.article-card h3 {
  font-size: 17px;
  margin: 24px 0 10px;
  scroll-margin-top: 90px;
  color: var(--ink);
}
.article-card p { margin: 12px 0; color: var(--ink-2); }
.article-card ul, .article-card ol { padding-left: 22px; margin: 10px 0; color: var(--ink-2); }
.article-card li { margin: 6px 0; }
.article-card strong { color: var(--ink); }
.article-card blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
  border-radius: 0 10px 10px 0;
}
.article-card blockquote p { margin: 0; color: var(--ink); }
.article-card code {
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--sand);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 13.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.article-card pre {
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  border-radius: 12px;
  padding: 14px 16px;
  overflow-x: auto;
}
.article-card pre code { background: none; border: 0; color: inherit; padding: 0; }
.article-card img {
  display: block;
  margin: 18px 0;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface-3);
  padding: 8px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
  cursor: zoom-in;
}
.table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--line); border-radius: 12px; }
.article-card table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.article-card th, .article-card td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.article-card th { background: var(--surface-2); color: var(--ink); font-weight: 650; }
.article-card td { color: var(--ink-2); }

.pager {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.pager a {
  display: block;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-3);
  color: var(--ink);
  text-decoration: none;
}
.pager a:hover { border-color: var(--accent-border); text-decoration: none; }
.pager small { display: block; font-size: 11.5px; color: var(--ink-3); }
.pager strong { display: block; font-size: 14px; margin-top: 3px; }
.pager-next { text-align: right; }

.toc-rail {
  position: sticky;
  top: 86px;
  border-left: 1px solid var(--line);
  padding: 4px 0 4px 14px;
  font-size: 12.5px;
}
.toc-rail strong { display: block; margin-bottom: 8px; font-size: 12px; color: var(--ink); }
.toc-rail ul { list-style: none; padding: 0; margin: 0; }
.toc-rail li { margin: 6px 0; }
.toc-rail li.lvl-3 { padding-left: 12px; font-size: 12px; }
.toc-rail a { color: var(--ink-3); }
.toc-rail a:hover { color: var(--accent); text-decoration: none; }

@media (max-width: 1120px) {
  .reader-shell { grid-template-columns: 230px minmax(0, 1fr); }
  .toc-rail { display: none; }
}
@media (max-width: 820px) {
  .reader-shell { grid-template-columns: 1fr; }
  .sidebar-toggle { display: inline-flex; }
  .sidebar { display: none; position: static; max-height: none; }
  .sidebar.open { display: block; }
  .article-card { padding: 22px 18px; }
  .pager { grid-template-columns: 1fr; }
}

/* 更新日志时间轴 */
.changelog-wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 36px 20px 68px;
}
.changelog-head { margin-bottom: 24px; }
.changelog-head h1 { margin: 0 0 8px; font-size: 30px; }
.changelog-head p { margin: 0 0 18px; color: var(--ink-2); }
.timeline {
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-left: 2px solid var(--line-strong);
  padding-left: 24px;
  margin-left: 8px;
}
.timeline-item {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -31px;
  top: 26px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
}
.timeline-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.timeline-date { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; color: var(--ink-3); }
.timeline-item h2 { margin: 4px 0 8px; font-size: 19px; }
.timeline-item h2 a { color: var(--ink); }
.timeline-item h2 a:hover { color: var(--accent); text-decoration: none; }
.timeline-item p { margin: 0 0 10px; color: var(--ink-2); font-size: 14px; }
.timeline-more { font-size: 13px; font-weight: 650; }

/* 灯箱大图预览 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 7, 12, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 94vw;
  max-height: 90vh;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

footer.docs-footer {
  text-align: center;
  color: var(--ink-3);
  font-size: 12.5px;
  padding: 26px 20px 38px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
footer.docs-footer a { color: var(--ink-2); margin-left: 12px; }
footer.docs-footer a:hover { color: var(--accent); }
