/* ============================================
   前台公共样式 · 兼容低版本 iOS / 浏览器
   配色：紫色 #7B61FF

   尺寸单位改用 vw（基于 viewport 宽度）
   设计稿 750px → 1px = 0.1333333vw（1rem = 100px）
   公式：x px / 7.5 = ?vw   （750 / 100 = 7.5）
   ============================================ */

/* 重置 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html {
    height: 100%;
    /* PC 端：永远显示垂直滚动条槽位（body 宽度固定 1905px）
       进刷视频模式时 body.overflow=hidden 也不让槽位消失 */
    overflow-y: scroll;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
                 "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #333333;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    width: 100%;
}

body {
    min-height: 100%;
    background: #f0f0f0;
}

a { text-decoration: none; color: inherit; }
img { vertical-align: middle; border: none; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ========== 页面容器 ========== */
.page-container {
    width: 100%;
    max-width: 488px;     /* PC 端最大 488px（+8px 补偿 Windows Chrome 滚动条槽位偏移） */
    margin: 0 auto;
    background: #ffffff;
    min-height: 100vh;
    position: relative;
    /* PC 端修复：水平溢出隐藏，避免切换 tab 时因为子元素宽度差
       导致整个 page-container 在视口中居中位置左右抖动 */
    overflow-x: hidden;
}

/* ========== 顶部区域 ========== */
.page-header {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 50;
    background: #ffffff;
    padding: 0;                  /* LOGO 上下左右都不要间距 */
    min-height: 12vw;            /* 顶部占位，防止内容贴顶 */
}

/* 「我的」页专属：隐藏顶部 LOGO 区
   由 JS 在切到 userPage 时给 .page-header 加 .is-hidden
   切回其它 tab 时移除 .is-hidden
   注意：#pageContent 的 min-height 是按"减去 header 高度"算的（PC 端 100vh - 230 - 100），
   header 隐藏后 .user-page 用 inset:0 从视口顶部 0 开始铺背景图，
   正好让 bj.jpg 占据原 header 区域 + 内容区，无空白带 */
.page-header.is-hidden {
    display: none !important;
}

.site-logo {
    display: block;
    max-height: 10vw;
    height: auto;
    width: auto;
    max-width: 40vw;
    margin: 0;                   /* LOGO 自身无间距 */
    padding-left: 1.6vw;         /* 左边距与轮播图一致 */
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}
/* 包裹 logo 的链接：点击跳首页 */
.site-logo-link {
    display: inline-block;
    line-height: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
    /* hover 微微透明反馈（不影响布局） */
    -webkit-transition: opacity .15s ease;
    transition: opacity .15s ease;
}
.site-logo-link:hover { opacity: .82; }
.site-logo-link:active { opacity: .65; }

/* ========== 右上角 APP 下载按钮 ========== */
.page-header {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
}

.app-download-btn {
    position: absolute;
    top: 50%;
    right: 2.4vw;
    -webkit-transform: translateY(-50%);
    transform: translateY(-50%);
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    gap: 0.8vw;
    padding: 0 2.4vw;
    height: 7.2vw;
    max-height: 32px;
    border-radius: 7.2vw;
    text-decoration: none;
    color: #ffffff;
    font-size: 2.4vw;
    font-weight: 600;
    letter-spacing: 0.1em;
    overflow: hidden;
    /* 浅紫水晶单色（与公告同色同手法） */
    background:
        -webkit-linear-gradient(180deg, rgba(255,255,255,.22) 0%, rgba(255,255,255,0) 50%, rgba(0,0,0,.10) 100%),
        #a855f7;
    background:
        linear-gradient(180deg, rgba(255,255,255,.22) 0%, rgba(255,255,255,0) 50%, rgba(0,0,0,.10) 100%),
        #a855f7;
    border: 1px solid rgba(139, 92, 246, .55);
    border-top: 1px solid rgba(221, 191, 253, .7);
    -webkit-box-shadow:
        inset 0 1px 0 rgba(255,255,255,.4),
        inset 0 -1px 0 rgba(0,0,0,.16),
        0 2px 6px rgba(139, 92, 246, .25),
        0 1px 2px rgba(0, 0, 0, .10);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.4),
        inset 0 -1px 0 rgba(0,0,0,.16),
        0 2px 6px rgba(139, 92, 246, .25),
        0 1px 2px rgba(0, 0, 0, .10);
    -webkit-transition: all .25s ease;
    transition: all .25s ease;
}

