/* =========================================================
   Mami｜工作室 — style.css
   單一套 HTML；由後台只需輸出一個 data-theme：
     editorial = 雜誌奶茶
     soft      = 柔潤粉紅
     minimal   = 極簡夏日
========================================================= */

/* =========================
   Theme Presets（固定三款）
========================= */

/* Theme 1：雜誌奶茶 Editorial Milk Tea */
:root,
[data-theme="editorial"] {
  --brand-accent: #c9b59c;
  --brand-hover: #a28b70;
  --brand-ink: #745f4d;
  --warm-accent: #745f4d;
  --brand-light: #efe9e3;
  --on-accent: #3f352b;

  --text-primary: #493f36;
  --text-secondary: #8b7b6e;

  --bg-primary: #f6f1ec;
  --bg-secondary: #efe9e3;
  --bg-desk: #d9cfc7;

  --border-color: #d9cfc7;
  --shadow-soft: 0 6px 22px rgba(92, 76, 62, .10);
  --outline-soft: #c9b59c;
  --icon-bg: #efe9e3;
  --icon-border: transparent;
  --card-hover-bg: #f7f3ee;
  --card-hover-shadow: 0 10px 26px rgba(116, 95, 77, .14);
  --focus-ring: rgba(201, 181, 156, .45);
}

/* Theme 2：柔潤粉紅 Soft Rose */
[data-theme="soft"] {
  --brand-accent: #efb6b6;
  --brand-hover: #e5a4a4;
  --brand-ink: #92605d;
  --warm-accent: #e9a17f;
  --brand-light: #ffdcdc;
  --on-accent: #573c34;

  --text-primary: #594641;
  --text-secondary: #8b6d65;

  --bg-primary: #fffbf9;
  --bg-secondary: #fff2eb;
  --bg-desk: #fff8f6;

  --border-color: #f4d6d4;
  --shadow-soft: 0 6px 22px rgba(154, 100, 84, .10);
  --outline-soft: #ffd6ba;
  --icon-bg: #ffdcdc;
  --icon-border: transparent;
  --card-hover-bg: #fff2f0;
  --card-hover-shadow: 0 10px 26px rgba(154, 100, 84, .14);
  --focus-ring: rgba(239, 182, 182, .55);
}

/* Theme 3：極簡夏日 Minimal Summer */
[data-theme="minimal"] {
  --brand-accent: #89d4ff;
  --brand-hover: #4ec4ff;
  --brand-ink: #27749c;
  --warm-accent: #de8f6e;
  --brand-light: #eaf9ff;
  --on-accent: #153f52;

  --text-primary: #49443e;
  --text-secondary: #8a8177;

  --bg-primary: #fffef9;
  --bg-secondary: #fdf4af;
  --bg-desk: #f3f4f1;

  --border-color: #dfddcf;
  --shadow-soft: 0 6px 22px rgba(39, 116, 156, .09);
  --outline-soft: #bce8ff;
  --icon-bg: #fff9dc;
  --icon-border: #f0e6b8;
  --card-hover-bg: #f0faff;
  --card-hover-shadow: 0 10px 26px rgba(39, 116, 156, .14);
  --focus-ring: rgba(137, 212, 255, .48);
}

/* =========================
   Root Variables（版型）
========================= */
:root {
  /* --- 風格變數（各主題覆寫） --- */
  --radius-lg: 20px;   /* 卡片 */
  --radius-md: 14px;   /* 按鈕 / chip */
  --radius-sm: 10px;   /* 小元件 */
  --radius-avatar: 50%;

  --font-display: 'Noto Sans TC', sans-serif;  /* 標題字體 */
  --fs-page-title: 22px;   /* 頁標題 */
  --fs-hero: 26px;         /* 首頁大標 */
  --fs-section: 14px;      /* 區塊標題 */
  --fs-item: 15px;         /* 項目名稱 */
  --fs-price: 15px;
  --fs-meta: 12px;

  --tracking-title: 0px;
  --tracking-label: 1px;
  --weight-title: 800;

  --shadow-card: var(--shadow-soft);
  --border-width: 1px;
  --section-gap: 24px;

  /* --- 版面寬度（平板/桌面共用，讓每個頁面的外框與內容寬度一致） --- */
  --shell-tablet: 760px;     /* 平板外框寬度，所有頁面共用 */
  --shell-desktop: 1180px;   /* 桌面外框寬度，所有頁面共用 */
  --content-reading: 800px;  /* 內容頁(確認/成功/個人資料/關於我們/條款)的內容寬度，維持易讀行寬 */
  --content-form: 580px;     /* 表單頁(綁定/編輯資料)的內容寬度，避免輸入欄位過寬 */
}

/* --- Theme A：柔潤 --- */
[data-theme="soft"] {
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 14px;
  --fs-page-title: 22px;
  --fs-hero: 25px;
  --fs-item: 15px;
  --tracking-title: .3px;
  --weight-title: 800;
  --shadow-card: var(--shadow-soft);
  --section-gap: 26px;
}

