/* 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 var(--primary-focus-shadow);
}

.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;
}

/* [v1.13] 拍摄部位指引 — 可展开的要点清单，纯说明性，不影响拍摄/提交逻辑 */
.shot-guide {
    max-width: 480px;
    margin: 0.75rem auto 0;
    text-align: left;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--card-bg);
}

.shot-guide summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--primary-color);
    font-weight: 500;
    list-style: none;
    min-height: 44px;
}

.shot-guide summary::-webkit-details-marker {
    display: none;
}

.shot-guide summary .chevron {
    margin-left: auto;
    transition: transform 0.2s;
}

.shot-guide[open] summary .chevron {
    transform: rotate(180deg);
}

.shot-guide-body {
    padding: 0 1rem 0.9rem;
    font-size: 0.85rem;
    line-height: 1.7;
}

.shot-guide-body .good { color: var(--primary-color); }
.shot-guide-body .bad { color: var(--error-color); }

/* 摄像头相关 */
.camera-container {
    max-width: 640px;
    margin: 0 auto;
}

.camera-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    /* [v1.10.38] 微信 X5 / 旧版 Android 不支持 aspect-ratio 时的兜底高度
       防止摄像头区域塌陷为 0px 高度不可见 */
    min-height: 200px;
    background: #1a1a2e;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1rem;
}

/* aspect-ratio 不支持时，用 padding-top 撑开 4:3 比例（老式兼容方案） */
@supports not (aspect-ratio: 4 / 3) {
    .camera-viewport {
        height: 0;
        padding-top: 75%;       /* 75% = 3/4 of width → 4:3 ratio */
        min-height: unset;
    }
    /* 内部元素绝对定位填满 */
    .camera-viewport video,
    .camera-viewport img,
    .camera-guide,
    .drag-overlay {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
    }
}

.camera-viewport video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-viewport img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* [v1.8.7] 文件上传 + 拖拽 + 桌面/手机按钮区分 */
.hidden-file {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); border: 0;
}

/* 拖拽遮罩（仅桌面端 hover 设备启用）*/
.drag-overlay {
    position: absolute;
    inset: 0;
    background: color-mix(in srgb, var(--primary-color, #2c5f2d) 78%, transparent);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 5;
    backdrop-filter: blur(4px);
}
.drag-text {
    font-size: 1.2rem;
    font-weight: 600;
    padding: 1rem 1.5rem;
    border: 3px dashed rgba(255,255,255,0.8);
    border-radius: 14px;
}
.camera-viewport.drag-active .drag-overlay { display: flex; }

/* 按钮触屏/桌面互斥显示 */
@media (hover: none) and (pointer: coarse) {
    .btn-desktop-only { display: none !important; }
    .drag-overlay { display: none !important; }
}
@media (hover: hover) and (pointer: fine) {
    .btn-mobile-only { display: none !important; }
}

/* ghost 风格按钮（次次要操作，比 secondary 更轻量）*/
.btn-ghost {
    background: transparent;
    color: var(--primary-color, #2c5f2d);
    border: 1.5px solid var(--border-color, #e0ddd8);
}
.btn-ghost:hover { background: var(--primary-bg-light, rgba(44, 95, 45, 0.06)); }
.btn-ghost:active { transform: translateY(1px); }

.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;
}

/* 四角 viewfinder 取景框（替换旧椭圆虚线）*/
.camera-guide .guide-outline {
    width: 62%;
    aspect-ratio: 3 / 4;
    margin-bottom: 0.5rem;
    position: relative;
    border-radius: 4px;
    /* 8 段渐变拼出四角 L 形角标 */
    background:
        linear-gradient(to right,  rgba(255,255,255,0.9) 2px, transparent 2px) 0   0   / 22px 22px no-repeat,
        linear-gradient(to bottom, rgba(255,255,255,0.9) 2px, transparent 2px) 0   0   / 22px 22px no-repeat,
        linear-gradient(to left,   rgba(255,255,255,0.9) 2px, transparent 2px) 100% 0   / 22px 22px no-repeat,
        linear-gradient(to bottom, rgba(255,255,255,0.9) 2px, transparent 2px) 100% 0   / 22px 22px no-repeat,
        linear-gradient(to right,  rgba(255,255,255,0.9) 2px, transparent 2px) 0   100% / 22px 22px no-repeat,
        linear-gradient(to top,    rgba(255,255,255,0.9) 2px, transparent 2px) 0   100% / 22px 22px no-repeat,
        linear-gradient(to left,   rgba(255,255,255,0.9) 2px, transparent 2px) 100% 100% / 22px 22px no-repeat,
        linear-gradient(to top,    rgba(255,255,255,0.9) 2px, transparent 2px) 100% 100% / 22px 22px no-repeat;
}
/* 舌诊 / 头皮：横向，比脸更宽 */
.tongue-guide .guide-outline {
    aspect-ratio: 4 / 3;
    width: 55%;
}

.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;
}

/* 双圈渐变 spinner（外圈主色 / 内圈浅色）*/
.loading-spinner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3.5px solid rgba(44, 95, 45, 0.12);
    border-top-color: var(--primary-color);
    border-right-color: var(--primary-light);
    animation: spin 0.75s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    margin: 0 auto 1rem;
    box-shadow: 0 0 12px var(--primary-focus-shadow);
}

.analysis-loading p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    animation: pulse-soft 2s ease-in-out infinite;
}

