:root {
  color-scheme: light;
  --bg: #eef2f3;
  --surface: #ffffff;
  --surface-soft: #f7faf9;
  --line: #d8e0df;
  --line-strong: #aab8b7;
  --text: #1c2b2d;
  --muted: #6a7d80;
  --teal: #1fb9b6;
  --teal-dark: #087f82;
  --teal-soft: #dff8f6;
  --orange: #f97316;
  --app-navigation-height: 0px;
  --shadow: 0 12px 32px rgba(24, 45, 48, 0.08);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

/* Native invigilation module */
.monitor-native-shell {
  min-width: 0;
}

.monitor-native-page {
  display: grid;
  gap: 18px;
}

.monitor-native-head,
.monitor-card-head,
.monitor-status-line,
.monitor-quick-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.monitor-native-head h2,
.monitor-card-head h3 {
  margin: 0;
}

.monitor-native-head > div:first-child > span,
.monitor-card-head > div > span,
.monitor-native-page .monitor-help {
  color: var(--muted);
  font-size: 13px;
}

.monitor-quick-form {
  align-items: end;
  justify-content: flex-start;
  overflow-x: auto;
  padding: 16px;
  background: #f5fbfb;
  border: 1px solid #d1ece9;
  border-radius: 16px;
}

.monitor-quick-form form {
  display: flex;
  align-items: end;
  gap: 10px;
  width: 100%;
  min-width: 520px;
  flex-wrap: nowrap;
}

.monitor-quick-form label,
.monitor-notes-label,
.monitor-import-panel label {
  display: grid;
  gap: 6px;
  color: #4e686a;
  font-size: 13px;
  font-weight: 700;
}

.monitor-quick-form form label {
  flex: 1 1 0;
  min-width: 0;
}

.monitor-quick-form input,
.monitor-notes-label textarea,
.monitor-import-panel textarea,
.monitor-data-table input,
.monitor-data-table select {
  min-height: 36px;
  padding: 7px 9px;
  color: var(--ink, #243638);
  background: #fff;
  border: 1px solid #c8d9d9;
  border-radius: 9px;
}

.monitor-quick-form input {
  width: 100%;
}

.monitor-quick-form form .button {
  flex: 0 0 auto;
  width: auto;
  white-space: nowrap;
}

.monitor-file-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  color: #087f82;
  background: #fff;
  border: 1px solid #b9d9d8;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
}

.monitor-file-label input {
  max-width: 190px;
  font-size: 12px;
}

.monitor-import-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: #fbfdfd;
  border: 1px dashed #b8d8d7;
  border-radius: 14px;
}

.monitor-import-sources {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, .45fr);
  gap: 12px;
  align-items: end;
}

.monitor-import-panel textarea {
  min-height: 92px;
  resize: vertical;
}

.monitor-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: #fbfdfd;
  border: 1px solid #d7e5e4;
  border-radius: 16px;
}

.monitor-setting-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, .9fr);
  gap: 16px;
}

.monitor-rules-card {
  grid-column: 1 / -1;
}

.monitor-rule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
}

.monitor-rule-grid > label {
  display: grid;
  gap: 6px;
  color: #4e686a;
  font-size: 13px;
  font-weight: 700;
}

.monitor-rule-grid > label input[type="number"] {
  width: 100%;
  min-height: 36px;
  box-sizing: border-box;
  padding: 7px 9px;
  color: var(--ink, #243638);
  background: #fff;
  border: 1px solid #c8d9d9;
  border-radius: 9px;
}

.monitor-rule-check {
  display: flex !important;
  align-items: center;
  gap: 8px;
  min-height: 36px;
}

.monitor-rule-check input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  accent-color: var(--teal-dark);
}

.monitor-rule-wide {
  grid-column: 1 / -1;
}

.monitor-rule-exclusions {
  display: grid;
  gap: 8px;
  color: #4e686a;
  font-size: 13px;
  font-weight: 700;
}

.monitor-rule-label {
  display: block;
}

.monitor-teacher-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  max-height: 190px;
  overflow: auto;
  padding: 10px;
  background: #f7fbfb;
  border: 1px solid #d7e7e6;
  border-radius: 10px;
}

.monitor-teacher-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 7px;
  row-gap: 1px;
  min-width: 0;
  padding: 7px 8px;
  color: #365457;
  background: #fff;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.monitor-teacher-option:has(input:checked) {
  color: #8a3b2a;
  background: #fff4ef;
  border-color: #f2c5b7;
}

.monitor-teacher-option input {
  grid-row: 1 / span 2;
  width: 15px;
  height: 15px;
  accent-color: var(--orange);
}

