:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #17233c;
  --muted: #66748a;
  --primary: #315fa8;
  --primary-dark: #254b88;
  --primary-soft: #edf3fc;
  --accent: #16836d;
  --accent-soft: #eaf7f2;
  --warning: #a15c07;
  --warning-soft: #fff6e7;
  --danger: #b53b45;
  --danger-soft: #fff0f1;
  --line: #e2e8f0;
  --line-strong: #cdd7e4;
  --shadow: 0 12px 34px rgba(32, 55, 90, 0.07);
  --radius: 16px;
  --radius-small: 10px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 4%, rgba(49, 95, 168, 0.055), transparent 28rem),
    var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

button,
a,
input,
select,
textarea,
summary {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid rgba(49, 95, 168, 0.24);
  outline-offset: 2px;
}

.loading-bar {
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  pointer-events: none;
  opacity: 0;
  overflow: hidden;
  background: rgba(49, 95, 168, 0.12);
  transition: opacity 0.15s ease;
}

.loading-bar.active {
  opacity: 1;
}

.loading-bar.active::after {
  display: block;
  width: 38%;
  height: 100%;
  content: "";
  background: var(--primary);
  animation: loading-slide 1s infinite ease-in-out;
}

@keyframes loading-slide {
  from { transform: translateX(-110%); }
  to { transform: translateX(370%); }
}

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  width: min(1180px, calc(100% - 32px));
  min-height: 68px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 11px;
  background: var(--primary);
  color: #fff;
  place-items: center;
}

.brand-mark svg {
  width: 25px;
  height: 25px;
}

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

.brand strong {
  font-size: 16px;
  letter-spacing: 0.04em;
  line-height: 1.35;
}

.brand small {
  display: none;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.03em;
}

