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

/* 变量定义 */
:root {
    --primary-color: #4a6cf7;
    --secondary-color: #6c8eff;
    --accent-color: #ff6b35;
    --accent-hover: #e55a2b;
    --dark-color: #1a1a2e;
    --dark-surface: #16213e;
    --light-color: #f0f2f5;
    --card-bg: #ffffff;
    --text-color: #333;
    --text-light: #666;
    --text-muted: #999;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --box-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s ease;
    --tag-action: #e74c3c;
    --tag-puzzle: #3498db;
    --tag-adventure: #27ae60;
    --tag-arcade: #f39c12;
    --tag-strategy: #9b59b6;
    --tag-sports: #1abc9c;
    --tag-simulation: #e67e22;
}

/* 基础样式 */
body {
    font-family: 'Segoe UI', 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-color);
}

a {
    text-decoration: none;
    color: inherit;
}

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

/* ========== 导航栏 ========== */
.navbar {
    background-color: var(--dark-color);
    color: white;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.logo {
    font-size: 1.6rem;
    font-weight: 800;
    color: white;
    text-decoration: none;
    transition: var(--transition);
    letter-spacing: -0.5px;
}

.logo:hover {
    color: var(--accent-color);
}

/* 桌面端导航链接 */
.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a:hover {
    color: var(--accent-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--accent-color);
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

/* 汉堡菜单样式 */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 5px;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: white;
    transition: var(--transition);
    border-radius: 2px;
}

/* 移动端菜单样式 */
.mobile-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--dark-color);
    padding: 1rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.mobile-menu.active {
    display: flex;
}

.mobile-menu a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 500;
    padding: 0.6rem 1rem;
    transition: var(--transition);
    width: 100%;
    text-align: center;
}

.mobile-menu a:hover {
    color: var(--accent-color);
    background-color: rgba(255, 255, 255, 0.05);
}

/* ========== Hero 区域 ========== */
.hero {
    background: linear-gradient(135deg, var(--dark-color) 0%, var(--dark-surface) 50%, var(--primary-color) 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 0.8rem;
    letter-spacing: -0.5px;
}

.hero-content p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.75);
    max-width: 600px;
    margin: 0 auto 1.5rem;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
}

.hero-stats .stat {
    text-align: center;
}

.hero-stats .stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent-color);
    display: block;
}

.hero-stats .stat-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========== 分类标签导航 ========== */
.category-nav {
    background-color: white;
    border-bottom: 1px solid #e8e8e8;
    position: sticky;
    top: 60px;
    z-index: 999;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.category-nav::-webkit-scrollbar {
    height: 0;
}

.category-nav .container {
    display: flex;
    gap: 0;
    align-items: center;
    padding: 0;
}

.category-tab {
    padding: 0.9rem 1.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-tab:hover {
    color: var(--primary-color);
}

.category-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* ========== 主内容区 ========== */
.main-content {
    padding: 1.5rem 0 2rem;
}

/* ========== 热门游戏横幅 ========== */
.featured-section {
    margin-bottom: 2rem;
}

.featured-section h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.featured-section h2 .fire-icon {
    color: var(--accent-color);
}

.featured-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.featured-scroll::-webkit-scrollbar {
    height: 4px;
}

.featured-scroll::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}

/* ========== 游戏分类区域 ========== */
.game-category {
    margin-bottom: 2rem;
}

.game-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.game-category-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-color);
}

.view-all-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    transition: var(--transition);
}

.view-all-link:hover {
    color: var(--accent-color);
}

/* ========== 游戏网格 ========== */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

/* ========== 游戏卡片 ========== */
.game-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    position: relative;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--box-shadow-hover);
}

.game-card a {
    display: block;
    text-decoration: none;
    color: var(--text-color);
}

.game-card-thumb {
    position: relative;
    overflow: hidden;
}

.game-card img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    transition: var(--transition);
}

.game-card:hover img {
    transform: scale(1.05);
}

/* 卡片上的分类标签 */
.game-card .card-category-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-category-badge.cat-Action { background-color: var(--tag-action); }
.card-category-badge.cat-Puzzle { background-color: var(--tag-puzzle); }
.card-category-badge.cat-Adventure { background-color: var(--tag-adventure); }
.card-category-badge.cat-Arcade { background-color: var(--tag-arcade); }
.card-category-badge.cat-Strategy { background-color: var(--tag-strategy); }
.card-category-badge.cat-Sports { background-color: var(--tag-sports); }
.card-category-badge.cat-Simulation { background-color: var(--tag-simulation); }

/* 卡片信息区 */
.game-info {
    padding: 0.75rem 0.8rem;
}

.game-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: var(--transition);
}

.game-card:hover .game-info h3 {
    color: var(--primary-color);
}

.game-info p {
    font-size: 0.8rem;
    color: var(--text-light);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 卡片标签区 */
.game-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    padding: 0 0.8rem 0.6rem;
}

.game-card-tags .tag {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    background-color: var(--light-color);
    color: var(--text-light);
    border-radius: 3px;
    font-weight: 500;
}

/* ========== 详情页 ========== */
.game-detail {
    padding: 1.5rem 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--accent-color);
}

/* 详情页头部 */
.game-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    background-color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
}

.game-image {
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

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

.game-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.game-details h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.8rem;
    color: var(--text-color);
}

