/* 移动端全面优化样式 */

/* ==================== 基础优化 ==================== */

/* 防止横向滚动 */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

html, body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* 优化触摸滚动 */
body {
    -webkit-overflow-scrolling: touch;
}

/* ==================== 平板优化 (768px - 1024px) ==================== */
@media (max-width: 1024px) and (min-width: 769px) {
    .container {
        max-width: 90%;
        padding: 0 30px;
    }
    
    .hero-content h1 {
        font-size: 36px;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

/* ==================== 手机端优化 (最大768px) ==================== */
@media (max-width: 768px) {
    /* 容器优化 */
    .container {
        max-width: 100%;
        padding: 0 20px;
    }
    
    /* 头部导航优化 */
    .main-header {
        padding: 12px 20px;
        position: sticky;
        top: 0;
        z-index: 1000;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    }
    
    .logo {
        font-size: 20px;
    }
    
    .nav-links {
        display: none; /* 可以后续添加汉堡菜单 */
    }
    
    /* Hero区域优化 */
    .hero-section {
        padding: 60px 0 40px;
        min-height: auto;
    }
    
    .hero-content h1 {
        font-size: 28px;
        line-height: 1.3;
        margin-bottom: 15px;
    }
    
    .hero-content .subtitle {
        font-size: 16px;
        line-height: 1.6;
        margin-bottom: 25px;
    }
    
    /* 按钮优化 - 更大的触摸区域 */
    .btn {
        min-height: 48px;
        padding: 14px 28px;
        font-size: 16px;
        border-radius: 12px;
        width: 100%;
        max-width: 100%;
    }
    
    .btn-primary {
        font-size: 17px;
        font-weight: 600;
    }
    
    /* 特性网格优化 */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .feature-card {
        padding: 25px 20px;
    }
    
    .feature-icon {
        font-size: 36px;
        margin-bottom: 12px;
    }
    
    .feature-card h3 {
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    .feature-card p {
        font-size: 14px;
        line-height: 1.6;
    }
    
    /* 测评介绍页优化 */
    .intro-content {
        padding: 30px 20px;
        margin: 15px;
        border-radius: 16px;
    }
    
    .intro-icon {
        font-size: 64px;
        margin-bottom: 15px;
    }
    
    .intro-content h1 {
        font-size: 24px;
        line-height: 1.4;
        margin-bottom: 20px;
    }
    
    .intro-desc {
        font-size: 15px;
        line-height: 1.7;
        margin-bottom: 15px;
    }
    
    .intro-info {
        grid-template-columns: 1fr;
        gap: 12px;
        margin: 20px 0;
    }
    
    .info-item {
        padding: 15px;
        font-size: 14px;
    }
    
    /* 问题卡片优化 */
    .question-card {
        padding: 25px 20px;
        margin: 15px;
        border-radius: 16px;
    }
    
    .question-number {
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    .question-text {
        font-size: 19px;
        line-height: 1.5;
        margin-bottom: 25px;
        font-weight: 600;
    }
    
    /* 选项优化 - 更大的点击区域 */
    .options-container {
        gap: 12px;
    }
    
    .option-btn {
        padding: 16px 20px;
        font-size: 16px;
        min-height: 56px;
        border-radius: 12px;
        transition: all 0.2s ease;
    }
    
    .option-btn:active {
        transform: scale(0.98);
    }
    
    /* 导航按钮优化 */
    .navigation-buttons {
        flex-direction: column;
        gap: 12px;
        margin-top: 25px;
    }
    
    .navigation-buttons .btn {
        width: 100%;
        order: 2;
    }
    
    .navigation-buttons .btn-secondary {
        order: 1;
    }
    
    /* 进度条优化 */
    .progress-bar {
        height: 6px;
        margin-bottom: 20px;
    }
    
    .progress-text {
        font-size: 13px;
        top: -25px;
    }
    
    /* 侧边栏状态优化 */
    .question-status-sidebar {
        width: 100%;
        position: relative;
        top: 0;
        max-height: none;
        margin-bottom: 20px;
        padding: 15px;
        border-radius: 12px;
    }
    
    .status-grid {
        grid-template-columns: repeat(9, 1fr);
        gap: 8px;
    }
    
    .status-item {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    /* 报告页面优化 */
    .report-header {
        padding: 25px 20px;
    }
    
    .report-title {
        font-size: 24px;
        margin-bottom: 15px;
    }
    
    .report-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .dimensions-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .dimension-card {
        padding: 20px;
    }
    
    .dimension-header h3 {
        font-size: 20px;
    }
    
    .score-circle {
        width: 80px;
        height: 80px;
    }
    
    .score-value {
        font-size: 24px;
    }
    
    /* 支付弹窗优化 */
    .modal-content,
    .qrcode-content {
        width: 92%;
        max-width: 400px;
        padding: 25px 20px;
        margin: 20px;
        border-radius: 16px;
    }
    
    .modal-content h2 {
        font-size: 22px;
        margin-bottom: 20px;
    }
    
    .payment-methods {
        gap: 12px;
    }
    
    .payment-method {
        padding: 16px;
        border-radius: 12px;
    }
    
    .payment-icon {
        font-size: 32px;
    }
    
    .payment-name {
        font-size: 16px;
    }
    
    .qrcode-image {
        width: 220px;
        height: 220px;
        margin: 20px auto;
    }
    
    /* 模态框按钮优化 */
    .modal-buttons,
    .hint-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .modal-buttons .btn,
    .hint-buttons .btn {
        width: 100%;
        max-width: 100%;
    }
}

/* ==================== 小屏手机优化 (最大480px) ==================== */
@media (max-width: 480px) {
    /* 进一步缩小间距 */
    .container {
        padding: 0 15px;
    }
    
    .hero-content h1 {
        font-size: 24px;
    }
    
    .hero-content .subtitle {
        font-size: 15px;
    }
    
    .intro-content {
        padding: 25px 15px;
        margin: 10px;
    }
    
    .intro-content h1 {
        font-size: 21px;
    }
    
    .intro-desc {
        font-size: 14px;
    }
    
    .question-card {
        padding: 20px 15px;
        margin: 10px;
    }
    
    .question-text {
        font-size: 17px;
    }
    
    .option-btn {
        padding: 14px 16px;
        font-size: 15px;
        min-height: 52px;
    }
    
    .status-grid {
        grid-template-columns: repeat(9, 1fr);
        gap: 6px;
    }
    
    .status-item {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }
    
    .report-title {
        font-size: 21px;
    }
    
    .dimension-header h3 {
        font-size: 18px;
    }
    
    .score-circle {
        width: 70px;
        height: 70px;
    }
    
    .score-value {
        font-size: 22px;
    }
    
    .qrcode-image {
        width: 200px;
        height: 200px;
    }
}

/* ==================== 超小屏优化 (最大375px) ==================== */
@media (max-width: 375px) {
    .hero-content h1 {
        font-size: 22px;
    }
    
    .intro-content h1 {
        font-size: 19px;
    }
    
    .question-text {
        font-size: 16px;
    }
    
    .option-btn {
        font-size: 14px;
        padding: 12px 14px;
        min-height: 48px;
    }
    
    .status-grid {
        grid-template-columns: repeat(9, 1fr);
        gap: 5px;
    }
    
    .status-item {
        width: 26px;
        height: 26px;
        font-size: 10px;
    }
}

/* ==================== 横屏优化 ==================== */
@media (max-height: 600px) and (orientation: landscape) {
    .hero-section {
        padding: 40px 0 30px;
    }
    
    .intro-content {
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .question-card {
        max-height: 85vh;
        overflow-y: auto;
    }
    
    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* ==================== 触摸优化 ==================== */
@media (hover: none) and (pointer: coarse) {
    /* 移动设备特定优化 */
    .btn:active {
        transform: scale(0.97);
        opacity: 0.9;
    }
    
    .option-btn:active {
        transform: scale(0.98);
    }
    
    .payment-method:active {
        transform: scale(0.98);
    }
    
    /* 增加所有可点击元素的触摸区域 */
    a, button, .btn, .option-btn {
        min-height: 44px; /* iOS 推荐的最小触摸目标 */
    }
}

/* ==================== 暗色模式支持 ==================== */
@media (prefers-color-scheme: dark) {
    /* 可选：为支持暗色模式的设备优化 */
    .main-header {
        background: rgba(30, 30, 30, 0.98);
    }
}

/* ==================== 性能优化 ==================== */
/* 使用 GPU 加速 */
.btn,
.option-btn,
.modal-content,
.question-card {
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

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