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

:root {
    --primary-color: #4a6bff;
    --secondary-color: #3451c7;
    --accent-color: #ff6b4a;
    --background-color: #f5f7fa;
    --card-background: #ffffff;
    --text-color: #333333;
    --text-light: #777777;
    --border-radius: 12px;
    --card-shadow: 0 8px 16px rgba(0,0,0,0.1);
    --transition-speed: 0.3s;
}

body {
    font-family: 'Arial', 'Microsoft YaHei', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 页面头部 */
.page-header {
    text-align: center;
    padding: 30px 0;
    margin-bottom: 20px;
}

.page-header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.page-header p {
    font-size: 1.2rem;
    color: var(--text-light);
}

/* 游戏卡片网格 */
.games-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(200px, 400px));
    gap: 20px;
    margin-bottom: 40px;
    justify-content: center;
}

/* 游戏卡片样式 */
.game-card {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    cursor: pointer;
    width: 100%;
    height: 200px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(0,0,0,0.15);
}

/* LOGO卡片特殊样式 */
.logo-card {
    background-color: #ffffff;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    text-align: center;
}

.logo-card img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 15px;
    object-fit: cover;
    background-color: white;
    padding: 5px;
}

.logo-card .card-content h2 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.logo-card .card-content p {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* 普通游戏卡片样式 */
.game-card .card-thumbnail {
    height: 60%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    background-color: rgba(0,0,0,0.05);
}

.game-card .card-info {
    padding: 15px;
    height: 40%;
    display: flex;
    flex-direction: column;
}

.game-card .card-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-card .card-description {
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 页脚样式 */
.page-footer {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 20px;
    margin-top: 20px;
}

.copyright, .copyright-text {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.ad-container {
    margin-bottom: 20px;
    border-radius: var(--border-radius);
    overflow: hidden;
}

/* 响应式设计 */
@media (max-width: 900px) {
    .games-grid {
        grid-template-columns: repeat(2, minmax(200px, 1fr));
    }
}

@media (max-width: 600px) {
    .games-grid {
        grid-template-columns: minmax(200px, 100%);
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .game-card {
        max-width: 100%;
    }
}

/* 容器页样式 */
.game-container {
    width: 100%;
    height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.game-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    position: relative;
}

/* 上部分：菜单区域 */
.top-menu {
    background-color: var(--accent-color);
    padding: 10px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 10;
}

.menu-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 下部分：游戏区域 */
.game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.game-iframe {
    width: 100%;
    flex-grow: 1;
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.home-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background-color: white;
    color: var(--primary-color);
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: bold;
    transition: all var(--transition-speed);
}

.home-button:hover {
    background-color: rgba(255,255,255,0.9);
    transform: translateY(-2px);
}

/* 加载和错误状态样式 */
.loading-screen, .error-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(255,255,255,0.9);
    z-index: 100;
    padding: 20px;
    text-align: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0,0,0,0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    margin-bottom: 20px;
    animation: spin 1s linear infinite;
}

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

.loading-screen h2, .error-screen h2 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.loading-screen p, .error-screen p {
    color: var(--text-light);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.retry-btn {
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 15px;
}

.back-link {
    color: var(--primary-color);
    text-decoration: underline;
}

/* 广告浮层样式 */
.ad-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.ad-modal {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    padding: 25px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    text-align: center;
}

.ad-modal h2 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.ad-modal p {
    margin-bottom: 20px;
    color: var(--text-light);
}

.ad-content {
    margin: 25px 0;
    min-height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0,0,0,0.05);
    border-radius: var(--border-radius);
}

.ad-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.ad-button {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-weight: bold;
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

.primary-button {
    background-color: var(--accent-color);
    color: white;
}

.primary-button:hover {
    background-color: #e05a3b;
}

.secondary-button {
    background-color: #e2e8f0;
    color: var(--text-color);
}

.secondary-button:hover {
    background-color: #d1d9e6;
}

.hidden {
    display: none;
}
