* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0F2027 0%, #203A43 50%, #2C5364 100%);
    min-height: 100vh;
    min-height: -webkit-fill-available; /* iOS Safari */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    padding-top: max(20px, env(safe-area-inset-top));
    padding-right: max(20px, env(safe-area-inset-right));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    padding-left: max(20px, env(safe-area-inset-left));
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-tap-highlight-color: transparent; /* 移除点击高亮 */
    -webkit-touch-callout: none; /* 禁用长按菜单 */
}

.container {
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 107, 107, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 215, 0, 0.2) 0%, transparent 50%);
    animation: bgAnimation 20s ease-in-out infinite;
}

@keyframes bgAnimation {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}



/* 星星背景 */
.dragon-container::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent);
    background-size: 300px 300px;
    animation: stars 10s linear infinite;
}

@keyframes stars {
    0% { transform: translateY(0); }
    100% { transform: translateY(-300px); }
}

/* 移除重复的container定义 */

.download-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px); /* Safari支持 */
    border-radius: 30px;
    padding: 50px 40px;
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.3),
        0 0 100px rgba(120, 119, 198, 0.1),
        inset 0 0 30px rgba(255, 255, 255, 0.05);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    animation: cardFloat 6s ease-in-out infinite;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
    flex-shrink: 0; /* 防止被压缩 */
}

.download-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.8), transparent);
    animation: topLineGlow 3s linear infinite;
}

