/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --background-color: #f9f9f9;
    --text-color: #333;
    --light-text-color: #f8f9fa;
    --border-radius: 8px;
    --box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    --transition-speed: 0.3s;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    overflow-x: hidden;
}

/* 为中文版本添加更好的字体支持 */
:lang(zh-CN) {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

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

h1, h2, h3 {
    margin-bottom: 0.5em;
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary-color);
    margin-bottom: 20px;
}

h3 {
    font-size: 1.2rem;
    color: var(--secondary-color);
}

p {
    margin-bottom: 1rem;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    display: block; /* 避免图片底部间隙 */
}

/* 懒加载图片样式 */
img.lazy-load {
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
}

img.loaded {
    opacity: 1;
}

ul {
    list-style-position: inside;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: var(--box-shadow);
    /* 添加进入动画 */
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
}

header h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem); /* 响应式字体大小 */
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.tagline {
    font-size: clamp(1.2rem, 3vw, 1.5rem); /* 响应式字体大小 */
    opacity: 0.9;
}

/* CTA按钮样式 */
.cta-buttons {
    margin-top: 1.5rem;
}

.scroll-to-game {
    background-color: var(--accent-color);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--transition-speed) ease, transform var(--transition-speed) ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.scroll-to-game:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.scroll-to-game:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 主要内容区域 */
main {
    padding: 2rem 0;
    /* 添加进入动画 */
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
}

/* 游戏部分 */
.game-section {
    margin-bottom: 3rem;
    text-align: center;
}

.game-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 比例 */
    height: 0;
    overflow: hidden;
    max-width: 1000px;
    margin: 0 auto;
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
    /* 添加游戏容器加载状态 */
    background-color: #eee;
}

.game-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1;
    opacity: 1;
    transition: opacity var(--transition-speed) ease;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.game-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: var(--border-radius);
    z-index: 2;
}

.game-container.loaded::before {
    opacity: 0;
}

/* 游戏信息部分 */
.game-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 3rem;
}

/* 游戏描述部分 */
.game-description, .game-controls {
    background-color: white;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.game-image {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9; /* 保持图片比例 */
    background-color: #eee; /* 加载前的占位颜色 */
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    margin-top: 1rem;
    border-radius: var(--border-radius);
}

.game-image:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* 游戏特性部分 */
.game-features {
    margin-bottom: 3rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.feature {
    background-color: white;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

/* 使用CSS过渡而不是JavaScript */
.feature.interactive:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

/* 页脚部分 */
footer {
    background-color: var(--primary-color);
    color: white;
    padding: 1.5rem 0;
    text-align: center;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .game-info {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2.8rem;
    }
    
    .tagline {
        font-size: 1.2rem;
    }
}

@media (max-width: 768px) {
    header {
        padding: 1.5rem 0;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .game-container {
        padding-bottom: 75%; /* 更高的高度适应移动端 */
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 2rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    .feature {
        padding: 1rem;
    }
}

/* 性能优化 - 添加内容可见性 */
.lazy-load {
    content-visibility: auto;
    contain-intrinsic-size: 0 500px; /* 初始占位大小 */
}

/* 添加视觉反馈以提高用户体验 */
a, button {
    transition: transform var(--transition-speed) ease, opacity var(--transition-speed) ease;
}

a:active, button:active {
    transform: scale(0.98);
    opacity: 0.8;
}

/* 增强可访问性 */
:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* 统一过渡效果 */
* {
    transition-property: background-color, color, border-color, box-shadow;
    transition-duration: var(--transition-speed);
    transition-timing-function: ease;
} 