:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --accent: #0ea5e9;
  --bg: #eef2ff;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --header-from: #1e40af;
  --header-to: #2563eb;
  --row-ended: #e2e8f0;
  --row-future: #ffe4e6;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

body {
  margin: 0;
  font-family: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* —— 顶栏 —— */
.site-header {
  background: linear-gradient(135deg, var(--header-from) 0%, var(--header-to) 100%);
  color: #fff;
  padding: 20px 16px 24px;
  box-shadow: 0 4px 20px rgba(30, 64, 175, 0.25);
}

.site-header__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.brand__icon {
  font-size: 36px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.brand__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand__subtitle {
  margin: 6px 0 0;
  font-size: 0.875rem;
  opacity: 0.9;
  font-weight: 400;
}

.header-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stat-chip {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  padding: 8px 14px;
  min-width: 100px;
}

.stat-chip--muted .stat-chip__value {
  opacity: 0.95;
}

.stat-chip--warn {
  background: rgba(254, 226, 226, 0.35);
  border-color: rgba(254, 202, 202, 0.6);
}

.stat-chip__label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.85;
  margin-bottom: 2px;
}

.stat-chip__value {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
}

/* —— 主内容 —— */
.page {
  max-width: 1100px;
  margin: -12px auto 0;
  padding: 0 16px 32px;
  position: relative;
  z-index: 1;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
  animation: fadeInUp 0.4s ease-out;
  transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.1);
  transform: translateY(-2px);
}

.card__head {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  align-items: flex-start;
}

.card__icon {
  font-size: 1.35rem;
  line-height: 1.2;
}

