* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    min-height: 100vh;
    color: #333;
}

.header {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    color: #2a5298;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.header p {
    color: #666;
    font-size: 1.1rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.game-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

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

.game-image {
    width: 100%;
    height: 250px;
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: all 0.3s ease;
}

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

.game-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(0,0,0,0.1) 0%,
        rgba(0,0,0,0.3) 50%,
        rgba(0,0,0,0.6) 100%
    );
    transition: all 0.3s ease;
}

.game-card:hover .game-image-overlay {
    background: linear-gradient(
        135deg,
        rgba(0,0,0,0.2) 0%,
        rgba(0,0,0,0.4) 50%,
        rgba(0,0,0,0.7) 100%
    );
}

.game-title-overlay {
    position: absolute;
    bottom: 15px;
    left: 20px;
    right: 20px;
    color: white;
    font-size: 1.8rem;
    font-weight: bold;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.8);
    z-index: 2;
    transform: translateY(10px);
    opacity: 0;
    transition: all 0.3s ease;
}

.game-card:hover .game-title-overlay {
    transform: translateY(0);
    opacity: 1;
}

/* 图片加载状态 */
.game-image.image-loaded::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.game-image.image-error::after {
    content: '🎮';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    z-index: 2;
}

.game-content {
    padding: 25px;
}

.game-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2a5298;
    margin-bottom: 15px;
}

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

.game-type {
    display: inline-block;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
}

.play-button {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: #2a5298;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    z-index: 10;
}

.play-button:hover {
    background: #1e3c72;
    transform: scale(1.05);
}

.search-bar {
    text-align: center;
    margin-bottom: 30px;
}

.search-input {
    padding: 15px 25px;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    width: 300px;
    max-width: 90%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    outline: none;
}

.search-input:focus {
    box-shadow: 0 5px 20px rgba(42, 82, 152, 0.3);
}

.loading {
    text-align: center;
    padding: 50px;
    color: white;
    font-size: 1.2rem;
}

.fade-in {
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .container {
        padding: 20px 15px;
    }
    
    .search-input {
        width: 100%;
        margin: 0 10px;
    }
    
    .game-image {
        height: 200px;
    }
    
    .game-title-overlay {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .game-content {
        padding: 20px;
    }
    
    .play-button {
        position: static;
        width: 100%;
        margin-top: 15px;
        text-align: center;
    }
    
    .game-image {
        height: 180px;
    }
    
    .game-title-overlay {
        font-size: 1.3rem;
        bottom: 10px;
        left: 15px;
        right: 15px;
    }
}

