/* 亿万号 · 移动端底部导航栏（≤720px 显示，全站通用） */

.mobile-tabbar{display:none}
.bottom-drawer[hidden]{display:none}
.bottom-drawer{display:none}

@media(max-width:720px){
  /* 为固定底栏留出空间，含 iPhone 安全区 */
  body{padding-bottom:calc(64px + env(safe-area-inset-bottom,0px))}

  .mobile-tabbar{
    display:flex;position:fixed;left:0;right:0;bottom:0;z-index:95;
    height:calc(60px + env(safe-area-inset-bottom,0px));
    padding-bottom:env(safe-area-inset-bottom,0px);
    background:rgba(255,255,255,.96);
    -webkit-backdrop-filter:saturate(180%) blur(14px);
    backdrop-filter:saturate(180%) blur(14px);
    border-top:1px solid var(--line);
    box-shadow:0 -6px 22px rgba(16,35,63,.07);
    transform:translateZ(0);  /* GPU 合成，滚动时不闪烁 */
  }
  .mobile-tabbar a{
    flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;
    gap:2px;color:var(--muted);font-size:10.5px;font-weight:600;line-height:1.25;
    text-decoration:none;position:relative;
    -webkit-tap-highlight-color:transparent;touch-action:manipulation;
    transition:color .16s,transform .12s;
  }
  .mobile-tabbar a svg{width:21px;height:21px;flex-shrink:0;transition:transform .16s}
  .mobile-tabbar a span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
  .mobile-tabbar a:active{transform:scale(.92)}
  .mobile-tabbar a.on{color:var(--blue)}
  .mobile-tabbar a.on svg{transform:translateY(-1px)}
  .mobile-tabbar a.on::before{
    content:"";position:absolute;top:0;left:50%;transform:translateX(-50%);
    width:22px;height:3px;border-radius:0 0 4px 4px;background:var(--blue);
  }
  /* 「更多」按钮上的未读式小圆点，提示还有其它栏目 */
  .mobile-tabbar .tab-more i{
    position:absolute;top:9px;left:calc(50% + 8px);width:6px;height:6px;border-radius:50%;
    background:var(--amber);display:block;
  }

  /* 底部抽屉 */
  .bottom-drawer{display:block;position:fixed;inset:0;z-index:290}
  .bottom-drawer__backdrop{
    position:absolute;inset:0;background:rgba(9,20,38,.5);
    -webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);
  }
  .bottom-drawer__panel{
    position:absolute;left:0;right:0;bottom:0;
    background:#fff;border-radius:18px 18px 0 0;
    padding:8px 16px calc(20px + env(safe-area-inset-bottom,0px));
    box-shadow:0 -16px 44px rgba(9,20,38,.22);
    transform:translateY(0);animation:drawerUp .22s ease-out;
  }
  @keyframes drawerUp{from{transform:translateY(24px);opacity:.4}to{transform:translateY(0);opacity:1}}
  .bottom-drawer__grab{width:36px;height:4px;border-radius:4px;background:#d9e1ee;margin:6px auto 12px}
  .bottom-drawer__head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
  .bottom-drawer__head h2{font-size:16px}
  .bottom-drawer__close{
    width:34px;height:34px;border:0;border-radius:9px;background:var(--bg-2);
    color:var(--ink);font-size:22px;line-height:1;display:flex;align-items:center;justify-content:center;
  }
  .bottom-drawer__grid{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}
  .bottom-drawer__grid a{
    display:flex;align-items:center;justify-content:center;text-align:center;
    min-height:48px;padding:8px 6px;border:1px solid var(--line);border-radius:10px;
    background:#fff;color:var(--ink-2);font-size:13px;font-weight:600;
    -webkit-tap-highlight-color:transparent;touch-action:manipulation;
  }
  .bottom-drawer__grid a:active{transform:scale(.97)}
  .bottom-drawer__grid a.on{background:var(--blue-soft);border-color:#b9cbf5;color:var(--blue);font-weight:700}
  body.drawer-open{overflow:hidden}
}

/* 超窄屏（≤360px）保持可读与可点 */
@media(max-width:360px){
  .mobile-tabbar a{font-size:10px}
  .mobile-tabbar a svg{width:19px;height:19px}
  .bottom-drawer__grid{grid-template-columns:repeat(2,1fr)}
}

/* 横屏矮屏：压缩底栏高度 */
@media(max-width:720px) and (max-height:420px){
  .mobile-tabbar{height:calc(48px + env(safe-area-inset-bottom,0px))}
  .mobile-tabbar a{flex-direction:row;gap:6px;font-size:11px}
  .mobile-tabbar a svg{width:17px;height:17px}
  body{padding-bottom:calc(50px + env(safe-area-inset-bottom,0px))}
}

/* 尊重减少动效偏好 */
@media(prefers-reduced-motion:reduce){
  .bottom-drawer__panel{animation:none}
  .mobile-tabbar a,.mobile-tabbar a svg{transition:none}
}
