/* ===== 液态玻璃底部导航（全站共享版）=====
   index.html / sects.html 自带内联版导航，不引本文件；
   其余页面引入 glass-nav.css + glass-nav.js，由 JS 注入导航 DOM。
   选中项 = 比容器更暗的灰玻璃药丸（对齐 App Store 实拍）。 */
.top-nav{
  position:fixed;left:50%;right:auto;bottom:calc(12px + env(safe-area-inset-bottom,0px));
  z-index:120;box-sizing:border-box;
  width:min(calc(100% - 24px),560px);
  --np:6px;
  height:64px;padding:var(--np);gap:0;
  transform:translateX(-50%) translateZ(0);       /* 居中 + 独立合成层，滚动时不抖动 */
  display:flex;align-items:stretch;
  border-radius:30px;
  overflow:hidden;isolation:isolate;
  /* 透明磨砂：白层很淡，靠 blur + brightness(.955)（比页面暗约 4%）透出玻璃边界 */
  background:
    linear-gradient(112deg,rgba(255,255,255,0) 34%,rgba(255,255,255,.18) 44%,rgba(255,255,255,.03) 54%,rgba(255,255,255,0) 66%),
    linear-gradient(168deg,rgba(255,255,255,.16) 0%,rgba(255,255,255,.07) 46%,rgba(255,255,255,.12) 100%);
  border:1px solid rgba(255,255,255,.70);
  border-bottom-color:rgba(176,152,116,.16);
  -webkit-backdrop-filter:blur(26px) saturate(190%) brightness(.955);
  backdrop-filter:blur(26px) saturate(190%) brightness(.955);
  box-shadow:
    0 18px 40px -8px rgba(46,33,16,.26),
    0 5px 12px -3px rgba(46,33,16,.13),
    0 0 0 .5px rgba(120,98,66,.10),
    inset 0 1px 0 rgba(255,255,255,.62),
    inset 0 -1px 0 rgba(150,128,96,.14);
}
/* 镜面层：上缘一道白光 + 底部暖色回光，模拟玻璃的厚度与折射 */
.top-nav::before{
  content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;z-index:0;
  background:
    linear-gradient(180deg,rgba(255,255,255,.62) 0%,rgba(255,255,255,.14) 10%,rgba(255,255,255,0) 34%),
    radial-gradient(150% 60% at 50% 126%,rgba(255,226,178,.18) 0%,rgba(255,255,255,0) 60%),
    radial-gradient(100% 100% at 50% 50%,rgba(255,255,255,0) 66%,rgba(255,255,255,.14) 100%);
}
/* 下缘折射亮边，让玻璃有边界感，不至于糊在页面内容上 */
.top-nav::after{
  content:"";position:absolute;left:0;right:0;bottom:0;height:1px;pointer-events:none;z-index:1;
  background:linear-gradient(90deg,rgba(255,255,255,0) 0%,rgba(255,255,255,.7) 26%,rgba(255,255,255,.7) 74%,rgba(255,255,255,0) 100%);
}
/* 老浏览器没有 backdrop-filter，退回接近实色的纸面 */
@supports not ((backdrop-filter:blur(2px)) or (-webkit-backdrop-filter:blur(2px))){
  .top-nav{background:linear-gradient(168deg,rgba(255,255,255,.97),rgba(252,250,245,.94))}
}
/* 系统开了「减弱透明度」就退回厚实底，跟 iOS 行为一致 */
@media (prefers-reduced-transparency:reduce){
  .top-nav{background:linear-gradient(168deg,#fdfcf9,#f7f4ee);-webkit-backdrop-filter:none;backdrop-filter:none}
  .nav-pill{background:#fff}
}
.bn-item{
  position:relative;z-index:1;flex:1 1 0;min-width:0;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
  background:none;border:none;cursor:pointer;font-family:inherit;
  text-decoration:none;color:#17181c;padding:0;border-radius:24px;
  text-shadow:0 0 1px rgba(255,255,255,.8),0 0 5px rgba(255,255,255,.7);
  -webkit-tap-highlight-color:transparent;
  transition:color .22s,transform .18s cubic-bezier(.22,.8,.24,1);
}
/* 选中态：一枚会滑动的玻璃药丸（位置由 --ni 控制） */
.nav-pill{
  box-sizing:border-box; /* wiki 系页面没有全局 border-box 重置，不补会多出边框宽度、滑过头 */
  position:absolute;top:var(--np);bottom:var(--np);left:var(--np);z-index:0;
  width:calc((100% - var(--np)*2)/4);border-radius:22px;pointer-events:none;
  background:linear-gradient(180deg,rgba(150,140,124,.44) 0%,rgba(124,114,96,.38) 100%);
  border:1px solid rgba(255,255,255,.30);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.55),
    inset 0 -1px 0 rgba(255,255,255,.16),
    0 1px 3px rgba(60,45,25,.10);
  transform:translateX(calc(var(--ni,0)*100%));
  transition:transform .34s cubic-bezier(.3,1.18,.36,1),opacity .2s;
}
@media (prefers-reduced-motion:reduce){.nav-pill{transition:none}}
/* 无选中页（赛季说明/下载教程/玩家必看）：四个按钮都不选定，药丸隐藏 */
.top-nav.no-act .nav-pill{opacity:0}
.bn-item:focus-visible{outline:2px solid rgba(196,136,58,.75);outline-offset:-3px}
.bn-item:active{transform:scale(.95)}
.bn-item.active:active{transform:scale(.97)}
/* 图标：自绘线性图标，未选中 = 黑色线稿；选中 = 蓝色填充 + 白色细节 */
.bn-ic{
  width:22px;height:22px;flex-shrink:0;overflow:visible;
  filter:drop-shadow(0 1px 1px rgba(255,255,255,.35));
  transition:transform .24s cubic-bezier(.22,.8,.24,1);
}
.bn-ic .ic-b{fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.bn-ic .ic-d{fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.bn-item.active .bn-ic{transform:scale(1.08);animation:icPop .34s cubic-bezier(.3,1.4,.4,1)}
/* 初始加载（.gn-boot）不播 icPop：直接打开页面不该有「刚切换到这个标签」的弹跳，真实点按后才启用 */
.top-nav.gn-boot .bn-item.active .bn-ic{animation:none}
/* .gn-boot 期间药丸也不许滑：慢网络渐进渲染下，init 可能在首绘后才设 --ni，
   不禁用过渡会看到药丸从「首页」滑到目标位（伪「从首页切换过来」）。任何真实交互解除 boot */
.top-nav.gn-boot .nav-pill{transition:none}
.bn-item.active .bn-ic .ic-b{fill:currentColor;stroke:currentColor;stroke-width:1.4}
.bn-item.active .bn-ic .ic-d{stroke:#fff}
@keyframes icPop{0%{transform:scale(.8)}60%{transform:scale(1.16)}100%{transform:scale(1.08)}}
.bn-item span{
  font-size:.70rem;font-weight:700;letter-spacing:.03em;line-height:1;
  max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  transition:color .22s;
}
.bn-item.active{color:#0a7cff}
.bn-item.active span{color:#0a7cff;font-weight:800;text-shadow:0 0 1px rgba(255,255,255,.95),0 0 6px rgba(255,255,255,.85)}
/* 给页面底部让出浮动导航的高度（index/sects 加在 .main 上，这里加在 body 上） */
body.gn-on{padding-bottom:calc(88px + env(safe-area-inset-bottom,0px))}
@media (min-width:961px){
  .top-nav{width:min(calc(100% - 32px),600px);--np:7px;height:66px;padding:var(--np)}
  .bn-ic{width:24px;height:24px}
  .bn-item span{font-size:.82rem}
  body.gn-on{padding-bottom:100px}
}
/* 弹窗/目录锁滚动时视口放宽 pad px，fixed 元素居中点会右移 pad/2，这里补回来。
   evt-lock：index/sects/conv_7 的活动弹层；wiki-menu-lock：wiki 系页面的百科目录（wiki-detail.js 写入同一变量） */
html.evt-lock .top-nav,html.wiki-menu-lock .top-nav{transform:translateX(calc(-50% - var(--evt-pad,0px) / 2)) translateZ(0)}
/* ===== 页面切换动画：进入淡入，跳转前淡出 =====
   只动 opacity！transform/filter 会让 fixed 导航、sticky 表头失去定位参照。
   注意 fill:both 的动画填充会压过普通声明和 transition，
   所以离开淡出也必须用 keyframes 动画（gnOut），不能用 transition。 */
@keyframes gnIn{from{opacity:0}to{opacity:1}}
@keyframes gnOut{to{opacity:0}}
body{animation:gnIn .42s cubic-bezier(.22,.8,.24,1) both}
body.is-leaving{animation:gnOut .19s ease both}
@media (prefers-reduced-motion:reduce){
  body,body.is-leaving{animation:none}
}