.card__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.card__desc {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.file-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.file-upload {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.file-upload--inline {
  flex: 0 0 auto;
  min-width: 0;
  padding: 0;
  border: none;
  background: transparent;
  gap: 0;
}

.file-upload--inline:hover {
  background: transparent;
}

.file-upload--inline .file-upload__btn {
  display: inline-block;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
}

.file-upload--inline:hover .file-upload__btn {
  border-color: var(--primary);
  color: var(--primary);
  background: #f8fafc;
}

.file-upload--inline.is-busy {
  opacity: 0.65;
  pointer-events: none;
}

.file-upload--inline.is-busy .file-upload__btn {
  background: var(--text-muted);
  color: #fff;
  border-color: var(--text-muted);
}

.file-upload:hover {
  border-color: var(--primary);
  background: #eff6ff;
}

.file-upload.is-busy {
  pointer-events: none;
  opacity: 0.75;
  border-color: var(--primary);
  background: #eff6ff;
}

.file-upload.is-busy .file-upload__btn {
  background: var(--text-muted);
}

.file-upload__btn {
  padding: 8px 14px;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}

.file-upload__name {
  font-size: 0.875rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.filter-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
}

.filter-row--fields .filter-item {
  flex: 1 1 140px;
  max-width: 200px;
  min-width: 120px;
}

.filter-row--rooms {
  width: 100%;
}

.filter-item--rooms {
  flex: 1 1 100%;
  max-width: none;
  min-width: 0;
}

.room-filter__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.room-filter__head > label:first-child {
  margin-bottom: 0;
}

.room-filter__all {
  margin: 0;
}

.room-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  max-height: 132px;
  overflow-y: auto;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.room-checkboxes.is-empty {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.check-pill--compact {
  padding: 4px 10px;
  font-size: 0.8125rem;
  gap: 6px;
}

.filter-item {
  flex: 0 1 auto;
  min-width: 0;
}

.filter-row--top {
  flex-wrap: nowrap;
}

.filter-item--top {
  flex: 1 1 100%;
  width: 100%;
  min-width: 0;
}

.filter-controls-line {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.filter-controls-line .date-input,
.filter-controls-line input[type="date"] {
  width: auto;
  min-width: 10.5rem;
  max-width: 11.5rem;
  flex: 0 0 auto;
}

.filter-controls-line .check-pill {
  flex-shrink: 0;
}

.filter-controls-sep {
  width: 1px;
  height: 28px;
  background: var(--border);
  margin: 0 4px;
  flex-shrink: 0;
}

.btn-sm {
  padding: 10px 10px;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.filter-item label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.filter-item select,
.filter-item input[type="date"],
.date-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9375rem;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.filter-item select:focus,
.filter-item input[type="date"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.date-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.date-label {
  flex: 1;
  min-width: 180px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.date-nav__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.btn {
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.1), transparent);
  transition: left 0.4s;
}

.btn:hover::before {
  left: 100%;
}

.btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff;
}

.btn-accent {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-accent:hover {
  background: #e0f2fe;
  color: #0369a1;
}

.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.875rem;
  cursor: pointer;
  background: #f8fafc;
  transition: background 0.15s, border-color 0.15s;
}

.check-pill:has(input:checked) {
  background: #eff6ff;
  border-color: var(--primary);
  color: var(--primary);
}

.check-pill input {
  accent-color: var(--primary);
}

.hidden {
  display: none !important;
}

.results-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 12px;
}

.results-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  flex: 1 1 240px;
  min-width: 0;
}

.results-title-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.results-date {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.results-hint {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.legend--inline {
  flex: 1 1 280px;
  margin: 0;
  padding: 0;
  background: transparent;
  gap: 12px;
}

.legend__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend__swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.legend__swatch--ended {
  background: var(--row-ended);
}

.legend__swatch--future {
  background: var(--row-future);
}

.table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  border: 1px solid var(--border);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f1f5f9;
  text-align: left;
  padding: 12px 14px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  font-weight: 600;
  color: var(--text);
}

tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  transition: background 0.2s ease;
}

tbody tr {
  transition: all 0.2s ease;
}

tbody tr:hover td {
  background: rgba(37, 99, 235, 0.06);
  transform: scale(1.01);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr.row-ended td {
  background: var(--row-ended);
  opacity: 0.7;
}

tbody tr.row-future td {
  background: var(--row-future);
  animation: pulse 2s ease-in-out infinite;
}

.period-bar {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  min-width: 180px;
  max-width: 320px;
}

tbody .period-bar {
  max-width: none;
}

.period-bar__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

.period-bar__seg {
  width: 100%;
  height: 10px;
  border-radius: 2px;
  background: transparent;
}

.period-bar__num {
  font-size: 0.625rem;
  line-height: 1;
  color: var(--text-muted);
  user-select: none;
}

.period-bar__num--active {
  font-weight: 700;
  color: var(--text);
}

.period-bar__seg--ghost {
  background: transparent;
  visibility: hidden;
}

.col-period {
  min-width: 200px;
}

.col-period__label {
  font-weight: 600;
  margin-bottom: 6px;
}

.period-bar--scale {
  max-width: none;
}

.period-bar--scale .period-bar__num {
  font-weight: 600;
  color: var(--text-muted);
}

.period-bar__seg--black {
  background: #111827;
}

.period-bar__seg--red {
  background: #dc2626;
}

.empty-tip {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.empty-tip.error {
  color: #dc2626;
  background: #fef2f2;
}

.table-wrap.is-loading {
  position: relative;
  pointer-events: none;
}

.table-wrap.is-loading::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(2px);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.table-wrap.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  z-index: 11;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.help-list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.help-list li {
  margin-bottom: 8px;
}

.help-list li:last-child {
  margin-bottom: 0;
}

.help-footer {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.help-footer .sep {
  margin: 0 8px;
  opacity: 0.5;
}

.site-footer {
  text-align: center;
  padding: 20px 16px 28px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.site-footer p {
  margin: 0;
}

.site-footer .copyright {
  margin-top: 8px;
  font-size: 0.6875rem;
  opacity: 0.7;
}

.site-footer .copyright a {
  color: inherit;
  text-decoration: none;
}

.site-footer .copyright a:hover {
  text-decoration: underline;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1e293b;
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.875rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s, opacity 0.25s;
  z-index: 1000;
  max-width: min(90vw, 400px);
  text-align: center;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.desktop-only[hidden] {
  display: none !important;
}

body.is-desktop .desktop-only:not([hidden]) {
  display: inline-flex;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal[hidden] {
  display: none !important;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.modal__panel {
  position: relative;
  width: min(560px, 100%);
  max-height: min(80vh, 640px);
  display: flex;
  flex-direction: column;
  background: var(--surface, #fff);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
  padding: 18px 18px 16px;
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.modal__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.modal__close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.modal__close:hover {
  color: var(--text);
}

.modal__desc {
  margin: 0 0 12px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.modal__scope {
  margin: 0 0 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.modal__search {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9375rem;
  margin-bottom: 10px;
}

.modal__search:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.teacher-rooms-list {
  flex: 1 1 auto;
  min-height: 180px;
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.teacher-rooms-list__empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.teacher-rooms-item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  text-align: left;
  font-size: 0.9375rem;
  color: var(--text);
  cursor: pointer;
}

.teacher-rooms-item:last-child {
  border-bottom: none;
}

.teacher-rooms-item:hover {
  background: #eff6ff;
}

.teacher-rooms-item.is-selected {
  background: #dbeafe;
  color: var(--primary);
  font-weight: 600;
}

.modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 14px;
}

@media (max-width: 768px) {
  .site-header__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-stats {
    width: 100%;
    justify-content: flex-start;
  }

  .stat-chip {
    flex: 1;
    min-width: calc(33.333% - 7px);
    text-align: center;
  }

  .stat-chip__label {
    font-size: 0.65rem;
  }

  .stat-chip__value {
    font-size: 0.8rem;
  }

  .brand__title {
    font-size: 1.3rem;
  }

  .brand__subtitle {
    font-size: 0.8rem;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 0 10px 24px;
  }

  .card {
    padding: 16px;
  }

  .card__head {
    flex-direction: column;
    gap: 8px;
  }

  .card__icon {
    font-size: 1.2rem;
  }

  .filter-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .filter-row--top {
    flex-wrap: wrap;
  }

  .filter-item--top {
    min-width: 0;
    width: 100%;
  }

  .filter-controls-line {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .filter-controls-line .date-input,
  .filter-controls-line input[type="date"] {
    flex: 0 0 auto;
    width: auto;
    min-width: 10.5rem;
    max-width: 11.5rem;
  }

  .filter-controls-line .btn-sm {
    flex: 0 0 auto;
  }

  .file-row {
    flex-direction: column;
    align-items: stretch;
  }

  .file-upload {
    min-width: auto;
    justify-content: center;
  }

  .checkbox-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .check-pill {
    flex: 1;
    min-width: calc(50% - 4px);
    justify-content: center;
  }

  .legend {
    flex-direction: column;
    gap: 8px;
    padding: 8px 10px;
  }

  table {
    font-size: 0.8rem;
  }

  thead th {
    padding: 10px 8px;
    font-size: 0.75rem;
  }

  tbody td {
    padding: 8px 10px;
  }

  .results-header {
    flex-direction: column;
    align-items: stretch;
  }

  .results-meta-line,
  .legend--inline {
    flex: 1 1 100%;
  }

  .btn {
    padding: 8px 14px;
    font-size: 0.8125rem;
  }
}

@media (max-width: 480px) {
  .site-header {
    padding: 16px 12px 20px;
  }

  .brand {
    gap: 10px;
  }

  .brand__icon {
    font-size: 28px;
  }

  .brand__title {
    font-size: 1.15rem;
  }

  .stat-chip {
    min-width: calc(50% - 5px);
  }

  .header-stats {
    gap: 6px;
  }

  .card {
    padding: 12px;
    margin-bottom: 12px;
  }

  .card__title {
    font-size: 0.9rem;
  }

  .card__desc {
    font-size: 0.75rem;
  }

  .file-upload {
    padding: 8px 10px;
  }

  .file-upload__btn {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
}

/* ===== 课程时间修改（调课） ===== */
.row--modified {
  background-color: rgba(255, 193, 7, 0.12) !important;
}
.row--modified td:first-child {
  border-left: 3px solid #ffc107;
}
.col-actions {
  white-space: nowrap;
  text-align: center;
  width: 70px;
}
.col-actions-head {
  width: 70px;
  text-align: center;
}
.btn-modify {
  padding: 2px 8px;
  font-size: 0.75rem;
  border: 1px solid #4a90d9;
  background: transparent;
  color: #4a90d9;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-modify:hover {
  background: #4a90d9;
  color: #fff;
}
.btn-modify--reset {
  border-color: #e0a800;
  color: #e0a800;
}
.btn-modify--reset:hover {
  background: #e0a800;
  color: #fff;
}
.mod-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}
.mod-form__row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mod-form__label {
  width: 80px;
  flex-shrink: 0;
  font-size: 0.875rem;
  color: #555;
  text-align: right;
}
.mod-form__input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s;
}
.mod-form__input:focus {
  border-color: #4a90d9;
}
.mod-form__hint {
  font-size: 0.75rem;
  color: #888;
  margin: 0 0 8px 0;
  line-height: 1.5;
}


/* ===== 筛选按钮与抽屉 ===== */
.filter-row--toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.filter-toggle {
  position: relative;
  padding: 8px 20px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 20px;
  font-size: 0.875rem;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 36px;
}

.filter-toggle:hover {
  border-color: #2563eb;
  color: #2563eb;
}

.filter-toggle[aria-expanded="true"] {
  background: #eff6ff;
  border-color: #2563eb;
  color: #2563eb;
}

.filter-toggle__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  background: #2563eb;
  color: #fff;
  border-radius: 9px;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
}

.filter-summary {
  flex: 1;
  font-size: 0.8rem;
  color: #6b7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.filter-backdrop.visible {
  opacity: 1;
  visibility: visible;
}

.filter-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 90vw;
  height: 100vh;
  max-height: 100vh;
  background: #fff;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
}

.filter-drawer.open {
  transform: translateX(0);
}

.filter-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.filter-drawer__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
}

.filter-drawer__close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 1.4rem;
  color: #9ca3af;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.filter-drawer__close:hover {
  background: #f3f4f6;
  color: #374151;
}

.filter-drawer__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 20px;
}

.filter-drawer__body .filter-item {
  margin-bottom: 16px;
}

.filter-drawer__body .filter-item > label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.filter-drawer__body .filter-item > select,
.filter-drawer__body .filter-item > input[type="date"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.875rem;
  outline: none;
  min-height: 38px;
}

.filter-drawer__body .filter-item > select:focus,
.filter-drawer__body .filter-item > input[type="date"]:focus {
  border-color: #2563eb;
}

.filter-drawer__foot {
  display: flex;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.filter-drawer__foot .btn {
  flex: 1;
  min-height: 40px;
}

/* ===== 移动端响应式 ===== */
@media (max-width: 768px) {
  .site-header__inner {
    padding: 10px 14px;
  }

  .brand__icon {
    font-size: 1.5rem;
  }

  .brand__title {
    font-size: 1.1rem;
  }

  .brand__subtitle {
    font-size: 0.75rem;
  }

  .header-stats {
    display: none;
  }

  .page {
    padding: 10px;
    gap: 10px;
  }

  .card {
    padding: 14px;
    border-radius: 12px;
  }

  .card__title {
    font-size: 1rem;
  }

  .card__desc {
    font-size: 0.78rem;
  }

  .filter-controls-line {
    flex-wrap: wrap;
    gap: 8px;
  }

  .date-input {
    flex: 1 1 100%;
    min-height: 40px;
    font-size: 0.9rem;
  }

  .btn-sm {
    min-height: 38px;
    padding: 6px 14px;
    font-size: 0.82rem;
    flex: 1;
  }

  .check-pill {
    min-height: 38px;
    padding: 6px 12px;
    font-size: 0.82rem;
  }

  .file-upload__btn {
    flex: 1 1 100%;
    text-align: center;
  }

  .filter-controls-sep {
    display: none;
  }

  .filter-row--toggle {
    margin-top: 10px;
  }

  .filter-toggle {
    min-height: 40px;
    padding: 8px 18px;
    font-size: 0.88rem;
  }

  /* 移动端：抽屉从底部滑出 */
  .filter-drawer {
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 88vh;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
  }

  .filter-drawer.open {
    transform: translateY(0);
  }

  .filter-drawer__body {
    padding: 14px 16px;
  }

  .filter-drawer__body .filter-item > select,
  .filter-drawer__body .filter-item > input[type="date"] {
    min-height: 44px;
    font-size: 0.9rem;
  }

  .room-checkboxes {
    gap: 8px;
  }

  .room-checkboxes {
    gap: 6px;
  }

  .room-checkboxes label {
    min-height: 32px;
    padding: 4px 10px;
    font-size: 0.78rem;
  }

  /* 结果表格：横向滚动 */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -14px;
    padding: 0 14px;
  }

  .table-wrap table {
    min-width: 600px;
    font-size: 0.8rem;
  }

  .table-wrap th,
  .table-wrap td {
    padding: 8px 10px;
    white-space: nowrap;
  }

  .results-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .results-title-text {
    font-size: 0.95rem;
  }

  .results-date {
    font-size: 0.8rem;
  }

  .results-hint {
    display: none;
  }

  .legend--inline {
    order: 3;
    width: 100%;
    font-size: 0.72rem;
    gap: 10px;
  }

  #copyWeekendBtn {
    min-height: 38px;
    font-size: 0.82rem;
    padding: 6px 14px;
  }

  .card--help {
    display: none;
  }

  .site-footer {
    padding: 16px 14px;
    font-size: 0.72rem;
  }

  .modal__panel {
    width: 92vw;
    max-width: 92vw;
    max-height: 88vh;
    margin: 6vh auto;
    border-radius: 14px;
  }

  .modal__head {
    padding: 14px 16px;
  }

  .modal__title {
    font-size: 1rem;
  }

  .modal__body,
  .mod-form {
    padding: 14px 16px;
  }

  .mod-form__input {
    min-height: 42px;
    font-size: 0.9rem;
  }

  .modal__actions {
    padding: 12px 16px 16px;
  }

  .modal__actions .btn {
    min-height: 42px;
    font-size: 0.88rem;
  }
}

@media (max-width: 480px) {
  .brand__subtitle {
    display: none;
  }

  .filter-controls-line .btn-sm {
    flex: 1 1 30%;
  }

  .check-pill {
    flex: 1 1 45%;
    justify-content: center;
  }

  .table-wrap table {
    min-width: 560px;
    font-size: 0.76rem;
  }

  .table-wrap th,
  .table-wrap td {
    padding: 6px 8px;
  }
}
