/* ═══════════════════════════════════════════════════════
   Design Tokens — 深色主題（日本傳統色・和色）
   夜海藍鉄的底、生成り（和紙白）的字、朱印的紅；
   浅葱＝主要動作（藍染職人色）、若竹＝成功/剩位、
   玉子＝警告/未收、紅緋＝危險/取消、琥珀＝金額與時刻（集魚燈）。
   客群多為年長者：內文亮度偏高，關鍵資訊不用淡灰。
═══════════════════════════════════════════════════════ */
:root {
  /* 底色階（由深至淺 = 由遠至近）——帶暖的藍鉄，不是編輯器灰 */
  --bg:          #1A202B;   /* 頁面底（藍鉄） */
  --bg-deep:     #141923;   /* 導覽列 / 登入頁底（濃紺） */
  --card:        #232B38;   /* 卡片（紺鼠） */
  --well:        #1A202B;   /* 卡片內凹陷區塊 */
  --raised:      #2E3948;   /* hover / 浮起元素 */
  --border:      #3F4C5F;
  --border-soft: #313C4C;   /* 列表分隔線 */

  /* 文字階——生成り色（和紙的暖白），阿伯也看得清楚 */
  --text:        #DCD8CE;   /* 內文（約 9.5:1） */
  --text-bright: #F2EFE8;   /* 標題 / 強調（約 13:1） */
  --text-muted:  #A6A89E;   /* 次要（利休鼠，仍保 5.5:1） */
  --text-on-color: #161B23; /* 色塊按鈕上的深色字 */

  /* 功能色（和色，亮度取偏高確保可讀） */
  --blue:       #57B7C7;    /* 浅葱——主要動作、連結 */
  --blue-hover: #74C7D5;
  --green:      #7EC98F;    /* 若竹——成功 / 已收 / 剩餘名額 */
  --yellow:     #E5BC63;    /* 玉子——警告 / 未收 */
  --red:        #EA7A66;    /* 紅緋——危險 / 取消 */
  --red-deep:   #B54A38;    /* 弁柄朱——印章・職人簽名色 */
  --orange:     #EDAB5E;    /* 琥珀——金額、出發時刻（集魚燈） */
  --cyan:       #A3B0CD;    /* 藤鼠——次要標籤（觀光票等） */

  /* 功能色的透明底（深色 UI 的「淡色底」一律用透明疊加） */
  --blue-dim:   rgba(87,183,199,.13);
  --blue-line:  rgba(87,183,199,.40);
  --green-dim:  rgba(126,201,143,.13);
  --green-line: rgba(126,201,143,.40);
  --yellow-dim: rgba(229,188,99,.11);
  --yellow-line:rgba(229,188,99,.40);
  --red-dim:    rgba(234,122,102,.13);
  --red-line:   rgba(234,122,102,.40);
  --cyan-dim:   rgba(163,176,205,.13);
  --cyan-line:  rgba(163,176,205,.40);

  /* 字體：標題明朝体（職人），內文系統無襯線（易讀） */
  --font-display: "Noto Serif TC", "Hiragino Mincho ProN", "Yu Mincho", serif;

  --shadow:      0 1px 3px rgba(0,0,0,.4);
  --shadow-lg:   0 8px 28px rgba(0,0,0,.5);
  --radius:      10px;
  --radius-sm:   7px;
  --btn-h:       52px;
  --btn-h-sm:    40px;
}

/* ═══════════════════════════════════════════════════════
   Reset & Base
═══════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 18px; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC",
               "PingFang TC", "Microsoft JhengHei", sans-serif;
  /* 全站鋪一層比登入頁更淡的青海波（老闆指定）：
     文字都在實色卡片上，波紋只在頁底與卡片縫隙透出，不影響可讀性 */
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 50% 115%,
      transparent 34%, rgba(87,183,199,.045) 35% 37%, transparent 38% 46%,
      rgba(87,183,199,.035) 47% 49%, transparent 50% 58%,
      rgba(87,183,199,.025) 59% 61%, transparent 62%),
    radial-gradient(circle at 0% 115%,
      transparent 34%, rgba(87,183,199,.045) 35% 37%, transparent 38% 46%,
      rgba(87,183,199,.035) 47% 49%, transparent 50% 58%,
      rgba(87,183,199,.025) 59% 61%, transparent 62%),
    radial-gradient(circle at 100% 115%,
      transparent 34%, rgba(87,183,199,.045) 35% 37%, transparent 38% 46%,
      rgba(87,183,199,.035) 47% 49%, transparent 50% 58%,
      rgba(87,183,199,.025) 59% 61%, transparent 62%);
  background-size: 72px 36px;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img, iframe { max-width: 100%; }
