/*!
 * FOOTBALL HUB 前台樣式（建立於 AdminLTE 4 / Bootstrap 5.3 之上）
 * 深色為預設；淺色以 [data-bs-theme="light"] 切換
 */

/* ───────────── 設計變數 ───────────── */
:root,
[data-bs-theme="dark"] {
  --fh-bg: #24343D;
  --fh-bg-2: #1d2b33;
  --fh-surface: #304C5C;
  --fh-surface-2: #2a4352;
  --fh-surface-3: #365667;
  --fh-border: rgba(255, 255, 255, .09);
  --fh-border-strong: rgba(255, 255, 255, .16);
  --fh-text: #e9f2f5;
  --fh-text-2: #c4d5dc;
  --fh-muted: #93abb6;
  --fh-primary: #20C6B5;
  --fh-primary-rgb: 32, 198, 181;
  --fh-primary-ink: #062a27;
  --fh-accent: #A95BEF;
  --fh-accent-rgb: 169, 91, 239;
  --fh-blue: #4aa8ff;
  --fh-live: #ff4d5e;
  --fh-win: #22c55e;
  --fh-draw: #94a3b8;
  --fh-loss: #ef4444;
  --fh-yellow: #facc15;
  --fh-header-bg: rgba(29, 43, 51, .88);
  --fh-shadow: 0 6px 24px rgba(0, 0, 0, .22);
  --fh-shadow-sm: 0 2px 10px rgba(0, 0, 0, .16);
  --fh-radius: 14px;
  --fh-radius-sm: 10px;
  --fh-gradient: linear-gradient(135deg, #20C6B5 0%, #4a8fe0 50%, #A95BEF 100%);
  --fh-hero: radial-gradient(1200px 400px at 10% -10%, rgba(32, 198, 181, .35), transparent 60%),
             radial-gradient(900px 400px at 100% 0%, rgba(169, 91, 239, .35), transparent 60%),
             linear-gradient(180deg, #1d2b33 0%, #24343D 100%);
  --fh-skeleton: rgba(255, 255, 255, .06);
  --fh-skeleton-hi: rgba(255, 255, 255, .12);

  --bs-body-bg: var(--fh-bg);
  --bs-body-color: var(--fh-text);
  --bs-secondary-color: var(--fh-muted);
  --bs-border-color: var(--fh-border);
  --bs-tertiary-bg: var(--fh-surface-2);
  --bs-link-color: var(--fh-primary);
  --bs-link-color-rgb: var(--fh-primary-rgb);
  --bs-link-hover-color: #5fe0d3;
  --bs-emphasis-color: #fff;
  color-scheme: dark;
}

[data-bs-theme="light"] {
  --fh-bg: #eef3f6;
  --fh-bg-2: #e3ebef;
  --fh-surface: #ffffff;
  --fh-surface-2: #f5f8fa;
  --fh-surface-3: #e8eff3;
  --fh-border: rgba(16, 42, 56, .10);
  --fh-border-strong: rgba(16, 42, 56, .18);
  --fh-text: #13262f;
  --fh-text-2: #2c4652;
  --fh-muted: #5d7581;
  --fh-primary: #0e9e90;
  --fh-primary-rgb: 14, 158, 144;
  --fh-primary-ink: #ffffff;
  --fh-accent: #8b3fd9;
  --fh-accent-rgb: 139, 63, 217;
  --fh-live: #e11d48;
  --fh-header-bg: rgba(255, 255, 255, .9);
  --fh-shadow: 0 6px 24px rgba(16, 42, 56, .08);
  --fh-shadow-sm: 0 2px 10px rgba(16, 42, 56, .06);
  --fh-hero: radial-gradient(1200px 400px at 10% -10%, rgba(32, 198, 181, .25), transparent 60%),
             radial-gradient(900px 400px at 100% 0%, rgba(169, 91, 239, .22), transparent 60%),
             linear-gradient(180deg, #e3f3f1 0%, #eef3f6 100%);
  --fh-skeleton: rgba(16, 42, 56, .06);
  --fh-skeleton-hi: rgba(16, 42, 56, .11);
  --bs-link-hover-color: #0a7a6f;
  --bs-emphasis-color: #000;
  color-scheme: light;
}

/* ───────────── 基礎 ───────────── */
html { scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body.fh {
  background: var(--fh-bg);
  color: var(--fh-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: .95rem;
  line-height: 1.6;
  padding-top: 60px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body.fh main { flex: 1 0 auto; min-width: 0; width: 100%; }
body.fh > * { min-width: 0; }
html, body.fh { overflow-x: clip; }
a { text-decoration: none; }
a:hover { text-decoration: none; }
.text-muted, .fh-muted { color: var(--fh-muted) !important; }
.text-2 { color: var(--fh-text-2); }
.text-primary-fh { color: var(--fh-primary) !important; }
.text-accent { color: var(--fh-accent) !important; }
.text-live { color: var(--fh-live) !important; }
.fw-800 { font-weight: 800; }
.tabular { font-variant-numeric: tabular-nums; }
.min-w-0 { min-width: 0; }
.fh-container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 16px; }
.fh-page { padding-top: 20px; padding-bottom: 40px; }
.visually-hidden-focusable:focus { position: fixed; top: 8px; left: 8px; z-index: 2000; background: var(--fh-primary); color: var(--fh-primary-ink); padding: 8px 14px; border-radius: 8px; }
::selection { background: rgba(var(--fh-primary-rgb), .35); }
img { max-width: 100%; }
.img-contain { object-fit: contain; }

/* ───────────── Header ───────────── */
.fh-header {
  position: fixed; inset: 0 0 auto 0; height: 60px; z-index: 1030;
  background: var(--fh-header-bg);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--fh-border);
}
.fh-header .fh-container { height: 100%; display: flex; align-items: center; gap: 12px; }
.fh-brand { display: flex; align-items: center; gap: 8px; color: var(--fh-text); font-weight: 800; letter-spacing: .5px; white-space: nowrap; }
.fh-brand:hover { color: var(--fh-text); }
.fh-brand .ball { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--fh-gradient); color: #fff; font-size: 16px; box-shadow: 0 0 0 3px rgba(var(--fh-primary-rgb), .15); }
.fh-brand .name { font-size: 1.05rem; }
.fh-brand .fh-logo-img { width: auto; max-width: min(200px, 46vw); object-fit: contain; display: block; }
.fh-brand-lg .fh-logo-img { max-width: 240px; }
[data-bs-theme="dark"] .fh-logo-light, [data-bs-theme="light"] .fh-logo-dark { display: none; }
/* 品牌 Logo：中文副標用 HTML 文字疊在圖上（比圖片內的小字清楚） */
.fh-logo { position: relative; display: inline-block; line-height: 0; flex-shrink: 0; }
.fh-logo .fh-logo-img { display: block; }
.fh-tagline {
  position: absolute; transform: translateY(-50%); display: flex; align-items: center; justify-content: center; gap: .35em;
  font-size: max(10px, calc(var(--h, 40px) * .29)); line-height: 1; font-weight: 800; letter-spacing: .14em; white-space: nowrap; pointer-events: none;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}
.fh-tagline::before, .fh-tagline::after { content: ""; flex: 1 1 0; min-width: 0; max-width: 2.2em; height: 1.5px; border-radius: 1px; background: currentColor; opacity: .85; }
.fh-tagline::after { margin-left: -.14em; }
.fh-logo-dark .fh-tagline { color: #fff; text-shadow: 0 0 2px #001020, 0 1px 2px rgba(0, 16, 32, .9); }
.fh-logo-light .fh-tagline { color: #0d2026; }
@media (max-width: 575.98px) { .fh-header .fh-brand .fh-logo-img { height: 32px !important; } .fh-header .fh-tagline { font-size: 10px; letter-spacing: .05em; gap: .25em; transform: translateY(-36%); } }
.fh-live-pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 99px; font-size: .7rem; font-weight: 800; color: #fff; background: var(--fh-live); letter-spacing: .5px; }
.fh-live-pill .dot, .live-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: fh-pulse 1.4s infinite; }
.live-dot { display: inline-block; background: var(--fh-live); }
@keyframes fh-pulse { 0% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } 100% { opacity: 1; transform: scale(1); } }

.fh-nav { display: flex; align-items: center; gap: 2px; margin: 0 auto 0 12px; list-style: none; padding: 0; }
.fh-nav > li { position: relative; }
.fh-nav > li > a, .fh-nav > li > button {
  display: flex; align-items: center; gap: 4px; padding: 8px 11px; border-radius: 10px; color: var(--fh-text-2);
  font-size: .9rem; font-weight: 600; background: none; border: 0; white-space: nowrap;
}
.fh-nav > li > a:hover, .fh-nav > li > button:hover { background: var(--fh-surface-2); color: var(--fh-text); }
.fh-nav > li > a.active, .fh-nav > li > button.active { color: var(--fh-primary); background: rgba(var(--fh-primary-rgb), .1); }
.fh-nav .live-count { font-size: .65rem; background: var(--fh-live); color: #fff; border-radius: 99px; padding: 0 6px; line-height: 16px; }

.fh-mega {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%); width: min(920px, 92vw);
  background: var(--fh-surface); border: 1px solid var(--fh-border-strong); border-radius: var(--fh-radius); box-shadow: var(--fh-shadow);
  padding: 18px; display: none; z-index: 1040;
}
.fh-nav > li:hover > .fh-mega, .fh-nav > li:focus-within > .fh-mega, .fh-mega.show { display: block; }
.fh-nav > li > .fh-mega::before { content: ""; position: absolute; top: -12px; left: 0; right: 0; height: 12px; }
.fh-mega h6 { font-size: .75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--fh-muted); margin: 0 0 8px; font-weight: 700; }
.fh-mega a { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 8px; color: var(--fh-text); font-size: .88rem; }
.fh-mega a:hover { background: var(--fh-surface-2); color: var(--fh-primary); }
.fh-mega a img { width: 20px; height: 20px; object-fit: contain; flex-shrink: 0; max-width: none; } /* Safari：百分比 max-width 的圖示在 flex 中可被壓扁 */
.fh-mega.small { width: 260px; left: auto; right: 0; transform: none; }

.fh-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.fh-icon-btn {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--fh-text-2);
  background: transparent; border: 1px solid transparent; font-size: 1.1rem;
}
.fh-icon-btn:hover { background: var(--fh-surface-2); color: var(--fh-text); border-color: var(--fh-border); }
.fh-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--fh-surface-3); flex-shrink: 0; max-width: none; }
.fh-search-trigger {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; min-width: 200px; border-radius: 10px;
  background: var(--fh-surface-2); border: 1px solid var(--fh-border); color: var(--fh-muted); font-size: .85rem;
}
.fh-search-trigger:hover { border-color: var(--fh-border-strong); color: var(--fh-text-2); }
.fh-search-trigger kbd { margin-left: auto; background: var(--fh-surface-3); color: var(--fh-muted); font-size: .7rem; border-radius: 4px; padding: 1px 6px; }