/* 左→右 闪烁扫光动画（水晶高光掠过） */
.app-download-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: -webkit-linear-gradient(90deg, transparent 0%, rgba(255,255,255,.55) 50%, transparent 100%);
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.55) 50%, transparent 100%);
    -webkit-transform: skewX(-25deg);
    transform: skewX(-25deg);
    -webkit-animation: btnShine 2.6s linear infinite;
    animation: btnShine 2.6s linear infinite;
    pointer-events: none;
}

@keyframes btnShine {
    0%   { left: -100%; }
    60%  { left: 130%; }
    100% { left: 130%; }
}

.app-download-icon {
    font-size: 3.6vw;
    line-height: 1;
    -webkit-filter: drop-shadow(0 1px 1px rgba(0,0,0,.2));
    filter: drop-shadow(0 1px 1px rgba(0,0,0,.2));
}

.app-download-text {
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,.2);
}

.app-download-btn:active {
    -webkit-transform: translateY(-50%) scale(0.96);
    transform: translateY(-50%) scale(0.96);
}

/* 公告栏（高度由 vw 决定，跟随屏幕宽度自适应） */
.announcement-bar {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    cursor: pointer;            /* 提示可点击 */
    -webkit-tap-highlight-color: rgba(255,255,255,.15);  /* 点击反馈 */
    -webkit-user-select: none;
    user-select: none;
    /* 低 iOS：禁止长按弹菜单，避免误触 */
    -webkit-touch-callout: none;
    /* 左右间距与轮播图一致 */
    margin: 1.6vw 1.6vw 0;           /* 上间距减小，与左右间距一致 */
    /* 浅紫水晶单色按钮 */
    background:
        -webkit-linear-gradient(180deg, rgba(255,255,255,.22) 0%, rgba(255,255,255,0) 50%, rgba(0,0,0,.10) 100%),
        #a855f7;                     /* 浅紫水晶单色 */
    background:
        linear-gradient(180deg, rgba(255,255,255,.22) 0%, rgba(255,255,255,0) 50%, rgba(0,0,0,.10) 100%),
        #a855f7;
    -webkit-backdrop-filter: blur(10px) saturate(160%);
    backdrop-filter: blur(10px) saturate(160%);
    border: 1px solid rgba(139, 92, 246, .55);
    border-top: 1px solid rgba(221, 191, 253, .7);
    -webkit-box-shadow:
        inset 0 1px 0 rgba(255,255,255,.4),
        inset 0 -1px 0 rgba(0,0,0,.16),
        0 2px 6px rgba(139, 92, 246, .25),
        0 1px 2px rgba(0, 0, 0, .10);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.4),
        inset 0 -1px 0 rgba(0,0,0,.16),
        0 2px 6px rgba(139, 92, 246, .25),
        0 1px 2px rgba(0, 0, 0, .10);
    overflow: hidden;
    border-radius: 3.2vw;            /* 左右圆角，与轮播图圆角一致 */
    height: 7vw;                     /* 手机端高度提升 */
    max-height: 50px;
    line-height: 7vw;
    position: relative;
}
/* 公告栏顶部细高光线（水晶质感） */
.announcement-bar::before {
    content: '';
    position: absolute;
    left: 10%; right: 10%; top: 0;
    height: 1px;
    background: -webkit-linear-gradient(90deg, transparent 0%, rgba(255,255,255,.7) 50%, transparent 100%);
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.7) 50%, transparent 100%);
    pointer-events: none;
    z-index: 2;
}

