/* ══════════════════════════════════════════════════════════
   玄机 · 顶栏与底栏（导航层）
   nav.css

   为什么单独做一个文件：
   app.html 里 .tabbar.ios-tabbar 的规则被重复定义了 5-6 次，
   还有 transition:none 覆盖 transition:transform 420ms 的自相矛盾。
   直接改原文件会陷入优先级战争。
   本文件挂在最后，用最高特异性接管，删掉即回滚。

   规则（WWDC25）：
   · 玻璃只用于导航层 —— 这里就是
   · 玻璃上不叠玻璃 —— lens 用实色玉
   · 只给主操作上色 —— lens 是唯一着色处
   ══════════════════════════════════════════════════════════ */

/* ── 底栏：玻璃 + 玉色 lens ── */
html body .tabbar.ios-tabbar{
  position:fixed !important;
  left:16px !important;
  right:16px !important;
  bottom:calc(14px + env(safe-area-inset-bottom)) !important;
  height:66px !important;
  padding:5px !important;
  border-radius:33px !important;

  /* 玻璃：深底半透 + 强模糊，不加外描边 */
  background:rgba(16,26,25,.52) !important;
  border:0 !important;
  -webkit-backdrop-filter:blur(36px) saturate(180%) !important;
  backdrop-filter:blur(36px) saturate(180%) !important;

  /* 层次全靠内高光与外投影，不靠 border */
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.10),
    inset 0 -1px 0 rgba(0,0,0,.30),
    0 22px 50px -18px rgba(0,0,0,.92),
    0 0 0 .5px rgba(200,220,210,.07) !important;

  z-index:80 !important;
  overflow:visible !important;
}

/* 亮色主题下换浅玻璃 */
html[data-theme="day"] body .tabbar.ios-tabbar{
  background:rgba(255,255,255,.74) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.9),
    inset 0 -1px 0 rgba(120,100,70,.06),
    0 18px 40px -16px rgba(40,52,40,.20),
    0 0 0 .5px rgba(27,33,30,.06) !important;
}

/* ── 内层：纯容器，不再叠玻璃 ── */
html body .tabbar.ios-tabbar .tabbar-inner{
  position:relative !important;
  display:flex !important;
  height:100% !important;
  background:transparent !important;
  border:0 !important;
  border-radius:0 !important;
  box-shadow:none !important;
  -webkit-backdrop-filter:none !important;
  backdrop-filter:none !important;
  padding:0 !important;
  gap:0 !important;
}

/* ── lens：实色玉色渐变（规则2：玻璃上不叠玻璃），同心圆角 ── */
html body .tabbar.ios-tabbar .lens{
  position:absolute !important;
  top:5px !important;
  left:5px !important;
  height:calc(100% - 10px) !important;
  width:calc((100% - 10px) / 5) !important;
  border-radius:28px !important;

  background:linear-gradient(165deg,#6FC9A9 0%,#4FA98C 46%,#2A6B57 100%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.38),
    0 10px 26px -10px rgba(79,169,140,.85) !important;

  transform:translateX(calc(var(--i,0) * 100%)) !important;
  transition:transform 440ms cubic-bezier(.32,1.26,.6,1) !important;
  z-index:0 !important;
  pointer-events:none !important;
}
html body .tabbar.ios-tabbar .lens::after{
  background:transparent !important;
  content:none !important;
}

/* ── 每个 tab ── */
html body .tabbar.ios-tabbar .tab,
html body .tabbar.ios-tabbar .tab-item{
  position:relative !important;
  z-index:1 !important;
  flex:1 1 0 !important;
  min-width:0 !important;
  border:0 !important;
  background:transparent !important;
  cursor:pointer !important;

  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
  gap:3px !important;

  color:rgba(200,220,210,.52) !important;
  font-family:inherit !important;
  font-size:9.5px !important;
  letter-spacing:.1em !important;
  transition:color .3s ease !important;
  -webkit-tap-highlight-color:transparent;
}

html[data-theme="day"] body .tabbar.ios-tabbar .tab,
html[data-theme="day"] body .tabbar.ios-tabbar .tab-item{
  color:rgba(27,33,30,.42) !important;
}

/* 图标 */
html body .tabbar.ios-tabbar .tab .tab-ico,
html body .tabbar.ios-tabbar .tab-item .tab-ico{
  display:grid !important;
  place-items:center !important;
  width:22px !important;
  height:22px !important;
  line-height:1 !important;
  transition:transform .3s ease !important;
}
html body .tabbar.ios-tabbar .tab .tab-ico svg,
html body .tabbar.ios-tabbar .tab-item .tab-ico svg{
  width:21px !important;
  height:21px !important;
  display:block !important;
}

/* 文字 */
html body .tabbar.ios-tabbar .tab .tab-label,
html body .tabbar.ios-tabbar .tab-item .tab-label{
  font-size:9.5px !important;
  line-height:1 !important;
  letter-spacing:.1em !important;
  transition:color .3s ease !important;
}

/* 选中：深色文字（压在玉色 lens 上） */
html body .tabbar.ios-tabbar .tab.on,
html body .tabbar.ios-tabbar .tab-item.on{
  color:#04120D !important;
}
html body .tabbar.ios-tabbar .tab.on .tab-ico,
html body .tabbar.ios-tabbar .tab-item.on .tab-ico{
  transform:translateY(-.5px) scale(1.05) !important;
}

/* 按下反馈 */
html body .tabbar.ios-tabbar .tab:active .tab-ico,
html body .tabbar.ios-tabbar .tab-item:active .tab-ico{
  transform:scale(.9) !important;
}

/* 历史面板打开时隐藏（沿用原逻辑） */
html body.sp-history-open .tabbar{
  display:none !important;
}

/* ── 底栏上方淡出，分隔浮动控件与滚动内容 ── */
html body .tabbar.ios-tabbar::before{
  content:"" !important;
  position:fixed !important;
  left:0 !important;
  right:0 !important;
  bottom:0 !important;
  height:132px !important;
  z-index:-1 !important;
  pointer-events:none !important;
  background:linear-gradient(to top,
    rgba(8,11,12,.92) 6%,
    rgba(8,11,12,.66) 42%,
    transparent 100%) !important;
}
html[data-theme="day"] body .tabbar.ios-tabbar::before{
  background:linear-gradient(to top,
    rgba(246,244,239,.94) 6%,
    rgba(246,244,239,.68) 42%,
    transparent 100%) !important;
}

@media (prefers-reduced-motion:reduce){
  html body .tabbar.ios-tabbar .lens,
  html body .tabbar.ios-tabbar .tab,
  html body .tabbar.ios-tabbar .tab-ico{
    transition:none !important;
  }
}