@media (max-width: 1199.98px) { .fh-search-trigger { min-width: 0; } .fh-search-trigger span, .fh-search-trigger kbd { display: none; } .fh-nav > li > a { padding: 8px 8px; } }
@media (max-width: 991.98px) { .fh-nav, .fh-search-trigger { display: none !important; } }
/* 頁首按鈕不可被壓縮；320px 寬的小手機（iPhone SE 1 代等）上收窄間距與按鈕，避免右側登入／會員按鈕被推出畫面 */
.fh-header .fh-icon-btn { flex-shrink: 0; padding: 0; }
@media (max-width: 359.98px) {
  .fh-header .fh-container { gap: 8px; padding: 0 12px; }
  .fh-header .fh-actions { gap: 0; }
  .fh-header .fh-icon-btn { width: 34px; height: 34px; }
}

/* ───────────── 手機底部導覽 ───────────── */
.fh-bottom-nav {
  position: fixed; inset: auto 0 0 0; height: 62px; z-index: 1030; display: none;
  background: var(--fh-header-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--fh-border); padding-bottom: env(safe-area-inset-bottom);
}
.fh-bottom-nav a, .fh-bottom-nav button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--fh-muted); font-size: .68rem; font-weight: 600; background: none; border: 0; position: relative;
}
.fh-bottom-nav i { font-size: 1.25rem; line-height: 1; }
.fh-bottom-nav .active { color: var(--fh-primary); }
.fh-bottom-nav .badge-live { position: absolute; top: 6px; left: calc(50% + 6px); font-size: .55rem; background: var(--fh-live); color: #fff; border-radius: 99px; padding: 0 5px; line-height: 14px; }
@media (max-width: 991.98px) {
  .fh-bottom-nav { display: flex; }
  body.fh { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
}
.offcanvas.fh-offcanvas { background: var(--fh-bg); color: var(--fh-text); width: 300px; }
.fh-offcanvas .list-group-item { background: transparent; color: var(--fh-text); border-color: var(--fh-border); display: flex; gap: 10px; align-items: center; }
.fh-offcanvas .list-group-item i { color: var(--fh-primary); width: 20px; text-align: center; }

/* ───────────── 卡片與區塊 ───────────── */
.fh-card {
  background: var(--fh-surface); border: 1px solid var(--fh-border); border-radius: var(--fh-radius);
  box-shadow: var(--fh-shadow-sm); overflow: hidden;
  /* clip：同樣裁切圓角，但不會變成捲動容器，卡片內的 sticky 賽事標題才會黏在頁首下方，而不是被往下推蓋住第一場比賽 */
  overflow: clip;
}
.fh-card + .fh-card, .fh-card + .fh-section, .fh-section + .fh-section { margin-top: 20px; }
.fh-card-header {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--fh-border);
}
.fh-card-header h2, .fh-card-header h3 { font-size: 1rem; font-weight: 800; margin: 0; display: flex; align-items: center; gap: 8px; }
.fh-card-header h2 i, .fh-card-header h3 i { color: var(--fh-primary); }
.fh-card-header .more { margin-left: auto; font-size: .82rem; color: var(--fh-muted); white-space: nowrap; }
.fh-card-header .more:hover { color: var(--fh-primary); }
.fh-card-body { padding: 16px; }
.fh-card-body.p-0 { padding: 0; }
.fh-section-title { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.fh-section-title h2 { font-size: 1.15rem; font-weight: 800; margin: 0; }
.fh-section-title .bar { width: 4px; height: 18px; border-radius: 2px; background: var(--fh-gradient); }
.fh-section-title .more { margin-left: auto; font-size: .85rem; color: var(--fh-muted); }
.fh-page-title { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.fh-page-title h1 { font-size: 1.5rem; font-weight: 800; margin: 0; }
.fh-page-title .sub { color: var(--fh-muted); font-size: .9rem; width: 100%; margin-top: -6px; }
.fh-divider { border-top: 1px solid var(--fh-border); }
.sticky-side { position: sticky; top: 76px; }

/* ───────────── 按鈕、標籤 ───────────── */
.btn-fh { background: var(--fh-primary); color: var(--fh-primary-ink); border: 0; font-weight: 700; border-radius: 10px; }
.btn-fh:hover, .btn-fh:focus { background: var(--fh-primary); filter: brightness(1.08); color: var(--fh-primary-ink); }
.btn-fh-outline { border: 1px solid rgba(var(--fh-primary-rgb), .5); color: var(--fh-primary); border-radius: 10px; font-weight: 600; background: transparent; }
.btn-fh-outline:hover, .btn-fh-outline.active { background: rgba(var(--fh-primary-rgb), .12); color: var(--fh-primary); border-color: var(--fh-primary); }
.btn-ghost { background: var(--fh-surface-2); border: 1px solid var(--fh-border); color: var(--fh-text-2); border-radius: 10px; }
.btn-ghost:hover, .btn-ghost.active { background: var(--fh-surface-3); color: var(--fh-text); border-color: var(--fh-border-strong); }
.btn-gradient { background: var(--fh-gradient); color: #fff; border: 0; font-weight: 700; border-radius: 10px; }
.btn-gradient:hover { color: #fff; filter: brightness(1.08); }
.fh-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; font-size: .85rem; font-weight: 600;
  background: var(--fh-surface-2); color: var(--fh-text-2); border: 1px solid var(--fh-border); white-space: nowrap;
  flex-shrink: 0; /* 籤片永遠不壓縮（iOS Safari 會忽略圖示寬度把籤片壓窄） */
}
.fh-chip:hover { color: var(--fh-text); border-color: var(--fh-border-strong); }
.fh-chip.active { background: rgba(var(--fh-primary-rgb), .15); color: var(--fh-primary); border-color: rgba(var(--fh-primary-rgb), .5); }
.fh-chip .count { font-size: .7rem; background: var(--fh-surface-3); border-radius: 99px; padding: 0 6px; color: var(--fh-muted); }
.fh-chip.active .count { background: rgba(var(--fh-primary-rgb), .2); color: var(--fh-primary); }
.fh-badge { display: inline-block; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--fh-surface-3); color: var(--fh-text-2); }
.fh-badge.primary { background: rgba(var(--fh-primary-rgb), .15); color: var(--fh-primary); }
.fh-badge.accent { background: rgba(var(--fh-accent-rgb), .18); color: var(--fh-accent); }
[data-bs-theme="dark"] .fh-badge.accent { color: #c99cf7; } /* 深色模式：紫字在紫色淡底上對比僅 2:1，改用同色系較淺的紫 */
.fh-badge.live { background: var(--fh-live); color: #fff; }
.chips-scroll { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; min-width: 0; }
.chips-scroll::-webkit-scrollbar { display: none; }
/* 橫向捲動列中的項目一律不壓縮（iOS Safari 計算最小寬度時會忽略圖示寬度，導致籤片被壓窄、文字溢出疊到下一個） */
.chips-scroll > *, .fh-tabs > *, .date-strip .day { flex-shrink: 0; }

.form-control, .form-select { background-color: var(--fh-surface-2); border-color: var(--fh-border); color: var(--fh-text); border-radius: 10px; }
.form-control:focus, .form-select:focus { background-color: var(--fh-surface-2); color: var(--fh-text); border-color: var(--fh-primary); box-shadow: 0 0 0 .2rem rgba(var(--fh-primary-rgb), .2); }
.form-control::placeholder { color: var(--fh-muted); }
.form-label { font-size: .85rem; color: var(--fh-text-2); font-weight: 600; }
/* w-auto 下拉選單寬度取決於最長選項：不可超出容器（320px 手機上即時比分的聯賽篩選會被卡片裁掉） */
.form-select.w-auto { max-width: 100%; }

/* ───────────── 隊徽、照片 ───────────── */
.logo { object-fit: contain; flex-shrink: 0; max-width: none; }
.logo-16 { width: 16px; height: 16px; }
.logo-22 { width: 22px; height: 22px; }
.logo-32 { width: 32px; height: 32px; }
.logo-64 { width: 64px; height: 64px; }
.logo-96 { width: 96px; height: 96px; }
.photo { object-fit: cover; object-position: top; background: var(--fh-surface-3); flex-shrink: 0; border-radius: 50%; max-width: none; }
.photo-sm { width: 36px; height: 36px; }
.photo-md { width: 56px; height: 56px; }
.photo-lg { width: 120px; height: 120px; border-radius: 20px; }
[data-bs-theme="dark"] .logo-shadow { filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .35)); }

/* ───────────── 比賽列表 ───────────── */
.comp-group + .comp-group { border-top: 1px solid var(--fh-border); }
.comp-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--fh-surface-2);
  font-weight: 700; font-size: .88rem; position: sticky; top: 60px; z-index: 2;
}
.comp-head a { color: var(--fh-text); }
.comp-head a:hover { color: var(--fh-primary); }
.comp-head .country { color: var(--fh-muted); font-weight: 500; font-size: .78rem; }
.comp-head .toggle { margin-left: auto; color: var(--fh-muted); font-size: .8rem; }
/* 收合按鈕原本只有 13×19px，手機很難點到：點擊範圍放大到 32×32，用負邊距維持原本的列高與位置 */
.comp-head .toggle[data-collapse] { display: inline-grid; place-items: center; width: 32px; height: 32px; margin: -6px -10px -6px auto; box-shadow: none; }

.match-row {
  display: grid; grid-template-columns: 58px minmax(0, 1fr) 76px minmax(0, 1fr) 36px; align-items: center; gap: 8px;
  padding: 10px 12px 10px 16px; border-top: 1px solid var(--fh-border); color: var(--fh-text); position: relative;
  transition: background .15s;
}
.match-row:first-of-type { border-top: 0; }
.match-row:hover { background: var(--fh-surface-2); color: var(--fh-text); }
.match-row .m-status { font-size: .78rem; font-weight: 700; color: var(--fh-muted); text-align: left; line-height: 1.2; }
.match-row .m-status.live { color: var(--fh-live); }
.match-row .m-status.ft { color: var(--fh-muted); }
.match-row .m-status.off { color: var(--fh-muted); text-decoration: line-through; }
.match-row .m-team { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; font-size: .92rem; }
.match-row .m-team.home { justify-content: flex-end; text-align: right; }
.match-row .m-team span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-row .m-team.winner span { font-weight: 800; }
.match-row .m-team.loser span { color: var(--fh-text-2); font-weight: 500; }
.match-row .m-score {
  text-align: center; font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; letter-spacing: 1px;
  background: var(--fh-surface-2); border-radius: 8px; padding: 3px 0; line-height: 1.3;
}
.match-row.is-live .m-score { color: var(--fh-live); background: rgba(255, 77, 94, .1); }
.match-row.is-ns .m-score { color: var(--fh-muted); font-weight: 600; font-size: .85rem; letter-spacing: 0; }
.match-row .m-pen { display: block; font-size: .65rem; color: var(--fh-muted); letter-spacing: 0; font-weight: 600; }
.match-row .m-side { display: flex; justify-content: flex-end; }
.match-row .redcard { display: inline-block; width: 9px; height: 12px; background: var(--fh-live); border-radius: 2px; flex-shrink: 0; }
.match-row .m-events { grid-column: 2 / 5; font-size: .74rem; color: var(--fh-muted); display: flex; justify-content: center; gap: 14px; margin-top: -4px; }
.match-row .m-events .ev { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 48%; }
.match-row .m-events .home-ev { text-align: right; }
.match-row.flash { animation: fh-flash 2.5s ease-out; }
@keyframes fh-flash { 0% { background: rgba(var(--fh-primary-rgb), .35); } 100% { background: transparent; } }
.match-row .m-round { font-size: .68rem; color: var(--fh-muted); display: block; font-weight: 500; }
/* 狀態欄很窄：輪次最多顯示兩行（例如「D 級聯賽／第 6 輪」），不再被截斷 */
.match-row .m-round { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-all; line-height: 1.25; margin-top: 1px; }
@media (max-width: 575.98px) { .match-row .m-round { font-size: .62rem; } }
@media (max-width: 575.98px) {
  .match-row { grid-template-columns: 46px minmax(0, 1fr) 62px minmax(0, 1fr) 0; gap: 6px; padding: 10px 10px; }
  .match-row .m-side { display: none; }
  .match-row .m-team { font-size: .85rem; gap: 6px; }
  .match-row .m-team .logo-22 { width: 20px; height: 20px; }
}

/* 精簡比賽卡（首頁橫向） */
.match-card {
  display: block; background: var(--fh-surface); border: 1px solid var(--fh-border); border-radius: var(--fh-radius);
  padding: 12px 14px; color: var(--fh-text); min-width: 230px; transition: transform .15s, border-color .15s;
}
.match-card:hover { color: var(--fh-text); transform: translateY(-2px); border-color: rgba(var(--fh-primary-rgb), .5); }
.match-card .mc-top { display: flex; align-items: center; gap: 6px; font-size: .75rem; color: var(--fh-muted); margin-bottom: 8px; }
.match-card .mc-top .st { margin-left: auto; font-weight: 700; }
.match-card .mc-top .st.live { color: var(--fh-live); }
.match-card .mc-team { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-weight: 600; font-size: .9rem; }
.match-card .mc-team .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-card .mc-team .sc { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 18px; text-align: right; }
.match-card.is-live { border-color: rgba(255, 77, 94, .45); box-shadow: 0 0 0 1px rgba(255, 77, 94, .15) inset; }
.match-card.is-live .sc { color: var(--fh-live); }
.h-scroll { display: flex; gap: 12px; overflow-x: auto; min-width: 0; padding: 2px 2px 8px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.h-scroll > * { scroll-snap-align: start; flex-shrink: 0; }

/* ───────────── 日期切換 ───────────── */
.date-strip { display: flex; align-items: center; gap: 8px; }
.date-strip .days { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.date-strip .days::-webkit-scrollbar { display: none; }
.date-strip .day {
  display: flex; flex-direction: column; align-items: center; min-width: 58px; padding: 6px 8px; border-radius: 10px;
  background: var(--fh-surface-2); border: 1px solid var(--fh-border); color: var(--fh-text-2); font-size: .72rem; line-height: 1.3;
}
.date-strip .day b { font-size: .95rem; color: var(--fh-text); }
.date-strip .day.active { background: rgba(var(--fh-primary-rgb), .15); border-color: var(--fh-primary); color: var(--fh-primary); }
.date-strip .day.active b { color: var(--fh-primary); }
.date-strip .day.today:not(.active) b { color: var(--fh-primary); }
.date-strip input[type=date] { width: 46px; min-width: 0; padding: 0; height: 46px; opacity: 0; position: absolute; inset: 0; cursor: pointer; }
.date-pick { position: relative; overflow: hidden; width: 46px; height: 46px; flex-shrink: 0; border-radius: 10px; background: var(--fh-surface-2); border: 1px solid var(--fh-border); display: grid; place-items: center; color: var(--fh-primary); font-size: 1.1rem; }
@media (max-width: 575.98px) {
  /* 手機：日期列可左右滑動，前後一天箭頭隱藏以騰出空間（保留日曆選擇），兩側淡出提示可滑動 */
  .date-strip > a.date-pick { display: none; }
  .date-strip .days { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%); padding: 0 6px; }
  .date-strip .day { min-width: 54px; padding: 6px 4px; }
}

/* ───────────── 頁籤 ───────────── */
.fh-tabs { display: flex; gap: 4px; overflow-x: auto; min-width: 0; scrollbar-width: none; border-bottom: 1px solid var(--fh-border); margin-bottom: 16px; }
.fh-tabs::-webkit-scrollbar { display: none; }
.fh-tabs a, .fh-tabs button {
  padding: 10px 14px; color: var(--fh-muted); font-weight: 700; font-size: .92rem; white-space: nowrap; background: none; border: 0;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.fh-tabs a:hover, .fh-tabs button:hover { color: var(--fh-text); }
.fh-tabs a.active, .fh-tabs button.active { color: var(--fh-primary); border-bottom-color: var(--fh-primary); }
.fh-card .fh-tabs { margin-bottom: 0; padding: 0 8px; }
.fh-seg { display: inline-flex; background: var(--fh-surface-2); border: 1px solid var(--fh-border); border-radius: 10px; padding: 3px; gap: 2px; }
.fh-seg a, .fh-seg button { padding: 5px 12px; border-radius: 8px; color: var(--fh-muted); font-size: .85rem; font-weight: 700; border: 0; background: none; white-space: nowrap; }
.fh-seg a.active, .fh-seg button.active { background: var(--fh-surface); color: var(--fh-primary); box-shadow: var(--fh-shadow-sm); }

/* ───────────── 表格 ───────────── */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.fh-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .88rem; }
.fh-table th { font-size: .74rem; font-weight: 700; color: var(--fh-muted); text-transform: uppercase; letter-spacing: .3px; padding: 10px 8px; border-bottom: 1px solid var(--fh-border); white-space: nowrap; background: var(--fh-surface); text-align: center; }
.fh-table td { padding: 9px 8px; border-bottom: 1px solid var(--fh-border); text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fh-table tr:last-child td { border-bottom: 0; }
.fh-table tbody tr:hover td { background: var(--fh-surface-2); }
.fh-table .col-team { text-align: left; min-width: 160px; }
.fh-table .col-team a { color: var(--fh-text); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.fh-table .col-team a:hover { color: var(--fh-primary); }
.fh-table .col-pos { width: 44px; min-width: 44px; font-weight: 700; position: relative; } /* min-width：手機上表格被壓縮時名次欄會縮到 25–41px，但第二個固定欄固定在 left:44px，左右滑動時兩欄之間會露出縫隙 */
.fh-table .col-pts { font-weight: 800; color: var(--fh-text); }
.fh-table .sticky-col { position: sticky; left: 0; z-index: 1; background: var(--fh-surface); }
.fh-table tbody tr:hover .sticky-col { background: var(--fh-surface-2); }
.fh-table .sticky-col-2 { position: sticky; left: 44px; z-index: 1; background: var(--fh-surface); }
.fh-table tbody tr:hover .sticky-col-2 { background: var(--fh-surface-2); }
.fh-table .zone { position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 2px; }
.fh-table .highlight td { background: rgba(var(--fh-primary-rgb), .08); }
.zone-legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 12px 16px; font-size: .78rem; color: var(--fh-muted); border-top: 1px solid var(--fh-border); }
.zone-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; background: var(--c); vertical-align: -1px; }
.group-title { padding: 10px 16px; font-weight: 800; background: var(--fh-surface-2); border-bottom: 1px solid var(--fh-border); }

/* 近況 */
.form-badges { display: inline-flex; gap: 3px; }
.form-badges .f { width: 20px; height: 20px; border-radius: 5px; display: inline-grid; place-items: center; font-size: .65rem; font-weight: 800; color: #fff; }
.form-badges .f.W { background: var(--fh-win); }
.form-badges .f.D { background: var(--fh-draw); }
.form-badges .f.L { background: var(--fh-loss); }

/* ───────────── Hero ───────────── */
.fh-hero { background: var(--fh-hero); border-bottom: 1px solid var(--fh-border); padding: 28px 0 24px; position: relative; overflow: hidden; }
.fh-hero h1 { font-size: clamp(1.5rem, 3.2vw, 2.4rem); font-weight: 900; letter-spacing: .5px; margin: 0 0 6px; }
.fh-hero h1 .grad { background: var(--fh-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.fh-hero p.lead { color: var(--fh-text-2); font-size: 1rem; margin-bottom: 16px; }
.fh-hero-match {
  background: linear-gradient(135deg, rgba(var(--fh-primary-rgb), .18), rgba(var(--fh-accent-rgb), .18)), var(--fh-surface);
  border: 1px solid var(--fh-border-strong); border-radius: 20px; padding: 18px; box-shadow: var(--fh-shadow); color: var(--fh-text); display: block;
}
.fh-hero-match:hover { color: var(--fh-text); border-color: rgba(var(--fh-primary-rgb), .6); }
.fh-hero-match .hm-comp { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--fh-muted); margin-bottom: 12px; }
.fh-hero-match .hm-body { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.fh-hero-match .hm-team { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-weight: 700; min-width: 0; }
.fh-hero-match .hm-team span { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.fh-hero-match .hm-score { font-size: 2.2rem; font-weight: 900; font-variant-numeric: tabular-nums; text-align: center; line-height: 1; }
.fh-hero-match .hm-status { text-align: center; font-size: .8rem; font-weight: 700; margin-top: 6px; color: var(--fh-muted); }
.fh-hero-match.is-live .hm-score, .fh-hero-match.is-live .hm-status { color: var(--fh-live); }
.hero-search { position: relative; max-width: 520px; }
.hero-search .form-control { height: 48px; padding-left: 44px; border-radius: 14px; background: var(--fh-surface); }
.hero-search i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--fh-muted); }

/* ───────────── 比賽詳細頁 ───────────── */
.match-hero { background: var(--fh-hero); border-bottom: 1px solid var(--fh-border); padding: 18px 0 0; }
.match-hero .mh-comp { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: .85rem; color: var(--fh-text-2); }
.match-hero .mh-body { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 18px 0 14px; }
.match-hero .mh-team { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; color: var(--fh-text); font-weight: 800; font-size: 1.05rem; min-width: 0; }
.match-hero .mh-team:hover { color: var(--fh-primary); }
.match-hero .mh-score { text-align: center; min-width: 140px; }
.match-hero .mh-score .score { font-size: clamp(2.2rem, 7vw, 3.4rem); font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: 2px; }
.match-hero .mh-score .pen { font-size: .85rem; color: var(--fh-muted); margin-top: 4px; }
.match-hero .mh-score .status { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-weight: 800; font-size: .85rem; padding: 3px 12px; border-radius: 99px; background: var(--fh-surface-2); }
.match-hero.is-live .mh-score .score { color: var(--fh-live); }
.match-hero.is-live .mh-score .status { background: var(--fh-live); color: #fff; }
.match-hero .mh-scorers { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; font-size: .78rem; color: var(--fh-text-2); padding-bottom: 12px; }
.match-hero .mh-scorers .h { text-align: right; }
.match-hero .mh-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; font-size: .8rem; color: var(--fh-muted); padding-bottom: 14px; }
@media (max-width: 575.98px) { .match-hero .mh-team { font-size: .88rem; } .match-hero .mh-team .logo-96 { width: 64px; height: 64px; } .match-hero .mh-score { min-width: 96px; } }

/* 事件時間軸 */
.fh-timeline { position: relative; padding: 8px 0; }
.fh-timeline::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: var(--fh-border); transform: translateX(-50%); }
.tl-item { display: grid; grid-template-columns: 1fr 52px 1fr; align-items: center; gap: 10px; padding: 6px 12px; position: relative; }
.tl-item .tl-min { text-align: center; font-weight: 800; font-size: .78rem; background: var(--fh-surface-2); border: 1px solid var(--fh-border); border-radius: 99px; padding: 2px 0; position: relative; z-index: 1; }
.tl-item .tl-body { display: flex; align-items: center; gap: 8px; font-size: .88rem; min-width: 0; }
.tl-item > * { grid-row: 1; }
.tl-item > :nth-child(1) { grid-column: 1; }
.tl-item > :nth-child(2) { grid-column: 2; }
.tl-item > :nth-child(3) { grid-column: 3; }
.tl-item .tl-body.home { justify-content: flex-end; text-align: right; }
.tl-item .tl-body .sub { color: var(--fh-muted); font-size: .76rem; display: block; }
.tl-item .ico { width: 22px; height: 22px; display: inline-grid; place-items: center; flex-shrink: 0; font-size: .95rem; }
.ico-goal { color: var(--fh-primary); }
.ico-yellow::before, .ico-red::before, .ico-second_yellow::before { content: ""; display: inline-block; width: 11px; height: 15px; border-radius: 2px; }
.ico-yellow::before { background: var(--fh-yellow); }
.ico-red::before { background: var(--fh-live); }
.ico-second_yellow::before { background: linear-gradient(135deg, var(--fh-yellow) 50%, var(--fh-live) 50%); }
.ico-sub { color: var(--fh-blue); }
.tl-divider { text-align: center; position: relative; z-index: 1; margin: 6px 0; }
.tl-divider span { background: var(--fh-surface); padding: 2px 12px; font-size: .75rem; font-weight: 700; color: var(--fh-muted); border: 1px solid var(--fh-border); border-radius: 99px; }

/* 數據對比條 */
.stat-row { padding: 8px 16px; }
.stat-row .labels { display: flex; justify-content: space-between; font-size: .85rem; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.stat-row .labels .nm { color: var(--fh-muted); font-size: .8rem; }
.stat-row .labels b.is-lead { color: var(--fh-primary); }
.stat-row .bars { display: flex; gap: 4px; height: 7px; }
.stat-row .bars span { border-radius: 99px; background: var(--fh-surface-3); position: relative; overflow: hidden; flex: 1; }
.stat-row .bars span i { position: absolute; top: 0; bottom: 0; border-radius: 99px; }
.stat-row .bars .h i { right: 0; background: var(--fh-primary); }
.stat-row .bars .a i { left: 0; background: var(--fh-accent); }

/* 陣容球場 */
.pitch {
  position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 68 / 105; max-height: 760px; margin: 0 auto;
  background: repeating-linear-gradient(180deg, #2f8a4f 0 9.5%, #2a7c47 9.5% 19%);
  border: 2px solid rgba(255, 255, 255, .35);
}
.pitch::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px solid rgba(255, 255, 255, .35); }
.pitch::after { content: ""; position: absolute; left: 50%; top: 50%; width: 22%; aspect-ratio: 1; border: 2px solid rgba(255, 255, 255, .35); border-radius: 50%; transform: translate(-50%, -50%); }
.pitch .box { position: absolute; left: 22%; right: 22%; height: 14%; border: 2px solid rgba(255, 255, 255, .35); }
.pitch .box.top { top: -2px; border-top: 0; }
.pitch .box.bottom { bottom: -2px; border-bottom: 0; }
.pitch .pl { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; width: 22%; color: #fff; text-align: center; z-index: 2; }
.pitch .pl .no { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .8rem; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); position: relative; }
.pitch .pl.home .no { background: var(--fh-primary); color: #062a27; }
.pitch .pl.away .no { background: var(--fh-accent); color: #fff; }
.pitch .pl .nm { font-size: .68rem; font-weight: 700; margin-top: 3px; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pitch .pl .rt { position: absolute; top: -6px; right: -14px; font-size: .6rem; font-weight: 800; padding: 0 4px; border-radius: 4px; background: #1d2b33; color: #fff; }
.pitch .pl .rt.hi { background: #16a34a; }
.pitch .pl .rt.lo { background: #b91c1c; }
.pitch .pl .goals { position: absolute; bottom: -4px; left: -10px; font-size: .7rem; }
/* 手機：球場只有 250–360px 寬，每排間距約 40–50px，縮小球員圓標與名字，避免名字壓到下一排（中線兩隊前鋒也不再重疊） */
@media (max-width: 429.98px) {
  .pitch .pl .no { width: 26px; height: 26px; font-size: .7rem; }
  .pitch .pl .nm { font-size: .6rem; line-height: 1.15; margin-top: 2px; }
  .pitch .pl .rt { top: -7px; right: -14px; font-size: .55rem; }
}
.pitch .form-label-h { position: absolute; left: 10px; font-size: .75rem; font-weight: 800; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); z-index: 3; }
.rating { display: inline-block; min-width: 34px; text-align: center; font-weight: 800; font-size: .78rem; padding: 1px 6px; border-radius: 6px; background: var(--fh-surface-3); color: var(--fh-text); }
.rating.hi { background: #16a34a; color: #fff; }
.rating.mid { background: #ca8a04; color: #fff; }
.rating.lo { background: #b91c1c; color: #fff; }

/* ───────────── 新聞 ───────────── */
.news-card { display: flex; gap: 12px; padding: 12px 16px; color: var(--fh-text); border-top: 1px solid var(--fh-border); }
.news-card:first-child { border-top: 0; }
.news-card:hover { background: var(--fh-surface-2); color: var(--fh-text); }
.news-card .thumb { width: 120px; height: auto; aspect-ratio: 16/10; border-radius: 10px; object-fit: cover; background: var(--fh-surface-3); flex-shrink: 0; }
.news-card h3 { font-size: .95rem; font-weight: 700; line-height: 1.45; margin: 0 0 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-card .meta { font-size: .75rem; color: var(--fh-muted); }
.news-tile { display: block; border-radius: var(--fh-radius); overflow: hidden; position: relative; background: var(--fh-surface); border: 1px solid var(--fh-border); color: var(--fh-text); height: 100%; }
.news-tile:hover { color: var(--fh-text); border-color: rgba(var(--fh-primary-rgb), .5); }
.news-tile .thumb { width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; background: var(--fh-surface-3); display: block; }
.news-tile .body { padding: 12px 14px; }
.news-tile h3 { font-size: 1rem; font-weight: 800; line-height: 1.45; margin: 6px 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-tile p { font-size: .85rem; color: var(--fh-text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.news-tile.big .thumb { aspect-ratio: 16/8; }
.blog-card .thumb, .blog-card.big .thumb { aspect-ratio: 1200/630; }
.news-tile.big h3 { font-size: 1.3rem; }
.article { font-size: 1.02rem; line-height: 1.9; }
.article h2 { font-size: 1.25rem; font-weight: 800; margin: 1.6em 0 .6em; }
.article h3 { font-size: 1.1rem; font-weight: 800; margin: 1.4em 0 .5em; }
.article img { border-radius: 12px; }
.article table { width: 100%; margin: 1em 0; }
.article table th, .article table td { padding: 8px; border-bottom: 1px solid var(--fh-border); }
.article dt { color: var(--fh-primary); margin-top: .8em; }
.article dd { margin-left: 0; color: var(--fh-text-2); }
.article blockquote { border-left: 4px solid var(--fh-primary); padding: .5em 1em; background: var(--fh-surface-2); border-radius: 0 10px 10px 0; }

/* ───────────── 球隊／球員卡 ───────────── */
.entity-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 10px; background: var(--fh-surface); border: 1px solid var(--fh-border); border-radius: var(--fh-radius); color: var(--fh-text); text-align: center; height: 100%; transition: transform .15s, border-color .15s; }
.entity-card:hover { color: var(--fh-text); transform: translateY(-2px); border-color: rgba(var(--fh-primary-rgb), .5); }
.entity-card .nm { font-weight: 700; font-size: .92rem; line-height: 1.3; }
.entity-card .sub { font-size: .75rem; color: var(--fh-muted); }
.entity-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; color: var(--fh-text); border-top: 1px solid var(--fh-border); }
.entity-row:first-child { border-top: 0; }
.entity-row:hover { background: var(--fh-surface-2); color: var(--fh-text); }
.entity-row .rank { width: 24px; text-align: center; font-weight: 800; color: var(--fh-muted); }
.entity-row .rank.top { color: var(--fh-primary); }
.entity-row .main { flex: 1; min-width: 0; }
.entity-row .main .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entity-row .main .sub { font-size: .76rem; color: var(--fh-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entity-row .val { font-weight: 900; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.profile-head { background: var(--fh-hero); border-bottom: 1px solid var(--fh-border); padding: 24px 0 0; }
.profile-head .ph-main { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.profile-head h1 { font-size: 1.7rem; font-weight: 900; margin: 0; }
.profile-head .ph-sub { color: var(--fh-text-2); font-size: .9rem; display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; }
.profile-head .fh-tabs { margin: 18px 0 0; border-bottom: 0; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 0; font-size: .9rem; }
.kv dt { color: var(--fh-muted); font-weight: 500; padding: 8px 0; border-bottom: 1px solid var(--fh-border); }
.kv dd { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--fh-border); font-weight: 600; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.stat-tile { background: var(--fh-surface-2); border: 1px solid var(--fh-border); border-radius: 12px; padding: 12px; text-align: center; }
.stat-tile .v { font-size: 1.5rem; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-tile .l { font-size: .75rem; color: var(--fh-muted); }

/* 比較 */
.compare-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.compare-head .side { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-weight: 800; overflow-wrap: anywhere; }
/* 球員比較：兩張 120px 照片在 320px 手機上會把右側球員推出卡片（被裁切），照片隨螢幕寬度縮小 */
.compare-head .side > .photo-lg { width: clamp(72px, 26vw, 120px); height: auto; aspect-ratio: 1 / 1; }
/* 近況徽章在窄欄（比賽頁頂部、球隊比較）放不下 5 個時換行置中，而不是溢出到比分或畫面外 */
.match-hero .form-badges, .compare-head .form-badges { flex-wrap: wrap; justify-content: center; max-width: 100%; }
.compare-head .vs { font-weight: 900; font-size: 1.3rem; color: var(--fh-muted); }

/* ───────────── 狀態頁 ───────────── */
.empty-state { text-align: center; padding: 40px 20px; color: var(--fh-muted); }
.empty-state .ico { font-size: 2.6rem; display: block; margin-bottom: 8px; opacity: .7; }
.empty-state h3 { font-size: 1.05rem; color: var(--fh-text); font-weight: 700; }
.empty-state p { font-size: .9rem; margin: 0 auto; max-width: 420px; }
.error-page { text-align: center; padding: 60px 16px; }
.error-page .code { font-size: clamp(4rem, 14vw, 8rem); font-weight: 900; line-height: 1; background: var(--fh-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.skeleton { background: linear-gradient(90deg, var(--fh-skeleton) 25%, var(--fh-skeleton-hi) 37%, var(--fh-skeleton) 63%); background-size: 400% 100%; animation: fh-shimmer 1.4s ease infinite; border-radius: 8px; }
@keyframes fh-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.skeleton-row { display: grid; grid-template-columns: 50px 1fr 60px 1fr; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--fh-border); }
.skeleton-row .skeleton { height: 16px; }
.api-error { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; background: rgba(255, 77, 94, .1); border: 1px solid rgba(255, 77, 94, .3); color: var(--fh-text); font-size: .88rem; }

/* ───────────── 麵包屑、分頁 ───────────── */
.fh-breadcrumb { font-size: .8rem; color: var(--fh-muted); margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fh-breadcrumb a { color: var(--fh-muted); }
.fh-breadcrumb a:hover { color: var(--fh-primary); }
.fh-breadcrumb .sep { opacity: .5; }
.fh-pagination { display: flex; justify-content: center; gap: 6px; margin-top: 20px; flex-wrap: wrap; }
.fh-pagination a, .fh-pagination span { min-width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; white-space: nowrap; padding: 0 10px; border-radius: 10px; background: var(--fh-surface); border: 1px solid var(--fh-border); color: var(--fh-text-2); font-weight: 600; font-size: .88rem; }
.fh-pagination a:hover { border-color: var(--fh-primary); color: var(--fh-primary); }
.fh-pagination .active { background: var(--fh-primary); color: var(--fh-primary-ink); border-color: var(--fh-primary); }
.fh-pagination .disabled { opacity: .4; }

/* ───────────── 收藏、分享 ───────────── */
.fav-btn { color: var(--fh-muted); background: none; border: 0; font-size: 1.1rem; padding: 4px; line-height: 1; }
.fav-btn:hover { color: var(--fh-yellow); }
.fav-btn.on { color: var(--fh-yellow); }
.fav-btn.on .bi-star::before { content: "\f586"; }
.remind-btn.on { color: var(--fh-primary); }

/* ───────────── 搜尋 ───────────── */
.search-modal .modal-content { background: var(--fh-surface); border: 1px solid var(--fh-border-strong); border-radius: 18px; color: var(--fh-text); }
.search-modal .search-input { height: 54px; font-size: 1.05rem; border: 0; background: transparent; padding-left: 48px; padding-right: 56px; } /* 右側留給關閉鈕：輸入文字後瀏覽器原生的清除（×）鈕不會疊在關閉鈕下面 */
.search-modal .search-input:focus { box-shadow: none; background: transparent; }
.search-modal .s-ico { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--fh-muted); font-size: 1.1rem; }
.search-results h6 { font-size: .72rem; color: var(--fh-muted); text-transform: uppercase; letter-spacing: 1px; padding: 10px 16px 4px; margin: 0; }
.search-results a { display: flex; align-items: center; gap: 10px; padding: 8px 16px; color: var(--fh-text); }
.search-results a:hover, .search-results a.focus { background: var(--fh-surface-2); }
.search-results .sub { font-size: .76rem; color: var(--fh-muted); }

/* ───────────── Footer ───────────── */
.fh-footer { background: var(--fh-bg-2); border-top: 1px solid var(--fh-border); padding: 36px 0 24px; margin-top: 40px; font-size: .88rem; color: var(--fh-muted); }
.fh-footer h6 { color: var(--fh-text); font-weight: 800; font-size: .9rem; margin-bottom: 10px; }
.fh-footer a { color: var(--fh-muted); display: block; padding: 3px 0; }
.fh-footer a:hover { color: var(--fh-primary); }
.fh-footer .copy { border-top: 1px solid var(--fh-border); margin-top: 24px; padding-top: 16px; font-size: .78rem; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }

/* ───────────── 雜項 ───────────── */
.fh-toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(20px); background: var(--fh-surface-3); color: var(--fh-text); padding: 10px 18px; border-radius: 12px; box-shadow: var(--fh-shadow); opacity: 0; transition: all .25s; z-index: 2000; font-size: .9rem; pointer-events: none; border: 1px solid var(--fh-border-strong); }
.fh-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.announce { background: var(--fh-gradient); color: #fff; text-align: center; font-size: .85rem; padding: 6px 12px; font-weight: 600; }
.announce a { color: #fff; text-decoration: underline; }
.region-title { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--fh-muted); margin: 18px 0 10px; }
.comp-tile { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--fh-surface); border: 1px solid var(--fh-border); border-radius: 12px; color: var(--fh-text); height: 100%; transition: border-color .15s, transform .15s; }
.comp-tile:hover { color: var(--fh-text); border-color: rgba(var(--fh-primary-rgb), .5); transform: translateY(-1px); }
.comp-tile .nm { font-weight: 700; line-height: 1.3; }
.comp-tile .sub { font-size: .75rem; color: var(--fh-muted); }
.game-card { display: block; padding: 22px; border-radius: 18px; color: #fff; position: relative; overflow: hidden; min-height: 170px; }
.game-card:hover { color: #fff; transform: translateY(-2px); }
.game-card h3 { font-weight: 900; font-size: 1.2rem; }
.game-card i.big { position: absolute; right: -8px; bottom: -18px; font-size: 6rem; opacity: .22; }
.game-card.g1 { background: linear-gradient(135deg, #12a594, #20C6B5); }
.game-card.g2 { background: linear-gradient(135deg, #7c3aed, #A95BEF); }
.game-card.g3 { background: linear-gradient(135deg, #2563eb, #4aa8ff); }
.game-card.g4 { background: linear-gradient(135deg, #db2777, #f472b6); }
.chart-box { position: relative; width: 100%; }
.ad-slot { display: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print { .fh-header, .fh-bottom-nav, .fh-footer { display: none !important; } body.fh { padding: 0; } }

/* 2026 FIFA 世界盃專區連結卡 */
.wc-strip { margin-top: 4px; }
.wc-strip-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--fh-radius); color: #fff;
  background: radial-gradient(120% 160% at 100% 0%, rgba(32, 198, 181, .35), transparent 55%), linear-gradient(135deg, #0b1f3a, #24343D 60%, #304C5C); border: 1px solid rgba(255, 255, 255, .08); }
.wc-strip-card:hover { color: #fff; filter: brightness(1.08); }
.wc-strip-card h2, .wc-strip-card b { font-size: 1.05rem; font-weight: 900; margin: 0; color: #fff; }
.wc-strip-card p { margin: 2px 0 0; font-size: .85rem; color: rgba(255, 255, 255, .8); }
.wc-strip-card p b { font-size: inherit; }
.wc-strip-trophy { font-size: 1.8rem; color: #facc15; line-height: 1; flex-shrink: 0; }
.wc-strip-cta { margin-left: auto; font-size: .82rem; font-weight: 700; color: #7ff0e2; white-space: nowrap; flex-shrink: 0; }
@media (max-width: 575.98px) { .wc-strip-cta { display: none; } }

/* ═════════════ 動態效果層（Motion）═════════════
 * 只用 transform / opacity 做動畫（不觸發版面重排、不產生 CLS）。
 * 捲動進場效果只在 <html class="js-anim"> 時啟用：沒有 JS 或使用者偏好減少動態時，內容一律直接顯示。
 */

/* Hero：流動極光 + 球場線條 */
.fh-hero { isolation: isolate; }
.fh-hero::before, .fh-hero::after {
  content: ""; position: absolute; z-index: -1; pointer-events: none; border-radius: 50%; opacity: .55;
  will-change: transform; /* 不用 filter: blur（手機每格重繪大面積模糊很耗效能）；放射漸層本身已柔和淡出 */
}
.fh-hero::before { width: 520px; height: 520px; left: -140px; top: -260px; background: radial-gradient(circle, rgba(var(--fh-primary-rgb), .55), transparent 65%); animation: fh-orb-a 18s ease-in-out infinite alternate; }
.fh-hero::after { width: 560px; height: 560px; right: -160px; top: -200px; background: radial-gradient(circle, rgba(var(--fh-accent-rgb), .5), transparent 65%); animation: fh-orb-b 22s ease-in-out infinite alternate; }
@keyframes fh-orb-a { 0% { transform: translate3d(0, 0, 0) scale(1); } 100% { transform: translate3d(180px, 90px, 0) scale(1.2); } }
@keyframes fh-orb-b { 0% { transform: translate3d(0, 0, 0) scale(1.1); } 100% { transform: translate3d(-200px, 120px, 0) scale(.9); } }
.fh-hero .fh-pitch {
  position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background:
    radial-gradient(circle at 75% 50%, transparent 0 88px, rgba(255, 255, 255, .07) 89px 90px, transparent 91px),
    linear-gradient(90deg, transparent calc(75% - 1px), rgba(255, 255, 255, .07) calc(75% - 1px) 75%, transparent 75%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .018) 0 80px, transparent 80px 160px);
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 100%); mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
}
[data-bs-theme="light"] .fh-hero .fh-pitch { opacity: 1; filter: invert(1) opacity(.5); }
@media (max-width: 991.98px) { .fh-hero .fh-pitch { display: none; } .fh-hero::before, .fh-hero::after { width: 340px; height: 340px; } }

/* 漸層文字流動 */
.fh-hero h1 .grad, .error-page .code { background-size: 220% 100%; animation: fh-grad-flow 7s ease-in-out infinite alternate; }
@keyframes fh-grad-flow { 0% { background-position: 0 50%; } 100% { background-position: 100% 50%; } }

/* Hero 進場（不影響 LCP：只做位移，透明度從 .01 開始仍算繪製） */
.fh-hero h1, .fh-hero p.lead, .fh-hero .hero-search, .fh-hero .chips-scroll, .fh-hero .fh-badge { animation: fh-rise .7s cubic-bezier(.2, .8, .2, 1) both; }
.fh-hero p.lead { animation-delay: .08s; }
.fh-hero .hero-search { animation-delay: .16s; }
.fh-hero .chips-scroll { animation-delay: .24s; }
@keyframes fh-rise { from { transform: translateY(14px); opacity: .01; } to { transform: none; opacity: 1; } }

/* 焦點賽事卡：漂浮 + 旋轉光暈邊框 + 滑鼠傾斜 */
.fh-hero-match { position: relative; transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .25s ease-out, border-color .2s, box-shadow .25s; animation: fh-rise .8s .1s cubic-bezier(.2, .8, .2, 1) both; }
.fh-hero-match::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--fh-angle, 0deg), transparent 0 60%, rgba(var(--fh-primary-rgb), .9) 75%, rgba(var(--fh-accent-rgb), .9) 90%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: fh-spin 5s linear infinite; opacity: .9;
}
.fh-hero-match.is-live::before { background: conic-gradient(from var(--fh-angle, 0deg), transparent 0 55%, rgba(255, 77, 94, .95) 75%, rgba(250, 204, 21, .9) 90%, transparent 100%); animation-duration: 2.6s; }
@property --fh-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes fh-spin { to { --fh-angle: 360deg; } }
.fh-hero-match::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(400px 160px at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .10), transparent 70%); opacity: 0; transition: opacity .25s; }
.fh-hero-match:hover { box-shadow: 0 18px 50px rgba(0, 0, 0, .35), 0 0 0 1px rgba(var(--fh-primary-rgb), .25); }
.fh-hero-match:hover::after { opacity: 1; }
.fh-hero-match .logo-64 { transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.fh-hero-match:hover .hm-team:first-child .logo-64 { transform: translateX(-4px) scale(1.06); }
.fh-hero-match:hover .hm-team:last-child .logo-64 { transform: translateX(4px) scale(1.06); }
.fh-hero-match .hm-score { text-shadow: 0 0 24px rgba(var(--fh-primary-rgb), .35); }
.fh-hero-match.is-live .hm-score { text-shadow: 0 0 24px rgba(255, 77, 94, .45); }

/* 頁首：捲動後加深 + 頂部閱讀進度條 */
.fh-header { transition: box-shadow .25s, background-color .25s; }
.fh-header.scrolled { box-shadow: 0 8px 30px rgba(0, 0, 0, .25); }
[data-bs-theme="light"] .fh-header.scrolled { box-shadow: 0 8px 30px rgba(16, 42, 56, .10); }
.fh-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--fh-gradient);
  transform-origin: 0 50%; transform: scaleX(var(--fh-progress, 0)); pointer-events: none;
}
.fh-brand .ball { transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.fh-brand:hover .ball { transform: rotate(360deg); }

/* 導覽列：漸層底線滑入、下拉選單淡入 */
.fh-nav > li > a, .fh-nav > li > button { position: relative; transition: color .2s, background-color .2s; }
.fh-nav > li > a::after, .fh-nav > li > button::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px; border-radius: 2px; background: var(--fh-gradient);
  transform: scaleX(0); transform-origin: 50% 50%; transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}
.fh-nav > li > a:hover::after, .fh-nav > li > button:hover::after, .fh-nav > li > a.active::after, .fh-nav > li > button.active::after { transform: scaleX(1); }
.fh-mega { animation: fh-drop .22s cubic-bezier(.2, .8, .2, 1); }
.fh-mega.small { animation-name: fh-drop-r; }
@keyframes fh-drop { from { opacity: 0; transform: translateX(-50%) translateY(-6px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes fh-drop-r { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* 手機底部導覽：選中項目上方光條 */
.fh-bottom-nav a::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--fh-gradient); transform: scaleX(0); transition: transform .25s; }
.fh-bottom-nav a.active::before { transform: scaleX(1); }
.fh-bottom-nav a:active i { transform: scale(.85); }
.fh-bottom-nav i { transition: transform .15s; }

/* 區塊標題：漸層光條 */
.fh-section-title .bar { background-size: 100% 220%; animation: fh-bar-flow 3s ease-in-out infinite alternate; box-shadow: 0 0 12px rgba(var(--fh-primary-rgb), .45); }
@keyframes fh-bar-flow { from { background-position: 50% 0; } to { background-position: 50% 100%; } }
.fh-card-header h2 i, .fh-card-header h3 i { filter: drop-shadow(0 0 6px rgba(var(--fh-primary-rgb), .45)); }

/* 卡片懸停：上浮 + 光暈（只在有滑鼠的裝置） */
.news-tile, .entity-card, .comp-tile, .match-card, .game-card, .wc-strip-card, .fh-chip, .fh-pagination a {
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s, border-color .2s, color .2s, background-color .2s, filter .2s;
}
.news-tile .thumb { transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.entity-card img { transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
@media (hover: hover) and (pointer: fine) {
  .news-tile:hover, .entity-card:hover, .match-card:hover, .game-card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(0, 0, 0, .28), 0 0 0 1px rgba(var(--fh-primary-rgb), .18); }
  [data-bs-theme="light"] .news-tile:hover, [data-bs-theme="light"] .entity-card:hover, [data-bs-theme="light"] .match-card:hover { box-shadow: 0 14px 34px rgba(16, 42, 56, .12), 0 0 0 1px rgba(var(--fh-primary-rgb), .2); }
  .news-tile:hover .thumb { transform: scale(1.06); }
  .entity-card:hover img { transform: scale(1.08) rotate(-2deg); }
  .comp-tile:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0, 0, 0, .2); }
  .fh-chip:hover { transform: translateY(-1px); }
  .wc-strip-card:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(11, 31, 58, .45); }
  .wc-strip-card:hover .wc-strip-trophy { animation: fh-wiggle .6s ease-in-out; }
}
.news-tile .thumb-wrap, .news-tile > picture { display: block; overflow: hidden; }
@keyframes fh-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg) scale(1.1); } 75% { transform: rotate(10deg) scale(1.1); } }

/* 世界盃連結卡：掃光 */
.wc-strip-card { position: relative; overflow: hidden; }
.wc-strip-card::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .16), transparent); transform: skewX(-20deg);
  animation: fh-sweep 5.5s ease-in-out infinite;
}
@keyframes fh-sweep { 0%, 60% { left: -40%; } 100% { left: 130%; } }
.wc-strip-trophy { filter: drop-shadow(0 0 10px rgba(250, 204, 21, .55)); }

/* 按鈕：漸層按鈕光澤、按下回彈 */
.btn-gradient { position: relative; overflow: hidden; background-size: 160% 100%; transition: background-position .4s, filter .2s, transform .1s; }
.btn-gradient:hover { background-position: 100% 0; }
.btn-fh:active, .btn-gradient:active, .btn-fh-outline:active, .btn-ghost:active, .fh-icon-btn:active { transform: scale(.96); }
.fh-icon-btn { transition: background-color .2s, color .2s, border-color .2s, transform .1s; }
.fav-btn { transition: transform .2s, color .2s; }
.fav-btn.on { animation: fh-pop .4s cubic-bezier(.2, .8, .2, 1.4); }
@keyframes fh-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* 搜尋框聚焦光暈 */
.hero-search .form-control { transition: box-shadow .25s, border-color .25s; }
.hero-search .form-control:focus { border-color: rgba(var(--fh-primary-rgb), .6); box-shadow: 0 0 0 4px rgba(var(--fh-primary-rgb), .15), 0 10px 30px rgba(var(--fh-primary-rgb), .15); }

/* 即時比賽：左側脈動光條、比分光暈 */
.match-row.is-live::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--fh-live);
  animation: fh-live-bar 1.6s ease-in-out infinite;
}
@keyframes fh-live-bar { 0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(255, 77, 94, .8); } 50% { opacity: .45; box-shadow: none; } }
.match-row.is-live .m-score { box-shadow: 0 0 0 1px rgba(255, 77, 94, .25) inset; }
.match-card.is-live { animation: fh-live-glow 2.4s ease-in-out infinite; }
@keyframes fh-live-glow { 0%, 100% { box-shadow: 0 0 0 1px rgba(255, 77, 94, .15) inset; } 50% { box-shadow: 0 0 0 1px rgba(255, 77, 94, .35) inset, 0 0 22px rgba(255, 77, 94, .18); } }

/* 進球動畫：比分彈跳 + 「進球！」標籤 */
.match-row.goal .m-score, .goal-pop { animation: fh-goal-pop .9s cubic-bezier(.2, .8, .2, 1.4); }
@keyframes fh-goal-pop { 0% { transform: scale(1); } 25% { transform: scale(1.35); background: rgba(250, 204, 21, .35); } 100% { transform: scale(1); } }
.match-card { position: relative; }
.match-card.flash { animation: fh-card-flash 2.5s ease-out; }
@keyframes fh-card-flash { 0% { box-shadow: 0 0 0 2px rgba(var(--fh-primary-rgb), .9), 0 0 28px rgba(var(--fh-primary-rgb), .45); } 100% { box-shadow: 0 0 0 0 transparent; } }
.match-row.goal::after, .match-card.goal::after {
  content: "⚽ 進球！"; position: absolute; left: 50%; top: -2px; transform: translateX(-50%); z-index: 2;
  font-size: .68rem; font-weight: 900; color: #111; background: #facc15; border-radius: 99px; padding: 1px 8px; white-space: nowrap;
  animation: fh-goal-tag 3.2s ease-out forwards; pointer-events: none;
}
.match-card.goal::after { top: 6px; }
@keyframes fh-goal-tag { 0% { opacity: 0; transform: translate(-50%, 6px) scale(.6); } 12% { opacity: 1; transform: translate(-50%, -4px) scale(1.08); } 20% { transform: translate(-50%, -2px) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -8px); } }

/* 表格列懸停 */
.fh-table tbody tr td { transition: background-color .15s; }
.fh-table tbody tr:hover td:first-child { box-shadow: 3px 0 0 var(--fh-primary) inset; }

/* 頁尾漸層頂線 */
.fh-footer { position: relative; }
.fh-footer::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px; background: var(--fh-gradient); opacity: .6; }

/* 回到頂部 */
.fh-to-top {
  position: fixed; right: 16px; bottom: 24px; z-index: 1020; width: 44px; height: 44px; border-radius: 50%; border: 0;
  display: grid; place-items: center; color: #fff; background: var(--fh-gradient); box-shadow: 0 8px 24px rgba(0, 0, 0, .3); font-size: 1.1rem;
  opacity: 0; transform: translateY(16px) scale(.8); pointer-events: none; transition: opacity .25s, transform .25s cubic-bezier(.2, .8, .2, 1.3);
}
.fh-to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.fh-to-top:hover { filter: brightness(1.1); }
@media (max-width: 991.98px) { .fh-to-top { bottom: calc(76px + env(safe-area-inset-bottom)); right: 12px; width: 40px; height: 40px; } }

/* 捲動進場（JS 只會套用在一開始不在畫面內的元素） */
html.js-anim .reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease-out, transform .7s cubic-bezier(.2, .8, .2, 1); transition-delay: calc(var(--i, 0) * 60ms); }
html.js-anim .reveal.in { opacity: 1; transform: none; }

/* 切換深淺色時平滑過渡 */
html.theme-fade, html.theme-fade *, html.theme-fade *::before, html.theme-fade *::after { transition: background-color .35s, color .35s, border-color .35s, fill .35s !important; }

/* 世界盃數據卡 */
.wc-kpi { position: relative; overflow: hidden; transition: transform .25s, border-color .25s; }
.wc-kpi::after { content: ""; position: absolute; right: -20px; top: -20px; width: 70px; height: 70px; border-radius: 50%; background: radial-gradient(circle, rgba(var(--fh-primary-rgb), .25), transparent 70%); }
@media (hover: hover) and (pointer: fine) { .wc-kpi:hover { transform: translateY(-3px); border-color: rgba(var(--fh-primary-rgb), .45); } }

/* 尊重「減少動態效果」偏好 */
@media (prefers-reduced-motion: reduce) {
  html.js-anim .reveal { opacity: 1; transform: none; }
  .fh-hero-match { transform: none !important; }
  .fh-hero::before, .fh-hero::after { display: none; }
  /* AdminLTE 在減少動態時對 .fade 強制 opacity:1，選單／搜尋的背景遮罩會變成全黑；維持 Bootstrap 原本的半透明 */
  .offcanvas-backdrop.show, .modal-backdrop.show { opacity: .5 !important; }
}

/* iPhone：輸入框字級小於 16px 時，點擊會讓 Safari 自動放大整個頁面且不會縮回（看起來像跑版），手機上統一為 16px */
@media (max-width: 575.98px) {
  body.fh input:not([type=checkbox]):not([type=radio]):not([type=range]), body.fh select, body.fh textarea { font-size: 16px; }
}
