/* ==================== 基础样式和布局 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", Arial, sans-serif;
    background: linear-gradient(135deg, #10B981 0%, #06B6D4 100%);
    min-height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    background: linear-gradient(135deg, #10B981 0%, #06B6D4 100%);
}

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

.main-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.main-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.hidden {
    display: none !important;
}

/* ==================== 移动端菜单按钮 ==================== */
.mobile-menu-btn {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1001;
    width: 48px;
    height: 48px;
    background: white;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0;
}

.mobile-menu-btn:active {
    transform: scale(0.95);
}

.mobile-menu-btn span {
    display: block;
    width: 22px;
    height: 2.5px;
    background: #059669;
    border-radius: 2px;
    margin: 3px 0;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-8.5px) rotate(-45deg);
}

/* ==================== 移动端遮罩层 ==================== */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
}

.mobile-overlay.show {
    display: block;
    opacity: 1;
}

/* ==================== 侧边栏样式 ==================== */
.sidebar {
    width: 280px;
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    background: linear-gradient(135deg, #10B981 0%, #06B6D4 100%);
    color: white;
    padding: 25px 20px;
}

.sidebar-header h2 {
    font-size: 18px;
    margin-bottom: 8px;
    font-weight: 600;
}

.sidebar-header .exam-name {
    font-size: 13px;
    opacity: 0.95;
    line-height: 1.4;
}

.question-nav {
    flex: 1;
    overflow-y: auto;
    padding: 20px 15px;
}

.question-nav::-webkit-scrollbar {
    width: 6px;
}

.question-nav::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 10px;
}

.question-type-group {
    margin-bottom: 25px;
}

.type-header {
    font-size: 14px;
    font-weight: 600;
    color: #059669;
    padding: 8px 12px;
    background: #ECFDF5;
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.type-count {
    font-size: 12px;
    color: #6B7280;
    font-weight: normal;
}

.question-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.question-item {
    aspect-ratio: 1;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    background: white;
    color: #374151;
}

.question-item:hover {
    border-color: #10B981;
    background: #ECFDF5;
}

.question-item.current {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    border-color: #059669;
}

.question-item.answered {
    background: #DBEAFE;
    border-color: #3B82F6;
    color: #1E40AF;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #E5E7EB;
    background: #F9FAFB;
}

.sidebar-footer-actions {
    display: flex;
    margin-top: 8px;
    border-top: 1px solid #F3F4F6;
    padding-top: 4px;
}

.sidebar-footer-actions .btn-text {
    flex: 1;
    width: auto;
    margin-top: 0;
    font-size: 11px;
    padding: 7px 4px;
}

.sidebar-footer-actions .btn-text:not(:last-child) {
    border-right: 1px solid #F3F4F6;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 14px;
    color: #374151;
}

.progress-info strong {
    color: #10B981;
    font-size: 16px;
}

#time-display {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #059669;
}

/* ==================== 侧边栏调节边 ==================== */

.sidebar-edge {
    width: 8px;
    flex-shrink: 0;
    background: white;
    cursor: col-resize;
    position: relative;
    z-index: 101;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
}

.sidebar-edge::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    transform: translateX(-50%);
    background: #E5E7EB;
    transition: width 0.15s ease, background 0.15s ease;
    pointer-events: none;
    border-radius: 2px;
}

.sidebar-edge:hover::before,
.sidebar-edge.resizing::before {
    width: 3px;
    background: #10B981;
}

.sidebar-collapse-btn {
    width: 18px;
    height: 44px;
    background: white;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.10);
    color: #9CA3AF;
    padding: 0;
    position: relative;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
    pointer-events: auto;
}

.sidebar-collapse-btn:hover {
    background: #F0FDF4;
    color: #10B981;
    border-color: #10B981;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.sidebar-collapse-btn svg {
    transition: transform 0.25s ease;
    pointer-events: none;
    flex-shrink: 0;
}

.sidebar-edge.sidebar-edge-collapsed .sidebar-collapse-btn svg {
    transform: rotate(180deg);
}

/* 桌面端：侧边栏折叠宽度动画，去掉向右的阴影（由 sidebar-edge 分隔线替代） */
@media (min-width: 769px) {
    .sidebar {
        transition: width 0.25s ease;
        overflow: hidden;
        box-shadow: none;
    }

    .sidebar.sidebar-collapsed {
        width: 0 !important;
        min-width: 0 !important;
    }
}

/* ==================== 通用组件样式 ==================== */