.monitor-teacher-option small {
  overflow: hidden;
  color: #789091;
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monitor-rule-empty {
  color: #708687;
  font-size: 12px;
  font-weight: 500;
}

.monitor-rule-grid small {
  color: #708687;
  font-size: 11px;
  font-weight: 500;
}

.monitor-config-dialog {
  width: min(900px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 24px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(20, 39, 45, 0.28);
}

.monitor-config-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.monitor-config-dialog-head h2,
.monitor-config-dialog-head p {
  margin: 0;
}

.monitor-config-dialog-head h2 {
  margin-top: 5px;
}

.monitor-config-dialog-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.monitor-config-dialog .monitor-card {
  background: #fbfdfd;
}

.monitor-config-dialog-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

.monitor-data-table {
  min-width: 720px;
}

.monitor-stats-table {
  min-width: 1180px;
}

.monitor-stats-table th:nth-child(3),
.monitor-stats-table td:nth-child(3),
.monitor-stats-table th:nth-child(4),
.monitor-stats-table td:nth-child(4) {
  white-space: nowrap;
  text-align: center;
}

.monitor-stats-table th:nth-child(5),
.monitor-stats-table td:nth-child(5) {
  white-space: nowrap;
  text-align: center;
}

.monitor-stats-table th {
  padding: 0;
}

.monitor-sort-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  color: inherit;
  font: inherit;
  font-weight: 750;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.monitor-sort-trigger:hover,
.monitor-sort-trigger:focus-visible,
.monitor-sortable-header.is-sorted .monitor-sort-trigger {
  color: var(--teal-dark);
  background: #c9efed;
}

.monitor-sort-trigger:focus-visible {
  outline: 3px solid rgba(8, 127, 130, 0.22);
  outline-offset: -3px;
}

.monitor-sort-indicator {
  flex: 0 0 auto;
  color: #6e8a8b;
  font-size: 14px;
  line-height: 1;
}

.monitor-sortable-header.is-sorted .monitor-sort-indicator {
  color: var(--teal-dark);
}

.monitor-stats-table th:nth-child(3) .monitor-sort-trigger,
.monitor-stats-table th:nth-child(4) .monitor-sort-trigger,
.monitor-stats-table th:nth-child(5) .monitor-sort-trigger {
  justify-content: center;
  text-align: center;
}

.monitor-arrangement-detail {
  min-width: 300px;
  color: #38595b;
  line-height: 1.55;
  white-space: normal;
}

.monitor-data-table th,
.monitor-data-table td {
  padding: 9px 10px;
  vertical-align: middle;
}

.monitor-data-table input {
  width: 100%;
  min-width: 80px;
}

.monitor-auto-value {
  display: inline-flex;
  align-items: center;
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px dashed #c8d9d9;
  border-radius: 9px;
  font-variant-numeric: tabular-nums;
}

.monitor-final-teacher-table {
  min-width: 980px;
}

.monitor-final-teacher-table th:not(:first-child),
.monitor-final-teacher-table td:not(:first-child) {
  min-width: 150px;
  text-align: center;
}

.monitor-final-teacher-table th strong,
.monitor-final-teacher-table th small {
  display: block;
}

.monitor-final-teacher-table th small {
  margin-top: 4px;
  color: #708687;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
}

.monitor-final-teacher-table td {
  white-space: nowrap;
}

.monitor-final-drag-help {
  margin: -6px 0 0;
}

.monitor-final-teacher-cell.is-draggable {
  cursor: grab;
  user-select: none;
  transition: background-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.monitor-final-teacher-cell.is-draggable:active,
.monitor-final-teacher-cell.is-dragging {
  cursor: grabbing;
  opacity: 0.58;
}

.monitor-final-teacher-cell[data-monitor-final-drop="true"]:not(.is-dragging) {
  transition: background-color 140ms ease, box-shadow 140ms ease;
}

.monitor-final-teacher-cell.is-drag-over {
  background: #dff8f6;
  box-shadow: inset 0 0 0 2px var(--teal);
}

.monitor-final-teacher-cell.is-flash-success {
  animation: monitor-cell-success 1.35s ease-out;
}

.monitor-final-teacher-cell.is-flash-error {
  animation: monitor-cell-error 1.35s ease-out;
}

@keyframes monitor-cell-success {
  0%, 100% { background: transparent; box-shadow: inset 0 0 0 0 transparent; }
  28% { background: #c8f3df; box-shadow: inset 0 0 0 2px #258b57; }
}

@keyframes monitor-cell-error {
  0%, 100% { background: transparent; box-shadow: inset 0 0 0 0 transparent; transform: translateX(0); }
  20%, 60% { background: #ffe0dc; box-shadow: inset 0 0 0 2px #c83d35; transform: translateX(-3px); }
  40%, 80% { transform: translateX(3px); }
}

.monitor-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  color: #577173;
  font-size: 12px;
}

.monitor-check input {
  width: auto;
  min-width: auto;
}

.text-button {
  padding: 3px 6px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.monitor-count-badge {
  padding: 6px 10px;
  color: #087f82;
  background: #e8f8f7;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.monitor-status-line {
  padding: 11px 13px;
  color: #587173;
  background: #f4fbfb;
  border: 1px solid #d1e8e6;
  border-radius: 12px;
  font-size: 13px;
}

.monitor-status-line strong {
  color: #243638;
}

.table-wrap.monitor-matrix-wrap {
  max-height: none;
  overflow: visible;
}

.monitor-matrix {
  min-width: 920px;
}

.monitor-matrix thead th {
  top: var(--app-navigation-height);
  z-index: 4;
}

.monitor-matrix th:first-child,
.monitor-matrix td:first-child {
  min-width: 140px;
  text-align: left;
}

.monitor-matrix th:first-child small,
.monitor-session-head small {
  display: block;
  margin-top: 4px;
  color: #708687;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}

.monitor-matrix tbody th:first-child small {
  display: inline;
  margin: 0 0 0 8px;
  font-size: 12px;
  line-height: 1.2;
}

.monitor-matrix tbody th:first-child {
  padding-top: 5px;
  padding-bottom: 5px;
}

.monitor-matrix td {
  min-width: 126px;
  text-align: center;
}

.monitor-matrix tbody td {
  padding-top: 5px;
  padding-bottom: 5px;
}

.monitor-assignment-td {
  padding: 4px 8px !important;
}

.monitor-assignment-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 104px;
  min-height: 32px;
  padding: 4px 10px;
  color: #176f70;
  background: #eefafa;
  border: 1px solid #b9dedc;
  border-radius: 9px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.monitor-assignment-cell:hover {
  border-color: #087f82;
  box-shadow: 0 0 0 3px rgba(31, 185, 182, .12);
}

.monitor-assignment-cell.is-unassigned {
  color: #7c8d8e;
  background: #f7faf9;
  border-style: dashed;
}

.monitor-assignment-cell.is-role-1 {
  color: #087f82;
  background: #e1f7f5;
}

.monitor-assignment-cell.is-role-2 {
  color: #765c0a;
  background: #fff6d9;
  border-color: #ead58b;
}

.monitor-assignment-cell.is-role-3 {
  color: #8a4c21;
  background: #fff0e5;
  border-color: #edc2a5;
}

.monitor-assignment-cell:disabled {
  cursor: not-allowed;
  opacity: .65;
}

.monitor-session-head {
  min-width: 140px;
  text-align: center;
}

.monitor-session-role-summary {
  display: block;
  margin-top: 4px;
  color: #087f82;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.monitor-session-role-summary span {
  display: block;
  white-space: nowrap;
}

.monitor-session-role-summary em {
  margin-right: 3px;
  color: #587173;
  font-style: normal;
  font-weight: 600;
}

.monitor-session-head b {
  display: block;
  margin-top: 4px;
  color: #087f82;
  font-size: 12px;
}

.monitor-clear-session {
  margin-top: 5px;
  padding: 0;
  color: #a46969;
  border: 0;
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}

.monitor-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.monitor-metrics > div {
  display: grid;
  gap: 5px;
  padding: 13px 14px;
  background: #f4fbfb;
  border: 1px solid #d4e9e7;
  border-radius: 12px;
}

.monitor-metrics span {
  color: #708687;
  font-size: 12px;
}

.monitor-metrics strong {
  color: #087f82;
  font-size: 24px;
}

.monitor-notes-label textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.6;
}

.monitor-guide-document {
  display: grid;
  gap: 12px;
  padding: 22px 24px 26px;
  background: #fff;
  border: 1px solid #d7e5e4;
  border-radius: 14px;
}

.monitor-guide-document > h3 {
  margin: 0 0 2px;
  color: #243638;
  font-size: 21px;
  line-height: 1.4;
}

.monitor-guide-document > p {
  margin: 0;
  color: #243638;
  line-height: 1.7;
}

.monitor-guide-editor {
  display: grid;
  gap: 14px;
  padding: 18px 20px 20px;
  background: #f5fbfb;
  border: 1px solid #d1ece9;
  border-radius: 14px;
}

.monitor-guide-editor-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.monitor-guide-editor-head strong {
  color: #243638;
  font-size: 16px;
}

.monitor-guide-editor-head span {
  margin-left: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.monitor-guide-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}

.monitor-guide-edit-field {
  display: grid;
  gap: 6px;
  color: #4e686a;
  font-size: 13px;
  font-weight: 700;
}

.monitor-guide-edit-field-wide {
  grid-column: 1 / -1;
}

.monitor-guide-edit-field small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.monitor-guide-edit-field input,
.monitor-guide-edit-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  color: var(--ink, #243638);
  background: #fff;
  border: 1px solid #c8d9d9;
  border-radius: 9px;
  font: inherit;
  font-weight: 500;
  line-height: 1.55;
}

.monitor-guide-edit-field textarea {
  min-height: 100px;
  resize: vertical;
}

.monitor-guide-edit-field input:focus,
.monitor-guide-edit-field textarea:focus {
  outline: 2px solid rgb(8 127 130 / 18%);
  border-color: #087f82;
}

.monitor-guide-list-empty {
  color: var(--muted) !important;
  font-style: italic;
}

.monitor-guide-document > h4 {
  margin: 12px 0 0;
  color: #087f82;
  font-size: 16px;
  line-height: 1.5;
}

.monitor-guide-document > h5 {
  margin: 4px 0 0;
  color: #243638;
  font-size: 15px;
  line-height: 1.5;
}

.monitor-guide-list {
  display: grid;
  gap: 5px;
}

.monitor-guide-list p {
  margin: 0;
  color: #304547;
  line-height: 1.7;
}

.monitor-guide-schedule {
  min-width: 900px;
  table-layout: fixed;
}

.monitor-guide-schedule th,
.monitor-guide-schedule td {
  min-width: 96px;
  padding: 10px 8px;
  text-align: center;
  white-space: nowrap;
}

.monitor-guide-empty {
  padding: 18px;
  color: #8a6a28;
  background: #fff8e8;
  border: 1px solid #f0d89e;
  border-radius: 10px;
  line-height: 1.7;
}

.monitor-guide-schedule th:first-child,
.monitor-guide-schedule td:first-child {
  min-width: 64px;
}

.monitor-guide-attendance {
  min-width: 760px;
  table-layout: fixed;
}

.monitor-guide-attendance th,
.monitor-guide-attendance td {
  height: 42px;
  text-align: center;
}

.monitor-history-list {
  display: grid;
  gap: 10px;
}

.monitor-history-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #fbfdfd;
  border: 1px solid #d7e5e4;
  border-radius: 14px;
}

.monitor-history-card h3,
.monitor-history-card p {
  margin: 0;
}

.monitor-history-card p {
  margin-top: 5px;
  color: #718687;
  font-size: 12px;
}

.monitor-empty {
  padding: 24px;
  color: #718687;
  text-align: center;
}

@media (max-width: 900px) {
  .monitor-guide-editor-grid {
    grid-template-columns: 1fr;
  }

  .monitor-guide-edit-field-wide {
    grid-column: auto;
  }

  .monitor-setting-grid {
    grid-template-columns: 1fr;
  }

  .monitor-rule-grid {
    grid-template-columns: 1fr;
  }

  .monitor-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .monitor-import-sources {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .monitor-guide-editor {
    padding: 14px;
  }

  .monitor-guide-editor-head {
    display: grid;
  }

  .monitor-guide-editor-head span {
    margin-left: 0;
  }

  .monitor-quick-form form {
    min-width: 520px;
  }

  .monitor-quick-form form label {
    flex: 1 1 0;
  }

  .monitor-quick-form form .button {
    width: auto;
  }

  .monitor-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .monitor-history-card {
    align-items: flex-start;
    flex-direction: column;
  }
}

.current-exam-card {
  display: grid;
  grid-template-columns: minmax(250px, 1.5fr) minmax(250px, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  padding: 16px 20px;
  background: #f3fbfa;
  border: 1px solid #b9e6df;
  border-radius: 11px;
}

.current-exam-copy span,
.current-exam-copy p {
  color: var(--muted);
  font-size: 12px;
}

.current-exam-copy h3,
.current-exam-copy p {
  margin: 0;
}

.current-exam-copy h3 {
  margin-top: 4px;
  color: var(--teal-dark);
  font-size: 18px;
}

.current-exam-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.current-exam-title-row h3 {
  margin-top: 0;
}

.current-exam-edit {
  padding: 2px 6px;
  color: var(--teal-dark);
  background: transparent;
  border: 0;
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
}

.current-exam-edit:hover {
  background: rgba(8, 127, 130, 0.1);
}

.current-exam-name-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.current-exam-name-form input {
  width: min(360px, 100%);
  min-height: 38px;
  padding: 0 10px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--teal-dark);
  border-radius: 8px;
  font-size: 18px;
  font-weight: 700;
}

.current-exam-name-actions {
  display: flex;
  gap: 6px;
}

.current-exam-copy p {
  margin-top: 5px;
}

.current-exam-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--muted);
  font-size: 12px;
}

.current-exam-stats strong {
  color: var(--ink);
  font-size: 15px;
}

.current-exam-actions {
  justify-content: flex-end;
}

.current-arrangement-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 12px 16px;
  background: #f3fbfa;
  border: 1px solid #b9e6df;
  border-left: 4px solid var(--teal-dark);
  border-radius: 10px;
}

.current-arrangement-context-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.current-arrangement-context-copy span,
.current-arrangement-context-copy small {
  color: var(--muted);
  font-size: 12px;
}

.current-arrangement-context-copy strong {
  overflow: hidden;
  color: var(--teal-dark);
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.current-arrangement-context > b {
  flex: 0 0 auto;
  color: var(--teal-dark);
  font-size: 13px;
  white-space: nowrap;
}

.panel > .current-exam-card {
  margin: 0 0 14px;
}

@media (max-width: 900px) {
  .current-exam-card {
    grid-template-columns: 1fr 1fr;
  }

  .current-exam-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .current-arrangement-context {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
  }

  .current-arrangement-context > b {
    white-space: normal;
  }

  .current-exam-card {
    display: block;
    padding: 14px;
  }

  .current-exam-stats,
  .current-exam-actions {
    margin-top: 12px;
  }

  .current-exam-name-form {
    align-items: stretch;
    flex-direction: column;
  }

  .current-exam-name-form input {
    width: 100%;
  }

  .current-exam-name-actions {
    justify-content: flex-start;
  }

  .current-exam-actions {
    display: flex;
    flex-wrap: wrap;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

#app {
  display: block;
  min-height: 100vh;
  overflow-x: clip;
}

.auth-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #e8f5f4 0%, #f7faf9 52%, #eef2f3 100%);
}

.auth-card {
  display: grid;
  width: min(430px, 100%);
  gap: 14px;
  padding: 30px;
  background: rgba(255, 255, 255, .97);
  border: 1px solid #cfe0df;
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(24, 45, 48, .14);
}

.auth-card h1,
.auth-card p {
  margin: 0;
}

.auth-card h1 {
  font-size: 25px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.auth-brand img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.auth-brand strong,
.auth-brand span {
  display: block;
}

.auth-brand strong {
  font-size: 17px;
}

.auth-brand span,
.auth-subtitle,
.auth-help {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.auth-card form {
  display: grid;
  gap: 12px;
}

.auth-card label {
  display: grid;
  gap: 6px;
  color: #405d5f;
  font-weight: 700;
}

.auth-card input {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  background: #fff;
  border: 1px solid #c8d8d7;
  border-radius: 8px;
  color: var(--text);
}

.auth-card input:focus {
  outline: 2px solid rgba(31, 185, 182, .22);
  border-color: var(--teal-dark);
}

.auth-card form button {
  min-height: 44px;
  margin-top: 4px;
  color: #fff;
  background: var(--teal-dark);
  border: 1px solid var(--teal-dark);
  border-radius: 8px;
  font-weight: 800;
}

.auth-card form button:disabled {
  cursor: wait;
  opacity: .7;
}

.auth-message {
  color: var(--teal-dark);
}

.auth-error {
  color: #b42318;
}

.auth-loading {
  justify-items: center;
  color: var(--muted);
}

.auth-loading img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.exam-account {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 9px;
  margin-left: 10px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.exam-account-name {
  max-width: 100px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exam-account-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.exam-account-copy small {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.exam-account button {
  padding: 6px 9px;
  color: var(--teal-dark);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  font-size: 12px;
}

.account-management-page {
  max-width: 1280px;
  margin: 0 auto;
}

.account-create-form {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: #f7fbfb;
  border: 1px solid #d7e8e6;
  border-radius: 12px;
}

.account-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  align-items: start;
}

.account-create-form label,
.account-grade-field label {
  display: grid;
  gap: 6px;
  color: #405d5f;
  font-size: 13px;
  font-weight: 700;
}

.account-create-form input,
.account-create-form select,
.account-grade-field select {
  min-height: 38px;
  padding: 0 10px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font: inherit;
  font-weight: 500;
}

.account-create-form small,
.account-grade-field small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

.account-grade-field {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(180px, 1fr);
  gap: 8px 14px;
  align-items: end;
}

.account-grade-field[hidden] {
  display: none;
}

.account-create-actions {
  justify-content: flex-start;
}

.account-table-wrap {
  max-height: 52vh;
}

.account-table th,
.account-table td {
  white-space: nowrap;
}

.account-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.account-edit-dialog {
  position: relative;
  width: min(620px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 24px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(20, 39, 45, 0.28);
}

.account-edit-dialog .dialog-heading {
  margin-bottom: 18px;
  padding-right: 28px;
}

.account-edit-dialog .dialog-heading h2 {
  margin: 4px 0 6px;
}

.account-edit-dialog .dialog-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.account-edit-form {
  display: grid;
  gap: 14px;
}

.account-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.account-edit-grid label {
  display: grid;
  gap: 6px;
  color: #405d5f;
  font-size: 13px;
  font-weight: 700;
}

.account-edit-grid input,
.account-edit-grid select {
  min-height: 38px;
  padding: 0 10px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font: inherit;
  font-weight: 500;
}

.account-edit-grid input[readonly] {
  color: var(--muted);
  background: #f5f8f8;
}

.account-edit-actions {
  justify-content: flex-end;
}

.account-role-badge,
.account-status {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
}

.account-role-badge {
  color: var(--teal-dark);
  background: var(--teal-soft);
}

.account-status.active {
  color: #16734e;
  background: #e8f7ee;
}

.account-status.disabled {
  color: #8c4a19;
  background: #fff1df;
}

.data-scope-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.data-scope-picker select {
  min-width: 92px;
  min-height: 31px;
  padding: 4px 8px;
  color: var(--teal-dark);
  background: #fff;
  border: 1px solid #b9d5d3;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
}

.data-scope-picker select:disabled {
  cursor: not-allowed;
  opacity: .78;
}

.app-navigation {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(248, 251, 251, 0.98);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 5px 20px rgba(24, 45, 48, 0.05);
  backdrop-filter: blur(12px);
}

.top-navigation-row {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 60px;
  padding: 7px 20px;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex: 0 0 248px;
  flex-direction: column;
  gap: 22px;
  height: 100vh;
  padding: 22px 16px;
  background: #f8fbfb;
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  overflow: hidden;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand strong,
.brand-copy,
.brand-copy small {
  display: block;
}

.brand strong {
  font-size: 15px;
  white-space: nowrap;
}

.brand-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  max-width: 180px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-all-nav::-webkit-scrollbar {
  display: none;
}

.top-all-nav {
  display: flex;
  align-items: stretch;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 40px;
  padding: 0;
  overflow-x: auto;
  background: transparent;
  border: 0;
  scrollbar-width: none;
}

.top-nav-group {
  display: grid;
  align-content: center;
  justify-items: center;
  flex: 0 0 auto;
  gap: 2px;
  padding: 3px 13px;
  border-right: 1px solid var(--line);
}

.top-guide-entry {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 3px 16px 3px 13px;
  border-right: 1px solid var(--line);
}

.workspace-entry {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 6px 12px 6px 8px;
  color: #fff;
  background: var(--teal-dark);
  border: 1px solid var(--teal-dark);
  border-radius: 10px;
  box-shadow: 0 5px 13px rgba(8, 127, 130, 0.16);
  text-align: left;
  white-space: nowrap;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.workspace-entry:hover {
  background: #076f72;
  border-color: #076f72;
  box-shadow: 0 7px 17px rgba(8, 127, 130, 0.22);
  transform: translateY(-1px);
}

.workspace-entry.active {
  border-color: #5fceca;
  box-shadow: 0 0 0 3px rgba(31, 185, 182, 0.15), 0 8px 20px rgba(8, 127, 130, 0.24);
}

.workspace-icon {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  place-items: center;
}

.workspace-icon svg {
  width: 17px;
  height: 17px;
}

.workspace-copy {
  display: grid;
  gap: 1px;
}

.workspace-copy strong {
  font-size: 14px;
  line-height: 1.25;
}

.workspace-copy small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  line-height: 1.2;
}

.top-nav-group:first-child {
  padding-left: 13px;
}

.top-nav-group:last-child {
  padding-right: 13px;
  border-right: 0;
}

.top-nav-group-label {
  display: block;
  width: 100%;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.top-nav-items {
  display: flex;
  align-items: center;
  gap: 4px;
}

.top-nav-items .nav-item {
  flex: 0 0 auto;
  width: auto;
  min-height: 32px;
  padding: 6px 11px;
  white-space: nowrap;
}

nav {
  display: grid;
  gap: 6px;
}

.flow-nav {
  display: grid;
  gap: 18px;
}

.nav-section {
  display: grid;
  gap: 6px;
}

.nav-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 3px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.nav-step b {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: var(--teal-dark);
  background: var(--teal-soft);
  border-radius: 50%;
  font-size: 11px;
}

.nav-step strong {
  font-weight: 700;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  color: #41575a;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  color: var(--teal-dark);
  background: var(--teal-soft);
  border-color: #b7edeb;
}

.main {
  width: 100%;
  min-width: 0;
  overflow-x: clip;
  padding: 20px 24px 28px;
}

.scope-overview {
  display: grid;
  gap: 18px;
  max-width: 1280px;
  margin: 0 auto;
}

.scope-overview-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 30px;
  background: linear-gradient(135deg, #e8f8f6, #fff);
  border: 1px solid #cce6e3;
  border-radius: 16px;
}

.scope-overview-hero h1 {
  margin: 5px 0 8px;
}

.scope-overview-hero p {
  max-width: 680px;
  color: var(--muted);
  line-height: 1.7;
}

.scope-overview-hero .eyebrow,
.scope-overview-card-head span,
.scope-overview-stats {
  color: var(--muted);
  font-size: 12px;
}

.scope-overview-badge {
  flex: 0 0 auto;
  padding: 9px 13px;
  color: var(--teal-dark);
  background: var(--teal-soft);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.scope-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.scope-overview-card {
  display: grid;
  gap: 13px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow);
}

.scope-overview-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.scope-overview-card h2 {
  margin-top: 4px;
  font-size: 20px;
}

.scope-overview-arrow {
  color: var(--teal);
  font-size: 24px !important;
  line-height: 1;
}

.scope-overview-card > strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scope-overview-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  flex: 0 0 auto;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: 0;
}

.current-exam-title {
  min-width: 0;
  padding-left: 14px;
  overflow: hidden;
  color: var(--muted);
  border-left: 1px solid var(--line);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.topbar-actions,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.button.primary {
  color: #fff;
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

.button.secondary {
  color: #234044;
  background: #fff;
}

.metrics {
  display: none !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metric {
  min-height: 104px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric span,
.metric em {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.metric strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 30px;
  line-height: 1;
}

.notice {
  margin-bottom: 14px;
  padding: 11px 14px;
  color: #07575a;
  background: var(--teal-soft);
  border: 1px solid #b7edeb;
  border-radius: 8px;
}

.exam-management-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
  background: linear-gradient(135deg, #f3fcfb, #ffffff);
  border-color: #b7edeb;
}

.exam-management-hero h2 {
  margin: 5px 0 6px;
  font-size: 20px;
}

.exam-management-hero p {
  color: var(--muted);
  font-size: 13px;
}

.archive-list {
  display: grid;
  gap: 12px;
}

.archive-card {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  padding: 18px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.archive-card h3 {
  margin: 0 0 5px;
  font-size: 16px;
}

.archive-card p,
.archive-card-stats,
.archive-empty span {
  color: var(--muted);
  font-size: 13px;
}

.archive-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.archive-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.archive-summary span {
  padding: 12px 14px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.archive-summary strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 20px;
}

.archive-empty {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 8px;
  padding: 64px 20px;
  text-align: center;
}

.grid.two {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(460px, 1.1fr);
  gap: 14px;
}

.panel {
  margin-bottom: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-head h2 {
  font-size: 17px;
  letter-spacing: 0;
}

.panel-head span {
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #123d42;
  background: #d7f4f2;
  font-weight: 750;
}

th,
td {
  min-height: 38px;
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: 0;
}

td:last-child,
th:last-child {
  border-right: 0;
}

.room-editor table {
  min-width: 820px;
}

.quick-settings {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 180px)) 1fr;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
  padding: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.quick-field {
  display: grid;
  gap: 6px;
}

.quick-field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.quick-field input {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
}

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

.advanced-label {
  margin: 6px 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.room-editor input {
  width: 100%;
  min-width: 70px;
  padding: 7px 8px;
  border: 1px solid #cbd8d7;
  border-radius: 6px;
  background: #fff;
}

.room-editor .col-seats-input {
  min-width: 180px;
}

.table-footer-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 10px;
}

.table-action {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  font-weight: 650;
}

.table-action.danger {
  color: #b42318;
  border-color: #f2c7c2;
  background: #fff7f6;
}

.table-action.danger:hover {
  background: #ffe9e6;
}

.result-table {
  max-height: 520px;
}

.toolbar {
  justify-content: space-between;
  margin-bottom: 12px;
}

.search,
select {
  min-height: 38px;
  padding: 0 11px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

.search {
  min-width: 260px;
}

.empty {
  padding: 28px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  line-height: 1.7;
}

.empty.inline {
  grid-column: 1 / -1;
}

.seat-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.seat-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: #f3f8f8;
  border-bottom: 1px solid var(--line);
}

.seat-panel-head strong,
.seat-panel-head span {
  display: block;
}

.seat-panel-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.seat-panel-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.seat-map-list {
  display: grid;
  gap: 18px;
}

.seat-map-toolbar,
.result-room-picker {
  display: flex;
  align-items: center;
  gap: 10px;
}

.result-room-picker > span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.result-room-picker select {
  min-width: 210px;
}

.global-toast {
  position: fixed;
  z-index: 1200;
  left: 50%;
  bottom: 24px;
  max-width: min(520px, calc(100vw - 32px));
  padding: 10px 16px;
  color: #fff;
  background: var(--teal-dark);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(24, 45, 48, 0.18);
  font-size: 14px;
  font-weight: 650;
  transform: translateX(-50%);
}

.view-tabs {
  position: sticky;
  top: 10px;
  z-index: 12;
  display: flex;
  width: 100%;
  max-width: 100%;
  gap: 28px;
  margin: 0 0 14px;
  padding: 0 4px;
  overflow-x: auto;
  background: rgba(244, 248, 248, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.view-tab {
  position: relative;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 2px;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 13px;
  font-weight: 700;
}

.view-tab:hover {
  color: var(--teal-dark);
}

.view-tab.active {
  color: var(--teal-dark);
}

.view-tab.active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  background: var(--teal-dark);
  border-radius: 3px 3px 0 0;
  content: "";
}

.unified-archive-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.unified-archive-head h2 {
  margin: 5px 0 6px;
}

.unified-archive-head p {
  margin: 0;
  color: var(--muted);
}

.archive-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(138px, 1fr));
  gap: 10px;
}

.archive-overview span {
  min-width: 150px;
  padding: 13px 16px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
}

.archive-overview strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 22px;
}

.unified-archive-sections {
  display: grid;
  gap: 14px;
}

.archive-source-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px 0;
}

.archive-source-title b,
.archive-source-title span {
  display: block;
}

.archive-source-title b {
  font-size: 16px;
}

.archive-source-title span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.monitor-source-title {
  margin-top: 8px;
}

.unified-exam-archives {
  display: grid;
  gap: 12px;
}

.unified-exam-archive {
  display: grid;
  grid-template-columns: minmax(210px, 1.25fr) minmax(170px, .8fr) minmax(170px, .8fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.archive-main h3,
.archive-main p {
  margin: 0;
}

.archive-main h3 {
  font-size: 16px;
}

.archive-main p,
.archive-part span,
.archive-part small {
  color: var(--muted);
  font-size: 11px;
}

.archive-main p,
.archive-part small {
  margin-top: 4px;
}

.archive-part {
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.archive-part span,
.archive-part strong,
.archive-part small {
  display: block;
}

.archive-part strong {
  margin-top: 3px;
  font-size: 14px;
}

.archive-part.complete strong {
  color: var(--teal-dark);
}

.archive-part.missing strong {
  color: var(--muted);
}

.unified-archive-actions {
  display: grid;
  gap: 7px;
}

.button.danger {
  color: #b42318;
  border-color: #efb4b4;
  background: #fff7f6;
}

.button.danger:hover {
  background: #ffe9e6;
}

.combined-summary {
  grid-template-columns: repeat(5, minmax(100px, 1fr));
}

.combined-archive-detail {
  display: grid;
  gap: 22px;
  min-width: 0;
  margin-top: 22px;
}

.combined-archive-detail > section,
.unified-archive-detail {
  min-width: 0;
  max-width: 100%;
}

.archive-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.archive-pagination > div {
  display: flex;
  gap: 8px;
}

.combined-archive-detail h3 {
  margin: 0 0 10px;
}

.archive-missing {
  padding: 24px;
  color: var(--muted);
  text-align: center;
  background: var(--surface-soft);
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
}

@media (max-width: 980px) {
  .unified-exam-archive {
    grid-template-columns: 1fr 1fr;
  }

  .unified-exam-archive .button {
    justify-self: start;
  }

  .combined-summary {
    grid-template-columns: repeat(3, minmax(100px, 1fr));
  }
}

@media (max-width: 760px) {
  .unified-archive-head {
    align-items: stretch;
    flex-direction: column;
  }

  .archive-overview {
    grid-template-columns: 1fr 1fr;
  }

  .archive-overview span {
    min-width: 0;
  }
}

.room-door-control {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.room-door-control span {
  margin: 0;
  white-space: nowrap;
}

.room-door-control select {
  min-width: 150px;
}

.blackboard {
  margin: 14px auto 12px;
  width: min(320px, 72%);
  padding: 8px;
  color: #fff;
  background: #285154;
  border-radius: 6px;
  text-align: center;
  font-weight: 700;
}

.front-area {
  position: relative;
  display: flex;
  justify-content: center;
  margin: 14px 14px 12px;
  width: calc(100% - 28px);
}

.front-area .blackboard {
  margin: 0;
}

.door-marker {
  position: absolute;
  top: 50%;
  padding: 5px 9px;
  color: var(--teal-dark);
  background: var(--teal-soft);
  border: 1px solid #9cd8c6;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  transform: translateY(-50%);
}

.door-marker.left {
  left: 0;
}

.door-marker.right {
  right: 0;
}

.seat-grid {
  display: grid;
  grid-template-columns: repeat(var(--seat-cols, 6), minmax(72px, 1fr));
  gap: 8px;
  padding: 14px;
}

.seat {
  min-height: 76px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: center;
}

.seat b {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: #fff;
  background: var(--teal-dark);
  border-radius: 5px;
  font-size: 12px;
}

.seat strong {
  display: block;
  margin-top: 6px;
  font-size: 13px;
}

.seat span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.ticket-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
}

.ticket {
  min-height: 132px;
  padding: 14px;
  background: #fff;
  border: 1px dashed #94a9a8;
  border-radius: 8px;
}

.ticket span,
.ticket div {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.ticket strong {
  display: block;
  margin: 12px 0 8px;
  font-size: 24px;
}

.ticket b {
  display: inline-block;
  margin-top: 10px;
  color: var(--orange);
  font-size: 16px;
}

.public-list-tools {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.public-list-tools label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.public-sheet {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.public-title {
  text-align: center;
}

.public-title h2 {
  font-size: 24px;
  letter-spacing: 0;
}

.public-title p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.public-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0 12px;
}

.public-summary span {
  padding: 10px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
}

.public-summary b {
  color: var(--text);
}

.public-table table {
  font-size: 14px;
}

.public-table th,
.public-table td {
  height: 38px;
  text-align: center;
}

.public-table td:nth-child(2) {
  font-weight: 700;
}

.print-panel .seat-panel {
  margin-bottom: 14px;
}

.seat-door-settings {
  display: flex;
  align-items: end;
  gap: 14px;
  margin: 4px 0 16px;
  padding: 12px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.seat-door-settings label {
  display: grid;
  gap: 5px;
  min-width: 170px;
  color: var(--muted);
  font-size: 12px;
}

.seat-door-settings em {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.pagination,
.actions,
.batch-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
}

.arrange-actions {
  position: relative;
  flex-wrap: wrap;
  margin: 4px 0 0;
}

.arrange-command-row {
  display: flex;
  align-items: stretch;
  gap: 14px;
  margin-top: 4px;
}

.arrange-command-row .arrange-actions {
  flex: 0 0 auto;
  margin: 0;
}

.arrange-command-row .arrange-feedback {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0 0 0 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.arrange-command-row .arrange-feedback.warning {
  border: 0;
  background: transparent;
}

.arrange-feedback {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid #9cd8c6;
  border-radius: 8px;
  background: #f3fcf9;
}

.arrange-feedback.warning {
  border-color: #edd18a;
  background: #fffbea;
}

.feedback-copy {
  display: flex;
  align-items: center;
  gap: 12px;
}

.feedback-copy > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
}

.feedback-icon {
  display: grid;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  color: #fff;
  background: var(--teal);
  border-radius: 50%;
  font-size: 19px;
  font-weight: 800;
  place-items: center;
}

.arrange-feedback.warning .feedback-icon {
  background: #a66b00;
}

.feedback-copy strong,
.feedback-copy p {
  display: inline;
}

.feedback-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.feedback-actions {
  flex: 0 0 auto;
  margin: 0;
}

.advanced-rules {
  position: relative;
  margin: 0;
}

.advanced-rules summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 42px;
  user-select: none;
}

.advanced-rules[open] summary {
  color: var(--text);
}

.advanced-rules-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 0;
  width: min(680px, calc(100vw - 64px));
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 32px rgb(29 54 58 / 14%);
}

.advanced-rules .rule-grid {
  margin-top: 0;
}

.pagination span {
  margin-right: auto;
  color: var(--muted);
}

.mapping-grid,
.rule-grid,
.validation-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.validation-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mapping-grid label,
.rule-grid label,
.topbar-actions label:not(.button) {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.rule-grid .check {
  display: flex;
  align-items: center;
}

.rule-grid .check input {
  width: auto;
}

.field-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.roster-grade-picker {
  display: none !important;
}

/* 导入区域保留模板和示例，隐藏重复的长格式说明。 */
.format-guide > p:first-of-type {
  display: none;
}

.modal-backdrop {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 39, 45, 0.52);
}

.exam-dialog {
  width: min(720px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 24px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(20, 39, 45, 0.28);
}

.guide-inline-dialog {
  position: relative;
  width: min(900px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 20px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(20, 39, 45, 0.28);
}

.guide-inline-dialog.wide {
  width: min(1500px, calc(100vw - 40px));
}

.guide-inline-dialog > .panel {
  margin: 0;
  padding-top: 44px;
  border: 0;
  box-shadow: none;
}

.guide-dialog-close {
  position: absolute;
  z-index: 2;
  top: 18px;
  right: 18px;
}

.guide-inline-dialog .new-exam-page {
  grid-template-columns: minmax(0, 1fr);
}

.guide-inline-dialog .new-exam-page .panel-head,
.guide-inline-dialog .new-exam-fields,
.guide-inline-dialog .new-exam-submit {
  grid-column: 1;
}

.room-layout-dialog {
  width: min(680px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 24px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(20, 39, 45, 0.28);
}

.layout-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 18px 0 14px;
  padding: 14px 16px;
  border: 1px solid #9cd8c6;
  border-radius: 8px;
  background: #f3fcf9;
  color: var(--muted);
}

.layout-total strong {
  color: var(--teal-dark);
  font-size: 24px;
}

.layout-total-copy {
  display: grid;
  gap: 3px;
}

.layout-total-copy small {
  color: var(--muted);
  font-size: 12px;
}

.layout-dimensions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 14px;
}

.layout-dimensions.with-door {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.layout-dimensions > div {
  display: grid;
  gap: 9px;
  min-height: 76px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.layout-dimensions > div > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.layout-dimensions strong {
  min-width: 28px;
  color: var(--text);
  font-size: 22px;
  text-align: center;
}

.layout-dimensions .layout-total {
  display: grid;
  margin: 0;
  background: #f3fcf9;
}

.layout-door-setting {
  align-content: center;
}

.layout-door-setting select {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
}

.layout-expression-field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.layout-expression-field input {
  width: 100%;
  min-height: 40px;
  box-sizing: border-box;
  padding: 0 11px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-weight: 500;
}

.layout-expression-field small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.column-adjust-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.column-adjust {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.column-adjust > div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.column-adjust strong {
  min-width: 24px;
  color: var(--text);
  font-size: 20px;
}

.extra-seat-adjust {
  border-color: #9cd8c6;
  background: #f3fcf9;
}

.stepper {
  width: 30px;
  height: 30px;
  color: var(--teal-dark);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
}

.room-layout-dialog .field-help {
  margin-top: 12px;
}

.room-layout-summary {
  display: inline-block;
  margin-right: 8px;
  color: var(--muted);
  font-size: 13px;
}

.dialog-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
}

.new-exam-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.new-exam-fields label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.new-exam-fields label:has(#customExamName) {
  grid-column: 1 / -1;
}

.new-exam-page {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(300px, 1fr);
  gap: 14px;
  padding: 20px;
}

.new-exam-page .panel-head {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.new-exam-warning {
  grid-column: 1 / -1;
  margin-top: 14px;
  padding: 10px 12px;
  color: #76520b;
  background: #fff9e9;
  border-left: 3px solid #d4a72c;
  border-radius: 4px;
  font-size: 13px;
}

.new-exam-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.new-exam-page .new-exam-fields,
.new-exam-page .new-exam-submit {
  margin-top: 16px;
  margin-bottom: 0;
}

.new-exam-submit > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.new-exam-submit span,
.archive-section-head > span {
  color: var(--muted);
  font-size: 13px;
}

.new-exam-submit strong {
  overflow: hidden;
  color: var(--teal-dark);
  font-size: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.new-exam-submit .button {
  flex: 0 0 auto;
}

.exam-name-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid #9cd8c6;
  border-radius: 8px;
  background: #f3fcf9;
}

.exam-name-preview span {
  color: var(--muted);
}

.exam-name-preview strong {
  color: #087f78;
  font-size: 20px;
}

.dialog-actions {
  justify-content: flex-end;
}

.panel-description {
  margin: 4px 0 14px;
  color: var(--muted);
  line-height: 1.65;
}

.room-plan-title {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 14px;
}

.plan-controls {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(120px, 0.8fr) minmax(190px, 1.2fr) minmax(150px, 0.9fr) auto;
  align-items: end;
  gap: 12px;
}

.plan-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.plan-controls input {
  width: 100%;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

.plan-controls small {
  min-height: 16px;
  color: var(--muted);
  font-size: 12px;
}

.plan-controls .capacity-example {
  min-height: 72px;
}

.plan-controls > .button {
  min-height: 38px;
  white-space: nowrap;
}

.compact-plan-controls {
  grid-template-columns: minmax(150px, 1fr) minmax(170px, 1fr) auto;
  max-width: 720px;
}

.room-layout-cell {
  display: flex;
  align-items: center;
  gap: 9px;
}

.room-layout-cell strong {
  color: var(--text);
  font-size: 14px;
}

.room-layout-cell span {
  color: var(--muted);
  font-size: 12px;
}

.plan-summary {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.plan-summary strong {
  color: var(--text);
  font-weight: 650;
}

.exam-prefix-setting {
  display: grid;
  width: min(420px, 100%);
  gap: 7px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
}

.exam-prefix-setting h3 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 15px;
}

.exam-prefix-setting input {
  min-height: 38px;
  box-sizing: border-box;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

.common-settings {
  display: grid;
  gap: 14px;
}

.settings-card {
  margin-bottom: 0;
}

/* 规格设置和批量生成属于同一条工作流，视觉上合并为一张连续卡片。 */
.standard-room-card {
  margin-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.standard-room-card + .batch-room-card {
  position: relative;
  margin-top: -14px;
  border-top: 1px dashed var(--line-strong);
  border-radius: 0 0 8px 8px;
  box-shadow: var(--shadow);
}

.standard-room-card + .batch-room-card::before {
  position: absolute;
  top: -1px;
  left: 16px;
  padding: 0 8px;
  color: var(--muted);
  background: var(--surface);
  content: "批量生成设置";
  font-size: 12px;
  transform: translateY(-50%);
}

.exam-number-layout,
.standard-room-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(320px, 1.2fr);
  align-items: end;
  gap: 16px;
}

.exam-number-layout label,
.standard-room-grid label,
.batch-controls label,
.batch-controls details label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.prefix-editor {
  display: grid;
  gap: 6px;
}

.prefix-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.prefix-input-row .prefix-save {
  min-height: 38px;
}

.prefix-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
}

.exam-number-layout input,
.standard-room-grid input,
.batch-controls input {
  min-height: 38px;
  box-sizing: border-box;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

.number-example {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 38px;
  padding: 13px 15px;
  border: 1px solid #9cd8c6;
  border-radius: 8px;
  background: #f3fcf9;
}

.capacity-example {
  display: grid;
  gap: 5px;
  padding: 13px 15px;
  border: 1px solid #9cd8c6;
  border-radius: 8px;
  background: #f3fcf9;
}

.number-example span,
.capacity-example span,
.batch-suggestion span {
  color: var(--muted);
  font-size: 12px;
}

.number-example strong,
.capacity-example strong {
  color: var(--teal-dark);
  font-size: 16px;
}

.number-example em {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roster-exam-number {
  padding: 12px 16px;
}

.roster-exam-number-row {
  display: flex;
  align-items: center;
}

.roster-exam-number-title {
  align-self: center;
  font-size: 16px;
  white-space: nowrap;
}

.roster-exam-number-formula {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--muted);
  white-space: nowrap;
}

.roster-exam-number-formula > strong {
  color: var(--ink);
}

.roster-exam-number-formula input {
  width: min(240px, 24vw);
  min-width: 150px;
  min-height: 38px;
}

.legacy-exam-number-note {
  font-size: 12px;
}

.legacy-exam-number-prefix {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.legacy-exam-number-prefix input {
  width: min(160px, 18vw);
  min-width: 100px;
}

.legacy-exam-number-prefix .button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.current-exam-number {
  color: var(--muted);
}

.current-exam-number strong {
  margin-left: 4px;
  color: var(--teal-dark);
}

@media (max-width: 760px) {
  .roster-exam-number-row {
    flex-direction: column;
    align-items: stretch;
  }

  .roster-exam-number-title {
    align-self: flex-start;
  }

  .roster-exam-number-formula {
    flex-wrap: wrap;
    white-space: normal;
  }

  .roster-exam-number-formula input {
    width: min(100%, 240px);
  }

  .legacy-exam-number-prefix {
    flex-wrap: wrap;
  }

  .legacy-exam-number-prefix input {
    width: min(100%, 240px);
  }
}

.standard-room-grid {
  grid-template-columns: repeat(2, minmax(160px, 0.5fr)) minmax(300px, 1fr);
}

.batch-suggestion {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.batch-suggestion > div {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.batch-controls {
  display: flex;
  align-items: end;
  gap: 18px;
}

.batch-controls > label {
  width: min(260px, 100%);
}

.batch-controls details {
  color: var(--muted);
  font-size: 13px;
}

.batch-controls details label {
  margin-top: 8px;
}

.generation-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid #9cd8c6;
  border-radius: 8px;
  background: #f3fcf9;
}

.generation-summary.insufficient {
  border-color: #efb4b4;
  background: #fff6f6;
}

.generation-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.danger-text {
  color: #b42318;
}

.overwrite-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.prefix-preview {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 6px;
  color: var(--muted);
}

.prefix-preview strong {
  color: var(--teal-dark);
  font-weight: 700;
}

.prefix-save {
  margin-top: 2px;
}

.room-plan-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.room-plan-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.room-plan-grid small {
  min-height: 32px;
  color: var(--muted);
  line-height: 1.5;
}

.room-plan-grid input {
  width: 100%;
  min-height: 38px;
  box-sizing: border-box;
  padding: 0 11px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

.room-editor input[data-field="name"] {
  ime-mode: active;
}

.room-card-editor {
  overflow: visible;
}

.room-edit-lock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
  padding: 13px 16px;
  color: #714b00;
  background: #fff8e7;
  border: 1px solid #efd18c;
  border-radius: 12px;
}

.room-edit-lock > div {
  display: grid;
  gap: 3px;
}

.room-edit-lock strong {
  color: #5e3e00;
  font-size: 14px;
}

.room-edit-lock span {
  color: #866929;
  font-size: 13px;
}

.room-edit-lock .button {
  flex: 0 0 auto;
}


.room-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.room-detail-card {
  display: grid;
  grid-template-columns: minmax(220px, 1.25fr) minmax(130px, 0.65fr) minmax(260px, 1.1fr) minmax(180px, 1fr) 40px;
  align-items: end;
  justify-content: stretch;
  column-gap: 16px;
  row-gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.room-detail-card > label,
.room-card-layout {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.room-detail-card > label > span,
.room-card-layout > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.room-detail-card input,
.room-detail-card select,
.room-add-row input,
.room-add-row select {
  width: 100%;
  min-height: 40px;
  box-sizing: border-box;
}

.room-card-layout .room-layout-cell {
  display: grid;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
}

.room-card-layout .room-layout-cell strong {
  min-width: 0;
  color: var(--text);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.room-layout-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.room-layout-actions .button {
  flex: 0 1 auto;
  min-width: 0;
}

.room-card-delete {
  min-height: 40px;
}

.room-icon-action {
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 9px;
  background: #fff;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  place-items: center;
}

.room-icon-action.delete {
  color: #c62828;
  border: 1px solid #f1aaa5;
}

.room-icon-action.delete:hover {
  background: #fff5f4;
}

.room-icon-action.add {
  color: #fff;
  background: var(--teal-dark);
  border: 1px solid var(--teal-dark);
}

.room-icon-action.add:hover {
  background: #076f6b;
}

.room-icon-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.room-add-row {
  border-style: dashed;
  background: var(--surface-soft);
}

.batch-room-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid #b9e4dc;
  border-radius: 12px;
  background: #f3fcf9;
}

.batch-room-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.batch-room-panel-head > div {
  display: grid;
  gap: 4px;
}

.batch-room-panel-head strong {
  font-size: 15px;
}

.batch-room-panel-head span {
  color: var(--muted);
  font-size: 12px;
}

.batch-room-close {
  width: 30px;
  height: 30px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
}

.batch-room-close:hover {
  color: var(--text);
  background: #fff;
}

.batch-room-form {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) repeat(3, minmax(0, 1fr));
  /*
   * Keep every field's label and input on the same baseline. The layout
   * field has an extra help line, so bottom-aligning the grid items lifts
   * that input above the other five fields.
   */
  align-items: start;
  gap: 12px;
}

.batch-room-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.batch-room-form label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.batch-room-form .batch-room-layout-field {
  grid-column: span 2;
}

.batch-room-form input {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.batch-room-form label small {
  min-height: 16px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
}

.batch-room-layout-breakdown {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  min-height: 34px;
  padding: 6px 9px;
  color: var(--teal-dark);
  background: #fff;
  border: 1px solid #9cd8c6;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.35;
}

.batch-layout-extra {
  padding: 3px 7px;
  color: #087f62;
  background: #dff8ed;
  border-radius: 999px;
  font-weight: 800;
}

.batch-room-layout-breakdown strong {
  color: var(--ink, var(--text));
  font-weight: 800;
}

.batch-layout-invalid {
  color: #a15c00;
}

.batch-room-form input:focus {
  border-color: var(--teal-dark);
  outline: 2px solid rgba(31, 185, 182, .16);
}

.batch-room-form .batch-room-preview {
  grid-column: 1 / -2;
  align-self: center;
  margin: 0;
  color: var(--teal-dark);
  font-size: 12px;
  line-height: 1.5;
}

.batch-room-form .batch-room-preview.warning {
  color: #a15c00;
}

.batch-room-form > .button {
  white-space: nowrap;
}

.room-plan-summary {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #9cd8c6;
  border-radius: 8px;
  background: #f3fcf9;
}

.room-plan-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.room-plan-summary strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 18px;
}

.room-plan-summary .button {
  margin-left: auto;
}

.issue-list {
  margin: 12px 0;
  padding: 12px 16px;
  border-radius: 6px;
}

.issue-list.error,
.validation.failed {
  border: 1px solid #efb4b4;
  background: #fff6f6;
}

.issue-list.warning {
  border: 1px solid #edd18a;
  background: #fffbea;
}

.validation.success {
  border-color: #9cd8c6;
  background: #f3fcf9;
}

.validation-next {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #efb4b4;
}

.validation-next p {
  color: var(--muted);
  font-size: 13px;
}

.validation-stats span {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.batch-print .print-sheet {
  margin-bottom: 20px;
}

.template-actions {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.template-button-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.template-button-row .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  white-space: nowrap;
}

.roster-import-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.roster-import-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.roster-import-actions input[type="file"] {
  flex: 1 1 360px;
  min-width: 260px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
}

.roster-import-panel textarea {
  width: 100%;
  min-height: 150px;
  margin-top: 12px;
  padding: 14px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font: inherit;
  line-height: 1.65;
}

.roster-import-panel textarea:focus {
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(0, 139, 139, 0.1);
}

.autosave-status {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.roster-grade-picker {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.format-guide {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.format-guide h3 {
  margin: 0 0 8px;
}

.format-guide > p,
.format-guide li {
  color: var(--muted);
  line-height: 1.7;
}

.field-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.field-cards.two-fields,
.mapping-grid.two-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-cards > div {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.field-cards em {
  margin-left: 5px;
  color: #b33a3a;
  font-size: 12px;
  font-style: normal;
}

.field-cards span {
  color: var(--muted);
  font-size: 13px;
}

.field-cards code {
  color: #087f78;
}

.format-example {
  padding: 12px;
  border-radius: 7px;
  background: #fff;
}

.format-example table {
  margin-top: 8px;
}

.ticket-print-section {
  margin-top: 20px;
}

.button:disabled,
button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.guide-page {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 8px 0 36px;
}

.guide-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 32px;
  padding: 26px 4px 24px;
  border-bottom: 1px solid var(--line);
}

.guide-intro h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 38px);
  letter-spacing: -0.04em;
}

.guide-intro p,
.guide-workflow-head p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.guide-current-exam {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 3px 16px;
  min-width: 320px;
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.guide-current-exam span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.guide-current-exam strong {
  max-width: 280px;
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guide-mode-switch {
  display: flex;
  gap: 30px;
  margin-top: 18px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.guide-mode {
  position: relative;
  flex: 0 0 auto;
  min-height: 46px;
  padding: 0 2px;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 14px;
  font-weight: 750;
}

.guide-mode:hover,
.guide-mode.active {
  color: var(--teal-dark);
}

.guide-mode.active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  background: var(--teal-dark);
  border-radius: 3px 3px 0 0;
  content: "";
}

.guide-workflow {
  margin-top: 24px;
}

.guide-workflow-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.guide-workflow-head h2 {
  margin: 0;
  font-size: 22px;
}

.guide-workflow-head > strong {
  color: var(--teal-dark);
  font-size: 18px;
}

.guide-workflow-next {
  display: flex;
  align-items: center;
  gap: 12px;
}

.guide-workflow-next span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.workflow-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 10px 14px;
  color: var(--teal-dark);
  background: #eff9f7;
  border: 1px solid #b9e4dc;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
}

.workflow-context.workflow-complete {
  align-items: center;
  color: var(--text);
}

.workflow-context-copy {
  display: grid;
  gap: 3px;
}

.workflow-context-copy strong {
  color: var(--teal-dark);
  font-size: 14px;
}

.workflow-context-copy span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.guide-progress {
  height: 4px;
  margin: 18px 0 2px;
  overflow: hidden;
  background: #dfe9e8;
  border-radius: 999px;
}

.guide-progress span {
  display: block;
  height: 100%;
  background: var(--teal-dark);
  border-radius: inherit;
  transition: width 180ms ease;
}

.guide-completion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 14px;
  padding: 14px 16px;
  background: #eff9f7;
  border: 1px solid #9cd8c6;
  border-radius: 10px;
}

.guide-completion > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.guide-completion-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  color: #fff;
  background: var(--teal-dark);
  border-radius: 50%;
  font-weight: 800;
  place-items: center;
}

.guide-completion strong {
  color: var(--ink);
  font-size: 15px;
}

.guide-completion .button {
  flex: 0 0 auto;
}

.guide-completion-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.guide-step-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-step {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 92px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
}

.guide-step.current {
  margin: 0 -12px;
  padding-right: 16px;
  padding-left: 16px;
  background: #eff9f7;
}

.guide-step-index {
  display: grid;
  width: 34px;
  height: 34px;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
  place-items: center;
}

.guide-step.done .guide-step-index,
.guide-step.current .guide-step-index {
  color: #fff;
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

.guide-step-copy > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.guide-step-copy h3 {
  margin: 0;
  font-size: 16px;
}

.guide-step-copy span {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 750;
}

.guide-step.upcoming .guide-step-copy span {
  color: var(--muted);
}

.guide-step-copy p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.guide-step-action {
  min-width: 92px;
}

/* 工作台采用“当前任务优先、完整流程次要”的紧凑层级。 */
.guide-intro {
  padding: 18px 4px;
}

.guide-intro h1 {
  font-size: clamp(24px, 2.5vw, 32px);
}

.guide-intro > div:first-child > span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.guide-current-exam {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 280px;
}

.guide-current-exam-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.guide-new-exam {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 9px 18px;
  font-size: 14px;
  box-shadow: 0 6px 14px rgba(8, 127, 130, 0.18);
}

.guide-new-exam span {
  color: inherit;
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
}

.guide-new-exam.nudge-once {
  animation: guide-new-exam-nudge 900ms ease-out 1;
}

@keyframes guide-new-exam-nudge {
  0%, 100% { box-shadow: 0 6px 14px rgba(8, 127, 130, 0.18); transform: translateY(0); }
  45% { box-shadow: 0 8px 22px rgba(8, 127, 130, 0.34); transform: translateY(-2px); }
}

.guide-next-exam-hint {
  display: flex;
  align-items: center;
  flex: 1 0 100%;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: -14px;
  padding: 9px 12px;
  color: var(--muted);
  background: #f5faf9;
  border-left: 3px solid #79c9bb;
  border-radius: 0 7px 7px 0;
  font-size: 13px;
  line-height: 1.5;
}

.guide-next-exam-hint .guide-new-exam {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 14px;
  font-size: 13px;
}

.guide-new-exam-archive-note {
  margin: 0 44px 14px 0;
  padding: 10px 12px;
  color: var(--teal-dark);
  background: #eff9f7;
  border-left: 3px solid #79c9bb;
  border-radius: 0 7px 7px 0;
  font-size: 13px;
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  .guide-new-exam.nudge-once { animation: none; }
}

.guide-workflow-head > div:first-child > span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.guide-workflow-head h2 {
  font-size: 20px;
}

.guide-workflow-next {
  align-items: flex-end;
  flex-direction: column;
  gap: 1px;
}

.guide-workflow-next strong {
  color: var(--teal-dark);
  font-size: 20px;
}

.guide-next-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 14px;
  padding: 18px 20px;
  background: #eff9f7;
  border: 1px solid #9cd8c6;
  border-radius: 10px;
}

.guide-next-card > div > span {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
}

.guide-next-card h3 {
  margin: 4px 0 0;
  font-size: 20px;
}

.guide-next-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.guide-next-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
}

.guide-all-flow-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
}

.guide-all-flow-head h3 {
  margin: 0;
  font-size: 14px;
}

.guide-all-flow-head span {
  color: var(--muted);
  font-size: 12px;
}

.guide-step-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.guide-step,
.guide-step.current {
  display: block;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
}

.guide-step-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 66px;
  padding: 10px 12px;
  color: var(--text);
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
}

button.guide-step-button {
  font: inherit;
  cursor: pointer;
}

.guide-step.revisitable .guide-step-button:hover {
  background: #f4fbfa;
  border-color: #74c8b8;
  box-shadow: 0 6px 16px rgba(18, 79, 76, 0.08);
  transform: translateY(-1px);
}

.guide-step.revisitable .guide-step-button:focus-visible {
  outline: 3px solid rgba(0, 138, 141, 0.2);
  outline-offset: 2px;
}

.guide-step.current .guide-step-button {
  background: #eff9f7;
  border-color: #7bcbbb;
}

.guide-step.upcoming .guide-step-button {
  color: var(--muted);
  background: var(--surface-soft);
}

.guide-step-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.guide-step-copy strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guide-step-copy small {
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 760px) {
  .guide-step-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .guide-next-card {
    align-items: stretch;
    flex-direction: column;
  }

  .guide-next-card .button {
    width: 100%;
  }

  .guide-next-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .guide-step-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  #app {
    display: block;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 14px;
  }

  nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .main {
    width: 100%;
    padding: 14px;
  }

  .top-navigation-row {
    gap: 12px;
    padding: 7px 12px;
  }

  .top-all-nav {
    padding: 0;
  }

  .topbar,
  .panel-head,
  .seat-panel-head,
  .exam-management-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    gap: 5px;
  }

  .current-exam-title {
    padding-left: 0;
    border-left: 0;
    white-space: normal;
  }

  .metrics,
  .grid.two,
  .account-form-grid,
  .account-grade-field,
  .ticket-grid,
  .mapping-grid,
  .rule-grid,
  .validation-stats,
  .field-cards,
  .room-plan-grid {
    grid-template-columns: 1fr;
  }

  .exam-number-layout,
  .standard-room-grid,
  .batch-suggestion,
  .plan-controls {
    grid-template-columns: 1fr;
  }

  .prefix-input-row {
    grid-template-columns: 1fr;
  }

  .room-detail-grid {
    grid-template-columns: 1fr;
  }

  .seat-grid {
    grid-template-columns: repeat(3, minmax(72px, 1fr));
  }

  .archive-card,
  .archive-summary {
    grid-template-columns: 1fr;
  }

  .archive-card .actions {
    justify-content: flex-start;
  }

  .guide-intro {
    align-items: stretch;
    flex-direction: column;
  }

  .guide-current-exam {
    justify-content: space-between;
    min-width: 0;
    padding: 0;
    border-left: 0;
  }
}

@media (max-width: 560px) {
  .guide-completion {
    align-items: stretch;
    flex-direction: column;
  }

  .workflow-context.workflow-complete,
  .workflow-context.workflow-complete .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .guide-completion .button {
    width: 100%;
  }

  .guide-completion-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .room-edit-lock {
    align-items: stretch;
    flex-direction: column;
  }

  .room-edit-lock .button {
    width: 100%;
  }

  nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-item {
    padding: 10px;
  }

  .top-navigation-row {
    gap: 10px;
    min-height: 56px;
    padding: 7px 10px;
  }

  .exam-account {
    gap: 5px;
    margin-left: 0;
    padding-left: 8px;
  }

  .data-scope-picker span,
  .exam-account-name {
    display: none;
  }

  .scope-overview-hero {
    align-items: stretch;
    flex-direction: column;
    padding: 22px;
  }

  .brand-copy {
    display: none;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .top-all-nav {
    min-height: 40px;
    padding: 0;
  }

  .topbar-actions,
  .toolbar,
  .quick-settings,
  .public-list-tools,
  .template-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .template-button-row {
    align-items: stretch;
    flex-direction: row;
  }

  .arrange-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .arrange-command-row {
    flex-direction: column;
  }

  .advanced-rules summary {
    line-height: 32px;
  }

  .advanced-rules-panel {
    position: static;
    width: 100%;
    margin-top: 6px;
  }

  .arrange-feedback,
  .feedback-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .feedback-copy > div {
    flex-wrap: wrap;
    white-space: normal;
  }

  .seat-door-settings {
    align-items: stretch;
    flex-direction: column;
  }

  .guide-step {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 12px;
  }

  .guide-step-action {
    grid-column: 2;
    justify-self: start;
  }

  .seat-panel-head,
  .room-door-control {
    align-items: stretch;
    flex-direction: column;
  }

  .seat-panel-controls {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .seat-map-toolbar,
  .result-room-picker {
    align-items: stretch;
    flex-direction: column;
  }

  .result-room-picker select {
    min-width: 0;
    width: 100%;
  }

  .new-exam-fields {
    grid-template-columns: 1fr;
  }

  .new-exam-page {
    display: block;
  }

  .new-exam-submit {
    align-items: stretch;
    flex-direction: column;
  }

  .new-exam-submit strong {
    white-space: normal;
  }

  .exam-name-preview {
    align-items: flex-start;
    flex-direction: column;
  }

  .room-plan-summary {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .room-plan-summary .button {
    margin-left: 0;
  }

  .quick-settings {
    display: flex;
  }

  .quick-actions {
    justify-content: stretch;
  }

  .button,
  .search,
  select {
    width: 100%;
  }

  .seat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .column-adjust-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .layout-dimensions {
    grid-template-columns: 1fr;
  }

  .layout-dimensions.with-door {
    grid-template-columns: 1fr;
  }
}

/* 全站组件基准：各业务页面共享相同的标题、控件、卡片和表格节奏。 */
.main {
  max-width: 1920px;
  margin: 0 auto;
}

.page-stack {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.page-stack > .panel,
.page-stack > .view-tabs,
.page-stack > .room-edit-lock {
  margin-bottom: 0;
}

.app-feedback {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  margin-bottom: 14px;
  padding: 8px 10px 8px 12px;
  color: #26484b;
  background: #f4fafa;
  border: 1px solid #b9dddd;
  border-left: 4px solid var(--teal-dark);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
}

.app-feedback.success {
  color: #17643f;
  background: #f1fbf6;
  border-color: #b8e4ca;
  border-left-color: #258b57;
}

.app-feedback.warning {
  color: #815715;
  background: #fff9ec;
  border-color: #ecd49f;
  border-left-color: #c6871a;
}

.app-feedback.error {
  color: #9d2e2a;
  background: #fff5f4;
  border-color: #efc1bd;
  border-left-color: #c83d35;
}

.app-feedback-icon {
  display: grid;
  width: 22px;
  height: 22px;
  color: #fff;
  background: currentColor;
  border-radius: 50%;
  font-size: 0;
  place-items: center;
}

.app-feedback-icon::after {
  color: #fff;
  content: "✓";
  font-size: 13px;
  font-weight: 800;
}

.app-feedback.warning .app-feedback-icon::after { content: "!"; }
.app-feedback.error .app-feedback-icon::after { content: "×"; }
.app-feedback.info .app-feedback-icon::after { content: "i"; }

.feedback-undo,
.app-feedback-close {
  min-height: 32px;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-weight: 700;
}

.feedback-undo {
  padding: 0 10px;
  border: 1px solid currentColor;
}

.app-feedback-close {
  width: 32px;
  padding: 0;
  font-size: 18px;
}

.feedback-undo:hover,
.app-feedback-close:hover {
  background: rgba(0, 0, 0, 0.05);
}

.panel-head > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.panel-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 750;
  line-height: 1.35;
}

.panel-head span,
.panel-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.panel-current-exam {
  color: var(--teal-dark);
  font-weight: 750;
}

.button,
.table-action {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
}

.button,
.table-action,
.nav-item,
.view-tab,
.workspace-entry,
.room-icon-action {
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.button:not(:disabled):hover,
.table-action:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(24, 45, 48, 0.1);
}

.button.primary:not(:disabled):hover {
  background: #076f72;
  border-color: #076f72;
}

.button:focus-visible,
.table-action:focus-visible,
.nav-item:focus-visible,
.view-tab:focus-visible,
.workspace-entry:focus-visible,
.room-icon-action:focus-visible,
.feedback-undo:focus-visible,
.app-feedback-close:focus-visible {
  outline: 3px solid rgba(8, 127, 130, 0.22);
  outline-offset: 2px;
}

.table-action {
  min-height: 34px;
  padding: 0 11px;
  font-size: 13px;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select,
textarea {
  border-color: var(--line-strong);
  border-radius: 8px;
  box-shadow: none;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
select:focus,
textarea:focus {
  border-color: var(--teal-dark);
  outline: none;
  box-shadow: 0 0 0 3px rgba(8, 127, 130, 0.1);
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.table-wrap,
.panel,
.empty,
.notice,
.room-detail-card,
.room-add-row,
.room-edit-lock {
  border-radius: 8px;
}

.panel {
  box-shadow: 0 6px 20px rgba(24, 45, 48, 0.055);
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  gap: 14px;
  text-align: left;
}

.empty-state-mark {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  color: var(--teal-dark);
  background: var(--teal-soft);
  border-radius: 50%;
  font-size: 22px;
  font-weight: 700;
  place-items: center;
}

.empty-state strong {
  display: block;
  color: var(--text);
  font-size: 15px;
}

.empty-state p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.empty-state > .button {
  margin-left: 10px;
}

.empty-state-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 10px;
}

.empty-state-actions .button {
  white-space: nowrap;
}

th,
td {
  height: 42px;
  padding: 9px 11px;
  vertical-align: middle;
}

tbody tr:hover td {
  background: #f8fbfb;
}

th {
  font-size: 13px;
  font-weight: 750;
}

.room-icon-action {
  width: 38px;
  height: 38px;
  min-height: 38px;
  border-radius: 8px;
}

.view-tabs {
  min-height: 46px;
  gap: 26px;
  padding: 0 6px;
}

.view-tab {
  min-height: 45px;
  font-size: 14px;
  font-weight: 700;
}

.actions,
.toolbar,
.template-actions {
  gap: 8px;
}

.room-detail-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  flex: 0 1 auto;
  min-width: min(100%, 330px);
  margin: 0;
}

.room-detail-actions > .button {
  width: auto;
  min-width: 0;
  padding-right: 8px;
  padding-left: 8px;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .main {
    padding: 14px 12px 22px;
  }

  .app-feedback {
    grid-template-columns: 22px minmax(0, 1fr) auto;
  }

  .feedback-undo {
    grid-column: 2;
    justify-self: start;
  }

  .app-feedback-close {
    grid-column: 3;
    grid-row: 1;
  }

  .empty-state {
    align-items: center;
    flex-direction: column;
    padding: 30px 18px;
    text-align: center;
  }

  .empty-state > .button,
  .empty-state-actions {
    width: auto;
    margin-left: 0;
  }

  .empty-state-actions {
    justify-content: center;
    flex-wrap: wrap;
  }
}

/* Unified application shell and responsive safeguards */
.top-nav-group-label {
  color: #8b9a9c;
  font-size: 10px;
  font-weight: 600;
}

.top-nav-items .nav-item.active {
  color: var(--teal-dark);
  background: #dff8f6;
  border-color: #9fe3df;
  box-shadow: inset 0 -2px 0 var(--teal-dark);
  font-weight: 750;
}

.page-stack {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.page-stack > .panel {
  margin-bottom: 0;
}

.button.secondary {
  color: #234044;
  background: #fff;
  border-color: var(--line);
}

.button.danger,
.table-action.danger,
.room-icon-action.delete {
  color: #b42318;
  background: #fff;
  border-color: #efb4b4;
}

.guide-step.pending-confirm {
  border-color: #e7be68;
  background: #fffaf0;
}

.guide-step.pending-confirm .guide-step-index {
  color: #9a6200;
  border-color: #e7be68;
  background: #fff;
}

.room-detail-grid {
  min-width: 0;
}

.room-detail-card > * {
  min-width: 0;
}

@media screen and (max-width: 1120px) and (min-width: 761px) {
  .room-detail-card {
    grid-template-columns: minmax(0, 1.25fr) minmax(72px, 0.55fr) 40px;
    align-items: end;
  }

  .room-detail-card .room-card-layout {
    grid-column: 1 / 3;
  }

  .room-detail-card > label:has(select) {
    grid-column: 1 / 3;
  }

  .room-detail-card .room-card-delete {
    grid-column: 3;
    grid-row: 1;
  }
}

@media screen and (max-width: 1120px) {
  .top-navigation-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .top-all-nav {
    flex-basis: 100%;
  }

  .room-detail-card {
    grid-template-columns: minmax(0, 1fr) minmax(78px, 0.45fr) 40px;
  }

  .batch-room-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .batch-room-form .batch-room-preview {
    grid-column: 1 / -2;
  }
}

@media screen and (max-width: 760px) {

  .panel-head .actions,
  .panel-head .template-actions {
    width: 100%;
  }

  .panel-head .actions > .button,
  .panel-head .template-actions > .button {
    flex: 1 1 auto;
  }

  .panel-head .room-detail-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .panel-head .room-detail-actions > .button {
    width: auto;
    min-width: 0;
    padding-right: 4px;
    padding-left: 4px;
    font-size: 13px;
  }

  .room-detail-card {
    grid-template-columns: minmax(0, 1fr) 40px;
  }

  .room-detail-card > label,
  .room-detail-card .room-card-layout {
    grid-column: 1;
  }

  .room-detail-card .room-card-delete {
    grid-column: 2;
    grid-row: 1;
  }

  .batch-room-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .batch-room-form .batch-room-preview {
    grid-column: 1 / -1;
  }

  .batch-room-form > .button {
    grid-column: 1 / -1;
  }
}

@media print {
  @page {
    size: A4;
    margin: 12mm;
  }

  body {
    background: #fff;
  }

  .sidebar,
  .app-navigation,
  .topbar,
  .metrics,
  .toolbar,
  .notice,
  .button,
  .no-print {
    display: none !important;
  }

  #app,
  .main {
    display: block;
    width: 100%;
    padding: 0;
  }

  .panel {
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .panel-head {
    display: none;
  }

  .public-sheet {
    padding: 0;
    border: 0;
  }

  .public-title h2 {
    font-size: 22px;
  }

  .public-title p {
    color: #333;
  }

  .public-summary {
    grid-template-columns: repeat(3, 1fr);
    break-inside: avoid;
  }

  .public-summary span {
    background: #fff;
  }

  .public-table,
  .table-wrap {
    overflow: visible;
    border-radius: 0;
  }

  th {
    position: static;
    background: #e8f6f5 !important;
  }

  .ticket-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .print-sheet {
    break-after: page;
    page-break-after: always;
  }

  .batch-print .panel,
  .ticket-print-section {
    display: block;
  }

  .ticket {
    break-inside: avoid;
  }
}

/* Two-level workspace navigation and rounded tab treatment. */
.top-section-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding-left: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.top-section-nav::-webkit-scrollbar {
  display: none;
}

.top-section-item {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 15px;
  color: #496064;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
}

.top-section-item:hover,
.top-section-item.active {
  color: var(--teal-dark);
  background: var(--teal-soft);
  border-color: #a9e4e1;
}

.top-management-item {
  flex: 0 0 auto;
  min-height: 40px;
  margin-right: 2px;
  padding: 8px 15px;
  color: #496064;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
}

.top-management-item:hover,
.top-management-item.active {
  color: var(--teal-dark);
  background: var(--teal-soft);
  border-color: #a9e4e1;
}

.view-tabs {
  position: relative;
  top: auto;
  z-index: 12;
  display: flex;
  align-items: end;
  gap: 6px;
  min-height: 56px;
  margin: 0 0 14px;
  padding: 0 14px;
  overflow-x: auto;
  background: #f1f6fb;
  border-bottom: 1px solid #cbd8e6;
  backdrop-filter: none;
  scrollbar-width: thin;
}

.page-stack > .view-tabs {
  margin-bottom: 0;
}

.view-tab {
  position: relative;
  flex: 0 0 auto;
  min-width: 118px;
  min-height: 48px;
  margin-bottom: -1px;
  padding: 0 19px;
  color: #4b627a;
  background: #e5edf6;
  border: 1px solid #cedbe9;
  border-bottom-color: #c3d1df;
  border-radius: 13px 13px 0 0;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.view-tab:hover {
  color: #245eaf;
  background: #edf4fc;
}

.view-tab.active {
  z-index: 1;
  color: #245db6;
  background: #fff;
  border-color: #99c2f2;
  border-bottom-color: #fff;
  box-shadow: 0 -1px 0 #fff;
}

@media (max-width: 560px) {
  .top-section-item,
  .top-management-item {
    min-height: 36px;
    padding: 7px 11px;
    font-size: 12px;
  }

  .top-section-nav {
    padding-left: 10px;
  }

  .view-tabs {
    min-height: 50px;
    padding: 0 10px;
  }

  .view-tab {
    min-width: 102px;
    min-height: 43px;
    padding: 0 14px;
    border-radius: 11px 11px 0 0;
    font-size: 14px;
  }
}
