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

body {
    font-family: 'Noto Sans SC', sans-serif;
    background: var(--theme-bg, linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #16213e 100%));
    min-height: 100vh;
    color: #e0e0e0;
    line-height: 1.6;
    --theme-accent: #000000;
    --theme-accent2: #1a1a1a;
    --theme-accent-rgb: rgba(0, 0, 0, 0.2);
    --gray-white: #e0e0e0;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

h1 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gray-white);
    margin-bottom: 40px;
    letter-spacing: 2px;
}

.upload-area {
    border: 2px dashed #667eea;
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    margin-bottom: 40px;
    background: rgba(102, 126, 234, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #764ba2;
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: #764ba2;
    background: rgba(102, 126, 234, 0.15);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    display: block;
}

.upload-text {
    font-size: 1.1rem;
    color: #a0a0a0;
}

.upload-text strong {
    color: #667eea;
}

#fileInput {
    display: none;
}

.question-container {
    display: none;
}

.question-container.active {
    display: block;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--gray-white);
    margin: 40px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--theme-accent-rgb);
}

.question-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--theme-accent-rgb, rgba(102, 126, 234, 0.2));
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.question-card:hover {
    border-color: var(--theme-accent, rgba(102, 126, 234, 0.5));
    background: rgba(255, 255, 255, 0.05);
}

.question-card.answered {
    border-color: rgba(102, 126, 234, 0.6);
}

.question-card.correct {
    border-color: rgba(34, 197, 94, 0.5);
    background: rgba(34, 197, 94, 0.05);
}

.question-card.incorrect {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.05);
}

.question-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.question-number {
    background: var(--theme-accent, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.question-text {
    font-size: 1.1rem;
    color: #f0f0f0;
    flex: 1;
}

.edit-answer-btn {
    background: #666;
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.edit-answer-btn:hover {
    background: #555;
}

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

.edit-answer-modal.show {
    display: flex;
}

.edit-answer-content {
    background: #1a1a2e;
    border: 1px solid var(--theme-accent-rgb);
    border-radius: 12px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
}

.edit-answer-title {
    font-size: 1.1rem;
    color: var(--gray-white);
    margin-bottom: 16px;
}

.edit-answer-input {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    font-family: inherit;
    margin-bottom: 16px;
}

.edit-answer-input:focus {
    outline: none;
    border-color: var(--theme-accent);
}

.edit-answer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.edit-answer-actions button {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}

.edit-answer-actions .cancel-btn {
    background: #444;
    color: white;
    border: none;
}

.edit-answer-actions .save-btn {
    background: #666;
    color: white;
    border: none;
}

.edit-answer-actions button:hover {
    background: #555;
}

.options-list {
    list-style: none;
    padding-left: 44px;
}

.options-list li {
    padding: 10px 16px;
    margin: 8px 0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
}

.options-list li:hover {
    background: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
}

.options-list li.selected {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.options-list li.correct-answer {
    background: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
}

.options-list li.wrong-answer {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

.option-input {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
    cursor: pointer;
}

.option-label {
    cursor: pointer;
    flex: 1;
}

.true-false-options {
    display: flex;
    gap: 20px;
    padding-left: 44px;
    margin-top: 12px;
}

.true-false-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.true-false-options label:hover {
    background: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.5);
}

.true-false-options label.selected {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.true-false-options label.correct-answer {
    background: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
}

.true-false-options label.wrong-answer {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

.essay-answer-btn {
    background: #666;
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
    margin-left: 44px;
    margin-top: 12px;
}

.essay-answer-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.essay-answer-content {
    display: none;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    padding: 20px;
    margin-left: 44px;
    margin-top: 16px;
    line-height: 1.8;
    color: #d0d0d0;
}

.essay-answer-content.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

.answer-feedback {
    display: none;
    margin-left: 44px;
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 500;
}

.answer-feedback.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

.answer-feedback.correct {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.5);
    color: #22c55e;
}

.answer-feedback.incorrect {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #ef4444;
}

.confirm-btn {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
    margin-left: 44px;
    margin-top: 12px;
}

.confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
}

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

.submit-btn {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 40px auto;
    padding: 16px 40px;
    background: #666;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-secondary {
    background: transparent;
    border: 1px solid rgba(102, 126, 234, 0.5);
    color: #667eea;
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
    margin-top: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.btn-secondary:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: #667eea;
}

.float-buttons {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 999;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.3s ease;
}

.float-btn {
    width: 44px;
    height: 44px;
    background: #666;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.float-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.progress-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 280px;
    max-height: 400px;
    background: rgba(20, 20, 35, 0.95);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    transition: all 0.3s ease;
    overflow: hidden;
}

.progress-panel.collapsed {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(102, 126, 234, 0.1);
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
}

.progress-panel.collapsed .progress-header {
    border-bottom: none;
    height: 100%;
    justify-content: center;
    padding: 0;
}

.progress-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-white);
}

.progress-panel.collapsed .progress-title {
    display: none;
}

.toggle-btn {
    background: none;
    border: none;
    color: #667eea;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.2s ease;
}

.toggle-btn:hover {
    color: #764ba2;
}

.progress-panel.collapsed .toggle-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.progress-content {
    padding: 12px 16px;
    max-height: 340px;
    overflow-y: auto;
}

.progress-panel.collapsed .progress-content {
    display: none;
}

.progress-section {
    margin-bottom: 16px;
}

.progress-section-title {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 8px;
}

.progress-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.progress-item {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(102, 126, 234, 0.3);
    background: rgba(102, 126, 234, 0.1);
    color: #a0a0a0;
}

.progress-item:hover {
    background: rgba(102, 126, 234, 0.3);
    border-color: #667eea;
}

.progress-item.answered {
    background: rgba(102, 126, 234, 0.3);
    border-color: #667eea;
    color: white;
}

.progress-item.correct {
    background: rgba(34, 197, 94, 0.3);
    border-color: #22c55e;
    color: #22c55e;
}

.progress-item.incorrect {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
    color: #ef4444;
}

.progress-summary {
    padding: 12px 16px;
    background: rgba(102, 126, 234, 0.1);
    border-top: 1px solid rgba(102, 126, 234, 0.2);
    font-size: 0.85rem;
    color: #a0a0a0;
}

.progress-panel.collapsed .progress-summary {
    display: none;
}

.format-hint {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    padding: 24px;
    margin-top: 30px;
    font-size: 0.95rem;
    color: #888;
}

.format-hint h3 {
    color: #ffffff;
    margin-bottom: 16px;
    font-size: 1.1rem;
}

.format-hint code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
    color: #a0d0a0;
}

.format-hint pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 16px;
    border-radius: 8px;
    margin: 12px 0;
    overflow-x: auto;
    font-family: monospace;
    font-size: 0.85rem;
    line-height: 1.5;
}