/* 按钮 */
.btn {
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-block;
    text-align: center;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-submit {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    width: 100%;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-submit:hover:not(:disabled) {
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
    filter: brightness(1.05);
}

.btn-secondary {
    background: white;
    border: 1px solid #D1D5DB;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #F9FAFB;
    border-color: #059669;
    color: #059669;
}

.btn-text {
    background: transparent;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    color: #6B7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    width: 100%;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-text:hover {
    background: #FEF2F2;
    color: #DC2626;
}

.btn-text svg {
    flex-shrink: 0;
}

.btn-primary {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    filter: brightness(1.05);
}

.btn-back {
    background: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #059669;
    cursor: pointer;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-back:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #10B981;
}

/* 输入框 */
input[type="text"],
input[type="password"],
input[type="number"],
select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: #10B981;
}

/* 复选框 */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* 标签 */
.config-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 25px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
}

/* ==================== 模态框样式 ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.modal-large {
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.modal-large .modal-body {
    flex: 1;
    overflow-y: auto;
}

.modal-header {
    background: linear-gradient(135deg, #10B981 0%, #06B6D4 100%);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

/* Tab 标签页样式 */
.settings-tabs {
    display: flex;
    background: #F3F4F6;
    border-bottom: 2px solid #E5E7EB;
}

.settings-tab {
    flex: 1;
    padding: 15px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #6B7280;
    transition: all 0.2s ease;
    position: relative;
}

.settings-tab:hover {
    background: rgba(16, 185, 129, 0.05);
    color: #10B981;
}

.settings-tab.active {
    background: white;
    color: #10B981;
    border-bottom-color: #10B981;
}

.settings-tab .tab-icon {
    font-size: 18px;
}

.settings-tab .tab-label {
    font-weight: 600;
}

/* Tab 内容区域 */
.settings-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.settings-tab-content.active {
    display: block;
}

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

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 25px;
    max-height: 70vh;
    overflow-y: auto;
}

.setting-item {
    margin-bottom: 20px;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-item label {
    display: block;
    font-weight: 600;
    color: #111827;
    margin-bottom: 5px;
    font-size: 14px;
}

.input-hint {
    font-size: 12px;
    color: #6B7280;
    margin-bottom: 8px;
}

.setting-item input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
}

.setting-item input:focus {
    outline: none;
    border-color: #10B981;
}

/* 配置列表样式 */
.config-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.config-list-hint {
    font-size: 13px;
    color: #6B7280;
    flex: 1;
}

.config-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.config-item {
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    padding: 15px;
    background: #F9FAFB;
    transition: all 0.2s;
}

.config-item.active {
    border-color: #10B981;
    background: #ECFDF5;
}

.config-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.config-radio {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.config-name-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
}

.config-name-input:focus {
    outline: none;
    border-color: #10B981;
}

.config-delete-btn {
    padding: 6px 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.config-delete-btn:hover {
    background: #FEE2E2;
}

.config-item-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-left: 28px;
}

.config-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.config-field label {
    font-size: 12px;
    font-weight: 600;
    color: #6B7280;
    display: flex;
    align-items: center;
    gap: 8px;
}

.field-hint {
    font-size: 11px;
    font-weight: 400;
    color: #9CA3AF;
    font-style: italic;
}

.config-field-input {
    padding: 8px 12px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-size: 13px;
}

.config-field-input:focus {
    outline: none;
    border-color: #10B981;
}

.config-field-textarea {
    padding: 10px 12px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    line-height: 1.6;
    resize: vertical;
    min-height: 100px;
}

