/* ================================================================
   菜刀客在线工具页 · ees.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;
}

/* ── 答题区 ───────────────────────────────────────────── */
.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: 240px;
}

.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: 24px;
    overflow-wrap: anywhere;
}

.q-question .q-num {
    display: inline-block;
    margin-right: 8px;
    color: #667eea;
    font-variant-numeric: tabular-nums;
}

.q-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.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;
}

.q-choice-key {
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 500;
    color: #9ca3af;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 0 6px;
    line-height: 18px;
}

/* ── 完成卡片 ─────────────────────────────────────────── */
.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;
}

/* ── 结果区 ───────────────────────────────────────────── */
#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);
}

.hero-result .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; }

.result-body .screening-badge.negative {
    background: #ecfdf5;
    color: #047857;
}

.result-body .screening-badge.positive {
    background: #fef2f2;
    color: #dc2626;
}

.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; }

/* ── 测试说明 ─────────────────────────────────────────── */
.info-panel .summary-row {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
    align-items: baseline;
}

.info-panel .summary-row .item-value {
    text-align: left;
}

.ie-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; }

/* ── 关于 EES · 文章排版 ──────────────────────────────── */
.extra-panel .seo-article {
    max-width: 1080px;
    padding: 6px 4px 0;
}

.extra-panel .seo-article h2 {
    position: relative;
    margin: 30px 0 12px;
    padding-left: 14px;
    font-size: 17px;
    font-weight: 700;
    color: #1f2937;
    letter-spacing: .2px;
    line-height: 1.5;
}

.extra-panel .seo-article h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 18px;
    border-radius: 3px;
    background: linear-gradient(180deg, #667eea, #764ba2);
}

.extra-panel .seo-article h2:first-child { margin-top: 4px; }

.extra-panel .seo-article p {
    margin: 0 0 12px;
    font-size: 13.5px;
    line-height: 2;
    color: #4b5563;
    text-align: justify;
}

.extra-panel .seo-article b {
    color: #374151;
    font-weight: 600;
}

.extra-panel .seo-article ul,
.extra-panel .seo-article ol {
    margin: 10px 0 16px;
    padding: 0;
    list-style: none;
}

.extra-panel .seo-article ul > li,
.extra-panel .seo-article ol > li {
    position: relative;
    margin-bottom: 8px;
    padding-left: 20px;
    font-size: 13.5px;
    line-height: 2;
    color: #4b5563;
}

.extra-panel .seo-article ul > li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 12px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #a5b4fc;
    box-shadow: 0 0 0 3px rgba(165, 180, 252, .18);
}

.extra-panel .seo-article ol { counter-reset: ees-item; }

.extra-panel .seo-article ol > li {
    counter-increment: ees-item;
    padding-left: 30px;
}

.extra-panel .seo-article ol > li::before {
    content: counter(ees-item);
    position: absolute;
    left: 0;
    top: 5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}

/* 应用场景卡片 */
.extra-panel .seo-article .scene-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    margin: 12px 0 20px;
}

.extra-panel .seo-article .scene-list > li {
    margin: 0;
    padding: 14px 16px 14px 18px;
    background: #f8f9ff;
    border: 1px solid #e8eaf8;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.9;
}

.extra-panel .seo-article .scene-list > li::before {
    content: "";
    left: 0;
    top: 14px;
    bottom: 14px;
    width: 3px;
    height: auto;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, #818cf8, #a78bfa);
    box-shadow: none;
}

/* 因子对照表 */
.extra-panel .ie-table-wrap {
    margin: 14px 0 20px;
    border-color: #e8eaf8;
    box-shadow: 0 2px 10px rgba(99, 102, 241, .06);
}

.extra-panel .factor-table th {
    background: #f3f4ff;
    color: #4338ca;
    font-size: 12.5px;
    border-bottom-color: #e2e5fb;
}

.extra-panel .factor-table td { font-size: 12.5px; }

.extra-panel .factor-table tbody tr:nth-child(even) td { background: #fbfbff; }

.extra-panel .factor-table tbody tr:hover td { background: #f3f5ff; }

/* 重要提示 */
.extra-panel .seo-tip {
    margin: 26px 0 6px;
    padding: 16px 18px 4px;
    background: #fff8f1;
    border: 1px solid #fde3c8;
    border-radius: 10px;
}

.extra-panel .seo-tip h2 { margin-top: 0; color: #b45309; }

.extra-panel .seo-tip h2::before { background: linear-gradient(180deg, #f59e0b, #f97316); }

.extra-panel .seo-tip p { color: #7c4a12; }

.extra-panel .seo-tip b { color: #b45309; }

/* ── 响应式 ───────────────────────────────────────────── */
@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; }
}

@media (max-width: 600px) {
    .quiz-panel .panel-header {
        flex-wrap: wrap;
        gap: 6px;
    }

    .quiz-stage { min-height: 220px; }

    .quiz-card { padding: 16px 16px 20px; }

    .q-question {
        font-size: 17px;
        margin-bottom: 16px;
    }

    .q-choice {
        padding: 12px 14px;
        font-size: 14px;
    }

    .q-choice-key { display: none; }

    .hero-result .amount { font-size: 34px; }

    .extra-panel .seo-article h2 { margin-top: 24px; font-size: 16px; }

    .extra-panel .seo-article p { text-align: left; }

    .extra-panel .seo-article .scene-list { grid-template-columns: 1fr; }
}