/* 左侧固定音量 UI（不滚动） */
.announcement-icon {
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
    width: 3.6vw;
    height: 3.6vw;
    min-width: 16px;
    min-height: 16px;
    max-width: 22px;
    max-height: 22px;
    margin: 0 1.6vw 0 2vw;
    color: #ffffff;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

/* 滚动轨道容器：占满剩余宽度，overflow:hidden */
.announcement-track {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    position: relative;
    height: 100%;
}

.announcement-content {
    display: inline-block;
    white-space: nowrap;
    padding-left: 100%;               /* 推到屏幕最右边开始 */
    padding-right: 1vw;
    font-size: 2.933333vw;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .55), 0 0 8px rgba(255, 255, 255, .25);
    line-height: inherit;
    -webkit-animation: marquee 28s linear infinite;
    animation: marquee 28s linear infinite;
    /* 不加 pointer-events:none — iOS 9 上可能导致整个公告栏 hit test 失败 */
}

@keyframes marquee {
    0%   { -webkit-transform: translateX(0); transform: translateX(0); }            /* 从 padding-left 100% 处开始（屏幕最右） */
    100% { -webkit-transform: translateX(-100%); transform: translateX(-100%); }   /* 整体左移出屏幕 */
}

/* 搜索栏 */
.search-bar {
    padding: 2.933333vw 3.733333vw;
    background: #ffffff;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    gap: 2.4vw;
}

.search-logo {
    width: 8.533333vw;
    height: 8.533333vw;
    max-width: 64px;
    max-height: 64px;
    background: #7B61FF;
    border-radius: 1.866667vw;
    -webkit-box-flex: 0;
    -webkit-flex: none;
    flex: none;
    overflow: hidden;
}

.search-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-input-wrap {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    position: relative;
}

.search-input {
    width: 100%;
    height: 8.533333vw;
    max-height: 64px;
    padding: 0 2.8vw 0 7.6vw;
    background: #f5f5f5;
    border: 1px solid #e5e5e5;
    border-radius: 4.266667vw;
    font-size: 3.2vw;
    color: #333333;
    outline: none;
    font-family: inherit;
}

.search-icon {
    position: absolute;
    left: 2vw;
    top: 50%;
    -webkit-transform: translateY(-50%);
    transform: translateY(-50%);
    width: 3.733333vw;
    height: 3.733333vw;
    max-width: 28px;
    max-height: 28px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999999' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
}

.search-btn {
    padding: 0 3.733333vw;
    height: 8.533333vw;
    max-height: 64px;
    background: #7B61FF;
    color: #ffffff;
    border-radius: 4.266667vw;
    font-size: 3.2vw;
    white-space: nowrap;
}

/* ========== 轮播图 ========== */
.carousel-section {
    position: relative;
    overflow: hidden;
    margin-top: 0;     /* 公告放在它下面了 */
}

.carousel-wrap {
    position: relative;
    overflow: hidden;
}

