/* ============ Design tokens ============ */
:root {
  --brand-50: #f0f9ff;
  --brand-100: #e0f2fe;
  --brand-500: #38bdf8;
  --brand-600: #0ea5e9;
  --brand-700: #0284c7;
  --brand-900: #0c4a6e;

  --surface: #ffffff;
  --surface-raised: #ffffff;
  --canvas: #f8faf9;
  --ink: #0f172a;
  --ink-soft: #475569;
  --ink-mute: #94a3b8;
  --line: #e5e7eb;

  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow: 0 4px 16px -4px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 32px -8px rgba(15, 23, 42, 0.14);
  --shadow-brand: 0 6px 24px -6px rgba(56, 189, 248, 0.35);

  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 9999px;
}

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  letter-spacing: -0.01em;
  background: var(--canvas);
  color: var(--ink);
}

body {
  background-image:
    radial-gradient(1200px 500px at -10% -20%, rgba(56, 189, 248, 0.08), transparent 60%),
    radial-gradient(800px 400px at 110% 10%, rgba(14, 165, 233, 0.05), transparent 55%);
  background-attachment: fixed;
}

/* ============ Navigation ============ */
.navbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav-link {
  position: relative;
  padding: 6px 2px;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 14px;
  transition: color 160ms ease;
}
.nav-link:hover { color: var(--brand-700); }
.nav-link.active { color: var(--brand-700); }
.nav-link.active::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -14px;
  height: 2px; background: var(--brand-600);
  border-radius: 2px;
}

.brand-mark {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 17px;
  line-height: 1.1; /* 手機窄螢幕換行成兩行時，上下行更靠近 */
  color: #000;
  text-decoration: none;
}
.brand-dot {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  overflow: hidden;
}
.brand-dot img {
  width: 100%; height: 100%;
  object-fit: contain;
}

/* ============ Hero ============ */
.hero {
  padding: 40px 0 32px;
  position: relative;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--brand-700); font-weight: 600; font-size: 12px;
  letter-spacing: 0.12em; text-transform: uppercase;
  background: var(--brand-50);
  padding: 6px 12px; border-radius: var(--radius-pill);
  border: 1px solid rgba(56, 189, 248, 0.2);
}
.hero h1 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  line-height: 1.1;
  margin-top: 18px;
  letter-spacing: -0.03em;
}
.hero p {
  color: var(--ink-soft); margin-top: 10px; font-size: 16px; max-width: 600px;
}

