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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #2196F3, #21CBF3);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.controls {
    padding: 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.control-group {
    display: flex;
    flex-direction: column;
}

.control-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #495057;
}

select, input {
    padding: 12px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

select:focus, input:focus {
    outline: none;
    border-color: #2196F3;
}

.button-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 120px;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: #2196F3;
    color: white;
}

.btn-primary:hover {
    background: #1976D2;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

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

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

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

.quiz-container {
    padding: 20px;
    display: none;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 0 15px;
}

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

.language-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #495057;
}

.language-toggle:hover {
    background: #e9ecef;
    border-color: #007bff;
    color: #007bff;
}

.language-toggle.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

.lang-icon {
    font-size: 16px;
}

.lang-text {
    font-size: 12px;
    white-space: nowrap;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    color: #495057;
    margin-bottom: 10px;
}

.lang-switch-btn {
    padding: 4px 8px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    cursor: pointer;
    font-size: 11px;
    color: #6c757d;
    transition: all 0.2s ease;
}

.lang-switch-btn:hover {
    background: #e9ecef;
    border-color: #007bff;
    color: #007bff;
}

.question-number {
    font-size: 1.2em;
    font-weight: 600;
    color: #2196F3;
}

.question-stats {
    font-size: 0.9em;
    color: #6c757d;
}

.question-text {
    font-size: 1.1em;
    line-height: 1.5;
    margin-bottom: 20px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #2196F3;
}

.options {
    margin-bottom: 20px;
}

.option {
    display: flex;
    align-items: flex-start;
    padding: 12px;
    margin-bottom: 6px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.option:hover {
    border-color: #2196F3;
    background: #f0f8ff;
}

.option.selected {
    border-color: #2196F3;
    background: #e3f2fd;
}

.option.correct {
    border-color: #28a745;
    background: #d4edda;
    animation: correctPulse 0.6s ease-in-out;
}

.option.incorrect {
    border-color: #dc3545;
    background: #f8d7da;
    animation: incorrectShake 0.6s ease-in-out;
}

@keyframes correctPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

@keyframes incorrectShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-3px); }
    20%, 40%, 60%, 80% { transform: translateX(3px); }
}

.option input {
    margin-right: 12px;
    margin-top: 2px;
}

.option-text {
    flex: 1;
    line-height: 1.4;
}

.quiz-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    margin: 20px 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2196F3, #21CBF3);
    transition: width 0.3s;
}

.results {
    padding: 30px;
    text-align: center;
    display: none;
}

.score-display {
    font-size: 3em;
    font-weight: bold;
    margin: 20px 0;
    color: #2196F3;
}

.score-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.score-item {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #dee2e6;
}

.score-item h3 {
    color: #495057;
    margin-bottom: 10px;
}

.score-item .value {
    font-size: 1.5em;
    font-weight: bold;
    color: #2196F3;
}

.hidden {
    display: none !important;
}

.loading {
    text-align: center;
    padding: 50px;
    font-size: 1.2em;
    color: #6c757d;
}

.stats-container {
    padding: 30px;
    display: none;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #dee2e6;
    text-align: center;
}

.stat-card h3 {
    color: #495057;
    margin-bottom: 15px;
}

.stat-card .stat-value {
    font-size: 2em;
    font-weight: bold;
    color: #2196F3;
    margin-bottom: 10px;
}

.answer-review {
    padding: 30px;
    display: none;
}

.review-question {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #2196F3;
}

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

.review-header {
    font-weight: bold;
    color: #495057;
    margin-bottom: 15px;
}

.review-text {
    margin-bottom: 15px;
    line-height: 1.6;
}

.review-options {
    margin-bottom: 15px;
}

.review-option {
    margin: 5px 0;
    padding: 8px 12px;
    border-radius: 4px;
}

.review-option.user-answer {
    background: #e3f2fd;
    border: 1px solid #2196F3;
}

.review-option.correct-answer {
    background: #d4edda;
    border: 1px solid #28a745;
}

.review-option.incorrect-answer {
    background: #f8d7da;
    border: 1px solid #dc3545;
}

/* 题目状态展示样式 */
.question-status {
    padding: 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.question-status h3 {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #495057;
    text-align: center;
}

.status-groups {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.status-group {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.status-title {
    font-size: 1.2em;
    margin-bottom: 15px;
    padding: 8px 12px;
    border-radius: 6px;
    text-align: center;
}

.status-title.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-title.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-title.pending {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* 状态统计样式 */
.status-summary {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 16px;
}

.status-indicator {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.status-indicator.correct {
    background: #28a745;
}

.status-indicator.wrong {
    background: #dc3545;
}

.status-indicator.untested {
    background: #ffc107;
}

/* 统一题目网格样式 */
.unified-question-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
}

.question-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.question-number-item {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

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

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

.question-number-item.wrong:hover {
    background: #c82333;
}

.question-number-item.correct {
    background: #28a745;
    color: white;
}

.question-number-item.correct:hover {
    background: #218838;
}

.question-number-item.untested {
    background: #ffc107;
    color: #212529;
}

.question-number-item.untested:hover {
    background: #e0a800;
}

/* 抖动动画效果 */
@keyframes shake {
    0%, 20%, 40%, 60%, 80%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
}

.shake {
    animation: shake 0.5s ease-in-out infinite;
}

@media (max-width: 768px) {
    .controls-grid {
        grid-template-columns: 1fr;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .quiz-navigation {
        flex-direction: column;
        gap: 15px;
    }
    
    .score-details {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .question-grid {
        grid-template-columns: repeat(auto-fill, minmax(35px, 1fr));
    }
    
    .question-number-item {
        width: 35px;
        height: 35px;
        font-size: 12px;
    }
}
