/* =========================================================
   成绩分析系统 · 样式
   ========================================================= */
:root {
    --bg: #f4f6fb;
    --panel: #ffffff;
    --border: #e6ecf5;
    --border-strong: #d7dfec;
    --text: #1f2a44;
    --text-soft: #44506b;
    --muted: #7b8aa5;
    --primary: #3c5aa6;
    --primary-dark: #2f4a8c;
    --primary-soft: #eef2ff;
    --green: #0f9960;
    --green-soft: #e9f8f1;
    --red: #d92d20;
    --red-soft: #fff1f0;
    --amber: #c26a0a;
    --amber-soft: #fff7ea;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(24, 39, 75, .04), 0 10px 28px rgba(24, 39, 75, .05);
    --shadow-sm: 0 1px 2px rgba(24, 39, 75, .05);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}

h1, h2, h3, h4 {
    margin: 0;
    font-weight: 650;
    letter-spacing: -.01em;
}

p {
    margin: 0;
}

svg {
    display: block;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 12px;
}

.strong {
    font-weight: 600;
    color: var(--text);
}

.link {
    color: var(--primary);
    font-weight: 500;
}

.link:hover {
    text-decoration: underline;
}

/* ---------------- 布局 ---------------- */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 236px;
    flex: 0 0 236px;
    background: #fff;
    border-right: 1px solid var(--border);
    padding: 20px 14px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 8px 14px;
    border-bottom: 1px solid var(--border);
}

.brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, #4a5d8c, #6f88b8);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 17px;
    font-weight: 700;
    box-shadow: 0 6px 14px rgba(58, 84, 140, .28);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}

.brand-text strong {
    font-size: 14.5px;
}

.brand-text span {
    font-size: 11px;
    color: var(--muted);
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border-radius: 10px;
    color: #4a5878;
    font-size: 13.5px;
    font-weight: 500;
    transition: background .15s, color .15s;
}

.nav-item:hover {
    background: #f4f7fd;
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
}

.nav-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-exam {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
    color: var(--muted);
}

.sidebar-exam strong {
    font-size: 12px;
    color: var(--text-soft);
    font-weight: 600;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sidebar-version {
    font-size: 10.5px;
    color: #a4b0c4;
}

.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 60px;
    background: rgba(255, 255, 255, .82);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 26px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--muted);
}

.crumb-current {
    color: var(--text);
    font-weight: 600;
}

.crumb-sep {
    color: #c3ccdc;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.content {
    padding: 22px 26px 52px;
    width: 100%;
    max-width: 1640px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ---------------- 通用元件 ---------------- */
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 20px;
    min-width: 0;
}

.card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

/* 左侧标题/副标题可收缩换行，不挤压右侧操作按钮 */
.card-head > div:first-child {
    min-width: 0;
}

/* 导出卡右上角按钮组：保持横排不被挤压竖排 */
.card-head .form-actions {
    flex-shrink: 0;
    flex-wrap: nowrap;
}

@media (max-width: 1024px) {
    .card-head {
        flex-wrap: wrap;
    }
    .card-head .form-actions {
        flex-wrap: wrap;
    }
}

.card-head.sub-head {
    margin: 18px 0 10px;
    padding-top: 14px;
    border-top: 1px dashed var(--border-strong);
}

.card-head h2 {
    font-size: 15.5px;
}

.card-head h3 {
    font-size: 14px;
}

