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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

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

.ad-container {
    padding: 0 4px;
    margin: 10px auto 5px;
    text-align: center;
}

.logo {
    height: 50px;
}

header {
    background-color: #6871e9;
    color: white;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

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

.logo-link {
    text-decoration: none;
    color: white;
}

.language-switcher button {
    background-color: transparent;
    color: white;
    border: 1px solid white;
    padding: 8px 16px;
    margin-left: 10px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.language-switcher button.active {
    background-color: #3498db;
    border-color: #3498db;
}

.language-switcher button:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.1);
}

h1 {
    font-size: 2rem;
}

h2 {
    margin: 30px 0 20px;
    font-size: 1.8rem;
    color: #2c3e50;
}

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

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

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

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

.game-info {
    padding: 15px;
}

.game-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-category {
    display: inline-block;
    background-color: #3498db;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.play-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.play-btn:hover {
    background-color: #219a52;
}

.play-btn.primary {
    font-size: 1.2rem;
    padding: 12px;
    margin-top: 20px;
}

.categories-container {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 10px 0 20px;
    margin-bottom: 30px;
}

.category-card {
    background-color: white;
    border-radius: 8px;
    padding: 15px 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    text-align: center;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background-color: #f8f9fa;
}

.category-name {
    font-weight: 500;
    color: #2c3e50;
}

footer {
    background-color: #2c3e50;
    color: white;
    padding: 20px 0;
    margin-top: 50px;
}

/* 详情页样式 */
.game-detail {
    margin-top: 30px;
}

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

.back-button {
    background-color: #34495e;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.back-button:hover {
    background-color: #2c3e50;
}

.game-main-info {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    margin-bottom: 40px;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.game-detail-description {
    font-size: 1.1rem;
    line-height: 1.7;
    margin: 15px 0;
}

.game-details-section {
    margin-bottom: 40px;
    background-color: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.game-details-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.4rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.game-instructions {
    line-height: 1.7;
    white-space: pre-line;
}

.game-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.game-tag {
    background-color: #ecf0f1;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.9rem;
    color: #2c3e50;
}

.no-related-games {
    text-align: center;
    color: #7f8c8d;
    padding: 20px;
    width: 100%;
}

.error-container {
    text-align: center;
    padding: 60px 20px;
    margin-top: 40px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.error-container h2 {
    color: #e74c3c;
    margin-bottom: 15px;
}

.error-container p {
    margin-bottom: 25px;
    color: #7f8c8d;
}

@media (max-width: 768px) {
    .game-main-info {
        grid-template-columns: 1fr;
    }
    
    .game-cover img {
        height: 300px;
    }
    
    .game-details-section {
        padding: 20px;
    }
}

footer p {
    text-align: center;
}

@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

/* Skeleton loader styles */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

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

.skeleton-img {
    height: 200px;
    border-radius: 8px 8px 0 0;
}

.skeleton-text {
    height: 16px;
    margin: 10px 0;
    border-radius: 4px;
}

.skeleton-text.small {
    width: 60%;
    height: 12px;
}

.skeleton-text.medium {
    width: 80%;
}

.skeleton-text.large {
    width: 100%;
    height: 20px;
}

/* 加载指示器样式 */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    width: 100%;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.loading-container p {
    color: #666;
    font-size: 1rem;
    margin: 0;
}