/* ============================================
   CppLearner · 学术教科书风格设计
   配色：暖米白 + 深墨绿 + 朱红批注
   ============================================ */

:root {
  /* —— 主色系 —— */
  --ink-deep:      #1a2925;   /* 主文字色：深墨色 */
  --ink-soft:      #3d4a45;   /* 次级文字 */
  --ink-mute:      #6b756f;   /* 弱化文字 */
  --paper:         #faf6ee;   /* 纸张底色：暖米白 */
  --paper-warm:    #f3ecdc;   /* 暖色块底 */
  --paper-line:    #e8dfc9;   /* 分隔线 */
  --paper-deep:    #ede4cf;   /* 较深的纸色 */

  /* —— 强调色 —— */
  --jade:          #2d5a4a;   /* 深墨绿 — 主标题、章节号 */
  --jade-soft:     #3d7563;   /* 浅墨绿 */
  --jade-glow:     #c4ddd2;   /* 墨绿淡背景 */
  --vermilion:     #b8412c;   /* 朱红 — 批注、强调、术语 */
  --vermilion-soft:#d36848;   /* 浅朱红 */
  --vermilion-bg:  #f5e3dc;   /* 朱红底 */
  --gold:          #a47b3c;   /* 金色 — 提示、标号 */
  --gold-bg:       #f5ecd5;

  /* —— 代码块 —— */
  --code-bg:       #1d2823;
  --code-border:   #2d5a4a;

  /* —— 字体 —— */
  --font-serif:    'Noto Serif SC', 'Songti SC', 'SimSun', serif;
  --font-sans:     'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono:     'JetBrains Mono', 'Source Code Pro', monospace;

  /* —— 尺寸 —— */
  --sidebar-w:     280px;
  --toc-w:         240px;
  --header-h:      72px;
  --content-pad:   72px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: var(--font-sans);
  color: var(--ink-deep);
  background: var(--paper);
  line-height: 1.7;
  font-size: 15.5px;
  -webkit-font-smoothing: antialiased;
}

/* 整体纸纹理 */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(180,150,80,0.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(45,90,74,0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ============================================
   阅读进度条
   ============================================ */
.reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: var(--vermilion);
  width: 0%;
  z-index: 1000;
  transition: width 0.15s ease-out;
  box-shadow: 0 0 8px rgba(184,65,44,0.4);
}

/* ============================================
   顶部 Header
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  height: var(--header-h);
  background: var(--paper);
  border-bottom: 1px solid var(--paper-line);
  z-index: 100;
  backdrop-filter: blur(8px);
}

.header-inner {
  height: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--jade);
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -1px;
  position: relative;
  box-shadow: 2px 2px 0 var(--vermilion);
}
.brand-mark span {
  font-size: 14px;
  margin-left: 1px;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  color: var(--ink-deep);
  line-height: 1.2;
}

.brand-sub {
  font-size: 11.5px;
  color: var(--ink-mute);
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.header-nav {
  display: flex;
  gap: 4px;
}

.nav-link {
  padding: 8px 16px;
  font-size: 13.5px;
  color: var(--ink-soft);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s;
  position: relative;
}

.nav-link:hover:not(.disabled) {
  background: var(--paper-warm);
  color: var(--ink-deep);
}

.nav-link.active {
  background: var(--jade);
  color: var(--paper);
  font-weight: 500;
}

.nav-link.disabled {
  color: var(--ink-mute);
  opacity: 0.55;
  cursor: not-allowed;
  position: relative;
  padding-right: 18px;
}

.site-header {
  position: sticky;
  top: 0;
  height: var(--header-h);
  background: var(--paper);
  border-bottom: 1px solid var(--paper-line);
  z-index: 100;
  backdrop-filter: blur(8px);
}

.header-nav {
  display: flex;
  gap: 4px;
  align-items: center;
}

/* 用一个小圆点而不是溢出标签来表示"即将开放" */
.nav-link.disabled::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 2px var(--paper);
}

.nav-link.disabled:hover {
  opacity: 0.8;
}

