/* 福來偉 fx-nav 全站手機／平板底部導覽列（2026-11-01 本機預覽，Grok Bot）
   - 只在 <1024px 顯示；電腦版 display:none，版面完全不變。
   - 沿用 fx-member 的深色＋淡金 rgba(232,192,104,…)；字級最小 16px。
   - 只動 transform / opacity；prefers-reduced-motion 時無動畫。
   - 與浮動 LINE 按鈕（.fx-fab）共存：有導覽列時浮動按鈕往上移到導覽列上方。 */

.fx-tabbar { display: none; }

@media (max-width: 1023px) {
  .fx-tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 9000;
    display: grid; grid-template-columns: repeat(5, 1fr);
    padding: 6px max(6px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px));
    background: linear-gradient(180deg, rgba(16,14,10,.94), rgba(7,7,9,.97));
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-top: 1px solid rgba(232,192,104,.28);
    box-shadow: 0 -10px 30px rgba(0,0,0,.45);
    font-family: "Noto Sans TC", sans-serif;
    transition: transform .3s ease, opacity .3s ease;
  }
  /* 頂端一條淡金細光 */
  .fx-tabbar::before {
    content: ""; position: absolute; left: 8%; right: 8%; top: -1px; height: 1px; pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(246,227,161,.85), transparent);
    opacity: .55;
  }
  .fx-tab {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 54px; border-radius: 14px;
    color: rgba(243,226,176,.72); font-size: 16px; line-height: 1.2; letter-spacing: 1px; text-decoration: none !important;
    -webkit-tap-highlight-color: transparent;
  }
  .fx-tab:hover { color: #f6e3a1; }
  .fx-tab-ic { position: relative; display: block; width: 24px; height: 24px; }
  .fx-tab svg { width: 24px; height: 24px; stroke: currentColor; display: block; }
  .fx-tab.on { color: #f6e3a1; background: radial-gradient(70% 90% at 50% 0%, rgba(232,192,104,.16), transparent 70%); }
  .fx-tab.on::before {
    content: ""; position: absolute; top: -6px; left: 28%; right: 28%; height: 2px; border-radius: 2px;
    background: #e8c068; box-shadow: 0 0 10px rgba(232,192,104,.85);
  }
  .fx-tab.on .fx-tab-tx { font-weight: 700; }
  .fx-tab:active .fx-tab-ic { transform: scale(.9); }
  .fx-tab-ic { transition: transform .15s ease; }
  .fx-tab-badge {
    position: absolute; top: -7px; left: 15px; min-width: 22px; height: 22px; border-radius: 11px; padding: 0 5px;
    background: #e8c068; color: #1a1408; font-size: 16px; line-height: 22px; font-weight: 700; text-align: center;
    box-shadow: 0 0 0 2px rgba(10,9,7,.95);
  }
  .fx-tab:focus-visible { outline: 2px solid #f6e3a1; outline-offset: -2px; }

  /* 頁面最下方留空間，不擋內容／頁尾 */
  body:has(.fx-tabbar), body.fx-has-tabbar { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)) !important; }

  /* 浮動 LINE / 聯絡按鈕：移到導覽列上方（覆蓋 fx-flow.css 的 bottom） */
  body:has(.fx-tabbar) .fx-fab, body.fx-has-tabbar .fx-fab,
  body:has(.fx-tabbar) .fx-fab-new, body.fx-has-tabbar .fx-fab-new {
    bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* 手機鍵盤打開（輸入中）時讓開，避免擋住輸入框 */
  .fx-tabbar.fx-tab-hide { transform: translateY(110%); opacity: 0; pointer-events: none; }
}

/* 會員首頁原本的頁內導覽 .fm-tabbar 由共用導覽取代（預覽中隱藏，避免兩條） */
body:has(.fx-tabbar) .fm-tabbar { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .fx-tabbar, .fx-tab-ic { transition: none !important; }
}
@media print { .fx-tabbar { display: none !important; } }

/* fontscale.css 對 nav a 設 15px!important；導覽列字級最低 16px，用更高權重蓋回 */
@media (max-width: 1023.98px) {
  html body nav.fx-tabbar a.fx-tab, html body nav.fx-tabbar a.fx-tab .fx-tab-tx { font-size: 16px !important; }
}
