* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background: #FFF8E1;
  color: #333;
  min-height: 100vh;
  padding: 0 0 30px;
}
.hidden { display: none !important; }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(180deg, #FFD54F 0%, #FFC107 45%, #FFF8E1 100%);
  padding: 16px 16px 10px;
  position: relative;  /* 给 logoBar 一个 z-index 参照 */
  z-index: 1;
}
.hero-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.brand { font-size: 16px; font-weight: 800; color: #5D4037; letter-spacing: 1px; }

/* 品牌 Logo 区：最多 3 个，从右向左排列（第 1 个最右）；固定钉在右上、永远在 hero 之上 */
.logo-bar {
  display: flex; flex-direction: row-reverse; gap: 6px; align-items: center;
  position: fixed; top: 12px; right: 12px; z-index: 20;
  padding: 4px 6px; border-radius: 10px;
  background: rgba(255,255,255,.6); backdrop-filter: blur(4px);
  box-shadow: 0 2px 6px rgba(0,0,0,.1);
}
.logo-bar.hidden { display: none !important; }
.logo-bar img {
  width: 32px; height: 32px; border-radius: 8px; object-fit: contain;
  background: rgba(255,255,255,.9); padding: 2px; box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

.countdown-wrap {
  display: flex; align-items: center; gap: 4px; justify-content: center;
  background: rgba(0,0,0,.18); border-radius: 20px; padding: 4px 12px;
  width: fit-content; margin: 0 auto 8px;
}
.cd-label { font-size: 11px; color: rgba(255,255,255,.95); }
.cd-time { font-size: 14px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }

.go-area { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 8px 0 10px; }
.go-circle {
  width: 104px; height: 104px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FFE082, #FFB300);
  border: 3px solid #E65100; display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 4px 16px rgba(230,81,0,.25), inset 0 2px 8px rgba(255,255,255,.4);
}
.go-circle:active { transform: scale(.96); }
.go-text { font-size: 32px; font-weight: 900; color: #BF360C; letter-spacing: -1px; }
.go-sub { font-size: 10px; font-weight: 700; color: #E65100; background: rgba(255,255,255,.55); padding: 2px 8px; border-radius: 10px; margin-top: -2px; }
.prize-link {
  display: flex; align-items: center; background: rgba(255,255,255,.75);
  border: 1.5px solid #FF8F00; border-radius: 20px; padding: 6px 14px; cursor: pointer;
}
.prize-link-text { font-size: 13px; font-weight: 700; color: #E65100; }

/* 字符盘：全部常显；已集金底，未集灰边框；缩小尺寸；分行居中 */
.char-grid { padding: 6px 2px 4px; }
.slot-counter { text-align: center; font-size: 13px; font-weight: 700; color: #E65100; margin-bottom: 6px; }
.slot-rows { display: flex; flex-direction: column; gap: 7px; align-items: center; }
.slot-row { display: flex; justify-content: center; gap: 9px; }
.char-slot {
  width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  position: relative; box-shadow: 0 2px 6px rgba(230,81,0,.15);
}
.char-slot .char { font-size: 22px; font-weight: 900; text-shadow: 0 1px 0 rgba(255,255,255,.5); }
.char-slot.got { background: linear-gradient(145deg, #FFE082, #FFCA28); border: 2.5px solid #F57C00; color: #BF360C; }
.char-slot.miss { background: #FBF7EC; border: 2px dashed #C9B98C; color: #B6A878; }
.char-slot .qty {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px;
  background: #EF4444; border-radius: 9px; border: 2px solid #fff; color: #fff;
  font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}

/* ===== Tab 栏 ===== */
.tab-bar { display: flex; background: #5D4037; position: sticky; top: 0; z-index: 10; }
.tab {
  flex: 1; text-align: center; padding: 11px 0; font-size: 12.5px; font-weight: 600;
  color: rgba(255,255,255,.6); cursor: pointer; border-bottom: 3px solid transparent;
}
.tab.active { color: #FFD54F; border-bottom-color: #FFD54F; background: rgba(255,255,255,.06); }

.panel { display: none; padding: 14px; animation: fadeIn .2s ease; }
.panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ===== Tab1 活动详情 ===== */
.detail-banner { width: 100%; border-radius: 10px; overflow: hidden; margin-bottom: 12px; position: relative; border: 1.5px solid #E0E0E0; }
.detail-banner img { width: 100%; display: block; }
.db-badge { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.5); color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 4px; }
.prize-list { display: flex; flex-direction: column; gap: 8px; }
.prize-card { display: flex; align-items: center; gap: 10px; background: #FFFDE7; border: 1.5px solid #FFECB3; border-radius: 10px; padding: 10px; }
.prize-img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; border: 1.5px solid #FFE082; flex-shrink: 0; background: #FFF8E1; }
.prize-title { font-size: 13.5px; font-weight: 700; color: #E65100; margin-bottom: 4px; }
.pch { font-size: 11px; font-weight: 700; color: #fff; background: #F57C00; padding: 2px 5px; border-radius: 5px; }

/* ===== Tab2 活动规则 ===== */
.rule-line { display: flex; gap: 6px; margin-bottom: 8px; font-size: 13px; line-height: 1.65; color: #37474F; }
.rl-label { color: #5D4037; font-weight: 600; white-space: nowrap; }
.rule-title { font-size: 14px; font-weight: 700; color: #5D4037; margin: 12px 0 6px; }
.rule-body { font-size: 13px; line-height: 1.8; color: #37474F; white-space: pre-wrap; background: #FFFDE7; border: 1px solid #FFECB3; border-radius: 8px; padding: 10px; }

/* ===== Tab3 TOP100 ===== */
.rank-title { font-size: 15px; margin-bottom: 10px; color: #5D4037; }
.rank-list { display: flex; flex-direction: column; }
.rank-item { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #EEE; }
.rank-medal { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; color: #fff; }
.mg { background: linear-gradient(135deg,#FFD54F,#FFB300); }
.ms { background: linear-gradient(135deg,#E0E0E0,#9E9E9E); }
.mb { background: linear-gradient(135deg,#CE93D8,#AB47BC); }
.mn { background: #EEE; color: #757575; }
.rank-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid #FFD54F; flex-shrink: 0; }
.rank-name { font-size: 12.5px; font-weight: 600; width: 64px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-chars { display: flex; gap: 3px; flex-wrap: wrap; flex: 1; }
.rch { font-size: 11px; font-weight: 700; color: #BF360C; background: linear-gradient(145deg,#FFE082,#FFCA28); border: 1.5px solid #F57C00; border-radius: 5px; padding: 2px 4px; position: relative; min-width: 22px; text-align: center; }
.cb { position: absolute; top: -5px; right: -5px; min-width: 14px; height: 14px; background: #EF4444; border-radius: 7px; border: 1.5px solid #fff; color: #fff; font-size: 8px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.rch.zero { color: #bbb; background: #f3f0e8; border-color: #ddd; }

/* ===== Tab4 兑换奖品（多奖品） ===== */
.prize-detail-list { display: flex; flex-direction: column; gap: 12px; }
.prize-detail-card { background: #FFFDE7; border: 1.5px solid #FFECB3; border-radius: 10px; padding: 12px; }
.prize-detail-card img { width: 100%; border-radius: 8px; margin-bottom: 8px; }
.pd-title { font-size: 15px; font-weight: 800; color: #E65100; margin-bottom: 6px; }
.pd-line { font-size: 12.5px; color: #555; line-height: 1.7; }
.pd-chars { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.pdc { font-size: 12px; font-weight: 700; color: #fff; background: #43A047; padding: 3px 8px; border-radius: 6px; }
.pdc.no { background: #bbb; }
.redeem-btn { margin-top: 10px; }
.prize-detail-card .redeem-result { margin-top: 10px; }

/* ===== 通用 ===== */
.btn { width: 100%; border: none; border-radius: 24px; padding: 13px; font-size: 16px; font-weight: 600; color: #fff; cursor: pointer; }
.btn-primary { background: linear-gradient(135deg,#E65100,#BF360C); }
.btn:active { opacity: .85; }
.tip { font-size: 12px; color: #999; text-align: center; margin-top: 8px; line-height: 1.5; }
.footer-tip { color: #8d6e63; font-size: 11.5px; text-align: center; margin-top: 16px; line-height: 1.6; padding: 0 10px; }
.redeem-result { margin-top: 12px; text-align: center; font-size: 15px; line-height: 1.7; background: #FFFDE7; border: 1.5px solid #FFECB3; border-radius: 10px; padding: 12px; }
.redeem-result b { font-size: 24px; color: #E65100; letter-spacing: 3px; }
.redeem-disabled { margin-top: 12px; text-align: center; font-size: 14px; line-height: 1.7; background: #f5f5f5; border: 1.5px solid #e0e0e0; border-radius: 10px; padding: 12px; color: #9e9e9e; }

/* ===== 登录弹窗 ===== */
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 50; }
.dialog { background: #fff; border-radius: 14px; padding: 22px 18px; width: 86%; max-width: 320px; }
.dialog h3 { text-align: center; margin-bottom: 6px; color: #E65100; }
.input { width: 100%; border: 1px solid #ddd; border-radius: 8px; padding: 11px; margin-top: 12px; font-size: 15px; }
.dialog .btn { margin-top: 14px; }
.toast { position: fixed; left: 50%; top: 42%; transform: translateX(-50%); background: rgba(0,0,0,.8); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px; z-index: 99; max-width: 80%; text-align: center; }

/* 用户问候 */
.hi-user { font-size: 12px; font-weight: 700; color: #5D4037; background: rgba(255,255,255,.6); padding: 2px 10px; border-radius: 12px; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 抽字区右侧列：次数 / 我的奖品 / 转发 */
.side-col { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.quota-badge {
  background: rgba(255,255,255,.85); border: 1.5px solid #FF8F00; border-radius: 16px;
  padding: 4px 12px; font-size: 12px; font-weight: 700; color: #E65100; text-align: center;
}
.share-bar { display: flex; flex-direction: column; gap: 6px; }
.share-btn {
  background: linear-gradient(135deg,#43A047,#2E7D32); color: #fff; border: none; border-radius: 18px;
  padding: 7px 12px; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.share-btn:active { opacity: .85; }

/* 转发引导层：微信 H5 无法代码调起分享面板，引导用户点右上角 ··· */
.share-guide { position: fixed; inset: 0; background: rgba(0,0,0,.78); z-index: 100; display: flex; flex-direction: column; align-items: center; padding-top: 60px; color: #fff; text-align: center; }
.share-guide.hidden { display: none !important; }
.share-guide-top { position: absolute; top: 8px; right: 16px; display: flex; flex-direction: column; align-items: center; }
.share-guide-dot { width: 40px; height: 40px; border: 2px solid #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; letter-spacing: 2px; color: #fff; }
.share-guide-arrow { font-size: 32px; margin-top: 4px; animation: shareGuidePulse 1.2s infinite; }
@keyframes shareGuidePulse { 0%,100%{ transform: translateY(0); opacity: 1; } 50%{ transform: translateY(8px); opacity: .55; } }
.share-guide-text { margin-top: 90px; font-size: 22px; font-weight: 700; line-height: 1.6; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.share-guide-tip { margin-top: 18px; font-size: 14px; color: rgba(255,255,255,.8); }

/* 抽字按钮置黑（集齐/一等奖后） */
.go-circle.disabled { background: #9e9e9e; border-color: #757575; cursor: not-allowed; box-shadow: none; }
.go-circle.disabled .go-text, .go-circle.disabled .go-sub { color: #eee; }
.go-circle.disabled:active { transform: none; }

/* 恭喜中奖特效 */
.win-card { text-align: center; border: 2px solid #FFD54F; }
.win-body { font-size: 14px; line-height: 1.8; color: #555; margin: 10px 0 14px; }
.confetti { position: absolute; top: -40px; font-size: 26px; opacity: 0; animation: fall 1.6s linear infinite; z-index: 1; }
.confetti:nth-child(1) { left: 12%; animation-delay: 0s; }
.confetti:nth-child(2) { left: 30%; animation-delay: .3s; }
.confetti:nth-child(3) { left: 50%; animation-delay: .6s; }
.confetti:nth-child(4) { left: 68%; animation-delay: .2s; }
.confetti:nth-child(5) { left: 84%; animation-delay: .5s; }
.confetti:nth-child(6) { left: 22%; animation-delay: .8s; }
@keyframes fall {
  0% { top: -40px; opacity: 1; transform: rotate(0deg); }
  100% { top: 100%; opacity: 0; transform: rotate(360deg); }
}

/* 我的奖品弹窗 */
.prize-modal { width: 90%; max-width: 360px; max-height: 82vh; display: flex; flex-direction: column; }
.modal-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #EEE; padding-bottom: 8px; margin-bottom: 4px; }
.modal-head h3 { color: #E65100; }
.modal-close { font-size: 18px; color: #999; cursor: pointer; padding: 0 6px; }
.modal-body { overflow-y: auto; padding-right: 2px; }

/* 领取兑奖码：实名信息弹窗 */
.rn-dialog { width: 90%; max-width: 340px; }
.rn-tip { font-size: 12px; color: #8d6e63; line-height: 1.6; margin: 6px 0 12px; background: #FFF8E1; border: 1px solid #FFE0B2; border-radius: 8px; padding: 8px 10px; }
.rn-dialog .field { margin-bottom: 12px; }
.rn-dialog .field label { display: block; font-size: 12.5px; font-weight: 600; color: #5D4037; margin-bottom: 5px; }
.rn-dialog .field .req { color: #E65100; margin-left: 2px; }
.rn-dialog .input { margin-top: 0; }
.rn-dialog .input.input-error { border-color: #C62828; background: #FDECEA; box-shadow: 0 0 0 2px rgba(198,40,40,.12); }
.rn-err { font-size: 12px; color: #C62828; min-height: 16px; margin: 2px 0 8px; text-align: center; }
.rn-foot { display: flex; gap: 10px; margin-top: 4px; }
.rn-foot .btn { margin-top: 0; flex: 1; }
.btn-ghost { background: #eee; color: #555; }
.win-redeem { margin-bottom: 8px; }

/* ===== 抽字幸运转盘弹窗 ===== */
.draw-mask { z-index: 60; backdrop-filter: blur(4px); background: rgba(0,0,0,.55); }
.draw-dialog {
  width: 88%; max-width: 340px; padding: 16px 16px 18px;
  background: linear-gradient(180deg, #FFF8E1 0%, #fff 60%);
  border-radius: 16px; border: 1.5px solid #FFD54F;
  box-shadow: 0 12px 40px rgba(245,124,0,.25);
  display: flex; flex-direction: column; gap: 12px;
  animation: drawDialogIn .35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes drawDialogIn {
  0%   { transform: scale(0.7) translateY(40px); opacity: 0; }
  100% { transform: scale(1)   translateY(0);    opacity: 1; }
}
.draw-head { display: flex; justify-content: space-between; align-items: center; }
.draw-title { font-size: 15px; font-weight: 700; color: #E65100; letter-spacing: .5px; }

/* 转盘 */
.draw-wheel-wrap {
  position: relative; width: 220px; height: 220px; margin: 4px auto 2px;
  border-radius: 50%;
  background: radial-gradient(circle, #FFE082 0%, #FFB300 100%);
  padding: 8px;
  box-shadow: 0 6px 18px rgba(230,81,0,.3), inset 0 0 0 4px #E65100;
}
.wheel {
  position: relative; width: 100%; height: 100%; border-radius: 50%;
  overflow: hidden; will-change: transform;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.5);
}
.wheel-label {
  position: absolute; left: 50%; top: 50%;
  transform-origin: 0 0; margin: -12px 0 0 -12px;
  width: 24px; height: 24px; text-align: center; line-height: 24px;
  font-size: 22px; font-weight: 900; color: #6D4C41;
}
.wheel-hub {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: 56px; height: 56px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, #FFE082);
  border: 3px solid #E65100; color: #BF360C;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 900;
  box-shadow: 0 2px 8px rgba(230,81,0,.4); z-index: 4;
  transition: transform .3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.wheel-hub.reveal {
  animation: hubPop .5s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 18px rgba(230,81,0,.7);
}
@keyframes hubPop {
  0%   { transform: translate(-50%,-50%) scale(.5); }
  60%  { transform: translate(-50%,-50%) scale(1.2); }
  100% { transform: translate(-50%,-50%) scale(1); }
}
/* 顶部指针（向下指入转盘） */
.wheel-pointer {
  position: absolute; left: 50%; top: -6px; transform: translateX(-50%);
  width: 0; height: 0; z-index: 6;
  border-left: 12px solid transparent; border-right: 12px solid transparent;
  border-top: 20px solid #E65100;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.3));
}

.draw-result {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 0; min-height: 76px; justify-content: center;
}
.draw-rarity { font-size: 12px; color: #888; letter-spacing: 1px; }
.draw-char {
  font-size: 56px; font-weight: 900; color: #BF360C;
  text-shadow: 0 3px 6px rgba(255,152,0,.3);
  transition: transform .3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.draw-char.pop { animation: drawCharPop .5s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes drawCharPop {
  0%   { transform: scale(0.5); }
  60%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}
.draw-tip { font-size: 12px; color: #999; }
.draw-tip.win  { color: #E65100; font-weight: 700; }
.draw-tip.lose { color: #C62828; }