/* --- Theme B：雜誌（襯線標題、對比字級） --- */
[data-theme="editorial"] {
  --radius-lg: 12px;
  --radius-md: 10px;
  --radius-sm: 8px;
  --font-display: 'Noto Serif TC', serif;
  --fs-page-title: 24px;
  --fs-hero: 30px;
  --fs-section: 13px;
  --fs-item: 16px;
  --fs-meta: 11.5px;
  --tracking-title: 2px;
  --tracking-label: 2px;
  --weight-title: 600;
  --shadow-card: var(--shadow-soft);
  --section-gap: 28px;
}

/* --- Theme C：極簡（直角、細線、小字距） --- */
[data-theme="minimal"] {
  --radius-lg: 2px;
  --radius-md: 2px;
  --radius-sm: 2px;
  --radius-avatar: 6px;
  --fs-page-title: 19px;
  --fs-hero: 24px;
  --fs-section: 12.5px;
  --fs-item: 14.5px;
  --fs-price: 14px;
  --fs-meta: 11.5px;
  --tracking-title: 3px;
  --tracking-label: 2px;
  --weight-title: 700;
  --shadow-card: none;
  --section-gap: 22px;
}

/* =========================
   Reset
========================= */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
button { font: inherit; cursor: pointer; }
a { text-decoration: none; color: inherit; }
a:hover { color: var(--brand-hover); }
img { display: block; max-width: 100%; }
.no-scrollbar { scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* =========================
   Base
========================= */
body {
  font-family: var(--font-display);
  color: var(--text-primary);
  background: var(--bg-desk);
  -webkit-font-smoothing: antialiased;
}
.display { font-family: var(--font-display); letter-spacing: var(--tracking-title); font-weight: var(--weight-title); }
.mono { font-family: 'Space Mono', monospace; }

/* =========================
   Layout
========================= */
.app-shell {
  max-width: 460px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 60px rgba(0, 0, 0, .06);
}
.app-header {
  position: sticky; top: 0; z-index: 20;
  padding-top: calc(16px + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg-primary) 95%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: var(--border-width) solid var(--border-color);
}
.app-main { flex: 1; overflow-y: auto; }
.app-footer {
  position: sticky; bottom: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg-primary) 94%, transparent);
  backdrop-filter: blur(12px);
  border-top: var(--border-width) solid var(--border-color);
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}
/* 主導覽外框：1024px 以下為右側抽屜選單(見 Responsive 區段)，桌面版併入頁首列(見 Desktop 區段)；此處只放兩者共用的樣式 */
.app-nav {
  z-index: 20;
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--bg-primary) 95%, transparent);
  backdrop-filter: blur(12px);
}
/* 選單按鈕/遮罩/關閉按鈕僅抽屜選單使用，預設隱藏(桌面版不顯示)，於 Responsive 區段的媒體查詢中才顯示 */
.nav-toggle, .nav-mask, .nav-close { display: none; }
/* 抽屜選單開啟時鎖定頁面捲動，避免背景內容跟著抽屜一起捲動 */
body.nav-open { overflow: hidden; }
.page-title { font-family: var(--font-display); font-size: var(--fs-page-title); font-weight: var(--weight-title); letter-spacing: var(--tracking-title); }

/* =========================
   Components
========================= */
.brand-mark { color: var(--brand-ink); }

.btn-primary {
  display: block; width: 100%; text-align: center;
  padding: 17px; border: none;
  border-radius: var(--radius-md);
  background: var(--brand-accent); color: var(--on-accent);
  font-family: var(--font-display);
  font-size: 16px; font-weight: var(--weight-title);
  letter-spacing: var(--tracking-label);
  transition: background .15s;
}
.btn-primary:hover { background: var(--brand-hover); color: var(--on-accent); }

.btn-pill {
  padding: 15px 26px; border: none;
  border-radius: var(--radius-md);
  background: var(--brand-accent); color: var(--on-accent);
  font-family: var(--font-display);
  font-size: 15px; font-weight: var(--weight-title);
  letter-spacing: var(--tracking-label);
  transition: background .15s;
}
.btn-pill:hover { background: var(--brand-hover); }

.btn-ghost {
  display: block; width: 100%; text-align: center;
  padding: 15px; border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: var(--border-width) solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 14px; font-weight: 600;
  letter-spacing: var(--tracking-label);
}

.card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: var(--border-width) solid var(--border-color);
  box-shadow: var(--shadow-card);
}

/* 首頁功能入口：三款主題共用整張卡片的互動規則 */
.home-action-card {
  color: var(--text-primary);
  cursor: pointer;
  transition:
    background-color .18s ease,
    border-color .18s ease,
    box-shadow .18s ease,
    color .18s ease,
    transform .18s ease;
}
.home-action-card:hover,
.home-action-card:focus-visible {
  color: var(--text-primary);
  background: var(--card-hover-bg);
  border-color: var(--brand-accent);
  box-shadow: var(--card-hover-shadow);
  transform: translateY(-2px);
}
.home-action-card:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}
.home-action-card:active {
  box-shadow: var(--shadow-card);
  transform: translateY(0);
}

.hero-card {
  position: relative; overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  padding: 30px 22px;
}
.hero-title { font-family: var(--font-display); font-size: var(--fs-hero); font-weight: var(--weight-title); letter-spacing: var(--tracking-title); line-height: 1.45; }

