:root {
    --primary: #1677ff;
    --bg: #f5f7fb;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --card: #ffffff;
    --success: #059669;
    --error: #dc2626;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
}

.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 240px;
    background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 20px 14px;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    padding: 0 6px;
}
.brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(22, 119, 255, 0.18);
    color: #60a5fa;
    flex-shrink: 0;
}
.brand-icon svg { width: 18px; height: 18px; }
.brand-text {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0.02em;
}
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    padding: 0 2px;
}
.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #94a3b8;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.4;
    transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
}
.sidebar-nav-link.is-active {
    background: rgba(22, 119, 255, 0.18);
    color: #fff;
    box-shadow: inset 3px 0 0 #1677ff;
}
.sidebar-nav-link.is-active .sidebar-nav-icon {
    background: rgba(22, 119, 255, 0.28);
    color: #93c5fd;
}
.sidebar-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-nav-link:hover .sidebar-nav-icon {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}
.sidebar-nav-icon svg { width: 18px; height: 18px; }
.sidebar-nav-label { min-width: 0; }
.sidebar-foot {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 14px;
    margin-top: 12px;
}
.sidebar-foot-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 12px;
}
.sidebar-foot-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #93c5fd;
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-foot-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #bfdbfe;
    text-decoration: none;
}
.sidebar-foot-link.is-active {
    background: rgba(22, 119, 255, 0.14);
    color: #bfdbfe;
}
.sidebar-foot-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    opacity: 0.9;
}
.sidebar-foot-icon svg { width: 16px; height: 16px; }
.sidebar-help-link { margin: 0; }
.sidebar-logout-link {
    margin-top: 4px;
    color: #94a3b8;
}
.sidebar-logout-link:hover {
    color: #fca5a5;
    background: rgba(248, 113, 113, 0.1);
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin-bottom: 4px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
}
.sidebar-user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(22, 119, 255, 0.22);
    color: #93c5fd;
    flex-shrink: 0;
}
.sidebar-user-avatar svg { width: 18px; height: 18px; }
.sidebar-user-meta { min-width: 0; }
.sidebar-user-name {
    font-size: 14px;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user-role {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-mp-qrcode {
    position: relative;
}
.sidebar-mp-qrcode-trigger {
    cursor: default;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #93c5fd;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-mp-qrcode-trigger:hover,
.sidebar-mp-qrcode:focus-within .sidebar-mp-qrcode-trigger {
    background: rgba(255, 255, 255, 0.06);
    color: #bfdbfe;
    text-decoration: none;
}
.sidebar-mp-qrcode-popover {
    display: none;
    position: absolute;
    left: calc(100% + 12px);
    bottom: -8px;
    padding: 12px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
    z-index: 200;
    text-align: center;
    line-height: 1.4;
}
.sidebar-mp-qrcode-popover::before {
    content: '';
    position: absolute;
    right: 100%;
    bottom: 20px;
    border: 8px solid transparent;
    border-right-color: #fff;
}
.sidebar-mp-qrcode:hover .sidebar-mp-qrcode-popover,
.sidebar-mp-qrcode:focus-within .sidebar-mp-qrcode-popover {
    display: block;
}
.sidebar-mp-qrcode-popover img {
    display: block;
    width: 160px;
    height: 160px;
    object-fit: contain;
    border-radius: 6px;
}
.sidebar-mp-qrcode-caption {
    margin: 8px 0 0;
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
}
.muted { color: #94a3b8; font-size: 12px; margin-top: 4px; }

.main { flex: 1; padding: 24px; min-width: 0; }
.main-full { width: 100%; }

.page-header { margin-bottom: 20px; }
.page-header h2 { margin: 0 0 8px; }
.page-header p { margin: 0; color: var(--muted); }
.page-header-row {
    align-items: flex-start;
    margin-bottom: 8px;
}
.page-header-row h2 {
    margin: 0;
    flex: 1;
    min-width: 0;
}
.page-header-row .btn-group {
    flex-shrink: 0;
    justify-content: flex-end;
}
.page-header-with-actions {
    position: relative;
}
.page-header-with-actions .page-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
}
.page-header-with-actions h2 {
    margin: 0;
}
.page-header-back {
    flex-shrink: 0;
    white-space: nowrap;
}
.page-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    flex-shrink: 0;
}
.page-header-actions form {
    margin: 0;
}
.identity-switch-current {
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
}
.sidebar-identity-hint {
    font-size: 12px;
    margin-top: 2px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.stat-card, .panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}
.stat-label {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}
.stat-value {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.2;
}
.stats-actions {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.stats-section {
    margin-bottom: 20px;
}
.stats-section-title {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 600;
}
.stats-hint {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--muted);
}
.stats-scope-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #1d4ed8;
    background: #eff6ff;
}
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.stats-table {
    font-size: 13px;
    min-width: 720px;
}
.stats-table th,
.stats-table td {
    white-space: nowrap;
}
.text-muted {
    color: var(--muted);
    text-align: center;
}

.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
    border-bottom: 1px solid var(--border);
    padding: 10px 8px;
    text-align: left;
}
.todo-list { margin: 0; padding-left: 20px; line-height: 1.9; }
.todo-list .done { color: var(--success); }