/* 鼠标悬停时显示完整提示 (用title属性,浏览器默认tooltip) */

/* ============================================
   主体三栏布局
   ============================================ */
.layout {
  max-width: 1600px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--toc-w);
  min-height: calc(100vh - var(--header-h));
  position: relative;
}

/* ============================================
   左侧 Sidebar
   ============================================ */
.sidebar {
  border-right: 1px solid var(--paper-line);
  padding: 32px 0 32px 32px;
  position: sticky;
  top: var(--header-h);
  align-self: start;
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-title {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-mute);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ornament {
  font-family: var(--font-serif);
  color: var(--vermilion);
  font-size: 18px;
  font-weight: 400;
}

.chapter-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.chapter-item {
  padding: 12px 16px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.18s;
  display: flex;
  align-items: baseline;
  gap: 10px;
  position: relative;
  font-size: 14px;
  color: var(--ink-soft);
  user-select: none;
}

.chapter-item:hover {
  background: var(--paper-warm);
  color: var(--ink-deep);
}

.chapter-item.active {
  background: var(--jade-glow);
  color: var(--jade);
  font-weight: 500;
}

.chapter-item.active::before {
  content: '';
  position: absolute;
  left: -32px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: var(--vermilion);
  border-radius: 0 2px 2px 0;
}

.chapter-num {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 13px;
  color: var(--vermilion);
  min-width: 30px;
  letter-spacing: 0;
}

.chapter-item.active .chapter-num {
  color: var(--vermilion);
}

.chapter-name {
  flex: 1;
  line-height: 1.4;
}

.chapter-item.pending {
  opacity: 0.6;
}
.chapter-item.pending .chapter-name::after {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  margin-left: 6px;
  vertical-align: middle;
  opacity: 0.7;
}
.chapter-item.pending .chapter-num {
  opacity: 0.5;
}

.sidebar-footer {
  margin-top: 20px;
  padding: 16px 16px 0;
  border-top: 1px dashed var(--paper-line);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--ink-mute);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.progress-track {
  height: 4px;
  background: var(--paper-deep);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--jade), var(--jade-soft));
  width: 0%;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================
   中间内容区
   ============================================ */
.content {
  padding: 56px var(--content-pad) 120px;
  max-width: 880px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* —— 章节标题 —— */
.chapter-header {
  margin-bottom: 56px;
  padding-bottom: 28px;
  border-bottom: 2px solid var(--jade);
  position: relative;
}

.chapter-header::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background: var(--vermilion);
}

.chapter-label {
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: 6px;
  color: var(--vermilion);
  margin-bottom: 12px;
  font-weight: 500;
}

.chapter-title {
  font-family: var(--font-serif);
  font-size: 44px;
  font-weight: 700;
  color: var(--ink-deep);
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.chapter-title-en {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink-mute);
  letter-spacing: 1px;
  margin-bottom: 24px;
}

.chapter-meta {
  display: flex;
  gap: 24px;
  font-size: 13px;
  color: var(--ink-soft);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.meta-item strong {
  color: var(--jade);
  font-weight: 600;
}

/* —— 学习目标卡片 —— */
.objectives {
  background: var(--paper-warm);
  border-left: 4px solid var(--gold);
  padding: 24px 28px;
  margin: 0 0 56px;
  border-radius: 0 6px 6px 0;
  position: relative;
}

.objectives-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.objectives-title::before {
  content: '◆';
  font-size: 11px;
}

.objectives ul {
  list-style: none;
  padding: 0;
}

.objectives li {
  padding: 5px 0 5px 22px;
  position: relative;
  font-size: 14.5px;
  color: var(--ink-soft);
}

.objectives li::before {
  content: counter(obj-counter, decimal);
  counter-increment: obj-counter;
  position: absolute;
  left: 0;
  top: 5px;
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--gold);
  font-size: 13px;
}

.objectives ul {
  counter-reset: obj-counter;
}

