/**
 * 移动端底部导航
 *
 * ── 需求 ──────────────────────────────────────────────────────────
 * 去掉中间的「+」发布入口（移动端不对普通用户开放发布权限），
 * 并把剩余图标的布局理顺。
 *
 * ── 为什么不用重排就能均分 ────────────────────────────────────────
 * 父主题的结构是：
 *
 *   #mobile-footer-menu { display:flex; justify-content:space-between }
 *     .mobile-footer-left   { flex:1; justify-content:space-around }  3 项
 *     .mobile-footer-center { flex:0 1 auto }                         「+」
 *     .mobile-footer-right  { flex:1; justify-content:space-around }  3 项
 *
 * 左右两半都是 flex:1，宽度相等；各自用 space-around 分配 3 个等宽图标。
 * space-around 会在每一项两侧各留同样的空隙，于是接缝处的间距
 * （左半右边距 + 右半左边距）恰好等于半区内部的间距。
 *
 * 所以中间那块一旦隐藏，两半各自扩张到 50%，6 个图标自动就是等距的 ——
 * 不需要改 flex 结构，也不需要手写 grid。
 *
 * 线上实测（420px 视口）：
 *   隐藏前图标中心间距  89 / 89 / 152 / 89 / 89   ← 中间被「+」撑开
 *   隐藏后图标中心间距  99 / 99 / 100 / 99 / 99   ← 最大差 1px
 *
 * 换到 606px 视口复测，间距同样是 99/99/100/99/99，
 * 说明这个均分是布局本身给的，不依赖具体宽度。
 * 每项点按区域实测 99×44，达到 44px 的最小可点尺寸建议值。
 */

/* =========================================================================
 * 一、移除「+」发布入口
 * ====================================================================== */

/*
 * 只隐藏、不改模板。
 *
 * 按钮消失后，发布弹层（#post-po-box）就没有任何触发点了 ——
 * 它由 postPoBox.show 控制，而站内只有这一个按钮会把它置为 true，
 * 所以弹层节点留在 DOM 里也永远不会出现，无需额外处理。
 *
 * 桌面端不受影响：整条 #mobile-footer-menu 本来就带 mobile-show，
 * 只在移动端显示。
 */
#mobile-footer-menu .mobile-footer-center {
    display: none !important;
}

/* =========================================================================
 * 二、iPhone 底部安全区
 *
 * 父主题给底栏写的是 position:fixed; bottom:0; height:55px，
 * 没有做安全区适配。在带 Home Indicator 的 iPhone 上用 Safari 访问时，
 * 这条 55px 的栏会被系统那道横条压住底部一截。
 *
 * env(safe-area-inset-bottom) 在不需要的环境（安卓、桌面、
 * 带底部工具栏的 App 内置浏览器）返回 0，是安全的渐进增强。
 *
 * 高度改为 auto + min-height，避免 border-box 下新增的内边距
 * 反过来压缩图标本身的空间。
 * ====================================================================== */

@supports (padding-bottom: env(safe-area-inset-bottom)) {
    #mobile-footer-menu {
        height: auto;
        min-height: 55px;
        padding-bottom: calc(6px + env(safe-area-inset-bottom));
    }
}

/* =========================================================================
 * 三、图标区微调
 * ====================================================================== */

/*
 * 去掉「+」后每项可用宽度从 89px 涨到约 99px，
 * 顺势把点按区域撑满，减少误触。
 */
#mobile-footer-menu .mobile-footer-left,
#mobile-footer-menu .mobile-footer-right {
    align-items: stretch;
}

#mobile-footer-menu .mobile-footer-left > *,
#mobile-footer-menu .mobile-footer-right > * {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