.session-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.session-badge {
  display: none;
  max-width: 160px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-shell {
  width: min(1180px, calc(100% - 28px));
  min-height: calc(100vh - 160px);
  margin: 0 auto;
  padding: 28px 0 36px;
}

.view {
  animation: view-in 0.24s ease-out;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-layout {
  display: grid;
  gap: 26px;
  align-items: center;
}

.login-intro {
  padding: 8px 4px 0;
}

.eyebrow,
.section-kicker {
  display: block;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.login-intro h1 {
  margin: 12px 0 16px;
  font-size: clamp(30px, 8vw, 46px);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.login-intro > p {
  max-width: 510px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.85;
}

.intro-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: #44536b;
  font-size: 12px;
}

.intro-points span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.intro-points span::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-card {
  padding: 24px 20px;
}

.card-heading {
  margin-bottom: 20px;
}

.card-heading h2 {
  margin: 4px 0 3px;
  font-size: 25px;
  line-height: 1.4;
}

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

.segmented {
  display: grid;
  margin-bottom: 22px;
  padding: 4px;
  border-radius: 11px;
  background: #eef2f7;
  grid-template-columns: 1fr 1fr;
}

.segment {
  min-height: 39px;
  padding: 7px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}

.segment.active {
  background: #fff;
  box-shadow: 0 2px 8px rgba(35, 52, 80, 0.08);
  color: var(--primary);
}

.form-stack {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.field > span,
.field-label {
  color: #3b4960;
  font-size: 12px;
  font-weight: 650;
}

.field input,
.field select,
.field textarea,
.compact-select {
  width: 100%;
  min-width: 0;
  min-height: 43px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  outline: none;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea {
  min-height: 76px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #9aa6b8;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.compact-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(49, 95, 168, 0.1);
}

.form-hint {
  margin: -3px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

/* 教师端点名字登录：一屏能看全 25 人，点一下即进入 */
.name-picker {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  max-height: 460px;
  padding: 8px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface-soft);
}

.name-chip {
  min-height: 40px;
  padding: 6px 4px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, transform 0.12s ease;
}

.name-chip:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.name-chip:not(:disabled):active {
  transform: translateY(1px);
}

.name-chip:disabled {
  opacity: 0.55;
  cursor: progress;
}

.name-chip[hidden] {
  display: none;
}

.name-picker-tip {
  grid-column: 1 / -1;
  margin: 0;
  padding: 10px 4px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
  text-align: center;
}

@media (max-width: 640px) {
  .name-picker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: none;
    overflow-y: visible;
  }

  .name-chip {
    min-height: 44px;
    font-size: 14px;
  }
}

.button {
  display: inline-flex;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  text-align: center;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.button:not(:disabled):active {
  transform: translateY(1px);
}

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

.button-primary:not(:disabled):hover {
  background: var(--primary-dark);
}

.button-secondary {
  border-color: #bed0e8;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.button-secondary:not(:disabled):hover {
  background: #e1ebf9;
}

.button-ghost {
  border-color: var(--line);
  background: #fff;
  color: #44536b;
}

.button-ghost:not(:disabled):hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.button-danger {
  border-color: #f0cdd0;
  background: #fff;
  color: var(--danger);
}

.button-danger:not(:disabled):hover {
  background: var(--danger-soft);
}

.button-small {
  min-height: 34px;
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 12px;
}

.button-block {
  width: 100%;
}

.inline-status {
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12px;
}

.page-heading {
  display: flex;
  margin-bottom: 22px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.page-heading h1 {
  margin: 3px 0 4px;
  font-size: clamp(24px, 6vw, 32px);
  letter-spacing: -0.025em;
  line-height: 1.35;
}

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

.heading-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
}

.batch-picker {
  display: grid;
  min-width: 210px;
  gap: 3px;
}

.batch-picker > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.batch-picker select {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}

.batch-picker small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.status-hint {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.auto-summary-line {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.auto-summary-line strong {
  color: var(--ink);
  font-size: 15px;
}

.auto-summary-line strong.is-missing {
  color: var(--danger);
}

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

.stats-grid {
  display: grid;
  margin-bottom: 20px;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.batch-stats {
  margin-bottom: 14px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.section-heading > .button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.panel-card > .batch-stats + .button {
  margin-top: 4px;
}

.stat-card {
  min-width: 0;
  padding: 15px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}

.stat-card strong,
.stat-card span {
  display: block;
}

.stat-card strong {
  overflow: hidden;
  margin-bottom: 2px;
  font-size: clamp(20px, 5vw, 27px);
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-card span {
  color: var(--muted);
  font-size: 11px;
}

.process-card {
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid #d6e2f1;
  border-radius: var(--radius);
  background: linear-gradient(120deg, #f4f8fe, #fff);
}

.process-heading {
  display: grid;
  margin-bottom: 14px;
  gap: 7px;
}

.process-heading h2 {
  margin: 3px 0 0;
  font-size: 18px;
}

.process-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.process-heading strong {
  color: var(--primary-dark);
}

.process-steps {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 8px;
  list-style: none;
}

.process-steps li {
  display: flex;
  min-width: 0;
  padding: 11px;
  border: 1px solid rgba(214, 226, 241, 0.8);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
  align-items: flex-start;
  gap: 10px;
}

.process-steps li > span {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  place-items: center;
}

.process-steps strong {
  display: block;
  color: #33425a;
  font-size: 13px;
}

.process-steps p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.content-section {
  margin-top: 24px;
}

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

.section-heading h2,
.section-heading h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
}

.section-heading p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.section-count {
  color: var(--muted);
  font-size: 12px;
}

.batch-section {
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.batch-header {
  display: flex;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(110deg, #f7faff, #fff);
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.batch-header h2 {
  margin: 0 0 2px;
  font-size: 16px;
}

.batch-header p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.batch-signup-deadline {
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 650;
}

.teacher-long-pause-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin: 0 0 16px;
  padding: 12px 16px;
  border: 1px solid #cfe5dc;
  border-radius: 12px;
  background: var(--accent-soft);
}

.teacher-long-pause-banner strong {
  color: #176a57;
  font-size: 13px;
}

.teacher-long-pause-banner span {
  color: #5b6b64;
  font-size: 12px;
}

.teacher-pause-panel {
  display: flex;
  padding: 14px 16px;
  border-bottom: 1px solid #ecdfca;
  background: var(--warning-soft);
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.teacher-pause-panel.is-paused {
  border-bottom-color: #cfe5dc;
  background: var(--accent-soft);
}

.teacher-pause-panel strong {
  display: block;
  color: #6f4616;
  font-size: 13px;
}

.teacher-pause-panel.is-paused strong {
  color: #176a57;
}

.teacher-pause-panel p {
  margin: 3px 0 0;
  color: #6b6255;
  font-size: 11px;
}

.teacher-pause-action {
  flex: 0 0 auto;
}

.pause-closed-note {
  display: block;
  max-width: 230px;
  color: var(--warning);
  font-size: 11px;
  text-align: right;
}

.teacher-pause-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
}

.teacher-pause-form .field {
  min-width: 128px;
  margin: 0;
}

.teacher-pause-form .field > span {
  font-size: 11px;
}

.teacher-pause-form select,
.teacher-pause-form input {
  padding: 7px 9px;
  font-size: 12px;
}

.teacher-pause-form .field-reason-other {
  min-width: 170px;
  flex: 1 1 170px;
}

.badge {
  display: inline-flex;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  background: #eef2f7;
  color: #526077;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.35;
  white-space: nowrap;
}

.badge-primary {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.badge-success {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.exam-grid {
  display: grid;
  padding: 14px;
  gap: 12px;
}

.exam-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.exam-card.is-mine {
  border-color: #b8d9ce;
  box-shadow: inset 3px 0 0 var(--accent);
}

.exam-topline {
  display: flex;
  margin-bottom: 9px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.exam-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.exam-card h3 {
  margin-bottom: 4px;
  font-size: 17px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.exam-class {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

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

.meta-item {
  min-width: 0;
}

.meta-item small,
.meta-item strong {
  display: block;
}

.meta-item small {
  margin-bottom: 1px;
  color: var(--muted);
  font-size: 10px;
}

.meta-item strong {
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.exam-footer {
  display: flex;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.capacity {
  color: var(--muted);
  font-size: 11px;
}

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

.capacity .remaining {
  color: var(--accent);
}

.capacity .full {
  color: var(--danger);
}

.selection-list,
.pause-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.selection-row,
.pause-row {
  display: flex;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.selection-row:last-child,
.pause-row:last-child {
  border-bottom: 0;
}

.selection-row strong,
.selection-row small,
.pause-row strong,
.pause-row small {
  display: block;
}

.selection-row strong,
.pause-row strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.selection-row small,
.pause-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.empty-state,
.loading-state,
.error-state {
  padding: 34px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.64);
  color: var(--muted);
  text-align: center;
}

.empty-state strong,
.error-state strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 15px;
}

.empty-state p,
.error-state p {
  margin: 0;
  font-size: 12px;
}

.error-state {
  border-color: #edcdd0;
  background: var(--danger-soft);
  color: var(--danger);
}

.error-state .button {
  margin-top: 14px;
}

.spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  margin-bottom: 9px;
  border: 2px solid #d6e0ee;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.admin-tabs {
  display: flex;
  margin-bottom: 20px;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  gap: 4px;
  scrollbar-width: none;
}

.admin-tabs::-webkit-scrollbar {
  display: none;
}

.admin-tab {
  min-width: max-content;
  min-height: 38px;
  padding: 7px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  flex: 1;
}

.admin-tab.active {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.admin-panel {
  display: grid;
  gap: 18px;
}

.panel-card {
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel-card > h2,
.panel-card > h3 {
  margin-bottom: 4px;
  font-size: 17px;
}

.panel-description {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 12px;
}

.form-grid {
  display: grid;
  gap: 13px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.batch-controls {
  display: grid;
  gap: 13px;
}

.batch-signup-summary {
  display: grid;
  margin: 13px 0;
  padding: 12px;
  border-radius: 10px;
  background: var(--surface-soft);
  gap: 12px;
}

.batch-signup-summary small,
.batch-signup-summary strong {
  display: block;
}

.batch-signup-summary small {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
}

.batch-signup-summary strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.batch-deadline-form .form-actions {
  align-self: end;
}

.batch-deadline-form .form-hint {
  flex-basis: 100%;
}

.batch-danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #f0cdd0;
  border-radius: 10px;
  background: var(--danger-soft);
}

.batch-danger-zone strong {
  display: block;
  margin-bottom: 3px;
  font-size: 13px;
  color: var(--danger);
}

.batch-danger-zone small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.status-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.status-button.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.divider {
  height: 1px;
  margin: 2px 0;
  border: 0;
  background: var(--line);
}

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

.admin-exam-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.admin-exam-main {
  padding: 16px;
}

.assignment-area {
  padding: 14px 16px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.assignment-area h4 {
  margin-bottom: 10px;
  font-size: 13px;
}

.assignment-list {
  display: grid;
  margin-bottom: 12px;
  gap: 7px;
}

.assignment-row {
  display: flex;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.assignment-person {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.assignment-person strong {
  font-size: 12px;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inline-form select {
  width: auto;
  min-width: 150px;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  flex: 1;
}

.inline-empty {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.auto-gate-note {
  margin-bottom: 16px;
  padding: 11px 12px;
  border-left: 3px solid var(--warning);
  border-radius: 0 9px 9px 0;
  background: var(--warning-soft);
  color: #76501d;
  font-size: 12px;
}

.auto-gate-note.is-open {
  border-left-color: var(--accent);
  background: var(--accent-soft);
  color: #256c5b;
}

.auto-preview-empty {
  margin-top: 18px;
}

.preview-summary {
  display: flex;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid #c9dcf3;
  border-radius: 12px;
  background: var(--primary-soft);
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.preview-summary strong,
.preview-summary small {
  display: block;
}

.preview-summary small {
  color: var(--muted);
  font-size: 11px;
}

.preview-block {
  margin-top: 18px;
}

.preview-block h3 {
  margin-bottom: 10px;
  font-size: 15px;
}

.proposal-list {
  display: grid;
  gap: 8px;
}

.proposal-row {
  display: flex;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.proposal-row strong,
.proposal-row small {
  display: block;
}

.proposal-row small {
  color: var(--muted);
  font-size: 11px;
}

.proposal-teacher {
  flex: 0 0 auto;
  text-align: right;
}

.diagnostic-card {
  margin-bottom: 9px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.diagnostic-card summary {
  padding: 11px 12px;
  background: var(--surface-soft);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.diagnostic-list {
  padding: 0 12px;
}

.diagnostic-row {
  display: grid;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  gap: 4px 10px;
  grid-template-columns: 1fr auto;
}

.diagnostic-row:last-child {
  border-bottom: 0;
}

.diagnostic-row strong {
  font-size: 12px;
}

.diagnostic-row p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  grid-column: 1 / -1;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.data-table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
  background: #fff;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.data-table th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.data-table td {
  font-size: 12px;
}

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

.table-subtext {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.share-actions {
  display: grid;
  margin-bottom: 12px;
  gap: 9px;
}

.share-note {
  margin-bottom: 14px;
}

.share-pause-note {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid #ecdfca;
  border-left: 4px solid #c8963c;
  border-radius: 10px;
  background: #fff8e6;
}

.share-pause-note strong {
  display: block;
  color: #8a6420;
  font-size: 13px;
}

.share-pause-note p {
  margin: 6px 0 4px;
  color: #5d4a22;
  font-size: 13px;
  line-height: 1.6;
}

.share-pause-note span {
  color: #8b7a55;
  font-size: 11px;
}

.share-table-wrap {
  -webkit-overflow-scrolling: touch;
}

.share-table {
  min-width: 900px;
}

.share-table td {
  overflow-wrap: anywhere;
}

.share-table td:nth-child(2) {
  min-width: 180px;
}

.share-table td:nth-child(5) {
  min-width: 170px;
}

.pause-dates {
  display: grid;
  gap: 13px;
}

.pause-batch-note {
  margin: 0;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: #256c5b;
  font-size: 12px;
}

.export-grid {
  display: grid;
  gap: 12px;
}

.export-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
}

.export-card h3 {
  margin-bottom: 5px;
  font-size: 15px;
}

.export-card p {
  min-height: 38px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12px;
}

.rules-card {
  margin-top: 32px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.74);
}

.rules-card > summary {
  display: flex;
  padding: 16px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.rules-card > summary::-webkit-details-marker {
  display: none;
}

.rules-card > summary strong {
  display: block;
  margin-top: 2px;
  font-size: 15px;
}

.summary-action {
  color: var(--muted);
  font-size: 11px;
}

.rules-grid {
  display: grid;
  padding: 0 16px 16px;
  gap: 8px;
}

.rule-item {
  display: flex;
  padding: 11px 12px;
  border-radius: 10px;
  background: var(--surface-soft);
  align-items: flex-start;
  gap: 10px;
}

.rule-item > span {
  color: var(--primary);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.06em;
}

.rule-item p {
  margin: 0;
  color: #536178;
  font-size: 11px;
}

.rule-item strong {
  color: #33425a;
  font-weight: 650;
}

.app-footer {
  display: flex;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  justify-content: space-between;
  gap: 12px;
}

.app-footer span:last-child {
  display: none;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 14px;
  bottom: 14px;
  left: 14px;
  display: grid;
  pointer-events: none;
  gap: 8px;
}

.toast {
  padding: 12px 14px;
  border: 1px solid #cad9ec;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 14px 40px rgba(23, 35, 60, 0.16);
  color: var(--ink);
  font-size: 13px;
  animation: toast-in 0.2s ease-out;
}

.toast-success {
  border-color: #b8ddd1;
  background: #f3fbf8;
  color: #176a57;
}

.toast-error {
  border-color: #ecc4c8;
  background: #fff7f7;
  color: var(--danger);
}

.toast-warning {
  border-color: #ecdcb0;
  background: #fffaef;
  color: var(--warning);
}

.group-notice {
  margin: 12px 0 16px;
  padding: 12px 16px;
  border: 1px solid #cddcf5;
  border-left: 4px solid #4a7bc8;
  border-radius: 10px;
  background: #f2f7ff;
  color: #2f4a70;
  font-size: 13px;
  line-height: 1.65;
}

.group-notice strong {
  display: block;
  margin-bottom: 4px;
  color: #2f5da8;
  font-size: 14px;
}

.group-notice p {
  margin: 0;
}

.duplicate-warning {
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid #ecdcb0;
  border-left: 4px solid var(--warning);
  border-radius: 10px;
  background: #fffaef;
  color: #6b5726;
  font-size: 13px;
  line-height: 1.65;
}

.duplicate-warning strong {
  display: block;
  margin-bottom: 4px;
  color: var(--warning);
  font-size: 14px;
}

.duplicate-warning ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.duplicate-warning li + li {
  margin-top: 2px;
}

.tencent-table tr.is-duplicate td {
  background: #fffdf5;
}

.badge-warning-text {
  color: var(--warning);
}

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

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

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

.tencent-document {
  display: flex;
  margin-bottom: 18px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.tencent-document h2 {
  margin: 3px 0 4px;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.tencent-document .tencent-url {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

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

.tencent-import-bar {
  display: flex;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid #c9dcf3;
  border-radius: 12px;
  background: var(--primary-soft);
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tencent-import-bar strong,
.tencent-import-bar small {
  display: block;
}

.tencent-import-bar small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.tencent-detail-heading {
  margin-top: 22px;
}

.tencent-table-wrap {
  -webkit-overflow-scrolling: touch;
}

.tencent-table {
  min-width: 1180px;
}

.tencent-table td {
  max-width: 190px;
  overflow-wrap: anywhere;
}

.cell-code {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 5px;
  background: #f1f5f9;
  color: #33425a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  overflow-wrap: anywhere;
}

@media (min-width: 600px) {
  .brand small,
  .session-badge,
  .app-footer span:last-child {
    display: block;
  }

  .login-card {
    padding: 30px;
  }

  .stats-grid {
    gap: 14px;
  }

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

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

  .share-actions {
    display: flex;
    flex-wrap: wrap;
  }

  .stat-card {
    padding: 18px;
  }

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

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

  .field-full,
  .form-actions-full {
    grid-column: 1 / -1;
  }

  .batch-controls {
    align-items: end;
    grid-template-columns: minmax(180px, 1fr) auto;
  }

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

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

  .toast-region {
    right: 22px;
    bottom: 22px;
    left: auto;
    width: min(380px, calc(100% - 44px));
  }
}

@media (min-width: 700px) {
  .tencent-form {
    align-items: end;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .tencent-form .button {
    min-height: 43px;
  }
}

@media (min-width: 900px) {
  .process-heading {
    align-items: center;
    justify-content: space-between;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .process-heading p {
    text-align: right;
  }

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

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

@media (min-width: 820px) {
  .page-shell {
    padding-top: 42px;
  }

  .login-layout {
    min-height: 490px;
    gap: 70px;
    grid-template-columns: minmax(0, 1.15fr) minmax(350px, 0.85fr);
  }

  .login-intro {
    padding-left: 12px;
  }

  .panel-card {
    padding: 22px;
  }

  .admin-two-column {
    display: grid;
    align-items: start;
    gap: 18px;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  }

  .admin-two-column > .panel-card {
    min-width: 0;
  }

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

@media (min-width: 1060px) {
  .exam-grid {
    padding: 16px;
    gap: 14px;
  }

  .exam-card {
    padding: 18px;
  }
}

@media (max-width: 420px) {
  .header-inner {
    width: calc(100% - 24px);
  }

  .page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .heading-actions .button {
    flex: 1;
  }

  .exam-footer,
  .selection-row,
  .pause-row,
  .preview-summary,
  .teacher-pause-panel,
  .tencent-import-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .exam-footer .button,
  .selection-row .button,
  .pause-row .button,
  .preview-summary .button,
  .teacher-pause-panel .button,
  .tencent-import-bar .button {
    width: 100%;
  }

  .batch-header {
    align-items: flex-start;
  }

  .teacher-pause-action,
  .pause-closed-note {
    width: 100%;
    max-width: none;
    text-align: left;
  }

  .proposal-teacher {
    text-align: left;
  }

  .proposal-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
