:root {
  --bg: #0c1118;
  --card: #151d2b;
  --border: #2a3a52;
  --text: #e6edf5;
  --muted: #8b9aaf;
  --accent: #3b82f6;
  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --purple: #a78bfa;
  --scroll-track: rgba(12, 17, 24, 0.65);
  --scroll-thumb: rgba(59, 130, 246, 0.42);
  --scroll-thumb-hover: rgba(59, 130, 246, 0.62);
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
}

/* 细滚动条（Firefox + WebKit） */
.thin-scroll {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}
.thin-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.thin-scroll::-webkit-scrollbar-track {
  background: var(--scroll-track);
  border-radius: 100px;
  margin: 4px 0;
}
.thin-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--scroll-thumb-hover), var(--scroll-thumb));
  border-radius: 100px;
  border: 1px solid rgba(15, 22, 35, 0.4);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.15);
}
.thin-scroll::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #60a5fa, var(--scroll-thumb-hover));
}

/* 预定日历弹窗内的滚动轨道（玻璃风，与深蓝背景融合） */
#modalRoomCalendar .thin-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(147, 197, 253, 0.55) rgba(255, 255, 255, 0.07);
}

#modalRoomCalendar .thin-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

#modalRoomCalendar .thin-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  margin: 6px 4px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

#modalRoomCalendar .thin-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.45);
  background: linear-gradient(
    180deg,
    rgba(224, 242, 254, 0.5) 0%,
    rgba(59, 130, 246, 0.48) 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 1px 4px rgba(0, 0, 0, 0.2);
}

