/* 福來偉 會員中心豪華版 fx-member（2026-11-01 上線，Grok Bot，August 指示；用於 /member/index.php）
   延續 fx-flow 的淡金色 rgba(var(--fx-gold),…)：深色底、金色細線、能量流動。
   只動 transform / opacity / stroke-dashoffset；捲進畫面才開始；分頁切走暫停；「減少動態」全部關閉。
   數字、名稱皆由 PHP 讀真實資料；等級福利、優惠券尚未開放，一律暗色、不可點、標「即將開放」。 */

:root {
  --fx-gold: 232,192,104;
  --fm-bg: #07070a;
  --fm-card: rgba(22,20,16,.78);
  --fm-line: rgba(232,192,104,.22);
  --fm-text: #f3e2b0;
  --fm-dim: rgba(243,226,176,.72);
}
body.fw-member:has(.fm-main) { background: var(--fm-bg); color: var(--fm-text); }
.fm-main { color: var(--fm-text); }
.fm-bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(var(--fx-gold),.16), transparent 60%),
    radial-gradient(80% 50% at 100% 100%, rgba(120,90,30,.18), transparent 60%),
    linear-gradient(180deg, var(--fm-bg2) 0%, var(--fm-bg2) 100%);
}
.fm-main { max-width: 32rem; margin: 0 auto; padding: 5.5rem 1rem 7.5rem; }
@media (min-width: 1024px) { .fm-main { max-width: 64rem; padding-bottom: 4rem; } }

.fm-head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: .4rem; }
.fm-intro { margin-bottom: 1rem; }
.fm-intro a, .fm-card .fm-note a { color: var(--fm-gold); }
.fm-row { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.fm-big { font-size: 1.25rem; color: var(--fm-gold); font-weight: 700; letter-spacing: 2px; }
.fm-txt { color: var(--fm-text); }
.fm-break { word-break: break-all; text-align: right; min-width: 0; }
.fm-h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: 4px; color: var(--fm-gold); }
.fm-chip {
  display: inline-flex; align-items: center; border: 1px solid rgba(var(--fx-gold),.5);
  background: rgba(var(--fx-gold),.1); border-radius: 999px; padding: 4px 12px; font-size: 16px; color: var(--fm-gold);
}
.fm-note { font-size: 16px; color: var(--fm-dim); line-height: 1.7; }
.fm-label { font-size: 16px; color: var(--fm-dim); letter-spacing: 1px; }
.fm-pending {
  display: inline-block; font-size: 16px; border: 1px dashed rgba(var(--fx-gold),.55);
  color: var(--fm-gold); border-radius: 8px; padding: 1px 8px;
}

/* ---------- 版面：手機堆疊，桌機兩欄 ---------- */
.fm-grid { display: grid; gap: 1rem; }
@media (min-width: 1024px) {
  .fm-grid { grid-template-columns: 1.1fr 1fr; align-items: start; }
  .fm-span2 { grid-column: 1 / -1; }
  .fm-member-wrap { grid-row: span 2; }
  .fm-grid { grid-auto-flow: row dense; }
}

/* ---------- 通用卡片：金色細框 + 進場 ---------- */
.fm-card {
  position: relative; border-radius: 20px; padding: 1.25rem;
  background: var(--fm-card); border: 1px solid var(--fm-line);
  box-shadow: 0 10px 30px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,235,180,.06);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1);
}
/* 只有 JS 啟動後才先藏起來等進場；JS 沒載入時內容照常顯示 */
.fm-live .fm-card:not(.fm-in) { opacity: 0; transform: translateY(14px); }
.fm-card h2 { font-size: 1.2rem; color: var(--fm-gold); font-weight: 700; letter-spacing: 2px; margin-bottom: .5rem; }
.fm-card-edge {   /* 卡片外框描線（stroke-dashoffset） */
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible;
}
.fm-card-edge rect {
  fill: none; stroke: rgb(var(--fx-gold)); stroke-width: 1.2;
  stroke-dasharray: 1 1; stroke-dashoffset: 1; opacity: .8;
  transition: stroke-dashoffset 1.4s cubic-bezier(.55,0,.25,1) .1s, opacity 1.2s ease 1.5s;
}
.fm-in .fm-card-edge rect { stroke-dashoffset: 0; opacity: .28; }

