:root {
    --ink: #172033;
    --ink-soft: #445066;
    --paper: #f7f5ef;
    --panel: #ffffff;
    --line: #d9dee8;
    --line-strong: #b9c3d3;
    --navy: #213a5c;
    --navy-deep: #13243b;
    --seal: #b43f35;
    --seal-dark: #8f2f27;
    --cyan: #2e8f9a;
    --cyan-soft: #dff1f2;
    --green: #2f8a57;
    --amber: #a76821;
    --danger: #b83232;
    --shadow: 0 18px 45px rgba(24, 35, 58, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--paper);
    color: var(--ink);
    font-size: 16px;
}

body {
    margin: 0;
    min-width: 320px;
    font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
    background:
        linear-gradient(90deg, rgba(19, 36, 59, 0.05) 1px, transparent 1px),
        linear-gradient(180deg, rgba(19, 36, 59, 0.04) 1px, transparent 1px),
        var(--paper);
    background-size: 26px 26px;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
.btn,
.btn-add,
.add-btn,
.save-btn,
.cancel-btn,
.import-btn,
.upload-btn,
.btn-primary,
.btn-secondary,
.btn-danger,
.info-btn,
.warning-btn,
.success-btn,
.delete-btn,
.select-all-btn,
.btn-clear,
.btn-action,
.add-teacher-btn {
    min-height: 36px;
    border: 0;
    border-radius: 6px;
    padding: 8px 14px;
    color: #fff;
    background: var(--navy);
    cursor: pointer;
    font-weight: 700;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: none;
    transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

button:hover,
.btn:hover,
.add-btn:hover,
.save-btn:hover,
.import-btn:hover,
.upload-btn:hover,
.btn-primary:hover,
.btn-secondary:hover,
.info-btn:hover,
.success-btn:hover,
.add-teacher-btn:hover {
    background: var(--navy-deep);
    transform: translateY(-1px);
}

button:disabled,
.btn:disabled,
.btn-danger:disabled,
.delete-btn:disabled {
    cursor: not-allowed;
    opacity: 0.45;
    transform: none;
}

.btn-primary,
.btn-add,
.add-btn,
.save-btn,
.success-btn,
.import-btn,
.upload-btn,
.add-teacher-btn {
    background: var(--green);
}

.btn-primary:hover,
.btn-add:hover,
.add-btn:hover,
.save-btn:hover,
.success-btn:hover,
.import-btn:hover,
.upload-btn:hover,
.add-teacher-btn:hover {
    background: #226f44;
}

.btn-danger,
.delete-btn,
.btn-action.btn-delete {
    background: var(--danger);
}

.btn-danger:hover,
.delete-btn:hover,
.btn-action.btn-delete:hover {
    background: #922727;
}

.btn-secondary,
.cancel-btn,
.select-all-btn,
.btn-clear {
    background: #667085;
}

.warning-btn,
.btn-action.btn-disable {
    background: var(--amber);
}

.info-btn,
.btn-action.btn-edit,
.btn-action.btn-enable {
    background: var(--cyan);
}

input,
select,
textarea {
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    padding: 8px 10px;
    color: var(--ink);
    background: #fff;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(46, 143, 154, 0.16);
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
}

.main-nav {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 20px 16px;
    background: linear-gradient(180deg, var(--navy-deep), #1d3454);
    color: #fff;
    box-shadow: 8px 0 28px rgba(19, 36, 59, 0.16);
    z-index: 100;
    overflow-y: auto;
}

.brand-panel {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 12px;
    align-items: center;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.brand-mark {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border: 2px solid rgba(255, 255, 255, 0.72);
    border-radius: 6px;
    background: var(--seal);
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 0;
}

.brand-title {
    font-size: 18px;
    font-weight: 900;
    line-height: 1.2;
}

.brand-subtitle,
.nav-group-label,
.server-card-title,
.server-muted {
    color: rgba(255, 255, 255, 0.68);
    font-size: 12px;
}

.nav-group-label {
    margin: 0 0 8px 8px;
    font-weight: 700;
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.main-nav li {
    margin: 0;
}

.main-nav a {
    min-height: 42px;
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 700;
    letter-spacing: 0;
}

.main-nav a::before {
    content: "";
    width: 8px;
    height: 8px;
    margin-right: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
}

.main-nav a:hover,
.main-nav a.router-link-active {
    color: #fff;
    background: rgba(255, 255, 255, 0.11);
}

.main-nav a.router-link-active::before {
    background: var(--seal);
    box-shadow: 0 0 0 4px rgba(180, 63, 53, 0.25);
}

.server-card {
    margin-top: 28px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
}

.server-card-title {
    margin-bottom: 10px;
    font-weight: 900;
}

.server-counts {
    display: grid;
    gap: 6px;
    font-size: 13px;
}

.server-error {
    color: #ffd0cc;
    font-size: 13px;
}

.workbench {
    min-width: 0;
}

.topbar {
    min-height: 104px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    padding: 22px 32px;
    background: rgba(247, 245, 239, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 80;
}

.topbar-identity {
    flex: 0 0 auto;
    min-width: 340px;
}

.topbar-kicker {
    color: var(--seal);
    font-size: 13px;
    font-weight: 900;
    margin-bottom: 4px;
}

.topbar h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.2;
    letter-spacing: 0;
}

.topbar-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex: 1 1 auto;
    min-width: 420px;
    flex-wrap: wrap;
}

.plan-switcher {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 500px;
    max-width: 700px;
    padding: 10px 12px;
    border: 1px solid var(--line-strong);
    border-left: 5px solid var(--seal);
    border-radius: 8px;
    background: linear-gradient(180deg, #fff, #f8fafc);
    color: var(--ink-soft);
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(19, 36, 59, 0.1);
}

.plan-switcher-label {
    color: var(--seal);
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
    flex: 0 0 auto;
}

.plan-switcher select {
    flex: 1 1 auto;
    min-width: 260px;
    max-width: none;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0 8px;
    background: #fff;
    color: var(--ink);
    font-weight: 700;
}

.topbar-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    color: var(--green);
    font-weight: 800;
    white-space: nowrap;
}

.topbar-status.error {
    color: var(--danger);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.container {
    max-width: 1480px;
    margin: 0 auto;
    padding: 28px 32px 56px;
}

.page,
.section,
.exam-management,
.exam-plan-management,
.blue-tabs .tab-content,
.dialog-content,
.stats-panel,
.exam-info,
.filter-section,
.assignment-options,
.progress-container,
.paste-import-area,
.upload-box,
.exam-assignment,
.add-form {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}

.page,
.exam-management,
.exam-plan-management {
    padding: 24px;
}

.section,
.exam-info,
.filter-section,
.assignment-options,
.progress-container,
.paste-import-area,
.upload-box,
.exam-assignment,
.add-form {
    padding: 18px;
    margin-bottom: 18px;
}

.page h1,
.page h2,
.section h2,
.section-header h2,
.header-section h2,
.exam-plan-management h2 {
    margin: 0 0 18px;
    color: var(--ink);
    font-weight: 900;
    letter-spacing: 0;
}

.page h1,
.header-section h2,
.exam-plan-management h2 {
    font-size: 24px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--seal);
    width: fit-content;
}

.section h2,
.section-header h2 {
    font-size: 18px;
}

.header-section,
.section-header,
.list-header-row,
.table-operations,
.toolbar,
.data-actions,
.control-section,
.action-bar,
.header-actions,
.filter-section,
.stats-panel {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.header-section,
.section-header,
.list-header-row {
    justify-content: space-between;
}

.summary-info,
.file-info,
.info-label,
.stat-label,
.list-stats,
.teacher-dept {
    color: var(--ink-soft);
}

.stats-panel {
    justify-content: flex-start;
    box-shadow: none;
}

.stat-item {
    min-width: 150px;
    padding: 8px 12px;
    border-left: 4px solid var(--cyan);
    background: #f5fafb;
}

.stat-value {
    color: var(--navy);
    font-size: 20px;
    font-weight: 900;
}

.stat-value.warning {
    color: var(--amber);
}

.template-center {
    display: grid;
    grid-template-columns: minmax(220px, 0.9fr) minmax(280px, 1.5fr);
    gap: 18px;
    align-items: center;
    margin-bottom: 18px;
    padding: 16px;
    border: 1px solid var(--line);
    border-left: 5px solid var(--cyan);
    border-radius: 8px;
    background: #f7fbfc;
}

.template-center h3 {
    margin: 0 0 6px;
    font-size: 17px;
    color: var(--ink);
}

.template-center p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 13px;
    line-height: 1.6;
}

.template-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.plan-card {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.plan-card:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.plan-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.plan-name {
    min-width: 0;
    margin: 0;
    color: var(--ink);
    font-size: 18px;
    line-height: 1.4;
    font-weight: 900;
}

.plan-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
}

.plan-description {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-left: 3px solid var(--line-strong);
    background: #f6f8fa;
    color: var(--ink-soft);
    line-height: 1.6;
}

.plan-meta {
    display: grid;
    gap: 6px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.meta-item {
    display: flex;
    gap: 4px;
    color: var(--ink-soft);
    font-size: 13px;
}

.meta-label {
    font-weight: 900;
}

.meta-value {
    color: var(--ink);
}

.loading,
.empty-state {
    padding: 42px 18px;
    color: var(--ink-soft);
    text-align: center;
}

.exam-form,
.inline-form,
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.form-group,
.form-item,
.filter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 180px;
}

.form-group label,
.filter-item label {
    width: auto;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 900;
}

.form-group input,
.form-group select,
.filter-item input,
.filter-item select,
.form-item input,
.search-box input {
    width: 100%;
    max-width: none;
}

.upload-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin: 18px 0;
}

.drop-zone {
    border: 2px dashed var(--line-strong);
    border-radius: 8px;
    padding: 22px;
    text-align: center;
    background: #fbfcfd;
    cursor: pointer;
    transition: border 0.16s ease, background 0.16s ease;
}

.drop-zone.drag-over,
.drop-zone:hover {
    border-color: var(--cyan);
    background: var(--cyan-soft);
}

.drop-zone input[type="file"] {
    display: none;
}

.upload-info,
.assignment-result,
.success-message {
    padding: 10px 12px;
    border-radius: 6px;
    color: #1d5f38;
    background: #e5f4eb;
    border: 1px solid #b8dec8;
}

.error-message {
    padding: 10px 12px;
    border-radius: 6px;
    color: #842424;
    background: #fae7e7;
    border: 1px solid #edbbbb;
}

.exam-table,
.data-table,
.schedule-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.exam-table th,
.exam-table td,
.data-table th,
.data-table td,
.schedule-table th,
.schedule-table td {
    padding: 10px 12px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    text-align: center;
    vertical-align: middle;
}

.exam-table th:last-child,
.exam-table td:last-child,
.data-table th:last-child,
.data-table td:last-child,
.schedule-table th:last-child,
.schedule-table td:last-child {
    border-right: 0;
}

.exam-table tr:last-child td,
.data-table tr:last-child td,
.schedule-table tr:last-child td {
    border-bottom: 0;
}

.exam-table thead th,
.data-table th,
.schedule-table th {
    color: var(--navy-deep);
    background: #edf1f6;
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.exam-table tbody tr:nth-child(even),
.data-table tbody tr:nth-child(even),
.schedule-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.exam-table tbody tr:hover,
.data-table tbody tr:hover,
.schedule-table tbody tr:hover {
    background: #f0f7f8;
}

.teacher-cell,
.teacher-item {
    background: var(--cyan-soft);
    border: 1px solid #a7d2d7;
    color: #24535a;
    border-radius: 6px;
    padding: 5px 8px;
    cursor: move;
}

.teachers-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    min-height: 32px;
}

.class-info {
    padding: 4px 6px;
    margin: 2px 0;
    background: #f3f5f8;
    border-radius: 6px;
    font-size: 13px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    padding: 5px 10px;
    border-radius: 999px;
    color: #fff;
    background: #667085;
    font-size: 12px;
    font-weight: 900;
}

.status-badge.active,
.status-badge.status-available {
    background: var(--green);
}

.status-badge.inactive,
.status-badge.status-unavailable {
    background: var(--danger);
}

.status-badge.exam-admin {
    background: var(--navy);
}

.status-badge.status-filtered {
    background: #667085;
}

.room-status-summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.room-status-summary .stat-number {
    margin: 0 2px;
}

.room-status-summary .stat-unavailable {
    color: var(--danger);
}

.status-quick-filters {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.status-filter-chip {
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--ink-soft);
    background: #fff;
    font-size: 13px;
    font-weight: 900;
}

.status-filter-chip:hover,
.status-filter-chip.active {
    color: #fff;
    background: var(--navy);
    border-color: var(--navy);
}

.status-filter-chip.danger.active,
.status-filter-chip.danger:hover {
    background: var(--danger);
    border-color: var(--danger);
}

.disabled-room td {
    color: #808a9d;
    background: #f4f5f7;
}

.blue-tabs {
    margin: 18px 0;
}

.blue-tabs .tab-header {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.blue-tabs .tab-item {
    min-width: 108px;
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--ink-soft);
    cursor: pointer;
    font-weight: 900;
}

.blue-tabs .tab-item.active,
.blue-tabs .tab-item:hover {
    color: #fff;
    border-color: var(--navy);
    background: var(--navy);
}

.blue-tabs .tab-content {
    margin-top: 10px;
    padding: 18px;
}

.blue-tabs .tab-content h3 {
    margin: 0 0 16px;
    color: var(--navy);
    font-size: 18px;
    font-weight: 900;
}

.progress-bar-wrapper {
    width: 100%;
    height: 26px;
    background: #e8edf3;
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    min-width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(90deg, var(--cyan), var(--navy));
    color: #fff;
    border-radius: 999px;
    transition: width 0.25s ease;
}

.progress-text,
.progress-message {
    font-weight: 900;
}

.dialog-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(19, 36, 59, 0.52);
    z-index: 1000;
}

.dialog-content {
    width: min(540px, 96vw);
    max-height: min(86vh, 760px);
    overflow: auto;
    padding: 22px;
    box-shadow: var(--shadow);
}

.plan-dialog {
    width: min(560px, 96vw);
}

.dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.dialog-buttons,
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
    padding-left: 0;
}

.dialog-body {
    display: grid;
    gap: 16px;
}

.dialog-body .form-group {
    min-width: 0;
}

.dialog-body textarea {
    min-height: 110px;
    resize: vertical;
}

.required {
    color: var(--danger);
}

.close-btn {
    width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    border-radius: 50%;
    color: var(--ink);
    background: #eef1f5;
}

.close-btn:hover {
    color: #fff;
    background: var(--danger);
}

.no-data {
    padding: 42px 18px;
    color: var(--ink-soft);
    text-align: center;
}

.action-buttons-horizontal {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.btn-action {
    min-width: 58px;
    min-height: 30px;
    padding: 6px 10px;
    font-size: 12px;
}

.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--seal);
    box-shadow: var(--shadow);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.16s ease, transform 0.16s ease;
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-2px);
}

