/* ==========================================
   纯音听力筛查 - 样式表
   与主站深色主题统一
   ========================================== */

/* 容器 */
.audio-container {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 80px 1.5rem 4rem;
    min-height: 100vh;
}

/* 页面标题 */
.audio-header {
    text-align: center;
    padding: 3rem 0 2rem;
}

.audio-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    font-size: 0.85rem;
    color: #f39c12;
    margin-bottom: 1.5rem;
}

.audio-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 900;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #f39c12, #f1c40f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.audio-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

/* 免责提示 */
.disclaimer-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(243, 156, 18, 0.08);
    border: 1px solid rgba(243, 156, 18, 0.2);
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.disclaimer-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* 卡片 */
.audio-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.5s ease-out both;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.5rem;
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    flex: 1;
}

.step-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.card-actions {
    display: flex;
    gap: 8px;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-glass);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-action:hover {
    background: var(--bg-card-hover);
    border-color: rgba(243, 156, 18, 0.4);
    color: var(--text-primary);
}

/* 设置区域 */
.setup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.form-row {
    margin-bottom: 1rem;
}

.form-row label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-row .required {
    color: #e84393;
}

.form-row input,
.form-row select {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-primary);
    transition: border-color var(--transition-fast);
}

.form-row input:focus,
.form-row select:focus {
    outline: none;
    border-color: rgba(243, 156, 18, 0.5);
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.1);
}

.form-row input::placeholder {
    color: var(--text-muted);
}

.form-row-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* 设置信息 */
.setup-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.info-icon {
    font-size: 1.3rem;
}

/* 开始按钮 */
.btn-start {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 20px rgba(243, 156, 18, 0.3);
}

.btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(243, 156, 18, 0.5);
}

.btn-start:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    font-size: 1rem;
}

/* 停止按钮 */
.btn-stop {
    padding: 8px 18px;
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #e74c3c;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-stop:hover {
    background: rgba(231, 76, 60, 0.25);
}

/* 测试面板 */
.test-panel {
    border-color: rgba(243, 156, 18, 0.3);
}

/* 测试进度 */
.test-progress {
    margin-bottom: 2rem;
}

.test-progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.test-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.test-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f39c12, #f1c40f);
    border-radius: 3px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 测试状态 */
.test-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
}