/* ---------- 會員卡（主視覺） ---------- */
.fm-member-card {
  position: relative; overflow: hidden; border-radius: 22px; aspect-ratio: 1.586 / 1;
  padding: 1.15rem 1.25rem; color: #2a1d05;
  background:
    linear-gradient(135deg, var(--fm-gold) 0%, #d9b45a 28%, #fbeebc 46%, #b88a2e 70%, #e9cd7d 100%);
  box-shadow: 0 18px 40px rgba(0,0,0,.55), 0 0 0 1px rgba(255,240,200,.35) inset, 0 0 40px rgba(var(--fx-gold),.18);
  transform: perspective(900px) rotateX(0deg) rotateY(0deg);
  transition: transform .5s ease;
}
.fm-member-card.fm-tier-l0 { background: linear-gradient(135deg,#d9d6cf 0%,#9a978f 30%,#f1efe9 48%,#7d7a73 72%,#c9c6bf 100%); }
.fm-member-card.fm-tier-l2 { background: linear-gradient(135deg,#2a2418 0%,#4a3a1a 30%,#8a6a2a 48%,#2b2213 72%,#5a4720 100%); color:var(--fm-gold); }
.fm-member-card.fm-tier-l3 { background: linear-gradient(135deg,#0d0d10 0%,#22201b 30%,#3a3324 48%,#101012 72%,#2a261d 100%); color:var(--fm-gold); }
.fm-mc-sheen {  /* 緩慢光澤掃過：只動 transform */
  position: absolute; top: -50%; left: -60%; width: 45%; height: 200%; pointer-events: none;
  background: linear-gradient(100deg, transparent 0%, rgba(255,255,255,.0) 30%, rgba(255,255,255,.55) 50%, rgba(255,255,255,0) 70%, transparent 100%);
  transform: translateX(-30%) rotate(14deg); opacity: .0;
}
.fm-live .fm-mc-sheen { animation: fmSheen 6.5s cubic-bezier(.45,0,.25,1) infinite 1s; }
@keyframes fmSheen {
  0% { transform: translateX(-40%) rotate(14deg); opacity: 0; }
  12% { opacity: .9; }
  45% { transform: translateX(420%) rotate(14deg); opacity: .9; }
  55%,100% { transform: translateX(420%) rotate(14deg); opacity: 0; }
}
.fm-mc-flow { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.fm-mc-flow path { fill: none; stroke: rgba(70,45,5,.45); stroke-width: 1; stroke-dasharray: 1 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset 2s cubic-bezier(.55,0,.25,1); transition-delay: var(--fx-d,0s); }
.fm-tier-l2 .fm-mc-flow path, .fm-tier-l3 .fm-mc-flow path { stroke: rgba(246,227,161,.45); }
.fm-in .fm-mc-flow path { stroke-dashoffset: 0; }
.fm-mc-flow .fm-dot { fill: #fff8dc; opacity: 0; transition: opacity .8s ease 1.8s; }
.fm-in .fm-mc-flow .fm-dot { opacity: .95; }
.fm-mc-top { position: relative; display: flex; justify-content: space-between; align-items: flex-start; }
.fm-mc-brand { font-weight: 800; letter-spacing: 5px; font-size: 1.05rem; }
.fm-mc-brand small { display: block; font-weight: 600; letter-spacing: 3px; font-size: 16px; opacity: .8; }
.fm-mc-tier { text-align: right; }
.fm-mc-tier b { display: block; font-size: 1.9rem; line-height: 1; letter-spacing: 2px; }
.fm-mc-tier span { font-size: 16px; letter-spacing: 2px; opacity: .85; }
.fm-mc-chip { position: relative; width: 40px; height: 28px; border-radius: 7px; margin-top: -.6rem;
  background: linear-gradient(135deg,var(--fm-gold),#c79b3e); box-shadow: inset 0 0 0 1px rgba(80,55,10,.4); }
.fm-member-card { display: flex; flex-direction: column; justify-content: space-between; }
.fm-mc-bottom { position: relative; display: flex; justify-content: space-between; align-items: flex-end; gap: .5rem; }
.fm-mc-name { font-size: 1.25rem; font-weight: 700; letter-spacing: 3px; }
.fm-mc-no { font-family: ui-monospace, Menlo, monospace; font-size: 16px; letter-spacing: 1px; opacity: .85; white-space: nowrap; }
.fm-mc-perk { font-size: 16px; border: 1px solid currentColor; border-radius: 999px; padding: 1px 10px; opacity: .85; white-space: nowrap; }

.fm-tier-strip { display: flex; gap: .4rem; margin-top: .85rem; }
.fm-tier-strip span { flex: 1; text-align: center; font-size: 16px; padding: 6px 0; border-radius: 10px;
  border: 1px solid rgba(var(--fx-gold),.22); color: var(--fm-dim); }
.fm-tier-strip span.on { border-color: rgba(var(--fx-gold),.8); color: var(--fm-gold); background: rgba(var(--fx-gold),.12); }

/* ---------- 快捷 ---------- */
.fm-quick { display: grid; grid-template-columns: repeat(4,1fr); gap: .6rem; }
.fm-quick a, .fm-quick button {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 84px; border-radius: 16px; border: 1px solid rgba(var(--fx-gold),.25);
  background: rgba(var(--fx-gold),.06); color: var(--fm-text); font-size: 16px; text-decoration: none;
}
.fm-quick svg { width: 26px; height: 26px; stroke: var(--fm-gold); }
.fm-badge { position: absolute; top: 6px; right: 8px; min-width: 22px; height: 22px; border-radius: 11px;
  background: var(--fm-gold); color: var(--fm-dark); font-size: 16px; line-height: 22px; text-align: center; padding: 0 5px; font-weight: 700; }

/* ---------- 進度環 ---------- */
.fm-ring-wrap { display: flex; align-items: center; gap: 1rem; }
.fm-ring { width: 128px; height: 128px; flex: 0 0 auto; }
.fm-ring .bg { fill: none; stroke: rgba(var(--fx-gold),.14); stroke-width: 9; }
.fm-ring .fg { fill: none; stroke: url(#fmRingGrad); stroke-width: 9; stroke-linecap: round;
  stroke-dasharray: 1 1; stroke-dashoffset: 1; transform: rotate(-90deg); transform-origin: 50% 50%;
  transition: stroke-dashoffset 1.8s cubic-bezier(.3,.7,.2,1) .2s; }
.fm-ring text { fill: var(--fm-gold); font-size: 22px; font-weight: 700; text-anchor: middle; }
.fm-ring text.s { font-size: 15px; fill: rgba(243,226,176,.75); font-weight: 400; }

/* ---------- 三種分數 ---------- */
.fm-points { display: grid; grid-template-columns: repeat(3,1fr); gap: .6rem; text-align: center; }
.fm-points > div { border-radius: 16px; border: 1px solid rgba(var(--fx-gold),.2); padding: .8rem .3rem; background: rgba(0,0,0,.25); }
.fm-points b { display: block; font-size: 1.6rem; color: var(--fm-gold); margin-top: 2px; font-variant-numeric: tabular-nums; }
.fm-points ul { margin-top: .75rem; }
.fm-pt-desc { list-style: none; padding: 0; margin: .8rem 0 0; }
.fm-pt-desc li { font-size: 16px; color: var(--fm-dim); line-height: 1.65; margin-bottom: .2rem; }
.fm-pt-desc li b { color: var(--fm-gold); font-weight: 600; }

/* ---------- 按鈕 ---------- */
.fm-btn {
  position: relative; overflow: hidden; display: block; width: 100%; min-height: 52px; border-radius: 999px; border: none;
  font-size: 18px; font-weight: 700; letter-spacing: 3px; color: var(--fm-dark); text-align: center; line-height: 52px; text-decoration: none;
  background: linear-gradient(90deg, var(--fm-gold), #d9b45a 50%, var(--fm-gold));
  box-shadow: 0 6px 20px rgba(var(--fx-gold),.25);
}
.fm-btn::after { content: ""; position: absolute; top: 0; left: 0; width: 30%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.6), transparent); transform: translateX(-120%); }
.fm-live .fm-btn::after { animation: fmBtnSheen 4.5s ease-in-out infinite 2s; }
@keyframes fmBtnSheen { 0% { transform: translateX(-120%); } 30%,100% { transform: translateX(400%); } }
.fm-btn-ghost { background: transparent; color: var(--fm-text); border: 1px solid rgba(var(--fx-gold),.5); box-shadow: none; font-weight: 600; }
.fm-btn-ghost::after { display: none; }
.fm-toast { margin-top: .6rem; min-height: 1.6em; font-size: 16px; color: var(--fm-gold); opacity: 0; transform: translateY(6px); transition: opacity .4s, transform .4s; }
.fm-toast.show { opacity: 1; transform: none; }

/* ---------- 優惠券（規劃中） ---------- */
.fm-coupons { display: flex; gap: .7rem; overflow-x: auto; padding-bottom: .3rem; scroll-snap-type: x mandatory; }
.fm-coupon {
  scroll-snap-align: start; flex: 0 0 78%; position: relative; min-height: 104px; border-radius: 14px; padding: .9rem 1rem;
  border: 1px dashed rgba(var(--fx-gold),.45); background: repeating-linear-gradient(135deg, rgba(var(--fx-gold),.05) 0 10px, transparent 10px 20px);
}
.fm-coupon::before, .fm-coupon::after { content: ""; position: absolute; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; background: var(--fm-bg); border: 1px dashed rgba(var(--fx-gold),.45); }
.fm-coupon::before { left: -10px; } .fm-coupon::after { right: -10px; }
.fm-coupon b { display: block; color: var(--fm-gold); font-size: 1.1rem; letter-spacing: 2px; }

/* ---------- 訂單 ---------- */
.fm-order { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .8rem 0; border-top: 1px solid rgba(var(--fx-gold),.12); }
.fm-order:first-of-type { border-top: none; }
.fm-order .no { color: var(--fm-gold); font-weight: 600; font-family: ui-monospace, Menlo, monospace; font-size: 16px; }
.fm-order .t { font-size: 16px; color: var(--fm-dim); }
.fm-status { font-size: 16px; border-radius: 999px; padding: 2px 10px; border: 1px solid rgba(var(--fx-gold),.45); color: var(--fm-gold); white-space: nowrap; }
.fm-status.done { border-color: rgba(120,200,150,.5); color: #b7e6c6; }
.fm-status.void { border-color: rgba(200,200,200,.35); color: rgba(243,226,176,.6); }

/* ---------- 推薦 ---------- */
.fm-ref { display: flex; gap: 1rem; align-items: center; }
.fm-code { font-family: ui-monospace, Menlo, monospace; font-size: 1.6rem; letter-spacing: 5px; color: var(--fm-gold); }
.fm-link { font-size: 16px; color: var(--fm-dim); word-break: break-all; }
.fm-qr { position: relative; width: 112px; height: 112px; flex: 0 0 auto; border-radius: 14px; padding: 8px; background: #fbf3d9; }
.fm-qr img { width: 100%; height: 100%; display: block; background: #fff; border-radius: 6px; }
.fm-qr img:not([src]) { visibility: hidden; }
.fm-qr-fail { position: absolute; inset: 8px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 14px; color: var(--fm-dark); }
.fm-qr-fail[hidden] { display: none; }
.fm-qr-scan { position: absolute; left: 8px; right: 8px; top: 8px; height: 2px; background: rgba(232,160,40,.9); box-shadow: 0 0 10px rgba(232,160,40,.9); opacity: 0; }
.fm-live .fm-in .fm-qr-scan { animation: fmScan 3.2s ease-in-out infinite; }
@keyframes fmScan { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { transform: translateY(94px); opacity: 0; } }
.fm-steps { list-style: none; padding: 0; margin: .7rem 0 0; counter-reset: s; }
.fm-steps li { counter-increment: s; font-size: 16px; color: var(--fm-dim); line-height: 1.6; padding-left: 2rem; position: relative; margin-bottom: .35rem; }
.fm-steps li::before { content: counter(s); position: absolute; left: 0; top: 1px; width: 1.45rem; height: 1.45rem; border-radius: 50%; border: 1px solid rgba(var(--fx-gold),.6); color: var(--fm-gold); font-size: 16px; line-height: 1.4rem; text-align: center; }

/* ---------- 帳號 ---------- */
.fm-kv { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-top: 1px solid rgba(var(--fx-gold),.1); font-size: 17px; }
.fm-kv:first-of-type { border-top: none; }
.fm-kv span:first-child { color: var(--fm-dim); }
.fm-kv a { color: var(--fm-gold); text-decoration: underline; }

/* ---------- 底部導覽（手機） ---------- */
.fm-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: grid; grid-template-columns: repeat(5,1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom,0px));
  background: rgba(10,9,7,.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(var(--fx-gold),.25);
}
.fm-tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; justify-content: center;
  color: rgba(243,226,176,.75); font-size: 16px; text-decoration: none; }
.fm-tabbar a.on { color: var(--fm-gold); }
.fm-tabbar a.on::before { content: ""; position: absolute; top: -6px; left: 30%; right: 30%; height: 2px; border-radius: 2px; background: var(--fm-gold); box-shadow: 0 0 10px rgba(var(--fx-gold),.8); }
.fm-tabbar svg { width: 22px; height: 22px; stroke: currentColor; }
.fm-tabbar .fm-badge { top: 2px; right: 18%; }
@media (min-width: 1024px) { .fm-tabbar { display: none; } }
@media (max-width: 1023px) { body.fw-member:has(.fm-tabbar) { padding-bottom: calc(66px + env(safe-area-inset-bottom,0px)); } }

/* ---------- 尚未開放：暗色、不可選取、不可點、不可聚焦 ---------- */
.fm-soon { opacity: .38; filter: grayscale(.7) brightness(.75); pointer-events: none; user-select: none; -webkit-user-select: none; cursor: not-allowed; }
.fm-soon-tag {
  display: inline-block; vertical-align: middle; margin-left: .4rem; font-size: 15px; font-weight: 600; letter-spacing: 1px;
  border: 1px solid rgba(243,226,176,.35); color: rgba(243,226,176,.8); background: rgba(255,255,255,.05);
  border-radius: 999px; padding: 1px 10px; user-select: none; -webkit-user-select: none;
}
.fm-soon-pill { opacity: .6; user-select: none; -webkit-user-select: none; pointer-events: none; }
.fm-perks { display: grid; grid-template-columns: repeat(2,1fr); gap: .6rem; }
.fm-perks > div { border-radius: 14px; border: 1px dashed rgba(var(--fx-gold),.35); padding: .7rem .8rem; }
.fm-perks b { display: block; color: var(--fm-gold); font-size: 16px; letter-spacing: 1px; }
.fm-perks span { font-size: 15px; color: var(--fm-dim); }

/* 鍵盤焦點 */
.fm-main a:focus-visible, .fm-main button:focus-visible, .fm-tabbar a:focus-visible { outline: 2px solid var(--fm-gold); outline-offset: 3px; }

.fm-foot-links { text-align: center; font-size: 16px; color: var(--fm-dim); margin-top: 1.5rem; }
.fm-foot-links a { text-decoration: underline; color: var(--fm-dim); margin: 0 .4rem; }

/* 分頁切到背景：暫停 */
.fm-paused .fm-mc-sheen, .fm-paused .fm-btn::after, .fm-paused .fm-qr-scan { animation-play-state: paused !important; }

/* 減少動態：全部關閉，內容直接顯示 */
@media (prefers-reduced-motion: reduce) {
  .fm-card { opacity: 1 !important; transform: none !important; transition: none !important; }
  .fm-card-edge, .fm-mc-flow, .fm-mc-sheen, .fm-qr-scan { display: none !important; }
  .fm-btn::after { display: none !important; }
  .fm-ring .fg { transition: none !important; }
  .fm-member-card { transition: none !important; transform: none !important; }
  .fm-toast { transition: none !important; }
}

/* namefix 2026-11-01（Grok Bot，August 核准）：超長且無斷點的會員名稱不撐寬會員卡（手機 390px 橫向捲動） */
.fm-grid > * { min-width: 0; }
.fm-member-card, .fm-mc-bottom > div { min-width: 0; }
.fm-mc-name, .fm-chip { overflow-wrap: anywhere; word-break: break-word; }