.carousel-track {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    width: 100%;
    will-change: transform;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.carousel-slide {
    width: 100%;
    -webkit-box-flex: 0;
    -webkit-flex: none;
    flex: none;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    padding: 0 1.6vw;            /* 左右各留间距 */
}

.carousel-slide img {
    width: 100%;
    display: block;
    border-radius: 3.2vw;        /* 圆角 */
    -webkit-box-shadow: 0 1px 4px rgba(0,0,0,.05);
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    background: #f3f4f6;         /* 占位底色 */
}

.carousel-dots {
    position: absolute;
    bottom: 2.4vw;
    left: 50%;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    gap: 1.4vw;
}

.carousel-dot {
    width: 1.4vw;
    height: 1.4vw;
    max-width: 10px;
    max-height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
}

.carousel-dot.active {
    background: #ffffff;
    width: 3.733333vw;
    max-width: 28px;
    border-radius: 0.733333vw;
}

/* ========== 内容区域 ========== */
.page-content {
    padding: 3.733333vw;
    padding-bottom: 16vw;            /* 底部导航高度预留 */
    -webkit-transition: padding-bottom 0.08s linear;
    transition: padding-bottom 0.08s linear;
}

/* iOS 下滑展开时，内容区底部预留也增加 25px（避免被展开后的导航遮挡） */
.page-content.is-expanded {
    padding-bottom: calc(13.333333vw + 20px + env(safe-area-inset-bottom, 0px) + 25px);
}

/* ========== 底部导航 ========== */
/* ========== 媒体查询：PC 浏览器（宽度 > 480px） ========== */
@media (min-width: 481px) {
    body {
        background: #f0f2f5;        /* PC 端背景浅灰 */
        min-height: 100vh;
    }
    .page-container {
        box-shadow: 0 0 20px rgba(0,0,0,0.08);
        /* 不强制 min-height: 100vh → 让内容决定高度
           否则 PC 端内容少的页面会被强制拉到 1 个视口高 */
        max-width: 488px;        /* PC 端 +8px 补偿 Chrome 滚动条槽位 */
    }
    /* PC 端：菜单宽度/左右间距由 JS 同步公告（见 index.js syncMenuToAnnouncement） */
    .multimenu-section {
        /* JS 会强制覆盖 width / marginLeft / marginRight / padding */
        cursor: grab;  /* 提示 PC 端可拖拽切换 */
    }
    .multimenu-section:active {
        cursor: grabbing;
    }
    /* PC 端各元素恢复 px 固定值，避免 vw 在大屏上过大 */
    .page-header {
        padding: 0;
        min-height: 48px;           /* PC 端减小 logo 与轮播图间距 */
    }
    .site-logo {
        max-height: 40px;           /* PC 端 LOGO 固定 40px 高 */
        max-width: 160px;
        padding-left: 8px;
    }
    .announcement-bar {
        height: 34px;
        line-height: 34px;
        margin: 8px 8px 0;            /* 上间距同步减小 */
        border-radius: 15px;
    }
    .announcement-icon {
        width: 18px;
        height: 18px;
        margin: 0 8px 0 12px;
    }
    .announcement-content {
        font-size: 12px;
        color: #ffffff;
    }
    .search-bar {
        padding: 12px 28px;
        gap: 12px;
    }
    .search-logo {
        width: 48px;
        height: 48px;
        border-radius: 10px;
    }
    .search-logo span {
        font-size: 20px !important;
        line-height: 48px !important;
    }
    .carousel-slide {
        padding: 0 8px;              /* PC 端左右间距，与移动端 vw 换算一致 */
    }
    .carousel-slide img {
        border-radius: 15px;
    }
    .carousel-dot {
        width: 7px;
        height: 7px;
    }
    .carousel-dots {
        gap: 7px;
        bottom: 12px;
    }
    .app-download-btn {
        right: 12px;
        height: 32px;
        padding: 0 14px;
        gap: 4px;
        font-size: 11px;
        border-radius: 16px;
    }
    .app-download-icon {
        font-size: 16px;
    }

    /* PC 端：导航 1 行 4 列（不依赖 max-width 断点，容器固定 480px 也生效）*/
    .navitem-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
    }
    .navitem-icon {
        width: 44px;
        height: 44px;
    }
}

/* ========== 公告详情弹窗 ==========
   弹窗样式已迁移到 index.php 内联 style（低版本 iOS Safari 兼容）：
   1) 避免外链 CSS 加载顺序/失败导致 display:none 默认隐藏无法被 inline style 覆盖
   2) 避免 iOS 9 上外链 CSS 内的 -webkit-backdrop-filter / animation 影响 click 事件分发
*/

/* "我知道了"按钮：样式已迁移到 index.php 内联 style（iOS 9 兼容） */

/* ============================================
   导航站点（前台公告栏下方区块）
   ============================================ */
.navitem-section {
    width: 100%;
    max-width: 1100px;
    margin: 6px auto 0;
    padding: 0 10px;
    box-sizing: border-box;
}
/* 多菜单下方的"热门导航"组：紧贴多菜单最后一行的卡片（缩间距） */
#navitemSection2 {
    margin-top: 0;                      /* 去掉共用 6px，让下方容器紧贴多菜单最后一行卡片 */
}

/* 外层大容器：标题 + 一行 5 个导航 */
.navitem-group {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(123, 97, 255, 0.08);
    padding: 8px 10px 10px;
    box-sizing: border-box;
}

.navitem-group-header {
    margin: 0 4px 8px;
}

.navitem-group-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #2c234f;
    line-height: 1.2;
}

.navitem-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
}

