/* ============================================================
   分子胶 AI 课程 · 顶栏叠加层（仅 02/05/06）
   目标：给保留自有设计（深色侧栏+hero）的章节，叠加与其它章节
         一致的「统一顶栏」，但不隐藏其侧栏、不改其配色。
   依赖：同页加载 site-nav.css —— 复用 .crs-topbar/.crs-brand/
         .crs-chapters 样式与 --crs-* 变量。
   关键：本层只挂在 html.ctb-on 上，绝不添加 .crs-on / .page-XX，
         因此 site-nav.css 里隐藏旧侧栏 / 换色 / 折叠栅格的规则都不会触发。
   ============================================================ */

/* 平滑滚动时为固定顶栏留白 */
html.ctb-on { scroll-padding-top: calc(var(--crs-nav-h) + 12px); }

/* 给固定顶栏让出顶部高度 */
html.ctb-on body { padding-top: var(--crs-nav-h) !important; }

/* 各页侧栏（sticky; top:0; height:100vh）下移一个栏高，避免被顶栏遮住 */
html.ctb-on .sidebar {
  top: var(--crs-nav-h) !important;
  height: calc(100vh - var(--crs-nav-h)) !important;
}

/* 各页自带的固定阅读进度条移到顶栏之下 */
html.ctb-on .prog,
html.ctb-on #progress { top: var(--crs-nav-h) !important; }

/* 锚点跳转（#id）为顶栏预留偏移，标题不被遮挡 */
html.ctb-on [id] { scroll-margin-top: calc(var(--crs-nav-h) + 14px); }

/* 移动端：各页固定「☰ 目录」按钮下移，避免压在顶栏上 */
@media (max-width: 980px) {
  html.ctb-on .menu-btn { top: calc(var(--crs-nav-h) + 12px) !important; }
}