.fas,
.far,
.fab {
    display: none;
}

.import-preview-panel {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--cyan);
    border-radius: 8px;
    background: #fbfcfe;
}

.import-preview-header,
.import-preview-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.import-preview-header h3,
.import-preview-panel h4 {
    margin: 0;
    color: var(--ink);
    font-size: 16px;
    font-weight: 900;
}

.import-preview-meta,
.import-preview-note {
    margin: 4px 0 0;
    color: var(--ink-soft);
    font-size: 13px;
}

.import-mapping-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin: 14px 0;
}

.import-mapping-field label {
    display: block;
    margin-bottom: 5px;
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 800;
}

.import-mapping-field input,
.import-mapping-field select {
    width: 100%;
}

.import-preview-hints {
    display: grid;
    gap: 8px;
    margin: 0 0 14px;
}

.import-preview-hint {
    padding: 9px 11px;
    border: 1px solid rgba(46, 143, 154, 0.22);
    border-radius: 6px;
    background: var(--cyan-soft);
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
}

.import-preview-hint.warning {
    border-color: rgba(167, 104, 33, 0.3);
    background: #fff7ea;
    color: #7b4b17;
}

.import-preview-actions {
    padding: 10px 0 14px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.import-preview-summary {
    color: var(--ink);
    font-weight: 800;
}

.import-preview-error {
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(184, 50, 50, 0.28);
    border-radius: 6px;
    background: #fff5f5;
    color: var(--danger);
    font-size: 13px;
    font-weight: 700;
}

.import-preview-error-title {
    margin-bottom: 6px;
    color: var(--danger);
    font-weight: 900;
}

.import-preview-split {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: 14px;
    margin-top: 14px;
}

.import-preview-table-wrap {
    overflow: auto;
    max-height: 360px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
}

.import-preview-table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
    font-size: 12px;
}

