/* 离线学习手册：目录是阅读顺序，青色只标记可执行的阅读入口。 */
:root {
  color-scheme: light;
  --paper: #ffffff;
  --canvas: #f5f8f8;
  --ink: #142d32;
  --muted: #52686d;
  --accent: #087f8c;
  --wash: #e8eff0;
  --rule: #c4d5d9;
  --body-font: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  --display-font: "Microsoft YaHei", "PingFang SC", sans-serif;
  --code-font: Consolas, "Cascadia Mono", "SFMono-Regular", monospace;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 6rem; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: var(--body-font); }
button, input, select { font: inherit; }
a { color: var(--accent); text-underline-offset: .22em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.skip-link { position: fixed; top: 0; left: 1rem; z-index: 30; transform: translateY(-150%); padding: .7rem 1rem; background: var(--paper); }
.skip-link:focus { transform: translateY(0); }
.site-header { min-height: 68px; background: var(--paper); border-bottom: 1px solid var(--rule); }
.site-header-inner { max-width: 1360px; margin: 0 auto; padding: 1rem 2.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.site-mark { color: var(--ink); text-decoration: none; font-size: 17px; font-weight: 700; }
.site-mark span { color: var(--accent); margin-right: .65rem; }
.site-tools { display: flex; gap: 1.3rem; flex-wrap: wrap; font-size: 14px; }
.home-wrap { max-width: 1260px; margin: 0 auto; padding: 3.5rem 2.5rem 2.5rem; }
.eyebrow { margin: 0 0 1rem; color: var(--accent); font-size: 14px; font-weight: 700; letter-spacing: .05em; }
.home-title { max-width: 930px; margin: 0; font-family: var(--display-font); font-size: clamp(32px, 4.2vw, 56px); font-weight: 700; line-height: 1.26; letter-spacing: -.03em; }
.home-intro { max-width: 850px; margin: 1.4rem 0 2rem; color: var(--muted); font-size: 19px; line-height: 1.85; }
.reading-route { margin: 2rem 0 2.2rem; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; list-style: none; border: 1px solid var(--rule); background: var(--paper); border-radius: 12px; overflow: hidden; }
.reading-route li { padding: 1.2rem 1.1rem; min-width: 0; border-right: 1px solid var(--rule); }
.reading-route li:last-child { border-right: 0; }
.reading-route a { font-size: 17px; color: var(--ink); font-weight: 700; }
.reading-route span { display: block; margin-top: .55rem; color: var(--muted); font-size: 13px; line-height: 1.6; }
.start-links { display: flex; gap: 1rem 1.6rem; align-items: center; flex-wrap: wrap; }
.primary-link { display: inline-block; background: var(--accent); color: white; padding: .8rem 1.2rem; border-radius: 7px; font-weight: 700; text-decoration: none; }
.primary-link:hover { background: var(--ink); text-decoration: none; }
.section-heading { margin-top: 3.4rem; margin-bottom: 1rem; font-size: 25px; line-height: 1.4; }
.section-note { color: var(--muted); font-size: 15px; line-height: 1.8; }
.find-chapter { display: grid; grid-template-columns: minmax(250px, 1fr) auto; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.search-label { display: block; color: var(--muted); font-size: 14px; margin-bottom: .5rem; }
.chapter-search { width: 100%; border: 1px solid var(--rule); border-radius: 7px; padding: .75rem .95rem; background: var(--paper); color: var(--ink); font-size: 16px; }
.result-count { color: var(--muted); font-size: 14px; margin-top: 1.7rem; }
.chapter-filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.2rem; }
.filter-button { border: 1px solid var(--rule); background: var(--paper); color: var(--ink); border-radius: 999px; padding: .5rem .9rem; font-size: 14px; }
.filter-button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: white; }
.chapter-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.chapter-row { display: grid; grid-template-columns: 122px minmax(0, 1fr) auto; gap: 1.5rem; padding: 1.5rem .1rem; border-bottom: 1px solid var(--rule); align-items: center; }
.chapter-id { font-family: var(--code-font); font-size: 18px; font-weight: 700; color: var(--accent); }
.chapter-group { margin-top: .4rem; font-size: 13px; color: var(--muted); }
.chapter-row h3 { margin: 0 0 .55rem; font-size: 21px; line-height: 1.5; }
.chapter-row h3 a { text-decoration: none; color: var(--ink); }
.chapter-description { color: var(--muted); margin: 0; font-size: 15px; line-height: 1.75; }
.chapter-actions { display: flex; gap: .6rem 1rem; flex-wrap: wrap; justify-content: flex-end; font-size: 14px; }
.chapter-actions a { white-space: nowrap; }
.chapter-actions .read-link { font-weight: 700; }
.empty-results { padding: 2rem; border: 1px solid var(--rule); background: var(--paper); color: var(--muted); line-height: 1.8; }
.resource-list { list-style: none; padding: 0; margin: 1rem 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem 2.4rem; }
.resource-list li { min-width: 0; padding: 1rem 0; }
.resource-list a { font-size: 17px; font-weight: 700; }
.resource-list p { margin: .55rem 0 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.site-footer { max-width: 1260px; margin: 1.5rem auto 0; padding: 1.5rem 2.5rem 2rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: 13px; line-height: 1.9; }
.reader-layout { max-width: 1360px; margin: 0 auto; padding: 2.2rem 2.5rem 3rem; display: grid; grid-template-columns: 245px minmax(0, 1fr); gap: 2.7rem; }
.reader-sidebar { min-width: 0; }
.sidebar-inner { position: sticky; top: 1.25rem; max-height: calc(100vh - 2.5rem); overflow-y: auto; padding-right: .9rem; padding-bottom: 1.5rem; }
.sidebar-label { margin: .2rem 0 .85rem; color: var(--muted); font-size: 13px; font-weight: 700; }
.toc { font-size: 14px; line-height: 1.7; }
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li { margin-bottom: .65rem; }
.toc ul ul { margin-top: .5rem; padding-left: .9rem; border-left: 1px solid var(--rule); }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }
.chapter-picker { margin-top: 1.7rem; padding-top: 1.2rem; border-top: 1px solid var(--rule); }
.chapter-picker summary { font-weight: 700; font-size: 14px; cursor: pointer; color: var(--ink); }
.chapter-picker ol { padding-left: 0; margin: 1rem 0 0; list-style: none; font-size: 13px; }
.chapter-picker li { margin: 0 0 .65rem; line-height: 1.65; }
.chapter-picker a { color: var(--muted); text-decoration: none; }
.chapter-picker .current a { color: var(--accent); font-weight: 700; }
.reader-main { min-width: 0; background: var(--paper); border: 1px solid var(--rule); border-radius: 12px; padding: 2.2rem 2.5rem; }
.chapter-topline { display: flex; flex-wrap: wrap; gap: .7rem 1.5rem; align-items: center; justify-content: space-between; padding-bottom: 1.3rem; border-bottom: 1px solid var(--rule); margin-bottom: 1.5rem; }
.chapter-topline .eyebrow { margin: 0; }
.chapter-topline nav { display: flex; gap: 1.25rem; font-size: 14px; }
.prose { font-size: 17px; line-height: 1.9; overflow-wrap: anywhere; }
.prose h1, .prose h2, .prose h3, .prose h4 { color: var(--ink); font-family: var(--display-font); line-height: 1.5; }
.prose h1 { margin: .5rem 0 1.2rem; font-size: clamp(26px, 2.5vw, 36px); letter-spacing: -.02em; }
.prose h2 { margin-top: 2.6rem; margin-bottom: 1rem; font-size: 25px; }
.prose h3 { margin-top: 1.8rem; font-size: 21px; }
.prose h4 { font-size: 18px; }
.prose p { margin: .8rem 0 1.1rem; }
.prose ul, .prose ol { padding-left: 1.6rem; }
.prose li { margin-bottom: .4rem; }
.prose blockquote { border-left: 4px solid var(--accent); margin: 1.3rem 0; padding: .25rem 1.2rem; background: var(--canvas); color: var(--muted); }
.prose code { font-family: var(--code-font); font-size: .91em; padding: .08rem .25rem; background: var(--wash); border-radius: 3px; }
.prose pre { max-width: 100%; overflow-x: auto; background: var(--wash); border: 1px solid var(--rule); border-radius: 7px; padding: 1.15rem 1.25rem; font-size: 14px; line-height: 1.75; }
.prose pre code { display: block; padding: 0; background: none; white-space: pre; overflow-wrap: normal; }
.prose img { display: block; max-width: 100%; height: auto; margin: 1.5rem auto; border: 1px solid var(--rule); border-radius: 6px; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }
.source-context { padding: .8rem 1rem; border: 1px solid var(--rule); background: var(--canvas); font-size: 14px; color: var(--muted); }
.source-reference { color: var(--ink); }
.source-reference small { color: var(--muted); margin-left: .35rem; font-size: .8em; }
.table-scroll { max-width: 100%; overflow-x: auto; margin: 1.3rem 0; border: 1px solid var(--rule); border-radius: 6px; }
.prose table { border-collapse: collapse; width: 100%; margin: 0; font-size: 15px; line-height: 1.75; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: .75rem .8rem; border-bottom: 1px solid var(--rule); min-width: 90px; }
.prose th { background: var(--wash); font-weight: 700; }
.prose tr:last-child td { border-bottom: 0; }
.prose td a { overflow-wrap: anywhere; }
.page-turn { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2.7rem; padding-top: 1.7rem; border-top: 1px solid var(--rule); font-size: 15px; line-height: 1.7; }
.page-turn a { text-decoration: none; }
.page-turn a:last-child { text-align: right; }
.page-turn span { display: block; font-size: 12px; color: var(--muted); margin-bottom: .4rem; }
.video-title { font-size: 19px; }
.video-meta { color: var(--muted); font-size: 14px; }
.video-list { list-style: none; padding: 0 !important; }
.video-list li { padding: 1.2rem 0; border-bottom: 1px solid var(--rule); }
.video-links { display: flex; flex-wrap: wrap; gap: 1.25rem; font-size: 15px; }
@media (max-width: 1000px) {
  .reader-layout { grid-template-columns: 205px minmax(0, 1fr); gap: 1.6rem; padding-left: 1.5rem; padding-right: 1.5rem; }
  .reader-main { padding: 1.8rem; }
  .chapter-row { grid-template-columns: 100px minmax(0, 1fr); gap: 1rem; }
  .chapter-actions { grid-column: 2; justify-content: flex-start; }
}
@media (max-width: 760px) {
  .site-header-inner { padding: 1rem 1.25rem; align-items: flex-start; }
  .site-tools { gap: .8rem; justify-content: flex-end; }
  .home-wrap { padding: 2.2rem 1.25rem 1.5rem; }
  .home-intro { font-size: 17px; }
  .reading-route { display: block; }
  .reading-route li { padding: .95rem 1.1rem; border-right: 0; border-bottom: 1px solid var(--rule); }
  .reading-route li:last-child { border-bottom: 0; }
  .reading-route span { display: inline; margin-left: .6rem; }
  .find-chapter { grid-template-columns: 1fr; gap: .2rem; }
  .result-count { margin-top: .3rem; }
  .chapter-row { grid-template-columns: 72px minmax(0, 1fr); }
  .chapter-id { font-size: 15px; }
  .chapter-row h3 { font-size: 18px; }
  .chapter-description { font-size: 14px; }
  .resource-list { grid-template-columns: 1fr; gap: 0; }
  .reader-layout { display: block; padding: 1.25rem .9rem 2rem; }
  .reader-sidebar { margin-bottom: 1rem; }
  .sidebar-inner { position: static; max-height: none; padding: .85rem 1rem; border: 1px solid var(--rule); border-radius: 7px; background: var(--paper); }
  .reader-sidebar .toc { max-height: 200px; overflow-y: auto; }
  .chapter-picker { margin-top: 1rem; padding-top: 1rem; }
  .reader-main { padding: 1.4rem 1.1rem; }
  .chapter-topline nav { font-size: 13px; }
  .prose { font-size: 16px; }
  .prose h2 { font-size: 23px; margin-top: 2rem; }
  .prose table { font-size: 14px; }
  .prose th, .prose td { min-width: 110px; }
  .site-footer { margin-top: 0; padding: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print {
  body { background: white; }
  .site-header, .reader-sidebar, .chapter-topline nav, .page-turn, .site-footer, .skip-link { display: none; }
  .reader-layout { display: block; padding: 0; }
  .reader-main { border: 0; padding: 0; }
  .prose { font-size: 11pt; }
  .prose h1 { font-size: 22pt; }
  .prose h2 { font-size: 16pt; }
  .table-scroll { overflow: visible; }
  .prose img { max-height: 240mm; }
  a { color: inherit; }
}