.card-sub {
    margin-top: 3px;
    font-size: 12px;
    color: var(--muted);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.grid-wide {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
    align-items: start;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 16px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: #fff;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
    white-space: nowrap;
}

.btn-sm {
    height: 32px;
    padding: 0 12px;
    font-size: 12.5px;
    border-radius: 9px;
}

.btn-primary {
    background: linear-gradient(135deg, #3f5ea9, #35508f);
    color: #fff;
    box-shadow: 0 6px 14px rgba(60, 90, 166, .22);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #35508f, #2c437a);
    color: #fff;
}

.btn-ghost {
    background: #fff;
    border-color: var(--border-strong);
    color: var(--text-soft);
}

.btn-ghost:hover {
    border-color: #b9c6de;
    color: var(--primary);
    background: #fafcff;
}

.btn-soft {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: #dfe6fb;
}

.btn-soft:hover {
    background: #e4ebff;
}

.btn-danger-ghost {
    background: #fff;
    border-color: #ffd7d3;
    color: var(--red);
}

.btn-danger-ghost:hover {
    background: var(--red-soft);
    color: var(--red);
}

.btn:disabled {
    opacity: .6;
    cursor: not-allowed;
    box-shadow: none;
}

.chip {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #f2f5fa;
    color: #64748b;
}

.chip-ok {
    background: var(--green-soft);
    color: #0b8153;
}

.chip-muted {
    background: #f4f6fa;
    color: #94a3b8;
}

.tag {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
}

.tag-warn {
    background: var(--red-soft);
    color: var(--red);
}

.tag-ok {
    background: var(--green-soft);
    color: #0b8153;
}

/* ---------------- 提示条 ---------------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    border: 1px solid transparent;
}

.alert-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 700;
    margin-top: 1px;
}

.alert-success {
    background: #f0fbf6;
    border-color: #c8ecd9;
    color: #0b6b46;
}

.alert-success .alert-icon {
    background: #d6f3e5;
    color: #0b8153;
}

.alert-error {
    background: var(--red-soft);
    border-color: #ffd4d0;
    color: #b42318;
}

.alert-error .alert-icon {
    background: #ffe1dd;
    color: var(--red);
}

.alert-warning {
    background: var(--amber-soft);
    border-color: #ffe4bd;
    color: #92400e;
}

.alert-warning .alert-icon {
    background: #ffe8c9;
    color: #b45309;
}

.alert-info {
    background: #f2f6ff;
    border-color: #d9e3fb;
    color: #2c4a91;
}

.alert-info .alert-icon {
    background: #e2eafd;
    color: var(--primary);
}

.notice {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 11px;
    font-size: 12.5px;
    line-height: 1.7;
}

.notice.slim {
    margin: 0 0 14px;
}

.notice-warn {
    background: var(--amber-soft);
    border: 1px solid #ffe3bd;
    color: #92400e;
}

.notice-info {
    background: #f4f7ff;
    border: 1px solid #dfe7fb;
    color: #3a4f86;
}

/* ---------------- 数据总览 ---------------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    right: -30px;
    top: -30px;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(76, 106, 178, .1), transparent 70%);
}

.stat-label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.02em;
    color: #22304e;
    font-variant-numeric: tabular-nums;
}

.stat-value small {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    margin-left: 4px;
}

.stat-sub {
    font-size: 11.5px;
    color: var(--muted);
    line-height: 1.5;
}

.progress {
    height: 6px;
    background: #eef2f9;
    border-radius: 999px;
    overflow: hidden;
    margin: 4px 0 2px;
}

.progress span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #4c6ab2, #6f88b8);
}

.chart-box {
    width: 100%;
    overflow-x: auto;
}

.bar-chart {
    width: 100%;
    height: auto;
    display: block;
}

.chart-empty {
    padding: 40px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

/* ---------------- 表格 ---------------- */
.table-wrap {
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    max-height: 72vh;
}

.table-wrap.tall {
    max-height: 64vh;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12.5px;
}

.table th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #f7f9fd;
    color: #64748b;
    font-weight: 600;
    font-size: 11.5px;
    letter-spacing: .01em;
    text-align: left;
    padding: 9px 10px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f0f3f9;
    white-space: nowrap;
    color: #33405c;
    background: #fff;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover td {
    background: #fafcff;
}

.table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.table-report th {
    vertical-align: bottom;
}

.table-report .group-head,
.table-students .group-head {
    text-align: center;
    background: #eef3fb;
    color: #35508f;
    border-left: 1px solid #e4ebf7;
}

.table-students thead tr:nth-child(2) th {
    top: 36px;
}

.table-students th[rowspan] {
    z-index: 4;
    vertical-align: middle;
}

.table-students td {
    padding: 7px 9px;
}

.name-cell {
    color: #1f2a44;
}

.table-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 2px 0;
    font-size: 11.5px;
    color: var(--muted);
    flex-wrap: wrap;
}

.th-hint {
    display: block;
    margin-top: 1px;
    font-size: 9.5px;
    font-weight: 400;
    color: #9aa8bf;
    letter-spacing: 0;
}

.table-teachers td {
    padding: 6px 8px;
}

.table-teachers th {
    font-size: 11.5px;
}

.empty-cell {
    text-align: center;
    color: var(--muted);
    padding: 32px 12px !important;
    font-size: 13px;
}

.empty-cell.tall {
    padding: 48px 12px !important;
}

.table-report td.pos,
.rc-table td.pos {
    color: var(--green);
    font-weight: 600;
}

.table-report td.neg,
.rc-table td.neg {
    color: var(--red);
    font-weight: 600;
}

.table-report td.warn-text {
    color: #b45309;
    font-weight: 600;
}

.rank-text {
    color: #64748b;
}

.table-report td.muted {
    color: #9aa6ba;
}

/* 可编辑排名 */
.rank-cell {
    cursor: pointer;
    position: relative;
}

.rank-cell:hover {
    background: #eef4ff !important;
}

.rank-cell.is-edited {
    background: #fff9ec !important;
    color: #b45309;
    font-weight: 600;
}

.rank-cell.is-edited::after {
    content: "";
    position: absolute;
    top: 4px;
    right: 4px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #e8a33d;
}

.rank-input {
    width: 52px;
    height: 24px;
    padding: 0 4px;
    border: 1px solid #7f9ad8;
    border-radius: 5px;
    font-size: 12px;
    font-family: inherit;
    text-align: right;
    outline: none;
    box-sizing: border-box;
    background: #fff;
}

/* ---------------- 表单 ---------------- */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 11px 16px;
    box-shadow: var(--shadow-sm);
}

