/* ============================================================================
   抽卡 · 全站樣式（午夜藍 + 金，與管理器同一套配色）
   ========================================================================== */
:root {
  --bg: #080c16; --bg2: #0c1222;
  --p1: #151e33; --p2: #0e1526;
  --sf: #1d2840; --sf2: #2a3858;
  --line: #34446a; --line2: #25324f; --line3: #1b253d;
  --ink: #edf1f9; --mut: #97a3be; --dim: #6c7a9a;
  --gold: #ffcd3c; --gold-hi: #ffe996; --gold-lo: #de9616; --gold-ink: #2e1e00;
  --ok: #5fe0a0; --bad: #ff7a86; --info: #7db4ff; --red: #ee3636;
  --r: 14px; --r-lg: 20px;
  --font: "Microsoft JhengHei UI", "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", "Heiti TC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: Consolas, "Cascadia Mono", "SFMono-Regular", Menlo, monospace;
  --shadow: 0 18px 50px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); scroll-behavior: smooth; scrollbar-gutter: stable; }   /* 彈窗開啟時頁面會被鎖住捲動（捲軸消失）：先把捲軸的位置保留下來，畫面才不會左右跳動 */
body {
  margin: 0; min-height: 100vh; color: var(--ink); font: 16px/1.7 var(--font);
  background:
    radial-gradient(1100px 520px at 50% -8%, #17254a 0, rgba(23, 37, 74, 0) 70%),
    radial-gradient(700px 420px at 100% 30%, rgba(255, 205, 60, .05) 0, rgba(255, 205, 60, 0) 70%),
    var(--bg);
  background-attachment: fixed;
}
a { color: var(--gold-hi); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.3; margin: 0; letter-spacing: .01em; }
h1 { font-size: clamp(28px, 4.2vw, 44px); font-weight: 800; }
h2 { font-size: clamp(20px, 2.4vw, 26px); font-weight: 700; }
p { margin: 8px 0; }
small, .muted { color: var(--mut); }
.mono { font-family: var(--mono); }
.sm { font-size: 14px; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 clamp(14px, 3vw, 28px); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(255, 205, 60, .35); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ───────── 頁首 ───────── */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(8, 12, 22, .76); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); border-bottom: 1px solid var(--line3); }
.hd { display: flex; align-items: center; gap: clamp(12px, 2.4vw, 28px); min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 20px; letter-spacing: .04em; }
.brand:hover { text-decoration: none; }
.logo { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--gold-ink); background: linear-gradient(145deg, #ffe58a, #eaa51d); box-shadow: inset 0 0 0 1px rgba(255, 245, 200, .8), 0 4px 14px rgba(255, 190, 40, .28); }
.logo-img { display: block; height: 58px; width: auto; flex: none; }   /* 品牌圖 assets/img/logo-s.png（3:2、透明底）：高度固定、寬度自動 */
/* 頁首「大版面」：頁面最上面時 logo 是平常的 3 倍大，往下捲（site.js 加上 html.hd-compact）就縮回平常大小。
   .hd-hero 的頁首是 position: fixed（不佔頁面流程的位置），前面的 .hd-holder 補回大版面的高度（site.js 會量實際高度寫進去），
   縮放時頁面內容才不會跳動。沒有 .hd-hero 的頁首（完抽公開頁等靜態頁）維持原本的 sticky + 平常大小。 */
.site-header.hd-hero { position: fixed; top: 0; left: 0; right: 0; }
.hd-holder { height: 73px; }   /* 頁首固定高度（不再有「大版面」）：72px + 底線 */
.nav { display: flex; gap: 4px; margin-right: auto; }
.nav a { padding: 8px 14px; border-radius: 10px; color: var(--mut); font-weight: 600; font-size: 15px; }
.nav a:hover { color: var(--ink); background: rgba(255, 255, 255, .05); text-decoration: none; }
.nav a.on { color: var(--gold-hi); }
.hd-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nav + .hd-right { margin-left: 0; }
.nav-toggle { display: none; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--line3); border-radius: 10px; background: rgba(255, 255, 255, .04); color: var(--ink); cursor: pointer; }
.nav-toggle:hover { background: rgba(255, 255, 255, .09); }

