/* General Body Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
}

header {
    background-color: #ffffff;
    padding: 2rem 1rem;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
}

header h1 {
    margin: 0;
    color: #007aff;
    font-size: 2.5rem;
}

main {
    padding: 2rem 1rem;
}

/* Game Grid Layout */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

/* Game Card Styles */
.game-card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.game-card__image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
}

.game-card__content {
    padding: 1rem;
    flex-grow: 1;
}

.game-card__title {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.game-card__description {
    font-size: 0.9rem;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Footer Styles */
footer {
    text-align: center;
    padding: 1.5rem;
    background-color: #ffffff;
    border-top: 1px solid #e0e0e0;
    margin-top: 2rem;
    font-size: 0.9rem;
    color: #888;
}

/* Styles for Game Detail and Play pages */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.game-detail__image {
    width: 100%;
    max-width: 400px;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: #007aff;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background-color 0.3s ease;
    text-align: center;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
}

.btn:hover {
    background-color: #005bb5;
}

/* Iframe for the game */
.game-frame-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

#game-frame {
    border: none;
    width: 100%;
    height: 100%;
}

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

.hidden {
    display: none !important;
}

.center {
    text-align: center;
}

/* 导航栏样式 */
header {
    background-color: #2c3e50;
    color: #fff;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 1.5rem;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    padding: 0.5rem 0;
}

nav ul li a:hover, nav ul li a.active {
    color: #3498db;
}

/* 主页样式 */
.hero {
    text-align: center;
    padding: 4rem 0;
    background-color: #3498db;
    color: #fff;
    margin-bottom: 2rem;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.hero .btn {
    background-color: #fff;
    color: #3498db;
    font-size: 1.1rem;
    padding: 1rem 2rem;
}

.hero .btn:hover {
    background-color: #f1f1f1;
}

/* 游戏列表样式 */
.featured-games, .game-browser {
    padding: 2rem 0;
}

.featured-games h2, .game-browser h2, .categories h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.game-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.game-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.game-card-content {
    padding: 1rem;
}

.game-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.category-tag {
    display: inline-block;
    background-color: #f1f1f1;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.game-card p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

.game-card .btn {
    width: 100%;
    text-align: center;
    padding: 0.6rem;
}

/* 分类样式 */
.categories {
    padding: 2rem 0;
    background-color: #f9f9f9;
}

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

.category-item {
    display: block;
    background-color: #fff;
    padding: 1.5rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.category-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    color: #3498db;
}

/* 搜索和过滤器样式 */
.search-container {
    text-align: center;
    margin-bottom: 1.5rem;
}

#search-input {
    width: 100%;
    max-width: 500px;
    padding: 0.8rem 1.2rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.category-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 2rem;
    gap: 0.8rem;
}

.filter-btn {
    background-color: #f1f1f1;
    color: #333;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn:hover {
    background-color: #e1e1e1;
}

.filter-btn.active {
    background-color: #3498db;
    color: #fff;
}

/* 游戏播放页面样式 */
.game-play {
    padding: 2rem 0;
}

.game-play h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.game-details {
    margin-bottom: 1.5rem;
}

.game-details p {
    margin-bottom: 0.5rem;
}

.iframe-container {
    position: relative;
    padding-bottom: 70%; /* 调整比例 */
    height: 0;
    overflow: hidden;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    background-color: #f1f1f1;
}

.iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    z-index: 1;
}

/* 媒体查询 - 响应式设计 */
@media (max-width: 768px) {
    .hero h2 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .category-filters {
        flex-direction: column;
        align-items: center;
    }
    
    .filter-btn {
        width: 80%;
    }
}

@media (max-width: 480px) {
    header .container {
        flex-direction: column;
    }
    
    nav ul {
        margin-top: 1rem;
    }
    
    nav ul li {
        margin-left: 1rem;
        margin-right: 1rem;
    }
    
    .game-grid {
        grid-template-columns: 1fr;
    }
}

/* Filter and Search Controls */
.filter-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
}

#category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

#category-filters button {
    padding: 8px 16px;
    border: 1px solid #ccc;
    background-color: #f0f0f0;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.2s ease-in-out;
}

#category-filters button:hover {
    background-color: #e0e0e0;
    border-color: #bbb;
}

#category-filters button.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.search-wrapper input {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 20px;
    min-width: 250px;
}

/* Pagination Styles */
#pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
    gap: 8px;
}

#pagination-container a {
    color: #007bff;
    padding: 8px 16px;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 5px;
    transition: background-color 0.3s;
}

#pagination-container a:hover {
    background-color: #f0f0f0;
}

#pagination-container a.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

#pagination-container a.disabled {
    color: #ccc;
    pointer-events: none;
    border-color: #eee;
}

/* Utility Classes */
.hidden {
    display: none;
}

.loader {
    font-style: italic;
    color: #888;
} 