.logo-square {
  border: 1.5px solid var(--outline-soft);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  color: var(--brand-ink);
}
/* 工作室 Logo 專用：不顯示外框邊線(個人資料頁的會員頭像仍沿用 .logo-square 的邊框，故以修飾 class 區分) */
.logo-square--logo { border: 0; }
/* 工作室 Logo 圖片(系統設定上傳，長寬比不固定)：以 contain 等比例填滿方框；獨立 class 不影響個人資料頁的 LINE 大頭貼 */
.logo-square__img { width: 100%; height: 100%; object-fit: contain; }

.eyebrow { font-family: var(--font-display); font-size: 11px; letter-spacing: var(--tracking-label); color: var(--brand-ink); }

.section-head { display: flex; align-items: center; gap: 9px; }
.section-bar { width: 16px; height: 3px; border-radius: 2px; background: var(--warm-accent, var(--brand-accent)); }
.section-title { font-family: var(--font-display); font-size: var(--fs-section); font-weight: var(--weight-title); letter-spacing: var(--tracking-title); }

.icon-badge {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: var(--icon-bg); color: var(--brand-ink);
  border: 1px solid var(--icon-border);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}

/* Home list entry */
.entry { display: flex; align-items: center; justify-content: space-between; padding: 22px 4px; border-bottom: var(--border-width) solid var(--border-color); }
.entry__name { font-family: var(--font-display); font-size: 18px; font-weight: var(--weight-title); letter-spacing: var(--tracking-title); }

/* Selectable: artist */
.artist { display: flex; flex-direction: column; align-items: center; gap: 9px; flex: 0 0 auto; width: 74px; background: none; border: none; padding: 6px 0; }
.artist__avatar {
  display: flex; align-items: center; justify-content: center;
  width: 58px; height: 58px; border-radius: var(--radius-avatar);
  font-family: var(--font-display);
  font-size: 21px; font-weight: 700;
  background: var(--icon-bg); color: var(--brand-ink);
  border: 1px solid var(--icon-border);
  transition: .15s;
}
.artist__name { font-family: var(--font-display); font-size: 12.5px; font-weight: 500; letter-spacing: var(--tracking-title); color: var(--text-secondary); text-align: center; }
.artist.is-selected .artist__avatar {
  background: var(--brand-accent);
  border-color: var(--brand-accent);
  color: var(--on-accent);
}
.artist.is-selected .artist__name { color: var(--text-primary); font-weight: 700; }

/* Selectable: service row */
.service {
  display: flex; align-items: center; gap: 13px; width: 100%;
  padding: 15px 16px; margin-bottom: 11px;
  background: var(--bg-primary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: .15s;
  box-shadow: var(--shadow-card);
}
.service__marker { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-color); background: var(--bg-primary); }
.service__name { font-family: var(--font-display); font-size: var(--fs-item); font-weight: 600; color: var(--text-primary); letter-spacing: var(--tracking-title); }
.service__meta { display: block; font-size: var(--fs-meta); color: var(--text-secondary); margin-top: 3px; }
.service__price { font-family: 'Space Mono', monospace; font-size: var(--fs-price); font-weight: 700; color: var(--text-primary); }
.service.is-selected { background: var(--brand-light); border-color: var(--brand-accent); }
.service.is-selected .service__marker { border-color: var(--brand-accent); background: var(--brand-accent); box-shadow: inset 0 0 0 3px var(--bg-primary); }
.service.is-selected .service__name { font-weight: 700; }
.service.is-selected .service__price { color: var(--warm-accent, var(--brand-ink)); }

/* 極簡主題：服務改為細線清單 */
[data-theme="minimal"] .service {
  padding: 17px 2px; margin-bottom: 0;
  background: transparent; border: none;
  border-top: var(--border-width) solid var(--border-color);
  box-shadow: none;
}
[data-theme="minimal"] .service__marker { width: 14px; height: 14px; border-radius: 0; border-width: 1.5px; border-color: var(--text-secondary); background: transparent; }
[data-theme="minimal"] .service.is-selected { background: transparent; }
[data-theme="minimal"] .service.is-selected .service__marker { border-color: var(--brand-accent); background: var(--brand-accent); box-shadow: none; }

/* 雜誌主題：服務改為底線清單 */
[data-theme="editorial"] .service {
  padding: 18px 4px; margin-bottom: 0;
  background: transparent; border: none;
  border-bottom: var(--border-width) solid var(--border-color);
  box-shadow: none;
}
[data-theme="editorial"] .service__marker { width: 9px; height: 9px; border: none; background: transparent; box-shadow: 0 0 0 2px var(--border-color); }
[data-theme="editorial"] .service.is-selected { background: transparent; }
[data-theme="editorial"] .service.is-selected .service__marker { background: var(--brand-accent); box-shadow: 0 0 0 2px var(--brand-accent); }

/* Date chip */
.chip-date {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  flex: 0 0 auto; min-width: 54px; padding: 11px 8px;
  border-radius: var(--radius-sm); transition: .15s;
  background: var(--bg-secondary); color: var(--text-primary);
  border: var(--border-width) solid var(--border-color);
}
.chip-date__num { font-family: 'Space Mono', monospace; font-size: 15px; font-weight: 700; }
.chip-date__w { font-size: 11px; opacity: .82; }
.chip-date.is-selected { background: var(--brand-accent); color: var(--on-accent); border-color: var(--brand-accent); }