/* 分析结果卡片 */
.analysis-result {
    animation: fadeIn 0.4s ease;
}

.result-card {
    background: var(--primary-bg-light, #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 var(--primary-focus-shadow);
}

.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 var(--primary-focus-shadow);
}

/* 追问卡片 */
.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: 44px;
    height: 44px;
    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 var(--primary-focus-shadow);
}

.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 var(--primary-focus-shadow);
}

.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;
        min-height: 240px;  /* 微信 X5 / 旧版兜底 */
    }

    .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%;
    }
}

/* 手机端（≤480px）强化 */
@media (max-width: 480px) {
    .step-indicator {
        padding: 0.75rem 0.25rem;
        gap: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        scroll-snap-type: x mandatory;
    }

    .step-item {
        scroll-snap-align: start;
        min-width: 60px;
        flex-shrink: 0;
    }

    .step-number {
        width: 28px;
        height: 28px;
        font-size: 0.78rem;
    }

    .step-label {
        font-size: 0.68rem;
        text-align: center;
        max-width: 56px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .step-line {
        max-width: 20px;
        min-width: 8px;
        flex-shrink: 1;
    }

    .diagnosis-step {
        padding: 1rem 0.875rem;
    }

    .step-header h2 {
        font-size: 1.15rem;
    }

    .result-card {
        padding: 1rem;
    }

    .result-card h3 {
        font-size: 1rem;
    }

    /* 摄像头在手机上改为 16:9 */
    .camera-viewport {
        aspect-ratio: 16 / 9;
        min-height: 180px;  /* 微信 X5 / 旧版兜底 */
        border-radius: var(--radius-md);
    }

    .camera-controls {
        gap: 0.6rem;
    }

    .camera-controls .btn {
        flex: 1;
        font-size: 0.9rem;
        padding: 0.65rem 0.5rem;
    }

    /* 追问卡片 */
    .followup-card {
        padding: 1rem;
    }

    .followup-question .q-number {
        width: 24px;
        height: 24px;
        font-size: 0.78rem;
    }

    .followup-question .q-text {
        font-size: 0.9rem;
    }

    .followup-answer textarea {
        font-size: 1rem; /* 防 iOS 缩放 */
        min-height: 52px;
    }

    /* 综合确认 */
    .review-card {
        padding: 1rem 0.875rem;
    }

    .review-card textarea,
    .review-form textarea,
    .review-form input[type="text"] {
        font-size: 1rem; /* 防 iOS 缩放 */
    }

    .btn-submit {
        min-width: unset;
        width: 100%;
        font-size: 1rem;
    }

    /* nav-link 在手机端换行时缩小 */
    .nav-link {
        padding: 0.3rem 0.5rem;
        font-size: 0.78rem;
        margin-right: 0.4rem;
    }
}

/* 极小屏幕（≤360px） */
@media (max-width: 360px) {
    .step-indicator {
        padding: 0.5rem 0;
    }

    .step-number {
        width: 24px;
        height: 24px;
        font-size: 0.72rem;
    }

    .step-label {
        font-size: 0.62rem;
        max-width: 46px;
    }

    .diagnosis-step {
        padding: 0.875rem 0.75rem;
    }

    .symptom-input-area textarea {
        min-height: 140px;
    }
}

/* 横屏手机：摄像头高度限制 */
@media (max-height: 500px) and (orientation: landscape) {
    .camera-viewport {
        aspect-ratio: 16 / 9;
        max-height: 220px;
    }

    .step-indicator {
        display: none; /* 横屏时节省空间 */
    }

    .diagnosis-step {
        padding: 0.875rem;
    }
}

/* ====================================================
   v2.1  问诊体质问卷 — 设计系统
   遵循 skill: touch-target-size(44px) / animation(150-300ms) /
   reduced-motion / color-not-only(emoji+文字双重编码)
   ==================================================== */

/* --- 问卷进度区 --- */
.q-progress-wrap {
    margin-bottom: 1.25rem;
}
.q-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.q-progress-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.q-progress-pct {
    font-size: 0.82rem;
    color: var(--primary-color);
    font-weight: 700;
}
.q-progress-track {
    background: var(--border-color);
    border-radius: 4px;
    height: 6px;
    overflow: hidden;
}
.q-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 4px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (prefers-reduced-motion: reduce) {
    .q-progress-fill { transition: none; }
}

/* --- 题目卡片 --- */
.q-card {
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    min-height: 180px;
    animation: slideUp 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .q-card { animation: none; }
}

.q-category-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding: 3px 10px;
    background: var(--border-color);
    border-radius: 20px;
    text-transform: uppercase;
}
.q-num-chip {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-left: 6px;
    opacity: 0.7;
}

.q-text {
    font-size: 1.05rem;
    line-height: 1.65;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    font-weight: 500;
}

/* --- 答案按钮行 --- */
.q-answers {
    display: flex;
    gap: 8px;
}