.toolbar-inline {
    margin-bottom: 14px;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.field-inline {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    color: var(--muted);
}

.field-inline select,
.field-inline input {
    height: 32px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    padding: 0 10px;
    font-size: 12.5px;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    outline: none;
}

.field-inline select:focus,
.field-inline input:focus {
    border-color: #8aa3dd;
    box-shadow: 0 0 0 3px rgba(76, 106, 178, .12);
}

.search-field input {
    width: 150px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.field span {
    font-size: 12px;
    font-weight: 600;
    color: #5b6b8c;
}

.field input,
.field select,
.field textarea {
    height: 38px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    padding: 0 12px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: #8aa3dd;
    box-shadow: 0 0 0 3px rgba(76, 106, 178, .12);
}

.field em {
    font-style: normal;
    font-size: 11.5px;
    color: var(--muted);
    line-height: 1.6;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
}

.field-grid.four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.input-mini {
    width: 100%;
    min-width: 88px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 8px;
    font-size: 12.5px;
    font-family: inherit;
    color: var(--text);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.input-mini:focus {
    border-color: #8aa3dd;
    box-shadow: 0 0 0 3px rgba(76, 106, 178, .12);
    background: #fff;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.form-actions.wrap {
    flex-wrap: wrap;
}

.hint {
    font-size: 11.5px;
    color: var(--muted);
    line-height: 1.7;
    margin-top: 4px;
}

/* 上传 */
.upload-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 34px 20px;
    border: 1.5px dashed #c3d0e6;
    border-radius: 12px;
    background: #fbfcff;
    cursor: pointer;
    text-align: center;
    transition: border-color .15s, background .15s;
}

.dropzone:hover,
.dropzone.dragging {
    border-color: #7f9ad8;
    background: #f4f8ff;
}

.dropzone input[type="file"] {
    display: none;
}

.dz-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    display: grid;
    place-items: center;
    font-size: 18px;
    font-weight: 700;
}

.dropzone strong {
    font-size: 13.5px;
    color: var(--text);
    font-weight: 600;
}

.dz-hint {
    font-size: 11.5px;
    color: var(--muted);
}

.steps {
    margin: 0;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 12.5px;
    color: #4a5878;
}

.steps li strong {
    display: block;
    font-size: 13px;
    color: var(--text);
    margin-bottom: 2px;
}

.steps li p {
    color: var(--muted);
    line-height: 1.7;
}

.mini-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 4px;
}

.mini-box {
    background: #f8fafd;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 9px 12px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.mini-box span {
    font-size: 11px;
    color: var(--muted);
}

.mini-box strong {
    font-size: 14px;
    color: #22304e;
    font-variant-numeric: tabular-nums;
}

/* ---------------- 列配置 ---------------- */
.config-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.config-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.config-head h1 {
    font-size: 18px;
}

.config-head p {
    margin-top: 4px;
    font-size: 12.5px;
    color: var(--muted);
}

.config-head-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.config-block {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 14px 18px 16px;
    box-shadow: var(--shadow-sm);
}

.config-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.config-block-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 650;
    color: #22304e;
}

.block-dot {
    width: 8px;
    height: 8px;
    border-radius: 3px;
    display: inline-block;
}

.dot-blue {
    background: #4c6ab2;
}

.dot-green {
    background: #2f8f7f;
}

.dot-amber {
    background: #e0a44a;
}

.block-note {
    font-size: 11px;
    font-weight: 400;
    color: var(--muted);
    background: #f5f7fb;
    padding: 1px 7px;
    border-radius: 5px;
}

.block-actions {
    display: flex;
    gap: 10px;
}

.link-btn {
    border: none;
    background: none;
    padding: 0;
    font-size: 11.5px;
    color: var(--primary);
    cursor: pointer;
    font-family: inherit;
}

.link-btn:hover {
    text-decoration: underline;
}

.block-tip {
    margin-top: 8px;
    font-size: 11.5px;
    color: var(--muted);
}

.check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 8px;
}

.check-chip {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
    font-size: 12.5px;
    color: #4a5878;
    background: #fcfdff;
    cursor: pointer;
    transition: border-color .12s, background .12s, color .12s;
    user-select: none;
}

.check-chip:hover {
    border-color: #bccae4;
}

.check-chip input {
    width: 14px;
    height: 14px;
    accent-color: var(--primary);
    margin: 0;
    cursor: pointer;
}

.check-chip:has(input:checked) {
    background: #f2f6ff;
    border-color: #c4d2ee;
    color: #2f4a8c;
    font-weight: 500;
}

.config-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 12px 18px;
    box-shadow: var(--shadow-sm);
}

.config-footer-note {
    font-size: 12px;
    color: var(--muted);
}

.config-footer-actions {
    display: flex;
    gap: 10px;
}

/* ---------------- 科目分析 ---------------- */
.report-hero {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    padding: 24px 30px;
    background: linear-gradient(118deg, #465a8c 0%, #5c74a6 48%, #7489b6 100%);
    color: #fff;
    box-shadow: 0 14px 32px rgba(58, 80, 138, .22);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 118px;
}

.report-hero::before {
    content: "";
    position: absolute;
    right: -80px;
    top: -120px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .07);
}

.report-hero::after {
    content: "";
    position: absolute;
    right: 120px;
    bottom: -140px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .05);
}

.hero-main {
    position: relative;
    z-index: 1;
}

