/* ========== B站风格配色系统 ========== */
:root {
    --bilibili-pink: #FB7299;
    --bilibili-blue: #00A1D6;
    --primary-color: #FB7299;
    --bg-color: #F4F4F4;
    --card-bg: #FFFFFF;
    --text-primary: #212121;
    --text-secondary: #757575;
    --border-color: #E0E0E0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
    --bottom-nav-offset: calc(60px + env(safe-area-inset-bottom));
    --skeleton-base: #EAEAEA;
    --skeleton-highlight: #F5F5F5;
}

/* ========== 全局样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background: var(--card-bg);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    padding-bottom: calc(var(--bottom-nav-offset) + 5px); /* 底部导航栏高度 */
    overflow-x: clip; /* clip 不建立 BFC，避免破坏 position:sticky */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* ========== Toast 轻提示 ========== */
.mgw-toast {
    position: fixed;
    bottom: calc(var(--bottom-nav-offset) + 16px);
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    background: rgba(30, 30, 40, 0.88);
    color: #fff;
    font-size: 14px;
    line-height: 1.5;
    padding: 9px 20px;
    border-radius: 24px;
    white-space: nowrap;
    max-width: 80vw;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 99998;
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    -webkit-user-select: text;
    user-select: text;
}
.mgw-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========== 离线横幅 ========== */
.mgw-offline-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99997;
    background: #f59e0b;
    color: #fff;
    font-size: 13px;
    text-align: center;
    padding: 6px 12px;
    transform: translateY(-100%);
    transition: transform 0.25s ease;
    pointer-events: none;
}
.mgw-offline-bar.is-visible {
    transform: translateY(0);
}

input, textarea, [contenteditable], .allow-select {
    -webkit-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
}

.top-stack {
    position: sticky;
    top: 0;
    z-index: 120;
    background: var(--card-bg);
    display: flex;
    flex-direction: column;
    gap: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    /* 安卓/iOS 刘海屏/状态栏安全区：防止顶部搜索栏被系统栏遮挡 */
    padding-top: env(safe-area-inset-top, 0px);
}

/* ========== 顶部栏 ========== */
.top-bar {
    position: relative;
    background: var(--card-bg);
    padding: 5px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    box-shadow: none;
    overflow: hidden;
}

.logo {
    display: flex;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
}

.logo-img {
    height: 26px;
    width: auto;
    max-width: 240px;
    object-fit: contain;
    display: block;
}

@media (min-width: 768px) {
    .logo-img {
        height: 48px;
        max-width: 320px;
    }
}

@media (max-width: 360px) {
    .logo-img {
        height: 26px;
        max-width: 200px;
    }
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: flex-end;
    min-width: 0;
    flex-wrap: nowrap;
}

.top-help-btn {
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.035);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 800;
    padding: 7px 10px;
    border-radius: 999px;
    cursor: pointer;
    flex: 0 0 auto;
    min-height: 38px;
    white-space: nowrap;
}

.top-help-btn:active {
    transform: scale(0.98);
}

.top-search {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.035);
    min-width: 180px;
    flex: 1;
    min-width: 0;
    min-height: 38px;
    overflow: hidden;
    flex-basis: 0;
}

.top-search-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--text-secondary);
    opacity: 0.7;
}

.top-search-input {
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    width: auto;
    flex: 1;
    min-width: 0;
    flex-basis: 0;
}

.top-search-input::placeholder {
    color: var(--text-secondary);
}

.top-search-clear {
    border: none;
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-secondary);
    width: 26px;
    height: 26px;
    border-radius: 999px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: 0 0 auto;
    visibility: hidden;
    pointer-events: none;
}

.top-search-clear.is-visible{
    visibility: visible;
    pointer-events: auto;
}

.top-search-clear svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
}

.top-search-clear:active {
    transform: scale(0.94);
}

.top-search-btn {
    border: none;
    background: var(--primary-color);
    color: white;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 999px;
    cursor: pointer;
    min-height: 30px;
}

.top-search-btn:active {
    transform: scale(0.96);
}

/* ========== 分类栏（横向滚动）========== */
.category-scroll-container {
    position: relative;
    background: var(--card-bg);
    padding: 3px 0;
    box-shadow: none;
    overflow: hidden;
    overflow-y: hidden;
    padding-right: 48px; /* 右侧留出"下拉更多"按钮空间 */
    touch-action: pan-x;
    overscroll-behavior-x: contain;
}

.category-list {
    display: flex;
    gap: 8px;
    padding: 0 12px;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: none;
    /* 隐藏滚动条 */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* 分类栏右侧下拉按钮 */
.category-more-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    box-shadow: var(--shadow);
    z-index: 5;
}

.category-more-btn:active {
    transform: translateY(-50%) scale(0.96);
}

/* 分类下拉面板 */
.category-dropdown-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 35000;
    padding: 12px;
}

.category-dropdown-panel {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.category-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
}

.category-dropdown-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.category-dropdown-close {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: none;
    background: rgba(0, 0, 0, 0.03);
    cursor: pointer;
    color: var(--text-secondary);
}