.bal { display: inline-flex; align-items: center; gap: 8px; padding: 4px 4px 4px 12px; border-radius: 999px; background: linear-gradient(180deg, #1e2a46, #141d33); border: 1px solid var(--line); font-weight: 700; }
.bal .coin { flex: none; }
.bal b { font-variant-numeric: tabular-nums; color: var(--gold-hi); font-size: 16px; }
.bal .u { color: var(--mut); font-size: 13px; font-weight: 600; }
.bal-plus { width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; color: var(--gold-ink); font: 700 20px/1 var(--font); background: linear-gradient(#ffe276, #eeac22); box-shadow: inset 0 0 0 1px rgba(255, 245, 200, .8); transition: transform .15s; }
.bal-plus:hover { transform: scale(1.1); }
.bal.bump { animation: bump .6s; }
@keyframes bump { 0% { box-shadow: 0 0 0 0 rgba(255, 205, 60, .7); } 100% { box-shadow: 0 0 0 14px rgba(255, 205, 60, 0); } }
.userchip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; color: var(--ink); font-weight: 600; font-size: 14px; border: 1px solid transparent; }
.userchip:hover { background: rgba(255, 255, 255, .05); text-decoration: none; }
.userchip .ui { display: none; flex: none; }          /* 手機上名字會藏起來，改用一個人像小圖示當「我的帳戶」入口（不是名稱首字） */
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #10213f; background: linear-gradient(145deg, #b6d5ff, #6f9fe6); }      /* 目前只有後台頂列用 */
.logout-form { display: inline; margin: 0; }

/* ───────── 按鈕 / 表單 ───────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border-radius: 12px; border: 1px solid transparent; font: 700 15px/1.2 var(--font); color: var(--ink); cursor: pointer; transition: filter .15s, transform .1s, background .15s, border-color .15s; user-select: none; white-space: nowrap; text-decoration: none !important; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.disabled { opacity: .5; cursor: not-allowed; filter: grayscale(.4); }
.btn.gold { color: var(--gold-ink); background: linear-gradient(#ffe479, #eeab20); box-shadow: inset 0 0 0 1px rgba(255, 244, 190, .85), 0 6px 18px rgba(255, 183, 30, .22); }
.btn.gold:hover:not([disabled]) { filter: brightness(1.07); }
.btn.sec { background: linear-gradient(#41527c, #2d3a5c); box-shadow: inset 0 0 0 1px #6a7eab; }
.btn.sec:hover:not([disabled]) { filter: brightness(1.12); }
.btn.ghost { background: rgba(255, 255, 255, .03); border-color: var(--line); }
.btn.ghost:hover:not([disabled]) { background: rgba(255, 255, 255, .08); border-color: #4b5e8c; }
.btn.danger { background: linear-gradient(#f0585f, #c42e38); box-shadow: inset 0 0 0 1px rgba(255, 200, 200, .55); }
.btn.sm { padding: 7px 14px; font-size: 14px; border-radius: 10px; }
.btn.lg { padding: 14px 28px; font-size: 17px; border-radius: 14px; }
.btn.block { display: flex; width: 100%; }

.field { margin: 14px 0; }
.field label, .lbl { display: block; margin: 0 0 6px; font-size: 14px; font-weight: 700; color: #d9e1f3; }
.input, .field input[type=text], .field input[type=password], .field input[type=email], .field input[type=number], .field input[type=tel], .field textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: #0a101e; color: var(--ink); font: 16px/1.4 var(--font); outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .field input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 205, 60, .16); }
.field .hint { margin-top: 5px; font-size: 13px; color: var(--dim); }
.field.bad input { border-color: var(--bad); }
.field .err { margin-top: 5px; font-size: 13px; color: var(--bad); }
.alert { padding: 12px 14px; border-radius: 12px; margin: 14px 0; font-size: 15px; line-height: 1.6; border: 1px solid; }
.alert.bad { background: rgba(255, 122, 134, .1); border-color: rgba(255, 122, 134, .5); color: #ffd3d7; }
.alert.ok { background: rgba(95, 224, 160, .1); border-color: rgba(95, 224, 160, .5); color: #cdf8e3; }
.alert.info { background: rgba(125, 180, 255, .1); border-color: rgba(125, 180, 255, .45); color: #d4e6ff; }
.alert.warn { background: rgba(255, 205, 60, .09); border-color: rgba(255, 205, 60, .45); color: #ffeeb8; }

/* ───────── 面板 / 標籤 ───────── */
.panel { background: linear-gradient(180deg, var(--p1), var(--p2)); border: 1px solid var(--line2); border-radius: var(--r-lg); padding: clamp(16px, 2.4vw, 26px); box-shadow: var(--shadow); }
.panel h2 { margin-bottom: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--gold-hi); background: rgba(255, 205, 60, .1); border: 1px solid rgba(255, 205, 60, .35); }
.chip.done { color: var(--ok); background: rgba(95, 224, 160, .1); border-color: rgba(95, 224, 160, .4); }
.chip.live { color: #ffb3b9; background: rgba(238, 54, 54, .12); border-color: rgba(238, 54, 54, .45); }
.chip.cat { color: #dfe8fb; background: rgba(150, 175, 230, .12); border-color: rgba(150, 175, 230, .4); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
/* 「已完抽」印章：紅色雙線框、微微傾斜，像蓋上去的章（首頁抽卡磚是蓋在圖片上的大章；公開頁、抽卡頁頁首用小章） */
.stamp { display: inline-block; flex: none; padding: 2px 14px 3px; border: 5px double currentColor; border-radius: 10px; color: #ff4d5e; font: 900 22px/1.2 var(--font); letter-spacing: .2em; text-indent: .2em; white-space: nowrap; transform: rotate(-6deg); user-select: none; pointer-events: none; text-shadow: 0 0 1px currentColor; }
.stamp.sm { padding: 0 9px 1px; border-width: 4px; border-radius: 7px; font-size: 14px; transform: rotate(-4deg); }

/* ───────── 首頁 ───────── */
.hero { padding: clamp(28px, 6vw, 64px) 0 clamp(18px, 3vw, 30px); display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(20px, 4vw, 48px); align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; letter-spacing: .14em; font-weight: 700; color: var(--gold); text-transform: uppercase; }
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--gold); border-radius: 2px; }
.hero h1 { margin: 12px 0 14px; background: linear-gradient(180deg, #fff, #cfd9f0); -webkit-background-clip: text; background-clip: text; color: transparent; text-wrap: balance; }       /* 窄螢幕換行時左右平均，不會落單「手腳」兩個字 */
.hero h1 em { font-style: normal; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { max-width: 34em; font-size: clamp(16px, 1.6vw, 19px); color: var(--mut); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 26px; }
.hero-stats div { min-width: 90px; }
.hero-stats b { display: block; font-size: 26px; color: var(--gold-hi); font-variant-numeric: tabular-nums; line-height: 1.2; }
.hero-stats span { font-size: 13px; color: var(--mut); }
.me-bal { display: flex; align-items: baseline; gap: 8px; margin: 8px 0 14px; }
.me-bal b { font-size: 40px; font-variant-numeric: tabular-nums; color: var(--gold-hi); line-height: 1; }
.me-bal span { color: var(--mut); font-weight: 600; }

.section { padding: clamp(18px, 3vw, 34px) 0; }
.section[id] { scroll-margin-top: 56px; }       /* 從「所有獎項」之類的錨點跳過來時，區塊標題不會被固定在上面的頁首蓋住 */
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.sec-head h2 { display: flex; align-items: center; gap: 10px; }
.sec-head h2::before { content: ""; width: 5px; height: 1.1em; border-radius: 3px; background: linear-gradient(var(--gold-hi), var(--gold-lo)); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters button { cursor: pointer; padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--mut); font: 700 14px var(--font); transition: all .15s; }
.filters button:hover { color: var(--ink); border-color: #4b5e8c; }
.filters button.on { color: var(--gold-ink); background: linear-gradient(#ffe479, #eeab20); border-color: transparent; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: clamp(10px, 1.5vw, 16px); }
/* 推薦項目：橫向捲動（最多 10 張） */
.rail { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 16px; scrollbar-width: thin; scrollbar-color: #3a4a72 transparent; -webkit-overflow-scrolling: touch; }
.rail .tile { flex: 0 0 min(62vw, 210px); scroll-snap-align: start; }
.rail-btns { display: flex; gap: 8px; }
.rail-btns button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); color: var(--ink); font: 700 22px/1 var(--font); cursor: pointer; transition: all .15s; }
.rail-btns button:hover { border-color: var(--gold); color: var(--gold-hi); background: rgba(255, 205, 60, .08); }
.filters.cats { margin: -4px 0 12px; }
/* 首頁分頁：換頁時清單淡出 + 滑動，和推薦幻燈片同風格；頁碼列＝上一頁 / 圓點 / 下一頁 */
.tiles { transition: opacity .23s ease, transform .23s ease; }
.tiles.pg-out { opacity: 0; transform: translateX(-28px); }
.tiles.pg-out.to-r { transform: translateX(28px); }
.tiles.pg-in { transition: none; opacity: 0; transform: translateX(28px); }
.tiles.pg-in.from-l { transform: translateX(-28px); }
.tile.ghost { visibility: hidden; pointer-events: none; }
.pgbar { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 22px 0 6px; }
.pgbar[hidden] { display: none; }
.pgbar .pg-mid { display: flex; align-items: center; gap: 8px; }
.pgbar .pg-nav { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); color: var(--ink); font: 700 24px/1 var(--font); cursor: pointer; display: grid; place-items: center; padding: 0 0 3px; transition: all .15s; }
.pgbar .pg-nav:hover:not(:disabled) { background: rgba(255, 205, 60, .85); border-color: transparent; color: #1a1300; }
.pgbar .pg-nav:disabled { opacity: .35; cursor: default; }
.pgbar .pg-dot { width: 10px; height: 10px; padding: 0; border-radius: 999px; border: 0; background: rgba(255, 255, 255, .3); cursor: pointer; transition: width .25s, background .25s; }
.pgbar .pg-dot.on { width: 28px; background: var(--gold-hi, #ffe479); }
.pgbar .pg-txt { margin-left: 6px; font-style: normal; font-size: 13px; color: var(--mut); white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .tiles, .tiles.pg-in { transition: none; } }
.sortbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.sortbar .sb-l { font-size: 13px; font-weight: 700; color: var(--dim); margin-right: 2px; }
.sortbar button { cursor: pointer; display: inline-flex; align-items: center; gap: 4px; padding: 5px 13px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--mut); font: 700 13px var(--font); transition: all .15s; }
.sortbar button:hover { color: var(--ink); border-color: #4b5e8c; }
.sortbar button.on { color: var(--gold-hi); border-color: rgba(255, 205, 60, .55); background: rgba(255, 205, 60, .08); }
.sortbar button i { font-style: normal; font-size: 10px; min-width: 1em; }
.filters button span { opacity: .75; font-weight: 600; margin-left: 2px; }
.filters button.zero:not(.on) { opacity: .5; }
.tile .cat-chip { position: absolute; right: 12px; bottom: 12px; padding: 3px 12px; border-radius: 999px; font-size: 12px; font-weight: 800; color: #dfe8fb; background: rgba(10, 16, 30, .72); border: 1px solid rgba(150, 175, 230, .45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.tile .tile-top { font-size: 13px; color: var(--mut); }
.tile .tile-top b { color: var(--gold-hi); font-variant-numeric: tabular-nums; font-size: 15px; }
.tile.rec { border-color: rgba(255, 205, 60, .35); }
.tile { display: flex; flex-direction: column; border-radius: var(--r-lg); overflow: hidden; color: var(--ink); background: linear-gradient(180deg, var(--p1), var(--p2)); border: 1px solid var(--line2); box-shadow: var(--shadow); transition: transform .2s, border-color .2s, box-shadow .2s; text-decoration: none !important; position: relative; }
.tile:hover { transform: translateY(-4px); border-color: rgba(255, 205, 60, .55); box-shadow: 0 26px 60px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 205, 60, .15); }
.tile.done .tile-art > img, .tile.done .tile-art .noimg { filter: saturate(.5) brightness(.62); }       /* 已完抽：圖片壓暗，讓上面的印章更顯眼 */
.tile.done .tile-body { opacity: .88; }
.tile-art { position: relative; overflow: hidden; background: radial-gradient(120% 100% at 30% 0, #2a3a66, #101a30); }
.tile .stamp { position: absolute; z-index: 2; left: 50%; top: 45%; margin: 0; padding: 3px 14px 5px; border-width: 4px; border-radius: 10px; font-size: 24px; letter-spacing: .24em; text-indent: .24em; transform: translate(-50%, -50%) rotate(-12deg); background: rgba(8, 12, 22, .34); box-shadow: 0 0 0 1px rgba(255, 77, 94, .35), 0 8px 26px rgba(0, 0, 0, .55); text-shadow: 0 2px 8px rgba(0, 0, 0, .55); }
.tile-art img { position: absolute; max-width: none; user-select: none; -webkit-user-drag: none; }
.tile-art .noimg { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 205, 60, .5); }
.tile-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(6, 10, 18, .82)); pointer-events: none; }
.tile .st { position: absolute; top: 12px; left: 12px; }
.tile .feat-tag { position: absolute; top: 12px; right: 12px; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 800; color: var(--gold-ink); background: linear-gradient(#ffe479, #eeab20); box-shadow: 0 4px 12px rgba(0, 0, 0, .4); }
.tile .price { position: absolute; left: 12px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 16px; text-shadow: 0 2px 8px rgba(0, 0, 0, .7); }
.tile .price small { font-size: 13px; color: #d6deef; font-weight: 600; }
.tile-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.tile-id { font: 700 12px var(--mono); color: var(--gold); letter-spacing: .08em; }
.tile-title { font-size: 15px; font-weight: 700; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.8em; }
.tile-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 12px; color: var(--mut); }
.tile-meta b { color: var(--ink); font-variant-numeric: tabular-nums; }
.bar { height: 6px; border-radius: 4px; background: #0a101e; overflow: hidden; margin-top: auto; }
.bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--gold-lo), var(--gold-hi)); }
.empty { text-align: center; padding: 56px 20px; color: var(--mut); border: 1px dashed var(--line); border-radius: var(--r-lg); }

/* ───────── 登入 / 註冊 / 忘記密碼 ───────── */
.auth-wrap { min-height: calc(100vh - 64px - 90px); display: grid; place-items: center; padding: 34px 0; }
.auth { width: 100%; max-width: 440px; }
.auth h1 { font-size: 28px; margin-bottom: 4px; }
.auth .sub { color: var(--mut); margin: 0 0 8px; }
.auth .alt { margin-top: 18px; text-align: center; color: var(--mut); font-size: 15px; }
.auth .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; margin-top: 6px; }
.pw-wrap { position: relative; }
.pw-wrap .input, .pw-wrap input { padding-right: 52px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--mut); cursor: pointer; padding: 8px 10px; font-size: 13px; font-weight: 700; }
.pw-eye:hover { color: var(--gold-hi); }
.strength { height: 4px; border-radius: 3px; background: #0a101e; margin-top: 8px; overflow: hidden; }
.strength i { display: block; height: 100%; width: 0; background: var(--bad); transition: width .25s, background .25s; }
.auth.wide { max-width: 560px; }
/* 註冊：同意事項（三個必選勾選框） */
.consent { margin: 18px 0 16px; padding: 14px 16px 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .02); min-width: 0; }
.consent legend { padding: 0 8px; font-size: 14px; font-weight: 700; color: #d9e1f3; }
.consent legend small { margin-left: 6px; font-weight: 500; font-size: 12px; color: var(--dim); }
.consent .chk { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 12px; font-size: 14px; line-height: 1.7; color: var(--mut); cursor: pointer; font-weight: 400; }
.consent .chk input { flex: none; width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--gold); cursor: pointer; }
.consent .chk b { color: var(--gold-hi); }
.consent .chk a { text-decoration: underline; text-underline-offset: 2px; }
.consent .hint { margin-top: 2px; font-size: 13px; color: var(--dim); line-height: 1.6; }
.consent.bad { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(255, 122, 134, .12); }
/* 條款提示（儲值視窗、抽取確認視窗） */
.legal-note { margin: 10px 0 0; font-size: 13px; line-height: 1.6; color: var(--dim); }
.legal-note b, .legal-mini b { color: var(--gold-hi); }
.legal-mini { display: block; margin-top: 8px; font-size: 13px; line-height: 1.6; color: var(--dim); }
.legal-mini a, .legal-note a { text-decoration: underline; text-underline-offset: 2px; }

/* ───────── 帳戶頁 ───────── */
.page-title { padding: 34px 0 10px; }
.tablewrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line3); }
table.logtbl, table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.logtbl th, .tbl th { text-align: left; padding: 10px 14px; background: #0f1729; color: var(--mut); font-weight: 700; white-space: nowrap; position: sticky; top: 0; }
.logtbl td, .tbl td { padding: 9px 14px; border-top: 1px solid var(--line3); white-space: nowrap; }
.logtbl tr:hover td, .tbl tr:hover td { background: rgba(255, 255, 255, .025); }
.tagwin { display: inline-block; padding: 1px 10px; border-radius: 999px; font-weight: 700; font-size: 13px; color: #1b1300; background: var(--ac, var(--gold)); }
.tagwin.major { box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); }
.pos { color: var(--ok); } .neg { color: var(--bad); }

/* 中獎紀錄：寄送資料欄 / 填寫視窗（超商單選、確認清單） */
#wins, #ledger, #consents { scroll-margin-top: 88px; }       /* 從 #wins 錨點跳過來時，區塊標題不會被固定在上面的頁首蓋住 */
.tbl td.shipcell { white-space: normal; min-width: 210px; }
.shipd .s1 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.chip.store { padding: 1px 10px; font-size: 12.5px; color: #eaf1ff; background: rgba(150, 175, 230, .12); border-color: rgba(150, 175, 230, .4); }
.sdot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; }
.sdot.seven { background: linear-gradient(135deg, #ff8a1f, #e60023); }
.sdot.family { background: linear-gradient(135deg, #00b25a, #0a6ebd); }
.chip.store.seven::before, .chip.store.family::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.chip.store.seven::before { background: linear-gradient(135deg, #ff8a1f, #e60023); }
.chip.store.family::before { background: linear-gradient(135deg, #00b25a, #0a6ebd); }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opt .slogo { flex: none; width: 28px; height: 28px; object-fit: contain; border-radius: 6px; }
.field label.opt { position: relative; display: block; margin: 0; font-size: 17px; font-weight: 800; color: var(--ink); cursor: pointer; }
.opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.opt span { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 10px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); transition: border-color .15s, background .15s, box-shadow .15s, color .15s; }
.opt:hover span { border-color: #4b5e8c; background: rgba(255, 255, 255, .07); }
.opt input:checked + span { border-color: var(--gold); background: rgba(255, 205, 60, .1); box-shadow: 0 0 0 3px rgba(255, 205, 60, .14); color: var(--gold-hi); }
.opt input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.field.bad .opt span { border-color: var(--bad); }
.ship-warn { margin: 16px 0 0; }
.confirm-list { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 16px; padding: 12px 14px; border-radius: 12px; background: #0a101e; border: 1px solid var(--line3); font-size: 15px; }
.confirm-list dt { color: var(--mut); white-space: nowrap; }
.confirm-list dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }

/* ───────── 彈窗 / 提示 ───────── */
.modal-back { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(3, 6, 12, .74); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); overflow-y: auto; }
.modal-back.show { display: flex; animation: fadein .18s; }
.modal { position: relative; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto; border-radius: 22px; padding: clamp(20px, 3vw, 30px); background: linear-gradient(180deg, #17213a, #0e1527); border: 1px solid var(--line); box-shadow: 0 30px 90px rgba(0, 0, 0, .7); animation: popin .22s cubic-bezier(.2, .9, .3, 1.2); }
.modal.wide { max-width: 640px; }
.modal h2 { font-size: 22px; margin-bottom: 4px; }
.modal .sub { color: var(--mut); margin: 0 0 14px; font-size: 14px; }
.modal-x { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .06); color: var(--mut); cursor: pointer; font-size: 18px; line-height: 1; }
.modal-x:hover { color: var(--ink); background: rgba(255, 255, 255, .12); }
.modal .acts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.modal .acts .btn { flex: 0 1 auto; }
.modal label.chk { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; font-size: 14px; color: var(--mut); font-weight: 400; cursor: pointer; }
@keyframes fadein { from { opacity: 0; } }
@keyframes popin { from { opacity: 0; transform: translateY(14px) scale(.96); } }

.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; margin: 10px 0 14px; }
.pack { cursor: pointer; padding: 12px 8px 10px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); color: var(--ink); text-align: center; font-family: var(--font); transition: all .15s; }
.pack:hover { border-color: #4b5e8c; background: rgba(255, 255, 255, .07); }
.pack.on { border-color: var(--gold); background: rgba(255, 205, 60, .1); box-shadow: 0 0 0 3px rgba(255, 205, 60, .14); }
.pack b { display: block; font-size: 22px; color: var(--gold-hi); font-variant-numeric: tabular-nums; }
.pack span { display: block; font-size: 12px; color: var(--mut); margin-top: 2px; }
.pay-methods { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 8px 0 4px; }
.pay { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--line); color: var(--dim); font-size: 14px; font-weight: 600; opacity: .8; }
.pay i { font-style: normal; font-size: 18px; }
.sum { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px; border-radius: 12px; background: #0a101e; border: 1px solid var(--line3); margin: 10px 0; }
.sum b { font-size: 20px; color: var(--gold-hi); font-variant-numeric: tabular-nums; }
.demo-note { display: flex; gap: 8px; align-items: flex-start; }

/* 儲值彈窗：緊湊版。一般螢幕上整個彈窗放得下、不會出現捲動軸；視窗真的很矮（橫放手機、很小的筆電視窗）才靠 .modal 的 max-height 捲動 */
#topupModal .modal { padding: 22px 26px 20px; }
#topupModal h2 { font-size: 21px; margin-bottom: 2px; padding-right: 40px; }
#topupModal .sub { margin: 0 0 10px; }
#topupModal .lbl { margin-bottom: 4px; }
#topupModal .lbl-note { margin-left: 10px; font-size: 12.5px; font-weight: 400; color: var(--dim); }
#topupModal .packs { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 4px 0 10px; }
#topupModal .pack { padding: 8px 6px 7px; border-radius: 12px; }
#topupModal .pack b { font-size: 20px; line-height: 1.3; }
#topupModal .pack span { margin-top: 0; }
#topupModal .tu-custom { margin: 0; }
#topupModal .tu-custom input { padding-top: 10px; padding-bottom: 10px; }
#topupModal .sum { padding: 9px 14px; margin: 10px 0 12px; }
#topupModal .sum b { font-size: 19px; }
#topupModal .pay-methods { grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 4px 0 2px; }
#topupModal .pay { justify-content: center; gap: 6px; padding: 8px 6px; font-size: 13px; white-space: nowrap; }
#topupModal .pay i { font-size: 16px; }
#topupModal .legal-note { margin: 8px 0 0; }
#topupModal .demo-note { margin: 10px 0 0; padding: 8px 12px; font-size: 13px; line-height: 1.5; }
#topupModal .acts { margin-top: 14px; }
@media (max-width: 520px) {
  #topupModal .modal { padding: 20px 18px 18px; }
  #topupModal .pay-methods { grid-template-columns: repeat(2, 1fr); }
}
@media (max-height: 700px) {
  #topupModal .modal { padding: 16px 22px 14px; }
  #topupModal .sub { margin-bottom: 6px; }
  #topupModal .pack { padding: 6px 6px 5px; }
  #topupModal .sum { margin: 8px 0; padding: 7px 14px; }
  #topupModal .pay { padding: 6px; }
  #topupModal .acts { margin-top: 10px; }
}

/* 提示訊息：放在左下角、完全不擋滑鼠（pointer-events: none），不會蓋住格子 / 按鈕 */
.toasts { position: fixed; z-index: 200; bottom: 16px; left: 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; pointer-events: none; width: min(60vw, 300px); }
@keyframes toastin { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
@media (max-width: 700px) { .toasts { bottom: 12px; left: 12px; width: min(80vw, 320px); } }
.toast { pointer-events: none; padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--ink); background: rgba(24, 35, 61, .92); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0, 0, 0, .45); animation: toastin .22s; max-width: 100%; }
.toast.ok { border-color: rgba(95, 224, 160, .6); }
.toast.bad { border-color: rgba(255, 122, 134, .7); }

/* ───────── 頁尾 ───────── */
.site-footer { border-top: 1px solid var(--line3); padding: 22px 0 30px; color: var(--dim); font-size: 14px; margin-top: 40px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.site-footer a { color: var(--mut); }
.site-footer .flinks { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.site-footer .fco { margin-top: 12px; gap: 4px 0; justify-content: flex-start; font-size: 13px; line-height: 1.7; }
.site-footer .fco .sep { margin: 0 10px; opacity: .5; }
@media (max-width: 760px) { .site-footer .fco { flex-direction: column; } .site-footer .fco .sep { display: none; } }

/* 頁首擠不下時（代幣、紫鑽的數字很大的窄螢幕）：site.js 的 fitHeader() 會加上 .tight，品牌只留 logo；放得下就照常顯示文字 */
.hd.tight .brand .bn { display: none; }
.hd.tight2 .bal .coin { display: none; }

/* ───────── 紫鑽 / 紫鑽商城 ───────── */
:root { --gem: #b983ff; --gem-hi: #e4ccff; --gem-lo: #7b3fe4; }
.gembox { display: inline-flex; align-items: center; gap: 6px; box-sizing: border-box; height: 40px; padding: 0 14px 0 10px; border-radius: 999px; color: var(--gem-hi); font-weight: 700; background: linear-gradient(180deg, #2b1f4f, #19122f); border: 1px solid #5a41a3; transition: border-color .15s, background .15s; }
.gembox:hover { text-decoration: none; border-color: #9a72f0; background: linear-gradient(180deg, #34265f, #1e1639); }
.gembox .ic { flex: none; }   /* 和代幣圖示一樣不加光暈：兩個圖示同樣大、同樣是平面的圓幣 */
.gembox b { font-variant-numeric: tabular-nums; font-size: 16px; line-height: 1.2; }
.gembox.bump { animation: gbump .6s; }
@keyframes gbump { 0% { box-shadow: 0 0 0 0 rgba(170, 110, 255, .75); } 100% { box-shadow: 0 0 0 14px rgba(170, 110, 255, 0); } }
.nav a.shoplink { display: inline-flex; align-items: center; gap: 6px; }
.nav a.shoplink .ic { flex: none; }
.me-bal b.gem-n { color: var(--gem-hi); }
.me-bal .ic.gem { align-self: center; flex: none; }
.toast.gem { border-color: rgba(185, 131, 255, .7); color: var(--gem-hi); }
.btn.gem { color: #fff; background: linear-gradient(#b98bff, #7a3fe0); box-shadow: inset 0 0 0 1px rgba(236, 214, 255, .55), 0 6px 18px rgba(130, 70, 230, .28); }
.btn.gem:hover:not([disabled]) { filter: brightness(1.1); }
.btn.gem[disabled] { opacity: .55; }

.shop-hero { padding: clamp(22px, 4vw, 44px) 0 6px; }
.shop-hero h1 { display: flex; align-items: center; gap: 12px; }
.shop-hero h1 .ic { flex: none; filter: drop-shadow(0 0 12px rgba(170, 110, 255, .6)); }
.shop-hero .lead { max-width: none; margin: 8px 0 0; color: var(--mut); font-size: clamp(15px, 1.35vw, 17px); }
.shop-hero .lead b { color: var(--gem-hi); }
.shop-me { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; justify-content: space-between; margin: 18px 0 6px; }
.shop-me .bal-big { display: flex; align-items: center; gap: 10px; }
.shop-me .bal-big b { font-size: 34px; line-height: 1; color: var(--gem-hi); font-variant-numeric: tabular-nums; }
.shop-me .bal-big span { color: var(--mut); font-weight: 600; }
.gitems { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: clamp(14px, 2vw, 22px); }
.gcard { display: flex; flex-direction: column; border-radius: var(--r-lg); overflow: hidden; background: linear-gradient(180deg, var(--p1), var(--p2)); border: 1px solid var(--line2); box-shadow: var(--shadow); position: relative; transition: transform .2s, border-color .2s; }
.gcard:hover { transform: translateY(-3px); border-color: rgba(185, 131, 255, .55); }
.gcard-art { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: radial-gradient(120% 100% at 30% 0, #33285c, #120e26); display: grid; place-items: center; }
.gcard-art img { width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.gcard-art .noimg { color: rgba(185, 131, 255, .55); }
.gcard.soldout .gcard-art img, .gcard.soldout .gcard-art .noimg { filter: grayscale(1) brightness(.72); }       /* 缺貨：圖片變灰階，上面蓋紅色「缺貨」印章 */
.gcard .stamp { position: absolute; z-index: 2; left: 50%; top: 50%; margin: 0; padding: 5px 24px 7px; border-width: 6px; border-radius: 12px; font-size: 38px; letter-spacing: .24em; text-indent: .24em; transform: translate(-50%, -50%) rotate(-12deg); background: rgba(8, 12, 22, .34); box-shadow: 0 0 0 1px rgba(255, 77, 94, .35), 0 8px 26px rgba(0, 0, 0, .55); text-shadow: 0 2px 8px rgba(0, 0, 0, .55); }
.gcard-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.gcard-title { font-size: 17px; font-weight: 700; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.8em; margin: 0; }
.gcard-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.gprice { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 20px; color: var(--gem-hi); font-variant-numeric: tabular-nums; }
.gprice small { font-size: 13px; color: var(--mut); font-weight: 600; }
.gstock { font-size: 13px; color: var(--mut); }
.gstock b { color: var(--ink); font-variant-numeric: tabular-nums; }
/* 還沒開搶的商品：先顯示、圖片上有「開搶」標籤、按鈕倒數（停用），時間到自動開放 */
.gsoon { position: absolute; left: 10px; top: 10px; z-index: 3; display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px 4px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 800; color: #fff; background: linear-gradient(#b98bff, #7a3fe0); box-shadow: inset 0 0 0 1px rgba(236, 214, 255, .55), 0 4px 14px rgba(0, 0, 0, .45); }
.gsoon .ic { flex: none; }
.gcard.upcoming { border-color: rgba(185, 131, 255, .5); }
.gcard.upcoming .btn.gem[disabled] { opacity: .92; filter: saturate(.75); font-variant-numeric: tabular-nums; }
.gcard.go { animation: gogo 1.2s ease-out 2; }
@keyframes gogo { 0% { box-shadow: 0 0 0 0 rgba(170, 110, 255, .8); } 100% { box-shadow: 0 0 0 18px rgba(170, 110, 255, 0); } }
.shop-notes { margin: 22px 0 0; padding-left: 1.2em; color: var(--mut); font-size: 14px; }
.shop-notes li { margin: 4px 0; }
/* 帳戶頁：紫鑽兌換紀錄 */
#gemorders, #gemledger { scroll-margin-top: 88px; }
.gthumb { display: inline-flex; align-items: center; gap: 10px; }
.gthumb img, .gthumb .gnoimg { flex: none; width: 44px; height: 44px; border-radius: 10px; object-fit: contain; background: radial-gradient(120% 100% at 30% 0, #33285c, #120e26); border: 1px solid var(--line3); }
.gthumb .gnoimg { display: grid; place-items: center; color: rgba(185, 131, 255, .6); }
.gcost { display: inline-flex; align-items: center; gap: 5px; color: var(--gem-hi); font-weight: 700; }
.chip.gem { color: var(--gem-hi); background: rgba(150, 100, 240, .12); border-color: rgba(185, 131, 255, .45); }

/* ───────── 手機 ───────── */
/* 頁首文字一律不換行：縮小狀態是單列（不換行排版），放不下時文字換行會把頁首撐高；改成由下面的漢堡選單收納導航列 */
.site-header .hd .nav a, .site-header .hd-right > *, .site-header .hd-right .btn, .site-header .bal, .site-header .gembox, .site-header .userchip { white-space: nowrap; }
.site-header .hd-right > * { flex: none; }
@media (max-width: 1100px) {      /* 導航列收進漢堡選單（站長頁首多一顆「管理後台」，一列放不下，所以門檻比手機寬） */
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; gap: 2px; margin: 0; padding: 8px 16px 14px; background: rgba(8, 12, 22, .97); border-bottom: 1px solid var(--line3); box-shadow: 0 14px 28px rgba(0, 0, 0, .45); }
  html.nav-open .nav { display: flex; }
  .nav a { padding: 13px 14px; font-size: 16px; }
  .nav-toggle { display: inline-flex; }
  .hd-right, .nav + .hd-right { margin-left: auto; }
}
@media (max-width: 860px) {
  .brand .bn { display: none !important; }      /* 手機：網站名稱一律不顯示（logo 上已經有名字），捲動前後都一樣 */
  .bal .u { display: none; }
  .userchip span.nm { display: none; }
  .userchip .ui { display: block; }
  .userchip { padding: 6px 8px; }
}
@media (max-width: 700px) {
  /* 中獎紀錄：手機上一筆中獎排成一張小卡（每格前面顯示欄位名稱），「填寫寄送資料」按鈕才不會被擠到橫向捲動的最右邊 */
  .tbl.rstack, .tbl.rstack tbody, .tbl.rstack tr, .tbl.rstack td { display: block; width: 100%; }
  .tbl.rstack thead { display: none; }
  .tbl.rstack tr { padding: 10px 14px 12px; border-top: 1px solid var(--line3); }
  .tbl.rstack tr:first-child { border-top: 0; }
  .tbl.rstack td { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 3px 0; border: 0; white-space: normal; text-align: right; }
  .tbl.rstack td::before { content: attr(data-l); flex: none; color: var(--dim); font-size: 13px; font-weight: 600; text-align: left; }
  .tbl.rstack td.shipcell { align-items: flex-start; min-width: 0; }
  .tbl.rstack td.shipcell .s1 { justify-content: flex-end; }
  .tbl.rstack tr:hover td { background: none; }
  .tbl.rstack td.shipcell > .btn { margin-left: auto; }
}
@media (max-width: 520px) {
  body { font-size: 15px; }
  .hd { min-height: 62px; gap: 6px; }
  .hd-right { gap: 3px; }
  .btn.admin-btn { padding: 7px 8px; font-size: 13px; }     /* 要寫成 .btn.admin-btn：.btn.sm 的 padding / 字級權重一樣高，單寫 .admin-btn 會被蓋掉 */
  .logo { width: 30px; height: 30px; border-radius: 9px; }
  .logo-img { height: 42px; }
  .hd-holder { height: 63px; }
  .has-admin .brand .bn { display: none; }      /* 站長頁首多一顆「管理後台」鈕：手機上品牌只留 logo，免得擠到換行 */
  .brand { font-size: 18px; }
  .brand .bn { white-space: nowrap; }            /* 不准縮成兩行：放不下就由 fitHeader() 整個收起來 */
  .btn.lg { padding: 12px 22px; }
  /* 頁首一列要放：（品牌）、（管理後台）、代幣、紫鑽、帳戶、登出——手機上每一個都縮小一點 */
  .bal { gap: 4px; padding: 3px 3px 3px 8px; }
  .bal .coin { width: 17px; height: 17px; }
  .bal b { font-size: 14px; }
  .bal-plus { width: 26px; height: 26px; font-size: 18px; }
  .gembox { height: 34px; padding: 0 8px 0 6px; gap: 3px; }      /* 和手機版代幣框（34px）一樣高 */
  .gembox .ic { width: 17px; height: 17px; }
  .gembox b { font-size: 14px; }
  .userchip { padding: 6px 5px; }
  .logout-form .btn.sm { padding: 7px 9px; font-size: 13px; }
  .shop-hero h1 .ic { width: 34px; height: 34px; }
  /* 商城：手機上一排兩張（比一張佔滿整個螢幕好逛） */
  .gitems { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .gcard-body { padding: 10px 11px 12px; gap: 8px; }
  .gcard-title { font-size: 15px; }
  .gcard-meta { flex-wrap: wrap; gap: 2px 8px; }
  .gprice { font-size: 17px; gap: 4px; }
  .gprice small { display: none; }
  .gsoon { left: 7px; top: 7px; padding: 3px 8px 3px 7px; font-size: 11px; gap: 4px; }
  .gcard .btn.block { padding: 9px 8px; font-size: 14px; }
  .gcard .stamp { font-size: 22px; padding: 3px 12px 4px; border-width: 4px; border-radius: 9px; }
}
@media (max-width: 380px) {
  .userchip { padding: 6px 5px; }
  .logout-form .btn.sm { padding: 7px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .chip .dot { animation-duration: 1.6s !important; animation-iteration-count: infinite !important; }   /* 「進行中」的小燈要一直閃：Windows 關掉動畫效果時（PC 常見）也一樣 */
}

/* 分頁（我的帳戶的代幣 / 紫鑽紀錄） */
.pager { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 14px; }
.pager a, .pager b { padding: 4px 11px; border-radius: 8px; border: 1px solid var(--line); font-size: 14px; }
.pager a:hover { text-decoration: none; border-color: #4b5e8c; }
.pager b { color: var(--gold-hi); border-color: var(--gold); background: rgba(255, 205, 60, .12); }
.pager .muted { margin-left: 8px; }

/* ───── 首頁「推薦項目」：滿版幻燈片 ───── */
.sl-head { padding-bottom: 0; }
.slider { position: relative; width: 100%; margin: 0; overflow: hidden; border-block: 1px solid var(--line2); background: #0a1020; }
.sl-track { position: relative; height: clamp(340px, 34vw, 480px); }
.sl-slide { position: absolute; inset: 0; display: block; color: var(--ink); text-decoration: none !important; opacity: 0; visibility: hidden; transition: opacity .7s ease, visibility 0s linear .7s; }
.sl-slide.on { opacity: 1; visibility: visible; transition: opacity .7s ease; z-index: 1; }
.sl-bg { position: absolute; inset: -30px; background: radial-gradient(120% 100% at 30% 0, #2a3a66, #101a30) center / cover no-repeat; filter: blur(26px) saturate(1.15) brightness(.55); transform: scale(1.06); }
.sl-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(6, 10, 18, .85) 0%, rgba(6, 10, 18, .45) 55%, rgba(6, 10, 18, .15) 100%); }
.sl-in { position: relative; height: 100%; display: flex; align-items: center; justify-content: space-between; gap: clamp(20px, 4vw, 64px); padding-block: 28px; padding-inline: clamp(56px, 7vw, 96px); box-sizing: border-box; }
.sl-txt { display: flex; flex-direction: column; align-items: flex-start; gap: clamp(10px, 1.4vw, 16px); min-width: 0; flex: 1 1 46%; }
.sl-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sl-tags .feat-tag { position: static; display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 12px; font-weight: 800; color: var(--gold-ink); background: linear-gradient(#ffe479, #eeab20); }
.sl-cat { padding: 3px 12px; border-radius: 999px; font-size: 12px; font-weight: 800; color: #dfe8fb; background: rgba(10, 16, 30, .6); border: 1px solid rgba(150, 175, 230, .45); }
.sl-title { font-size: clamp(24px, 3.4vw, 44px); font-weight: 800; line-height: 1.25; text-shadow: 0 3px 16px rgba(0, 0, 0, .6); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sl-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; font-size: 14px; color: #cdd7ee; }
.sl-meta b { color: #fff; font-variant-numeric: tabular-nums; }
.sl-price { display: inline-flex; align-items: center; gap: 8px; font-size: clamp(20px, 2.2vw, 28px); font-weight: 800; color: #fff; }
.sl-price small { font-size: 14px; font-weight: 600; color: #cdd7ee; }
.sl-txt .bar { width: min(100%, 340px); }
.sl-go { margin-top: 4px; }
.sl-art { position: relative; flex: 0 0 auto; width: min(46%, 560px); overflow: hidden; border-radius: var(--r-lg); border: 1px solid rgba(255, 205, 60, .45); box-shadow: 0 24px 60px rgba(0, 0, 0, .6); background: radial-gradient(120% 100% at 30% 0, #2a3a66, #101a30); }
.sl-art img { position: absolute; max-width: none; user-select: none; -webkit-user-drag: none; }
.sl-art .noimg { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 205, 60, .5); }
.sl-nav { position: absolute; z-index: 3; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25); background: rgba(8, 12, 22, .55); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; display: grid; place-items: center; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); transition: background .15s, border-color .15s; }
.sl-nav:hover { background: rgba(255, 205, 60, .85); border-color: transparent; color: #1a1300; }
.sl-nav.prev { left: clamp(8px, 1.6vw, 24px); }
.sl-nav.next { right: clamp(8px, 1.6vw, 24px); }
.sl-dots { position: absolute; z-index: 3; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 8px; }
.sl-dots button { width: 10px; height: 10px; padding: 0; border-radius: 999px; border: 0; background: rgba(255, 255, 255, .4); cursor: pointer; transition: width .25s, background .25s; }
.sl-dots button.on { width: 28px; background: var(--gold-hi, #ffe479); }
@media (max-width: 760px) {
  .sl-track { height: 520px; }
  .sl-in { flex-direction: column-reverse; justify-content: flex-end; align-items: stretch; gap: 14px; padding: 22px 16px 46px; }
  .sl-txt { flex: 0 0 auto; }
  .sl-art { width: min(100%, 340px); align-self: center; }
  .sl-shade { background: linear-gradient(180deg, rgba(6, 10, 18, .35), rgba(6, 10, 18, .8)); }
  .sl-nav { top: 110px; width: 36px; height: 36px; font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { .sl-slide, .sl-slide.on { transition: none; } }

/* 手機版：幻燈片就是一張圖（和大獎圖同比例），文字直接疊在圖片下方，高度不再撐高 */
@media (max-width: 760px) {
  .sl-track { height: auto; aspect-ratio: 1.6; }
  .sl-bg { display: none; }
  .sl-shade { display: none; }
  .sl-in { position: absolute; inset: 0; display: block; padding: 0; max-width: none; margin: 0; }
  .sl-art { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; border: 0; border-radius: 0; box-shadow: none; aspect-ratio: auto !important; align-self: auto; }
  .sl-in::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, rgba(6, 10, 18, .4) 0%, rgba(6, 10, 18, 0) 38%, rgba(6, 10, 18, .92) 100%); }
  .sl-txt { position: static; display: block; }
  .sl-txt > * { position: absolute; z-index: 2; }
  .sl-tags { top: 10px; left: 12px; }
  .sl-title { left: 14px; right: 92px; bottom: 38px; font-size: 18px; line-height: 1.25; -webkit-line-clamp: 1; }
  .sl-meta { left: 14px; right: 92px; bottom: 14px; font-size: 12px; gap: 2px 12px; flex-wrap: nowrap; overflow: hidden; }
  .sl-meta > span:nth-child(n+3) { display: none; }
  .sl-price { font-size: 15px; gap: 5px; }
  .sl-price small { font-size: 11px; }
  .sl-price svg { width: 18px; height: 18px; }
  .sl-txt .bar { display: none; }
  .slider .sl-go.btn { right: 10px; bottom: 12px; margin: 0; padding: 5px 11px; min-height: 0; height: auto; font-size: 12px; line-height: 1.2; border-radius: 999px; }
  .sl-nav { top: 50%; width: 30px; height: 30px; font-size: 20px; }
  .sl-nav.prev { left: 6px; }
  .sl-nav.next { right: 6px; }
  .sl-dots { top: 12px; bottom: auto; left: auto; right: 12px; justify-content: flex-end; gap: 6px; }
  .sl-dots button { width: 7px; height: 7px; }
  .sl-dots button.on { width: 18px; }
}

/* ───── 手機 / 觸控裝置：拿掉會讓捲動卡頓的重效果（固定背景、毛玻璃） ───── */
@media (max-width: 900px), (hover: none) {
  body { background-attachment: scroll; }
  .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(8, 12, 22, .96); }
  .modal-back { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .tile .cat-chip, .sl-nav { backdrop-filter: none; -webkit-backdrop-filter: none; }
  html { scroll-behavior: auto; }
}
/* 抽卡磚上的「進行中」：蓋在圖片上，底色要實心、字用白色，才不會被圖片背景吃掉 */
.tile .chip.live { color: #fff; background: #d92a3c; border-color: rgba(255, 255, 255, .55); font-weight: 800; font-size: 11px; padding: 1px 8px; gap: 4px; box-shadow: 0 2px 6px rgba(0, 0, 0, .5); text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.tile .chip.live .dot { width: 6px; height: 6px; }
/* 手機：首頁抽卡一排兩張，卡片內的字、標籤、印章再縮小一點 */
@media (max-width: 520px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .rail { gap: 10px; }
  .rail .tile { flex: 0 0 min(46vw, 170px); }
  .tile-body { padding: 8px 10px 10px; gap: 4px; }
  .tile-title { font-size: 13.5px; min-height: 2.8em; }
  .tile-id { font-size: 11px; }
  .tile-meta { font-size: 11px; gap: 1px 8px; }
  .tile .tile-top { font-size: 11px; }
  .tile .tile-top b { font-size: 13px; }
  .tile .price { left: 8px; bottom: 7px; font-size: 14px; gap: 4px; }
  .tile .price small { font-size: 11px; }
  .tile .cat-chip { right: 8px; bottom: 8px; padding: 2px 8px; font-size: 10.5px; }
  .tile .feat-tag { top: 8px; right: 8px; padding: 2px 8px; font-size: 10.5px; }  .tile .chip.live { font-size: 10px; padding: 1px 6px; gap: 3px; }
  .tile .chip.live .dot { width: 5px; height: 5px; }
  .tile .stamp { font-size: 18px; padding: 2px 10px 3px; border-width: 3px; border-radius: 8px; }
  /* 篩選：狀態＝三等分的切換列；分類＝同一排橫向滑動（不換行），每顆一樣高、置中對齊，右邊淡出提示還能滑 */
  .sec-head { gap: 10px; margin-bottom: 12px; }
  #stFilters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; width: 100%; padding: 3px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); }
  #stFilters button { border: 0; padding: 7px 4px; font-size: 13px; text-align: center; white-space: nowrap; }
  .filters.cats { flex-wrap: nowrap; gap: 7px; margin: 0 -14px 14px; padding: 2px 14px 6px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 28px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 28px), transparent 100%); }
  .filters.cats::-webkit-scrollbar { display: none; }
  .filters.cats button { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 32px; padding: 0 13px; font-size: 13px; line-height: 1; white-space: nowrap; scroll-snap-align: start; }
  .filters.cats button span { margin: 0; padding: 2px 6px; border-radius: 999px; background: rgba(255, 255, 255, .08); font-size: 11px; line-height: 1; opacity: 1; }
  .filters.cats button.on span { background: rgba(0, 0, 0, .14); }
  .sortbar { gap: 6px; margin-bottom: 12px; flex-wrap: nowrap; }
  .sortbar .sb-l { font-size: 12px; }
  .sortbar button { flex: 1 1 0; justify-content: center; padding: 6px 4px; font-size: 12.5px; white-space: nowrap; }
}
