/* 全站统一边框盒模型：本文件每页都加载。19 个不引 styles.css 的页面（配对中心/安全中心/提醒中心等）
   此前输入框按内容盒算宽，width:100%+padding 会探出卡片右缘（2026-09-28 站主手机实测发现） */
*, *::before, *::after { box-sizing: border-box; }

/* nav-common.css - 底部导航/面板/Loading 共享样式（styles.css 与 site-nav.css 的公共部分）*/
/* 底部导航样式 - 单行可左右滑动 */
.bottom-nav {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 0;
    padding: 0;
    /* iOS 全面屏 Home 指示条安全区 */
    padding-bottom: env(safe-area-inset-bottom, 0px);
    border-top: 1.5px solid var(--border);
    background: var(--bg);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.bottom-nav::-webkit-scrollbar {
    display: none;
}

.sp-loading.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.sp-loading-logo {
    width: 64px;
    height: 64px;
    border: 2px solid var(--fg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: bold;
    letter-spacing: 1px;
    color: var(--fg);
    animation: spLogoPulse 1.2s ease-in-out infinite;
}
.sp-loading-text {
    margin-top: 14px;
    font-size: 0.78rem;
    color: var(--muted);
    letter-spacing: 3px;
    animation: spTextFade 1.2s ease-in-out infinite;
}
/* ===== 底部大类导航（两字 + 汉堡详细） ===== */
/* 2026-09-19 视觉调整：激活态黑色胶囊；彩色 emoji 保留 */
.bottom-nav > a.nav-cat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 7px 0 9px;
    text-decoration: none;
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
}
.bottom-nav > a.nav-cat.active {
    color: var(--fg);
    font-weight: bold;
}
.bottom-nav > a.nav-cat.active .nav-cat-name {
    background: var(--fg);
    color: var(--bg);
    border-radius: 999px;
    padding: 2px 10px;
}
.bottom-nav .nav-cat-icon { font-size: 17px; line-height: 1; }
.bottom-nav > a.nav-cat.active .nav-cat-icon { opacity: 1; transform: scale(1.08); }
/* 汉堡详细面板 */
.nav-panel {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: none;
}
.nav-panel.open { display: block; }
.nav-panel-mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}
.nav-panel-box {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    border-top: 1.5px solid var(--border);
    border-radius: 14px 14px 0 0;
    max-height: 72vh;
    overflow-y: auto;
    padding: 10px 12px 24px;
    animation: navSlideUp 0.25s ease;
    -webkit-overflow-scrolling: touch;
}
.nav-panel-box::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: var(--light-border, #e0e0e0);
    margin: 0 auto 10px;
}
/* 桌面端：不通栏贴底，改为导航上方的居中悬浮卡片 */
@media (min-width: 1024px) {
    .nav-panel-box {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: 640px;
        bottom: 84px;
        border-radius: 14px;
        box-shadow: 0 14px 44px rgba(0, 0, 0, 0.22);
    }
    .nav-panel-box::before { display: none; }
}
.nav-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 0 4px;
}
.nav-panel-title { font-size: 15px; font-weight: bold; color: var(--fg); }
.nav-panel-close {
    background: none;
    border: 1.5px solid var(--light-border);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
    padding: 0;
}
.nav-panel-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.nav-panel-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 12px 4px;
    border: 1.5px solid var(--light-border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--fg);
    font-size: 11px;
    text-align: center;
}
.nav-panel-item .npi-icon { font-size: 18px; line-height: 1; }
.nav-panel-item:hover { background: var(--hover-bg); }
.nav-panel-lock { overflow: hidden; }
/* 面板打开时隐藏右下角悬浮按钮组（搜索/分享），避免压住面板右上角的关闭按钮 */
body.nav-panel-lock .search-fab,
body.nav-panel-lock .share-fab,
body.nav-panel-lock .print-fab,
body.nav-panel-lock .exit-fab { display: none !important; }
/* 键盘焦点可见性（无障碍） */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--fg);
    outline-offset: 2px;
    border-radius: 4px;
}

