/* ===== 简约大气·清新通用版 ===== */
:root {
    --primary: #3b82f6;
    --primary-light: #60a5fa;
    --primary-dark: #2563eb;
    --secondary: #8b5cf6;
    --accent: #f59e0b;
    --bg: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.9);
    --card-border: rgba(59, 130, 246, 0.15);
    --text: #1e293b;
    --text-light: #64748b;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
    --radius: 20px;
    --radius-sm: 12px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    overflow-x: hidden;
}

/* 主容器 */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* 头部导航 */
.main-nav {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--card-border);
    position: relative;
    overflow: hidden;
}

.header-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.nav-brand {
    width: 100%;
}

.nav-title {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.5rem;
}

.nav-subtitle {
    font-size: 0.9rem;
    color: var(--text-light);
    background: #f1f5f9;
    display: inline-block;
    padding: 0.3rem 1rem;
    border-radius: 40px;
    margin-top: 0.5rem;
}

/* 快速导航按钮 */
.quick-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.nav-btn {
    background: white;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 0.8rem 0.5rem;
    text-align: center;
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(4px);
}

.nav-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

/* 广告区域 */
.banner-section {
    margin-bottom: 2rem;
}

.banner-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.banner-card {
    background: white;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
    border: 1px solid #eef2ff;
}

.banner-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.banner-link {
    display: block;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #f8fafc;
}

.banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.banner-card:hover .banner-image {
    transform: scale(1.02);
}

.banner-content {
    padding: 0.6rem;
    text-align: center;
    background: white;
}

.banner-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 搜索栏 */
.search-section {
    margin-bottom: 2rem;
}

.search-box {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.8rem;
    border: 1px solid #e2e8f0;
    border-radius: 48px;
    font-size: 0.95rem;
    background: white;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

/* 游戏网格 */
.games-section {
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1.2rem;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
}

.section-subtitle {
    color: var(--text-light);
    font-size: 0.85rem;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.2rem;
}

/* 游戏卡片 */
.game-card {
    background: white;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
    border: 1px solid #eef2ff;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.game-media {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f1f5f9;
}

.game-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.game-card:hover .game-poster {
    transform: scale(1.05);
}

.game-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
}

.game-info {
    padding: 0.8rem;
}

.game-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
    line-height: 1.3;
    height: 2.6rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.game-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    font-size: 0.75rem;
}

.game-type {
    background: #eef2ff;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    color: var(--primary);
    font-weight: 500;
}

.game-rating {
    color: var(--accent);
}

.play-button {
    width: 100%;
    background: var(--primary);
    border: none;
    border-radius: 40px;
    padding: 0.6rem;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.play-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.play-button.loading {
    background: #94a3b8;
    cursor: not-allowed;
}

/* 底部 */
.app-footer {
    text-align: center;
    padding: 1.5rem;
    background: white;
    border-radius: var(--radius);
    margin-top: 2rem;
    border: 1px solid #eef2ff;
    color: var(--text-light);
    font-size: 0.85rem;
}

/* 模态框 */
.game-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.game-modal.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.game-modal-header {
    width: 95%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border-radius: 12px 12px 0 0;
    padding: 0.8rem 1.2rem;
}

.game-title-bar {
    font-weight: 600;
    color: var(--primary);
}

.modal-btn {
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.2s;
}

.modal-btn:hover {
    background: #e2e8f0;
}

.game-modal-content {
    width: 95%;
    max-width: 1200px;
    height: 85vh;
    background: white;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.game-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* 保护提示 */
.protection-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: white;
    text-align: center;
}

/* 响应式 */
@media (max-width: 1024px) {
    .games-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
    }
    .quick-nav {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.8rem;
    }
    .banner-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.8rem;
    }
    .games-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.8rem;
    }
    .nav-title {
        font-size: 1.4rem;
    }
}

@media (max-width: 640px) {
    .quick-nav {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }
    .nav-btn {
        font-size: 0.7rem;
        padding: 0.6rem 0.2rem;
    }
    .banner-title {
        font-size: 0.7rem;
    }
    .game-title {
        font-size: 0.8rem;
    }
    .play-button {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    .game-info {
        padding: 0.5rem;
    }
}

/* 游戏卡片随机颜色备用（可忽略） */
.color-1, .color-2, .color-3, .color-4, .color-5, .color-6 {
    /* 仅用于渐变背景，保留但无实际影响 */
}