.category-dropdown-grid {
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.category-dropdown-grid .category-btn {
    width: 100%;
    justify-content: center;
}

@media (max-width: 480px) {
    .category-dropdown-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ========== 解压密码说明弹窗内容排版 ========== */
.pwd-guide {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pwd-block {
    padding: 14px;
    border-radius: 14px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
}

.pwd-title {
    font-size: 15px;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.pwd-line {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.pwd-code {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 900;
}

.pwd-note {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
}

.pwd-sub {
    margin-top: 4px;
    font-size: 14px;
    font-weight: 900;
    color: var(--text-primary);
}

.pwd-paragraph {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.category-list::-webkit-scrollbar {
    display: none;
}

.category-btn {
    flex-shrink: 0;
    padding: 4px 10px;
    background: var(--home-category-btn-bg, white);
    color: var(--home-category-btn-text, var(--text-secondary));
    border: 1px solid var(--home-category-btn-border, var(--border-color));
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.18s ease, color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    white-space: nowrap;
    line-height: 1.2;
    box-shadow: var(--home-category-btn-shadow, none);
}

.category-btn:active,
.category-btn.active {
    background: var(--home-category-btn-active-bg, var(--primary-color));
    color: var(--home-category-btn-active-text, white);
    border-color: var(--home-category-btn-active-border, var(--primary-color));
    box-shadow: var(--home-category-btn-active-shadow, none);
    transform: scale(1.05);
}

.category-btn:not(.active):hover {
    border-color: var(--home-category-btn-active-border, var(--primary-color));
    color: var(--home-category-btn-hover-text, var(--primary-color));
}

/* ========== 主内容区 ========== */
.main-content {
    padding: 6px;
    min-height: calc(100vh - 200px);
}

@media (min-width: 768px) {
    /* PC 两侧留白，形成“侧边栏”空间 */
    .main-content {
        max-width: 1240px;
        margin: 0 auto;
        padding: 22px 56px;
    }
}
/* ========== 顶部Banner ========== */
.top-banner {
    width: 100%;
    margin-bottom: 10px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.top-banner.has-slides{
    cursor: default;
    background: transparent;
}

/* === 叠层轮播：绝对定位 + 淡入切换，避免平移轨道在部分环境下只显示第一张 === */
.top-banner-track{
    width: 100%;
    display: block;
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    box-shadow: 0 6px 28px rgba(0,0,0,0.14);
}

.top-banner-slide{
    position: absolute;
    inset: 0;
    display: block;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity .42s ease, visibility .42s ease;
}

.top-banner-slide.is-active{
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 1;
}

.top-banner-slide img{
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transform-origin: center center;
    animation: bannerKenBurns var(--banner-interval, 3.8s) ease forwards;
    will-change: transform;
}

/* 底部渐变遮罩（仅首页banner，增加层次感和高级感） */
.top-banner-slide:not(.oupai-banner-slide)::before {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 45%;
    background: linear-gradient(to top, rgba(0,0,0,0.30) 0%, rgba(0,0,0,0) 100%);
    pointer-events: none;
    z-index: 1;
}

/* 顶部光泽高光层（镜头感） */
.top-banner-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        160deg,
        rgba(255,255,255,0.08) 0%,
        rgba(255,255,255,0) 55%
    );
    pointer-events: none;
    z-index: 2;
}

@keyframes bannerKenBurns {
    from { transform: scale(1.00); }
    to   { transform: scale(1.07); }
}

.top-banner-dots{
    position: absolute;
    left: 0;
    right: 0;
    bottom: 10px;
    display: flex;
    justify-content: center;
    gap: 6px;
    pointer-events: none;
    z-index: 2;
}

.top-banner-dot{
    width: 16px;
    height: 4px;
    border-radius: 999px;
    border: 0;
    background: rgba(255,255,255,0.45);
    box-shadow: 0 1px 6px rgba(0,0,0,0.25);
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    transition: width 0.3s ease;
}

.top-banner-dot.active{
    width: 32px;
    background: rgba(255,255,255,0.55);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.25), 0 2px 8px rgba(0,0,0,0.20);
}

/* 活跃dot进度条动画 */
.top-banner-dot.active::after{
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 0%;
    background: rgba(255,255,255,0.95);
    border-radius: 999px;
    animation: dotProgress var(--banner-interval, 3.8s) linear forwards;
}

@keyframes dotProgress {
    from { width: 0%; }
    to   { width: 100%; }
}

.top-banner.is-fallback{
    background: var(--card-bg);
    cursor: default;
}

.top-banner-fallback-single{
    position: relative;
    width: 100%;
}

.top-banner-fallback-single-thumb{
    width: 100%;
    aspect-ratio: 16 / 9;
    background: rgba(0,0,0,0.035);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.top-banner-fallback-single-img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    animation: bannerFallbackFadeIn 0.6s ease;
}

@keyframes bannerFallbackFadeIn {
    from { opacity: 0; transform: scale(1.04); }
    to   { opacity: 1; transform: scale(1.00); }
}

.top-banner-fallback-single-title{
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 12px;
    background: linear-gradient(180deg, rgba(0,0,0,0.00) 0%, rgba(0,0,0,0.55) 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-banner-fallback{
    padding: 10px;
}

.top-banner-fallback-track{
    display: flex;
    align-items: stretch;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.top-banner-fallback-track::-webkit-scrollbar{display:none;}

.top-banner-fallback-card{
    flex: 0 0 148px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    padding: 0;
    text-align: left;
    cursor: pointer;
}

.top-banner-fallback-card:active{transform: scale(0.99);}

.top-banner-fallback-thumb{
    width: 100%;
    height: 86px;
    background: rgba(0,0,0,0.035);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.top-banner-fallback-thumb img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.top-banner-fallback-emoji{
    font-size: 34px;
    line-height: 1;
}

.top-banner-fallback-title{
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-banner img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.top-banner:active {
    transform: scale(0.99);
    transition: transform 0.1s;
}
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 6px;
}

/* ========== 游戏卡片 ========== */
.game-card {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, box-shadow 0.2s ease;
    cursor: pointer;
    position: relative;
    animation: cardFadeIn 0.22s ease both;
}

@keyframes cardFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ========== 首页整体翻页动画 ========== */
#homeSlideContainer,
#oupaiSlideContainer {
    width: 100%;
    /* will-change 仅在动画播放时由 animation class 触发，避免永久 GPU 层影响 sticky */
}
@keyframes pageExitLeft  { from{transform:translateX(0);opacity:1} to{transform:translateX(-70px);opacity:0} }
@keyframes pageExitRight { from{transform:translateX(0);opacity:1} to{transform:translateX(70px);opacity:0} }
@keyframes pageEnterFromRight { from{transform:translateX(80px);opacity:0} to{transform:translateX(0);opacity:1} }
@keyframes pageEnterFromLeft  { from{transform:translateX(-80px);opacity:0} to{transform:translateX(0);opacity:1} }
#homeSlideContainer.page-exit-left  { animation: pageExitLeft  0.18s ease forwards; }
#homeSlideContainer.page-exit-right { animation: pageExitRight 0.18s ease forwards; }
#homeSlideContainer.page-enter-left { animation: pageEnterFromRight 0.22s ease forwards; }
#homeSlideContainer.page-enter-right{ animation: pageEnterFromLeft  0.22s ease forwards; }

.game-card:nth-child(2) { animation-delay: 28ms; }
.game-card:nth-child(3) { animation-delay: 56ms; }
.game-card:nth-child(4) { animation-delay: 84ms; }
.game-card:nth-child(5) { animation-delay: 112ms; }
.game-card:nth-child(6) { animation-delay: 140ms; }

.game-card:hover {
    box-shadow: var(--shadow-hover);
}

.game-card:active {
    transform: scale(0.99);
}

/* ========== 骨架屏加载占位 ========== */
.game-card-skeleton {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.skeleton-block {
    background: linear-gradient(
        90deg,
        var(--skeleton-base) 25%,
        var(--skeleton-highlight) 50%,
        var(--skeleton-base) 75%
    );
    background-size: 200% 100%;
    animation: skeletonShimmer 1.4s infinite;
    border-radius: 4px;
}
.game-card-skeleton .skeleton-img {
    width: 100%;
    height: 180px;
    border-radius: 0;
}
.game-card-skeleton .skeleton-content {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.game-card-skeleton .skeleton-title  { height: 14px; width: 78%; }
.game-card-skeleton .skeleton-tag    { height: 10px; width: 38%; }
.game-card-skeleton .skeleton-meta   { height: 10px; width: 54%; }
@keyframes skeletonShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ========== 水波纹点击反馈 ========== */
.mgw-ripple-wave {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: mgwRippleExpand 0.5s linear forwards;
    background: rgba(255, 255, 255, 0.22);
    pointer-events: none;
    z-index: 9;
}
@keyframes mgwRippleExpand {
    to { transform: scale(4); opacity: 0; }
}

.game-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    position: relative;
}

/* 封面中心“水滴波纹”引导（叠在图片上方，常驻，轻量） */
.game-image::before,
.game-image::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    transform: translate(-50%, -50%) scale(0.6);
    opacity: 0;
    z-index: 2;
    pointer-events: none;
}

.game-image::before {
    animation: none;
}

.game-image::after {
    animation: none;
}

@media (prefers-reduced-motion: reduce) {
    .game-image::before,
    .game-image::after {
        animation: none;
        opacity: 0;
    }
}

.game-category-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    max-width: calc(100% - 16px);
    padding: 4px 8px;
    border-radius: 8px;
    background: var(--primary-color);
    color: white;
    font-size: 11px;
    font-weight: 700;
    box-shadow: var(--shadow);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 3;
    display: none;
}

.game-top-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    border-radius: 8px;
    background: var(--bilibili-blue);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    box-shadow: var(--shadow);
    z-index: 3;
}

.game-image img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-image-fallback {
    position: relative;
    z-index: 1;
    line-height: 1;
}

.game-info {
    padding: 10px;
    display: flex;
    flex-direction: column;
}

.game-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    min-height: calc(1.4em * 2); /* 固定两行高度：一行标题时也预留第二行 */
}

.game-card-tags,
.oupai-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

@media (max-width: 768px) {
    .game-card-tags,
    .oupai-card-tags {
        display: flex !important;
        flex-wrap: nowrap !important;
        white-space: nowrap;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        width: 100%;
        max-width: 100%;
    }

    .game-card-tags::-webkit-scrollbar,
    .oupai-card-tags::-webkit-scrollbar {
        display: none;
    }

    .game-tag-chip,
    .oupai-tag-chip {
        flex: 0 0 auto !important;
        white-space: nowrap !important;
        max-width: none;
    }
}

.oupai-random-page-hint {
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    font-size: 12px;
    color: #8b5aa8;
    font-weight: 700;
    white-space: nowrap;
}

.game-tag-chip,
.oupai-tag-chip {
    border: 1px solid var(--oupai-tag-border, rgba(214, 187, 255, 0.88));
    background: var(--oupai-tag-bg, linear-gradient(135deg, rgba(255, 244, 251, 0.96), rgba(241, 244, 255, 0.98)));
    color: var(--oupai-tag-text, #a45dc3);
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: var(--oupai-tag-shadow, 0 6px 14px rgba(196, 170, 255, 0.12));
}

.game-tag-chip {
    cursor: default;
}

.oupai-tag-chip:active {
    transform: scale(0.97);
}

.game-meta,
.game-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.game-meta-row {
    justify-content: space-between;
    margin-top: 6px;
    width: 100%;
    flex-wrap: nowrap;
}

.meta-btn,
.meta-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 18px;
    padding: 0;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 49%;
}

.meta-btn-time,
.meta-time {
    color: #6b7280;
    max-width: 28%;
}

.meta-btn-category,
.meta-category {
    margin-left: auto;
    color: #6b7280;
    font-weight: 500;
}

.game-category-corner-badge {
    margin-left: auto;
    max-width: 72%;
    padding: 4px 9px;
    border-radius: 9px;
    background: var(--oupai-category-bg, linear-gradient(135deg, rgba(230,107,144,1) 0%, rgba(236,85,131,1) 100%));
    border: 1px solid var(--oupai-category-border, rgba(255,255,255,0.32));
    color: var(--oupai-category-text, #fff);
    font-size: 11px;
    font-weight: 800;
    box-shadow: var(--oupai-category-shadow, 0 4px 10px rgba(230,107,144,0.30));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.35;
    transform: translateZ(0);
    transition: transform .12s ease, filter .12s ease;
}

.game-card:active .game-category-corner-badge {
    transform: scale(0.97);
    filter: brightness(0.96);
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(230, 107, 144, 0.12);
    color: var(--primary-color);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.6;
}

.meta-chip.is-muted {
    background: rgba(107, 114, 128, 0.12);
    color: #6b7280;
}

.meta-link {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.game-footer {
    padding: 0 10px 10px;
    display: flex;
    gap: 6px;
    display: none;
}

.card-download-btn {
    width: 100%;
    border: none;
    background: var(--primary-color);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: var(--shadow);
}

.card-download-btn-half {
    flex: 1;
    min-width: 0;
    gap: 4px;
}

.card-download-btn:active {
    transform: scale(0.98);
}

.card-download-btn.is-disabled {
    background: #bdbdbd;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-icon {
    width: 16px;
    height: 16px;
    display: inline-block;
}

.btn-icon svg {
    width: 16px;
    height: 16px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ========== B站风格底部导航栏 ========== */
html.settings-loading .bottom-nav {
    visibility: hidden;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-offset);
    min-height: var(--bottom-nav-offset);
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
    z-index: 12000;
    padding-bottom: env(safe-area-inset-bottom);
    --nav-active-color: var(--primary-color);
    --nav-active-bg: rgba(251, 114, 153, 0.12);
    --nav-active-shadow: 0 8px 18px rgba(251, 114, 153, 0.16);
    transform: translateZ(0);
}

html.overlay-open .bottom-nav,
body.overlay-open .bottom-nav,
html.my-embed-open .bottom-nav,
body.my-embed-open .bottom-nav {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ===== 底部导航 —— 弹性图标 + 扩散光晕 ===== */
@keyframes navIconBounce {
    0%   { transform: scale(1); }
    30%  { transform: scale(0.78) translateY(2px); }
    60%  { transform: scale(1.22) translateY(-3px); }
    80%  { transform: scale(0.96) translateY(0); }
    100% { transform: scale(1.08); }
}
@keyframes navRipple {
    0%   { transform: scale(0.4); opacity: 0.5; }
    100% { transform: scale(2.6); opacity: 0; }
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 0;
    transition: color .22s cubic-bezier(0.34,1.56,0.64,1);
    color: var(--text-secondary);
    position: relative;
    -webkit-tap-highlight-color: transparent;
    border-radius: 14px;
    text-decoration: none;
    overflow: hidden;
}

/* 按下时整体轻压 */
.nav-item:active {
    transform: scale(0.92);
    transition: transform .08s ease;
}

.nav-item.active {
    color: var(--nav-active-color);
}

/* 激活态背景光晕（伪元素） */
.nav-item.active::before {
    content: '';
    position: absolute;
    inset: 4px 6px;
    border-radius: 10px;
    background: var(--nav-active-bg);
    z-index: 0;
    animation: navRipple 0.42s cubic-bezier(0.22,1,0.36,1) forwards;
}

.nav-item.nav-spacer {
    color: rgba(153, 153, 153, 0.45);
    pointer-events: none;
}

.nav-item.nav-spacer .nav-icon {
    opacity: 0.65;
}

.nav-item.nav-spacer .nav-label {
    opacity: 0.72;
}

.nav-item.nav-has-dot::after {
    content: '';
    position: absolute;
    right: 22%;
    top: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff3b30;
    border: 1.5px solid #fff;
    z-index: 2;
}

.nav-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1), color .22s ease;
}

.nav-icon svg {
    width: 100%;
    height: 100%;
    display: block;
    fill: none;
    stroke: currentColor;
}

/* 激活时图标弹跳 */
.nav-item.active .nav-icon {
    animation: navIconBounce 0.42s cubic-bezier(0.34,1.56,0.64,1) forwards;
}

.nav-label {
    font-size: 11px;
    font-weight: 500;
    position: relative;
    z-index: 1;
    transition: font-weight 0s, transform .22s cubic-bezier(0.34,1.56,0.64,1), color .22s ease;
}

/* 激活时文字微微上浮 + 加粗 */
.nav-item.active .nav-label {
    font-weight: 700;
    transform: translateY(-1px);
}

/* ========== “我的”内嵌页（无跳转痕迹） ========== */
html.my-embed-open,
body.my-embed-open {
    height: 100%;
    overflow: hidden;
}

/* ========== 通用遮罩：禁止滚动 ========== */
html.overlay-open,
body.overlay-open {
    height: 100%;
    overflow: hidden;
}

.my-overlay {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: var(--bottom-nav-offset); /* 预留底部导航高度 + 安全区 */
    background: var(--bg-color);
    z-index: 900; /* 底部导航 z-index=1000，需保留可点 */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}

.my-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition: opacity .22s ease, transform .22s ease, visibility 0s;
}

.my-frame {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: var(--bg-color);
}

/* ========== “影视”搜索弹层（浑然一体） ========== */
.video-overlay {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: var(--bottom-nav-offset);
    /* 改为“独立界面”：不再是弹窗遮罩 */
    background: var(--bg-color);
    z-index: 950;
    padding: 0;
    box-sizing: border-box;
    display: block;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}

.video-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition: opacity .22s ease, transform .22s ease, visibility 0s;
}

.video-frame {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: var(--bg-color);
}

.reward-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(12, 18, 36, 0.7);
    z-index: 65000;
}

.reward-modal {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(92vw, 460px);
    max-height: min(84vh, 760px);
    overflow: auto;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 14px 34px rgba(23, 24, 45, 0.2);
    z-index: 65001;
    -webkit-overflow-scrolling: touch;
}

.reward-modal-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 18px 10px;
}

.reward-modal-title {
    font-size: 18px;
    font-weight: 900;
    color: var(--text-primary);
}

.reward-modal-close {
    border: none;
    background: rgba(15, 23, 42, 0.06);
    color: #425466;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
}

.reward-modal-body {
    padding: 0 18px 18px;
}

.reward-qr-card {
    text-align: center;
}

.reward-qr-title {
    font-size: 16px;
    font-weight: 900;
    color: var(--text-primary);
}

.reward-tip {
    margin-top: 12px;
    padding: 14px 14px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 190, 190, 0.9);
    background: linear-gradient(180deg, #f7efe9 0%, #f4ede7 100%);
    color: var(--text-primary);
}

.reward-tip-title {
    font-size: 15px;
    font-weight: 1000;
}

.reward-tip-text {
    margin-top: 8px;
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 13px;
    text-align: left;
}

.reward-tags {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.reward-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 95, 109, 0.08);
    border: 1px solid rgba(255, 95, 109, 0.16);
    color: #d94b78;
    font-size: 12px;
    font-weight: 900;
}

