/* ==========================================================================
   櫻坂46 FanHub UI  v0.1  (2026-10-04)
   設計提案，尚未經設計部與 QA 驗收。只適用 櫻坂46 FanHub，不跨站共用檔案。

   形狀沿用 Wanson 提供的參考檔 ui-proposal-2026-10-04（Index Fold R02）：
     - 左上角的摺角
     - 右側的團體色標籤：預設 0px、hover +2px、pressed -2px
     - 票根
   和參考檔不同的地方：
     - 玫紅換成團體色（櫻色），顏色全部改成變數
     - 加上深色外觀（線上版本來就有深色切換）
     - 加上照片框（成員照、封面、影片縮圖），照片讀不到時退回字卡
     - 主要導覽改成五項

   命名：fb- 是按鈕，fh- 是版面與其他元件。變數一律 --fh-*。
   圖示一律用內嵌 SVG，不需要圖示字型。
   ========================================================================== */

:root {
  --fh-ink: #111216;   /* 文字、主按鈕 */
  --fh-on-ink: #ffffff;
  --fh-paper: #f4f1ea;   /* 頁面底色 */
  --fh-surface: #fffdf9;   /* 卡片、輸入框 */
  --fh-surface-2: #ece8df;   /* 標籤、分段切換底 */
  --fh-rule: #d7d3ca;
  --fh-rule-strong: #b9b4a9;
  --fh-muted: #5b5d64;   /* 輔助文字 */
  --fh-hover: #f0ece3;
  --fh-press: #e6e1d7;
  --fh-disabled-bg: #e9e5dc;
  --fh-disabled-fg: #74767c;
  --fh-disabled-line: #c9c5bc;
  --fh-placeholder: #6f7178;
  --fh-faint: #8e8c86;
  --fh-skel: #f6f3ec;
  --fh-accent: #f2a0b9;   /* 團體色色塊，上面的字用墨色 */
  --fh-accent-hover: #ec8aa9;
  --fh-accent-press: #e27699;
  --fh-accent-ink: #a42e5d;   /* 團體文字色：連結、焦點框 */
  --fh-accent-soft: #fde3eb;   /* 已選取的淡底 */
  --fh-ok: #1d6b46;
  --fh-ok-soft: #dff1e6;
  --fh-warn: #6b4a00;
  --fh-warn-soft: #fff0bc;
  --fh-danger: #a2330f;
  --fh-danger-soft: #fce7da;
  --fh-info: #1b5e8c;
  --fh-info-soft: #e1eff9;
  --fh-on-accent: #111216;        /* 團體色底上的字，深淺外觀都用墨色 */
  --fh-scrim: rgba(17, 18, 22, .56);

  --fh-h: 48px;                   /* 主要按鈕高度 */
  --fh-h-sm: 44px;                /* 最小點擊高度 */
  --fh-cut: 10px;                 /* 摺角大小 */
  --fh-tab: 8px;                  /* 右側標籤凸出的寬度 */
  --fh-stub: 52px;                /* 票根右段寬度 */
  --fh-font: Inter, "Noto Sans TC", "Noto Sans JP", system-ui, sans-serif;
  --fh-display: "Inter Tight", "Noto Sans TC", "Noto Sans JP", sans-serif;
  --fh-mono: "IBM Plex Mono", ui-monospace, monospace;
  --fh-fast: 160ms;
  --fh-ease: cubic-bezier(.2, .8, .2, 1);

  /* 字級只有六級 */
  --fh-fs-12: 12px;  --fh-fs-14: 14px;  --fh-fs-16: 16px;
  --fh-fs-20: 20px;  --fh-fs-28: 28px;  --fh-fs-40: 40px;

  /* 間距 */
  --fh-s1: 4px;  --fh-s2: 8px;  --fh-s3: 12px;  --fh-s4: 16px;
  --fh-s5: 24px; --fh-s6: 32px; --fh-s7: 48px;  --fh-s8: 64px;

  --fh-gutter: 20px;
  --fh-max: 1120px;
  --fh-header: 56px;
  --fh-bottomnav: 64px;
  color-scheme: light;
}

/* 深色外觀：使用者在「我的」選了深色，或選「跟隨系統」而系統是深色。
   .fh-ink 是淺色外觀裡的墨色區塊（例如首頁的歡迎區塊），裡面的元件自動換成深色配色。 */
:root[data-theme="dark"],
.fh-ink {
  --fh-ink: #f4f1ea;
  --fh-on-ink: #111216;
  --fh-paper: #111216;
  --fh-surface: #1a1b20;
  --fh-surface-2: #25262c;
  --fh-rule: #34353c;
  --fh-rule-strong: #55575f;
  --fh-muted: #a9abb1;
  --fh-hover: #22232a;
  --fh-press: #2c2d34;
  --fh-disabled-bg: #25262c;
  --fh-disabled-fg: #8a8c92;
  --fh-disabled-line: #44454c;
  --fh-placeholder: #9a9ca2;
  --fh-faint: #74767c;
  --fh-skel: #2c2d34;
  --fh-accent: #f2a0b9;
  --fh-accent-hover: #f7b5c9;
  --fh-accent-press: #ec8aa9;
  --fh-accent-ink: #f4b8d0;
  --fh-accent-soft: #3a2230;
  --fh-ok: #7fd1a6;
  --fh-ok-soft: #16301f;
  --fh-warn: #f0c860;
  --fh-warn-soft: #352a08;
  --fh-danger: #ffab85;
  --fh-danger-soft: #3b1d10;
  --fh-info: #8cc8f0;
  --fh-info-soft: #152c3d;
}
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fh-ink: #f4f1ea;
    --fh-on-ink: #111216;
    --fh-paper: #111216;
    --fh-surface: #1a1b20;
    --fh-surface-2: #25262c;
    --fh-rule: #34353c;
    --fh-rule-strong: #55575f;
    --fh-muted: #a9abb1;
    --fh-hover: #22232a;
    --fh-press: #2c2d34;
    --fh-disabled-bg: #25262c;
    --fh-disabled-fg: #8a8c92;
    --fh-disabled-line: #44454c;
    --fh-placeholder: #9a9ca2;
    --fh-faint: #74767c;
    --fh-skel: #2c2d34;
    --fh-accent: #f2a0b9;
    --fh-accent-hover: #f7b5c9;
    --fh-accent-press: #ec8aa9;
    --fh-accent-ink: #f4b8d0;
    --fh-accent-soft: #3a2230;
    --fh-ok: #7fd1a6;
    --fh-ok-soft: #16301f;
    --fh-warn: #f0c860;
    --fh-warn-soft: #352a08;
    --fh-danger: #ffab85;
    --fh-danger-soft: #3b1d10;
    --fh-info: #8cc8f0;
    --fh-info-soft: #152c3d;
    color-scheme: dark;
  }
}

/* --------------------------------------------------------------------------
   按鈕基底
   -------------------------------------------------------------------------- */
