* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #4361ee;
  --primary-hover: #3a56d4;
  --bg: #f8f9fc;
  --card: #ffffff;
  --text: #1a1a2e;
  --text-light: #6c757d;
  --border: #e2e8f0;
  --success: #22c55e;
  --error: #ef4444;
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ========== 导航栏 ========== */

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 40px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.navbar-actions { display: flex; gap: 12px; }

.btn {
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { background: #a0aec0; cursor: not-allowed; }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: #f0f4ff; }

.btn-sm { padding: 6px 16px; font-size: 13px; }

.btn-danger { background: var(--error); color: white; }
.btn-danger:hover { background: #dc2626; }

/* ========== 表单容器 ========== */

.auth-container {
  max-width: 420px;
  margin: 80px auto;
  padding: 40px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.auth-container h2 {
  font-size: 24px;
  margin-bottom: 8px;
  text-align: center;
}

.auth-container .subtitle {
  color: var(--text-light);
  text-align: center;
  margin-bottom: 28px;
  font-size: 14px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus { border-color: var(--primary); }

.form-input.error { border-color: var(--error); }

.form-hint {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

.form-error {
  font-size: 13px;
  color: var(--error);
  margin-top: 6px;
  min-height: 20px;
}

.form-success {
  font-size: 14px;
  color: var(--success);
  text-align: center;
  padding: 12px;
  background: #f0fdf4;
  border-radius: 8px;
  margin-bottom: 16px;
}

.form-row {
  display: flex;
  gap: 10px;
}

.form-row .form-input { flex: 1; }

.form-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-light);
}

/* ========== 验证码输入 ========== */

.verify-section {
  display: none;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.verify-section.show { display: block; }

/* ========== 滑块验证码 ========== */

.slider-captcha {
  margin-bottom: 18px;
}

.slider-captcha-label {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  display: block;
}

.slider-track {
  position: relative;
  width: 100%;
  height: 44px;
  background: #f1f5f9;
  border-radius: 22px;
  border: 1.5px solid var(--border);
  overflow: hidden;
  user-select: none;
  cursor: pointer;
}

.slider-track.verified {
  border-color: var(--success);
  background: #f0fdf4;
}

.slider-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, #e0e7ff, #c7d2fe);
  border-radius: 22px;
  transition: none;
}

.slider-track.verified .slider-fill {
  background: linear-gradient(90deg, #bbf7d0, #86efac);
}

.slider-thumb {
  position: absolute;
  top: 2px;
  left: 0;
  width: 40px;
  height: 40px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: grab;
  transition: none;
  z-index: 2;
}

.slider-thumb:active { cursor: grabbing; }

.slider-track.verified .slider-thumb {
  background: var(--success);
  color: white;
}

.slider-text {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #94a3b8;
  pointer-events: none;
  z-index: 1;
}

.slider-target {
  position: absolute;
  top: 6px;
  width: 32px;
  height: 32px;
  background: rgba(67, 97, 238, 0.15);
  border: 2px dashed var(--primary);
  border-radius: 50%;
  z-index: 1;
}

.slider-track.verified .slider-target { display: none; }

/* ========== 账户后台 ========== */

.account-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

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

.tab {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all 0.2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ========== 表格 ========== */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  text-align: left;
  padding: 10px 12px;
  background: #f8fafc;
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  white-space: nowrap;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tbody tr:hover { background: #f8fafc; }

.table-wrapper {
  overflow-x: auto;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

/* ========== 学生全宽表格 ========== */

.student-fullwidth {
  width: 100%;
  padding: 0 12px;
  box-sizing: border-box;
}

.data-table-full {
  width: 100%;
  table-layout: auto;
}

.data-table-full th,
.data-table-full td {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  padding: 8px 10px;
  font-size: 13px;
}

.data-table-full .td-mono {
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  font-size: 12px;
  color: var(--text-light);
}

.data-table-full .td-time {
  font-size: 12px;
  color: var(--text-light);
}

.pinyin-input {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 13px;
  width: 120px;
  outline: none;
  transition: border-color 0.2s;
}

.pinyin-input:focus { border-color: var(--primary); }

.qr-thumb { border: 1px solid var(--border); }

/* ========== 卡片 ========== */

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  margin-bottom: 20px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

/* ========== 搜索框 ========== */

.search-box {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.search-box .form-input { flex: 1; }

/* ========== 状态标签 ========== */

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.badge-pending { background: #fef3c7; color: #92400e; }
.badge-approved { background: #dcfce7; color: #166534; }
.badge-rejected { background: #fee2e2; color: #991b1b; }

/* ========== 上传区域 ========== */

.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #fafbfe;
}

.upload-area:hover, .upload-area.drag-over { border-color: var(--primary); background: #f0f4ff; }

.upload-icon { font-size: 36px; margin-bottom: 8px; }

.upload-text { color: var(--text-light); font-size: 14px; }

/* ========== 通用 ========== */

.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-light);
}

.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.flex { display: flex; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ========== 座位工具栏 ========== */

.seat-toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.seat-toolbar select {
  height: 38px;
  padding: 0 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
}

.section { margin-bottom: 16px; }

/* ========== 座位主布局 ========== */

#tab-seats, #tab-print {
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  padding-left: 24px;
  padding-right: 24px;
  box-sizing: border-box;
}

.seat-main {
  display: flex;
  gap: 24px;
  margin-top: 16px;
  align-items: flex-start;
}

.seat-placeholder {
  text-align: center;
  padding: 80px 20px;
  color: #bbb;
  font-size: 16px;
}

.unassigned-panel {
  width: 220px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  max-height: 650px;
  overflow-y: auto;
  z-index: 1;
}

.panel-title {
  font-size: 14px;
  font-weight: 600;
  color: #666;
  margin-bottom: 12px;
  text-align: center;
}

.unassigned-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  min-height: 40px;
}

.stu-tag {
  padding: 10px 6px;
  font-size: 15px;
  text-align: center;
  background: #e3f2fd;
  color: #1565c0;
  border-radius: 8px;
  cursor: grab;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.15s;
  border: 2px solid transparent;
}

.stu-tag:hover { background: #bbdefb; }
.stu-tag.dragging { opacity: 0.4; }

.classroom-area {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.podium {
  background: #fce4ec;
  color: #c62828;
  text-align: center;
  padding: 10px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 12px;
  margin-bottom: 14px;
}

.groups-row {
  display: flex;
  flex-direction: row-reverse;
  gap: 14px;
  justify-content: center;
  min-width: 820px;
}

.group {
  background: #fafafa;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  padding: 8px 6px;
  transition: all 0.2s;
}

.group.drag-over-group { border-color: #ff9800; background: #fff8e1; }

.group-header {
  text-align: center;
  font-size: 14px;
  color: #999;
  margin-bottom: 8px;
  cursor: grab;
  padding: 4px 0;
  user-select: none;
  font-weight: 600;
}

.group-header:hover { color: #ff9800; }

.group-cols {
  display: flex;
  flex-direction: row-reverse;
  gap: 4px;
}

.subgroup {
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.2s;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 4px;
}

.subgroup.drag-over-subgroup { border-color: #4caf50; background: #e8f5e9; }

.subgroup-header {
  text-align: center;
  font-size: 13px;
  color: #bbb;
  cursor: grab;
  user-select: none;
  padding: 4px 0;
  font-weight: 500;
}

.subgroup-header:hover { color: #4caf50; }

.seat-cell {
  width: 90px;
  height: 42px;
  border: 1.5px dashed #ddd;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #ccc;
  transition: all 0.15s;
  background: #fff;
}

.seat-cell.occupied {
  border-style: solid;
  border-color: #90caf9;
  background: #e3f2fd;
  color: #1565c0;
  font-weight: 600;
  cursor: grab;
}

.seat-cell.drag-over-seat {
  border-color: #1976d2;
  background: #bbdefb;
  border-style: solid;
}

/* ========== 实验室布局 ========== */

.lab-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  direction: rtl;
  min-width: 880px;
}

.lab-table {
  direction: ltr;
  background: #fafafa;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 8px;
  transition: all 0.2s;
}

.lab-table.drag-over-group { border-color: #ff9800; background: #fff8e1; }

.lab-seats {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 6px;
  align-items: center;
  justify-items: center;
}

.lab-table-label {
  grid-row: 1 / 3;
  grid-column: 2;
  width: 68px;
  height: 68px;
  background: #fff3e0;
  border: 2px solid #ffcc80;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #e65100;
  cursor: grab;
  user-select: none;
}

.lab-table-label:hover { background: #ffe0b2; }

.lab-s-tl { grid-column: 1; grid-row: 1; }
.lab-s-tr { grid-column: 3; grid-row: 1; }
.lab-s-bl { grid-column: 1; grid-row: 2; }
.lab-s-br { grid-column: 3; grid-row: 2; }

.lab-grid .seat-cell { width: 72px; height: 38px; font-size: 14px; }

/* ========== 四路路队布局 ========== */

.queue-row {
  display: flex;
  flex-direction: row-reverse;
  gap: 20px;
  justify-content: center;
}

.queue-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #fafafa;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  padding: 10px 12px;
  transition: all 0.2s;
}

.queue-col.drag-over-subgroup { border-color: #4caf50; background: #e8f5e9; }

.queue-col-header {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: #666;
  cursor: grab;
  user-select: none;
  padding: 6px 0;
  background: #e8eaf6;
  border-radius: 6px;
  margin-bottom: 4px;
}

.queue-col-header:hover { background: #c5cae9; }

.queue-row .seat-cell { width: 90px; height: 38px; font-size: 14px; }

/* ========== 座位操作按钮 ========== */

.seat-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
  padding-top: 40px;
  z-index: 1;
}

.seat-btn {
  width: 64px;
  height: 64px;
  border: none;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 2px;
}

.seat-btn-clear { background: #fff3e0; color: #e65100; border: 2px solid #ffcc80; }
.seat-btn-clear:hover { background: #ffe0b2; }
.seat-btn-submit { background: #e8f5e9; color: #2e7d32; border: 2px solid #a5d6a7; }
.seat-btn-submit:hover { background: #c8e6c9; }

/* ========== 确认弹窗 ========== */

.confirm-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.confirm-card {
  background: linear-gradient(145deg, #ffffff, #f0f4ff);
  border-radius: 24px;
  padding: 40px 36px 32px;
  text-align: center;
  width: 340px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  animation: confirmPop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes confirmPop {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.confirm-emoji { font-size: 56px; margin-bottom: 12px; }
.confirm-title { font-size: 20px; font-weight: 700; color: #333; margin-bottom: 8px; }
.confirm-desc { font-size: 14px; color: #888; margin-bottom: 28px; }
.confirm-btns { display: flex; gap: 12px; }

.confirm-btn-yes {
  flex: 1; height: 44px; border: none; border-radius: 12px;
  font-size: 16px; font-weight: 600; cursor: pointer;
  background: linear-gradient(135deg, #43a047, #66bb6a); color: #fff;
  transition: opacity 0.2s;
}

.confirm-btn-yes:hover { opacity: 0.9; }

.confirm-btn-no {
  flex: 1; height: 44px; border: 2px solid #e0e0e0; border-radius: 12px;
  font-size: 16px; font-weight: 600; cursor: pointer;
  background: #fff; color: #888;
  transition: all 0.2s;
}

.confirm-btn-no:hover { border-color: #bbb; color: #555; }

.stu-tag, .seat-cell.occupied, .group-header, .subgroup-header,
.lab-table-label, .queue-col-header {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  touch-action: none;
}

/* ========== 打印码模块 ========== */

.print-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.filters select {
  height: 38px;
  padding: 0 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
}

.print-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.print-controls label { font-weight: 600; color: #555; }

.print-controls button:not(.btn) {
  width: 30px; height: 30px;
  border: 1px solid #d0d0d0; border-radius: 6px;
  background: #fff; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #333; transition: background 0.15s;
}

.print-controls button:not(.btn):hover { background: #eef2ff; }

.print-controls span {
  display: inline-block; width: 24px; text-align: center;
  font-weight: 700; font-size: 16px;
}

.print-preview {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.a4-page {
  width: 794px; height: 1123px;
  background: #fff; border: 1px solid #ccc;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  display: grid; padding: 16px; box-sizing: border-box;
}

.qr-cell {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
}

.qr-cell img {
  max-width: 90%; max-height: calc(100% - 22px);
  object-fit: contain; border-radius: 4px;
}

.qr-cell span {
  font-size: 11px; color: #444; text-align: center;
  line-height: 1.2; white-space: nowrap;
}

.qr-cell-empty { visibility: hidden; }

.empty-row {
  text-align: center; padding: 40px; color: #bbb; font-size: 14px;
}

/* ========== 响应式 ========== */

@media (max-width: 1200px) {
  .seat-main {
    flex-direction: column;
    gap: 16px;
  }

  .unassigned-panel {
    width: 100%;
    max-height: 200px;
    order: -1;
  }

  .unassigned-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }

  .classroom-area {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }

  .seat-actions {
    flex-direction: row;
    justify-content: center;
    padding-top: 0;
  }

  .seat-btn {
    width: auto;
    height: 48px;
    padding: 0 28px;
    flex: 1;
    max-width: 200px;
  }
}

@media (max-width: 860px) {
  .a4-page { width: 100%; height: auto; aspect-ratio: 210 / 297; }
  .print-toolbar { flex-direction: column; align-items: flex-start; }
}

/* ===== 表现记录 ===== */

.records-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.records-toolbar select {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  min-width: 200px;
}

.records-toolbar input {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  min-width: 140px;
  box-sizing: border-box;
}

.ranking-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ranking-toolbar select,
.ranking-toolbar input {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  min-width: 180px;
  box-sizing: border-box;
}

.ranking-table {
  width: 100%;
  table-layout: fixed;
}

.ranking-table th,
.ranking-table td {
  padding: 10px 12px;
  font-size: 14px;
}

.ranking-table th:nth-child(1),
.ranking-table td:nth-child(1) { width: 55px; text-align: center; }
.ranking-table th:nth-child(2),
.ranking-table td:nth-child(2) { width: 60px; text-align: center; }
.ranking-table th:nth-child(3),
.ranking-table td:nth-child(3) { width: 70px; }
.ranking-table th:nth-child(4),
.ranking-table td:nth-child(4) { width: 95px; text-align: center; }
.ranking-table th:nth-child(5),
.ranking-table td:nth-child(5) { width: 70px; text-align: center; }
.ranking-table th:nth-child(6),
.ranking-table td:nth-child(6) { width: 70px; text-align: center; }
.ranking-table th:nth-child(7),
.ranking-table td:nth-child(7) { width: 70px; text-align: center; }
.ranking-table th:nth-child(8),
.ranking-table td:nth-child(8) { min-width: 120px; }
.ranking-table th:nth-child(9),
.ranking-table td:nth-child(9) { min-width: 120px; }

.ranking-table .td-reason-col {
  white-space: normal;
  word-break: break-word;
}

.records-table {
  width: 100%;
  table-layout: fixed;
}

.records-table th,
.records-table td {
  padding: 8px 10px;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.records-table th:nth-child(1),
.records-table td:nth-child(1) { width: 150px; }
.records-table th:nth-child(2),
.records-table td:nth-child(2) { width: 50px; text-align: center; }
.records-table th:nth-child(3),
.records-table td:nth-child(3) { width: 80px; }
.records-table th:nth-child(4),
.records-table td:nth-child(4) { width: auto; }
.records-table th:nth-child(5),
.records-table td:nth-child(5) { width: 55px; text-align: center; }
.records-table th:nth-child(6),
.records-table td:nth-child(6) { width: 60px; }
.records-table th:nth-child(7),
.records-table td:nth-child(7) { width: 60px; }
.records-table th:nth-child(8),
.records-table td:nth-child(8) { width: 90px; }
.records-table th:nth-child(9),
.records-table td:nth-child(9) { width: 55px; text-align: center; }

.records-table .td-time {
  font-size: 12px;
  color: var(--text-light);
}

.records-table .td-reason {
  min-width: 120px;
}

.reason-input {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 13px;
  width: 100%;
  min-width: 100px;
  outline: none;
  transition: border-color 0.2s;
  background: transparent;
  box-sizing: border-box;
}

.reason-input:focus { border-color: var(--primary); }

.record-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
}

.badge-score {
  background: #ebf8ff;
  color: #2b6cb0;
}

.badge-remind {
  background: #fefcbf;
  color: #975a16;
}

.btn-undo {
  background: none;
  border: 1px solid #e53e3e;
  color: #e53e3e;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-undo:hover {
  background: #e53e3e;
  color: #fff;
}

@media (max-width: 768px) {
  .records-table { table-layout: auto; }
  .records-table th, .records-table td { white-space: nowrap; }
  .records-table th:nth-child(4), .records-table td:nth-child(4) { min-width: 120px; }
  .ranking-table { table-layout: auto; }
  .ranking-table th, .ranking-table td { white-space: nowrap; }
  .ranking-table .td-reason-col { white-space: normal; word-break: break-word; }
}

@media (max-width: 600px) {
  .navbar { padding: 12px 16px; }
  .auth-container { margin: 40px 16px; padding: 24px; }
  .account-layout { padding: 12px; }
  .tabs { gap: 0; }
  .tab { padding: 10px 14px; font-size: 13px; }

  .seat-toolbar { flex-direction: column; gap: 8px; }
  .seat-toolbar select { width: 100%; }

  .lab-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  .queue-row { gap: 10px; }

  .confirm-card { width: 85%; padding: 32px 24px 24px; }
}
