

/* ============================================
   学情数据分析系统 · 组件（飞书风）
   ============================================ */

/* ---------- Toast 通知 ---------- */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 380px;
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-overlay-md);
    border-left: 4px solid var(--c-primary);
    pointer-events: auto;
    animation: toast-in 0.3s ease-out;
    font-size: 14px;
    line-height: 1.5;
    color: var(--c-text-2);
}
.toast-icon { display: flex; flex-shrink: 0; line-height: 1.4; }
.toast.success .toast-icon { color: var(--c-success); }
.toast.error .toast-icon { color: var(--c-danger); }
.toast.warning .toast-icon { color: var(--c-warning); }
.toast.info .toast-icon { color: var(--c-primary); }
.toast-msg { flex: 1; min-width: 0; word-break: break-word; }
.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    color: var(--c-text-3);
    padding: 2px;
}
@media (hover: hover) {
    .toast-close:hover { color: var(--c-text); }
}
.toast.success { border-left-color: var(--c-success); }
.toast.error { border-left-color: var(--c-danger); }
.toast.warning { border-left-color: var(--c-warning); }
.toast.info { border-left-color: var(--c-primary); }
@keyframes toast-in {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}
.toast.removing { animation: toast-out 0.25s ease-in forwards; }
@keyframes toast-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}

/* ---------- KPI 统计卡行 ---------- */
.kpi-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}
.kpi-card {
    flex: 1;
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
}
.kpi-label { font-size: 13px; color: var(--c-text-3); margin-bottom: 4px; }
.kpi-value {
    font-size: 28px;
    font-weight: 700;
    font-family: "JetBrains Mono", "SF Mono", monospace;
    font-variant-numeric: tabular-nums;
}
.kpi-value.blue { color: var(--c-primary); }
.kpi-value.green { color: var(--c-success); }
.kpi-value.red { color: var(--c-danger); }
.kpi-value.orange { color: var(--c-warning); }
.kpi-value.purple { color: var(--c-purple); }
.kpi-desc { font-size: 13px; color: var(--c-text-3); margin-top: 2px; }
a.kpi-card { display: block; flex: 1; text-decoration: none; cursor: pointer; transition: box-shadow 0.2s, transform 0.2s; }
@media (hover: hover) {
    a.kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
}

/* ---------- 进度条 ---------- */
.progress-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.progress-row:last-child { margin-bottom: 0; }
.progress-label {
    min-width: 80px;
    font-size: 14px;
    color: var(--c-text-2);
    white-space: nowrap;
}
.progress-track {
    flex: 1;
    height: 8px;
    background: var(--c-border-2);
    border-radius: 4px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}
.progress-green { background: var(--c-success); }
.progress-yellow { background: var(--c-warning); }
.progress-red { background: var(--c-danger); }
.progress-blue { background: var(--c-primary); }
.progress-num {
    min-width: 44px;
    text-align: right;
    font-size: 14px;
    font-weight: 600;
    font-family: "JetBrains Mono", "SF Mono", monospace;
    font-variant-numeric: tabular-nums;
}

/* ---------- 预警条 ---------- */
.warning-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-left: 4px solid;
    margin-bottom: 6px;
    background: #fff;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    box-shadow: var(--shadow-sm);
}
.warning-item:last-child { margin-bottom: 0; }
.warning-red { border-color: var(--c-danger); }
.warning-yellow { border-color: var(--c-warning); }
.warning-green { border-color: var(--c-success); }
.warn-icon { display: flex; line-height: 1.4; }
.warn-content { flex: 1; min-width: 0; }
.warn-name { font-size: 14px; font-weight: 600; }
.warn-msg { font-size: 13px; color: var(--c-text-2); margin-top: 2px; }
.warn-sug { font-size: 12px; color: var(--c-text-3); margin-top: 2px; }
.warn-action {
    font-size: 12px;
    color: var(--c-primary);
    cursor: pointer;
    white-space: nowrap;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}
@media (hover: hover) {
    .warn-action:hover { background: var(--c-primary-bg); }
}

/* ---------- 状态标签 ---------- */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}
.badge-green { background: var(--c-success-bg); color: var(--c-success); }
.badge-red { background: var(--c-danger-bg); color: var(--c-danger); }
.badge-blue { background: var(--c-primary-bg); color: var(--c-primary); }
.badge-gray { background: var(--c-bg-2); color: var(--c-text-3); }

/* ---------- 学生总览卡 ---------- */
.overview-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--c-primary-bg);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 16px;
}
.overview-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--c-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}
.overview-info { flex: 1; }
.overview-name { font-size: 18px; font-weight: 700; }
.overview-meta { font-size: 13px; color: var(--c-text-3); margin-top: 2px; }

