* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background-color: #f5f5f5;
}

.header {
    background-color: #3498db;
    color: white;
    padding: 5px;
    text-align: center;
    font-size: 1.5em;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-btn {
    padding: 2px 10px;
    background-color: #307cc7;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    margin-right: 20px;
}

.admin-btn:hover {
    background-color: #4b83b7;
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.answer-sheet {
    width: 18%;
    background-color: #fff;
    padding: 20px;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.test-selector {
    margin-bottom: 20px;
}

.test-selector select {
    width: 70%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.test-selector button {
    width: 20%;
    padding: 8px;
    margin-left: 5%;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.test-selector button:hover {
    background-color: #2980b9;
}

.timer {
    margin-bottom: 20px;
    font-size: 1.2em;
    text-align: center;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.question-types {
    margin-bottom: 10px;
    font-weight: bold;
    color: #555;
}

.question-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.question-item {
    width: calc(20% - 8px);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #eee;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.question-item:hover {
    background-color: #ddd;
}

.question-item.answered {
    background-color: #8eb5fc;
}

.question-item.marked::after {
    content: '🔖';
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 10px;
}

.question-item.correct {
    background-color: #28a745;
    color: white;
}

.question-item.incorrect {
    background-color: #dc3545;
    color: white;
}

.submit-btn {
    padding: 10px;
    background-color: #1877ca;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    margin-top: auto;
}

.submit-btn:hover {
    background-color: #33648a;
}

.reset-btn {
    padding: 10px;
    background-color: #1877ca;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    margin-top: 10px;
}

.reset-btn:hover {
    background-color: #33648a;
}

.score-display {
    margin-top: 10px;
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    color: #ce2c2c;
}

.question-area {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    background-color: #fff;
}

.test-title {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
    color: #3498db;
}

.question-container {
    margin-bottom: 10px;
    padding: 8px;
    border-radius:5px;
    background-color: #f3f7fd;
}

.question-header {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.question-number {
    font-weight: bold;
    margin-right: 5px;
}

.flag-btn {
    margin-right: 10px;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 1.2em;
}

.option-item {
    font-family: 'Consolas', 'Menlo', 'Monaco', 'Courier New', monospace;
    line-height: 0.8;
}

.options-list {
    list-style-type: none;
}

.option-item {
    margin-bottom: 10px;
    padding: 10px;
    background-color: #e9ecef;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.option-item:hover {
    background-color: #dee2e6;
}

.option-item.selected {
    background-color: #d8e9ec;
    border-left: 4px solid #17a2b8;
}

.option-item.correct-answer {
    background-color: #d4edda;
    border-left: 4px solid #28a745;
}

.option-item.wrong-answer {
    background-color: #f8d7da;
    border-left: 4px solid #dc3545;
}

.answer-feedback {
    margin-top: 5px;
    padding: 3px;
    border-radius: 4px;
    display: none;
}

.answer-feedback.correct {
    background-color: #d4edda;
    color: #155724;
    display: block;
}

.answer-feedback.incorrect {
    background-color: #f8d7da;
    color: #721c24;
    display: block;
}

pre,
code {
    font-family: 'Consolas', 'Menlo', 'Monaco', 'Courier New', monospace;
    margin: 0;
    padding: 5px;
    tab-size: 4;
    /* 确保 Tab 渲染为 4 个空格 */
}

pre {
    background-color: #2d2d2d;
    color: #f8f8f2;
    border-radius: 4px;
    overflow-x: auto;
}

code {
    display: block;
    white-space: pre;
    /* 保留所有空格和换行 */
}

.language-python {
    color: #eac337;
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }

    .answer-sheet {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #ddd;
    }

    .question-item {
        width: calc(10% - 8px);
    }
}