.reward-qr-grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.reward-qr-grid.is-single {
    grid-template-columns: minmax(0, 1fr);
}

.reward-qr-loading {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-secondary);
    padding: 18px 12px;
}

.reward-qr-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-radius: 18px;
    border: 1px solid rgba(223, 228, 237, 0.95);
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.reward-qr-label {
    font-size: 13px;
    font-weight: 900;
    color: var(--text-primary);
}

.reward-qr-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border-radius: 14px;
    background: #fff;
    border: 1px solid rgba(226, 232, 240, 0.9);
}

.reward-qr-save {
    border: none;
    border-radius: 12px;
    height: 38px;
    font-size: 13px;
    font-weight: 900;
    color: #fff;
    background: linear-gradient(135deg, #ff8a4c 0%, #ff5f6d 55%, #fb7299 100%);
    box-shadow: 0 12px 26px rgba(255, 95, 109, 0.22);
    cursor: pointer;
}

.reward-qr-missing {
    border-radius: 12px;
    padding: 10px;
    font-size: 12px;
    line-height: 1.6;
    color: #8f4b4b;
    background: rgba(255, 92, 92, 0.08);
}

.reward-vx {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border-radius: 20px;
    background: linear-gradient(180deg, #f5fff7 0%, #f3faf5 100%);
    border: 1px solid rgba(49, 196, 141, 0.16);
}

.reward-vx-title {
    font-size: 13px;
    font-weight: 900;
    color: #1f7a57;
}

.reward-vx-img {
    width: min(100%, 220px);
    align-self: center;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(226, 232, 240, 0.9);
}

.reward-help {
    margin-top: 10px;
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 12px;
}

/* 覆盖页加载提示：减少“空白等待”的割裂感 */
.overlay-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    color: #b8c6ff;
    background: linear-gradient(180deg, rgba(10, 16, 40, 0.72), rgba(10, 16, 40, 0.46));
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 2;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .18s ease, visibility 0s linear .18s;
}

.overlay-loading.is-visible {
    opacity: 1;
    visibility: visible;
    transition: opacity .18s ease, visibility 0s;
}

.oupai-auth-gate {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: linear-gradient(180deg, rgba(248, 250, 255, 0.98), rgba(255, 245, 249, 0.98));
}

.oupai-auth-card {
    width: min(100%, 420px);
    padding: 24px 20px;
    border-radius: 22px;
    background: rgba(255,255,255,0.96);
    border: 1px solid rgba(251, 114, 153, 0.16);
    box-shadow: 0 20px 44px rgba(251, 114, 153, 0.14);
    text-align: center;
}

.oupai-auth-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 84px;
    padding: 6px 12px;
    border-radius: 999px;
    margin-bottom: 12px;
    font-size: 12px;
    font-weight: 900;
    color: #fff;
    background: linear-gradient(135deg, #fb7299 0%, #ff8db2 100%);
}

.oupai-auth-title {
    font-size: 20px;
    line-height: 1.35;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.oupai-auth-text {
    font-size: 14px;
    line-height: 1.75;
    color: var(--text-secondary);
}

.oupai-auth-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
}

.oupai-auth-btn {
    appearance: none;
    border: 1px solid rgba(251, 114, 153, 0.18);
    background: rgba(251, 114, 153, 0.06);
    color: var(--primary-color);
    min-height: 44px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
}

.oupai-auth-btn.primary {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #fb7299 0%, #ff8db2 100%);
    box-shadow: 0 12px 28px rgba(251, 114, 153, 0.18);
}

.oupai-auth-btn:active {
    transform: scale(0.98);
}

.overlay-loading-spinner {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(184, 198, 255, .35);
    border-top-color: rgba(184, 198, 255, .95);
    animation: overlaySpin .85s linear infinite;
}

.overlay-loading-text {
    font-size: 13px;
    letter-spacing: .2px;
    opacity: .95;
}

@keyframes overlaySpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .my-overlay,
    .video-overlay,
    .overlay-loading {
        transition: none !important;
    }
    .overlay-loading-spinner {
        animation: none !important;
    }
}