.fb-btn {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  min-height: var(--fh-h);
  min-width: 44px;
  margin: 0;
  padding: 0 20px;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--_fg, var(--fh-ink));
  font: 700 15px/1.2 var(--fh-font);
  letter-spacing: .02em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--fh-fast) var(--fh-ease), color var(--fh-fast) var(--fh-ease);
}

/* 底色放在 ::before，摺角只裁這一層，焦點框與右側標籤不會被裁掉 */
.fb-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: var(--_bg, transparent);
  clip-path: var(--_clip, none);
  transition: background-color var(--fh-fast) var(--fh-ease);
}

.fb-btn svg {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fb-btn:focus-visible {
  outline: 3px solid var(--fh-accent-ink);
  outline-offset: 3px;
}

.fb-btn:active { transform: translateY(1px); }

.fb-btn:disabled,
.fb-btn[aria-disabled="true"] {
  --_bg: var(--fh-disabled-bg);
  --_fg: var(--fh-disabled-fg);
  --_tab: var(--fh-disabled-line);
  cursor: not-allowed;
  pointer-events: none;
}

/* 尺寸 */
.fb-sm { min-height: var(--fh-h-sm); padding: 0 16px; font-size: 14px; }
.fb-block { display: flex; width: 100%; }

/* 讀取中：<button aria-busy="true"><span class="fb-spin" aria-hidden="true"></span>文字</button> */
.fb-spin { display: none; }
.fb-btn[aria-busy="true"] { cursor: progress; pointer-events: none; }
.fb-btn[aria-busy="true"] .fb-spin {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: fb-spin .7s linear infinite;
}
@keyframes fb-spin { to { transform: rotate(360deg); } }

/* 摺角形狀：一律左上角 */
.fb-tab,
.fb-cut,
.fb-oshi {
  --_clip: polygon(var(--fh-cut) 0, 100% 0, 100% 100%, 0 100%, 0 var(--fh-cut));
}

/* --------------------------------------------------------------------------
   A  INDEX TAB：主按鈕。每個畫面最多一顆。
   <button class="fb-btn fb-tab">選一位推し</button>
   -------------------------------------------------------------------------- */
.fb-tab {
  --_bg: var(--fh-ink);
  --_fg: var(--fh-on-ink);
  margin-inline-end: calc(var(--fh-tab) + 2px);   /* 預留標籤與 hover 位移 */
}
.fb-tab::after {
  content: "";
  position: absolute;
  top: 50%;
  right: calc(var(--fh-tab) * -1);
  width: var(--fh-tab);
  height: 46%;
  background: var(--_tab, var(--fh-accent));
  clip-path: polygon(0 0, 100% 14%, 100% 86%, 0 100%);
  transform: translate(0, -50%);
  transition: transform var(--fh-fast) var(--fh-ease);
}
.fb-tab:active::after { transform: translate(-2px, -50%); }   /* pressed -2px */
.fb-tab.fb-block { width: calc(100% - var(--fh-tab) - 2px); }

/* --------------------------------------------------------------------------
   B  INDEX CUT：團體色實心。同一區塊裡第二重要的動作，例如「套用」。
   <button class="fb-btn fb-cut">套用</button>
   線框版：<button class="fb-btn fb-cut fb-outline">編輯</button>
   -------------------------------------------------------------------------- */
.fb-cut {
  --_bg: var(--fh-accent);
  --_fg: var(--fh-on-accent);
}
.fb-cut:active { --_bg: var(--fh-accent-press); }

.fb-outline {
  --_bg: var(--fh-ink);            /* 這一層當邊框 */
  --_fg: var(--fh-ink);
  --_inner: var(--fh-surface);
}
.fb-outline::after {
  content: "";
  position: absolute;
  inset: 1.5px;
  z-index: -1;
  background-color: var(--_inner);
  clip-path: polygon(calc(var(--fh-cut) - .9px) 0, 100% 0, 100% 100%, 0 100%, 0 calc(var(--fh-cut) - .9px));
  transition: background-color var(--fh-fast) var(--fh-ease);
}
.fb-outline:active { --_bg: var(--fh-ink); --_inner: var(--fh-press); }
.fb-outline:disabled,
.fb-outline[aria-disabled="true"] { --_bg: var(--fh-disabled-line); --_inner: var(--fh-disabled-bg); }

/* --------------------------------------------------------------------------
   C  ARCHIVE TICKET：票根。只用在「加入我的行程」這類和行程有關的操作。
   <button class="fb-btn fb-ticket" aria-pressed="false">
     <span class="fb-ticket__label"><span class="fb-when-off">加入我的行程</span><span class="fb-when-on">已加入行程</span></span>
     <span class="fb-ticket__stub" aria-hidden="true">
       <svg class="fb-when-off" viewBox="0 0 24 24"><path d="M12 5v14M5 12h14"/></svg>
       <svg class="fb-when-on" viewBox="0 0 24 24"><path d="M5 12.5l4.5 4.5L19 7.5"/></svg>
     </span>
   </button>
   -------------------------------------------------------------------------- */
.fb-ticket {
  --_bg: var(--fh-ink);
  --_fg: var(--fh-on-ink);
  --_stub-fg: var(--fh-accent);
  --_n: 6px;                       /* 缺口半徑 */
  padding: 0;
  gap: 0;
  align-items: stretch;
}
.fb-ticket::before {
  -webkit-mask:
    radial-gradient(circle var(--_n) at calc(100% - var(--fh-stub)) 0, #0000 calc(var(--_n) - .5px), #000 var(--_n)),
    radial-gradient(circle var(--_n) at calc(100% - var(--fh-stub)) 100%, #0000 calc(var(--_n) - .5px), #000 var(--_n));
  -webkit-mask-composite: source-in;
  mask:
    radial-gradient(circle var(--_n) at calc(100% - var(--fh-stub)) 0, #0000 calc(var(--_n) - .5px), #000 var(--_n)),
    radial-gradient(circle var(--_n) at calc(100% - var(--fh-stub)) 100%, #0000 calc(var(--_n) - .5px), #000 var(--_n));
  mask-composite: intersect;
}
.fb-ticket__label {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  gap: 8px;
  padding: 0 18px;
}
.fb-ticket__stub {
  display: grid;
  place-items: center;
  flex: 0 0 var(--fh-stub);
  box-sizing: border-box;
  margin: var(--_n) 0;
  border-left: 1.5px dashed currentColor;
  border-image: repeating-linear-gradient(to bottom, color-mix(in srgb, currentColor 55%, transparent) 0 4px, transparent 4px 8px) 1;
  color: inherit;
}
.fb-ticket__stub svg {
  color: var(--_stub-fg);
  transition: transform var(--fh-fast) var(--fh-ease);
}
.fb-ticket[aria-pressed="true"] { --_bg: var(--fh-accent); --_fg: var(--fh-on-accent); --_stub-fg: var(--fh-on-accent); }
.fb-ticket:disabled,
.fb-ticket[aria-disabled="true"] { --_stub-fg: var(--fh-disabled-fg); }

/* 切換用：依 aria-pressed 顯示其中一個 */
.fb-btn[aria-pressed="true"] .fb-when-off,
.fb-btn:not([aria-pressed="true"]) .fb-when-on { display: none; }

/* --------------------------------------------------------------------------
   D  安靜的次要操作
   <a class="fb-btn fb-ghost" href="…" target="_blank" rel="noopener">看官方公告 <svg…外連圖示/></a>
   <a class="fb-btn fb-link" href="#">看完整行程（108）</a>
   -------------------------------------------------------------------------- */
.fb-ghost {
  --_fg: var(--fh-ink);
  min-height: var(--fh-h-sm);
  box-shadow: inset 0 0 0 1.5px var(--fh-ink);
}
.fb-ghost:active { --_bg: var(--fh-press); }
.fb-ghost:disabled,
.fb-ghost[aria-disabled="true"] { box-shadow: inset 0 0 0 1.5px var(--fh-disabled-line); }

.fb-link {
  --_fg: var(--fh-accent-ink);
  min-height: var(--fh-h-sm);
  padding: 0 4px;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 5px;
}
.fb-link:active { --_fg: var(--fh-ink); }
.fb-link:disabled,
.fb-link[aria-disabled="true"] { --_bg: transparent; text-decoration: none; }

/* 清單列：整列可點，右側箭頭 hover +2px */
.fb-row {
  display: flex;
  width: 100%;
  min-height: 64px;
  padding: 12px 4px;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--fh-rule);
  font-weight: 500;
  text-align: left;
  white-space: normal;
}
.fb-row__main { display: grid; gap: 2px; min-width: 0; }
.fb-row__main b { font-weight: 700; }
.fb-row__main span { color: var(--fh-muted); font-size: 14px; }
.fb-row svg { color: var(--fh-accent-ink); transition: transform var(--fh-fast) var(--fh-ease); }
.fb-row:active { --_bg: var(--fh-press); transform: none; }

/* --------------------------------------------------------------------------
   推し切換：還沒加入是線框，加入後變成墨色底加團體色標籤
   <button class="fb-btn fb-oshi" aria-pressed="false">
     <span class="fb-when-off"><svg …愛心/>加入推し</span>
     <span class="fb-when-on"><svg …打勾/>我的推し</span>
   </button>
   -------------------------------------------------------------------------- */
.fb-oshi {
  --_bg: var(--fh-ink);
  --_fg: var(--fh-ink);
  --_inner: var(--fh-surface);
  min-height: var(--fh-h-sm);
  min-width: 120px;
  padding: 0 16px;
  margin-inline-end: calc(var(--fh-tab) + 2px);
  font-size: 14px;
}
.fb-oshi > span { display: inline-flex; align-items: center; gap: 6px; }
.fb-oshi svg { width: 18px; height: 18px; }
.fb-oshi::after {
  content: "";
  position: absolute;
  inset: 1.5px;
  z-index: -1;
  background-color: var(--_inner);
  clip-path: polygon(calc(var(--fh-cut) - .9px) 0, 100% 0, 100% 100%, 0 100%, 0 calc(var(--fh-cut) - .9px));
  transition: background-color var(--fh-fast) var(--fh-ease), transform var(--fh-fast) var(--fh-ease);
}
.fb-oshi:active { --_inner: var(--fh-press); }
.fb-oshi[aria-pressed="true"] { --_fg: var(--fh-on-ink); }
.fb-oshi[aria-pressed="true"]::after {
  inset: auto;
  top: 50%;
  right: calc(var(--fh-tab) * -1);
  z-index: 0;
  width: var(--fh-tab);
  height: 46%;
  background-color: var(--_tab, var(--fh-accent));
  clip-path: polygon(0 0, 100% 14%, 100% 86%, 0 100%);
  transform: translate(0, -50%);
}
.fb-oshi[aria-pressed="true"]:active::after { transform: translate(-2px, -50%); }
.fb-oshi:disabled,
.fb-oshi[aria-disabled="true"] { --_bg: var(--fh-disabled-line); --_inner: var(--fh-disabled-bg); }

/* --------------------------------------------------------------------------
   圖示鈕：一定要有 aria-label
   <button class="fb-btn fb-icon" aria-label="把 金村 美玖 加入推し" aria-pressed="false"><svg …/></button>
   -------------------------------------------------------------------------- */
.fb-icon {
  width: 44px;
  min-height: 44px;
  padding: 0;
  box-shadow: inset 0 0 0 1.5px var(--fh-rule);
}
.fb-icon svg { width: 22px; height: 22px; }
.fb-icon:active { --_bg: var(--fh-press); }
.fb-icon[aria-pressed="true"] { --_fg: var(--fh-accent-ink); box-shadow: inset 0 0 0 1.5px var(--fh-accent-ink); --_bg: var(--fh-accent-soft); }
.fb-icon[aria-pressed="true"] svg { fill: currentColor; }
.fb-icon--plain { box-shadow: none; }

/* --------------------------------------------------------------------------
   篩選：單選或多選都用 aria-pressed
   <button class="fb-btn fb-chip" aria-pressed="true">全部</button>
   -------------------------------------------------------------------------- */
.fb-chip {
  min-height: var(--fh-h-sm);
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: inset 0 0 0 1.5px var(--fh-rule);
  --_bg: var(--fh-surface);
}
.fb-chip[aria-pressed="true"] { --_bg: var(--fh-ink); --_fg: var(--fh-on-ink); box-shadow: none; }
.fb-chip[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 3px;
  background: var(--fh-accent);
}

/* --------------------------------------------------------------------------
   Hover：只在有滑鼠的裝置上生效，避免手機點完還停在 hover 樣式
   -------------------------------------------------------------------------- */
@media (hover: hover) {
  .fb-tab:hover::after { transform: translate(2px, -50%); }                 /* hover +2px */
  .fb-tab:active::after { transform: translate(-2px, -50%); }
  .fb-cut:not(.fb-outline):hover { --_bg: var(--fh-accent-hover); }
  .fb-cut:not(.fb-outline):active { --_bg: var(--fh-accent-press); }
  .fb-outline:hover { --_inner: var(--fh-hover); }
  .fb-outline:active { --_inner: var(--fh-press); }
  .fb-ticket:hover .fb-ticket__stub svg { transform: translateX(2px); }
  .fb-ghost:hover { --_bg: var(--fh-hover); }
  .fb-ghost:active { --_bg: var(--fh-press); }
  .fb-link:hover { text-decoration-thickness: 2.5px; }
  .fb-row:hover { --_bg: var(--fh-hover); }
  .fb-row:hover svg { transform: translateX(2px); }
  .fb-oshi:not([aria-pressed="true"]):hover { --_inner: var(--fh-hover); }
  .fb-oshi[aria-pressed="true"]:hover::after { transform: translate(2px, -50%); }
  .fb-oshi[aria-pressed="true"]:active::after { transform: translate(-2px, -50%); }
  .fb-icon:hover { --_bg: var(--fh-hover); }
  .fb-icon[aria-pressed="true"]:hover { --_bg: var(--fh-accent-soft); }
  .fb-chip:not([aria-pressed="true"]):hover { --_bg: var(--fh-hover); }
}

/* --------------------------------------------------------------------------
   動態與高對比
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .fb-btn, .fb-btn::before, .fb-btn::after, .fb-btn svg { transition: none; }
  .fb-btn:active { transform: none; }
  .fb-btn[aria-busy="true"] .fb-spin { animation-duration: 1.6s; }
}
@media (forced-colors: active) {
  .fb-btn { border: 1px solid ButtonText; }
  .fb-btn::before, .fb-btn::after { forced-color-adjust: none; }
}


/* ==========================================================================
   版面與元件
   ========================================================================== */

/* --------------------------------------------------------------------------
   基礎
   -------------------------------------------------------------------------- */
.fh-app, .fh-app * { box-sizing: border-box; }
.fh-app {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--fh-ink);
  background: var(--fh-paper);
  font: 400 var(--fh-fs-16)/1.6 var(--fh-font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
/* 日文內容一律加 lang="ja"，這樣漢字會用日文字形 */
.fh-app :lang(ja) { font-family: Inter, "Noto Sans JP", "Noto Sans TC", system-ui, sans-serif; }
.fh-app h1, .fh-app h2, .fh-app h3, .fh-app p { margin: 0; }
.fh-app a:not(.fb-btn) { color: inherit; }
.fh-app :focus-visible { outline: 3px solid var(--fh-accent-ink); outline-offset: 3px; }
.fh-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fh-app a.fh-skip { position: absolute; left: 8px; top: -60px; z-index: 100; padding: 12px 16px; color: var(--fh-on-ink); background: var(--fh-ink); font-weight: 700; }
.fh-app a.fh-skip:focus { top: 8px; }

.fh-h1 { font: 800 var(--fh-fs-28)/1.2 var(--fh-display); letter-spacing: -.01em; }
.fh-h2 { font: 800 var(--fh-fs-20)/1.3 var(--fh-display); }
.fh-h3 { font: 700 var(--fh-fs-16)/1.4 var(--fh-font); }
.fh-meta { color: var(--fh-muted); font-size: var(--fh-fs-14); }
.fh-small { font-size: var(--fh-fs-12); color: var(--fh-muted); }
.fh-label { font: 500 var(--fh-fs-12)/1.2 var(--fh-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--fh-muted); }
.fh-num { font-family: var(--fh-display); font-weight: 800; font-variant-numeric: tabular-nums; }
.fh-stack { display: grid; gap: var(--fh-s4); }
.fh-stack--lg { gap: var(--fh-s6); }
.fh-inline { display: flex; flex-wrap: wrap; align-items: center; gap: var(--fh-s3); }
.fh-between { display: flex; align-items: center; justify-content: space-between; gap: var(--fh-s3); }
.fh-hide { display: none !important; }

/* 墨色區塊：淺色外觀裡的深色區塊。左上摺角 24px。一頁最多一個 */
.fh-ink {
  display: grid;
  gap: var(--fh-s4);
  padding: 28px var(--fh-gutter) var(--fh-s5);
  color: var(--fh-ink);
  background: var(--fh-paper);
  clip-path: polygon(24px 0, 100% 0, 100% 100%, 0 100%, 0 24px);
}
:root[data-theme="dark"] .fh-ink { background: var(--fh-surface); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fh-ink { background: var(--fh-surface); } }
.fh-ink .fh-label { color: var(--fh-accent); }
.fh-ink__title { font: 800 var(--fh-fs-28)/1.25 var(--fh-display); }
.fh-ink p { color: var(--fh-muted); max-width: 40ch; }

/* --------------------------------------------------------------------------
   外框：頁首、桌機導覽、手機底部導覽
   -------------------------------------------------------------------------- */
.fh-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--fh-paper);
  border-bottom: 1px solid var(--fh-rule);
}
.fh-header__in {
  display: flex;
  align-items: center;
  gap: var(--fh-s2);
  max-width: var(--fh-max);
  height: var(--fh-header);
  margin: 0 auto;
  padding: 0 var(--fh-gutter);
}
.fh-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-right: var(--fh-s2);
  padding: 0;
  border: 0;
  background: none;
  color: var(--fh-ink);
  font: 800 14px/1.15 var(--fh-display);
  letter-spacing: .14em;
  text-align: left;
  cursor: pointer;
}
.fh-logo svg { width: 30px; height: 28px; flex: none; }
.fh-logo small { display: block; margin-top: 2px; font: 500 var(--fh-fs-12)/1.1 var(--fh-mono); letter-spacing: .14em; color: var(--fh-muted); }
.fh-header__grow { flex: 1 1 auto; }
.fh-nav { display: none; align-items: stretch; height: 100%; gap: var(--fh-s1); }
.fh-nav button, .fh-bottomnav button {
  position: relative;
  border: 0;
  background: none;
  color: var(--fh-muted);
  font: 600 var(--fh-fs-14)/1 var(--fh-font);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.fh-nav button { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; white-space: nowrap; }
.fh-nav button[aria-current="page"], .fh-bottomnav button[aria-current="page"] { color: var(--fh-ink); font-weight: 700; }
.fh-nav button[aria-current="page"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px; background: var(--fh-accent);
}
.fh-nav svg, .fh-bottomnav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.fh-bottomnav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--fh-surface);
  border-top: 1px solid var(--fh-rule);
}
.fh-bottomnav button {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  min-width: 0;
  min-height: var(--fh-bottomnav);
  padding: 0 2px;
  font-size: var(--fh-fs-12);
}
.fh-bottomnav button[aria-current="page"]::before {
  content: ""; position: absolute; top: -1px; left: 22%; right: 22%; height: 3px; background: var(--fh-accent);
}
.fh-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; color: var(--fh-on-ink); background: var(--fh-ink); font: 700 var(--fh-fs-12)/1 var(--fh-font); font-variant-numeric: tabular-nums; }
.fh-bottomnav .fh-count { position: absolute; top: 8px; left: calc(50% + 6px); }