.q-answer-btn {
    flex: 1;
    min-height: 72px;      /* 远超 44px touch target */
    min-width: 44px;
    padding: 10px 4px;
    border-radius: 10px;
    border: 1.5px solid var(--border-color);
    background: transparent;
    cursor: pointer;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    touch-action: manipulation;
    transition: border-color 0.15s ease, background 0.15s ease,
                color 0.15s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.q-answer-btn:hover {
    border-color: var(--primary-light);
    background: var(--primary-bg-light);
    color: var(--primary-dark);
}
.q-answer-btn:active,
.q-answer-btn.pressing {
    transform: scale(0.94);
}
.q-answer-btn.selected {
    border-color: var(--primary-color);
    background: var(--primary-bg-light);
    color: var(--primary-dark);
    font-weight: 600;
    position: relative;
}
/* 选中态右上角小对勾 */
.q-answer-btn.selected::after {
    content: '✓';
    position: absolute;
    top: 3px;
    right: 5px;
    font-size: 0.6rem;
    color: var(--primary-color);
    font-weight: 800;
    line-height: 1;
}
.q-answer-emoji {
    font-size: 1.35rem;
    line-height: 1;
    display: block;
}
.q-answer-label {
    font-size: 0.72rem;
    display: block;
}
@media (prefers-reduced-motion: reduce) {
    .q-answer-btn { transition: border-color 0.01ms, background 0.01ms; }
}

/* 手机端：五按钮可能太挤，缩小字号 */
@media (max-width: 420px) {
    .q-answers { gap: 5px; }
    .q-answer-btn { min-height: 66px; font-size: 0.68rem; }
    .q-answer-emoji { font-size: 1.15rem; }
}

/* --- 问卷导航按钮行 --- */
.q-nav-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.25rem;
    gap: 12px;
}
.q-nav-row .btn-ghost:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.q-skip-link {
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    background: none;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    touch-action: manipulation;
    min-height: 44px;
    display: flex;
    align-items: center;
    transition: color 0.15s ease;
}
.q-skip-link:hover { color: var(--primary-color); }

/* ====================================================
   v2.0  望诊结果卡  Vision Analysis Card
   遵循: no-emoji-icons / color-not-only / animation /
   touch-target-size / dark/light contrast
   ==================================================== */

/* 主容器：适配明暗双主题 */
.vision-card {
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    animation: fadeIn 0.3s ease;
}

