/* ============================================================
   自驾圈 - 移动端底部 TabBar（统一版）
   四页共用：mobile.html / myguides.html / community.html / profile.html

   ⚠️ 维护注意（血泪教训，2026-09-16）：
   本文件及其引用页面，任何挂在 <body> 上的动画都【禁止】包含 transform
   （哪怕 transform: translateY(0)）。因为元素一旦有 transform，就会成为
   后代 position:fixed 元素的 containing block，导致 TabBar / 顶部导航 /
   弹窗等全部从"吸屏幕"降级成"吸页面"，跑到网页最底部去。
   淡入淡出只允许用 opacity。
   ============================================================ */

.tabbar {
  position: fixed;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  left: 12px;
  right: 12px;
  width: calc(100% - 24px);
  z-index: 200;                     /* 低于弹层(300+)，避免压住弹窗/抽屉按钮 */
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 8px 0;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  box-shadow: 0 -4px 24px rgba(15, 23, 42, .15);
  transition: transform .28s cubic-bezier(.4, 0, .2, 1), opacity .28s ease;
}

/* 向下滚动时隐藏 / 向上滚动时出现（由 tabbar.js 切换） */
.tabbar.tabbar-hidden {
  transform: translateY(160%);
  opacity: 0;
  pointer-events: none;
}

.tabbar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 44px;
  min-height: 44px;
  padding: 4px 12px;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.2;
  text-decoration: none;
  transition: color .15s ease;
}

.tabbar-item.active { color: var(--brand-primary, #f5b942); }

.tabbar-item-icon { display: flex; align-items: center; font-size: 22px; }

.tabbar-item-label { font-weight: 500; }

/* 宽屏（桌面预览）：限宽居中 */
@media (min-width: 768px) {
  .tabbar {
    left: 50%;
    right: auto;
    width: 400px;
    max-width: 400px;
    transform: translateX(-50%);
  }
  .tabbar.tabbar-hidden { transform: translate(-50%, 160%); }
}
