/* ==================== 全局样式 ==================== */
:root {
    --primary: #2563eb;
    --primary-light: #dbeafe;
    --primary-dark: #1e40af;
    --success: #16a34a;
    --success-light: #dcfce7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
    --card: #ffffff;
    --border: #e5e7eb;
    --text-muted: #6b7280;
}

.text-muted { color: var(--text-muted); }

.badge-info {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.q-content {
    line-height: 1.5;
    word-break: break-word;
}
.q-content img { max-width: 100%; }

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==================== 导航栏 ==================== */
.navbar {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    text-decoration: none;
}

.logo-icon {
    font-size: 24px;
}

.nav-links {
    display: flex;
    flex-wrap: nowrap;
    gap: 1px;
    min-width: 0;
    flex: 1 1 auto;
    justify-content: center;
    overflow-x: auto;
    scrollbar-width: none;        /* Firefox 隐藏滚动条 */
}
.nav-links::-webkit-scrollbar { display: none; }   /* WebKit 隐藏滚动条 */

.nav-link {
    padding: 7px 9px;
    color: var(--gray-600);
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 13px;
    white-space: nowrap;
    transition: all 0.2s;
}

.nav-link:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

/* ==================== 主内容区 ==================== */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 32px 24px;
}

/* ==================== 页面标题 ==================== */
.page-header {
    margin-bottom: 28px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
}

.subtitle {
    color: var(--gray-500);
    font-size: 14px;
    margin-top: 4px;
}

/* ==================== 首页仪表板 ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 36px;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-label {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 2px;
}

/* 快捷操作 */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.action-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.action-icon {
    font-size: 32px;
}

.action-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
}

.action-desc {
    font-size: 13px;
    color: var(--gray-500);
}

/* 图表区域 */
.chart-section {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.chart-section h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--gray-800);
}

/* 条形图 */
.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bar-label {
    width: 80px;
    font-size: 14px;
    color: var(--gray-700);
    text-align: right;
}

.bar-track {
    flex: 1;
    height: 24px;
    background: var(--gray-100);
    border-radius: 12px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #60a5fa);
    border-radius: 12px;
    transition: width 0.5s ease;
    min-width: 4px;
}

.bar-count {
    width: 40px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
}

/* 知识点标签 */
.kp-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.kp-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--gray-100);
    border-radius: 20px;
    font-size: 13px;
    color: var(--gray-700);
    text-decoration: none;
    transition: all 0.2s;
}

