/* 全站侧边栏目录（TOC）——桌面侧边栏 + 移动端折叠按钮 */
.toc-rail{
  position:fixed;top:104px;left:16px;width:238px;max-height:calc(100vh - 148px);
  overflow-y:auto;background:rgba(247,245,239,.97);border:1px solid #E2DCC8;
  border-radius:14px;padding:14px 10px 12px;z-index:900;
  font-family:"Noto Sans SC",system-ui,-apple-system,sans-serif;
  box-shadow:0 6px 24px rgba(46,75,61,.10);
  scrollbar-width:thin;scrollbar-color:#C9C0A8 transparent;
}
.toc-rail::-webkit-scrollbar{width:5px;}
.toc-rail::-webkit-scrollbar-thumb{background:#C9C0A8;border-radius:4px;}
.toc-head{
  font-size:12.5px;font-weight:700;color:#2E4B3D;letter-spacing:.5px;
  display:flex;align-items:center;gap:8px;padding:2px 44px 10px 10px;
  border-bottom:1px solid #EFE9D8;margin-bottom:8px;
}
.toc-head svg{width:15px;height:15px;stroke:#B98A2F;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex:none;}
.toc-rail nav ul{list-style:none;margin:0;padding:0;}
.toc-rail nav > ul > li{margin:1px 0;}
.toc-rail nav a{
  display:block;padding:4.5px 10px;border-radius:8px;font-size:13px;color:#3E5A4C;
  text-decoration:none;line-height:1.55;transition:background .15s,color .15s;
}
.toc-rail nav a:hover{background:#EFEBDC;color:#2E4B3D;}
.toc-rail nav a.active{background:#2E4B3D;color:#F7F5EF;font-weight:600;}
.toc-rail nav ul ul a{padding-left:24px;font-size:12.3px;color:#6B7F73;border-left:1px solid #E7E1CC;margin-left:10px;border-radius:0 8px 8px 0;}
.toc-rail nav ul ul a:hover{color:#2E4B3D;background:#EFEBDC;}
.toc-rail nav ul ul a.active{background:#2E4B3D;color:#F7F5EF;}

/* 滚动锚点偏移（顶部导航高度） */
.chapter,.module,.chapter h3.sec,.module h3.sec{scroll-margin-top:102px;}

/* 移动端：折叠成按钮 + 抽屉 */
.toc-fab{
  display:none;position:fixed;left:16px;bottom:16px;width:48px;height:48px;
  border-radius:14px;background:#2E4B3D;border:1px solid #B98A2F;
  box-shadow:0 8px 24px rgba(46,75,61,.35);z-index:950;cursor:pointer;
  align-items:center;justify-content:center;padding:0;
}
.toc-fab svg{width:22px;height:22px;stroke:#F7F5EF;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}
.toc-fab:hover{background:#38594A;}
.toc-fab .fab-dot{position:absolute;top:-4px;right:-4px;width:18px;height:18px;border-radius:50%;background:#B98A2F;color:#2E4B3D;font-size:11px;font-weight:800;display:flex;align-items:center;justify-content:center;border:2px solid #F7F5EF;}
.toc-mask{display:none;position:fixed;inset:0;background:rgba(20,30,24,.45);z-index:955;}
.toc-close{
  display:flex;position:absolute;top:8px;right:8px;width:26px;height:26px;padding:0;
  border:none;background:transparent;border-radius:8px;cursor:pointer;
  align-items:center;justify-content:center;color:#7a7a72;transition:background .15s,color .15s;
}
.toc-close:hover{background:#EFEBDC;color:#2E4B3D;}
.toc-close svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;}

/* 用户主动隐藏目录：无论桌面/移动端，rail 隐藏，FAB 显示 */
body.toc-hidden .toc-rail{display:none !important;}
body.toc-hidden .toc-fab{display:flex;}

@media (max-width:1280px){
  .toc-rail{display:none;}
  .toc-fab{display:flex;}
  .toc-mask{display:none;}
  body.toc-open .toc-mask{display:block;}
  body.toc-open .toc-rail{
    display:block;position:fixed;top:0;right:0;bottom:0;width:min(300px,84vw);
    max-height:none;border-radius:0;border:none;border-left:1px solid #E2DCC8;
    z-index:960;overflow-y:auto;padding:58px 12px 24px;box-shadow:-8px 0 30px rgba(46,75,61,.25);
  }
  body.toc-open .toc-close{display:flex;}
  body.toc-open{overflow:hidden;}
}
@media (max-width:480px){
  .toc-fab{bottom:14px;right:12px;}
}

/* ===== 面包屑导航条（导航栏下方） ===== */
.crumb-bar{
  display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;
  background:#EFEBDC;border-bottom:1px solid #E2DCC8;padding:7px 26px;
  font-family:"Noto Sans SC","PingFang SC",system-ui,sans-serif;font-size:12.5px;
}
.crumb-path{display:flex;align-items:center;flex-wrap:wrap;gap:2px;min-width:0;}
.crumb-path a{color:#2E4B3D;text-decoration:none;font-weight:600;transition:color .15s;}
.crumb-path a:hover{color:#B98A2F;text-decoration:underline;}
.crumb-sep{color:#B98A2F;margin:0 4px;font-weight:700;}
.crumb-cur{color:#6B7F73;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:46vw;}
@media (max-width:640px){
  .crumb-bar{padding:6px 14px;font-size:12px;}
}


/* 面包屑统一：不换行，左对齐 */
.crumb-bar{display:flex !important;align-items:center !important;flex-wrap:nowrap !important;padding:7px 16px !important;}
.crumb-path{display:flex !important;align-items:center !important;flex-wrap:nowrap !important;white-space:nowrap !important;overflow:hidden !important;}
.crumb-cur{max-width:none !important;overflow:visible !important;text-overflow:clip !important;}

/* 强制面包屑左内边距 */
.crumb-bar{padding-left:16px !important;padding-right:16px !important !important;}

