:root {
  --bg: #e8ecf4;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.85);
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  --text: #0f172a;
  --muted: #64748b;
  --blue: #2563eb;
  --blue-soft: #dbeafe;
  --orange: #ea580c;
  --orange-soft: #ffedd5;
  --green: #16a34a;
  --radius: 22px;
  --radius-lg: 28px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: 'Segoe UI', system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 600px at 10% -10%, #dbeafe 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #e0e7ff 0%, transparent 50%), var(--bg);
}

.hidden {
  display: none !important;
}

.glass {
  background: var(--glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  border-radius: var(--radius-lg);
}

/* ----- 登录 ----- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 40px 36px 44px;
}

.login-brand {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.login-sub {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--muted);
}

.field input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  font-size: 15px;
  outline: none;
  background: rgba(255, 255, 255, 0.9);
}

.field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn-primary {
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.35);
}

.btn-primary.btn-inline {
  width: auto;
  min-width: 120px;
  margin-top: 0;
  padding: 12px 28px;
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-secondary {
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-weight: 600;
  cursor: pointer;
}

.login-error {
  color: #dc2626;
  font-size: 13px;
  margin: 0 0 8px;
}

/* ----- 布局 ----- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  padding: 28px 20px;
  margin: 20px 0 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-self: flex-start;
  position: sticky;
  top: 20px;
}

.sidebar-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 4px 8px;
}

.logo-dot {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #6366f1);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.brand-cn {
  font-weight: 800;
  font-size: 15px;
  line-height: 1.2;
}

.brand-en {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.55);
  color: var(--text);
}

.nav-item.active {
  background: rgba(37, 99, 235, 0.12);
  color: var(--blue);
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px 24px 32px 12px;
  min-width: 0;
}

.topbar {
  padding: 22px 26px;
  margin-bottom: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.page-title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-desc {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.pill {
  font-size: 12px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
}

.pill-green {
  background: #dcfce7;
  color: var(--green);
}

.content {
  flex: 1;
}

.view {
  animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.section-heading {
  margin: 28px 0 16px;
  font-size: 17px;
  font-weight: 800;
}

.grid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.stat-card {
  padding: 20px 20px 22px;
}

.stat-card h4 {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.stat-card .num {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.grid-venues {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.venue-card {
  padding: 22px 22px 24px;
  position: relative;
  overflow: hidden;
}

.venue-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), transparent 40%);
  pointer-events: none;
}

.venue-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
  position: relative;
}

.venue-meta {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--muted);
  position: relative;
}

.venue-remain {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 10px;
  position: relative;
}

.price-range {
  font-size: 22px;
  font-weight: 900;
  color: var(--orange);
  position: relative;
}

.venue-card-click {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.venue-card-click:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.venue-card-click:focus {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.venue-card-hint {
  margin-top: 12px;
  font-size: 12px;
  position: relative;
}

.panel {
  padding: 22px 24px;
}

.muted {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

.toolbar {
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.field textarea {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  width: 100%;
  box-sizing: border-box;
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  margin-bottom: 18px;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

.field-inline {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}

.field-inline input {
  width: 100px;
}

.venue-form .field.field-inline {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
}

/* 弹窗 */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px 28px 24px;
  z-index: 1;
}

.modal-title {
  margin: 0 0 20px;
  font-size: 20px;
  font-weight: 800;
}

.venue-form .field {
  margin-bottom: 16px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

.modal-actions .btn-primary {
  width: auto;
  min-width: 120px;
}

.cover-upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

.cover-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.cover-size-hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  flex: 1;
  min-width: 200px;
}

.cover-preview-wrap {
  margin-top: 12px;
}

.cover-preview-wrap.hidden {
  display: none;
}

.cover-preview-img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  object-fit: contain;
  background: #f8fafc;
}