@media (max-width: 480px) {
    .sp-loading-logo {
            width: 56px;
            height: 56px;
            font-size: 1.2rem;
        }
    .sp-loading-text {
            font-size: 0.72rem;
        }
    .bottom-nav > a.nav-cat { font-size: 10px; padding: 8px 0 9px; }
    .bottom-nav .nav-cat-icon { font-size: 15px; }
    .nav-panel-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
}

/* ============================
   全站 Loading 动画
   品牌化的页面加载过渡
   ============================ */
.sp-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    z-index: 99998;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease-out, visibility 0.4s ease-out;
}

/* ===== 全站通用组件（2026-10 视觉统一）：提示条 / 链接条 =====
   新页面提示与说明统一用 .site-notice，结果页/区块底部的跳转条统一用 .site-linkbar，
   不要再各写一套内联样式。 */
.site-notice {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
    margin: 10px 0;
    font-size: 0.75rem;
    line-height: 1.7;
    color: var(--muted);
}
.site-notice a { color: var(--fg); }
.site-linkbar {
    margin: 14px auto 18px;
    max-width: 420px;
    border: 1px dashed var(--border);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.75rem;
    color: var(--muted);
    text-align: center;
    line-height: 1.7;
}
.site-linkbar a { color: var(--fg); font-weight: bold; }

/* ===== 全站通用控件：原生单选/复选统一黑色系（2026-10 视觉统一），
   避免裸 input 呈现浏览器默认蓝色；已有自定义样式的控件不受影响（页面 css 后加载） */
input[type="radio"], input[type="checkbox"] { accent-color: var(--fg); }

/* ===== 紧急退出（跳走前先挡住屏幕） ===== */
.exit-fab {
    position: fixed;
    right: 16px;
    bottom: 208px;             /* FAB 第三层：分享 96 / 搜索 152 / 快退 208 */
    z-index: 900;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1.5px solid var(--light-border);
    background: var(--bg);
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.15s;
    padding: 0;
}
.exit-fab:hover { opacity: 1; }
/* 首次访问的一次性提示气泡：贴在 🚪 左边，9 秒后自己淡出（本机记一次就不再出现） */
.exit-hint {
    position: fixed;
    right: 68px;
    bottom: 208px;
    max-width: 208px;
    z-index: 901;
    background: var(--fg);
    color: var(--bg);
    font-size: 12px;
    line-height: 1.65;
    padding: 7px 10px;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;      /* 纯提示，不挡下面的点击 */
}
.exit-hint.show { opacity: 1; }
/* 跳转前的白屏：网络慢或断网时也有东西挡着，跳转成功就随页面一起消失 */
.panic-cover {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.panic-cover-hint { font-family: Arial, sans-serif; font-size: 13px; color: #999; }
@media (max-width: 480px) {
    .exit-fab { right: 12px; bottom: 200px; width: 40px; height: 40px; font-size: 17px; }
    .exit-hint { right: 60px; bottom: 200px; max-width: 176px; font-size: 11.5px; }
}
/* 导航面板打开时连提示一起藏起来 */
body.nav-panel-lock .exit-hint { display: none !important; }

/* ===== 吸顶筛选栏（StickyFilter.mount 注入 .sf-sticky） ===== */
.sf-sticky {
    position: sticky; top: 0; z-index: 70;
    background: #fff;
    padding: 4px 0 8px;
    margin: 0;
}
.sf-sticky.sf-on { box-shadow: 0 8px 20px rgba(0,0,0,.10); }


/* ===== 无障碍：键盘焦点可见 ===== */
:focus-visible { outline: 2.5px solid currentColor; outline-offset: 2px; }

/* ===== 主题切换悬浮钮（第四层：分享 96 / 搜索 152 / 快退 208 / 主题 264） ===== */
.theme-fab {
    position: fixed;
    right: 16px;
    bottom: 264px;
    z-index: 900;
}
.theme-fab-main {
    width: 44px; height: 44px; border-radius: 50%;
    border: 1.5px solid #000; background: #fff; color: #000;
    font-size: 1.05rem; cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,.14);
    transition: transform .12s;
}
.theme-fab-main:active { transform: scale(0.94); }
body.nav-panel-lock .theme-fab { display: none !important; }
@media (max-width: 480px) {
    .theme-fab { right: 12px; bottom: 256px; }
    .theme-fab-main { width: 40px; height: 40px; font-size: 0.95rem; }
}