/* —— 小节标题 —— */
.section {
  margin-bottom: 64px;
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.section-title {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--jade);
  margin-bottom: 8px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--paper-line);
}

.section-num {
  font-family: var(--font-serif);
  font-size: 38px;
  color: var(--vermilion);
  font-weight: 900;
  line-height: 0.9;
  opacity: 0.85;
}

.section-title-en {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-mute);
  font-weight: 400;
  margin-left: auto;
  letter-spacing: 0.5px;
}

.subsection-title {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  color: var(--ink-deep);
  margin: 36px 0 14px;
  padding-left: 14px;
  border-left: 3px solid var(--vermilion);
  scroll-margin-top: calc(var(--header-h) + 20px);
}

/* —— 正文段落 —— */
.section p {
  margin: 14px 0;
  font-size: 15.5px;
  line-height: 1.85;
  color: var(--ink-deep);
  text-align: justify;
}

.section p strong {
  color: var(--jade);
  font-weight: 600;
}

/* 英文术语样式 */
.term-en {
  font-family: var(--font-mono);
  font-size: 0.92em;
  color: var(--vermilion);
  font-weight: 500;
  background: var(--vermilion-bg);
  padding: 1px 6px;
  border-radius: 3px;
  letter-spacing: 0;
}

/* 关键词强调 */
.keyword {
  color: var(--vermilion);
  font-weight: 600;
  border-bottom: 1px dashed var(--vermilion-soft);
}

/* —— 代码块容器 —— */
.code-block {
  margin: 24px 0;
  background: var(--code-bg);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--code-border);
  box-shadow: 0 2px 12px rgba(26,41,37,0.08);
  position: relative;
}