.table-wrap {
  overflow: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.data-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.row-actions {
  display: flex;
  gap: 8px;
}

.row-actions button {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
}

.row-actions button.approve {
  border-color: #bbf7d0;
  background: #ecfdf5;
  color: var(--green);
  font-weight: 700;
}

.booking-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.booking-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.booking-row {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.venue-list-row-main {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.venue-list-row-text {
  min-width: 0;
}

.venue-list-thumb {
  width: 96px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.venue-list-thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--muted);
  box-sizing: border-box;
}

.booking-row strong {
  font-size: 15px;
}

.booking-row-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.booking-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.booking-row-actions button {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
}

.booking-row-actions button:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.booking-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: #2563eb;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-btn:hover {
  color: #1d4ed8;
}

.bc-current {
  font-weight: 700;
  color: var(--text, #0f172a);
}

.subpanel-title {
  margin: 0 0 10px;
  font-size: 17px;
}

.booking-workspace {
  margin-top: 8px;
  padding-top: 4px;
  border-top: 1px solid #e2e8f0;
}

.workspace-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.workspace-col.sub-glass {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid #e2e8f0;
}

.workspace-heading {
  margin: 0 0 6px;
  font-size: 15px;
}

.muted.small {
  font-size: 12px;
  margin: 0 0 10px;
}

@media (max-width: 900px) {
  .app-shell {
    flex-direction: column;
  }
  .sidebar {
    width: auto;
    margin: 12px;
    position: relative;
    top: 0;
  }
  .nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .workspace-split {
    grid-template-columns: 1fr;
  }
}

/* —— 预约情况一览（对齐小程序网格） —— */
.booking-preview-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  margin-bottom: 16px;
  border-radius: 16px;
}

.booking-preview-title-block {
  flex: 1;
  min-width: 200px;
}

.booking-preview-desc {
  margin: 0;
  font-size: 13px;
}

.booking-preview-panel {
  padding: 20px 22px 24px;
}

.date-strip-admin {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 14px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e5e7eb;
}

.date-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 14px 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 10px;
  font: inherit;
  color: #9ca3af;
  transition: color 0.15s ease, background 0.15s ease;
}

.date-pill .date-md {
  font-size: 15px;
  font-weight: 700;
}

.date-pill .date-week {
  font-size: 11px;
  font-weight: 600;
}

.date-pill:hover {
  color: #6b7280;
  background: rgba(0, 0, 0, 0.03);
}

.date-pill-active {
  color: #dc2626;
  position: relative;
}

.date-pill-active::after {
  content: '';
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: -6px;
  height: 3px;
  border-radius: 2px;
  background: #dc2626;
}

.grid-legend-admin {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--muted);
  align-items: center;
}

.grid-legend-admin span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend-swatch {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  vertical-align: middle;
}

.legend-swatch.legend-free {
  border: 1px solid #d1d5db;
  background: #fff;
}

.legend-swatch.legend-full {
  background: #e5e7eb;
  border: 1px solid #d1d5db;
}

.preview-grid-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 4px;
}

.preview-grid-table {
  width: 100%;
  min-width: 480px;
  border-collapse: separate;
  border-spacing: 8px;
}

.preview-grid-table .corner-cell {
  width: 100px;
  border: none;
  background: transparent;
}

.preview-grid-table .court-head {
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: #111827;
  padding: 10px 8px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}

.preview-grid-table .time-cell {
  text-align: right;
  font-size: 13px;
  font-weight: 700;
  color: #374151;
  padding: 12px 10px 12px 0;
  vertical-align: middle;
  white-space: nowrap;
}

.preview-cell {
  text-align: center;
  vertical-align: middle;
  min-width: 88px;
  height: 72px;
  border-radius: 12px;
  padding: 8px 6px;
  border: 1px solid #e5e7eb;
}

.preview-cell.is-free {
  background: #fff;
}

.preview-cell.is-free .pc-price {
  color: #dc2626;
  font-weight: 800;
  font-size: 16px;
  display: block;
}

.preview-cell.is-full {
  background: #f3f4f6;
  border-color: #e5e7eb;
}

.preview-cell.is-full .pc-price {
  display: none;
}

.preview-cell .pc-sub {
  display: block;
  font-size: 11px;
  color: #6b7280;
  margin-top: 4px;
}

.preview-cell.is-full .pc-sub {
  color: #9ca3af;
}

.preview-cell .pc-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
  margin-top: 4px;
}