.kp-tag:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.kp-count {
    background: var(--primary);
    color: white;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

/* ==================== 筛选栏 ==================== */
.filter-bar {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group label {
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 500;
}

.filter-group select,
.search-input,
.export-title-input {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    background: white;
    color: var(--gray-800);
    outline: none;
    transition: border-color 0.2s;
}

.filter-group select:focus,
.search-input:focus,
.export-title-input:focus {
    border-color: var(--primary);
}

.filter-search {
    flex: 1;
    min-width: 200px;
}

.search-input {
    width: 100%;
}

/* ==================== 题型芯片选择器 ==================== */
.type-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.type-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.type-chip {
    padding: 7px 14px;
    border: 1px solid var(--gray-300);
    background: #fff;
    color: var(--gray-700);
    border-radius: var(--radius);
    font-size: 14px;
    line-height: 1.2;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.type-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.type-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.type-all {
    font-weight: 600;
}

/* ==================== 按钮 ==================== */
.btn {
    padding: 8px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-export {
    background: var(--success);
    color: white;
}

.btn-export:hover {
    background: #15803d;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-warning {
    background: #d97706;
    color: white;
}

.btn-warning:hover {
    background: #b45309;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 13px;
}

.btn-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.btn-link:hover {
    text-decoration: underline;
}

/* ==================== 导出操作栏 ==================== */
.export-bar {
    background: white;
    border-radius: var(--radius);
    padding: 12px 20px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.export-left,
.export-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--gray-700);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.export-title-input {
    width: 180px;
}

/* ==================== 题目卡片 ==================== */
.question-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.question-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.question-card:hover {
    box-shadow: var(--shadow-lg);
}

.question-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--gray-100);
}

.question-meta {
    display: flex;
    gap: 8px;
    flex: 1;
    flex-wrap: wrap;
}

.question-content {
    padding: 16px 20px;
    cursor: pointer;
}

.question-content p {
    color: var(--gray-700);
    font-size: 14px;
    line-height: 1.7;
}

.question-options-preview {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.opt-preview {
    font-size: 13px;
    color: var(--gray-500);
}

.expand-hint {
    margin-top: 8px;
    font-size: 12px;
    color: var(--gray-400);
    text-align: right;
}

.question-detail-panel {
    background: #f8fafc;
    border-top: 1px dashed #e2e8f0;
    padding: 14px 20px;
    font-size: 14px;
}

.question-detail-panel .qd-section {
    margin-bottom: 12px;
}

.question-detail-panel .qd-section:last-child {
    margin-bottom: 0;
}

.question-detail-panel .qd-label {
    display: inline-block;
    font-weight: 600;
    color: #4338ca;
    background: #eef2ff;
    padding: 2px 10px;
    border-radius: 6px;
    margin-bottom: 6px;
}

.question-detail-panel .qd-body {
    color: var(--gray-700);
    line-height: 1.7;
    word-break: break-word;
}

.question-detail-panel .qd-empty {
    color: var(--gray-400);
    font-size: 13px;
    text-align: center;
    padding: 10px 0;
}

/* ==================== 徽章 ==================== */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-type {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-kp {
    background: var(--gray-100);
    color: var(--gray-600);
}

.badge-diff {
    background: var(--gray-100);
    color: var(--gray-600);
}

.badge-diff-简单 {
    background: var(--success-light);
    color: var(--success);
}

.badge-diff-中等 {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-diff-较难,
.badge-diff-困难 {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-source {
    background: var(--gray-100);
    color: var(--gray-400);
    font-size: 11px;
}

/* ==================== 分页 ==================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 32px;
}

.page-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    color: var(--gray-700);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.page-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.page-info {
    color: var(--gray-500);
    font-size: 14px;
}

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state h2 {
    font-size: 20px;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--gray-500);
    font-size: 14px;
}

.empty-state a {
    color: var(--primary);
}

/* ==================== 上传页 ==================== */
.info-banner {
    background: var(--primary-light);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
    display: flex;
    gap: 16px;
}

.info-icon {
    font-size: 28px;
}

.info-content p {
    font-size: 14px;
    color: var(--gray-700);
    margin-bottom: 4px;
}

.info-content code {
    background: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--primary);
    margin: 0 2px;
}

.link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.link:hover {
    text-decoration: underline;
}

.upload-zone {
    background: white;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-icon {
    font-size: 56px;
    margin-bottom: 16px;
}

.upload-text {
    font-size: 16px;
    color: var(--gray-700);
    font-weight: 500;
    margin-bottom: 4px;
}

.upload-hint {
    font-size: 13px;
    color: var(--gray-400);
}

.upload-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 32px;
    color: var(--gray-500);
}

.status-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.upload-result {
    margin-top: 24px;
}

.result-success,
.result-error {
    background: white;
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    box-shadow: var(--shadow);
}

.result-success {
    border-left: 4px solid var(--success);
}

.result-error {
    border-left: 4px solid var(--danger);
}

.result-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.result-success h3 {
    color: var(--success);
    font-size: 20px;
    margin-bottom: 8px;
}

.result-error h3 {
    color: var(--danger);
    font-size: 20px;
    margin-bottom: 8px;
}

.result-actions {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    justify-content: center;
}

.preview-section {
    margin-top: 24px;
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.preview-section h4 {
    font-size: 15px;
    color: var(--gray-700);
    margin-bottom: 12px;
}

.preview-item {
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 8px;
}

.preview-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.preview-content {
    font-size: 13px;
    color: var(--gray-600);
}

/* ==================== 题目详情页 ==================== */
.detail-page {
    max-width: 800px;
    margin: 0 auto;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.back-link {
    color: var(--gray-500);
    text-decoration: none;
    font-size: 14px;
}

.back-link:hover {
    color: var(--primary);
}

.detail-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.detail-content {
    background: white;
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
}

.content-section {
    margin-bottom: 24px;
}

.content-section h3 {
    font-size: 15px;
    color: var(--gray-500);
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.content-text {
    font-size: 15px;
    line-height: 1.8;
    color: var(--gray-800);
    white-space: pre-wrap;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-item {
    display: flex;
    gap: 12px;
    padding: 8px 12px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.option-label {
    font-weight: 600;
    color: var(--primary);
    min-width: 20px;
}

.option-text {
    color: var(--gray-700);
}

.answer-section .answer-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--success);
    padding: 8px 16px;
    background: var(--success-light);
    border-radius: var(--radius);
    display: inline-block;
}

.explanation-section .explanation-text {
    font-size: 14px;
    color: var(--gray-600);
    line-height: 1.7;
    white-space: pre-wrap;
    padding: 12px 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.detail-footer {
    margin-top: 16px;
    text-align: right;
}

.created-time {
    font-size: 12px;
    color: var(--gray-400);
}

/* ==================== 错误页 ==================== */
.error-page {
    text-align: center;
    padding: 80px 20px;
}

.error-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.error-page h2 {
    font-size: 20px;
    color: var(--gray-700);
    margin-bottom: 16px;
}

/* ==================== 页脚 ==================== */
.footer {
    text-align: center;
    padding: 24px;
    color: var(--gray-400);
    font-size: 13px;
    border-top: 1px solid var(--gray-200);
    margin-top: auto;
}

/* ==================== 响应式 ==================== */
/* 平板 */
@media (max-width: 1100px) {
    .nav-link {
        padding: 6px 7px;
        font-size: 12.5px;
    }

    .nav-container {
        padding: 0 12px;
    }
}

/* 手机 */
@media (max-width: 768px) {
    .main-content {
        padding: 16px 12px;
    }

    .page-header h1 {
        font-size: 24px;
    }

    .page-header h2 {
        font-size: 20px;
    }

    .page-header { margin-bottom: 18px; }
    .subtitle { font-size: 12px; }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 18px;
    }
    .stat-card { padding: 14px; gap: 10px; }
    .stat-icon { font-size: 28px; }
    .stat-number { font-size: 24px; }
    .stat-label { font-size: 12px; }

    .quick-actions {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        margin-bottom: 18px;
    }
    .action-card { padding: 12px 8px; gap: 4px; }
    .action-icon { font-size: 24px; }
    .action-text { font-size: 13px; }
    .action-desc { display: none; }

    .chart-section { padding: 16px; margin-bottom: 16px; }
    .chart-section h2 { font-size: 16px; margin-bottom: 12px; }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form {
        flex-direction: column;
    }

    .search-input {
        min-width: 0;
        width: 100%;
    }

    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        width: 100%;
    }

    .filter-search {
        min-width: 0;
    }

    /* 手机端：下拉框/输入框占满整行，避免长选项溢出被裁切（知识点等） */
    .filter-group select,
    .filter-group input {
        width: 100%;
        max-width: 100%;
    }

    /* 题型选择器：手机端「全部」独占一行，6 个题型分两排各 3 个 */
    .type-filter {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .type-all {
        width: 100%;
        text-align: center;
    }

    .type-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    .type-chip {
        width: 100%;
        text-align: center;
    }

    .export-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .export-left,
    .export-right {
        width: 100%;
    }

    .export-title-input {
        width: 100%;
    }

    /* 所有表格：内部横向滚动，中和内联 min-width，避免整页溢出变形 */
    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        min-width: 0 !important;
    }

    .content-cell {
        max-width: 140px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .detail-content {
        padding: 16px;
    }

    .detail-page {
        padding: 0;
    }

    .detail-header {
        flex-wrap: wrap;
        gap: 10px;
    }

    .detail-header .detail-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }

    .detail-header .detail-actions .btn {
        flex: 1 1 auto;
        justify-content: center;
        text-align: center;
    }

    .exam-meta-bar {
        flex-direction: column;
        gap: 4px;
    }

    .nav-links {
        gap: 0;
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }

    .nav-link {
        padding: 6px 8px;
        font-size: 12px;
        white-space: nowrap;
    }

    .nav-logo span:not(.logo-icon) {
        display: none;
    }

    .nav-user {
        gap: 4px;
    }

    .user-info {
        font-size: 12px;
    }

    .pagination {
        flex-wrap: wrap;
    }

    .modal {
        width: 95%;
    }

    /* 图片自适应，避免超出屏幕 */
    .detail-content img,
    .q-content img,
    .content-text img,
    .question-image-item img {
        max-width: 100%;
        height: auto;
    }

    .stat-card {
        padding: 16px;
    }

    .info-banner {
        flex-direction: column;
    }

    /* 在线做题提交按钮在手机上占满宽度，方便点按 */
    #submitBtn {
        width: 100%;
        justify-content: center;
    }
}

/* 小屏手机 */
@media (max-width: 480px) {
    .main-content {
        padding: 12px 8px;
    }

    .page-header h1 {
        font-size: 21px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .stat-card { padding: 10px; gap: 8px; }
    .stat-icon { font-size: 24px; }
    .stat-number { font-size: 20px; }
    .stat-label { font-size: 11px; }
    .quick-actions { gap: 6px; }
    .action-card { padding: 10px 6px; }
    .action-icon { font-size: 20px; }
    .action-text { font-size: 12px; }
    .chart-section { padding: 12px; margin-bottom: 12px; }
    .chart-section h2 { font-size: 15px; margin-bottom: 10px; }
    .bar-item { gap: 6px; }
    .bar-label { width: 52px; font-size: 11px; }
    .bar-track { height: 20px; }
    .kp-tag { padding: 4px 9px; font-size: 11px; }

    .nav-link {
        padding: 6px 7px;
        font-size: 12px;
    }

    .detail-content {
        padding: 12px;
    }

    .stat-number {
        font-size: 26px;
    }

    .stat-icon {
        font-size: 28px;
    }
}

/* ==================== 题目图片 ==================== */
.question-images {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.question-image-item {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.question-image-item:hover {
    box-shadow: var(--shadow-lg);
}

.question-image-item img {
    display: block;
    max-width: 200px;
    max-height: 200px;
    object-fit: contain;
}

.badge-image {
    background: #fef3c7;
    color: #92400e;
    font-size: 11px;
}

/* 图片管理区域 */
.image-manage-section {
    margin-top: 24px;
    padding: 20px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.image-upload-zone {
    background: white;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.image-upload-zone:hover,
.image-upload-zone.drag-over {
    border-color: var(--primary);
    background: var(--primary-light);
}

.image-upload-zone .upload-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.image-upload-zone p {
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: 4px;
}

.image-upload-zone .upload-hint {
    font-size: 12px;
    color: var(--gray-400);
}

/* 全屏图片查看 */
.image-fullscreen-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.image-fullscreen-overlay img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
}

/* ==================== 登录页（分屏式） ==================== */
.auth-wrap {
    width: 100%;
    display: flex;
    min-height: calc(100vh - 150px);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 24px 60px -20px rgba(30,58,138,0.35);
    background: #fff;
}

/* ---- 左侧品牌墙 ---- */
.auth-brand {
    position: relative;
    flex: 0 0 44%;
    max-width: 560px;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #3b82f6 100%);
    color: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 56px 48px;
}
.brand-deco {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    opacity: 0.25;
    pointer-events: none;
}
.deco-1 {
    width: 320px; height: 320px;
    background: radial-gradient(circle, #93c5fd 0%, transparent 70%);
    top: -90px; right: -80px;
}
.deco-2 {
    width: 260px; height: 260px;
    background: radial-gradient(circle, #bfdbfe 0%, transparent 70%);
    bottom: -70px; left: -60px;
}
.brand-content { position: relative; z-index: 1; }
.brand-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.brand-logo .logo-icon { font-size: 40px; }
.brand-name { font-size: 22px; font-weight: 700; letter-spacing: 1px; }
.brand-title { font-size: 30px; font-weight: 800; line-height: 1.3; margin-bottom: 10px; }
.brand-sub { font-size: 14px; opacity: 0.85; margin-bottom: 36px; }
.brand-feats { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.brand-feats li { display: flex; align-items: center; gap: 14px; font-size: 15px; }
.feat-ico {
    flex: 0 0 40px; height: 40px; width: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.18); border-radius: 12px; font-size: 20px;
}
.brand-footer {
    position: absolute; bottom: 24px; left: 48px; right: 48px;
    font-size: 12px; opacity: 0.6; z-index: 1;
}

/* ---- 右侧登录区 ---- */
.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background:
        radial-gradient(circle at 100% 0%, #eff6ff 0%, transparent 45%),
        radial-gradient(circle at 0% 100%, #eef2ff 0%, transparent 45%),
        #f8fafc;
}
.auth-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 50px -12px rgba(30,58,138,0.22);
    padding: 40px 36px;
}
.auth-card-head { text-align: center; margin-bottom: 28px; }
.auth-card-head h2 { font-size: 24px; color: var(--gray-800); font-weight: 700; }
.auth-card-head p { font-size: 13px; color: var(--gray-500); margin-top: 6px; }

.login-form .form-group { margin-bottom: 18px; }
.login-form label {
    display: block; font-size: 13px; color: var(--gray-600);
    margin-bottom: 7px; font-weight: 500;
}
.input-wrap { position: relative; }
.input-wrap .input-ico {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    font-size: 15px; opacity: 0.7; pointer-events: none;
}
.login-form input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--gray-300);
    border-radius: 12px;
    font-size: 14px;
    background: #fbfcfe;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    box-sizing: border-box;
}
.login-form input[type="password"] {
    padding-right: 42px; /* 给右侧「显示密码」按钮留位 */
}
.login-form input::placeholder { color: #9ca3af; }
.login-form input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px var(--primary-light);
}
.pw-toggle {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    border: none; background: transparent; cursor: pointer;
    font-size: 16px; padding: 4px; line-height: 1; opacity: 0.7;
}
.pw-toggle:hover { opacity: 1; }

.btn-block { width: 100%; padding: 13px; font-size: 15px; }
.btn-login {
    margin-top: 6px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border: none;
    font-weight: 600;
    letter-spacing: 4px;
    box-shadow: 0 8px 20px -6px rgba(37,99,235,0.55);
    transition: transform 0.15s, box-shadow 0.2s;
}
.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px -6px rgba(37,99,235,0.65);
}
.btn-login:active { transform: translateY(0); }

.login-hint {
    margin-top: 26px;
    display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
}
.hint-item {
    font-size: 12px; color: var(--gray-600);
    background: var(--gray-50);
    border: 1px solid var(--gray-300);
    border-radius: 999px;
    padding: 5px 12px;
}
.login-hint code {
    background: #fff; color: var(--primary);
    padding: 1px 6px; border-radius: 5px; font-size: 12px;
    border: 1px solid var(--primary-light);
}

/* ---- 移动端：堆叠为单列 ---- */
@media (max-width: 860px) {
    .auth-wrap {
        flex-direction: column;
        width: 100%;
        margin-left: 0;
        min-height: auto;
    }
    .auth-brand {
        flex: none;
        max-width: none;
        padding: 22px 24px 16px;
    }
    .brand-logo { margin-bottom: 8px; }
    .brand-logo .logo-icon { font-size: 30px; }
    .brand-name { font-size: 16px; }
    .brand-title { font-size: 18px; margin-bottom: 4px; }
    .brand-sub { font-size: 12px; margin-bottom: 10px; }
    .brand-feats { display: none; }
    .brand-footer { display: none; }
    .auth-main { padding: 20px 16px 26px; }
    .auth-card { padding: 22px 20px; box-shadow: 0 10px 30px -12px rgba(30,58,138,0.25); }
    .auth-card-head { margin-bottom: 16px; }
    .auth-card-head h2 { font-size: 20px; }
    .auth-card-head p { font-size: 12px; }
    .login-form .form-group { margin-bottom: 14px; }
    .login-form label { margin-bottom: 5px; }
    .login-hint { margin-top: 16px; gap: 6px; }
    .hint-item { font-size: 11px; padding: 4px 10px; }
}

/* ==================== 导航栏用户区 ==================== */
.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.user-info {
    font-size: 13px;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    gap: 6px;
}

.role-badge {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 600;
}

.role-admin {
    background: #fee2e2;
    color: #991b1b;
}

.role-teacher {
    background: #dbeafe;
    color: #1e40af;
}

.role-student {
    background: #d1fae5;
    color: #065f46;
}

.role-external {
    background: #fef3c7;
    color: #b45309;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-login {
    background: var(--primary);
    color: white !important;
    padding: 6px 16px;
    border-radius: var(--radius);
}

/* ==================== 通用组件 ==================== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 12px;
    font-size: 14px;
}

.alert-error {
    background: var(--danger-light);
    color: var(--danger);
}

.alert-success {
    background: var(--success-light);
    color: var(--success);
}

.alert-info {
    background: var(--primary-light);
    color: var(--primary);
}

.alert-warn {
    background: #fff7e6;
    color: #b76e00;
    border: 1px solid #ffd591;
}

.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 16px;
    color: var(--gray-800);
}

.card-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px 20px;
}

.form-tip {
    font-size: 12px;
    color: var(--gray-500);
    margin: 6px 0 0;
}

.onboarding-form {
    max-width: 760px;
    margin: 0 auto;
}

.photo-block {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.id-photo {
    width: 110px;
    height: 140px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.id-photo.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    font-size: 13px;
}

.row-actions {
    display: flex;
    gap: 8px;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    .photo-block {
        flex-direction: column;
    }
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--gray-700);
}

.checkbox-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--gray-600);
}

/* ==================== 数据表格 ==================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    text-align: left;
    padding: 10px 12px;
    background: var(--gray-50);
    color: var(--gray-500);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--gray-200);
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

.data-table tr:hover td {
    background: var(--gray-50);
}

.content-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==================== 弹窗 ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    justify-content: center;
    align-items: center;
}

.modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-lg {
    max-width: 700px;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 16px;
    color: var(--gray-800);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--gray-400);
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.modal-hint {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 8px;
}

.code-example {
    background: var(--gray-50);
    padding: 12px;
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 12px;
}

.batch-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: monospace;
    resize: vertical;
    box-sizing: border-box;
}

/* ==================== 管理员标签页 ==================== */
.admin-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--gray-200);
}

.admin-tabs .tab {
    padding: 8px 20px;
    font-size: 14px;
    color: var(--gray-500);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.admin-tabs .tab:hover {
    color: var(--primary);
}

.admin-tabs .tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

/* ==================== 套卷中心 ==================== */
.papers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.paper-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.paper-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
}

.paper-card-header h3 {
    font-size: 16px;
    color: var(--gray-800);
    margin-top: 8px;
}

.paper-type-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary);
}

.paper-type-高考真题 {
    background: #fee2e2;
    color: #991b1b;
}

.paper-type-模拟试题 {
    background: #fef3c7;
    color: #92400e;
}

.paper-type-日常训练 {
    background: #dcfce7;
    color: #166534;
}

.paper-card-body {
    padding: 16px 20px;
    flex: 1;
}

.paper-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 8px;
}

.paper-desc {
    font-size: 13px;
    color: var(--gray-600);
    line-height: 1.5;
}

.paper-date {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 8px;
}

.paper-card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    gap: 8px;
}

.paper-info-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}

.paper-meta-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.answer-preview,
.explanation-preview {
    padding: 8px 12px;
    margin-top: 8px;
    font-size: 13px;
    border-radius: var(--radius);
}

.answer-preview {
    background: var(--success-light);
    color: var(--success);
}

.explanation-preview {
    background: var(--gray-50);
    color: var(--gray-600);
}

/* ==================== 上传页扩展 ==================== */
.file-confirm {
    display: flex;
    align-items: center;
    gap: 16px;
    background: white;
    border-radius: var(--radius);
    padding: 20px 24px;
    margin: 16px 0;
    box-shadow: var(--shadow);
    border: 2px solid var(--primary-light);
}

.file-confirm-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.file-icon {
    font-size: 32px;
}

.file-detail {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.file-name {
    font-size: 15px;
    color: var(--gray-800);
    font-weight: 600;
}

.file-size {
    font-size: 13px;
    color: var(--gray-400);
}

.paper-options {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    margin: 20px 0;
    box-shadow: var(--shadow);
}

.upload-zone-small {
    background: var(--gray-50);
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-zone-small:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.info-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.info-card h4 {
    font-size: 15px;
    color: var(--gray-800);
    margin-bottom: 12px;
}

/* ==================== 视频区域 ==================== */
.video-section video {
    display: block;
    margin-top: 12px;
}

/* ==================== 阅卷系统 ==================== */
.grading-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.action-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    text-decoration: none;
    color: inherit;
    text-align: center;
    transition: transform 0.2s;
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.action-icon {
    font-size: 36px;
    display: block;
    margin-bottom: 8px;
}

.action-card h3 {
    font-size: 16px;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.action-card p {
    font-size: 13px;
    color: var(--gray-500);
}

.exam-meta-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--gray-600);
}

.score-table input {
    width: 60px;
    padding: 4px 6px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 13px;
}

.score-input {
    text-align: center;
}

.badge-draft {
    background: var(--gray-100);
    color: var(--gray-500);
}

.badge-grading {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-done {
    background: var(--success-light);
    color: var(--success);
}

/* ==================== 成绩统计 ==================== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    text-align: center;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 4px;
}

.score-rate {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

.rate-good {
    background: var(--success-light);
    color: var(--success);
}

.rate-ok {
    background: var(--warning-light);
    color: var(--warning);
}

.rate-bad {
    background: var(--danger-light);
    color: var(--danger);
}

/* ==================== 分值配置 ==================== */
.score-config {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.score-config-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--gray-600);
}

.score-config-row input {
    width: 60px;
    padding: 4px 6px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
}

/* ==================== 徽章扩展 ==================== */
.badge-cat {
    background: #ede9fe;
    color: #5b21b6;
    font-size: 11px;
}

/* ==================== 页面头部 ==================== */
.page-header {
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 22px;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.page-header p {
    font-size: 14px;
    color: var(--gray-500);
}

/* ==================== 筛选栏 ==================== */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
}

.search-form {
    display: flex;
    gap: 8px;
}

.search-input {
    padding: 6px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    min-width: 200px;
}

/* ==================== 空提示 ==================== */
.empty-hint {
    color: var(--gray-400);
    font-size: 14px;
    padding: 16px;
    text-align: center;
}

/* ==================== 题号 ==================== */
.qnum {
    font-weight: 600;
    color: var(--primary);
    margin-right: 4px;
}

.question-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ==================== 阅卷系统样式 ==================== */

/* 阅卷进度条（小） */
.progress-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mini-progress {
    width: 80px;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.mini-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #6366f1);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.mini-progress-text {
    font-size: 12px;
    color: var(--gray-500);
    white-space: nowrap;
}

/* 考试详情页进度条 */
.grading-progress-mini {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar-mini {
    width: 150px;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill-mini {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.progress-text-mini {
    font-size: 13px;
    color: var(--gray-600);
    font-weight: 500;
}

/* 空状态图标 */
.empty-icon {
    font-size: 48px;
    margin-bottom: 8px;
    opacity: 0.6;
}

/* 阅卷模式切换标签 */
.mode-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    background: #f1f5f9;
    border-radius: var(--radius);
    padding: 3px;
}

.mode-tab {
    flex: 1;
    padding: 10px 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    border: none;
    background: transparent;
}

.mode-tab:hover {
    color: var(--gray-800);
}

.mode-tab.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-weight: 600;
}

/* 逐题批阅 - 学生选择器 */
.student-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.student-selector select {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    min-width: 200px;
    background: #fff;
}

.student-nav {
    display: flex;
    gap: 4px;
}

.student-nav button {
    width: 36px;
    height: 36px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: #fff;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.student-nav button:hover {
    background: #f0f9ff;
    border-color: var(--primary);
    color: var(--primary);
}

.student-nav button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* 阅卷进度条（大） */
.grading-progress {
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: var(--radius);
    border: 1px solid #e2e8f0;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e5e7eb;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #6366f1);
    border-radius: 5px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 13px;
    color: var(--gray-600);
}

/* 逐题批阅 - 题目卡片 */
.marking-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 12px;
}

.marking-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--gray-500);
}

.marking-card .question-content {
    font-size: 15px;
    line-height: 1.7;
    color: var(--gray-800);
    margin-bottom: 10px;
}

.marking-card .correct-answer {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #166534;
}

.marking-card .student-answer {
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #854d0e;
}

.marking-card .score-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.marking-card .score-input-row input {
    width: 70px;
    padding: 6px 10px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    text-align: center;
}

.marking-card .score-input-row input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}

