/**
 * 营养学刷题工具样式文件
 * 包含所有页面样式定义
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 800px;
    width: 100%;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.progress {
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 20px;
}

.progress-text {
    color: white;
    text-align: center;
    margin-bottom: 10px;
}

.progress-bar {
    background: rgba(255,255,255,0.3);
    border-radius: 5px;
    height: 10px;
    overflow: hidden;
}

.progress-fill {
    background: #4CAF50;
    height: 100%;
    border-radius: 5px;
    transition: width 0.3s ease;
    width: 0%;
}

.card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    padding: 30px;
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.question-type {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 20px;
}

.type-single {
    background: #e3f2fd;
    color: #1976d2;
}

.type-multiple {
    background: #fff3e0;
    color: #f57c00;
}

.type-judge {
    background: #f3e5f5;
    color: #7b1fa2;
}

.question {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 25px;
    color: #333;
}

.options {
    margin-bottom: 25px;
}

.option {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.option:hover {
    background: #e9ecef;
    border-color: #6c757d;
}

.option.selected {
    background: #e3f2fd;
    border-color: #2196f3;
    color: #1976d2;
}

.option.correct {
    background: #e8f5e8;
    border-color: #4caf50;
    color: #2e7d32;
}

.option.wrong {
    background: #ffebee;
    border-color: #f44336;
    color: #c62828;
}

.judge-options {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.judge-option {
    flex: 1;
    max-width: 150px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: bold;
}

.submit-btn {
    background: #2196f3;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 15px 30px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.3s ease;
    width: 100%;
    margin-bottom: 20px;
}

.submit-btn:hover {
    background: #1976d2;
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.result {
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: none;
}

.result.correct {
    background: #e8f5e8;
    border: 2px solid #4caf50;
    color: #2e7d32;
}

.result.wrong {
    background: #ffebee;
    border: 2px solid #f44336;
    color: #c62828;
}

.result-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.correct-answer {
    margin-bottom: 15px;
}

.explanation {
    line-height: 1.6;
}

.next-btn {
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 15px 30px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.3s ease;
    width: 100%;
}

.next-btn:hover {
    background: #45a049;
}

/* 控制按钮 */
.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.control-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.control-btn:active {
    transform: translateY(0);
}

.control-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.control-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* 返回刷题按钮高亮样式 */
.control-btn.active {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
    transform: translateY(-2px);
}

.control-btn.active:hover {
    background: linear-gradient(135deg, #ff5252 0%, #d63031 100%);
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.5);
}

/* 题库模式显示 */
.quiz-mode {
    text-align: center;
    margin-bottom: 15px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}

.stats {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 15px;
    color: white;
    text-align: center;
}

.stats-item {
    display: inline-block;
    margin: 0 15px;
}

/* 错题导出区域 */
.export-area {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.export-area h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.2rem;
    text-align: center;
}

.export-area textarea {
    width: 100%;
    height: 300px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    background: #fafafa;
    color: #333;
    box-sizing: border-box;
}

.export-area textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.export-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.hidden {
    display: none !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 15px;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .controls {
        justify-content: center;
    }
    
    .stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .option {
        padding: 12px;
        font-size: 14px;
    }
    
    .judge-options {
        flex-direction: column;
    }
    
    .judge-option {
        width: 100%;
        margin: 5px 0;
    }
    
    .export-area {
        margin: 15px;
        padding: 15px;
    }
    
    .export-area textarea {
        height: 250px;
        font-size: 13px;
    }
    
    .export-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .export-controls .control-btn {
        width: 100%;
        max-width: 200px;
    }
}