.code-header {
  background: rgba(0,0,0,0.25);
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.code-lang {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(196, 221, 210, 0.7);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.code-copy {
  background: rgba(196,221,210,0.1);
  color: rgba(196,221,210,0.9);
  border: 1px solid rgba(196,221,210,0.2);
  padding: 3px 12px;
  font-size: 11px;
  border-radius: 3px;
  cursor: pointer;
  font-family: var(--font-mono);
  transition: all 0.2s;
  letter-spacing: 0.5px;
}

.code-copy:hover {
  background: rgba(196,221,210,0.2);
  color: var(--paper);
}

.code-copy.copied {
  background: var(--vermilion);
  color: white;
  border-color: var(--vermilion);
}

.code-block pre {
  margin: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 16px 20px !important;
  font-family: var(--font-mono) !important;
  font-size: 13.5px !important;
  line-height: 1.7 !important;
  color: #e8e8d8 !important;  /* 默认浅色文字,确保Prism未加载时也可读 */
  white-space: pre !important;
  overflow-x: auto;
}

.code-block code {
  font-family: var(--font-mono) !important;
  font-size: 13.5px !important;
  color: inherit;
  background: transparent !important;
  white-space: pre !important;
  padding: 0 !important;
  border: none !important;
}

/* 兜底:Prism token 颜色 */
.code-block .token.comment { color: #7c8a83 !important; font-style: italic; }
.code-block .token.keyword { color: #ff9b6c !important; font-weight: 500; }
.code-block .token.string  { color: #b4e08e !important; }
.code-block .token.number  { color: #f7d56e !important; }
.code-block .token.function { color: #80c8e8 !important; }
.code-block .token.class-name { color: #f0c674 !important; }
.code-block .token.operator { color: #c4ddd2 !important; }
.code-block .token.punctuation { color: #c4ddd2 !important; }

/* 自带高亮 token 颜色 (与上面 Prism 配色保持一致) */
.code-block .tok-kw   { color: #ff9b6c; font-weight: 500; }       /* 关键字:橙红 */
.code-block .tok-type { color: #f0c674; }                          /* 内建类型:金黄 */
.code-block .tok-str  { color: #b4e08e; }                          /* 字符串:绿 */
.code-block .tok-num  { color: #f7d56e; }                          /* 数字:黄 */
.code-block .tok-cmt  { color: #7c8a83; font-style: italic; }      /* 注释:灰绿 */
.code-block .tok-fn   { color: #80c8e8; }                          /* 函数名:蓝 */
.code-block .tok-op   { color: #c4ddd2; }                          /* 运算符:浅青 */
.code-block .tok-pre  { color: #d99cc8; }                          /* 预处理:粉紫 */

/* —— 内联代码 —— */
:not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--paper-deep);
  color: var(--jade);
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid var(--paper-line);
}

/* —— 提示框 —— */
.note {
  margin: 24px 0;
  padding: 18px 22px 18px 56px;
  border-radius: 6px;
  position: relative;
  font-size: 14.5px;
  line-height: 1.75;
}

.note::before {
  position: absolute;
  left: 20px;
  top: 18px;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.note-info {
  background: var(--jade-glow);
  color: var(--jade);
  border-left: 4px solid var(--jade);
}
.note-info::before {
  content: 'i';
  font-style: italic;
  background: var(--jade);
  color: var(--paper);
}

.note-warn {
  background: var(--vermilion-bg);
  color: #8a3220;
  border-left: 4px solid var(--vermilion);
}
.note-warn::before {
  content: '!';
  background: var(--vermilion);
  color: var(--paper);
}

.note-tip {
  background: var(--gold-bg);
  color: #7a5a28;
  border-left: 4px solid var(--gold);
}
.note-tip::before {
  content: '✓';
  font-size: 14px;
  background: var(--gold);
  color: var(--paper);
}

.note strong {
  color: inherit;
  font-weight: 700;
}

/* —— 列表 —— */
.section ul, .section ol {
  margin: 14px 0 14px 8px;
  padding-left: 24px;
}

.section ul li, .section ol li {
  margin: 6px 0;
  line-height: 1.8;
}

.section ul li::marker {
  color: var(--vermilion);
}

.section ol li::marker {
  color: var(--vermilion);
  font-weight: 700;
  font-family: var(--font-serif);
}

/* —— 定义格式 / 语法盒子 —— */
.syntax-box {
  margin: 20px 0;
  padding: 22px 24px 18px;
  background: linear-gradient(135deg, var(--paper-warm), var(--paper-deep));
  border: 1px solid var(--paper-line);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--ink-deep);
  line-height: 1.9;
  position: relative;
  overflow: visible;
  white-space: pre-wrap;
  word-break: break-word;
}

.syntax-box::before {
  content: '语法格式';
  position: absolute;
  top: -10px;
  left: 16px;
  background: var(--paper);
  padding: 2px 10px;
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--jade);
  font-weight: 600;
  letter-spacing: 2px;
  border: 1px solid var(--paper-line);
  border-radius: 3px;
}

/* —— 表格 —— */
.section table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
}

.section table th, .section table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--paper-line);
}

.section table th {
  background: var(--paper-warm);
  font-weight: 700;
  color: var(--jade);
  border-bottom: 2px solid var(--jade);
}

.section table tr:hover td {
  background: var(--paper-warm);
}

/* ============================================
   待开放页面
   ============================================ */
.pending-page {
  text-align: center;
  padding: 120px 40px;
}
.pending-icon {
  font-size: 64px;
  margin-bottom: 24px;
  opacity: 0.6;
}
.pending-title {
  font-family: var(--font-serif);
  font-size: 26px;
  color: var(--jade);
  margin-bottom: 16px;
}
.pending-text {
  color: var(--ink-mute);
  font-size: 15px;
  line-height: 2;
}

/* ============================================
   右侧 TOC
   ============================================ */
.toc-panel {
  border-left: 1px solid var(--paper-line);
  padding: 56px 24px 32px;
  position: sticky;
  top: var(--header-h);
  align-self: start;
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
}

.toc-title {
  font-family: var(--font-serif);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-mute);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.toc-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-left: 1px solid var(--paper-line);
}

.toc-item {
  padding: 6px 0 6px 14px;
  font-size: 12.5px;
  color: var(--ink-soft);
  cursor: pointer;
  border-left: 2px solid transparent;
  margin-left: -1px;
  transition: all 0.18s;
  line-height: 1.5;
  user-select: none;
}

.toc-item:hover {
  color: var(--jade);
}

.toc-item.active {
  color: var(--vermilion);
  border-left-color: var(--vermilion);
  font-weight: 500;
}

.toc-item.toc-sub {
  padding-left: 26px;
  font-size: 11.5px;
  color: var(--ink-mute);
}

.toc-divider {
  height: 1px;
  background: var(--paper-line);
  margin: 24px 0;
}

.toc-tip {
  padding: 14px;
  background: var(--paper-warm);
  border-radius: 6px;
  border-left: 3px solid var(--gold);
}

.tip-label {
  font-family: var(--font-serif);
  font-size: 11px;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.toc-tip p {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.7;
}

.toc-tip strong {
  color: var(--vermilion);
}

/* ============================================
   滚动条
   ============================================ */
.sidebar::-webkit-scrollbar,
.toc-panel::-webkit-scrollbar {
  width: 6px;
}
.sidebar::-webkit-scrollbar-thumb,
.toc-panel::-webkit-scrollbar-thumb {
  background: var(--paper-deep);
  border-radius: 3px;
}
.sidebar::-webkit-scrollbar-thumb:hover,
.toc-panel::-webkit-scrollbar-thumb:hover {
  background: var(--jade-glow);
}

/* ============================================
   响应式
   ============================================ */
@media (max-width: 1280px) {
  .toc-panel { display: none; }
  .layout { grid-template-columns: var(--sidebar-w) 1fr; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 0px; --content-pad: 24px; }
  .layout { grid-template-columns: 1fr; }
  .header-nav { display: none; }
  .chapter-title { font-size: 32px; }
  .section-title { font-size: 22px; }
  .section-num { font-size: 28px; }

  /* Sidebar 变成抽屉 */
  .sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    height: calc(100vh - var(--header-h));
    width: 288px;
    z-index: 250;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 24px 0 24px 24px;
    box-shadow: 4px 0 24px rgba(26,41,37,0.15);
    border-right: none;
  }

  .sidebar.drawer-open {
    transform: translateX(0);
  }

  /* 在抽屉内调整活动指示器位置 */
  .sidebar .chapter-item.active::before {
    left: -24px;
  }

  /* 汉堡按钮 */
  .mobile-menu-btn { display: flex; }

  /* 底部导航 */
  .mobile-bottom-nav { display: flex; }

  /* 内容区底部留出空间给底栏 */
  .content { padding-bottom: 88px; }
}

/* ============================================
   手机汉堡按钮
   ============================================ */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--paper-line);
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--ink-deep);
  transition: background 0.2s;
}

.mobile-menu-btn:hover {
  background: var(--paper-warm);
}

/* ============================================
   蒙层遮罩
   ============================================ */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26,41,37,0.45);
  z-index: 200;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.mobile-overlay.show { display: block; }

/* ============================================
   手机底部导航栏
   ============================================ */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--paper);
  border-top: 1px solid var(--paper-line);
  z-index: 100;
  align-items: stretch;
  /* iOS safe area */
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 12px rgba(26,41,37,0.07);
}

.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink-mute);
  transition: color 0.2s;
  padding: 8px 4px;
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item.active {
  color: var(--jade);
}

.mobile-nav-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.mobile-nav-label {
  font-size: 10px;
  font-family: var(--font-sans);
  letter-spacing: 0.3px;
  font-weight: 500;
}

/* ============================================
   动画
   ============================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.chapter-header,
.objectives,
.section {
  animation: fadeUp 0.5s ease-out backwards;
}
.objectives { animation-delay: 0.08s; }
.section:nth-of-type(1) { animation-delay: 0.16s; }
.section:nth-of-type(2) { animation-delay: 0.20s; }
.section:nth-of-type(3) { animation-delay: 0.24s; }
.section:nth-of-type(4) { animation-delay: 0.28s; }
.section:nth-of-type(5) { animation-delay: 0.32s; }