/* 单个站点：透明，无包裹外观（不加背景/边框/阴影） */
.navitem-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px 2px 3px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    text-decoration: none;
    color: #1f2937;
    transition: transform 0.18s ease;
    -webkit-tap-highlight-color: transparent;
}

.navitem-card:active {
    transform: scale(0.95);
}

@media (hover: hover) {
    .navitem-card:hover {
        transform: translateY(-1px);
    }
}

/* 图片的「透明背景框」 */
.navitem-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: transparent;                         /* 完全透明 */
    border: 1.5px solid rgba(123, 97, 255, 0.55);    /* 紫色边框作为主要视觉 */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 3px;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.navitem-icon img {
    width: 82%;
    height: 82%;
    object-fit: contain;
    display: block;
    border-radius: 6px;  /* 图片自身也带圆角 */
}

.navitem-card:hover .navitem-icon {
    background: rgba(123, 97, 255, 0.08);
    border-color: rgba(123, 97, 255, 0.85);
}

.navitem-card:active .navitem-icon {
    background: rgba(123, 97, 255, 0.16);
}

.navitem-name {
    font-size: 12px;
    line-height: 1.3;
    text-align: center;
    /* 最多 2 行，超出省略（兼容 iOS 9 老 Safari：旧 + 新 webkit 同时声明）*/
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    word-break: break-word;
    white-space: normal;
    overflow-wrap: break-word;
    color: #374151;
    width: 100%;
    /* 给一个最大高度兜底（不支持 line-clamp 的浏览器不会被撑爆）*/
    max-height: 2.6em;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 默认（PC 端小窗口）：5 列 */
@media (max-width: 900px) {
    .navitem-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 6px;
    }
}

/* 中等屏：5 列 */
@media (max-width: 700px) {
    .navitem-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 4px;
    }
}

/* 手机：5 列（统一与 PC 端各档位一致）*/
@media (max-width: 480px) {
    .navitem-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 3px;
    }
    .navitem-card {
        padding: 3px 1px 2px;
    }
    .navitem-icon {
        width: 44px;
        height: 44px;
        margin-bottom: 2px;
    }
    .navitem-name {
        font-size: 11px;
        line-height: 1.2;
    }
}

/* ============================================
   最终覆盖：导航 1 行 4 列（PC 和手机端统一）
   - PC 端视口（>= 481px）：容器 480px 内放 4 个
   - 手机端（<= 480px）：4 个
   使用 !important 确保胜过所有前面的 grid-template-columns
   ============================================ */
.navitem-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px;
}

/* ============================================
   多菜单分页导航（前台）
   兼容低版本 iOS 9 Safari
   - 不用 CSS gap（用 margin）
   - 不用 aspect-ratio（固定宽高）
   - 不用 grid 自适应 minmax（统一 5/4 列）
   ============================================ */

/* 设计：
   1. 菜单容器宽度与公告区域一致（撑满 page-container，保留 1.6vw 内边距）
   2. 4 个菜单按钮平分宽度（每个 25%）
   3. 整块容器左右滑动（transform: translateX），不用滚动条
   5. 选中只换底色，字号/字重不变
   ============================================ */