#modalRoomCalendar .thin-scroll::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.82) 0%,
    rgba(96, 165, 250, 0.58) 100%
  );
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: #0e1520;
  position: sticky;
  top: 0;
  z-index: 40;
}
header h1 {
  margin: 0;
  font-size: 1.2rem;
  min-width: 0;
}
.header-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  flex-shrink: 0;
}
.header-sync-cluster {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.header-refresh-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.header-prune-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.45);
}
.header-prune-btn:hover:not(:disabled) {
  background: rgba(251, 191, 36, 0.12);
}
.header-userdate {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
/** 维护包厢：与清旧预定/刷新同高同色阶，不使用主色蓝以免顶栏刺眼 */
.header-maint-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--border);
  color: var(--muted);
}
.badge.on {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}
main { padding: 16px; max-width: 1400px; margin: 0 auto; }
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  align-items: center;
}
.toolbar-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.filter-label {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.filter-select {
  font: inherit;
  padding: 8px 12px;
  min-width: 120px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f1623;
  color: var(--text);
  cursor: pointer;
}
.filter-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
.filter-cap-wrap {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}
.filter-cap-input {
  font: inherit;
  width: 72px;
  max-width: 100%;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f1623;
  color: var(--text);
}
.filter-cap-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
.filter-cap-input::placeholder {
  color: var(--muted);
  opacity: 0.85;
}
.filter-cap-sep {
  color: var(--muted);
  font-size: 13px;
  user-select: none;
}
.filter-cap-unit {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.filter-phone-tail-wrap {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}
.filter-phone-tail-input {
  font: inherit;
  width: 88px;
  max-width: 100%;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f1623;
  color: var(--text);
}
.filter-phone-tail-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
.filter-phone-tail-input::placeholder {
  color: var(--muted);
  opacity: 0.85;
}
/* 「预定日期」与日期框、中文星期同一行，不换行 */
.filter-date-field {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px 12px;
  padding: 4px 10px 6px;
  margin: -4px -6px -6px 0;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: linear-gradient(145deg, rgba(31, 41, 55, 0.65), rgba(15, 23, 35, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 2px 10px rgba(0, 0, 0, 0.2);
}
.filter-date-field .filter-label {
  margin-bottom: 0;
  flex-shrink: 0;
}
.filter-date-field .filter-date-control {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px 14px;
  min-width: 0;
}
.filter-date-display {
  font-size: 13px;
  font-weight: 600;
  color: rgba(226, 232, 240, 0.78);
  white-space: nowrap;
  letter-spacing: 0.02em;
}
/* 工具栏预定日期 + 一键预订弹窗内日期：同一套输入框与日历按钮样式（原生日期弹层由系统/浏览器绘制，受 color-scheme 影响） */
.filter-date-input,
.modal.modal-book input.book-booking-date {
  font: inherit;
  padding: 8px 12px;
  min-width: 158px;
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(100, 116, 139, 0.45);
  background: rgba(10, 16, 28, 0.85);
  color: var(--text);
  color-scheme: dark;
  accent-color: var(--accent);
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}
.filter-date-input:hover,
.modal.modal-book input.book-booking-date:hover {
  border-color: rgba(96, 165, 250, 0.6);
  background: rgba(15, 24, 40, 0.95);
}
.filter-date-input:focus,
.modal.modal-book input.book-booking-date:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.28);
}
/* 日期原生控件里的「打开日历」图标：加大、高对比 */
.filter-date-input::-webkit-calendar-picker-indicator,
.modal.modal-book input.book-booking-date::-webkit-calendar-picker-indicator {
  cursor: pointer;
  width: 26px;
  height: 26px;
  padding: 0;
  margin-left: 2px;
  opacity: 1;
  filter: invert(53%) sepia(95%) saturate(2476%) hue-rotate(200deg) brightness(104%) contrast(98%)
    drop-shadow(0 0 5px rgba(96, 165, 250, 0.55));
}
.filter-date-input::-webkit-calendar-picker-indicator:hover,
.modal.modal-book input.book-booking-date::-webkit-calendar-picker-indicator:hover {
  filter: invert(56%) sepia(95%) saturate(2476%) hue-rotate(195deg) brightness(118%) contrast(102%)
    drop-shadow(0 0 8px rgba(147, 197, 253, 0.7));
}

.filter-date-input::-moz-calendar-picker-indicator,
.modal.modal-book input.book-booking-date::-moz-calendar-picker-indicator {
  cursor: pointer;
  width: 26px;
  height: 26px;
  padding: 2px;
  margin-left: 2px;
  opacity: 1;
  background-color: transparent;
}
.room-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 28px 16px;
  color: var(--muted);
  font-size: 14px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: rgba(15, 22, 35, 0.45);
}
.room-card--filter {
  cursor: default;
}
.room-card--filter .drag-han {
  opacity: 0.4;
  cursor: default;
}
button {
  font: inherit;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 600;
}
button.primary { background: var(--accent); color: #fff; }
button.secondary {
  background: var(--border);
  color: var(--text);
}
button.danger { background: var(--danger); color: #fff; }
button.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
button:disabled { opacity: 0.4; cursor: not-allowed; }

/* 多宫格卡片：自适应列数 */
.room-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  align-items: stretch;
}
@media (max-width: 360px) {
  .room-list {
    grid-template-columns: 1fr;
  }
}

.room-card {
  /** 无当前预定日场次：浅白雾面 + 冷灰收边，在深色页面里偏亮、不刺眼 */
  background: linear-gradient(
    168deg,
    rgba(255, 255, 255, 0.2) 0%,
    rgba(248, 250, 252, 0.11) 38%,
    rgba(71, 85, 105, 0.42) 100%
  );
  border: 1px solid rgba(203, 213, 225, 0.32);
  border-radius: 12px;
  padding: 14px 16px;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: grab;
  box-shadow:
    0 1px 8px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  position: relative;
}
/** 选定预定日但该日无场次：略再提亮，仍与「已预订」红卡区分 */
.room-card.room-card--day-idle {
  background: linear-gradient(
    168deg,
    rgba(255, 255, 255, 0.24) 0%,
    rgba(241, 245, 249, 0.14) 42%,
    rgba(71, 85, 105, 0.38) 100%
  );
  border-color: rgba(203, 213, 225, 0.38);
  box-shadow:
    0 1px 6px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
/** 所选预定日角标为「已预订」：酒红琥珀基调，与深色界面融合、不刺眼 */
.room-card.room-card--day-booked {
  background: linear-gradient(
    152deg,
    rgba(254, 202, 202, 0.14) 0%,
    rgba(185, 28, 28, 0.2) 30%,
    rgba(88, 12, 24, 0.42) 48%,
    rgba(17, 24, 38, 0.97) 100%
  );
  border-color: rgba(248, 113, 113, 0.38);
  box-shadow:
    0 4px 22px rgba(0, 0, 0, 0.32),
    0 0 0 1px rgba(239, 68, 68, 0.12),
    inset 0 1px 0 rgba(254, 215, 215, 0.14),
    inset 0 -1px 0 rgba(127, 29, 29, 0.18);
}
.room-card.room-card--filter.room-card--day-booked {
  background: linear-gradient(
    152deg,
    rgba(254, 202, 202, 0.1) 0%,
    rgba(153, 27, 27, 0.16) 38%,
    rgba(69, 10, 18, 0.48) 52%,
    rgba(13, 20, 32, 0.97) 100%
  );
  border-color: rgba(248, 113, 113, 0.3);
  box-shadow:
    0 3px 18px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(254, 215, 215, 0.1),
    inset 0 -1px 0 rgba(127, 29, 29, 0.12);
}
.room-card.dragging { opacity: 0.55; cursor: grabbing; }
.room-card.drag-over {
  outline: 2px dashed var(--accent);
  outline-offset: 2px;
}
.room-top {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding-right: 80px;
}
.room-status-pill {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 2;
  pointer-events: none;
}
.room-book-summary {
  font-size: 13px;
  color: var(--text);
  line-height: 1.45;
}
.room-book-summary .book-sum-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(42, 58, 82, 0.5);
  min-width: 0;
}
.room-book-summary .book-sum-block:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.room-book-summary .book-sum-block:first-child {
  padding-top: 0;
}
.room-book-summary .book-sum-text-row {
  width: 100%;
}
.room-book-summary .book-sum-text-row .book-sum-line {
  display: block;
  width: 100%;
  min-width: 0;
  font-size: 12px;
  line-height: 1.5;
  padding: 0;
  border: none;
}
/** 到店、取消、经理、短信同一行左对齐，不必铺满整行；经理标签随文字宽度，三钮可略加宽 */
.room-book-summary .book-sum-actions-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: 100%;
  min-width: 0;
  min-height: 28px;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  position: relative;
  z-index: 2;
}
.room-book-summary .book-sum-actions-row > .book-sum-arrived,
.room-book-summary .book-sum-actions-row > .book-sum-cancel {
  flex-shrink: 0;
}
.room-book-summary .book-sum-actions-row > .book-sum-manager-tag {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}
.room-book-summary .book-sum-actions-row > .book-sum-copy-sms,
.room-book-summary .book-sum-actions-row > .book-sum-share-card {
  flex-shrink: 0;
}
.room-book-summary .book-sum-actions-row .book-sum-manager-val {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.room-book-summary .book-sum-actions-row > .book-sum-arrived {
  padding: 2px 10px;
  min-width: 3.5em;
}
.room-book-summary .book-sum-actions-row > .book-sum-cancel {
  padding: 2px 10px;
  min-width: 2.75em;
}
.room-book-summary .book-sum-actions-row > .book-sum-copy-sms,
.room-book-summary .book-sum-actions-row > .book-sum-share-card {
  padding: 2px 10px;
  min-width: 2.75em;
}
.room-book-summary .book-sum-cancel {
  flex-shrink: 0;
  font-size: 11px;
  padding: 2px 10px;
}
.room-book-summary .book-sum-arrived {
  flex-shrink: 0;
  font-size: 11px;
  padding: 2px 8px;
  margin-right: 0;
  white-space: nowrap;
}
.room-book-summary .book-sum-arrived--yes {
  color: var(--ok, #2d9964);
  border-color: rgba(45, 153, 100, 0.45);
  background: rgba(45, 153, 100, 0.12);
}
.room-book-summary .book-sum-arrived--no {
  color: var(--muted);
  border-color: rgba(120, 130, 150, 0.45);
}
.room-book-summary .book-sum-arrived:disabled {
  opacity: 0.55;
}
/** 经理标签：随文案宽度（inline-flex），整行不足时姓名省略 */
.room-book-summary .book-sum-manager-tag {
  display: inline-flex;
  flex: 0 1 auto;
  align-items: center;
  flex-wrap: nowrap;
  gap: 2px;
  font-size: 11px;
  line-height: 1.35;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(212, 175, 55, 0.38);
  background: rgba(212, 175, 55, 0.08);
  white-space: nowrap;
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.room-book-summary .book-sum-manager-key {
  flex-shrink: 0;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.room-book-summary .book-sum-manager-val {
  flex: 0 1 auto;
  min-width: 0;
  color: #e8c76b;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.room-book-summary--idle {
  color: var(--muted);
  font-size: 12px;
}
.room-title-cluster {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}
.room-name-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 0 1 auto;
}
.room-cap-loc-row {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.4;
  width: 100%;
  padding-left: 1.65rem;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/**
 * 预定摘要区：右侧不必与上方 room-top 同样为角标留 80px（角标仅叠在标题行），略向右扩宽，
 * 便于「到店、取消、经理、短信」一行展示。
 */
.room-book-row {
  width: 100%;
  padding-right: 14px;
  padding-left: 1.65rem;
  box-sizing: border-box;
}
.room-book-row .room-book-summary {
  text-align: left;
  white-space: normal;
  overflow: visible;
}
.drag-han {
  cursor: grab;
  color: var(--muted);
  user-select: none;
  font-size: 18px;
  line-height: 1;
}
/** 包厢角标：各状态色相、明暗拉开，一扫可辨 */
.st-pill {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.st-idle {
  background: linear-gradient(
    180deg,
    rgba(71, 85, 105, 0.55) 0%,
    rgba(51, 65, 85, 0.4) 100%
  );
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.45);
}
.st-reserved {
  background: linear-gradient(
    180deg,
    rgba(220, 38, 38, 0.52) 0%,
    rgba(153, 27, 27, 0.48) 100%
  );
  color: #fef2f2;
  border-color: rgba(252, 165, 165, 0.48);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 14px rgba(248, 113, 113, 0.18);
}
.st-dining {
  background: linear-gradient(
    180deg,
    rgba(22, 163, 74, 0.62) 0%,
    rgba(21, 128, 61, 0.5) 100%
  );
  color: #ecfdf5;
  border-color: rgba(134, 239, 172, 0.52);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 12px rgba(34, 197, 94, 0.18);
}
.st-cleaning {
  background: linear-gradient(
    180deg,
    rgba(217, 119, 6, 0.58) 0%,
    rgba(180, 83, 9, 0.46) 100%
  );
  color: #fffbeb;
  border-color: rgba(253, 230, 138, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.st-disabled {
  background: linear-gradient(
    180deg,
    rgba(220, 38, 38, 0.58) 0%,
    rgba(185, 28, 28, 0.46) 100%
  );
  color: #fef2f2;
  border-color: rgba(252, 165, 165, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.room-cap-line,
.room-meta-line {
  font-size: 13px;
  color: var(--muted);
  margin: -4px 0 0;
  line-height: 1.45;
}
/* 底部操作区：空闲/停用 与 一行三钮 固定 12px 间距，整块贴卡片底，摘要区用 margin-top:auto 吸收高度差 */
.room-card-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
  width: 100%;
  flex-shrink: 0;
}
.quick-st {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.quick-st button {
  padding: 6px 12px;
  font-size: 12px;
}
.booking-block {
  font-size: 13px;
  color: var(--muted);
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}
.booking-block strong { color: var(--text); }
.row-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: clamp(5px, 1.8%, 10px);
  min-width: 0;
}
/* 一行三钮：按比例分配宽度，不换行（与全局 button padding 收窄） */
.room-card .row-actions > button {
  flex: 1 1 0;
  min-width: 0;
  padding: 9px clamp(6px, 5%, 12px);
  font-size: 12px;
  line-height: 1.28;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.room-card .row-actions > button:nth-child(1) {
  flex: 1.12 1 0%;
}
.room-card .row-actions > button:nth-child(2) {
  flex: 1 1 0%;
}
.room-card .row-actions > button:nth-child(3) {
  flex: 1.28 1 0%;
}
.modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-bg.open { display: flex; }
.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow: auto;
  padding: 18px;
  padding-top: 16px;
}
.modal.modal-wide {
  max-width: 480px;
}
.modal.modal-book {
  max-width: 540px;
}

/* ---------- 预定日历：全宽大屏 + 玻璃质感 ---------- */
.modal-bg.modal-bg-calendar {
  display: none;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  inset: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  z-index: 120;
}

.modal-bg-calendar.open {
  display: flex;
}

.cal-bg-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #081424 url(/media/calendar-bg.png) center / cover no-repeat;
  pointer-events: none;
}

.cal-bg-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    155deg,
    rgba(6, 18, 44, 0.5) 0%,
    rgba(2, 6, 16, 0.78) 100%
  );
}

.cal-glass-shell {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: clamp(10px, 2vw, 28px);
  border-radius: 22px;
  overflow-x: hidden;
  overflow-y: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 28px 100px rgba(0, 0, 0, 0.5);
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.cal-hero-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  padding: clamp(14px, 2.2vw, 24px) clamp(18px, 3.2vw, 40px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.cal-hero-left {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-self: start;
}

.cal-hero-right {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
}

.cal-hero-center {
  justify-self: center;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
  text-align: center;
  min-width: 0;
}

.cal-title-main.cal-title-main--hero-center {
  margin: 0;
  font-size: clamp(1.05rem, 2.4vw, 1.42rem);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.cal-week-badge.cal-week-badge--hero-sub {
  flex-shrink: 0;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
}

.cal-hero-arrow {
  flex-shrink: 0;
  font: inherit;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
  cursor: pointer;
}

.cal-hero-arrow:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.38);
}

.cal-ym-block {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.98);
  font-weight: 700;
  font-size: clamp(1.15rem, 3vw, 2rem);
  letter-spacing: 0.02em;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.35);
}

/* 年与月仅用数字展示：等宽数字、居中、适配系统 UI 字体 */
.cal-glass-select {
  font-family:
    ui-sans-serif,
    system-ui,
    "Segoe UI Variable",
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei UI",
    "Microsoft YaHei",
    sans-serif;
  font-weight: 600;
  font-size: inherit;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: 0.06em;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  appearance: none;
  color: #fff;
  background-color: rgba(0, 0, 0, 0.22);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-opacity='0.72' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 11px 11px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  padding: 7px 32px 7px 16px;
  cursor: pointer;
  text-align: center;
}

.cal-glass-select:hover {
  background-color: rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.3);
}

.cal-glass-select:focus {
  outline: none;
  border-color: rgba(147, 197, 253, 0.75);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.cal-glass-select::-ms-expand {
  display: none;
}

.cal-glass-select option {
  font-family: inherit;
  font-variant-numeric: tabular-nums lining-nums;
  font-weight: 600;
  color: #e2e8f0;
  background: #0f172a;
  padding: 8px;
}

/* 年与月：顶栏字号为 clamp，年框若 max-width 过小会裁切四位年份；用 em 随行高缩放 */
.cal-glass-select--year {
  min-width: 6.75em;
  max-width: none;
}

.cal-glass-select--month {
  min-width: 5.2ch;
  max-width: 5.75rem;
}

.cal-week-badge {
  justify-self: center;
  padding: 9px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.94);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.cal-pill-tab {
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(0, 0, 0, 0.16);
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
}

.cal-pill-tab:hover {
  background: rgba(255, 255, 255, 0.12);
}

.cal-pill-tab--on {
  background: rgba(59, 130, 246, 0.45);
  border-color: rgba(147, 197, 253, 0.55);
  color: #fff;
  cursor: default;
}

.cal-pill-close {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  margin-left: 4px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
  font-size: 1.42rem;
  line-height: 1;
  cursor: pointer;
  font-weight: 500;
}

.cal-pill-close:hover {
  background: rgba(239, 68, 68, 0.4);
}

.cal-sheet {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 clamp(12px, 3vw, 40px) clamp(14px, 2.2vw, 28px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/** 顶栏下方：包厢说明（居中） */
.cal-sub-bar {
  flex-shrink: 0;
  padding: 8px clamp(12px, 3vw, 40px) 10px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cal-sub-bar .cal-title-sub.muted {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.cal-title-main {
  margin: 0;
  font-size: clamp(1.1rem, 2.8vw, 1.7rem);
  color: rgba(255, 255, 255, 0.98);
  font-weight: 700;
}

.cal-title-sub.muted {
  color: rgba(255, 255, 255, 0.62);
}

.cal-week-head--glass {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin: 0 2px 6px;
  padding: 0;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
}

.cal-grid--glass {
  flex: 0 0 auto;
  min-height: min(240px, 40vh);
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  /** 各行随该行内预定最多的格子增高，不按 1fr 均分压扁 */
  grid-auto-rows: minmax(min-content, auto);
  grid-template-rows: none;
  gap: 0;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  overflow: visible;
  background: rgba(0, 0, 0, 0.1);
}

.cal-grid--glass > .cal-cell {
  /** 空行/补位格有底线高度；有预定时由内容撑满本行，随行增高 */
  align-self: stretch;
  min-height: clamp(56px, 9vh, 104px);
}

.cal-cell.cal-cell--pad {
  visibility: visible;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.06);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cal-day-btn.cal-cell--today .cal-cell-num {
  color: #93c5fd;
}

.cal-cell.cal-day-btn {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  justify-content: flex-start;
  width: 100%;
  margin: 0;
  cursor: pointer;
  border: none;
  border-radius: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: clamp(10px, 1.6vw, 20px);
  font: inherit;
  color: rgba(255, 255, 255, 0.96);
  background: rgba(0, 0, 0, 0.06);
  transition: background 0.14s ease;
}

.cal-cell.cal-day-btn:nth-child(7n) {
  border-right: none;
}

.cal-grid--glass > .cal-cell.cal-cell--pad:nth-child(7n) {
  border-right: none;
}

.cal-cell.cal-day-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
}

.cal-cell.cal-day-btn:focus-visible {
  outline: 2px solid rgba(147, 197, 253, 0.85);
  outline-offset: -2px;
  z-index: 2;
}

/* 日历日格：大号日期在左，右侧为预定摘要（不靠悬停 tooltip） */
.cal-cell-head-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: flex-start;
  gap: clamp(8px, 1.2vw, 12px);
  width: 100%;
  min-width: 0;
}

.cal-cell-booking-meta {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
}

.cal-cell-booking-line {
  font-size: clamp(9px, 2vw, 11px);
  line-height: 1.38;
  color: rgba(255, 255, 255, 0.9);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.cal-cell-num {
  font-size: clamp(1.25rem, 3.8vw, 2.35rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.cal-day-btn.cal-cell--today {
  background: rgba(59, 130, 246, 0.22);
}

.cal-day-btn.cal-cell--book:not(.cal-cell--selected) {
  background: rgba(251, 191, 36, 0.08);
}

.cal-day-btn.cal-cell--selected {
  background: rgba(59, 130, 246, 0.45);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 620px) {
  .cal-hero-bar {
    grid-template-columns: 1fr;
    row-gap: 12px;
  }

  .cal-hero-left,
  .cal-hero-right {
    justify-self: center;
  }

  .cal-week-badge {
    order: -1;
  }
}

.muted-text,
.muted {
  color: var(--muted);
}

.book-hint {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 12px;
  line-height: 1.45;
}
.book-hint code {
  font-size: 12px;
  background: rgba(0, 0, 0, 0.28);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text);
}
.book-rows {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 10px;
}
.book-slot {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: #0f1623;
}
.book-slot-head {
  width: 100%;
  margin-bottom: 12px;
}
/* 单行玻璃条：预定日期、场次同一行；与下方人数/预订人列宽一致（grid 等分 + 与 fields 同宽） */
.book-slot-head-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 14px;
  align-items: end;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 8px 0 10px;
  margin: 0;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: linear-gradient(145deg, rgba(31, 41, 55, 0.65), rgba(15, 23, 35, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 2px 10px rgba(0, 0, 0, 0.2);
  overflow-x: auto;
}
.book-slot-head-bar .book-slot-head-part {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: flex-end;
  min-width: 0;
}
.book-slot-head-bar .book-slot-head-part--date {
  min-width: 0;
  max-width: 100%;
}
.book-slot-head-bar .book-slot-head-part--slot {
  min-width: 0;
  max-width: 100%;
}
.book-slot-head-bar .book-slot-head-lab {
  font-size: 12px;
  line-height: 1.25;
  min-height: 1.25em;
  color: rgba(186, 198, 216, 0.92);
  letter-spacing: 0.02em;
}
.book-slot-head-lab {
  font-size: 12px;
  color: var(--muted);
}
/* 玻璃条内仅预定日期 + 场次；人数已下至第二行 */
.book-slot-head-bar input.book-booking-date,
.book-slot-head-bar select.book-slot-select {
  width: 100%;
  margin: 0;
  box-sizing: border-box;
  min-height: 40px;
}
.book-slot-head-bar select.book-slot-select {
  min-width: 0;
}
/** 首行日期框：覆盖弹窗内全局 min-width:158px，与「人数」列右缘对齐，边距与字号随屏宽自适应 */
.modal.modal-book .book-slot-head-bar input.book-booking-date {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 8px clamp(6px, 2.4vw, 12px);
  font-size: clamp(12px, 3.4vw, 15px);
}
.modal.modal-book .book-slot-head-bar input.book-booking-date::-webkit-calendar-picker-indicator {
  width: clamp(17px, 4.8vw, 24px);
  height: clamp(17px, 4.8vw, 24px);
  margin-left: clamp(2px, 0.8vw, 6px);
  padding: 0;
}
.modal.modal-book select.book-slot-select {
  font: inherit;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(100, 116, 139, 0.45);
  background: rgba(10, 16, 28, 0.85);
  color: var(--text);
  color-scheme: dark;
  accent-color: var(--accent);
  min-width: 104px;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}
.modal.modal-book select.book-slot-select:hover {
  border-color: rgba(96, 165, 250, 0.6);
  background: rgba(15, 24, 40, 0.95);
}
.modal.modal-book select.book-slot-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.28);
}
.modal.modal-book .book-slot-head-bar select.book-slot-select {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  padding: 8px clamp(6px, 2.4vw, 12px);
  font-size: clamp(12px, 3.4vw, 15px);
}
/* 人数改在 .book-hc-guest-row 内，与预订人同行 */
.modal.modal-book .book-hc-guest-row input.book-headcount {
  font: inherit;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(100, 116, 139, 0.45);
  background: rgba(10, 16, 28, 0.85);
  color: var(--text);
  color-scheme: dark;
  accent-color: var(--accent);
  width: 100%;
  margin: 0;
  box-sizing: border-box;
  min-height: 40px;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}
.modal.modal-book .book-hc-guest-row input.book-headcount:hover {
  border-color: rgba(96, 165, 250, 0.6);
  background: rgba(15, 24, 40, 0.95);
}
.modal.modal-book .book-hc-guest-row input.book-headcount:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.28);
}
.book-slot-head .book-slot-del {
  margin-left: auto;
  flex-shrink: 0;
  align-self: center;
}
.book-slot-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.modal.modal-book label.book-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}
.modal.modal-book .book-field-lab {
  font-size: 12px;
  color: var(--muted);
}
.modal.modal-book .book-guest,
.modal.modal-book .book-phone,
.modal.modal-book .book-manager,
.modal.modal-book .book-note {
  width: 100%;
  margin: 0;
}
/* 预订人、电话强制同一行，两侧等分且可收窄 */
.book-guest-row {
  display: flex;
  flex-flow: row nowrap;
  align-items: flex-end;
  gap: 10px 14px;
  width: 100%;
  min-width: 0;
}
.modal.modal-book .book-field--guest {
  min-width: 0;
  margin: 0;
}
.modal.modal-book .book-field--phone {
  min-width: 0;
  margin: 0;
}
/* 人数+预订人 一行；电话+经理 一行；到店时间单独一行（与首行日期+场次同宽：grid 双列） */
.book-hc-guest-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 14px;
  align-items: end;
  width: 100%;
  min-width: 0;
}
.book-hc-guest-row .book-slot-head-part--headcount {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: flex-end;
}
.book-hc-guest-row .book-field--guest {
  min-width: 0;
  margin: 0;
}
.book-phone-mgr-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 14px;
  align-items: end;
  width: 100%;
  min-width: 0;
}
.modal.modal-book .book-phone-mgr-row .book-field--phone,
.modal.modal-book .book-phone-mgr-row .book-field--manager {
  min-width: 0;
  margin: 0;
}
.book-arrival-only-row {
  width: 100%;
  min-width: 0;
}
.modal.modal-book .book-hc-guest-row input.book-guest,
.modal.modal-book .book-phone-mgr-row input.book-phone,
.modal.modal-book .book-phone-mgr-row input.book-manager {
  min-height: 40px;
  box-sizing: border-box;
}
/** 到店时间 + 经理同一行（与预订人/电话行一致对齐方式） */
.book-arrival-manager-row {
  display: flex;
  flex-flow: row nowrap;
  align-items: flex-end;
  gap: 10px 14px;
  width: 100%;
  min-width: 0;
}
.book-arrival-manager-row .book-field--arrival {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  margin: 0;
}
.modal.modal-book .book-field--manager {
  flex: 1 1 0%;
  min-width: 0;
  margin: 0;
}
.modal.modal-book .book-field--arrival {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}
.book-time-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.modal.modal-book select.book-time-h,
.modal.modal-book select.book-time-m {
  font: inherit;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f1623;
  color: var(--text);
  min-width: 76px;
}
.book-time-sep {
  color: var(--muted);
  font-weight: 600;
  user-select: none;
}
.book-add-slot {
  width: 100%;
  margin-bottom: 4px;
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  padding-right: 0;
}
.modal-head h2 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.35;
  padding-top: 2px;
}
.modal-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  line-height: 1;
  font-size: 1.35rem;
  font-weight: 500;
  border-radius: 10px;
  background: rgba(42, 58, 82, 0.55);
  color: var(--muted);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover {
  color: var(--text);
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.45);
}
#modalBook .modal > h2 {
  margin: 0 0 14px;
  font-size: 1.1rem;
}
.modal label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 10px 0 4px;
}
.modal input,
.modal textarea {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f1623;
  color: var(--text);
}
.modal textarea { min-height: 72px; resize: vertical; }
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}
.maint-section {
  margin-bottom: 18px;
}
.maint-h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 600;
}
.maint-add-btn {
  margin-top: 10px;
  width: 100%;
}
.maint-inline-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin-top: 10px;
}
@media (max-width: 420px) {
  .maint-inline-two {
    grid-template-columns: 1fr;
  }
}
.maint-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}
.maint-empty-hint {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.maint-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px 12px;
  background: #0f1623;
  border: 1px solid var(--border);
  border-radius: 8px;
}
/** 与列表卡片一致：当前预定日该包厢已预订时略提亮为酒红调 */
.maint-row.maint-row--booked {
  background: linear-gradient(
    158deg,
    rgba(254, 202, 202, 0.1) 0%,
    rgba(127, 29, 29, 0.22) 42%,
    rgba(15, 22, 35, 0.96) 100%
  );
  border-color: rgba(248, 113, 113, 0.32);
  box-shadow:
    0 2px 12px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(254, 215, 215, 0.08);
}
/** 第一行：包厢名称 + 包厢号 + 删除（网格强制同行，避免窄屏折行错乱） */
.maint-row-line1 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px 10px;
  width: 100%;
}
.maint-row-line1 .maint-name-input {
  min-width: 0;
}
.maint-row-line1 .maint-num-wrap {
  flex: none;
  min-width: 0;
}
.maint-row-line1 .maint-row-actions {
  margin-left: 0;
}
/* 已有包厢：容纳人数 + 位置同一行 */
.maint-row-fields {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  width: 100%;
}
.maint-row-fields .maint-loc-hint {
  flex: 1 1 100%;
  margin: 0;
}
.maint-loc-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 160px;
  min-width: 0;
}
.maint-loc-lab {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
input.maint-loc-input {
  flex: 1 1 80px;
  min-width: 0;
  max-width: 100%;
  padding: 6px 8px;
  font: inherit;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f1623;
  color: var(--text);
}
.maint-loc-hint {
  font-size: 11px;
  color: var(--muted);
}
input.maint-name-input {
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  min-width: 0;
  flex: 1 1 120px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f1623;
  color: var(--text);
}
input.maint-name-input:focus {
  outline: none;
  border-color: var(--accent);
}
.maint-cap-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.maint-cap-lab {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
input.maint-cap-input {
  width: 72px;
  max-width: 100%;
  padding: 6px 8px;
  font: inherit;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f1623;
  color: var(--text);
}
.maint-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}
button.small {
  padding: 6px 12px;
  font-size: 12px;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: 10px;
  z-index: 200;
  display: none;
}
.toast.show { display: block; }

/** 离线授权门禁（高于登录门 z-index） */
.license-gate.modal-bg {
  z-index: 160;
}
.license-gate-screen-card h2 {
  margin-top: 0;
}
.license-gate-screen-card .license-gate-hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 14px;
}
.license-fp-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}
.license-fp-pre {
  flex: 1 1 220px;
  margin: 0;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
  word-break: break-all;
  max-height: 120px;
  overflow: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0a1018;
  color: var(--text);
}
.license-json-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 180px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f1623;
  color: var(--text);
  font-family: ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.4;
  resize: vertical;
}
/** 登录门（未登录时阻挡操作） */
.login-gate.modal-bg {
  z-index: 150;
}
.modal.modal-narrow {
  max-width: 380px;
}