.card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

/* 自动批阅 - 批量文本区 */
.auto-grade-textarea {
    width: 100%;
    min-height: 200px;
    padding: 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
}

.auto-grade-textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}

.auto-grade-hint {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 6px;
}

.btn-lg {
    padding: 10px 24px;
    font-size: 15px;
    border-radius: var(--radius);
}

/* ==================== 阅卷工作流步骤 ==================== */
.workflow-steps {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 24px;
    padding: 16px;
    background: #f8fafc;
    border-radius: var(--radius);
    border: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

.workflow-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #e2e8f0;
    min-width: fit-content;
    transition: all 0.2s;
}

.workflow-step.done {
    background: #f0fdf4;
    border-color: #86efac;
}

.workflow-step.active {
    background: #eff6ff;
    border-color: #93c5fd;
}

.workflow-step.active .step-num {
    background: var(--primary);
    color: #fff;
}

.step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.workflow-step.done .step-num {
    background: #22c55e;
    color: #fff;
}

.step-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.step-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-800);
}

.step-title a {
    color: var(--primary);
    text-decoration: none;
}

.step-title a:hover {
    text-decoration: underline;
}

.step-desc {
    font-size: 11px;
    color: var(--gray-500);
}

.step-check {
    color: #22c55e;
    font-weight: 700;
    font-size: 16px;
}

