/*
 * 底部导航栏样式（从 home.css 抽出，独立成文件）。
 *
 * 首页与报告页 / 用户中心等「应用内」页面通过 <link> 单独引入本文件，
 * 登录 / 注册 / 找回 / 重置等临时流程不引入，避免干扰。
 * 与站点主色同源（金色高亮 #f59e0b → #d97706），切到任意页面都像同一个站。
 *
 * 图标是内联 SVG（见 partials/icon.php），尺寸由 .icon 统一给；
 * 不再依赖 Font Awesome，因此不存在「某个页面没引 FA 就图标空白」的问题。
 */

:root {
    --bottom-nav-h: 60px;      /* 导航条本体高度 */
    --bottom-nav-safe: 0px;    /* iPhone 底部小横条（home indicator）占位 */
}

/* 支持安全区变量的浏览器才把它算进来；不支持的浏览器整条声明无效，
   于是回落到上一行写死的 0px —— 老机器上导航条贴着屏幕底部，仍然是正常的。 */
@supports (padding: env(safe-area-inset-bottom)) {
    :root {
        --bottom-nav-safe: env(safe-area-inset-bottom);
    }
}

/* 挂载了底栏的页面，给内容留出底部空间，避免最后一行被 fixed 底栏压住。
   .auth-shell 那条是必须的：它的 min-height 是 100vh（按视口算，不看父元素），
   只给 body 加 padding 并不会把它变矮，底部的「返回首页」照样会被盖住。 */
body.has-bottom-nav {
    padding-bottom: calc(var(--bottom-nav-h) + 16px + var(--bottom-nav-safe));
}

body.has-bottom-nav .auth-shell {
    min-height: calc(100vh - var(--bottom-nav-h) - var(--bottom-nav-safe));
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    align-items: stretch;
    box-sizing: border-box;
    width: 100%;
    max-width: 420px;
    height: calc(var(--bottom-nav-h) + var(--bottom-nav-safe));
    padding-bottom: var(--bottom-nav-safe);
    background: rgba(26, 26, 46, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.nav-item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    /* 触摸目标不小于 44×44（iOS HIG 下限），底栏 60px 高度刚好够 */
    min-height: 44px;
    color: #a0aec0;
    text-decoration: none;
    border-radius: 10px;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s ease, background-color 0.2s ease;
}

/* 按下的即时反馈：移动端没有 hover，没有这个反馈用户会以为没点到 */
.nav-item:active {
    background-color: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
    color: #ffffff;
}

/* 当前页指示条：贴在导航条顶边，比「只有颜色变了」更容易被看见 */
.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 3px;
    background: linear-gradient(to right, #f59e0b, #d97706);
    border-radius: 0 0 3px 3px;
}

.nav-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 22px;
}

/* 内联 SVG 图标：颜色继承父级 color，所以高亮时只改 .nav-item 的颜色即可 */
.nav-item .icon {
    width: 21px;
    height: 21px;
    transition: transform 0.25s ease;
}

.nav-item.active .icon {
    transform: scale(1.15);
    color: #f59e0b;
    filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.65));
}

.nav-text {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.3px;
    line-height: 1.2;
    white-space: nowrap;
}
