/* ==========================================================================
   BNET 問卷系統：設計系統
   - Apple 風格：中性白灰 + 藍色重點，卡片、柔和陰影、大圓角
   - 只用系統字體（唔連第三方，保障私隱）
   - 淺色 / 深色自動切換；減少動態、減少透明、高對比都有照顧
   - 觸控目標 >= 44px，公眾問卷選項 >= 56px（長者用手機）
   換品牌色：改 --accent 系列同「問卷品牌色」變數（淺色 + 兩個深色區塊）
   ========================================================================== */

/* ---------- 1. 設計變數 ---------- */
:root {
  color-scheme: light dark;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang HK", "PingFang TC",
    "Hiragino Sans CNS", "Noto Sans HK", "Noto Sans TC", "Microsoft JhengHei", "Segoe UI", Roboto,
    system-ui, sans-serif;

  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f2f2f4;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --line: rgba(0, 0, 0, 0.1);
  --line-strong: rgba(0, 0, 0, 0.28);
  --glass: rgba(245, 245, 247, 0.72);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 20px rgba(0, 0, 0, 0.06);
  --track: #e5e5ea;

  --accent: #0a5cad;          /* 按鈕底色：跟紙本問卷嘅藍（白字 7:1） */
  --accent-press: #084a8c;
  --accent-text: #0a5cad;     /* 連結、重點文字 */
  --accent-tint: rgba(10, 92, 173, 0.09);

  /* 問卷品牌色（取自紙本問卷 PDF） */
  --bar-blue: #0a5cad;        /* 第一部分標題條 */
  --bar-green: #2f7d32;       /* 第二部分標題條 */
  --sec-blue: #0a5cad;        /* 題目卡框線、題號 */
  --sec-green: #2f7d32;
  --on-sec: #ffffff;          /* 題號圓形入面嘅字 */
  --ink: #0b1340;             /* 題目文字（深藍） */
  --opt-line: #94a3b8;        /* 未選選項嘅框線 */
  --coin: #c2410c;            /* 題目圖示 */
  --coin-bg: #ffe9dc;
  --icon-inner: #ffffff;
  --face-agree: #2f7d32;
  --face-neutral: #b7791f;
  --face-disagree: #c2410c;

  --ok: #1b7a34;
  --ok-bg: #e6f5ea;
  --warn: #8a4b00;
  --warn-bg: #fff6df;
  --warn-line: #e8a317;
  --bad: #c4001a;
  --bad-bg: #fdeaec;
  --info-bg: #e8f1fc;

  --radius: 18px;
  --radius-sm: 14px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* 深色變數：要改深色，下面兩處（自動 + 手動）要一齊改 */
/* A. 自動：系統係深色，而且用戶冇手動選「淺色」 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-2: #2c2c2e;
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --line: rgba(255, 255, 255, 0.14);
    --line-strong: rgba(255, 255, 255, 0.34);
    --glass: rgba(28, 28, 30, 0.72);
    --shadow: none;
    --track: #3a3a3c;

    --accent-text: #6db3ff;
    --accent-tint: rgba(74, 155, 232, 0.2);
    --sec-blue: #4a9be8;
    --sec-green: #58b05c;
    --on-sec: #06182f;
    --ink: #f5f5f7;
    --opt-line: #636b78;
    --coin: #ff9a63;
    --coin-bg: #3a2a22;
    --icon-inner: #1c1c1e;
    --face-agree: #5ec269;
    --face-neutral: #e0b24d;
    --face-disagree: #ff8a65;

    --ok: #4ade6b;
    --ok-bg: rgba(48, 209, 88, 0.16);
    --warn: #ffd60a;
    --warn-bg: rgba(255, 214, 10, 0.13);
    --warn-line: #b8960a;
    --bad: #ff6b60;
    --bad-bg: rgba(255, 69, 58, 0.16);
    --info-bg: rgba(41, 151, 255, 0.16);
  }
}
/* B. 手動選「深色」 */
:root[data-theme="dark"] {
  --bg: #000000;
  --surface: #1c1c1e;
  --surface-2: #2c2c2e;
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.34);
  --glass: rgba(28, 28, 30, 0.72);
  --shadow: none;
  --track: #3a3a3c;

  --accent-text: #6db3ff;
  --accent-tint: rgba(74, 155, 232, 0.2);
  --sec-blue: #4a9be8;
  --sec-green: #58b05c;
  --on-sec: #06182f;
  --ink: #f5f5f7;
  --opt-line: #636b78;
  --coin: #ff9a63;
  --coin-bg: #3a2a22;
  --icon-inner: #1c1c1e;
  --face-agree: #5ec269;
  --face-neutral: #e0b24d;
  --face-disagree: #ff8a65;

  --ok: #4ade6b;
  --ok-bg: rgba(48, 209, 88, 0.16);
  --warn: #ffd60a;
  --warn-bg: rgba(255, 214, 10, 0.13);
  --warn-line: #b8960a;
  --bad: #ff6b60;
  --bad-bg: rgba(255, 69, 58, 0.16);
  --info-bg: rgba(41, 151, 255, 0.16);
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* ---------- 2. 基本 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
body.public { font-size: 1.125rem; }  /* 公眾問卷字體再大一點 */

h1, h2, h3, p { margin: 0; }
a { color: var(--accent-text); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -9999px; }  /* honeypot：真人睇唔到 */

.container { max-width: 640px; margin: 0 auto; padding: 20px 16px 72px; }
.container.wide { max-width: 1560px; padding-left: 20px; padding-right: 20px; }
.container.mid { max-width: 1100px; }

.eyebrow { font-size: 0.875rem; font-weight: 600; letter-spacing: 0.04em; color: var(--accent-text); }
.title { font-size: clamp(1.75rem, 6.4vw, 2.5rem); line-height: 1.18; letter-spacing: -0.01em; font-weight: 700; margin: 6px 0 10px; }
.lead { color: var(--text-2); }
.muted { color: var(--text-2); font-size: 0.9375rem; }

/* 切換外觀嗰一刻：暫停過渡，令全頁一齊變色 */
.theme-switching *, .theme-switching *::before, .theme-switching *::after { transition: none !important; }

/* ---------- 外觀切換（自動 / 淺色 / 深色）---------- */
.theme-switch { display: none; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: 999px; }
.js .theme-switch { display: inline-flex; }  /* 冇 JavaScript 就唔顯示（掣會冇用） */
.theme-switch button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 0 14px;
  border: 0; border-radius: 999px; background: transparent; color: var(--text-2); font: inherit; font-size: 0.875rem; font-weight: 600; cursor: pointer;
  transition: background-color 160ms, color 160ms, transform 120ms var(--ease); -webkit-tap-highlight-color: transparent;
}
.theme-switch button:active { transform: scale(0.96); }
.theme-switch button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22); }
.theme-switch svg { width: 18px; height: 18px; flex: none; }
.theme-switch.compact button { padding: 0; }
.theme-switch.compact .t-label { display: none; }
/* 外觀掣位置：
   問卷頁 = 同標題一齊排（桌面：同標題一行，右邊；手機：標題太長，放喺「意見調查」小標題嗰一行右邊）
   多謝／未開放／登入頁 = 固定喺視窗右上角 */
.page-tools { display: flex; justify-content: flex-end; }
.page-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "eyebrow tools" "title title"; align-items: center; column-gap: 12px; }
.page-head .eyebrow { grid-area: eyebrow; }
.page-head .title { grid-area: title; }
.page-head .page-tools { grid-area: tools; }
@media (min-width: 600px) {
  .page-head { grid-template-areas: "eyebrow eyebrow" "title tools"; align-items: start; }
  .page-head .page-tools { margin-top: 2px; }
}
.page-tools.fixed { position: fixed; top: calc(env(safe-area-inset-top) + 10px); right: calc(env(safe-area-inset-right) + 12px); margin: 0; z-index: 5; }

/* ---------- 3. 按鈕 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border: 1px solid transparent; border-radius: 999px;
  font: inherit; font-size: 0.9375rem; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform 120ms var(--ease), background-color 160ms, opacity 160ms;
  -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active { transform: scale(0.97); }                 /* 一撳即刻有回應 */