/**
 * 保存预订时的二次提示（同厅覆盖 / 跨厅继续·换包厢）：与「预定提示」一致
 * 叠在 #modalBook 之上，暗色卡片 + 模糊遮罩
 */
.modal-bg-booking-prompt {
  z-index: 165;
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.modal-booking-prompt-card {
  max-width: min(440px, 94vw);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.35),
    0 24px 56px rgba(0, 0, 0, 0.45);
}

.modal-booking-prompt-card > h2 {
  margin: 0 0 14px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

.modal-booking-prompt-card .book-hint {
  color: var(--text);
  opacity: 0.9;
  margin-bottom: 10px;
}

.modal-booking-prompt-card .book-hint:last-of-type {
  margin-bottom: 0;
}

.modal-booking-prompt-card .book-hint.muted {
  color: var(--muted);
  opacity: 1;
  font-size: 12px;
}

.modal-booking-prompt-card .modal-actions-booking-prompt {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
  align-items: stretch;
  margin-top: 18px;
}

.modal-booking-prompt-card .modal-actions-booking-prompt button {
  flex: 1 1 120px;
  min-width: 0;
  padding: 10px 14px;
  font-size: 13px;
}
.login-gate-card h2 {
  margin-top: 0;
}
.login-gate-hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 12px;
}
.login-gate-lab {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.login-gate-input {
  width: 100%;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f1623;
  color: var(--text);
  font: inherit;
}
.login-gate-err {
  font-size: 13px;
  color: var(--danger);
  min-height: 1.2em;
  margin: 0 0 10px;
}
.login-gate-submit {
  width: 100%;
  margin-top: 6px;
}
.header-logout-btn,
.header-user-admin-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/** 预定短信模版独立弹窗（导航栏入口） */
.modal.booking-sms-tpl-modal {
  max-width: min(520px, 96vw);
}
.booking-sms-tpl-modal .modal-head {
  margin-bottom: 0;
}
.booking-sms-tpl-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 10px 0 14px;
  line-height: 1.45;
}
.booking-sms-tpl-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 10px;
}
.booking-sms-tpl-field input,
.booking-sms-tpl-field textarea {
  font: inherit;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f1623;
  color: var(--text);
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  min-height: 0;
}
.booking-sms-tpl-save {
  width: 100%;
  margin-top: 8px;
}

