/**
 * 智能记忆学习材料题目样式
 */

.intelligent-memory-quiz {
    margin: 2rem 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 头部区域 */
.quiz-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.quiz-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.quiz-header h2 i {
    margin-right: 0.5rem;
}

.quiz-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 使用说明 */
.quiz-instructions {
    background: #f8f9fa;
    padding: 1.5rem;
    border-bottom: 1px solid #dee2e6;
}

.quiz-instructions h4 {
    margin: 0;
    color: #495057;
    font-size: 1.1rem;
}

.quiz-instructions .d-flex {
    margin-bottom: 1rem;
}

.quiz-instructions ul {
    margin: 0;
    padding-left: 1.5rem;
    color: #6c757d;
}

.quiz-instructions li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* 题目列表 */
.quiz-questions {
    padding: 1.5rem;
}

/* 单个题目 */
.quiz-question {
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #fff;
    transition: box-shadow 0.3s ease;
}

.quiz-question:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.quiz-question:last-child {
    margin-bottom: 0;
}

/* 题目头部 */
.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e9ecef;
}

.question-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #212529;
    font-weight: 600;
}

/* 题目文本 */
.question-text {
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
    line-height: 1.6;
    color: #212529;
}

/* 选项区域 */
.question-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

/* 选项按钮 */
.quiz-option-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem 1.25rem;
    text-align: left;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    color: #212529;
    line-height: 1.5;
}

.quiz-option-btn:hover:not(:disabled) {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateX(4px);
}

.quiz-option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

/* 已选择的选项 */
.quiz-option-btn.selected {
    font-weight: 600;
    border-width: 3px;
}

/* 正确答案样式 */
.quiz-option-btn.correct,
.quiz-option-btn.selected.correct {
    background: #d1e7dd;
    border-color: #28a745;
    color: #155724;
}

.quiz-option-btn.correct:not(.selected) {
    background: #d4edda;
    border-color: #28a745;
    opacity: 0.8;
}

/* 错误答案样式 */
.quiz-option-btn.incorrect,
.quiz-option-btn.selected.incorrect {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

/* 答案图标 */
.answer-icon {
    margin-left: auto;
    font-size: 1.2em;
}

/* 解析区域 */
.question-footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

/* 解析 按钮 */
.quiz-view-btn,
.quiz-hide-btn {
    margin-bottom: 1rem;
}

.quiz-view-btn {
    /* 查看解析按钮 - 蓝色 */
}

.quiz-hide-btn {
    /* 隐藏解析按钮 - 灰色 */
}

/* 解析内容块 */
.quiz-explanation-block {
    background: #f8f9fa;
    padding: 1.25rem;
    border-radius: 6px;
    border-left: 4px solid #0d6efd;
    margin-top: 0.5rem;
}

/* 兼容旧样式 */
.question-explanation {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

.quiz-explanation-toggle {
    margin-bottom: 1rem;
}

.quiz-explanation {
    background: #f8f9fa;
    padding: 1.25rem;
    border-radius: 6px;
    border-left: 4px solid #0d6efd;
}

.explanation-item {
    margin-bottom: 1rem;
}

.explanation-item:last-child {
    margin-bottom: 0;
}

.explanation-item strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #495057;
    font-size: 0.95rem;
}

.source-reference {
    background: white;
    padding: 0.75rem;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #6c757d;
    line-height: 1.6;
}

.explanation-text {
    color: #495057;
    line-height: 1.7;
    padding: 0.75rem;
    background: white;
    border-radius: 4px;
}

/* 底部区域 */
.quiz-footer {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    border-top: 1px solid #dee2e6;
    text-align: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .quiz-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .quiz-header h2 {
        font-size: 1.25rem;
    }

    .quiz-question {
        padding: 1rem;
    }

    .question-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .quiz-option-btn {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }
}

/* 加载动画 */
.quiz-loading {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.quiz-loading i {
    font-size: 2rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 空状态 */
.quiz-empty {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.quiz-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* 打印样式 */
@media print {
    .quiz-header {
        background: #667eea !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .quiz-option-btn {
        break-inside: avoid;
    }

    .quiz-explanation-toggle {
        display: none;
    }

    .quiz-explanation {
        display: block !important;
    }
}

