/* ============================================================
   星城引路 · style.css
   結構：base → tokens → layout → header/footer → components → page-specific → @media
   ⚠ 所有 @media 寫在檔案最底部（規範 11-pitfalls.md §1）
   ============================================================ */

/* ---------- 1. Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1100px 540px at 50% -120px, rgba(218,168,76,.18), transparent 60%),
    radial-gradient(900px 600px at 50% 120%, rgba(140,80,30,.14), transparent 65%),
    linear-gradient(180deg, #050608 0%, #07090d 60%, #030406 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
input, textarea, select { font: inherit; }
h1, h2, h3, h4, h5 { margin: 0; font-family: "Noto Serif TC", "Cinzel", serif; font-weight: 700; letter-spacing: .04em; }

/* 滾動條配色（Chromium / Edge） */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #07090d; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #b8852e, #5a3f17); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #d9a84c, #7a521e); }

/* ---------- 2. Tokens ---------- */
:root {
  /* color */
  --bg-1: #050608;
  --bg-2: #0c1014;
  --bg-3: #11171c;
  --bg-4: #17110b;
  --gold: #d9a84c;
  --gold-2: #ffe0a2;
  --gold-3: #b8852e;
  --gold-soft: #f4d799;
  --line: rgba(218, 168, 76, .35);
  --line-2: rgba(218, 168, 76, .55);
  --cream: #fff8eb;
  --cream-2: #f5ead4;
  --paper: #fffaf1;
  --ink: #241709;
  --muted: #c9c2b2;
  --muted-2: #8e867a;
  --text: #f6eee2;
  --text-soft: #d8cdb6;
  --danger: #c84735;
  --success: #46b97c;
  --info: #3a8af4;
  --vip2-bg: #2b1410;
  --vip2-fg: #ffd3a1;

  /* radius / shadow */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --shadow-1: 0 6px 18px rgba(0,0,0,.32);
  --shadow-2: 0 18px 40px rgba(0,0,0,.42);
  --shadow-glow: 0 0 24px rgba(218,168,76,.18);

  /* timing */
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- 3. Layout primitives ---------- */
.page { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin: 26px 0 18px; }
.section-head > div { min-width: 0; }
.section-title { color: var(--gold-2); font-size: clamp(26px, 3.5vw, 34px); letter-spacing: .08em; margin: 4px 0 0; }
.section-desc  { color: var(--text-soft); margin: 8px 0 0; }
.breadcrumb    { font-size: 13px; color: #bba471; letter-spacing: .04em; }
.breadcrumb a  { color: inherit; }
.breadcrumb a:hover { color: var(--gold-2); }

.spacer-sm { height: 18px; }
.spacer-md { height: 40px; }

main { padding-bottom: 64px; }

/* ---------- 4. Visitor banner ---------- */
.visitor-banner {
  background: linear-gradient(90deg, #1a0d05, #2b1c0a 50%, #1a0d05);
  border-bottom: 1px solid var(--line);
  color: var(--gold-2);
  font-size: 14px;
}
.visitor-banner-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 10px 24px;
  display: flex; align-items: center; gap: 12px;
}
.visitor-banner-icon { color: var(--gold); display: inline-flex; }
.visitor-banner-text { flex: 1; }
.visitor-banner-text b { color: #fff; }
.visitor-banner-cta {
  background: linear-gradient(180deg, #ffe3a8, #c88e33);
  color: #27180b;
  padding: 6px 14px; border-radius: 999px;
  font-weight: 800; font-size: 13px;
  white-space: nowrap;
  transition: transform .2s var(--ease), box-shadow .2s;
}
.visitor-banner-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(218,168,76,.35); }
.visitor-banner-close {
  background: transparent; border: 0; color: var(--gold-2);
  font-size: 22px; cursor: pointer; line-height: 1;
  padding: 4px 8px; border-radius: 6px;
}
.visitor-banner-close:hover { background: rgba(218,168,76,.12); }

/* ---------- 5. Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(5, 6, 8, .94);
  border-bottom: 1px solid var(--line);
  /* ⚠ 不可加 backdrop-filter（規範 11-pitfalls.md §2） */
}
.nav-row {
  display: flex; align-items: center; gap: 22px;
  min-height: 80px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  color: var(--gold-2);
  flex: 0 0 auto;
}
.brand-emblem {
  width: 54px; height: 54px; object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(218,168,76,.32));
  transition: transform .35s var(--ease);
}
.brand:hover .brand-emblem { transform: rotate(-6deg) scale(1.05); }
.brand-text { display: flex; flex-direction: column; gap: 4px; line-height: 1; white-space: nowrap; }
.brand-text strong { font-family: "Noto Serif TC", serif; font-size: 26px; letter-spacing: .12em; color: #f6d37e; font-weight: 900; }
.brand-text small  { font-size: 12px; color: #fff4d2; letter-spacing: .22em; opacity: .85; }

.nav {
  display: flex; gap: 4px; flex: 1; justify-content: center;
  align-items: center;
  font-weight: 700;
}
.nav a {
  display: inline-flex; align-items: center;
  padding: 10px 14px;
  color: #efe6d4;
  border-radius: 8px;
  position: relative;
  transition: color .2s, background .2s;
}
.nav a:hover { color: var(--gold-2); background: rgba(218,168,76,.06); }
.nav a.is-active { color: var(--gold-2); }
.nav a.is-active::after {
  content: "";
  position: absolute; left: 14px; right: 14px; bottom: -2px;
  height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.header-actions {
  display: flex; align-items: center; gap: 10px;
  flex: 0 0 auto;
}

/* user chip（已登入時的小頭像） */
.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.03);
  transition: border-color .2s, background .2s;
}
.user-chip:hover { border-color: var(--gold-2); background: rgba(218,168,76,.08); }
.user-chip-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #ffe3a8, #b8852e);
  color: #27180b; font-weight: 900;
  display: grid; place-items: center;
  font-size: 14px;
}
.user-chip-meta { display: flex; flex-direction: column; line-height: 1.2; gap: 2px; }
.user-chip-meta b { font-size: 13px; color: #fff; }
.user-chip-meta small { font-size: 11px; color: var(--gold-soft); letter-spacing: .08em; }

/* hamburger */
.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  background: transparent; border: 1px solid var(--line);
  border-radius: 10px; cursor: pointer; padding: 0;
  position: relative; z-index: 110;
  transition: background .2s, border-color .2s;
}
.nav-toggle:hover { background: rgba(218,168,76,.08); border-color: var(--gold); }
.nav-toggle span {
  display: block; position: absolute;
  left: 11px; right: 11px; height: 2px;
  background: var(--gold-2); border-radius: 2px;
  transition: top .25s, transform .25s, opacity .2s;
}
.nav-toggle span:nth-child(1) { top: 14px; }
.nav-toggle span:nth-child(2) { top: 21px; }
.nav-toggle span:nth-child(3) { top: 28px; }
.nav-toggle.is-open span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { top: 21px; transform: rotate(-45deg); }

/* nav backdrop */
.nav-backdrop {
  position: fixed; inset: 0;
  background: rgba(5,6,8,.62);
  opacity: 0; pointer-events: none;
  transition: opacity .3s var(--ease);
  z-index: 99;
}
.nav-backdrop.is-show { opacity: 1; pointer-events: auto; }
body.is-menu-open { overflow: hidden; }

/* ---------- 6. Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #07090d, #050608);
  padding-top: 56px;
  margin-top: 80px;
  color: var(--text-soft);
}
.footer-grid {
  display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 36px;
  padding-bottom: 36px;
}
.footer-brand .brand { color: var(--gold-2); margin-bottom: 14px; }
.footer-brand .brand-text strong { font-size: 22px; }
.footer-brand .brand-text small  { font-size: 11px; }
.footer-desc { line-height: 1.8; margin: 0 0 18px; color: #d4c5a3; font-size: 14px; }
.footer-contact { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.footer-contact li { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.footer-contact .ft-key { color: var(--gold); min-width: 50px; font-weight: 700; letter-spacing: .12em; }
.footer-contact a { color: #efe2c4; }
.footer-contact a:hover { color: var(--gold-2); }
.footer-social { display: flex; gap: 10px; }
.footer-social a {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line);
  display: grid; place-items: center;
  color: var(--gold-2);
  transition: background .2s, transform .2s var(--ease), border-color .2s;
}
.footer-social a:hover { background: var(--gold); color: #1a1006; border-color: var(--gold); transform: translateY(-2px); }

.footer-col h5 {
  color: #fff; font-size: 13px; margin: 0 0 14px;
  letter-spacing: .22em; font-weight: 800;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer-col a { color: #d4c5a3; font-size: 14px; transition: color .2s, padding .2s; }
.footer-col a:hover { color: var(--gold-2); padding-left: 4px; }

.footer-bottom { border-top: 1px solid rgba(218,168,76,.12); padding: 18px 0; font-size: 13px; }
.footer-bottom-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: #8e867a; }
.footer-disclaimer { color: #6c6557; }

/* ---------- 7. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 22px;
  color: var(--gold-2);
  background: rgba(8,10,14,.55);
  font-weight: 800; letter-spacing: .04em;
  cursor: pointer;
  transition: transform .2s var(--ease), background .2s, border-color .2s, box-shadow .2s, color .2s;
  text-align: center; white-space: nowrap;
}
.btn:hover { border-color: var(--gold); background: rgba(218,168,76,.1); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn.primary, .gold-btn {
  background: linear-gradient(180deg, #ffe3a8, #c88e33);
  color: #27180b; border-color: transparent;
  box-shadow: inset 0 1px rgba(255,255,255,.45), 0 6px 16px rgba(218,168,76,.18);
}
.btn.primary:hover, .gold-btn:hover {
  background: linear-gradient(180deg, #ffeec0, #d99e3f);
  box-shadow: inset 0 1px rgba(255,255,255,.5), 0 10px 22px rgba(218,168,76,.30);
}
.btn.ghost { background: rgba(255,255,255,.04); color: var(--gold-2); }
.btn.danger { background: var(--danger); border-color: transparent; color: #fff; }
.btn.danger:hover { background: #d6553f; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block, .full-btn { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.gold-btn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; padding: 12px 24px; margin-top: 14px;
  font-weight: 900; gap: 8px;
}

/* ---------- 8. Forms ---------- */
.form-box {
  max-width: 460px; margin: 60px auto;
  background: var(--paper); color: var(--ink);
  border-radius: var(--r-lg);
  padding: 32px;
  box-shadow: var(--shadow-2);
}
.form-box h1 {
  margin: 0 0 6px; font-size: 26px; color: #2b1c0a;
}
.form-box .form-lead { color: #66523a; margin: 0 0 20px; font-size: 14px; }
.form-control { margin: 14px 0; }
.form-control label { display: block; font-weight: 800; margin-bottom: 6px; color: #2b1c0a; font-size: 14px; }
.form-control input, .form-control select, .form-control textarea,
input.fc, select.fc, textarea.fc {
  width: 100%; padding: 13px 14px;
  border-radius: 8px; border: 1px solid #d7c49f;
  background: #fff; color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
  font-family: inherit;
}
.form-control input:focus, .form-control select:focus, .form-control textarea:focus,
input.fc:focus, select.fc:focus, textarea.fc:focus {
  outline: 0; border-color: var(--gold-3);
  box-shadow: 0 0 0 3px rgba(217,168,76,.18);
}
/* ============================================================
   原生瀏覽器 chrome 全面接管（避免醜的預設樣式）
   ============================================================ */

/* 1. number 上下箭頭 */
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; appearance: none; margin: 0; }

/* 2. search 的 X 清除按鈕（Webkit） */
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration { -webkit-appearance: none; appearance: none; }

/* 3. textarea 右下角 resize 把手只保留垂直方向，且調整觸感 */
textarea { resize: vertical; min-height: 80px; }

/* 4. 移除 input/textarea/select autofill 黃色 + 字色保持 */
input:-webkit-autofill,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  transition: background-color 999999s ease-in-out 0s;
}
.admin-card input:-webkit-autofill,
.admin-card textarea:-webkit-autofill,
.admin-card select:-webkit-autofill {
  -webkit-text-fill-color: #fff;
  -webkit-box-shadow: 0 0 0 1000px #11171c inset;
}

/* 5. date / time / datetime-local / month / week 的小日曆 icon 染金色 */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator,
input[type="week"]::-webkit-calendar-picker-indicator {
  filter: invert(60%) sepia(80%) saturate(420%) hue-rotate(2deg) brightness(98%);
  cursor: pointer;
  opacity: .8;
}
input[type="date"]:hover::-webkit-calendar-picker-indicator,
input[type="time"]:hover::-webkit-calendar-picker-indicator,
input[type="datetime-local"]:hover::-webkit-calendar-picker-indicator { opacity: 1; }

/* 6. password 顯示密碼按鈕（Edge） */
input::-ms-reveal,
input::-ms-clear { display: none; }

/* 7. 統一 button reset（再加保險） */
button { background: transparent; border: 0; color: inherit; cursor: pointer; }

/* 8. 預設 outline 改用我們的 focus-visible 配色（保留無障礙） */
*:focus { outline: 0; }
*:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: inherit;
}
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible { outline-offset: 2px; }

