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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 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 {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 100%;
    padding: 40px;
    min-height: 500px;
}

h1 {
    color: #667eea;
    text-align: center;
    margin-bottom: 30px;
    font-size: 32px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.input-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 10px;
    color: #333;
    font-weight: 600;
    font-size: 16px;
}

input[type="number"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 18px;
    transition: border-color 0.3s;
}

input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
}

input[type="number"].error {
    border-color: #ff6b6b;
    background-color: #fff5f5;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-danger {
    background: #ff6b6b;
    color: white;
}

.btn-danger:hover {
    background: #fa5252;
}

.question-display {
    text-align: center;
    margin-bottom: 30px;
}

.question-text {
    font-size: 48px;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
}

.timer-bar {
    width: 100%;
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 20px;
}

.timer-progress {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.1s linear;
}

.timer-text {
    text-align: center;
    font-size: 24px;
    color: #667eea;
    margin-bottom: 20px;
    font-weight: bold;
}

.timer-text.warning {
    color: #ffa502;
}

.timer-text.danger {
    color: #ff6b6b;
}

.feedback {
    text-align: center;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    font-size: 18px;
    font-weight: 600;
    display: none;
}

.feedback.success {
    background: #d4edda;
    color: #155724;
    display: block;
}

.feedback.error {
    background: #f8d7da;
    color: #721c24;
    display: block;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    color: #666;
    font-size: 16px;
}

.score-display {
    text-align: center;
    margin-bottom: 30px;
}

.final-score {
    font-size: 72px;
    font-weight: bold;
    color: #667eea;
}

.score-detail {
    color: #666;
    font-size: 20px;
    margin-top: 10px;
}

.records-list {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 20px;
}

.record-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.record-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.record-date {
    font-weight: 600;
    color: #333;
}

.record-score {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
}

.record-detail {
    color: #666;
    font-size: 14px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
}

.close-btn:hover {
    color: #333;
}

.question-review {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
}

.question-review.correct {
    border-left: 4px solid #28a745;
}

.question-review.correct-but-mistake {
    border-left: 4px solid #ffa502;
    background: #fff8e1;
}

.question-review.incorrect {
    border-left: 4px solid #dc3545;
    background: #fff5f5;
    border: 2px solid #ff6b6b;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.2);
}

.question-review.incorrect .review-question {
    color: #dc3545;
}

.review-question {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
}

.review-answer {
    font-size: 14px;
    color: #666;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.filter-btn:hover,
.filter-btn.active {
    background: #667eea;
    color: white;
}

.delete-record-btn {
    background: none;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
}

.delete-record-btn:hover {
    text-decoration: underline;
}

@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 24px;
    }

    .question-text {
        font-size: 36px;
    }

    .final-score {
        font-size: 48px;
    }
}