/* ---------- 诊断问题块 ---------- */
.issue-block {
    background: var(--c-danger-bg);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 8px;
}
.issue-block:last-child { margin-bottom: 0; }
.issue-title { font-size: 14px; font-weight: 600; color: var(--c-danger); }
.issue-detail { font-size: 13px; color: var(--c-text-2); margin: 4px 0; }
.issue-sug { font-size: 13px; color: var(--c-success); margin-top: 4px; }
.issue-sug::before { content: "💡 "; }

/* ---------- 等宽数字(全局) ---------- */
.num-mono {
    font-family: "JetBrains Mono", "SF Mono", monospace;
    font-variant-numeric: tabular-nums;
}

/* ---------- 诊断卡片(左侧提亮border) ---------- */
.card-diagnosis {
    border-left: 4px solid var(--c-primary);
}

/* ---------- 关注学生迷你卡片 ---------- */
.student-mini-card {
    background: var(--c-danger-bg);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 13px;
    flex: 1;
    min-width: 0;
}
.student-mini-card.warning { background: var(--c-warning-bg); }
.student-mini-card.green { background: var(--c-success-bg); }
.student-mini-card .name { font-weight: 600; }
.student-mini-card .desc { color: var(--c-text-2); margin-top: 2px; }

/* ============================================
   键盘焦点环（WCAG 2.4.7 - a11y 必填）
   ============================================ */
:focus-visible {
    outline: 3px solid var(--c-primary);
    outline-offset: 2px;
    border-radius: 4px;
}
button:focus-visible,
.btn:focus-visible,
a:focus-visible {
    outline-offset: 3px;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline-offset: 1px;
}
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
    outline: 2px solid var(--c-primary);
    outline-offset: 1px;
}
dialog:focus-visible,
[role="dialog"]:focus-visible {
    outline: none;
}

/* ============================================
   模态框（HTML5 <dialog> 元素）
   ============================================ */
dialog.app-modal {
    border: none;
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-overlay-md);
    color: var(--c-text);
}
dialog.app-modal::backdrop {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
}
.app-modal-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--c-text);
}
.app-modal-title svg { color: var(--c-warning); }
.app-modal-body {
    font-size: 14px;
    color: var(--c-text-2);
    margin-bottom: 20px;
    line-height: 1.6;
}
.app-modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ============================================
   响应式（移动端 < 768px）
   ============================================ */
