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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #1d1d1e 0%, #0e0319 100%);
    min-height: 100vh;
}

/* 语言切换按钮 */
.language-switch {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 4px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.lang-btn {
    background: transparent;
    border: none;
    padding: 8px 16px;
    border-radius: 21px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 60px;
}

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

.lang-btn.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.lang-btn:active {
    transform: scale(0.95);
}

/* 语言切换的响应式设计 */
@media (max-width: 768px) {
    .language-switch {
        top: 15px;
        right: 15px;
        padding: 3px;
    }
    
    .lang-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
        min-width: 50px;
    }
}

@media (max-width: 480px) {
    .language-switch {
        top: 10px;
        right: 10px;
    }
    
    .lang-btn {
        padding: 5px 10px;
        font-size: 0.8rem;
        min-width: 45px;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 0;
}

.title-group {
    margin-bottom: 20px;
}

.title {
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
    margin: 0;
}

.title-main {
    font-size: 3rem;
    margin-bottom: 8px;
}

.title-sub {
    font-size: 2.2rem;
    opacity: 0.85;
    font-weight: 500;
}

.subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* 主要内容 */
.main-content {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    border-radius: 20px;
    padding: 60px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

/* 海报容器 */
.poster-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.poster {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    transition: opacity 0.2s ease, transform 0.3s ease, filter 0.3s ease; /* 添加filter过渡 */
    opacity: 0;
}

.poster.loaded {
    opacity: 1;
    animation: breathing 6s ease-in-out infinite; /* 添加呼吸动画 */
}

.poster:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    animation-play-state: paused; /* hover时暂停呼吸动画 */
    filter: brightness(1.1) contrast(1.1) saturate(1.2); /* hover时的HDR增强 */
}

/* 加载占位符 */
.loading-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-placeholder.hidden {
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 呼吸动画 - 细微的缩放效果 + HDR模拟 */
@keyframes breathing {
    0%, 100% { 
        transform: scale(1); 
        opacity: 0.85;
        filter: brightness(0.95) contrast(1.05) saturate(1.1) hue-rotate(0deg);
        box-shadow: 
            0 15px 35px rgba(0, 0, 0, 0.2),
            0 0 10px rgba(255, 255, 255, 0.03),
            inset 0 0 20px rgba(255, 255, 255, 0.02);
    }
    25% {
        transform: scale(1.005);
        opacity: 0.92;
        filter: brightness(1.0) contrast(1.08) saturate(1.15) hue-rotate(1deg);
        box-shadow: 
            0 17px 38px rgba(0, 0, 0, 0.22),
            0 0 15px rgba(255, 255, 255, 0.06),
            inset 0 0 25px rgba(255, 255, 255, 0.035);
    }
    50% { 
        transform: scale(1.01);
        opacity: 1;
        filter: brightness(1.08) contrast(1.15) saturate(1.25) hue-rotate(2deg);
        box-shadow: 
            0 20px 45px rgba(0, 0, 0, 0.25),
            0 0 20px rgba(255, 255, 255, 0.1),
            inset 0 0 30px rgba(255, 255, 255, 0.05);
    }
    75% {
        transform: scale(1.005);
        opacity: 0.92;
        filter: brightness(1.0) contrast(1.08) saturate(1.15) hue-rotate(1deg);
        box-shadow: 
            0 17px 38px rgba(0, 0, 0, 0.22),
            0 0 15px rgba(255, 255, 255, 0.06),
            inset 0 0 25px rgba(255, 255, 255, 0.035);
    }
}

/* 支持广色域的设备使用更丰富的色彩 */
@media (color-gamut: p3) {
    @keyframes breathing {
        0%, 100% { 
            transform: scale(1); 
            opacity: 0.85;
            filter: brightness(0.95) contrast(1.05) saturate(1.1) hue-rotate(0deg);
            box-shadow: 
                0 15px 35px rgba(0, 0, 0, 0.2),
                0 0 12px color(display-p3 1 1 1 / 0.04),
                inset 0 0 22px color(display-p3 1 1 1 / 0.025);
        }
        25% {
            transform: scale(1.005);
            opacity: 0.92;
            filter: brightness(1.02) contrast(1.1) saturate(1.2) hue-rotate(1.5deg);
            box-shadow: 
                0 17px 38px rgba(0, 0, 0, 0.25),
                0 0 18px color(display-p3 1 1 1 / 0.08),
                inset 0 0 28px color(display-p3 1 1 1 / 0.045);
        }
        50% { 
            transform: scale(1.01);
            opacity: 1;
            filter: brightness(1.1) contrast(1.2) saturate(1.35) hue-rotate(3deg);
            box-shadow: 
                0 20px 45px rgba(0, 0, 0, 0.3),
                0 0 25px color(display-p3 1 1 1 / 0.15),
                inset 0 0 35px color(display-p3 1 1 1 / 0.08);
        }
        75% {
            transform: scale(1.005);
            opacity: 0.92;
            filter: brightness(1.02) contrast(1.1) saturate(1.2) hue-rotate(1.5deg);
            box-shadow: 
                0 17px 38px rgba(0, 0, 0, 0.25),
                0 0 18px color(display-p3 1 1 1 / 0.08),
                inset 0 0 28px color(display-p3 1 1 1 / 0.045);
        }
    }
}

/* 内容区域 */
.content-section {
    padding: 0 20px;
}

.game-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #f4f4f4;
    margin-bottom: 40px;
    font-weight: 400;
}

.links-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.steam-link,
.discord-link,
.wechat-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    position: relative;
}