.workflow-arrow {
    color: #cbd5e1;
    font-size: 18px;
    flex-shrink: 0;
}

/* ==================== 快捷操作卡片 ==================== */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.quick-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    text-decoration: none;
    transition: all 0.2s;
}

.quick-action-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.qa-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.qa-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.qa-desc {
    font-size: 12px;
    color: var(--gray-500);
    text-align: center;
}

/* ==================== 阅卷进度卡片 ==================== */
.grading-progress-card {
    padding: 14px 20px;
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* ==================== 扫描件查看栏 ==================== */
.scan-viewer-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.scan-viewer-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    white-space: nowrap;
}

.scan-thumbs {
    display: flex;
    gap: 8px;
    flex: 1;
    overflow-x: auto;
    padding: 4px 0;
}

.scan-thumb-img {
    width: 60px;
    height: 80px;
    object-fit: cover;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.scan-thumb-img:hover {
    border-color: var(--primary);
}

.scan-upload-prompt {
    padding: 10px 16px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius);
    margin-bottom: 16px;
}

/* ==================== 答题卡分割页面 ==================== */
.answer-card-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.ac-region-table input {
    padding: 4px 6px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 13px;
}

.ac-region-table input:focus {
    border-color: var(--primary);
    outline: none;
}

.ac-scan-list {
    margin-top: 12px;
}