/* 菜单 section：撑满父容器，移动端用 vw 内边距 */
.multimenu-section {
    width: 100%;
    max-width: 1100px;
    margin: 8px auto 0;
    padding: 0 1.6vw;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

/* 菜单容器：与公告同宽（占满 .multimenu-section） */
.multimenu-tabs,
.multimenu-tabs-wrap {
    width: 100%;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    /* 4 个按钮一行 */
    display: -webkit-box;
    display: flex;
    overflow: hidden;                /* 隐藏溢出，配合 translateX */
    /* 容器全圆 → 让激活态胶囊的首尾也能完整显示圆角 */
    border-radius: 999px;
    background: rgba(168,85,247,.06);   /* 容器底：淡紫底 */
    border: 1px solid rgba(168,85,247,.18);
    position: relative;
}

/* 按钮：4 等分，纯扁平（无中间分割线） */
.multimenu-tab {
    /* 4 个按钮，每个 25% */
    -webkit-box-flex: 1;
    -webkit-flex: 1 1 0%;
    flex: 1 1 0%;
    -webkit-flex-basis: 25%;
    flex-basis: 25%;
    min-width: 0;                    /* 关键！flex 子项不收缩 */
    /* 文字居中 */
    text-align: center;
    padding: 8px 4px;
    font-size: 13px;                 /* 选中态不变化 */
    font-weight: 500;
    color: #a855f7;
    background: transparent;
    border: 0;                       /* 无任何边框/分割线 */
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    /* 过渡仅字色（背景由 .multimenu-active-bg 滑动层接管，无背景渐变） */
    -webkit-transition: color .15s ease;
    transition: color .15s ease;
    /* 文字过长省略 */
    white-space: nowrap;
    overflow: hidden;
    -o-text-overflow: ellipsis;
    text-overflow: ellipsis;
    /* 圆角全圆：首/末按钮不会被父容器 999px 切角时露出方形 */
    border-radius: 999px;
    /* 文字浮在 .multimenu-active-bg 背景层之上（背景层 z-index:1） */
    position: relative;
    z-index: 2;
}
/* 不再需要 last-child 取消分割线（已经全部 border:0） */

/* 选中态：文字变白（背景层是独立的 .multimenu-tab-bg 滑动元素） */
.multimenu-tab.active {
    color: #fff;
    font-weight: 500;
    font-size: 13px;
}

/* 滑动背景层：1 个独立的 <div id="multimenuActiveBg"></div>
   与所有 tab 同级（放在 .multimenu-tabs 容器内）
   ── 核心机制 ──
   1. JS 改 transform: translate3d(idx * 100%, 0, 0) 让背景层滑过去
   2. translateX 百分比相对自身 width（= 100/menuCount %容器宽）
   3. 文字层固定不动（背景层在文字下方）── */
.multimenu-active-bg {
    /* 绝对定位：在 .multimenu-tabs 容器内 */
    position: absolute;
    top: 0;
    left: 0;
    width: 33.333%;              /* JS 同步设为 100/menuCount% */
    height: 100%;
    /* 紫色渐变背景 */
    background:
        -webkit-linear-gradient(180deg, rgba(255,255,255,.30) 0%, rgba(255,255,255,0) 50%, rgba(0,0,0,.10) 100%),
        -webkit-linear-gradient(180deg, #c084fc 0%, #a855f7 100%);
    background:
        linear-gradient(180deg, rgba(255,255,255,.30) 0%, rgba(255,255,255,0) 50%, rgba(0,0,0,.10) 100%),
        linear-gradient(180deg, #c084fc 0%, #a855f7 100%);
    border-radius: 999px;
    -webkit-box-shadow:
        inset 0 1px 0 rgba(255,255,255,.30),
        0 2px 6px rgba(168,85,247,.25);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.30),
        0 2px 6px rgba(168,85,247,.25);
    /* 核心：滑动过渡（与 track 完全同步） */
    -webkit-transition: -webkit-transform .35s cubic-bezier(.25,.46,.45,.94);
    transition: transform .35s cubic-bezier(.25,.46,.45,.94);
    /* 滑动偏移：JS 设为 translate3d(idx * 100%, 0, 0) */
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    /* 背景层在文字下方（不接收点击） */
    z-index: 1;
    pointer-events: none;
}
/* 内容区容器：横向滑动轨道（hidden 溢出，配合 translateX） */
.multimenu-content {
    background: transparent;       /* 容器本身透明（让 each panel 各自背景透出） */
    border-radius: 12px;
    padding: 0;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    min-height: 60px;
    position: relative;
    overflow: hidden;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    /* 横向滑动硬件加速 */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* 滑动 track：横向排列多个 panel
   总宽 = 菜单数 × 视口宽，让 translateX(-25%) 精准对应移动一个 panel */
.multimenu-track {
    display: -webkit-box;
    display: flex;
    -webkit-box-align: start;
    align-items: flex-start;          /* 关键：不再 stretch，track 高度 = 自身 max(panel 高度) */
    -webkit-transition: -webkit-transform .35s cubic-bezier(.25,.46,.45,.94);
    transition: transform .35s cubic-bezier(.25,.46,.45,.94);
    will-change: -webkit-transform, transform;
}

/* 单个 panel：占视口的 1/菜单数
   JS 会根据 menuCount 设置 inline style：flex-basis: 25%/33.33%/50% 等
   例如 4 菜单 → 每个 panel = 25% of track = 1 viewport */
.multimenu-panel {
    -webkit-box-flex: 0;
    -webkit-flex: 0 0 auto;
    flex: 0 0 auto;
    -webkit-flex-basis: 25%;
    flex-basis: 25%;
    min-width: 0;                       /* 关键：允许收缩（避免 grid 5 列被撑爆） */
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    background: #fff;
    border-radius: 12px;
    padding: 10px 5px 4px;              /* 上 10 / 左右 5 / 下 4（紧凑底部，让下方容器紧贴最后一行卡片） */
    -webkit-box-shadow: 0 3px 10px rgba(123,97,255,.08);
    box-shadow: 0 3px 10px rgba(123,97,255,.08);
    /* 防止内嵌 grid 溢出导致外层被撑大 */
    overflow: hidden;
}
.multimenu-empty {
    text-align: center;
    color: #9ca3af;
    font-size: 12px;
    padding: 16px 0;
}
/* 5 列网格（PC） */
.multimenu-grid {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    padding: 4px;
}
.multimenu-card {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    /* 用 grid + gap 代替百分比 + margin，彻底避免一行塞不下 */
    padding: 4px 2px 3px;
    text-align: center;
    text-decoration: none;
    color: #2c234f;
    -webkit-tap-highlight-color: transparent;
    display: -webkit-box;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: center;
    align-items: center;
}
.multimenu-card:active { opacity: .7; }
.multimenu-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    border: 1.5px solid rgba(123,97,255,.55);
    background: #fff;
    overflow: hidden;
    display: -webkit-box;
    display: flex;
    -webkit-box-align: center;
    align-items: center;
    -webkit-box-pack: center;
    justify-content: center;
    margin-bottom: 4px;
}
.multimenu-icon img {
    width: 82%;
    height: 82%;
    -o-object-fit: contain;
    object-fit: contain;
    display: block;
    border-radius: 6px;  /* 图片自身也带圆角 */
}
.multimenu-icon-text {
    font-size: 18px;
    font-weight: 700;
    color: #7B61FF;
}
.multimenu-name {
    font-size: 12px;
    line-height: 1.3;
    max-width: 100%;
    text-align: center;
    /* 最多 2 行 + 省略（兼容 iOS 9 老 Safari）*/
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    word-break: break-word;
    white-space: normal;
    overflow-wrap: break-word;
    max-height: 2.6em;
    overflow: hidden;
    text-overflow: ellipsis;
    /* 兼容：旧标准 white-space:nowrap 已被上面 white-space:normal 覆盖 */
}

/* 手机端：5 列（由 grid-template-columns 控制，无需 width） */
@media (max-width: 480px) {
    .multimenu-card { width: auto; }   /* 5 列 */
    .multimenu-icon { width: 44px; height: 44px; }
    .multimenu-name { font-size: 11px; }
    .multimenu-grid { gap: 3px; padding: 3px; }
}

/* 当无菜单时，整块隐藏 */
.multimenu-section.is-hidden { display: none; }

/* 底部宣传语：下方容器下方居中一行文字 */
.footer-slogan {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px 10px 8px;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    text-align: center;
    font-size: 12px;
    color: #888;
    letter-spacing: .5px;
}

/* ========== 刷视频全屏容器（JS 动态创建 #videoFullscreen）==========
   JS 注入的 style 已直接用 CSS 函数 calc()/env() 写死 bottom，
   不依赖 JS 算 tabBar 高度，避免 iOS Safari body.hidden 时 fixed
   元素 offsetHeight 为 0 的问题。
   这里只留 media query 兜底（如果未来 JS 注入失败） */
#videoFullscreen {
    bottom: 70px;                /* PC 端兜底 */
}
@media (max-width: 480px) {
    #videoFullscreen {
        bottom: calc(13.333333vw + env(safe-area-inset-bottom, 0px));
    }
}