@keyframes cardFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes topLineGlow {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.header {
    margin-bottom: 30px;
}

.header h1 {
    font-family: 'Orbitron', 'Noto Sans SC', sans-serif;
    font-size: 3.5rem;
    font-weight: 900;
    color: #333;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #FFD700, #FFA500, #FF6347);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
    letter-spacing: 2px;
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% { 
        text-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
        transform: scale(1);
    }
    100% { 
        text-shadow: 0 0 50px rgba(255, 215, 0, 0.6);
        transform: scale(1.02);
    }
}

.test-badge {
    display: inline-block;
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
    color: white;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 700;
    animation: pulse 2s infinite;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.test-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: badgeShine 2s infinite;
}

@keyframes badgeShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.game-info {
    margin-bottom: 40px;
}

.game-info h2 {
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 25px;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
}

.specs {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.spec {
    text-align: center;
}

.spec .label {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.spec .value {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.download-btn {
    width: 85%;
    min-height: 48px; /* 最小触摸目标大小 */
    padding: 18px 20px;
    background: linear-gradient(45deg, #00C9FF 0%, #92FE9D 100%);
    border: none;
    border-radius: 20px;
    color: #0A0E27;
    font-size: 1.2rem;
    font-weight: 900;
    cursor: pointer;
    touch-action: manipulation; /* 优化触摸响应 */
    -webkit-tap-highlight-color: transparent;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 25px auto 30px;
    position: relative;
    overflow: hidden;
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border: 2px solid rgba(0, 201, 255, 0.3);
    will-change: transform, box-shadow;
    max-width: 280px;
    user-select: none; /* 防止文本选择 */
}

.download-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: lightningShine 3s infinite;
    transition: opacity 0.3s ease;
}

.download-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(0, 201, 255, 0.3), transparent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    opacity: 0;
}

.download-btn:hover {
    transform: translateY(-6px) scale(1.06);
    box-shadow: 
        0 25px 50px rgba(0, 201, 255, 0.35),
        0 0 80px rgba(146, 254, 157, 0.25),
        inset 0 0 20px rgba(255, 255, 255, 0.15);
    border-color: rgba(0, 201, 255, 1);
    background: linear-gradient(45deg, #00E5FF 0%, #A3FFAE 100%);
}

.download-btn:hover::before {
    opacity: 0.8;
    animation-duration: 1.5s;
}

.download-btn:hover::after {
    width: 500px;
    height: 500px;
    opacity: 1;
}

.download-btn:active {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 
        0 15px 30px rgba(0, 201, 255, 0.3),
        0 0 60px rgba(146, 254, 157, 0.2);
    transition: all 0.15s cubic-bezier(0.23, 1, 0.32, 1);
}

.btn-icon {
    font-size: 1.6rem;
    animation: downloadAnimation 2s infinite ease-in-out;
    filter: drop-shadow(0 0 12px rgba(0, 201, 255, 0.7));
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    will-change: transform, filter;
}

.download-btn:hover .btn-icon {
    animation: downloadAnimation 1s infinite ease-in-out;
    transform: translateY(3px) rotate(-3deg);
    filter: drop-shadow(0 0 20px rgba(0, 201, 255, 1));
}

.btn-text {
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    will-change: transform;
}

.download-btn:hover .btn-text {
    transform: translateY(-1px);
}

@keyframes lightningShine {
    0% { left: -100%; opacity: 0; }
    5% { opacity: 1; }
    95% { opacity: 1; }
    100% { left: 100%; opacity: 0; }
}

@keyframes downloadAnimation {
    0%, 100% { 
        transform: translateY(0) rotate(0deg) scale(1);
        filter: drop-shadow(0 0 15px rgba(0, 201, 255, 0.7));
    }
    25% { 
        transform: translateY(-3px) rotate(-2deg) scale(0.95);
        filter: drop-shadow(0 0 20px rgba(0, 201, 255, 0.9));
    }
    50% { 
        transform: translateY(6px) rotate(3deg) scale(1.05);
        filter: drop-shadow(0 0 25px rgba(0, 201, 255, 1));
    }
    75% { 
        transform: translateY(-2px) rotate(-1deg) scale(1.02);
        filter: drop-shadow(0 0 20px rgba(0, 201, 255, 0.8));
    }
}

.features {
    display: flex;
    justify-content: space-around;
}

.feature {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.check {
    font-size: 1.3rem;
    filter: drop-shadow(0 0 8px rgba(0, 201, 255, 0.6));
    animation: iconGlow 2s ease-in-out infinite alternate;
}

@keyframes iconGlow {
    0% { 
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 8px rgba(0, 201, 255, 0.6));
    }
    100% { 
        transform: scale(1.15) rotate(5deg);
        filter: drop-shadow(0 0 15px rgba(0, 201, 255, 0.9));
    }
}

/* 进度条 */
.progress-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: -webkit-fill-available; /* iOS Safari */
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.progress-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 300px;
    text-align: center;
    margin: 0 20px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-text {
    font-weight: 600;
    color: #333;
}

/* 响应式 */
/* iPhone 15 Pro Max 及大屏手机适配 */
@media (max-width: 430px) and (min-height: 900px) {
    .container {
        width: 100%;
        max-width: 100%;
        padding: 0 20px;
        margin: 0 auto;
    }
    
    .download-card {
        padding: 35px 30px;
        margin: 0 auto;
        width: 100%;
        max-width: 100%;
    }
    
    .header h1 {
        font-size: 2.8rem;
    }
    
    .download-btn {
        width: 100%;
        max-width: 320px;
        padding: 18px 22px;
        font-size: 1.15rem;
        gap: 12px;
        margin: 22px auto 30px;
    }
    
    .btn-icon {
        font-size: 1.5rem;
    }
    
    .download-btn:hover .btn-icon {
        transform: translateY(2px) rotate(-2deg);
    }
}

@media (max-width: 768px) {
    .container {
        width: 100%;
        max-width: 100%;
        padding: 0 15px;
        margin: 0 auto;
    }
    
    .download-card {
        padding: 30px 25px;
        margin: 0 auto;
        width: 100%;
        max-width: 100%;
    }
    
    .header h1 {
        font-size: 2.5rem;
    }
    
    .download-btn {
        width: 100%;
        max-width: 320px;
        padding: 16px 20px;
        font-size: 1.1rem;
        gap: 10px;
        margin: 20px auto 25px;
    }
    
    .btn-icon {
        font-size: 1.4rem;
    }
    
    .download-btn:hover .btn-icon {
        transform: translateY(2px) rotate(-2deg);
    }
}

@media (max-width: 480px) {
    body {
        padding: 15px;
        padding-top: max(15px, env(safe-area-inset-top));
        padding-right: max(15px, env(safe-area-inset-right));
        padding-bottom: max(15px, env(safe-area-inset-bottom));
        padding-left: max(15px, env(safe-area-inset-left));
    }
    
    .container {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }
    
    .download-card {
        padding: 30px 20px;
        border-radius: 20px;
        width: 100%;
        max-width: 100%;
        margin: 0;
    }
    
    .header h1 {
        font-size: 2.2rem;
        margin-bottom: 12px;
        word-break: keep-all; /* 防止文字换行 */
    }
    
    .game-info h2 {
        font-size: 1.2rem;
        margin-bottom: 20px;
        line-height: 1.4;
        word-break: keep-all;
    }
    
    .specs {
        flex-direction: row;
        gap: 8px;
        margin-bottom: 20px;
        justify-content: space-between;
        flex-wrap: wrap;
    }
    
    .spec {
        flex: 1;
        min-width: 0;
        min-width: calc(33.333% - 6px); /* 确保三个元素一行 */
    }
    
    .spec .label {
        font-size: 0.7rem;
        margin-bottom: 2px;
        white-space: nowrap;
    }
    
    .spec .value {
        font-size: 0.85rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .download-btn {
        width: 100%;
        max-width: none;
        min-height: 48px; /* 确保触摸目标足够大 */
        padding: 14px 18px;
        font-size: 1rem;
        gap: 8px;
        margin: 15px auto 20px;
        border-radius: 18px;
        letter-spacing: 1px;
    }
    
    .btn-icon {
        font-size: 1.3rem;
    }
    
    .download-btn:active {
        transform: translateY(-2px) scale(1.02);
    }
    
    .download-btn:active .btn-icon {
        transform: translateY(2px) rotate(-2deg);
    }
    
    .features {
        flex-direction: column;
        gap: 12px;
    }
    
    .feature {
        font-size: 0.9rem;
        gap: 8px;
        justify-content: center;
    }
    
    .check {
        font-size: 1.1rem;
    }
    
    .progress-content {
        width: 85%;
        padding: 25px 20px;
    }
}

@media (max-width: 360px) {
    body {
        padding: 10px;
        padding-top: max(10px, env(safe-area-inset-top));
        padding-right: max(10px, env(safe-area-inset-right));
        padding-bottom: max(10px, env(safe-area-inset-bottom));
        padding-left: max(10px, env(safe-area-inset-left));
    }
    
    .download-card {
        padding: 25px 15px;
    }
    
    .header h1 {
        font-size: 1.8rem;
        letter-spacing: 1px;
    }
    
    .download-btn {
        padding: 12px 16px;
        min-height: 44px;
        font-size: 0.95rem;
    }
    
    .game-info h2 {
        font-size: 1.1rem;
        line-height: 1.3;
    }
    
    .specs {
        gap: 5px;
    }
    
    .spec .label {
        font-size: 0.65rem;
    }
    
    .spec .value {
        font-size: 0.8rem;
    }
}

/* 横屏适配 */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        padding: 10px;
        align-items: center;
        padding-top: max(10px, env(safe-area-inset-top));
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }
    
    .container {
        width: 100%;
        max-width: 100%;
        padding: 0 10px;
    }
    
    .download-card {
        padding: 20px 25px;
        border-radius: 20px;
    }
    
    .header h1 {
        font-size: 2rem;
        margin-bottom: 10px;
    }
    
    .game-info {
        margin-bottom: 20px;
    }
    
    .game-info h2 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }
    
    .specs {
        margin-bottom: 15px;
    }
    
    .download-btn {
        margin: 15px auto 20px;
        padding: 12px 18px;
        min-height: 44px;
    }
    
    .features {
        flex-direction: row;
        justify-content: space-around;
        gap: 10px;
    }
    
    .feature {
        font-size: 0.85rem;
    }
}

/* 超小屏幕优化 */
@media (max-width: 320px) {
    .header h1 {
        font-size: 1.6rem;
    }
    
    .game-info h2 {
        font-size: 1rem;
    }
    
    .download-btn {
        font-size: 0.9rem;
        padding: 10px 14px;
        letter-spacing: 0.5px;
    }
    
    .spec .label {
        font-size: 0.6rem;
    }
    
    .spec .value {
        font-size: 0.75rem;
    }
}

/* 防止文本溢出 */
* {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 优化滚动性能 */
.download-card {
    -webkit-overflow-scrolling: touch;
    transform: translateZ(0); /* 启用硬件加速 */
    will-change: transform; /* 优化动画性能 */
}

/* 移动端优化：确保内容可见且居中 */
@media (max-width: 768px) {
    body {
        align-items: center;
        justify-content: center;
        padding-top: max(20px, env(safe-area-inset-top));
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
}

/* 小屏幕优化：确保内容不超出屏幕 */
@media (max-width: 480px) {
    body {
        align-items: center;
        justify-content: center;
        padding-top: max(15px, env(safe-area-inset-top));
        padding-bottom: max(15px, env(safe-area-inset-bottom));
    }
}