/* 弱网失败提示：居中小弹窗（可关闭） */
.net-fail-modal {
    position: fixed;
    inset: 0;
    z-index: 36000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(0, 0, 0, 0.28);
}

.net-fail-modal.is-visible {
    display: flex;
}

.net-fail-card {
    width: min(88vw, 340px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
    padding: 14px 14px 12px;
    color: #1f2a37;
}

.net-fail-title {
    font-size: 15px;
    font-weight: 800;
}

.net-fail-desc {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.55;
    color: #4b5563;
}

.net-fail-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.net-fail-btn {
    border: 0;
    border-radius: 9px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.net-fail-btn.secondary {
    background: #eef1f5;
    color: #344054;
}

.net-fail-btn.primary {
    background: var(--primary-color, #2f6bff);
    color: #fff;
}

.video-panel {
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 14px;
    margin-top: 0;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    /* iOS 上 touch-action 兼容不一致，过度限制会导致内部横向滚动失效 */
    touch-action: auto;
}

.video-content {
    position: relative;
    padding: calc(env(safe-area-inset-top) + 12px) 14px 18px;
    box-sizing: border-box;
}

.video-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.video-topbar-spacer {
    flex: 1;
}

.video-homeBox {
    margin-top: 10px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 14px;
    box-shadow: none;
}

.video-homeBox-title {
    font-size: 15px;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 10px;
}

/* 旧的 .video-header 不再使用（用户不喜欢顶部固定标题条） */

.video-back {
    appearance: none;
    border: 1px solid var(--border-color);
    background: rgba(0,0,0,0.06);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    font-weight: 900;
}

.video-back:hover {
    border-color: var(--primary-color);
}

.video-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-close {
    appearance: none;
    border: 1px solid var(--border-color);
    background: rgba(0,0,0,0.06);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.video-close:hover {
    border-color: var(--primary-color);
}

.video-searchbar {
    display: flex;
    gap: 10px;
    margin-top: 0;
    max-width: 100%;
}

.video-input {
    flex: 1;
    padding: 12px 12px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(0,0,0,0.06);
    color: var(--text-primary);
    outline: none;
    font-size: 14px;
}

.video-input:focus {
    border-color: var(--primary-color);
}

.video-search-btn {
    appearance: none;
    border: 1px solid var(--primary-color);
    background: var(--primary-color);
    color: #fff;
    padding: 12px 14px;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
    min-width: 84px;
}

.video-search-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.video-hint {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    min-height: 16px;
}

.video-hint.is-loading::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.18);
    border-top-color: var(--primary-color);
    margin-right: 8px;
    vertical-align: -1px;
    animation: videoSpin 0.8s linear infinite;
}

@keyframes videoSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.video-home {
    margin-top: 14px;
    display: grid;
    gap: 14px;
    max-width: 100%;
}

.video-home.is-hidden {
    display: none;
}

.video-section-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.video-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 100%;
}

.video-chip {
    appearance: none;
    border: 1px solid var(--border-color);
    background: rgba(0,0,0,0.06);
    color: var(--text-primary);
    padding: 10px 12px;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
    font-size: 13px;
}

.video-chip:hover {
    border-color: var(--primary-color);
}

.video-categories {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: scroll;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    max-width: 100%;
}

.video-categories::-webkit-scrollbar {
    height: 6px;
}

.video-categories::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.18);
    border-radius: 999px;
}

