/**
 * 移动优先响应式设计样式
 * 专为Android用户优化的触摸友好界面
 */

/* 基础移动样式 */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* 允许文本选择的元素 */
p, span, div.content, .text-selectable {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 触摸友好的按钮样式 */
.btn-touch {
    min-height: 48px;
    min-width: 48px;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
    overflow: hidden;
}

.btn-touch:active {
    transform: scale(0.98);
}

.btn-touch::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.btn-touch:active::before {
    width: 300px;
    height: 300px;
}

/* 主要下载按钮 */
.btn-download {
    background: linear-gradient(45deg, #FF6B6B, #FF8E53);
    color: white;
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
    margin: 16px 0;
    width: 100%;
    max-width: 300px;
    font-size: 18px;
    padding: 16px 24px;
}

.btn-download:hover {
    background: linear-gradient(45deg, #FF5252, #FF7043);
    box-shadow: 0 12px 35px rgba(255, 107, 107, 0.6);
    transform: translateY(-2px);
}

/* 次要按钮 */
.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

/* 卡片样式 */
.card-mobile {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 24px;
    margin: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 应用图标 */
.app-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    object-fit: cover;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    margin: 0 auto 16px;
    display: block;
}

/* 评分星星 */
.rating-stars {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin: 12px 0;
    font-size: 20px;
}

.star {
    color: #FFD700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* 统计数字 */
.stats-number {
    font-size: 24px;
    font-weight: 700;
    color: #2C3E50;
    margin: 8px 0;
}

.stats-label {
    font-size: 14px;
    color: #7F8C8D;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 进度条 */
.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin: 16px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* 倒计时样式 */
.countdown {
    background: linear-gradient(45deg, #E74C3C, #C0392B);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    text-align: center;
    margin: 16px 0;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.countdown-timer {
    font-size: 20px;
    font-weight: 700;
    margin: 8px 0;
}

/* 社交证明 */
.social-proof {
    background: rgba(76, 175, 80, 0.1);
    border-left: 4px solid #4CAF50;
    padding: 16px;
    border-radius: 8px;
    margin: 16px 0;
}

.social-proof-icon {
    color: #4CAF50;
    font-size: 20px;
    margin-right: 8px;
}

/* 轮播图样式 */
.carousel-mobile {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    margin: 16px 0;
}

.carousel-track {
    display: flex;
    transition: transform 0.3s ease;
}

.carousel-slide {
    min-width: 100%;
    position: relative;
}

.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background: white;
    transform: scale(1.2);
}

/* 语言切换器 */
.language-switcher-mobile {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.language-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #2C3E50;
    transition: all 0.3s ease;
    min-height: 44px;
}

.language-option:hover,
.language-option.active {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.language-flag {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 8px;
    object-fit: cover;
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 脉冲动画 */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* 滑入动画 */
.slide-in {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 淡入动画 */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 弹跳动画 */
.bounce-in {
    animation: bounceIn 0.8s ease-out;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* 响应式断点 */

/* 小屏手机 (320px - 480px) */
@media (max-width: 480px) {
    .card-mobile {
        margin: 12px 8px;
        padding: 20px;
        border-radius: 16px;
    }
    
    .btn-download {
        font-size: 16px;
        padding: 14px 20px;
    }
    
    .app-icon {
        width: 64px;
        height: 64px;
    }
    
    .stats-number {
        font-size: 20px;
    }
    
    .language-switcher-mobile {
        top: 16px;
        right: 16px;
    }
}

/* 中等屏幕手机 (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .card-mobile {
        max-width: 400px;
        margin: 16px auto;
    }
    
    .btn-download {
        max-width: 350px;
    }
}

/* 平板设备 (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .card-mobile {
        max-width: 500px;
        margin: 24px auto;
        padding: 32px;
    }
    
    .btn-download {
        max-width: 400px;
        font-size: 20px;
        padding: 18px 28px;
    }
    
    .app-icon {
        width: 100px;
        height: 100px;
    }
}

/* 桌面设备 (1025px+) */
@media (min-width: 1025px) {
    .card-mobile {
        max-width: 600px;
        margin: 32px auto;
        padding: 40px;
    }
    
    .language-switcher-mobile {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 20px;
    }
}

/* 横屏模式优化 */
@media (orientation: landscape) and (max-height: 500px) {
    .card-mobile {
        padding: 16px;
        margin: 8px;
    }
    
    .app-icon {
        width: 60px;
        height: 60px;
    }
    
    .btn-download {
        padding: 12px 20px;
        font-size: 16px;
    }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .app-icon,
    .language-flag {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #2C3E50 0%, #34495E 100%);
    }
    
    .card-mobile {
        background: rgba(44, 62, 80, 0.95);
        color: white;
    }
    
    .stats-number {
        color: #ECF0F1;
    }
    
    .stats-label {
        color: #BDC3C7;
    }
    
    .language-switcher-mobile {
        background: rgba(44, 62, 80, 0.9);
    }
    
    .language-option {
        color: #ECF0F1;
    }
}

/* 减少动画（用户偏好） */
@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) {
    .btn-download {
        border: 2px solid #000;
    }
    
    .card-mobile {
        border: 2px solid #000;
    }
}

/* 打印样式 */
@media print {
    .language-switcher-mobile,
    .countdown,
    .carousel-mobile {
        display: none;
    }
    
    .card-mobile {
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* RTL语言支持 */
[dir="rtl"] .language-switcher-mobile {
    left: 20px;
    right: auto;
}

[dir="rtl"] .language-flag {
    margin-left: 8px;
    margin-right: 0;
}

[dir="rtl"] .social-proof {
    border-left: none;
    border-right: 4px solid #4CAF50;
}

[dir="rtl"] .social-proof-icon {
    margin-left: 8px;
    margin-right: 0;
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .btn-touch:hover {
        transform: none;
    }
    
    .language-option:hover {
        background: transparent;
    }
}

/* 可访问性增强 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 焦点样式 */
.btn-touch:focus,
.language-option:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* 错误状态 */
.error-message {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid #E74C3C;
    color: #C0392B;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0;
    text-align: center;
}

/* 成功状态 */
.success-message {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid #4CAF50;
    color: #2E7D32;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0;
    text-align: center;
}

/* 加载状态 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    background: white;
    padding: 24px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}