.status-ear {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ear-icon {
    font-size: 1.5rem;
}

.ear-label {
    font-size: 1.1rem;
    font-weight: 600;
}

.status-ear.right .ear-label { color: #e74c3c; }
.status-ear.left .ear-label { color: #3498db; }

.status-freq {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #f39c12, #f1c40f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.status-level {
    font-size: 1rem;
    color: var(--text-muted);
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50px;
}

/* 声波动画 */
.wave-container {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wave-ring {
    position: absolute;
    border: 2px solid rgba(243, 156, 18, 0.3);
    border-radius: 50%;
    opacity: 0;
}

.wave-ring:nth-child(1) { width: 60px; height: 60px; }
.wave-ring:nth-child(2) { width: 90px; height: 90px; }
.wave-ring:nth-child(3) { width: 120px; height: 120px; }

.wave-core {
    font-size: 2rem;
    z-index: 1;
    opacity: 0.4;
    transition: opacity 0.3s;
}

/* 播放动画 */
.wave-container.playing .wave-core {
    opacity: 1;
}

.wave-container.playing .wave-ring {
    animation: waveExpand 1s ease-out forwards;
}

.wave-container.playing .wave-ring:nth-child(1) { animation-delay: 0s; }
.wave-container.playing .wave-ring:nth-child(2) { animation-delay: 0.15s; }
.wave-container.playing .wave-ring:nth-child(3) { animation-delay: 0.3s; }

@keyframes waveExpand {
    0% { transform: scale(0.5); opacity: 0.8; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* 响应按钮 */
.response-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.btn-heard,
.btn-not-heard {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-primary);
}

.btn-heard {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.btn-heard:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(39, 174, 96, 0.5);
}

.btn-not-heard {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.btn-not-heard:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(231, 76, 60, 0.5);
}

.btn-heard:disabled,
.btn-not-heard:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.resp-icon {
    font-size: 1.2rem;
    font-weight: 700;
}

/* 听力图 */
.audiogram-wrapper {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 10px;
    overflow: hidden;
}

.audiogram-wrapper canvas {
    width: 100%;
    height: 450px;
    display: block;
}

/* 报告 */
.report-block {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.report-block h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.report-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.report-info-item {
    display: flex;
    gap: 8px;
    font-size: 0.88rem;
}

.report-info-item .label {
    color: var(--text-muted);
    flex-shrink: 0;
}

.report-info-item .value {
    color: var(--text-primary);
    font-weight: 500;
}

/* 报告表格 */
.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.report-table th,
.report-table td {
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.report-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.report-table td {
    color: var(--text-primary);
}

.report-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* 评估结果 */
.result-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.result-ear {
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    text-align: center;
}

.result-ear.right {
    background: rgba(231, 76, 60, 0.08);
    border: 1px solid rgba(231, 76, 60, 0.2);
}

.result-ear.left {
    background: rgba(52, 152, 219, 0.08);
    border: 1px solid rgba(52, 152, 219, 0.2);
}

.result-ear-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.result-ear-avg {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.result-ear.right .result-ear-avg { color: #e74c3c; }
.result-ear.left .result-ear-avg { color: #3498db; }

.result-ear-level {
    font-size: 0.9rem;
    font-weight: 500;
}

.level-normal { color: #27ae60; }
.level-mild { color: #f1c40f; }
.level-moderate { color: #f39c12; }
.level-moderately-severe { color: #e67e22; }
.level-severe { color: #e74c3c; }
.level-profound { color: #c0392b; }

/* 评估建议 */
.evaluation-text {
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--text-secondary);
    padding: 1.25rem;
    background: rgba(243, 156, 18, 0.05);
    border: 1px solid rgba(243, 156, 18, 0.15);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.level-legend {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.level-legend span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.level-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.level-dot.normal { background: #27ae60; }
.level-dot.mild { background: #f1c40f; }
.level-dot.moderate { background: #f39c12; }
.level-dot.moderately-severe { background: #e67e22; }
.level-dot.severe { background: #e74c3c; }
.level-dot.profound { background: #c0392b; }

/* 报告指标样式 */
.result-metrics {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0.75rem 0;
}

.metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    font-size: 0.82rem;
}

.metric-label {
    color: var(--text-muted);
}

.metric-value {
    font-weight: 600;
    color: var(--text-primary);
}

.result-ear-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.result-ear.right .result-ear-title { color: #e74c3c; }
.result-ear.left .result-ear-title { color: #3498db; }

.result-ear-level {
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: 0.5rem;
    padding: 6px 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
}

/* 报告表格行按频率着色 */
.report-table td.level-normal { color: #27ae60; }
.report-table td.level-mild { color: #f1c40f; }
.report-table td.level-moderate { color: #f39c12; }
.report-table td.level-moderately-severe { color: #e67e22; }
.report-table td.level-severe { color: #e74c3c; }
.report-table td.level-profound { color: #c0392b; }

/* 声明区块 */
.report-note p {
    font-size: 0.82rem;
    line-height: 1.8;
    color: var(--text-muted);
    margin: 0;
}

/* 活跃导航链接 */
.navbar-links a.active {
    color: var(--text-primary);
    position: relative;
}

.navbar-links a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #f39c12, #f1c40f);
    border-radius: 1px;
}

/* 复制成功提示 */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    background: rgba(39, 174, 96, 0.9);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* 响应式 */
@media (max-width: 768px) {
    .setup-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .test-status {
        flex-direction: column;
        gap: 1rem;
    }

    .status-freq {
        font-size: 1.4rem;
    }

    .response-buttons {
        gap: 0.75rem;
    }

    .result-summary {
        grid-template-columns: 1fr;
    }

    .form-row-group {
        grid-template-columns: 1fr;
    }

    .setup-info {
        grid-template-columns: 1fr;
    }
}

/* 动画 */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
