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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 头部导航 */
.header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo h1 {
    font-size: 24px;
    color: #4CAF50;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    padding: 5px 0;
    position: relative;
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #4CAF50;
    transition: width 0.3s ease;
}

.nav a:hover::after,
.nav a.active::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
}

/* 搜索栏 */
.search-section {
    background-color: #4CAF50;
    padding: 20px 0;
}

.search-box {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
}

.search-box input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 5px 0 0 5px;
    font-size: 16px;
}

.search-box button {
    background-color: #3d8b40;
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    font-size: 16px;
}

.search-box button:hover {
    background-color: #367c39;
}

/* 游戏分类 */
.categories {
    padding: 40px 0;
}

.categories h2 {
    margin-bottom: 30px;
    text-align: center;
    color: #333;
    font-size: 28px;
}

.category-list {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.category-item {
    background-color: white;
    padding: 15px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
}

.category-item:hover,
.category-item.active {
    background-color: #4CAF50;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 游戏详情页面样式 */
.game-detail-section {
    padding: 40px 0;
}

.game-detail-content {
    background-color: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

.back-button {
    margin-bottom: 20px;
}

.game-basic-info {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.game-cover {
    width: 300px;
    height: 400px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.game-cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-info {
    flex: 1;
    min-width: 300px;
}

.game-info h2 {
    font-size: 28px;
    margin-bottom: 15px;
    color: #333;
}

.game-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.category-tag {
    background-color: #f0f0f0;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 14px;
    margin-right: 10px;
    margin-bottom: 10px;
    display: inline-block;
}

.game-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
}

.game-rating i {
    color: #FFD700;
}

.game-description {
    margin-bottom: 20px;
    color: #666;
    line-height: 1.7;
}

.game-stats {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.stat-label {
    font-size: 14px;
    color: #666;
}

.game-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.play-game-btn,
.favorite-btn {
    padding: 12px 25px;
    font-size: 16px;
}

.favorite-btn.favorited {
    background-color: #f44336;
    color: white;
}

.game-screenshots {
    margin-bottom: 30px;
}

.game-screenshots h3 {
    font-size: 22px;
    margin-bottom: 20px;
    color: #333;
}

.screenshots-container {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 15px;
}

.screenshot-item {
    min-width: 250px;
    height: 160px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.screenshot-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-screenshots {
    padding: 30px 0;
    text-align: center;
    color: #999;
    font-style: italic;
}

.game-instructions {
    margin-bottom: 30px;
}

.game-instructions h3 {
    font-size: 22px;
    margin-bottom: 20px;
    color: #333;
}

#game-instructions {
    list-style-position: inside;
    color: #666;
    line-height: 1.7;
}

#game-instructions li {
    margin-bottom: 10px;
}

.related-games {
    margin-top: 40px;
}

.related-games h3 {
    font-size: 22px;
    margin-bottom: 20px;
    color: #333;
}

.related-game-card {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.related-game-icon-container {
    width: 60px;
    height: 60px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e0e0e0;
    border-radius: 50%;
}

.related-game-icon {
    font-size: 24px;
    color: #4CAF50;
}

.related-game-title {
    font-size: 16px;
    color: #333;
    margin: 0;
}

.no-related-games {
    padding: 30px 0;
    text-align: center;
    color: #999;
    font-style: italic;
}

/* 游戏网格 */
.popular-games,
.category-games {
    padding: 40px 0;
}

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

.section-header h2 {
    font-size: 28px;
    color: #333;
}

.view-all a {
    text-decoration: none;
    color: #4CAF50;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.view-all a:hover {
    text-decoration: underline;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

/* 添加媒体查询，手机端每行最多显示两条游戏 */
@media (max-width: 768px) {
    .game-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.game-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    text-align: center;
}

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

.game-card-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
    overflow: hidden;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.game-card-content {
    padding: 15px 0 0;
}

.game-card-title {
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
}

.game-card-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #666;
    width: 100%;
}

.game-card-rating {
    display: flex;
    align-items: center;
    gap: 5px;
}

.game-card-rating i {
    color: #FFD700;
}

/* 页脚 */
.footer {
    background-color: #333;
    color: white;
    padding: 40px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-info h3,
.footer-links h4,
.footer-social h4 {
    margin-bottom: 15px;
    font-size: 18px;
}

.footer-info p {
    color: #ccc;
}

.footer-links ul {
    list-style: none;
}

.footer-links a {
    color: #ccc;
    text-decoration: none;
    display: block;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: white;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-icons a:hover {
    background-color: #4CAF50;
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #ccc;
    font-size: 14px;
}

/* 游戏详情页 */
.game-detail-section {
    padding: 40px 0;
}

.back-button {
    margin-bottom: 20px;
}

.game-basic-info {
    display: flex;
    gap: 30px;
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

.game-cover {
    width: 100%;
    height: 300px;
    background-color: #f0f0f0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.game-cover-icon {
    font-size: 80px;
    color: #333;
    transition: transform 0.3s ease;
}

.game-cover:hover .game-cover-icon {
    transform: scale(1.1);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .game-cover {
        height: 200px;
    }
    
    .game-cover-icon {
        font-size: 60px;
    }
}

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

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

.game-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.game-category {
    background-color: #f0f0f0;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    color: #666;
}

.game-rating {
    display: flex;
    align-items: center;
    gap: 5px;
}

.game-rating i {
    color: #FFD700;
}

.game-description {
    margin-bottom: 20px;
    color: #666;
    line-height: 1.8;
}

.game-stats {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
}

.stat-item i {
    color: #4CAF50;
}

.game-actions {
    display: flex;
    gap: 15px;
}

.game-actions .btn {
    padding: 12px 30px;
    font-size: 16px;
}

.play-game-btn i {
    margin-right: 8px;
}

.favorite-btn i {
    margin-right: 8px;
}

#contactUrl{
    color: #fff;
}

/* 游戏截图 */
.game-screenshots,
.game-instructions,
.related-games {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

.game-screenshots h3,
.game-instructions h3,
.related-games h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
}

.screenshots-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.screenshot-item {
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.screenshot-item:hover {
    transform: scale(1.03);
}

.screenshot-item img {
    width: 100%;
    height: auto;
}

/* 游戏说明 */
#game-instructions-content {
    line-height: 1.8;
    color: #666;
}

/* 相关游戏 */
#related-games-container {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header .container {
        padding: 10px 20px;
    }
    
    .nav {
        display: none;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .game-basic-info {
        flex-direction: column;
    }
    
    .game-cover {
        width: 100%;
        max-width: 300px;
        height: auto;
        margin: 0 auto;
    }
    
    .game-stats {
        flex-wrap: wrap;
        gap: 20px;
    }
    
    .game-actions {
        flex-direction: column;
    }
    
    .game-actions .btn {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .search-box {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-box button {
        border-radius: 5px;
    }
    
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .category-list {
        gap: 10px;
    }
    
    .category-item {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* 移动端菜单 */
.mobile-menu-active .nav {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: white;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.mobile-menu-active .nav ul {
    flex-direction: column;
    gap: 15px;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-card {
    animation: fadeIn 0.5s ease-out;
}

/* 加载状态 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: #666;
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 相关游戏容器 */
#related-games-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
}

/* 相关游戏卡片 */
.related-game-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding: 10px;
    border-radius: 10px;
}

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

/* 图标容器 */
.related-game-icon-container {
    width: 80px;
    height: 80px;
    background-color: #f8f8f8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* 图标样式 */
.related-game-icon {
    width: 60%;
    height: 60%;
    object-fit: contain;
}

/* 删除旧的图片样式 */
.related-game-image {
    display: none;
}

/* 响应式调整 */
@media (max-width: 768px) {
    #related-games-container {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    
    .related-game-icon-container {
        width: 60px;
        height: 60px;
    }
}