@media (max-width: 768px) {
    .topbar {
        height: auto;
        padding: 8px 12px;
    }
    .topbar-inner {
        flex-wrap: wrap;
        gap: 8px;
    }
    .topbar-meta {
        order: 3;
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    .topbar-nav {
        order: 2;
        margin-left: auto;
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .topbar-nav::-webkit-scrollbar { display: none; }
    .nav-item {
        white-space: nowrap;
        flex: 0 0 auto;
    }
    .topbar-search {
        order: 4;
        width: 100%;
        margin-left: 0;
    }
    .topbar-search input { width: 100%; }

    .kpi-row {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .kpi-card { padding: 14px 12px; }
    .kpi-value { font-size: 22px; }
    .kpi-label { font-size: 11px; }
    .kpi-desc { font-size: 11px; line-height: 1.3; }

    .profile-stats {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px !important;
    }
    .profile-stats > * { text-align: center; }

    .overview-card { flex-wrap: wrap; }
    .overview-card .profile-stats { flex: 1 1 100%; order: 3; }
    .overview-card > div:last-child { order: 4; }

    .detail-grid,
    .exam-detail-grid,
    .essay-detail-grid,
    .home-grid {
        grid-template-columns: 1fr !important;
    }

    .data-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .data-table table { min-width: 600px; }

    .form-row { flex-direction: column; align-items: stretch; }
    .form-row .form-label { min-width: 0; }

    dialog.app-modal {
        max-width: calc(100vw - 24px);
        width: 100%;
    }
}

@media (max-width: 480px) {
    .kpi-row { grid-template-columns: 1fr; }
    .page-title { font-size: 20px; }
    .card-title { font-size: 15px; }
    .btn { padding: 8px 12px; }
}
/* ============================================
   M2 交互范式统一 · 补全组件类
   ============================================ */

/* 按钮补变体（设计 §5.4：danger/warning 两色） */
.btn-danger { background: var(--c-danger); color: #fff; }
.btn-warning { background: var(--c-warning); color: #fff; }
@media (hover: hover) {
    .btn-danger:hover { background: #991b1b; }
    .btn-warning:hover { background: #92400e; }
}

/* 失败进度条（任务处理组件：失败态 fill 变红，替代 100% 蓝条） */
.progress-fill--failed { background: var(--c-danger); }

/* ============================================
   M3/M4 页面收敛 + 手机适配（2026-08-03）
   ============================================ */

/* ---------- 底部导航（手机 5 tab；>768px 隐藏，active 态服务端渲染） ---------- */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #fff;
    border-top: 1px solid var(--c-border);
    z-index: 90;
    align-items: stretch;
    justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 10px;
    line-height: 1.2;
    color: var(--c-text-3);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px;
}
.bottom-nav-item .bottom-nav-icon { font-size: 20px; line-height: 1.2; display: flex; }
.bottom-nav-item .bottom-nav-icon svg { width: 20px; height: 20px; }
.bottom-nav-item.active { color: var(--c-primary); font-weight: 600; }

/* ---------- 学生导入预览表（避免 .data-table 手机 min-width 撑破弹层） ---------- */
.import-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.import-table th, .import-table td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--c-border-2);
    text-align: left;
    white-space: nowrap;
}
.import-table th {
    background: var(--c-bg-2);
    color: var(--c-text-2);
    font-weight: 500;
    position: sticky;
    top: 0;
}
.import-table .ok { color: var(--c-success); }
.import-table .dup { color: var(--c-warning); }
.import-table .dup-name { color: var(--c-danger); }

/* ---------- 手机适配 ≤768px ---------- */
@media (max-width: 768px) {
    /* 顶栏导航隐藏 → 底部导航接管 */
    .topbar-nav { display: none; }
    .bottom-nav { display: flex; }
    body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

    /* 步骤条：横向滚动（不强制 4 步平铺） */
    .stepbar {
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6px;
    }
    .stepbar .step { flex: 0 0 auto; scroll-snap-align: center; }

    /* 统计总览卡 4 列 → 2×2（数字 min-content 在 375px 单列宽不足，会撑破） */
    .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}

/* ---------- 手机适配 ≤480px ---------- */
@media (max-width: 480px) {
    /* 卡片/学生单列 */
    .students-grid { grid-template-columns: 1fr; }
    .exam-card-grid { grid-template-columns: 1fr !important; }
    /* 散页缩略图（auto-fill minmax(280px)）在 480px 下天然单列 */

    /* 上传区收紧（上传区与预览区上下排布已有） */
    .upload-area { padding: 32px 12px; }

    /* 步骤条只留序号点 */
    .step-label { display: none; }

    /* modal 底部弹出全屏 */
    dialog.app-modal {
        width: 100%;
        max-width: 100%;
        margin: auto auto 0;
        border-radius: 16px 16px 0 0;
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
}


/* ============================================
   M5 视觉重构（2026-08-03）
   设计 §5.4 组件补齐 + 内联样式迁移工具类
   ============================================ */

/* ---------- 布局工具类（内联迁移用，设计 §1.3） ---------- */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-end { display: flex; align-items: center; justify-content: flex-end; }
.flex-col { display: flex; flex-direction: column; }
.flex-1 { flex: 1; min-width: 0; }
.inline-flex { display: inline-flex; }
.wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.inline { display: inline; }
.inline-block { display: inline-block; }
.hide { display: none; }          /* 供 JS style.display 切换（无 !important） */
.cursor-pointer { cursor: pointer; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.divider-top { border-top: 1px solid var(--c-border-2); }
.divider-top-solid { border-top: 1px solid var(--c-border); }
.divider-top-dashed { border-top: 1px dashed var(--c-border); }

.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; }
.gap-12 { gap: 12px; } .gap-14 { gap: 14px; } .gap-16 { gap: 16px; }
.gap-20 { gap: 20px; } .gap-24 { gap: 24px; } .gap-32 { gap: 32px; }

.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 2px; } .mb-4 { margin-bottom: 4px; }
.mb-6 { margin-bottom: 6px; } .mb-8 { margin-bottom: 8px; } .mb-10 { margin-bottom: 10px; }
.mb-12 { margin-bottom: 12px; } .mb-14 { margin-bottom: 14px; } .mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; } .mb-24 { margin-bottom: 24px; } .mb-32 { margin-bottom: 32px; }
.mt-0 { margin-top: 0; } .mt-2 { margin-top: 2px; } .mt-4 { margin-top: 4px; }
.mt-6 { margin-top: 6px; } .mt-8 { margin-top: 8px; } .mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; } .mt-14 { margin-top: 14px; } .mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mt-40 { margin-top: 40px; }
.ml-2 { margin-left: 2px; } .ml-4 { margin-left: 4px; } .ml-6 { margin-left: 6px; }
.ml-8 { margin-left: 8px; } .ml-12 { margin-left: 12px; } .ml-16 { margin-left: 16px; }
.mr-4 { margin-right: 4px; } .mr-8 { margin-right: 8px; }
.ml-auto { margin-left: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

.pa-8 { padding: 8px; } .pa-12 { padding: 12px; } .pa-14 { padding: 14px; }
.pa-16 { padding: 16px; } .pa-20 { padding: 20px; } .pa-24 { padding: 24px; }
.pa-28 { padding: 28px; } .pa-40 { padding: 40px; }
.px-16 { padding-left: 16px; padding-right: 16px; } .px-20 { padding-left: 20px; padding-right: 20px; }
.py-12 { padding-top: 12px; padding-bottom: 12px; } .py-16 { padding-top: 16px; padding-bottom: 16px; }
.py-20 { padding-top: 20px; padding-bottom: 20px; }

/* 文字工具类（设计 §5.2 六档字号） */
.text-2 { color: var(--c-text-2); }
.text-3 { color: var(--c-text-3); }
.text-primary { color: var(--c-primary); }
.text-success { color: var(--c-success); }
.text-warning { color: var(--c-warning); }
.text-danger { color: var(--c-danger); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.fs-10 { font-size: 10px; } .fs-11 { font-size: 11px; } .fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; } .fs-14 { font-size: 14px; } .fs-15 { font-size: 15px; }
.fs-16 { font-size: 16px; } .fs-18 { font-size: 18px; } .fs-20 { font-size: 20px; }
.fs-24 { font-size: 24px; } .fs-28 { font-size: 28px; } .fs-32 { font-size: 32px; }
.fs-36 { font-size: 36px; } .fs-40 { font-size: 40px; } .fs-48 { font-size: 48px; }
.fs-56 { font-size: 56px; }
.fw-500 { font-weight: 500; } .fw-600 { font-weight: 600; } .fw-700 { font-weight: 700; }
.w-40 { width: 40px; } .w-50 { width: 50px; } .w-60 { width: 60px; } .w-80 { width: 80px; }

/* ---------- 导航下拉（base.html 顶栏 dropdown，JS 只读写 style.display） ---------- */
.nav-dropdown { position: relative; display: inline-block; }
.block { display: block; }
.nav-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    min-width: 200px;
    z-index: 100;
    padding: 6px 0;
}
/* 移动端：学期下拉改固定全宽面板，脱离 .topbar-meta 的 overflow-x 裁剪；
   top 由 base.html JS 在展开时按 chip 位置写入 */
@media (max-width: 768px) {
    .nav-dropdown-content {
        position: fixed;
        left: 12px;
        right: 12px;
        min-width: 0;
    }
}
.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--c-text);
    text-decoration: none;
    transition: background 0.15s;
    cursor: pointer;
}
.nav-dropdown-item:hover { background: var(--c-primary-bg); }
.nav-dropdown-item--btn { width: 100%; border: none; background: none; text-align: left; }
.nav-dropdown-sep { border-top: 1px solid var(--c-border-2); margin: 4px 0; }
.pa-8-12 { padding: 8px 12px; }
.nav-badge.warn { background: var(--c-warning); }
.text-info { color: var(--c-info); }
.radio-accent { accent-color: var(--c-primary); }
.pa-10-20 { padding: 10px 20px; }
.input-mono { font-family: ui-monospace, "SFMono-Regular", Consolas, Menlo, monospace; }
.w-auto { width: auto; }
.pt-12 { padding-top: 12px; } .pt-14 { padding-top: 14px; } .pt-16 { padding-top: 16px; }
.pb-12 { padding-bottom: 12px; } .pb-16 { padding-bottom: 16px; }
.pt-2 { padding-top: 2px; }
.is-dim { opacity: 0.6; }
.overflow-x-auto { overflow-x: auto; }
.pa-32 { padding: 32px; }

