/* 全局样式 */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --text-color: #333;
    --text-light: #fff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 头部样式 */
header {
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header h1 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 2.5rem;
}

/* 导航栏样式 */
nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    list-style: none;
}

.categories a {
    color: var(--text-light);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.categories a:hover, .categories a.active {
    background-color: var(--secondary-color);
}

.search {
    display: flex;
    width: 100%;
    max-width: 500px;
}

.search input {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 4px 0 0 4px;
}

.search button {
    padding: 0.5rem 1rem;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

/* 广告位样式 */
.ad-banner {
    background-color: #fff;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.ad-placeholder {
    background-color: #eee;
    padding: 2rem;
    text-align: center;
    border: 1px dashed #ccc;
}

/* 游戏网格样式 */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.game-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    cursor: pointer;
    position: relative;
    padding-bottom: 56.25%; /* 16:9宽高比 */
}

.game-card:hover {
    transform: translateY(-5px);
}

.preview-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.game-preview {
    width: 100%;
    height: 100%;
    border: none;
    background: #f5f5f5;
}

.game-info {
    padding: 1rem;
}

.game-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.game-category {
    display: inline-block;
    background-color: var(--light-color);
    color: var(--dark-color);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* 模态框样式 */
.game-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    height: 80%;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2rem;
    color: white;
    cursor: pointer;
    z-index: 1001;
}

#gameFrame {
    width: 100%;
    height: 100%;
    border: none;
}

/* 页脚样式 */
footer {
    background-color: var(--dark-color);
    color: var(--text-light);
    padding: 1rem 0;
    text-align: center;
    margin-top: auto;
}

footer nav {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

footer a {
    color: var(--text-light);
    text-decoration: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    .categories {
        flex-direction: column;
        align-items: center;
    }
}