.video-rank-blocks {
    display: grid;
    gap: 10px;
}

.video-rank-block {
    border: 1px solid var(--border-color);
    background: rgba(0,0,0,0.06);
    border-radius: 14px;
    padding: 10px;
}

.video-rank-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 14px;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.video-rank-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
}

.video-rank-scroll::-webkit-scrollbar {
    height: 6px;
}

.video-rank-scroll::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.18);
    border-radius: 999px;
}

.video-poster {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    width: 92px;
    flex: 0 0 auto;
    text-align: left;
}

.video-poster-cover {
    position: relative;
    width: 92px;
    height: 128px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: rgba(0,0,0,0.08);
}

.video-poster-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-poster-rank {
    position: absolute;
    left: 8px;
    top: 8px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    color: #fff;
    background: rgba(0,0,0,0.68);
}

.video-poster-title {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 32px;
}

.video-tags {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.video-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    border: 1px solid var(--border-color);
    background: rgba(0,0,0,0.06);
    color: var(--text-secondary);
}

.video-category {
    appearance: none;
    border: 1px solid var(--border-color);
    background: rgba(0,0,0,0.06);
    color: var(--text-primary);
    padding: 10px 12px;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    font-size: 13px;
    flex: 0 0 auto;
    scroll-snap-align: start;
}

.video-category.has-img {
    padding-left: 44px;
    background-repeat: no-repeat;
    background-size: 26px 26px;
    background-position: 12px center;
}

.video-category:hover {
    border-color: var(--primary-color);
}

.video-results {
    margin-top: 10px;
    display: grid;
    gap: 10px;
    max-width: 100%;
}

.video-results.is-hidden {
    display: none;
}

.video-item {
    border: 1px solid var(--border-color);
    background: rgba(0,0,0,0.06);
    border-radius: 14px;
    padding: 12px;
}

.video-item-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.35;
}

.video-item-meta {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    word-break: break-all;
}

.video-item-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.video-action-btn {
    appearance: none;
    border: 1px solid var(--border-color);
    background: rgba(0,0,0,0.06);
    color: var(--text-primary);
    padding: 10px 12px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    font-size: 13px;
}

.video-action-btn:hover {
    border-color: var(--primary-color);
}

/* 中间大按钮（PWA安装）*/
.nav-center {
    position: relative;
    margin-top: -20px;
}

.nav-center-sponsor {
    position: relative;
    margin-top: -20px;
}

.nav-center .nav-label {
    margin-top: 8px;
    font-size: 11px;
    font-weight: 900;
}

.nav-center-sponsor .nav-label {
    margin-top: 8px;
    font-size: 11px;
    font-weight: 900;
}

.nav-center-sponsor::before,
.nav-center-sponsor::after {
    content: none;
}