.fh-main {
  max-width: var(--fh-max);
  margin: 0 auto;
  padding: var(--fh-s5) var(--fh-gutter) calc(var(--fh-bottomnav) + var(--fh-s7) + env(safe-area-inset-bottom));
}
.fh-main:focus { outline: none; }
.fh-section { margin-top: var(--fh-s7); }
.fh-main > .fh-section:first-child, .fh-cols > div > .fh-section:first-child { margin-top: 0; }
.fh-cols { margin-top: var(--fh-s7); }
.fh-pagehead + .fh-cols { margin-top: 0; }
.fh-cols > div + div { margin-top: var(--fh-s7); }

.fh-pagehead { display: grid; gap: var(--fh-s2); margin-bottom: var(--fh-s5); }
.fh-pagehead__row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--fh-s3); }
.fh-back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin: -8px 0 0 -4px; padding: 0 8px 0 0; border: 0; background: none; color: var(--fh-muted); font: 600 var(--fh-fs-14)/1 var(--fh-font); cursor: pointer; }
.fh-back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.fh-sechead { display: flex; align-items: center; justify-content: space-between; gap: var(--fh-s3); min-height: 44px; margin-bottom: var(--fh-s2); padding-bottom: var(--fh-s2); border-bottom: 1px solid var(--fh-ink); }

