* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

header {
    background-color: #333;
    color: #fff;
    padding: 1rem;
    text-align: center;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

nav ul li {
    margin: 0 1rem;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s;
}

nav ul li a:hover {
    background-color: #555;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info span {
    color: #fff;
}

#logout-btn {
    background-color: #555;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
}

#logout-btn:hover {
    background-color: #777;
}

.login-section, .register-section {
    background-color: #fff;
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 500px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.login-section h2, .register-section h2 {
    margin-bottom: 1.5rem;
    color: #333;
    text-align: center;
}

.login-btn, .register-btn {
    background-color: #4CAF50;
    color: white;
    width: 100%;
    margin-top: 1rem;
}

.login-btn:hover, .register-btn:hover {
    background-color: #45a049;
}

.register-link, .login-link {
    text-align: center;
    margin-top: 1rem;
}

.import-methods {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.import-method {
    flex: 1;
    background-color: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
}

.import-method h3 {
    margin-bottom: 1rem;
    color: #555;
}

@media (max-width: 768px) {
    .import-methods {
        flex-direction: column;
    }
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.exam-category {
    background-color: #fff;
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.exam-category h2 {
    margin-bottom: 1.5rem;
    color: #333;
    text-align: center;
}

.category-buttons {
    display: flex;
    gap: 2rem;
    justify-content: center;
}

.category-btn {
    flex: 1;
    max-width: 300px;
    padding: 2rem;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.category-btn:hover {
    background-color: #45a049;
}

.practice-main {
    background-color: #fff;
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.practice-main h2 {
    margin-bottom: 1.5rem;
    color: #333;
    text-align: center;
}

.practice-modules {
    display: flex;
    gap: 2rem;
}

.module {
    flex: 1;
    background-color: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
}

.module h3 {
    margin-bottom: 1rem;
    color: #555;
    text-align: center;
}

.module-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.action-btn {
    padding: 1rem;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.action-btn:hover {
    background-color: #1976D2;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.login-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

#forgot-password {
    color: #2196F3;
    text-decoration: none;
}

#forgot-password:hover {
    text-decoration: underline;
}

button {
    padding: 0.8rem 1.5rem;
    margin: 0.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.start-exam, .start-practice {
    background-color: #4CAF50;
    color: white;
}

.start-exam:hover, .start-practice:hover {
    background-color: #45a049;
}

.placeholder {
    background-color: #999;
    color: white;
    cursor: not-allowed;
}

.collection-section {
    background-color: #fff;
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.collection-content {
    margin-top: 1rem;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 2rem;
}

#exam-page, #result-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    z-index: 1000;
    overflow-y: auto;
}

.hidden {
    display: none;
}

.exam-header, .result-header {
    background-color: #333;
    color: #fff;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#back-btn, #result-back-btn {
    background-color: #555;
    color: white;
}

#back-btn:hover, #result-back-btn:hover {
    background-color: #777;
}

.exam-content {
    padding: 2rem;
}

.exam-mode {
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
}

.exam-mode button {
    background-color: #f0f0f0;
    color: #333;
}

.exam-mode button.active {
    background-color: #4CAF50;
    color: white;
}

#question-container {
    margin-bottom: 2rem;
    min-height: 300px;
}

.question {
    background-color: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.question h3 {
    margin-bottom: 1rem;
    color: #333;
}

.options {
    margin-top: 1rem;
}

.option {
    margin: 0.5rem 0;
    padding: 0.8rem;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.option:hover {
    background-color: #f0f0f0;
}

.option.selected {
    background-color: #e3f2fd;
    border-color: #2196F3;
}

.option.correct {
    background-color: #e8f5e8;
    border-color: #4CAF50;
}

.option.incorrect {
    background-color: #ffebee;
    border-color: #f44336;
}

.exam-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

#submit-btn {
    background-color: #2196F3;
    color: white;
}

#submit-btn:hover {
    background-color: #1976D2;
}

.result-content {
    padding: 2rem;
    text-align: center;
}

.score {
    margin-bottom: 2rem;
}

.score h3 {
    font-size: 2rem;
    color: #333;
}

.result-stats {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

#review-btn, #retry-btn {
    background-color: #4CAF50;
    color: white;
    margin: 0 1rem;
}

#review-btn:hover, #retry-btn:hover {
    background-color: #45a049;
}

footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
}

.question-actions {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
}

.favorite-btn {
    background-color: #ff9800;
    color: white;
}

.favorite-btn:hover {
    background-color: #f57c00;
}

.favorite-btn.active {
    background-color: #e65100;
}

/* 答案样式 */
.answer {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #e3f2fd;
    border-radius: 5px;
    border-left: 4px solid #2196F3;
}

.answer h4 {
    margin-top: 0;
    color: #1976D2;
}

.answer p {
    margin: 0.5rem 0;
}

.option.correct {
    background-color: #e8f5e8;
    border-left: 4px solid #4CAF50;
}

/* 题库统计样式 */
.question-stats {
    background-color: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.question-stats h3 {
    margin-bottom: 1rem;
    color: #333;
}

.question-actions {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
}

.clear-btn {
    background-color: #f44336;
    color: white;
}

.clear-btn:hover {
    background-color: #d32f2f;
}

.view-btn {
    background-color: #2196F3;
    color: white;
}

.view-btn:hover {
    background-color: #1976D2;
}

/* 开关按钮样式 */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    margin-left: 1rem;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #2196F3;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

@media (max-width: 768px) {
    .exam-types {
        flex-direction: column;
    }

    .exam-mode {
        flex-direction: column;
    }

    .exam-controls {
        flex-direction: column;
        gap: 1rem;
    }

    .result-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* 后台管理样式 */
.admin-section {
    background-color: #fff;
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.admin-section h2 {
    margin-bottom: 1.5rem;
    color: #333;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.import-btn {
    background-color: #2196F3;
    color: white;
}

.import-btn:hover {
    background-color: #1976D2;
}

.success-message {
    background-color: #e8f5e8;
    color: #2e7d32;
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.error-message {
    background-color: #ffebee;
    color: #c62828;
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}