/* ============ 樂透開獎站 — 設計系統 ============ */
:root {
  --bg: #ffffff;
  --surface: #f7f8fa;
  --surface-2: #f0f2f5;
  --border: #e8eaee;
  --text: #1a2233;
  --text-2: #5c6675;
  --text-3: #98a1b0;
  --primary: #e63946;
  --primary-dark: #c92a37;
  --primary-soft: #fff0f1;
  --gold: #c9920a;
  --gold-soft: #fdf6e3;
  --blue: #2563eb;
  --blue-soft: #eff4ff;
  --green: #16a34a;
  --green-soft: #ecfdf3;
  --purple: #7c3aed;
  --purple-soft: #f5f0ff;
  --teal: #0d9488;
  --teal-soft: #ecfdfa;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(26, 34, 51, 0.06), 0 8px 24px rgba(26, 34, 51, 0.06);
  --shadow-hover: 0 4px 12px rgba(26, 34, 51, 0.1), 0 16px 40px rgba(26, 34, 51, 0.1);
  --font: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ============ Header ============ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; gap: 32px;
  height: 64px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 20px; font-weight: 800; letter-spacing: 0.5px;
  flex-shrink: 0;
}
.logo-mark {
  width: 36px; height: 36px; border-radius: 12px;
  background: linear-gradient(135deg, #e63946, #ff7a45);
  display: grid; place-items: center;
  color: #fff; font-size: 18px; font-weight: 900;
  box-shadow: 0 4px 12px rgba(230, 57, 70, 0.35);
}
.main-nav { display: flex; gap: 4px; flex: 1; }
.main-nav a {
  padding: 8px 16px; border-radius: 999px; white-space: nowrap;
  font-size: 15px; font-weight: 600; color: var(--text-2);
  transition: all 0.2s;
}
.main-nav a:hover { background: var(--surface); color: var(--text); }
.main-nav a.active { background: var(--primary-soft); color: var(--primary); }

.live-badge {
  display: flex; align-items: center; gap: 8px; white-space: nowrap; flex-shrink: 0;
  padding: 6px 14px; border-radius: 999px;
  background: var(--green-soft); color: var(--green);
  font-size: 13px; font-weight: 700;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
}

/* ============ Hero ============ */
.hero {
  padding: 40px 0 8px;
}
.hero-top {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.hero h1 { font-size: 30px; font-weight: 800; letter-spacing: 0.5px; }
.hero-sub { color: var(--text-2); font-size: 15px; margin-top: 4px; }
.date-chip {
  padding: 8px 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 14px; font-weight: 600; color: var(--text-2);
}

/* Jackpot banner */
.jackpot-banner {
  border-radius: 20px;
  background: linear-gradient(120deg, #fff8f0 0%, #fff0f1 55%, #fdf6e3 100%);
  border: 1px solid #f5e0d0;
  padding: 24px 28px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  margin-bottom: 32px;
  position: relative; overflow: hidden;
}
.jackpot-banner::after {
  content: ""; position: absolute; right: -60px; top: -60px;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 196, 87, 0.25), transparent 70%);
}
.jackpot-label {
  font-size: 13px; font-weight: 700; color: var(--primary);
  letter-spacing: 2px; margin-bottom: 4px;
}
.jackpot-amount {
  font-size: 40px; font-weight: 900; color: var(--text);
  letter-spacing: 1px; line-height: 1.15;
}
.jackpot-amount em { font-style: normal; color: var(--primary); }
.jackpot-meta { font-size: 14px; color: var(--text-2); margin-top: 6px; }
.countdown { display: flex; gap: 10px; align-items: center; }
.countdown-cell {
  background: #ffffff; border: 1px solid var(--border);
  border-radius: 14px; padding: 10px 0; width: 68px;
  text-align: center; box-shadow: var(--shadow);
}
.countdown-cell b {
  display: block; font-size: 26px; font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.countdown-cell span { font-size: 12px; color: var(--text-3); }
.countdown-sep { font-size: 22px; font-weight: 700; color: var(--text-3); }

/* ============ Section headers ============ */
.section { padding: 28px 0; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.section-title {
  font-size: 22px; font-weight: 800;
  display: flex; align-items: center; gap: 10px;
}
.section-title::before {
  content: ""; width: 5px; height: 22px; border-radius: 3px;
  background: linear-gradient(180deg, var(--primary), #ff7a45);
}
.section-more {
  font-size: 14px; font-weight: 600; color: var(--text-2);
  padding: 6px 14px; border-radius: 999px; transition: all 0.2s;
}
.section-more:hover { background: var(--surface); color: var(--primary); }

/* ============ 分類 filter tabs ============ */
.filter-tabs {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px;
}
.filter-tab {
  padding: 8px 18px; border-radius: 999px;
  border: 1px solid var(--border); background: #fff;
  font-size: 14px; font-weight: 600; color: var(--text-2);
  transition: all 0.2s;
}
.filter-tab:hover { border-color: var(--primary); color: var(--primary); }
.filter-tab.active {
  background: var(--text); border-color: var(--text); color: #fff;
}

/* ============ 開獎卡片 ============ */
.draw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
}
.draw-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex; flex-direction: column; gap: 14px;
}
.draw-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.draw-card-head { display: flex; align-items: center; gap: 12px; }
.game-icon {
  width: 44px; height: 44px; border-radius: 13px; flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 15px; font-weight: 900; color: #fff; letter-spacing: 0;
}
.game-name { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.game-meta { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }
.tag-hot {
  font-size: 11px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #ff5f2e, #ff9a2e);
  padding: 2px 8px; border-radius: 999px; letter-spacing: 1px;
}
.tag-pred {
  font-size: 11px; font-weight: 700; color: var(--purple);
  background: var(--purple-soft);
  padding: 2px 8px; border-radius: 999px;
}
.draw-issue {
  margin-left: auto; text-align: right;
  font-size: 12.5px; color: var(--text-3); line-height: 1.4;
}
.draw-issue b { color: var(--text-2); font-weight: 700; }

/* 號碼球 */
.balls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ball {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 17px; font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: radial-gradient(circle at 32% 28%, #ffffff, var(--surface-2));
  border: 1.5px solid var(--border);
  color: var(--text);
  box-shadow: inset 0 -3px 6px rgba(26, 34, 51, 0.06), 0 2px 4px rgba(26, 34, 51, 0.05);
}
.ball.special {
  background: radial-gradient(circle at 32% 28%, #ff8a94, var(--primary));
  border-color: var(--primary-dark); color: #fff;
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.15), 0 3px 8px rgba(230, 57, 70, 0.35);
}
.ball.gold {
  background: radial-gradient(circle at 32% 28%, #ffd97a, #e8a90c);
  border-color: #cf940a; color: #6b4a00;
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.12), 0 3px 8px rgba(232, 169, 12, 0.35);
}
.ball.small { width: 34px; height: 34px; font-size: 14px; }
.ball-plus { font-size: 18px; font-weight: 700; color: var(--text-3); margin: 0 2px; }

/* digit style (3星彩/4星彩/4D) */
.digits { display: flex; gap: 8px; }
.digit {
  width: 46px; height: 54px; border-radius: 12px;
  display: grid; place-items: center;
  font-size: 26px; font-weight: 900;
  background: var(--surface); border: 1.5px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.digit.accent { background: var(--blue-soft); border-color: #c7d8fb; color: var(--blue); }

.prize-rows { display: flex; flex-direction: column; gap: 8px; }
.prize-row { display: flex; align-items: center; gap: 12px; }
.prize-row-label {
  font-size: 12.5px; font-weight: 700; color: var(--text-2);
  background: var(--surface); border-radius: 8px;
  padding: 4px 10px; min-width: 58px; text-align: center;
}

.draw-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px dashed var(--border); padding-top: 12px; margin-top: auto;
}
.next-draw { font-size: 13px; color: var(--text-2); }
.next-draw b { color: var(--text); }
.card-link {
  font-size: 13.5px; font-weight: 700; color: var(--primary);
  display: inline-flex; align-items: center; gap: 4px;
}
.card-link:hover { text-decoration: underline; }

/* bingo grid */
.bingo-balls { display: flex; flex-wrap: wrap; gap: 6px; }
.bingo-balls .ball { width: 33px; height: 33px; font-size: 13.5px; }

/* ============ 預測文章 ============ */
.article-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}
.article-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex; flex-direction: column;
}
.article-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.article-cover {
  height: 120px; position: relative;
  display: flex; align-items: flex-end; padding: 16px;
}
.article-cover .cover-tag {
  font-size: 12px; font-weight: 800; color: #fff;
  background: rgba(0, 0, 0, 0.28); backdrop-filter: blur(4px);
  padding: 4px 12px; border-radius: 999px; letter-spacing: 1px;
}
.article-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.article-title { font-size: 16.5px; font-weight: 800; line-height: 1.45; }
.article-excerpt {
  font-size: 13.5px; color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.article-meta {
  margin-top: auto; padding-top: 8px;
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; color: var(--text-3);
}
.article-meta .divider { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); }

/* 預測號碼 pill */
.pred-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pred-pill {
  font-size: 13px; font-weight: 800;
  background: var(--gold-soft); color: var(--gold);
  border: 1px solid #f0e2b8;
  padding: 3px 10px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

/* ============ 文章內頁 ============ */
.article-page { max-width: 760px; margin: 0 auto; padding: 40px 20px 60px; }
.breadcrumb { font-size: 13.5px; color: var(--text-3); margin-bottom: 18px; }
.breadcrumb a:hover { color: var(--primary); }
.article-page h1 { font-size: 30px; font-weight: 900; line-height: 1.4; margin-bottom: 14px; }
.article-page-meta {
  display: flex; align-items: center; gap: 12px;
  font-size: 14px; color: var(--text-3);
  padding-bottom: 20px; border-bottom: 1px solid var(--border); margin-bottom: 26px;
}
.article-content { font-size: 16.5px; line-height: 1.9; color: #2a3345; }
.article-content h2 {
  font-size: 21px; font-weight: 800; margin: 32px 0 12px; color: var(--text);
  display: flex; align-items: center; gap: 10px;
}
.article-content h2::before {
  content: ""; width: 4px; height: 20px; border-radius: 2px;
  background: var(--primary);
}
.article-content p { margin-bottom: 16px; }
.pred-box {
  background: var(--gold-soft); border: 1px solid #f0e2b8;
  border-radius: var(--radius); padding: 20px 22px; margin: 20px 0;
}
.pred-box-title {
  font-size: 15px; font-weight: 800; color: var(--gold);
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.disclaimer {
  margin-top: 36px; padding: 14px 18px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  font-size: 13px; color: var(--text-3); line-height: 1.7;
}

/* ============ 彩種詳情頁 ============ */
.game-hero {
  padding: 36px 0 24px;
  display: flex; align-items: center; gap: 18px;
}
.game-hero .game-icon { width: 64px; height: 64px; border-radius: 18px; font-size: 22px; }
.game-hero h1 { font-size: 28px; font-weight: 900; }
.game-hero .game-meta { font-size: 14.5px; }
.history-table { width: 100%; border-collapse: collapse; }
.history-table th {
  text-align: left; font-size: 13px; color: var(--text-3);
  font-weight: 700; padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.history-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 14.5px; }
.history-table tr:hover td { background: var(--surface); }
.panel {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden;
}

/* ============ Footer ============ */
.site-footer {
  margin-top: 48px; border-top: 1px solid var(--border);
  background: var(--surface); padding: 36px 0;
}
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-note { font-size: 13px; color: var(--text-3); max-width: 560px; line-height: 1.8; }
.footer-links { display: flex; gap: 20px; font-size: 14px; color: var(--text-2); }
.footer-links a:hover { color: var(--primary); }

/* ============ 手機底部導覽列 ============ */
.mobile-nav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 150;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.mobile-nav-inner { display: flex; }
.mobile-nav a, .mobile-nav button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0 10px; border: none; background: none;
  font-size: 11px; font-weight: 700; color: var(--text-3);
  font-family: inherit;
}
.mobile-nav .m-icon { line-height: 0; }
.mobile-nav .m-icon svg { width: 22px; height: 22px; display: block; }
.mobile-nav a.active { color: var(--primary); }

/* ============ RWD（平板） ============ */
@media (max-width: 900px) {
  .live-badge { display: none; }
  .header-inner { gap: 16px; }
  .btn-tg .tg-text { display: none; }
  .btn-tg.btn-sm { padding: 9px 12px; }
}

/* ============ RWD（手機優先重點區） ============ */
@media (max-width: 720px) {
  body { padding-bottom: 64px; } /* 底部導覽列空間 */
  .mobile-nav { display: block; }

  /* header：只留 logo + 會員，主導覽移到底部列 */
  .header-inner { height: 56px; gap: 10px; }
  .main-nav { display: none; }
  .logo { font-size: 18px; }
  .logo-mark { width: 32px; height: 32px; border-radius: 10px; font-size: 16px; }
  .auth-slot { margin-left: auto; }
  .user-chip span:not(.points-badge):not(.user-avatar) { display: none; } /* 手機只留頭像+積分 */

  /* hero / 頭獎橫幅 */
  .hero { padding: 22px 0 4px; }
  .hero h1 { font-size: 23px; }
  .hero-sub { font-size: 13.5px; }
  .date-chip { padding: 6px 12px; font-size: 12.5px; }
  .jackpot-banner { padding: 18px 18px 20px; flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
  .jackpot-amount { font-size: 32px; }
  .countdown { gap: 8px; }
  .countdown-cell { width: 56px; padding: 7px 0; border-radius: 12px; }
  .countdown-cell b { font-size: 21px; }

  /* 區塊與卡片 */
  .section { padding: 20px 0; }
  .section-title { font-size: 19px; }
  .filter-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -20px 18px; padding: 0 20px; }
  .filter-tabs::-webkit-scrollbar { display: none; }
  .filter-tab { white-space: nowrap; flex-shrink: 0; }
  .draw-grid { grid-template-columns: 1fr; gap: 14px; }
  .draw-card { padding: 16px; }
  .ball { width: 38px; height: 38px; font-size: 15px; }
  .bingo-balls .ball { width: 30px; height: 30px; font-size: 12.5px; }
  .digit { width: 40px; height: 48px; font-size: 22px; }
  .draw-issue { font-size: 11.5px; }
  .article-grid { grid-template-columns: 1fr; gap: 14px; }

  /* 表格：橫向滑動不擠壓 */
  .panel { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .history-table { min-width: 520px; }
  .history-table th, .history-table td { padding: 10px 12px; }
  .admin-table { min-width: 640px; }

  /* 彩種頁 / 文章頁 */
  .game-hero { padding: 22px 0 16px; gap: 14px; }
  .game-hero .game-icon { width: 52px; height: 52px; font-size: 18px; }
  .game-hero h1 { font-size: 23px; }
  .article-page { padding: 24px 16px 48px; }
  .article-page h1 { font-size: 23px; }
  .article-content { font-size: 15.5px; }
  .article-content h2 { font-size: 18px; }
  .pred-box { padding: 16px; }

  /* CTA 橫幅 / modal */
  .cta-banner { padding: 18px; }
  .cta-banner h3 { font-size: 17px; }
  .cta-actions { width: 100%; }
  .cta-actions .btn { width: 100%; }
  .modal { padding: 20px; border-radius: 18px 18px 0 0; max-width: none; align-self: flex-end; max-height: 82vh; }
  .modal-backdrop.open { align-items: flex-end; padding: 0; }

  /* footer */
  .site-footer { padding: 26px 0; margin-top: 28px; }
  .footer-inner { flex-direction: column; gap: 14px; }
}

/* ============ 會員／登入 ============ */
.auth-slot { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 18px; border-radius: 999px; border: none;
  font-size: 14px; font-weight: 700; transition: all 0.2s;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(230,57,70,.3); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-google { background: #fff; border: 1px solid var(--border); color: var(--text); box-shadow: var(--shadow); }
.btn-google:hover { border-color: #c9ced8; }
.btn-gold { background: linear-gradient(135deg,#f0b429,#e8a90c); color: #5b3f00; box-shadow: 0 4px 12px rgba(232,169,12,.35); }
.btn-gold:hover { filter: brightness(1.05); }
.btn-ghost { background: var(--surface); color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-tg { background: linear-gradient(135deg,#2AABEE,#229ED9); color: #fff; box-shadow: 0 4px 12px rgba(42,171,238,.35); text-decoration: none; white-space: nowrap; flex-shrink: 0; }
.btn-tg:hover { filter: brightness(1.05); }
.btn-tg .tg-text { display: inline; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.user-chip {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 5px 12px 5px 6px; border-radius: 999px;
  border: 1px solid var(--border); background: #fff; transition: all .2s;
}
.user-chip:hover { box-shadow: var(--shadow); }
.user-chip img, .user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg,#e63946,#ff7a45);
  color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 800;
}
.user-chip .points-badge {
  font-size: 12px; font-weight: 800; color: var(--gold);
  background: var(--gold-soft); padding: 2px 8px; border-radius: 999px;
}

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(20,26,40,.45); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: #fff; border-radius: 20px; box-shadow: var(--shadow-hover);
  width: 100%; max-width: 420px; padding: 26px; position: relative;
  max-height: 88vh; overflow-y: auto;
}
.modal h3 { font-size: 19px; font-weight: 800; margin-bottom: 6px; }
.modal .modal-sub { font-size: 13.5px; color: var(--text-2); margin-bottom: 16px; }
.modal-close {
  position: absolute; top: 14px; right: 14px; width: 32px; height: 32px;
  border-radius: 50%; border: none; background: var(--surface);
  color: var(--text-2); font-size: 16px;
}
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--text-2); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 10px 14px; border-radius: 10px;
  border: 1.5px solid var(--border); font-size: 14.5px; font-family: inherit;
  outline: none; transition: border-color .2s; background: #fff; color: var(--text);
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--primary); }
.member-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px dashed var(--border); gap: 10px;
}
.member-row .label { font-size: 14px; color: var(--text-2); }
.member-row .value { font-size: 14.5px; font-weight: 700; }

/* ============ 鎖碼區塊 ============ */
.pred-box.locked { position: relative; }
.pred-box.locked .pred-pills { filter: blur(6px); user-select: none; pointer-events: none; }
.lock-overlay {
  position: absolute; inset: 0; border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,.85));
  text-align: center; padding: 16px;
}
.lock-overlay .lock-title { font-size: 14.5px; font-weight: 800; }
.lock-overlay .lock-sub { font-size: 12.5px; color: var(--text-2); }
.pred-box.vip { background: #f5f0ff; border-color: #e0d2fb; }
.pred-box.vip .pred-box-title { color: var(--purple); }
.pred-box.vip .pred-pill { background: #fff; color: var(--purple); border-color: #e0d2fb; }

/* ============ CTA 橫幅 ============ */
.cta-banner {
  border-radius: 20px; padding: 22px 26px; margin: 24px 0;
  background: linear-gradient(120deg, #1a2233 0%, #2c3a55 100%);
  color: #fff; display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; position: relative; overflow: hidden;
}
.cta-banner::before {
  content: ""; position: absolute; left: -40px; bottom: -80px;
  width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(230,57,70,.35), transparent 70%);
}
.cta-banner h3 { font-size: 19px; font-weight: 800; margin-bottom: 4px; }
.cta-banner p { font-size: 13.5px; color: rgba(255,255,255,.75); }
.cta-banner .promo-code {
  font-weight: 900; letter-spacing: 2px; color: #ffd97a;
  background: rgba(255,255,255,.1); padding: 2px 10px; border-radius: 8px;
}
.cta-actions { display: flex; gap: 10px; align-items: center; position: relative; }

/* 簽到卡 */
.checkin-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 999px; border: none;
  background: var(--gold-soft); color: var(--gold);
  font-size: 13.5px; font-weight: 800;
}
.checkin-pill:disabled { opacity: .55; cursor: default; }

/* Toast */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: #fff; padding: 12px 22px; border-radius: 999px;
  font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none;
  transition: all .3s; z-index: 300; box-shadow: var(--shadow-hover);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ 後台 ============ */
.admin-layout { display: grid; grid-template-columns: 200px 1fr; gap: 24px; padding: 28px 0 60px; }
.admin-nav { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 84px; align-self: start; }
.admin-nav button {
  text-align: left; padding: 10px 16px; border-radius: 12px; border: none;
  background: transparent; font-size: 14.5px; font-weight: 700; color: var(--text-2);
}
.admin-nav button.active { background: var(--primary-soft); color: var(--primary); }
.admin-nav button:hover:not(.active) { background: var(--surface); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat-card .stat-label { font-size: 12.5px; color: var(--text-3); font-weight: 700; }
.stat-card .stat-value { font-size: 26px; font-weight: 900; margin-top: 2px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table th { text-align: left; padding: 10px 12px; color: var(--text-3); font-size: 12px; border-bottom: 1px solid var(--border); }
.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.badge { font-size: 11.5px; font-weight: 800; padding: 2px 10px; border-radius: 999px; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.gray { background: var(--surface-2); color: var(--text-3); }
.badge.purple { background: var(--purple-soft); color: var(--purple); }
.badge.gold { background: var(--gold-soft); color: var(--gold); }
@media (max-width: 860px) { .admin-layout { grid-template-columns: 1fr; } .admin-nav { flex-direction: row; overflow-x: auto; position: static; } }

/* 手機 modal 底部抽屜（放檔尾確保覆寫基礎樣式） */
@media (max-width: 720px) {
  .modal-backdrop.open { align-items: flex-end; padding: 0; }
  .modal-backdrop.open .modal { border-radius: 18px 18px 0 0; max-width: none; max-height: 82vh; }
}

/* 官方彩種 logo */
.game-icon.has-logo { background: #fff; border: 1px solid var(--border); padding: 4px; }
.game-icon.has-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ============ 中獎快訊跑馬燈 ============ */
.marquee-bar {
  display: flex; align-items: center; gap: 0;
  background: linear-gradient(90deg, #fff8f0, #fff);
  border-bottom: 1px solid var(--border);
  height: 42px; overflow: hidden;
}
.marquee-label {
  flex-shrink: 0; height: 100%;
  display: inline-flex; align-items: center;
  padding: 0 16px 0 20px;
  font-size: 13px; font-weight: 800; color: var(--primary);
  background: var(--primary-soft);
  border-right: 1px solid #f5dfe1;
  white-space: nowrap;
}
.marquee-viewport { flex: 1; overflow: hidden; height: 100%; display: flex; align-items: center; }
.marquee-track {
  display: inline-flex; white-space: nowrap;
  animation: marquee-scroll 30s linear infinite;
  will-change: transform;
}
.marquee-viewport:hover .marquee-track { animation-play-state: paused; }
.marquee-item {
  font-size: 13.5px; font-weight: 600; color: var(--text-2);
  padding: 0 28px; white-space: nowrap;
}
.marquee-item b, .marquee-item em { color: var(--gold); font-style: normal; font-weight: 800; }
@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@media (max-width: 720px) {
  .marquee-bar { height: 38px; }
  .marquee-label { padding: 0 10px 0 14px; font-size: 12px; }
  .marquee-item { font-size: 12.5px; padding: 0 20px; }
}

/* 品牌 icon 圖 */
.logo-mark-img { width: 36px; height: 36px; border-radius: 12px; box-shadow: 0 4px 12px rgba(230,57,70,.3); display: block; }
@media (max-width: 720px) { .logo-mark-img { width: 32px; height: 32px; border-radius: 10px; } }

/* 圖片版 CTA 廣告橫幅 */
.cta-banner-img { display: block; margin: 24px 0; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-hover); cursor: pointer; border: none; padding: 0; background: none; width: 100%; }
.cta-banner-img img { width: 100%; height: auto; display: block; transition: transform .3s; }
.cta-banner-img:hover img { transform: scale(1.015); }

/* ============ 命中戰績 ============ */
.stat-chips { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.stat-chip {
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 12px 20px; box-shadow: var(--shadow); min-width: 130px;
}
.stat-chip b { font-size: 24px; font-weight: 900; display: block; }
.stat-chip span { font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.stat-chip.hit b { color: var(--green); }
.stat-chip.gold b { color: var(--gold); }
.record-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; box-shadow: var(--shadow); margin-bottom: 14px;
}
.record-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.record-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; flex-wrap: wrap; }
.record-label {
  font-size: 12px; font-weight: 700; color: var(--text-3);
  background: var(--surface); padding: 3px 10px; border-radius: 8px; flex-shrink: 0;
}
.record-pred { font-size: 14.5px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ============ 統計工具 ============ */
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .tool-grid { grid-template-columns: 1fr; } }
.tool-h { font-size: 16px; font-weight: 800; margin-bottom: 14px; }
.tool-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 13.5px; }
.tool-rank { width: 20px; text-align: center; color: var(--text-3); font-weight: 800; font-size: 12px; }
.tool-bar { flex: 1; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.tool-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg,#e63946,#ff7a45); }
.tool-bar.cold i { background: linear-gradient(90deg,#2563eb,#38bdf8); }
.heat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; }
.heat-cell { border: 1px solid var(--border); border-radius: 10px; padding: 6px 4px; text-align: center; line-height: 1.3; }
.heat-cell b { display: block; font-size: 15px; }
.heat-cell span { display: block; font-size: 10.5px; color: var(--text-2); }
.heat-cell .miss { color: var(--text-3); }
.tail-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 8px; }
.tail-cell { text-align: center; font-size: 12px; }
.tail-bar { height: 90px; display: flex; align-items: flex-end; justify-content: center; background: var(--surface); border-radius: 8px; padding: 4px; }
.tail-bar i { display: block; width: 60%; border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg,#f0b429,#e8a90c); min-height: 3px; }
.tail-cell b { display: block; margin-top: 4px; }
.tail-cell span { color: var(--text-3); }

/* ============ 懸浮廣告 ============ */
.float-ad {
  position: fixed; right: 16px; bottom: 20px; z-index: 140;
  width: 148px; border-radius: 16px; overflow: visible;
  filter: drop-shadow(0 8px 24px rgba(26,34,51,.35));
  animation: floatAdIn .5s cubic-bezier(.2,.9,.3,1.2);
}
.float-ad img {
  width: 100%; height: auto; display: block; border-radius: 16px; cursor: pointer;
  transition: transform .25s;
}
.float-ad img:hover { transform: scale(1.04); }
.float-ad-close {
  position: absolute; top: -10px; right: -10px; z-index: 2;
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff;
  background: var(--text); color: #fff; font-size: 12px; line-height: 1;
  display: grid; place-items: center;
}
@keyframes floatAdIn { from { opacity: 0; transform: translateY(30px) scale(.8); } to { opacity: 1; } }
@media (max-width: 720px) {
  .float-ad { width: 118px; bottom: 76px; right: 12px; } /* 避開底部導覽列 */
}