.fh-footer { margin-top: var(--fh-s8); padding-top: var(--fh-s5); border-top: 1px solid var(--fh-rule); color: var(--fh-muted); font-size: var(--fh-fs-14); }
.fh-footer nav { display: flex; flex-wrap: wrap; gap: 0 var(--fh-s4); margin: var(--fh-s2) 0; }
.fh-footer a, .fh-footer button { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; color: var(--fh-ink); font: 600 var(--fh-fs-14)/1.2 var(--fh-font); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }

/* --------------------------------------------------------------------------
   通知列：一行說完，可關閉
   -------------------------------------------------------------------------- */
.fh-notice {
  display: flex;
  align-items: center;
  gap: var(--fh-s3);
  min-height: 44px;
  padding: 6px var(--fh-gutter);
  color: var(--fh-warn);
  background: var(--fh-warn-soft);
  border-bottom: 1px solid color-mix(in srgb, var(--fh-warn) 30%, transparent);
  font-size: var(--fh-fs-14);
  font-weight: 500;
}
.fh-notice > span { flex: 1 1 auto; }
.fh-notice--info { color: var(--fh-info); background: var(--fh-info-soft); border-color: color-mix(in srgb, var(--fh-info) 30%, transparent); }
.fh-notice--danger { color: var(--fh-danger); background: var(--fh-danger-soft); border-color: color-mix(in srgb, var(--fh-danger) 30%, transparent); }
.fh-notice--ink { color: var(--fh-on-ink); background: var(--fh-ink); border-color: var(--fh-ink); }
.fh-notice button { flex: none; min-height: 44px; padding: 0 8px; border: 0; background: none; color: inherit; font: 700 var(--fh-fs-14)/1 var(--fh-font); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }

/* 區塊內的提示（資料過期、部分更新、來源說明） */
.fh-callout { display: grid; gap: var(--fh-s2); padding: var(--fh-s4); background: var(--fh-surface); border-left: 4px solid var(--fh-accent-ink); }
.fh-callout--info { border-left-color: var(--fh-info); }
.fh-callout--warn { border-left-color: var(--fh-warn); }
.fh-callout--danger { border-left-color: var(--fh-danger); }

/* --------------------------------------------------------------------------
   卡片與清單
   -------------------------------------------------------------------------- */
.fh-card { padding: var(--fh-s4); background: var(--fh-surface); border: 1px solid var(--fh-rule); }
.fh-list { margin: 0; padding: 0; list-style: none; }
.fh-list > li { border-bottom: 1px solid var(--fh-rule); }

/* 下一場 Live：全站唯一用粗邊框與大數字的元件 */
.fh-hero {
  position: relative;
  display: grid;
  gap: var(--fh-s4);
  padding: var(--fh-s5) var(--fh-s4) var(--fh-s4);
  background: var(--fh-surface);
  border: 1.5px solid var(--fh-ink);
}
.fh-hero::before { content: ""; position: absolute; top: -1.5px; left: -1.5px; width: 56px; height: 5px; background: var(--fh-accent); }
.fh-hero__title { font: 700 var(--fh-fs-20)/1.4 var(--fh-font); }
.fh-hero__date { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.fh-hero__date b { font: 800 var(--fh-fs-40)/1 var(--fh-display); font-variant-numeric: tabular-nums; }
.fh-hero__facts { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; color: var(--fh-muted); font-size: var(--fh-fs-14); }
.fh-hero__facts li { display: flex; align-items: center; gap: 8px; }
.fh-hero__facts svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fh-hero__actions { display: grid; gap: var(--fh-s3); }

/* 行程列：日期塊（或時間塊）+ 內容 */
.fh-event { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; align-items: center; gap: var(--fh-s4); width: 100%; min-height: 76px; padding: var(--fh-s3) 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.fh-event__date { display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 60px; padding: 4px 2px; color: var(--fh-on-ink); background: var(--fh-ink); border-left: 5px solid var(--fh-accent); text-align: center; }
.fh-event__date b { font: 800 var(--fh-fs-20)/1 var(--fh-display); font-variant-numeric: tabular-nums; }
.fh-event__date span { font-size: var(--fh-fs-12); line-height: 1.2; }
/* 一般媒體行程（電視、廣播、雜誌）：時間塊用淡底，只有 Live 與活動用墨色塊 */
.fh-event--quiet .fh-event__date { color: var(--fh-ink); background: var(--fh-surface-2); border-left-color: var(--fh-rule-strong); }
.fh-event--quiet .fh-event__date b { font-size: var(--fh-fs-16); }
.fh-event--ended .fh-event__date { color: var(--fh-muted); background: var(--fh-surface-2); border-left-color: var(--fh-rule-strong); }
.fh-event__body { display: grid; gap: 2px; min-width: 0; }
.fh-event__title { font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.fh-event > svg { width: 20px; height: 20px; fill: none; stroke: var(--fh-accent-ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* 官方消息列 */
.fh-news { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--fh-s3); min-height: 64px; padding: var(--fh-s3) 0; text-decoration: none; }
.fh-news__title { font-weight: 600; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fh-news svg { width: 18px; height: 18px; fill: none; stroke: var(--fh-muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* 標籤 */
.fh-tag { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; color: var(--fh-ink); background: var(--fh-surface-2); font: 600 var(--fh-fs-12)/1 var(--fh-font); white-space: nowrap; }
.fh-tag--accent { background: var(--fh-accent-soft); color: var(--fh-accent-ink); }
.fh-tag--ok { background: var(--fh-ok-soft); color: var(--fh-ok); }
.fh-tag--warn { background: var(--fh-warn-soft); color: var(--fh-warn); }
.fh-tag--ink { background: var(--fh-ink); color: var(--fh-on-ink); }
.fh-tag--line { background: none; box-shadow: inset 0 0 0 1px var(--fh-rule-strong); color: var(--fh-muted); }
.fh-tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* --------------------------------------------------------------------------
   照片
   成員照、作品封面、影片縮圖都放在固定比例的框裡。讀不到時加上 .is-missing，退回字卡。
   <span class="fh-photo fh-photo--fold">
     <img src="…" alt="" loading="lazy" onerror="this.parentNode.classList.add('is-missing')">
     <span class="fh-photo__fallback" aria-hidden="true">金</span>
   </span>
   -------------------------------------------------------------------------- */
.fh-photo { position: relative; display: block; width: 100%; aspect-ratio: 4 / 5; overflow: hidden; background: var(--fh-surface-2); }
.fh-photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; }
.fh-photo--fold { clip-path: polygon(16px 0, 100% 0, 100% 100%, 0 100%, 0 16px); }
.fh-photo--1x1 { aspect-ratio: 1 / 1; }
.fh-photo--16x9 { aspect-ratio: 16 / 9; }
.fh-photo--1x1 img, .fh-photo--16x9 img { object-position: 50% 50%; }
.fh-photo__fallback { position: absolute; inset: 0; display: none; place-items: center; color: var(--fh-muted); font: 800 var(--fh-fs-28)/1 var(--fh-display); }
.fh-photo.is-missing img { display: none; }
.fh-photo.is-missing .fh-photo__fallback, .fh-photo--empty .fh-photo__fallback { display: grid; }

/* 應援色：兩個色塊。照片下方的色帶，或字卡上的方塊。沒有資料時整個不顯示 */
.fh-penlight { display: grid; grid-template-columns: 1fr 1fr; height: 6px; }
.fh-penlight i { background: var(--c, var(--fh-surface-2)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fh-ink) 18%, transparent); }
.fh-penlight--block { width: 44px; height: 44px; flex: none; clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px); }

/* 成員卡：照片為主，姓名在下。整張卡可點；愛心是另一顆按鈕 */
.fh-mgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--fh-s5) var(--fh-s3); margin: 0; padding: 0; list-style: none; }
.fh-mcard { position: relative; display: block; }
.fh-mcard__main { display: grid; gap: 0; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.fh-mcard__text { display: grid; gap: 2px; min-height: 60px; padding: var(--fh-s2) 48px 0 0; align-content: start; }
.fh-mcard__kana { color: var(--fh-muted); font-size: var(--fh-fs-12); line-height: 1.3; }
.fh-mcard__name { font: 700 var(--fh-fs-16)/1.3 var(--fh-font); }
.fh-mcard__meta { color: var(--fh-muted); font-size: var(--fh-fs-12); }
.fh-mcard > .fb-icon { position: absolute; right: 0; bottom: 8px; }
.fh-mcard__main:focus-visible { outline-offset: 4px; }

/* 成員列：小照片 + 姓名，用在清單裡 */
.fh-member { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: var(--fh-s3); padding: var(--fh-s3) 0; }
.fh-member .fh-photo { width: 56px; aspect-ratio: 1 / 1; }
.fh-member .fh-photo__fallback { font-size: var(--fh-fs-20); }
.fh-member__main { display: grid; gap: 2px; min-width: 0; min-height: 44px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; align-content: center; }
.fh-member__name { font: 700 var(--fh-fs-16)/1.3 var(--fh-font); }

/* 成員頁頂部：照片 + 姓名 + 操作 */
.fh-profile { display: grid; gap: var(--fh-s5); }
.fh-profile__photo { width: min(100%, 320px); }
.fh-profile__pen { display: flex; align-items: center; gap: var(--fh-s3); }

/* 屬性表 */
.fh-kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px var(--fh-s4); margin: 0; }
.fh-kv dt { color: var(--fh-muted); font-size: var(--fh-fs-14); }
.fh-kv dd { margin: 0; font-weight: 600; }

/* 數字 */
.fh-stats { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--fh-rule); background: var(--fh-surface); }
.fh-stats > * { display: grid; gap: 2px; padding: var(--fh-s4) var(--fh-s2); text-align: center; border-left: 1px solid var(--fh-rule); }
.fh-stats > :first-child { border-left: 0; }
.fh-stats b { font: 800 var(--fh-fs-28)/1 var(--fh-display); font-variant-numeric: tabular-nums; }
.fh-stats span { color: var(--fh-muted); font-size: var(--fh-fs-12); }

/* 作品列：封面 + 名稱。整列可點 */
.fh-work { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: var(--fh-s3); width: 100%; min-height: 76px; padding: var(--fh-s3) 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; text-decoration: none; }
.fh-work .fh-photo { width: 64px; }
.fh-work .fh-photo__fallback { font-size: var(--fh-fs-14); }
.fh-work__body { display: grid; gap: 2px; min-width: 0; }
.fh-work__title { font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.fh-work > svg { width: 20px; height: 20px; fill: none; stroke: var(--fh-accent-ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fh-work--wide { grid-template-columns: 112px minmax(0, 1fr) auto; }
.fh-work--wide .fh-photo { width: 112px; }

/* 曲目 */
.fh-tracks { margin: 0; padding: 0; list-style: none; counter-reset: t; }
.fh-tracks li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: baseline; gap: var(--fh-s3); min-height: 48px; padding: var(--fh-s3) 0; border-bottom: 1px solid var(--fh-rule); counter-increment: t; }
.fh-tracks li::before { content: counter(t, decimal-leading-zero); color: var(--fh-muted); font: 500 var(--fh-fs-12)/1.6 var(--fh-mono); }
.fh-tracks b { font-weight: 700; overflow-wrap: anywhere; }

/* 隊形：一列一列，由後排到前排。Center 用團體色底線加文字標示 */
.fh-formation { display: grid; gap: var(--fh-s4); }
.fh-formation__row { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--fh-s3) var(--fh-s2); margin: 0; padding: 0; list-style: none; }
.fh-formation__row li { display: grid; gap: 4px; align-content: start; justify-items: center; width: 64px; text-align: center; font-size: var(--fh-fs-12); line-height: 1.3; }
.fh-formation__row li > .fh-photo { width: 100%; }
.fh-formation__row .fh-photo { aspect-ratio: 5 / 8; }
.fh-formation__row .fh-photo__fallback { font-size: var(--fh-fs-16); }
.fh-formation__row li.is-center { font-weight: 700; }
.fh-formation__row li.is-center .fh-photo { box-shadow: 0 4px 0 var(--fh-accent); margin-bottom: 4px; }
.fh-formation__rowlabel { margin-bottom: var(--fh-s2); color: var(--fh-muted); font-size: var(--fh-fs-12); line-height: 1.2; text-align: center; }

/* --------------------------------------------------------------------------
   分頁、分段切換
   -------------------------------------------------------------------------- */
.fh-tabs { display: flex; gap: var(--fh-s1); margin: 0 calc(var(--fh-gutter) * -1) var(--fh-s5); padding: 0 var(--fh-gutter); overflow-x: auto; border-bottom: 1px solid var(--fh-rule); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.fh-tabs::-webkit-scrollbar { display: none; }
.fh-tabs button { position: relative; flex: none; min-height: 48px; min-width: 56px; padding: 0 14px; border: 0; background: none; color: var(--fh-muted); font: 600 var(--fh-fs-16)/1 var(--fh-font); cursor: pointer; }
.fh-tabs button[aria-selected="true"] { color: var(--fh-ink); font-weight: 700; }
.fh-tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 3px; background: var(--fh-accent); }

.fh-seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; background: var(--fh-surface-2); }
.fh-seg button { min-height: 44px; padding: 0 16px; border: 0; background: none; color: var(--fh-muted); font: 600 var(--fh-fs-14)/1 var(--fh-font); cursor: pointer; white-space: nowrap; }
.fh-seg button[aria-pressed="true"] { color: var(--fh-ink); background: var(--fh-surface); font-weight: 700; box-shadow: 0 0 0 1px var(--fh-rule); }
.fh-chips { display: flex; flex-wrap: wrap; gap: var(--fh-s2); }

/* --------------------------------------------------------------------------
   表單
   -------------------------------------------------------------------------- */
.fh-field { display: grid; gap: 6px; }
.fh-field > label, .fh-field > .fh-field__label { font-weight: 700; font-size: var(--fh-fs-14); }
.fh-input, .fh-select, .fh-textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--fh-rule-strong);
  border-radius: 0;
  background: var(--fh-surface);
  color: var(--fh-ink);
  font: 400 var(--fh-fs-16)/1.4 var(--fh-font);   /* 16px 以上，iOS 才不會自動放大 */
  -webkit-appearance: none;
  appearance: none;
}
.fh-textarea { min-height: 96px; padding: 12px 14px; resize: vertical; }
.fh-select { padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--fh-ink) 50%), linear-gradient(135deg, var(--fh-ink) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 14px) 21px; background-size: 6px 6px; background-repeat: no-repeat; }
.fh-input:hover, .fh-select:hover, .fh-textarea:hover { border-color: var(--fh-ink); }
.fh-input:focus, .fh-select:focus, .fh-textarea:focus { outline: 3px solid var(--fh-accent-ink); outline-offset: 1px; border-color: var(--fh-ink); }
.fh-input::placeholder { color: var(--fh-placeholder); opacity: 1; }
.fh-field__help { color: var(--fh-muted); font-size: var(--fh-fs-14); }
.fh-field__error { display: flex; align-items: center; gap: 6px; color: var(--fh-danger); font-size: var(--fh-fs-14); font-weight: 600; }
.fh-field--error .fh-input { border-color: var(--fh-danger); }

