* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, "PingFang SC", sans-serif;
  background: radial-gradient(circle at top, #0b1120 0%, #020617 55%, #020617 100%);
  color: #e5e7eb;
}
a { color: #38bdf8; text-decoration: none; }
a:hover { text-decoration: underline; }
input, select, button { font: inherit; }

.layout {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 220px;
  background: rgba(15,23,42,0.98);
  color: #e5e7eb;
  padding: 18px 0;
}
.sidebar a {
  display: block;
  padding: 10px 22px;
  color: rgba(249,250,251,.78);
  font-size: 14px;
}
.sidebar a:hover,
.sidebar a.active {
  background: linear-gradient(90deg, #22c55e 0%, #0ea5e9 100%);
  color: #020617;
  font-weight: 600;
}
.main {
  flex: 1;
  padding: 24px;
}
.card {
  background:
    radial-gradient(circle at top left, rgba(56,189,248,.16), transparent 60%),
    radial-gradient(circle at bottom right, rgba(34,197,94,.14), transparent 60%),
    rgba(15,23,42,0.98);
  border-radius: 16px;
  padding: 20px 20px 18px;
  margin-bottom: 18px;
  box-shadow: 0 18px 45px rgba(15,23,42,.6);
  border: 1px solid rgba(148,163,184,.28);
  backdrop-filter: blur(12px);
}
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid rgba(30,41,59,.9);
  font-size: 13px;
}
th {
  background: rgba(15,23,42,.96);
  font-weight: 600;
  color: #9ca3af;
}

/* Booking表格：列宽随内容自适应 + 横向滚动时表头保持可读 */
.table-scroll { overflow-x: auto; }
.table-scroll table {
  width: max-content; /* 让“列数多 -> 表格更宽”，避免把“周期与时间”挤窄 */
  min-width: 100%;
  table-layout: auto;
  display: table; /* 覆盖移动端媒体查询里对 table 的 display:block */
  overflow-x: visible; /* 横向滚动由外层容器负责 */
}
.table-scroll thead th {
  position: static; /* 竖向滚动时表头跟内容一起动 */
  background: rgba(15,23,42,.96);
}
.table-scroll th.time-range-col,
.table-scroll td.time-range-col {
  white-space: pre-line;
  word-break: break-word;
}
.btn {
  padding: 8px 16px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .02em;
}
.btn-primary {
  background: linear-gradient(90deg, #22c55e 0%, #14b8a6 50%, #0ea5e9 100%);
  color: #020617;
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-danger {
  background: linear-gradient(90deg, #fb7185 0%, #ef4444 100%);
  color: #fee2e2;
}
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 13px;
  color: #e5e7eb;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  max-width: 420px;
  padding: 8px 12px;
  border: 1px solid rgba(148,163,184,.6);
  border-radius: 10px;
  background: rgba(15,23,42,.85);
  color: #e5e7eb;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #22c55e;
  box-shadow: 0 0 0 1px rgba(34,197,94,.5);
}

/* Responsive layout */
@media (max-width: 900px) {
  .layout {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    display: flex;
    overflow-x: auto;
    padding: 8px 8px 10px;
  }
  .sidebar a {
    padding: 8px 14px;
    white-space: nowrap;
    font-size: 13px;
  }
  .main {
    padding: 16px 12px 24px;
  }
  table {
    display: block;
    width: 100%;
    overflow-x: auto;
  }
  /* 覆盖移动端的全局 table display:block，避免导致表头/表身在横向滚动时错位 */
  .table-scroll table {
    display: table;
    width: max-content;
    overflow-x: visible;
  }
}

@media (max-width: 600px) {
  .card {
    padding: 16px 14px;
    border-radius: 14px;
  }
  th, td {
    padding: 9px 8px;
    font-size: 12px;
  }
  .btn {
    padding: 7px 12px;
    font-size: 12px;
  }
}

/* 模态框：白底需深色文字，确保可读 */
.modal-box,
.modal-box * {
  color: #1f2937;
}
.modal-box .form-group label {
  color: #374151;
}
.modal-box input,
.modal-box select,
.modal-box textarea {
  background: #f9fafb;
  color: #111827;
  border-color: #d1d5db;
}
.modal-box .btn {
  color: inherit;
}
.modal-box .btn-primary {
  color: #020617;
}
.modal-box .btn:not(.btn-primary) {
  background: #e5e7eb;
  color: #374151;
}
.modal-box #consume-modal-booking-info,
.modal-box .text-muted {
  color: #6b7280;
}
.modal-box #consume-modal-error,
.modal-box #edit-modal-error,
.modal-box #copy-modal-error,
.modal-box #consumption-error,
.modal-box #consumption-upload-error {
  color: #dc2626;
}

/* 编辑周期弹窗内表格：表头浅色背景、深色文字 */
.modal-box .edit-slots-table thead th {
  background: #f3f4f6;
  color: #1f2937;
}

/* 编辑周期弹窗：加宽，避免列被压缩 */
.modal-box.schedule-edit-modal {
  width: min(96vw, 1280px);
  max-width: 1280px;
}

/* 编辑表格容器：列多时横向滚动，保证每列宽度可读 */
.modal-box .edit-slots-wrap {
  width: 100%;
  overflow-x: auto;
}
.modal-box .edit-slots-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}

/* 编辑周期表格：增加隔行底色 */
.modal-box .edit-slots-table tbody tr:nth-child(odd) {
  background: #ffffff;
}
.modal-box .edit-slots-table tbody tr:nth-child(even) {
  background: #f8fafc;
}
.modal-box .edit-slots-table tbody tr:hover {
  background: #eef6ff;
}

/* 加宽教练列，并让多选框更易读 */
.modal-box .edit-slots-table th.coach-col,
.modal-box .edit-slots-table td:nth-child(6) {
  min-width: 260px;
}
.modal-box .edit-slots-table .edit-slot-coaches {
  min-width: 240px;
  min-height: 104px;
}