/* Time chip */
.chip-time {
  flex: 0 0 auto; padding: 11px 15px;
  font-family: 'Space Mono', monospace;
  font-size: 13.5px; font-weight: 700;
  border-radius: var(--radius-sm); transition: .15s;
  background: var(--bg-secondary); color: var(--text-primary);
  border: var(--border-width) solid var(--border-color);
}
.chip-time.is-selected { background: var(--brand-accent); color: var(--on-accent); border-color: var(--brand-accent); }
.chip-time.is-disabled { background: transparent; color: var(--border-color); border-color: var(--border-color); text-decoration: line-through; cursor: not-allowed; }
[data-theme="minimal"] .chip-date,
[data-theme="minimal"] .chip-time { background: transparent; }

/* 主導覽項目(純文字無圖示；不標示目前頁面，所有項目在各頁皆為相同樣式與間距的連結，頁首列不另放連結)；此為桌面頂部導覽的水平排列預設，抽屜選單於 Responsive 區段覆蓋為直式 */
.nav-item {
  display: flex; align-items: center; justify-content: center;
  flex: 1; min-width: 44px; min-height: 44px;
  color: var(--text-secondary); font-size: 13px; letter-spacing: var(--tracking-label);
}
.nav-item:hover { color: var(--brand-ink); }

/* Form fields */
.field-label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 9px; }
.field-input {
  width: 100%; padding: 15px 16px; font-size: 16px; font-family: inherit;
  color: var(--text-primary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary); transition: .15s;
}
.field-input:focus { outline: none; border-color: var(--brand-accent); }
.field-input[readonly] { color: var(--text-secondary); }
.field-input::placeholder { color: color-mix(in srgb, var(--text-secondary) 62%, transparent); }
/* 極簡 / 雜誌：底線式輸入 */
[data-theme="minimal"] .field-input,
[data-theme="editorial"] .field-input {
  padding: 12px 2px; border: none;
  border-bottom: 1.5px solid var(--border-color);
  border-radius: 0; background: transparent;
}
[data-theme="minimal"] .field-input:focus,
[data-theme="editorial"] .field-input:focus { border-bottom-color: var(--brand-accent); }
[data-theme="minimal"] .field-label,
[data-theme="editorial"] .field-label {
  font-family: 'Space Mono', monospace; font-size: 11px;
  letter-spacing: var(--tracking-label); color: var(--brand-ink); font-weight: 400;
}

/* Badges */
.badge { font-size: 11.5px; font-weight: 700; padding: 5px 11px; border-radius: 999px; letter-spacing: var(--tracking-label); }
.badge--pending { background: var(--brand-light); color: var(--brand-hover); }
.badge--done { background: color-mix(in srgb, var(--bg-secondary) 82%, var(--border-color)); color: var(--text-secondary); }
[data-theme="minimal"] .badge { border-radius: 0; font-family: 'Space Mono', monospace; font-size: 10px; }
[data-theme="minimal"] .badge--pending { background: var(--brand-accent); color: var(--on-accent); }
[data-theme="minimal"] .badge--done { background: transparent; border: 1px solid var(--border-color); color: var(--text-secondary); }