.fh-search { position: relative; display: block; }
.fh-search svg { position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); fill: none; stroke: var(--fh-muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.fh-search .fh-input { padding-left: 44px; }

/* 勾選列：整列 48px 都可以點 */
.fh-check { display: flex; align-items: center; gap: var(--fh-s3); min-height: 48px; padding: 4px 0; cursor: pointer; }
.fh-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.fh-check__box { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border: 1.5px solid var(--fh-ink); background: var(--fh-surface); }
.fh-check__box svg { width: 16px; height: 16px; fill: none; stroke: var(--fh-on-ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.fh-check input:checked + .fh-check__box { background: var(--fh-ink); }
.fh-check input:checked + .fh-check__box svg { opacity: 1; }
.fh-check input:focus-visible + .fh-check__box { outline: 3px solid var(--fh-accent-ink); outline-offset: 3px; }
.fh-check input:disabled + .fh-check__box { border-color: var(--fh-rule-strong); background: var(--fh-surface-2); }
.fh-check__text { flex: 1 1 auto; min-width: 0; }

/* 開關 */
.fh-switch { display: flex; align-items: center; justify-content: space-between; gap: var(--fh-s4); min-height: 48px; cursor: pointer; }
.fh-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.fh-switch__track { position: relative; width: 48px; height: 28px; flex: none; background: var(--fh-rule-strong); transition: background-color var(--fh-fast) var(--fh-ease); }
.fh-switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; background: var(--fh-surface); transition: transform var(--fh-fast) var(--fh-ease); }
.fh-switch input:checked + .fh-switch__track { background: var(--fh-ink); }
.fh-switch input:checked + .fh-switch__track::after { transform: translateX(20px); background: var(--fh-accent); }
.fh-switch input:focus-visible + .fh-switch__track { outline: 3px solid var(--fh-accent-ink); outline-offset: 3px; }

/* 摺疊區塊 */
.fh-acc { border: 1px solid var(--fh-rule); background: var(--fh-surface); }
.fh-acc + .fh-acc { border-top: 0; }
.fh-acc > summary { display: flex; align-items: center; justify-content: space-between; gap: var(--fh-s3); min-height: 60px; padding: 0 var(--fh-s4); cursor: pointer; list-style: none; font-weight: 700; }
.fh-acc > summary::-webkit-details-marker { display: none; }
.fh-acc > summary > :first-child { flex: 1 1 auto; min-width: 0; }
.fh-acc > summary::after { content: ""; width: 10px; height: 10px; flex: none; border-right: 2px solid var(--fh-ink); border-bottom: 2px solid var(--fh-ink); transform: rotate(45deg) translateY(-3px); transition: transform var(--fh-fast) var(--fh-ease); }
.fh-acc[open] > summary::after { transform: rotate(-135deg) translateY(-3px); }
.fh-acc__body { padding: 0 var(--fh-s4) var(--fh-s4); }

/* --------------------------------------------------------------------------
   月曆
   -------------------------------------------------------------------------- */
.fh-cal { margin: 0 calc(var(--fh-gutter) * -1); border-top: 1px solid var(--fh-rule); border-bottom: 1px solid var(--fh-rule); background: var(--fh-surface); }
.fh-cal__head { display: flex; align-items: center; justify-content: space-between; padding: var(--fh-s2) var(--fh-s3); }
.fh-cal__head b { font: 800 var(--fh-fs-20)/1 var(--fh-display); font-variant-numeric: tabular-nums; }
.fh-cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.fh-cal__dow { display: grid; place-items: center; height: 32px; color: var(--fh-muted); font-size: var(--fh-fs-12); border-top: 1px solid var(--fh-rule); }
.fh-cal__day { position: relative; display: grid; justify-items: center; align-content: start; gap: 4px; min-height: 52px; padding: 8px 0 6px; border: 0; border-top: 1px solid var(--fh-rule); background: none; color: var(--fh-ink); font: 600 var(--fh-fs-14)/1 var(--fh-font); font-variant-numeric: tabular-nums; cursor: pointer; }
.fh-cal__day[disabled] { color: var(--fh-faint); cursor: default; }
.fh-cal__day[aria-pressed="true"] { color: var(--fh-on-ink); background: var(--fh-ink); }
.fh-cal__day[data-today]::after { content: ""; position: absolute; left: 30%; right: 30%; bottom: 3px; height: 2px; background: var(--fh-accent-ink); }
.fh-cal__day[aria-pressed="true"][data-today]::after { background: var(--fh-accent); }
/* 記號：Live 與活動用團體色實心方塊，其他行程用灰色方塊。數量另外寫在給報讀器的文字裡 */
.fh-cal__marks { display: flex; gap: 3px; height: 6px; }
.fh-cal__marks i { width: 6px; height: 6px; background: var(--fh-rule-strong); }
.fh-cal__marks i.is-live { background: var(--fh-accent-ink); }
.fh-cal__day[aria-pressed="true"] .fh-cal__marks i { background: color-mix(in srgb, var(--fh-on-ink) 55%, transparent); }
.fh-cal__day[aria-pressed="true"] .fh-cal__marks i.is-live { background: var(--fh-accent); }
.fh-legend { display: flex; flex-wrap: wrap; gap: var(--fh-s2) var(--fh-s4); color: var(--fh-muted); font-size: var(--fh-fs-12); }
.fh-legend span { display: inline-flex; align-items: center; gap: 6px; }
.fh-legend i { width: 8px; height: 8px; background: var(--fh-rule-strong); }
.fh-legend i.is-live { background: var(--fh-accent-ink); }

/* --------------------------------------------------------------------------
   對話框：手機從底部滑出，桌機置中
   -------------------------------------------------------------------------- */
.fh-dialog { width: 100%; max-width: 560px; max-height: min(88vh, 720px); margin: auto auto 0; padding: 0; border: 0; border-top: 4px solid var(--fh-accent); background: var(--fh-paper); color: var(--fh-ink); overflow: hidden; }
.fh-dialog[open] { display: flex; flex-direction: column; }
.fh-dialog::backdrop { background: var(--fh-scrim); }
.fh-dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--fh-s3); padding: var(--fh-s4) var(--fh-s4) var(--fh-s2) var(--fh-gutter); }
.fh-dialog__body { display: grid; gap: var(--fh-s4); padding: var(--fh-s2) var(--fh-gutter) var(--fh-s5); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.fh-dialog__foot { display: grid; gap: var(--fh-s3); padding: var(--fh-s3) var(--fh-gutter) calc(var(--fh-s4) + env(safe-area-inset-bottom)); border-top: 1px solid var(--fh-rule); background: var(--fh-paper); }

/* --------------------------------------------------------------------------
   提示訊息：一般 4 秒，有「復原」的 6 秒
   -------------------------------------------------------------------------- */
.fh-toast { position: fixed; left: 50%; bottom: calc(var(--fh-bottomnav) + 16px + env(safe-area-inset-bottom)); z-index: 60; display: flex; align-items: center; gap: var(--fh-s3); width: max-content; max-width: calc(100vw - 32px); min-height: 48px; padding: 0 6px 0 16px; color: var(--fh-on-ink); background: var(--fh-ink); border-left: 5px solid var(--fh-accent); font-size: var(--fh-fs-14); font-weight: 600; transform: translate(-50%, 24px); opacity: 0; pointer-events: none; visibility: hidden; transition: transform var(--fh-fast) var(--fh-ease), opacity var(--fh-fast) var(--fh-ease), visibility 0s linear var(--fh-fast); }
.fh-toast.is-on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; visibility: visible; transition-delay: 0s; }
.fh-toast button { min-height: 44px; padding: 0 12px; border: 0; background: none; color: inherit; font: 700 var(--fh-fs-14)/1 var(--fh-font); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.fh-toast > span { padding-right: 10px; }

/* --------------------------------------------------------------------------
   狀態：載入中、空、錯誤
   -------------------------------------------------------------------------- */
.fh-skel { display: block; height: 16px; background: linear-gradient(90deg, var(--fh-surface-2) 0%, var(--fh-skel) 50%, var(--fh-surface-2) 100%); background-size: 200% 100%; animation: fh-skel 1.2s linear infinite; }
.fh-skel--title { height: 28px; width: 60%; }
.fh-skel--block { height: 120px; }
.fh-skel--photo { height: auto; aspect-ratio: 4 / 5; }
@keyframes fh-skel { to { background-position: -200% 0; } }

.fh-empty { display: grid; justify-items: start; gap: var(--fh-s3); padding: var(--fh-s5) var(--fh-s4); background: var(--fh-surface); border: 1px solid var(--fh-rule); }
.fh-empty__mark { width: 40px; height: 40px; background: var(--fh-surface-2); clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px); }
.fh-empty--error { border-left: 4px solid var(--fh-danger); }