/* 9. select 的下拉選項（Firefox 才能改背景，Chrome 由 OS 控制） */
select option {
  background: #fff; color: var(--ink);
}
.admin-card select option {
  background: #11171c; color: #fff;
}

/* 10. 連結點擊去掉 tap highlight（行動版 Webkit） */
a, button, label, input, select, textarea {
  -webkit-tap-highlight-color: rgba(218, 168, 76, .25);
}

/* 11. 圖片 alt 失敗的 broken icon 再小一點 */
img { font-size: 12px; color: var(--muted); }

/* === 自訂 select === */
.form-control select,
select.fc,
.admin-card select,
.checkout-card select,
.white-card select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='10' viewBox='0 0 14 10'><path fill='none' stroke='%23b8852e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2 2l5 6 5-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}
.admin-card select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='10' viewBox='0 0 14 10'><path fill='none' stroke='%23ffe2a4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2 2l5 6 5-6'/></svg>");
}

/* === 自訂 checkbox / radio === */
input[type="checkbox"],
input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border: 2px solid #d7c49f;
  background: #fff;
  cursor: pointer; position: relative;
  flex-shrink: 0; margin: 0; padding: 0;
  transition: border-color .2s, background .2s, box-shadow .2s;
  vertical-align: middle;
}
input[type="checkbox"] { border-radius: 4px; }
input[type="radio"]    { border-radius: 50%; }

input[type="checkbox"]:hover,
input[type="radio"]:hover { border-color: var(--gold-3); }

input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(217,168,76,.28);
}