::selection { background: #3A4557; color: var(--text-bright); }

/* 標題一律明朝体＋鬆字距（職人記號之一） */
h1, h2, h3,
.navbar-brand, .cal-month-label, .login-title {
  font-family: var(--font-display);
  color: var(--text-bright);
  letter-spacing: .04em;
}

/* 數字（價格/時刻/統計）用等寬數字，欄位對齊 */
.stat-number, .stat-mini-num, .datetime-time, .trip-time-large,
.ticket-type-price, .stepper-unit-price, .stepper-subtotal,
.booking-total-amount, .tkt-price, .ticket-pill-price {
  font-variant-numeric: tabular-nums;
}

/* 可及性底線：鍵盤焦點、動效減量 */
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ═══════════════════════════════════════════════════════
   青海波暗紋（簽名元素・只用於前台 hero 與登入頁）
═══════════════════════════════════════════════════════ */
.pattern-waves {
  background-color: var(--bg-deep);
  background-image:
    radial-gradient(circle at 50% 115%,
      transparent 34%, rgba(87,183,199,.07) 35% 37%, transparent 38% 46%,
      rgba(87,183,199,.055) 47% 49%, transparent 50% 58%,
      rgba(87,183,199,.04) 59% 61%, transparent 62%),
    radial-gradient(circle at 0% 115%,
      transparent 34%, rgba(87,183,199,.07) 35% 37%, transparent 38% 46%,
      rgba(87,183,199,.055) 47% 49%, transparent 50% 58%,
      rgba(87,183,199,.04) 59% 61%, transparent 62%),
    radial-gradient(circle at 100% 115%,
      transparent 34%, rgba(87,183,199,.07) 35% 37%, transparent 38% 46%,
      rgba(87,183,199,.055) 47% 49%, transparent 50% 58%,
      rgba(87,183,199,.04) 59% 61%, transparent 62%);
  background-size: 72px 36px;
}

/* ═══════════════════════════════════════════════════════
   Layout helpers
═══════════════════════════════════════════════════════ */
.page-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px 16px 60px;
}

/* ═══════════════════════════════════════════════════════
   Navbar（朱印在此）
═══════════════════════════════════════════════════════ */
.navbar {
  background: var(--bg-deep);
  color: var(--text-bright);
  padding: 0 16px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 200;
  border-bottom: 1px solid var(--border-soft);
}
/* 後台以一道朱線標記（老闆一眼分辨前後台） */
.navbar-admin { border-bottom: 2px solid var(--red-deep); }
.navbar-brand {
  font-size: 19px; font-weight: 700; color: var(--text-bright);
  text-decoration: none; letter-spacing: .12em;
  display: inline-flex; align-items: center;
}
/* 朱印「釣」：方形印章、內框如刻邊 */
.brand-seal {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; margin-right: 10px;
  background: var(--red-deep); color: #F6EFEA;
  font-family: var(--font-display); font-size: 19px; font-weight: 700;
  border-radius: 6px; letter-spacing: 0;
  box-shadow: inset 0 0 0 1.5px rgba(246,239,234,.35);
  flex-shrink: 0;
}
.navbar-admin-link { font-size: 14px; color: var(--text-muted); text-decoration: none; }
.navbar-admin-link:hover { color: var(--text-bright); }
.navbar-actions { display: flex; gap: 10px; align-items: center; }
.btn-nav {
  background: transparent; border: 1px solid var(--border);
  color: var(--text); padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 15px; cursor: pointer; text-decoration: none; display: inline-block;
}
.btn-nav:hover { background: var(--raised); color: var(--text-bright); text-decoration: none; }
.btn-nav-logout { border-color: var(--red-line); color: var(--red); }
.btn-nav-logout:hover { background: var(--red-dim); color: var(--red); }

/* ═══════════════════════════════════════════════════════
   ── CALENDAR (DESKTOP) ──────────────────────────────
═══════════════════════════════════════════════════════ */
.cal-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 58px);
}