/* 步驟 */
.fh-steps { display: grid; gap: 8px; margin: 4px 0 0; padding: 0; list-style: none; counter-reset: s; font-size: var(--fh-fs-14); color: var(--fh-muted); }
.fh-steps li { display: flex; gap: 10px; align-items: baseline; counter-increment: s; }
.fh-steps li::before { content: counter(s); font: 800 var(--fh-fs-14) var(--fh-display); color: var(--fh-accent); }

/* 資料來源說明：放在區塊最下面的一行小字 */
.fh-source { margin-top: var(--fh-s3); color: var(--fh-muted); font-size: var(--fh-fs-12); line-height: 1.5; }

/* --------------------------------------------------------------------------
   響應式：760px 以上改用頁首導覽，1024px 以上雙欄
   -------------------------------------------------------------------------- */
@media (min-width: 760px) {
  :root { --fh-gutter: 32px; --fh-header: 64px; }
  .fh-nav { display: flex; }
  .fh-bottomnav { display: none; }
  .fh-main { padding-bottom: var(--fh-s8); }
  .fh-h1 { font-size: var(--fh-fs-40); }
  .fh-ink { padding: 40px 36px; }
  .fh-ink__title { font-size: var(--fh-fs-40); }
  .fh-grid--2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--fh-s6); }
  .fh-hero { padding: var(--fh-s6) var(--fh-s5) var(--fh-s5); }
  .fh-hero__actions { grid-template-columns: repeat(2, minmax(0, max-content)); }
  .fh-dialog { margin: auto; }
  .fh-toast { bottom: 32px; }
  .fh-cal { margin: 0; border: 1px solid var(--fh-rule); }
  .fh-cal__day { min-height: 72px; }
  .fh-tabs { margin-left: 0; margin-right: 0; padding: 0; }
  .fh-mgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--fh-s6) var(--fh-s4); }
  .fh-profile { grid-template-columns: 280px minmax(0, 1fr); align-items: start; gap: var(--fh-s6); }
  .fh-formation__row li { width: 80px; }
}
@media (min-width: 1024px) {
  .fh-cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--fh-s7); align-items: start; }
  .fh-cols > div + div { margin-top: 0; }
  .fh-mgrid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 359px) {
  .fh-logo small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .fh-skel { animation: none; }
  .fh-toast, .fh-switch__track, .fh-switch__track::after, .fh-acc > summary::after { transition: none; }
}
