/* =========================================================================
   WAJIMALL 雛形 — 共用設計系統
   調性：清新綠藍（teal → water-blue）、明亮、留白、接近成品
   所有介面（顧客 / 營運台 / 後台 / 司機）共用此檔，請勿各自發明樣式。
   ========================================================================= */

/* ---- Google Fonts (Noto Sans TC) ---- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;700;900&display=swap');

/* =========================== 1. Design tokens =========================== */
:root {
  /* 品牌：綠藍 */
  --brand:        #0FB5A6;
  --brand-600:    #0C9488;
  --brand-700:    #0A7A70;
  --brand-100:    #CFF5EF;
  --brand-50:     #E8FBF8;
  --water:        #2FA8E8;
  --water-50:     #E8F5FD;
  --grad-brand:   linear-gradient(135deg, #16C6B3 0%, #2FA8E8 100%);
  --grad-brand-soft: linear-gradient(135deg, #E9FBF8 0%, #E8F5FD 100%);

  /* 中性（冷調 slate） */
  --ink-900: #0E1B24;
  --ink-700: #33454F;
  --ink-500: #5F7280;
  --ink-400: #8A9AA5;
  --ink-300: #B7C3CB;
  --line:    #E4EBEE;
  --line-2:  #EEF3F4;
  --bg:      #F3F7F7;
  --surface: #FFFFFF;
  --surface-2: #FAFCFC;

  /* 語意 */
  --success: #18A957;  --success-bg: #E6F7EE;
  --warning: #F0A21B;  --warning-bg: #FDF3E0;
  --danger:  #E8523F;  --danger-bg:  #FCE9E6;
  --info:    #2FA8E8;  --info-bg:    #E8F5FD;
  --violet:  #8B5CF6;  --violet-bg:  #F0EBFE;

  /* 半徑 / 陰影 */
  --r-xs: 6px; --r-sm: 9px; --r: 12px; --r-lg: 16px; --r-xl: 22px; --pill: 999px;
  --sh-1: 0 1px 2px rgba(16,40,50,.05), 0 1px 3px rgba(16,40,50,.06);
  --sh-2: 0 4px 14px rgba(16,40,50,.08);
  --sh-3: 0 12px 30px rgba(16,40,50,.12);
  --sh-brand: 0 8px 22px rgba(15,181,166,.30);

  /* 字級 */
  --fs-xs: 11px; --fs-sm: 12.5px; --fs: 14px; --fs-md: 15px;
  --fs-lg: 17px; --fs-xl: 20px; --fs-2xl: 24px; --fs-3xl: 30px;
}

/* =========================== 2. Reset / base =========================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Noto Sans TC', -apple-system, 'Segoe UI', system-ui, sans-serif;
  color: var(--ink-900);
  background: var(--bg);
  font-size: var(--fs);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img, svg { display: block; max-width: 100%; }
input, select, textarea { font-family: inherit; font-size: var(--fs); }
ul { list-style: none; }
.icon { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.9;
        stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-sm { width: 18px; height: 18px; }
.icon-lg { width: 28px; height: 28px; }

/* =========================== 3. 文字工具 =========================== */
.t-3xl { font-size: var(--fs-3xl); font-weight: 900; letter-spacing: -.5px; }
.t-2xl { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.3px; }
.t-xl  { font-size: var(--fs-xl);  font-weight: 800; }
.t-lg  { font-size: var(--fs-lg);  font-weight: 700; }
.t-md  { font-size: var(--fs-md);  font-weight: 600; }
.t-sm  { font-size: var(--fs-sm); }
.t-xs  { font-size: var(--fs-xs); }
.muted { color: var(--ink-500); }
.muted-2 { color: var(--ink-400); }
.bold  { font-weight: 700; }
.tnum  { font-variant-numeric: tabular-nums; }
.brand-text { color: var(--brand-600); }
.center { text-align: center; }
.right { text-align: right; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =========================== 4. Layout 工具 =========================== */
.row { display: flex; align-items: center; }
.row-top { display: flex; align-items: flex-start; }
.col { display: flex; flex-direction: column; }
.between { justify-content: space-between; }
.center-x { justify-content: center; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.gap-2 { gap: 2px; } .gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; }
.gap-12 { gap: 12px; } .gap-14 { gap: 14px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; } .gap-24 { gap: 24px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.mt-4{margin-top:4px}.mt-8{margin-top:8px}.mt-12{margin-top:12px}.mt-16{margin-top:16px}
.mt-20{margin-top:20px}.mt-24{margin-top:24px}.mt-32{margin-top:32px}
.mb-4{margin-bottom:4px}.mb-6{margin-bottom:6px}.mb-8{margin-bottom:8px}.mb-10{margin-bottom:10px}
.mb-12{margin-bottom:12px}.mb-16{margin-bottom:16px}.mb-20{margin-bottom:20px}.mb-24{margin-bottom:24px}.mb-32{margin-bottom:32px}
.mr-6{margin-right:6px}.mr-8{margin-right:8px}.ml-auto{margin-left:auto}
.ink-900{color:var(--ink-900)}.ink-700{color:var(--ink-700)}
.p-16{padding:16px}.p-20{padding:20px}.p-24{padding:24px}

/* =========================== 5. 按鈕 =========================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: var(--r);
  font-size: var(--fs-md); font-weight: 700; color: #fff;
  background: var(--brand); transition: .16s ease; white-space: nowrap;
}
.btn:hover { background: var(--brand-600); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-grad { background: var(--grad-brand); box-shadow: var(--sh-brand); }
.btn-grad:hover { filter: brightness(1.04); background: var(--grad-brand); }
.btn-block { width: 100%; }
.btn-lg { height: 52px; font-size: var(--fs-lg); border-radius: var(--r-lg); }
.btn-sm { height: 36px; padding: 0 14px; font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn-ghost { background: var(--brand-50); color: var(--brand-700); }
.btn-ghost:hover { background: var(--brand-100); }
.btn-outline { background: #fff; color: var(--ink-700); box-shadow: inset 0 0 0 1px var(--line); }
.btn-outline:hover { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--ink-300); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #d4402d; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center;
            width: 40px; height: 40px; padding: 0; border-radius: var(--r); color: var(--ink-700);
            background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.btn-icon:hover { background: var(--brand-50); color: var(--brand-600); }

/* =========================== 6. 卡片 =========================== */
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-1);
        border: 1px solid var(--line-2); }
/* 用作連結的卡片/容器：避免 <a> 預設 inline 造成背景框塌陷、內容溢出。
   :where() 零特異性，帶 .row/.col/.grid 的仍維持各自 display。 */
:where(a.card, a.banner, a.list, a.stat, a.note) { display: block; }
.card-pad { padding: 18px; }
.card-hover { transition: .18s ease; cursor: pointer; }
.card-hover:hover { box-shadow: var(--sh-2); transform: translateY(-2px); border-color: var(--brand-100); }
.section-title { font-size: var(--fs-lg); font-weight: 800; margin-bottom: 12px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.link { color: var(--brand-600); font-weight: 600; font-size: var(--fs-sm); }
.divider { height: 1px; background: var(--line); margin: 16px 0; }

/* =========================== 7. Badge / Chip / Status =========================== */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px;
         border-radius: var(--pill); font-size: var(--fs-xs); font-weight: 700;
         white-space: nowrap; flex: none; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge-plain::before { display: none; }
.b-success { color: var(--success); background: var(--success-bg); }
.b-warning { color: #b9790a; background: var(--warning-bg); }
.b-danger  { color: var(--danger);  background: var(--danger-bg); }
.b-info    { color: #1681c4; background: var(--info-bg); }
.b-violet  { color: #6d3fe0; background: var(--violet-bg); }
.b-brand   { color: var(--brand-700); background: var(--brand-50); }
.b-gray    { color: var(--ink-500); background: #EEF2F3; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px;
        border-radius: var(--pill); font-size: var(--fs-sm); font-weight: 600;
        white-space: nowrap; flex: none;
        background: var(--surface); color: var(--ink-700); box-shadow: inset 0 0 0 1px var(--line); }
.chip .icon { width: 16px; height: 16px; flex: none; }
.chip-active { background: var(--brand); color: #fff; box-shadow: none; }

/* =========================== 8. 表單 =========================== */
.field { margin-bottom: 16px; }
.field > label { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-700); margin-bottom: 7px; }
.input, .select {
  width: 100%; height: 46px; padding: 0 14px; border-radius: var(--r);
  background: var(--surface); color: var(--ink-900);
  border: 1.5px solid var(--line); transition: .15s; outline: none;
}
.input:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.input::placeholder { color: var(--ink-400); }
textarea.input { height: auto; padding: 12px 14px; resize: vertical; }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-400); }
.input-icon .input { padding-left: 42px; }
.stepper { display: inline-flex; align-items: center; border-radius: var(--r); box-shadow: inset 0 0 0 1.5px var(--line); overflow: hidden; }
.stepper button { width: 40px; height: 44px; color: var(--brand-600); font-size: 20px; font-weight: 700; }
.stepper button:hover { background: var(--brand-50); }
.stepper input { width: 48px; height: 44px; text-align: center; border: none; font-weight: 700; }

/* =========================== 9. List =========================== */
.list { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden; border: 1px solid var(--line-2); }
.li { display: flex; align-items: center; gap: 13px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); transition: .12s; }
.li:last-child { border-bottom: none; }
.li-click { cursor: pointer; }
.li-click:hover { background: var(--surface-2); }
.li-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
         background: var(--brand-50); color: var(--brand-600); flex: none; }
.li-main { flex: 1; min-width: 0; }
.li-chev { color: var(--ink-300); }

/* =========================== 10. Avatar =========================== */
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
          background: var(--grad-brand); color: #fff; font-weight: 700; flex: none; }
.avatar-lg { width: 64px; height: 64px; font-size: var(--fs-xl); }
.avatar-sm { width: 32px; height: 32px; font-size: var(--fs-sm); }

/* =========================== 11. 統計卡 / 圖表占位 =========================== */
.stat { background: var(--surface); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--sh-1); border: 1px solid var(--line-2); }
.stat-label { font-size: var(--fs-sm); color: var(--ink-500); display: flex; align-items: center; gap: 6px; }
.stat-num { font-size: var(--fs-2xl); font-weight: 900; margin-top: 6px; letter-spacing: -.5px; }
.stat-delta { font-size: var(--fs-xs); font-weight: 700; }
.up { color: var(--success); } .down { color: var(--danger); }
/* 相容別名：部分頁面誤用了這些 class 名，對應到正式樣式，避免無樣式跑版 */
.stat-card, .stat-card2 { background: var(--surface); border-radius: var(--r-lg); padding: 16px 18px;
  box-shadow: var(--sh-1); border: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat-v, .stat-num2 { font-size: var(--fs-2xl); font-weight: 900; letter-spacing: -.5px; display: block; }
.stat-l { font-size: var(--fs-sm); color: var(--ink-500); }
.stat-c, .stat-trend { font-size: var(--fs-xs); font-weight: 700; }
.ok, .trend-up { color: var(--success); }
.trend-down { color: var(--danger); }
.stat-chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px;
  border-radius: var(--pill); font-size: var(--fs-xs); font-weight: 700; white-space: nowrap;
  background: var(--brand-50); color: var(--brand-700); }
.hbar-track { flex: 1; height: 10px; border-radius: var(--pill); background: #EEF3F4; overflow: hidden; }
.hbar-track > i, .hbar-track > span { display: block; height: 100%; border-radius: var(--pill); background: var(--grad-brand); }
.chip-tab { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; white-space: nowrap; flex: none;
  border-radius: var(--pill); font-size: var(--fs-sm); font-weight: 600; background: var(--surface); color: var(--ink-700); box-shadow: inset 0 0 0 1px var(--line); }
.chip-tab.on { background: var(--brand); color: #fff; box-shadow: none; }
.seg-sm { display: inline-flex; background: #EAF0F1; border-radius: var(--pill); padding: 3px; gap: 2px; }
.seg-sm button { padding: 6px 13px; border-radius: var(--pill); font-size: var(--fs-sm); font-weight: 600; color: var(--ink-500); white-space: nowrap; flex: none; }
.seg-sm button.on { background: #fff; color: var(--brand-700); box-shadow: var(--sh-1); }
.sb-sub { display: block; padding: 7px 12px 7px 41px; font-size: var(--fs-sm); color: var(--ink-500); border-radius: var(--r); margin-bottom: 2px; }
.sb-sub:hover { background: var(--surface-2); }
.sb-sub.on { background: var(--brand-50); color: var(--brand-700); }
.ico { display: inline-grid; place-items: center; flex: none; }
/* 更多相容別名（避免無樣式跑版） */
.icon-xs { width: 14px; height: 14px; }
.ta-r, .text-right { text-align: right; }
.ta-c { text-align: center; }
.b-ok, .badge-ok { color: var(--success); background: var(--success-bg); }
.b-blue { color: #1681c4; background: var(--info-bg); }
.badge-warn { color: #b9790a; background: var(--warning-bg); }
.badge-muted { color: var(--ink-500); background: #EEF2F3; }
.seg-item { padding: 7px 16px; border-radius: var(--pill); font-size: var(--fs-sm); font-weight: 600; color: var(--ink-500); white-space: nowrap; flex: none; }
.seg-item.on, .seg-item.active { background: #fff; color: var(--brand-700); box-shadow: var(--sh-1); }
.seg-btn { padding: 7px 16px; border-radius: var(--pill); font-size: var(--fs-sm); font-weight: 600; color: var(--ink-500); white-space: nowrap; flex: none; }
.seg-btn.active, .seg-btn.on { background: #fff; color: var(--brand-700); box-shadow: var(--sh-1); }
.list-row { display: flex; align-items: center; gap: 13px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.list-row:last-child { border-bottom: none; }
.num-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--pill);
  background: var(--brand); color: #fff; font-size: 11px; font-weight: 800; }
.stat-lbl { font-size: var(--fs-sm); color: var(--ink-500); }
.stat-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; }
/* 長條圖：格線 + 基準軸 + 飽和漸層 + hover 數值 */
.chart { position: relative; height: 200px; display: flex; align-items: flex-end; gap: 12px;
  padding: 24px 6px 0; border-bottom: 1.5px solid var(--line);
  background: repeating-linear-gradient(to top, transparent 0, transparent calc(25% - 1px), var(--line-2) calc(25% - 1px), var(--line-2) 25%); }
.bar { position: relative; flex: 1; min-width: 0; min-height: 6px; border-radius: 7px 7px 0 0;
  background: linear-gradient(180deg, #16C6B3 0%, #2FC9B6 55%, #7DE6D8 100%);
  box-shadow: 0 2px 9px rgba(15,181,166,.22); transition: .18s ease; }
.bar:hover { filter: brightness(1.05); transform: translateY(-2px); }
.bar.alt { background: linear-gradient(180deg, #C2EFE9, #E3F7F3); box-shadow: none; }
.bar.hl { background: linear-gradient(180deg, #16C6B3, #2FA8E8); box-shadow: 0 5px 16px rgba(47,168,232,.32); }
.bar[data-v]::before { content: attr(data-v); position: absolute; top: -8px; left: 50%;
  transform: translate(-50%, -100%) scale(.92); background: var(--ink-900); color: #fff;
  font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 7px; white-space: nowrap;
  opacity: 0; transition: .15s; pointer-events: none; z-index: 6; }
.bar[data-v]:hover::before { opacity: 1; transform: translate(-50%, -100%) scale(1); }
.chart.show-values { padding-top: 34px; }
.chart.show-values .bar[data-v]::after { content: attr(data-v); position: absolute; top: -7px;
  left: 50%; transform: translate(-50%, -100%); font-size: 11px; font-weight: 800; color: var(--ink-700); white-space: nowrap; }
.chart-x { display: flex; gap: 12px; padding: 9px 6px 0; }
.chart-x span { flex: 1; text-align: center; font-size: var(--fs-xs); color: var(--ink-400); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.legend > span { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-sm); color: var(--ink-700); }
.legend i.dot { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }
.spark { height: 56px; width: 100%; display: block; }
/* 甜甜圈：陰影 + 中心字 */
.donut { width: 150px; height: 150px; border-radius: 50%; position: relative; display: grid; place-items: center;
  background: conic-gradient(var(--brand) 0 62%, var(--water) 62% 84%, #E4EBEE 84% 100%);
  filter: drop-shadow(0 8px 16px rgba(16,40,50,.10)); }
.donut::after { content: ''; width: 96px; height: 96px; border-radius: 50%; background: #fff; box-shadow: inset 0 1px 5px rgba(16,40,50,.05); }
.donut-c { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; z-index: 2; line-height: 1.2; }
/* 水平條形比較圖（排行/佔比） */
.hbar-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.hbar-row .lbl { width: 84px; flex: none; font-size: var(--fs-sm); color: var(--ink-700); }
.hbar { flex: 1; height: 10px; border-radius: var(--pill); background: #EEF3F4; overflow: hidden; }
.hbar > i { display: block; height: 100%; border-radius: var(--pill); background: var(--grad-brand); }
.hbar-row .val { width: 64px; flex: none; text-align: right; font-size: var(--fs-sm); font-weight: 700; font-variant-numeric: tabular-nums; }

/* =========================== 12. 表格（後台） =========================== */
.table-wrap { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-1); border: 1px solid var(--line-2); overflow: hidden; }
table.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs); }
.tbl thead th { text-align: left; font-size: var(--fs-sm); font-weight: 700; color: var(--ink-500);
                padding: 13px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl tbody td { padding: 13px 16px; border-bottom: 1px solid var(--line-2); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .right { text-align: right; }

/* =========================== 13. Timeline（訂單狀態） =========================== */
.timeline { position: relative; padding-left: 8px; }
.tl-item { position: relative; padding: 0 0 22px 28px; }
.tl-item::before { content: ''; position: absolute; left: 5px; top: 4px; bottom: -4px; width: 2px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-dot { position: absolute; left: 0; top: 3px; width: 12px; height: 12px; border-radius: 50%;
          background: #fff; box-shadow: 0 0 0 2px var(--ink-300); }
.tl-item.done .tl-dot { background: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.tl-item.done::before { background: var(--brand); }
.tl-item.active .tl-dot { background: var(--water); box-shadow: 0 0 0 4px var(--water-50); }

/* =========================== 14. Segmented tabs =========================== */
.seg { display: inline-flex; background: #EAF0F1; border-radius: var(--pill); padding: 4px; gap: 2px; }
.seg button { padding: 7px 16px; border-radius: var(--pill); font-size: var(--fs-sm); font-weight: 600; color: var(--ink-500); white-space: nowrap; flex: none; }
.seg button.on { background: #fff; color: var(--brand-700); box-shadow: var(--sh-1); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 12px 4px; margin-right: 18px; font-weight: 600; color: var(--ink-500); border-bottom: 2.5px solid transparent; }
.tabs a.on { color: var(--brand-700); border-bottom-color: var(--brand); }

/* =========================== 15. Empty / Map placeholder =========================== */
.empty { text-align: center; padding: 48px 20px; color: var(--ink-400); }
.empty .icon { width: 56px; height: 56px; margin: 0 auto 14px; color: var(--ink-300); }
.map { position: relative; border-radius: var(--r-lg); overflow: hidden; min-height: 200px;
       background:
         linear-gradient(rgba(47,168,232,.04), rgba(15,181,166,.06)),
         repeating-linear-gradient(0deg, #E8EFF0 0 1px, transparent 1px 28px),
         repeating-linear-gradient(90deg, #E8EFF0 0 1px, transparent 1px 28px),
         #F0F6F6; }
.map-pin { position: absolute; width: 30px; height: 30px; border-radius: 50% 50% 50% 2px;
           transform: rotate(45deg); background: var(--grad-brand); box-shadow: var(--sh-2); }
.map-pin span { transform: rotate(-45deg); display: block; color: #fff; font-weight: 800; text-align: center; line-height: 30px; }
.map-route { position: absolute; height: 3px; background: repeating-linear-gradient(90deg, var(--water) 0 9px, transparent 9px 16px); }
/* 相容別名：.route（SVG 路線，鋪滿地圖）、.pin（地圖標點，誤用名） */
svg.route { position: absolute; inset: 0; width: 100%; height: 100%; }
.map .pin { position: absolute; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 50% 50% 50% 2px;
  transform: translate(-50%, -100%); background: var(--grad-brand); color: #fff; font-weight: 800; font-size: 12px;
  display: grid; place-items: center; box-shadow: var(--sh-2); }
.map .pin .icon, .map .pin svg { color: #fff; }

/* =========================== 16. 裝置外框（index 預覽用） =========================== */
.device-phone { width: 300px; height: 620px; border-radius: 42px; background: #0E1B24; padding: 11px;
                box-shadow: var(--sh-3); flex: none; position: relative; }
.device-phone .screen { width: 100%; height: 100%; border-radius: 32px; overflow: hidden; background: var(--bg); position: relative; }
.device-phone .notch { position: absolute; top: 11px; left: 50%; transform: translateX(-50%);
                       width: 120px; height: 26px; background: #0E1B24; border-radius: 0 0 16px 16px; z-index: 20; }
.device-tablet { width: 520px; height: 700px; border-radius: 34px; background: #0E1B24; padding: 14px; box-shadow: var(--sh-3); flex: none; }
.device-tablet .screen { width: 100%; height: 100%; border-radius: 22px; overflow: hidden; background: var(--bg); }
.device-browser { width: 100%; max-width: 1100px; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-3); background: #fff; }
.device-browser .chrome { height: 42px; background: #EAF0F1; display: flex; align-items: center; gap: 8px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.device-browser .dot { width: 11px; height: 11px; border-radius: 50%; }
.device-browser .url { flex: 1; height: 26px; background: #fff; border-radius: var(--pill); margin-left: 8px; font-size: var(--fs-xs); color: var(--ink-400); display: flex; align-items: center; padding: 0 14px; }

/* =========================== 17. App shell — 手機 =========================== */
/* 手機頁面獨立開啟時，置中顯示在手機尺寸的框裡（像真手機）；
   在 index 的 iframe（寬=框寬）裡則撐滿、看不到舞台背景。 */
body:has(> .phone-app) {
  min-height: 100vh;
  display: grid; place-items: center;
  background: radial-gradient(1100px 700px at 50% -15%, var(--brand-50), var(--bg) 60%);
}
.phone-app { display: flex; flex-direction: column; background: var(--bg);
  width: 412px; max-width: 100vw; height: min(896px, 100vh); overflow: hidden;
  border-radius: 38px; box-shadow: 0 40px 90px rgba(16,40,50,.22), 0 0 0 1px var(--line-2); position: relative; }
@media (max-width: 440px) { .phone-app { border-radius: 0; height: 100vh; box-shadow: none; } }
.topbar { height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 16px;
          background: var(--surface); border-bottom: 1px solid var(--line-2); flex: none; position: sticky; top: 0; z-index: 10; }
.topbar.brand { background: var(--grad-brand); color: #fff; border: none; }
.topbar .title { font-size: var(--fs-lg); font-weight: 800; }
.topbar .sp { flex: 1; }
.app-body { flex: 1; overflow-y: auto; padding: 16px; }
.app-body::-webkit-scrollbar { width: 0; }
.bottom-nav { flex: none; display: flex; background: var(--surface); border-top: 1px solid var(--line-2);
              padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.bn-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0;
           color: var(--ink-400); font-size: 10.5px; font-weight: 600; }
.bn-item .icon { width: 23px; height: 23px; }
.bn-item.on { color: var(--brand-600); }
.bn-fab { margin-top: -28px; }
.bn-fab .icon { width: 30px; height: 30px; color: #fff; }
.bn-fab .fab { width: 56px; height: 56px; border-radius: 50%; background: var(--grad-brand);
               display: grid; place-items: center; box-shadow: var(--sh-brand); }

/* =========================== 18. App shell — 平板 / 後台（sidebar） =========================== */
.admin { display: flex; height: 100vh; background: var(--bg); }
.sidebar { width: 248px; flex: none; background: var(--surface); border-right: 1px solid var(--line-2);
           display: flex; flex-direction: column; height: 100%; }
.sidebar.compact { width: 220px; }
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
.sb-logo { width: 36px; height: 36px; border-radius: 10px; background: var(--grad-brand); display: grid; place-items: center; color: #fff; font-weight: 900; }
.sb-nav { flex: 1; overflow-y: auto; padding: 6px 12px 16px; }
.sb-group { font-size: var(--fs-xs); font-weight: 700; color: var(--ink-400); letter-spacing: .04em;
            padding: 16px 12px 6px; text-transform: none; }
.sb-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--r);
           color: var(--ink-700); font-weight: 600; font-size: var(--fs); margin-bottom: 2px; transition: .12s; }
.sb-item:hover { background: var(--surface-2); }
.sb-item.on { background: var(--brand-50); color: var(--brand-700); }
.sb-item.on .icon { color: var(--brand-600); }
.sb-item .icon { color: var(--ink-400); }
.sb-item .badge { margin-left: auto; }
.sb-foot { padding: 12px; border-top: 1px solid var(--line-2); }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; height: 100%; }
.main-top { height: 62px; flex: none; display: flex; align-items: center; gap: 14px; padding: 0 24px;
            background: var(--surface); border-bottom: 1px solid var(--line-2); }
.main-top .title { font-size: var(--fs-xl); font-weight: 800; }
.main-body { flex: 1; overflow-y: auto; padding: 24px; }
.searchbar { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: var(--pill);
             background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-400); min-width: 240px; }
.searchbar input { border: none; background: none; outline: none; flex: 1; color: var(--ink-900); }

/* 平板營運台：較大觸控 */
.ops .sb-item { padding: 13px 14px; font-size: var(--fs-md); }
.ops .main-body { padding: 20px; }

/* =========================== 19. 雜項 =========================== */
.pill-tab-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.pill-tab-row::-webkit-scrollbar { height: 0; }
.banner { border-radius: var(--r-lg); padding: 18px 20px; color: #fff; background: var(--grad-brand); box-shadow: var(--sh-brand); }
.note { background: var(--info-bg); color: #1681c4; border-radius: var(--r); padding: 12px 14px; font-size: var(--fs-sm); display: flex; gap: 8px; }
.kbd-amt { font-variant-numeric: tabular-nums; font-weight: 900; }
.dot-line { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-300); }
.thumb { width: 64px; height: 64px; border-radius: var(--r); background: var(--grad-brand-soft);
         display: grid; place-items: center; color: var(--brand-600); flex: none; }
.thumb .icon { width: 32px; height: 32px; }
.progress { height: 7px; border-radius: var(--pill); background: #E7EEEF; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--grad-brand); border-radius: var(--pill); }
.fab-float { position: absolute; right: 18px; bottom: 84px; width: 54px; height: 54px; border-radius: 50%;
             background: var(--grad-brand); display: grid; place-items: center; box-shadow: var(--sh-brand); z-index: 9; }
.fab-float .icon { color: #fff; width: 26px; height: 26px; }

/* =========================== 20. Modal / Toast（互動回饋） =========================== */
.modal-backdrop { position: fixed; inset: 0; z-index: 9998; display: none; align-items: center;
  justify-content: center; padding: 22px; background: rgba(14,27,36,.45); backdrop-filter: blur(2px); }
.modal-backdrop.open { display: flex; }
.modal { width: 100%; max-width: 440px; max-height: 86vh; overflow: auto; background: #fff;
  border-radius: var(--r-lg); box-shadow: var(--sh-3); animation: pop .16s ease; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line-2); }
.modal-head .t { font-size: var(--fs-lg); font-weight: 800; }
.modal-body { padding: 18px; }
.modal-foot { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line-2); }
.modal-foot .btn { flex: 1; }
.wj-toast { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(12px);
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: var(--pill);
  background: var(--ink-900); color: #fff; font-size: 13px; font-weight: 700; box-shadow: var(--sh-3);
  z-index: 99999; opacity: 0; transition: .22s ease; pointer-events: none; }
.wj-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.wj-toast svg { color: #2FE0C0; }
