/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    min-height: 100vh;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

header h1 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 2.5rem;
}

.mode-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.mode-btn {
    padding: 10px 20px;
    border: 2px solid #3498db;
    background-color: #fff;
    color: #3498db;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    background-color: #3498db;
    color: #fff;
}

.mode-btn.active {
    background-color: #3498db;
    color: #fff;
}

/* 主内容区样式 */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* 欢迎屏幕样式 */
#welcomeScreen {
    text-align: center;
    padding: 50px 20px;
}

#welcomeScreen h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 2rem;
}

#welcomeScreen p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    color: #666;
}

.mode-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.mode-card {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: 300px;
    transition: transform 0.3s ease;
}

.mode-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.mode-card h3 {
    color: #3498db;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.mode-card p {
    color: #666;
    font-size: 0.95rem;
}

.start-btn {
    padding: 15px 40px;
    background-color: #27ae60;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.start-btn:hover {
    background-color: #219a52;
}

/* 题目屏幕样式 */
.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.question-info {
    display: flex;
    gap: 20px;
}

.question-type,
.question-score,
.question-difficulty {
    padding: 5px 10px;
    border-radius: 3px;
    font-weight: bold;
}

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

.question-score {
    background-color: #e8f5e8;
    color: #388e3c;
}

.question-difficulty {
    background-color: #fff3e0;
    color: #f57c00;
}

.question-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-btn {
    padding: 8px 15px;
    background-color: #3498db;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.nav-btn:hover {
    background-color: #2980b9;
}

#questionProgress {
    font-weight: bold;
    color: #2c3e50;
}

.question-content {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #fafafa;
    border-radius: 5px;
    border-left: 5px solid #3498db;
}

#questionNumber {
    color: #3498db;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

#questionText {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #2c3e50;
}

/* 选项样式 */
.options {
    margin-bottom: 20px;
}

.option {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background-color: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option:hover {
    border-color: #3498db;
    background-color: #f0f8ff;
}

.option.selected {
    border-color: #3498db;
    background-color: #e3f2fd;
}

.option.correct {
    border-color: #27ae60;
    background-color: #e8f5e8;
}

.option.incorrect {
    border-color: #e74c3c;
    background-color: #ffebee;
}

.option-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-right: 15px;
    background-color: #3498db;
    color: #fff;
    border-radius: 50%;
    font-weight: bold;
}

.option.selected .option-label {
    background-color: #2980b9;
}

.option.correct .option-label {
    background-color: #27ae60;
}

.option.incorrect .option-label {
    background-color: #e74c3c;
}

.option-text {
    font-size: 1rem;
    color: #2c3e50;
}

/* 答案反馈样式 */
.answer-feedback {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 5px;
    font-weight: bold;
}

.feedback-correct {
    background-color: #e8f5e8;
    color: #27ae60;
    border: 1px solid #27ae60;
}

.feedback-incorrect {
    background-color: #ffebee;
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

.feedback-info {
    background-color: #e3f2fd;
    color: #1976d2;
    border: 1px solid #1976d2;
}

/* 题目操作按钮样式 */
.question-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.action-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-btn {
    background-color: #27ae60;
    color: #fff;
}

.submit-btn:hover {
    background-color: #219a52;
}

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

.show-answer-btn {
    background-color: #f39c12;
    color: #fff;
}

.show-answer-btn:hover {
    background-color: #e67e22;
}

/* 结果屏幕样式 */
#resultScreen {
    text-align: center;
    padding: 50px 20px;
}

#resultScreen h2 {
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2rem;
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    min-width: 150px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.stat-label {
    display: block;
    color: #666;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.stat-value {
    display: block;
    color: #2c3e50;
    font-size: 2rem;
    font-weight: bold;
}

.restart-btn {
    padding: 15px 40px;
    background-color: #3498db;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.restart-btn:hover {
    background-color: #2980b9;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border: 1px solid #888;
    width: 90%;
    max-width: 800px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation-name: modalopen;
    animation-duration: 0.4s;
}

@keyframes modalopen {
    from {opacity: 0; transform: translateY(-50px);}
    to {opacity: 1; transform: translateY(0);}
}

.modal-header {
    padding: 15px 20px;
    background-color: #3498db;
    color: white;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.4rem;
}

.close-btn {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-btn:hover,
.close-btn:focus {
    color: #f00;
    text-decoration: none;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-radius: 0 0 8px 8px;
    text-align: center;
}

/* 进度统计样式 */
.progress-stats {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.stat-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.stat-label {
    font-weight: bold;
    color: #666;
}

.stat-value {
    font-weight: bold;
    color: #2c3e50;
    font-size: 1.1rem;
}

/* 题目列表样式 */
.question-list h4 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.question-list-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 8px;
}

.question-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.question-item.correct {
    background-color: #27ae60;
    color: white;
}

.question-item.wrong {
    background-color: #e74c3c;
    color: white;
}

.question-item.unanswered {
    background-color: #bdc3c7;
    color: white;
}

.question-item.current {
    border: 3px solid #3498db;
    transform: scale(1.1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.question-item:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* 页脚样式 */
footer {
    text-align: center;
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    color: #666;
    font-size: 0.9rem;
}

/* 响应式设计 */
/* 平板设备 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .question-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .question-info {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .mode-info {
        flex-direction: column;
        align-items: center;
    }
    
    .result-stats {
        gap: 20px;
    }
    
    .question-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .action-btn {
        width: 100%;
        max-width: 300px;
    }
}

/* 手机设备 */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    header h1 {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }
    
    .mode-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    #welcomeScreen h2 {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }
    
    .mode-card {
        width: 100%;
        max-width: 300px;
        padding: 15px;
    }
    
    .start-btn {
        padding: 12px 30px;
        font-size: 1.1rem;
    }
    
    .question-content {
        padding: 15px;
    }
    
    #questionNumber {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }
    
    #questionText {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .option {
        padding: 12px;
        margin-bottom: 8px;
    }
    
    .option-label {
        width: 25px;
        height: 25px;
        margin-right: 12px;
        font-size: 0.9rem;
    }
    
    .option-text {
        font-size: 0.95rem;
    }
    
    .answer-feedback {
        padding: 12px;
        font-size: 0.95rem;
    }
    
    .action-btn {
        padding: 10px 25px;
        font-size: 0.95rem;
        max-width: 100%;
    }
    
    .stat-item {
        padding: 15px;
        min-width: 120px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .restart-btn {
        padding: 12px 30px;
        font-size: 1.1rem;
    }
}

/* 小屏手机 */
@media (max-width: 360px) {
    header h1 {
        font-size: 1.3rem;
    }
    
    .mode-selector {
        gap: 8px;
    }
    
    .mode-btn {
        padding: 7px 12px;
        font-size: 0.85rem;
    }
    
    .option {
        padding: 10px;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .option-label {
        margin-right: 0;
        margin-bottom: 5px;
    }
    
    .question-actions {
        gap: 12px;
    }
    
    .action-btn {
        padding: 9px 20px;
        font-size: 0.9rem;
    }
    
    .stat-item {
        min-width: 100px;
        padding: 12px;
    }
    
    .stat-value {
        font-size: 1.3rem;
    }
}