/* ================================================================
   菜刀客在线工具页 · scl-90.html 私有样式
   需在 /css/common.css 之后加载。
   ================================================================ */

.main {
    grid-template-columns: minmax(0, 1fr) 380px;
    align-items: start;
}

.col-main {
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 0;
}

.col-side {
    min-width: 0;
}

.info-panel .summary-row {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 10px;
    align-items: baseline;
}

.info-panel .summary-row .item-value {
    text-align: right;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .main {
        grid-template-columns: 1fr;
    }

    .col-main,
    .col-side {
        display: contents;
    }

    .quiz-panel { order: 1; }
    .result-panel { order: 2; }
    .info-panel { order: 3; }
}

.quiz-topbar {
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}

.progress-track {
    height: 8px;
    border-radius: 4px;
    background: #eef2ff;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0;
    border-radius: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 300ms ease;
}

.quiz-progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
}

.quiz-progress-meta .scale-hint {
    color: #9ca3af;
}

.quiz-stage {
    position: relative;
    overflow: hidden;
    min-height: 340px;
}

.quiz-card {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding: 20px 24px 24px;
    background: #fff;
    will-change: transform, opacity;
    transition: transform 260ms ease, opacity 260ms ease;
}

.quiz-card.onscreen { transform: translateX(0); opacity: 1; }
.quiz-card.slide-out-left { transform: translateX(-105%); opacity: 0; }
.quiz-card.slide-out-right { transform: translateX(105%); opacity: 0; }
.quiz-card.from-left { transform: translateX(-105%); opacity: 0; }
.quiz-card.from-right { transform: translateX(105%); opacity: 0; }

.q-question {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.7;
    color: #374151;
    margin-bottom: 22px;
    overflow-wrap: anywhere;
}

.q-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
}

.q-choice {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 13px 16px;
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: all 0.2s ease;
}

.q-choice:hover {
    border-color: #667eea;
    background: #eef2ff;
    transform: translateY(-1px);
}

.q-choice.selected {
    border-color: #667eea;
    background: #eef2ff;
    color: #4338ca;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.q-choice-dot {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    background: #fff;
    transition: all 0.15s;
}

.q-choice.selected .q-choice-dot {
    border-color: #667eea;
    background: #667eea;
    box-shadow: inset 0 0 0 3px #fff;
}

.q-choice-label {
    flex: 1 1 auto;
}

.done-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    height: 100%;
    padding: 10px;
}

.done-icon {
    font-size: 44px;
}

.done-title {
    font-size: 18px;
    font-weight: 700;
    color: #374151;
}

.done-hero {
    font-size: 14px;
    color: #6b7280;
}

.done-hero b {
    display: inline-block;
    margin-left: 6px;
    font-size: 30px;
    font-weight: 700;
    color: #4338ca;
    font-variant-numeric: tabular-nums;
}

.done-sub {
    font-size: 13px;
    color: #9ca3af;
}

.done-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 4px;
}

.hero-sub {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 2px;
}

.crisis-alert {
    border: 1px solid #fecaca;
    background: #fef2f2;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.8;
    color: #991b1b;
}

.crisis-alert strong {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
}

.crisis-alert p {
    margin: 0;
}

.level-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    vertical-align: 1px;
}

.level-badge.lv-normal {
    background: #ecfdf5;
    color: #047857;
}

.level-badge.lv-mild {
    background: #eff6ff;
    color: #1d4ed8;
}

.level-badge.lv-moderate {
    background: #fffbeb;
    color: #b45309;
}

.level-badge.lv-high {
    background: #fef2f2;
    color: #dc2626;
}

.level-badge.lv-severe {
    background: #7f1d1d;
    color: #fff;
}

.screening-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.screening-badge.positive {
    background: #fef2f2;
    color: #dc2626;
}

.screening-badge.negative {
    background: #ecfdf5;
    color: #047857;
}

.factor-row {
    padding: 10px 14px;
}

.factor-row + .factor-row {
    border-top: 1px solid #f0f1f3;
}

.factor-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 13px;
}

.factor-name {
    color: #374151;
    font-weight: 600;
}

.factor-val {
    color: #ef4444;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.factor-track {
    height: 6px;
    background: #eef2ff;
    border-radius: 3px;
    overflow: hidden;
}

.factor-fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 3px;
    background: #667eea;
    transition: width 0.3s;
}

.factor-fill.lv-normal {
    background: #10b981;
}

.factor-fill.lv-mild {
    background: #3b82f6;
}

.factor-fill.lv-moderate {
    background: #f59e0b;
}

.factor-fill.lv-high {
    background: #ef4444;
}

.factor-fill.lv-severe {
    background: #991b1b;
}

.interpret {
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.85;
    color: #4b5563;
}

.interpret p + p {
    margin-top: 6px;
}

.result-note {
    padding: 0 2px;
    font-size: 12px;
    line-height: 1.7;
    color: #9ca3af;
}

#resultContent {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#resultContent .hero-result {
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.25);
}

#resultContent .summary-list {
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}

.factor-table-wrap {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow-x: auto;
}

.factor-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    line-height: 1.75;
}

.factor-table th {
    padding: 9px 12px;
    background: #f9fafb;
    color: #374151;
    font-weight: 600;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.factor-table td {
    padding: 9px 12px;
    color: #4b5563;
    vertical-align: top;
    border-bottom: 1px solid #f3f4f6;
}

.factor-table td:first-child {
    width: 110px;
    color: #374151;
    font-weight: 600;
    white-space: nowrap;
}

.factor-table tbody tr:last-child td {
    border-bottom: none;
}

.factor-table tbody tr:hover td {
    background: #fafbff;
}

@media (max-width: 600px) {
    .quiz-panel .panel-header {
        flex-wrap: wrap;
        gap: 6px;
    }

    .quiz-stage {
        min-height: 330px;
    }

    .quiz-card {
        padding: 16px 16px 20px;
    }

    .q-question {
        font-size: 17px;
        margin-bottom: 16px;
    }

    .q-choice {
        padding: 12px 14px;
        font-size: 14px;
    }

    .hero-result .amount {
        font-size: 34px;
    }
}
