/* StuLink 成绩管理模块统一样式 v1.9.0 */

/* 2026-10-12 UI 审计 M5：成绩模块原有 5 种操作反馈（原生 alert / #scFlash 定时消失 /
   #qMsg 文字 / #tcMsg 文字 / report.css 的 .rp-copied toast），同一模块内给用户
   4 种心智模型。这里提供一个全局 stuToast(msg, type) 的样式载体，
   实现放在 static/js/common.js（base.html 已全局引入），各页面逐步替换 alert()。
   非阻塞、自动消失、不打断填写。 */
.stu-toast-wrap { position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
    z-index: 9999; display: flex; flex-direction: column; gap: 6px; align-items: center;
    pointer-events: none; }
.stu-toast { padding: 8px 16px; border-radius: 6px; font-size: 13.5px; color: #fff;
    box-shadow: 0 4px 14px rgba(0,0,0,.18); max-width: 70vw;
    animation: stuToastIn .16s ease-out; }
.stu-toast.ok { background: #198754; }
.stu-toast.warn { background: #b45309; }
.stu-toast.err { background: #b42318; }
.stu-toast.leaving { opacity: 0; transition: opacity .25s ease-out; }
@keyframes stuToastIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media print { .stu-toast-wrap { display: none !important; } }
.g-table thead th {
    background: #1e293b !important;
    color: #fff !important;
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
    padding: .4rem .55rem;              /* 紧凑：压缩纵向留白 */
    border-bottom: none;
}
.g-table thead th.num { text-align: right; }
.g-table tbody td {
    font-size: 12.5px;
    padding: .3rem .55rem;
    white-space: nowrap;                /* 不换行，避免列宽被内容撑爆 */
    /* 行间虚线：横向阅读时明确「这一行的内容到此为止」 */
    border-bottom: 1px dashed #dbe3ec;
}
.g-table tbody tr:last-child td { border-bottom: none; }
.g-table tbody tr:nth-child(even) { background: #f8fafc; }
.g-table .num { text-align: right; font-variant-numeric: tabular-nums; }
/* 数值列再压缩左右留白：列数多的宽表能少滚一屏 */
.g-table thead th.num, .g-table tbody td.num { padding-left: .35rem; padding-right: .35rem; }
.g-table .center { text-align: center; }

/* 2026-10-12 UI 审计 M1：.g-table 全表 nowrap，长考试名/长科目名/备注必触发横向滚动。
   给「文本类列」加一个可选的 .wrap 类：允许换行 + 任意位置断行，列宽由 max-width 收住。
   用法：<td class="wrap">很长的名字</td>。 */
.g-table td.wrap, .g-table th.wrap {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-all;
    max-width: 220px;
}
/* 表头也允许换行（多级表头/长科目名），避免把整表撑宽 */
.g-table thead th.wrap { max-width: 120px; line-height: 1.3; }

/* 宽表横向滚动时首列冻结（如每生一行的明细表）：标签列始终可见
   2026-10-12 UI 审计 L7：冻结列背景原写死 #fff/#f8fafc，与 .table-warning /
   .table-success 等行状态冲突 → 横向滚动时首列不变色、行状态被"切断"。
   改用 var(--bs-table-bg)（base.html 已为 .table-responsive 场景修过同类问题），
   让行背景由 Bootstrap 的行类统一决定。 */
.g-table thead th:first-child,
.g-table tbody td:first-child { position: sticky; left: 0; background: var(--bs-table-bg, #fff); }
.g-table thead th:first-child { z-index: 3; background: #1e293b !important; }
.g-table tbody td:first-child { z-index: 1; }
.g-table tbody tr:nth-child(even) { --bs-table-bg: #f8fafc; }
.g-table tbody tr:nth-child(even) td:first-child { background: var(--bs-table-bg, #f8fafc); }
.g-table tbody tr.stu-link:hover td:first-child { background: #e0ecff !important; }
/* 行状态类（缺考黄 / 已选绿等）在冻结列上同样生效。
   2026-10-13：原来写的是 --bs-table-warning-bg / --bs-table-success-bg /
   --bs-table-danger-bg —— 这几个变量 Bootstrap 里**根本不存在**，所以永远回落到
   浅色字面量，深色模式下这些行一定是一整块亮黄/亮绿/亮红（用户反馈「色块突兀」）。
   改用真实存在的 --bs-*-bg-subtle（Bootstrap 在深色主题下会重定义它）。 */
.g-table tbody tr.table-warning { --bs-table-bg: var(--bs-warning-bg-subtle, #fff3cd); }
.g-table tbody tr.table-warning td:first-child { background: var(--bs-table-bg, #fff3cd); }
.g-table tbody tr.table-success { --bs-table-bg: var(--bs-success-bg-subtle, #d1e7dd); }
.g-table tbody tr.table-success td:first-child { background: var(--bs-table-bg, #d1e7dd); }
.g-table tbody tr.table-danger { --bs-table-bg: var(--bs-danger-bg-subtle, #f8d7da); }
.g-table tbody tr.table-danger td:first-child { background: var(--bs-table-bg, #f8d7da); }

/* 表头排序（点击表头切换 升序 → 降序 → 还原） */
.g-table thead th.sortable { cursor: pointer; user-select: none; }
.g-table thead th.sortable:hover { color: #93c5fd !important; }
.g-table thead th .th-sort {
    margin-left: 4px; font-size: 10px; opacity: .3; vertical-align: 1px;
}
.g-table thead th.sortable:hover .th-sort { opacity: .6; }
.g-table thead th.sorted-asc .th-sort,
.g-table thead th.sorted-desc .th-sort { opacity: 1; color: #fbbf24; }

/* 分析页图表卡片 */
.chart-card { border: none; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.chart-card .card-header { background: #fff; border-bottom: 1px solid #f1f5f9; }
.chart-box { width: 100%; height: 360px; }
.chart-box.short { height: 300px; }

/* ================= 指标卡：表格 / 图表 双视图切换 ================= */
.view-switch .btn {
    --bs-btn-padding-y: .15rem; --bs-btn-padding-x: .6rem;
    --bs-btn-font-size: 12px; --bs-btn-border-radius: 20px;
}
.view-switch .btn.active { pointer-events: none; }
.view-pane { animation: viewFade .16s ease-out; }
.view-pane[hidden] { display: none !important; }
@keyframes viewFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.tbl-chart { width: 100%; height: 360px; }
.tbl-chart.tall { height: 460px; }
.chart-tip { color: var(--sl-text-muted); font-size: 12px; }
/* ==================== 指标卡：左图 + 右表（2026-10-28 用户口径） ====================
  「页面就默认左边显示图表，右边显示表格」——有图的卡片固定两栏：
  左栏 42% 图表、右栏完整数据表（排序/列显隐仍可用）；窄屏自动回上下堆叠。
  无图的卡片仍是整宽表格（不带 .chart-pane）。
  注：文字色统一走 --sl-text-muted（深色模式下回退成 #64748b 会偏暗）。 */
.chart-pane { display: flex; flex-wrap: nowrap; align-items: stretch; }
.chart-pane .tbl-chart {
    flex: 0 0 42%;
    width: auto;
    height: 420px;
    box-sizing: border-box;
    padding: 6px 10px;
}
.chart-pane .tbl-wrap {
    flex: 1 1 0;
    min-width: 0;
    max-height: 480px;
    overflow: auto;
    border-left: 1px solid var(--sl-border);
}
/* 右栏只有五六成宽：字号比整宽表降一档，避免一屏只看到两三列 */
.chart-pane .tbl-wrap .g-table { min-width: 0 !important; width: 100%; }
.chart-pane .tbl-wrap .g-table thead th {
    font-size: 13px; padding: .3rem .45rem;
}
.chart-pane .tbl-wrap .g-table tbody td {
    font-size: 13.5px; padding: .26rem .45rem;
}
/* 只有手机/超窄屏（<768px）才回「上图下表」；
   768 及以上一律左图右表（表格可横向滚动），符合「默认左边图表、右边表格」。 */
@media (max-width: 767.98px) {
    .chart-pane { flex-wrap: wrap; }
    .chart-pane .tbl-chart {
        flex: 0 0 100%;
        width: 100%;
        height: 300px;
        padding: 0;
    }
    .chart-pane .tbl-wrap {
        flex: 0 0 100%;
        border-left: 0;
        border-top: 1px solid var(--sl-border);
    }
}

/* 卡片内的表：按内容自适应、整表水平居中，不强制铺满容器；
   但给一个适中的下限宽度 —— 否则列少的表（科目总表）被压得太窄。 */
.tbl-card .g-table {
    width: auto;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}
@media (min-width: 768px) {
    .tbl-card .g-table { min-width: 760px; }
}
/* 字号 18px（2026-10-19 用户口径）；列间留白同步放大 */
.tbl-card .g-table thead th { font-size: 18px; padding: .42rem .6rem; }
.tbl-card .g-table tbody td { font-size: 18px; padding: .32rem .6rem; }
.tbl-card .g-table thead th:not(.num),
.tbl-card .g-table tbody td:not(.num) {
    white-space: normal;
    overflow-wrap: anywhere;
    max-width: 260px;
}
/* 首列（名次段/班级/科目）是行标签：不换行，宽度跟着内容走 */
.tbl-card .g-table thead th:first-child,
.tbl-card .g-table tbody td:first-child { white-space: nowrap; }
/* 第二列（班级/日期）也是短标签：不允许被挤成「01 换行 班」 */
.tbl-card .g-table thead th:nth-child(2),
.tbl-card .g-table tbody td:nth-child(2) { white-space: nowrap; }

/* 班级多选下拉 */
#gCmList .cm-item {
    display: flex; align-items: center; gap: 6px; padding: 3px 6px;
    border-radius: 6px; cursor: pointer; white-space: nowrap;
}
#gCmList .cm-item:hover { background: #f1f5f9; }
#gCmList .cm-item input { cursor: pointer; }

/* 可点击行（考试列表行等，整行可跳转） */
.g-table tbody tr.stu-link { cursor: pointer; }
.g-table tbody tr.stu-link:hover { background: #e0ecff !important; }

/* 表格卡片 */
.tbl-card { border: none; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.tbl-card .card-header { background: #fff; border-bottom: 1px solid #f1f5f9; padding: 8px 14px; }
.tbl-wrap { max-height: 480px; overflow: auto; }

/* 分析页 tab 面板 */
.tab-pane-loading {
    padding: 60px 0;
    text-align: center;
    color: var(--sl-text-subtle);
}
.empty-state {
    padding: 50px 20px;
    text-align: center;
    color: var(--sl-text-muted);
}
.empty-state .bi { font-size: 40px; color: #cbd5e1; }

/* ================= AI 分析：对话 / 思维链 / 图表 ================= */
.ai-chat {
    display: flex; flex-direction: column; gap: 14px;
    max-height: 52vh; overflow-y: auto; padding: 14px;
    background: #f6f8fb; border: 1px solid #eef2f6; border-radius: 10px;
}
.ai-msg { display: flex; }
.ai-msg-user { justify-content: flex-end; }
.ai-bubble {
    max-width: 88%; padding: 10px 14px; border-radius: 12px;
    background: #fff; border: 1px solid #e6ebf2; font-size: 13.5px; line-height: 1.75;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.ai-msg-user .ai-bubble {
    background: #0d6efd; color: #fff; border-color: #0d6efd;
    white-space: pre-wrap; word-break: break-word;
}
.ai-bubble h4, .ai-bubble h5, .ai-bubble h6 { margin: 12px 0 6px; font-weight: 700; }
.ai-bubble h4 { font-size: 15px; }
.ai-bubble h5 { font-size: 14px; }
.ai-bubble h6 { font-size: 13px; }
.ai-bubble table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 12.5px; }
.ai-bubble table th, .ai-bubble table td {
    border: 1px solid #e2e8f0; padding: 5px 8px; text-align: left;
}
.ai-bubble table th { background: #f1f5f9; font-weight: 600; }
.ai-bubble ul, .ai-bubble ol { padding-left: 20px; margin: 6px 0; }
.ai-bubble code {
    background: #f1f5f9; padding: 1px 5px; border-radius: 4px; font-size: 12px;
}
.ai-bubble blockquote {
    border-left: 3px solid #cbd5e1; margin: 8px 0; padding: 4px 10px; color: var(--sl-text-muted);
}
.ai-caret {
    display: inline-block; width: 6px; height: 14px; margin-left: 2px;
    background: #0d6efd; vertical-align: -2px; animation: aiBlink .9s steps(2, start) infinite;
}
@keyframes aiBlink { to { visibility: hidden; } }
.ai-stage { color: var(--sl-text-muted); font-size: 12.5px; }
.ai-think {
    margin-top: 8px; border: 1px dashed #cbd5e1; border-radius: 8px;
    background: #fbfcfe; padding: 6px 10px;
}
.ai-think summary {
    cursor: pointer; color: var(--sl-text-muted); font-size: 12.5px; user-select: none;
}
.ai-think-body {
    margin-top: 6px; max-height: 220px; overflow: auto;
    white-space: pre-wrap; font-family: inherit; line-height: 1.6;
}
.ai-chart-card {
    border: 1px solid #eef2f6; border-radius: 10px; background: #fff; padding: 10px 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.ai-chart-title { font-size: 13px; font-weight: 600; color: #334155; margin-bottom: 4px; }
.ai-chart-input textarea { resize: vertical; }

/* 成绩认定证明（打印页 / 公开核验页共用，对齐纸质模板版式） */
.cert-doc { max-width: 900px; margin: 0 auto; background: #fff; }
.cert-doc .cert-school { text-align: center; font-size: 1.35rem; font-weight: 700; letter-spacing: 6px; }
.cert-doc .cert-title { text-align: center; font-size: 1.5rem; font-weight: 700;
    letter-spacing: 8px; margin: 10px 0 18px; }
.cert-doc .cert-text { font-size: 15px; line-height: 2; text-indent: 2em; margin-bottom: 14px; }
.cert-doc .cert-text b { border-bottom: 1px solid #333; padding: 0 4px; }
.cert-tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.cert-tbl th, .cert-tbl td { border: 1px solid #333; padding: 6px 8px; text-align: center; }
.cert-tbl thead th { background: #f1f5f9; font-weight: 600; }
.cert-tbl td.subj { font-weight: 600; white-space: nowrap; background: #f8fafc; }
.cert-tbl td.muted { color: var(--sl-text-subtle); font-size: 13px; }
.cert-note { font-size: 13px; color: #475569; margin-top: 10px; }
.cert-foot { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 36px; }
.cert-sign { text-align: center; font-size: 14px; line-height: 1.9; white-space: nowrap; }
.cert-seal {
    margin: 0 auto 10px; width: 110px; height: 110px; border: 3px solid #b42318; border-radius: 50%;
    color: #b42318; display: flex; align-items: center; justify-content: center;
    text-align: center; font-size: .8rem; transform: rotate(-12deg); opacity: .85;
}

/* 打印（导出 PDF）：仅打印当前激活 tab，横向 A4 */
@media print {
    body { background: #fff; }
    .navbar, .sidebar, .g-filter-bar, .g-actions, .nav-tabs, .btn,
    .alert, .no-print { display: none !important; }
    .main-content { margin: 0 !important; padding: 0 !important; }
    .tab-pane { display: none !important; }
    .tab-pane.active { display: block !important; }
    .tbl-card, .chart-card { box-shadow: none !important; border: 1px solid #e2e8f0;
        break-inside: avoid; page-break-inside: avoid; }
    /* 打印只输出每张卡当前激活的视图（表格或图表），隐藏交互控件 */
    .view-switch, #gClassMulti, #gViewToggle { display: none !important; }
    .view-pane[hidden] { display: none !important; }
    .tbl-chart { height: 300px !important; }
    .chart-box { height: 260px !important; }
    /* 打印时数据表不截断（屏幕上右栏滚动，纸上要看到全部行） */
    .chart-data { max-height: none !important; overflow: visible !important; }
    /* 打印：左右并排改回上下（A4 分两栏会挤成一团） */
    .chart-pane { display: block; }
    .chart-pane .tbl-chart { width: 100% !important; padding: 0; }
    /* 屏幕上给表留的 760px 下限在 A4 上会溢出 → 打印按内容宽度 */
    .tbl-card .g-table { min-width: 0 !important; }
    .g-table thead th { position: static; }
    table { page-break-inside: auto; }
    tr { page-break-inside: avoid; }
}

/* ===== 数据导入（2026-10-19）：左＝标准模板 / 右＝AI 智能导入 =====
   两张卡统一圆角、卡片头层级；右侧拖拽区用虚线 + 胶囊标签，
   深浅主题都只引用 --sl-* 变量，不写字面量颜色。 */
.di-card {
    border-radius: 14px;
    border: 1px solid var(--sl-border);
    background: var(--sl-surface);
    box-shadow: var(--sl-shadow);
    overflow: hidden;
}
.di-card .di-card-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
    background: var(--sl-surface-2);
    border-bottom: 1px solid var(--sl-border);
}
.di-title { font-size: 15px; font-weight: 600; color: var(--sl-text); }
.di-title .bi { color: var(--sl-accent); }
.di-sub { font-size: 12px; color: var(--sl-text-muted); }
.di-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 150px;
    padding: 22px 16px;
    border: 1.5px dashed var(--sl-soft-info-bd);
    border-radius: 12px;
    background: var(--sl-surface-2);
    cursor: pointer;
    text-align: center;
    transition: border-color .15s, background .15s;
}
.di-drop:hover, .di-drop.di-drop-on {
    border-color: var(--sl-accent);
    background: var(--sl-soft-info-bg);
}
.di-drop > .bi { font-size: 30px; line-height: 1.1; color: var(--sl-soft-info-fg); }
.di-drop-main { font-size: 14px; font-weight: 600; color: var(--sl-text); }
.di-drop-sub { font-size: 12px; color: var(--sl-text-muted); }
.di-file-name {
    min-height: 18px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--sl-text-muted);
    word-break: break-all;
}
.di-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.di-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border: 1px solid var(--sl-border);
    border-radius: 999px;
    background: var(--sl-surface-3);
    color: var(--sl-text-muted);
    font-size: 12px;
    line-height: 1.6;
    white-space: nowrap;
}
.di-chip-ok {
    border-color: var(--sl-soft-success-bd);
    background: var(--sl-soft-success-bg);
    color: var(--sl-soft-success-fg);
}
/* 历次考试：年级学期标签（高一上…高三下），用 --sl-* 变量跟随深浅主题 */
.sem-chip {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border: 1px solid var(--sl-border);
    border-radius: 999px;
    background: var(--sl-surface-3);
    color: var(--sl-text-muted);
    font-size: 12px;
    line-height: 1.7;
    white-space: nowrap;
    vertical-align: 1px;
}
/* 历次考试：筛选栏（年级胶囊 + 学期 / 类型 / 日期区间） */
.exams-filter .form-select-sm,
.exams-filter .form-control-sm {
    min-width: 112px;
    font-size: 13px;
}
.exams-filter input[type="date"] {
    min-width: 148px;
}
.di-note {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px dashed var(--sl-border);
    color: var(--sl-text-subtle);
    font-size: 12px;
    line-height: 1.6;
}
.di-band-strip {
    padding: 12px 0;
    border-top: 1px solid var(--sl-border);
    border-bottom: 1px solid var(--sl-border);
}
.di-band-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--sl-soft-info-bg);
    color: var(--sl-soft-info-fg);
    font-size: 20px;
}
.di-band-main { min-width: 220px; }
@media (max-width: 1199.98px) {
    .di-band-main { min-width: 0; }
}


/* ── 2026-11-03 目标设定（导入页）：各班各分数线上线目标 ───────────── */
#examTargetCard .tgt-wrap { max-height: 440px; overflow: auto; }
#examTargetCard .tgt-table th,
#examTargetCard .tgt-table td { vertical-align: middle; }
#examTargetCard .tgt-table thead th {
    position: sticky; top: 0; z-index: 2; white-space: nowrap;
    background: var(--bs-tertiary-bg, #f8f9fa);
}
#examTargetCard .tgt-first {
    position: sticky; left: 0; z-index: 1; white-space: nowrap;
    background: var(--bs-body-bg, #fff);
}
#examTargetCard .tgt-table thead .tgt-first { z-index: 3; }
#examTargetCard .tgt-input {
    width: 86px; height: 28px; margin: 0 auto; padding: .1rem .3rem;
    text-align: center;
}
#examTargetCard .tgt-cell { text-align: center; min-width: 100px; }
#examTargetCard .tgt-sub {
    display: block; margin-top: 2px; white-space: nowrap;
    font-size: 11px; color: var(--bs-secondary-color, #6c757d);
}
#examTargetCard .tgt-total td {
    font-weight: 600; background: var(--bs-tertiary-bg, #f8f9fa);
}

#examTargetCard .tgt-count { min-width: 92px; }
#examTargetCard .tgt-count > div { font-weight: 600; }
#examTargetCard .tgt-count .tgt-sub { font-weight: 400; }

/* 2026-11-03 用户口径：「班级/参考」一行两色同字号（如 52/50） */
#examTargetCard .tgt-num-pair { font-size: 13px; font-weight: 600; white-space: nowrap; display: inline-block; }
#examTargetCard .tgt-num-pair .tgt-sep { color: var(--bs-secondary-color, #adb5bd); margin: 0 1px; font-weight: 400; }
#examTargetCard .tgt-num-pair .tgt-enrolled { color: var(--bs-body-color, #212529); }
#examTargetCard .tgt-num-pair .tgt-exam { color: var(--bs-primary, #0d6efd); }
#examTargetCard tfoot .tgt-num-pair .tgt-enrolled { color: var(--bs-body-color, #212529); }

/* 2026-11-03 合并表：班型 / 选科 / 去差列 */
#examTargetCard .tgt-type { min-width: 92px; }
#examTargetCard .tgt-sel { min-width: 112px; }
#examTargetCard .tgt-trim { min-width: 88px; }
#examTargetCard .trim-in { width: 72px; margin: 0 auto; text-align: center; height: 28px; padding: .1rem .3rem; }
#examTargetCard .tgt-sel .badge { font-weight: 500; }

/* 2026-11-03 用户口径：合并表列宽优化——管理列固定窄宽，分数线列自适应并可横向滚动 */
#examTargetCard .tgt-table th, #examTargetCard .tgt-table td { white-space: nowrap; }
#examTargetCard .tgt-first { width: 106px; min-width: 106px; }
#examTargetCard .tgt-type { width: 74px; min-width: 74px; }
#examTargetCard .tgt-sel { width: 88px; min-width: 88px; }
#examTargetCard .tgt-count { width: 80px; min-width: 80px; }
#examTargetCard .tgt-trim { width: 70px; min-width: 70px; }
#examTargetCard .tgt-line { min-width: 94px; }
#examTargetCard .tgt-type .badge, #examTargetCard .tgt-sel .badge { font-size: 11px; padding: .12rem .34rem; }
#examTargetCard .tgt-table th.tgt-line { min-width: 94px; }

/* 2026-11-03 用户口径：目标「人数 + 百分比」双输入联动（基数＝班级人数）
   2026-11-03 UI 优化：原来百分比框 48px 装不下「10.0」被截断，且数字框的上下箭头
   占宽又碍眼 —— 加宽、居中、隐藏原生 spinner，百分比紧贴「%」。 */
#examTargetCard .tgt-pair {
    display: flex; align-items: center; gap: 4px;
    justify-content: center; padding: 1px 0;
}
#examTargetCard .tgt-pair .tgt-input {
    width: 58px; min-width: 58px; text-align: center;
    padding: .1rem .2rem; font-variant-numeric: tabular-nums;
}
#examTargetCard .tgt-pair .tgt-pct {
    width: 62px; min-width: 62px; text-align: center;
    padding: .1rem .2rem; font-variant-numeric: tabular-nums;
    color: var(--bs-body-color, #212529);   /* 可编辑，别做成灰显 */
    background: var(--bs-body-bg, #fff);
}
/* 2026-11-03 用户口径：划线矩阵 + 目标表里的**所有数字输入框**都去掉上下箭头
   （滚动/误点就会改分数，风险太高）；Chrome/Edge/Safari + Firefox 全覆盖。 */
#bandTable input[type=number]::-webkit-outer-spin-button,
#bandTable input[type=number]::-webkit-inner-spin-button,
#examTargetCard input[type=number]::-webkit-outer-spin-button,
#examTargetCard input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none; margin: 0;
}
#bandTable input[type=number],
#examTargetCard input[type=number] { -moz-appearance: textfield; appearance: textfield; }
#examTargetCard .tgt-pct-sym { font-size: 12px; color: var(--bs-secondary-color, #6c757d); }
#examTargetCard .tgt-line { min-width: 152px; }
#examTargetCard .tgt-table th.tgt-line { min-width: 152px; }
#examTargetCard .tgt-total-pct { font-size: 11px; font-weight: 400; color: var(--bs-secondary-color, #6c757d); }

/* 2026-11-03 用户口径：「实际/目标」如 5/5 双色（实际=正文色、目标=次要色） */
.g-table .cell-pair-a { color: var(--bs-body-color, #212529); font-weight: 600; }
.g-table .cell-pair-sep { color: var(--bs-secondary-color, #adb5bd); margin: 0 2px; }
.g-table .cell-pair-b { color: var(--bs-secondary-color, #6c757d); }
/* 层次积分档：目标表表头的小输入框 */
#examTargetCard .tgt-table thead th.tgt-line { padding: 2px 4px; }
#examTargetCard .tgt-th-name { font-weight: 600; margin-bottom: 2px; }
#examTargetCard .tgt-score {
    width: 46px; height: 24px; margin: 0 auto; padding: 0 2px;
    font-size: 12px; text-align: center;
}
#examTargetCard .tgt-score-ro { font-size: 11px; color: var(--bs-secondary-color, #6c757d); }
#examTargetCard .tgt-table thead th { vertical-align: middle; }

/* 2026-11-03 用户口径：年级分析的「先按班型排（卓越 / 强基）」勾选框
   —— 与「全校对比」页 .ld-sort-toggle 同一视觉语言（默认不勾＝按班号） */
.grades-sort-toggle { padding: 0 2px; }
.grades-sort-toggle label { display: inline-flex; align-items: center; gap: 4px;
    font-size: 12px; color: var(--sl-text-muted, #6c757d); cursor: pointer;
    white-space: nowrap; }
.grades-sort-toggle input { margin: 0; cursor: pointer; }


/* 2026-11-04 用户口径：班级积分表格——主值是得分，下面一行灰色小字写算式
   例：（6−5）×3=3 ；表头已写「每人 N 分」 */
.g-table .cell-formula-val { font-variant-numeric: tabular-nums; }
.g-table .cell-formula-note {
    font-size: 10.5px; line-height: 1.25; white-space: nowrap;
    color: var(--sl-text-muted, #6c757d); font-weight: 400;
}
.g-table td.num { vertical-align: middle; }


/* ==========================================================================
   2026-11-04 用户口径：数据导入页整页 UI 统一 + 美化
   规则：**可修改的格子＝淡黄底**、**不可修改的格子＝灰底灰字**；
        卡片、表头、按钮、输入框统一样式。深浅色主题都走变量，不写死白底。
   ========================================================================== */
:root {
    --imp-edit-bg: #fffceb;        /* 可编辑：淡黄 */
    --imp-edit-bg-2: #fff8d9;      /* 可编辑：hover/聚焦更明显 */
    --imp-edit-bd: #ecd98f;
    --imp-edit-bd-2: #e0b53b;
    --imp-ro-bg: #f8f9fa;          /* 不可编辑：灰 */
    --imp-ro-fg: #868e96;
    --imp-ro-bd: #e6e8ea;
    --imp-head-bg: #f1f5f9;
    --imp-card-bd: #e5e9ef;
}
[data-bs-theme="dark"] {
    --imp-edit-bg: #3b3524;
    --imp-edit-bg-2: #4a4229;
    --imp-edit-bd: #7a6a2e;
    --imp-edit-bd-2: #b99a3a;
    --imp-ro-bg: #2b2d31;
    --imp-ro-fg: #9aa0a6;
    --imp-ro-bd: #3a3d42;
    --imp-head-bg: #26282c;
    --imp-card-bd: #34373c;
}

/* ---- 1) 卡片统一：圆角 + 柔和阴影 + 淡色标题条 ---- */
#importPageScope .card,
#bandOverviewCard, #examTargetCard, #scoreChanges, #aiPanel,
.di-card {
    border: 1px solid var(--imp-card-bd);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -18px rgba(16, 24, 40, .18);
    overflow: hidden;
}
#bandOverviewCard > .card-header,
#examTargetCard > .card-header,
#scoreChanges > .card-header,
#aiPanel > .card-header,
.di-card > .card-header {
    background: linear-gradient(180deg, var(--imp-head-bg), transparent);
    border-bottom: 1px solid var(--imp-card-bd);
    font-weight: 600;
}
#bandOverviewCard .imp-card-title,
#examTargetCard .imp-card-title,
#scoreChanges .imp-card-title { font-size: 14.5px; letter-spacing: .2px; }

/* ---- 2) 可编辑控件（淡黄） ---- */
#examTargetCard input:not([disabled]):not([readonly]),
#examTargetCard select:not([disabled]),
#bandTable input:not([disabled]) {
    background: var(--imp-edit-bg);
    border: 1px solid var(--imp-edit-bd);
    border-radius: 7px;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
#examTargetCard input:not([disabled]):not([readonly]):hover,
#bandTable input:not([disabled]):hover {
    background: var(--imp-edit-bg-2);
    border-color: var(--imp-edit-bd-2);
}
#examTargetCard input:not([disabled]):not([readonly]):focus,
#examTargetCard select:not([disabled]):focus,
#bandTable input:not([disabled]):focus {
    background: var(--imp-edit-bg-2);
    border-color: var(--imp-edit-bd-2);
    box-shadow: 0 0 0 .16rem rgba(224, 181, 59, .25);
    outline: none;
}

/* ---- 3) 不可修改控件（灰） ---- */
#examTargetCard input[disabled],
#examTargetCard select[disabled],
#bandTable input[disabled],
.form-control:disabled,
.form-select:disabled {
    background: var(--imp-ro-bg) !important;
    color: var(--imp-ro-fg) !important;
    border: 1px solid var(--imp-ro-bd) !important;
    cursor: not-allowed;
    box-shadow: none !important;
}

/* ---- 4) 整格底色：可改＝淡黄，只读＝灰 ---- */
#tgtForm[data-editable="1"] td.tgt-line { background: var(--imp-edit-bg); }
#tgtForm[data-editable="0"] td.tgt-line { background: var(--imp-ro-bg); }
#examTargetCard td.tgt-first,
#examTargetCard td.tgt-type,
#examTargetCard td.tgt-sel,
#examTargetCard td.tgt-count,
#examTargetCard td.tgt-trim { background: var(--imp-ro-bg); }
#examTargetCard td.tgt-sub,
#examTargetCard .tgt-sub,
#examTargetCard .tgt-tpl-def { color: var(--imp-ro-fg); }
#bandTable td.q-edit { background: var(--imp-edit-bg); }
#bandTable td.q-ro { background: var(--imp-ro-bg); color: var(--imp-ro-fg); }
#bandTable td:first-child { background: var(--imp-ro-bg); }

/* ---- 5) 表头统一：浅底、字重、吸顶 ---- */
#examTargetCard .tgt-table thead th,
#bandTable thead th {
    background: var(--imp-head-bg);
    font-weight: 600;
    font-size: 12.5px;
    color: var(--bs-body-color, #212529);
    border-bottom: 1px solid var(--imp-card-bd);
}

/* ---- 6) 行 hover：一眼看出在哪行 ---- */
#examTargetCard .tgt-table tbody tr:hover > td,
#bandTable tbody tr:hover > td { box-shadow: inset 0 0 0 999px rgba(13, 110, 253, .045); }
#examTargetCard .tgt-table tbody tr:hover > td.tgt-line { box-shadow: none; }

/* ---- 7) 输入框尺寸统一（人数/百分比/去差/分值 对齐） ---- */
#examTargetCard .form-control-sm,
#bandTable .form-control-sm { height: 30px; font-size: 13px; }
#examTargetCard .tgt-score { height: 26px; font-size: 12px; }

/* ---- 8) 按钮统一：主按钮实色、次按钮描边、圆角一致 ---- */
#bandOverviewCard .btn, #examTargetCard .btn, #scoreChanges .btn, .di-card .btn {
    border-radius: 8px; font-weight: 500;
}
#examTargetCard .btn-primary, #bandOverviewCard .btn-primary {
    box-shadow: 0 1px 2px rgba(13, 110, 253, .25);
}

/* ---- 9) 合计行：略深底 + 顶部分隔线 ---- */
#examTargetCard .tgt-total td {
    background: var(--imp-head-bg);
    border-top: 1px solid var(--imp-card-bd);
    font-weight: 600;
}

/* ---- 10) 图例说明：可编辑标记提示（页面顶部一句话） ---- */
#importEditHint { font-size: 12px; color: var(--imp-ro-fg); }
#importEditHint .dot-edit {
    display: inline-block; width: 10px; height: 10px; border-radius: 3px;
    background: var(--imp-edit-bg); border: 1px solid var(--imp-edit-bd);
    margin-right: 4px; vertical-align: -1px;
}
#importEditHint .dot-ro {
    display: inline-block; width: 10px; height: 10px; border-radius: 3px;
    background: var(--imp-ro-bg); border: 1px solid var(--imp-ro-bd);
    margin: 0 4px 0 10px; vertical-align: -1px;
}

/* 2026-11-05 用户口径：名次段表「自定义分段」工具栏（表上方一行） */
.g-toolbar .g-toolbar-input { max-width: 260px; min-width: 160px; height: 28px; font-size: 12.5px; }
.g-toolbar .btn { border-radius: 8px; }
/* 热力图单元格：只染底色，文字保持可读 */
.g-table.heat td.num { transition: background-color .2s ease; }

/* 2026-11-05 用户口径：积分格只显示得分，算式改为鼠标悬浮提示（title） */
.g-table td.g-has-note { cursor: help; }
.g-table td.g-has-note:hover { box-shadow: inset 0 0 0 2px rgba(13,110,253,.25); }

/* ===== 2026-11-06 名次段分布卡：左编辑器 + 历史/物理双热力表并排 ===== */
.rank-pair .rank-pair-body{display:flex;align-items:stretch}
.rank-pair .rank-cuts{flex:0 0 216px;max-width:216px;padding:10px 12px;
    border-right:1px dashed var(--sl-border,#d9dee7);background:rgba(0,0,0,.015)}
.rank-pair .rank-cuts-group + .rank-cuts-group{margin-top:14px;padding-top:12px;
    border-top:1px dashed var(--sl-border,#e3e7ee)}
.rank-pair .rank-cuts-title{font-size:12.5px;font-weight:600;color:var(--sl-text,#495057);margin-bottom:2px}
.rank-pair .rank-cuts-sub{font-size:11px;color:var(--sl-text-muted,#adb5bd);margin-bottom:6px}
.rank-pair .rank-cuts-row{display:flex;align-items:center;gap:6px;margin-bottom:4px}
.rank-pair .rank-cuts-span{width:66px;font-size:12px;color:var(--sl-text-muted,#6c757d);
    font-variant-numeric:tabular-nums}
.rank-pair .rank-cuts-row input{height:26px;padding:2px 6px;font-size:12.5px;border-radius:6px}
.rank-pair .rank-cuts-tail .rank-cuts-hint{font-size:11px;color:var(--sl-text-muted,#adb5bd)}
.rank-pair .rank-cuts-actions{display:flex;gap:6px;margin-top:6px}
.rank-pair .rank-cuts-actions .btn{padding:2px 8px;font-size:12px;border-radius:6px}
.rank-pair .rank-cuts-msg{margin-top:4px;color:var(--sl-text-muted,#6c757d)}
.rank-pair .rank-panes{display:flex;flex:1 1 auto;min-width:0}
.rank-pair .rank-pane{flex:1 1 50%;min-width:0;padding:10px 12px}
/* 历史 / 物理的分界线 */
.rank-pair .rank-pane + .rank-pane{border-left:1px dashed var(--sl-border,#d9dee7)}
.rank-pair .rank-pane-title{font-size:12.5px;font-weight:600;color:var(--sl-text,#495057);
    margin-bottom:6px}
/* 班级列头挪到表底后留下的空白表头（不占高度、不可点） */
.g-table th.rank-th-blank{padding:0 !important;border:0 !important;height:0 !important;
    line-height:0;font-size:0;pointer-events:none}
/* 表格最后一行：班级名 */
.g-table tr.rank-class-row td{background:var(--sl-surface-2,#f6f7f9);font-weight:600;
    color:var(--sl-text,#495057);border-top:2px solid var(--sl-border,#dee2e6);font-size:12px}
.g-table tr.rank-class-row td.rank-class-label{color:var(--sl-text-muted,#868e96);font-weight:500}
@media (max-width:1199.98px){
  .rank-pair .rank-pair-body{flex-direction:column}
  .rank-pair .rank-cuts{flex:1 1 auto;max-width:none;border-right:0;
      border-bottom:1px dashed var(--sl-border,#d9dee7)}
  .rank-pair .rank-panes{flex-direction:column}
  .rank-pair .rank-pane + .rank-pane{border-left:0;
      border-top:1px dashed var(--sl-border,#d9dee7)}
}

/* ===== 2026-11-06 名次段卡（第二步）：第一列可输入 + 表下操作条 ===== */
.rank-pair .rank-panes{display:flex;padding:6px 4px}
.rank-pair .rank-pane .cut-cell{white-space:nowrap;padding:3px 6px}
.rank-pair .rank-pane .cut-lo{font-size:12px;color:var(--sl-text-muted,#6c757d);margin-right:2px;
    font-variant-numeric:tabular-nums}
.rank-pair .rank-pane .cut-input{width:66px;display:inline-block;height:24px;padding:1px 5px;
    font-size:12.5px;border-radius:6px;text-align:right}
.rank-pair .rank-pane .cut-input:focus{border-color:#f0b429;box-shadow:0 0 0 3px rgba(240,180,41,.18)}
.rank-pair .rank-pane .cut-tail-label{font-size:12px;color:var(--sl-text-muted,#868e96)}
.rank-pair .rank-pane-ops{display:flex;gap:6px;align-items:center;margin:6px 2px 2px}
.rank-pair .rank-pane-ops .btn{padding:2px 8px;font-size:12px;border-radius:6px}

/* 2026-11-06 名次段卡（第三次）：「对应分数」列 + 行内加/减行按钮 */
.rank-pair .rank-score-cell{color:var(--sl-text-muted,#6c757d);font-size:12px;
    font-variant-numeric:tabular-nums;white-space:nowrap}
.rank-pair td.rank-ops-cell{padding:2px 4px;white-space:nowrap}
.rank-pair .rank-ops{display:flex;gap:4px}
.rank-pair .rank-ops .btn{padding:1px 6px;font-size:11.5px;border-radius:5px;line-height:1.5}
.rank-pair .rank-ops .btn:hover{border-color:#2563eb;color:#2563eb}

/* ===== 2026-11-06 名次段卡（第四次）：输入框淡黄（对齐导入页可编辑格）+ 前两列收窄 ===== */
.rank-pair .rank-pane .cut-cell{width:80px;max-width:96px;padding:3px 5px}
.rank-pair .rank-pane .cut-input{width:54px;height:24px;padding:1px 4px;font-size:12.5px;
    text-align:right;background:#fffceb;border:1px solid #f0d9a0;border-radius:6px;
    color:#4b3b00}
.rank-pair .rank-pane .cut-input:focus{background:#fff8d6;border-color:#e6bf62;
    box-shadow:0 0 0 3px rgba(240,180,41,.20)}
.rank-pair .rank-pane .cut-input-mirror{margin-right:1px}
.rank-pair .rank-pane .cut-tail-label{font-size:12.5px;color:#b08900;margin-left:1px}
.rank-pair .rank-pane table th:first-child{width:80px}
.rank-pair .rank-pane table th:nth-child(2){width:94px}
.rank-pair .rank-pane table td.rank-score-cell{width:94px;max-width:120px;padding:3px 6px;
    font-size:11.5px;color:#6c757d;white-space:nowrap}
/* 深色主题：淡黄换成低饱和暖色，避免刺眼 */
[data-bs-theme="dark"] .rank-pair .rank-pane .cut-input{background:rgba(240,180,41,.14);
    border-color:rgba(240,180,41,.36);color:#ffe9a8}
[data-bs-theme="dark"] .rank-pair .rank-pane .cut-tail-label{color:#e0b64b}
