/* ============================================================
   页面底部导航（首页 / 精选 / 合集 / 资料库）

   手机端：拉伸到屏幕左右边缘、直角边框、贴在屏幕底部
   桌面端：保持原来的悬浮胶囊样式
   ============================================================ */
.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    z-index: 1200;

    display: flex;
    align-items: center;
    gap: 4px;
    padding: 7px 8px;
    border-radius: 40px;

    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 6px 22px rgba(60, 45, 30, 0.13),
        0 16px 44px rgba(60, 45, 30, 0.10);

    -webkit-tap-highlight-color: transparent;
    transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.bottom-nav-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 20px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 1px;
    color: #7a6a5a;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}
.bottom-nav-item:hover {
    background: #f4ede4;
    color: #3d3328;
    text-decoration: none;
}
.bottom-nav-item:active { transform: scale(0.96); }
.bottom-nav-item.active {
    color: #fff;
    background: linear-gradient(90deg, #c56cf0 0%, #8b5cf6 55%, #6366f1 100%);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.38);
}
.bottom-nav-item .bn-icon {
    font-size: 16px;
    line-height: 1;
}
/* 图标用内联 SVG，与文字颜色保持一致 */
.bottom-nav-item .bn-icon svg {
    display: block;
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 有底部浮动导航的页面：给页面底部留出足够空间，避免内容/按钮被导航挡住 */
body.has-bottom-nav {
    padding-bottom: 150px;
}
/* 通用的安全留白（各页面可直接加在 body 上） */
body.pc-bottom-pad {
    padding-bottom: 150px !important;
}

/* 关灯（暗色）模式下，底部导航保持原来的白色样式，不做变色 */

@media (max-width: 700px) {
    /* 拉伸到屏幕左右边缘、直角、贴底 */
    .bottom-nav {
        left: 0;
        right: 0;
        bottom: 0;
        transform: none;
        width: 100%;
        max-width: 100%;
        padding: 8px 4px calc(8px + env(safe-area-inset-bottom, 0px));
        gap: 0;
        border-radius: 0;
        border: none;
        border-top: 1px solid rgba(184, 164, 140, 0.28);
        justify-content: space-around;   /* 4 个栏目均分整条宽度 */
        box-shadow: 0 -3px 16px rgba(60, 45, 30, 0.10);
    }
    .bottom-nav-item {
        flex: 1 1 0;                     /* 等宽铺满 */
        justify-content: center;
        padding: 8px 2px;
        font-size: 18.5px;
        letter-spacing: 0.2px;
        gap: 4px;
        border-radius: 10px;
    }
    .bottom-nav-item .bn-icon svg { width: 16px; height: 16px; }
    /* 导航现在贴在屏幕底部，页面底部要留出整条导航的高度，别被挡住 */
    body.has-bottom-nav { padding-bottom: 84px; }
    body.pc-bottom-pad { padding-bottom: 84px !important; }
}