/* 详情页分类和标签 */
.game-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    align-items: center;
}

.game-meta .meta-category {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
}

.game-meta .meta-tag {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    background-color: var(--light-color);
    color: var(--text-light);
}

.game-meta .meta-updated {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: auto;
}

.game-details .game-desc {
    margin-bottom: 1.5rem;
    line-height: 1.7;
    color: var(--text-color);
    font-size: 0.95rem;
}

.play-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: var(--accent-color);
    color: white;
    padding: 0.9rem 2rem;
    border-radius: var(--border-radius-sm);
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.play-button:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 53, 0.4);
}

/* ========== 编辑评测模块 ========== */
.editorial-section {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    margin: 0 0 2rem;
    box-shadow: var(--box-shadow);
}

.editorial-section h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--light-color);
}

.editorial-summary {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: var(--light-color);
    border-radius: var(--border-radius-sm);
    border-left: 4px solid var(--primary-color);
}

/* How to Play */
.editorial-block {
    margin-bottom: 1.5rem;
}

.editorial-block h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.editorial-block ul,
.editorial-block ol {
    padding-left: 1.2rem;
    margin-bottom: 0;
}

.editorial-block li {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 0.4rem;
    color: var(--text-color);
}

/* Pros / Cons 两栏 */
.pros-cons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.pros-block,
.cons-block {
    padding: 1rem;
    border-radius: var(--border-radius-sm);
}

.pros-block {
    background-color: #e8f5e9;
    border-left: 4px solid #27ae60;
}

.cons-block {
    background-color: #fce4ec;
    border-left: 4px solid #e74c3c;
}

.pros-block h3 {
    color: #27ae60;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.cons-block h3 {
    color: #e74c3c;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.pros-block li,
.cons-block li {
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 0.3rem;
}

/* FAQ */
.faq-block {
    margin-top: 1rem;
}

.faq-item {
    margin-bottom: 0.8rem;
    padding: 0.8rem 1rem;
    background-color: var(--light-color);
    border-radius: var(--border-radius-sm);
}

.faq-item .faq-q {
    font-weight: 700;
    color: var(--text-color);
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.faq-item .faq-a {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.5;
}

/* ========== 相关游戏 ========== */
.related-games {
    background-color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.related-games h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-color);
}

/* ========== 首页内容段落 ========== */
.home-content-section {
    padding: 2rem 0;
}

.home-content-block {
    background-color: white;
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.home-content-block h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 2rem 0 0.8rem;
}

.home-content-block h2:first-child {
    margin-top: 0;
}

.home-content-block h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 1.5rem 0 0.6rem;
}

.home-content-block p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-color);
    margin-bottom: 0.8rem;
}

@media (max-width: 768px) {
    .home-content-block {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .home-content-block {
        padding: 1.2rem;
    }

    .home-content-block h2 {
        font-size: 1.2rem;
    }

    .home-content-block h3 {
        font-size: 1rem;
    }
}

/* ========== 页脚 ========== */
.footer {
    background-color: var(--dark-color);
    color: white;
    padding: 2.5rem 0 1.5rem;
    margin-top: 2rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: white;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--accent-color);
}

.copyright {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
}

/* ========== 法律页面 ========== */
.page-content {
    padding: 2rem 0;
}

.page-container {
    background-color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.page-container h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.page-container h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 1.5rem 0 0.8rem;
    color: var(--secondary-color);
}

.page-container p {
    margin-bottom: 1rem;
    line-height: 1.7;
    font-size: 0.95rem;
}

.page-container ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.page-container li {
    margin-bottom: 0.5rem;
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .hero {
        padding: 2rem 0;
    }

    .hero-content h1 {
        font-size: 1.8rem;
    }

    .hero-content p {
        font-size: 0.95rem;
    }

    .hero-stats {
        gap: 1.5rem;
    }

    .hero-stats .stat-number {
        font-size: 1.4rem;
    }

    .category-nav {
        top: 60px;
    }

    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.8rem;
    }

    .game-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .pros-cons-grid {
        grid-template-columns: 1fr;
    }

    .footer-links {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
    }

    .game-card img {
        height: 110px;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 1.5rem;
    }

    .hero-stats {
        gap: 1rem;
    }

    .hero-stats .stat-number {
        font-size: 1.2rem;
    }

    .hero-stats .stat-label {
        font-size: 0.7rem;
    }

    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 0.6rem;
    }

    .game-card img {
        height: 95px;
    }

    .game-info h3 {
        font-size: 0.85rem;
    }

    .game-info p {
        font-size: 0.75rem;
    }

    .game-card-tags {
        display: none;
    }

    .game-content,
    .editorial-section,
    .related-games,
    .page-container {
        padding: 1.2rem;
    }

    .game-details h1 {
        font-size: 1.4rem;
        word-break: break-word;
    }

    .game-detail {
        padding: 1rem 0;
    }

    .editorial-section h2 {
        font-size: 1.1rem;
    }
}

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

.game-category {
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
}

.game-category:nth-child(1) { animation-delay: 0s; }
.game-category:nth-child(2) { animation-delay: 0.1s; }
.game-category:nth-child(3) { animation-delay: 0.2s; }
.game-category:nth-child(4) { animation-delay: 0.3s; }
.game-category:nth-child(5) { animation-delay: 0.4s; }

/* ========== 滚动条样式 ========== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}
