/* ==================== 在线测评模块样式 ==================== */

/* 测评首页 */
.quiz-home {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding: 40px 20px;
}

.quiz-header {
    margin-bottom: 40px;
}

.quiz-icon {
    font-size: 64px;
    color: var(--primary);
    margin-bottom: 20px;
    display: block;
}

.quiz-header h1 {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.quiz-desc {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* 信息卡片 */
.quiz-info-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.quiz-info-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 24px 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.quiz-info-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.quiz-info-card i {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 12px;
    display: block;
}

.quiz-info-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.quiz-info-card p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* 测评规则 */
.quiz-rules {
    background: white;
    border-radius: var(--radius-md);
    padding: 30px;
    margin-bottom: 40px;
    text-align: left;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.quiz-rules h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quiz-rules h3 i {
    color: var(--primary);
}

.quiz-rules ul {
    list-style: none;
    padding: 0;
}

.quiz-rules li {
    padding: 10px 0;
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    border-bottom: 1px solid var(--border-light);
    padding-left: 20px;
    position: relative;
}

.quiz-rules li:before {
    content: "•";
    color: var(--primary);
    font-weight: bold;
    position: absolute;
    left: 0;
}

.quiz-rules li:last-child {
    border-bottom: none;
}

/* 答题界面 */
.quiz-container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow);
}

.quiz-progress-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border);
}

.quiz-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
    padding: 8px 16px;
    border-radius: var(--radius);
}

.quiz-timer.warning {
    color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
}

.quiz-timer.danger {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
    animation: pulse 1s infinite;
}

.quiz-progress {
    font-size: 15px;
    color: var(--text-secondary);
}

.quiz-progress span {
    font-weight: 700;
    color: var(--primary);
}

.quiz-score-preview {
    font-size: 15px;
    color: var(--text-secondary);
}

.quiz-score-preview span {
    font-weight: 700;
    color: var(--success);
}

/* 题目区域 */
.quiz-question-area {
    margin-bottom: 30px;
}

.question-card {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 30px;
}

.question-type-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 16px;
}

.badge-single {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-multiple {
    background: #d1fae5;
    color: #065f46;
}

.question-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
    line-height: 1.6;
}

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

.option-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.option-item:hover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.option-item.selected {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
}

.option-item.correct {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.option-item.wrong {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.option-letter {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.option-item.selected .option-letter {
    background: var(--primary);
    color: white;
}

.option-item.correct .option-letter {
    background: var(--success);
    color: white;
}

.option-item.wrong .option-letter {
    background: var(--danger);
    color: white;
}

.option-text {
    font-size: 15px;
    color: var(--text-primary);
    flex: 1;
}

/* 答题导航 */
.quiz-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.quiz-question-dots {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.question-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.question-dot:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.question-dot.answered {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.question-dot.current {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

.quiz-submit-area {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* 结果页面 */
.quiz-result {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    padding: 40px 20px;
}

.result-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.result-icon.pass {
    color: var(--success);
}

.result-icon.fail {
    color: var(--danger);
}

.result-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 20px;
}

.result-score-circle {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto 30px;
}

.result-score-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 8;
}

.score-fill {
    fill: none;
    stroke: var(--success);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 339.3;
    stroke-dashoffset: 339.3;
    transition: stroke-dashoffset 1.5s ease;
}

.score-fill.low {
    stroke: var(--danger);
}

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-text span {
    font-size: 48px;
    font-weight: 800;
    color: var(--text-primary);
}

.score-text small {
    font-size: 16px;
    color: var(--text-secondary);
}

.result-message {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 30px;
    line-height: 1.8;
}

.result-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 30px;
}

.result-detail-item {
    background: var(--bg-primary);
    padding: 16px;
    border-radius: var(--radius);
}

.detail-label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.detail-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 解析页面 */
.quiz-review {
    max-width: 800px;
    margin: 0 auto;
}

.review-title {
    text-align: center;
    font-size: 28px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.review-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.review-item {
    background: white;
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.review-item.correct {
    border-left: 4px solid var(--success);
}

.review-item.wrong {
    border-left: 4px solid var(--danger);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.review-number {
    font-weight: 700;
    color: var(--primary);
}

.review-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.review-status.correct {
    background: #d1fae5;
    color: #065f46;
}

.review-status.wrong {
    background: #fee2e2;
    color: #991b1b;
}

.review-question {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.review-options {
    margin-bottom: 16px;
}

.review-option {
    padding: 8px 12px;
    margin-bottom: 6px;
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-secondary);
}

.review-option.correct-answer {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    font-weight: 600;
}

.review-option.user-answer {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.review-explanation {
    background: var(--bg-primary);
    padding: 16px;
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.review-explanation strong {
    color: var(--primary);
}

.review-actions {
    text-align: center;
}

/* 证书 */
.certificate {
    background: #fefce8;
    padding: 20px;
}

.cert-border {
    border: 4px double #ca8a04;
    padding: 40px;
    background: white;
}

.cert-content {
    text-align: center;
    padding: 20px;
}

.cert-header {
    margin-bottom: 30px;
}

.cert-logo {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 12px;
    display: block;
}

.cert-header h2 {
    font-size: 24px;
    color: var(--text-primary);
}

.cert-title {
    font-size: 42px;
    font-weight: 800;
    color: #ca8a04;
    margin-bottom: 8px;
    letter-spacing: 8px;
}

.cert-subtitle {
    font-size: 14px;
    color: var(--text-light);
    letter-spacing: 2px;
    margin-bottom: 40px;
}

.cert-body {
    margin-bottom: 40px;
    line-height: 2;
}

.cert-body p {
    font-size: 16px;
    color: var(--text-secondary);
}

.cert-name {
    font-size: 32px;
    color: var(--primary);
    margin: 20px 0;
    padding: 10px 0;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
    min-width: 300px;
}

.cert-score {
    font-size: 18px;
    margin-top: 20px;
    color: var(--text-primary);
}

.cert-score strong {
    font-size: 24px;
    color: var(--primary);
}

.cert-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.cert-date {
    font-size: 14px;
    color: var(--text-secondary);
}

.cert-seal {
    text-align: center;
}

.cert-seal i {
    font-size: 48px;
    color: var(--primary);
    opacity: 0.3;
}

.cert-seal p {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .quiz-info-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .quiz-progress-bar {
        flex-direction: column;
        gap: 12px;
    }

    .result-details {
        grid-template-columns: 1fr;
    }

    .cert-border {
        padding: 20px;
    }

    .cert-title {
        font-size: 32px;
    }
}

@media (max-width: 480px) {
    .quiz-info-cards {
        grid-template-columns: 1fr;
    }

    .quiz-navigation {
        flex-direction: column;
        gap: 16px;
    }

    .result-actions {
        flex-direction: column;
    }

    .result-actions .btn {
        width: 100%;
    }
}