.hero-eyebrow {
    display: inline-block;
    font-size: 11px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .72);
    margin-bottom: 6px;
}

.hero-main h1 {
    font-size: 23px;
    letter-spacing: .01em;
    margin-bottom: 5px;
}

.hero-main p {
    font-size: 12.5px;
    color: rgba(255, 255, 255, .78);
}

.hero-motto {
    position: relative;
    z-index: 1;
    writing-mode: vertical-rl;
    font-size: 12px;
    letter-spacing: .35em;
    color: rgba(255, 255, 255, .45);
    line-height: 1.9;
    padding-right: 4px;
}

.subject-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.subject-tab {
    height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 0 16px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--border);
    color: #4a5878;
    font-size: 12.5px;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.subject-tab:hover {
    border-color: #b9c8e2;
    color: var(--primary);
}

.subject-tab.active {
    background: linear-gradient(135deg, #3f5ea9, #35508f);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 14px rgba(60, 90, 166, .25);
}

.report-card {
    padding: 0;
    overflow: hidden;
}

.report-card .table-wrap {
    border: none;
    border-radius: 0;
    max-height: 68vh;
}

.report-card .table th:first-child,
.report-card .table td:first-child {
    padding-left: 20px;
}

.report-card .table th:last-child,
.report-card .table td:last-child {
    padding-right: 20px;
}

.report-card .table-foot {
    padding: 10px 20px 14px;
    border-top: 1px solid var(--border);
}

.warn-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.warn-box {
    background: #fff6f5;
    border: 1px solid #ffdbd7;
    border-radius: 13px;
    padding: 15px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.warn-box-amber {
    background: #fffaf0;
    border-color: #ffe6c2;
}

.warn-head {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #c92a2a;
    font-size: 13.5px;
}

.warn-box-amber .warn-head {
    color: #b45309;
}

.warn-ico {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: currentColor;
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 700;
    flex: 0 0 18px;
}

.warn-tag {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    background: rgba(201, 42, 42, .1);
    color: currentColor;
    padding: 1px 8px;
    border-radius: 999px;
}

.warn-box-amber .warn-tag {
    background: rgba(180, 83, 9, .1);
}

.warn-line {
    font-size: 12.5px;
    color: #a12820;
    line-height: 1.75;
}

.warn-box-amber .warn-line {
    color: #9a4b06;
}

.warn-line.ok {
    color: #0b8153;
}

.warn-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.warn-chip {
    font-size: 11px;
    background: rgba(255, 255, 255, .75);
    border: 1px solid rgba(201, 42, 42, .18);
    color: #a12820;
    border-radius: 6px;
    padding: 1px 7px;
    font-variant-numeric: tabular-nums;
}

.warn-box-amber .warn-chip {
    border-color: rgba(180, 83, 9, .18);
    color: #9a4b06;
}

/* ---------------- 学生排名 / AI ---------------- */
.ai-card {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.ai-key {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 13px;
    border-radius: 999px;
    background: #f4f7fd;
    color: #4a5878;
}

.ai-key .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #b6c2d6;
}

.ai-key.is-ok {
    background: #f0fbf6;
    color: #0b6b46;
}

.ai-key.is-ok .dot {
    background: #17b26a;
    box-shadow: 0 0 0 3px rgba(23, 178, 106, .16);
}

.ai-key.is-warn {
    background: var(--amber-soft);
    color: #92400e;
}

.ai-key.is-warn .dot {
    background: #e8a33d;
    box-shadow: 0 0 0 3px rgba(232, 163, 61, .18);
}

.ai-key-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ai-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    border-top: 1px dashed var(--border-strong);
    padding-top: 12px;
}

.ai-hint {
    font-size: 12px;
    color: var(--muted);
}

.ai-hint.busy {
    color: var(--primary);
}

.ai-scope {
    margin-left: auto;
    font-size: 11.5px;
    color: var(--muted);
    background: #f7f9fd;
    border-radius: 6px;
    padding: 2px 8px;
}

.ai-report {
    border-top: 1px solid var(--border);
    padding-top: 14px;
}

.ai-report-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    font-size: 12.5px;
    flex-wrap: wrap;
}

.ai-report-head strong {
    font-size: 14px;
    color: #22304e;
}

.md-body {
    font-size: 13px;
    color: #3a4763;
    line-height: 1.85;
    max-height: 520px;
    overflow: auto;
    padding-right: 6px;
}

.md-body h2 {
    font-size: 16px;
    margin: 18px 0 8px;
    color: #22304e;
}

.md-body h3 {
    font-size: 14px;
    margin: 16px 0 6px;
    color: #2f3d5c;
}

.md-body h2:first-child,
.md-body h3:first-child {
    margin-top: 4px;
}

.md-body p {
    margin: 8px 0;
}

.md-body ul,
.md-body ol {
    margin: 8px 0;
    padding-left: 22px;
}

.md-body li {
    margin: 3px 0;
}

.md-body strong {
    color: #1f2a44;
}

.md-body blockquote {
    margin: 10px 0;
    padding: 8px 14px;
    border-left: 3px solid #c3d2ef;
    background: #f7faff;
    color: #4a5878;
    border-radius: 0 8px 8px 0;
}

