/**
 * 健身室器材預約 App 示範頁樣式（showcase1.php）
 *
 * 來源：Figma「booking_design_mobile」最新手機版（393 × 852）。手機優先：
 *   - 基本樣式＝手機版，尺寸、顏色、字級按設計稿；
 *   - ≥768px（平板）：同一版式，內容置中並增加欄數；
 *   - ≥1024px（桌面）：底部分頁列移到頂部，各畫面改為多欄排版。
 * 結構：變數 → 基礎 → 共用元件 → 各畫面 → 平板 → 桌面 → 返回按鈕 → 減少動態。
 */

/* ---------- 變數 ---------- */
:root {
  --mint: #42caa2;
  --teal: #2e95a0;
  --navy: #1a5f9e;
  --grad: linear-gradient(90deg, rgba(66, 202, 162, 0.9) 0%, rgba(46, 149, 160, 0.9) 57%, rgba(26, 95, 158, 0.9) 100%);
  --grad-btn: linear-gradient(90deg, rgba(66, 202, 162, 0.9) 0%, rgba(46, 148, 160, 0.9) 50%, rgba(26, 95, 158, 0.9) 100%);
  --grad-cta: linear-gradient(90deg, rgba(67, 206, 162, 0.95) 0%, rgba(57, 179, 161, 0.95) 23%, rgba(35, 120, 158, 0.95) 74%, rgba(24, 90, 157, 0.95) 100%);
  --ink: #000;
  --muted: #666f64;
  --muted-2: rgba(102, 111, 100, 0.7);
  --line: rgba(174, 174, 174, 0.4);
  --page: #f7f8fa;
  --tab-h: 89px;
  --action-h: 96px;
  --radius-card: 15px;
  --shadow-card: 0 0 6px 3px rgba(0, 0, 0, 0.05);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- 基礎 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  font-family: var(--font);
  font-weight: 400;
  color: var(--ink);
  background: linear-gradient(180deg, #fff 0%, var(--page) 100%) fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--mint); outline-offset: 2px; }
.ic { display: block; flex: none; }
.desk-only { display: none !important; }

/* 畫面：一次只顯示一個 */
.screen { display: none; min-height: 100svh; position: relative; }
.screen.active { display: block; animation: screen-in 0.22s ease-out; }
@keyframes screen-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
body.has-tab main { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); }

/* 模擬狀態列（手機） */
.status {
  height: 37px;
  padding: 10px 0 0 27px;
  font-size: 14px;
  font-weight: 500;
  color: #1a1919;
  line-height: 17px;
}
.status.light { color: #fff; }

/* ---------- 共用元件 ---------- */
/* 漸變頁首（Figma Rectangle 2，高 106） */
.band {
  background: var(--grad);
  min-height: 106px;
  padding-bottom: 18px;
}
.band-title {
  padding: 8px 18px 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 1.92px;
  line-height: 29px;
  color: #fff;
}
/* 白色內容層，圓角疊在頁首上（Figma Rectangle 3） */
.sheet {
  position: relative;
  margin-top: -9px;
  padding-top: 15px;
  border-radius: 10px 10px 0 0;
  background: #fff;
  min-height: calc(100svh - 97px);
}

/* 篩選 chip */
.chips {
  display: flex;
  gap: 11px;
  overflow-x: auto;
  padding: 0 18px 2px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 33px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 18px;
  font-weight: 300;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.chip.active { background: rgba(66, 202, 162, 0.14); border-color: var(--mint); }
@media (hover: hover) { .chip:not(.active):hover { border-color: var(--mint); } }

/* 搜尋列 */
.search {
  position: relative;
  display: flex;
  align-items: center;
  height: 44px;
  margin: 29px 11px 0;
  border: 1px solid var(--mint);
  border-radius: 20px;
  background: #fff;
}
.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 64px 0 26px;
  border: 0;
  border-radius: 20px;
  background: transparent;
  font-size: 18px;
  color: #000;
  outline: none;
}
.search input::placeholder { color: #5c5c5c; }
.search input::-webkit-search-cancel-button { display: none; }
.search:focus-within { box-shadow: 0 0 0 3px rgba(66, 202, 162, 0.25); }
.search-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 51px; height: 33px; }

/* 圓形返回／關閉按鈕（49 × 47） */
.round-btn { width: 49px; height: 47px; flex: none; border-radius: 50%; }
.round-btn .ic { width: 49px; height: 47px; }

/* 漸變膠囊按鈕（Book Now／Confirm Booking） */
.pill-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: 311px;
  max-width: 100%;
  height: 50px;
  margin: 0 auto;
  border-radius: 30px;
  background: var(--grad-cta);
  color: #fff;
  font-size: 28px;
  font-weight: 200;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 10px rgba(26, 95, 158, 0.18);
  transition: transform 0.15s, box-shadow 0.15s;
}
.pill-btn:active { transform: scale(0.98); }
@media (hover: hover) { .pill-btn:hover { box-shadow: 0 6px 16px rgba(26, 95, 158, 0.3); } }
.pill-arrow { width: 10px; height: 16px; }
.pill-sm { font-size: 24px; }

/* 漸變分隔線（Figma Line 4） */
.g-line { height: 1px; margin: 0; border: 0; background: var(--grad-btn); opacity: 0.9; }
.mc-line { margin: 18px 16px 0; }

/* 器材標籤 */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
  height: 16px;
  padding: 0 5px;
  border: 1px solid #ddddde;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 300;
  line-height: 14px;
}
.tags-lg li { height: 27px; padding: 0 10px; font-size: 14px; line-height: 25px; }