.cal-topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  flex-shrink: 0;
}
.cal-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cal-month-label {
  font-size: 22px;
  font-weight: 700;
  min-width: 160px;
  text-align: center;
}
.btn-cal-nav {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  display: inline-block;
}
.btn-cal-nav:hover { background: var(--raised); color: var(--text-bright); text-decoration: none; }
.btn-cal-today { background: var(--blue); color: var(--text-on-color); border-color: var(--blue); }
.btn-cal-today:hover { background: var(--blue-hover); color: var(--text-on-color); }
.cal-hint { font-size: 14px; color: var(--text-muted); }
.cal-topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Template quick bar（dormant，保留樣式） */
.template-quick-bar {
  background: var(--yellow-dim);
  border-top: 1px solid var(--yellow-line);
  border-bottom: 1px solid var(--yellow-line);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  position: relative;
  flex-shrink: 0;
}
.template-bar-label { font-size: 15px; font-weight: 600; white-space: nowrap; }
.template-bar-list { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.template-chip {
  background: var(--card);
  border: 1px solid var(--blue-line);
  color: var(--blue);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.template-chip:hover { background: var(--blue-dim); text-decoration: none; }
.template-chip-blank { border-style: dashed; color: var(--text-muted); border-color: var(--border); }
.btn-icon-close {
  background: none; border: none; font-size: 18px; cursor: pointer; color: var(--text-muted);
  padding: 4px 8px;
}

/* Calendar grid */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  flex: 1;
  overflow-y: auto;
  border-left: 1px solid var(--border-soft);
  border-top: 1px solid var(--border-soft);
}
.cal-wd {
  background: var(--raised);
  color: var(--text-bright);
  text-align: center;
  padding: 8px 4px;
  font-size: 14px;
  font-weight: 700;
  border-right: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}
.cal-cell {
  border-right: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  padding: 4px;
  min-height: 110px;
  background: var(--card);
  vertical-align: top;
  overflow: hidden;
}
.cal-cell:hover { background: var(--raised); }
.cal-other-month { background: var(--bg-deep); }
.cal-other-month .cal-date-num { color: #5A6577; }
/* 今日格分兩段（老闆定案：預設亮色塊太突兀）：
   - 預設 .cal-today-quiet：只把日期數字改琥珀色，低調可辨
   - 按「今天」按鈕（?today=1）套 .cal-today：純色塊（深浅葱）＋浅葱描邊，
     日期數字用琥珀方塊＋深墨字（呼應朱印的方形，對比夠高不會糊） */
.cal-today-quiet .cal-date-num { color: var(--orange); font-weight: 800; }
.cal-today { background: #1C5661 !important; box-shadow: inset 0 0 0 2px var(--blue); }
.cal-today .cal-date-num {
  background: var(--orange);
  color: var(--text-on-color);
  border-radius: 5px;
  min-width: 26px; height: 26px; padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
.cal-cell-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.cal-date-num { font-size: 14px; font-weight: 700; color: var(--text); }
.cal-add-btn {
  background: none; border: 1px dashed var(--border); color: var(--text-muted);
  width: 22px; height: 22px; border-radius: 4px; cursor: pointer;
  font-size: 14px; line-height: 1;
  display: none;
}
.cal-cell:hover .cal-add-btn { display: flex; align-items: center; justify-content: center; }
.cal-add-btn:hover { background: var(--blue); color: var(--text-on-color); border-color: var(--blue); }

/* Calendar events */
.cal-event, .cal-event-admin {
  display: block;
  border-radius: 4px;
  padding: 3px 5px;
  margin-bottom: 3px;
  font-size: 12px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
  color: var(--text);
}
.cal-event:hover, .cal-event-admin:hover { filter: brightness(1.2); text-decoration: none; }
.cal-event-active { background: var(--blue-dim); color: #93D2DE; border-left: 3px solid var(--blue); }
.cal-event-full   { background: var(--raised); color: var(--text-muted); border-left: 3px solid #5A6577; }
.cal-event-cancelled { background: var(--red-dim); color: var(--red); border-left: 3px solid var(--red); }
/* 已取消的班用刪除線（老闆指定）。後台事件只劃標題連結，
   避免刪除線劃到「名單/編輯」操作按鈕 */
a.cal-event.cal-event-cancelled,
a.cal-event.cal-event-cancelled:hover { text-decoration: line-through; }
.cal-event-admin.cal-event-cancelled .cal-event-link { text-decoration: line-through; }

.cal-event-vessel { font-weight: 700; }
.cal-event-time   { margin-left: 4px; opacity: .75; }
.cal-event-seats  { margin-left: 4px; font-size: 11px; color: var(--green); }
.cal-event-full-label { margin-left: 4px; font-size: 11px; color: var(--text-muted); }
.cal-event-link   { color: inherit; text-decoration: none; }

/* Admin event extras */
.cal-event-admin { white-space: normal; overflow: visible; }
.cal-event-admin-seats {
  display: flex; gap: 3px; flex-wrap: wrap; margin-top: 2px;
}
.seat-ang  { background: var(--blue-dim); color: var(--blue); font-size: 11px; padding: 1px 5px; border-radius: 3px; }
.seat-tour { background: var(--cyan-dim); color: var(--cyan); font-size: 11px; padding: 1px 5px; border-radius: 3px; }
.seat-full { background: var(--raised); color: var(--text-muted); font-size: 11px; padding: 1px 5px; border-radius: 3px; }
.cal-event-admin-actions {
  display: flex; gap: 3px; margin-top: 3px; flex-wrap: wrap;
}
.cal-btn-sm {
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid var(--blue-line);
  border-radius: 3px;
  font-size: 11px;
  padding: 1px 5px;
  text-decoration: none;
  white-space: nowrap;
}
.cal-btn-sm:hover { background: var(--blue); color: var(--text-on-color); }

/* ═══════════════════════════════════════════════════════
   ── MOBILE TRIP CARDS ──────────────────────────────
═══════════════════════════════════════════════════════ */
/* 前台 hero：透明底，讓 body 的青海波直接流過（不做第二層，避免斷層感） */
.hero { text-align: center; padding: 24px 16px 18px; }
.hero h1 { font-size: 27px; margin-bottom: 8px; font-weight: 700; }
.hero-sub { font-size: 16px; color: var(--text-muted); letter-spacing: .06em; }

/* 前台列表「近期 / 歷史」切換（與後台 range 篩選同口徑） */
.list-range-toggle { text-align: center; margin-bottom: 16px; }
.link-past-trips { font-size: 15px; color: var(--text-muted); text-decoration: underline; text-underline-offset: 3px; }
.link-past-trips:hover { color: var(--blue); }

/* 活動詳情頁「已出發，報名截止」提示 */
.departed-note { font-size: 17px; color: var(--text); text-align: center; margin: 0; }

/* 欄位下方即時提示（手機號碼格式檢查用） */
.field-hint { font-size: 15px; color: var(--text-muted); margin: 6px 2px 0; }
.field-hint-ok  { color: var(--green); font-weight: 700; }
.field-hint-err { color: var(--red);   font-weight: 700; }
.form-input.input-invalid { border-color: var(--red); }
.form-input.input-invalid:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-dim); }

.trip-list { display: flex; flex-direction: column; gap: 16px; }

.trip-card {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.trip-card-header { display: flex; gap: 14px; align-items: flex-start; }
.trip-date-col { flex-shrink: 0; text-align: center; min-width: 70px; }
.trip-month-day { font-size: 15px; font-weight: 700; color: var(--text-bright); }
.trip-time-large { font-size: 24px; font-weight: 800; color: var(--orange); line-height: 1; }
.trip-card-main { flex: 1; }
.trip-card-row { margin-bottom: 4px; }
.trip-card-title { font-size: 19px; font-weight: 700; color: var(--text-bright); line-height: 1.35; margin: 6px 0 8px; font-family: var(--font-display); letter-spacing: .02em; }
.trip-card-meta { display: flex; flex-direction: column; gap: 5px; }
/* 港口/船名是阿伯要看的關鍵資訊——用正文色不用淡灰 */
.meta-item { display: flex; align-items: center; gap: 6px; font-size: 16px; color: var(--text); }
.meta-icon { font-size: 16px; }

.ticket-summary { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.ticket-pill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 16px;
}
.ticket-available { background: var(--blue-dim); border: 1px solid var(--blue-line); }
.ticket-full      { background: var(--raised); border: 1px solid var(--border); opacity: .65; }
.ticket-pill-name  { font-weight: 600; color: var(--text-bright); }
.ticket-pill-price { color: var(--orange); font-weight: 700; }
.ticket-pill-seats { color: var(--text); font-size: 15px; }

/* ═══════════════════════════════════════════════════════
   Trip hero / detail
═══════════════════════════════════════════════════════ */
.trip-hero {
  background: var(--card); border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.trip-title { font-size: 24px; font-weight: 700; line-height: 1.35; margin: 8px 0 16px; }
.trip-subtitle { font-size: 18px; color: var(--text-muted); margin-bottom: 10px; }
.back-link { display: inline-block; color: var(--text-muted); font-size: 16px; margin-bottom: 10px; }
.back-link:hover { color: var(--blue); }

.trip-datetime-block {
  background: var(--well); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 14px 16px; margin-bottom: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.datetime-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.datetime-label {
  font-size: 13px; font-weight: 700; color: var(--text-bright);
  background: var(--raised); border: 1px solid var(--border);
  padding: 2px 10px; border-radius: 20px;
  min-width: 44px; text-align: center; white-space: nowrap;
}
.datetime-value { font-size: 17px; font-weight: 600; color: var(--text-bright); }
.datetime-time  { font-size: 24px; font-weight: 800; color: var(--orange); }

.trip-meta-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.meta-pill {
  background: var(--well); border: 1px solid var(--border);
  border-radius: 20px; padding: 6px 14px; font-size: 15px; color: var(--text);
  display: inline-flex; align-items: center; gap: 4px;
}
.pill-icon { font-size: 16px; }

/* ═══════════════════════════════════════════════════════
   Section cards（區塊標題＝朱線，全站一致的層次錨點）
═══════════════════════════════════════════════════════ */
.section-card {
  background: var(--card); border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.section-card-warning { border-left: 3px solid var(--yellow); background: var(--card); }
.section-title {
  font-size: 18px; font-weight: 700;
  margin-bottom: 14px; padding-left: 10px;
  border-left: 3px solid var(--red-deep);
  line-height: 1.4;
}
/* 說明用資訊卡（藍調、低對比） */
.info-note { background: var(--blue-dim); border: 1px solid var(--blue-line); }
.info-note p { margin: 0; font-size: 16px; color: var(--text); }

.rich-text p { margin-bottom: 12px; font-size: 17px; line-height: 1.75; }
.rich-text p:last-child { margin-bottom: 0; }
.rich-text ul { padding-left: 0; list-style: none; }
.rich-text ul li {
  padding: 6px 0 6px 24px; position: relative;
  font-size: 17px; border-bottom: 1px solid var(--border-soft);
}
.rich-text ul li:last-child { border-bottom: none; }
.rich-text ul li::before { content:"・"; color: var(--red-deep); font-weight: 700; position: absolute; left: 2px; top: 6px; }
.equip-block { margin-bottom: 16px; }
.equip-block:last-child { margin-bottom: 0; }

/* Booking section highlight */
.booking-section { border: 1px solid var(--blue-line); }

/* Ticket type display on trip page */
.ticket-type-list { display: flex; flex-direction: column; gap: 14px; }
.ticket-type-card {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px; background: var(--well); transition: border-color .2s;
}
.ticket-type-full { opacity: .65; }
.ticket-type-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; gap: 8px; }
.ticket-type-name  { font-size: 20px; font-weight: 700; color: var(--text-bright); }
.ticket-type-price { font-size: 24px; font-weight: 800; color: var(--orange); white-space: nowrap; }
.per-person { font-size: 14px; font-weight: 400; color: var(--text-muted); }
.ticket-type-tag { display: inline-block; font-size: 13px; padding: 2px 10px; border-radius: 20px; margin-top: 4px; }
.tag-angler  { background: var(--blue-dim); color: var(--blue); }
.tag-tourist { background: var(--cyan-dim); color: var(--cyan); }
.ticket-type-capacity { margin-bottom: 14px; }
.capacity-bar { height: 8px; background: var(--raised); border-radius: 4px; overflow: hidden; }
.capacity-fill { height: 100%; background: var(--orange); border-radius: 4px; }
.capacity-text { font-size: 15px; color: var(--text-muted); margin-top: 6px; display: block; }
.capacity-text strong { color: var(--text-bright); font-size: 18px; }

/* ═══════════════════════════════════════════════════════
   Stats
═══════════════════════════════════════════════════════ */
.stats-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.stats-grid-admin { grid-template-columns: repeat(3, 1fr); }
.stat-item {
  background: var(--well); border-radius: var(--radius-sm);
  padding: 14px; text-align: center; border: 1px solid var(--border);
}
.stat-total { background: var(--blue-dim); border-color: var(--blue-line); }
.stat-total .stat-number { color: var(--blue); }
.stat-total .stat-label { color: var(--text); }
.stat-money      { background: var(--yellow-dim); border-color: var(--yellow-line); }
.stat-money      .stat-number { color: var(--yellow); }
.stat-money-paid { background: var(--green-dim); border-color: var(--green-line); }
.stat-money-paid .stat-number { color: var(--green); }
.stat-number { font-size: 32px; font-weight: 800; color: var(--text-bright); line-height: 1; }
.stat-money-num { font-size: 20px; }
.stat-label  { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

/* ═══════════════════════════════════════════════════════
   ── BOOKING STEPPER ────────────────────────────────
═══════════════════════════════════════════════════════ */
.stepper-list { display: flex; flex-direction: column; gap: 12px; }

.stepper-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--well);
  flex-wrap: wrap;
}
.stepper-row-full { opacity: .55; }

.stepper-info { flex: 1; min-width: 140px; }
.stepper-ticket-name { font-size: 19px; font-weight: 700; margin-bottom: 4px; color: var(--text-bright); }
.stepper-price-rem { display: flex; gap: 10px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.stepper-unit-price { font-size: 18px; font-weight: 700; color: var(--orange); }
.stepper-remaining { font-size: 15px; font-weight: 600; }

.stepper-control {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--blue-line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}
.btn-stepper {
  width: 52px; height: 52px;
  background: var(--blue); color: var(--text-on-color);
  border: none; font-size: 24px; font-weight: 700;
  cursor: pointer; transition: background .15s;
  display: flex; align-items: center; justify-content: center;
}
.btn-stepper:hover:not(:disabled) { background: var(--blue-hover); }
.btn-stepper:disabled { background: var(--raised); color: var(--text-muted); cursor: not-allowed; }
.stepper-input {
  width: 56px; height: 52px;
  text-align: center; border: none;
  font-size: 22px; font-weight: 800; color: var(--text-bright);
  background: var(--card); outline: none;
  -moz-appearance: textfield;
}
.stepper-input::-webkit-inner-spin-button,
.stepper-input::-webkit-outer-spin-button { appearance: none; }

.stepper-subtotal {
  font-size: 17px; font-weight: 700; color: var(--orange);
  min-width: 80px; text-align: right;
}

/* Booking total summary */
.booking-total-card {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px; background: var(--well); transition: border-color .2s, background .2s;
}
.booking-total-card-active {
  border-color: var(--blue-line); background: var(--blue-dim);
}
.booking-total-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 17px; padding: 4px 0;
}
.booking-total-row-big { padding-top: 10px; border-top: 1px solid var(--border); margin-top: 8px; }
.booking-total-label { color: var(--text-muted); }
.booking-total-value { font-weight: 700; font-size: 18px; color: var(--text-bright); }
.booking-total-amount { font-size: 28px; font-weight: 800; color: var(--orange); }
.booking-total-note { font-size: 14px; color: var(--text-muted); text-align: center; margin-top: 8px; }

/* Booking items summary (success page) */
.booking-items-summary {
  background: var(--well); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 16px; margin: 16px 0;
}
.booking-items-summary h3 { font-size: 16px; margin-bottom: 10px; }
.booking-item-row { display: flex; justify-content: space-between; font-size: 17px; padding: 5px 0; border-bottom: 1px solid var(--border-soft); }
.booking-item-row:last-child { border-bottom: none; }
.booking-item-total { font-weight: 700; padding-top: 10px; color: var(--text-bright); }
.total-price { font-size: 22px; color: var(--orange); }

/* ═══════════════════════════════════════════════════════
   Buttons（色塊上一律深色字）
═══════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: var(--btn-h); padding: 0 24px;
  border-radius: var(--radius-sm); font-size: 18px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent;
  text-decoration: none; white-space: nowrap;
  transition: background .15s, transform .1s; line-height: 1;
}
.btn:active { transform: scale(.97); }
.btn:hover  { text-decoration: none; }
.btn-full   { width: 100%; }
.btn-large  { height: 58px; font-size: 20px; }
.btn-primary { background: var(--blue); color: var(--text-on-color); border-color: var(--blue); font-weight: 700; }
.btn-primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: var(--raised); color: var(--text-bright); }
.btn-success { background: var(--green); color: var(--text-on-color); border-color: var(--green); font-weight: 700; }
.btn-success:hover { background: #93D4A3; border-color: #93D4A3; }
.btn-danger  { background: transparent; color: var(--red); border-color: var(--red-line); }
.btn-danger:hover { background: var(--red-dim); }
.btn-disabled { background: var(--raised); color: var(--text-muted); border-color: var(--raised); cursor: not-allowed; }
.btn-sm      { height: var(--btn-h-sm); padding: 0 14px; font-size: 15px; }
.btn-sm-narrow { padding: 0 10px; }

/* ═══════════════════════════════════════════════════════
   Forms
═══════════════════════════════════════════════════════ */
.form-card { background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 24px 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 20px; }
.form-section-title {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700; color: var(--text-bright);
  letter-spacing: .04em;
  padding: 8px 0 8px 10px; margin-top: 8px;
  border-left: 3px solid var(--red-deep);
}
.form-row { display: flex; flex-direction: column; gap: 20px; }
@media (min-width: 600px) { .form-row { flex-direction: row; } .form-row .form-group { flex: 1; } }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 16px; font-weight: 600; color: var(--text-bright); }
.label-sub { font-size: 12px; color: var(--text-muted); font-weight: 400; }
.required { color: var(--red); margin-left: 2px; }
.form-hint { font-size: 14px; color: var(--text-muted); margin-top: 4px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 12px 14px; font-size: 18px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-deep); color: var(--text-bright); transition: border-color .2s;
  font-family: inherit; line-height: 1.5;
}
.form-input::placeholder, .form-textarea::placeholder { color: #808795; }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(87,183,199,.20);
}
/* 日期/時間原生控制項在深色底的圖示 */
.form-input::-webkit-calendar-picker-indicator { filter: invert(.7); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%23A6A89E' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}
.form-actions { display: flex; gap: 12px; justify-content: flex-end; align-items: center; flex-wrap: wrap; padding-top: 8px; }
.ticket-form-block { border-radius: var(--radius-sm); padding: 16px; border: 1px solid var(--border); background: var(--well); }
.ticket-angler  { border-color: var(--blue-line); background: var(--blue-dim); }
.ticket-tourist { border-color: var(--cyan-line); background: var(--cyan-dim); }
.ticket-form-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; color: var(--text-bright); }

/* ── Template picker（dormant，保留樣式）── */
.template-picker-card { background: var(--yellow-dim); border: 1px solid var(--yellow-line); border-radius: var(--radius); padding: 20px; margin-bottom: 8px; }
.template-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-top: 12px; }
.template-pick-btn {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px;
  cursor: pointer; text-align: left; transition: border-color .2s;
  display: flex; flex-direction: column; gap: 4px;
}
.template-pick-btn:hover { border-color: var(--blue); background: var(--blue-dim); }
.tpick-selected { border-color: var(--blue) !important; background: var(--blue-dim) !important; }
.tpick-name   { font-size: 16px; font-weight: 700; color: var(--text-bright); }
.tpick-vessel { font-size: 13px; color: var(--text-muted); }
.tpick-price  { font-size: 13px; color: var(--orange); }

/* ── Template card list (templates.html) ── */
.template-card-list { display: flex; flex-direction: column; gap: 16px; }
.template-card { background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.template-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.template-card-name   { font-size: 20px; font-weight: 700; }
.template-card-meta   { font-size: 15px; color: var(--text-muted); margin-top: 4px; }
.template-card-times  { display: flex; flex-direction: column; gap: 2px; text-align: right; }
.tcard-time { font-size: 14px; color: var(--text-muted); white-space: nowrap; }
.template-ticket-row  { display: flex; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.template-ticket-item { background: var(--well); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 120px; }
.tkt-angler  { background: var(--blue-dim); border-color: var(--blue-line); }
.tkt-tourist { background: var(--cyan-dim); border-color: var(--cyan-line); }
.tkt-name  { font-size: 15px; font-weight: 700; color: var(--text-bright); }
.tkt-price { font-size: 16px; font-weight: 700; color: var(--orange); }
.tkt-cap   { font-size: 13px; color: var(--text-muted); }
.template-card-desc   { font-size: 14px; color: var(--text-muted); margin-bottom: 12px; }
.template-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════════════
   Badges
═══════════════════════════════════════════════════════ */
.badge { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.badge-active    { background: var(--green-dim);  color: var(--green); }
.badge-draft     { background: var(--yellow-dim); color: var(--yellow); } /* 草稿已廢除；此 class 由「整組同行」標籤沿用 */
.badge-cancelled { background: var(--red-dim);    color: var(--red); }
.badge-paid      { background: var(--green-dim);  color: var(--green); }
.badge-unpaid    { background: var(--yellow-dim); color: var(--yellow); }
/* 已結束（船已出發，報名截止）：藤鼠灰，與取消（紅）區隔 */
.badge-done      { background: rgba(163,176,205,.14); color: var(--cyan); }

/* ═══════════════════════════════════════════════════════
   Admin trip/booking lists
═══════════════════════════════════════════════════════ */
.admin-page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.admin-page-header h1 { font-size: 26px; }
.admin-trip-list { display: flex; flex-direction: column; gap: 16px; }
.admin-trip-card { background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.admin-trip-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.admin-trip-title { font-size: 20px; font-weight: 700; margin: 6px 0 4px; color: var(--text-bright); }
/* 已取消的班：標題與資訊刪除線＋整卡降透明（操作按鈕不劃線，仍可點） */
.trip-cancelled { opacity: .75; }
.trip-cancelled .admin-trip-title,
.trip-cancelled .admin-trip-meta { text-decoration: line-through; }
.title-cancelled { text-decoration: line-through; }
.admin-trip-meta { font-size: 15px; color: var(--text-muted); }
.admin-trip-stats-mini { display: flex; gap: 12px; flex-shrink: 0; }
.stat-mini { text-align: center; }
.stat-mini-num   { font-size: 26px; font-weight: 800; color: var(--blue); display: block; }
.stat-mini-label { font-size: 13px; color: var(--text-muted); }
.admin-ticket-row { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-ticket-pill { background: var(--well); border: 1px solid var(--border); border-radius: 20px; padding: 5px 12px; font-size: 14px; }
.admin-ticket-detail { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 160px; }
.admin-ticket-name { font-size: 15px; font-weight: 600; color: var(--text-bright); }
.admin-trip-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 8px; border-top: 1px solid var(--border-soft); }

/* Booking admin list */
.booking-admin-list { display: flex; flex-direction: column; gap: 0; }
.booking-admin-item {
  display: grid; grid-template-columns: 32px 1fr auto;
  gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border-soft); align-items: start;
}
.booking-admin-item:last-child { border-bottom: none; }
.booking-cancelled { opacity: .45; }
.booking-admin-seq { width: 32px; height: 32px; background: var(--raised); border: 1px solid var(--border); color: var(--text-bright); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; flex-shrink: 0; margin-top: 2px; }
.booking-admin-name { font-size: 18px; font-weight: 700; color: var(--text-bright); }
.booking-admin-phone { font-size: 15px; color: var(--text); margin-top: 2px; }
.booking-items-inline { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.booking-item-tag { background: var(--blue-dim); border: 1px solid var(--blue-line); border-radius: 4px; padding: 2px 8px; font-size: 14px; color: var(--text); }
.booking-people-count { font-size: 14px; color: var(--text-muted); }
.booking-admin-notes { font-size: 14px; color: var(--text-muted); font-style: italic; margin-top: 3px; }
.booking-admin-meta { font-size: 13px; color: #808795; margin-top: 4px; display: flex; gap: 6px; }
.booking-admin-status { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; min-width: 80px; }
.payment-actions { display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }

/* Reg list (public) */
.reg-list { display: flex; flex-direction: column; gap: 0; }
.reg-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.reg-item:last-child { border-bottom: none; }
.reg-num { width: 28px; height: 28px; background: var(--raised); border: 1px solid var(--border); color: var(--text-bright); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.reg-name   { font-size: 17px; font-weight: 600; color: var(--text-bright); }
.reg-detail { font-size: 15px; color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════
   Success / Error pages
═══════════════════════════════════════════════════════ */
.success-card { background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 32px 24px; box-shadow: var(--shadow); text-align: center; margin-top: 16px; }
.success-icon { font-size: 56px; margin-bottom: 12px; }
.success-card h1 { font-size: 28px; color: var(--green); margin-bottom: 8px; }
.success-sub { font-size: 17px; color: var(--text-muted); margin-bottom: 24px; }
.success-detail { background: var(--well); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 16px; text-align: left; display: flex; flex-direction: column; gap: 10px; }
.detail-row { display: flex; gap: 12px; flex-wrap: wrap; }
.detail-label { font-size: 15px; color: var(--text-muted); min-width: 80px; }
.detail-value { font-size: 16px; font-weight: 600; color: var(--text-bright); }
.success-notice { background: var(--yellow-dim); border: 1px solid var(--yellow-line); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 20px; text-align: left; font-size: 16px; display: flex; flex-direction: column; gap: 6px; color: var(--yellow); }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-icon { font-size: 56px; margin-bottom: 16px; }
.empty-state h2 { font-size: 22px; margin-bottom: 8px; }
.empty-state p { font-size: 17px; }

/* Login（青海波暗紋）
   ⚠️ 只能設 background-color：用 background 縮寫會蓋掉 .pattern-waves 的波紋圖層 */
.bg-navy { background-color: var(--bg-deep); }
.login-container { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.login-card { background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 36px 28px; width: 100%; max-width: 400px; box-shadow: var(--shadow-lg); }
.login-logo  { text-align: center; margin-bottom: 14px; }
.login-seal {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px;
  background: var(--red-deep); color: #F6EFEA;
  font-family: var(--font-display); font-size: 38px; font-weight: 700;
  border-radius: 10px;
  box-shadow: inset 0 0 0 2px rgba(246,239,234,.35);
}
.login-title { font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 24px; }
.login-form  { display: flex; flex-direction: column; gap: 16px; }

/* Alerts */
.alert { border-radius: var(--radius-sm); padding: 14px 16px; font-size: 16px; margin-bottom: 16px; }
.alert-error   { background: var(--red-dim);   border: 1px solid var(--red-line);   color: var(--red); }
.alert-success { background: var(--green-dim); border: 1px solid var(--green-line); color: var(--green); }

/* Misc */
.dot-sep   { color: var(--border); }
.text-danger  { color: var(--red); font-weight: 700; }
.text-success { color: var(--green); font-weight: 600; }
.text-muted   { color: var(--text-muted); }
.money-em { font-weight: 700; color: var(--text-bright); }
.video-wrapper { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: var(--radius-sm); background: #000; }
.video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.site-footer { text-align: center; padding: 24px 16px; font-size: 14px; color: var(--text-muted); border-top: 1px solid var(--border-soft); margin-top: 16px; letter-spacing: .06em; }

/* ═══════════════════════════════════════════════════════
   Responsive
═══════════════════════════════════════════════════════ */
@media (min-width: 500px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .stats-grid-admin { grid-template-columns: repeat(6, 1fr); }
  .trip-datetime-block { flex-direction: row; gap: 24px; }
}
@media (min-width: 600px) { html { font-size: 19px; } }
@media (min-width: 900px) {
  .stats-grid-admin { grid-template-columns: repeat(6, 1fr); }
}

/* ── 後台列表視圖篩選列 ─────────────────────────────────────── */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.filter-bar .form-select { width: auto; flex: 0 1 auto; font-size: 15px; padding: 8px 32px 8px 10px; }
.filter-bar .form-input  { width: auto; flex: 1 1 150px; min-width: 130px; font-size: 15px; padding: 8px 10px; }
.filter-count { font-size: 14px; color: var(--text-muted); margin-bottom: 12px; }

/* ── 模板批次建班 / 存成模板 ─────────────────────────────────── */
.form-check { display: flex; align-items: flex-start; gap: 8px; font-size: 15px; cursor: pointer; color: var(--text); }
.form-check input[type="checkbox"] { margin-top: 3px; width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--blue); }
.date-chip-box { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; min-height: 8px; }
.date-chip {
  display: inline-block; padding: 6px 12px; border-radius: 999px;
  background: var(--blue-dim); border: 1px solid var(--blue-line); color: var(--blue);
  font-size: 15px; font-weight: 600; cursor: pointer; user-select: none;
}
.date-chip:hover { background: var(--red-dim); border-color: var(--red-line); color: var(--red); }