.config-field-textarea:focus {
    outline: none;
    border-color: #10B981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* 全局提示词模板配置区域 */
.prompt-templates-section {
    padding: 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.section-header h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.section-description {
    margin: 0;
    font-size: 13px;
    color: #6B7280;
    font-weight: 400;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    min-width: auto;
}

.section-hint {
    font-size: 12px;
    color: #6B7280;
    margin-bottom: 20px;
    line-height: 1.6;
    background: #F9FAFB;
    padding: 10px 12px;
    border-radius: 6px;
    border-left: 3px solid #10B981;
}

.section-hint code {
    background: #E5E7EB;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 11px;
    color: #374151;
}

.template-field {
    margin-bottom: 20px;
}

.template-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.template-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    line-height: 1.6;
    resize: vertical;
    background: #FAFAFA;
    transition: all 0.2s ease;
}

.template-textarea:focus {
    outline: none;
    border-color: #10B981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    background: white;
}

.template-preview-hint {
    margin-top: 15px;
    padding: 12px 15px;
    background: #F0FDF4;
    border-left: 3px solid #10B981;
    border-radius: 6px;
    font-size: 13px;
    color: #065F46;
    line-height: 1.6;
}

.modal-footer {
    padding: 15px 25px;
    background: #F9FAFB;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.modal-footer .btn {
    padding: 12px 32px;
    font-size: 14px;
    min-width: 0;
    flex: 1 1 0;
}

/* ==================== 响应式布局 ==================== */
@media (max-width: 768px) {
    /* 侧边栏移动端适配 */
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        width: 85vw;
        max-width: 320px;
        transform: translateX(-100%);
        z-index: 1000;
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.15);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    /* 移动端隐藏侧边栏调节边 */
    .sidebar-edge {
        display: none !important;
    }

    /* 侧边栏头部优化 */
    .sidebar-header {
        padding: 20px 15px;
    }

    .sidebar-header h2 {
        font-size: 16px;
        margin-bottom: 6px;
    }

    .sidebar-header .exam-name {
        font-size: 12px;
        line-height: 1.3;
    }

    /* 显示汉堡菜单按钮（仅在答题界面和结果页面） */
    .mobile-menu-btn {
        display: none;
    }

    /* 题目导航网格 */
    .question-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
    }

    .question-item {
        min-height: 40px;
        font-size: 12px;
    }

    /* 答题界面适配 */
    .question-container {
        padding: 15px;
    }

    .question-card {
        padding: 15px;
        margin: 0;
    }

    .question-header {
        margin-bottom: 15px;
        padding-bottom: 12px;
    }

    .question-number {
        min-width: 35px;
        height: 35px;
        font-size: 14px;
        margin-right: 10px;
        border-radius: 8px;
    }

    .question-type-badge,
    .question-score-badge {
        font-size: 11px;
        padding: 4px 10px;
    }

    .question-content {
        font-size: 14px;
        line-height: 1.7;
        margin-bottom: 15px;
    }

    /* 选项优化 - 增加触摸面积 */
    .option {
        min-height: 48px;
        padding: 12px 14px;
        margin: 10px 0;
        border-width: 2px;
    }

    .option input[type="radio"],
    .option input[type="checkbox"] {
        width: 18px;
        height: 18px;
        margin-right: 10px;
        flex-shrink: 0;
    }

    .option-text {
        font-size: 14px;
        line-height: 1.6;
    }

    .option.correct::before,
    .option.wrong::before {
        font-size: 16px;
    }

    /* 按钮优化 - 增加触摸面积 */
    .btn,
    .btn-nav,
    .btn-primary,
    .btn-secondary,
    .btn-submit {
        min-height: 48px;
        padding: 12px 20px;
        font-size: 14px;
    }

    .navigation-buttons {
        margin-top: 20px;
        padding-top: 15px;
        gap: 8px;
    }

    .btn-nav {
        flex: 1;
        min-width: 0;
    }

    .btn-show-answer {
        padding: 10px 16px;
        font-size: 13px;
    }

    /* 结果页面适配 */
    .result-container {
        margin: 20px;
        padding: 30px 20px;
    }

    #has-subjective {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }

    #has-subjective .stat-item:last-child {
        grid-column: 1 / -1;
    }

    #no-subjective {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    .stat-item {
        padding: 15px;
    }

    .stat-value {
        font-size: 24px;
    }

    .stat-label {
        font-size: 12px;
    }

    .result-icon {
        font-size: 56px;
        margin-bottom: 15px;
    }

    .result-title {
        font-size: 20px;
        margin-bottom: 10px;
    }

    .result-score {
        font-size: 48px;
        margin: 15px 0;
    }

    .result-total {
        font-size: 16px;
        margin-bottom: 25px;
    }

    .result-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .result-buttons .btn {
        width: 100%;
    }

    /* 模式选择页面 */
    .mode-selection {
        padding: 20px;
    }

    .mode-header h1 {
        font-size: 28px;
    }

    .mode-subtitle {
        font-size: 16px;
    }

    .mode-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .mode-card {
        padding: 30px 25px;
    }

    /* 上传页面 */
    .upload-container {
        padding: 20px;
    }

    .upload-box {
        padding: 40px 30px;
    }

    /* 试卷列表 */
    .exam-list-container {
        padding: 15px;
    }

    .exam-list-header {
        padding: 20px 15px;
        margin-bottom: 15px;
    }

    .exam-list-header h2 {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .exam-list-info {
        font-size: 12px;
        padding: 5px 12px;
    }

    .exam-list-filters {
        padding: 15px;
        margin-bottom: 15px;
    }

    .exam-list-filters select {
        font-size: 13px;
        padding: 11px 12px;
    }

    .exam-list-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .exam-card {
        padding: 18px 15px;
    }

    .exam-card-title {
        font-size: 15px;
        line-height: 1.5;
        margin-bottom: 10px;
    }

    .exam-card-date {
        font-size: 11px;
        padding: 5px 10px;
    }

    .exam-card-info {
        font-size: 12px;
        gap: 12px;
        padding-top: 12px;
    }

    .exam-card-info span {
        font-size: 11px;
    }

    /* 配置页面 */
    .practice-config-container,
    .custom-exam-container {
        padding: 15px;
    }

    .practice-config-header,
    .custom-exam-header {
        padding: 20px 15px;
        margin-bottom: 15px;
    }

    .practice-config-header h2,
    .custom-exam-header h2 {
        font-size: 20px;
    }

    .practice-info,
    .custom-info {
        font-size: 13px;
    }

    .practice-config-options,
    .custom-exam-config {
        padding: 20px 15px;
        margin-bottom: 15px;
    }

    .config-section {
        margin-bottom: 20px;
        padding-bottom: 20px;
    }

    .config-section h3 {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .custom-exam-config {
        gap: 15px;
    }

    .exam-checkbox-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .exam-checkbox-item {
        font-size: 12px;
        padding: 10px;
    }

    .question-type-grid {
        gap: 8px;
    }

    .type-count-item {
        padding: 8px;
        width: 100%;
    }

    .type-count-label {
        flex: 1;
        font-size: 12px;
    }

    .type-count-input {
        width: 60px;
    }

    .type-count-hint {
        font-size: 12px;
        padding: 10px;
        margin-bottom: 12px;
    }

    /* 返回按钮 */
    .btn-back {
        margin-bottom: 15px;
        padding: 11px 20px;
        font-size: 13px;
        border-width: 1.5px;
    }

    /* 文本区域 */
    .textarea-answer {
        min-height: 100px;
        font-size: 14px;
        padding: 12px;
    }

    /* 答案区域 */
    .answer-section {
        margin-top: 20px;
        padding: 15px;
    }

    .answer-label {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .answer-content {
        font-size: 13px;
        line-height: 1.6;
    }

    /* AI评分详情 */
    .ai-grading-section {
        margin-top: 20px;
        padding: 15px;
    }

    .ai-grading-label {
        font-size: 14px;
    }

    .ai-grading-score {
        font-size: 20px;
    }

    .ai-grading-item-label {
        font-size: 13px;
    }

    .ai-grading-item-content {
        font-size: 13px;
        padding: 10px;
    }

    /* 设置对话框 */
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 10px;
    }

    .modal-header {
        padding: 15px 18px;
    }

    .modal-header h3 {
        font-size: 16px;
    }

    .modal-body {
        padding: 18px;
    }

    .setting-item {
        margin-bottom: 15px;
    }

    .setting-item label {
        font-size: 13px;
    }

    .input-hint {
        font-size: 11px;
        margin-bottom: 6px;
    }

    .modal-footer {
        padding: 12px 18px;
        flex-wrap: wrap;
    }
    
    .modal-footer .btn {
        padding: 10px 24px;
        min-width: 90px;
        font-size: 14px;
    }

    /* 侧边栏底部优化 */
    .sidebar-footer {
        padding: 15px;
    }

    .progress-info {
        font-size: 13px;
        margin-bottom: 12px;
    }

    .progress-info strong {
        font-size: 15px;
    }

    #time-display {
        font-size: 13px;
    }

    /* 题目导航优化 */
    .question-nav {
        padding: 15px 12px;
    }

    .type-header {
        font-size: 13px;
        padding: 6px 10px;
        margin-bottom: 10px;
    }

    .type-count {
        font-size: 11px;
    }

    /* 移动端遮罩层调整 */
    .mobile-overlay.show {
        backdrop-filter: blur(2px);
    }

    /* 选项before伪元素优化 */
    .option.correct::before,
    .option.wrong::before {
        font-size: 14px;
        margin-right: 6px;
    }

    /* 确保触摸滚动流畅 */
    #exam-interface,
    .question-nav,
    .main-content {
        -webkit-overflow-scrolling: touch;
    }

    /* 防止双击缩放 */
    button,
    .option,
    .mode-card,
    .exam-card {
        touch-action: manipulation;
    }

    /* 极小屏幕额外优化 */
    @media (max-width: 360px) {
        .sidebar {
            width: 90vw;
        }

        .question-grid {
            grid-template-columns: repeat(4, 1fr);
        }

        .question-item {
            font-size: 11px;
        }

        .mode-header h1 {
            font-size: 22px;
        }

        .mode-card {
            padding: 20px 15px;
        }

        .mode-icon {
            font-size: 40px;
        }

        .mode-title {
            font-size: 16px;
        }
    }
}

/* ==================== 答题设置样式 ==================== */

.exam-settings-section {
    padding: 0;
}

.setting-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #111827;
}

.setting-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #10B981;
}

.checkbox-text {
    font-weight: 500;
}

.setting-hint {
    font-size: 12px;
    color: #6B7280;
    margin-top: 8px;
    padding-left: 28px;
    line-height: 1.5;
}