.ac-scan-list h4 {
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--gray-700);
}

.ac-scan-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 8px;
}

.ac-scan-thumb {
    width: 50px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid #e2e8f0;
}

.ac-scan-name {
    flex: 1;
    font-size: 12px;
    color: var(--gray-600);
    word-break: break-all;
}

.ac-summary {
    display: flex;
    gap: 20px;
    justify-content: space-around;
}

.ac-summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.ac-summary-num {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.ac-summary-label {
    font-size: 12px;
    color: var(--gray-500);
}

/* ==================== 题库预览图片缩略图 ==================== */
.question-thumb-row {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    align-items: center;
}

.question-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.15s;
}

.question-thumb:hover {
    transform: scale(1.08);
    border-color: var(--primary);
}

.more-imgs {
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 500;
}

/* ==================== 全屏图片/扫描件查看 ==================== */
.image-fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    cursor: pointer;
}

.image-fullscreen-overlay img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
}

/* ==================== 响应式补充 ==================== */
@media (max-width: 768px) {
    .nav-user .user-info {
        display: none;
    }

    .papers-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
    }

    .grading-actions {
        grid-template-columns: 1fr;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 6px 8px;
    }

    .admin-tabs {
        overflow-x: auto;
    }

    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .answer-card-layout {
        grid-template-columns: 1fr;
    }

    .workflow-steps {
        flex-direction: column;
        align-items: stretch;
    }

    .workflow-arrow {
        display: none;
    }

    .ac-summary {
        flex-direction: column;
        gap: 12px;
    }
}

