/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', 'Microsoft YaHei', sans-serif;
    background: #ffffff;
    color: #333;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    grid-template-areas: 
        "top-section"
        "game-area"
        "ads";
    min-height: 100vh;
    gap: 20px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* 顶部区域 */
.top-section {
    grid-area: top-section;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
}

/* Logo区域 */
.logo-area {
    flex-shrink: 0;
}

.logo {
    width: 100px;
    height: 100px;
    border-radius: 15px;
    object-fit: cover;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* 游戏选择区域 */
.game-selection {
    flex: 1;
    position: relative;
    padding: 0 20px;
}

/* 游戏介绍卡片 */
.game-intro-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 400px;
    height: 100px;
    box-sizing: border-box;
}

.game-intro-card:hover {
    border-color: #4A90E2;
    box-shadow: 0 4px 16px rgba(74, 144, 226, 0.2);
    transform: translateY(-1px);
}

.game-intro-card.expanded {
    border-color: #4A90E2;
    box-shadow: 0 4px 16px rgba(74, 144, 226, 0.2);
}

.card-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.card-content {
    flex: 1;
}

.card-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin: 0 0 4px 0;
}

.card-description {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.card-arrow {
    font-size: 12px;
    color: #666;
    transition: transform 0.3s ease;
}

.card-arrow.rotated {
    transform: rotate(180deg);
}

/* 游戏卡片容器 */
.game-cards-container {
    position: absolute;
    top: 100%;
    left: 20px;
    right: 20px;
    z-index: 10;
    background: #fff;
    border: 2px solid #4A90E2;
    border-top: none;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 16px rgba(74, 144, 226, 0.2);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.game-cards-container.expanded {
    max-height: 300px;
}

.game-cards {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 270px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #4A90E2 #f1f1f1;
}

/* WebKit滚动条样式 */
.game-cards::-webkit-scrollbar {
    width: 6px;
}

.game-cards::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.game-cards::-webkit-scrollbar-thumb {
    background: #4A90E2;
    border-radius: 3px;
}

.game-cards::-webkit-scrollbar-thumb:hover {
    background: #357ABD;
}

/* 游戏卡片 */
.game-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-card:hover {
    background: #e3f2fd;
    border-color: #4A90E2;
    transform: translateX(5px);
}

.game-card-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.game-card-content {
    flex: 1;
}

.game-card-title {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin: 0 0 2px 0;
}

.game-card-description {
    font-size: 12px;
    color: #666;
    margin: 0;
    line-height: 1.3;
}

/* 游戏区域 */
.game-area {
    grid-area: game-area;
    background: #f8f9fa;
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.game-container {
    width: 100%;
    height: 700px;
    position: relative;
}

.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 40px;
}

.welcome-screen h2 {
    font-size: 32px;
    margin-bottom: 15px;
    color: #333;
}

.welcome-screen p {
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
}

.game-preview {
    margin-top: 20px;
}

.preview-card {
    background: #fff;
    padding: 30px;
    border-radius: 20px;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    max-width: 400px;
}

.preview-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.preview-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #333;
}

.preview-card p {
    font-size: 14px;
    color: #666;
}

#gameFrame {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 15px;
}

/* 广告区域 */
.ad-section {
    grid-area: ads;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    text-align: center;
    min-height: 120px;
}

.ad-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .container {
        gap: 15px;
        padding: 15px;
    }
    
    .top-section {
        gap: 15px;
    }
    
    .logo {
        width: 100px;
        height: 100px;
    }
    
    .game-container {
        height: 600px;
    }
    
    .game-item {
        width: 350px;
        height: 180px;
    }
    
    .game-name {
        font-size: 18px;
    }
    
    .game-description {
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .container {
        gap: 10px;
        padding: 10px;
    }
    
    .top-section {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        text-align: center;
    }
    
    .logo {
        width: 100px;
        height: 100px;
    }
    
    .game-container {
        height: 500px;
    }
    
    .welcome-screen h2 {
        font-size: 24px;
    }
    
    .welcome-screen p {
        font-size: 16px;
    }
    
    .game-item {
        width: 300px;
        height: 160px;
        padding: 15px;
    }
    
    .game-name {
        font-size: 16px;
    }
    
    .game-description {
        font-size: 12px;
        max-width: 280px;
    }
}



/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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