/* ===== 幸运大抽奖 - 红金喜庆风 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: linear-gradient(160deg, #c0392b 0%, #e74c3c 45%, #d35400 100%);
  min-height: 100vh;
  color: #fff;
}

.hidden { display: none !important; }

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* ===== 顶部主题 ===== */
.hero { text-align: center; padding: 10px 0 18px; }

.hero-emblem {
  width: 58px;
  height: 58px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffd97a, #f5b942);
  color: #a8331f;
  font-size: 30px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.6);
}

.hero-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 2px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.hero-sub {
  margin-top: 6px;
  font-size: 15px;
  font-weight: 600;
  color: #ffe9a8;
}

.hero-note {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
}

/* 活动倒计时（未开始 / 进行中 / 已结束） */
.act-countdown {
  display: inline-block;
  margin-top: 12px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}
.act-countdown.ended {
  background: rgba(0, 0, 0, 0.22);
  border-color: rgba(255, 255, 255, 0.24);
}

/* 抽奖按钮禁用态（活动未开始 / 已结束） */
.draw-btn:disabled,
.wheel-btn:disabled {
  filter: grayscale(0.35);
  opacity: 0.82;
  cursor: not-allowed;
}

/* ===== 我的奖品入口 ===== */
.my-prizes-link {
  display: block;
  text-align: right;
  font-size: 13px;
  color: #ffe9a8;
  text-decoration: none;
  margin-bottom: 10px;
  font-weight: 600;
}

/* ===== 九宫格 ===== */
.grid-wrap {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 217, 122, 0.55);
  border-radius: 20px;
  padding: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  position: relative;
}