/* 底部固定操作列（Figma bottom-fixed-bar） */
.action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
  background: #fff;
  border-radius: 15px 15px 0 0;
  box-shadow: inset 0 0.3px 1px rgba(0, 0, 0, 0.25), 0 -4px 16px rgba(0, 0, 0, 0.04);
}
.empty { padding: 32px 24px; text-align: center; font-size: 15px; font-weight: 300; color: var(--muted); }

/* 分頁列（手機底部） */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: none;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: #fff;
  box-shadow: inset 0 0.3px 1px rgba(0, 0, 0, 0.25);
}
body.has-tab .tabbar { display: block; }
.tabbar .brand { display: none; }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); height: 100%; max-width: 520px; margin: 0 auto; padding: 0 8px; }
.tabs button { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px; padding-top: 14px; }
.tab-ic { position: relative; display: grid; place-items: center; width: 32px; height: 32px; }
.tab-ic img { grid-area: 1 / 1; }
.tab-ic .on { display: none; }
.tabs .active .on { display: block; }
.tabs .active .off { display: none; }
.tab-tx { font-size: 12px; color: #8c8f94; white-space: nowrap; }
.tabs .active .tab-tx {
  background: var(--grad-btn);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 500;
}

/* ---------- 開始畫面 ---------- */
#start { overflow: hidden; color: #fff; cursor: pointer; }
.start-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(1px); transform: scale(1.02); z-index: -1; }
#start::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.25)); }
#start.active { display: flex; flex-direction: column; }
.start-title {
  margin: clamp(120px, 21svh, 180px) 22px 0 24px;
  font-size: 38px;
  font-weight: 700;
  line-height: 46px;
  text-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
  max-width: 340px;
}
.start-sub { display: none; }
.start-cta {
  width: 340px;
  height: 55px;
  margin: auto auto calc(52px + env(safe-area-inset-bottom));
  font-size: 28px;
}

/* ---------- 分店卡片 ---------- */
.store-grid { display: grid; gap: 16px; padding: 31px 15px 24px; }
.store-card {
  position: relative;
  border-radius: var(--radius-card);
  background: #fff;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}
.store-open { display: block; width: 100%; text-align: left; }
.store-photo { position: relative; display: block; height: 117px; overflow: hidden; border-radius: var(--radius-card) var(--radius-card) 0 0; }
.store-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.store-photo::after { content: ""; position: absolute; inset: 0; box-shadow: inset -50px 0 10px 1px rgba(0, 0, 0, 0.28); pointer-events: none; }
.store-body { display: block; padding: 7px 60px 13px 11px; }
.store-name { display: block; font-size: 18px; line-height: 22px; }
.store-meta { display: block; margin-top: 2px; font-size: 12px; color: var(--muted-2); }
.chev { position: absolute; right: 17px; bottom: 15px; width: 31px; height: 18px; }
.heart { position: absolute; top: 12px; right: 14px; width: 33px; height: 30px; display: grid; place-items: center; }
.heart .ic { width: 33px; height: 30px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25)); }
@media (hover: hover) { .store-open:hover .store-photo img { transform: scale(1.04); } }

