/* 基础重置和字体设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --accent-color: #f59e0b;
    --background-primary: #0f0f23;
    --background-secondary: #1a1a3a;
    --background-card: #242451;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-accent: #fbbf24;
    --success-color: #10b981;
    --border-color: #374151;
    --shadow-color: rgba(99, 102, 241, 0.3);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --border-radius: 16px;
    --border-radius-small: 8px;
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
}

/* 字体导入 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* 基础样式 */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 移动端优先的容器布局 */
.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 100%;
    margin: 0 auto;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a3a 50%, #242451 100%);
    position: relative;
}

/* 背景动画效果 */
.container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 40% 60%, rgba(245, 158, 11, 0.05) 0%, transparent 30%);
    pointer-events: none;
    z-index: -1;
    animation: backgroundPulse 6s ease-in-out infinite alternate;
}

@keyframes backgroundPulse {
    0% { opacity: 0.8; }
    100% { opacity: 1; }
}

/* 头部样式 */
.header {
    padding: var(--spacing-lg) var(--spacing-md);
    text-align: center;
    position: relative;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    animation: logoFloat 3s ease-in-out infinite alternate;
}

@keyframes logoFloat {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-5px); }
}

.logo-image {
    height: 2.5rem;
    width: auto;
    filter: drop-shadow(0 0 10px var(--shadow-color));
    animation: iconGlow 2s ease-in-out infinite alternate;
}

.logo-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 10px var(--shadow-color));
    animation: iconGlow 2s ease-in-out infinite alternate;
}

@keyframes iconGlow {
    0% { filter: drop-shadow(0 0 10px var(--shadow-color)); }
    100% { filter: drop-shadow(0 0 20px var(--shadow-color)); }
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

/* 主要内容区域 */
.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
}

.hero-section {
    text-align: center;
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
}

/* 游戏预览区域 */
.game-preview {
    margin-bottom: var(--spacing-xl);
}

.game-screen {
    width: 200px;
    height: 200px;
    margin: 0 auto var(--spacing-lg);
    background: var(--background-card);
    border: 3px solid var(--primary-color);
    border-radius: var(--border-radius);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 0 30px var(--shadow-color),
        inset 0 0 20px rgba(0, 0, 0, 0.3);
    animation: screenGlow 3s ease-in-out infinite alternate;
}

@keyframes screenGlow {
    0% { box-shadow: 0 0 30px var(--shadow-color), inset 0 0 20px rgba(0, 0, 0, 0.3); }
    100% { box-shadow: 0 0 50px var(--shadow-color), inset 0 0 20px rgba(0, 0, 0, 0.3); }
}

.screen-content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: linear-gradient(45deg, #1a1a3a, #242451);
}

/* 像素艺术动画 */
.pixel-art {
    display: grid;
    grid-template-rows: repeat(3, 1fr);
    gap: 8px;
}

.pixel-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.pixel {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pixel-1, .pixel-5, .pixel-9 { background: var(--primary-color); }
.pixel-2, .pixel-4, .pixel-6, .pixel-8 { background: var(--secondary-color); }
.pixel-3, .pixel-7 { background: var(--accent-color); }

/* 内容包装器 */
.content-wrapper {
    padding: 0 var(--spacing-sm);
}

.welcome-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.3;
}

.welcome-subtitle {
    font-size: 1rem;
    color: var(--text-accent);
    margin-bottom: var(--spacing-md);
    font-weight: 500;
}

.description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
    line-height: 1.6;
}

/* 特性展示 */
.features {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
}

.feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-small);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    min-width: 80px;
}

.feature:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.feature-icon {
    font-size: 1.25rem;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.3));
}

.feature-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-align: center;
}

/* CTA区域 */
.cta-section {
    margin-bottom: var(--spacing-xl);
}

.play-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    width: 100%;
    max-width: 280px;
    margin: 0 auto var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-xl);
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--border-radius);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 8px 25px rgba(99, 102, 241, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.play-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.play-button:hover::before {
    left: 100%;
}

.play-button:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 12px 35px rgba(99, 102, 241, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.play-button:active {
    transform: translateY(0);
}

.button-text {
    font-family: inherit;
}

.button-icon {
    font-size: 1.2rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-3px); }
    60% { transform: translateY(-2px); }
}

.safety-note {
    font-size: 0.8rem;
    color: var(--success-color);
    font-weight: 500;
    margin: 0;
    opacity: 0.9;
}

/* 页脚 */
.footer {
    padding: var(--spacing-md);
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.footer-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
}

/* 平板设备优化 */
@media (min-width: 768px) {
    .container {
        max-width: 768px;
    }
    
    .header {
        padding: var(--spacing-xl) var(--spacing-lg);
    }
    
    .logo-icon {
        font-size: 2.5rem;
    }
    
    .logo-text {
        font-size: 1.75rem;
    }
    
    .hero-section {
        max-width: 500px;
    }
    
    .game-screen {
        width: 250px;
        height: 250px;
    }
    
    .welcome-title {
        font-size: 2.25rem;
    }
    
    .welcome-subtitle {
        font-size: 1.1rem;
    }
    
    .description {
        font-size: 1rem;
    }
    
    .features {
        gap: var(--spacing-lg);
    }
    
    .feature {
        min-width: 100px;
        padding: var(--spacing-md);
    }
    
    .feature-text {
        font-size: 0.85rem;
    }
    
    .play-button {
        max-width: 320px;
        font-size: 1.2rem;
    }
}

/* 桌面设备优化 */
@media (min-width: 1024px) {
    .container {
        max-width: 1024px;
    }
    
    .main-content {
        padding: var(--spacing-xl);
    }
    
    .hero-section {
        max-width: 600px;
    }
    
    .game-screen {
        width: 300px;
        height: 300px;
    }
    
    .pixel {
        width: 25px;
        height: 25px;
    }
    
    .welcome-title {
        font-size: 2.5rem;
    }
    
    .description {
        font-size: 1.1rem;
    }
    
    .features {
        gap: var(--spacing-xl);
    }
    
    .feature {
        min-width: 120px;
    }
    
    .play-button {
        max-width: 360px;
        padding: var(--spacing-lg) var(--spacing-2xl);
    }
}

/* 性能优化 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #ffffff;
        --text-primary: #ffffff;
        --text-secondary: #cccccc;
        --background-primary: #000000;
        --background-secondary: #111111;
        --background-card: #222222;
    }
}

/* 暗色主题已经是默认，但为了兼容性添加 */
@media (prefers-color-scheme: dark) {
    /* 暗色主题样式已经是默认 */
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .play-button {
        min-height: 48px;
        font-size: 1.1rem;
    }
    
    .feature {
        min-height: 60px;
    }
}

/* 加载动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-section > * {
    animation: fadeInUp 0.6s ease forwards;
}

/* 可访问性优化 */
.play-button:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* 防止选中文本 */
.logo-icon,
.logo-image,
.feature-icon,
.button-icon {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}