.md-body hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 14px 0;
}

.md-body code {
    background: #f2f5fa;
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 12px;
}

.md-table {
    overflow-x: auto;
    margin: 10px 0;
}

.md-table table {
    border-collapse: collapse;
    width: 100%;
    font-size: 12px;
}

.md-table th,
.md-table td {
    border: 1px solid var(--border);
    padding: 6px 9px;
    text-align: left;
    white-space: nowrap;
}

.md-table th {
    background: #f7f9fd;
    color: #5b6b8c;
}

/* ---------------- 分页 ---------------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 2px 2px;
    flex-wrap: wrap;
    font-size: 12px;
}

.page-links {
    display: flex;
    gap: 6px;
    align-items: center;
}

.page-link {
    min-width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: #fff;
    color: #4a5878;
    font-size: 12px;
}

.page-link:hover {
    border-color: #b9c8e2;
    color: var(--primary);
}

.page-link.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ---------------- 空状态 ---------------- */
.empty-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 46px 30px 42px;
    gap: 10px;
}

.empty-hero.compact {
    padding: 40px 24px;
}

.empty-hero h1 {
    font-size: 20px;
}

.empty-hero h2 {
    font-size: 16px;
}

.empty-hero p {
    max-width: 620px;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.8;
}

.empty-illustration {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: linear-gradient(135deg, #eaf0ff, #dfe8fb);
    color: #4a67ad;
    display: grid;
    place-items: center;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.empty-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 14px 0 6px;
    width: 100%;
    max-width: 880px;
    text-align: left;
}

.empty-step {
    background: #f9fbff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
}

.empty-step span {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 11.5px;
    font-weight: 700;
    margin-bottom: 6px;
}

.empty-step strong {
    display: block;
    font-size: 13px;
    margin-bottom: 2px;
}

.empty-step p {
    font-size: 11.5px;
    color: var(--muted);
    line-height: 1.65;
    text-align: left;
}

.empty-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 4px;
}

.info-list {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.info-list > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 2px;
    border-bottom: 1px dashed var(--border);
    font-size: 12.5px;
}

.info-list > div:last-child {
    border-bottom: none;
}

.info-list dt {
    color: var(--muted);
    margin: 0;
}

.info-list dd {
    margin: 0;
    color: var(--text-soft);
    text-align: right;
    word-break: break-all;
}