/* ---------- 分店資訊 ---------- */
.si-hero { position: relative; height: 295px; overflow: hidden; }
.si-hero > img { width: 100%; height: 100%; object-fit: cover; }
.si-hero::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.1); pointer-events: none; }
.si-back { position: absolute; z-index: 1; top: max(37px, calc(env(safe-area-inset-top) + 30px)); left: 15px; }
.si-heart { position: absolute; z-index: 1; top: 44px; right: 20px; width: 49px; height: 47px; }
.si-heart .on { width: 49px; height: 47px; display: none; }
.si-heart.on .on { display: block; }
.heart-off-ic { display: block; width: 49px; height: 47px; border-radius: 50%; background: rgba(239, 239, 239, 0.5) url("../assets/r16/icons/heart-off.svg") center / 26px 24px no-repeat; }
.si-heart.on .heart-off-ic { display: none; }
.si-body {
  position: relative;
  margin-top: -12px;
  padding: 31px 14px calc(var(--action-h) + 10px);
  border-radius: 10px 10px 0 0;
  background: #fff;
}
.si-name { font-size: 24px; font-weight: 400; line-height: 29px; }
.label-chips { display: flex; gap: 14px; margin-top: 15px; overflow-x: auto; scrollbar-width: none; }
.label-chips::-webkit-scrollbar { display: none; }
.label-chips li {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 33px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 300;
}
.label-chips .ic { width: 20px; height: 20px; }
.si-body > .g-line { margin: 22px 0 0; }
.contact { margin-top: 12px; }
.contact li { display: flex; align-items: center; gap: 14px; min-height: 42px; padding-left: 11px; font-size: 14px; font-weight: 300; color: var(--muted); }
.contact a { text-decoration: none; }
.contact a:hover { color: var(--teal); text-decoration: underline; }
.ct-ic { display: grid; place-items: center; width: 26px; flex: none; }
.ct-ic .phone { transform: rotate(56deg) skewX(-3deg); }
.si-map { position: relative; margin: 10px -14px 0; overflow: hidden; }
.si-map > img { width: 100%; height: 250px; object-fit: cover; }
.si-action .pill-btn { margin-top: -10px; }
.si-action { padding-top: 0; height: calc(73px + env(safe-area-inset-bottom)); }

