/* quiz.css - 通用问答测试页样式（属性测试/恋爱态度测试共用） */
/* 黑白简约线条风格，与全站一致 */

.quiz-app {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 80px;
    min-height: 100vh;
}

/* ===== 开始页 ===== */
.quiz-start {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    text-align: center;
}

.quiz-start h1 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 12px;
    letter-spacing: 2px;
}

.quiz-start .quiz-sub {
    font-size: 1rem;
    color: var(--muted);
    margin-bottom: 12px;
}

.quiz-start .quiz-desc {
    font-size: 0.875rem;
    color: var(--muted);
    margin-bottom: 16px;
    line-height: 1.8;
    max-width: 380px;
}

.quiz-start .quiz-meta {
    font-size: 0.75rem;
    color: var(--muted);
    border: 1.5px dashed var(--light-border);
    border-radius: 8px;
    padding: 10px 18px;
    margin-bottom: 36px;
    line-height: 1.9;
}

.quiz-start-btn {
    background: #000;
    color: #fff;
    border: 2px solid #000;
    padding: 14px 48px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-start-btn:hover {
    background: #fff;
    color: #000;
}

/* 断点续答（有未完成进度时显示） */
.quiz-resume-wrap {
    width: 100%;
    max-width: 320px;
    margin-bottom: 20px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
}

.quiz-resume-tip {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 10px;
}

.quiz-resume-btn {
    display: block;
    width: 100%;
    padding: 11px 16px;
    background: #000;
    color: #fff;
    border: 2px solid #000;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

.quiz-resume-btn:hover {
    background: #fff;
    color: #000;
}

.quiz-resume-discard {
    display: block;
    width: 100%;
    padding: 8px 16px;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
}

.quiz-resume-discard:hover {
    color: var(--fg);
}

/* 桌面端键盘提示（仅支持悬停的设备显示） */
.quiz-kbd-hint {
    display: none;
    font-size: 12px;
    color: var(--muted);
    margin-top: 14px;
}

@media (hover: hover) and (pointer: fine) {
    .quiz-kbd-hint {
        display: block;
    }
}

/* ===== 答题页 ===== */
.quiz-questions {
    display: none;
    flex-direction: column;
    min-height: 70vh;
    transition: opacity 0.15s ease;
}

.quiz-progress-text {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
    text-align: right;
}

.quiz-progress-track {
    width: 100%;
    height: 4px;
    background: var(--light-border);
    border-radius: 2px;
    margin-bottom: 24px;
    overflow: hidden;
}

.quiz-progress-fill {
    height: 100%;
    background: #000;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.quiz-question {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 30px;
    line-height: 1.6;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quiz-option {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #000;
    border-radius: 5px;
    background: #fff;
    color: #000;
    font-size: 15px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.5;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.quiz-option:hover {
    background: #000;
    color: #fff;
}

.quiz-option:active {
    transform: scale(0.97);
}

/* 回退时高亮已选答案 */
.quiz-option.selected {
    background: #000;
    color: #fff;
}

.quiz-option .sel-tick {
    margin-right: 2px;
}

.quiz-back {
    margin-top: 26px;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
    text-align: center;
    text-decoration: underline;
}

.quiz-back:hover {
    color: var(--fg);
}

/* ===== 结果页 ===== */
.quiz-result {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-bottom: 40px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.quiz-result.revealed {
    opacity: 1;
    transform: translateY(0);
}

.quiz-result-head {
    margin-bottom: 24px;
    padding-top: 16px;
}

.quiz-result-type {
    font-size: 2.6rem;
    font-weight: bold;
    letter-spacing: 4px;
    margin-bottom: 8px;
    line-height: 1.3;
}

.quiz-result-name {
    font-size: 1.15rem;
    color: var(--muted);
    margin-bottom: 10px;
}

.quiz-result-badge {
    display: inline-block;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    padding: 4px 16px;
    font-size: 13px;
    color: var(--muted);
}

.quiz-result-desc {
    font-size: 0.92rem;
    line-height: 1.9;
    color: var(--fg);
    max-width: 480px;
    margin-bottom: 26px;
    text-align: left;
}

/* 百分比条列表 */
.quiz-pct-list {
    width: 100%;
    max-width: 470px;
    margin-bottom: 26px;
    text-align: left;
}

.quiz-pct-row {
    margin-bottom: 12px;
}

.quiz-pct-row .pct-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.quiz-pct-row .pct-name {
    font-size: 14px;
    font-weight: bold;
}

.quiz-pct-row .pct-name .pct-en {
    font-weight: normal;
    color: var(--muted);
    font-size: 12px;
    margin-left: 4px;
}

.quiz-pct-row .pct-val {
    font-size: 13px;
    font-weight: bold;
}

/* 程度分级小标签 */
.quiz-pct-row .pct-band {
    font-size: 11px;
    font-weight: normal;
    color: var(--muted);
    border: 1px solid var(--light-border);
    border-radius: 8px;
    padding: 1px 6px;
    margin-right: 6px;
    display: inline-block;
}

/* 作答质量警告框 */
.quiz-warn {
    width: 100%;
    max-width: 480px;
    border: 1.5px dashed var(--fg);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.8rem;
    line-height: 1.7;
    text-align: left;
    margin-bottom: 18px;
}

.quiz-pct-row .pct-track {
    width: 100%;
    height: 8px;
    background: var(--light-border);
    border-radius: 4px;
    overflow: hidden;
}

.quiz-pct-row .pct-fill {
    height: 100%;
    background: #000;
    border-radius: 4px;
    width: 0;
    transition: width 0.9s ease;
}

.quiz-pct-row.dim .pct-fill {
    background: #888;
}

/* 解读区块 */
.quiz-result-section {
    width: 100%;
    max-width: 480px;
    margin-bottom: 20px;
    text-align: left;
}

.quiz-section-title {
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1.5px solid var(--border);
}

.quiz-role-card {
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 10px;
    font-size: 0.85rem;
    line-height: 1.8;
    color: var(--fg);
}

.quiz-role-card b {
    display: block;
    margin-bottom: 2px;
    font-size: 0.95rem;
}

.quiz-role-card .card-pct {
    float: right;
    font-size: 14px;
    font-weight: bold;
}

/* 操作按钮 */
.quiz-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
    margin-bottom: 20px;
}

.quiz-btn {
    padding: 12px 26px;
    border: 2px solid #000;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    color: #000;
}

.quiz-btn.primary {
    background: #000;
    color: #fff;
}

.quiz-btn.primary:hover {
    background: #333;
}

.quiz-btn.secondary:hover {
    background: var(--hover-bg);
}

/* 提示 */
.quiz-notice {
    font-size: 0.72rem;
    color: var(--muted);
    line-height: 1.7;
    max-width: 460px;
    margin-top: 6px;
}

@media (max-width: 480px) {
    .quiz-start h1 {
        font-size: 1.5rem;
    }

    .quiz-result-type {
        font-size: 2rem;
        letter-spacing: 2px;
    }

    .quiz-question {
        font-size: 1.1rem;
    }

    .quiz-option {
        padding: 13px 16px;
        font-size: 14px;
    }

    .quiz-actions {
        width: 100%;
        max-width: 300px;
        flex-direction: column;
    }

    .quiz-btn {
        width: 100%;
        text-align: center;
    }
}