/* Notice + data rows */
.notice {
  display: flex; gap: 12px; padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: var(--border-width) solid var(--border-color);
}
[data-theme="minimal"] .notice { background: transparent; border-color: var(--brand-accent); }
.notice__icon { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; background: var(--brand-accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; }
.notice__text { font-size: 12.5px; line-height: 1.7; color: var(--brand-hover); }

.data-row { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; border-bottom: var(--border-width) solid var(--border-color); }
.data-row__k { font-family: var(--font-display); font-size: 13.5px; letter-spacing: var(--tracking-title); color: var(--text-secondary); }
.data-row__v { font-family: var(--font-display); font-size: 14px; font-weight: 700; letter-spacing: var(--tracking-title); }
/* 數值類（日期 / 時間 / 金額）統一等寬字型 */
.data-row__v--num { font-family: 'Space Mono', monospace; font-size: 14px; font-weight: 700; }
.data-row__v--price { font-family: 'Space Mono', monospace; font-size: 19px; font-weight: 700; color: var(--warm-accent, var(--brand-ink)); }
[data-theme="minimal"] .data-row__k { font-family: 'Space Mono', monospace; font-size: 11px; letter-spacing: var(--tracking-label); }
.field-input, .field-input::placeholder { font-family: var(--font-display); }
[data-theme="editorial"] .data-row__v--price { font-size: 20px; }

/* Add-on（加購）— 選中服務後展開 */
.addons {
  display: none;
  padding: 4px 16px 16px;
  margin: -11px 0 11px;
  background: var(--brand-light);
  border: 1.5px solid var(--brand-accent);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}
.service.is-selected + .addons { display: block; }
.addons__title {
  font-family: var(--font-display);
  font-size: 10.5px; letter-spacing: var(--tracking-label);
  color: var(--brand-hover);
  padding: 10px 0 4px;
}
.addon {
  display: flex; align-items: center; gap: 11px; width: 100%;
  min-height: 44px; padding: 11px 0; background: transparent; border: none;
  border-top: 1px solid color-mix(in srgb, var(--brand-accent) 22%, transparent);
  text-align: left;
}
.addon__box {
  flex: 0 0 auto; width: 19px; height: 19px;
  border: 1.5px solid color-mix(in srgb, var(--brand-accent) 45%, transparent);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: transparent; line-height: 1;
}
.addon__name { flex: 1; font-family: var(--font-display); font-size: 13.5px; letter-spacing: var(--tracking-title); color: var(--text-primary); }
.addon__price { font-family: 'Space Mono', monospace; font-size: 13px; font-weight: 700; color: var(--brand-hover); }
.addon.is-selected .addon__box { background: var(--brand-accent); border-color: var(--brand-accent); color: var(--on-accent); }
.addon.is-selected .addon__name { font-weight: 700; }
[data-theme="minimal"] .addons { border-radius: 0; }
[data-theme="minimal"] .addon__box { border-radius: 0; }
/* 極簡 / 雜誌主題：服務為清單式，加購改為左側內縮區塊 */
[data-theme="minimal"] .addons,
[data-theme="editorial"] .addons {
  margin: 0 0 4px; padding: 2px 14px 12px 29px;
  background: transparent;
  border: none;
  border-left: 2px solid var(--brand-accent);
  border-radius: 0;
}

/* Footer 金額（與列表同為等寬數字） */
.total-amount {
  font-family: 'Space Mono', monospace;
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
}

.app-footer > .flex-1 { min-width: 0; }
.app-footer .btn-pill { flex-shrink: 0; }

/* =========================
   Utilities
========================= */
.text-muted { color: var(--text-secondary); }
.text-brand { color: var(--warm-accent, var(--brand-ink)); }
.link-brand { color: var(--brand-hover); }
.stack { margin-top: var(--section-gap); }

/* =========================
   Responsive
========================= */
@media (min-width: 480px) { body { padding: 0; } }

@media (max-width: 340px) {
  .app-footer { gap: 8px; }
  .app-footer .btn-pill { padding-inline: 14px; }
  .total-amount { font-size: 17px; }
}

/* =========================
   手機/平板(1024px 以下)：主導覽收合為右側抽屜選單，由頁首的漢堡按鈕開啟
========================= */
@media (max-width: 1023px) {
  /* 頁首右側的漢堡按鈕：44px 觸控範圍，負右邊距讓圖示視覺上對齊頁首內距而非按鈕外框 */
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 auto; width: 44px; height: 44px; margin-right: -10px;
    background: transparent; border: none; border-radius: var(--radius-sm);
    color: var(--text-primary);
  }
  .nav-toggle:hover { color: var(--brand-ink); }
  /* 遮罩：蓋住整個視窗，預設透明且不可互動；visibility 延遲切換讓淡出動畫跑完才真正隱藏 */
  .nav-mask {
    display: block; position: fixed; inset: 0; z-index: 40;
    background: rgba(0, 0, 0, .45);
    opacity: 0; visibility: hidden;
    transition: opacity .25s ease, visibility 0s linear .25s;
  }
  .nav-mask.is-open { opacity: 1; visibility: visible; transition: opacity .25s ease; }
  /* 抽屜本體：固定於視窗右側全高，預設整個移出畫面右側，開啟時滑入；寬度最多佔 80% 視窗，小螢幕仍看得到遮罩可點擊關閉 */
  .app-nav {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 41;
    width: min(280px, 80vw);
    flex-direction: column; align-items: stretch; justify-content: flex-start;
    padding: calc(8px + env(safe-area-inset-top)) 0 calc(16px + env(safe-area-inset-bottom));
    border-left: var(--border-width) solid var(--border-color);
    box-shadow: var(--shadow-soft);
    overflow-y: auto;
    transform: translateX(100%); visibility: hidden;
    transition: transform .25s ease, visibility 0s linear .25s;
  }
  .app-nav.is-open { transform: none; visibility: visible; transition: transform .25s ease; }
  /* 抽屜右上角的關閉按鈕 */
  .nav-close {
    display: inline-flex; align-items: center; justify-content: center;
    align-self: flex-end; width: 44px; height: 44px; margin: 0 10px 8px 0;
    background: transparent; border: none; border-radius: var(--radius-sm);
    color: var(--text-primary);
  }
  .nav-close:hover { color: var(--brand-ink); }
  /* 抽屜內的導覽項目改為直式列表：靠左對齊、加大字級與列高、以底線分隔(覆蓋 .nav-item 的水平排列預設) */
  .app-nav .nav-item {
    flex: 0 0 auto; justify-content: flex-start;
    min-height: 52px; padding: 0 24px;
    font-size: 15px; color: var(--text-primary);
    border-bottom: var(--border-width) solid var(--border-color);
  }
  .app-nav .nav-item:last-child { border-bottom: 0; }
  .app-nav .nav-item:hover { color: var(--brand-ink); background: var(--bg-secondary); }
}