.booking-sms-tpl-logo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 12px;
}
.booking-sms-tpl-logo-preview {
  max-height: 56px;
  max-width: 160px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #0f1623;
}
.booking-sms-tpl-logo-file-wrap input[type='file'] {
  font-size: 12px;
}
.booking-sms-tpl-inline-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.booking-sms-tpl-dynamic-list,
.booking-sms-tpl-gallery-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}
.booking-sms-tpl-list-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.booking-sms-tpl-list-row input[type='text'] {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f1623;
  color: var(--text);
  font: inherit;
}
.booking-sms-tpl-gallery-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px dashed var(--border);
  border-radius: 8px;
}
.booking-sms-tpl-gallery-prev {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #0f1623;
}
input.booking-sms-tpl-gallery-file {
  font-size: 12px;
  max-width: 220px;
}

.maint-inline-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.maint-inline-field--full {
  margin-top: 10px;
}
.maint-num-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 140px;
  min-width: 0;
}
.maint-num-lab {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
input.maint-num-input {
  width: 96px;
  max-width: 100%;
  padding: 6px 8px;
  font: inherit;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f1623;
  color: var(--text);
}

.room-number-suffix {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.92em;
}

/** 用户管理弹窗宽表 */
.modal.user-mgmt-modal {
  max-width: min(920px, 96vw);
}

/** 包厢卡片每场：短信 / 分享 按钮（与到店、取消、经理同排） */
.room-book-summary .book-sum-copy-sms,
.room-book-summary .book-sum-share-card {
  flex-shrink: 0;
  font-size: 11px;
  padding: 2px 10px;
  white-space: nowrap;
}

.user-mgmt-h3 {
  font-size: 13px;
  margin: 16px 0 8px;
  color: var(--text);
}
.user-mgmt-add {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.user-mgmt-add-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px 14px;
  align-items: end;
  margin-bottom: 12px;
}
.user-mgmt-add-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  min-width: 0;
}
.user-mgmt-add-grid input,
.user-mgmt-add-grid select {
  font: inherit;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f1623;
  color: var(--text);
}
.user-mgmt-table-wrap {
  max-height: min(420px, 52vh);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.user-mgmt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.user-mgmt-table th,
.user-mgmt-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(42, 58, 82, 0.55);
  vertical-align: middle;
  text-align: left;
}
.user-mgmt-table th {
  background: rgba(21, 29, 43, 0.85);
  position: sticky;
  top: 0;
  z-index: 1;
  font-weight: 700;
}
.user-mgmt-table input {
  font: inherit;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #0f1623;
  color: var(--text);
  width: 100%;
  max-width: 140px;
  box-sizing: border-box;
}
.user-mgmt-table td.user-mgmt-cell-user {
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.user-mgmt-table td.user-mgmt-cell-pwd {
  color: var(--muted);
  letter-spacing: 1px;
}
.user-mgmt-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
