:root {
    /* 亮色主题 */
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --secondary: #1e293b;
    --text: #334155;
    --text-light: #64748b;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.1);
    --skeleton-base: #f0f0f0;
    --skeleton-highlight: #e0e0e0;
    --social-icon-filter: brightness(0.1);
}

.dark-theme {
    /* 暗色主题 */
    --primary: #3b82f6;
    --primary-light: #2563eb;
    --secondary: #f1f5f9;
    --text: #e2e8f0;
    --text-light: #94a3b8;
    --bg: #0f172a;
    --card-bg: #1e293b;
    --border: #334155;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.3);
    --skeleton-base: #334155;
    --skeleton-highlight: #475569;
    --social-icon-filter: none;
}

/* 预加载样式 - 骨架屏 */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.preloader.hidden {
    opacity: 0;
    pointer-events: none;
}

.skeleton {
    width: 80%;
    max-width: 800px;
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.skeleton-header {
    height: 2rem;
    width: 60%;
    background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-highlight) 50%, var(--skeleton-base) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.skeleton-line {
    height: 1rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-highlight) 50%, var(--skeleton-base) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-line:nth-child(2) { width: 80%; }
.skeleton-line:nth-child(3) { width: 90%; }
.skeleton-line:nth-child(4) { width: 70%; }

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

/* 主题和语言切换容器 */
.controls {
    position: fixed; /* 改为固定定位 */
    top: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    gap: 10px;
    background-color: var(--card-bg); /* 添加背景色 */
    padding: 8px; /* 增加内边距 */
    border-radius: 8px; /* 圆角 */
    box-shadow: var(--shadow); /* 添加阴影 */
    transition: all 0.3s ease; /* 平滑过渡 */
    border: 1px solid var(--border); /* 边框 */
}

/* 主题切换按钮 */
.theme-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background-color: var(--card-bg);
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-switcher:hover {
    border-color: var(--primary-light);
}

.theme-icon {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.dark-theme .theme-icon {
    transform: rotate(180deg);
}

/* 语言切换样式 */
.language-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background-color: var(--card-bg);
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.language-select:hover {
    border-color: var(--primary-light);
}

.language-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

header {
    padding: 80px 0 60px;
    text-align: center;
    position: relative;
}

h1 {
    font-size: 3rem;
    margin: 0;
    color: var(--secondary);
    font-weight: 700;
    letter-spacing: -0.05em;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-top: 16px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.nav-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 8px;
}

.nav-tab {
    padding: 12px 24px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-light);
    transition: all 0.3s ease;
    border-radius: 8px;
    font-size: 1rem;
    position: relative;
}

.nav-tab:hover {
    color: var(--primary);
}

.nav-tab.active {
    color: var(--primary);
    font-weight: 600;
}

.nav-tab.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background-color: var(--primary);
    border-radius: 3px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

h2 {
    font-size: 2rem;
    color: var(--secondary);
    margin-top: 0;
    margin-bottom: 24px;
    font-weight: 700;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 60px;
}

.card {
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

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

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: var(--border);
}

.card-content {
    padding: 20px;
}

.card h3 {
    margin: 0 0 8px;
    color: var(--secondary);
    font-size: 1.25rem;
}

.card p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.95rem;
}

/* 按钮样式 */
.card-button {
    display: inline-block;
    margin-top: 15px;
    padding: 8px 16px;
    background-color: var(--primary);
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.card-button:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
}

/* 游戏详情页样式*/
.game-detail-overlay {
    position: fixed; /* 改为固定定位 */
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 40px;
    box-sizing: border-box;
    overflow: auto;
}

.game-detail-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.game-detail-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto; /* 保持居中 */
}

.game-detail-content {
    background-color: var(--card-bg);
    border-radius: 12px;
    width: 100%;
    overflow-y: auto;
    padding: 30px;
    box-sizing: border-box;
    position: relative;
    max-height: 90vh;
    color: var(--text);
    scroll-behavior: smooth; /* 平滑滚动 */
}

.close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-light);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    line-height: 1;
    padding: 0;
    z-index: 10;
}

.close-button:hover {
    background-color: var(--bg);
    color: var(--primary);
}

.close-button::before {
    content: "×";
}

.about-content {
    display: flex;
    gap: 40px;
    align-items: center;
    margin-bottom: 60px;
}

.about-text {
    flex: 1;
}

.about-image {
    flex: 1;
    text-align: center;
}

.about-image img {
    max-width: 100%;
    border-radius: 12px;
    box-shadow: var(--shadow-hover);
    background-color: var(--border);
}

.social-links {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}

.social-links img {
    filter: var(--social-icon-filter, none);
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--bg);
    border-radius: 50%;
    color: var(--text);
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-link:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* 社交链接样式 */
.social-link {
    display: none; /* 默认隐藏所有社交链接 */
}

.social-links .social-zh,
.social-links .social-en {
    display: inline-flex; /* 确保社交链接容器正确显示 */
}

/* 中文状态下显示中文平台 */
body:not(.lang-en) .social-zh {
    display: inline-flex;
}

body:not(.lang-en) .social-en {
    display: none;
}

/* 英文状态下显示英文平台 */
body.lang-en .social-zh {
    display: none;
}

body.lang-en .social-en {
    display: inline-flex;
}

footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-light);
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

@media (max-width: 768px) {
    header {
        padding: 60px 0 40px;
    }
    
    h1 {
        font-size: 2.25rem;
    }
    
    .about-content {
        flex-direction: column;
        gap: 30px;
    }
    
    .about-text, .about-image {
        width: 100%;
    }
    
    .about-image {
        order: -1;
    }
    
    .nav-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-tab {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .controls {
        top: 10px;
        right: 10px;
    }
    
    .game-detail-overlay {
        padding: 20px;
    }
    
    .game-detail-content {
        width: 100%;
        padding: 20px;
    }
    
    .skeleton {
        width: 90%;
        padding: 1.5rem;
    }
    
    .close-button {
        font-size: 1.5rem;
        width: 32px;
        height: 32px;
    }
}

.main-logo {
    width: auto;
    height: 200px;
    max-width: 80vw; /* 视口宽度的80% */
    margin: 0 auto;
    display: block;
    object-fit: contain;
}

@media (max-width: 768px) {
    .game-detail-overlay {
        padding: 20px;
    }
}

/* 禁用图片拖动 */
img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}