/* 下载引导流光圈：仅保留给安装按钮，赞助桃心不继承 */
.nav-center:not(.nav-center-sponsor)::before,
.nav-center:not(.nav-center-sponsor)::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 66px;
    height: 66px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.nav-center:not(.nav-center-sponsor)::before {
    border: 2px solid rgba(251, 114, 153, 0.55);
    box-shadow: 0 0 0 0 rgba(251, 114, 153, 0.45);
    animation: navRingPulse 1.6s ease-out infinite;
}

.nav-center:not(.nav-center-sponsor)::after {
    background: conic-gradient(from 0deg, transparent 0deg, rgba(251, 114, 153, 0.85) 50deg, transparent 110deg);
    mask: radial-gradient(closest-side, transparent 62%, #000 63%);
    -webkit-mask: radial-gradient(closest-side, transparent 62%, #000 63%);
    animation: navRingSweep 2.1s linear infinite;
    opacity: 0.9;
}

.nav-center.nav-center-sponsor::before,
.nav-center.nav-center-sponsor::after {
    content: none !important;
    display: none !important;
    animation: none !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    opacity: 0 !important;
}

.nav-center-sponsor:active .center-plus {
    transform: scale(0.9);
}

@keyframes navRingPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.92);
        opacity: 0.9;
        box-shadow: 0 0 0 0 rgba(251, 114, 153, 0.35);
    }
    70% {
        transform: translate(-50%, -50%) scale(1.15);
        opacity: 0;
        box-shadow: 0 0 0 14px rgba(251, 114, 153, 0);
    }
    100% {
        opacity: 0;
    }
}

@keyframes navRingSweep {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.center-plus {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), #FF6B9D);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(251, 114, 153, 0.4);
    transition: all 0.3s;
}

.nav-center-sponsor .center-plus {
    background: linear-gradient(135deg, #ff8a4c 0%, #ff5f6d 55%, #fb7299 100%);
    box-shadow: 0 10px 22px rgba(255, 95, 109, 0.28);
    animation: sponsorHeartBreath 2.35s ease-in-out infinite;
}

.nav-center-sponsor .nav-center-label {
    color: #ff6b6b;
}

@keyframes sponsorHeartBreath {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 22px rgba(255, 95, 109, 0.24);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 14px 28px rgba(255, 95, 109, 0.34);
    }
}

.center-plus .center-icon {
    width: 24px;
    height: 24px;
    display: block;
    stroke: #fff;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.nav-center-sponsor .center-plus .center-icon {
    width: 26px;
    height: 26px;
    fill: #fff;
    stroke: none;
}

.nav-center:active .center-plus {
    transform: scale(0.9);
}

.center-plus span {
    font-size: 28px;
    color: white;
    font-weight: 300;
}

/* ========== 模态框 ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: absolute;
    bottom: var(--bottom-nav-offset);
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-radius: 20px 20px 0 0;
    max-height: calc(85vh - var(--bottom-nav-offset));
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.modal-header {
    position: sticky;
    top: 0;
    background: var(--card-bg);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
}

.modal-close:hover {
    background: var(--bg-color);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* 详情页底部下载按钮常驻区 */
.modal-footer {
    position: sticky;
    bottom: 0;
    background: var(--card-bg);
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border-color);
    z-index: 11;
    box-shadow: 0 -8px 20px rgba(15, 23, 42, 0.06);
}

.modal-footer .download-btn {
    margin-top: 10px;
}

.modal-image {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 16px;
}

.modal-section {
    margin-bottom: 20px;
}

.modal-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.modal-section p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.download-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.12s ease, filter 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
    margin-top: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.download-btn:active {
    transform: scale(0.98);
    filter: brightness(0.95);
}

/* ========== 响应式设计 ========== */
@media (min-width: 768px) {
    .games-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 18px;
    }

    .game-image {
        height: 220px;
        font-size: 72px;
    }
    
    .modal-content {
        max-width: 500px;
        left: 50%;
        transform: translateX(-50%);
        bottom: auto;
        top: 50%;
        transform: translate(-50%, -50%);
        border-radius: 20px;
    }
}

/* 大屏桌面保留底部导航，仅增加内容列数 */
@media (min-width: 1200px) {
    .games-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }
    
    .game-image {
        aspect-ratio: 16 / 9;
        height: auto;
    }
}

/* ========== 加载更多（不闪烁）========== */
.games-footer-wrap {
    grid-column: 1/-1;
}

.games-controls-container {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.load-more {
    grid-column: 1/-1;
    display: flex;
    justify-content: center;
    padding: 12px 0 8px;
}

.load-more-inline {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 6px 2px 2px;
}

.load-progress-jump {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    min-height: 48px;
    min-width: 0;
    width: 100%;
    justify-content: center;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.load-progress-jump::-webkit-scrollbar {
    display: none;
}

.jump-prefix,
.jump-mid {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.load-progress-jump .page-jump-input {
    width: 96px;
    min-width: 96px;
}

.load-progress-jump .page-jump-btn {
    height: 34px;
    padding: 0 10px;
    font-size: 13px;
    flex: 0 0 auto;
    min-width: 58px;
}

.pagination-total-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #fff;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.load-more-inline .download-btn {
    margin-left: 0;
    margin-top: 0;
    width: 100%;
    max-width: 280px;
    min-width: 0;
    justify-self: center;
}

@media (max-width: 480px) {
    .load-more-inline {
        grid-template-columns: minmax(0, 1fr) minmax(136px, 1fr);
        gap: 8px;
    }

    .load-progress-jump {
        gap: 4px;
        min-height: 44px;
    }

    .jump-prefix,
    .jump-mid {
        font-size: 12px;
    }

    .load-progress-jump .page-jump-input {
        width: 56px;
        min-width: 56px;
        height: 34px;
        font-size: 16px;
        padding: 0 4px;
    }

    .load-progress-jump .page-jump-btn {
        height: 32px;
        padding: 0 8px;
        font-size: 12px;
        border-radius: 9px;
        min-width: 56px;
    }

    .load-more-inline .download-btn {
        max-width: none;
        min-height: 44px;
        padding: 10px 8px;
        font-size: 15px;
    }
}

.list-pagination {
    grid-column: 1/-1;
    margin: 2px 0 18px;
    padding: 16px 14px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--card-bg);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pagination-block {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.015);
}

.pagination-block-jump {
    padding: 10px 12px;
}

.pagination-block-pages {
    padding: 10px 8px;
}

.pagination-line {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.pagination-pages {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.pagination-pages::-webkit-scrollbar {
    display: none;
}

.page-btn {
    flex: 0 0 auto;
    min-width: 36px;
    height: 34px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #fff;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 700;
    padding: 0 10px;
    cursor: pointer;
}

.page-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.page-btn.is-active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: #fff;
}

.page-nav {
    min-width: 72px;
    margin: 0;
}

.page-ellipsis {
    padding: 0 4px;
    color: var(--text-secondary);
    font-weight: 700;
}

.pagination-jump {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0;
}

.pagination-hint {
    font-size: 12px;
    color: var(--text-secondary);
}

.page-jump-input {
    width: 84px;
    height: 38px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0 10px;
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    letter-spacing: 0.2px;
    color: var(--text-primary);
    background: #fff;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.page-jump-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(251, 114, 153, 0.18);
}

/* 去掉 number 默认步进按钮，避免挤占数字显示空间 */
.page-jump-input[type="number"] {
    -moz-appearance: textfield;
}

.page-jump-input[type="number"]::-webkit-outer-spin-button,
.page-jump-input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.page-jump-btn {
    height: 34px;
    border: 1px solid var(--primary-color);
    border-radius: 10px;
    background: var(--primary-color);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 0 12px;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1;
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state.empty-state--centered {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(88vw, 360px);
    padding: 24px 18px 18px;
    border-radius: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.18);
    z-index: 1200;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 14px;
    line-height: 1.6;
}

/* ========== 弹窗和广告样式（保留兼容性）========== */
.floating-ad-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(3, 8, 20, 0.74);
    z-index: 40000;
}

.floating-ad {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 40001;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,255,255,0.95));
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 18px;
    box-shadow: 0 14px 34px rgba(2, 8, 20, 0.24);
    padding: 14px 14px 16px;
    max-width: 540px;
    width: min(92vw, 540px);
    text-align: left;
    animation: popupFadeIn 0.3s ease;
}