/* 报告页：图表双列 + 维度得分条 + 建议行 */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
/* 报告页图表网格移动端折叠（M-1：375px 双列 canvas min-content 挤出横向滚动；
   必须位于 .charts-grid 主规则之后——同特异性下后定义优先，否则被 1fr 1fr 覆盖） */
@media (max-width: 768px) {
    .charts-grid { grid-template-columns: 1fr; }
    .chart-box { max-width: 100%; }
    .chart-box canvas { max-width: 100%; }
}
.link-btn { border: none; background: none; cursor: pointer; text-decoration: underline; padding: 0; }
.rate-track {
    flex: 1;
    height: 18px;
    background: #e9ecef;
    border-radius: 9px;
    overflow: hidden;
}
.rate-fill {
    height: 100%;
    border-radius: 9px;
    transition: width 0.6s;
}
.advice-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}
.advice-row:last-child { border-bottom: none; }
.advice-empty {
    padding: 12px 0;
    text-align: center;
    font-size: 14px;
    color: var(--c-text-3);
}
.avatar-28 {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}
.modal-box-lg { max-width: 640px; }
.btn-xs { padding: 3px 9px; font-size: 12px; }
.m-2 { margin: 2px; }
.badge-solid-warning { background: var(--c-warning); color: #fff; }

/* 切题确认页：OCR 面板 / 页码分隔条 / 题目编辑输入 */
.ocr-panel {
    padding: 12px;
    max-height: 500px;
    overflow-y: auto;
    background: var(--c-bg-2);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.ocr-body {
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--c-text);
}
.ocr-page-marker {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0 8px;
    padding: 4px 8px;
    background: var(--c-info-bg);
    border-radius: 4px;
    font-weight: 600;
    font-size: 13px;
    color: var(--c-info);
}
.ocr-page-marker span { flex: 1; border-top: 1px dashed #1a73e8; }
.editor-scroll { padding: 12px; max-height: 500px; overflow-y: auto; }
.q-editor-input {
    width: 100%;
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    box-sizing: border-box;
    font-family: inherit;
    background: #fff;
}
.q-editor-textarea { min-height: 48px; resize: vertical; line-height: 1.6; }
.region-tag {
    margin-top: 4px;
    padding: 3px 8px;
    background: #f0f4ff;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--c-text-3);
}
.dot-8 { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.dot-8.danger { background: var(--c-danger); }
.ellipsis-cell { display: inline-block; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clickable-row { cursor: pointer; }
.clickable-row:hover { background-color: var(--c-bg-2); }
/* 整行跳详情：真实 <a> 绝对定位铺满整行（键盘可达、语义化，替代 JS 事件委托）。
   <a> 必须放在 td 内（tr 只允许 td/th 子元素）；width 延伸超出表格，
   由外层 .card.overflow-hidden 裁剪，可见点击区恰为整行。 */
.clickable-row > td:first-child { position: relative; }
.row-stretch-link {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 10000px;
    z-index: 1;
}
.clickable-row a:not(.row-stretch-link),
.clickable-row button,
.clickable-row form { position: relative; z-index: 2; }
.min-w-120 { min-width: 120px; }
.user-select-none { user-select: none; }
.ocr-text-block {
    padding: 16px 20px;
    font-size: 13px;
    line-height: 1.8;
    color: var(--c-text);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 500px;
    overflow-y: auto;
    background: var(--c-bg-2);
    border-radius: var(--radius-sm);
}
.pa-40-20 { padding: 40px 20px; }
.h-40 { height: 40px; }
.w-100 { width: 100%; }
.max-w-400 { max-width: 400px; }
.m-0 { margin: 0; }
.text-indigo { color: var(--c-indigo); }
.modal--lg { max-width: 640px; }
.import-drop {
    border: 2px dashed var(--c-border);
    border-radius: var(--radius);
    padding: 28px 16px;
    text-align: center;
    cursor: pointer;
    background: var(--c-bg);
}
.import-preview { display: none; flex-direction: column; min-height: 0; }
.import-errors {
    display: none;
    font-size: 13px;
    color: var(--c-danger);
    background: var(--c-danger-bg);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    margin-bottom: 10px;
    max-height: 80px;
    overflow-y: auto;
}
.import-scroll {
    overflow-y: auto;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    flex: 1;
    min-height: 0;
}
.img-preview {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    border: 1px solid var(--c-border-2);
}
.img-thumb {
    width: 100%;
    max-height: 220px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: #f8fafc;
    border: 1px solid var(--c-border);
}
.img-placeholder {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-text-3);
    background: #f8fafc;
    border-radius: var(--radius-sm);
}
.form-textarea { min-height: 240px; resize: vertical; }
.bg-bg-2 { background: var(--c-bg-2); }
.irt-bar { background: var(--c-primary); border-radius: 3px 3px 0 0; min-height: 4px; }
.kpi-hero.indigo { color: var(--c-indigo); }
.items-baseline { align-items: baseline; }
.dim-row-slider { flex: 1; display: flex; align-items: center; gap: 8px; }
.card-accent { border-color: var(--c-primary); }
.bg-primary-bg { background: var(--c-primary-bg); }
.todo-dot.danger { background: var(--c-danger); }
.todo-dot.primary { background: var(--c-primary); }
.todo-item--primary { background: var(--c-primary-bg); border-color: #c7d8ff; }
.pa-24-12 { padding: 24px 12px; }

/* 维度条填充色（学生详情，动态 width 仍内联） */
.dim-row-bar-inner.ok { background: var(--c-success); }
.dim-row-bar-inner.primary { background: var(--c-primary); }
.dim-row-bar-inner.warn { background: var(--c-warning); }
.dim-row-bar-inner.danger { background: var(--c-danger); }
.num-red { color: var(--c-danger); }
.num-yellow { color: var(--c-warning); }
.num-green { color: var(--c-success); }
.card-body { padding: 16px 20px; }

/* 评语导出弹窗（essay_list） */
.export-box {
    background: #fff;
    border-radius: var(--radius-lg);
    width: 520px;
    max-width: calc(100vw - 24px);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md);
}
.export-head { padding: 20px 24px 16px; border-bottom: 1px solid var(--c-border-2); }
.export-toolbar {
    padding: 12px 24px;
    border-bottom: 1px solid var(--c-border-2);
    display: flex;
    align-items: center;
    gap: 12px;
}
.export-list { flex: 1; overflow-y: auto; padding: 8px 24px; }
.export-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--c-border-2);
}
.export-foot {
    padding: 16px 24px;
    border-top: 1px solid var(--c-border-2);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* 进度条基础（动态 width 由模板/JS 内联写入，静态样式走类） */
.bar {
    height: 8px;
    background: var(--c-border);
    border-radius: 4px;
    overflow: hidden;
}
.bar-sm {
    height: 6px;
    background: var(--c-border);
    border-radius: 3px;
    overflow: hidden;
}
.bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s;
    background: linear-gradient(90deg, var(--c-primary), var(--c-success));
}
.bar-fill-sm { border-radius: 3px; }

/* 散页待处理提示条（P0-2） */
.orphan-banner {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    background: #fff3cd;
    color: #856404;
    padding: 8px 14px;
    border-radius: var(--radius);
}
.orphan-banner a { text-decoration: underline; margin-left: auto; white-space: nowrap; }

/* 供应商设置表单（80px 标签 + 输入框网格） */
.form-grid {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 8px 12px;
    align-items: center;
    font-size: 14px;
}
.form-input--readonly { background: var(--c-bg-2); color: var(--c-text-2); }
.v-divider { width: 1px; height: 20px; background: var(--c-border); flex-shrink: 0; }
.health-card {
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 10px 14px;
    min-width: 220px;
}
.health-card-head { display: flex; align-items: center; gap: 8px; }
.health-card-head strong { font-size: 14px; }
.health-card-body { margin-top: 6px; font-size: 13px; color: var(--c-text-2); }
.new-provider-card { margin-bottom: 12px; border: 2px dashed var(--c-primary); }

/* ---------- 供应商 chip（靛蓝点缀） ---------- */
.chip-indigo { background: var(--c-indigo-bg); border-color: #c7d2fe; }
.chip-indigo .chip-dot { background: var(--c-indigo); }

/* ---------- alert 第四色 info（设计 §5.4 alert 四种） ---------- */
.alert-info { background: var(--c-info-bg); border-color: #c7d8ff; color: var(--c-info); }
.alert-title { display: flex; align-items: center; gap: 6px; }

/* 紧凑告警条（处理页/确认页内嵌提示） */
.alert-inline {
    margin: 0 12px 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
}
.alert-inline-info { background: var(--c-info-bg); color: var(--c-info); }
.alert-inline-error { background: var(--c-danger-bg); color: var(--c-danger); }
.alert-inline-warning { background: var(--c-warning-bg); color: var(--c-warning); }

/* ---------- 提示条（页面头部小贴士） ---------- */
.tip {
    margin-top: 6px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
}
.tip-info { background: var(--c-indigo-bg); color: var(--c-indigo); }
.tip-warn { background: var(--c-warning-bg); color: var(--c-warning); }
.tip-amber { background: #fff3cd; color: #856404; }

/* ---------- 卡片网格（母卷/试卷卡） ---------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}
.justify-center { justify-content: center; }
.template-card {
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.template-card:hover { box-shadow: var(--shadow-md); }
.exam-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}
.exam-card { cursor: pointer; transition: all 0.2s; display: block; text-decoration: none; }
.exam-card.scored { border-color: var(--c-success); border-width: 2px; }
.exam-card.failed { border-color: var(--c-danger); border-width: 2px; }
.exam-card-head { padding: 16px; text-align: center; }
.exam-card-name { font-size: 16px; font-weight: 500; color: var(--c-text); margin-bottom: 4px; }
.exam-card-score {
    font-size: 28px;
    font-weight: 700;
    margin: 8px 0;
}
.exam-card-score.ok { color: var(--c-success); }
.exam-card-score.warn { color: var(--c-warning); }
.exam-card-score.danger { color: var(--c-danger); }
.exam-card-score.muted { color: var(--c-text-3); }
.exam-card-score-sub { font-size: 16px; }
.exam-card-status { font-size: 13px; margin-top: 4px; }
.exam-card-actions { margin-top: 12px; display: flex; gap: 4px; justify-content: center; }
.exam-status-bar {
    height: 4px;
    border-radius: 8px 8px 0 0;
}
.exam-status-bar.ok { background: var(--c-success); }
.exam-status-bar.warn { background: var(--c-warning); }

/* ---------- 上传按钮（uploader.js 组件，设计 §5.4 上传） ---------- */
.uploader-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 9px 20px;
    background: var(--c-primary);
    color: #fff;
    border-radius: var(--radius);
    font-size: 16px;
    cursor: pointer;
}
.upload-area--gray { background: var(--c-bg); padding: 48px 24px; }

/* ---------- 步骤指示（上传页 1/2 步） ---------- */
.step-indicator { display: flex; align-items: center; gap: 6px; }
.step-indicator .step-dot {
    display: inline-flex;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--c-text-3);
    color: #fff;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}
.step-indicator.active .step-dot { background: var(--c-primary); }
.step-indicator.active span:last-child { font-weight: 500; color: var(--c-primary); }
.step-indicator:not(.active) { opacity: 0.5; }
.step-indicator:not(.active) span:last-child { color: var(--c-text-3); }

/* ---------- 上传页批改模式单选卡 ---------- */
.radio-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border: 2px solid var(--c-border);
    border-radius: var(--radius);
    cursor: pointer;
    flex: 1;
    min-width: 200px;
    transition: border-color 0.15s, background 0.15s;
}
.radio-card input { margin-top: 3px; }
.radio-card:has(input:checked) {
    border-color: var(--c-primary);
    background: var(--c-primary-bg);
}
.radio-card-title { font-weight: 600; font-size: 16px; color: var(--c-text); }
.radio-card-desc { font-size: 13px; color: var(--c-text-3); margin-top: 4px; }

/* ---------- 维度滑块（essay_detail 调分） ---------- */
.dim-slider { flex: 1; height: 6px; }
.dim-slider-value { font-size: 13px; font-weight: 600; color: var(--c-text-2); min-width: 28px; text-align: right; }

/* ---------- 骨架屏（设计 §5.4 新增：列表/详情加载占位） ---------- */
.skeleton {
    background: linear-gradient(90deg, var(--c-bg-2) 25%, #eef0f2 37%, var(--c-bg-2) 63%);
    background-size: 400% 100%;
    animation: skeleton-shimmer 1.4s ease infinite;
    border-radius: var(--radius-sm);
}
.skeleton-line { height: 14px; margin-bottom: 10px; }
.skeleton-line:last-child { margin-bottom: 0; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-40 { width: 40%; }
.skeleton-card { padding: 20px; }
.skeleton-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
}
@keyframes skeleton-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: 0 0; }
}

/* ---------- 分段控件（手机试卷分析入口，设计 §5.2） ---------- */
.seg-control {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--c-border-2);
    border-radius: var(--radius);
    margin-bottom: 16px;
}
.seg-control-item {
    flex: 1;
    text-align: center;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--c-text-2);
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}
.seg-control-item.active { background: #fff; color: var(--c-primary); font-weight: 500; box-shadow: var(--shadow-sm); }

/* ---------- 表单错误态（设计 §5.4：错误红边 + 中文提示） ---------- */
.form-input--error { border-color: var(--c-danger); }
.form-input--error:focus { border-color: var(--c-danger); box-shadow: 0 0 0 3px rgba(245,63,91,0.15); }
.form-error { font-size: 13px; color: var(--c-danger); margin-top: 4px; }

/* ---------- 大数字 KPI（单点成绩展示，56px 级） ---------- */
.kpi-hero {
    font-size: 56px;
    font-weight: 700;
    color: var(--c-primary);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.kpi-hero-sm { font-size: 36px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-hero.danger { color: var(--c-danger); }
.kpi-hero.success { color: var(--c-success); }
.kpi-hero.warn { color: var(--c-warning); }
.kpi-hero.muted { color: var(--c-text-3); }

/* ---------- 底部导航 badge 圆点（设计 §5.4 导航） ---------- */
.bottom-nav-badge {
    position: absolute;
    top: 6px;
    right: calc(50% - 20px);
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--c-danger);
    color: #fff;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    line-height: 16px;
    text-align: center;
}
.bottom-nav-item { position: relative; }

/* ---------- 空态行动区（设计 §5.4 空态带行动按钮） ---------- */
.empty-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
    flex-wrap: wrap;
}

/* ---------- 数据表格：数字右对齐列（设计 §5.4 表格） ---------- */
.data-table td.num, .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .ellipsis-cell { max-width: 200px; }

/* ---------- 手机触屏（设计 §5.4 点击区 >=44px） ---------- */
@media (max-width: 768px) {
    .btn { min-height: 44px; }
    .btn-sm { min-height: 36px; }
    .btn-lg { min-height: 48px; }
    .nav-item { min-height: 44px; }
}

/* ============================================
   M6 菜单收敛 + 信息统一 + 首屏重构（2026-08-03）
   ============================================ */

/* ---------- essay_list：任务信息 + 管线 单行紧凑条 ---------- */
.task-pipeline-bar { padding: 10px 16px; margin-bottom: 16px; }
.task-pipeline-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.task-info-min {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 14px;
    white-space: nowrap;
}
.pipeline-strip {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 280px;
}
.pstrip-node {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
    border: none;          /* button 重置：无边框/无底色/字体继承 */
    background: none;
    font: inherit;
}
@media (hover: hover) {
    .pstrip-node:hover { background: var(--c-bg-2); }
}
.pstrip-node.active { background: var(--c-primary-bg); }
.pstrip-count {
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.pstrip-label { font-size: 13px; color: var(--c-text-2); font-weight: 500; }
.pstrip-node.active .pstrip-label { color: var(--c-primary); font-weight: 600; }
.pstrip-arrow { color: var(--c-text-4); font-size: 13px; }
.pstrip-failed-label { color: var(--c-danger); font-weight: 600; }
.task-pipeline-actions { margin-left: auto; }

/* ---------- index：KPI 合并卡（两值并排） ---------- */
.kpi-combo {
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.kpi-combo .kpi-value { font-size: 24px; }
.kpi-combo-sep { color: var(--c-text-4); font-size: 16px; font-weight: 400; }

/* ---------- exam_batch：仪表盘收敛 ---------- */
.dash-progress-block { flex: 1; min-width: 240px; max-width: 360px; }

/* ---------- exam_card：学号行 ---------- */
.exam-card-no { font-size: 12px; color: var(--c-text-3); margin-top: 2px; }

/* ---------- essay_detail：评语生成中提示条 ---------- */
.feedback-pending-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius-sm);
    background: var(--c-primary-bg);
    border: 1px dashed var(--c-primary);
    color: var(--c-primary);
}

/* ---------- exam_template_review：吸底操作条 ---------- */
.sticky-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(6px);
    border-top: 1px solid var(--c-border);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
    padding: 12px 24px;
}
.sticky-actions-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 1400px;
    margin: 0 auto;
    flex-wrap: wrap;
}
@media (max-width: 768px) {
    /* 吸底条抬到手机底部导航之上 */
    .sticky-actions {
        bottom: calc(56px + env(safe-area-inset-bottom));
        padding: 8px 12px;
    }
}
/* 有吸底条的页面预留底部空间，避免内容被遮挡 */
body:has(.sticky-actions) { padding-bottom: 84px; }
@media (max-width: 768px) {
    body:has(.sticky-actions) { padding-bottom: calc(120px + env(safe-area-inset-bottom)); }
}