/* ---------------- Toast ---------------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 32px;
    transform: translate(-50%, 16px);
    background: rgba(31, 42, 68, .94);
    color: #fff;
    padding: 9px 18px;
    border-radius: 999px;
    font-size: 12.5px;
    box-shadow: 0 12px 30px rgba(20, 30, 60, .28);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
    z-index: 9999;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.toast.error {
    background: rgba(180, 35, 24, .96);
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 1280px) {
    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1120px) {
    .grid-2,
    .grid-wide,
    .warn-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 900px) {
    .app-shell {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex: none;
        height: auto;
        position: static;
        padding: 12px 14px;
        gap: 10px;
    }

    .brand {
        padding-bottom: 10px;
    }

    .nav {
        flex-direction: row;
        overflow-x: auto;
        gap: 4px;
        padding-bottom: 2px;
    }

    .nav-item {
        white-space: nowrap;
        padding: 7px 10px;
        font-size: 12.5px;
    }

    .sidebar-footer {
        display: none;
    }

    .topbar {
        position: static;
        padding: 0 16px;
    }

    .content {
        padding: 16px 14px 40px;
    }

    .report-hero {
        padding: 20px 22px;
    }

    .hero-main h1 {
        font-size: 19px;
    }

    .hero-motto {
        display: none;
    }

    .empty-steps {
        grid-template-columns: minmax(0, 1fr);
    }

    .field-grid,
    .field-grid.four {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mini-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .stat-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .field-grid,
    .field-grid.four {
        grid-template-columns: minmax(0, 1fr);
    }

    .toolbar {
        align-items: stretch;
    }

    .toolbar-group {
        width: 100%;
    }

    .search-field input {
        width: 100%;
    }

    .ai-scope {
        margin-left: 0;
    }
}

/* ---------------- 打印 ---------------- */
@media print {
    .sidebar,
    .topbar,
    .toolbar,
    .config-footer,
    .ai-card,
    .btn,
    .pagination {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .content {
        padding: 0;
    }

    .card,
    .report-hero {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .table-wrap {
        max-height: none;
        overflow: visible;
    }
}

/* ---------------- v2 新增样式 ---------------- */
.report-hero.slim {
    min-height: 86px;
    padding: 16px 26px;
}

.report-hero.slim .hero-main h1 {
    font-size: 18px;
}

.exam-switcher select {
    min-width: 200px;
}

.exam-switcher .btn {
    margin-left: 4px;
}

.stat-card.slim {
    padding: 12px 16px;
}

.stat-card.slim .stat-value {
    font-size: 20px;
}

.subject-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 10px;
    margin: 14px 0;
}

.subject-card {
    background: #f8fafd;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.subject-card strong {
    font-size: 13.5px;
}

.subject-card dl {
    margin: 6px 0 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.subject-card dl div {
    display: flex;
    justify-content: space-between;
    font-size: 11.5px;
}

.subject-card dt {
    color: var(--muted);
    margin: 0;
}

.subject-card dd {
    margin: 0;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: #33405c;
}

.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    margin-left: 6px;
    border-radius: 999px;
    background: var(--red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
}

.import-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.summary-row td {
    background: #f2f6fc !important;
    color: #2f4a8c;
    font-weight: 700;
    border-top: 2px solid #c9d7ef;
}

.summary-cell {
    letter-spacing: .02em;
}

td.teacher-cell.teacher-warn {
    background: #d94a3d;
    color: #fff;
    font-weight: 600;
    text-align: center;
}

.row-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.inline-form {
    display: inline-flex;
    margin: 0;
}

.hidden-form {
    display: none;
}

.table-exams .input-mini {
    min-width: 0;
}

.table-exams .exam-name-input {
    width: 220px;
}

.table-exams .date-input {
    width: 140px;
}

.table-exams .note-input {
    width: 140px;
}

.table-exams .sort-input {
    width: 72px;
}

.table-exams .subject-name-input {
    width: 160px;
}

.table-exams .score-input {
    width: 96px;
}

/* ---------------- 登录 / 初始化页 ---------------- */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #dfe8f3 0%, #eef2f7 45%, #dce9e2 100%);
    padding: 24px;
}

.auth-wrap {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: #fff;
    border-radius: 16px;
    padding: 36px 32px 24px;
    box-shadow: 0 18px 50px rgba(31, 55, 88, .16);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.auth-logo {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #3f7fc4, #5fae8f);
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-brand h1 {
    font-size: 19px;
    margin: 0 0 2px;
    color: #1e2c3c;
}

.auth-brand p {
    margin: 0;
    font-size: 12.5px;
    color: #8795a8;
}

.auth-form .field {
    display: block;
    margin-bottom: 14px;
}

.auth-form .field span {
    display: block;
    font-size: 12.5px;
    color: #5b6b80;
    margin-bottom: 6px;
}

.auth-form .field input,
.auth-form .field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d5dde8;
    border-radius: 9px;
    font-size: 14px;
}

.auth-form .field input:focus {
    outline: none;
    border-color: #3f7fc4;
    box-shadow: 0 0 0 3px rgba(63, 127, 196, .15);
}

.btn-block {
    width: 100%;
    padding: 11px 0;
    font-size: 15px;
    margin-top: 6px;
}

.auth-foot {
    margin: 16px 0 0;
    font-size: 12px;
    color: #97a3b4;
    text-align: center;
}

.flash {
    padding: 10px 14px;
    border-radius: 9px;
    font-size: 13px;
    margin-bottom: 12px;
}

.flash-success {
    background: #e7f5ee;
    color: #1e7a4f;
}

.flash-error {
    background: #fdeaea;
    color: #b3372f;
}

.flash-warning {
    background: #fdf3e0;
    color: #9a6b13;
}

/* ---------------- 顶栏用户区 ---------------- */
.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 4px 4px;
    border: 1px solid #e3e9f1;
    border-radius: 999px;
    background: #f7f9fc;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3f7fc4, #5fae8f);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.user-meta strong {
    font-size: 12.5px;
    color: #26364a;
}

.user-meta .muted {
    font-size: 11px;
}

.user-link {
    font-size: 12px;
    color: #4a6f96;
    background: none;
    border: none;
    padding: 2px 4px;
    cursor: pointer;
    text-decoration: none;
}

.user-link:hover {
    color: #2a5c8e;
    text-decoration: underline;
}

/* ---------------- 用户管理 ---------------- */
.user-create-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.user-create-form .field {
    min-width: 170px;
}

.user-create-form .field span {
    display: block;
    font-size: 12px;
    color: #5b6b80;
    margin-bottom: 5px;
}

.user-create-form input,
.user-create-form select {
    padding: 8px 10px;
    border: 1px solid #d5dde8;
    border-radius: 8px;
    font-size: 13px;
}

.user-display-input,
.user-role-select {
    width: 130px;
}

.user-pwd-input {
    width: 110px;
}

.check-inline {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    color: #5b6b80;
    cursor: pointer;
}

.table-simple th {
    text-align: left;
    color: #6b7a8f;
    font-weight: 500;
    font-size: 12.5px;
    padding: 9px 12px;
    background: #f7f9fc;
}

.config-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    padding: 16px;
}

.config-grid .field {
    min-width: 200px;
    flex: 1;
}

.config-grid .field span {
    display: block;
    font-size: 12px;
    color: #5b6b80;
    margin-bottom: 5px;
}

.config-grid input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d5dde8;
    border-radius: 8px;
    font-size: 13px;
}

.form-actions {
    align-self: flex-end;
}

.table-exams tr.is-current td {
    background: #fbfdff;
}

.export-preview {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    overflow: auto;
    background: #fff;
}

.export-preview h3 {
    font-size: 13.5px;
    margin: 10px 0 8px;
    color: #2f3d5c;
}

.export-preview table {
    margin-bottom: 18px;
    width: 100%;
}