.dashboard-plans .panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.dashboard-plans .panel-head h3 {
    margin: 0;
}
.dashboard-empty {
    margin: 0;
    padding: 12px 0 4px;
}
.plan-overview-block + .plan-overview-block {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.plan-overview-title {
    margin: 0 0 4px;
    font-size: 16px;
}
.plan-overview-meta {
    margin: 0;
    font-size: 13px;
}
.plan-overview-links {
    font-size: 14px;
    white-space: nowrap;
}
.plan-overview-links a {
    color: var(--primary);
    text-decoration: none;
}
.plan-overview-links a:hover {
    text-decoration: underline;
}
.stats-grid-compact {
    margin-top: 16px;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}
.stats-grid-compact .stat-card {
    padding: 14px 16px;
}
.stats-grid-compact .stat-value {
    font-size: 22px;
}
.plan-class-table-wrap {
    margin-top: 16px;
    overflow-x: auto;
}
.table-compact th,
.table-compact td {
    padding: 8px 10px;
    font-size: 13px;
}

.btn {
    display: inline-block;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    background: #fff;
    color: var(--text);
    text-decoration: none;
    text-align: center;
    line-height: 1.4;
}
.btn:hover { opacity: .92; }
.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.btn-block { width: 100%; }
.form-inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.form-inline input {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    min-width: 160px;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}
.alert-success { background: #ecfdf5; color: var(--success); }
.alert-error { background: #fef2f2; color: var(--error); }
.alert-warn { background: #fffbeb; color: #92400e; border: 1px solid #fcd34d; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

.promote-confirm-modal {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(15, 23, 42, 0.45);
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
.promote-confirm-modal[hidden] { display: none !important; }
.promote-confirm-dialog {
    background: #fff; border-radius: 10px; max-width: 640px; width: 100%;
    max-height: 85vh; overflow: auto; padding: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}
.promote-confirm-dialog h3 { margin: 0 0 16px; }
.promote-confirm-body { font-size: 14px; line-height: 1.65; color: #334155; }
.promote-confirm-list { margin: 8px 0 16px 18px; padding: 0; }
.promote-confirm-list li { margin-bottom: 4px; }
.promote-confirm-warn {
    background: #fef3c7; border-left: 4px solid #f59e0b;
    padding: 10px 12px; margin: 12px 0; border-radius: 4px;
}

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eff6ff, #f8fafc);
}
.login-card {
    width: 420px;
    max-width: 92vw;
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .08);
}
.login-card h1 { margin: 0 0 8px; font-size: 22px; }
.subtitle { color: var(--muted); margin: 0 0 24px; }
.login-card label { display: block; margin: 12px 0 6px; font-size: 14px; }
.login-card input, .login-card select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 4px;
}
.register-card { width: 480px; }
.register-card select { margin-bottom: 8px; }
.hint { margin-top: 16px; font-size: 12px; color: var(--muted); }

.pagination { margin-top: 20px; }
.pagination ul, .pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
    align-items: center;
}
.pagination li { display: inline-flex; }
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .active span, .pagination .current span, .pagination span.current {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.pagination .disabled span { color: var(--muted); background: #f8fafc; }

.class-grade-panel { padding-top: 0; overflow: hidden; }
.grade-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 16px 0;
    border-bottom: 1px solid var(--border);
    margin: 0 -20px 0;
    padding-left: 20px;
    padding-right: 20px;
}
.grade-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    margin-bottom: -1px;
    border: 1px solid transparent;
    border-radius: 8px 8px 0 0;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    transition: color .15s, background .15s;
}
.grade-tab:hover { color: var(--primary); background: #f8fbff; }
.grade-tab.is-active {
    color: var(--primary);
    background: #fff;
    border-color: var(--border);
    border-bottom-color: #fff;
    font-weight: 600;
}
.grade-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 12px;
    font-weight: 600;
}
.grade-tab.is-active .grade-tab-count {
    background: #dbeafe;
    color: var(--primary);
}
.grade-panel { padding-top: 16px; }
.grade-panel-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.btn-sm { padding: 6px 12px; font-size: 13px; }
.class-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}
.class-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    background: #fafafa;
    transition: border-color .15s, box-shadow .15s;
}
.class-card:hover {
    border-color: #bfdbfe;
    box-shadow: 0 4px 12px rgba(22, 119, 255, .08);
}
.class-card-name { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.class-card-meta { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.class-card-link { font-size: 13px; color: var(--primary); text-decoration: none; }
.class-card-link:hover { text-decoration: underline; }
.empty-grade { text-align: center; padding: 40px 16px; }

.class-batch-panel { padding: 24px; }
.class-batch-form { max-width: 720px; }
.class-batch-meta {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.class-batch-meta .form-row { margin-bottom: 0; }
.class-batch-mode-tabs {
    display: inline-flex;
    gap: 0;
    padding: 4px;
    background: #f1f5f9;
    border-radius: 10px;
    border: 1px solid var(--border);
}
.class-batch-mode-tab {
    border: none;
    background: transparent;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    color: #64748b;
    cursor: pointer;
    transition: background .15s, color .15s, box-shadow .15s;
}
.class-batch-mode-tab:hover { color: var(--primary); }
.class-batch-mode-tab.is-active {
    background: #fff;
    color: var(--primary);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
}
.class-batch-mode-pane { margin-bottom: 4px; }
.class-batch-hint { margin-top: 8px; }
.class-batch-hint code {
    padding: 1px 6px;
    background: #f1f5f9;
    border-radius: 4px;
    font-size: 12px;
}
.class-batch-preview-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 13px;
    color: #475569;
}
.class-batch-preview-split { color: #cbd5e1; }
.class-batch-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    max-height: 160px;
    overflow-y: auto;
    padding: 2px;
}
.class-batch-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    font-size: 13px;
    line-height: 1.4;
}
.class-batch-chip.is-dup {
    background: #fffbeb;
    border-color: #fcd34d;
    color: #b45309;
    text-decoration: line-through;
    text-decoration-color: rgba(180, 83, 9, .45);
}
.class-batch-range-grid {
    display: grid;
    grid-template-columns: 120px 120px 1fr;
    gap: 12px;
    align-items: end;
}
.class-batch-range-field { display: flex; flex-direction: column; gap: 6px; }
.class-batch-range-field input { width: 100%; }
.class-batch-range-label { font-size: 13px; color: var(--muted); }
.class-batch-options {
    margin-top: 8px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
}
.class-batch-options .checkbox-item { margin: 0; }
.class-batch-actions { align-items: center; flex-wrap: wrap; }
.class-batch-submit-hint { font-size: 13px; }
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
@media (max-width: 640px) {
    .class-batch-meta { grid-template-columns: 1fr; }
    .class-batch-range-grid { grid-template-columns: 1fr 1fr; }
    .class-batch-range-field-wide { grid-column: 1 / -1; }
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-secondary {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: #f8fafc; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-bar form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filter-bar select, .filter-bar input {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.form-grid { max-width: 640px; }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; margin-bottom: 6px; font-size: 14px; }
.form-row input, .form-row select, .form-row textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
}
.form-row textarea { min-height: 120px; resize: vertical; font-family: inherit; }
.radio-group { display: flex; flex-wrap: wrap; gap: 16px; }
.range-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.range-preview {
    margin-top: 10px; padding: 10px 12px; background: #f8fafc;
    border: 1px solid var(--border); border-radius: 8px; white-space: pre-wrap; font-size: 13px;
}
.form-actions { display: flex; gap: 10px; margin-top: 20px; }
.text-error { color: var(--error); font-size: 13px; }
.text-warn { color: #d97706; font-size: 13px; }
.row-error { background: #fff7f7; }
.checkbox-list { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.checkbox-item { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.checkbox-item-disabled { color: #9ca3af; cursor: not-allowed; }

.test-plan-form-panel { padding: 20px 24px; }
.test-plan-form { max-width: 920px; }
.test-plan-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}
.test-plan-section:last-of-type { border-bottom: none; padding-bottom: 0; }
.test-plan-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.test-plan-section-title {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}
.test-plan-section-head .test-plan-section-title { margin-bottom: 0; }
.test-plan-class-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.test-plan-class-toolbar .muted { font-size: 13px; }
.test-plan-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 20px;
}
.test-plan-field-full { grid-column: 1 / -1; }
.test-plan-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #374151;
}
.test-plan-field input,
.test-plan-field select {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
}
.test-plan-field input:focus,
.test-plan-field select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.test-plan-readonly {
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
    font-size: 14px;
    color: #374151;
}
.test-plan-hint {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    font-size: 13px;
    color: #6b7280;
}
.test-plan-class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 10px;
}
.test-plan-class-card {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.test-plan-class-card:hover:not(.is-disabled) {
    border-color: #93c5fd;
    background: #f8fbff;
}
.test-plan-class-card input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--primary);
}
.test-plan-class-card:has(input:checked) {
    border-color: var(--primary);
    background: #eff6ff;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.08);
}
.test-plan-class-name {
    font-size: 14px;
    color: #111827;
    line-height: 1.2;
}
.test-plan-class-tag {
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 12px;
    white-space: nowrap;
}
.test-plan-class-card.is-disabled {
    cursor: not-allowed;
    background: #f9fafb;
    border-style: dashed;
    color: #9ca3af;
}
.test-plan-class-card.is-disabled .test-plan-class-name { color: #9ca3af; }
.test-plan-actions {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* 体测计划列表：计划卡片 + 操作小卡片 */
.test-plan-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.test-plan-list-pager {
    margin-top: 16px;
}
.test-plan-list-pager .pagination {
    margin-top: 0;
}
.test-plan-card {
    padding: 20px 22px;
}
.test-plan-card-head {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
.test-plan-card-title {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}
.test-plan-card-meta {
    margin: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
}
.tag-active {
    background: #ecfdf5;
    color: #047857;
    font-weight: 500;
}
.tag-muted {
    background: #f3f4f6;
    color: #6b7280;
}
.test-plan-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 10px;
}
.test-plan-action-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fafbfc;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    min-height: 72px;
}
.test-plan-action-card:hover {
    border-color: #93c5fd;
    background: #f0f7ff;
    box-shadow: 0 2px 8px rgba(22, 119, 255, 0.08);
}
.test-plan-action-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    line-height: 1.35;
}
.test-plan-action-desc {
    font-size: 12px;
    line-height: 1.45;
    color: var(--muted);
}
.test-plan-action-card-form {
    padding: 0;
    overflow: hidden;
}
.test-plan-action-card-form:hover {
    border-color: #fca5a5;
    background: #fef2f2;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.08);
}
.test-plan-action-card-btn {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    min-height: 72px;
    padding: 12px 14px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font: inherit;
}
.test-plan-action-card-form .test-plan-action-title {
    color: #dc2626;
}
.test-plan-action-card-form:hover .test-plan-action-title {
    color: #b91c1c;
}

@media (max-width: 720px) {
    .test-plan-fields { grid-template-columns: 1fr; }
    .test-plan-class-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .test-plan-action-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.export-list { display:flex; flex-direction:column; gap:12px; }
.export-item {
    display:flex; justify-content:space-between; align-items:center; gap:16px;
    padding:14px; border:1px solid var(--border); border-radius:8px; background:#fafafa;
}
.export-item p { margin:4px 0 0; }
.tag-warn { background:#fff7ed; color:#c2410c; }
.text-success { color:#15803d; }

.student-workspace {
    display: flex;
    gap: 0;
    min-height: 520px;
    padding: 0;
    overflow: hidden;
}
.student-sidebar {
    width: 240px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    padding: 16px 12px;
    background: #fafafa;
}
.student-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.sidebar-section-title {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 8px;
    font-weight: 600;
}
.sidebar-grade-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}
.sidebar-grade-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    color: #6b7280;
    font-size: 13px;
    cursor: pointer;
}
.sidebar-grade-tab:hover { border-color: #93c5fd; color: var(--primary); }
.sidebar-grade-tab.is-active {
    border-color: var(--primary);
    color: var(--primary);
    background: #eff6ff;
    font-weight: 600;
}
.sidebar-grade-count {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #e5e7eb;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.sidebar-grade-tab.is-active .sidebar-grade-count {
    background: #dbeafe;
    color: var(--primary);
}
.class-nav-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 420px;
    overflow-y: auto;
}
.class-nav-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
}
.class-nav-item:hover { background: #eff6ff; color: var(--primary); }
.class-nav-item.is-opened { background: #f0f9ff; }
.class-nav-item.is-active {
    background: #fff;
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}
.class-nav-empty { padding: 12px 8px; font-size: 13px; }
.work-tab-bar {
    display: flex;
    gap: 4px;
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
    overflow-x: auto;
    min-height: 44px;
    align-items: flex-end;
}
.work-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    background: #eef2f7;
    color: #6b7280;
    cursor: pointer;
    white-space: nowrap;
    margin-bottom: -1px;
}
.work-tab.is-active {
    background: #fff;
    color: var(--primary);
    border-color: var(--border);
    font-weight: 600;
}
.work-tab-close {
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 16px;
    line-height: 1;
    padding: 0 2px;
    cursor: pointer;
}
.work-tab-close:hover { color: var(--error); }
.work-panels {
    flex: 1;
    padding: 16px;
    position: relative;
}
.work-panel { display: none; }
.work-panel.is-active { display: block; }
.work-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 360px;
}
.work-panel-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.work-search-form {
    display: flex;
    gap: 8px;
    align-items: center;
}
.work-search-form input {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    min-width: 180px;
}
.work-loading { padding: 40px 16px; text-align: center; }
.work-pagination {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}
.work-panel-toolbar .btn-sm + .btn-sm { margin-left: 8px; }

.student-workspace .table.student-list-table {
    font-size: 13px;
}
.student-workspace .table.student-list-table th,
.student-workspace .table.student-list-table td {
    padding: 8px 10px;
}
.student-workspace .table.student-list-table .col-check {
    width: 36px;
    text-align: center;
}
.student-workspace .table.student-list-table .row-actions {
    white-space: nowrap;
}
.student-workspace .table.student-list-table .row-actions a + a,
.student-workspace .table.student-list-table .row-actions a + button,
.student-workspace .table.student-list-table .row-actions button + a,
.student-workspace .table.student-list-table .row-actions button + button {
    margin-left: 6px;
}
.student-workspace .table.student-list-table .row-actions .student-change-action {
    background: none;
    border: none;
    padding: 0;
    color: #2563eb;
    cursor: pointer;
    font: inherit;
}
.student-workspace .table.student-list-table .row-actions .student-change-action.is-warn {
    color: #ea580c;
}
.student-workspace .table.student-list-table .row-actions .pending-tag {
    color: #92400e;
    font-size: 12px;
}

.student-change-modal {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(15, 23, 42, 0.45);
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
.student-change-modal[hidden] { display: none !important; }
.student-change-dialog {
    background: #fff; border-radius: 10px; max-width: 480px; width: 100%;
    max-height: 85vh; overflow: auto; padding: 20px 22px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}
.student-change-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 8px;
}
.student-change-head h3 { margin: 0; font-size: 18px; }
.student-change-close {
    border: none; background: transparent; font-size: 22px; line-height: 1;
    color: #64748b; cursor: pointer; padding: 0 4px;
}
.student-change-hint { margin: 0 0 12px; font-size: 13px; }
.student-change-label {
    display: block; margin: 10px 0 6px; font-size: 13px; color: #334155;
}
.student-change-input {
    width: 100%; box-sizing: border-box;
    padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
    font: inherit;
}
.student-change-subhint { margin: 8px 0 0; font-size: 12px; }
.student-change-foot {
    display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px;
}

.student-batch-form textarea {
    min-height: 280px;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
}
.batch-format-hint {
    margin-top: 10px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
}
.batch-format-hint ul { margin: 8px 0 8px 18px; }
.batch-format-hint code {
    background: #eef2ff;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.student-entry-panel { padding: 24px; }
.student-entry-form { max-width: 920px; }
.student-form-grid {
    display: grid;
    gap: 16px 20px;
    margin-bottom: 16px;
}
.student-form-grid .form-row { margin-bottom: 0; }
.student-form-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.student-form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.student-form-grid-full { grid-column: 1 / -1; }
@media (max-width: 768px) {
    .student-form-grid-2,
    .student-form-grid-3 { grid-template-columns: 1fr; }
}
.student-entry-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.student-entry-meta .form-row { margin-bottom: 0; }
.student-entry-hint-panel {
    margin-top: 20px;
    padding: 16px 18px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.65;
}
.student-entry-hint-panel h4 {
    margin: 0 0 10px;
    font-size: 14px;
}
.student-entry-hint-panel ul {
    margin: 8px 0 10px 18px;
}
.student-entry-hint-panel li + li { margin-top: 4px; }
.student-entry-hint-panel .hint-note {
    margin: 10px 0 0;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
    color: var(--muted);
    font-size: 12px;
}
.student-form-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.student-form-section:last-of-type { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.student-form-section-title {
    margin: 0 0 14px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}
.student-form-options {
    margin-top: 8px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
}
.student-form-options .checkbox-item { margin: 0; }
.student-import-upload-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 32px 20px;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    text-align: center;
    transition: border-color .15s, background .15s;
}
.student-import-upload-box:hover,
.student-import-upload-box.is-dragover {
    border-color: #93c5fd;
    background: #eff6ff;
}
.student-import-upload-box input[type="file"] {
    max-width: 100%;
}
.student-import-upload-icon {
    font-size: 28px;
    line-height: 1;
    color: #64748b;
}
.student-import-upload-text { font-size: 14px; color: #475569; }
.student-import-upload-sub { font-size: 12px; color: var(--muted); }
.student-import-guide {
    margin-top: 16px;
}
.student-import-guide h3 {
    margin: 0 0 12px;
    font-size: 15px;
}
.student-import-field-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin: 12px 0 16px;
}
.student-import-field-table th,
.student-import-field-table td {
    border: 1px solid var(--border);
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
}
.student-import-field-table th {
    background: #eff6ff;
    font-weight: 600;
}
.student-import-field-table .col-required { white-space: nowrap; width: 88px; }
.student-import-warn-list {
    margin: 0;
    padding-left: 18px;
    color: #b45309;
}
.student-import-warn-list li + li { margin-top: 6px; }

.form-row-inline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-row-inline > div label { display: block; margin-bottom: 6px; font-size: 14px; }
.form-row-inline > div select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
}
.readonly-field {
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-weight: 600;
}

.score-batch-toolbar { margin-bottom: 16px; }
.score-batch-pager-bar { margin-bottom: 12px; align-items: center; gap: 12px; }
.score-batch-pager-bar .pagination { margin-top: 0; }
.scores-view-pager { margin-top: 0; }

.teacher-assign-intro ul { margin: 8px 0 0 18px; line-height: 1.7; }
.assign-tab-bar { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 1px solid #e5e7eb; padding-bottom: 12px; }
.assign-tab { border: 1px solid #e5e7eb; background: #fff; padding: 8px 16px; border-radius: 6px; cursor: pointer; }
.assign-tab.active { background: var(--primary, #2563eb); color: #fff; border-color: var(--primary, #2563eb); }
.assign-tab-pane { display: none; }
.assign-tab-pane.active { display: block; }
.assign-grade-block { margin-bottom: 20px; }
.assign-grade-block h4 { margin: 0 0 10px; font-size: 15px; }
.assign-class-grid { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.assign-class-item { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.assign-class-item.is-disabled { opacity: 0.55; cursor: not-allowed; }
.assign-gender-table { max-width: 720px; }
.assign-elective-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.assign-elective-list { min-height: 80px; }
.tag { font-style: normal; font-size: 12px; padding: 1px 6px; border-radius: 4px; }
.tag-warn { background: #fef3c7; color: #92400e; }
.tag-admin { background: #dbeafe; color: #1d4ed8; font-weight: 600; }
.row-admin { background: #f8fbff; }
.btn-sm { padding: 4px 10px; font-size: 13px; }

.stats-target-panel .target-input { width: 90px; padding: 6px 8px; }
.stats-subtitle { margin: 20px 0 10px; font-size: 15px; }
.text-warn { color: #b45309; font-weight: 600; }
.stats-compare-panel h3 { margin-top: 0; }
.adjust-change-line { font-size: 13px; line-height: 1.5; }
.adjust-failure-list { margin: 0; padding-left: 18px; color: #64748b; }
.adjust-progress {
    height: 12px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin: 12px 0 8px;
}
.adjust-progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #1677ff, #36cfc9);
    border-radius: 999px;
    transition: width 0.35s ease;
}
.adjust-result-area[hidden],
#applyPanel[hidden],
#applyProgressWrap[hidden] {
    display: none !important;
}

.score-paste-panel { margin-bottom: 16px; }
.score-paste-summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--primary);
    padding: 4px 0;
}
.score-paste-body { margin-top: 12px; }
.score-paste-body textarea {
    width: 100%;
    min-height: 140px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 13px;
    resize: vertical;
}
.score-paste-body .form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}
.score-paste-form.form-grid { max-width: none; }
.score-paste-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
    gap: 16px;
    align-items: stretch;
}
.score-paste-input-row > label {
    grid-column: 1 / -1;
}
.score-paste-limit-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-bottom: 14px;
    padding: 10px 14px;
    background: #fff7ed;
    border: 1px solid #fdba74;
    border-radius: 8px;
    font-size: 13px;
    color: #9a3412;
}
.score-paste-limit-banner strong {
    color: #c2410c;
    font-size: 14px;
}
.score-paste-input-main {
    min-width: 0;
}
.score-paste-row-counter {
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--muted, #6b7280);
}
.score-paste-row-counter.is-over {
    color: #dc2626;
    font-weight: 600;
}
.score-paste-input-row > .score-paste-input-main > textarea {
    min-width: 0;
    width: 100%;
    min-height: 280px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
}
.score-paste-side-hint {
    margin-top: 0;
    height: 100%;
    max-height: 420px;
    overflow-y: auto;
    font-size: 12px;
}
.score-paste-side-hint ul {
    margin: 8px 0 0 16px;
    padding: 0;
}
.score-paste-side-hint li {
    margin-bottom: 6px;
}
@media (max-width: 960px) {
    .score-paste-input-row {
        grid-template-columns: 1fr;
    }
    .score-paste-side-hint {
        max-height: none;
    }
}
.batch-preview-panel {
    min-width: 0;
    overflow: hidden;
}
.score-paste-map-panel {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--border);
}
.score-paste-map-summary {
    margin-bottom: 12px;
}
.score-paste-map-summary p {
    margin: 0 0 8px;
    font-size: 13px;
}
.score-paste-header-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
}
.score-paste-map-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    -webkit-overflow-scrolling: touch;
}
.score-paste-map-wrap:focus {
    outline: 2px solid rgba(37, 99, 235, 0.35);
    outline-offset: 1px;
}
.score-paste-map-table {
    width: max-content;
    min-width: 100%;
    margin: 0;
    font-size: 13px;
    border-collapse: separate;
    border-spacing: 0;
}
.score-paste-map-table th,
.score-paste-map-table td {
    vertical-align: top;
    padding: 8px 10px;
    min-width: 96px;
    max-width: 140px;
    border-bottom: 1px solid var(--border);
}
.score-paste-map-table th:first-child,
.score-paste-map-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 72px;
    max-width: 88px;
    background: #fff;
    box-shadow: 1px 0 0 var(--border);
}
.score-paste-map-table thead th {
    background: #f8fafc;
}
.score-paste-map-table thead th:first-child {
    z-index: 3;
}
.score-paste-map-table .paste-col-map select {
    width: 100%;
    min-width: 108px;
    max-width: 132px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
}
.score-paste-map-table .paste-col-header {
    font-size: 12px;
    color: var(--muted, #666);
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.score-paste-map-table .paste-col-sample {
    font-family: Consolas, 'Courier New', monospace;
    font-size: 12px;
    color: var(--text-secondary, #444);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.score-class-switch { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.score-class-switch select {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    min-width: 160px;
}
.test-record-students-wrap { padding: 0; }
.test-record-students-table { font-size: 13px; }
.test-record-students-table th,
.test-record-students-table td {
    padding: 8px 12px;
}
.test-record-students-table td a { font-size: 13px; }
.page-header-compact h2 { font-size: 1.25rem; margin-bottom: 4px; }
.page-header-compact p { font-size: 13px; margin: 2px 0; }
.score-entry-panel { padding: 14px 18px; }
.score-entry-form.form-grid { max-width: none; }
.score-entry-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.score-entry-row-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 16px;
}
.score-entry-row-bmi {
    max-width: 280px;
}
.score-entry-row-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
}
.score-entry-field { margin-bottom: 0; }
.score-entry-form label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    color: #374151;
}
.score-entry-input {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    color: #111827;
    -moz-appearance: textfield;
    appearance: textfield;
}
.score-entry-input::-webkit-outer-spin-button,
.score-entry-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.score-entry-input.is-invalid {
    border-color: #dc2626;
    background: #fef2f2;
}
.score-entry-readonly {
    padding: 6px 8px;
    font-size: 13px;
    min-height: 31px;
    box-sizing: border-box;
}
.score-entry-hint {
    font-size: 12px;
    margin: 0;
}
.score-entry-actions {
    margin-top: 4px;
    margin-bottom: 0;
}
@media (max-width: 640px) {
    .score-entry-row-3,
    .score-entry-row-2 {
        grid-template-columns: 1fr;
    }
    .score-entry-row-bmi { max-width: none; }
}
.score-grid-wrap { overflow-x: auto; padding: 0; }
.score-grid-table { min-width: 960px; font-size: 13px; }
.score-grid-table th, .score-grid-table td {
    white-space: nowrap;
    vertical-align: middle;
    text-align: center;
}
.score-grid-table .sticky-col {
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 1;
    box-shadow: 2px 0 4px rgba(0,0,0,.04);
}
.score-grid-table thead .sticky-col { background: #fafafa; }
.score-grid-table .col-seq {
    width: 56px;
    color: #6b7280;
}
.score-grid-input {
    width: 72px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    color: #111827;
    text-align: center;
    -moz-appearance: textfield;
    appearance: textfield;
}
.score-grid-input::placeholder {
    color: #cbd5e1;
    opacity: 1;
}
.score-grid-input::-webkit-input-placeholder {
    color: #cbd5e1;
}
.score-grid-input::-moz-placeholder {
    color: #cbd5e1;
    opacity: 1;
}
.score-grid-input::-webkit-outer-spin-button,
.score-grid-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.score-grid-input.is-invalid {
    border-color: #dc2626;
    background: #fef2f2;
}
.score-na {
    display: inline-block;
    width: 72px;
    text-align: center;
    color: #cbd5e1;
}
.score-cell-wrap {
    min-width: 96px;
    vertical-align: top;
}
.score-attempt-hint {
    font-size: 11px;
    line-height: 1.35;
    color: #059669;
    margin-top: 4px;
    max-width: 120px;
    word-break: break-all;
}
.score-attempt-hint.muted {
    color: #9ca3af;
}
.score-best-readonly {
    display: inline-block;
    min-width: 72px;
    padding: 6px 8px;
    background: #f3f4f6;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

/* 按班/按场表格录入：紧凑列宽，尽量一屏显示全部项目 */
.score-batch-form .score-grid-table {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
    font-size: 12px;
}
.score-batch-form .score-grid-table th,
.score-batch-form .score-grid-table td {
    padding: 4px 2px;
    white-space: nowrap;
}
.score-batch-form .score-grid-table th {
    white-space: normal;
    line-height: 1.2;
    font-size: 11px;
    font-weight: 600;
    vertical-align: bottom;
}
.score-batch-form .score-grid-table th .muted {
    font-size: 10px;
    font-weight: 400;
}
.score-batch-form .score-grid-table .col-class {
    width: 34px;
    max-width: 38px;
    font-size: 11px;
    padding-left: 4px;
    padding-right: 4px;
}
.score-batch-form .score-grid-table .col-seq {
    width: 28px;
    font-size: 11px;
    color: #6b7280;
}
.score-batch-form .score-grid-table .sticky-col {
    left: 0;
    width: 48px;
    min-width: 0;
    max-width: 48px;
    padding-left: 4px;
    padding-right: 2px;
    font-size: 12px;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
}
.score-batch-form .score-grid-table .col-gender {
    width: 24px;
    padding-left: 1px;
    padding-right: 1px;
    font-size: 11px;
}
.score-batch-form .score-grid-table .score-col-item {
    width: 48px;
    max-width: 52px;
}
.score-batch-form .score-grid-table .col-meta {
    font-size: 11px;
    padding-left: 2px;
    padding-right: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.score-batch-form .score-grid-table .col-meta.col-score {
    width: 36px;
    max-width: 40px;
}
.score-batch-form .score-grid-table .col-meta.col-grade {
    width: 32px;
    max-width: 36px;
}
.score-batch-form .score-grid-table th.col-meta:not(.col-score):not(.col-grade),
.score-batch-form .score-grid-table td.col-meta:not(.col-score):not(.col-grade) {
    width: 40px;
    max-width: 44px;
}
.score-batch-form .score-grid-input {
    width: 46px;
    max-width: 100%;
    padding: 3px 1px;
    font-size: 12px;
    border-radius: 4px;
}
.score-batch-form .score-na {
    width: 46px;
    font-size: 12px;
}
.score-batch-form .score-cell-wrap {
    min-width: 0;
    width: 50px;
    max-width: 52px;
    padding: 2px 1px;
}
.score-batch-form .score-best-readonly {
    min-width: 0;
    width: 46px;
    padding: 3px 1px;
    font-size: 12px;
    border-radius: 4px;
}
.score-batch-form .score-grid-wrap {
    padding: 0;
}

.scores-view-tabs {
    padding: 16px 20px;
    margin-bottom: 20px;
}
.scores-tab-bar {
    display: inline-flex;
    gap: 0;
    padding: 4px;
    background: #f1f5f9;
    border-radius: 10px;
    border: 1px solid var(--border);
}
.scores-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    min-height: 40px;
    padding: 0 24px;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    border-radius: 8px;
    transition: all .15s ease;
}
.scores-tab:hover {
    color: #334155;
    background: rgba(255, 255, 255, 0.7);
}
.scores-tab.active {
    color: #fff;
    font-weight: 600;
    background: var(--primary);
    box-shadow: 0 2px 8px rgba(22, 119, 255, 0.28);
}
.scores-completion-panel {
    padding: 0;
    overflow: hidden;
}
.scores-completion-table {
    min-width: 860px;
    font-size: 13px;
}
.scores-completion-table th,
.scores-completion-table td {
    padding: 8px 10px;
    vertical-align: middle;
    text-align: center;
    white-space: nowrap;
}
.scores-completion-table .sticky-col {
    position: sticky;
    left: 0;
    z-index: 1;
    text-align: left;
    min-width: 120px;
    background: #fff;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.04);
}
.scores-completion-table thead .sticky-col {
    background: #fafafa;
}
.scores-comp-class {
    font-weight: 600;
    color: #0f172a;
}
.scores-completion-table .col-num {
    width: 52px;
    color: var(--muted);
}
.scores-completion-table .col-status {
    width: 96px;
}
.scores-comp-cell {
    min-width: 72px;
}
.scores-comp-ratio {
    display: inline-block;
    font-weight: 700;
    font-size: 13px;
}
.scores-comp-ratio.is-done {
    color: #059669;
}
.scores-comp-ratio.is-pending {
    color: #1677ff;
}
.scores-comp-pending {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: #ea580c;
}
.scores-pending-badge,
.scores-done-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.scores-pending-badge {
    color: #c2410c;
    background: #ffedd5;
}
.scores-done-badge {
    color: #047857;
    background: #d1fae5;
}
.scores-student-panel {
    padding: 0;
}
.scores-student-table th,
.scores-student-table td {
    padding: 6px 8px;
    line-height: 1.25;
}
.scores-student-table .col-seq {
    width: 56px;
}
.scores-student-table .col-grade {
    width: 72px;
}
.scores-student-table .col-class {
    width: 72px;
}
.scores-student-table .col-gender {
    width: 44px;
}
.scores-score-cell {
    min-width: 68px;
    vertical-align: middle;
}
.scores-score-cell .scores-cell-value {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}
.scores-score-cell .scores-cell-points {
    display: block;
    margin-top: 1px;
    font-size: 11px;
    font-weight: 600;
    color: #059669;
    line-height: 1.2;
}
.scores-score-cell .scores-cell-bonus {
    display: block;
    margin-top: 1px;
    font-size: 11px;
    font-weight: 600;
    color: #2563eb;
    line-height: 1.2;
}
.scores-score-cell.is-missing .scores-cell-value {
    color: #ea580c;
}
.scores-score-cell.is-missing {
    background: #fffbeb;
}
.scores-score-cell.is-filled {
    background: #f8fafc;
}
@media (max-width: 900px) {
    .scores-tab-bar {
        display: flex;
        width: 100%;
    }
    .scores-tab {
        flex: 1;
        min-width: 0;
        padding: 0 12px;
    }
}
.batch-preview-summary { margin-bottom: 16px; }
.batch-preview-summary h3 { margin: 0 0 8px; }
.batch-preview-summary p { margin: 0; }
.batch-preview-table { font-size: 13px; }
.batch-preview-table .raw-line-cell {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 12px;
}
.batch-preview-table .hint-cell { min-width: 220px; }

.batch-class-map-panel {
    margin-bottom: 20px;
    padding: 16px;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    background: #f8fbff;
}
.batch-class-map-head h4 { margin: 0 0 6px; }
.batch-class-map-head .hint { margin: 0 0 12px; }
.batch-class-map-table { margin-bottom: 12px; background: #fff; }
.batch-class-map-table th,
.batch-class-map-table td { vertical-align: middle; }
.batch-class-map-select {
    min-width: 220px;
    max-width: 100%;
}
.batch-class-map-current { margin-top: 4px; font-size: 12px; }
.batch-class-map-actions { margin: 0; padding-top: 0; }
.batch-lines-limit { margin: 0 0 8px; }
.batch-preview-actions {
    margin: 0 0 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border, #e5e7eb);
}

.teacher-entry-panel { padding-top: 0; }
.teacher-entry-tabs {
    display: flex;
    gap: 0;
    margin: 0;
    border-bottom: 1px solid var(--border, #e5e7eb);
    padding: 0;
}
.teacher-tab {
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--muted, #64748b);
    border-radius: 0;
    padding: 12px 20px;
    margin-bottom: -1px;
    cursor: pointer;
    font-size: 14px;
}
.teacher-tab:hover {
    color: var(--text, #334155);
    background: #f8fafc;
}
.teacher-tab.is-active {
    background: #fff;
    border-bottom-color: #2563eb;
    color: #2563eb;
    font-weight: 600;
}
.teacher-entry-body {
    padding: 16px 0 4px;
}
.teacher-entry-panel .teacher-entry-section {
    display: none;
}
.teacher-entry-panel .teacher-entry-section.is-active {
    display: block;
}
.teacher-entry-panel .teacher-entry-section[hidden] {
    display: none !important;
}
.teacher-batch-intro { margin: 0 0 12px; }
.teacher-batch-form textarea {
    width: 100%;
    min-height: 180px;
    font-family: inherit;
}
.teacher-batch-meta input[type="text"] {
    width: 120px;
    max-width: 100%;
}
.teacher-single-form input[type="text"],
.teacher-single-form input[type="password"] {
    min-width: 140px;
}

.coverage-panel { margin-top: 16px; }
.coverage-stats { grid-template-columns: repeat(4, minmax(120px, 1fr)); margin-bottom: 16px; }
.coverage-legend { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.coverage-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
.coverage-table { min-width: 920px; margin: 0; font-size: 12px; }
.coverage-table th, .coverage-table td { text-align: center; padding: 6px 4px; }
.coverage-table .cov-sticky {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
    text-align: left;
    min-width: 96px;
    box-shadow: 2px 0 4px rgba(0,0,0,.04);
}
.coverage-table thead .cov-sticky { background: #fafafa; }
.coverage-table .cov-subhead th { font-size: 11px; font-weight: 500; color: var(--muted); padding-top: 0; }
.coverage-table .cov-item-name { font-weight: 600; white-space: nowrap; }
.cov-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    cursor: default;
}
.cov-ok { background: #dcfce7; color: #15803d; }
.cov-partial { background: #fef9c3; color: #a16207; }
.cov-missing { background: #fee2e2; color: #dc2626; }
.cov-na { background: #f1f5f9; color: #94a3b8; }
.coverage-missing { margin-top: 12px; }
.coverage-missing summary { cursor: pointer; font-weight: 600; color: #b45309; }
.coverage-missing-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.coverage-missing-tag {
    display: inline-block;
    padding: 4px 10px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 999px;
    font-size: 12px;
    color: #9a3412;
}

.btn-danger {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}
.btn-danger:hover { background: #fecaca; }
.score-manage-table { font-size: 13px; }
.score-manage-actions { white-space: nowrap; }
.score-manage-actions a { margin-right: 10px; }
.inline-form { display: inline; }
.btn-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--primary);
    cursor: pointer;
    font: inherit;
    text-decoration: none;
}
.btn-link.text-error { color: var(--error); }
.btn-link:hover { text-decoration: underline; }
.table-actions form.inline-form { margin: 0; }
.link-btn {
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    font-size: 13px;
    color: #1677ff;
}
.link-danger { color: #dc2626; }
.cov-link { text-decoration: none; }
.cov-link:hover .cov-cell { box-shadow: 0 0 0 2px rgba(22,119,255,.25); }

.feature-notice-modal {
    position: fixed; inset: 0; z-index: 1100;
    background: rgba(15, 23, 42, 0.45);
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
.feature-notice-modal[hidden] { display: none !important; }
.feature-notice-dialog {
    background: #fff; border-radius: 10px; max-width: 680px; width: 100%;
    max-height: 85vh; overflow: auto; padding: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}
.feature-notice-dialog h3 { margin: 0 0 16px; font-size: 18px; }
.feature-notice-body { font-size: 14px; line-height: 1.7; color: #334155; }
.feature-notice-list { margin: 0; padding-left: 1.25em; }
.feature-notice-list li { margin-bottom: 10px; }
.feature-notice-list li:last-child { margin-bottom: 0; }
.feature-notice-dialog .form-actions { margin-top: 20px; justify-content: flex-end; align-items: center; gap: 16px; }
.feature-notice-guide-link {
    color: #1677ff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}
.feature-notice-guide-link:hover { text-decoration: underline; }
.feature-notice-dialog .btn[disabled] {
    opacity: 0.65;
    cursor: not-allowed;
}

.membership-card {
    margin-bottom: 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.membership-card__hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    background: linear-gradient(135deg, #ecfdf5 0%, #eff6ff 55%, #f8fafc 100%);
    border-bottom: 1px solid var(--border);
}
.membership-card__hero-main {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.membership-card__badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    padding: 8px 12px;
    border-radius: 10px;
    background: linear-gradient(135deg, #10b981, #0d9488);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}
.membership-card__hero-text { min-width: 0; }
.membership-card__title {
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
}
.membership-card__desc {
    margin: 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}
.membership-card__desc strong { color: #0f172a; }
.membership-card__dot { margin: 0 4px; }
.membership-card__upgrade { flex-shrink: 0; }
.membership-card__stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
    border-bottom: 1px solid var(--border);
}
.membership-mini-stat {
    padding: 14px 16px;
    background: #fff;
    text-align: center;
}
.membership-mini-stat__value {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}
.membership-mini-stat__label {
    margin-top: 4px;
    font-size: 12px;
    color: #94a3b8;
}
.membership-card__section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px 0;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}
.membership-card__warn {
    font-size: 12px;
    font-weight: 600;
    color: #d97706;
    background: #fffbeb;
    padding: 3px 10px;
    border-radius: 999px;
}
.membership-grade-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    padding: 14px 20px 20px;
}
.membership-grade-item {
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fafbfc;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.membership-grade-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}
.membership-grade-item--warn {
    border-color: #fde68a;
    background: #fffbeb;
}
.membership-grade-item--danger {
    border-color: #fecaca;
    background: #fef2f2;
}
.membership-grade-item__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}
.membership-grade-item__name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}
.membership-grade-item__count {
    font-size: 14px;
    color: #0f172a;
    white-space: nowrap;
}
.membership-grade-item__limit {
    font-size: 12px;
    font-weight: 400;
    color: #94a3b8;
}
.membership-grade-item__track {
    height: 8px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}
.membership-grade-item__fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #34d399, #10b981);
    min-width: 2px;
    transition: width 0.3s ease;
}
.membership-grade-item--warn .membership-grade-item__fill {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
}
.membership-grade-item--danger .membership-grade-item__fill {
    background: linear-gradient(90deg, #f87171, #ef4444);
}
.membership-grade-item__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: #94a3b8;
}
.membership-grade-item__status {
    color: #dc2626;
    font-weight: 600;
}
.membership-card__empty {
    margin: 0;
    padding: 8px 20px 20px;
    font-size: 13px;
}
@media (max-width: 768px) {
    .membership-card__hero {
        flex-direction: column;
        align-items: stretch;
    }
    .membership-card__upgrade { width: 100%; text-align: center; }
    .membership-card__stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .membership-grade-grid {
        grid-template-columns: 1fr;
    }
}