input[type="checkbox"]:checked {
  border-color: var(--gold-3);
  background: var(--gold-3);
}
input[type="checkbox"]:checked::after {
  content: ""; position: absolute;
  left: 5px; top: 1px;
  width: 5px; height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
input[type="radio"]:checked { border-color: var(--gold-3); border-width: 2px; }
input[type="radio"]:checked::after {
  content: ""; position: absolute;
  inset: 3px;
  background: var(--gold-3);
  border-radius: 50%;
}

/* admin 暗色 checkbox / radio */
.admin-card input[type="checkbox"],
.admin-card input[type="radio"] {
  background: #1a1f25;
  border-color: rgba(218,168,76,.45);
}
.admin-card input[type="checkbox"]:checked,
.admin-card input[type="radio"]:checked {
  background: var(--gold);
  border-color: var(--gold);
}
.admin-card input[type="radio"]:checked::after { background: #1a1f25; }

/* === 自訂 file input === */
.file-field { position: relative; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.file-field > input[type="file"] {
  position: absolute; left: 0; top: 0;
  opacity: 0; width: 0.1px; height: 0.1px; overflow: hidden;
  z-index: -1;
}
.file-field-button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 8px;
  border: 1px dashed #d7c49f; background: #fffdf6;
  color: #2b1c0a; font-weight: 800; font-size: 14px;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .15s var(--ease);
}
.file-field-button:hover { background: #fdf3d8; border-color: var(--gold-3); transform: translateY(-1px); }
.file-field-button svg { width: 16px; height: 16px; }
.file-field-name { color: #826b48; font-size: 13px; word-break: break-all; }

.admin-card .file-field-button {
  background: #11171c; color: var(--gold-2);
  border-color: rgba(218,168,76,.4);
}
.admin-card .file-field-button:hover { background: rgba(218,168,76,.1); border-color: var(--gold); }
.admin-card .file-field-name { color: var(--gold-soft); }

/* === input 後綴（如 % 元 等） === */
.input-suffix {
  position: relative;
  display: flex; align-items: stretch;
}
.input-suffix > input { flex: 1; padding-right: 44px; }
.input-suffix > .suffix {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: #826b48; font-weight: 800; font-size: 14px; pointer-events: none;
}
.admin-card .input-suffix > .suffix { color: var(--gold-soft); }
.form-control .form-help { font-size: 12px; color: #826b48; margin-top: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #4a3a26; }
.form-check input { width: 18px; height: 18px; }
.form-divider {
  border: 0; border-top: 1px solid #ead8b3;
  margin: 18px 0; text-align: center; height: 0; color: #b89d6c;
  position: relative;
}
.form-divider::after {
  content: attr(data-label); position: absolute; top: -10px; left: 50%;
  transform: translateX(-50%); padding: 0 12px; background: var(--paper);
  font-size: 12px;
}

.demo-hint {
  margin-top: 12px; padding: 10px 12px;
  background: #fdf3d8; border: 1px dashed #d3b56a;
  border-radius: 8px; color: #6b4a14; font-size: 13px;
  display: flex; align-items: center; gap: 8px;
}

/* ---------- 9. Hero / 開獎卡 ---------- */
.hero-wrap {
  display: grid; grid-template-columns: 1fr 320px;
  border: 1px solid rgba(218,168,76,.18); /* 邊框淡一點，避免跟 hero 內側形成「線感」 */
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-top: 20px;
  background: #07090d;
  box-shadow: var(--shadow-2);
}
.hero {
  position: relative;
  min-height: 460px;
  padding: 56px 36px;
  display: flex; flex-direction: column; justify-content: center;
  isolation: isolate;
  background: #07090d; /* 左半純黑底 */
}
/* 圖只取「中間 50% 切片」（去左右各 25%），靠右擺，左淡出 */
/* 原理：background-size:200% → 圖被拉到容器 2 倍寬，position:center → 容器只顯示圖的 25%-75%（即中間 50%）*/
.hero::before {
  content: ""; position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 56%;            /* 右側區塊寬度（可調） */
  z-index: -1;
  background-image: url('../assets/images/hero-bg.png');
  /* 用 cover 確保圖完全覆蓋容器，避免圖比容器矮露出邊；
     圖實際比例 2.073，容器 ~1.01:1 → cover 時會縱向填滿、橫向溢出，
     位置 center 顯示圖中間（指南針）；左右多餘自動裁掉 */
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  /* 四向淡出：水平（左強右輕）+ 垂直（上下對稱）兩層 mask 取交集
     ⚠ 各方向起點/終點都從 transparent 0% 開始，避免邊緣殘留薄影 */
  -webkit-mask-image:
    linear-gradient(90deg,
      transparent 0%,
      rgba(0,0,0,.3) 22%,
      #000 44%,
      #000 86%,
      rgba(0,0,0,.4) 100%),
    linear-gradient(180deg,
      transparent 0%,
      rgba(0,0,0,.18) 10%,
      rgba(0,0,0,.45) 22%,
      rgba(0,0,0,.78) 34%,
      #000 44%,
      #000 56%,
      rgba(0,0,0,.78) 66%,
      rgba(0,0,0,.45) 78%,
      rgba(0,0,0,.18) 90%,
      transparent 100%);
  -webkit-mask-composite: source-in;
          mask-image:
    linear-gradient(90deg,
      transparent 0%,
      rgba(0,0,0,.3) 22%,
      #000 44%,
      #000 86%,
      rgba(0,0,0,.4) 100%),
    linear-gradient(180deg,
      transparent 0%,
      rgba(0,0,0,.18) 10%,
      rgba(0,0,0,.45) 22%,
      rgba(0,0,0,.78) 34%,
      #000 44%,
      #000 56%,
      rgba(0,0,0,.78) 66%,
      rgba(0,0,0,.45) 78%,
      rgba(0,0,0,.18) 90%,
      transparent 100%);
          mask-composite: intersect;
}
/* 上下也補一點點漸層暗角，讓文字更清晰 */
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,.18), transparent 35%, transparent 65%, rgba(0,0,0,.32));
}
.hero-tag {
  display: inline-block; align-self: flex-start;
  padding: 4px 12px; border-radius: 999px;
  background: rgba(218,168,76,.18); color: var(--gold-2);
  font-size: 12px; letter-spacing: .25em; margin-bottom: 12px;
  font-family: "Cinzel", "Noto Serif TC", serif;
}
.hero h1 {
  font-size: clamp(26px, 4vw, 40px);
  letter-spacing: .14em; color: var(--gold-2); margin: 0 0 10px;
  text-shadow: 0 4px 22px rgba(0,0,0,.45);
}
.hero p { font-size: clamp(14px, 1.6vw, 17px); margin: 0 0 18px; color: #f1e6cc; max-width: 560px; }

.hero-nums { display: flex; gap: 14px; margin: 10px 0 22px; flex-wrap: wrap; }
.hero-num {
  width: 80px; height: 80px;
  border: 2px solid var(--gold-soft); border-radius: 50%;
  display: grid; place-items: center;
  font-family: "Cinzel", serif;
  font-size: 34px; font-weight: 900;
  color: #ffe7a4; background: rgba(0,0,0,.3);
  box-shadow: inset 0 0 12px rgba(218,168,76,.18), 0 6px 14px rgba(0,0,0,.35);
}
.hero-buttons { display: flex; gap: 12px; flex-wrap: wrap; }

/* lottery 球（橘紅漸層） */
.balls { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.ball {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 25%, #ffb36f 0, #ff6c30 35%, #b5090f 100%);
  font-weight: 900; color: #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,.3), inset 0 1px rgba(255,255,255,.35);
  font-size: 14px;
  transition: transform .2s var(--ease);
}
.ball.special { background: radial-gradient(circle at 35% 25%, #d8e9ff 0, #6ea5ff 35%, #1a3b96 100%); }
.balls .ball:hover { transform: translateY(-2px) scale(1.05); }

.lottery-card {
  background: linear-gradient(180deg, #0c0e12, #07090d);
  border-left: 1px solid var(--line);
  display: grid; place-items: center;
  text-align: center; padding: 22px 22px; gap: 4px;
}
.lottery-card h3 { color: var(--gold-2); font-size: 15px; margin: 0; letter-spacing: .14em; }
.lottery-logo { width: 110px; max-width: 80%; height: auto; }
.lottery-card .balls { margin: 8px 0 4px; }
.lottery-card .countdown {
  font-family: "Cinzel", serif; font-size: 26px;
  letter-spacing: .18em; color: var(--gold-2);
  margin: 4px 0 8px;
  text-shadow: 0 0 12px rgba(218,168,76,.35);
}
.lottery-card .countdown-label { font-size: 12px; color: #c2b288; letter-spacing: .14em; margin: 0; }

/* ---------- 10. 6 大選單卡 ---------- */
.section-kicker {
  display: flex; align-items: center; gap: 16px;
  margin: 60px 0 18px;
  font-family: "Cinzel", "Noto Serif TC", serif;
  color: var(--gold-2); font-size: 14px;
  letter-spacing: .35em;
}
.section-kicker::before,
.section-kicker::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(218,168,76,.45), transparent);
}
.menu-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px;
  margin: 0 0 24px;
}
.menu-card {
  position: relative;
  border: 1px solid var(--line); border-radius: var(--r-md);
  min-height: 158px;
  background: linear-gradient(155deg, #131a20, #0a0d11 70%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 18px 10px;
  transition: transform .25s var(--ease), box-shadow .25s, border-color .25s;
  overflow: hidden;
}
.menu-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 70% at 50% 0%, rgba(218,168,76,.18), transparent 60%);
  opacity: 0; transition: opacity .3s;
}
.menu-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-glow), 0 18px 30px rgba(0,0,0,.32); border-color: var(--gold); }
.menu-card:hover::before { opacity: 1; }
.menu-card img { width: 56px; height: 56px; margin-bottom: 12px; filter: drop-shadow(0 0 12px rgba(218,168,76,.32)); }
.menu-card h3 { color: #ffe2a4; font-size: 18px; margin: 0; letter-spacing: .04em; }
.menu-card p  { margin: 6px 0 0; color: var(--muted); font-size: 13px; }

/* ---------- 11. Content cards 通用 ---------- */
.toolbar {
  display: grid; grid-template-columns: 1fr auto;
  gap: 14px; align-items: center;
  border: 1px solid var(--line);
  background: linear-gradient(155deg, rgba(18,25,30,.92), rgba(6,8,10,.92));
  padding: 14px; border-radius: var(--r-lg);
  margin: 18px 0 18px;
}
.lottery-tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.lottery-tabs::-webkit-scrollbar { display: none; }
.lottery-tab {
  border: 1px solid var(--line-2);
  background: rgba(0,0,0,.28); color: var(--gold-soft);
  border-radius: 999px;
  padding: 9px 16px;
  font-weight: 800; cursor: pointer; white-space: nowrap;
  font-size: 14px;
  transition: background .2s, color .2s, border-color .2s, box-shadow .2s;
}
.lottery-tab:hover { background: rgba(218,168,76,.12); color: var(--gold-2); }
.lottery-tab.is-active {
  background: linear-gradient(180deg, #ffe3a8, #c88e33);
  color: #27180b; border-color: transparent;
  box-shadow: 0 0 22px rgba(218,168,76,.22);
}

.search-box {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line);
  background: #060708; border-radius: 999px;
  padding: 10px 14px; color: #c9b58c; min-width: 240px;
  transition: border-color .2s, box-shadow .2s;
}
.search-box:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(218,168,76,.16); }
.search-box svg { width: 16px; height: 16px; flex-shrink: 0; }
.search-box input { background: transparent; border: 0; outline: 0; color: #fff; flex: 1; min-width: 0; }
.search-box input::placeholder { color: #7e7158; }

.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 18px; }
.filter-pill {
  border: 1px solid var(--line);
  color: #ead29a; background: rgba(0,0,0,.24);
  border-radius: 999px; padding: 7px 13px;
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.filter-pill:hover { background: rgba(218,168,76,.1); }
.filter-pill.is-active { background: rgba(218,168,76,.18); border-color: var(--gold-2); color: #fff; }

.grid-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
.content-card {
  position: relative; overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, #fff9ed, #efe0c3);
  color: #26180b;
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
  transition: transform .25s var(--ease), box-shadow .25s, border-color .25s;
  display: flex; flex-direction: column;
}
.content-card:hover { transform: translateY(-3px); box-shadow: 0 20px 38px rgba(0,0,0,.42); border-color: var(--gold); }
.content-card.dark { background: linear-gradient(155deg, #151a1f, #0a0d10); color: #f8ead0; }
.content-card .card-link {
  display: flex; flex-direction: column; height: 100%;
  color: inherit;
}

.thumb {
  position: relative; aspect-ratio: 4 / 3;
  background: #161616; overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.content-card:hover .thumb img { transform: scale(1.04); }
.thumb.paper   { aspect-ratio: 282 / 389; background: #f8efdc; padding: 14px; }
.thumb.paper img { object-fit: contain; }
.thumb.fortune { aspect-ratio: 194 / 338; background: #f8efdc; padding: 14px; }
.thumb.fortune img { object-fit: contain; }

.card-body { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; }
.card-body h3 { font-size: 19px; margin: 0 0 8px; color: inherit; }
.card-body p  { color: #625547; margin: 0 0 14px; line-height: 1.65; font-size: 14px; flex: 1; }
.content-card.dark .card-body p { color: #d1c1a3; }

.meta-line {
  display: flex; justify-content: space-between; gap: 10px;
  color: #7b6a52; font-size: 13px; margin-top: auto;
  padding-top: 12px;
}
.content-card.dark .meta-line { color: #bda977; }
.meta-line svg { width: 14px; height: 14px; vertical-align: -2px; }

.badge-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 999px; padding: 4px 10px;
  font-size: 12px; font-weight: 900; letter-spacing: .04em;
}
.badge.gold { background: #21170c; color: #ffe2a4; border: 1px solid var(--line-2); }
.badge.free { background: #e7f5e7; color: #246b38; }
.badge.vip1 { background: #fff0c9; color: #7b4b00; }
.badge.vip2 { background: var(--vip2-bg); color: var(--vip2-fg); }

.lock-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.62);
  display: grid; place-items: center;
  color: #ffe2a4; font-size: 16px; font-weight: 900;
  letter-spacing: .08em;
  gap: 6px;
  z-index: 2;
}

.pagination {
  display: flex; gap: 8px; justify-content: center; margin: 32px 0 8px;
}
.page-no {
  width: 40px; height: 40px;
  border: 1px solid var(--line-2); border-radius: 8px;
  display: grid; place-items: center;
  color: var(--gold-soft);
  cursor: pointer;
  transition: background .2s, color .2s;
}
.page-no:hover { background: rgba(218,168,76,.1); }
.page-no.is-active { background: linear-gradient(180deg, #ffe3a8, #c88e33); color: #241709; border-color: transparent; }

/* ---------- 12. Detail layout (paper / fortune slip) ---------- */
.detail-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  margin-top: 8px;
}
.detail-card {
  background: var(--paper); color: var(--ink);
  border-radius: var(--r-lg); padding: 28px 30px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-2);
}
.detail-card h1 { margin: 0 0 12px; font-size: 30px; color: #2b1c0a; }
.detail-card p { line-height: 1.85; }
.detail-image { width: 100%; border-radius: 10px; margin: 18px 0; background: #eee; }
.detail-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

.side-panel {
  background: linear-gradient(155deg, #12191e, #090b0e);
  border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 22px;
  align-self: start;
  position: sticky; top: 96px;
}
.side-panel h3 { margin: 0 0 14px; color: #ffe2a4; font-size: 16px; letter-spacing: .12em; }
.side-link {
  display: block; padding: 12px 0;
  border-bottom: 1px dashed rgba(218,168,76,.2);
  color: #e8d2a0; font-size: 14px;
  transition: color .2s, padding .2s;
}
.side-link:hover { color: var(--gold-2); padding-left: 6px; }
.side-link:last-child { border-bottom: 0; }

/* paper / fortune slip */
.report-paper {
  position: relative; max-width: 520px; margin: 0 auto;
  aspect-ratio: 282 / 389;
  background: url('../assets/images/paper-sample.png') center / 100% 100% no-repeat;
  color: #1b120b; padding: 11% 8% 8%;
  filter: drop-shadow(0 14px 28px rgba(0,0,0,.32));
}
.report-title { text-align: center; font-size: 28px; font-weight: 900; letter-spacing: .04em; margin-bottom: 6px; }
.report-info { display: flex; justify-content: space-between; border-top: 2px solid #3a281a; border-bottom: 2px solid #3a281a; padding: 5px 0; font-size: 13px; font-weight: 900; }
.report-logo { text-align: center; margin: 12px 0 6px; }
.report-logo img { height: 32px; }
.report-balls { display: flex; justify-content: center; gap: 6px; margin: 10px 0 14px; }
.report-balls .ball { width: 40px; height: 40px; font-size: 14px; }
.report-section { border: 2px solid #3a281a; background: rgba(255,255,255,.22); padding: 8px 10px; margin: 6px 0; }
.report-section h4 { margin: 0 0 6px; text-align: center; font-size: 16px; font-weight: 900; }
.report-two { display: grid; grid-template-columns: 1fr .58fr; gap: 8px; }

.fortune-slip {
  position: relative; max-width: 360px; margin: 0 auto;
  aspect-ratio: 194 / 338;
  background: url('../assets/images/fortune-card-sample.png') center / 100% 100% no-repeat;
  color: #381d0d; padding: 22% 14% 13%;
  filter: drop-shadow(0 14px 28px rgba(0,0,0,.32));
  text-align: center;
}
.fortune-slip h2 { font-size: 22px; margin: 0 0 8px; }
.fortune-level { font-size: 32px; font-weight: 900; margin-bottom: 14px; }
.fortune-poem { font-size: 18px; line-height: 1.95; font-weight: 800; letter-spacing: .08em; white-space: pre-line; }
.fortune-explain { margin-top: 14px; border-top: 1px solid rgba(80,40,15,.25); padding-top: 12px; line-height: 1.8; text-align: left; font-size: 14px; }

/* ---------- 13. VIP cards ---------- */
.vip-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 16px; }
.vip-card {
  position: relative;
  background: linear-gradient(155deg, #141a20, #090b0e);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 28px 26px; text-align: center;
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
  display: flex; flex-direction: column;
}
.vip-card:hover { transform: translateY(-4px); border-color: var(--gold-2); box-shadow: 0 22px 50px rgba(0,0,0,.4), 0 0 32px rgba(218,168,76,.16); }
.vip-card h2 { color: var(--gold-2); font-size: 22px; letter-spacing: .14em; margin: 0; }
.vip-price {
  font-family: "Cinzel", serif; font-size: 38px; font-weight: 900;
  color: var(--gold-2); margin: 14px 0 6px;
}
.vip-price small { font-size: 14px; color: var(--muted); font-weight: 600; letter-spacing: .14em; }
.vip-desc { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.vip-card ul { list-style: none; padding: 0; text-align: left; line-height: 2; color: #d7c6a8; flex: 1; }
.vip-card li { padding-left: 24px; position: relative; }
.vip-card li::before {
  content: "✓"; position: absolute; left: 0; top: 2px;
  color: var(--gold); font-weight: 900;
}
.vip-card.featured {
  border-color: var(--gold-2);
  box-shadow: 0 0 38px rgba(218,168,76,.22);
}
.vip-card.featured::before {
  content: "推薦方案"; position: absolute; top: -14px; left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #ffe3a8, #c88e33);
  color: #27180b; padding: 4px 14px; border-radius: 999px;
  font-size: 12px; font-weight: 900; letter-spacing: .14em;
}
.vip-card .btn { margin-top: 22px; width: 100%; }

/* ---------- 14. Live cards ---------- */
.live-head { margin-bottom: 18px; }
.live-head .btn { white-space: nowrap; }
.live-toolbar {
  display: grid; grid-template-columns: 1fr auto;
  gap: 14px; align-items: center;
  border: 1px solid var(--line);
  background: linear-gradient(155deg, rgba(18,25,30,.94), rgba(6,8,10,.94));
  padding: 14px; border-radius: var(--r-lg);
  margin: 8px 0 22px;
}
.live-platform-tabs { min-width: 0; }

.live-featured {
  display: grid; grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: var(--r-xl); overflow: hidden;
  background: linear-gradient(155deg, #141a20, #080a0c);
  box-shadow: 0 22px 50px rgba(0,0,0,.34);
  margin-bottom: 22px;
}
.live-featured-cover {
  position: relative; min-height: 320px; overflow: hidden;
  background: #0b0d10;
}
.live-cover-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 25% 20%, rgba(255,219,137,.28), transparent 28%),
    radial-gradient(circle at 75% 55%, rgba(218,168,76,.26), transparent 30%),
    linear-gradient(135deg, #2a160f, #090b0f 55%, #14100b);
}
.live-cover-bg::after {
  content: "LIVE"; position: absolute; left: 50%; top: 50%;
  transform: translate(-50%,-50%);
  font-family: "Cinzel", serif;
  font-size: 80px; letter-spacing: .12em; font-weight: 900;
  color: rgba(255,226,164,.12);
  border: 2px solid rgba(218,168,76,.28);
  padding: 28px 38px; border-radius: 18px;
}
.live-featured-info { padding: 36px; }
.live-featured-info h2 { margin: 0 0 12px; color: #ffe2a4; font-size: 28px; }
.live-featured-info p { line-height: 1.85; color: #d5c6aa; }
.live-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 22px 0; }
.live-meta-grid span {
  border: 1px solid rgba(218,168,76,.24);
  background: rgba(0,0,0,.26); border-radius: 10px;
  padding: 10px; color: #e5c985; font-size: 14px;
}
.live-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.live-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.live-card {
  overflow: hidden; border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(155deg, #131920, #080a0c);
  box-shadow: 0 14px 34px rgba(0,0,0,.28);
  transition: transform .25s var(--ease), border-color .25s;
}
.live-card:hover { transform: translateY(-3px); border-color: var(--gold); }
.live-thumb { position: relative; min-height: 180px; overflow: hidden; }
.live-thumb::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 35% 35%, rgba(255,226,164,.24), transparent 32%),
    linear-gradient(135deg, rgba(0,0,0,.1), rgba(0,0,0,.62));
}
.live-thumb::after {
  content: "▶"; position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 64px; height: 64px;
  border: 1px solid rgba(255,226,164,.6);
  border-radius: 50%; display: grid; place-items: center;
  color: var(--gold-2); background: rgba(0,0,0,.34);
  font-size: 22px; text-indent: 3px;
  transition: background .2s, transform .25s var(--ease);
}
.live-card:hover .live-thumb::after { background: rgba(218,168,76,.4); transform: translate(-50%,-50%) scale(1.1); }

.fb-gradient    { background: linear-gradient(135deg, #14345f, #06090d); }
.yt-gradient    { background: linear-gradient(135deg, #5e1616, #090909); }
.gold-gradient  { background: linear-gradient(135deg, #684410, #0a0804); }
.other-gradient { background: linear-gradient(135deg, #24302f, #08090b); }
.live-thumb.dark { filter: saturate(.75); }

.live-status, .platform-badge {
  position: absolute; z-index: 2;
  border-radius: 999px; padding: 5px 10px;
  font-size: 12px; font-weight: 900;
  letter-spacing: .04em;
}
.live-status { left: 12px; top: 12px; color: #fff; }
.live-status.is-live  { background: var(--danger); box-shadow: 0 0 16px rgba(215,55,55,.45); }
.live-status.upcoming { background: var(--gold-3); color: #1e1207; }
.live-status.ended    { background: #555; color: #eee; }
.platform-badge { right: 12px; top: 12px; background: rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.16); }
.platform-badge.fb    { color: #9fc7ff; }
.platform-badge.yt    { color: #ffaaaa; }
.platform-badge.other { color: var(--gold-2); }

.live-body { padding: 16px 18px 18px; }
.live-body h3 { font-size: 19px; color: #ffe2a4; margin: 0 0 8px; }
.live-body p  { line-height: 1.6; color: #d1c1a3; margin: 0 0 12px; font-size: 14px; }
.locked-card .live-thumb::after { display: none; }

/* ---------- 15. Stats / Tables / Hot ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 8px 0 24px; }
.stat-card {
  background: linear-gradient(155deg, #141a20, #090b0e);
  border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 8px;
  color: var(--text-soft); font-size: 13px; letter-spacing: .08em;
  transition: border-color .25s;
}
.stat-card:hover { border-color: var(--gold-2); }
.stat-card b { font-size: 28px; color: var(--gold-2); font-family: "Cinzel", serif; letter-spacing: .04em; }
.stat-card small { color: var(--muted); font-size: 12px; }

.table-card {
  background: var(--paper); color: var(--ink);
  border-radius: var(--r-lg); padding: 22px;
  overflow: auto; box-shadow: 0 12px 30px rgba(0,0,0,.22);
}
.table-card h3 { color: #2b1c0a; margin: 0 0 14px; font-size: 18px; }
.data-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.data-table th, .data-table td { padding: 12px 14px; border-bottom: 1px solid #eadfcc; text-align: left; font-size: 14px; vertical-align: middle; }
.data-table th { color: #6c4612; font-weight: 800; letter-spacing: .12em; background: #fdf3d8; }
.data-table tbody tr { transition: background .18s; }
.data-table tbody tr:hover { background: #fdf6e2; }

/* 後台暗色 data-table 覆蓋 */
.admin-card .data-table th,
.admin-card .data-table td { border-bottom: 1px solid rgba(218,168,76,.12); color: var(--text-soft); }
.admin-card .data-table th {
  background: rgba(218,168,76,.06);
  color: var(--gold-soft);
  border-bottom-color: rgba(218,168,76,.28);
}
.admin-card .data-table tbody tr { transition: background .18s, box-shadow .18s; }
.admin-card .data-table tbody tr:hover {
  background: rgba(218,168,76,.06);
  box-shadow: inset 3px 0 0 var(--gold);
}
.admin-card .data-table tbody tr:hover td { color: #fff; }
.admin-card .data-table tbody tr:hover td b,
.admin-card .data-table tbody tr:hover td code { color: var(--gold-2); }
.admin-card .data-table code {
  background: rgba(218,168,76,.08); padding: 2px 6px; border-radius: 4px;
  color: var(--gold-soft); font-size: 12px; letter-spacing: .04em;
}

/* 後台 input/textarea 全域暗色（不需逐個 inline style） */
/* ⚠ 用 background-color 而非 background 簡寫，保留 select 的 SVG 箭頭 */
.admin-card input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.admin-card textarea,
.admin-card select {
  background-color: #11171c; color: #fff;
  border-color: rgba(218,168,76,.32);
}
.admin-card input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
.admin-card textarea:focus,
.admin-card select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(218,168,76,.18);
  outline: 0;
}
.admin-card input::placeholder,
.admin-card textarea::placeholder { color: rgba(218,168,76,.32); }
.admin-card label { color: var(--gold-2); }
.admin-card .form-help { color: var(--muted); }
.admin-card form input[type="checkbox"] + label,
.admin-card .form-check label { color: var(--text-soft); }

/* 表格內小型 input / select：尺寸 polish */
.data-table input:not([type="checkbox"]):not([type="radio"]),
.data-table select {
  padding: 7px 10px; font-size: 13px; border-radius: 6px;
}
/* select 預留箭頭空間 + 合理 min-width（避免縮成 ~50px 切到文字） */
.data-table select {
  padding-right: 30px;
  min-width: 110px;
  background-position: right 10px center;
}
.data-table .input-suffix > input { padding: 7px 32px 7px 10px; font-size: 13px; }
.data-table .input-suffix { min-width: 90px; max-width: 110px; }
.admin-card .data-table input:not([type="checkbox"]):not([type="radio"]),
.admin-card .data-table select {
  background-color: #11171c; color: #fff;
  border-color: rgba(218,168,76,.32);
}

.hot-card {
  background: var(--paper); color: var(--ink);
  border-radius: var(--r-lg); padding: 22px;
  box-shadow: 0 12px 30px rgba(0,0,0,.22);
}
.hot-tabs {
  display: flex; background: #08090b; border: 1px solid var(--line);
  border-radius: 10px; padding: 4px; margin-bottom: 14px;
}
.hot-tabs span {
  flex: 1; text-align: center; color: var(--text-soft);
  padding: 8px; border-radius: 7px; font-weight: 800; cursor: pointer;
  transition: background .2s, color .2s;
}
.hot-tabs span.is-active { background: linear-gradient(180deg, #ffe3a8, #c88e33); color: #27180b; }

.hot-inner {
  background: #0d1116; color: #fff; border-radius: 10px;
  padding: 22px; text-align: center;
}
.hot-number-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 14px 0; }
.hot-number { text-align: center; }
.hot-number .ball { margin: 0 auto; width: 46px; height: 46px; font-size: 16px; }
.hot-number small { display: block; color: #cfc6b5; margin-top: 6px; font-size: 12px; }

/* ---------- 16. Toast & Empty / Permission ---------- */
.toast-stack {
  position: fixed; right: 16px; bottom: 16px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
  max-width: calc(100vw - 32px);
}
.toast {
  background: rgba(15, 18, 22, .96);
  border: 1px solid var(--line);
  color: var(--text); padding: 12px 16px;
  border-radius: 12px; min-width: 220px;
  box-shadow: var(--shadow-2);
  pointer-events: auto;
  transform: translateY(8px); opacity: 0;
  animation: toastIn .25s var(--ease) forwards;
  font-size: 14px;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid var(--info); }
.toast.gold    { border-left: 3px solid var(--gold); }
@keyframes toastIn { to { transform: translateY(0); opacity: 1; } }

.empty-permission {
  max-width: 680px; margin: 50px auto;
  background: linear-gradient(155deg, #141a20, #090b0e);
  border: 1px solid var(--line);
  border-radius: var(--r-xl); padding: 44px 32px;
  text-align: center;
}
.empty-permission .lock-emblem {
  width: 72px; height: 72px; margin: 0 auto 18px;
  display: grid; place-items: center;
  border: 1px solid var(--line-2); border-radius: 50%;
  color: var(--gold-2); background: rgba(218,168,76,.06);
}
.empty-permission h1 { color: var(--gold-2); font-size: 24px; margin: 6px 0 10px; }
.empty-permission p { color: var(--text-soft); margin: 0 0 22px; line-height: 1.8; }
.empty-permission .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- 17. Index 專屬 ---------- */
.content-grid { display: grid; grid-template-columns: 1.4fr .85fr 1.05fr; gap: 16px; margin: 18px 0; align-items: stretch; }
.white-card {
  background: var(--paper); color: var(--ink);
  border-radius: var(--r-lg); padding: 20px;
  box-shadow: 0 12px 30px rgba(0,0,0,.22);
  display: flex; flex-direction: column;
  height: 100%;
}
/* 卡片內最後一個按鈕固定靠底（filler 撐空間） */
.white-card > .gold-btn:last-child,
.white-card > .btn:last-child { margin-top: auto; }
.white-card .home-feature-img { align-self: center; }
.card-title {
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 900; font-size: 19px; margin-bottom: 14px;
  color: #1e1407;
}
.card-title .more { font-size: 13px; color: #9d6c0a; font-weight: 700; }
.card-title .more:hover { color: var(--gold-3); }

.route-item {
  display: grid; grid-template-columns: 130px 1fr; gap: 14px;
  border-bottom: 1px solid #eadfcc; padding: 12px 0;
}
.route-item:last-of-type { border-bottom: 0; }
.route-item img { width: 130px; aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; }
.route-item h3 { margin: 0 0 6px; font-size: 16px; color: #1e1407; }
.route-item p  { margin: 0; color: #5f574e; line-height: 1.6; font-size: 13px; }

.home-feature-img {
  display: block; width: 100%; height: auto;
  margin: 0 auto 14px; border-radius: 8px; object-fit: contain;
}
.home-fortune-img { max-width: 220px; }
.home-report-img  { max-width: 230px; }

/* ============================================================
   Body 背景變體（不純黑、有溫度）
   用法：<body class="bg-aura"> / "bg-warm" / "bg-cool"
   ============================================================ */

/* 共用：星塵點點層（用 ::before 鋪滿、固定背景） */
body.bg-aura::before, body.bg-warm::before, body.bg-cool::before,
body.bg-emerald::before, body.bg-rose::before, body.bg-imperial::before,
body.bg-jade::before, body.bg-vintage::before {
  content: "";
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.2px 1.2px at 20px 30px, rgba(255,228,160,.65), transparent 60%),
    radial-gradient(1px 1px at 80px 90px, rgba(255,255,255,.5), transparent 60%),
    radial-gradient(1.5px 1.5px at 140px 50px, rgba(218,168,76,.55), transparent 60%),
    radial-gradient(1px 1px at 200px 120px, rgba(255,255,255,.35), transparent 60%),
    radial-gradient(1.2px 1.2px at 60px 180px, rgba(218,168,76,.45), transparent 60%),
    radial-gradient(1px 1px at 240px 200px, rgba(255,228,160,.5), transparent 60%),
    radial-gradient(1.4px 1.4px at 110px 240px, rgba(218,168,76,.4), transparent 60%),
    radial-gradient(1px 1px at 180px 70px, rgba(255,255,255,.4), transparent 60%);
  background-size: 280px 280px;
  background-repeat: repeat;
  opacity: .55;
  animation: bgStarShimmer 8s ease-in-out infinite;
}
@keyframes bgStarShimmer {
  0%, 100% { opacity: .42; }
  50%      { opacity: .68; }
}

/* 確保內容在星塵之上（fixed 元素例外） */
body[class*="bg-"] > *:not(script):not(style):not(.bg-switcher):not(.bg-toggle):not(.toast-stack):not(.nav-backdrop):not(.visitor-banner) {
  position: relative;
  z-index: 1;
}

/* === 1. 星塵雲彩（默認 · 深藍紫底 + 暖角光暈）=== */
body.bg-aura {
  background:
    /* 角落光暈 */
    radial-gradient(700px 400px at 0% 0%, rgba(80,40,30,.42), transparent 65%),
    radial-gradient(800px 450px at 100% 0%, rgba(40,30,80,.35), transparent 65%),
    radial-gradient(700px 400px at 0% 100%, rgba(60,30,40,.32), transparent 65%),
    radial-gradient(800px 450px at 100% 100%, rgba(30,40,80,.32), transparent 65%),
    /* 中央暖光 */
    radial-gradient(1100px 540px at 50% 0%, rgba(218,168,76,.16), transparent 60%),
    radial-gradient(900px 600px at 50% 120%, rgba(140,80,30,.14), transparent 65%),
    /* 基底深色（不純黑：帶藍紫底色）*/
    linear-gradient(180deg, #0c0a14 0%, #0a0d14 35%, #07090f 70%, #04050a 100%);
  background-attachment: fixed;
}

/* === 2. 暖橘金（傳統金黃調，較暖）=== */
body.bg-warm {
  background:
    radial-gradient(900px 500px at 0% 0%, rgba(120,60,20,.5), transparent 65%),
    radial-gradient(900px 500px at 100% 0%, rgba(80,30,10,.4), transparent 65%),
    radial-gradient(700px 400px at 0% 100%, rgba(100,50,20,.4), transparent 65%),
    radial-gradient(700px 400px at 100% 100%, rgba(60,30,15,.4), transparent 65%),
    radial-gradient(1100px 540px at 50% -100px, rgba(218,168,76,.22), transparent 60%),
    linear-gradient(180deg, #160d08 0%, #100a08 50%, #0a0604 100%);
  background-attachment: fixed;
}

/* === 3. 冷藍紫（神祕星象感）=== */
body.bg-cool {
  background:
    radial-gradient(900px 500px at 0% 0%, rgba(30,40,90,.5), transparent 65%),
    radial-gradient(900px 500px at 100% 0%, rgba(50,30,90,.45), transparent 65%),
    radial-gradient(800px 400px at 0% 100%, rgba(20,40,80,.4), transparent 65%),
    radial-gradient(800px 400px at 100% 100%, rgba(60,40,90,.4), transparent 65%),
    radial-gradient(1100px 540px at 50% -100px, rgba(218,168,76,.12), transparent 60%),
    linear-gradient(180deg, #080b18 0%, #060a14 50%, #04060c 100%);
  background-attachment: fixed;
}

/* === 4. 星雲圖（用 Pollinations 下載的 bg-cloud-stars.jpg）=== */
body.bg-stars {
  background:
    radial-gradient(700px 400px at 0% 0%, rgba(80,40,20,.42), transparent 65%),
    radial-gradient(800px 450px at 100% 100%, rgba(40,30,80,.4), transparent 65%),
    linear-gradient(180deg, #0c0a14 0%, #04050a 100%);
  background-attachment: fixed;
}
body.bg-stars::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: url('../assets/images/bg-cloud-stars.jpg') center / cover no-repeat;
  opacity: .42;
  /* 用 mask 讓圖中央淡、邊緣保留 */
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.5) 30%, rgba(0,0,0,.3) 60%, #000 100%);
          mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.5) 30%, rgba(0,0,0,.3) 60%, #000 100%);
}

/* === 5. 龍紋角落（用 bg-dragon-corner.jpg）=== */
body.bg-dragon {
  background:
    radial-gradient(800px 500px at 50% 0%, rgba(218,168,76,.18), transparent 65%),
    linear-gradient(180deg, #0e0a0c 0%, #060406 100%);
  background-attachment: fixed;
}
body.bg-dragon::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: url('../assets/images/bg-dragon-corner.jpg') center / cover no-repeat;
  opacity: .22;
  /* 龍紋圖比較強烈，整體用較強 mask 讓邊緣淡掉 */
  -webkit-mask-image: radial-gradient(ellipse 100% 80% at 50% 40%, #000 0%, rgba(0,0,0,.6) 40%, rgba(0,0,0,.2) 70%, transparent 100%);
          mask-image: radial-gradient(ellipse 100% 80% at 50% 40%, #000 0%, rgba(0,0,0,.6) 40%, rgba(0,0,0,.2) 70%, transparent 100%);
}

/* === 6. 星宿圖（古老天文圖）=== */
body.bg-constellation {
  background:
    radial-gradient(800px 500px at 0% 0%, rgba(40,30,80,.4), transparent 65%),
    radial-gradient(800px 500px at 100% 100%, rgba(60,30,80,.35), transparent 65%),
    linear-gradient(180deg, #07091a 0%, #050614 50%, #03040a 100%);
  background-attachment: fixed;
}
body.bg-constellation::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: url('../assets/images/bg-constellation.jpg') center / cover no-repeat;
  opacity: .35;
  -webkit-mask-image: radial-gradient(ellipse 110% 90% at 50% 50%, #000 0%, rgba(0,0,0,.5) 50%, transparent 100%);
          mask-image: radial-gradient(ellipse 110% 90% at 50% 50%, #000 0%, rgba(0,0,0,.5) 50%, transparent 100%);
}

/* === 純 CSS 配色變體（無外部圖）=== */

/* 翡翠綠 */
body.bg-emerald {
  background:
    radial-gradient(800px 500px at 0% 0%, rgba(20,80,60,.5), transparent 65%),
    radial-gradient(800px 500px at 100% 100%, rgba(40,100,70,.4), transparent 65%),
    radial-gradient(700px 400px at 100% 0%, rgba(218,168,76,.18), transparent 65%),
    linear-gradient(180deg, #061410 0%, #04100a 50%, #02080a 100%);
  background-attachment: fixed;
}

/* 玫瑰紅酒 */
body.bg-rose {
  background:
    radial-gradient(900px 500px at 0% 0%, rgba(120,30,40,.45), transparent 65%),
    radial-gradient(800px 500px at 100% 100%, rgba(80,20,40,.4), transparent 65%),
    radial-gradient(700px 400px at 50% 0%, rgba(218,168,76,.16), transparent 65%),
    linear-gradient(180deg, #150608 0%, #0e0508 50%, #08040a 100%);
  background-attachment: fixed;
}

/* 帝皇紫 */
body.bg-imperial {
  background:
    radial-gradient(900px 500px at 0% 0%, rgba(70,30,100,.5), transparent 65%),
    radial-gradient(900px 500px at 100% 100%, rgba(100,40,120,.4), transparent 65%),
    radial-gradient(700px 400px at 50% 100%, rgba(218,168,76,.18), transparent 65%),
    linear-gradient(180deg, #0e0814 0%, #08060e 50%, #04030a 100%);
  background-attachment: fixed;
}

/* 玉青 */
body.bg-jade {
  background:
    radial-gradient(900px 500px at 0% 0%, rgba(20,60,80,.5), transparent 65%),
    radial-gradient(900px 500px at 100% 100%, rgba(40,80,90,.4), transparent 65%),
    radial-gradient(700px 400px at 50% 0%, rgba(218,168,76,.12), transparent 65%),
    linear-gradient(180deg, #061014 0%, #050e10 50%, #02080c 100%);
  background-attachment: fixed;
}

/* 古銅復古 */
body.bg-vintage {
  background:
    radial-gradient(900px 500px at 0% 0%, rgba(110,70,40,.45), transparent 65%),
    radial-gradient(900px 500px at 100% 100%, rgba(80,50,30,.4), transparent 65%),
    radial-gradient(700px 400px at 100% 0%, rgba(218,168,76,.2), transparent 65%),
    linear-gradient(180deg, #1a120a 0%, #14100a 50%, #0a0604 100%);
  background-attachment: fixed;
}

/* === 7. 雲紋邊框（金色雲紋只在頂底邊框，中央純黑）=== */
body.bg-pattern {
  background: linear-gradient(180deg, #0a0805 0%, #06050a 100%);
  background-attachment: fixed;
}
body.bg-pattern::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: url('../assets/images/bg-cloud-pattern.jpg') center / cover no-repeat;
  opacity: .25;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 22%, transparent 78%, #000 100%);
          mask-image: linear-gradient(180deg, #000 0%, transparent 22%, transparent 78%, #000 100%);
}

/* === 第二批圖片變體（共用 ::after 顯示主題圖，opacity / mask 各自調）=== */

body.bg-mountain-ink {
  background: radial-gradient(900px 500px at 50% 0%, rgba(218,168,76,.16), transparent 60%), linear-gradient(180deg, #07090d 0%, #04060a 100%);
  background-attachment: fixed;
}
body.bg-mountain-ink::after { content:""; position:fixed; inset:0; z-index:0; pointer-events:none;
  background: url('../assets/images/bg-mountain-ink.jpg') center / cover no-repeat;
  opacity: .3;
  -webkit-mask-image: linear-gradient(180deg, #000, rgba(0,0,0,.5) 50%, transparent 100%);
          mask-image: linear-gradient(180deg, #000, rgba(0,0,0,.5) 50%, transparent 100%);
}

body.bg-gold-leaf {
  background: linear-gradient(180deg, #0a0608 0%, #050306 100%);
  background-attachment: fixed;
}
body.bg-gold-leaf::after { content:""; position:fixed; inset:0; z-index:0; pointer-events:none;
  background: url('../assets/images/bg-gold-leaf.jpg') center / cover no-repeat;
  opacity: .28;
  mix-blend-mode: screen;
}

body.bg-bagua-faded {
  background: radial-gradient(900px 600px at 50% 50%, rgba(218,168,76,.12), transparent 70%), linear-gradient(180deg, #08090e 0%, #04050a 100%);
  background-attachment: fixed;
}
body.bg-bagua-faded::after { content:""; position:fixed; inset:0; z-index:0; pointer-events:none;
  background: url('../assets/images/bg-bagua-faded.jpg') center / cover no-repeat;
  opacity: .25;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000, transparent 75%);
          mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000, transparent 75%);
}

body.bg-lanterns {
  background: radial-gradient(1000px 500px at 50% 100%, rgba(120,30,30,.4), transparent 65%), linear-gradient(180deg, #08060a 0%, #050308 100%);
  background-attachment: fixed;
}
body.bg-lanterns::after { content:""; position:fixed; inset:0; z-index:0; pointer-events:none;
  background: url('../assets/images/bg-lanterns.jpg') center / cover no-repeat;
  opacity: .35;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 30%, #000 100%);
          mask-image: linear-gradient(180deg, transparent 0%, #000 30%, #000 100%);
}

body.bg-galaxy {
  background: linear-gradient(180deg, #060514 0%, #04030a 100%);
  background-attachment: fixed;
}
body.bg-galaxy::after { content:""; position:fixed; inset:0; z-index:0; pointer-events:none;
  background: url('../assets/images/bg-galaxy.jpg') center / cover no-repeat;
  opacity: .55;
  -webkit-mask-image: radial-gradient(ellipse 100% 90% at 50% 50%, #000, rgba(0,0,0,.6) 60%, transparent 100%);
          mask-image: radial-gradient(ellipse 100% 90% at 50% 50%, #000, rgba(0,0,0,.6) 60%, transparent 100%);
}

body.bg-temple {
  background: radial-gradient(900px 400px at 50% 100%, rgba(218,168,76,.18), transparent 65%), linear-gradient(180deg, #08070a 0%, #050308 100%);
  background-attachment: fixed;
}
body.bg-temple::after { content:""; position:fixed; inset:0; z-index:0; pointer-events:none;
  background: url('../assets/images/bg-temple.jpg') center / cover no-repeat;
  opacity: .32;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.5) 50%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.5) 50%, transparent 100%);
}

body.bg-bamboo-ink {
  background: radial-gradient(900px 500px at 0% 50%, rgba(20,80,40,.3), transparent 65%), linear-gradient(180deg, #050a08 0%, #030605 100%);
  background-attachment: fixed;
}
body.bg-bamboo-ink::after { content:""; position:fixed; inset:0; z-index:0; pointer-events:none;
  background: url('../assets/images/bg-bamboo-ink.jpg') center / cover no-repeat;
  opacity: .32;
  -webkit-mask-image: radial-gradient(ellipse 110% 90% at 30% 50%, #000, transparent 80%);
          mask-image: radial-gradient(ellipse 110% 90% at 30% 50%, #000, transparent 80%);
}

body.bg-coin-pattern {
  background: linear-gradient(180deg, #0a0608 0%, #050304 100%);
  background-attachment: fixed;
}
body.bg-coin-pattern::after { content:""; position:fixed; inset:0; z-index:0; pointer-events:none;
  background: url('../assets/images/bg-coin-pattern.jpg') center / cover no-repeat;
  opacity: .18;
  mix-blend-mode: overlay;
}

body.bg-flame-gold {
  background: radial-gradient(900px 500px at 50% 100%, rgba(180,80,30,.4), transparent 65%), linear-gradient(180deg, #0a0608 0%, #050304 100%);
  background-attachment: fixed;
}
body.bg-flame-gold::after { content:""; position:fixed; inset:0; z-index:0; pointer-events:none;
  background: url('../assets/images/bg-flame-gold.jpg') center / cover no-repeat;
  opacity: .35;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.4) 40%, #000 100%);
          mask-image: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.4) 40%, #000 100%);
}

body.bg-zen-circle {
  background: linear-gradient(180deg, #08070a 0%, #04030a 100%);
  background-attachment: fixed;
}
body.bg-zen-circle::after { content:""; position:fixed; inset:0; z-index:0; pointer-events:none;
  background: url('../assets/images/bg-zen-circle.jpg') center / cover no-repeat;
  opacity: .35;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000, transparent 80%);
          mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000, transparent 80%);
}

/* === 第三批：30-60 歲客群主題（傳統 + 招財 + 典雅）=== */

body.bg-fortune-fu {
  background: radial-gradient(900px 500px at 50% 0%, rgba(120,30,30,.35), transparent 65%), linear-gradient(180deg, #100507 0%, #08030a 100%);
  background-attachment: fixed;
}
body.bg-fortune-fu::after { content:""; position:fixed; inset:0; z-index:0; pointer-events:none;
  background: url('../assets/images/bg-fortune-fu.jpg') center / cover no-repeat;
  opacity: .32;
  -webkit-mask-image: radial-gradient(ellipse 100% 80% at 50% 50%, #000, transparent 90%);
          mask-image: radial-gradient(ellipse 100% 80% at 50% 50%, #000, transparent 90%);
}

body.bg-pine-crane {
  background: linear-gradient(180deg, #060a14 0%, #04060c 100%);
  background-attachment: fixed;
}
body.bg-pine-crane::after { content:""; position:fixed; inset:0; z-index:0; pointer-events:none;
  background: url('../assets/images/bg-pine-crane.jpg') center / cover no-repeat;
  opacity: .35;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.5) 50%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.5) 50%, transparent 100%);
}

body.bg-plum-blossom {
  background: radial-gradient(800px 500px at 100% 0%, rgba(150,40,80,.25), transparent 65%), linear-gradient(180deg, #0a0508 0%, #050308 100%);
  background-attachment: fixed;
}
body.bg-plum-blossom::after { content:""; position:fixed; inset:0; z-index:0; pointer-events:none;
  background: url('../assets/images/bg-plum-blossom.jpg') center / cover no-repeat;
  opacity: .35;
  -webkit-mask-image: radial-gradient(ellipse 100% 90% at 50% 50%, #000, transparent 85%);
          mask-image: radial-gradient(ellipse 100% 90% at 50% 50%, #000, transparent 85%);
}

body.bg-koi-water {
  background: radial-gradient(900px 500px at 0% 100%, rgba(80,30,30,.4), transparent 65%), linear-gradient(180deg, #0a0608 0%, #050308 100%);
  background-attachment: fixed;
}
body.bg-koi-water::after { content:""; position:fixed; inset:0; z-index:0; pointer-events:none;
  background: url('../assets/images/bg-koi-water.jpg') center / cover no-repeat;
  opacity: .35;
  -webkit-mask-image: radial-gradient(ellipse 110% 80% at 30% 70%, #000, transparent 90%);
          mask-image: radial-gradient(ellipse 110% 80% at 30% 70%, #000, transparent 90%);
}

body.bg-ingots {
  background: linear-gradient(180deg, #0e0a05 0%, #06040a 100%);
  background-attachment: fixed;
}
body.bg-ingots::after { content:""; position:fixed; inset:0; z-index:0; pointer-events:none;
  background: url('../assets/images/bg-ingots.jpg') center / cover no-repeat;
  opacity: .3;
  -webkit-mask-image: radial-gradient(ellipse 100% 80% at 50% 50%, #000, transparent 90%);
          mask-image: radial-gradient(ellipse 100% 80% at 50% 50%, #000, transparent 90%);
}

body.bg-jade-talisman {
  background: radial-gradient(900px 500px at 50% 0%, rgba(218,168,76,.18), transparent 65%), linear-gradient(180deg, #08060c 0%, #04030a 100%);
  background-attachment: fixed;
}
body.bg-jade-talisman::after { content:""; position:fixed; inset:0; z-index:0; pointer-events:none;
  background: url('../assets/images/bg-jade-talisman.jpg') center / cover no-repeat;
  opacity: .35;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000, transparent 85%);
          mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000, transparent 85%);
}

body.bg-fireworks-distant {
  background: radial-gradient(900px 600px at 50% 100%, rgba(218,168,76,.2), transparent 65%), linear-gradient(180deg, #050614 0%, #03040a 100%);
  background-attachment: fixed;
}
body.bg-fireworks-distant::after { content:""; position:fixed; inset:0; z-index:0; pointer-events:none;
  background: url('../assets/images/bg-fireworks-distant.jpg') center / cover no-repeat;
  opacity: .42;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.6) 30%, #000 100%);
          mask-image: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.6) 30%, #000 100%);
}

body.bg-misty-peaks {
  background: radial-gradient(900px 500px at 50% 100%, rgba(218,168,76,.2), transparent 65%), linear-gradient(180deg, #06080d 0%, #04060a 100%);
  background-attachment: fixed;
}
body.bg-misty-peaks::after { content:""; position:fixed; inset:0; z-index:0; pointer-events:none;
  background: url('../assets/images/bg-misty-peaks.jpg') center / cover no-repeat;
  opacity: .4;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.4) 60%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.4) 60%, transparent 100%);
}

body.bg-silk-pattern {
  background: linear-gradient(180deg, #100408 0%, #060306 100%);
  background-attachment: fixed;
}
body.bg-silk-pattern::after { content:""; position:fixed; inset:0; z-index:0; pointer-events:none;
  background: url('../assets/images/bg-silk-pattern.jpg') center / cover no-repeat;
  opacity: .28;
  mix-blend-mode: overlay;
}

body.bg-old-wood {
  background: linear-gradient(180deg, #100805 0%, #060403 100%);
  background-attachment: fixed;
}
body.bg-old-wood::after { content:""; position:fixed; inset:0; z-index:0; pointer-events:none;
  background: url('../assets/images/bg-old-wood.jpg') center / cover no-repeat;
  opacity: .32;
  mix-blend-mode: overlay;
}

body.bg-marble-gold {
  background: linear-gradient(180deg, #06070a 0%, #03040a 100%);
  background-attachment: fixed;
}
body.bg-marble-gold::after { content:""; position:fixed; inset:0; z-index:0; pointer-events:none;
  background: url('../assets/images/bg-marble-gold.jpg') center / cover no-repeat;
  opacity: .35;
}

body.bg-night-temple-roof {
  background: radial-gradient(900px 500px at 50% 100%, rgba(120,40,30,.35), transparent 65%), linear-gradient(180deg, #08070d 0%, #050308 100%);
  background-attachment: fixed;
}
body.bg-night-temple-roof::after { content:""; position:fixed; inset:0; z-index:0; pointer-events:none;
  background: url('../assets/images/bg-night-temple-roof.jpg') center / cover no-repeat;
  opacity: .35;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.4) 60%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.4) 60%, transparent 100%);
}

/* === 角落 SVG 雲紋裝飾（純色變體共用，淡淡的）=== */
body.bg-aura::after, body.bg-warm::after, body.bg-cool::after,
body.bg-emerald::after, body.bg-rose::after, body.bg-imperial::after,
body.bg-jade::after, body.bg-vintage::after {
  content: "";
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  /* 用 inline SVG data URI：左下、右下角的中國風雲紋 */
  background-image:
    /* 左上：細小金色花紋 */
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 220'><g fill='none' stroke='%23d9a84c' stroke-width='1' opacity='.4'><circle cx='40' cy='40' r='30'/><circle cx='40' cy='40' r='20'/><path d='M40 10 L40 70 M10 40 L70 40' stroke-width='.6'/><path d='M85 25 q15 -10 30 0 q-15 10 -30 0' stroke-width='.8'/><path d='M105 50 q10 -8 20 0 q-10 8 -20 0' stroke-width='.7'/></g></svg>"),
    /* 右下：龍鱗弧線紋 */
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 300'><g fill='none' stroke='%23d9a84c' stroke-width='1.2' opacity='.35'><path d='M30 270 q60 -80 130 -60 q70 20 110 -40' /><path d='M50 280 q60 -100 140 -80 q80 20 110 -50' /><circle cx='220' cy='220' r='25'/><circle cx='220' cy='220' r='14'/></g></svg>");
  background-position: top 40px left 40px, bottom 40px right 40px;
  background-repeat: no-repeat;
  background-size: 220px 220px, 300px 300px;
  opacity: .55;
}

/* ============================================================
   Forecast Card · 號碼預測卡（含中獎圈標 / 連中徽章）
   ============================================================ */
.fc-card {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 6;
  border-radius: 12px;
  overflow: hidden;
  background: #1a1206;
  box-shadow: 0 18px 40px rgba(0,0,0,.42);
  border: 1px solid rgba(218,168,76,.35);
  font-family: "Noto Serif TC", "Microsoft JhengHei", serif;
  isolation: isolate;
  user-select: none;
  /* 字體大小依容器寬度，所有定位用 % 才能跨設備等比縮放 */
  font-size: clamp(14px, 4cqi, 38px);
  container-type: inline-size;
}
.fc-bg {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover;
  background-position: center;
  /* 暗化背景讓白字突出 */
  filter: brightness(.85);
}
.fc-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.18), rgba(0,0,0,.04) 35%, rgba(0,0,0,.04) 65%, rgba(0,0,0,.32));
}

/* 連中徽章（PNG 圖片版本，左上，橫向 jo1.png 風格）*/
.fc-streak-img {
  position: absolute; top: 4%; left: 4%; z-index: 3;
  width: 30cqi; height: auto;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.45));
  transform: rotate(-2deg);
  pointer-events: none;
}

/* 日期（右上） */
.fc-date {
  position: absolute; top: 4%; right: 4%; z-index: 3;
  display: flex; align-items: center; gap: 1cqi;
  font-weight: 900;
  text-shadow: 0 2px 6px rgba(0,0,0,.5);
}
.fc-date-cell {
  display: inline-grid; place-items: center;
  width: 14cqi; height: 14cqi;
  background: linear-gradient(180deg, #fff, #f0e8d4);
  color: #1a1006;
  border-radius: 4px;
  font-family: "Cinzel", serif;
  font-size: 9cqi; font-weight: 900;
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.fc-date-sep {
  color: #fff;
  font-size: 6cqi; font-weight: 800;
  margin: 0 1cqi;
}

/* 「今彩」（右側直書） */
.fc-lottery {
  position: absolute; top: 24%; right: 5%; z-index: 3;
  display: flex; flex-direction: column; gap: 0;
  font-size: 11cqi; font-weight: 900;
  color: #ffd860;
  text-shadow: 0 2px 8px rgba(0,0,0,.8), 0 0 16px rgba(255,80,40,.4);
  -webkit-text-stroke: 1px #8a1d00;
  letter-spacing: 0;
  line-height: 1;
}
.fc-lottery small {
  font-size: 5cqi;
  color: #fff;
  -webkit-text-stroke: 0;
  text-shadow: 0 2px 6px rgba(0,0,0,.6);
  margin-top: 1cqi;
}

/* 作者（左側直書） */
.fc-author {
  position: absolute; top: 26%; left: 5%; z-index: 3;
  display: flex; flex-direction: column;
  font-size: 8.5cqi; font-weight: 900;
  color: #ffd860;
  text-shadow: 0 2px 6px rgba(0,0,0,.7);
  -webkit-text-stroke: 1px #5a3000;
  line-height: 1.06;
  gap: 0;
}
.fc-author span {
  display: block;
  filter: drop-shadow(0 0 6px rgba(0,0,0,.5));
}

/* 數字區 — 兩種 layout：row（一行）/ scatter（散佈） */
.fc-numbers {
  position: absolute; z-index: 4;
}
.fc-numbers.fc-layout-row {
  left: 0; right: 0; bottom: 14%;
  display: flex; justify-content: center; align-items: center;
  gap: 4cqi;
  padding: 0 6%;
}
.fc-numbers.fc-layout-scatter {
  inset: 0;
  pointer-events: none;
}

/* === 方形畫布系統（數字 PNG 與 win-mark.png 同尺寸 → 直接 inset:0 疊放）=== */
.fc-num {
  position: relative;
  display: inline-block;
  width: 26cqi;
  aspect-ratio: 1 / 1;            /* 強制方形 */
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.55));
  animation: fcNumIn .35s ease both;
  --rot: 0deg;
}
/* 數字 PNG 滿框 */
.fc-num .fc-num-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  transform: rotate(var(--rot));
}
@keyframes fcNumIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* row layout 不同數量自動縮小 */
.fc-numbers.fc-layout-row[data-count="4"] .fc-num { width: 22cqi; }
.fc-numbers.fc-layout-row[data-count="5"] .fc-num { width: 18cqi; }

/* scatter layout 絕對定位（位置由 inline style 控制） */
.fc-layout-scatter .fc-num {
  position: absolute;
  transform: translate(-50%, -50%);
}

/* === 中獎標記（與數字同尺寸方形 → 直接 inset:0 完美對齊）=== */
.fc-num.is-win .fc-win-mark {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.45));
  z-index: 2;
  /* 略放大到 1.2x 讓圈圈包住數字外緣（圈位於 win-mark 中央 80% 區域） */
  transform: scale(1.2) rotate(-3deg);
  transform-origin: center center;
  animation: fcInkStamp .55s cubic-bezier(.22,.61,.36,1) both;
}
@keyframes fcInkStamp {
  0%   { opacity: 0; transform: scale(.5) rotate(-25deg); }
  60%  { opacity: 1; transform: scale(1.32) rotate(2deg); }
  100% { opacity: 1; transform: scale(1.2) rotate(-3deg); }
}

/* 副標 */
.fc-tagline {
  position: absolute; left: 5%; right: 5%; bottom: 34%; z-index: 3;
  text-align: center;
  color: #fff; font-size: 6.5cqi; font-weight: 700;
  letter-spacing: .12em;
  text-shadow: 0 2px 6px rgba(0,0,0,.7), 0 0 12px rgba(0,0,0,.5);
}

/* member.php 快速入口卡片 */
.member-quick-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.member-quick-link {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border-radius: 10px;
  background: linear-gradient(155deg, #fdf3d8, #f5e8c4);
  border: 1px solid #e0c890;
  color: #2b1c0a;
  transition: transform .2s var(--ease), box-shadow .2s, border-color .2s;
}
.member-quick-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(184,133,46,.18);
  border-color: var(--gold-3);
}
.member-quick-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  display: grid; place-items: center;
  background: #fff; border-radius: 8px;
  font-size: 20px; box-shadow: inset 0 0 0 1px #ead8b3;
}
.member-quick-link b { display: block; font-size: 14px; color: #2b1c0a; }
.member-quick-link small { display: block; font-size: 12px; color: #66523a; margin-top: 2px; }

.lower { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin: 16px 0; }
.forum-list { background: var(--paper); color: #1e1407; border-radius: var(--r-lg); padding: 20px; box-shadow: 0 12px 30px rgba(0,0,0,.22); }
.forum-row {
  display: grid; grid-template-columns: 1fr 100px 70px;
  gap: 10px; padding: 10px 0; border-bottom: 1px solid #ece1d0; font-size: 14px;
  align-items: center;
}
.forum-row:last-child { border-bottom: 0; }
.forum-row b { color: #1e1407; }
.forum-row span { color: #6e5e45; }

.cta {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  margin: 22px 0; padding: 18px;
  background: rgba(12,16,20,.7);
}
.cta-item {
  display: flex; gap: 14px; align-items: center; justify-content: center;
  border-right: 1px solid rgba(218,168,76,.18);
  padding: 8px 14px;
  transition: background .2s;
  border-radius: 10px;
}
.cta-item:hover { background: rgba(218,168,76,.06); }
.cta-item:last-child { border-right: 0; }
.cta-item img { width: 48px; height: 48px; }
.cta-item b { color: var(--gold-2); font-size: 16px; }
.cta-item p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

/* ---------- 18. 金流 / Payment ---------- */
.checkout-layout { display: grid; grid-template-columns: 1fr 360px; gap: 22px; margin-top: 16px; }
.checkout-card {
  background: var(--paper); color: var(--ink);
  border-radius: var(--r-lg); padding: 28px;
  box-shadow: var(--shadow-2);
}
.checkout-card h2 { font-size: 20px; margin: 0 0 14px; color: #2b1c0a; }
.pay-methods { display: grid; gap: 12px; }
.pay-method {
  display: flex; gap: 14px; align-items: center;
  padding: 16px 18px; border-radius: 12px;
  border: 2px solid #ead8b3; background: #fffdf6;
  cursor: pointer; transition: border-color .2s, background .2s, transform .15s var(--ease);
}
.pay-method:hover { border-color: var(--gold-3); transform: translateY(-1px); }
.pay-method input { width: 18px; height: 18px; accent-color: var(--gold-3); }
.pay-method.is-selected { border-color: var(--gold-3); background: #fdf3d8; }
.pay-method-logo {
  width: 60px; height: 40px; border-radius: 6px;
  background: #fff; border: 1px solid #ead8b3;
  display: grid; place-items: center;
  font-weight: 900; color: #2b1c0a; font-size: 14px;
  letter-spacing: .04em;
}
.pay-method-logo.bluex { background: #0d3a8a; color: #fff; }
.pay-method-logo.ecpay { background: #00b900; color: #fff; }
.pay-method-logo.atm   { background: #444; color: #fff; }
.pay-method-info { flex: 1; }
.pay-method-info b { display: block; font-size: 16px; color: #2b1c0a; }
.pay-method-info p { margin: 2px 0 0; font-size: 13px; color: #66523a; }

.summary-card {
  background: linear-gradient(155deg, #141a20, #090b0e);
  border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 24px;
  align-self: start; position: sticky; top: 96px;
}
.summary-card h3 { color: var(--gold-2); margin: 0 0 16px; font-size: 18px; letter-spacing: .12em; }
.summary-row {
  display: flex; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px dashed rgba(218,168,76,.2);
  color: var(--text-soft); font-size: 14px;
}
.summary-row b { color: #fff; }
.summary-total {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: baseline;
  color: var(--gold-2);
}
.summary-total .total-num { font-family: "Cinzel", serif; font-size: 28px; font-weight: 900; }

.pay-redirect {
  max-width: 520px; margin: 60px auto;
  background: linear-gradient(155deg, #141a20, #090b0e);
  border: 1px solid var(--line);
  border-radius: var(--r-xl); padding: 48px 36px;
  text-align: center;
}
.pay-spinner {
  width: 56px; height: 56px; margin: 0 auto 22px;
  border: 4px solid rgba(218,168,76,.18);
  border-top-color: var(--gold);
  border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.pay-result {
  max-width: 520px; margin: 60px auto;
  background: linear-gradient(155deg, #141a20, #090b0e);
  border: 1px solid var(--line);
  border-radius: var(--r-xl); padding: 48px 36px;
  text-align: center;
}
.pay-result.is-success { border-color: rgba(70,185,124,.5); }
.pay-result.is-fail    { border-color: rgba(200,71,53,.5); }
.pay-result-icon {
  width: 80px; height: 80px; margin: 0 auto 22px;
  border-radius: 50%; display: grid; place-items: center;
  font-size: 36px; font-weight: 900;
}
.pay-result.is-success .pay-result-icon { background: rgba(70,185,124,.15); color: var(--success); }
.pay-result.is-fail    .pay-result-icon { background: rgba(200,71,53,.15); color: var(--danger); }

/* ---------- 19. Promotion ---------- */
.promo-banner {
  background: linear-gradient(135deg, #1a0d05, #2b1c0a 50%, #1a0d05);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  margin: 8px 0 18px;
  display: grid; grid-template-columns: 1fr auto;
  gap: 16px; align-items: center;
}
.promo-banner h3 { color: var(--gold-2); margin: 0 0 6px; font-size: 18px; letter-spacing: .14em; }
.promo-banner p  { color: #d4c5a3; margin: 0; font-size: 14px; }
.promo-link {
  display: flex; align-items: center; gap: 10px;
  background: rgba(0,0,0,.35); border: 1px dashed var(--line-2);
  border-radius: 10px; padding: 10px 14px;
  color: var(--gold-2); font-family: "Cinzel", monospace;
  font-size: 14px; letter-spacing: .04em;
}

/* ---------- 20. Admin shell ---------- */
.admin-layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.admin-side {
  background: #0a0c10; border-right: 1px solid var(--line);
  padding: 18px 14px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-side .brand { color: var(--gold-2); margin-bottom: 18px; padding: 0 8px; }
.admin-side .brand-text strong { font-size: 18px; }
.admin-side .brand-text small  { font-size: 10px; }
.admin-side h6 { font-size: 11px; color: var(--muted-2); margin: 18px 8px 8px; letter-spacing: .22em; }
.admin-nav { display: flex; flex-direction: column; gap: 2px; }
.admin-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  color: #d4c5a3; font-size: 14px;
  transition: background .2s, color .2s;
}
.admin-nav a:hover { background: rgba(218,168,76,.08); color: var(--gold-2); }
.admin-nav a.is-active { background: rgba(218,168,76,.15); color: var(--gold-2); }
.admin-main { padding: 22px 28px; min-width: 0; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.admin-head h1 { font-size: 24px; color: var(--gold-2); margin: 0; letter-spacing: .08em; }
.admin-card {
  background: linear-gradient(155deg, #141a20, #090b0e);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  margin-bottom: 18px;
}

/* ---------- Utils ---------- */
.text-center { text-align: center; }
.muted { color: var(--muted); }
.gold-text { color: var(--gold-2); }
.hide-mobile { }
.show-mobile { display: none; }
.flex-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.mt-12 { margin-top: 12px; } .mt-24 { margin-top: 24px; } .mt-36 { margin-top: 36px; }
.mb-12 { margin-bottom: 12px; } .mb-24 { margin-bottom: 24px; }

/* ============================================================
   ⚠⚠⚠ 以下為所有 @media 規則（必須在所有 base rules 之後）
   斷點：
     900 - 漢堡選單啟動
     820 - 主要 grid 改 2 欄
     640 - section padding 縮、grid 改 1 欄
     540 - footer 改兩排式
   ============================================================ */
@media (max-width: 1100px) {
  .hero-wrap { grid-template-columns: 1fr 280px; }
  .menu-grid { grid-template-columns: repeat(3, 1fr); }
  .content-grid { grid-template-columns: 1fr 1fr; }
  .content-grid > article:nth-child(3) { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  /* 1. nav 改漢堡抽屜 */
  .nav-row { gap: 12px; min-height: 64px; padding-top: 8px; padding-bottom: 8px; }
  .brand-emblem { width: 44px; height: 44px; }
  .brand-text strong { font-size: 19px; letter-spacing: .08em; }
  .brand-text small  { font-size: 10px; letter-spacing: .14em; }
  .brand { margin-right: auto; }
  .nav-toggle { display: block; }

  .nav {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: min(320px, 86vw);
    background: linear-gradient(180deg, #0c0e12, #050608);
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    padding: 90px 18px 30px;
    gap: 4px;
    transform: translateX(100%);
    transition: transform .35s var(--ease);
    box-shadow: -22px 0 50px rgba(0,0,0,.45);
    border-left: 1px solid var(--line);
    overflow-x: hidden; overflow-y: auto;
    z-index: 105;
  }
  .nav.is-open { transform: translateX(0); }
  .nav a {
    width: 100%; padding: 14px 18px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 16px;
  }
  .nav a:hover { background: rgba(218,168,76,.1); }
  .nav a.is-active { background: rgba(218,168,76,.15); }
  .nav a.is-active::after { display: none; }

  .header-actions .btn-sm { padding: 7px 10px; font-size: 12px; }
  .header-actions .user-chip-meta small { display: none; }

  /* 2. 各 grid 收斂 */
  .hero-wrap { grid-template-columns: 1fr; }
  .lottery-card { border-left: 0; border-top: 1px solid var(--line); }
  .menu-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
  .content-grid > article:nth-child(3) { grid-column: auto; }
  .lower { grid-template-columns: 1fr; }
  .cta { grid-template-columns: repeat(2, 1fr); }
  .cta-item:nth-child(2) { border-right: 0; }
  .cta-item:nth-child(odd) { border-right: 1px solid rgba(218,168,76,.18); }
  .grid-cards { grid-template-columns: 1fr 1fr; }
  .vip-grid { grid-template-columns: 1fr; }
  .vip-card.featured { transform: none; }
  .live-featured { grid-template-columns: 1fr; }
  .live-featured-cover { min-height: 240px; }
  .live-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-layout { grid-template-columns: 1fr; }
  .side-panel { position: static; }
  .checkout-layout { grid-template-columns: 1fr; }
  .summary-card { position: static; }

  /* 3. footer 收 2 欄 */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-brand { grid-column: 1 / -1; }

  /* 4. 數字球縮小 */
  .hero-num { width: 70px; height: 70px; font-size: 30px; }

  /* 5. toolbar 直排 */
  .toolbar, .live-toolbar { grid-template-columns: 1fr; }
  .search-box { min-width: 0; }

  /* 6. admin */
  .admin-layout { grid-template-columns: 1fr; }
  .admin-side { position: relative; height: auto; max-height: none; padding: 14px; }
  .admin-main { padding: 18px 14px; }

  /* 7. show / hide */
  .hide-mobile { display: none !important; }
  .show-mobile { display: block; }
}

@media (max-width: 640px) {
  .page { padding: 0 16px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .section-title { font-size: 24px; }

  .visitor-banner-inner { padding: 8px 14px; gap: 8px; flex-wrap: wrap; }
  .visitor-banner-text  { font-size: 13px; flex: 1 1 100%; order: 1; }
  .visitor-banner-icon  { display: none; }
  .visitor-banner-cta   { font-size: 12px; padding: 5px 10px; }

  .hero { padding: 36px 22px; min-height: 300px; }
  /* 手機下：hero 圖只佔右下小區域 + 大幅淡化，避免壓到文字 */
  .hero::before {
    left: 35%;
    -webkit-mask-image: linear-gradient(90deg,
      transparent 0%, rgba(0,0,0,.2) 25%, rgba(0,0,0,.55) 60%, #000 100%),
      linear-gradient(180deg,
        transparent 0%, rgba(0,0,0,.5) 30%, #000 60%, rgba(0,0,0,.5) 90%, transparent 100%);
            mask-image: linear-gradient(90deg,
      transparent 0%, rgba(0,0,0,.2) 25%, rgba(0,0,0,.55) 60%, #000 100%),
      linear-gradient(180deg,
        transparent 0%, rgba(0,0,0,.5) 30%, #000 60%, rgba(0,0,0,.5) 90%, transparent 100%);
    -webkit-mask-composite: source-in;
            mask-composite: intersect;
    opacity: .55;
  }
  .hero-buttons { flex-direction: column; }
  .hero-buttons .btn { width: 100%; }
  .hero-num { width: 64px; height: 64px; font-size: 26px; }

  .menu-grid { gap: 10px; }
  .menu-card { min-height: 130px; padding: 14px 8px; }
  .menu-card img { width: 44px; height: 44px; margin-bottom: 8px; }
  .menu-card h3 { font-size: 16px; }
  .menu-card p  { font-size: 12px; }

  .grid-cards { grid-template-columns: 1fr; }
  .live-grid  { grid-template-columns: 1fr; }
  .cta { grid-template-columns: 1fr; padding: 12px; }
  .cta-item { border-right: 0 !important; border-bottom: 1px solid rgba(218,168,76,.18); padding: 12px; }
  .cta-item:last-child { border-bottom: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card  { padding: 14px; }
  .stat-card b { font-size: 22px; }

  .form-box { margin: 28px auto; padding: 24px; }
  .form-row { grid-template-columns: 1fr; }

  .report-paper { max-width: 100%; font-size: 12px; padding: 11% 7% 7%; }
  .report-title { font-size: 22px; }
  .report-balls .ball { width: 32px; height: 32px; font-size: 12px; }
  .report-section h4 { font-size: 14px; }
  .fortune-slip { max-width: 100%; padding: 22% 12% 12%; }
  .fortune-level { font-size: 26px; }
  .fortune-poem { font-size: 16px; line-height: 1.85; }
  .hot-number-grid { grid-template-columns: repeat(3, 1fr); }

  .live-featured-info { padding: 22px; }
  .live-meta-grid { grid-template-columns: 1fr; }
  .live-cover-bg::after { font-size: 48px; padding: 18px 24px; }

  .pay-redirect, .pay-result, .empty-permission { padding: 32px 22px; margin: 30px auto; }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: 22px 14px; padding-bottom: 24px; }
  .footer-bottom-inner { flex-direction: column; gap: 6px; text-align: center; align-items: center; }
}

@media (max-width: 540px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand { padding-bottom: 16px; border-bottom: 1px solid rgba(218,168,76,.12); }
}

@media (max-width: 420px) {
  .brand-text small { display: none; }
  .stats-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
