/* ============================================================
   tw.css — 繁體中文首頁（對應原站 /tw）專用樣式
   只補原站有、英文首頁樣式未覆蓋的部分：
   1) 書法體海報標題層   2) 編號話題榜
   3) 評價流內嵌產品卡   4) 浮動擲筊組件
   5) 頁腳（語言切換 / 條款 / 示例營業資訊）
   ============================================================ */

/* ---------- 書法體標題（海報疊字） ---------- */
.tw-hero-title {
  font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
  font-weight: 900;
  font-size: clamp(30px, 9.4vw, 46px) !important;
  letter-spacing: .05em;
  line-height: 1.06;
  margin: 2px 0 4px;
  background: linear-gradient(180deg, #fff 0%, #ffe9f2 42%, #ff5c9a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 10px rgba(0,0,0,.85));
}
.tw-hero-title.xian {
  background: linear-gradient(180deg, #f6e6ff 0%, #cbb2ff 45%, #8a5cff 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
.tw-hero-title.ink {
  background: linear-gradient(180deg, #ffffff 0%, #ffe0a3 42%, #f0a92a 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
.tw-kicker {
  font-size: 10.5px; letter-spacing: .22em; font-weight: 800;
  color: #ffe6f0; text-shadow: 0 1px 3px rgba(0,0,0,1), 0 0 10px rgba(0,0,0,.8);
}
.tw-hook { font-size: 12px; color: #e7e3ee; text-shadow: 0 1px 8px rgba(0,0,0,.95); }

/* 海報底部漸層再壓一層，讓中文大字更清楚（原站海報也是底部壓黑） */
.hero-card::after {
  background: linear-gradient(to top, rgba(0,0,0,.96) 0%, rgba(0,0,0,.86) 22%, rgba(0,0,0,.5) 42%, rgba(0,0,0,.12) 62%, transparent 80%);
}

/* ---------- 編號話題榜（原站「超值話題八字」1/2/3） ---------- */
.rank-list { display: grid; gap: 10px; }
.rank-row {
  display: grid; grid-template-columns: 64px 22px 1fr 16px; align-items: center; gap: 10px;
  padding: 8px; border-radius: 14px; text-decoration: none; color: var(--ink);
  background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
  border: 1px solid var(--line);
  transition: transform .25s ease, border-color .25s ease;
}
.rank-row:active { transform: scale(.985); border-color: rgba(255,31,102,.55); }
.rank-thumb { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: #0e0e10; }
.rank-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rank-no {
  font-family: "Noto Serif SC", serif; font-size: 20px; font-weight: 900;
  color: #fff; text-align: center; opacity: .92;
}
.rank-copy b { display: block; font-size: 15px; font-weight: 800; }
.rank-copy span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.rank-arrow { color: var(--muted); font-size: 16px; }

/* ---------- 評價流內嵌產品卡（原站評價裡嵌一張產品入口） ---------- */
.r-emb {
  display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 8px;
  border-radius: 12px; background: rgba(255,255,255,.045);
  border: 1px solid var(--line); text-decoration: none; color: var(--ink);
}
.r-emb img { width: 42px; height: 52px; border-radius: 7px; object-fit: cover; flex: 0 0 auto; }
.r-emb b { display: block; font-size: 13.5px; }
.r-emb span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.r-emb .go { margin-left: auto; color: var(--muted); }

/* ---------- 浮動擲筊組件（原站右下角「今日運勢」） ---------- */
.tw-jb {
  position: fixed; right: max(14px, calc(50% - 240px + 14px)); bottom: 96px; z-index: 60;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  border: 0; background: none; padding: 0; font: inherit; color: inherit;
}
.tw-jb-pill {
  background: linear-gradient(180deg, #f7dfa4 0%, #e6c073 55%, #c79a3f 100%);
  color: #241a05; font-size: 11.5px; font-weight: 900; letter-spacing: .04em;
  padding: 5px 10px; border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.7);
}
.tw-jb-stage { position: relative; width: 74px; height: 62px; }
.tw-jb-glow {
  position: absolute; left: 50%; bottom: -8px; width: 86px; height: 62px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(255,236,190,.95) 0%, rgba(255,206,105,.8) 45%, rgba(255,186,60,.3) 70%, rgba(255,175,40,0) 100%);
  border-radius: 50%; pointer-events: none;
}
.cup {
  position: absolute; bottom: 6px; width: 30px; height: 40px;
  border-radius: 39px 39px 6px 6px;
  background: radial-gradient(120% 90% at 50% 12%, #ffe9bd 0%, #e8b25c 42%, #a9701f 78%, #6d4410 100%);
  box-shadow: inset 0 -2px 4px rgba(0,0,0,.45), 0 3px 8px rgba(0,0,0,.5);
  transform-origin: 50% 92%;
}
.cup::after {
  content: ""; position: absolute; left: 50%; bottom: 7px; width: 11px; height: 2px;
  transform: translateX(-50%); border-radius: 2px; background: rgba(90,52,8,.55);
}
.cup.a { left: 8px; }
.cup.b { right: 8px; }
.tw-jb-result {
  font-size: 11px; font-weight: 800; color: var(--accent);
  min-height: 14px; text-shadow: 0 1px 6px rgba(0,0,0,.9);
}
/* 擲出瞬間：沿用 motion.css 已有的 jiaobei 動畫 */
.tw-jb.toss .cup.a { animation: jiaobei-clack-a .9s cubic-bezier(.3,.7,.4,1) both; }
.tw-jb.toss .cup.b { animation: jiaobei-clack-b .9s cubic-bezier(.3,.7,.4,1) both; }

/* ---------- 首頁語言切換 ---------- */
.lang-switch {
  display: inline-flex; align-items: center; gap: 4px; text-decoration: none;
  font-size: 11.5px; font-weight: 800; color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 9px;
}
.lang-switch.on { color: #111; background: #fff; border-color: #fff; }

/* ---------- 頁腳（原站有營業資訊 / 條款 / 隱私 / 語言） ---------- */
.tw-foot {
  margin-top: 8px; padding: 26px 16px 118px; border-top: 1px solid var(--line);
  background: #0d0d0f; color: var(--muted); font-size: 11.5px; line-height: 1.9;
}
.tw-foot .foot-langs { display: flex; gap: 8px; margin-bottom: 14px; }
.tw-foot dl { display: grid; grid-template-columns: 74px 1fr; gap: 2px 8px; margin-bottom: 14px; }
.tw-foot dt { color: #8b8b93; }
.tw-foot dd { color: #b9b9c2; }
.tw-foot .foot-links { display: flex; gap: 10px; margin-bottom: 12px; }
.tw-foot a { color: #cfcfd6; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.18); }
.tw-foot .foot-note { color: #6f6f78; font-size: 11px; }
.tw-foot .copy { margin-top: 10px; color: #6f6f78; font-size: 11px; }

/* ---------- 新客券彈窗（原站 300 元新客券） ---------- */
.tw-coupon {
  position: fixed; inset: 0; z-index: 90; display: none;
  align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,.62); backdrop-filter: blur(2px);
}
.tw-coupon.show { display: flex; }
.tw-coupon-card {
  width: min(480px, 100%); background: #16161a; border-radius: 20px 20px 0 0;
  padding: 16px; border-top: 1px solid rgba(255,255,255,.12);
  animation: cp-fadein .32s ease both;
}
.tw-coupon-art {
  border-radius: 14px; padding: 26px 18px; text-align: center;
  background: radial-gradient(120% 120% at 50% 0%, #3a0f22 0%, #1a0a12 60%, #100609 100%);
  border: 1px solid rgba(255,31,102,.35);
}
.tw-coupon-art .amt {
  font-family: "Noto Serif SC", serif; font-size: 40px; font-weight: 900; color: #ff3f7d;
  letter-spacing: .04em; text-shadow: 0 0 24px rgba(255,63,125,.55);
}
.tw-coupon-art .amt small { font-size: 15px; margin-left: 4px; }
.tw-coupon-art p { color: #f3d9e3; font-size: 12.5px; margin-top: 6px; }
.tw-coupon-cta {
  display: block; width: 100%; margin-top: 12px; padding: 13px; border: 0; border-radius: 12px;
  background: linear-gradient(180deg, #ff3f7d 0%, #e11153 100%);
  color: #fff; font-weight: 900; font-size: 14px; letter-spacing: .02em;
  box-shadow: 0 6px 18px rgba(255,31,102,.35);
}
.tw-coupon-cta.claimed {
  background: linear-gradient(180deg, #2b2b36 0%, #1c1c24 100%);
  color: #ffd166; box-shadow: none; border: 1px solid rgba(255,209,102,.45);
  letter-spacing: .06em;
}
.tw-coupon-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.tw-coupon-foot button { background: none; border: 0; color: #9a9aa3; font-size: 12px; font-weight: 700; }
.tw-coupon-foot .close { border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; color: #d7d7de; }

/* ---------- 弹窗内会员注册/登录（不离开首页） ---------- */
.tw-coupon-auth { margin-top: 12px; }
.tw-coupon-auth[hidden] { display: none !important; }
.tw-coupon-auth .tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.tw-coupon-auth .tabs button { flex: 1; padding: 9px; border-radius: 10px; border: 1px solid var(--line); background: none; color: #9a9aa3; font-size: 13px; font-weight: 800; cursor: pointer; }
.tw-coupon-auth .tabs button.on { background: rgba(255,63,125,.14); border-color: rgba(255,63,125,.5); color: #fff; }
.tw-coupon-auth .fld { margin-bottom: 10px; }
.tw-coupon-auth .fld label { display: block; font-size: 11px; color: #8b8b96; margin-bottom: 5px; font-weight: 700; }
.tw-coupon-auth .fld input { width: 100%; padding: 11px 13px; border-radius: 11px; border: 1px solid var(--line); background: #111118; color: #f2f2f7; font-size: 13.5px; outline: none; }
.tw-coupon-auth .fld input:focus { border-color: rgba(255,63,125,.55); }
.tw-coupon-auth .err { color: #ff6d6d; font-size: 12px; min-height: 15px; margin: 2px 0 4px; text-align: center; }
.tw-coupon-auth .hint { color: #6f6f78; font-size: 11px; text-align: center; margin-top: 8px; }

/* ---------- 全屏测算层（轮播/产品卡在首页内直接展开） ---------- */
.tw-flow { position: fixed; inset: 0; z-index: 120; background: #000; animation: twflow-in .3s ease both; }
@keyframes twflow-in { from { opacity: 0; } to { opacity: 1; } }
.tw-flow[hidden] { display: none !important; }
.tw-flow iframe { width: 100%; height: 100%; border: 0; display: block; }
.tw-flow-back {
  position: fixed; top: 14px; left: 14px; z-index: 130;
  width: 38px; height: 38px; border-radius: 99px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.18); background: rgba(0,0,0,.5); color: #fff;
  display: grid; place-items: center;
}

/* ---------- 無障礙：尊重減少動態偏好 ---------- */
@media not all { /* 動效照常播放：忽略系統「減少動態效果」（原 reduce 降級規則保留，改回此行即可恢復） */
  .tw-jb.toss .cup.a, .tw-jb.toss .cup.b { animation: none; }
  .tw-jb-glow { animation: none !important; }
}

/* 評價星等用文字時的字級收斂 */
.review .r-stars { font-size: 13px; letter-spacing: 1px; line-height: 1; }

/* 只有置中的海報顯示頁碼（原站也是如此） */
.hero-card:not(.is-active) .page-no { opacity: 0; }
.hero-card .page-no { transition: opacity .3s ease; }

/* 浮動擲筊：與底部導航留出呼吸空間，文字不要壓在卡片上 */
.tw-jb { bottom: 108px; }
.tw-jb-pill { box-shadow: 0 4px 16px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.7); }

/* 金色海報的 kicker 用暖色，避免和粉色字衝突 */
.hero-card .tw-kicker { color: #ffe6f0; }
.hero-card .poster-title { padding-bottom: 2px; }

/* 金色字疊在有光的人物臉上時，補一圈極細描邊與雙層陰影，避免糊掉 */
.tw-hero-title {
  -webkit-text-stroke: .6px rgba(0,0,0,.26);
  filter: drop-shadow(0 3px 12px rgba(0,0,0,.95)) drop-shadow(0 1px 2px rgba(0,0,0,.9));
}
.tw-kicker {
  font-size: 11px;
  color: #fff;
  text-shadow: 0 1px 4px #000, 0 0 12px rgba(0,0,0,.9);
}

/* 中文標題改用「底部壓黑底板」而不是整張壓暗：字和底分離，對比一次到位 */
.hero-card .poster-title {
  left: 0; right: 0; bottom: 0;
  padding: 30px 20px 18px;
  background: linear-gradient(to top, rgba(7,6,9,.96) 0%, rgba(7,6,9,.88) 46%, rgba(7,6,9,.55) 74%, rgba(7,6,9,0) 100%);
  border-radius: 0 0 20px 20px;
}
.hero-card .tw-kicker {
  display: inline-block; font-size: 10.5px; letter-spacing: .2em;
  color: #ffd9a1; padding: 3px 8px; border-radius: 6px;
  background: rgba(242,193,78,.12); border: 1px solid rgba(242,193,78,.3);
}
.hero-card .tw-hook { display: block; margin-top: 6px; }
/* 海報本身的漸層回到原本高度，避免和底板重複壓暗 */
.hero-card::after { height: 46%; opacity: .55; }

/* 浮動組件加一層極淡玻璃底，壓在文字上時仍看得清下面在說什麼 */
.tw-jb {
  padding: 6px 6px 4px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(12,12,14,.55), rgba(12,12,14,.32));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 6px 20px rgba(0,0,0,.45);
}

/* backdrop-filter 會把底下亮部糊成一團，改用純半透明底 */
.tw-jb { background: rgba(12,12,14,.62); backdrop-filter: none; -webkit-backdrop-filter: none; }

/* 海報卡：恢復底部壓暗層（原 style.css 把 poster 卡的 ::after 關掉了，
   遇到亮色海報時白色標題與灰色副標會糊在畫面上） */
.cover-card.poster .imgwrap::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 56%;
  background: linear-gradient(to top, rgba(6,5,8,.94) 0%, rgba(6,5,8,.72) 34%, rgba(6,5,8,.28) 66%, rgba(6,5,8,0) 100%);
  pointer-events: none;
  z-index: 1;
}
.cover-card.poster .poster-title-sm { z-index: 3; }
.cover-card.poster .poster-title-sm .sub {
  color: #f2f2f5;
  text-shadow: 0 1px 4px rgba(0,0,0,.95), 0 0 10px rgba(0,0,0,.7);
}
.cover-card.poster .poster-title-sm h3 { text-shadow: 0 2px 10px rgba(0,0,0,1), 0 1px 3px rgba(0,0,0,.9); }

/* ============================================================
   浮動擲筊 v2 — 對齊原站：紅色筊杯（月牙形）+ 柔和金光暈
   原版問題：光暈是一塊偏黃的實心圓，還從右側漏出面板外，
   筊杯被畫成兩個金色膠囊，看起來像按鈕而不是擲筊。
   ============================================================ */
.tw-jb {
  padding: 8px 10px 10px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(17,14,20,.86), rgba(9,8,11,.72));
  border: 1px solid rgba(255,206,140,.14);
  box-shadow: 0 10px 26px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.05);
}

.tw-jb-stage { width: 76px; height: 44px; margin-top: 2px; animation: twJbFloat 4.2s ease-in-out infinite; }
@keyframes twJbFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

/* 光暈：收在筊杯正後方，模糊 + 緩慢呼吸，不再是一塊實心黃圓 */
.tw-jb-glow {
  left: 50%; bottom: -3px; width: 66px; height: 32px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(255,190,112,.50) 0%, rgba(255,150,62,.20) 56%, rgba(255,140,50,0) 100%);
  filter: blur(7px);
  animation: twGlowBreathe 3.6s ease-in-out infinite;
}
@keyframes twGlowBreathe {
  0%, 100% { opacity: .45; transform: translateX(-50%) scale(.92); }
  50%      { opacity: .85; transform: translateX(-50%) scale(1.06); }
}

/* 筊杯：平底、弧頂、頂部凹口 → 月牙形（用 mask 挖口，避免和半透明面板有色差） */
.cup {
  width: 33px; height: 27px; bottom: 6px;
  border-radius: 48% 48% 14% 14% / 88% 88% 22% 22%;
  background: radial-gradient(130% 120% at 50% 2%, #ff9d78 0%, #e2503a 36%, #a92a1d 72%, #61100d 100%);
  box-shadow: inset 0 2px 2px rgba(255,226,196,.45), inset 0 -8px 12px rgba(0,0,0,.45);
  -webkit-mask: radial-gradient(19px 15px at 50% -4px, transparent 97%, #000 100%);
  mask: radial-gradient(19px 15px at 50% -4px, transparent 97%, #000 100%);
}
.cup::after { display: none; }
.cup.a { left: 5px; }
.cup.b { right: 5px; }
.tw-jb-result { color: #ffd9a1; }

/* 隨機小角度，兩片筊杯不要像複製貼上 */
.tw-jb:not(.toss) .cup.a { rotate: -4deg; }
.tw-jb:not(.toss) .cup.b { rotate: 5deg; }

/* ============================================================
   海報亮度歸一：少數海報（婚期將至等）頂部接近純白，
   在深色站裡像「白色輪播圖」。統一壓暗並補一層暗角。
   ============================================================ */
.hero-card img { filter: brightness(.82) saturate(.96) contrast(1.04); }
.hero-card:not(.is-active) img { filter: brightness(.58) saturate(.9) contrast(1.02); }
/* 注意：不要改 .hero-card::before —— 那是原站的掃光動畫，覆蓋掉就沒了 */

/* ============================================================
   分類膠囊：篩選時的卡片進場動畫
   ============================================================ */
.cover-card { animation: twCardIn .34s ease both; }
@keyframes twCardIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.cover-card.is-filtered-out { display: none; }
section.is-filtered-empty { display: none; }
.cat-pill { transition: background .18s ease, color .18s ease, transform .18s ease; }
.cat-pill:active { transform: scale(.96); }

/* 分類列固定在頂欄下方：篩選後滾到內容，也能馬上換分類 */
.cat-strip {
  position: sticky; top: var(--hdr-h, 60px); z-index: 30;
  background: rgba(9,8,11,.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.06);
}

/* 擲筊面板收緊：結果文字為空時不佔位，光暈再亮一點 */
.tw-jb { gap: 4px; padding: 8px 10px 8px; }
.tw-jb-result:empty { display: none; }
.tw-jb-glow {
  width: 72px; height: 36px; bottom: -4px;
  background: radial-gradient(closest-side, rgba(255,203,135,.9) 0%, rgba(255,163,72,.45) 52%, rgba(255,150,60,0) 100%);
}
@keyframes twGlowBreathe {
  0%, 100% { opacity: .6; transform: translateX(-50%) scale(.94); }
  50%      { opacity: 1;   transform: translateX(-50%) scale(1.05); }
}
.cup {
  box-shadow: inset 0 2px 3px rgba(255,232,204,.55), inset 0 -8px 12px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.45);
}
.rank-row.is-filtered-out { display: none; }

/* 擲筊再修：光暈要「露在筊杯外圈」才看得見；面板上下留白收緊 */
.tw-jb-stage { height: 36px; }
.cup { bottom: 3px; }
.tw-jb-glow {
  width: 98px; height: 52px; bottom: -6px;
  background: radial-gradient(closest-side, rgba(255,208,148,.85) 0%, rgba(255,170,84,.55) 34%, rgba(255,150,60,.18) 66%, rgba(255,140,50,0) 100%);
  filter: blur(9px);
}

/* 顶栏/分类列层级抬高：滚动时评价文字曾透到 logo 上方 */
.hdr { z-index: 80; }
.cat-strip { z-index: 70; }

/* 浮動組件再輕一點：不要整塊蓋住底下的評價卡 */
.tw-jb {
  padding: 7px 9px 7px;
  background: linear-gradient(180deg, rgba(16,13,20,.78), rgba(9,8,11,.66));
  border-color: rgba(255,206,140,.12);
}
.tw-jb-pill { font-size: 10.5px; padding: 4px 9px; }
.tw-jb-stage { width: 68px; height: 34px; }
.cup { width: 30px; height: 25px; }
.cup.a { left: 5px; } .cup.b { right: 5px; }
.tw-jb-glow { width: 88px; height: 46px; }

/* 筊杯補高光（mask 只保留形狀內的部分，所以高光也一起被裁） */
.cup::before {
  content: "";
  position: absolute; left: 4px; right: 4px; top: 3px; height: 46%;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,236,214,.55) 0%, rgba(255,236,214,.12) 55%, rgba(255,236,214,0) 100%);
  pointer-events: none;
}
/* 光暈再暖一檔，讓「燈」的感覺出來，而不是一團灰黃 */
.tw-jb-glow {
  background: radial-gradient(closest-side, rgba(255,216,166,.95) 0%, rgba(255,176,92,.5) 40%, rgba(255,150,60,.16) 68%, rgba(255,140,50,0) 100%);
  filter: blur(8px);
}