/* 标签行 */
.vision-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}
.vision-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1.5px solid transparent;
    line-height: 1.4;
}
/* 各体质色系 — 每种有边框+淡背景，不依赖颜色唯一编码 */
.vision-badge-purple { background: rgba(167,139,250,0.13); border-color: rgba(167,139,250,0.4); color: #7c3aed; }
.vision-badge-blue   { background: rgba(96,165,250,0.13);  border-color: rgba(96,165,250,0.4);  color: #1d4ed8; }
.vision-badge-amber  { background: rgba(251,191,36,0.13);  border-color: rgba(251,191,36,0.4);  color: #92400e; }
.vision-badge-teal   { background: rgba(52,211,153,0.13);  border-color: rgba(52,211,153,0.4);  color: #065f46; }
.vision-badge-slate  { background: rgba(148,163,184,0.13); border-color: rgba(148,163,184,0.4); color: #475569; }
.vision-badge-rose   { background: rgba(248,113,113,0.13); border-color: rgba(248,113,113,0.4); color: #be123c; }

/* 深色模式变体 */
@media (prefers-color-scheme: dark) {
    .vision-badge-purple { color: #c4b5fd; }
    .vision-badge-blue   { color: #93c5fd; }
    .vision-badge-amber  { color: #fcd34d; }
    .vision-badge-teal   { color: #6ee7b7; }
    .vision-badge-slate  { color: #cbd5e1; }
    .vision-badge-rose   { color: #fca5a5; }
}

/* 偏颇指数柱状图区域 */
.vision-bars-section {
    background: #0f172a;
    border-radius: 10px;
    padding: 14px 16px;
    margin: 12px 0;
    border: 1px solid rgba(148,163,184,0.12);
}
.vision-bars-title {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 10px;
    font-weight: 500;
    letter-spacing: 0.03em;
}

.vision-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.vision-bar-row:last-child { margin-bottom: 0; }
.vision-bar-label {
    font-size: 0.78rem;
    color: #94a3b8;
    min-width: 68px;
    text-align: right;
    flex-shrink: 0;
}
.vision-bar-track {
    flex: 1;
    background: #1e293b;
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
    position: relative;
}
.vision-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.75s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
/* 三档颜色 + 纹理，不依赖颜色唯一编码 */
.vision-bar-fill.level-low    { background: #4ade80; }
.vision-bar-fill.level-mid    { background: #facc15; }
.vision-bar-fill.level-high   { background: #f87171; }
/* 辅助纹理：中高偏颇加斜线纹，色盲友好 */
.vision-bar-fill.level-mid::after,
.vision-bar-fill.level-high::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        45deg, transparent, transparent 3px,
        rgba(255,255,255,0.15) 3px, rgba(255,255,255,0.15) 6px
    );
}
.vision-bar-value {
    font-size: 0.72rem;
    color: #64748b;
    min-width: 26px;
    text-align: left;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}
@media (prefers-reduced-motion: reduce) {
    .vision-bar-fill { transition: none; }
}

/* 部位分析表格（面色专属） */
.vision-region-table {
    margin-top: 10px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.vision-region-row {
    display: flex;
    align-items: center;
    padding: 7px 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.82rem;
    gap: 8px;
}
.vision-region-row:last-child { border-bottom: none; }
.vision-region-key {
    color: var(--text-secondary);
    min-width: 76px;
    flex-shrink: 0;
    font-weight: 500;
}
.vision-region-val {
    color: var(--text-primary);
    line-height: 1.5;
}

/* 综合辨证绿卡 */
.vision-syndrome-card {
    margin-top: 12px;
    padding: 12px 14px;
    background: rgba(34,197,94,0.07);
    border-radius: 10px;
    border-left: 3px solid var(--primary-color);
}
.vision-syndrome-text {
    font-size: 0.88rem;
    color: var(--text-primary);
    line-height: 1.7;
}

/* 体质提示标签 */
.vision-constitution-row {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.vision-constitution-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-right: 2px;
}
.vision-constitution-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 14px;
    font-size: 0.78rem;
    background: rgba(44,95,45,0.1);
    color: var(--primary-dark);
    border: 1px solid rgba(44,95,45,0.25);
    font-weight: 500;
}

/* 健康状态标签 */
.vision-status-row {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.vision-status-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 14px;
    font-size: 0.78rem;
    background: rgba(248,113,113,0.1);
    color: #be123c;
    border: 1px solid rgba(248,113,113,0.25);
    font-weight: 500;
}

/* ====================================================
   v2.1  体质雷达图  Constitution Radar
   遵循: legend / data-table / color-not-only /
   responsive-chart / screen-reader-summary
   ==================================================== */

.radar-container {
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    background: #0f172a;
    border: 1px solid rgba(148,163,184,0.12);
}
.radar-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 1rem;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 8px;
}
.radar-title-icon {
    width: 16px;
    height: 16px;
    opacity: 0.8;
}

.radar-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}
@media (min-width: 600px) {
    .radar-layout { flex-direction: row; align-items: flex-start; gap: 1.5rem; }
}

.radar-svg-wrap {
    width: 100%;
    max-width: 260px;
    flex-shrink: 0;
    margin: 0 auto;
}
.radar-svg-wrap svg {
    width: 100%;
    height: auto;
    display: block;
}

/* 图例网格 — 色盲友好：每项有图标+数字，不只靠颜色 */
.radar-legend {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    min-width: 0;
}
.radar-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    line-height: 1;
}
.radar-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}
.radar-legend-name  { color: #94a3b8; font-weight: 500; min-width: 44px; }
.radar-legend-score { color: #e2e8f0; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 28px; }
.radar-legend-bar-wrap {
    flex: 1;
    background: #1e293b;
    border-radius: 3px;
    height: 5px;
    overflow: hidden;
}
.radar-legend-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (prefers-reduced-motion: reduce) {
    .radar-legend-bar { transition: none; }
}

.radar-status-text {
    font-size: 0.82rem;
    color: #94a3b8;
    text-align: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(148,163,184,0.12);
}
.radar-legend-note {
    font-size: 0.7rem;
    color: #475569;
    text-align: center;
    margin-top: 6px;
}

/* 无障碍：screen-reader-summary 隐藏文本 */
.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;
}

/* ====================================================
   v2.0  望诊摘要总卡 (Report顶部)
   ==================================================== */
.report-bars-card {
    background: #0f172a;
    border: 1px solid rgba(148,163,184,0.12);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1rem;
    animation: fadeIn 0.35s ease;
}
.report-bars-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 1rem;
    letter-spacing: 0.04em;
}
.report-bars-section-label {
    font-size: 0.75rem;
    color: #64748b;
    margin: 10px 0 6px;
    font-weight: 500;
}
.report-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 7px;
}
.report-bar-label {
    font-size: 0.78rem;
    color: #94a3b8;
    min-width: 66px;
    text-align: right;
    flex-shrink: 0;
}
.report-bar-track {
    flex: 1;
    background: #1e293b;
    border-radius: 4px;
    height: 7px;
    overflow: hidden;
}
.report-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.report-bar-val {
    font-size: 0.72rem;
    color: #64748b;
    min-width: 24px;
    font-variant-numeric: tabular-nums;
}
.report-bars-legend-note {
    font-size: 0.7rem;
    color: #475569;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(148,163,184,0.1);
}

/* ====================================================
   补充结果卡深色适配（保留原 result-card 逻辑）
   ==================================================== */
.dark-result-card {
    background: #0f172a;
    border-left: 3px solid var(--primary-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.dark-result-card h3 {
    color: #4ade80;
    font-family: 'Noto Serif SC', serif;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

/* 问卷补充区样式增强 */
#inquiryPhaseA .review-card {
    background: var(--card-bg);
}
#inquiryPhaseA textarea {
    width: 100%;
    padding: 0.875rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;   /* 防 iOS 缩放 */
    line-height: 1.7;
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: var(--card-bg);
    color: var(--text-primary);
    box-sizing: border-box;
}
#inquiryPhaseA textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-focus-shadow);
}

/* ====================================================
   v1.11.4  体质评分水平柱状图
   遵循: color-not-only / legend-visible / direct-labeling /
   axis-labels / pattern-texture / reduced-motion / WCAG
   ==================================================== */

.constitution-barchart-card {
    background: #0f172a;
    border: 1px solid rgba(148,163,184,0.12);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1rem;
    animation: fadeIn 0.4s ease;
}

.constitution-barchart-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 0.04em;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.constitution-barchart {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.bchart-section-label {
    font-size: 0.65rem;
    color: #475569;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 3px;
}

.bchart-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 5px;
    font-size: 0.64rem;
    color: #334155;
}
.bchart-divider::before,
.bchart-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(148,163,184,0.1);
}

.bchart-row {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 26px;
}

.bchart-rank {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1e293b;
    color: #64748b;
    font-size: 0.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}
.bchart-rank-balance {
    background: rgba(74,222,128,0.12);
    color: #4ade80;
    border: 1px solid rgba(74,222,128,0.25);
    font-size: 0.5rem;
    letter-spacing: -0.02em;
}

.bchart-name {
    font-size: 0.7rem;
    color: #64748b;
    min-width: 36px;
    text-align: right;
    flex-shrink: 0;
    font-weight: 500;
}

/* 轨道 — overflow:visible 让阈值线能超出边界 */
.bchart-track {
    flex: 1;
    background: #1e293b;
    border-radius: 5px;
    height: 10px;
    position: relative;
    overflow: visible;
}

/* ① 正常区间色带（0–30% 绿 / 60–100% 红） */
.bchart-zone-safe {
    position: absolute;
    left: 0; top: 0; bottom: 0; width: 30%;
    background: rgba(74, 222, 128, 0.09);
    border-radius: 5px 0 0 5px;
    pointer-events: none;
    z-index: 1;
}
.bchart-zone-warn {
    position: absolute;
    left: 60%; top: 0; bottom: 0; right: 0;
    background: rgba(239, 68, 68, 0.07);
    border-radius: 0 5px 5px 0;
    pointer-events: none;
    z-index: 1;
}

/* ② 人群参考基线（~25分均值竖线 + 小标签） */
.bchart-mark-pop {
    position: absolute;
    left: 25%;
    top: -6px; bottom: -6px;
    width: 1.5px;
    background: #f59e0b;
    z-index: 4;
    pointer-events: none;
    border-radius: 1px;
}
.bchart-pop-tip {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.45rem;
    color: #f59e0b;
    font-weight: 700;
    white-space: nowrap;
}

/* ③ 洞察摘要卡（图表顶部） */
.bchart-insight {
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    padding: 7px 11px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.bchart-insight-ok {
    background: rgba(74, 222, 128, 0.06);
    border-color: rgba(74, 222, 128, 0.18);
}
.bchart-insight-icon { font-size: 0.85rem; flex-shrink: 0; }
.bchart-insight-text {
    flex: 1;
    font-size: 0.71rem;
    color: #cbd5e1;
    line-height: 1.5;
}
.bchart-insight-text strong { font-weight: 700; }
.bchart-insight-score { font-size: 0.63rem; color: #94a3b8; margin-left: 2px; }
.bchart-insight-hint {
    font-size: 0.57rem;
    color: #475569;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ④ 行可点击态 */
.bchart-row[data-name] {
    cursor: pointer;
    border-radius: 5px;
    margin: 0 -4px;
    padding: 0 4px;
    transition: background 0.18s ease;
}
.bchart-row[data-name]:hover,
.bchart-row[data-name]:focus { background: rgba(148, 163, 184, 0.07); outline: none; }
.bchart-row-expanded { background: rgba(74, 222, 128, 0.04) !important; }

/* ⑤ 展开体质说明面板 */
.bchart-expand {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.32s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
    padding-left: 66px; /* align with track start: rank(18)+gap(6)+name(36)+gap(6) */
    padding-right: 60px; /* align with score+label width */
}
.bchart-expand.open {
    max-height: 72px;
    opacity: 1;
    margin-bottom: 4px;
}
.bchart-expand-sym {
    display: block;
    font-size: 0.63rem;
    color: #94a3b8;
    line-height: 1.7;
    padding-top: 5px;
}
.bchart-expand-tip {
    display: block;
    font-size: 0.61rem;
    color: #4ade80;
    line-height: 1.5;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(74, 222, 128, 0.1);
}
@media (max-width: 480px) {
    .bchart-expand { padding-left: 46px; padding-right: 48px; }
}

.bchart-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.85s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    left: 0; top: 0;
    max-width: 100%;
    overflow: hidden;
    z-index: 2; /* 覆盖色带，低于阈值线(z:3)和参考线(z:4) */
}

/* 四档颜色 */
.bchart-fill-balance { background: linear-gradient(90deg, #4ade80, #86efac); }
.bchart-fill-low     { background: #4ade80; }
.bchart-fill-mid     { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.bchart-fill-high    { background: linear-gradient(90deg, #ef4444, #f87171); }

/* 斜线纹理 — 中高档色盲辅助 */
.bchart-fill-mid::after,
.bchart-fill-high::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        45deg, transparent, transparent 3px,
        rgba(255,255,255,0.12) 3px, rgba(255,255,255,0.12) 6px
    );
}

/* 阈值线（30分 / 60分）*/
.bchart-mark {
    position: absolute;
    top: -3px;
    bottom: -3px;
    width: 1.5px;
    border-radius: 1px;
    z-index: 3;
    pointer-events: none;
}
.bchart-mark-30 { left: 30%; background: rgba(74,222,128,0.45); }
.bchart-mark-60 { left: 60%; background: rgba(248,113,113,0.45); }

.bchart-score {
    font-size: 0.7rem;
    color: #e2e8f0;
    font-weight: 700;
    min-width: 24px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.bchart-label-text {
    font-size: 0.58rem;
    font-weight: 600;
    min-width: 28px;
    text-align: center;
    flex-shrink: 0;
    padding: 1px 4px;
    border-radius: 3px;
}
.bchart-label-balance { color: #4ade80; background: rgba(74,222,128,0.1); }
.bchart-label-low     { color: #4ade80; background: rgba(74,222,128,0.08); }
.bchart-label-mid     { color: #fbbf24; background: rgba(251,191,36,0.1); }
.bchart-label-high    { color: #f87171; background: rgba(248,113,113,0.1); }

.bchart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 12px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(148,163,184,0.08);
}
.bchart-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.62rem;
    color: #475569;
}
.bchart-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    display: inline-block;
    flex-shrink: 0;
}
.dot-balance { background: linear-gradient(90deg, #4ade80, #86efac); }
.dot-low     { background: #4ade80; }
.dot-mid     { background: #fbbf24; }
.dot-high    { background: #f87171; }

@media (prefers-reduced-motion: reduce) {
    .bchart-fill { transition: none; }
}

/* ====================================================
   v1.11.4  调理重点优先级面板
   ==================================================== */

.constitution-priority-panel {
    background: linear-gradient(135deg, #0f172a 0%, #1a2540 100%);
    border: 1px solid rgba(148,163,184,0.12);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.25rem;
    margin-bottom: 1rem;
    animation: fadeIn 0.35s ease;
}
.constitution-priority-balance {
    display: flex;
    align-items: center;
    gap: 12px;
}
.priority-icon {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}
.priority-text {
    font-size: 0.87rem;
    color: #94a3b8;
    line-height: 1.5;
}
.priority-panel-title {
    font-size: 0.67rem;
    font-weight: 700;
    color: #475569;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    margin-bottom: 0.9rem;
}
.priority-badges-row {
    display: flex;
    gap: 8px;
}
.priority-badge {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 10px 6px;
    border-radius: 10px;
    border: 1.5px solid rgba(148,163,184,0.12);
    background: rgba(15,23,42,0.5);
    text-align: center;
    min-width: 0;
}
.priority-ring-1 {
    border-color: rgba(248,113,113,0.35);
    background: rgba(248,113,113,0.06);
}
.priority-ring-2 {
    border-color: rgba(251,191,36,0.3);
    background: rgba(251,191,36,0.05);
}
.priority-ring-3 {
    border-color: rgba(96,165,250,0.28);
    background: rgba(96,165,250,0.05);
}
.priority-badge-score {
    font-size: 1.4rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.priority-ring-1 .priority-badge-score { color: #f87171; }
.priority-ring-2 .priority-badge-score { color: #fbbf24; }
.priority-ring-3 .priority-badge-score { color: #60a5fa; }
.priority-badge-name {
    font-size: 0.77rem;
    color: #cbd5e1;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.priority-badge-rank {
    font-size: 0.57rem;
    color: #475569;
    white-space: nowrap;
}
.priority-badge-tip {
    font-size: 0.58rem;
    color: #64748b;
    line-height: 1.35;
    text-align: center;
    margin-top: 4px;
    padding: 3px 4px 0;
    border-top: 1px solid rgba(148,163,184,0.12);
}

/* ====================================================
   v1.11.4  整体视觉强化
   遵循: animation / state-transition / elevation-consistent
   ==================================================== */

/* 进度图标脉冲（活跃步骤） */
.progress-item.active .progress-icon {
    animation: tcm-pulse 1.6s ease-in-out infinite;
}
@keyframes tcm-pulse {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(44,95,45,0.5)); }
    50%       { filter: drop-shadow(0 0 14px rgba(44,95,45,0.85)); }
}
@media (prefers-reduced-motion: reduce) {
    .progress-item.active .progress-icon { animation: none; }
}

/* ─── 步骤连线：完成后渐变为绿色 ─── */
.step-line {
    transition: background-color 0.6s ease;
}
.step-item.completed + .step-line {
    background: var(--success-color);
}

/* ─── 进度项完成：图标角落绿色对钩徽章 ─── */
.progress-item.completed .progress-icon {
    position: relative;
}
.progress-item.completed .progress-icon::after {
    content: '✓';
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--success-color);
    color: #fff;
    font-size: 0.6rem;
    line-height: 18px;
    text-align: center;
    font-weight: 800;
    border: 2px solid #f6ffed;
    box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}

/* ─── 步骤标题装饰短横 ─── */
.step-header h2 {
    position: relative;
    padding-bottom: 0.65rem;
}
.step-header h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 2.5px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 2px;
}

/* ─── 折叠卡片 header hover ─── */
.review-card.collapsible .review-card-header {
    transition: background 0.2s ease;
    padding: 2px 4px;
    margin: -2px -4px;
    border-radius: var(--radius-sm);
}
.review-card.collapsible .review-card-header:hover {
    background: rgba(44, 95, 45, 0.05);
}

/* ─── 问卷导航按钮（启用态）增强 ─── */
.q-nav-row .btn-ghost:not(:disabled) {
    color: var(--primary-color);
    border: 1px solid rgba(44, 95, 45, 0.22);
}
.q-nav-row .btn-ghost:not(:disabled):hover {
    background: rgba(44, 95, 45, 0.06);
    border-color: rgba(44, 95, 45, 0.4);
}

/* ─── AI评估进行中 subtitle 呼吸提示 ─── */
.progress-section .subtitle {
    animation: pulse-soft 2.5s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
    .progress-section .subtitle { animation: none; }
}

/* 活跃进度条 shimmer（Agent 运行中） */
.progress-item.active .progress-fill {
    width: 100% !important;
    background: linear-gradient(
        90deg,
        var(--primary-color) 0%,
        var(--primary-light) 40%,
        #a8d8a9 50%,
        var(--primary-light) 60%,
        var(--primary-color) 100%
    );
    background-size: 300% 100%;
    animation: shimmer-progress 1.8s ease-in-out infinite;
}
@keyframes shimmer-progress {
    0%   { background-position: 100% 50%; }
    100% { background-position: -100% 50%; }
}
@media (prefers-reduced-motion: reduce) {
    .progress-item.active .progress-fill {
        animation: none;
        width: 100% !important;
        background: var(--primary-color);
    }
}

/* 结果区 header 按钮分组分割线 */
.hdr-divider {
    display: inline-block;
    width: 1px;
    height: 28px;
    background: var(--border-color);
    align-self: center;
    margin: 0 4px;
    flex-shrink: 0;
}

/* 问诊记录区 textarea 可读性增强 */
#reviewInquiryText {
    font-size: 0.9rem;
    line-height: 1.8;
    background: rgba(44, 95, 45, 0.03);
    color: var(--text-primary);
    font-family: inherit;
    letter-spacing: 0.01em;
}

/* 题目卡片增强阴影 */
.q-card {
    box-shadow: 0 4px 20px rgba(0,0,0,0.07), 0 1px 4px rgba(0,0,0,0.05);
}

/* 报告区 section-header 字体 */
.section-header h2 {
    font-family: 'Noto Serif SC', serif;
}

/* 结果区标签页按钮增强 */
.tab-btn {
    touch-action: manipulation;
}
.tab-btn.active {
    position: relative;
}
.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0; right: 0;
    height: 2px;
    background: var(--primary-color);
    border-radius: 2px 2px 0 0;
}

/* 雷达图标题增强 */
.radar-title {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 柱状图卡片在小屏字号缩减 */
@media (max-width: 480px) {
    .bchart-name    { min-width: 30px; font-size: 0.65rem; }
    .bchart-score   { min-width: 20px; font-size: 0.65rem; }
    .bchart-label-text { min-width: 24px; font-size: 0.56rem; }
    .bchart-legend  { gap: 4px 8px; }
    .bchart-legend-item { font-size: 0.58rem; }
    .priority-badge { padding: 8px 4px; }
    .priority-badge-score { font-size: 1.15rem; }
    .priority-badge-name  { font-size: 0.7rem; }
}

/* ====================================================
   v1.11.4  症状维度汇总（分组柱）
   按体质大类汇聚问卷子题，显示每类均值 + 各题原始答案
   遵循: data-density / gridline-subtle / direct-labeling /
   responsive-chart / color-not-only / reduced-motion
   ==================================================== */

.symptom-dimension-card {
    background: #0f172a;
    border: 1px solid rgba(148,163,184,0.12);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1rem;
    animation: fadeIn 0.4s ease;
}
.symptom-dimension-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 0.04em;
    margin-bottom: 1rem;
}

/* 二列网格：≥600px 两列，小屏单列 */
.sdim-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
@media (max-width: 600px) {
    .sdim-grid { grid-template-columns: 1fr; }
}

/* 单个体质分组卡 */
.sdim-group {
    background: #111827;
    border: 1px solid rgba(148,163,184,0.07);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* 分组标题行：[类别名] [均值条] [均值分] */
.sdim-group-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(148,163,184,0.07);
    margin-bottom: 2px;
}
.sdim-cat-name {
    font-size: 0.7rem;
    color: #e2e8f0;
    font-weight: 700;
    min-width: 40px;
    flex-shrink: 0;
}
.sdim-cat-bar-wrap {
    flex: 1;
    background: #1e293b;
    border-radius: 3px;
    height: 6px;
    overflow: hidden;
}
.sdim-cat-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.sdim-cat-low  { background: #4ade80; }
.sdim-cat-mid  { background: #fbbf24; }
.sdim-cat-high { background: #f87171; }
.sdim-cat-score {
    font-size: 0.68rem;
    font-weight: 800;
    min-width: 22px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

/* 各子题行 */
.sdim-q-row {
    display: flex;
    align-items: center;
    gap: 5px;
}
.sdim-q-text {
    font-size: 0.58rem;
    color: #475569;
    min-width: 70px;
    max-width: 70px;
    flex-shrink: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: default; /* title tooltip 提示全文 */
}
.sdim-q-track {
    flex: 1;
    background: #1e293b;
    border-radius: 3px;
    height: 5px;
    overflow: hidden;
}
.sdim-q-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.1s; /* 0.1s stagger */
}
.sdim-q-low  { background: rgba(74,222,128,0.7); }
.sdim-q-mid  { background: rgba(251,191,36,0.8); }
.sdim-q-high { background: rgba(248,113,113,0.85); }
.sdim-q-label {
    font-size: 0.55rem;
    color: #334155;
    min-width: 22px;
    text-align: right;
    flex-shrink: 0;
    white-space: nowrap;
}

.sdim-note {
    font-size: 0.6rem;
    color: #1e293b;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(148,163,184,0.07);
    color: #334155;
}

@media (prefers-reduced-motion: reduce) {
    .sdim-cat-bar, .sdim-q-fill { transition: none; }
}

/* ====================================================
   v1.12  UI/UX Pro Max 系统升级
   SVG 图标对齐 / 响应式 header-actions / 标签页横滑
   遵循: no-emoji-icons / touch-target-size / aria-labels /
   responsive-chart / mobile-first / bottom-nav-limit
   ==================================================== */

/* ─── SVG 图标在按钮内对齐 ─── */
.btn-icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    vertical-align: middle;
}
.btn-icon svg {
    width: 15px;
    height: 15px;
    display: block;
    flex-shrink: 0;
}

/* ─── 表单 label 内联图标 ─── */
.label-icon {
    display: inline-flex;
    align-items: center;
    vertical-align: -0.1em;
    margin-right: 2px;
}
.label-icon svg {
    width: 14px;
    height: 14px;
}

/* ─── 进度区 SVG 图标 ─── */
.progress-icon svg {
    width: 22px;
    height: 22px;
    display: block;
    color: var(--primary-color);
}

/* ─── 导航链接内 SVG 对齐 ─── */
.nav-link svg {
    vertical-align: -0.15em;
    margin-right: 2px;
    flex-shrink: 0;
}

/* ─── 结果区 header-actions 分组 + 响应式换行 ─── */
.header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
    margin-top: 0.6rem;
}
.header-actions-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}
@media (max-width: 600px) {
    .header-actions {
        justify-content: center;
    }
    .header-actions .hdr-divider {
        display: none;
    }
    .header-actions-group {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ─── 结果标签页横向滚动（移动端 6 个标签不截断）─── */
.result-tabs {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x proximity;
    padding-bottom: 2px; /* 防 active 下划线被裁 */
    gap: 2px;
}
.result-tabs::-webkit-scrollbar { display: none; }

.tab-btn {
    white-space: nowrap;
    flex-shrink: 0;
    scroll-snap-align: start;
    min-height: 40px;
    touch-action: manipulation;
}

/* ─── 步骤操作区按钮在手机端全宽 ─── */
@media (max-width: 480px) {
    .step-actions {
        flex-wrap: wrap;
    }
    .step-actions .btn {
        min-width: 0;
        flex: 1 1 calc(50% - 0.5rem);
    }
    .step-actions .btn-submit {
        flex: 1 1 100%;
    }
}

/* ====================================================
   v1.13  UI/UX Pro Max 无障碍 + 触控 + 表单细化
   遵循: aria-labels / keyboard-nav / touch-target-size /
   focus-states / form-labels / state-transition
   ==================================================== */

/* ─── 折叠卡片：chevron SVG 平滑旋转 ─── */
.collapse-icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-secondary);
}
.review-card.collapsible.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

/* ─── 折叠卡片 header 键盘 focus 环 ─── */
.review-card.collapsible .review-card-header:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* ─── 步骤指示器：键盘 focus 环 ─── */
.step-item:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
    border-radius: 8px;
}
.step-item:focus { outline: none; } /* 移除非键盘 focus 默认轮廓 */

/* ─── 摄像头控制按钮：明确 44px 触控高度 ─── */
.camera-controls .btn {
    min-height: 44px;
}

/* ─── 问诊补充区：移除 inline 样式 ─── */
.inquiry-supplement-card {
    margin: 0;
}
.inquiry-supplement-title {
    margin-bottom: 8px;
    font-size: 0.95rem;
}
.inquiry-supplement-hint {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 10px;
}

/* ─── 表单 input/textarea focus-visible（键盘专属高亮）─── */
.review-form input[type="text"]:focus-visible,
.review-form textarea:focus-visible,
#reviewInquiryText:focus-visible,
#symptomInput:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 1px;
}
/* 非键盘（鼠标/触控）仍保留 box-shadow，但无 outline */
.review-form input[type="text"]:focus:not(:focus-visible),
.review-form textarea:focus:not(:focus-visible),
#reviewInquiryText:focus:not(:focus-visible),
#symptomInput:focus:not(:focus-visible) {
    outline: none;
}

/* ─── 特殊情况 textarea 高度宽松一些（rows=3 + min-height）─── */
#reviewSpecialConditions {
    min-height: 80px;
}

/* ====================================================
   打印样式 — 报告导出打印专用
   规则: 隐藏非内容元素 / 纯黑白 / 用 box-shadow 替代 background-color
   ==================================================== */
@media print {
    /* 隐藏操作 UI */
    .navbar, .footer, .step-indicator, .diagnosis-step,
    .progress-section, .header-actions, .result-tabs,
    .tab-btn, #detailView, .step-actions, .q-nav-row,
    .camera-controls, .btn { display: none !important; }

    /* 让报告区域全宽可见 */
    #resultSection, #reportView { display: block !important; }
    body, .main-content, .container { background: #fff !important; padding: 0 !important; }

    /* 图表卡片：深色背景改为白底+边框 */
    .constitution-barchart-card,
    .constitution-priority-panel,
    .symptom-dimension-card,
    .radar-container,
    .vision-bars-section,
    .sdim-group {
        background: #fff !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* 文字强制黑色 */
    .bchart-name, .bchart-score, .bchart-label-text,
    .sdim-cat-name, .sdim-q-text, .sdim-q-label,
    .priority-badge-name, .priority-badge-rank, .priority-badge-tip,
    .constitution-barchart-title, .symptom-dimension-title,
    .radar-title, .vision-bars-title {
        color: #111 !important;
    }

    /* 保留彩色条形与区间色带（重要信息） */
    .bchart-fill, .bchart-zone-safe, .bchart-zone-warn,
    .bchart-mark-pop, .sdim-cat-bar, .sdim-q-fill,
    .vision-bar-fill {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    /* 打印隐藏交互提示 */
    .bchart-insight-hint, .bchart-expand { display: none !important; }

    /* 分页控制 */
    .report-container { page-break-inside: avoid; }
    .constitution-barchart-card,
    .symptom-dimension-card { page-break-before: always; }

    /* 报告正文 */
    .final-report, #finalReport {
        font-size: 10pt;
        line-height: 1.7;
        color: #111 !important;
    }
}
