/* === 全局重置 + 全宽固定布局 === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background: linear-gradient(145deg, #ecf5fa 0%, #daeaf5 50%, #e8f0f8 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
    color: #1a2835;
    font-size: 7.5px;
    line-height: 1.25;
    letter-spacing: 0.1px;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
    -webkit-transform: none;
    transform: none;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ===== 蓝色小球背景画布 ===== */
#colorful-bubbles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.8;
    background: transparent;
}

.navbar, .merchant-banner, .scroll-area, .bottom-nav {
    position: relative;
    z-index: 2;
}

/* 顶部导航栏 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 36px;
    background-color: #ffffff;
    border-bottom: 1px solid #e1e1e1;
    display: flex;
    align-items: center;
    padding: 0 8px;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.navbar-title {
    font-size: 11px;
    font-weight: 600;
    color: #1a1a1a;
    flex: 1;
    white-space: nowrap;
}

.games-count {
    background-color: #1a6be0;
    color: white;
    font-size: 7.5px;
    border-radius: 8px;
    padding: 1px 4px;
    margin-left: 3px;
}

.search-container {
    position: relative;
    width: 100px;
    flex-shrink: 0;
}

.search-input {
    width: 100%;
    padding: 3px 6px 3px 22px;
    font-size: 8px;
    border: 1px solid #ddd;
    border-radius: 12px;
    background-color: #f0f0f0;
    outline: none;
    transition: all 0.3s;
    color: #333;
}

.search-input:focus {
    width: 140px;
    background-color: #e8e8e8;
    border-color: #aaa;
}

.search-input::placeholder {
    color: #888;
    font-size: 8px;
}

.search-icon {
    position: absolute;
    left: 7px;
    top: 50%;
    transform: translateY(-50%);
    color: #777;
    font-size: 9px;
}

/* 商家入驻按钮 */
.merchant-banner {
    position: fixed;
    top: 36px;
    left: 0;
    right: 0;
    height: 32px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 10px;
    font-weight: 600;
    text-decoration: none;
    z-index: 99;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 
                inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.merchant-banner i {
    margin-right: 5px;
    font-size: 11px;
    color: #555;
}

/* ===== 可滚动的内容区域 ===== */
.scroll-area {
    position: fixed;
    top: 68px; /* 36 + 32 = 68px */
    bottom: 52px;
    left: 0;
    right: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    z-index: 1;
    padding: 10px 8px 8px 8px;
    background: transparent;
}

/* 容器 */
.games-container {
    max-width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ===== 功能按钮 ===== */
.function-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 4px;
    padding: 0 2px;
}

.func-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(200, 215, 230, 0.9);
    border-radius: 12px;
    text-decoration: none;
    color: #1e3a5f;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 20, 40, 0.06);
    padding: 6px 4px 5px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.func-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.98);
    border-color: #90b0d0;
    box-shadow: 0 6px 12px rgba(0, 30, 60, 0.12);
}

.func-image {
    width: 38px;
    height: 38px;
    margin-bottom: 5px;
    background-color: #d6e3f0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.5);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

.func-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
}

.func-label {
    font-size: 8px;
    font-weight: 600;
    color: #122b44;
    line-height: 1.2;
    letter-spacing: 0.2px;
}

.func-sub {
    font-size: 6.5px;
    color: #5f7d9c;
    line-height: 1.2;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 2px;
}

/* ===== 横向滑动卡片区域 ===== */
.slider-section {
    width: 100%;
    margin-bottom: 4px;
}

.section-title {
    font-size: 10px;
    font-weight: 600;
    color: #1e3a5f;
    margin-bottom: 6px;
    padding-left: 2px;
    letter-spacing: 0.3px;
}

.horizontal-scroll {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 4px;
    gap: 8px;
    scroll-snap-type: x mandatory;
}

.horizontal-scroll::-webkit-scrollbar {
    height: 3px;
    background-color: rgba(200, 215, 230, 0.4);
    border-radius: 4px;
}