.cell {
  aspect-ratio: 1 / 1;
  background: linear-gradient(160deg, #fff8e7, #ffeec9);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px;
  border: 2px solid transparent;
  transition: all 0.12s ease;
  overflow: hidden;
  position: relative;
}


.cell-emoji { font-size: 26px; line-height: 1; }

.cell-name {
  font-size: 12px;
  font-weight: 700;
  color: #b03a2e;
  text-align: center;
  line-height: 1.25;
  max-width: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* 跑马灯高亮 */
.cell.active {
  background: linear-gradient(160deg, #ffd97a, #f7b733);
  border-color: #fff;
  transform: scale(1.05);
  box-shadow: 0 0 18px rgba(255, 217, 122, 0.9);
}

.cell.active .cell-name { color: #8c2a1c; }

/* 中奖定格 */
.cell.winner {
  background: linear-gradient(160deg, #fff3c4, #ffd35c);
  border-color: #fff;
  animation: winnerPulse 0.9s ease-in-out 3;
}

@keyframes winnerPulse {
  0%, 100% { transform: scale(1.05); box-shadow: 0 0 14px rgba(255, 217, 122, 0.85); }
  50% { transform: scale(1.12); box-shadow: 0 0 26px rgba(255, 235, 160, 1); }
}

/* 中间抽奖按钮 */
.draw-btn {
  aspect-ratio: 1 / 1;
  border: none;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffcf5c, #f39c12);
  color: #a8331f;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28), inset 0 -3px 0 rgba(0, 0, 0, 0.12);
  transition: transform 0.1s ease;
  font-family: inherit;
}

.draw-btn:active { transform: scale(0.95); }

.draw-btn:disabled { opacity: 0.75; }

.draw-btn-main {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 2px;
}

.draw-btn-sub {
  font-size: 11px;
  font-weight: 700;
  color: rgba(168, 51, 31, 0.85);
}

/* ===== 表单 ===== */
.form-box { margin-top: 18px; }

.phone-input {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 12px;
  padding: 0 16px;
  font-size: 16px;
  background: #fff;
  color: #333;
  outline: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.phone-input::placeholder { color: #aaa; }

/* 已中奖：手机号锁定变灰，不可再改 */
.phone-input:disabled {
  background: rgba(255, 255, 255, 0.35);
  color: rgba(255, 255, 255, 0.75);
  box-shadow: none;
  cursor: not-allowed;
}

/* 未输手机号点抽奖：抖动提醒 */
.phone-input.shake { animation: inputShake 0.4s ease; border: 2px solid #ffd7d2; }

@keyframes inputShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

.tip {
  margin-top: 8px;
  font-size: 13px;
  min-height: 18px;
  text-align: center;
  color: #ffe9a8;
  font-weight: 600;
}

.tip.error { color: #ffd7d2; }

/* ===== 分享 ===== */
.share-box {
  margin-top: 20px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
}

.share-title {
  font-size: 13px;
  color: #ffe9a8;
  font-weight: 600;
  margin-bottom: 12px;
}

.share-rule { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,0.06); font-size: 11.5px; color: #f3d9a0; line-height: 1.7; text-align: left; }
.share-rule b { color: #ffe9a8; }

.share-btns { display: flex; gap: 12px; }

.share-btn {
  flex: 1;
  height: 44px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  background: linear-gradient(145deg, #57c84d, #3ba832);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.share-btn-friend { background: linear-gradient(145deg, #4a9de0, #2f7fc4); }

.share-btn:disabled { opacity: 0.6; }

.share-confirm {
  margin-top: 12px;
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  background: linear-gradient(145deg, #ffd97a, #f5b942);
  color: #a8331f;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ===== 记录入口 ===== */
.records-entry { margin-top: 18px; text-align: center; }

.records-btn {
  display: inline-block;
  font-size: 14px;
  color: #ffe9a8;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 233, 168, 0.5);
  padding-bottom: 2px;
}

.footer {
  margin-top: 28px;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
}

/* ===== 结果弹窗 ===== */
.modal { position: fixed; inset: 0; z-index: 100; }

.modal-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); }

.modal-body {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 48px);
  max-width: 340px;
  background: linear-gradient(170deg, #fffdf6, #fff3d6);
  border-radius: 20px;
  padding: 26px 22px 22px;
  text-align: center;
  color: #333;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  border: 2px solid #f5c96b;
}

.modal-confetti { font-size: 38px; }

.modal-title {
  margin-top: 6px;
  font-size: 21px;
  font-weight: 800;
  color: #c0392b;
}

.modal-prize-img { margin-top: 12px; }

.modal-prize-img img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid #f5c96b;
}

.modal-prize-name {
  margin-top: 12px;
  font-size: 19px;
  font-weight: 800;
  color: #b03a2e;
}

.modal-prize-type {
  margin-top: 4px;
  font-size: 12px;
  color: #999;
}

.modal-desc {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.6;
  color: #666;
  text-align: left;
  background: rgba(245, 201, 107, 0.14);
  border-radius: 10px;
  padding: 10px 12px;
  white-space: pre-line;
}

.modal-code-wrap {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.modal-code-label { font-size: 12px; color: #999; }

.modal-code {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #c0392b;
  background: #fff;
  border: 1px dashed #e0a83c;
  border-radius: 8px;
  padding: 4px 12px;
}

.modal-redeem {
  margin-top: 10px;
  font-size: 12px;
  color: #888;
}

/* ===== 中奖弹窗：核销二维码 ===== */
.modal-qr { margin-top: 14px; }

.modal-qr-img {
  width: 148px;
  height: 148px;
  margin: 0 auto;
  padding: 6px;
  background: #fff;
  border: 2px solid #f5c96b;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-qr-img img, .modal-qr-img canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.modal-qr-tip {
  margin-top: 8px;
  font-size: 12px;
  color: #999;
  text-align: center;
}

/* ===== 中奖弹窗：核销地址 + 导航 ===== */
.modal-address {
  margin-top: 14px;
  background: rgba(245, 201, 107, 0.14);
  border: 1px dashed #e0a83c;
  border-radius: 10px;
  padding: 12px;
  text-align: left;
}

.modal-address-label {
  font-size: 12px;
  color: #999;
  margin-bottom: 4px;
}

.modal-address-text {
  font-size: 15px;
  font-weight: 700;
  color: #b03a2e;
  line-height: 1.5;
}

.modal-address-btns {
  margin-top: 10px;
  display: flex;
  gap: 10px;
}

.addr-btn {
  flex: 1;
  height: 38px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.addr-btn-nav { background: linear-gradient(145deg, #4a9de0, #2f7fc4); color: #fff; }

.addr-btn-copy { background: #f2e6cc; color: #a8331f; }

.addr-btn:active { opacity: 0.85; }

/* ===== 抽奖页常驻核销地址 ===== */
.addr-box {
  margin: 0 16px 16px;
  background: #fff8ea;
  border: 1px dashed #e0a83c;
  border-radius: 12px;
  padding: 14px;
}

.addr-box-title {
  font-size: 14px;
  font-weight: 700;
  color: #b03a2e;
  margin-bottom: 6px;
}

.addr-box-text {
  font-size: 15px;
  font-weight: 700;
  color: #7a3b17;
  line-height: 1.5;
}

.addr-box-btns {
  margin-top: 10px;
  display: flex;
  gap: 10px;
}

.modal-actions { margin-top: 18px; display: flex; gap: 10px; }

.modal-btn {
  flex: 1;
  height: 42px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-btn-primary { background: linear-gradient(145deg, #e74c3c, #c0392b); color: #fff; }

.modal-btn-ghost { background: #f2e6cc; color: #a8331f; }

/* ===== 分享引导（已按需求移除「点右上角三个点」浮层，样式保留兼容） ===== */

/* ===== 大转盘（后台可切换，与九宫格二选一）===== */
.wheel-wrap {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 217, 122, 0.55);
  border-radius: 20px;
  padding: 18px 14px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.wheel-stage {
  position: relative;
  width: 100%;
  max-width: 330px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
}

/* 外圈灯泡环 */
.wheel-lights {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from 0deg,
    #ffe9a8 0deg 7deg,
    rgba(192, 57, 43, 0.9) 7deg 20deg
  );
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), inset 0 0 12px rgba(0, 0, 0, 0.25);
  animation: wheelLights 6s linear infinite;
}

@keyframes wheelLights {
  to { transform: rotate(360deg); }
}

/* 旋转盘面 */
.wheel-rotator {
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: inset 0 0 0 3px rgba(212, 160, 23, 0.9), 0 0 14px rgba(0, 0, 0, 0.2);
  background: #fff6e0;
}

.wheel-rotator canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* 顶部指针 */
.wheel-pointer {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-top: 30px solid #c0392b;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.35));
  z-index: 3;
}

.wheel-pointer::after {
  content: '';
  position: absolute;
  top: -36px;
  left: -9px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffd97a, #f5b942);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* 中心抽奖按钮 */
.wheel-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 27%;
  aspect-ratio: 1 / 1;
  border: none;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffcf5c, #f39c12);
  color: #a8331f;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3), inset 0 -3px 0 rgba(0, 0, 0, 0.12);
  border: 3px solid #fff;
  font-family: inherit;
  transition: transform 0.1s ease;
}

.wheel-btn:active { transform: translate(-50%, -50%) scale(0.94); }

.wheel-btn:disabled { opacity: 0.8; }

.wheel-btn-main {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 2px;
}

.wheel-btn-sub {
  font-size: 10px;
  font-weight: 700;
  color: rgba(168, 51, 31, 0.85);
  white-space: nowrap;
}

.wheel-tip {
  margin-top: 12px;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
}

/* ===== 中奖弹窗：使用说明 / 有效期 / 详情入口 ===== */
.modal-rules {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.65;
  color: #7a6a55;
  text-align: left;
  background: #fffaf0;
  border: 1px dashed #e8cf9a;
  border-radius: 10px;
  padding: 9px 11px;
  white-space: pre-line;
}

.modal-valid {
  margin-top: 8px;
  font-size: 12px;
  color: #a8894a;
  font-weight: 600;
}

.modal-detail-link {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #c0392b;
  text-decoration: none;
}

.addr-box-tip {
  margin-top: 10px;
  font-size: 12px;
  color: #a8894a;
  text-align: center;
}

/* 多店区块在抽奖页内容区（page 已有 padding，不再加左右边距） */
.addr-box { margin: 0 0 16px; }

/* ===== 分享面板 ===== */
.share-sheet { position: fixed; inset: 0; z-index: 300; }

.share-sheet-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.72); }

.share-sheet-body {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 40px);
  max-width: 330px;
  max-height: 92vh;
  overflow-y: auto;
  background: linear-gradient(170deg, #fffdf6, #fff3d6);
  border-radius: 18px;
  border: 2px solid #f5c96b;
  padding: 16px 14px 14px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.share-sheet-title {
  font-size: 16px;
  font-weight: 800;
  color: #b03a2e;
  margin-bottom: 10px;
}

.share-poster {
  width: 100%;
  max-width: 260px;
  border-radius: 10px;
  border: 1px solid #f0d9a8;
  background: #fdf3dc;
  display: block;
  margin: 0 auto;
  min-height: 120px;
  /* 允许微信长按弹出「保存图片」菜单 */
  -webkit-touch-callout: default;
  -webkit-user-select: auto;
  user-select: auto;
}

.share-poster-tip { margin-top: 8px; font-size: 12px; color: #a8894a; }

.share-sheet-btns { margin-top: 10px; display: flex; gap: 8px; }

.share-sheet-btn {
  flex: 1;
  height: 40px;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.share-sheet-btn-save { background: linear-gradient(145deg, #ffd97a, #f5b942); color: #a8331f; }

.share-sheet-btn-link { background: #f2e6cc; color: #a8331f; }

.share-sheet-hint { margin-top: 8px; font-size: 11px; color: #999; line-height: 1.5; }

.share-sheet-done {
  margin-top: 10px;
  width: 100%;
  height: 42px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  background: linear-gradient(145deg, #e74c3c, #c0392b);
  color: #fff;
}

.share-sheet-done:disabled { opacity: .5; cursor: not-allowed; }

/* 上传按钮的状态样式：审核中（橙）/ 已通过（绿）/ 已驳回（红，可重传） */
.share-sheet-done.is-reviewing {
  background: linear-gradient(145deg, #f39c12, #e67e22);
  opacity: 1;
  cursor: progress;
}
.share-sheet-done.is-approved {
  background: linear-gradient(145deg, #27ae60, #1e8449);
  opacity: 1;
  cursor: default;
}
.share-sheet-done.is-rejected {
  background: linear-gradient(145deg, #e74c3c, #c0392b);
  opacity: 1;
}

.share-sheet-close {
  margin-top: 10px;
  border: none;
  background: transparent;
  color: #a8894a;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
}


/* ============ 中奖弹窗：生成海报按钮 ============ */
.modal-share-btn {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 14px 0;
  border: none;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
  background: linear-gradient(135deg, #ff7a45, #e1251b 58%, #b81b12);
  box-shadow: 0 6px 18px rgba(225, 37, 27, 0.3);
  cursor: pointer;
}
.modal-share-btn:active { opacity: 0.88; }

/* ============ 参与规则 + 免责（不要在抽奖前挤压视觉，保持紧凑） ============ */
.rule-note {
  margin: 0 16px 14px;
  padding: 12px 13px;
  border-radius: 12px;
  background: #fff5f3;
  border: 1px solid #f2c9c2;
}
.rule-note-head {
  font-size: 13px;
  font-weight: 700;
  color: #b8170f;
  margin-bottom: 6px;
}
.rule-note-body {
  font-size: 12.5px;
  line-height: 1.75;
  color: #6d3b33;
}
.rule-note-body b { color: #b8170f; }
.rule-more {
  margin-top: 8px;
  border-top: 1px dashed #f0cfc9;
  padding-top: 8px;
}
.rule-more summary {
  font-size: 12.5px;
  color: #2b2b2b;
  cursor: pointer;
  list-style: none;
}
.rule-more summary::-webkit-details-marker { display: none; }
.rule-more summary::after { content: ' ▾'; }
.rule-more[open] summary::after { content: ' ▴'; }
.rule-more ol {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.85;
  color: #7a5a52;
}
.rule-more li { margin-bottom: 2px; }
.rule-disclaimer {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff8e6;
  border: 1px solid #f0dcb4;
  font-size: 11.5px;
  line-height: 1.7;
  color: #7c5a1e;
}
/* 免责条款收进折叠后，与判定条目之间留一点间距 */
.rule-more .rule-disclaimer { margin-top: 10px; }