.btn-fill { background: var(--accent); color: #fff; }
.btn-fill:active { background: var(--accent-press); }
.btn-soft { background: var(--accent-tint); color: var(--accent-text); }
.btn-ghost { background: transparent; color: var(--accent-text); padding: 0 12px; }
.btn-lg { width: 100%; min-height: 58px; border-radius: 18px; font-size: 1.1875rem; }
.btn[disabled] { opacity: 0.6; cursor: default; transform: none; }

/* ---------- 4. 卡片、標籤、提示 ---------- */
.card {
  background: var(--surface); border-radius: var(--radius); padding: 20px; margin: 16px 0;
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.card h2 { font-size: 1.125rem; font-weight: 650; letter-spacing: -0.005em; margin-bottom: 8px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px;
  font-size: 0.8125rem; font-weight: 600; background: var(--surface-2); color: var(--text-2); white-space: nowrap;
}
.chip svg { width: 14px; height: 14px; }
.chip-live { background: var(--ok-bg); color: var(--ok); }
.chip-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip-soon { background: var(--info-bg); color: var(--accent-text); }
.chip-ok { background: var(--ok-bg); color: var(--ok); }
.chip-bad { background: var(--bad-bg); color: var(--bad); }

/* 醒目提示：請勿填寫個人資料 */
.notice {
  display: flex; gap: 12px; align-items: flex-start; margin: 18px 0 22px; padding: 16px;
  background: var(--warn-bg); border: 1.5px solid var(--warn-line); border-radius: var(--radius);
}
.notice svg { flex: none; width: 26px; height: 26px; color: var(--warn); margin-top: 1px; }
.notice p { font-size: 1rem; line-height: 1.55; }
.alert { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--bad-bg); color: var(--bad); font-weight: 600; margin: 16px 0; }

/* ---------- 5. 公眾問卷（跟紙本 PDF：標誌欄 + 藍/綠標題條 + 圓角框題目卡）---------- */
/* 標誌欄：標誌有白底，所以兩個模式都用白底 */
.brandbar { background: #ffffff; border-bottom: 3px solid #0a5cad; }
.brandbar-inner { max-width: 640px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.brandbar img { display: block; height: clamp(40px, 11vw, 64px); width: auto; }

.progress {
  position: sticky; top: 0; z-index: 10; background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.progress-inner { max-width: 640px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 14px; }
.progress-text { font-size: 0.9375rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 5.2em; }
.progress-track { flex: 1; height: 8px; border-radius: 999px; background: var(--track); overflow: hidden; }
.progress-fill {
  height: 100%; border-radius: 999px; background: var(--accent); transform-origin: left; transform: scaleX(0);
  transition: transform 380ms var(--ease);
}
.progress.is-done .progress-fill { background: var(--ok); }

/* 部分標題條（藍 / 綠） */
.sec { margin: 0 0 22px; }
.sec.theme-blue { --sec: var(--sec-blue); --bar: var(--bar-blue); }
.sec.theme-green { --sec: var(--sec-green); --bar: var(--bar-green); }
.sec-bar {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px;
  padding: 16px 20px; border-radius: 18px; background: var(--bar); color: #fff;
}
.sec-bar h1, .sec-bar h2 { font-size: clamp(1.5rem, 6vw, 1.875rem); line-height: 1.2; font-weight: 800; letter-spacing: 0.01em; }
.sec-bar .hint { font-size: 0.9375rem; font-weight: 600; opacity: 0.95; }

/* 題目卡：圓角框線（顏色跟部分）、題號圓形、可選圖示 */
fieldset.q {
  border: 2.5px solid var(--sec); margin: 16px 0 0; padding: 16px 16px 18px; min-inline-size: 0; background: var(--surface);
  border-radius: 22px; transition: border-color 200ms, box-shadow 200ms;
}
fieldset.q.invalid { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); }
fieldset.q > legend { float: left; width: 100%; padding: 0; margin: 0 0 14px; }
fieldset.q > legend + * { clear: both; }
.qhead { display: flex; align-items: center; gap: 12px; }
.qno {
  flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  background: var(--sec); color: var(--on-sec); font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums;
}
.qicon {
  flex: none; width: 60px; height: 60px; border-radius: 50%; background: var(--coin-bg); color: var(--coin);
  --icon-inner: var(--coin-bg);
}
.qicon svg { display: block; width: 100%; height: 100%; }
.qtext { font-size: 1.25rem; font-weight: 800; line-height: 1.35; color: var(--ink); letter-spacing: 0.01em; }
.opt-tag { margin-left: 6px; font-size: 0.8125rem; font-weight: 600; color: var(--text-2); background: var(--surface-2); padding: 2px 8px; border-radius: 999px; vertical-align: 2px; }
.field-error { margin-top: 12px; color: var(--bad); font-weight: 700; font-size: 0.9375rem; }

/* 選項（A / B / C）：一條條大圓角膠囊，字母圓形 */
.opts { display: grid; gap: 10px; }
.opt, .face, .rate { position: relative; display: block; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.opt input, .face input, .rate input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.opt > span {
  display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 10px 14px; border-radius: 18px;
  border: 2.5px solid var(--opt-line); background: var(--surface); color: var(--ink);
  font-size: 1.1875rem; font-weight: 700; line-height: 1.35;
  transition: transform 120ms var(--ease), background-color 160ms, border-color 160ms;
}
.opt .ltr {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 2.5px solid var(--sec);
  color: var(--sec); font-style: normal; font-weight: 800; font-size: 1.0625rem;
  transition: background-color 160ms, color 160ms;
}
.opt:active > span, .face:active > span, .rate:active > span { transform: scale(0.98); }
.opt input:checked + span { border-color: var(--sec); background: var(--accent-tint); background: color-mix(in srgb, var(--sec) 13%, var(--surface)); }
.opt input:checked + span .ltr { background: var(--sec); color: var(--on-sec); }

/* 臉孔：同意 / 普通 / 唔同意（顏色 + 文字 + 圖示，唔單靠顏色分辨） */
.faces { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.face > span {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 128px; padding: 10px 4px;
  border-radius: 18px; border: 2.5px solid var(--opt-line); background: var(--surface); color: var(--ink);
  font-size: 1.125rem; font-weight: 800; text-align: center;
  transition: transform 120ms var(--ease), background-color 160ms, border-color 160ms;
}
.face svg { width: 64px; height: 64px; flex: none; color: var(--face-c); }
.face[data-face="agree"] { --face-c: var(--face-agree); }
.face[data-face="neutral"] { --face-c: var(--face-neutral); }
.face[data-face="disagree"] { --face-c: var(--face-disagree); }
.face input:checked + span { border-color: var(--sec); border-width: 3.5px; padding: 9px 3px; background: var(--accent-tint); background: color-mix(in srgb, var(--sec) 13%, var(--surface)); }
@media (min-width: 520px) {
  .face > span { flex-direction: row; gap: 10px; min-height: 92px; font-size: 1.1875rem; }
  .face svg { width: 60px; height: 60px; }
}

/* 評分（備用題型）：一排大按鈕 */
.rating { display: grid; grid-template-columns: repeat(var(--n, 5), 1fr); gap: 8px; }
.scale { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 0.875rem; color: var(--text-2); }
.rate > span {
  display: flex; align-items: center; justify-content: center; min-height: 58px; border: 2.5px solid var(--opt-line); border-radius: 18px;
  background: var(--surface); color: var(--ink); font-size: 1.3125rem; font-weight: 800; font-variant-numeric: tabular-nums;
  transition: transform 120ms var(--ease), background-color 160ms, border-color 160ms, color 160ms;
}
.rate input:checked + span { background: var(--sec); color: var(--on-sec); border-color: var(--sec); }

.opt input:focus-visible + span, .face input:focus-visible + span, .rate input:focus-visible + span { outline: 3px solid var(--accent-text); outline-offset: 2px; }

.field {
  display: block; width: 100%; min-height: 128px; padding: 14px 16px; font: inherit; color: var(--text);
  background: var(--surface-2); border: 2px solid transparent; border-radius: var(--radius-sm); resize: vertical;
  transition: border-color 160ms, background-color 160ms;
}
.field::placeholder { color: var(--text-2); }
.field:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.field:focus-visible { outline: 3px solid var(--accent-tint); outline-offset: 0; }

.submit-area { margin-top: 26px; }
.public-foot { margin-top: 28px; text-align: center; color: var(--text-2); font-size: 0.875rem; line-height: 1.7; }
.public-foot span { display: inline-block; margin: 0 8px; }

/* ---------- 6. 多謝 / 未開放 ---------- */
.hero { min-height: 56vh; display: grid; place-content: center; justify-items: center; gap: 14px; text-align: center; padding: 32px 20px; }
.hero .title { margin: 6px 0 0; }
.hero .lead { max-width: 28em; }
.badge { width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-bg); color: var(--ok); }
.badge.neutral { background: var(--surface-2); color: var(--text-2); }
.badge svg { width: 60px; height: 60px; }
.badge .tick { stroke-dasharray: 26; stroke-dashoffset: 26; animation: draw 520ms 160ms var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.badge { animation: pop 420ms var(--ease) both; }
@keyframes pop { from { transform: scale(0.7); opacity: 0; } }

/* ---------- 7. Admin 共用 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10; background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: 1560px; margin: 0 auto; padding: 8px 20px; min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; color: var(--text); text-decoration: none; letter-spacing: -0.005em; }
.brand-mark { width: 30px; height: 30px; border-radius: 50%; display: block; flex: none; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.auth { align-content: center; }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-weight: 600; text-decoration: none; margin-left: -6px; padding-left: 6px; }
.back svg { width: 18px; height: 18px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; color: var(--text-2); font-size: 0.9375rem; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 4px; }

/* 登入 */
.auth { min-height: 100svh; display: grid; place-items: center; padding: 20px 16px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .brand-mark { width: 64px; height: 64px; margin: 0 auto 14px; }
.auth-card h1 { text-align: center; font-size: 1.75rem; letter-spacing: -0.01em; margin-bottom: 4px; }
.auth-card .lead { text-align: center; margin-bottom: 20px; font-size: 0.9375rem; }
.form-row { display: grid; gap: 6px; margin-bottom: 16px; }
.form-row label { font-size: 0.9375rem; font-weight: 600; }
.input {
  width: 100%; min-height: 50px; padding: 0 14px; font: inherit; color: var(--text); background: var(--surface-2);
  border: 2px solid transparent; border-radius: var(--radius-sm); transition: border-color 160ms, background-color 160ms;
}
.input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.input:focus-visible { outline: 3px solid var(--accent-tint); outline-offset: 0; }

/* 總覽 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 20px 0 8px; }
.stat { background: var(--surface); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.stat-num { display: block; font-size: 2.125rem; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-lbl { color: var(--text-2); font-size: 0.875rem; }

.section-title { font-size: 1.25rem; font-weight: 650; margin: 28px 0 4px; letter-spacing: -0.005em; }
.event-list { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 12px; }
.event-row {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 16px; padding: 16px 18px;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line);
  color: var(--text); text-decoration: none; transition: transform 140ms var(--ease), background-color 160ms;
  -webkit-tap-highlight-color: transparent;
}
.event-row:active { transform: scale(0.99); }
.event-name { font-weight: 650; font-size: 1.0625rem; line-height: 1.35; }
.event-meta { color: var(--text-2); font-size: 0.875rem; grid-column: 1; }
.event-side { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; gap: 12px; }
.count { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.count small { font-size: 0.8125rem; font-weight: 500; color: var(--text-2); margin-left: 2px; }
.chev { width: 18px; height: 18px; color: var(--text-2); }
@media (hover: hover) { .event-row:hover { background: var(--surface-2); } }

/* 活動詳情 */
.kpi { padding: 22px; }
.kpi-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.kpi .big { font-size: clamp(2.75rem, 11vw, 3.75rem); }
.big { font-size: 2.25rem; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin: 6px 0 12px; }
.big small { font-size: 0.9375rem; font-weight: 500; letter-spacing: 0; color: var(--text-2); }
.meter { position: relative; height: 16px; background: var(--track); border-radius: 999px; margin: 22px 0 34px; }
.meter-fill { display: block; height: 100%; border-radius: 999px; background: var(--text-2); transform-origin: left; animation: grow 700ms var(--ease) both; }
.meter-target { position: absolute; top: -6px; bottom: -6px; width: 3px; margin-left: -1.5px; background: var(--text); border-radius: 2px; }
.meter-target-lbl { position: absolute; top: 100%; margin-top: 8px; transform: translateX(-50%); font-size: 0.8125rem; color: var(--text-2); white-space: nowrap; }

.row {
  display: grid; grid-template-columns: minmax(72px, 170px) 1fr minmax(96px, auto); grid-template-areas: "lbl track val";
  align-items: center; gap: 12px; margin: 12px 0;
}
.row .lbl { grid-area: lbl; font-size: 0.9375rem; overflow-wrap: anywhere; }
.row .track { grid-area: track; }
.row .val { grid-area: val; text-align: right; font-size: 0.9375rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.track { height: 12px; border-radius: 999px; background: var(--track); overflow: hidden; }
.fill { display: block; height: 100%; border-radius: 999px; background: var(--accent); transform-origin: left; animation: grow 600ms var(--ease) both; }
.fill.sat { background: var(--ok); }
.fill.face-agree { background: var(--face-agree); }
.fill.face-neutral { background: var(--face-neutral); }
.fill.face-disagree { background: var(--face-disagree); }
.legend-inline { margin-left: 8px; }
.tick { width: 18px; height: 18px; color: var(--ok); vertical-align: -3px; margin-right: 6px; flex: none; }
.lbl.is-good { font-weight: 650; }
@keyframes grow { from { transform: scaleX(0); } }
.legend { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; background: var(--ok); display: inline-block; }

.comments { list-style: none; margin: 10px 0 0; padding: 0; }
.comments li { display: grid; grid-template-columns: auto 1fr; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.comments .hour { color: var(--text-2); font-size: 0.8125rem; white-space: nowrap; font-variant-numeric: tabular-nums; padding-top: 2px; }
.comments .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.note { background: var(--info-bg); padding: 14px 16px; border-radius: var(--radius-sm); color: var(--text); margin: 16px 0; }

/* ---------- 8. 窄螢幕 ---------- */
@media (max-width: 520px) {
  .row { grid-template-columns: 1fr auto; grid-template-areas: "lbl val" "track track"; gap: 6px 12px; }
  .comments li { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------- 11. 後台：導覽、進度、篩選、圖表、表格、表單 ---------- */
.topnav { display: flex; align-items: center; gap: 4px; margin-right: auto; margin-left: 14px; }
.topnav a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px;
  color: var(--text-2); font-weight: 600; font-size: 0.9375rem; text-decoration: none;
}
.topnav a[aria-current="page"] { background: var(--accent-tint); color: var(--accent-text); }
@media (hover: hover) { .topnav a:hover { background: var(--surface-2); } }
@media (max-width: 640px) { .topbar-inner .brand span:last-child { display: none; } .topnav { margin-left: 4px; } }

.chip-warn { background: var(--warn-bg); color: var(--warn); }

/* 目標達成：只有「已收 / 目標」同一條細進度條 */
.goal { padding: 16px 20px; margin-top: 12px; }
.goal-label { color: var(--text-2); font-size: 0.875rem; font-weight: 600; }
.goal-num { font-size: clamp(2.25rem, 7vw, 3rem); line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin: 2px 0 10px; }
.goal-num small { font-size: 0.5em; font-weight: 500; color: var(--text-2); letter-spacing: 0; }
.thin-bar { height: 8px; background: var(--track); border-radius: 999px; overflow: hidden; }
.thin-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.title.sm { font-size: clamp(1.5rem, 5vw, 1.875rem); margin: 4px 0 8px; }

/* 篩選 */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; padding: 12px 16px; margin: 12px 0; }
.filters label { display: grid; gap: 4px; font-size: 0.8125rem; font-weight: 600; color: var(--text-2); }
.filters select, .filters input[type="date"] {
  min-height: 44px; padding: 0 12px; font: inherit; font-size: 0.9375rem; color: var(--text); background: var(--surface-2);
  border: 2px solid transparent; border-radius: var(--radius-sm); max-width: 100%;
}
.filters select:focus, .filters input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.filter-actions { display: flex; gap: 6px; align-items: center; }
.filter-downloads { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.btn-sm svg { width: 16px; height: 16px; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 6px 16px; margin-top: 22px; }
.section-head .actions { margin: 0; }
.section-title small { display: block; margin-top: 2px; font-size: 0.8125rem; font-weight: 500; color: var(--text-2); }

/* KPI 方格 */
.kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kpis.compact { gap: 10px; margin: 0 0 12px; }
.kpis.compact .stat { padding: 12px 14px; }
.kpis.compact .stat-num { font-size: 1.75rem; }
.stat .chip { margin-top: 8px; }
.stat .stat-lbl { display: block; }
.stat .stat-lbl + .stat-lbl { margin-top: 4px; }

/* 圖表（SVG）：簡單長條圖，細細個，唔使捲動 */
.chart-card { padding: 12px 16px 8px; margin: 0 0 12px; }
.chart-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.chart-head h2 { margin: 0; font-size: 1rem; }
.chart-wrap { margin-top: 4px; }
.chart { display: block; width: 100%; max-height: 170px; height: auto; font-family: var(--font); }
.ch-base { stroke: var(--line-strong); stroke-width: 1; }
.ch-text { fill: var(--text-2); font-size: 11.5px; }
.ch-target { stroke: var(--bad); stroke-width: 1.5; stroke-dasharray: 6 4; }
.ch-target-text { fill: var(--bad); font-size: 11.5px; font-weight: 600; }
.ch-bar { fill: currentColor; }
.ch-value { fill: var(--text); font-size: 12px; font-weight: 700; }
.ch-met { color: var(--ok); }
.ch-near { color: var(--warn-line); }
.ch-unmet { color: var(--bad); }
.ch-none { color: var(--text-2); }
.ch-low .ch-bar { opacity: 0.5; }
.key { display: inline-block; margin-left: 10px; font-weight: 600; font-size: 0.8125rem; }
.key-met { color: var(--ok); } .key-near { color: var(--warn); } .key-unmet { color: var(--bad); }
.kpi-met { border: 2px solid var(--ok); }
.kpi-near { border: 2px solid var(--warn-line); }
.kpi-unmet { border: 2px solid var(--bad); }
.kpi-met .meter-fill { background: var(--ok); }
.kpi-near .meter-fill { background: var(--warn-line); }
.kpi-unmet .meter-fill { background: var(--bad); }

/* 表格 */
.table-wrap { overflow-x: auto; margin: 0 -4px; position: relative; } /* position：表格入面嘅 sr-only（絕對定位）先會被裁切，唔會撐闊成頁 */
.table-card { padding: 8px 16px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.tbl th { text-align: left; font-size: 0.8125rem; font-weight: 650; color: var(--text-2); padding: 10px 8px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.tbl th a { color: inherit; text-decoration: none; }
.tbl th a:hover { color: var(--accent-text); }
.tbl td { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.tbl-name { display: block; font-weight: 650; color: var(--text); text-decoration: none; line-height: 1.35; }
a.tbl-name { color: var(--accent-text); }
.tbl-sub { display: block; font-size: 0.8125rem; color: var(--text-2); font-weight: 400; line-height: 1.4; }
.tbl-sub-inline { font-size: 0.8125rem; color: var(--text-2); }
.num .chip { margin-top: 4px; }

/* 活動設定表單 */
.label-like { font-size: 0.9375rem; font-weight: 600; }
.win { padding: 12px 14px; background: var(--info-bg); border-radius: var(--radius-sm); font-weight: 600; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 500; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }
.custom-times { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 4px; }
.time-pick { display: grid; grid-template-columns: 1fr 110px; gap: 6px 8px; align-items: center; }
.time-pick .label-like { grid-column: 1 / -1; font-size: 0.8125rem; color: var(--text-2); }
/* 有 JavaScript：預設收埋，剔「自訂時間」先顯示；冇 JavaScript：一直顯示 */
.js .custom-times { display: none; }
.js .custom-on .custom-times { display: grid; }
.container.narrow { max-width: 760px; }
.form-actions { margin-top: 8px; max-width: 360px; }
.note-ok { background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 0.875rem; }
.btn-danger { background: var(--bad-bg); color: var(--bad); }
.danger-zone { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }

/* 後台唔做增長動畫（睇數據用，唔使特效） */
.fill, .meter-fill { animation: none; }

/* ---------- 後台：字體加大 + 視覺層級 ----------
   層級（由重到輕）：① 頁面標題 → ② 最重要數字（目標、滿意度）→ ③ 卡片標題 → ④ 表格內容 → ⑤ 輔助說明（淡色、較細）
   所有後台頁面 body 都有 class="admin"；問卷公眾頁唔受影響。 */
.admin { font-size: 1.125rem; line-height: 1.5; }
.admin .topbar-inner { min-height: 66px; }
.admin .brand { font-size: 1.1875rem; }
.admin .topnav a { min-height: 46px; padding: 0 20px; font-size: 1.0625rem; }
.admin .theme-switch button { min-height: 44px; }

/* ① 頁面標題 */
.page-head-admin { margin: 6px 0 14px; }
.page-head-admin h1 { font-size: clamp(1.75rem, 3vw, 2.25rem); line-height: 1.2; font-weight: 750; letter-spacing: -0.015em; }
.page-head-admin .muted { margin-top: 2px; }
.admin .title.sm { font-size: clamp(1.75rem, 3vw, 2.25rem); font-weight: 750; margin: 6px 0 14px; }
.admin .title { font-weight: 750; }
.admin .eyebrow { font-size: 1rem; }

/* ⑤ 輔助文字：細啲、淡啲，但唔好細過 15px */
.admin .muted { font-size: 1rem; color: var(--text-2); }
.admin .tbl-sub, .admin .tbl-sub-inline, .admin .stat-lbl, .admin .meta { font-size: 1rem; }

/* ③ 卡片標題 */
.admin .card h2, .admin .chart-head h2 { font-size: 1.3125rem; font-weight: 700; letter-spacing: -0.005em; }
.admin .card-title { font-size: 1.1875rem; font-weight: 700; margin: 0 0 2px; }

/* ② 最重要：目標達成 */
.admin .goal { padding: 20px 24px; border-top: 5px solid var(--accent); }
.admin .goal-label { font-size: 1.0625rem; font-weight: 650; color: var(--text); }
.admin .goal-num { font-size: clamp(3rem, 5vw, 4rem); margin: 4px 0 12px; }
.admin .goal-num small { font-size: 0.45em; }
.admin .thin-bar { height: 12px; }

/* ② KPI 方格：數字大、標籤清楚；滿意度（重點指標）再突出 */
.admin .kpis.compact { gap: 12px; }
.admin .kpis.compact .stat { padding: 16px 18px; border-radius: 18px; }
.admin .kpis.compact .stat-num { font-size: 2.5rem; font-weight: 750; line-height: 1.1; }
.admin .stat-lbl { color: var(--text-2); margin-top: 2px; }
.admin .stat-main { border-left: 6px solid var(--text-2); }
.admin .stat-main .stat-num { font-size: 3rem; }
.admin .st-met { border-left-color: var(--ok); }
.admin .st-near { border-left-color: var(--warn-line); }
.admin .st-unmet { border-left-color: var(--bad); }
.admin .chip { font-size: 1rem; padding: 4px 12px; }

/* 篩選 */
.admin .filter-form { padding: 0 20px 18px; gap: 12px; }
.admin .filters label { font-size: 1rem; font-weight: 650; color: var(--text); }
.admin .filters select, .admin .filters input[type="date"] { min-height: 50px; font-size: 1.0625rem; min-width: 0; }
.admin .filters input[type="date"] { font-size: 1rem; padding: 0 8px 0 12px; }
.admin .btn { font-size: 1.0625rem; }
.admin .btn-sm { min-height: 46px; padding: 0 18px; font-size: 1.0625rem; }
.admin .btn-sm svg { width: 18px; height: 18px; }

/* 圖表：文字加大 */
.admin .ch-text { font-size: 16px; }
.admin .ch-value { font-size: 17px; font-weight: 750; }
.admin .ch-target-text { font-size: 16px; }
.admin .ov .chart { max-height: 260px; }
.admin .key { font-size: 1rem; }

/* ④ 表格：字大、行高、表頭清楚、滑鼠移上去有反應 */
.admin .tbl { font-size: 1.125rem; }
.admin .tbl th { font-size: 1rem; font-weight: 700; color: var(--text-2); padding: 12px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line-strong); }
.admin .tbl th:first-child { border-top-left-radius: 10px; }
.admin .tbl th:last-child { border-top-right-radius: 10px; }
.admin .tbl td { padding: 16px 12px; }
.admin .tbl-name { font-size: 1.1875rem; font-weight: 700; }
@media (hover: hover) { .admin .tbl tbody tr:hover { background: var(--surface-2); } }
.admin .table-card { padding: 10px 14px 6px; }

/* 表單（活動設定） */
.admin .form-row label, .admin .label-like { font-size: 1.0625rem; font-weight: 650; color: var(--text); }
.admin .input { min-height: 54px; font-size: 1.125rem; }
.admin .setup h2, .admin .list-title { font-size: 1.3125rem; font-weight: 700; }
.admin .win { font-size: 1rem; padding: 12px 14px; }
.admin .check { font-size: 1.0625rem; }
.admin .setup-col .btn-lg { min-height: 56px; font-size: 1.1875rem; }

/* 活動詳情 */
.admin .row .lbl, .admin .row .val { font-size: 1.0625rem; }
.admin .big { font-size: 2.75rem; }
.admin .big small { font-size: 1.0625rem; }
.admin .kpi .big { font-size: clamp(3rem, 6vw, 4rem); }
.admin .legend, .admin .legend-inline { font-size: 1rem; }
.admin .back { font-size: 1.0625rem; }
.admin .row { margin: 14px 0; }

/* ---------- 問卷：提交掣上面嘅提示 ---------- */
.submit-hint { text-align: center; margin: 0 0 12px; font-size: 1.125rem; font-weight: 700; color: var(--text-2); }
.submit-hint.is-ready { color: var(--ok); }

/* ---------- 9. 無障礙偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 1ms !important; }
  .badge .tick { stroke-dashoffset: 0; }
}
@media (prefers-reduced-transparency: reduce) {
  .progress, .topbar { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --line: rgba(128, 128, 128, 0.7); --text-2: var(--text); }
  fieldset.q, .card, .event-row, .stat { outline: 1px solid var(--line-strong); }
}

/* ---------- 10. 列印（admin 詳情頁）---------- */
@media print {
  body { background: #fff; color: #000; }
  .topbar, .actions, .back { display: none !important; }
  .card, .stat { box-shadow: none; break-inside: avoid; }
  .fill, .meter-fill { animation: none; }
}

/* ---------- 活動設定：左邊表單（由上而下）、右邊活動清單 ---------- */
.manage-grid { display: grid; grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); gap: 16px; align-items: start; }
.manage-grid.is-editing { grid-template-columns: minmax(300px, 520px); }
.setup { padding: 18px 20px; margin: 0; }
.setup h2 { margin: 0 0 12px; font-size: 1.0625rem; }
.setup-col { display: grid; gap: 12px; }
.setup-col .form-row { margin: 0; }
.setup-col .input { min-height: 48px; }
.setup-col .btn-lg { min-height: 50px; border-radius: 14px; font-size: 1.0625rem; margin-top: 4px; }
.list-col { min-width: 0; }
.list-title { margin: 0 0 8px; font-size: 1.0625rem; font-weight: 650; }
.list-col .table-card { margin: 0; }
.time-line { display: grid; gap: 8px; }
.time-line .win { padding: 8px 12px; font-size: 0.875rem; }
.time-line .check { min-height: 40px; }
.time-line .custom-times { grid-template-columns: 1fr; margin-top: 0; }
.time-line .time-pick { grid-template-columns: 1fr 96px; }
@media (max-width: 860px) {
  .manage-grid, .manage-grid.is-editing { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 總覽：左邊目標 / 篩選 / KPI，右邊圖 + 比較表 ---------- */
.ov-grid { display: grid; grid-template-columns: minmax(320px, 370px) minmax(0, 1fr); gap: 16px; align-items: start; }
.ov-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.ov-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; } /* 單欄都要 minmax(0,…)：否則表格 / 圖會撐闊成頁 */
.ov-side .card, .ov-main .card { margin: 0; }
.ov-side .filters { display: block; padding: 0; margin: 0; }
.filter-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px 16px; }
.ov-downloads { display: flex; flex-wrap: wrap; gap: 8px; }
.ov-side .filters label { min-width: 0; }
.ov-side .filters select, .ov-side .filters input[type="date"] { width: 100%; }
.ov-side .span2 { grid-column: 1 / -1; }
.ov-side .filter-actions { margin-left: 0; }
.ov-main .kpis.compact { grid-template-columns: 1fr 1fr 1.5fr 1fr 1.25fr; margin: 0; }
.chart-card { padding: 14px 18px 10px; }
.ov .chart { max-height: 210px; }
@media (max-width: 1250px) {
  .ov-main .kpis.compact { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}
@media (max-width: 1000px) {
  .ov-grid { grid-template-columns: minmax(0, 1fr); } /* minmax(0,…)：唔俾內容（表格、圖）撐闊成頁 */
}
.admin .time-line .win { font-size: 1rem; }
.admin .chip-lg { font-size: 1.0625rem; padding: 6px 16px; margin-left: 10px; vertical-align: middle; font-weight: 700; }
.admin .big .chip-lg { position: relative; top: -4px; }

/* ---------- 後台最細字體 16px（其餘更大嘅字體維持原樣）---------- */
.admin .meter-target-lbl, .admin .comments .hour, .admin .count small, .admin .event-meta, .admin .section-title small { font-size: 1rem; }
.admin .eyebrow, .admin .btn, .admin .legend-inline, .admin .theme-switch button, .admin .time-pick .label-like { font-size: 1rem; }
.form-row label, .auth-card .lead { font-size: 1rem; }
.admin .ch-text, .admin .ch-target-text { font-size: 16px; }
/* KPI 方格：數字（同徽章）喺上面，說明文字貼底 */
.admin .kpis.compact .stat { display: flex; flex-direction: column; min-height: 156px; }
.admin .stat-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.admin .stat-top .chip { margin: 0; padding: 5px 14px; font-size: 1rem; font-weight: 700; }
.admin .kpis.compact .stat-lbl { margin-top: auto; padding-top: 14px; line-height: 1.35; }

/* 設定頁置中：新增 = 兩欄（最闊 1240px，喺螢幕中間）；修改 = 單欄窄版置中 */
.container.center { max-width: 1240px; padding-left: 20px; padding-right: 20px; }
.container.center.edit { max-width: 640px; }
.container.center.edit .manage-grid.is-editing { grid-template-columns: 1fr; }
/* 活動詳情頂部資料（狀態、地點、收問卷時間、回應數）：20px */
.admin .meta, .admin .meta span, .admin .meta strong, .admin .meta .chip { font-size: 1.25rem; }
.admin .meta { gap: 8px 22px; margin-top: 4px; }
.admin .meta .chip { padding: 5px 16px; font-weight: 700; }
/* 版本碼（頁尾） */
.admin-foot { text-align: center; color: var(--text-2); font-size: 1rem; padding: 4px 16px 32px; font-variant-numeric: tabular-nums; }

/* ---------- 「？說明」掣（頂部） ---------- */
.help-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 10px; border-radius: 999px; background: var(--accent-tint); color: var(--accent-text); font-weight: 700; font-size: 1rem; text-decoration: none; }
.help-btn b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 1rem; line-height: 1; }
.help-btn[aria-current="page"] { outline: 2px solid var(--accent-text); outline-offset: -2px; }
@media (hover: hover) { .help-btn:hover { background: var(--info-bg); } }
@media (max-width: 640px) { .help-btn span { display: none; } .help-btn { padding: 0 8px; } }

/* ---------- 使用說明：左目錄 + 右邊一步一頁 ---------- */
.help-grid { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: 16px; align-items: start; }
.help-nav { margin: 0; padding: 18px 12px; }
.help-nav h2 { font-size: 1rem; font-weight: 700; color: var(--text-2); margin: 6px 12px 6px; }
.help-nav h2:not(:first-child) { margin-top: 18px; }
.help-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.help-nav a, .help-soon { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-height: 52px; align-content: center; padding: 10px 14px; border-radius: 14px; font-size: 1.125rem; font-weight: 650; color: var(--text); text-decoration: none; }
.help-nav a small, .help-soon small { font-size: 1rem; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.help-nav a[aria-current="page"] { background: var(--accent-tint); color: var(--accent-text); }
@media (hover: hover) { .help-nav a:hover { background: var(--surface-2); } }
.help-soon { color: var(--text-2); font-weight: 500; }

.help-card { margin: 0; padding: 22px 28px 24px; }
.help-head h2 { font-size: 1.5rem; font-weight: 750; }
.help-head .muted { margin-top: 2px; }
.hstep { display: grid; grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 20px; }
.hnum { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 2rem; font-weight: 800; margin-bottom: 12px; }
.hstep h3 { font-size: 1.625rem; line-height: 1.3; font-weight: 750; outline: none; }
.htext { font-size: 1.375rem; line-height: 1.55; margin-top: 10px; }
.htip { margin-top: 16px; padding: 12px 16px; border-radius: 14px; background: var(--warn-bg); border: 1.5px solid var(--warn-line); font-size: 1.125rem; line-height: 1.5; }
.htip strong { display: block; color: var(--warn); margin-bottom: 2px; }
.hshot { position: relative; margin: 0; border: 1px solid var(--line-strong); border-radius: 14px; overflow: hidden; background: #fff; box-shadow: var(--shadow); }
.hshot img { display: block; width: 100%; height: auto; }
.hmark { position: absolute; border: 3.5px solid #e11d48; border-radius: 10px; box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.22); pointer-events: none; }
.hmark b { position: absolute; left: -14px; top: -16px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #e11d48; color: #fff; font-size: 1.125rem; font-weight: 800; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); }

@media (max-width: 1000px) {
  .help-grid { grid-template-columns: 1fr; }
  .hstep { grid-template-columns: 1fr; gap: 16px; }
  .help-card { padding: 18px 16px 20px; }
}
@media print { .help-controls, .help-nav, .topbar { display: none !important; } .hstep { display: grid !important; break-inside: avoid; } }

/* 說明頁：截圖放大啲（文字欄收窄、目錄收窄） */
.help-grid { grid-template-columns: minmax(230px, 260px) minmax(0, 1fr); }
.hstep { grid-template-columns: minmax(250px, 310px) minmax(0, 1fr); gap: 24px; }
@media (max-width: 1180px) {
  .hstep { grid-template-columns: 1fr; gap: 16px; }
  .hstep-text { display: grid; grid-template-columns: 60px 1fr; column-gap: 14px; align-items: center; }
  .hstep-text .hnum { margin: 0; grid-row: 1; }
  .hstep-text h3 { grid-column: 2; }
  .hstep-text .htext, .hstep-text .htip { grid-column: 1 / -1; }
}
@media (max-width: 1000px) { .help-grid { grid-template-columns: 1fr; } }

/* ---------- 說明頁（改版）：功能標籤橫排 + 全闊卡片；截圖細細個，切換步驟高度唔變 ---------- */
.help-tags ul { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; padding: 0; }
.help-tag { display: inline-flex; align-items: baseline; gap: 10px; min-height: 52px; align-items: center; padding: 0 20px; border-radius: 999px; background: var(--surface); border: 2px solid var(--line-strong); color: var(--text); font-size: 1.1875rem; font-weight: 700; text-decoration: none; }
.help-tag small { font-size: 1rem; font-weight: 500; color: var(--text-2); }
.help-tag[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.help-tag[aria-current="page"] small { color: rgba(255, 255, 255, 0.85); }
.help-tag.is-soon { background: transparent; border-style: dashed; color: var(--text-2); font-weight: 500; }
@media (hover: hover) { a.help-tag:not([aria-current]):hover { background: var(--surface-2); } }
.help-grid { display: block; }
.help-card { padding: 22px 28px 22px; }
.hstep { grid-template-columns: minmax(260px, 1fr) minmax(0, 1.1fr); gap: 32px; align-items: center; min-height: 340px; }
.hshot-area { display: flex; align-items: center; justify-content: flex-start; height: 340px; }
.hshot { display: inline-block; max-width: 100%; }
.hshot img { display: block; max-width: 100%; max-height: 330px; width: auto; height: auto; }
@media (max-width: 900px) {
  .hstep { grid-template-columns: 1fr; gap: 16px; min-height: 0; }
  .hshot-area { height: auto; }
  .hshot img { max-height: 300px; }
}
/* 說明頁：再矮少少，一個畫面（約 900px 高）就睇晒 */
.hstep { min-height: 300px; }
.hshot-area { height: 300px; }
.hshot img { max-height: 290px; }
.help-card { padding: 18px 28px 18px; }
.help-card .help-head .muted { margin-bottom: 0; }

/* 說明頁：截圖填滿右邊位置（截圖已裁成闊身比例，所以每步高度一致） */
.hstep { grid-template-columns: minmax(260px, 1fr) minmax(0, 1.15fr); }
.hshot-area { display: block; height: auto; }
.hshot { display: block; width: 100%; }
.hshot img { width: 100%; max-height: none; }
@media (max-width: 900px) { .hshot img { max-height: none; } }

/* 說明頁：左邊功能側欄 + 右邊一步一頁（側欄 260px；截圖闊啲，補返因側欄減少嘅位置） */
.help-grid { display: grid; grid-template-columns: minmax(230px, 260px) minmax(0, 1fr); gap: 16px; align-items: start; }
.help-nav { margin: 0; padding: 16px 12px; }
.help-nav h2 { font-size: 1rem; font-weight: 700; color: var(--text-2); margin: 4px 14px 8px; }
.hstep { grid-template-columns: minmax(240px, 0.85fr) minmax(0, 1.3fr); gap: 28px; min-height: 270px; }
.hshot-area { height: auto; }
@media (max-width: 1000px) {
  .help-grid { grid-template-columns: 1fr; }
  .help-nav ul { display: flex; flex-wrap: wrap; gap: 8px; }
}
@media (max-width: 900px) { .hstep { grid-template-columns: 1fr; min-height: 0; } }
.hstep { min-height: 340px; }
@media (max-width: 900px) { .hstep { min-height: 0; } }

/* ---------- 說明頁：列印版入口 ---------- */
.help-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.help-title-row .btn { flex: none; }

/* ---------- 說明（列印版）：每個項目一頁 A4 ---------- */
.help-print { background: var(--bg); }
.pp-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 16px; padding-bottom: 8px; }
.pp-page { max-width: 794px; margin: 18px auto; padding: 36px 40px; background: #fff; color: #111; border-radius: 6px; box-shadow: var(--shadow); }
.pp-brand { font-size: 1rem; font-weight: 600; color: #475569; }
.pp-head h2 { font-size: 1.875rem; font-weight: 800; margin: 4px 0 2px; color: #0b1340; }
.pp-head h2 small { margin-left: 12px; font-size: 1rem; font-weight: 500; color: #475569; }
.pp-intro { font-size: 1.0625rem; color: #334155; margin-bottom: 14px; }
.pp-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.pp-step { border: 1.5px solid #cbd5e1; border-radius: 12px; padding: 12px 14px; break-inside: avoid; display: grid; gap: 8px; align-content: start; }
.pp-text h3 { display: inline; font-size: 1.125rem; font-weight: 800; color: #0b1340; margin-left: 8px; vertical-align: middle; }
.pp-num { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #0a5cad; color: #fff; font-weight: 800; vertical-align: middle; }
.pp-text p { margin-top: 6px; font-size: 1rem; line-height: 1.5; color: #1e293b; }
.pp-tip { padding: 6px 10px; border-radius: 8px; background: #fff6df; border: 1px solid #e8a317; font-size: 1rem; }
.pp-step .hshot { box-shadow: none; border-color: #cbd5e1; }
.pp-foot { margin-top: 14px; font-size: 1rem; color: #475569; text-align: right; }
@media print {
  @page { size: A4 portrait; margin: 10mm; }
  .help-print { background: #fff; }
  .no-print { display: none !important; }
  .pp-page { max-width: none; margin: 0; padding: 0; box-shadow: none; border-radius: 0; break-after: page; }
  .pp-page:last-of-type { break-after: auto; }
  .pp-head h2 { font-size: 22pt; }
  .pp-text p, .pp-tip, .pp-intro { font-size: 10.5pt; }
  .pp-text h3 { font-size: 12pt; }
  .hmark { border-width: 2.5px; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
/* 列印版：5 個步驟都要放得落一頁 A4 */
@media print {
  @page { size: A4 portrait; margin: 8mm; }
  .pp-head h2 { font-size: 18pt; margin: 2pt 0 0; }
  .pp-head h2 small { font-size: 10pt; }
  .pp-brand { font-size: 8.5pt; }
  .pp-intro { font-size: 10pt; margin-bottom: 6pt; }
  .pp-steps { gap: 7pt 8pt; }
  .pp-step { padding: 6pt 7pt; gap: 4pt; border-radius: 8pt; }
  .pp-num { width: 20pt; height: 20pt; font-size: 10.5pt; }
  .pp-text h3 { font-size: 11pt; margin-left: 5pt; }
  .pp-text p, .pp-tip { font-size: 9.5pt; margin-top: 3pt; line-height: 1.4; }
  .pp-tip { padding: 3pt 6pt; }
  .pp-foot { margin-top: 4pt; font-size: 8.5pt; }
  .hmark b { width: 15pt; height: 15pt; font-size: 9pt; left: -6pt; top: -7pt; }
}

/* ---------- 手機 / 平板後台：底部分頁列（總覽 / 活動設定 / 說明 / 登出）+ 頂部右上角外觀圖示（≤820px）---------- */
.tabbar { display: none; }
@media (max-width: 820px) {
  .topnav, .topbar-actions .help-btn, .topbar-actions .logout-top { display: none; }
  /* 導覽搬咗落底部，頂部只剩標誌 + 名稱（左）同外觀圖示（右）*/
  .topbar-inner { justify-content: space-between; }
  .brand { min-width: 0; }
  .topbar-inner .brand span:last-child { display: inline; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .admin { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }

  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--glass); border-top: 1px solid var(--line);
    -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  }
  .tabbar .tab {
    flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 64px; padding: 8px 4px; color: var(--text-2); font: inherit; font-size: 1rem; font-weight: 650; line-height: 1.2;
    text-decoration: none; cursor: pointer; border: 0; background: transparent; -webkit-tap-highlight-color: transparent;
    transition: color 140ms, transform 120ms var(--ease);
  }
  .tabbar .tab:active { transform: scale(0.96); }
  .tabbar .tab svg { width: 26px; height: 26px; flex: none; }
  .tabbar .tab[aria-current="page"] { color: var(--accent-text); font-weight: 750; }
  .tabbar .tab[aria-current="page"] svg { stroke-width: 2.4; }
  .tab-form { flex: 1; min-width: 0; display: flex; margin: 0; }
  .tabbar .tab-logout { width: 100%; color: var(--bad); }
}
.topbar-actions .theme-switch { margin-left: 4px; }
@media (prefers-reduced-transparency: reduce) { .tabbar { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; } }
@media print { .tabbar { display: none !important; } }

/* ---------- 活動詳情：各題統計（可展開）---------- */
.q-list-title { margin: 28px 0 -4px; font-size: 1.5rem; font-weight: 750; letter-spacing: -0.01em; }
.qcard { padding: 0; overflow: hidden; }
.admin .qcard > :not(summary) { margin-left: 20px; margin-right: 20px; }
.admin .qcard > :last-child { margin-bottom: 20px; }
.qsum {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 24px; align-items: center; gap: 12px;
  min-height: 64px; padding: 14px 20px; cursor: pointer; list-style: none; -webkit-tap-highlight-color: transparent;
}
.qsum::-webkit-details-marker { display: none; }
.qsum h2 { margin: 0; }
.qsum-val { font-size: 1.375rem; font-weight: 750; white-space: nowrap; font-variant-numeric: tabular-nums; }
.qsum-val small { font-size: 1rem; font-weight: 500; color: var(--text-2); }
.qsum-chev { width: 24px; height: 24px; color: var(--text-2); transition: transform 200ms var(--ease); }
.qcard[open] > .qsum .qsum-val { display: none; } /* 展開後，重點數字喺內文已經有大字 */
.qcard[open] > .qsum .qsum-chev { transform: rotate(180deg); }
.qcard[open] > .qsum { padding-bottom: 8px; }
@media (hover: hover) { .qsum:hover { background: var(--surface-2); } }
@media (prefers-reduced-motion: reduce) { .qsum-chev { transition: none; } }
.manage-grid > * { min-width: 0; }

/* ---------- 可收埋區塊（篩選、新增活動）---------- */
.fsum {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 24px; align-items: center; gap: 12px;
  min-height: 64px; padding: 14px 20px; cursor: pointer; list-style: none; -webkit-tap-highlight-color: transparent;
}
.fsum::-webkit-details-marker { display: none; }
.fsum h2 { margin: 0; }
.fsum-val { font-size: 1rem; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.fold[open] > .fsum .fsum-val { display: none; }
.fold[open] > .fsum .qsum-chev { transform: rotate(180deg); }
.fold[open] > .fsum { padding-bottom: 8px; }
@media (hover: hover) { .fsum:hover { background: var(--surface-2); } }
@media (min-width: 821px) {
  /* 電腦版：一直展開，唔使收埋 */
  .fold > .fsum { cursor: default; pointer-events: none; grid-template-columns: minmax(0, 1fr); }
  .fold > .fsum .qsum-chev { display: none; }
}
.setup.fold { padding: 0; overflow: hidden; }
.admin .setup.fold > :not(summary) { margin-left: 20px; margin-right: 20px; }
.admin .setup.fold > :last-child { margin-bottom: 20px; }
.setup.fold.is-edit { padding-top: 20px; }
.setup.fold.is-edit > .fsum { display: none; }
.filters.card { overflow: hidden; }

/* ---------- 場次卡片（手機 / 平板 ≤820px 取代表格，唔使左右捲動）---------- */
.ev-cards-wrap, .ev-cards { display: none; }
.ev-cards { list-style: none; margin: 0; padding: 0; gap: 12px; }
.evc {
  display: grid; gap: 6px; padding: 16px 18px; border-radius: var(--radius); color: var(--text); text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); -webkit-tap-highlight-color: transparent;
}
a.evc { transition: transform 120ms var(--ease), background-color 140ms; }
a.evc:active { transform: scale(0.985); }
@media (hover: hover) { a.evc:hover { background: var(--surface-2); } }
.evc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.evc-date { font-size: 1.0625rem; font-weight: 650; color: var(--text-2); font-variant-numeric: tabular-nums; }
.evc-name { font-size: 1.1875rem; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
a.evc .evc-name { color: var(--accent-text); }
.evc-sub, .evc-win { font-size: 1rem; color: var(--text-2); line-height: 1.45; }
.evc-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.evc-nums > span { display: grid; gap: 2px; align-content: start; justify-items: start; min-width: 0; }
.evc-nums small { font-size: 1rem; color: var(--text-2); }
.evc-nums b { font-size: 1.5rem; font-weight: 750; line-height: 1.15; font-variant-numeric: tabular-nums; }
.evc-nums em { font-size: 1rem; font-style: normal; color: var(--text-2); }
.evc-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.evc-resp { font-size: 1.0625rem; color: var(--text-2); }
.evc-resp b { color: var(--text); font-size: 1.25rem; }
@media (max-width: 820px) {
  .ev-table { display: none; }
  .ev-cards-wrap.card { display: block; background: none; border: 0; box-shadow: none; padding: 0; margin: 0; }
  .ev-cards { display: grid; }
  .list-col .ev-cards { margin-top: 4px; }
}

/* ---------- 總覽手機版排序：目標 → KPI → 篩選（收埋）→ 圖 → 場次卡片 → 下載 ---------- */
@media (max-width: 1000px) {
  .ov-grid { gap: 12px; }
  .ov-side, .ov-main { display: contents; }
  .ov-side > *, .ov-main > * { min-width: 0; margin: 0; }
  .ov-side > .goal { order: 1; }
  .ov-main > .kpis, .ov-main > .note { order: 2; }
  .ov-side > .filters { order: 3; }
  .ov-main > .chart-card { order: 4; }
  .ov-main > .ev-cards-wrap, .ov-main > .ev-table { order: 5; }
  .ov-side > .ov-downloads { order: 6; }
}
@media (max-width: 600px) {
  .ov-main .kpis.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-main .kpis.compact .stat-main { grid-column: 1 / -1; }
}

/* ---------- 使用說明：全部步驟由上到下捲動 ---------- */
.hstep { scroll-margin-top: 84px; }
.hstep + .hstep { margin-top: 34px; padding-top: 34px; border-top: 1px solid var(--line); }
.help-cta { margin: 30px 0 0; text-align: center; }
.help-cta .btn { min-width: 220px; }

/* 手機：KPI 格唔使咁高；排序掣四等分一行 */
@media (max-width: 600px) {
  .admin .kpis.compact .stat { min-height: 112px; }
  .admin .kpis.compact .stat-main { min-height: 104px; }
}

/* ---------- 總覽（手機 / 平板 ≤820px）：「篩選」「PDF」「CSV」一行 + 彈出選單 ---------- */
.ov-toolbar { display: none; }
@media (max-width: 820px) {
  .ov-side > .filters, .ov-side > .ov-downloads { display: none; }
  .ov-side > .ov-toolbar { display: flex; order: 3; position: relative; gap: 8px; align-items: center; }
  .ov-toolbar .fmenu { flex: 1.35 1 0; min-width: 0; display: flex; }
  .tbtn {
    flex: 1 1 0; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 52px; padding: 0 10px; border: 0; border-radius: 999px; list-style: none; cursor: pointer;
    background: var(--accent-tint); color: var(--accent-text); font: inherit; font-size: 1rem; font-weight: 700; text-decoration: none; white-space: nowrap;
    -webkit-tap-highlight-color: transparent; transition: background-color 160ms, color 160ms, transform 120ms var(--ease);
  }
  .tbtn::-webkit-details-marker { display: none; }
  .tbtn:active { transform: scale(0.97); }
  .tbtn svg { width: 20px; height: 20px; flex: none; }
  .fmenu > .tbtn { width: 100%; }
  .fmenu[open] > .tbtn-main { background: var(--accent); color: #fff; }
  .tcount { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; background: var(--accent); color: #fff; font-style: normal; font-size: 1rem; font-weight: 750; line-height: 1; }
  .fmenu[open] .tcount { background: #fff; color: var(--accent); }

  /* 彈出選單：由「篩選」掣下面彈出，四個選項逐個彈入（好似電視選單）*/
  .fmenu-panel {
    position: absolute; left: 0; right: 0; top: calc(100% + 10px); z-index: 25;
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 14px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.28);
    transform-origin: 18% 0; animation: fmenu-in 200ms var(--ease) both;
  }
  .fopt {
    display: grid; gap: 2px; align-content: center; min-width: 0; min-height: 68px; padding: 8px 14px; border-radius: 16px;
    background: var(--surface-2); color: var(--text); text-decoration: none;
    animation: fopt-in 260ms var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms + 70ms);
  }
  .fopt > span { font-size: 1rem; font-weight: 600; color: var(--text-2); }
  .fopt select, .fopt input[type="date"] {
    width: 100%; min-width: 0; min-height: 32px; padding: 0; border: 0; border-radius: 0; background: transparent; color: inherit;
    font: inherit; font-size: 1.0625rem; font-weight: 700; outline: none;
  }
  .fopt.on { background: var(--accent-tint); }
  .fopt.on > span, .fopt.on select, .fopt.on input { color: var(--accent-text); }
  .fopt:focus-within { outline: 3px solid var(--accent-text); outline-offset: 2px; }
  .fopt-clear { grid-column: 1 / -1; justify-content: center; text-align: center; min-height: 54px; background: var(--bad-bg); color: var(--bad); font-weight: 700; font-size: 1.0625rem; }
  .fopt-apply { grid-column: 1 / -1; }
  .js .fopt-apply { display: none; }
}
@keyframes fmenu-in { from { opacity: 0; transform: translateY(-8px) scale(0.96); } }
@keyframes fopt-in { from { opacity: 0; transform: translateY(-8px) scale(0.9); } }
@media (prefers-reduced-motion: reduce) { .fmenu-panel, .fopt { animation: none; } }

/* ---------- 使用說明（手機 / 平板 ≤820px）：每步一張卡，左右撥動，下一張露出一截 ---------- */
.hpos { display: none; }
@media (max-width: 820px) {
  .hpos {
    display: block; position: sticky; top: 72px; z-index: 5; width: max-content; margin: 14px 0 10px; padding: 6px 16px; border-radius: 999px;
    background: var(--accent-tint); color: var(--accent-text); font-size: 1.0625rem; font-weight: 750; font-variant-numeric: tabular-nums;
  }
  .hsteps {
    position: relative; /* 入面 sr-only（絕對定位）要被裁切，否則會撐闊成頁 */

    display: flex; gap: 12px; align-items: stretch; margin: 0 -16px; padding: 4px 16px 10px;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px; overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .hsteps::-webkit-scrollbar { display: none; }
  .hsteps:focus-visible { outline: 3px solid var(--accent-text); outline-offset: -3px; }
  .hsteps > .hstep, .hsteps > .hstep + .hstep {
    flex: 0 0 86%; min-width: 0; margin: 0; padding: 16px; scroll-snap-align: start; scroll-snap-stop: always;
    border: 1px solid var(--line); border-radius: 20px; background: var(--surface-2);
  }
  .hsteps > .hstep .hshot { background: #fff; }
}

/* 說明頁單欄：minmax(0,…) 先唔會俾橫向捲動區撐闊成頁 */
.help-card, .help-nav { min-width: 0; }
@media (max-width: 1000px) { .help-grid { grid-template-columns: minmax(0, 1fr); } }

/* 使用說明（手機 / 平板）：步驟卡直接放喺頁面底色上，撥動區貼住螢幕左右邊；每張卡跟自己內容高度 */
@media (max-width: 820px) {
  .help-card.card { background: none; border: 0; box-shadow: none; padding: 0; margin: 0; }
  .help-head { padding: 0 2px; }
  .hsteps { align-items: flex-start; }
}

/* ---------- 排序選單（手機 / 平板）：同篩選一樣，一個 badge 掣，撳開選項逐個彈出 ---------- */
@media (max-width: 820px) {
  .smenu { position: relative; display: flex; justify-content: flex-end; margin: 0 0 12px; } /* 排序掣靠右 */
  .smenu > .tbtn { display: inline-flex; flex: 0 0 auto; width: auto; justify-content: flex-start; padding: 0 20px; }
  .smenu .fmenu-panel { top: calc(100% + 8px); }
  .fopt-link { justify-content: center; align-content: center; text-align: center; min-height: 58px; font-size: 1.0625rem; font-weight: 700; }
  .fopt-link.on { color: var(--accent-text); }
}

/* 排序 / 篩選後局部更新：載入中輕輕淡出，新內容淡入（唔會跳返頂部）*/
.ov-grid { transition: opacity 140ms ease; }
.ov-grid.is-loading { opacity: 0.55; pointer-events: none; }
.ov-grid.is-fresh { animation: ov-fresh 240ms var(--ease) both; }
@keyframes ov-fresh { from { opacity: 0.55; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .ov-grid, .ov-grid.is-fresh { transition: none; animation: none; } }