.export-preview th,
.export-preview td {
    white-space: nowrap;
}

.export-preview th {
    background: #eaf0fa;
    color: #35508f;
    font-weight: 600;
}

.export-preview tr.summary td {
    background: #f3f7fd;
    font-weight: 700;
    color: #2f4a8c;
}

.export-preview td.teacher-warn {
    background: #d94a3d;
    color: #fff;
    font-weight: 600;
}

@media print {
    .exam-switcher,
    .import-tabs,
    .subject-tabs,
    .warn-grid,
    .ai-card {
        display: none !important;
    }
}

/* ---- 成长建议 ---- */
.advice-list { list-style: none; margin: 0; padding: 6px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.advice-item { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; line-height: 1.7; color: #334155; background: #f8fafc; border: 1px solid #eef2f7; border-radius: 10px; padding: 10px 14px; }
.advice-dot { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; background: #94a3b8; }
.advice-good { background: #f2fbf6; border-color: #d9efe3; } .advice-good .advice-dot { background: #0f9960; }
.advice-warn { background: #fff7ed; border-color: #ffe4c7; } .advice-warn .advice-dot { background: #d97706; }
.advice-goal { background: #eff6ff; border-color: #dbeafe; } .advice-goal .advice-dot { background: #3f7fc4; }

/* ---- 本次亮点徽章 ---- */
.hl-filter { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hl-filter select { font-size: 13px; padding: 4px 8px; border: 1px solid #dbe4ef; border-radius: 8px; background: #fff; color: #334155; }
.hl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 14px; padding: 4px 16px 16px; }
.hl-list .muted { font-size: 12px; }
.hl-class { flex: 1 0 100%; color: #7c8ba1; font-size: 12px; margin-top: -2px; }
.hl-more { color: #7c8ba1; font-size: 12px; }

/* 导出页班级多选芯片 */
.class-picker { flex: 1 0 100%; width: 100%; border: 1px solid #dbe4f0; border-radius: 10px; padding: 12px 14px; margin-top: 10px; background: #fbfcfe; }
.class-picker-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; font-size: 13px; flex-wrap: wrap; }
.class-picker-title { font-weight: 600; color: #34435b; }
.class-picker-count { color: #3f7fc4; }
.class-picker-count b { font-size: 15px; }
.class-picker-actions { display: inline-flex; gap: 10px; margin-left: auto; }
.class-picker-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.class-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px; border: 1px solid #c9d5e6; border-radius: 999px; cursor: pointer; user-select: none; background: #fff; font-size: 13px; color: #34435b; transition: border-color .15s, background .15s; }
.class-chip input { margin: 0; accent-color: #3f7fc4; cursor: pointer; }
.class-chip:hover { border-color: #3f7fc4; background: #f2f7fd; }
.class-chip.picked { border-color: #3f7fc4; background: #e8f1fc; color: #2b6cb0; font-weight: 600; }

/* 成绩分析档位名单弹窗 */
.count-link { cursor: pointer; color: #3f7fc4; text-decoration: underline dotted; text-underline-offset: 3px; border-radius: 4px; }
.count-link:hover, .count-link:focus-visible { color: #2b6cb0; background: #e8f1fc; outline: none; }
.summary-row .count-link { color: #2f4a8c; }
.modal-overlay { position: fixed; inset: 0; background: rgba(23, 34, 56, .45); z-index: 200; display: flex; align-items: flex-start; justify-content: center; padding: 60px 16px 32px; }
.modal-overlay[hidden] { display: none; }
.modal-card { background: #fff; border-radius: 14px; width: min(560px, 100%); max-height: min(70vh, 640px); display: flex; flex-direction: column; box-shadow: 0 18px 50px rgba(20, 32, 60, .25); overflow: hidden; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 20px 10px; border-bottom: 1px solid #e3ebf6; }
.modal-head h3 { margin: 0 0 4px; font-size: 15.5px; }
.modal-head p { margin: 0; font-size: 12px; line-height: 1.5; }
.modal-close { border: none; background: #f0f4fb; color: #5b6b8c; width: 30px; height: 30px; border-radius: 50%; font-size: 17px; cursor: pointer; flex-shrink: 0; }
.modal-close:hover { background: #e2eaf6; color: #2f3d5c; }
.modal-head-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.modal-head-actions .btn[disabled] { opacity: .45; cursor: not-allowed; }
.profiles-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.profiles-toolbar .muted { font-size: 13px; }
.profile-card { border-left: 3px solid #d7e2f2; }
.profile-card-current { border-left-color: #2f9e73; }
.profile-hero { padding: 18px 22px; }
.profile-hero h1 { margin: 0 0 4px; font-size: 22px; }
.profile-hero p { margin: 0; }
.modal-body { overflow: auto; padding: 8px 20px 18px; }
.modal-table th { position: sticky; top: 0; background: #eaf0fa; }
.modal-table td, .modal-table th { padding: 7px 10px; }
.modal-empty { padding: 18px 0 8px; text-align: center; }
.hl-block { background: #fbfdff; border: 1px solid #eef2f7; border-radius: 12px; padding: 12px 14px; }
.hl-block h3 { margin: 0 0 10px; font-size: 14px; color: #1e3a5f; }
.hl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hl-list li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #334155; flex-wrap: wrap; }
.hl-list b { color: #0f172a; }
.hl-score { margin-left: auto; color: #b45309; font-weight: 600; font-variant-numeric: tabular-nums; }
.hl-subject { flex: 0 0 auto; background: #eef4fb; color: #3f7fc4; border-radius: 6px; padding: 1px 8px; font-size: 12px; font-weight: 600; }
.hl-tag { flex: 0 0 auto; color: #fff; border-radius: 999px; padding: 1px 10px; font-size: 12px; font-weight: 700; }
.hl-tag-gold { background: linear-gradient(135deg, #f59e0b, #d97706); }
.hl-tag-silver { background: linear-gradient(135deg, #94a3b8, #64748b); }
.hl-tag-bronze { background: linear-gradient(135deg, #d97706, #92400e); }

/* ---- 个人成绩单 ---- */
.rc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 4px 16px 0; }
.rc-title h2 { margin: 0 0 4px; font-size: 20px; color: #1e3a5f; }
.rc-title p { margin: 0; color: #64748b; font-size: 13px; }
.rc-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.rc-sub { margin: 18px 16px 8px; font-size: 14.5px; color: #1e3a5f; border-left: 3px solid #7fa7d9; padding-left: 8px; }
.rc-table td, .rc-table th { padding: 7px 10px; }
.rc-comment { margin: 16px 16px 0; background: #fbf7ee; border: 1px solid #f1e6cd; border-radius: 10px; padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start; }

.rc-advice { margin: 8px 16px 0; padding: 10px 14px 10px 30px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; font-size: 13px; line-height: 1.8; color: #334155; }
.rc-advice li { margin: 2px 0; }
@media print {
    .rc-advice { background: #fff; border-color: #cbd5e1; -webkit-print-color-adjust: exact; print-color-adjust: exact; page-break-inside: avoid; }
}
.rc-comment-label { flex: 0 0 auto; font-size: 12px; font-weight: 700; color: #b45309; background: #fdf3dd; border-radius: 6px; padding: 2px 8px; margin-top: 2px; }
.rc-comment p { margin: 0; font-size: 13.5px; line-height: 1.8; color: #475569; }
.rc-sign { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 22px 16px 6px; color: #475569; font-size: 13.5px; }

/* ---- 成绩条 ---- */
.slip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.slip { background: #fff; border: 1px dashed #cbd5e1; border-radius: 10px; padding: 12px 14px; break-inside: avoid; page-break-inside: avoid; }
.slip-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: #64748b; margin-bottom: 3px; }
.slip-exam { font-weight: 600; color: #3f7fc4; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 6px; }
.slip-name { font-size: 17px; font-weight: 700; color: #1e3a5f; margin-bottom: 8px; }
.slip-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.slip-table th, .slip-table td { border-bottom: 1px solid #f1f5f9; padding: 4px 2px; text-align: left; }
.slip-table th { color: #94a3b8; font-weight: 600; }
.slip-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.slip-total td { border-top: 1px solid #e2e8f0; font-weight: 700; color: #1e3a5f; }
.slip-foot { margin-top: 8px; font-size: 12px; color: #94a3b8; }

/* ---- 成绩条勾选打印 ---- */
.slip-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px solid #eef2f7; }
.slip-toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.slip-pick { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: #64748b; cursor: pointer; flex: 0 0 auto; }
.slip-pick input { accent-color: #3f7fc4; cursor: pointer; }
.slip.slip-checked { border-color: #3f7fc4; }
.slip:not(.slip-checked) { opacity: 0.45; }
@media print {
    body.print-selected .slip:not(.slip-checked) { display: none !important; }
}

/* ---- 智能分组 ---- */
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.group-card { padding: 0; overflow: hidden; }
.group-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 12px 14px 8px; }
.group-card-head h3 { margin: 0; font-size: 15px; color: #1e3a5f; }
.group-stat { font-size: 12.5px; color: #64748b; }
.group-stat b { color: #b45309; }
.group-card .table { font-size: 13px; }
.mini-link { display: inline-block; margin-left: 6px; font-size: 11px; color: #3f7fc4; background: #eef4fb; border-radius: 4px; padding: 0 5px; vertical-align: 2px; }
.mini-link:hover { background: #dbeafe; }

/* ---- 新增页打印优化 ---- */
@media print {
    .rc-actions, .hl-grid { display: none !important; }
    .rc-sheet { box-shadow: none; border: 1px solid #cbd5e1; }
    .slip-grid { grid-template-columns: repeat(2, 1fr); gap: 6mm; }
    .group-grid { grid-template-columns: repeat(2, 1fr); }
    .group-card { break-inside: avoid; page-break-inside: avoid; }
}

/* ---- 成长档案页打印优化 ---- */
@media print {
    .no-print,
    .profiles-toolbar,
    .form-actions,
    .hint { display: none !important; }
    .stat-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
    .grid-2 { grid-template-columns: 1fr; }
    .card { break-inside: avoid; page-break-inside: avoid; }
    .chart-box svg { max-width: 100%; height: auto; }
}