.floating-ad-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.floating-ad-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    color: #fff;
    background: linear-gradient(135deg, rgba(11,92,255,1) 0%, rgba(251,114,153,0.96) 120%);
}

.floating-ad-title {
    font-size: 18px;
    font-weight: 900;
    color: #121826;
    margin: 2px 0 10px;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.floating-ad img {
    width: 100%;
    border-radius: 14px;
    margin-bottom: 12px;
    display: block;
}

.floating-ad-content {
    color: #263043;
    font-size: 15px;
    line-height: 1.75;
    margin-bottom: 6px;
    word-break: break-word;
}

.floating-ad-link-wrap {
    display: block;
    color: inherit;
    text-decoration: none;
}

.floating-ad-close {
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.08);
    border: none;
    border-radius: 50%;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
}

.floating-ad-close:hover {
    background: rgba(0, 0, 0, 0.15);
}

.floating-dock-btn {
    position: fixed;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 999px;
    z-index: 39999;
    background: radial-gradient(circle at 28% 26%, rgba(255,255,255,0.34), rgba(255,255,255,0) 34%), linear-gradient(145deg, rgba(251,114,153,0.98) 0%, rgba(255,145,184,0.96) 100%);
    color: #fff;
    box-shadow: 0 8px 18px rgba(251, 114, 153, 0.2), inset 0 1px 1px rgba(255,255,255,0.28);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    touch-action: none;
    transition: box-shadow .18s ease, transform .12s ease, opacity .18s ease;
}

.floating-dock-btn:active {
    transform: scale(0.96);
}

.floating-dock-btn.is-dragging {
    box-shadow: 0 10px 22px rgba(251, 114, 153, 0.24), inset 0 1px 1px rgba(255,255,255,0.34);
}

.floating-dock-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.floating-dock-btn-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.floating-dock-btn-text {
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .2px;
    line-height: 1;
}

.floating-dock-btn--update {
    min-width: 72px;
    padding: 0 12px;
}

.floating-dock-btn--ad {
    width: 46px;
    padding: 0;
}

.floating-ad-reopen-dot {
    position: fixed;
    right: 14px;
    top: 50%;
    bottom: auto;
    width: 46px;
    height: 46px;
    z-index: 39999;
    transform: translateY(-50%);
}

.floating-ad-reopen-dot:active {
    transform: translateY(-50%) scale(0.96);
}

.floating-ad-reopen-dot.is-dragging {
    box-shadow: 0 14px 32px rgba(251, 114, 153, 0.3), inset 0 1px 1px rgba(255,255,255,0.45);
}

.custom-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    z-index: 40001;
    max-width: 500px;
    width: 90%;
    animation: popupSlide 0.3s ease;
}

.custom-popup .custom-popup-content {
    white-space: pre-line;
    word-break: break-word;
}

/* 小屏优化：顶部搜索更紧凑 */
@media (max-width: 480px) {
    .top-bar {
        padding: 5px 10px;
    }

    .logo {
        font-size: 18px;
    }

    .top-search-input {
        width: auto;
    }

    .top-actions {
        gap: 6px;
    }

    .top-help-btn {
        padding: 6px 9px;
        font-size: 11px;
        min-height: 36px;
    }

    .top-search {
        padding: 6px 8px;
        min-height: 36px;
        gap: 4px;
    }

    .top-search-btn {
        padding: 6px 10px;
        min-height: 28px;
        font-size: 12px;
    }

}

@keyframes popupSlide {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* ========== 欧派专区：API 卡片模式布局 ========== */
#oupaiOverlay {
    background:
        radial-gradient(circle at top left, rgba(255, 182, 224, 0.32), transparent 28%),
        radial-gradient(circle at top right, rgba(148, 187, 255, 0.28), transparent 26%),
        linear-gradient(180deg, #fff6fd 0%, #f6f7ff 48%, #f4fbff 100%);
}

.oupai-inner {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.oupai-top-shell {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(222, 201, 255, 0.78);
    box-shadow: 0 10px 30px rgba(165, 137, 255, 0.08);
}

.oupai-category-shell {
    padding-right: 0;
    background: transparent;
}

.oupai-topbar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 14px 8px;
    background: linear-gradient(180deg, rgba(255,255,255,0.48) 0%, rgba(255,255,255,0.08) 100%);
}

.oupai-topbar-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 2px 0 0;
    text-align: center;
}

.oupai-topbar-title {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 0.04em;
    color: #7d4fd9;
    text-shadow: 0 2px 8px rgba(195, 133, 255, 0.12);
}

