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

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 页面切换 */
.page {
    display: none;
    flex-direction: column;
    flex: 1;
    animation: fadeIn 0.5s ease-in-out;
}

.page.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 标题样式 */
h1 {
    text-align: center;
    color: #4a6fa5;
    margin-bottom: 30px;
    font-size: 2.5rem;
}

h2 {
    color: #4a6fa5;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

/* 按钮样式 */
button {
    cursor: pointer;
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.primary-btn {
    background-color: #4a6fa5;
    color: white;
    padding: 12px 30px;
    font-size: 1.2rem;
    margin: 20px auto;
    display: block;
    width: 200px;
}

.primary-btn:hover {
    background-color: #3a5a85;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.nav-btn {
    background-color: #e0e0e0;
    color: #333;
    padding: 10px 20px;
}

.nav-btn:hover:not(:disabled) {
    background-color: #d0d0d0;
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 首页样式 */
.rules {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

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

.rules li {
    margin-bottom: 10px;
    padding-left: 25px;
    position: relative;
}

.rules li:before {
    content: "•";
    color: #4a6fa5;
    font-size: 1.5rem;
    position: absolute;
    left: 0;
    top: -5px;
}

.difficulty-selection {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.difficulty-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.difficulty-btn {
    background-color: #e0e0e0;
    color: #333;
    padding: 10px 25px;
    font-size: 1.1rem;
    border-radius: 25px;
}

.difficulty-btn.active {
    background-color: #4a6fa5;
    color: white;
}

/* 答题页面样式 */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background-color: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.progress {
    font-size: 1.2rem;
    font-weight: bold;
    color: #4a6fa5;
}

.timer {
    font-size: 1.2rem;
    font-weight: bold;
}

.timer-value {
    color: #4a6fa5;
    transition: color 0.3s ease;
}

.timer-value.warning {
    color: #f39c12;
}

.timer-value.danger {
    color: #e74c3c;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.question-container {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    flex: 1;
}

#question-text {
    margin-bottom: 30px;
    font-size: 1.4rem;
    line-height: 1.6;
}

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

.option-btn {
    background-color: #f8f9fa;
    border: 2px solid #e0e0e0;
    color: #333;
    padding: 15px 20px;
    text-align: left;
    font-size: 1.1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.option-btn:hover:not(.selected):not(.correct):not(.wrong) {
    background-color: #e9ecef;
    border-color: #4a6fa5;
}

.option-btn.selected {
    border-color: #4a6fa5;
    background-color: #e3f2fd;
}

.option-btn.correct {
    border-color: #27ae60;
    background-color: #d4edda;
    color: #155724;
}

.option-btn.wrong {
    border-color: #e74c3c;
    background-color: #f8d7da;
    color: #721c24;
}

.navigation-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hidden {
    display: none;
}

/* 结果页面样式 */
.result-summary {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.score {
    font-size: 2rem;
    margin-bottom: 20px;
}

.score-value {
    color: #4a6fa5;
    font-weight: bold;
    font-size: 2.5rem;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 50px;
    flex-wrap: wrap;
}

.stat-item {
    font-size: 1.2rem;
}

.stat-value {
    font-weight: bold;
    color: #4a6fa5;
}

.wrong-questions {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    flex: 1;
}

.wrong-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.wrong-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}

.wrong-item-question {
    font-size: 1.2rem;
    margin-bottom: 15px;
    font-weight: bold;
}

.wrong-item-answers {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.answer-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.answer-label {
    font-weight: bold;
    min-width: 80px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .quiz-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    #question-text {
        font-size: 1.2rem;
    }
    
    .navigation-buttons {
        flex-direction: column;
        gap: 15px;
    }
    
    .stats {
        gap: 20px;
    }
    
    .primary-btn {
        width: 100%;
    }
}