/* 校外账号首页功能卡片 */
.feature-card {
    background: white;
    border-radius: var(--radius, 12px);
    padding: 18px 20px;
    box-shadow: var(--shadow, 0 2px 8px rgba(0,0,0,0.06));
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 14px 16px;
    border-left: 4px solid var(--primary, #3b82f6);
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,0.1));
}

.feature-icon {
    grid-column: 1;
    grid-row: 1 / 3;
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    background: #f0f7ff;
    flex-shrink: 0;
}

.feature-title {
    grid-column: 2;
    grid-row: 1;
    font-size: 17px;
    font-weight: 600;
    color: var(--gray-900, #1f2937);
}

.feature-desc {
    grid-column: 2;
    grid-row: 2;
    font-size: 13px;
    color: var(--gray-500, #6b7280);
    line-height: 1.5;
}

.feature-arrow {
    grid-column: 3;
    grid-row: 1 / 3;
    color: var(--gray-400, #9ca3af);
    font-size: 22px;
    line-height: 1;
}

.feature-card:hover .feature-arrow {
    color: var(--primary, #3b82f6);
}

/* 功能卡片按顺序着色 */
.card-grid .feature-card:nth-child(1) { border-left-color: #3b82f6; }
.card-grid .feature-card:nth-child(1) .feature-icon { background: #eff6ff; }
.card-grid .feature-card:nth-child(2) { border-left-color: #f97316; }
.card-grid .feature-card:nth-child(2) .feature-icon { background: #fff7ed; }
.card-grid .feature-card:nth-child(3) { border-left-color: #10b981; }
.card-grid .feature-card:nth-child(3) .feature-icon { background: #ecfdf5; }
.card-grid .feature-card:nth-child(4) { border-left-color: #8b5cf6; }
.card-grid .feature-card:nth-child(4) .feature-icon { background: #f5f3ff; }

@media (max-width: 480px) {
    .feature-card {
        padding: 16px;
        gap: 12px 14px;
    }
    .feature-icon {
        width: 44px;
        height: 44px;
        font-size: 22px;
        border-radius: 12px;
    }
    .feature-title {
        font-size: 15px;
    }
    .feature-desc {
        font-size: 12px;
    }
    .feature-arrow {
        font-size: 18px;
    }
}