.import-preview-table th,
.import-preview-table td {
    border-bottom: 1px solid var(--line);
    border-right: 1px solid #edf0f5;
    padding: 7px 8px;
    vertical-align: top;
    white-space: nowrap;
}

.import-preview-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f0f4f8;
    color: var(--ink);
    font-weight: 900;
}

.import-preview-table .row-number {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 52px;
    background: #f7f9fc;
    color: var(--ink-soft);
    text-align: center;
    font-weight: 900;
}

.import-preview-table th.row-number {
    z-index: 3;
    background: #e9eef6;
}

.import-preview-table tr.mapping-header-row td {
    background: #eef6ff;
    font-weight: 800;
}

.import-preview-table tr.mapping-data-row td.row-number {
    color: var(--green);
}

.import-preview-table td.mapped-column {
    background: #f4fbf8;
    box-shadow: inset 3px 0 0 rgba(47, 138, 87, 0.6);
}

.import-preview-table tr.mapping-header-row td.mapped-column {
    background: #e7f6ef;
}

.mapped-column-label {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 5px;
    border-radius: 4px;
    background: rgba(47, 138, 87, 0.12);
    color: var(--green);
    font-size: 11px;
    font-weight: 900;
}

.import-preview-table tr.row-has-issue td {
    background: #fff5f5;
    color: var(--danger);
    font-weight: 800;
}

