* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 30px;
    position: relative;
    overflow: hidden;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eaeaea;
    position: relative;
}

.header h1 {
    color: #2c3e50;
    font-size: 2.4rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.header h1 i {
    color: #3498db;
}

.header p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

.random-notice {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 20px;
    text-align: center;
    color: #856404;
    font-weight: bold;
}

.info-bar {
    display: flex;
    justify-content: space-between;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.question-container {
    margin-bottom: 40px;
}

.question-card {
    background-color: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.question-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

.question-number {
    display: inline-block;
    background-color: #3498db;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    text-align: center;
    line-height: 32px;
    margin-right: 12px;
    font-weight: bold;
    font-size: 1.1rem;
}

.question-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
}

.options-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.option {
    padding: 15px 20px;
    background-color: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.option:hover {
    background-color: #f0f7ff;
    border-color: #a0d2ff;
}

.option.selected {
    background-color: #e1f0ff;
    border-color: #3498db;
    font-weight: bold;
}

.option.correct {
    background-color: #d4edda;
    border-color: #28a745;
    position: relative;
}

.option.correct::after {
    content: '✓';
    position: absolute;
    right: 20px;
    color: #28a745;
    font-weight: bold;
    font-size: 1.2rem;
}

.option.incorrect {
    background-color: #f8d7da;
    border-color: #dc3545;
    position: relative;
}

.option.incorrect::after {
    content: '✗';
    position: absolute;
    right: 20px;
    color: #dc3545;
    font-weight: bold;
    font-size: 1.2rem;
}

.option-label {
    display: inline-block;
    width: 36px;
    height: 36px;
    background-color: #eaeaea;
    border-radius: 50%;
    text-align: center;
    line-height: 36px;
    margin-right: 15px;
    font-weight: bold;
    color: #555;
    flex-shrink: 0;
}

.selected .option-label {
    background-color: #3498db;
    color: white;
}

.correct .option-label {
    background-color: #28a745;
    color: white;
}

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

.option-text {
    font-size: 1.05rem;
}

.submit-section {
    text-align: center;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 2px solid #eaeaea;
}

.submit-btn {
    background: linear-gradient(90deg, #2ecc71, #1abc9c);
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.6);
}

.submit-btn:active {
    transform: translateY(-1px);
}

.submit-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.result-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    border-radius: 16px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    animation: modalAppear 0.5s ease;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #3498db #e0e0e0;
}

.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #e0e0e0;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

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

.result-icon {
    font-size: 5rem;
    margin-bottom: 20px;
}

.excellent { color: #f1c40f; }
.good { color: #2ecc71; }
.average { color: #3498db; }
.poor { color: #e74c3c; }

.result-title {
    font-size: 2.2rem;
    margin-bottom: 15px;
    color: #2c3e50;
}

.result-score {
    font-size: 3.5rem;
    font-weight: bold;
    margin: 20px 0;
    color: #3498db;
}

.result-text {
    font-size: 1.2rem;
    color: #7f8c8d;
    margin-bottom: 30px;
}

.result-details {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin: 25px 0;
    text-align: left;
}

.result-details h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.category-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.category-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.category-name {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 8px;
}

.category-bar {
    height: 8px;
    background-color: #ecf0f1;
    border-radius: 4px;
    margin: 8px 0;
    overflow: hidden;
}

.category-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease;
}

.category-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.question-review {
    margin-top: 25px;
    text-align: left;
}

.review-title {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 15px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.review-title span {
    font-size: 0.9rem;
    color: #7f8c8d;
    font-weight: normal;
}

.review-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #3498db;
    transition: all 0.2s ease;
}

.review-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
    transform: translateX(3px);
}

.review-item.review-correct {
    border-left-color: #2ecc71;
}

.review-item.review-wrong {
    border-left-color: #e74c3c;
}

.review-question {
    font-weight: 600;
    margin-bottom: 10px;
    color: #2c3e50;
    line-height: 1.5;
}

.review-answer {
    padding: 10px;
    border-radius: 6px;
    margin: 5px 0;
    font-size: 0.95rem;
}

.correct-answer {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.wrong-answer {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.modal-btn {
    padding: 12px 30px;
    border-radius: 50px;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: bold;
    min-width: 150px;
}

.restart-btn {
    background-color: #3498db;
    color: white;
}

.close-btn {
    background-color: #e0e0e0;
    color: #333;
}

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

.close-btn:hover {
    background-color: #d0d0d0;
}

.progress-bar {
    height: 8px;
    background-color: #ecf0f1;
    border-radius: 4px;
    margin-top: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2ecc71, #1abc9c);
    width: 0%;
    transition: width 0.5s ease;
}

.status-bar {
    margin-bottom: 20px;
}

.status-text {
    margin-top: 15px;
    color: #7f8c8d;
    font-size: 1rem;
}

.status-text i {
    margin-right: 5px;
}

#submission-status {
    color: #2ecc71;
    font-weight: bold;
}

.footer {
    text-align: center;
    margin-top: 30px;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.submitted-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 999;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.overlay-content {
    background-color: white;
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
    animation: slideUp 0.4s ease;
}

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

.overlay-content h3 {
    color: #2c3e50;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.overlay-content p {
    color: #7f8c8d;
    margin-bottom: 25px;
}

.overlay-btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    margin: 5px;
}

.overlay-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

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

.overlay-btn.secondary:hover {
    background-color: #d0d0d0;
}

.question-card.submitted {
    opacity: 0.6;
    background-color: #f0f0f0;
}

.question-card.submitted .question-text {
    color: #555;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .info-bar {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .question-card {
        padding: 20px;
    }
    
    .option {
        padding: 12px 15px;
    }
    
    .submit-btn {
        padding: 14px 30px;
        font-size: 1.1rem;
    }
    
    .modal-content {
        padding: 25px 20px;
        max-height: 85vh;
    }
    
    .modal-buttons {
        flex-direction: column;
    }
    
    .modal-btn {
        width: 100%;
    }
    
    .category-stats {
        grid-template-columns: 1fr;
    }
    
    .overlay-content {
        padding: 30px 20px;
        margin: 0 15px;
    }
    
    .status-text {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .status-text span {
        margin-right: 0 !important;
    }
}