/**
 * 在线测听工具样式
 * 适配 PC 和移动端，大按钮设计适合中老年人使用
 */

/* ========== 全局样式 ========== */
.hearing-test-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

/* ========== 免责声明 ========== */
.disclaimer {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 24px;
    font-size: 14px;
    color: #856404;
    line-height: 1.6;
}

.disclaimer::before {
    content: "⚠️ ";
    font-size: 16px;
}

/* ========== 测试步骤通用样式 ========== */
.test-step {
    display: none;
    animation: fadeIn 0.5s ease;
}

.test-step.active {
    display: block;
}

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

.step-header {
    text-align: center;
    margin-bottom: 32px;
}

.step-header h2 {
    font-size: 28px;
    color: #2a5298;
    margin-bottom: 12px;
}

.step-header p {
    font-size: 16px;
    color: #666;
}

/* ========== Step 1: 测试前准备 ========== */
.preparation-tips {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.preparation-tips p {
    font-size: 16px;
    color: #333;
    margin-bottom: 12px;
    line-height: 1.8;
}

.checkbox-group {
    margin: 24px 0;
}

.checkbox-group label {
    display: block;
    font-size: 16px;
    color: #333;
    margin-bottom: 12px;
    cursor: pointer;
    padding: 12px;
    background: #fff;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.checkbox-group label:hover {
    border-color: #2a5298;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    vertical-align: middle;
}

.checkbox-group label.checked {
    border-color: #2a5298;
    background: #f0f4ff;
}

/* ========== 按钮样式 ========== */
.btn-primary {
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 24px auto 0;
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #2a5298, #4a7fd4);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    color: #666;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 8px;
}

.btn-secondary:hover {
    background: #e9ecef;
    border-color: #2a5298;
    color: #2a5298;
}

.btn-heard {
    display: block;
    width: 100%;
    max-width: 500px;
    margin: 24px auto;
    padding: 24px 48px;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #007bff, #0056b3);
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(0, 123, 255, 0.4);
}

.btn-heard:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(0, 123, 255, 0.5);
}

.btn-heard:active {
    transform: scale(0.98);
}

/* ========== Step 2: 基础信息 ========== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 16px;
    color: #333;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2a5298;
}

.checkbox-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.checkbox-inline label {
    display: flex;
    align-items: center;
    font-size: 15px;
    color: #333;
    cursor: pointer;
    padding: 8px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.checkbox-inline label:has(input:checked) {
    border-color: #2a5298;
    background: #f0f4ff;
}

.checkbox-inline input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
}

.button-group {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 32px;
}

/* ========== Step 3: 核心测试 ========== */
.test-playback {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 16px;
    margin-bottom: 24px;
}

.frequency-indicator {
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
}

.frequency-label {
    display: inline-block;
    padding: 8px 16px;
    background: #2a5298;
    color: #fff;
    border-radius: 20px;
    font-weight: 600;
}

.volume-indicator {
    font-size: 14px;
    color: #666;
    margin-top: 16px;
}

.test-prompt {
    font-size: 20px;
    color: #333;
    margin: 24px 0;
    font-weight: 500;
}

.progress-container {
    margin: 32px 0;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2a5298, #4a7fd4);
    border-radius: 6px;
    transition: width 0.5s ease;
    width: 0%;
}

.test-status {
    text-align: center;
    font-size: 14px;
    color: #999;
    margin-top: 16px;
}

/* ========== Step 4: 结果报告 ========== */
.result-summary {
    text-align: center;
    padding: 32px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 16px;
    margin-bottom: 32px;
}

.result-summary h2 {
    font-size: 24px;
    color: #333;
    margin-bottom: 16px;
}

.result-level {
    font-size: 36px;
    font-weight: 700;
    margin: 16px 0;
}

.level-normal { color: #2a5298; }
.level-mild { color: #ffc107; }
.level-moderate { color: #fd7e14; }
.level-severe { color: #dc3545; }

.result-threshold {
    font-size: 18px;
    color: #666;
    margin-top: 12px;
}

/* ========== 频率曲线图 ========== */
.frequency-chart {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.frequency-chart h3 {
    font-size: 20px;
    color: #333;
    margin-bottom: 16px;
    text-align: center;
}

/* ========== 建议 ========== */
.recommendations {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.recommendations h3 {
    font-size: 20px;
    color: #333;
    margin-bottom: 16px;
}

.recommendations p {
    font-size: 16px;
    color: #666;
    line-height: 1.8;
}

/* ========== 附近门店 ========== */
.nearby-stores {
    margin-bottom: 32px;
}

.nearby-stores h3 {
    font-size: 20px;
    color: #333;
    margin-bottom: 16px;
}

.store-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.store-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.store-card h4 {
    font-size: 18px;
    color: #2a5298;
    margin-bottom: 8px;
}

.store-card p {
    font-size: 14px;
    color: #666;
    margin-bottom: 6px;
}

.btn-map {
    display: inline-block;
    padding: 8px 16px;
    font-size: 14px;
    color: #007bff;
    background: #f0f4ff;
    border: 1px solid #007bff;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.btn-map:hover {
    background: #007bff;
    color: #fff;
}

/* ========== 预约表单 ========== */
.appointment-section {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.appointment-section h3 {
    font-size: 20px;
    color: #333;
    margin-bottom: 24px;
    text-align: center;
}

.appointment-form {
    max-width: 500px;
    margin: 0 auto;
}

.appointment-form .form-group {
    margin-bottom: 16px;
}

.btn-submit-appointment {
    display: block;
    width: 100%;
    padding: 16px;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #2a5298, #4a7fd4);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 24px;
}

.btn-submit-appointment:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

/* ========== 分享 ========== */
.share-section {
    text-align: center;
    padding: 24px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 32px;
}

.share-section p {
    font-size: 16px;
    color: #333;
    margin-bottom: 16px;
}

.btn-share {
    display: inline-block;
    padding: 12px 32px;
    font-size: 16px;
    color: #fff;
    background: linear-gradient(135deg, #2a5298, #1e3c72);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-share:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.4);
}

/* ========== 隐私提示 ========== */
.privacy-notice {
    text-align: center;
    font-size: 13px;
    color: #999;
    padding: 16px;
    border-top: 1px solid #e0e0e0;
    margin-top: 32px;
}

/* ========== 操作按钮（暂停/重测） ========== */
.test-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

.btn-pause {
    padding: 12px 24px;
    font-size: 16px;
    color: #ffc107;
    background: #fff;
    border: 2px solid #ffc107;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-pause:hover {
    background: #ffc107;
    color: #fff;
}

.btn-restart {
    padding: 12px 24px;
    font-size: 16px;
    color: #dc3545;
    background: #fff;
    border: 2px solid #dc3545;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-restart:hover {
    background: #dc3545;
    color: #fff;
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    .hearing-test-container {
        padding: 16px;
    }

    .step-header h2 {
        font-size: 24px;
    }

    .btn-primary,
    .btn-heard {
        font-size: 18px;
        padding: 14px 28px;
    }

    .btn-heard {
        padding: 20px 36px;
        font-size: 20px;
    }

    .result-level {
        font-size: 28px;
    }

    .store-card {
        padding: 16px;
    }

    .appointment-section {
        padding: 24px 16px;
    }

    .button-group {
        flex-direction: column;
    }

    .checkbox-inline {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .step-header h2 {
        font-size: 20px;
    }

    .test-prompt {
        font-size: 18px;
    }

    .frequency-label {
        font-size: 13px;
        padding: 6px 12px;
    }
}
