/*
 * index.css - 首页特有样式
 */

/* ============================
   1. Hero 区域
   ============================ */
.hero {
    position: relative;
    height: 400px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--border-radius);
    overflow: hidden;
    margin: 20px 0 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
}

.hero-content {
    max-width: 600px;
    padding: 0 20px;
    z-index: 2;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 25px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.hero .btn {
    background-color: white;
    color: var(--primary-color);
    font-size: 1.1rem;
    padding: 12px 30px;
}

.hero .btn:hover {
    background-color: var(--light-color);
    color: var(--dark-color);
}

/* ============================
   2. 热门游戏区域
   ============================ */
.popular-games {
    margin: 40px 0;
}

.popular-games h2 {
    font-size: 1.8rem;
    color: var(--dark-color);
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.popular-games h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--primary-color);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    width: 100%;
}

/* ============================
   3. 分类区域
   ============================ */
.categories {
    margin: 50px 0;
}

.categories h2 {
    font-size: 1.8rem;
    color: var(--dark-color);
    margin-bottom: 25px;
    text-align: center;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--dark-color);
    padding: 25px 15px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: transform var(--transition-duration);
}

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

.category-card .icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

.category-card .casual {
    background: linear-gradient(45deg, #3498db, #9b59b6);
}

.category-card .puzzle {
    background: linear-gradient(45deg, #2ecc71, #3498db);
}

.category-card .action {
    background: linear-gradient(45deg, #e74c3c, #f39c12);
}

.category-card .sports {
    background: linear-gradient(45deg, #1abc9c, #2ecc71);
}

.category-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
}

/* ============================
   4. 游戏卡片
   ============================ */
.game-card {
    background-color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    transition: transform var(--transition-duration) ease-in-out, 
                box-shadow var(--transition-duration) ease-in-out;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

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

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

.game-card .info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.game-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--dark-color);
    line-height: 1.3;
}

.game-card .rating {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.game-card .stars {
    color: #f39c12;
    margin-right: 5px;
}

.game-card .popularity {
    background-color: #f5f7fa;
    color: var(--gray-color);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.game-card .intro {
    font-size: 0.95rem;
    color: var(--gray-color);
    margin-top: 10px;
    flex-grow: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* ============================
   5. 响应式调整
   ============================ */
@media (max-width: 768px) {
    .hero {
        height: 300px;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }
    
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .hero {
        height: 250px;
    }
    
    .hero h2 {
        font-size: 1.8rem;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .category-card {
        padding: 20px;
    }
}