.oupai-topbar-subtitle {
    color: #9f90c4;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

.oupai-search-row {
    min-width: 0;
    flex: 1 1 auto;
    max-width: 520px;
    margin: 0 auto;
    border: 1px solid rgba(217, 188, 255, 0.72);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 10px 28px rgba(196, 158, 255, 0.14);
}

.oupai-search-input {
    min-width: 0;
    color: #6d5799;
    font-weight: 600;
}

.oupai-search-input:focus {
    border-color: transparent;
}

.oupai-search-input::placeholder {
    color: #b39acb;
}

.oupai-search-btn {
    flex: 0 0 auto;
    background: linear-gradient(135deg, #ff8fc9 0%, #8f9dff 100%);
    box-shadow: 0 10px 20px rgba(164, 150, 255, 0.24);
}

.oupai-search-row .top-search-icon {
    color: #c26ad2;
}

.oupai-search-center {
    width: 100%;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.oupai-search-btn:active {
    opacity: 1;
}

.oupai-password-btn {
    flex: 0 0 auto;
    min-width: 74px;
    border-color: rgba(238, 167, 214, 0.4);
    background: linear-gradient(135deg, #fff0fa 0%, #eef2ff 100%);
    color: #b05ea9;
    box-shadow: 0 10px 24px rgba(255, 174, 221, 0.14);
}

.oupai-category-bar {
    padding: 0 12px;
    justify-content: center;
}

#oupaiCategoryBar .category-btn {
    border: 1px solid rgba(210, 187, 255, 0.78);
    background: rgba(255, 255, 255, 0.76);
    color: #8b68bc;
    box-shadow: 0 8px 18px rgba(197, 174, 255, 0.12);
}

#oupaiCategoryBar .category-btn.active,
#oupaiCategoryBar .category-btn:active {
    background: linear-gradient(135deg, #ff92ca 0%, #8d98ff 100%);
    border-color: transparent;
    color: #fff;
}

.oupai-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.oupai-top-banner {
    display: none;
    position: relative;
    overflow: hidden;
}

.oupai-banner-slide {
    position: absolute;
    inset: 0;
    border: none;
    padding: 0;
    background: transparent;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
}

.oupai-banner-track {
    width: 100%;
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    aspect-ratio: 16 / 9;
}

/* 删除旧的 absolute 覆盖模式 */

.oupai-banner-title {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 24px 14px 12px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.72) 100%);
}

.oupai-controls {
    margin-top: 14px;
}

.oupai-controls .load-more-inline.oupai-random-actions {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100%;
}

.oupai-controls .load-more-inline.oupai-random-actions .download-btn {
    display: inline-flex !important;
    min-width: 160px;
    width: auto !important;
    max-width: none !important;
    margin: 0 auto !important;
    justify-self: auto !important;
}

.oupai-controls .load-more-inline.oupai-random-actions .oupai-random-page-hint {
    display: block;
    width: 100%;
    text-align: center;
}

.oupai-controls .load-more-inline.oupai-random-actions .oupai-random-loading-hint {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
}

.oupai-main-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
    background:
        radial-gradient(circle at top center, rgba(255, 198, 230, 0.16), transparent 26%),
        linear-gradient(180deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0.62) 100%);
}

.oupai-main-content #oupaiGrid {
    padding-top: 0;
}

.oupai-main-content #oupaiControls {
    margin-bottom: env(safe-area-inset-bottom, 0px);
}

.oupai-grid .game-card {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(227, 204, 255, 0.82);
    box-shadow: 0 12px 26px rgba(184, 158, 255, 0.12);
    backdrop-filter: blur(14px);
}

.oupai-grid .game-card:hover {
    box-shadow: 0 16px 30px rgba(186, 156, 255, 0.18);
}

.oupai-grid .game-image {
    background: linear-gradient(135deg, #ffbddf 0%, #b7c5ff 52%, #97e5ff 100%);
}

.oupai-grid .game-title {
    color: #6b5695;
}

.oupai-grid .meta-text {
    color: #aa94c6;
}

.oupai-grid .game-category-corner-badge {
    background: var(--oupai-category-bg, linear-gradient(135deg, rgba(255, 153, 205, 0.18), rgba(146, 164, 255, 0.22)));
    color: var(--oupai-category-text, #9158c4);
    border-color: var(--oupai-category-border, rgba(218, 186, 255, 0.8));
    box-shadow: var(--oupai-category-shadow, 0 4px 10px rgba(230,107,144,0.18));
}

.oupai-controls .list-pagination,
.oupai-controls .pagination-block {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(220, 199, 255, 0.78);
    box-shadow: 0 10px 24px rgba(186, 156, 255, 0.1);
}

.oupai-controls .page-btn.is-active,
.oupai-controls .page-btn:active,
.oupai-controls .page-jump-btn,
.oupai-controls .download-btn {
    background-image: linear-gradient(135deg, #ff91c9 0%, #8e9bff 100%);
    border-color: transparent;
    color: #fff;
}

.oupai-controls .page-btn,
.oupai-controls .page-jump-input {
    border-color: rgba(216, 194, 255, 0.82);
}

@media (min-width: 768px) {
    .oupai-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 12px;
    }

    .oupai-topbar,
    .oupai-category-shell,
    .oupai-main-content {
        width: 100%;
        max-width: 1240px;
        margin: 0 auto;
        box-sizing: border-box;
        padding-left: 56px;
        padding-right: 56px;
    }

    .oupai-topbar {
        padding-top: 14px;
        padding-bottom: 10px;
    }

    .oupai-category-shell {
        padding-top: 0;
        padding-bottom: 4px;
        padding-right: 56px;
    }

    .oupai-main-content {
        padding-top: 22px;
        padding-bottom: 22px;
    }
}

#oupaiInner {
    display: flex;
    flex-direction: column;
}

#oupaiTopBar {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 1;
}

@media (max-width: 480px) {
    .oupai-topbar {
        padding: 8px 10px 7px;
    }

    .oupai-topbar-head {
        padding: 2px 0 0;
    }

    .oupai-topbar-title {
        font-size: 20px;
    }

    .oupai-topbar-subtitle {
        font-size: 11px;
    }

    .oupai-search-center {
        gap: 8px;
    }

    .oupai-password-btn {
        min-width: 64px;
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* ========== 系统深色模式适配 ========== */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #0D0D0D;
        --card-bg: #1A1A1A;
        --text-primary: #E8E8E8;
        --text-secondary: #909090;
        --border-color: #2D2D2D;
        --shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
        --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.7);
        --skeleton-base: #252525;
        --skeleton-highlight: #333333;
    }

    html {
        background: #0D0D0D;
    }

    /* 底部导航栏 */
    .bottom-nav {
        background: rgba(18, 18, 18, 0.97) !important;
        border-top-color: #2A2A2A;
    }

    /* 顶部搜索栏背景 */
    .top-search-bar,
    .bilibili-header {
        background: rgba(18, 18, 18, 0.97);
    }

    /* 搜索输入框 */
    .search-input-wrap,
    .search-input {
        background: #252525;
        color: var(--text-primary);
    }

    /* 分类胶囊（未选中） */
    .category-item:not(.is-active) {
        background: #252525;
        color: var(--text-secondary);
        border-color: #333;
    }

    /* 弹窗/详情背景 */
    .game-modal,
    .overlay-page,
    .modal-content {
        background: #1A1A1A;
    }

    /* 分页按钮 */
    .page-btn:not(.is-active) {
        background: #252525;
        color: var(--text-secondary);
        border-color: #333;
    }

    /* 跳页输入框 */
    .page-jump-input {
        background: #252525;
        color: var(--text-primary);
        border-color: #333;
    }

    /* 水波纹深色下调深一些 */
    .mgw-ripple-wave {
        background: rgba(255, 255, 255, 0.12);
    }
}
