/* ============ 开门红 H5 — 中国红 × 鎏金 ============ */
:root {
  --red: #C8102E;
  --red-deep: #9B0E24;
  --red-bg-top: #A81226;
  --red-bg-bottom: #7E0B1E;
  --gold: #F5C664;
  --gold-deep: #D9A441;
  --paper: #FFF8EC;
  --paper-soft: #FFF2D9;
  --ink: #5A2A1E;
  --ink-soft: #8A5A46;
  --shadow: 0 6px 18px rgba(70, 5, 15, .35);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Noto Sans CJK SC", sans-serif;
  background: linear-gradient(180deg, var(--red-bg-top) 0%, var(--red-bg-bottom) 42%, #6D0919 100%) fixed;
  color: var(--paper);
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 32px;
  opacity: 1;
  transition: opacity .45s ease;
}
body.loading { opacity: 0; }
button { font-family: inherit; }

/* ---------- 顶部品牌 ---------- */
.brand-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px 0;
  font-size: 13px;
}
.brand-name { font-weight: 600; letter-spacing: 2px; color: var(--gold); }
.brand-name::before { content: "●"; font-size: 8px; vertical-align: 2px; margin-right: 6px; color: var(--gold-deep); }
.brand-period { color: rgba(255, 244, 214, .75); font-size: 11px; }