/* =========================
   Tablet
========================= */
@media (min-width: 768px) {
  body { padding: 24px; }

  .app-shell {
    max-width: var(--shell-tablet); /* 外框寬度統一，不再依頁面各自設定 */
    min-height: calc(100dvh - 48px);
    overflow: clip;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-lg);
  }

  .app-header { padding-inline: 30px; }
  .app-main { padding-inline: 32px; }
  .app-footer { padding-inline: 32px; }

  .page-home .app-main,
  .page-profile .app-main,
  .page-confirm .app-main { padding-bottom: 132px; }

  .page-home .grid.grid-cols-2 { gap: 20px; }
  .page-home .card { padding: 24px; }

  .page-records .app-main { padding-bottom: 132px; }
  /* 紀錄卡片格線掛在分頁面板上(而非 .app-main)，避免 .tabs 被當成格子而被撐高 */
  .page-records [data-tab-panel] {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 18px;
  }
  .page-records [data-tab-panel].hidden { display: none; } /* 未選取的分頁維持隱藏(覆蓋上方 display: grid) */
  .page-records [data-tab-panel] > * { margin-bottom: 0; } /* 卡片間距改由 gap 控制 */
  .page-records [data-tab-panel] > .btn-ghost,
  .page-records [data-tab-panel] > .empty-hint { grid-column: 1 / -1; } /* 新增預約按鈕與無資料提示佔滿整行 */

  /* 表單頁(綁定/編輯資料)：外框與其他頁面同寬，改以左右內距將表單置中，維持原本的欄位寬度 */
  .page-bind main,
  .page-bind .app-footer { padding-inline: max(32px, calc((100% - var(--content-form)) / 2)); }
}