.horizontal-scroll::-webkit-scrollbar-thumb {
    background-color: #9bb7d4;
    border-radius: 4px;
}

.scroll-card {
    flex: 0 0 auto;
    width: 80px;
    background: transparent;
    border: none;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    scroll-snap-align: start;
}

.card-cover {
    width: 100%;
    aspect-ratio: 4 / 3;
    background-color: #cbdbe9;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 0;
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.card-label-area {
    background-color: #ffffff;
    padding: 4px 3px 3px 3px;
    text-align: center;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    border: 1px solid #e0e8f0;
    border-top: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    min-height: 26px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-main-label {
    font-size: 7.5px;
    font-weight: 600;
    color: #1f3a57;
    line-height: 1.2;
    margin-bottom: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-sub-label {
    font-size: 6px;
    color: #6f8aa8;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== 图标行区域 ===== */
.icon-row-section {
    width: 100%;
    margin: 4px 0 6px 0;
}

.icon-row-scroll {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    gap: 10px;
    padding: 2px 0 6px 0;
    scroll-snap-type: x mandatory;
}

.icon-row-scroll::-webkit-scrollbar {
    height: 3px;
    background-color: rgba(200, 215, 230, 0.4);
    border-radius: 4px;
}

.icon-row-scroll::-webkit-scrollbar-thumb {
    background-color: #9bb7d4;
    border-radius: 4px;
}

.icon-item {
    flex: 0 0 auto;
    width: 60px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    scroll-snap-align: start;
}

.icon-image {
    width: 60px;
    height: 60px;
    background-color: #cbdbe9;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.4);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.icon-label-area {
    width: 100%;
    background: transparent; 
    padding: 4px 0 0 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.icon-main-label {
    font-size: 7px;
    font-weight: 600;
    color: #1f3a57;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.icon-sub-label {
    font-size: 5.5px;
    color: #6f8aa8;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== 大游戏卡片 ===== */
.large-game-card {
    display: flex;
    flex-direction: row;
    background-color: #ffffff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s, box-shadow 0.2s;
    width: 100%;
    height: auto;
    min-height: 68px;
}

.large-game-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
}

.large-card-left {
    width: 80px;
    flex-shrink: 0;
    background-color: #d9e6f2;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.large-card-right {
    flex: 1;
    padding: 5px 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    background: rgba(255,255,255,0.9);
}

.large-card-title {
    font-size: 10px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.2;
    margin-bottom: 1px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.large-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin: 1px 0;
}

.large-tag {
    background-color: #eef2f6;
    color: #2f4858;
    font-size: 6.5px;
    padding: 1px 5px;
    border-radius: 10px;
    font-weight: 500;
}

.large-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1px;
    color: #6b7a8a;
    font-size: 7px;
}

.large-card-footer span i {
    font-size: 8px;
    margin-left: 2px;
    color: #3f6b9c;
}

.no-results {
    text-align: center;
    padding: 30px 15px;
    color: #999;
    font-size: 10px;
    display: none;
}

/* ===== 底部导航栏 ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 52px;
    background: rgba(230, 235, 240, 0.75);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border-top: 1px solid rgba(160, 170, 180, 0.3);
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    z-index: 998;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.04);
    padding-bottom: env(safe-area-inset-bottom, 0);
    padding-top: 0;
    width: 100%;
}

.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    text-decoration: none;
    color: #6b7a8a;
    font-size: 7px;
    padding: 2px 0 4px 0;
    flex: 1;
    gap: 0.5px;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
    border-radius: 16px 16px 0 0;
    margin: 0 0.5px;
    height: 100%;
    position: relative;
    background: transparent;
    border: none;
    transform: translateY(0);
    box-shadow: none;
}

.bottom-nav .nav-item.active {
    color: #1e3a5f;
    font-weight: 600;
    background: #ffffff;
    transform: translateY(-5px);
    box-shadow: 
        0 -2px 4px -2px rgba(0, 0, 0, 0.1),
        0 2px 6px -4px rgba(0, 0, 0, 0.2),
        inset 0 1px 2px rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-bottom: none;
    z-index: 10;
}

.bottom-nav .nav-icon {
    font-size: 16px;
    line-height: 1;
    filter: drop-shadow(0 1px 1px rgba(255,255,255,0.5));
    color: #5e6f7e;
    transition: color 0.2s;
}

.bottom-nav .nav-item.active .nav-icon {
    color: #1e3a5f;
}

/* 小屏幕微调 */
@media (max-width: 380px) {
    .func-image {
        width: 32px;
        height: 32px;
    }
    .scroll-card {
        width: 70px;
    }
    .icon-item {
        width: 52px;
    }
    .icon-image {
        width: 52px;
        height: 52px;
    }
}

@media (max-width: 320px) {
    .large-card-left {
        width: 70px;
    }
    .bottom-nav {
        height: 48px;
    }
}

/* ========= 弹窗样式 ========= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(3px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.2s, opacity 0.2s ease;
}

.modal-overlay.show {
    visibility: visible;
    opacity: 1;
}

.modal-overlay.hide-animation {
    opacity: 0;
    visibility: hidden;
    transition: visibility 0.2s, opacity 0.2s ease;
}

.modal-container {
    background: #ffffff;
    border-radius: 12px;
    width: 280px;
    max-width: 88vw;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(160, 190, 210, 0.5);
    overflow: hidden;
    transform: scale(0.92);
    transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

.modal-overlay.show .modal-container {
    transform: scale(1);
}

.modal-overlay.hide-animation .modal-container {
    transform: scale(0.94);
}

.modal-header {
    background: #eef3fc;
    padding: 8px 10px 5px 10px;
    border-bottom: 1px solid #d9e2ec;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 9px;
    font-weight: 700;
    color: #1e3a5f;
    letter-spacing: 0.3px;
    margin: 0;
    line-height: 1.2;
}

.modal-close {
    background: none;
    border: none;
    font-size: 12px;
    cursor: pointer;
    color: #7c8f9e;
    padding: 0 2px;
    transition: color 0.1s;
}

.modal-close:hover {
    color: #1a2c3f;
}

.modal-content {
    padding: 10px 0 12px 0;
}

.modal-desc {
    font-size: 7.5px;
    color: #2c3e4e;
    line-height: 1.35;
    margin-bottom: 6px;
    font-weight: 500;
    padding: 0 12px;
}

.modal-highlight {
    background: #f0f6fe;
    border-left: 2px solid #1e6fd9;
    padding: 5px 6px;
    margin: 6px 12px 5px 12px;
    border-radius: 4px;
}

.modal-highlight p {
    font-size: 6.8px;
    margin: 2px 0;
    color: #0f3b60;
}

.modal-highlight strong {
    font-size: 7px;
    color: #c7452b;
}

.modal-platform {
    font-size: 6.5px;
    color: #5d7385;
    margin: 4px 12px 2px 12px;
    display: inline-block;
    line-height: 1.3;
}

.modal-promo-img {
    width: 100%;
    margin: 8px 0 6px 0;
    text-align: center;
    background: #f8fafc;
}

.modal-promo-img img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    background: #ffffff;
    border: none;
    border-radius: 0;
}

.modal-footer {
    display: flex;
    justify-content: center;
    margin-top: 8px;
    margin-bottom: 4px;
}

.modal-btn {
    background: linear-gradient(95deg, #1f6390, #2c7cb0);
    border: none;
    padding: 6px 18px;
    border-radius: 30px;
    color: white;
    font-size: 8.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    letter-spacing: 0.3px;
}

.modal-btn:hover {
    background: linear-gradient(95deg, #17547a, #236894);
    transform: scale(0.97);
}

.modal-note {
    font-size: 5.8px;
    text-align: center;
    margin-top: 6px;
    margin-bottom: 2px;
    color: #a0aaba;
    padding: 0 12px;
}