/* ---------- 主视觉 ---------- */
.hero { position: relative; text-align: center; padding: 30px 24px 6px; }
.hero-seal {
  position: absolute; top: 18px; right: 20px;
  writing-mode: vertical-rl; letter-spacing: 6px;
  font-size: 13px; font-weight: 600; color: var(--red-deep);
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  padding: 10px 5px; border-radius: 4px;
  box-shadow: 0 3px 8px rgba(60, 4, 12, .4);
}
.hero-title {
  font-size: 34px; font-weight: 800; line-height: 1.28;
  letter-spacing: 3px;
  background: linear-gradient(180deg, #FFE9B8 18%, var(--gold) 55%, #E0AC4C 92%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 14px rgba(80, 8, 18, .45);
  padding: 0 30px;
}
.hero-slogan { margin-top: 10px; font-size: 14px; letter-spacing: 2px; color: rgba(255, 240, 205, .9); }

/* ---------- 转盘 ---------- */
.wheel-zone { text-align: center; padding: 22px 0 8px; }
.wheel-bezel {
  position: relative; width: 330px; height: 330px; margin: 0 auto;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 32%, #FFE7AE 0%, var(--gold-deep) 46%, #B37B22 78%, #8F5E14 100%);
  box-shadow: var(--shadow), inset 0 -6px 14px rgba(90, 50, 0, .35);
}
.bezel-lights { position: absolute; inset: 0; }
.bezel-lights i {
  position: absolute; left: 50%; top: 50%;
  width: 8px; height: 8px; border-radius: 50%;
  background: #FFF3CE; box-shadow: 0 0 6px 2px rgba(255, 236, 170, .85);
  animation: twinkle 1.1s infinite;
}
.bezel-lights i:nth-child(even) { animation-delay: .55s; }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

.wheel-rotor {
  position: absolute; inset: 15px;
  border-radius: 50%;
  transition: transform 4.2s cubic-bezier(.16, .84, .12, 1);
  will-change: transform;
}
#wheelCanvas { width: 100%; height: 100%; display: block; border-radius: 50%; }

.wheel-pointer {
  position: absolute; left: 50%; top: -6px; transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-top: 30px solid var(--red);
  filter: drop-shadow(0 2px 3px rgba(60, 4, 12, .5));
}
.wheel-pointer::after {
  content: ""; position: absolute; left: -8px; top: -32px;
  width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #FFE9B8, var(--gold-deep));
}

.wheel-hub {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 88px; height: 88px; border-radius: 50%;
  border: 4px solid #FFE3A1;
  background: radial-gradient(circle at 50% 30%, #E6314F, var(--red) 55%, var(--red-deep));
  color: #FFF3CE; cursor: pointer;
  box-shadow: 0 4px 12px rgba(70, 5, 15, .5), inset 0 -4px 8px rgba(90, 4, 16, .55);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: transform .15s ease;
}
.wheel-hub:active { transform: translate(-50%, -50%) scale(.94); }
.wheel-hub[disabled] { filter: grayscale(.35) brightness(.85); cursor: not-allowed; }
.hub-main { font-size: 24px; font-weight: 800; letter-spacing: 4px; margin-left: 4px; }
.hub-sub { font-size: 11px; letter-spacing: 3px; margin-left: 3px; color: #FFD98A; }

.chance-pill {
  display: inline-block; margin-top: 18px;
  font-size: 14px; letter-spacing: 1px;
  color: #FFEBBB;
  background: rgba(0, 0, 0, .22);
  border: 1px solid rgba(245, 198, 100, .5);
  border-radius: 999px; padding: 7px 20px;
}
.chance-pill b { color: var(--gold); font-size: 17px; margin: 0 2px; }

/* ---------- 面板通用 ---------- */
.panel {
  background: var(--paper); color: var(--ink);
  border-radius: 16px; margin: 18px 14px 0; padding: 16px;
  box-shadow: var(--shadow);
}
.panel-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.panel-head h2 {
  font-size: 17px; font-weight: 700; letter-spacing: 1px;
  padding-left: 10px; border-left: 4px solid var(--red);
}
.panel-tip { font-size: 11px; color: var(--ink-soft); }

/* ---------- 任务 ---------- */
.task-list { list-style: none; }
.task-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 2px;
}
.task-list li + li { border-top: 1px dashed #EAD9BC; }
.task-info { flex: 1; }
.task-name { font-size: 15px; font-weight: 600; }
.task-desc { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.task-btn {
  border: none; border-radius: 999px; padding: 8px 16px;
  font-size: 13px; font-weight: 600; color: #FFF3CE;
  background: linear-gradient(180deg, #E0344F, var(--red));
  box-shadow: 0 3px 6px rgba(160, 14, 34, .35);
}
.task-btn[disabled] { background: #D9C6A6; color: #FFF; box-shadow: none; }

/* ---------- 产品卡片 ---------- */
.card-scroller {
  display: flex; gap: 12px; overflow-x: auto;
  padding: 2px 2px 8px; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.card-scroller::-webkit-scrollbar { display: none; }
.product-card {
  flex: 0 0 208px; scroll-snap-align: start;
  background: linear-gradient(165deg, #FFFDF6, var(--paper-soft));
  border: 1px solid #F0DDB8; border-radius: 14px;
  padding: 14px; position: relative;
}
.product-tag {
  display: inline-block; font-size: 11px; font-weight: 600;
  color: var(--red-deep); background: rgba(200, 16, 46, .1);
  border: 1px solid rgba(200, 16, 46, .25);
  padding: 2px 9px; border-radius: 999px;
}
.product-title { font-size: 15px; font-weight: 700; margin-top: 9px; }
.product-desc { font-size: 12px; color: var(--ink-soft); line-height: 1.55; margin-top: 5px; min-height: 37px; }
.product-cta {
  margin-top: 10px; width: 100%;
  border: 1px solid var(--red); border-radius: 999px;
  background: none; color: var(--red);
  font-size: 13px; font-weight: 600; padding: 7px 0;
}
.product-cta.is-link { background: var(--red); color: #FFF3CE; border: none; }

/* ---------- 我的奖品入口 ---------- */
.my-prizes-entry {
  display: flex; align-items: center; gap: 10px;
  margin: 18px 14px 0; padding: 15px 16px;
  background: linear-gradient(120deg, #FFE9B4, var(--gold));
  color: var(--red-deep); border-radius: 16px;
  font-weight: 700; font-size: 15px; letter-spacing: 1px;
  box-shadow: var(--shadow); cursor: pointer;
}
.entry-text { flex: 1; }
.entry-count { font-size: 13px; }
.entry-arrow { font-size: 22px; line-height: 1; }

/* ---------- 规则/脚注 ---------- */
.rules-list { padding-left: 20px; }
.rules-list li { font-size: 12px; line-height: 1.7; color: var(--ink-soft); margin-bottom: 4px; }
.page-foot {
  margin: 20px 26px 0; text-align: center;
  font-size: 11px; line-height: 1.7; color: rgba(255, 240, 205, .55);
}

/* ---------- 弹层 ---------- */
.mask {
  position: fixed; inset: 0; z-index: 30;
  background: rgba(30, 2, 8, .62);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.mask[hidden] { display: none; }

.sheet {
  width: 100%; max-width: 340px;
  background: var(--paper); color: var(--ink);
  border-radius: 18px; padding: 24px 22px;
}
.sheet-title { font-size: 19px; font-weight: 800; text-align: center; }
.sheet-sub { font-size: 12px; color: var(--ink-soft); text-align: center; margin: 6px 0 16px; }
.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input {
  width: 100%; border: 1px solid #E4D2B0; border-radius: 10px;
  padding: 11px 12px; font-size: 16px; background: #FFFDF6; color: var(--ink);
}
.field input:focus { outline: 2px solid var(--gold-deep); border-color: transparent; }
.agree-line {
  display: flex; gap: 7px; align-items: flex-start;
  font-size: 11px; color: var(--ink-soft); line-height: 1.6; margin: 4px 0 14px;
}
.agree-line input { margin-top: 2px; }
.btn-primary {
  width: 100%; border: none; border-radius: 999px;
  padding: 13px 0; font-size: 16px; font-weight: 700; letter-spacing: 2px;
  color: #FFF3CE; background: linear-gradient(180deg, #E0344F, var(--red));
  box-shadow: 0 4px 10px rgba(160, 14, 34, .4); cursor: pointer;
}
.btn-primary[disabled] { background: #D9C6A6; box-shadow: none; cursor: not-allowed; }

/* ---------- 抽奖结果 ---------- */
.result-card {
  position: relative; width: 100%; max-width: 320px;
  background: linear-gradient(180deg, #FFFDF6, var(--paper-soft));
  color: var(--ink); border-radius: 20px;
  border: 2px solid var(--gold-deep);
  padding: 30px 24px 24px; text-align: center;
  overflow: hidden;
}
.result-burst {
  position: absolute; left: 50%; top: -46px; transform: translateX(-50%);
  width: 190px; height: 190px; border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 198, 100, .5) 0%, rgba(245, 198, 100, 0) 68%);
  pointer-events: none;
}
.result-level {
  display: inline-block; font-size: 13px; font-weight: 700;
  color: var(--red-deep); letter-spacing: 2px;
  background: linear-gradient(180deg, #FFE9B8, var(--gold));
  border-radius: 999px; padding: 4px 16px;
}
.result-name { font-size: 25px; font-weight: 800; margin-top: 14px; color: var(--red-deep); }
.result-desc { font-size: 13px; color: var(--ink-soft); line-height: 1.7; margin: 12px 0 18px; }

/* ---------- 我的奖品面板 ---------- */
.prizes-panel {
  width: 100%; max-width: 360px; max-height: 82vh; overflow-y: auto;
  background: var(--paper); color: var(--ink);
  border-radius: 18px; padding: 20px;
}
.prizes-head { display: flex; justify-content: space-between; align-items: center; }
.prizes-head h3 { font-size: 18px; font-weight: 800; }
.panel-close {
  border: none; background: none; font-size: 26px; line-height: 1;
  color: var(--ink-soft); cursor: pointer; padding: 2px 6px;
}
.prizes-tip { font-size: 12px; color: var(--ink-soft); margin: 8px 0 14px; }
.prize-item {
  border: 1px solid #EFDCB8; border-radius: 14px;
  padding: 14px; margin-bottom: 12px; text-align: center;
  background: #FFFDF6;
}
.prize-item .p-name { font-size: 16px; font-weight: 700; color: var(--red-deep); }
.prize-item .p-level { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.prize-qr { width: 150px; height: 150px; margin: 12px auto 6px; }
.prize-qr svg, .prize-qr img { width: 100%; height: 100%; }
.p-code { font-size: 20px; font-weight: 800; letter-spacing: 4px; color: var(--ink); }
.p-status { display: inline-block; font-size: 11px; border-radius: 999px; padding: 3px 12px; margin-top: 8px; }
.p-status.issued { color: var(--red-deep); background: rgba(200, 16, 46, .09); border: 1px solid rgba(200, 16, 46, .3); }
.p-status.redeemed { color: #6B7C5A; background: rgba(107, 124, 90, .12); border: 1px solid rgba(107, 124, 90, .35); }
.prizes-empty { text-align: center; font-size: 13px; color: var(--ink-soft); padding: 26px 0 18px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 12vh; transform: translateX(-50%);
  z-index: 50; max-width: 78vw;
  background: rgba(30, 2, 8, .85); color: #FFEBBB;
  font-size: 14px; line-height: 1.5;
  border-radius: 999px; padding: 10px 20px; text-align: center;
}
.toast[hidden] { display: none; }

/* ---------- 无障碍与降级 ---------- */
button:focus-visible, input:focus-visible, .my-prizes-entry:focus-visible {
  outline: 3px solid #FFD98A; outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .wheel-rotor { transition-duration: .6s; }
  .bezel-lights i { animation: none; }
  body { transition: none; }
}
@media (max-width: 350px) {
  .wheel-bezel { width: 288px; height: 288px; }
  .hero-title { font-size: 29px; }
}

/* ============ M2：玩法中心 ============ */
.game-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.game-card {
  display: block; text-decoration: none;
  background: linear-gradient(165deg, #FFFDF6, var(--paper-soft));
  border: 1px solid #F0DDB8; border-radius: 14px;
  padding: 14px 12px; position: relative;
}
.game-card .g-icon { font-size: 30px; line-height: 1; }
.game-card .g-name { font-size: 15px; font-weight: 700; color: var(--ink); margin-top: 8px; }
.game-card .g-desc { font-size: 11px; color: var(--ink-soft); margin-top: 3px; line-height: 1.5; }
.game-card .g-tag {
  position: absolute; top: 10px; right: 10px;
  font-size: 10px; font-weight: 600; color: var(--red-deep);
  background: rgba(200, 16, 46, .1); border: 1px solid rgba(200, 16, 46, .25);
  border-radius: 999px; padding: 2px 8px;
}

/* ============ M2：玩法页通用 ============ */
.game-top {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 4px; font-size: 14px;
}
.game-top .back { color: var(--gold); text-decoration: none; font-weight: 600; white-space: nowrap; }
.game-top .g-title { flex: 1; text-align: center; font-weight: 800; letter-spacing: 2px; color: #FFE9B8; font-size: 17px; }
.game-top .mine { color: var(--gold); text-decoration: none; font-size: 13px; white-space: nowrap; }
.game-stage {
  background: var(--paper); color: var(--ink);
  border-radius: 18px; margin: 14px; padding: 20px 16px;
  box-shadow: var(--shadow); text-align: center;
}
.game-stage h2 { font-size: 20px; font-weight: 800; letter-spacing: 1px; }
.game-sub { font-size: 13px; color: var(--ink-soft); margin-top: 6px; line-height: 1.7; }
.big-num { font-size: 40px; font-weight: 800; color: var(--red-deep); font-variant-numeric: tabular-nums; }

/* 刮刮乐 */
.scratch-wrap { position: relative; width: 100%; max-width: 320px; height: 170px; margin: 16px auto 6px; }
.scratch-under {
  position: absolute; inset: 0; border-radius: 14px;
  background: linear-gradient(160deg, #FFF6E0, #FFE9B8);
  border: 2px dashed var(--gold-deep);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.scratch-under .s-name { font-size: 24px; font-weight: 800; color: var(--red-deep); padding: 0 12px; }
.scratch-under .s-tip { font-size: 12px; color: var(--ink-soft); }
#scratchCanvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 14px; touch-action: none; }

/* 答题 */
.quiz-progress { font-size: 13px; color: var(--ink-soft); margin-bottom: 10px; }
.quiz-q { font-size: 18px; font-weight: 700; line-height: 1.6; text-align: left; min-height: 86px; }
.quiz-topic {
  display: inline-block; font-size: 11px; color: var(--red-deep);
  background: rgba(200,16,46,.08); border: 1px solid rgba(200,16,46,.22);
  border-radius: 999px; padding: 2px 10px; margin-bottom: 8px;
}
.quiz-opts { display: grid; gap: 10px; margin-top: 14px; }
.quiz-opt {
  text-align: left; font-size: 16px; line-height: 1.5;
  background: #FFFDF6; color: var(--ink);
  border: 1.5px solid #EBD9B8; border-radius: 12px;
  padding: 13px 14px; cursor: pointer;
}
.quiz-opt.correct { border-color: #4F7A3C; background: rgba(79,122,60,.1); }
.quiz-opt.wrong { border-color: var(--red); background: rgba(200,16,46,.07); }
.quiz-explain {
  margin-top: 12px; font-size: 13px; line-height: 1.7; color: var(--ink-soft);
  background: var(--paper-soft); border-radius: 10px; padding: 10px 12px; text-align: left;
}

/* 金豆庄园 */
.bean-tree { font-size: 84px; line-height: 1.1; margin: 6px 0; }
.bean-count { font-size: 15px; color: var(--ink-soft); }
.bean-count b { font-size: 30px; color: var(--red-deep); font-variant-numeric: tabular-nums; margin: 0 4px; }
.bean-actions { list-style: none; margin-top: 14px; text-align: left; }
.bean-actions li { display: flex; align-items: center; gap: 12px; padding: 11px 2px; }
.bean-actions li + li { border-top: 1px dashed #EAD9BC; }
.goal-pick { display: grid; gap: 10px; margin-top: 12px; }
.goal-card {
  border: 1.5px solid #EBD9B8; border-radius: 12px; padding: 12px;
  background: #FFFDF6; cursor: pointer; text-align: left; font-size: 14px;
}
.goal-card b { color: var(--red-deep); }
.goal-bar { height: 16px; background: #F1E3C2; border-radius: 999px; overflow: hidden; margin-top: 12px; }
.goal-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); transition: width .6s ease; min-width: 6px; }
.goal-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-soft); margin-top: 6px; }

/* 节拍点点乐 */
.rhythm-field {
  position: relative; height: 340px; margin-top: 14px;
  background: linear-gradient(180deg, #FFFDF6, var(--paper-soft));
  border: 2px dashed var(--gold-deep); border-radius: 16px; overflow: hidden;
  touch-action: manipulation;
}
.rhythm-target {
  position: absolute; width: 92px; height: 92px; border: none; border-radius: 50%;
  font-size: 46px; line-height: 1; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #FFE9B8, var(--gold));
  box-shadow: 0 4px 10px rgba(160, 100, 20, .35);
  animation: popin .18s ease;
}
@keyframes popin { from { transform: scale(.3); } to { transform: scale(1); } }
.rhythm-hud { display: flex; justify-content: space-between; font-size: 15px; font-weight: 700; color: var(--ink); padding: 0 4px; }
.rhythm-hud b { color: var(--red-deep); font-variant-numeric: tabular-nums; }

/* AI 财运签 */
.fortune-tube { font-size: 96px; line-height: 1.1; margin: 4px 0; display: inline-block; }
.fortune-tube.shaking { animation: shake .5s ease infinite; }
@keyframes shake { 0%,100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
.sign-card {
  margin-top: 8px; text-align: center;
  background: linear-gradient(178deg, #FFFDF4, #FFF3D8);
  border: 2px solid var(--gold-deep); border-radius: 16px; padding: 22px 18px;
}
.sign-title {
  display: inline-block; font-size: 16px; font-weight: 800; letter-spacing: 2px;
  color: var(--red-deep);
  border-top: 2px solid var(--gold-deep); border-bottom: 2px solid var(--gold-deep);
  padding: 6px 14px;
}
.sign-verse { margin-top: 14px; font-size: 16px; line-height: 2.1; color: var(--ink); font-weight: 600; }
.sign-advice {
  margin-top: 12px; font-size: 13px; line-height: 1.8; color: var(--ink-soft);
  background: rgba(217, 164, 65, .12); border-radius: 10px; padding: 10px 12px;
}
.sign-foot { margin-top: 12px; font-size: 10px; color: #B29B77; line-height: 1.6; }

/* ============ M2：适老大字模式 ============ */
.elder-toggle {
  position: fixed; left: 12px; bottom: 14px; z-index: 60;
  border: 1px solid rgba(245, 198, 100, .6); border-radius: 999px;
  background: rgba(30, 2, 8, .62); color: var(--gold);
  font-size: 14px; font-weight: 600; padding: 9px 15px; cursor: pointer;
  box-shadow: 0 3px 10px rgba(30, 2, 8, .4);
}
body.elder { letter-spacing: .5px; }
body.elder .brand-period { display: none; }
body.elder .hero-title { font-size: 36px; letter-spacing: 1px; }
body.elder .hero-slogan { font-size: 17px; }
body.elder .chance-pill { font-size: 17px; }
body.elder .chance-pill b { font-size: 21px; }
body.elder .panel-head h2 { font-size: 21px; }
body.elder .panel-tip { font-size: 14px; }
body.elder .task-name, body.elder .product-title, body.elder .game-card .g-name { font-size: 19px; }
body.elder .task-desc, body.elder .product-desc, body.elder .game-card .g-desc { font-size: 15px; }
body.elder .task-btn, body.elder .product-cta { font-size: 17px; padding: 12px 20px; }
body.elder .rules-list li, body.elder .page-foot { font-size: 15px; }
body.elder .sheet-title { font-size: 23px; }
body.elder .sheet-sub, body.elder .agree-line { font-size: 15px; }
body.elder .field span { font-size: 17px; }
body.elder .field input { font-size: 19px; }
body.elder .btn-primary { font-size: 19px; padding: 16px 0; }
body.elder .toast { font-size: 17px; }
body.elder .quiz-q { font-size: 22px; }
body.elder .quiz-opt { font-size: 19px; padding: 16px; }
body.elder .quiz-explain { font-size: 16px; }
body.elder .game-sub { font-size: 16px; }
body.elder .game-top .g-title { font-size: 20px; }
body.elder .game-top .back, body.elder .game-top .mine { font-size: 16px; }
body.elder .sign-verse { font-size: 19px; }
body.elder .sign-advice { font-size: 16px; }
body.elder .bean-actions .task-name { font-size: 19px; }
body.elder .rhythm-target { width: 112px; height: 112px; font-size: 56px; }
body.elder .p-code { font-size: 24px; }
body.elder .prizes-tip { font-size: 15px; }
