:root {
    --primary-color: #4a6fa5;
    --secondary-color: #6b8cbc;
    --accent-color: #ff7b54;
    --light-color: #f8f9fa;
    --dark-color: #2d3748;
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --danger-color: #f56565;
    --gray-light: #e2e8f0;
    --gray-medium: #a0aec0;
    --gray-dark: #4a5568;
    --sidebar-width: 250px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e7ec 100%);
    color: var(--dark-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.site-header {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.98) 100%);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid rgba(74, 111, 165, 0.1);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    font-size: 2.2rem;
    background: linear-gradient(135deg, var(--primary-color), #667eea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 4px rgba(74, 111, 165, 0.2));
}

.site-title {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--primary-color), #667eea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    line-height: 1;
}

.site-tagline {
    font-size: 0.9rem;
    color: var(--gray-dark);
    font-weight: 500;
    opacity: 0.8;
}

.nav-menu {
    display: flex;
    gap: 25px;
    align-items: center;
    background: rgba(255, 255, 255, 0.8);
    padding: 8px 20px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(74, 111, 165, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.nav-link {
    padding: 10px 20px;
    border-radius: 25px;
    color: var(--dark-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    background: linear-gradient(135deg, var(--primary-color), #667eea);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 111, 165, 0.3);
}

.auth-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
}

.auth-btn {
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 0.95rem;
    border: 1px solid rgba(74, 111, 165, 0.2);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.login-btn {
    color: var(--primary-color);
}

.signup-btn {
    background: linear-gradient(135deg, var(--primary-color), #667eea);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(74, 111, 165, 0.3);
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 111, 165, 0.3);
}

/* Language Selector */
.language-selector {
    position: relative;
    display: inline-block;
}

.language-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(74, 111, 165, 0.2);
    border-radius: 20px;
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--dark-color);
    transition: all 0.3s ease;
}

.language-btn:hover {
    background: rgba(74, 111, 165, 0.1);
    border-color: var(--primary-color);
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    min-width: 140px;
    z-index: 1000;
    display: none;
}

.language-selector:hover .language-dropdown {
    display: block;
}

.language-option {
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.language-option:hover {
    background: rgba(74, 111, 165, 0.1);
}

.language-option.active {
    background: rgba(74, 111, 165, 0.2);
    color: var(--primary-color);
    font-weight: 600;
}

/* Main Layout */
.main-container {
    display: flex;
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--gray-light);
    margin-right: 20px;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.sidebar-title {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--primary-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-list {
    list-style: none;
}

.category-item {
    margin-bottom: 10px;
}

.category-btn {
    width: 100%;
    padding: 12px 15px;
    background: white;
    color: var(--dark-color);
    border: 1px solid var(--gray-light);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-btn:hover, .category-btn.active {
    background: var(--primary-color);
    color: white;
    transform: translateX(5px);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 30px;
    background: #f8f9fa;
    min-height: calc(100vh - 140px);
    border-radius: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Website Introduction */
.website-intro {
    background: white;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--gray-light);
    text-align: center;
}

.intro-title {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.intro-text {
    line-height: 1.7;
    color: var(--gray-dark);
    margin-bottom: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.game-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--gray-light);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.game-image {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    position: relative;
    overflow: hidden;
}

.game-image i {
    position: relative;
    z-index: 2;
    color: white;
}

.game-info {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.game-title {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: var(--dark-color);
    font-weight: 600;
}

.game-description {
    font-size: 0.9rem;
    color: var(--gray-dark);
    line-height: 1.5;
    margin-bottom: 15px;
    flex: 1;
    display: -webkit-box;
    display: -moz-box;
    display: box;
    -webkit-line-clamp: 3;
    -moz-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    -moz-box-orient: vertical;
    box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Game Interactions */
.game-interactions {
    margin-top: 15px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.interaction-row {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
    gap: 20px;
    width: 100%;
}

.game-rating {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rating-stars {
    display: flex;
    gap: 2px;
}

.rating-star {
    color: #ffc107;
    cursor: pointer;
    transition: transform 0.2s ease;
    font-size: 0.9rem;
}

.rating-star:hover {
    transform: scale(1.2);
}

.rating-count {
    font-size: 0.8rem;
    color: var(--gray-medium);
}

.favorite-btn {
    background: transparent;
    border: 1px solid var(--gray-light);
    border-radius: 50px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--gray-medium);
}

.favorite-btn:hover, .favorite-btn.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.play-btn-container {
    display: flex;
    justify-content: center;
    margin-top: 8px;
    width: 100%;
}

.play-btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(74, 111, 165, 0.2);
    width: 100%;
    text-align: center;
}

.play-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 111, 165, 0.3);
}

/* Ad Section */
.ad-section {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin: 30px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--gray-light);
    text-align: center;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    display: none; /* 默认隐藏 */
}

.ad-section.has-ad {
    display: flex; /* 有广告时显示 */
}

.ad-label {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 0.7rem;
    color: var(--gray-medium);
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid var(--gray-light);
    z-index: 1;
}

/* Newsletter */
.newsletter-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--gray-light);
    text-align: center;
}

.newsletter-title {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.newsletter-form {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    gap: 10px;
}

.newsletter-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid var(--gray-light);
    border-radius: 50px;
    font-size: 1rem;
}

.newsletter-btn {
    padding: 12px 25px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.newsletter-btn:hover {
    background: #ff6a3c;
    transform: translateY(-2px);
}

/* Footer */
footer {
    text-align: center;
    padding: 25px 30px;
    background: white;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
    border-top: 1px solid var(--gray-light);
    width: 100%;
    margin-top: auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.footer-info {
    margin-top: 15px;
    font-size: 0.9rem;
    color: var(--gray-medium);
    line-height: 1.5;
}

/* Mobile Warning */
.mobile-warning {
    display: none;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.mobile-warning.active {
    display: block;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        margin-right: 0;
        margin-bottom: 25px;
        position: static;
    }
    
    .category-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .category-item {
        margin-bottom: 0;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .logo-section {
        flex-direction: column;
        gap: 10px;
    }
    
    .site-title {
        font-size: 1.6rem;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .nav-link {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .game-image {
        height: 150px;
    }
    
    .game-title {
        font-size: 1.1rem;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    .category-list {
        grid-template-columns: 1fr;
    }
    
    .interaction-row {
        flex-direction: column;
        gap: 10px;
    }
}