/* AI望诊问诊 - 页面专属样式 */
/* 复用 style.css 中的 CSS 变量 */

/* 步骤指示器 */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    margin-bottom: 2rem;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.step-item.active .step-number {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: #fff;
    box-shadow: 0 4px 12px rgba(44, 95, 45, 0.3);
}

.step-item.completed .step-number {
    background: var(--success-color);
    color: #fff;
}

.step-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.step-item.active .step-label {
    color: var(--primary-color);
    font-weight: 700;
}

.step-item.completed .step-label {
    color: var(--success-color);
}

.step-line {
    flex: 1;
    height: 2px;
    background: var(--border-color);
    margin: 0 0.5rem;
    max-width: 80px;
    margin-bottom: 1.5rem;
}

/* 诊断步骤区域 */
.diagnosis-step {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
    animation: fadeIn 0.4s ease;
}

.step-header {
    text-align: center;
    margin-bottom: 2rem;
}

.step-header h2 {
    font-family: 'Noto Serif SC', serif;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.step-header .subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* 摄像头相关 */
.camera-container {
    max-width: 640px;
    margin: 0 auto;
}

.camera-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #1a1a2e;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1rem;
}

.camera-viewport video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-viewport img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.camera-guide {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.camera-guide .guide-outline {
    width: 60%;
    aspect-ratio: 3 / 4;
    border: 2px dashed rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    margin-bottom: 0.5rem;
}

.camera-guide span {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.camera-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.btn-capture {
    min-width: 140px;
}

/* 分析加载状态 */
.analysis-loading {
    text-align: center;
    padding: 2rem;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.analysis-loading p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* 分析结果卡片 */
.analysis-result {
    animation: fadeIn 0.4s ease;
}

.result-card {
    background: #f0f7f0;
    border-left: 4px solid var(--primary-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.result-card h3 {
    color: var(--primary-color);
    font-family: 'Noto Serif SC', serif;
    margin-bottom: 1rem;
}

.result-content {
    line-height: 1.8;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.step-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* 问诊相关 */
.inquiry-phase {
    margin-bottom: 2rem;
}

.inquiry-phase h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.phase-hint {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.symptom-input-area {
    margin-bottom: 1.5rem;
}

.symptom-input-area textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.8;
    resize: vertical;
    min-height: 180px;
    transition: all 0.3s ease;
    background: #fafafa;
}

.symptom-input-area textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(44, 95, 45, 0.1);
}

.audio-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
}

.audio-preview audio {
    width: 100%;
    max-width: 400px;
}

.audio-controls {
    display: flex;
    gap: 1rem;
}

.transcription-result {
    animation: fadeIn 0.4s ease;
}

.transcription-result h4 {
    color: var(--primary-color);
    margin: 1rem 0 0.5rem;
}

.transcription-result textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
}

.transcription-result textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 95, 45, 0.1);
}

/* 追问卡片 */
.followup-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.followup-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: all 0.3s ease;
}

.followup-card.completed {
    border-color: var(--success-color);
    background: #f6ffed;
}

.followup-question {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.followup-question .q-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.followup-question .q-text {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.followup-question .tts-btn {
    background: none;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

.followup-question .tts-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

.followup-answer {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.followup-answer textarea {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    resize: none;
    min-height: 60px;
}

.followup-answer textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}


/* 综合确认 */
.review-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.review-card {
    background: #f9f9f9;
    border-radius: var(--radius-md);
    padding: 1.25rem;
    border: 1px solid var(--border-color);
}

.review-card h3 {
    color: var(--primary-color);
    font-family: 'Noto Serif SC', serif;
    margin-bottom: 0.75rem;
}

.review-card .result-content {
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.9rem;
}

.review-card.collapsible .review-card-body {
    max-height: 200px;
    overflow-y: auto;
    transition: max-height 0.3s ease;
}

.review-card.collapsible .review-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.review-card.collapsible .review-card-header h3 {
    margin-bottom: 0;
}

.collapse-icon {
    transition: transform 0.3s ease;
    color: var(--text-secondary);
}

.review-card.collapsible.collapsed .review-card-body {
    max-height: 0;
    overflow: hidden;
}

.review-card.collapsible.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.review-card textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
}

.review-card textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 95, 45, 0.1);
}

.review-form {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.review-form .form-group {
    margin-bottom: 1.25rem;
}

.review-form .form-group:last-child {
    margin-bottom: 0;
}

.review-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.review-form input[type="text"],
.review-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.review-form input[type="text"]:focus,
.review-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 95, 45, 0.1);
}

.btn-submit {
    min-width: 200px;
    font-size: 1.05rem;
    padding: 0.85rem 2rem;
}

/* 导航链接 */
.nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 0.85rem;
    transition: all 0.2s;
    margin-right: 0.75rem;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* 响应式 */
@media (max-width: 768px) {
    .step-indicator {
        padding: 1rem 0.5rem;
    }

    .step-number {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    .step-label {
        font-size: 0.75rem;
    }

    .step-line {
        max-width: 40px;
    }

    .diagnosis-step {
        padding: 1.25rem;
    }

    .camera-viewport {
        aspect-ratio: 3 / 4;
    }

    .camera-controls {
        flex-wrap: wrap;
    }

    .mic-button {
        width: 80px;
        height: 80px;
    }

    .mic-icon {
        font-size: 2rem;
    }

    .followup-answer {
        flex-direction: column;
    }

    .followup-answer .answer-mic {
        align-self: flex-end;
    }

    .step-actions {
        flex-direction: column;
    }

    .step-actions .btn {
        width: 100%;
    }
}