/* =========================
   Desktop
========================= */
@media (min-width: 1024px) {
  body { padding: 32px; }

  .app-shell {
    max-width: var(--shell-desktop); /* 外框寬度統一，不再依頁面各自設定 */
    min-height: calc(100dvh - 64px);
  }

  /* 有主選單的頁面：手機版抽屜選單改為桌面頂部導覽，併入頁首列右側 */
  .page-with-nav .app-shell {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto;
    grid-template-rows: auto 1fr;
  }
  .page-with-nav .app-header {
    grid-column: 1;
    grid-row: 1;
  }
  .page-with-nav .app-nav {
    grid-column: 2;
    grid-row: 1;
    position: sticky; /* 與頁首一同吸頂 */
    top: 0;
    justify-content: flex-end;
    gap: 28px;
    padding: calc(16px + env(safe-area-inset-top)) 30px 16px;
    border-bottom: var(--border-width) solid var(--border-color);
  }
  .page-with-nav .nav-item {
    flex: 0 0 auto; /* 頂部導覽不平均撐開，項目依內容寬度靠右排列 */
    min-width: 44px;
    min-height: 44px;
    font-size: 13px;
    white-space: nowrap;
  }
  .page-with-nav .app-main {
    grid-column: 1 / -1;
    grid-row: 2;
    padding: 40px 48px 48px;
  }

  /* 首頁：桌面維持清楚的單欄內容流，避免左右區塊互相擠壓 */
  .page-home .app-main {
    display: block;
    width: 100%;
    max-width: 980px;
    margin-inline: auto;
  }
  .page-home .hero-card { min-height: 240px; padding: 42px 36px; }
  .page-home .hero-title { font-size: calc(var(--fs-hero) + 5px); }
  .page-home .grid.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 28px;
  }
  .page-home .no-scrollbar {
    flex-wrap: wrap;
    overflow-x: visible;
    gap: 22px;
  }

  /* 預約頁：左側選擇，右側固定摘要 */
  .page-booking .app-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    grid-template-rows: auto 1fr;
    overflow: visible;
  }
  .page-booking .app-header {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .page-booking .app-main {
    grid-column: 1;
    grid-row: 2;
    overflow: visible;
    padding: 36px 44px 56px;
  }
  .page-booking .app-footer {
    grid-column: 2;
    grid-row: 2;
    position: sticky;
    top: 104px;
    bottom: auto;
    align-self: start;
    flex-direction: column;
    align-items: stretch;
    gap: 22px;
    margin: 36px 36px 36px 0;
    padding: 26px;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
  }
  .page-booking .app-footer .btn-pill { width: 100%; }
  .page-booking [data-group="artist"],
  .page-booking [data-group="date"] {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  /* 內容頁(確認/成功/個人資料/條款)：外框與其他頁面同寬，改以左右內距將內容置中，維持易讀行寬 */
  .page-confirm .app-main,
  .page-profile .app-main { padding: 40px max(56px, calc((100% - var(--content-reading)) / 2)) 140px; }
  .page-confirm .app-footer { padding-inline: max(56px, calc((100% - var(--content-reading)) / 2)); }
  .page-static .app-main { padding: 40px max(56px, calc((100% - var(--content-reading)) / 2)) 64px; } /* 條款頁富文本避免行寬過長 */

  .page-records .app-main { padding-bottom: 48px; }
  .page-records [data-tab-panel] { grid-template-columns: repeat(3, minmax(0, 1fr)); } /* 桌面版卡片改為三欄 */
}

/* =========================================================
   LIFF 動態頁面追加樣式(樣板轉 Blade 後新增的元件)
========================================================= */

/* 預約狀態徽章(F-05：待審核黃/已確認綠/已完成灰/已取消灰/已拒絕紅) */
.badge--confirmed { background: #e2efe2; color: #4a7a4d; }
.badge--rejected { background: #f7e0dd; color: #b05a4e; }
.badge--cancelled { background: color-mix(in srgb, var(--bg-secondary) 82%, var(--border-color)); color: var(--text-secondary); }
[data-theme="minimal"] .badge--confirmed { background: #dff3df; color: #35673a; }
[data-theme="minimal"] .badge--rejected { background: #f8d8d3; color: #9d4438; }
[data-theme="minimal"] .badge--cancelled { background: transparent; border: 1px solid var(--border-color); color: var(--text-secondary); }

/* 日期停用狀態(休息日或無班表時灰階不可選) */
.chip-date.is-disabled { background: transparent; color: var(--border-color); border-color: var(--border-color); cursor: not-allowed; }

/* 服務人員頭像圖片(有上傳頭像時取代文字頭像) */
.artist__avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

/* 預約紀錄分頁(即將到來/歷史紀錄) */
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tab { flex: 1; padding: 11px 0; border: var(--border-width) solid var(--border-color); border-radius: 999px; background: transparent; color: var(--text-secondary); font-size: 13.5px; font-weight: 700; letter-spacing: var(--tracking-label); cursor: pointer; }
.tab.is-active { background: var(--brand-accent); border-color: var(--brand-accent); color: var(--on-accent); }
[data-theme="minimal"] .tab { border-radius: 0; }

/* 取消預約對話框(需二次確認並填寫原因) */
.modal-mask { position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(0, 0, 0, .45); }
.modal-mask.is-open { display: flex; }
.modal { width: 100%; max-width: 360px; background: var(--bg-primary); border-radius: var(--radius-lg, 18px); padding: 22px; box-shadow: var(--shadow-soft); }
[data-theme="minimal"] .modal { border-radius: 0; }

/* 表單驗證錯誤訊息 */
.field-error { display: block; margin-top: 6px; font-size: 12px; color: #b05a4e; }

/* 無資料提示 */
.empty-hint { padding: 34px 0; text-align: center; font-size: 13px; color: var(--text-secondary); }

/* 載入中提示(入口頁與時段查詢) */
.loading-hint { padding: 16px 2px; font-size: 13px; color: var(--text-secondary); }

/* 服務項目原價刪除線(原價高於金額時顯示促銷比較) */
.service__price del { display: block; font-size: 11px; font-weight: 400; color: var(--text-secondary); text-decoration: line-through; }

/* 起標價金額後綴「起」(服務清單金額與底部預估總額共用；字級略小於金額，避免搶走數字焦點) */
.price-suffix { margin-left: 3px; font-size: 12px; font-weight: 500; color: var(--text-secondary); }

/* 條款頁富文本內容(隱私權政策/服務條款，後台 CKEditor 輸出的 HTML；Tailwind reset 會清除預設樣式，需在此範圍內還原) */
.rich-content { font-size: 14px; line-height: 1.9; color: var(--text-primary); overflow-wrap: break-word; }
.rich-content h1, .rich-content h2, .rich-content h3, .rich-content h4 { font-family: var(--font-display); font-weight: var(--weight-title); letter-spacing: var(--tracking-title); margin: 1.6em 0 .6em; line-height: 1.5; }
.rich-content h1 { font-size: 19px; }
.rich-content h2 { font-size: 17px; }
.rich-content h3 { font-size: 15.5px; }
.rich-content h4 { font-size: 14.5px; }
.rich-content h1:first-child, .rich-content h2:first-child, .rich-content h3:first-child, .rich-content h4:first-child { margin-top: 0; }
.rich-content p { margin: 0 0 1em; }
.rich-content ul, .rich-content ol { margin: 0 0 1em; padding-left: 1.5em; }
.rich-content ul { list-style: disc; }
.rich-content ol { list-style: decimal; }
.rich-content li { margin-bottom: .35em; }
.rich-content a { color: var(--brand-hover); text-decoration: underline; }
.rich-content strong { font-weight: 700; }
.rich-content blockquote { margin: 0 0 1em; padding: 10px 16px; border-left: 3px solid var(--brand-accent); background: var(--bg-secondary); border-radius: var(--radius-sm); color: var(--text-secondary); }
.rich-content hr { border: none; border-top: var(--border-width) solid var(--border-color); margin: 1.6em 0; }
.rich-content img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.rich-content table { width: 100%; border-collapse: collapse; margin: 0 0 1em; font-size: 13px; }
.rich-content th, .rich-content td { border: var(--border-width) solid var(--border-color); padding: 8px 10px; text-align: left; }
.rich-content th { background: var(--bg-secondary); font-weight: 700; }

/* 最新消息發布日期(卡片與內容頁共用，與其他數值一致採等寬字型) */
.news-date { font-family: 'Space Mono', monospace; font-size: 11.5px; letter-spacing: var(--tracking-label); color: var(--brand-ink); }

/* 最新消息列表項目(每筆左右滿版：不設圓角、左右框線與陰影，僅以底線分隔；左右內距與 .news-inset 相同，讓文字起點與其他頁面一致) */
.news-list { display: flex; flex-direction: column; }
.news-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 8px; /* 左右內距與 main 內距合計 20px，和其他頁面一致 */
  border-bottom: var(--border-width) solid var(--border-color);
  color: var(--text-primary);
  transition: background-color .18s ease;
}
.news-card:hover,
.news-card:focus-visible { color: var(--text-primary); background: var(--card-hover-bg); }
.news-card:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: -3px; } /* 焦點框往內縮，避免滿版時被外框裁切 */
.news-card__title {
  font-family: var(--font-display); font-size: var(--fs-item); font-weight: var(--weight-title); letter-spacing: var(--tracking-title); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; /* 標題最多兩行，超出以省略號截斷 */
}
/* 列表頁的提示與分頁：main 為了讓項目滿版不設左右內距，由此類別補回與其他頁面一致的內距 */
.news-inset { padding-inline: 20px; }


/* 最新消息內容頁標題 */
.news-title { font-family: var(--font-display); font-size: var(--fs-page-title); font-weight: var(--weight-title); letter-spacing: var(--tracking-title); line-height: 1.5; margin: 0; }

/* 分頁(上一頁/下一頁與頁碼，手機版不列出全部頁碼) */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pager__btn {
  padding: 11px 18px;
  border: var(--border-width) solid var(--border-color); border-radius: var(--radius-md);
  background: var(--bg-secondary); color: var(--text-primary);
  font-size: 13px; font-weight: 700; letter-spacing: var(--tracking-label);
}
.pager__btn.is-disabled { color: var(--border-color); cursor: not-allowed; }
.pager__info { font-size: 12.5px; color: var(--text-secondary); }
[data-theme="minimal"] .pager__btn { background: transparent; }

/* 最新消息響應式(置於元件樣式之後，確保同權重的 .page-news .app-main 規則能覆蓋版型預設的左右內距) */
.page-news .app-main { padding-inline: 12px; } /* 列表項目接近滿版，僅保留少量左右內距 */
.news-inset { padding-inline: 8px; } /* 與 main 內距合計 20px，和其他頁面一致 */
@media (min-width: 768px) {
  /* 平板：列表維持單欄，內距放大 */
  .page-news .app-main { padding-inline: 16px; padding-bottom: 132px; }
  .page-news-detail .app-main { padding-bottom: 132px; }
  .news-card { padding: 16px; } /* 與 main 內距合計 32px */
  .news-inset { padding-inline: 16px; } /* 合計 32px */
}
@media (min-width: 1024px) {
  /* 桌面：列表仍為單欄並再放大內距與標題字級；內容頁比照條款頁以左右內距維持易讀行寬 */
  .page-news .app-main { padding: 0 20px 48px; }
  .news-card { padding: 18px 28px; } /* 與 main 內距合計 48px */
  .news-card__title { font-size: calc(var(--fs-item) + 2px); }
  .news-inset { padding-inline: 28px; } /* 合計 48px */
  .page-news-detail .app-main { padding: 40px max(56px, calc((100% - var(--content-reading)) / 2)) 64px; }

  /* 導覽列已移到頂部：底部操作列回到貼齊外框底部；無 .app-main 類別的表單頁(編輯基本資料)與操作列一律橫跨整個外框 */
  .page-with-nav main { grid-column: 1 / -1; grid-row: 2; }
  .page-with-nav:not(.page-booking) .app-footer { grid-column: 1 / -1; grid-row: 3; bottom: 0; }
  /* 預約頁：頁首讓出右側欄位給頂部導覽，底部操作列維持右側固定摘要 */
  .page-booking.page-with-nav .app-header { grid-column: 1; }
}

/* 關於我們(工作室介紹、聯絡資訊與 Google 地圖；各區塊依系統設定有無填寫決定顯示) */
.about-section + .about-section { margin-top: var(--section-gap); } /* 相鄰區塊以共用區塊間距分隔，隱藏的區塊不會留下多餘空白 */
.about-intro { font-size: 14px; line-height: 1.9; color: var(--text-primary); white-space: pre-line; overflow-wrap: break-word; } /* 後台 textarea 純文字，保留換行 */
.about-row { display: flex; align-items: flex-start; gap: 16px; padding: 15px 0; border-bottom: var(--border-width) solid var(--border-color); }
.about-row__k { flex: 0 0 auto; min-width: 40px; font-family: var(--font-display); font-size: 13.5px; letter-spacing: var(--tracking-title); color: var(--text-secondary); line-height: 1.6; }
.about-row__v { flex: 1; min-width: 0; font-family: var(--font-display); font-size: 14px; font-weight: 700; letter-spacing: var(--tracking-title); line-height: 1.6; overflow-wrap: anywhere; } /* 地址較長時於右側自動換行 */
.about-row__v--num { font-family: 'Space Mono', monospace; }
[data-theme="minimal"] .about-row__k { font-family: 'Space Mono', monospace; font-size: 11px; letter-spacing: var(--tracking-label); }
.about-map { overflow: hidden; border-radius: var(--radius-lg); border: var(--border-width) solid var(--border-color); background: var(--icon-bg); }
.about-map iframe { display: block; width: 100%; aspect-ratio: 4 / 3; border: 0; } /* 手機以 4:3 比例避免地圖過矮 */
[data-theme="minimal"] .about-map { border-radius: 0; }
@media (min-width: 768px) {
  .page-about .app-main { padding-bottom: 132px; }
  .about-map iframe { aspect-ratio: 16 / 9; } /* 平板以上版面較寬，改為 16:9 */
}
@media (min-width: 1024px) {
  /* 桌面：比照個人資料頁以左右內距維持易讀行寬 */
  .page-about .app-main { padding: 40px max(56px, calc((100% - var(--content-reading)) / 2)) 64px; }
}