/* ---------- 選擇器材 ---------- */
#machine { background: #fff; }
.mc-top { display: flex; align-items: center; gap: 20px; padding: 0 27px 0 17px; }
.mc-top .search { flex: 1; min-width: 0; margin: 0; }
.cat-chips { margin-top: 43px; padding-left: 13px; gap: 9px; }
.cat-chips .chip { font-size: 14px; padding: 0 12px; }
.cat-chips .chip:first-child { font-size: 18px; }
.cat-chips .ic { width: 16px; height: 16px; }
.result-count { margin: 24px 16px 0; font-size: 14px; font-weight: 300; color: var(--muted); }
.machine-grid { display: grid; gap: 20px; padding: 10px 16px 32px; }
.machine-card {
  display: flex;
  height: 120px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: linear-gradient(#fff, #fff) padding-box, var(--grad-btn) border-box;
  overflow: hidden;
}
.mc-img { flex: none; width: 152px; display: grid; place-items: center; padding: 0 6px 0 16px; }
.mc-img img { max-width: 100%; max-height: 116px; width: auto; height: auto; object-fit: contain; }
.mc-info { position: relative; flex: 1; min-width: 0; padding: 12px 10px 0 12px; }
.mc-name { font-size: 16px; font-weight: 300; line-height: 19px; }
.mc-info .tags { margin-top: 10px; }
.mk-btn {
  position: absolute;
  right: 10px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 130px;
  height: 34px;
  border: 1px solid var(--mint);
  border-radius: 3px;
  background: var(--grad-btn);
  color: #fff;
  font-size: 14px;
}
.mk-arrow { width: 7px; height: 11px; }
@media (hover: hover) { .mk-btn:hover { filter: brightness(1.06); } }

/* ---------- 確認預約 ---------- */
#mbook { background: linear-gradient(180deg, #42caa2 0%, #64d4b3 6%, #64d4b3 10%, #f8f9fb 43%); }
#mbook .status { position: absolute; top: 0; left: 0; }
.mb-visual { position: relative; padding-top: 93px; }
.mb-back { position: absolute; top: 37px; left: 17px; }
.mb-visual > img { width: 269px; height: 237px; margin: 0 auto; object-fit: contain; }
.mb-body { padding: 53px 14px calc(var(--action-h) + 12px); }
.mb-name { font-size: 24px; font-weight: 400; }
.mb-body .tags-lg { margin-top: 12px; }
.mb-body > .g-line { margin-top: 23px; }
.summary-box { margin: 26px 7px 0; padding: 0 22px; border-radius: 10px; background: #fff; box-shadow: var(--shadow-card); }
.sum-row {
  display: flex;
  align-items: center;
  gap: 21px;
  width: 100%;
  min-height: 87px;
  padding-left: 5px;
  border-bottom: 1px solid transparent;
  border-image: var(--grad-btn) 1;
  font-size: 22px;
  font-weight: 300;
  text-align: left;
}
.sum-row:last-child { border-bottom: 0; }
.sum-row .ic { width: 27px; height: 27px; }
@media (hover: hover) { .sum-row:hover span { color: var(--teal); } }
.mb-action {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 12px 20px calc(24px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(248, 249, 251, 0), #f8f9fb 40%);
}

/* ---------- 日期／時段選擇 ---------- */
.picker { background: var(--page); }
.picker-head { position: sticky; top: 0; z-index: 10; background: linear-gradient(90deg, #42caa2, #2e94a0 50%, #1a5f9e); color: #fff; }
.picker-bar { display: flex; align-items: center; gap: 19px; height: 56px; padding: 0 17px; }
.picker-bar .band-title { padding: 0; font-weight: 700; }
.weekdays { display: flex; justify-content: space-between; padding: 0 21px; height: 39px; align-items: center; font-size: 14px; }
.weekdays span { width: 40px; text-align: center; }
.weekdays .sun { color: #af292b; }
.picker-head .weekdays { background: rgba(0, 0, 0, 0.06); }
.months { padding: 8px 0 calc(var(--action-h) + 50px); }
.month { padding: 14px 0 6px; }
.month + .month { border-top: 1px solid rgba(0, 0, 0, 0.06); }
.month-name { text-align: center; font-size: 18px; font-weight: 400; margin-bottom: 16px; }
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 6px; padding: 0 24px; }
.day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  height: 52px;
  font-size: 18px;
}
.day .num { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; transition: background 0.15s; }
.day.full, .day.outside { color: rgba(0, 0, 0, 0.3); cursor: default; }
.day .full-tx { position: absolute; top: 30px; font-size: 13px; }
.day.selected .num { background: var(--grad-btn); color: #fff; }
@media (hover: hover) { .day:not(.full):not(.outside):not(.selected):not(.blank):hover .num { background: rgba(66, 202, 162, 0.14); } }
.picker-action { display: flex; flex-direction: column; gap: 14px; padding-top: 18px; }
.picked { padding-left: 14px; font-size: 20px; font-weight: 300; }
.picker-action .pill-btn { margin: 0 auto; }
.week-card { padding: 14px 0 4px; background: var(--page); }
.week-card .month-name { margin-bottom: 8px; }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); padding: 0 21px; }
#time .week-strip .day { height: 50px; }
.slots { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0 calc(var(--action-h) + 50px); }
.slot {
  position: relative;
  flex: none;
  width: 232px;
  height: 47px;
  border-radius: 8px;
  font-size: 22px;
  letter-spacing: 1.92px;
  font-variant-numeric: tabular-nums;
}
.slot.selected { background: var(--grad-btn); color: #fff; }
.slot.full { color: rgba(0, 0, 0, 0.25); text-decoration: line-through; cursor: default; }
.slot-mark { position: absolute; left: -36px; top: 50%; width: 20px; height: 26px; transform: translateY(-50%); }
@media (hover: hover) { .slot:not(.selected):not(.full):hover { background: rgba(66, 202, 162, 0.14); } }

/* 時段畫面（<1024px）：頁首及一週日期固定，只有時段清單捲動（與設計稿一致） */
@media (max-width: 1023px) {
  #time.active { display: flex; flex-direction: column; height: 100svh; min-height: 0; }
  #time .picker-head, #time .week-card { flex: none; }
  #time .week-card { border-bottom: 1px solid rgba(0, 0, 0, 0.08); }
  #time .slots { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: calc(var(--action-h) + 60px); }
}

/* ---------- 我的預約 ---------- */
.booking-grid { display: grid; gap: 22px; padding: 22px 21px 24px; }
.booking-card { padding: 14px 18px 16px; border-radius: 8px; background: #fff; box-shadow: var(--shadow-card); }
.bk-head { display: flex; align-items: center; justify-content: space-between; min-height: 29px; }
.bk-status { display: inline-flex; align-items: center; gap: 6px; font-size: 16px; color: #5c5c5c; }
.bk-btn {
  min-width: 103px;
  height: 28px;
  padding: 0 10px;
  border-radius: 3px;
  background: var(--grad-btn);
  color: #fff;
  font-size: 14px;
}
.booking-card .g-line { margin: 9px 0 13px; opacity: 0.55; }
.bk-name { font-size: 24px; font-weight: 400; line-height: 29px; }
.bk-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; color: var(--muted); }
.bk-store { font-size: 18px; }
.bk-date { font-size: 16px; }
.bk-meta .ic { flex: none; }
.is-cancelled .bk-status { color: #af292b; }
.is-cancelled .bk-name, .is-cancelled .bk-meta { opacity: 0.6; }

/* ---------- 帳戶 ---------- */
.acc-band { min-height: 178px; }
.acc-user { display: flex; align-items: center; gap: 13px; padding: 24px 23px 0; color: #fff; }
.avatar { width: 75px; height: 75px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.9); object-fit: cover; }
.acc-name { font-size: 26px; font-weight: 400; line-height: 31px; }
.acc-edit { display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 18px; font-weight: 300; color: #fff; }
.acc-tiles { display: grid; grid-template-columns: repeat(2, 155px); justify-content: center; gap: 31px 32px; padding: 62px 0 32px; background: #fff; min-height: calc(100svh - 178px); align-content: start; }
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  height: 220px;
  border-radius: 20px;
  font-size: 24px;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s, box-shadow 0.15s;
}
.tile .ic { height: 34px; width: auto; }
.tile.mint { background: #b3eada; }
.tile.mint2 { background: rgba(66, 202, 162, 0.4); }
.tile.blue { background: rgba(28, 100, 159, 0.4); }
.tile:active { transform: scale(0.98); }
@media (hover: hover) { .tile:hover { transform: translateY(-3px); box-shadow: 0 8px 14px rgba(0, 0, 0, 0.2); } }

/* ---------- 對話框及提示 ---------- */
.dlg {
  width: min(340px, calc(100vw - 40px));
  padding: 24px 22px 20px;
  border: 0;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  font-family: var(--font);
  text-align: center;
}
.dlg::backdrop { background: rgba(0, 0, 0, 0.4); }
.dlg h2 { font-size: 20px; font-weight: 500; }
.dlg p { margin-top: 10px; font-size: 15px; font-weight: 300; color: var(--muted); }
.dlg-actions { display: flex; gap: 12px; margin-top: 20px; }
.dlg-btn { flex: 1; height: 42px; border-radius: 21px; font-size: 16px; }
.dlg-btn.ghost { border: 1px solid var(--mint); }
.dlg-btn.solid { background: var(--grad-btn); color: #fff; }
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + 18px + env(safe-area-inset-bottom));
  z-index: 70;
  max-width: calc(100vw - 40px);
  padding: 10px 18px;
  border-radius: 20px;
  background: rgba(26, 25, 25, 0.88);
  color: #fff;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 平板（≥768px）：同一手機版式，增加欄數 ---------- */
@media (min-width: 768px) {
  .chips, .toolbar { max-width: 960px; }
  .toolbar { margin: 0 auto; }
  .search { margin-left: 18px; margin-right: 18px; }
  .store-grid, .booking-grid { grid-template-columns: repeat(2, 1fr); max-width: 960px; margin: 0 auto; padding-left: 18px; padding-right: 18px; }
  .store-photo { height: 160px; }
  .machine-grid { grid-template-columns: repeat(2, 1fr); max-width: 960px; margin: 0 auto; }
  .mc-wrap { max-width: 960px; margin: 0 auto; }
  .acc-tiles { grid-template-columns: repeat(4, 155px); }
  .si-hero { height: 380px; }
  .si-body, .mb-body { max-width: 720px; margin-left: auto; margin-right: auto; }
  .si-map { margin: 14px 0 0; border-radius: 12px; }
  .month-grid, .week-strip, .weekdays { max-width: 560px; margin-left: auto; margin-right: auto; width: 100%; }
  .action-bar, .mb-action { padding-left: calc(50% - 300px); padding-right: calc(50% - 300px); }
  .slots { display: grid; grid-template-columns: repeat(3, 232px); justify-content: center; gap: 8px 16px; }
  .slot-mark { display: none; }
  .picker-head .weekdays { max-width: none; padding: 0 calc(50% - 280px); }
  .mb-visual > img { width: 360px; height: 317px; }
  .start-title { font-size: 52px; line-height: 62px; max-width: 560px; margin-left: 48px; }
}

/* ---------- 桌面（≥1024px）：導覽列移到頂部，多欄排版 ---------- */
@media (min-width: 1024px) {
  :root { --nav-h: 72px; --wrap: 1200px; }
  .mob-only { display: none !important; }
  .desk-only { display: block !important; }
  .status { display: none; }
  body.has-tab main { padding-bottom: 0; }
  body:not(.on-start) main { padding-top: var(--nav-h); }

  /* 頂部導覽：沿用分頁列的白底、圖示及漸變文字 */
  .tabbar, body.has-tab .tabbar {
    display: flex;
    align-items: center;
    top: 0;
    bottom: auto;
    height: var(--nav-h);
    padding: 0 calc(var(--site-back-w) + 48px) 0 max(32px, calc(50% - var(--wrap) / 2));
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06), 0 4px 18px rgba(0, 0, 0, 0.04);
  }
  body.on-start .tabbar { display: none; }
  .tabbar .brand {
    display: block;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: var(--grad-btn);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    white-space: nowrap;
  }
  .tabbar .brand span { font-weight: 300; }
  .tabs { display: flex; gap: 8px; height: 100%; max-width: none; margin: 0 0 0 auto; padding: 0; }
  .tabs button { flex-direction: row; align-items: center; justify-content: center; gap: 10px; padding: 0 16px; position: relative; }
  .tabs button::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--grad-btn); transform: scaleX(0); transition: transform 0.2s; }
  .tabs .active::after { transform: scaleX(1); }
  .tab-ic { width: 28px; height: 28px; }
  .tab-ic img { max-height: 24px; width: auto; }
  .tab-tx { font-size: 15px; }
  @media (hover: hover) { .tabs button:hover .tab-tx { color: var(--teal); } }

  /* 漸變頁首變為頁面標題帶 */
  .band { min-height: 0; padding: 40px max(32px, calc(50% - var(--wrap) / 2)) 54px; }
  .band-title { padding: 0; font-size: 34px; line-height: 41px; }
  .sheet { max-width: calc(var(--wrap) + 64px); margin: -24px auto 0; padding: 28px 32px 40px; border-radius: 15px 15px 0 0; min-height: calc(100svh - var(--nav-h) - 111px); }
  .toolbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; max-width: none; }
  .toolbar .chips { padding: 0; }
  .toolbar .search { flex: 0 1 380px; margin: 0; }
  .store-grid { grid-template-columns: repeat(3, 1fr); gap: 24px; max-width: none; padding: 28px 0 0; }
  .store-photo { height: 200px; }
  .store-card { transition: box-shadow 0.2s, transform 0.2s; }
  @media (hover: hover) { .store-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12); } }

  /* 開始畫面：橫向大圖，標題及按鈕靠左 */
  #start.active { justify-content: center; padding: 0 max(48px, calc(50% - 560px)); }
  .start-title { margin: 0; font-size: clamp(56px, 5vw, 84px); line-height: 1.15; max-width: 760px; }
  .start-sub { display: block; margin-top: 18px; font-size: 22px; font-weight: 300; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35); }
  .start-cta { margin: 44px 0 0; }

  /* 分店資訊：左邊相片＋地圖，右邊資料＋預約按鈕 */
  #storeinfo { padding: 32px max(32px, calc(50% - var(--wrap) / 2)) 48px; }
  .si-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; align-items: start; }
  .si-media { display: grid; gap: 20px; }
  .si-hero { height: 400px; border-radius: 15px; }
  .si-back { top: 20px; left: 20px; }
  .si-heart { top: 20px; right: 20px; }
  .si-media .si-map { margin: 0; border-radius: 15px; box-shadow: var(--shadow-card); }
  .si-media .si-map > img { height: 280px; }
  .si-body { margin: 0; max-width: none; padding: 32px 28px; border-radius: 15px; box-shadow: var(--shadow-card); position: sticky; top: calc(var(--nav-h) + 24px); }
  .si-name { font-size: 32px; line-height: 39px; }
  .label-chips { flex-wrap: wrap; gap: 10px; }
  .contact li { font-size: 16px; min-height: 48px; }
  .si-action, .si-action.action-bar { position: static; height: auto; margin-top: 28px; padding: 0; background: none; box-shadow: none; border-radius: 0; }
  .si-action .pill-btn { margin: 0; width: 100%; }

  /* 選擇器材：搜尋列在上，器材卡兩欄 */
  #machine { background: transparent; }
  .mc-wrap { max-width: calc(var(--wrap) + 64px); padding: 32px 32px 48px; }
  .mc-top { padding: 0; gap: 24px; }
  .mc-top .search { flex: 0 1 520px; }
  .cat-chips { margin-top: 28px; padding: 0; }
  .mc-line { margin: 20px 0 0; }
  .result-count { margin: 20px 0 0; }
  .machine-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; max-width: none; padding: 14px 0 0; }
  .machine-card { height: 168px; transition: box-shadow 0.2s, transform 0.2s; }
  @media (hover: hover) { .machine-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(26, 95, 158, 0.12); } }
  .mc-img { width: 190px; padding: 0 12px 0 24px; }
  .mc-img img { max-height: 150px; }
  .mc-info { padding: 20px 16px 0 16px; }
  .mc-name { font-size: 20px; line-height: 24px; }
  .mc-info .tags li { height: 20px; font-size: 13px; line-height: 18px; }
  .mk-btn { right: 16px; bottom: 18px; width: 150px; height: 38px; font-size: 15px; }

  /* 確認預約：左邊器材圖，右邊摘要 */
  #mbook { background: linear-gradient(180deg, #42caa2 0%, #64d4b3 12%, #f8f9fb 60%); }
  .mb-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; max-width: calc(var(--wrap) + 64px); margin: 0 auto; padding: 40px 32px 56px; min-height: calc(100svh - var(--nav-h)); }
  .mb-visual { padding: 0; }
  .mb-back { top: 0; left: 0; }
  .mb-visual > img { width: min(100%, 480px); height: 440px; }
  .mb-body { max-width: none; margin: 0; padding: 0; }
  .mb-name { font-size: 36px; }
  .summary-box { margin: 28px 0 0; }
  .mb-action { position: static; margin-top: 32px; padding: 0; background: none; }
  .mb-action .pill-btn { margin: 0; width: 100%; }

  /* 日期：兩個月份並排；時段：格狀排列，摘要固定在右邊 */
  .picker-head { position: static; padding: 0 max(32px, calc(50% - var(--wrap) / 2)); }
  .picker-bar { height: 96px; padding: 0; }
  .picker-bar .band-title { font-size: 32px; }
  .picker-head .weekdays { display: none; }
  .months { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; max-width: calc(var(--wrap) + 64px); margin: 0 auto; padding: 32px 32px 160px; }
  .month { padding: 24px 20px; border-radius: 15px; background: #fff; box-shadow: var(--shadow-card); }
  .month + .month { border-top: 0; }
  .month .weekdays { display: flex !important; padding: 0 24px; margin-bottom: 8px; color: var(--muted); }
  .month-grid, .week-strip, .weekdays { max-width: none; }
  .day { height: 60px; }
  .action-bar.picker-action { flex-direction: row; align-items: center; justify-content: space-between; padding: 18px max(32px, calc(50% - var(--wrap) / 2)); border-radius: 0; }
  .picker-action .pill-btn { margin: 0; }
  .picked { font-size: 22px; }
  .week-card { max-width: 760px; margin: 28px auto 0; padding: 20px 24px; border-radius: 15px; background: #fff; box-shadow: var(--shadow-card); }
  .week-card::before { content: "Sun Mon Tue Wed Thu Fri Sat"; display: none; }
  #time .picker-head .weekdays { display: none; }
  .slots { grid-template-columns: repeat(4, 1fr); max-width: 1000px; margin: 0 auto; padding: 28px 32px 160px; }
  .slot { width: 100%; border: 1px solid rgba(0, 0, 0, 0.06); background: #fff; font-size: 20px; }
  .slot.full { background: transparent; }

  /* 預約紀錄及帳戶 */
  .booking-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; max-width: none; padding: 28px 0 0; }
  .acc-band { padding-top: 40px; }
  .acc-user { padding: 0; gap: 24px; }
  .avatar { width: 96px; height: 96px; }
  .acc-name { font-size: 32px; line-height: 39px; }
  .acc-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; max-width: calc(var(--wrap) + 64px); margin: -24px auto 0; padding: 40px 32px 48px; border-radius: 15px 15px 0 0; min-height: 0; }
  .tile { height: 240px; }
  .toast { bottom: 32px; }
}