/* ============ Card ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  border-color: rgba(56, 189, 248, 0.25);
}

.card-title {
  font-size: 17px; font-weight: 700; letter-spacing: -0.01em;
}
.card-desc { color: var(--ink-soft); font-size: 14px; margin-top: 4px; }

.meta {
  display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px;
  font-size: 13px; color: var(--ink-soft);
}
.meta-item { display: inline-flex; align-items: center; gap: 6px; }
.meta-icon { opacity: 0.7; font-size: 15px; }

/* ============ Badges ============ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600; letter-spacing: 0.01em;
  border: 1px solid transparent;
  white-space: nowrap; /* 避免窄螢幕擠壓時標籤文字直排（如「教練」變兩行）*/
  flex-shrink: 0;
}
.badge-open { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.badge-confirmed { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.badge-cancelled { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.badge-completed { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }
.badge-waitlisted { background: #fffbeb; color: #a16207; border-color: #fcd34d; }
.badge-pending { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }
.badge-closed { background: #f1f5f9; color: #64748b; border-color: #cbd5e1; }
/* 場次開放/關閉切換鈕（外觀沿用 badge，加上可點互動）*/
.session-toggle { cursor: pointer; font-family: inherit; line-height: 1.2; transition: filter 120ms ease, box-shadow 120ms ease; }
.session-toggle:hover { filter: brightness(0.97); box-shadow: var(--shadow-sm); }
.badge-rejected { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.badge-coach { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }
.badge-leave { background: #fef2f2; color: #dc2626; border-color: #fecaca; } /* 已請假：淡紅，呼應已確認的淡藍 */
.badge::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; opacity: 0.8;
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  transition: all 160ms ease;
  cursor: pointer; border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: var(--brand-600); color: white;
  box-shadow: var(--shadow-brand);
  /* 與 .btn-secondary 對稱：未搭配基底 .btn 使用時（如預約 modal 的「確認預約」、
     成功頁按鈕）也要有圓角，避免直角。搭配 .btn 時為相同值、無視覺變化。 */
  border-radius: var(--radius-sm);
}
.btn-primary:hover { background: var(--brand-700); transform: translateY(-1px); }
.btn-primary:disabled { background: #cbd5e1; color: #64748b; box-shadow: none; cursor: not-allowed; transform: none; }

.btn-ghost {
  background: transparent; color: var(--ink); border-color: var(--line);
}
.btn-ghost:hover { background: #f1f5f9; border-color: #cbd5e1; }

.btn-dark { background: var(--ink); color: white; }
.btn-dark:hover { background: #1e293b; }

.btn-danger { background: #ef4444; color: white; }
.btn-danger:hover { background: #dc2626; }

.btn-sm { padding: 7px 14px; font-size: 13px; }

/* Display/width intentionally omitted — apply Tailwind `flex w-full` on the
   element so `sm:hidden` can still hide it at desktop. style.css loads after
   the Tailwind CDN, so setting display here would override sm:hidden. */
.btn-pill-outline {
  align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  border: 1.5px solid #bfdbfe;
  background: #f8fbff;
  color: #1d4ed8;
  font-size: 14px; font-weight: 700;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease;
}
.btn-pill-outline:hover { background: #eff6ff; border-color: #93c5fd; }

/* ============ Capacity bar ============ */
.capacity-bar {
  height: 6px; background: #f1f5f9; border-radius: 3px; overflow: hidden;
  margin-top: 12px;
}
.capacity-fill {
  height: 100%; background: linear-gradient(90deg, var(--brand-500), var(--brand-700));
  border-radius: 3px;
  transition: width 400ms ease;
}
.capacity-fill.full { background: linear-gradient(90deg, #f59e0b, #d97706); }

/* ============ Forms ============ */
.form-label {
  display: block;
  font-size: 12px; font-weight: 600; color: var(--ink-soft);
  letter-spacing: 0.04em; text-transform: uppercase;
  margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 160ms, box-shadow 160ms;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}
.form-textarea { min-height: 70px; resize: vertical; }

/* ============ Modal / Drawer ============ */
.overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 30;
  display: grid; place-items: center;
  animation: fadeIn 160ms ease;
}
.modal-panel {
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%; max-width: 560px;
  max-height: 90vh; overflow: auto;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  animation: zoomIn 200ms ease;
}
.drawer-panel {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 100%; max-width: 680px;
  background: var(--surface);
  padding: 28px;
  overflow: auto;
  box-shadow: var(--shadow-lg);
  animation: slideIn 240ms ease;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes zoomIn { from { opacity: 0; transform: scale(0.95) } to { opacity: 1; transform: scale(1) } }
@keyframes slideIn { from { transform: translateX(100%) } to { transform: translateX(0) } }

/* ============ Toast ============ */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 40;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: white;
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideUp 240ms cubic-bezier(0.22, 1, 0.36, 1);
  display: none;
}
.toast.show { display: block; }
.toast.error { background: #dc2626; }
.toast.success { background: var(--brand-600); }
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ============ Utility ============ */
.section-title {
  font-size: 20px; font-weight: 700; letter-spacing: -0.01em;
}
.subtle { color: var(--ink-mute); font-size: 13px; }
.section-desc {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 4px 0 14px;
}

.empty-state {
  padding: 60px 24px; text-align: center;
  color: var(--ink-soft);
  border: 1px dashed var(--line); border-radius: var(--radius);
  background: var(--surface);
}
.empty-state-icon {
  font-size: 40px; opacity: 0.4; margin-bottom: 12px;
  display: block;
}

/* ============ Day-of-week accordion (courses page) ============ */
.day-group {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  transition: box-shadow 200ms ease, border-color 200ms ease;
}
.day-group[open] {
  box-shadow: var(--shadow);
  border-color: rgba(56, 189, 248, 0.35);
}
.day-group summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 22px;
  display: flex; align-items: center; gap: 16px;
  transition: background 150ms ease;
}
.day-group summary::-webkit-details-marker { display: none; }
.day-group summary:hover { background: var(--brand-50); }

.day-chip {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand-100), var(--brand-50));
  color: var(--brand-700);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 700; font-size: 20px; line-height: 1;
  flex-shrink: 0;
  transition: all 220ms ease;
  box-shadow: 0 0 0 0 rgba(56, 189, 248, 0);
}
.day-chip-dow {
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.04em;
}
.day-chip-time {
  font-family: "Archivo", "Noto Sans TC", sans-serif;
  font-size: 16px; font-weight: 800;
  font-variant-numeric: tabular-nums;
  margin-top: 3px;
}
.day-group[open] .day-chip {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: white;
  box-shadow: 0 6px 18px -4px rgba(56, 189, 248, 0.45);
}
.course-meta {
  font-size: 12px !important;
  color: var(--ink-mute) !important;
  margin-top: 6px !important;
}

.day-title { flex: 1; min-width: 0; }
.day-title h3 {
  font-size: 16px; font-weight: 700;
  letter-spacing: -0.01em;
}
.day-title p {
  font-size: 13px; color: var(--ink-soft); margin-top: 2px;
}

.day-chevron {
  width: 20px; height: 20px;
  color: var(--ink-mute);
  transition: transform 240ms ease, color 200ms ease;
}
.day-group[open] .day-chevron {
  transform: rotate(180deg);
  color: var(--brand-600);
}

.day-group-content {
  padding: 8px 20px 20px;
  border-top: 1px solid var(--line);
  background: #fafbfc;
}
.day-group-content .card {
  background: var(--surface);
}

/* Accordion (details) */
details.session-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
  transition: box-shadow 160ms;
}
details.session-row[open] { box-shadow: var(--shadow); }
details.session-row summary {
  list-style: none; cursor: pointer;
  padding: 14px 18px;
  display: flex; justify-content: space-between; align-items: center;
}
details.session-row summary::-webkit-details-marker { display: none; }
details.session-row summary:hover { background: #f8faf9; }

/* Registration row inside drawer */
.reg-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.reg-row:last-child { border-bottom: none; }

/* Table */
.data-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.data-table th {
  text-align: left; font-weight: 600; color: var(--ink-soft);
  padding: 10px 12px; background: #f8faf9;
  border-bottom: 1px solid var(--line);
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
}
.data-table td {
  padding: 12px; border-bottom: 1px solid var(--line);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f8faf9; }

/* ============ Loading ============ */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9, #e2e8f0, #f1f5f9);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============ Tabs (coach dashboard) ============ */
.tab { padding: 8px 16px; cursor: pointer; border-bottom: 2px solid transparent; color: #64748b; }
.tab.tab-active { color: #0ea5e9; border-bottom-color: #0ea5e9; font-weight: 600; }
.tab-panel { }

/* Phase 3A · Mobile navbar toggle + dropdown */
.nav-toggle-btn {
  background: transparent;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  font-size: 18px;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.nav-toggle-btn:hover { background: #f1f5f9; }
.nav-toggle-btn[aria-expanded="true"] { background: #f1f5f9; }

#nav-mobile {
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
}

.nav-link-mobile {
  display: block;
  padding: 12px 4px;
  color: #0f172a;
  text-decoration: none;
  font-size: 15px;
  border-bottom: 1px solid #f1f5f9;
}
.nav-link-mobile:last-child { border-bottom: 0; }
.nav-link-mobile:hover { color: var(--brand-700); }
.nav-link-mobile.active { color: var(--brand-700); font-weight: 600; }

/* ============================================================
 * Phase 3B · Group class mobile UI (only effective at <768px)
 * ============================================================ */

/* Mobile-only overrides on existing classes */
@media (max-width: 767px) {
  .card { padding: 12px; }
  .day-group summary { padding: 14px; }
  .day-title h3 { font-size: 15px; }
  .day-title > p:not(.course-meta) {
    font-size: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .course-meta { font-size: 11px !important; }
}

/* Mobile course-card layout (rendered inside .md:hidden wrapper) */
.cc-row1 { display: flex; gap: 12px; align-items: center; }
.cc-date-chip {
  background: #f1f5f9;
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
  min-width: 54px;
}
.cc-date-chip .cc-d {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  color: var(--brand-700);
}
.cc-date-chip .cc-t {
  font-size: 10px;
  color: var(--ink-mute);
  margin-top: 3px;
  display: block;
}
.cc-cap { flex: 1; min-width: 0; }
.cc-cap-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.cc-remaining { font-size: 14px; font-weight: 700; }
.cc-remaining.open             { color: #047857; }
.cc-remaining.warn             { color: #a16207; }
.cc-remaining.full             { color: #b91c1c; }
.cc-remaining.mine-confirmed   { color: #047857; }
.cc-remaining.mine-waitlisted  { color: #a16207; }

.cc-bar {
  height: 4px;
  background: #f1f5f9;
  border-radius: 2px;
  margin: 6px 0 4px;
  overflow: hidden;
}
.cc-fill { height: 100%; transition: width 400ms ease; }
.cc-fill.open { background: linear-gradient(90deg, #0ea5e9, #0369a1); }
.cc-fill.warn { background: linear-gradient(90deg, #fbbf24, #d97706); }
.cc-fill.full { background: linear-gradient(90deg, #ef4444, #b91c1c); }
.cc-fill.mine { background: #cbd5e1; }

.cc-deadline { font-size: 10px; color: var(--ink-mute); }

.cc-action { margin-top: 10px; }
.cc-action .btn { width: 100%; padding: 11px 9px; font-size: 13px; }

.cc-mine-link {
  display: block;
  padding: 11px 9px;
  border-radius: 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.cc-mine-link.mine-confirmed  { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.cc-mine-link.mine-waitlisted { background: #fffbeb; color: #a16207; border: 1px solid #fcd34d; }
.cc-mine-link.mine-confirmed:hover,
.cc-mine-link.mine-confirmed:active   { background: #d1fae5; }
.cc-mine-link.mine-waitlisted:hover,
.cc-mine-link.mine-waitlisted:active  { background: #fef3c7; }

/* Badge variant for "almost full"; shares the waitlist amber palette
 * since these states are mutually exclusive per card. Label
 * (`快滿` vs `候補`) carries the semantic difference. */
.badge-warn { background: #fffbeb; color: #a16207; border-color: #fcd34d; }

/* New button variant for "進入候補" — amber, signals waitlist not confirmation */
.btn-warn { background: #d97706; color: white; }
.btn-warn:hover { background: #b45309; transform: translateY(-1px); }

/* ============ 頁面標題 / 通用按鈕補丁 ============ */
.page-title {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 8px;
}

/* btn-secondary：幾個頁面共用，Tailwind CDN 沒提供 */
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  background: var(--surface);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
  white-space: nowrap;
  text-decoration: none;
}
.btn-secondary:hover { background: #f1f5f9; border-color: #cbd5e1; }
.btn-secondary:disabled { opacity: 0.45; cursor: not-allowed; }

/* ============ Coaches — 方向 A 質感卡（手風琴清單）============ */

/* 清單容器間距 */
#coach-list { display: flex; flex-direction: column; gap: 0; }

/* 卡片主體 */
.ccard {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  gap: 14px;
  align-items: center;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 180ms ease, box-shadow 180ms ease;
  margin-bottom: 12px;
}
.ccard:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.ccard:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: 2px;
}
/* 展開狀態：底部圓角取消，讓展開面板接合 */
.ccard.expanded {
  border-radius: 16px 16px 0 0;
  margin-bottom: 0;
  box-shadow: var(--shadow);
  transform: none;
}

/* 頭像：62px 圓角方形 */
.ccard-avatar {
  width: 62px; height: 62px;
  border-radius: 15px;
  flex-shrink: 0;
  overflow: hidden;
  background: linear-gradient(140deg, var(--brand-50), var(--brand-100));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 1px rgba(15,23,42,.04), var(--shadow-sm);
}
.ccard-avatar img { width: 100%; height: 100%; object-fit: cover; }
/* 無頭像時的首字 fallback */
.ccard-avatar-fallback {
  font-size: 24px;
  font-weight: 700;
  color: var(--brand-700);
  user-select: none;
  line-height: 1;
}

/* 卡片文字區 */
.ccard-body { flex: 1; min-width: 0; }
.ccard-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 7px;
}

/* 專長標籤列 */
.ccard-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}
.tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-700);
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

/* 右側 chevron 圓形按鈕 */
.ccard-go {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--canvas);
  display: flex; align-items: center; justify-content: center;
  color: var(--brand-600);
  font-size: 18px;
  align-self: center;
  transition: background 180ms ease, color 180ms ease, transform 240ms ease;
}
.ccard.expanded .ccard-go {
  background: var(--brand-600);
  color: #fff;
  transform: rotate(90deg);
}

/* ── 展開面板 ── */
.ccard-expand {
  background: var(--surface);
  border-radius: 0 0 16px 16px;
  box-shadow: var(--shadow);
  padding: 6px 16px 16px;
  margin-bottom: 12px;
  position: relative;
}
/* 分隔線 */
.ccard-expand::before {
  content: "";
  position: absolute;
  top: 0; left: 16px; right: 16px;
  height: 1px;
  background: var(--line);
}

/* Bio 文字 */
.bioA {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.6;
  padding-top: 13px;
  white-space: pre-line;
}

/* 「最近可預約」小標題 */
.slotlabel {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-mute);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 14px 0 9px;
}

/* 橫向 mini 時段卡列 */
.miniSlots {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  margin-bottom: 14px;
  scrollbar-width: none;
}
.miniSlots::-webkit-scrollbar { display: none; }

.miniSlot {
  flex-shrink: 0;
  text-align: center;
  border: 1.5px solid var(--brand-100);
  border-radius: 12px;
  padding: 8px 12px;
  background: #fff;
  min-width: 62px;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}
.miniSlot:hover { border-color: var(--brand-600); background: var(--brand-50); }
.miniSlot .md { font-size: 10px; color: var(--ink-mute); font-weight: 600; }
.miniSlot .tm { font-size: 15px; font-weight: 700; color: var(--ink); margin-top: 1px; }

/* 「看更多 ›」假卡 */
.miniSlot-more {
  flex-shrink: 0;
  text-align: center;
  border: 1.5px dashed #cbd5e1;
  border-radius: 12px;
  padding: 8px 12px;
  background: #fff;
  min-width: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-700);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}
.miniSlot-more:hover { background: var(--brand-50); border-color: var(--brand-500); }

/* 無時段提示 */
.slot-empty {
  font-size: 12px;
  color: var(--ink-mute);
  margin-bottom: 12px;
}

/* 預約 CTA 按鈕 */
.ctaA {
  display: block;
  width: 100%;
  padding: 13px;
  border-radius: 12px;
  background: var(--brand-600);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-brand);
  transition: background 150ms ease;
}
.ctaA:hover { background: var(--brand-700); }

.section-all-label {
  font-size: 11px; font-weight: 700; color: var(--ink-soft);
  letter-spacing: 0.08em; text-transform: uppercase;
  margin: 18px 0 8px;
}

/* ============ 教練詳細頁標頭 ============ */
.detail-head {
  display: flex;
  gap: 13px;
  align-items: center;
  margin-bottom: 18px;
}
.detail-av {
  width: 54px; height: 54px;
  border-radius: 14px;
  flex-shrink: 0;
  overflow: hidden;
  background: linear-gradient(140deg, var(--brand-50), var(--brand-100));
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
}
.detail-av img { width: 100%; height: 100%; object-fit: cover; }
.detail-av-fallback {
  font-size: 21px;
  font-weight: 700;
  color: var(--brand-700);
  user-select: none;
  line-height: 1;
}
.detail-name { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
.detail-spec { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

/* ============ 日期橫向 rail（詳細頁）============ */
/* 可預約時段標題列：標題＋年月（左）／週次導覽 今天・‹・›（右） */
.slot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.slot-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
#slot-yearmonth {
  font-size: 15px;
  font-weight: 700;
  color: #0369a1;
  background: #e0f2fe;
  border-radius: 999px;
  padding: 2px 12px;
}
.day-nav-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 7px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}
.day-nav-btn:hover:not(:disabled) { border-color: #38bdf8; background: #f0f9ff; }
.day-nav-btn:disabled { opacity: .4; cursor: default; }
.day-nav-arrow { padding: 7px 12px; font-size: 18px; }

.dayrail {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 2px 0 10px;
  margin: 0 0 4px;
}

.daypill {
  min-width: 0;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 9px 2px;
  text-align: center;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
.daypill .dow { font-size: 11px; color: var(--ink-mute); font-weight: 600; }
.daypill .dnum { font-size: 18px; font-weight: 700; margin-top: 1px; color: var(--ink); }
.daypill .ddot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--brand-500);
  margin: 5px auto 0;
}
/* 選中狀態 */
.daypill.sel {
  background: var(--brand-600);
  border-color: var(--brand-600);
  box-shadow: var(--shadow-brand);
}
.daypill.sel .dow,
.daypill.sel .dnum { color: #fff; }
.daypill.sel .ddot { background: rgba(255,255,255,.7); }
/* 無時段：淡化不可點 */
.daypill.empty { opacity: 0.4; cursor: not-allowed; }
.daypill.empty .ddot { background: transparent; }

/* 當日時段標題 */
.slot-day-head {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin: 16px 0 10px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.slot-day-head small { font-size: 12px; color: var(--ink-mute); font-weight: 500; }

/* ============ 時段卡 grid（詳細頁）============ */
.timegrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}
.timeslot {
  border: 1.5px solid var(--brand-100);
  border-radius: 13px;
  background: #fff;
  padding: 11px 6px;
  text-align: center;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
  position: relative;
}
.timeslot:hover {
  border-color: var(--brand-600);
  background: var(--brand-50);
  transform: translateY(-1px);
}
.timeslot .t-main { font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.timeslot .t-sub { font-size: 10px; color: var(--ink-mute); margin-top: 2px; }
/* 選中狀態（點擊後立即開 modal）*/
.timeslot.sel {
  background: var(--brand-600);
  border-color: var(--brand-600);
  box-shadow: var(--shadow-brand);
}
.timeslot.sel .t-main { color: #fff; }
.timeslot.sel .t-sub { color: rgba(255,255,255,.8); }

/* 無時段文字 */
.timegrid-empty {
  grid-column: 1 / -1;
  font-size: 13px;
  color: var(--ink-mute);
  padding: 16px 0 8px;
}

/* ============ 入口頁 — 雙色路徑卡 ============ */
.entry-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 168px;
  border-radius: 20px;
  padding: 22px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.entry-card:hover { transform: translateY(-3px); }
/* 冷暖雙柔色（T1）：兩張等重柔色卡，差在冷/暖色相，無藍白強落差 */
.entry-card.group {
  background: linear-gradient(150deg, #f0f9ff, #e0f2fe);  /* 柔藍 */
  color: var(--ink);
  box-shadow: var(--shadow);
}
.entry-card.solo {
  background: linear-gradient(150deg, #fdf2f4, #f8e1e7);  /* 低彩度玫瑰紅 */
  color: var(--ink);
  box-shadow: var(--shadow);
}
.entry-card.group:hover, .entry-card.solo:hover { box-shadow: var(--shadow-lg); }

/* 內容疊在浮水印之上 */
.entry-badge, .entry-title, .entry-desc, .entry-cta { position: relative; z-index: 1; }

.entry-badge {
  width: 46px; height: 46px;
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
  color: #fff;
}
.entry-card.group .entry-badge { background: var(--brand-600); }
.entry-card.solo  .entry-badge { background: #c05a73; }

.entry-title { font-size: 21px; font-weight: 800; letter-spacing: -.01em; }
.entry-desc { font-size: 13.5px; margin-top: 8px; line-height: 1.6; color: var(--ink-soft); }

.entry-cta {
  margin-top: auto;            /* 推到卡片底部，無需絕對定位 */
  padding-top: 18px;
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 14px;
}
.entry-card.group .entry-cta { color: var(--brand-700); }
.entry-card.solo  .entry-cta { color: #a23e57; }
.entry-cta .arr {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.entry-card.group .entry-cta .arr { background: #bae6fd; }
.entry-card.solo  .entry-cta .arr { background: #f3d5dd; }

/* 角落圖騰浮水印（裝飾、不可點）*/
.entry-watermark {
  position: absolute;
  right: -10px; bottom: -14px;
  width: 120px; height: 120px;
  z-index: 0;
  pointer-events: none;
}
.entry-card.group .entry-watermark { color: var(--brand-600); opacity: .12; }
.entry-card.solo  .entry-watermark { color: #c05a73; opacity: .13; }

/* ============ 入口頁 FAQ accordion ============ */
.faq { margin-top: 14px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 18px;
  font-weight: 700; font-size: 15px; color: var(--ink);
  transition: background 150ms ease;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { background: var(--brand-50); }
.faq-tog {
  flex-shrink: 0; width: 16px; text-align: center;
  color: var(--brand-600); font-weight: 700; font-size: 18px; line-height: 1.45;
}
.faq-tog::before { content: "+"; }
.faq-item[open] .faq-tog::before { content: "−"; }
.faq-a {
  padding: 0 18px 16px 46px;
  color: var(--ink-soft); font-size: 14px; line-height: 1.75;
}

/* 報名成功頁：LINE 通知區（置中）+ 加入官方 LINE 按鈕 + 綁定碼 */
.line-box {
  text-align: center;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 14px;
  padding: 18px 16px;
}
.line-join-btn {
  display: inline-block;
  margin: 4px 0 10px;
  background: #06c755; color: #fff;
  font-weight: 700; font-size: 14px;
  padding: 9px 22px; border-radius: 9999px;
  text-decoration: none;
  box-shadow: 0 4px 12px -4px rgba(6,199,85,.5);
  transition: background 150ms ease;
}
.line-join-btn:hover { background: #05b34c; }
.line-code {
  display: inline-block;
  margin-top: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 20px; font-weight: 700; letter-spacing: .15em;
  color: #166534; background: #dcfce7;
  border: 1px dashed #86efac; border-radius: 10px;
  padding: 6px 16px;
}

/* 班表時間欄自訂下拉（Google Calendar 風格的小捲動框） */
.time-dd {
  position: fixed;
  z-index: 60;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  max-height: 220px;
  overflow-y: auto;
}
.time-dd-opt { padding: 7px 12px; font-size: 14px; cursor: pointer; white-space: nowrap; }
.time-dd-opt:hover { background: var(--brand-50); }

/* 後台「?」說明小圓鈕 */
.help-btn {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface);
  color: #64748b; font-size: 13px; font-weight: 700; line-height: 1;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.help-btn:hover { background: var(--brand-50); color: #0ea5e9; border-color: #bae6fd; }

/* 補登（過去）時段卡：淡琥珀虛線框，與一般可預約時段區別 */
.timeslot.slot-past { border-style: dashed; border-color: #fcd34d; background: #fffdf5; }
.timeslot.slot-past .t-sub { color: #b45309; }

/* 登錄預約 週曆 */
.reg-toolbar{display:flex;align-items:center;gap:8px;margin-bottom:10px;flex-wrap:wrap;}
.reg-navbtn{padding:4px 10px;font-size:13px;}
.reg-range{font:inherit;font-weight:600;color:var(--ink);margin-left:4px;background:none;border:1px solid transparent;border-radius:0;padding:4px 8px;cursor:pointer;}
.reg-range::after{content:"▾";margin-left:6px;font-size:11px;color:var(--ink-mute);}
.reg-range:hover{background:var(--brand-50);border-color:var(--line);}
.reg-range:focus-visible{outline:none;border-color:var(--brand-500);box-shadow:var(--ring-focus);}

/* 週範圍 → 滾輪式年/月/日跳週（懸浮層：方角、髮絲線、floating 陰影；中間帶＝選取列） */
.wp-layer{position:fixed;inset:0;z-index:70;touch-action:none;}
.wp-pop{position:fixed;width:264px;background:var(--surface);color:var(--ink);border:1px solid var(--line);box-shadow:var(--shadow-lg);touch-action:auto;}
.wp-cols{display:grid;grid-template-columns:1.3fr 1fr 1fr;padding:10px 10px 0;}
.wp-lbl{font-family:"Archivo","Noto Sans TC",sans-serif;font-size:11px;font-weight:700;letter-spacing:.2em;text-indent:.2em;color:var(--ink-mute);text-align:center;padding-bottom:6px;}
.wp-col:focus-within .wp-lbl{color:var(--brand-700);}
.wp-box{position:relative;}
.wp-box::before{content:"";position:absolute;left:0;right:0;top:72px;height:36px;background:var(--brand-50);border-top:1px solid var(--brand-100);border-bottom:1px solid var(--brand-100);pointer-events:none;}
.wp-wheel{position:relative;height:180px;overflow-y:auto;scroll-snap-type:y mandatory;overscroll-behavior:contain;scrollbar-width:none;outline:none;
  -webkit-mask-image:linear-gradient(to bottom,transparent,#000 30%,#000 70%,transparent);mask-image:linear-gradient(to bottom,transparent,#000 30%,#000 70%,transparent);}
.wp-wheel::-webkit-scrollbar{display:none;}
.wp-list{padding:72px 0;}
.wp-it{height:36px;line-height:36px;text-align:center;scroll-snap-align:center;font-family:"Archivo","Noto Sans TC",sans-serif;font-weight:600;font-size:14px;font-variant-numeric:tabular-nums;color:var(--ink-mute);cursor:pointer;user-select:none;-webkit-user-select:none;}
.wp-it.is-sel{color:var(--ink);font-weight:800;font-size:17px;}
.wp-foot{display:flex;gap:8px;padding:10px;margin-top:10px;border-top:1px solid var(--line);}
.wp-foot button{height:40px;border-radius:0;font-family:"Archivo","Noto Sans TC",sans-serif;font-weight:700;font-size:14px;font-variant-numeric:tabular-nums;cursor:pointer;transition:background-color .16s ease;}
.wp-cancel{flex:0 0 72px;background:var(--surface);color:var(--ink-soft);border:1px solid var(--line);}
.wp-cancel:hover{background:var(--canvas);}
.wp-ok{flex:1;background:var(--brand-600);color:var(--fg-on-brand);border:0;}
.wp-ok:hover{background:var(--brand-700);}
.wp-foot button:focus-visible{outline:none;box-shadow:var(--ring-focus);}
.reg-grid-wrap{overflow:auto;max-height:70vh;}
.reg-grid{display:grid;grid-template-columns:56px repeat(7,minmax(64px,1fr));gap:2px;min-width:640px;}
.reg-cell{font-size:12px;border-radius:6px;padding:4px;min-height:40px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;}
.reg-head{font-weight:700;background:#f1f5f9;color:#0f172a;}
.reg-date{font-weight:400;font-size:11px;color:#64748b;}
.reg-timecol{background:#f8fafc;color:#64748b;font-variant-numeric:tabular-nums;}
.reg-open{color:#cbd5e1;cursor:pointer;border:1px dashed #e2e8f0;}
.reg-open:hover{background:#e0f2fe;color:#0284c7;border-color:#7dd3fc;}
.reg-avail{background:#f0f9ff;border-color:#bae6fd;color:#7dd3fc;}
.reg-booked{background:#dbeafe;color:#1e3a8a;font-weight:600;cursor:default;}
.reg-group{background:#f3e8ff;color:#6b21a8;cursor:default;}
.reg-sub{font-weight:400;font-size:10px;opacity:0.8;}
.reg-multi{align-items:stretch;gap:2px;padding:2px;}
.reg-bk{background:#dbeafe;color:#1e3a8a;font-size:11px;border-radius:4px;padding:2px 4px;cursor:pointer;text-align:left;width:100%;}
.reg-bk:hover{background:#bfdbfe;}
.reg-gp{background:#f3e8ff;color:#6b21a8;font-size:11px;border-radius:4px;padding:2px 4px;text-align:left;width:100%;}
.reg-bk-colored{color:#fff;}
.reg-bk-colored .reg-sub{color:rgba(255,255,255,.85);}
.reg-bk-colored:hover{filter:brightness(.92);}
/* 同格多筆：左右並排、後一塊略疊前一塊（參考 Google 日曆），每塊固定兩行（姓名／類型·教練）超出截斷，格高不再被撐開 */
.reg-side{flex-direction:row;gap:0;}
.reg-side>.reg-bk,.reg-side>.reg-gp{flex:1 1 0;min-width:0;width:auto;overflow:hidden;white-space:nowrap;}
.reg-side>*+*{margin-left:-3px;box-shadow:-1px 0 0 var(--surface);}
.reg-side .reg-nm{display:block;overflow:hidden;}

/* 拖拉改時段 */
.reg-bk{touch-action:none;cursor:grab;}
.reg-bk:active{cursor:grabbing;}
.reg-bk-dragging{opacity:.4;pointer-events:none;}
.reg-drop-hover{outline:2px dashed var(--brand-600);outline-offset:-2px;background:var(--brand-50);}
.reg-drag-ghost{position:fixed;left:0;top:0;pointer-events:none;z-index:9999;background:#dbeafe;color:#1e3a8a;font-size:11px;border-radius:6px;padding:4px 8px;box-shadow:0 6px 20px rgba(0,0,0,.18);opacity:.95;white-space:nowrap;max-width:200px;overflow:hidden;text-overflow:ellipsis;}

/* 登錄彈窗 */
.regm-overlay{position:fixed;inset:0;background:rgba(0,0,0,0.5);z-index:60;display:grid;place-items:center;padding:16px;}
.regm-modal{background:#fff;border-radius:12px;max-width:440px;width:100%;max-height:90vh;overflow-y:auto;padding:20px;position:relative;}
.regm-close{position:absolute;top:12px;right:14px;background:none;border:none;font-size:20px;color:#94a3b8;cursor:pointer;}
.regm-title{font-weight:700;margin-bottom:12px;}
.regm-slot{font-size:14px;margin-bottom:10px;}
.regm-label{display:block;font-size:13px;font-weight:600;margin:10px 0 4px;}
.regm-pkg-head{display:flex;align-items:center;justify-content:space-between;gap:8px;}
.regm-pkg-head .regm-label{margin-bottom:0;}
.regm-input{width:100%;}
.regm-results{max-height:160px;overflow-y:auto;}
.regm-result{padding:6px 8px;border-bottom:1px solid #f1f5f9;cursor:pointer;font-size:14px;}
.regm-result:hover{background:#f0f9ff;}
.regm-sub{font-size:12px;color:#64748b;}
.regm-nopkg{font-size:13px;color:#b45309;margin:10px 0 6px;}
.regm-newpkg{display:grid;grid-template-columns:1fr 1fr;gap:6px;}
.regm-newpkg button{grid-column:1/-1;}
.regm-check{display:flex;align-items:center;gap:6px;margin:10px 0;font-size:14px;cursor:pointer;}
.regm-rec{background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;padding:10px;margin-bottom:10px;}
.regm-rec-row{display:flex;align-items:center;gap:6px;margin-bottom:8px;flex-wrap:wrap;}
.regm-num{width:64px;}
.regm-weekdays{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:8px;}
.regm-wd{font-size:13px;display:flex;align-items:center;gap:3px;}
.regm-radio{display:flex;align-items:center;gap:4px;font-size:13px;}
.regm-preview{max-height:180px;overflow-y:auto;margin:10px 0;font-size:13px;}
.regm-occ{padding:2px 0;}
.regm-ok{color:#166534;}.regm-conflict,.regm-depleted,.regm-no_date{color:#b45309;}
.regm-actions{display:flex;gap:8px;justify-content:flex-end;}
.bke-detail{font-size:13px;line-height:1.7;margin-bottom:12px;}
.bke-actions{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:10px;}
.bke-sub{font-size:13px;font-weight:600;margin:8px 0 4px;}
.bke-row{display:flex;gap:6px;align-items:center;flex-wrap:wrap;}

/* 我的課表：統計列（已上課／請假／即將到來）· 置於我的方案卡片容器之前 */
.sn-stats{display:flex;gap:18px;flex-wrap:wrap;margin:14px 0 4px;padding:12px 16px;border:1px solid var(--line);border-radius:12px;background:#fff;}
.sn-stat{font-size:12px;color:var(--ink-mute);display:flex;flex-direction:column;line-height:1.3;}
.sn-stat b{font-family:"Archivo","Noto Sans TC",sans-serif;font-size:22px;font-weight:800;color:var(--ink);}
.sn-stat-sub{font-size:11px;color:var(--ink-mute);}
