/* ==================== layout.css ==================== */
/* 基础布局、容器、页面结构样式 */
/* 包含：全局重置、页面容器、轮播图、跑马灯、全局加载、图片懒加载、 */
/* 卡片组件、空状态、按钮组、工具类、响应式适配、滚动条美化、底部认证信息 */

/* ==================== 全局样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: #1a1c2e;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin-top: 0 !important;
    padding-top: 0 !important;
    overflow-x: hidden;
}

#app {
    max-width: 750px;
    margin: 0 auto;
    background: #1a1c2e;
    min-height: 100vh;
    position: relative;
    padding-bottom: 60px;
    overflow-x: hidden;
}

/* ==================== 轮播图 ==================== */
.banner {
    width: 100%;
    height: 150px;
    background: #2a2d4a;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 15px;
    z-index: 1;
}

.banner::before {
    display: none;
}

/* 轮播指示器 */
.banner-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 3;
}

.banner-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.banner-dot.active {
    background: #ffd700;
    width: 20px;
    border-radius: 3px;
}

/* ==================== 跑马灯 ==================== */
.marquee {
    background: #2a2d4a;
    padding: 5px 15px;
    border-radius: 25px;
    margin: 8px 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    position: relative;
    height: 36px;
}

/* 喇叭图标 */
.marquee-icon {
    font-size: 12px;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
    padding: 3px 10px;
    border-radius: 12px;
    flex-shrink: 0;
    margin-right: 10px;
    white-space: nowrap;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* 滚动内容 */
.marquee-content-wrapper {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
}

.marquee-content {
    display: inline-block;
    animation: marquee 20s linear infinite;
    color: #ffd700;
    font-size: 13px;
}

.marquee-content .highlight {
    color: #e74c3c;
    font-weight: bold;
}

.marquee-content .platform {
    color: #f39c12;
    font-weight: bold;
}

@keyframes marquee {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* 更多按钮 */
.marquee-more {
    background: linear-gradient(135deg, #7cb87c 0%, #9dc49d 100%);
    color: white;
    padding: 6px 16px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 10px;
    transition: all 0.3s;
    position: relative;
}

.marquee-more:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(67, 160, 71, 0.4);
}

/* 角标 */
.marquee-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    font-size: 10px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* ==================== 全局加载样式 ==================== */
.global-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 28, 46, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.global-loading .loading-spinner {
    position: relative;
    width: 60px;
    height: 60px;
    margin-bottom: 20px;
}

.global-loading .spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid rgba(255, 215, 0, 0.2);
    border-top-color: #FFD700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.global-loading .spinner-ring.delay-1 {
    animation-delay: 0.1s;
    border-width: 2px;
}

.global-loading .spinner-ring.delay-2 {
    animation-delay: 0.2s;
    border-width: 1px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.global-loading .loading-text {
    font-size: 14px;
    color: #999;
}

/* ==================== 图片懒加载样式 ==================== */
.lazy-image {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lazy-image.lazy-loaded {
    opacity: 1;
}

.lazy-image.lazy-loading {
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
}

.lazy-image.lazy-error {
    background: linear-gradient(135deg, rgba(244,67,54,0.1) 0%, rgba(244,67,54,0.05) 100%);
}

/* ==================== 图片占位符 ==================== */
.img-placeholder {
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.img-placeholder::before {
    content: '🖼️';
    font-size: 24px;
    opacity: 0.3;
}

/* ==================== 卡片组件 ==================== */
.card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.card-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
    border-left: 4px solid #7cb87c;
    padding-left: 10px;
}

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #999;
}

/* ==================== 按钮组 ==================== */
.btn-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 15px;
}

/* ==================== 工具类 ==================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }

.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }

.p-10 { padding: 10px; }
.p-15 { padding: 15px; }
.p-20 { padding: 20px; }

.hidden { display: none; }
.visible { display: block; }

/* ==================== 响应式适配 ==================== */
@media screen and (max-width: 750px) {
    .subcategory-sidebar {
        width: 70px;
    }

    .subcategory-item {
        font-size: 10px;
        padding: 8px 3px;
    }

    .game-card-icon {
        width: 70px;
        height: 70px;
    }

    .game-card {
        padding: 8px 4px;
    }
}

@media screen and (max-width: 375px) {
    .games-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .subcategory-sidebar {
        width: 65px;
    }

    .subcategory-item {
        font-size: 9px;
        padding: 6px 2px;
    }

    .game-card-icon {
        width: 60px;
        height: 60px;
    }

    .game-card-name {
        font-size: 11px;
    }

    .game-categories {
        grid-template-columns: repeat(2, 1fr);
    }

    .category-item.tall {
        min-height: 160px !important;
        height: 160px !important;
    }
}

/* ==================== 滚动条美化 ==================== */
/* 隐藏滚动条 */
::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
    background: transparent;
}

html, body {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* ==================== 底部认证信息 ==================== */
.footer-certification {
    background: #2a2d4a;
    padding: 8px 15px 30px 15px;
    text-align: center;
    margin-top: 5px;
}

.cert-row {
    margin-bottom: 20px;
}

.cert-row:last-child {
    margin-bottom: 0;
}

/* 第一行：18+年龄限制 */
.age-row {
    display: flex;
    justify-content: center;
}

.age-placeholder {
    width: 80px;
    height: 80px;
    background: #e0e0e0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 12px;
}

/* 第二行：合作伙伴Logo */
.partners-row {
    display: flex;
    justify-content: center;
    gap: 1px;
    flex-wrap: nowrap;
}

.partner-placeholder {
    width: 80px;
    height: 50px;
    background: transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    flex-shrink: 0;
    overflow: hidden;
}

.partner-placeholder img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* 第三行：认证列表 */
.certifications-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 20px;
}

.cert-item {
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
}

.cert-placeholder {
    width: 32px;
    height: 32px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: bold;
    color: #999;
    flex-shrink: 0;
}

.cert-text {
    font-size: 11px;
    color: #888;
    line-height: 1.3;
    white-space: nowrap;
}

/* 第四行：版权信息 */
.copyright-row {
    font-size: 13px;
    color: #666;
    padding-top: 10px;
}