/* 闊螢幕：器材及預約卡改為三欄 */
@media (min-width: 1440px) {
  .machine-grid, .booking-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- 右上角返回按鈕（回到主網站 Skills） ---------- */
:root { --site-back-w: 92px; }
.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;
}
.site-back {
  position: fixed;
  z-index: 60;
  top: calc(env(safe-area-inset-top) + 4px);
  right: calc(env(safe-area-inset-right) + 10px);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px 0 6px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.78);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.site-back img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.site-back:active { background: rgba(24, 90, 157, 0.92); }
@media (hover: hover) and (pointer: fine) {
  .site-back:hover { background: rgba(24, 90, 157, 0.92); box-shadow: 0 4px 18px rgba(24, 90, 157, 0.45); }
}
.site-back:focus-visible { outline: 3px solid var(--mint); outline-offset: 2px; }

/* 桌面：按鈕在頂部導覽列高度內垂直置中 */
@media (min-width: 1024px) {
  :root { --site-back-w: 112px; }
  .site-back { top: 17px; right: max(24px, calc(50% - var(--wrap) / 2 - 8px)); height: 38px; padding: 0 18px 0 7px; font-size: 15px; gap: 9px; }
  .site-back img { width: 24px; height: 24px; }
  .tabbar, body.has-tab .tabbar { padding-right: calc(max(24px, calc(50% - var(--wrap) / 2 - 8px)) + var(--site-back-w) + 24px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
