/* ============================================================
   TOC 目录修正 (custom inject)
   ------------------------------------------------------------
   1) 吸顶避让浮动导航: 导航 fixed 于视口顶部 12px、高 54px
      (底边 66px), 主题默认 .sticky_layout top:20px 会被其遮住
      目录上半部分 → 吸顶位下调到 78px(66 + 12 间距)。
   2) 右上角数字样式: 原滚动百分比(斜体 140%)已改为显示当前
      章节层级编号(1 / 1.1 / 1.1.1, main.js 维护), 此处给出
      配套观感: 等宽小数字、正常字重、主题蓝, 空内容时隐藏。
   ============================================================ */

/* 桌面端吸顶位: 避让浮动导航底边 66px */
@media (min-width: 901px) {
  #aside-content .sticky_layout {
    top: 78px !important;
  }
}

/* 右上角章节号 */
#card-toc .item-headline .toc-percentage {
  float: right;
  margin-top: -11px;
  font-style: normal;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  color: #6e84ab;
  user-select: none;
}

html[data-theme='dark'] #card-toc .item-headline .toc-percentage {
  color: #8fa4cf;
}

/* 无激活章节时(页首/未滚动)隐藏占位 */
#card-toc .item-headline .toc-percentage:empty {
  display: none;
}

/* ============================================================
   锚点跳转避让固定导航 (scroll-margin-top)
   ------------------------------------------------------------
   导航 fixed 于视口顶 12px、高 54px → 底边 66px；
   给文章内锚点标题设 scroll-margin-top，让浏览器原生锚点滚动
   (URL 带 # 直接访问 / 其它锚点跳转) 自动让出导航高度，
   标题精准落位在导航下方。
   注意: 主题 btf.scrollToDest 走 JS 手动 scrollTo，不经原生锚点，
   故对 TOC 点击的场景由 anchor-offset.js patch 处理，此处兜
   原生/第三方锚点与带哈希直访。
   ============================================================ */
#article-container h1[id],
#article-container h2[id],
#article-container h3[id],
#article-container h4[id],
#article-container h5[id],
#article-container h6[id],
.post-content h1[id],
.post-content h2[id],
.post-content h3[id],
.post-content h4[id],
.post-content h5[id],
.post-content h6[id] {
  scroll-margin-top: 74px;
}
