/* ===== 移动端底部导航（2026-11-16） =====
   仅 ≤768px 显示；桌面端完全不受影响。body 的底部内边距由 JS 加类触发，
   避免无 JS 时页面被多留一条空白。 */
.lt-bn { display: none; }

@media (max-width: 768px) {
  .lt-bn {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0;
    z-index: 900; /* 低于导航栏(1000)/Wiki 抽屉(999·1001)/弹窗(9999)，避免盖住抽屉与模态框 */
    background: #171c39;
    border-top: 1px solid rgba(255, 255, 255, .09);
    box-shadow: 0 -6px 22px rgba(0, 0, 0, .28);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    -webkit-tap-highlight-color: transparent;
  }
  .lt-bn a {
    flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 4px 2px;
    color: rgba(255, 255, 255, .68);
    text-decoration: none;
    font-size: 11px; line-height: 1.1; font-weight: 600;
    border-radius: 8px;
  }
  .lt-bn a svg { width: 22px; height: 22px; display: block; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  .lt-bn a.is-active { color: #8fd486; }
  .lt-bn a:active { background: rgba(255, 255, 255, .07); }
  .lt-bn a:focus-visible { outline: 2px solid #8fd486; outline-offset: -2px; }

  body.lt-bn-on { padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px)); }

  /* Wiki 目录抽屉从顶部铺到底部，给底栏留出空间，否则最后几项会压在底栏下面 */
  body.lt-bn-on .wiki-sidebar { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  /* Wiki「返回顶部」原本 bottom:16px，正好落在底栏里，抬到底栏上方 */
  body.lt-bn-on #wikiBackToTop { bottom: calc(74px + env(safe-area-inset-bottom, 0px)) !important; }

  /* 输入框聚焦（手机软键盘弹出）时收起底栏，避免挡住正在填的字段 */
  .lt-bn { transition: transform .18s ease; }
  body.lt-bn-input .lt-bn { transform: translateY(110%); }
}

@media (prefers-reduced-motion: reduce) {
  .lt-bn { transition: none; }
}