.steam-link {
    background: linear-gradient(45deg, #1b2838, #2a475e);
    color: white;
}

.steam-link:hover {
    background: linear-gradient(45deg, #2a475e, #1b2838);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.discord-link {
    background: linear-gradient(45deg, #5865f2, #7289da);
    color: white;
}

.discord-link:hover {
    background: linear-gradient(45deg, #7289da, #5865f2);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.wechat-link {
    background: linear-gradient(45deg, #07c160, #20a853);
    color: white;
}

.wechat-link:hover {
    background: linear-gradient(45deg, #20a853, #07c160);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.link-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}
.filter-white {
    filter: invert(1);
}

/* 微信二维码弹窗 */
.wechat-qr-popup {
    position: absolute;
    bottom: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    min-width: 200px;
    text-align: center;
}

.wechat-qr-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: white;
}

.wechat-link:hover .wechat-qr-popup {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

.qr-code {
    width: 150px;
    height: 150px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.qr-text {
    color: #333;
    font-size: 0.9rem;
    margin: 0;
    font-weight: 500;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 30px 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-top: 40px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 40px 30px;
    }
    
    .game-description {
        font-size: 1rem;
    }
    
    .steam-link,
    .discord-link,
    .wechat-link {
        padding: 14px 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .title {
        font-size: 1.5rem;
        letter-spacing: 1px;
    }
    
    .main-content {
        padding: 30px 20px;
    }
    
    .header {
        padding: 20px 0;
        margin-bottom: 30px;
    }
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.8s ease-in-out;
}

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

/* 语言特定元素 */
.lang-hidden {
    display: none !important;
}

/* 语言切换时的过渡动画 */
[data-lang-key] {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.language-switching [data-lang-key] {
    opacity: 0.7;
    transform: translateY(2px);
}

/* 英文页面的特殊样式调整 */
html[data-lang="en"] .title-main {
    font-size: 2.8rem;
    letter-spacing: 1px;
}

html[data-lang="en"] .title-sub {
    font-size: 2rem;
    opacity: 0.9;
}

html[data-lang="en"] .game-description {
    font-size: 1.05rem;
}

/* 移动端英文样式调整 */
@media (max-width: 768px) {
    html[data-lang="en"] .title-main {
        font-size: 1.8rem;
    }
    
    html[data-lang="en"] .title-sub {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    html[data-lang="en"] .title-main {
        font-size: 1.4rem;
    }
    
    html[data-lang="en"] .title-sub {
        font-size: 1.2rem;
    }
}