.results-page {
    display: none;
    padding: 40px 20px;
    max-width: 900px;
    margin: 0 auto;
}

.results-page.active {
    display: block;
}

.main-page.hidden {
    display: none;
}

.results-header {
    text-align: center;
    margin-bottom: 40px;
}

.results-score {
    font-size: 4rem;
    font-weight: 700;
    background: #666;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.results-percentage {
    font-size: 1.5rem;
    color: #a0a0a0;
    margin-top: 8px;
}

.results-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 30px 0;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
}

.stat-value.correct { color: #22c55e; }
.stat-value.incorrect { color: #ef4444; }

.stat-label {
    font-size: 0.9rem;
    color: #888;
    margin-top: 4px;
}

.results-section {
    margin: 30px 0;
}

.results-section-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.3);
}

.result-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.result-card.correct {
    border-left: 4px solid #22c55e;
}

.result-card.incorrect {
    border-left: 4px solid #ef4444;
}

.result-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.result-icon {
    font-size: 1.2rem;
}

.result-icon.correct { color: #22c55e; }
.result-icon.incorrect { color: #ef4444; }

.result-question-text {
    font-size: 1rem;
    color: #d0d0d0;
}

.result-details {
    padding-left: 44px;
}

.result-answer-row {
    margin: 6px 0;
    font-size: 0.95rem;
}

.result-answer-label {
    color: #888;
}

.result-answer-value {
    font-weight: 600;
}

.result-answer-value.correct { color: #22c55e; }
.result-answer-value.incorrect { color: #ef4444; }

.back-btn {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 40px auto;
    padding: 16px 40px;
    background: #666;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
}

.back-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.results-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
}

.result-action-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
}

.result-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
}

.result-action-btn.secondary {
    background: #666;
}

.result-action-btn.secondary:hover {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.theme-menu {
    position: fixed;
    left: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(20, 20, 35, 0.95);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    padding: 16px;
    z-index: 998;
    display: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    min-width: 200px;
}

.theme-menu.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

.theme-menu-title {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 12px;
    text-align: center;
}

.theme-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.theme-option {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.theme-option:hover {
    transform: scale(1.1);
    border-color: #667eea;
}

.theme-option.active {
    border-color: #fff;
}

.theme-btn {
    font-size: 1rem !important;
}

.color-picker-section {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 12px;
}

.color-picker-label {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 8px;
    display: block;
    text-align: center;
}

.color-picker-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.color-picker {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: none;
    padding: 0;
}

.color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker::-webkit-color-swatch {
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
}

/* 计时器样式 */
.timer-panel {
    position: fixed;
    left: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(20, 20, 35, 0.95);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    padding: 16px;
    z-index: 998;
    display: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    min-width: 140px;
    text-align: center;
}

.timer-panel.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.timer-title {
    font-size: 0.9rem;
    color: #a0a0a0;
}

.timer-close-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.timer-close-btn:hover {
    color: #ef4444;
}

.timer-display {
    font-size: 2.5rem;
    font-weight: 700;
    color: #667eea;
    font-family: 'Courier New', monospace;
    margin: 16px 0;
    letter-spacing: 2px;
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.timer-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timer-btn:hover {
    background: rgba(102, 126, 234, 0.4);
    transform: scale(1.1);
}

/* 设置菜单样式 */
.settings-menu {
    position: fixed;
    left: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(20, 20, 35, 0.95);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    padding: 16px;
    z-index: 997;
    display: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    min-width: 220px;
}

.settings-menu.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

.settings-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
}

.settings-menu-title {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

.settings-close-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.settings-close-btn:hover {
    color: #ef4444;
}

.settings-section {
    margin-bottom: 16px;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section-title {
    font-size: 0.9rem;
    color: #667eea;
    margin-bottom: 12px;
    font-weight: 500;
}

.settings-field {
    margin-bottom: 12px;
}

.settings-field label {
    display: block;
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 4px;
}

.settings-field select,
.settings-field input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    font-size: 0.9rem;
    font-family: inherit;
}

.settings-field select:focus,
.settings-field input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

.settings-field select option {
    background: #1a1a2e;
    color: #fff;
}

.settings-btn {
    width: 100%;
    padding: 10px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.settings-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}
