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

:root {
    --primary-color: #4a90e2;
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-color: #e0e6ed;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.12);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

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

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    box-shadow: var(--shadow);
}

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

.logo {
    font-size: 24px;
    font-weight: 700;
    text-decoration: none;
    color: white;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

nav a:hover {
    opacity: 0.8;
}

.main-wrapper {
    display: flex;
    gap: 30px;
    margin-top: 30px;
    padding-bottom: 60px;
}

.main-content {
    flex: 1;
}

.sidebar {
    width: 320px;
    flex-shrink: 0;
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.game-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.game-description {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.game-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    background: #000;
}

.game-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

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

.game-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

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

.game-thumbnail {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 语言切换 */
.lang-switch {
    display: flex;
    gap: 8px;
    align-items: center;
}

.lang-switch-btn {
    padding: 6px 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.lang-switch-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.lang-switch-btn.active {
    background: white;
    color: #667eea;
    border-color: white;
}

/* 页面内容样式 */
.page-content {
    max-width: 900px;
    margin: 0 auto;
}

.page-content h1 {
    font-size: 36px;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.page-content h2 {
    font-size: 24px;
    margin: 32px 0 16px;
    color: var(--text-primary);
}

.page-content p {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 16px;
    word-wrap: break-word;
}

.detail-content p {
    word-wrap: break-word;
}

.game-card-content {
    padding: 16px;
}

.game-card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.game-card-desc {
    font-size: 14px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sidebar-game-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-game-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.3s;
}

.sidebar-game-card:hover {
    box-shadow: var(--shadow-hover);
}

.sidebar-game-thumbnail {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    flex-shrink: 0;
}

.sidebar-game-info {
    flex: 1;
    min-width: 0;
}

.sidebar-game-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.sidebar-game-desc {
    font-size: 12px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

footer {
    background: var(--secondary-color);
    color: white;
    padding: 40px 0;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
}

.footer-section h3 {
    font-size: 18px;
    margin-bottom: 20px;
}

.footer-games {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.footer-game-link {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-game-link:hover {
    color: white;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    text-decoration: none;
    margin-bottom: 20px;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

.detail-thumbnail {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin-bottom: 24px;
}

.detail-content h1 {
    font-size: 32px;
    margin-bottom: 16px;
}

.detail-content p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.play-button {
    display: inline-block;
    padding: 14px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: transform 0.3s, box-shadow 0.3s;
}

.play-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

@media (max-width: 1024px) {
    .main-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    nav ul {
        gap: 16px;
        font-size: 14px;
    }

    .game-title {
        font-size: 22px;
    }

    .game-list {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .game-thumbnail {
        height: 120px;
    }
}