/* ============================================
   P1 开学前必修：按压反馈 + 禁用视觉（2026-08-03）
   ============================================ */
.btn:active { transform: scale(0.98); }
.btn svg, .link svg, .uploader-btn svg { flex-shrink: 0; }
.btn svg, .link svg, .uploader-btn svg { flex-shrink: 0; }
.btn:disabled, .btn.disabled { opacity: 0.55; cursor: not-allowed; }
/* 其他可点元素按压态（transform 轻压；仅动 transform 符合动效规范） */
.nav-item:active, .chip-clickable:active, .pstrip-node:active,
.pipeline-node:active, .pipeline-failed-item:active, .seg-control-item:active,
.bottom-nav-item:active, .search-item:active, .warn-action:active,
.link-btn:active, .task-select:active {
    transform: scale(0.97);
}
/* 卡片类按压态（大幅缩放会抖动，用 0.99 轻压） */
.exam-card:active, .student-card:active, .quick-card:active,
.stat-card:active, .upload-area:active, .radio-card:active {
    transform: scale(0.99);
}
/* badge 用作筛选按钮（exam_batch）：仅去默认边框，保留 .badge 全部既有样式 */
button.badge { border: none; }

/* ---------- 图表三态（exam_report）：加载骨架 / 空态 / 失败重试 覆盖层 ---------- */
.chart-box { position: relative; height: 240px; }
.chart-box .chart-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #fff;
    z-index: 2;
    text-align: center;
    padding: 12px;
}
.chart-skeleton { width: 100%; height: 100%; }

/* ---------- 步骤条 done 态（components/step_indicator.html 复用） ---------- */
.step-indicator.done { opacity: 1; }
.step-indicator.done .step-dot { background: var(--c-success); }
.step-indicator.done span:last-child { color: var(--c-success); }
