/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* 通用样式 */
.hidden {
    display: none !important;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: inline-block;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background-color: #2ecc71;
    color: white;
}

.btn-secondary:hover {
    background-color: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

.btn-success {
    background-color: #2ecc71;
    color: white;
}

.btn-success:hover {
    background-color: #27ae60;
}

.btn-warning {
    background-color: #f39c12;
    color: white;
}

.btn-warning:hover {
    background-color: #d68910;
}

.btn-outline {
    background-color: transparent;
    color: #3498db;
    border: 2px solid #3498db;
}

.btn-outline:hover {
    background-color: #3498db;
    color: white;
}

/* 首页样式 */
.home-page {
    flex: 1;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eaeaea;
}

h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    color: #7f8c8d;
    font-size: 1.2rem;
}

.home-main {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

@media (max-width: 900px) {
    .home-main {
        grid-template-columns: 1fr;
    }
}

/* 分类区域 */
.category-section h2,
.exam-settings h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.category-item {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 5px solid #3498db;
    position: relative;
}

.category-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.category-item.active {
    background-color: #e3f2fd;
    border-left-color: #2c3e50;
}

.category-item h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: #2c3e50;
}

.category-count {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: #3498db;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* 考试设置区域 */
.exam-settings {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.setting-row {
    margin-bottom: 25px;
}

.setting-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.setting-row select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background-color: white;
}

.mixed-option {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.mixed-option input {
    margin-right: 10px;
    width: 18px;
    height: 18px;
}

.mixed-option label {
    margin-bottom: 0;
    cursor: pointer;
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.action-buttons .btn {
    flex: 1;
}

footer {
    text-align: center;
    padding: 20px 0;
    color: #7f8c8d;
    border-top: 1px solid #eaeaea;
    margin-top: 30px;
}

/* 考试页面样式 */
.exam-page {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.exam-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eaeaea;
}

.exam-title h2 {
    color: #2c3e50;
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.question-counter {
    color: #7f8c8d;
    font-size: 1.1rem;
}

.exam-timer {
    background-color: #fdf2f2;
    color: #e74c3c;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: bold;
}

.progress-bar {
    height: 8px;
    background-color: #ecf0f1;
    border-radius: 4px;
    margin-bottom: 30px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #3498db;
    width: 0%;
    transition: width 0.5s ease;
}

.question-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.question-container {
    flex: 1;
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.question-category {
    display: inline-block;
    background-color: #e3f2fd;
    color: #1976d2;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-bottom: 20px;
    font-weight: 500;
}

.question-text {
    font-size: 1.4rem;
    margin-bottom: 30px;
    color: #2c3e50;
    line-height: 1.5;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option {
    padding: 18px;
    background-color: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.1rem;
}

.option:hover {
    background-color: #e9ecef;
}

.option.selected {
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.question-navigation {
    display: flex;
    justify-content: space-between;
}

.question-navigation .btn {
    min-width: 120px;
}

/* 练习页面样式 */
.practice-page {
    flex: 1;
}

.practice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eaeaea;
}

.practice-header h2 {
    color: #2c3e50;
    font-size: 1.8rem;
}

.practice-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.practice-question {
    background-color: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.practice-category {
    display: inline-block;
    background-color: #f3e5f5;
    color: #7b1fa2;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-bottom: 15px;
    font-weight: 500;
}

.practice-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.practice-option {
    padding: 15px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.practice-option:hover {
    background-color: #e9ecef;
}

.practice-option.correct {
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.practice-option.incorrect {
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.practice-explanation {
    margin-top: 20px;
    padding: 15px;
    background-color: #fff3cd;
    border-radius: 6px;
    color: #856404;
}

/* 结果页面样式 */
.result-page {
    flex: 1;
}

.result-header {
    text-align: center;
    margin-bottom: 40px;
}

.result-header h2 {
    color: #2c3e50;
    font-size: 2rem;
    margin-bottom: 20px;
}

.score-display {
    font-size: 5rem;
    font-weight: bold;
    color: #3498db;
    line-height: 1;
}

.score-text {
    font-size: 1.5rem;
    color: #7f8c8d;
    margin-top: 10px;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.stat-item {
    background-color: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 1.1rem;
    color: #7f8c8d;
}

.stat-item:nth-child(1) .stat-value {
    color: #27ae60;
}

.stat-item:nth-child(2) .stat-value {
    color: #e74c3c;
}

.stat-item:nth-child(3) .stat-value {
    color: #f39c12;
}

.result-details {
    margin-bottom: 40px;
}

.result-item {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 15px;
    border-left: 5px solid #3498db;
}

.result-category {
    display: inline-block;
    background-color: #f0f4c3;
    color: #827717;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 0.85rem;
    margin-right: 10px;
    margin-bottom: 10px;
    font-weight: 500;
}

.result-question {
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.result-answer {
    margin-bottom: 5px;
}

.result-explanation {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #ddd;
    color: #7f8c8d;
}

.correct-answer {
    color: #27ae60;
    font-weight: 600;
}

.user-answer {
    color: #e74c3c;
    font-weight: 600;
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .app-container {
        padding: 15px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .home-main {
        gap: 20px;
    }
    
    .exam-settings {
        padding: 20px;
    }
    
    .result-stats {
        grid-template-columns: 1fr;
    }
    
    .exam-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .exam-timer {
        align-self: flex-end;
    }
    
    .question-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .question-navigation .btn {
        width: 100%;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .result-actions .btn {
        width: 100%;
    }
}