.import-preview-empty {
    padding: 18px;
    color: var(--ink-soft);
    text-align: center;
}

#app-dialog-root {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(420px, calc(100vw - 36px));
    pointer-events: none;
}

.app-toast {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) 28px;
    align-items: start;
    gap: 12px;
    padding: 14px 12px 14px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 16px 36px rgba(15, 32, 55, 0.18);
    color: var(--ink);
    pointer-events: auto;
    animation: app-toast-in 160ms ease-out;
}

.app-toast-icon {
    width: 10px;
    height: 10px;
    margin-top: 5px;
    border-radius: 999px;
    background: var(--primary);
}

.app-toast-success .app-toast-icon {
    background: var(--green);
}

.app-toast-error .app-toast-icon {
    background: var(--danger);
}

.app-toast-message {
    min-width: 0;
    font-size: 14px;
    line-height: 1.55;
    font-weight: 700;
    word-break: break-word;
}

.app-toast-close {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--ink-soft);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.app-toast-close:hover {
    background: #f1f5f9;
    color: var(--ink);
}

.app-toast-leave {
    animation: app-toast-out 180ms ease-in forwards;
}

@keyframes app-toast-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes app-toast-out {
    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}

@media (max-width: 980px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .main-nav {
        position: static;
        height: auto;
        padding: 14px;
    }

    .brand-panel {
        margin-bottom: 14px;
        padding-bottom: 12px;
    }

    .main-nav ul {
        display: flex;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .main-nav a {
        white-space: nowrap;
    }

    .server-card {
        display: none;
    }

    .topbar {
        position: static;
        padding: 18px;
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar-controls,
    .plan-switcher {
        width: 100%;
        justify-content: flex-start;
        min-width: 0;
        max-width: none;
    }

    .topbar-identity {
        min-width: 0;
    }

    .plan-switcher select {
        min-width: 0;
        width: 100%;
        max-width: none;
    }

    .container {
        padding: 18px;
    }

    .template-center {
        grid-template-columns: 1fr;
    }

    .template-actions {
        justify-content: flex-start;
    }

    .import-preview-split {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .topbar h1 {
        font-size: 22px;
    }

    .page,
    .exam-management,
    .exam-plan-management,
    .section {
        padding: 16px;
    }

    .exam-table,
    .data-table,
    .schedule-table {
        display: block;
        overflow-x: auto;
    }

    .header-section,
    .section-header,
    .list-header-row {
        align-items: stretch;
    }

    .header-actions,
    .template-actions,
    .dialog-buttons {
        width: 100%;
    }

    .header-actions > *,
    .template-actions > *,
    .dialog-buttons > * {
        flex: 1 1 auto;
    }

    .plans-grid {
        grid-template-columns: 1fr;
    }
}
