:root {
  color-scheme: light;
  --ink: #253044;
  --muted: #657084;
  --accent: #3565c8;
  --line: #e5e9f0;
  --soft: #f3f6fb;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: #fff; font: 15px/1.75 system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 10; padding: 8px 16px; background: #fff; }
.skip-link:focus { top: 8px; }
.site-header { position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1440px; min-height: 60px; margin: auto; padding: 10px 32px; display: flex; align-items: center; gap: 14px; }
.brand { color: var(--ink); font-size: 18px; font-weight: 700; }
.preview-label { color: var(--accent); background: var(--soft); border-radius: 4px; padding: 2px 7px; font-size: 12px; white-space: nowrap; }
.repository-link { margin-left: auto; font-size: 13px; white-space: nowrap; }
.reading-layout { display: grid; grid-template-columns: 224px minmax(0, 1fr) 184px; gap: 36px; max-width: 1440px; margin: auto; padding: 28px 32px 48px; }
.sidebar, .toc { position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 112px); overflow-y: auto; font-size: 13px; }
.sidebar { padding-right: 18px; border-right: 1px solid var(--line); }
.navigation-title { margin: 0 0 14px; color: var(--muted); font-size: 12px; }
.navigation a { display: block; padding: 5px 9px; border-radius: 5px; color: var(--muted); }
.navigation a:hover { background: var(--soft); color: var(--accent); text-decoration: none; }
.navigation .home-link { margin-bottom: 16px; }
.category-toggle { padding: 5px 9px; border-radius: 5px; color: var(--ink); font-weight: 600; cursor: pointer; }
.category-toggle:hover { background: var(--soft); }
.navigation-group { margin: 12px 0; }
.navigation-empty { margin: 4px 0 4px 24px; color: var(--muted); font-size: 12px; }
.navigation ul { list-style: none; margin: 0; padding-left: 12px; }
.navigation .topic-list { border-left: 1px solid var(--line); margin-left: 9px; padding-left: 8px; }
.navigation a[aria-current="page"], .navigation .is-current { color: var(--accent); background: #edf3ff; font-weight: 600; }
.main-content { min-width: 0; }
.breadcrumb { font-size: 12px; color: var(--muted); margin-bottom: 18px; }
.breadcrumb a { color: var(--muted); }
.markdown-body h1 { font-size: 28px; line-height: 1.4; letter-spacing: -.4px; margin: 0 0 18px; }
.markdown-body h2 { font-size: 20px; line-height: 1.5; margin: 30px 0 12px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.markdown-body h3 { font-size: 17px; margin: 24px 0 10px; }
.markdown-body :is(h1, h2, h3) { scroll-margin-top: 86px; }
.markdown-body p { margin: 12px 0; }
.markdown-body :is(ul, ol) { padding-left: 24px; margin: 10px 0; }
.markdown-body li + li { margin-top: 5px; }
.markdown-body blockquote { margin: 18px 0; padding: 9px 16px; border-left: 3px solid var(--accent); background: var(--soft); color: #4c5d76; border-radius: 0 5px 5px 0; }
.markdown-body blockquote p { margin: 5px 0; }
.markdown-body table { display: block; max-width: 100%; width: max-content; overflow-x: auto; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
.markdown-body :is(th, td) { border: 1px solid var(--line); padding: 10px 12px; vertical-align: top; text-align: left; }
.markdown-body th { background: var(--soft); font-weight: 600; }
.markdown-body code { font-family: Consolas, "SFMono-Regular", monospace; font-size: .9em; overflow-wrap: anywhere; padding: 2px 5px; border-radius: 4px; background: #eef1f6; }
.markdown-body pre { overflow-x: auto; padding: 16px 18px; background: #f5f7fa; border: 1px solid var(--line); border-radius: 6px; line-height: 1.6; }
.markdown-body pre code { padding: 0; background: none; overflow-wrap: normal; }
.markdown-body img { max-width: 100%; height: auto; }
.markdown-body a { overflow-wrap: anywhere; }
.markdown-body hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.page-footer { border-top: 1px solid var(--line); margin-top: 36px; padding-top: 16px; color: var(--muted); font-size: 12px; }
.toc { border-left: 1px solid var(--line); padding-left: 18px; }
.toc-title { margin: 0 0 10px; font-weight: 600; }
.toc a { display: block; color: var(--muted); font-size: 12px; line-height: 1.6; padding: 4px 0; }
.toc .toc-child { padding-left: 12px; }
@media (max-width: 1180px) {
  .reading-layout { grid-template-columns: 208px minmax(0, 1fr); gap: 28px; }
  .toc { display: none; }
}
@media (max-width: 760px) {
  .header-inner { padding: 12px 18px; gap: 8px; flex-wrap: wrap; }
  .brand { font-size: 16px; }
  .repository-link { font-size: 12px; }
  .reading-layout { display: block; padding: 18px; }
  .sidebar { position: static; max-height: none; padding: 0 0 14px; border: 0; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
  .markdown-body h1 { font-size: 25px; }
  .markdown-body h2 { font-size: 19px; }
}
@media print {
  .site-header, .sidebar, .toc, .breadcrumb, .skip-link { display: none; }
  .reading-layout { display: block; padding: 0; }
  .markdown-body pre, .markdown-body table { overflow: visible; }
}
