/* 抖音商城模拟器（复刻） */
* {
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  background: #fafafa;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #17171c;
}

[hidden] {
  display: none !important;
}

img {
  display: block;
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
  font-family: inherit;
  color: inherit;
  line-height: 1.4;
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

/* ---------- 外层 ---------- */
.mall-simulator {
  position: relative;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background: #fff;
  color: #17171c;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

/* ---------- 设置页 ---------- */
.setup-page {
  min-height: 100vh;
  box-sizing: border-box;
  padding: 0 20px 28px;
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
  background: linear-gradient(160deg, #fff0f5 0, #f6f7fb 250px);
}

.setup-nav {
  display: flex;
  align-items: center;
  height: 62px;
  padding-top: env(safe-area-inset-top);
  font-size: 17px;
  font-weight: 600;
}

.back-button {
  width: 36px;
  height: 44px;
  flex: 0 0 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  text-decoration: none;
}

.setup-nav .back-button {
  margin-left: -14px;
  margin-right: 7px;
}

.back-chevron {
  width: 12px;
  height: 12px;
  border-left: 2px solid #17171c;
  border-bottom: 2px solid #17171c;
  transform: rotate(45deg);
}

.setup-heading {
  margin: 14px 0 10px;
  font-size: 26px;
  font-weight: 700;
}

.setup-description {
  color: #85838f;
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 22px;
}

.preview-card {
  background: #fff;
  padding: 16px;
  border-radius: 18px;
  box-shadow: 0 6px 24px rgba(67, 34, 64, .024);
}

.preview-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 15px;
  font-weight: 600;
}

.preview-tag {
  padding: 5px 8px;
  border-radius: 5px;
  background: #fff1f5;
  color: #ec2860;
  font-size: 11px;
  font-weight: 400;
}

.preview-window {
  position: relative;
  height: 270px;
  overflow: hidden;
  background: #f7f7f7;
  border: 1px solid #f0f0f0;
  border-radius: 10px;
  cursor: pointer;
}

.home-preview {
  display: block;
  width: 100%;
}

.preview-action {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: 11px;
  font-size: 12px;
  color: #fff;
  background: rgba(26, 20, 40, .565);
}

.upload-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.upload-button,
.reset-button {
  flex: 1;
  padding: 11px 0;
  font-size: 13px;
  border-radius: 8px;
}

.upload-button {
  background: #fff0f5;
  color: #ed1f58;
  font-weight: 600;
}

.reset-button {
  background: #f5f5f7;
  color: #686775;
}

.reset-button:disabled {
  opacity: .45;
}

.upload-hint,
.storage-hint {
  font-size: 11px;
  color: #9995a1;
  line-height: 1.7;
  margin-top: 10px;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.storage-hint {
  color: #b4657b;
}

.flow-description {
  margin: 24px 2px;
  color: #736c7b;
  font-size: 12px;
  line-height: 1.8;
}

.flow-title {
  font-size: 14px;
  color: #292331;
  font-weight: 600;
  margin-bottom: 7px;
}

.flow-note {
  margin-top: 6px;
  color: #99909d;
}

.start-button {
  display: block;
  width: 100%;
  color: #fff;
  background: linear-gradient(105deg, #ff782b, #ff0054 65%, #fc0081);
  border-radius: 12px;
  font-size: 17px;
  font-weight: 600;
  padding: 14px;
  box-shadow: 0 7px 17px rgba(255, 0, 84, .125);
}

/* ---------- 商城首页 ---------- */
.home-page {
  position: relative;
  min-height: 100vh;
  cursor: pointer;
}

.home-image,
.results-products {
  display: block;
  width: 100%;
}

/* ---------- 搜索 / 搜索结果 ---------- */
.search-page {
  min-height: 100vh;
  background: linear-gradient(120deg, #fff6f6 0, #fdf7fe 90px, #fff 160px);
}

.search-page.has-results {
  background: #f5f6f8;
}

.search-header {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 12px 9px 9px 3px;
  padding-top: calc(12px + env(safe-area-inset-top));
  background: linear-gradient(105deg, #fff5f4, #fff8fe);
}

.search-box {
  flex: 1;
  display: flex;
  align-items: center;
  height: 40px;
  padding: 2px 2px 2px 12px;
  border: 1.3px solid #e77999;
  border-radius: 28px;
  background: #fff;
  min-width: 0;
  box-sizing: border-box;
}

.search-icon {
  width: 15px;
  height: 15px;
  border: 1.6px solid #19191f;
  border-radius: 50%;
  position: relative;
  margin-right: 8px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.search-icon:after {
  content: "";
  position: absolute;
  width: 6px;
  height: 1.6px;
  background: #19191f;
  right: -4px;
  bottom: -2px;
  transform: rotate(48deg);
}

.keyword-input {
  flex: 1;
  min-width: 0;
  height: 34px;
  font-size: 16px;
  color: #19191f;
  border: 0;
  outline: none;
  background: transparent;
  padding: 0;
  font-family: inherit;
}

.keyword-input::placeholder {
  color: #999;
}

.clear-button {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #bfbfbf;
  color: #fff;
  font-size: 20px;
  line-height: 17px;
  margin: 0 10px 0 3px;
}

.search-button {
  flex: 0 0 62px;
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  border-radius: 24px;
  background: linear-gradient(125deg, #ff842f, #ff0051 50%);
  height: 34px;
  line-height: 34px;
}

.result-search-button {
  background: transparent;
  color: #17171c;
  border-left: 1px solid #e9e9e9;
  border-radius: 0;
  height: 24px;
  line-height: 24px;
  flex-basis: 54px;
}

.camera-icon {
  width: 17px;
  height: 14px;
  border: 1.5px solid #aaa;
  border-radius: 4px;
  position: relative;
  margin: 0 13px 0 5px;
}

.camera-icon:before {
  content: "";
  position: absolute;
  width: 7px;
  height: 3px;
  border: 1.5px solid #aaa;
  border-bottom: 0;
  top: -5px;
  left: 3px;
  border-radius: 3px 3px 0 0;
}

.camera-icon span {
  display: block;
  width: 6px;
  height: 6px;
  border: 1.5px solid #aaa;
  border-radius: 50%;
  margin: 2.5px auto;
}

.lottery-entry {
  display: flex;
  align-items: center;
  padding: 13px 12px;
  gap: 10px;
  background: #fff;
  border-radius: 19px;
  margin: 0 4px 5px;
}

.lottery-icon {
  width: 57px;
  height: 57px;
  flex: 0 0 57px;
  border-radius: 9px;
  object-fit: cover;
}

.lottery-entry-copy {
  flex: 1;
  min-width: 0;
}

.lottery-entry-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  white-space: nowrap;
}

.lottery-entry-subtitle {
  font-size: clamp(10px, 3.05vw, 14px);
  color: #777;
  white-space: nowrap;
}

.lottery-entry-button {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(115deg, #ff8e2f, #ff0056 55%);
  border-radius: 25px;
  padding: 6px 15px;
  flex-shrink: 0;
}

.result-filters {
  background: #fff;
  padding: 13px 9px 9px;
  border-radius: 18px 18px 0 0;
}

.filter-tabs {
  display: flex;
  justify-content: space-between;
  padding: 0 4px 12px;
  font-size: 17px;
  color: #777;
}

.filter-tabs .selected {
  color: #15151b;
}

.filter-tabs .highlight {
  color: #e60049;
  font-weight: 600;
}

.filter-tags {
  display: flex;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
}

.filter-tags span {
  flex-shrink: 0;
  padding: 9px 12px;
  border: 1px solid #f0f0f2;
  background: #f8f8fa;
  border-radius: 24px;
  color: #606065;
  font-size: 14px;
}

.coupon-banner {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 4px;
  padding: 7px 8px;
  background: #fff0f5;
  font-size: 12px;
  white-space: nowrap;
}

.coupon-logo {
  background: linear-gradient(90deg, #fb407d, #db68d9);
  color: #fff;
  border-radius: 2px;
  font-size: 10px;
  font-style: italic;
  padding: 3px;
  font-weight: 600;
}

.coupon-value {
  color: #ed0050;
  font-weight: 600;
}

.coupon-action {
  margin-left: auto;
  background: linear-gradient(120deg, #ff8b25, #f05 60%);
  border-radius: 20px;
  padding: 7px 9px;
  color: #fff;
}

@media (max-width: 350px) {
  .lottery-entry {
    gap: 7px;
    padding: 12px 9px;
  }

  .lottery-entry-button {
    padding: 6px 10px;
    font-size: 12px;
  }

  .lottery-icon {
    width: 50px;
    height: 50px;
    flex-basis: 50px;
  }

  .coupon-banner {
    font-size: 10px;
    gap: 3px;
  }

  .coupon-action {
    padding: 7px 6px;
  }
}

/* ---------- 抽奖页 ---------- */
.mall-lottery {
  --u: min(1vw, 4.8px);
  --spin-duration: 6200ms;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  overflow: hidden;
  color: #17171d;
  background: #fff;
  background-image:
    radial-gradient(ellipse at 15% 0%, #fffde4 0%, transparent 48%),
    radial-gradient(ellipse at 95% 0%, #ffe6f5 0%, transparent 55%),
    linear-gradient(#fff 65%, #fce7e9);
  background-size: 100% calc(var(--u) * 103);
  background-repeat: no-repeat;
}

.mall-lottery button:disabled {
  color: inherit;
}

.draw-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .64);
  -webkit-backdrop-filter: blur(2.5px);
  backdrop-filter: blur(2.5px);
  animation: draw-focus-in 0.55s ease-out both;
}

.is-spinning,
.is-reward-open {
  touch-action: none;
}

.lottery-header,
.wheel-stage {
  transition: filter .35s ease;
}

.is-spinning .lottery-header,
.is-spinning .wheel-stage {
  position: relative;
  z-index: 41;
}

.lottery-header .icon-button,
.side-action,
.draw-button {
  transition: opacity .35s ease, filter .35s ease;
}

.is-spinning .lottery-header .icon-button,
.is-spinning .side-action {
  opacity: .12;
  filter: blur(1px);
  pointer-events: none;
}

.is-spinning .draw-button {
  opacity: 0;
  filter: blur(1px);
  pointer-events: none;
  transition-delay: .35s;
}

.is-reward-open .lottery-header,
.is-reward-open .wheel-stage,
.is-reward-open .my-prizes,
.is-reward-open .lottery-recommendations {
  filter: blur(2.5px);
  pointer-events: none;
}

@keyframes draw-focus-in {
  0% {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@media (min-width: 480px) {
  .mall-lottery {
    --u: 4.8px;
  }
}

.lottery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--u) * 2.5 + env(safe-area-inset-top)) calc(var(--u) * 2) calc(var(--u) * 2);
}

.icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 calc(var(--u) * 10);
  height: calc(var(--u) * 9);
}

.lottery-header .back-chevron {
  width: calc(var(--u) * 2.8);
  height: calc(var(--u) * 2.8);
  border: 2px solid #202126;
  border-top: 0;
  border-right: 0;
  transform: rotate(45deg);
}

.lottery-title-image {
  display: block;
  width: 62%;
  height: calc(var(--u) * 8.5);
  object-fit: contain;
}

.more-button {
  font-size: calc(var(--u) * 4);
  letter-spacing: 2px;
}

.wheel-stage {
  position: relative;
  padding-bottom: calc(var(--u) * 3);
}

.wheel-rim {
  position: relative;
  width: 83.03%;
  padding-top: 83.03%;
  margin: 0 auto;
}

.wheel-disc {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.wheel-disc.spinning {
  transition: transform var(--spin-duration) cubic-bezier(.18, .04, .18, 1);
}

.wheel-centre {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18%;
  height: 21.31%;
  transform: translate(-50%, -59.05%);
  overflow: visible;
  z-index: 2;
}

.wheel-centre img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.draw-actions {
  position: relative;
  z-index: 3;
  height: calc(var(--u) * 16.97);
  margin-top: calc(var(--u) * -16.67);
}

.side-action {
  position: absolute;
  bottom: calc(var(--u) * .3);
  width: 18.03%;
  height: calc(var(--u) * 15.91);
  overflow: visible;
}

.video-action {
  left: 2.575%;
}

.task-action {
  right: 1.82%;
  width: 17.88%;
}

.side-action-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  clip-path: polygon(0 68%, 12% 68%, 12% 50%, 15% 36%, 25% 21%, 39% 9%, 48% 3%, 57% 3%, 69% 10%, 80% 24%, 85% 41%, 86% 68%, 100% 68%, 100% 100%, 0 100%);
}

.task-action .side-action-art {
  clip-path: polygon(0 68%, 14% 68%, 15% 41%, 20% 24%, 31% 10%, 43% 3%, 52% 3%, 61% 9%, 75% 21%, 85% 36%, 88% 50%, 88% 68%, 100% 68%, 100% 100%, 0 100%);
}

.draw-button {
  position: absolute;
  left: 21.97%;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--u) * 1.4);
  width: 56.06%;
  height: 100%;
  color: #fff !important;
  background:
    radial-gradient(ellipse at 14% 0%, #ffab24, transparent 53%),
    radial-gradient(ellipse at 4% 100%, #ffa72e, transparent 42%),
    radial-gradient(ellipse at 100% 100%, #ff729c, transparent 48%),
    linear-gradient(120deg, #ff5630, #ff0051 60%, #ff1281) !important;
  border-radius: calc(var(--u) * 10);
  box-shadow: inset 0 -1px 2px rgba(236, 126, 91, .333);
}

.draw-label {
  font-size: calc(var(--u) * 6);
  font-weight: 950;
  transform: skew(-5deg);
  text-shadow: 0 1px 1px rgba(215, 44, 51, .1254901961);
}

.draw-count {
  font-size: calc(var(--u) * 3.6);
  font-weight: 500;
}

.draw-button.exhausted {
  background: linear-gradient(135deg, #ffa358, #f85b86) !important;
}

.draw-button.exhausted .draw-label {
  font-size: calc(var(--u) * 4.2);
}

.winner-bubble {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 1.3);
  position: absolute;
  z-index: 3;
  left: 2%;
  top: 62%;
  padding: calc(var(--u) * 1.5) calc(var(--u) * 3) calc(var(--u) * 1.5) calc(var(--u) * 1);
  background: linear-gradient(100deg, #fff0f7, #fffed5);
  border: 1px solid #fff;
  border-radius: calc(var(--u) * 7);
  box-shadow: 0 2px 10px rgba(237, 213, 164, .333);
}

.winner-avatar {
  width: calc(var(--u) * 6.5);
  height: calc(var(--u) * 6.5);
  line-height: calc(var(--u) * 6.5);
  border-radius: 50%;
  text-align: center;
  background: #ef4f88;
  color: #fff8be;
  font-size: calc(var(--u) * 4);
  flex-shrink: 0;
}

.winner-note,
.winner-amount {
  display: block;
  font-size: calc(var(--u) * 2.4);
}

.winner-amount {
  margin-top: 2px;
  color: #e60a56;
  font-weight: 700;
}

.my-prizes {
  position: relative;
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 3);
  padding: calc(var(--u) * 3) 0 calc(var(--u) * 2.5) calc(var(--u) * 4.2);
  border-radius: calc(var(--u) * 5.2) calc(var(--u) * 5.2) 0 0;
  background: #fff;
}

.my-prizes-label {
  flex-shrink: 0;
  font-size: calc(var(--u) * 3.7);
  line-height: 1.15;
  font-weight: 800;
}

.prize-scroll {
  flex: 1;
  min-width: 0;
  width: 0;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.prize-scroll::-webkit-scrollbar {
  display: none;
}

.prize-row {
  display: flex;
  gap: calc(var(--u) * 1.1);
  width: max-content;
  padding-right: calc(var(--u) * 4);
}

.coupon-prize,
.cash-summary {
  box-sizing: border-box;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  height: calc(var(--u) * 14.85);
  border: 1px solid #e5e5e5;
  border-radius: calc(var(--u) * 3.3);
}

.coupon-prize {
  width: calc(var(--u) * 58.86);
  padding: 0 calc(var(--u) * 3);
  gap: calc(var(--u) * 2.8);
  background: #fff;
}

.coupon-amount {
  color: #f0074b;
  font-size: calc(var(--u) * 3.1);
}

.coupon-amount > div {
  display: flex;
  align-items: baseline;
  font-weight: 700;
}

.coupon-amount > div > span {
  font-size: calc(var(--u) * 4.8);
}

.coupon-caption {
  display: block;
  margin-top: calc(var(--u) * 1.2);
  font-size: calc(var(--u) * 2.7);
}

.coupon-copy {
  flex: 1;
  font-size: calc(var(--u) * 2.8);
  font-weight: 600;
}

.coupon-expiry {
  display: block;
  margin-top: calc(var(--u) * 1.6);
  color: #b2b2b2;
  font-size: calc(var(--u) * 2.6);
  font-weight: 400;
}

.coupon-detail {
  flex-shrink: 0;
  padding: calc(var(--u) * 1.6) calc(var(--u) * 2) !important;
  border: 1px solid #e592a5 !important;
  border-radius: calc(var(--u) * 5);
  color: #e9154e !important;
  font-size: calc(var(--u) * 3.2);
  font-weight: 600;
  line-height: 1.2;
}

.prize-scroll-hint {
  position: absolute;
  right: 0;
  top: calc(var(--u) * 3);
  bottom: calc(var(--u) * 2.5);
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(var(--u) * 7);
  color: #aaa;
  font-size: calc(var(--u) * 7);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff 85%);
  pointer-events: none;
}

.cash-summary {
  width: calc(var(--u) * 64);
  gap: calc(var(--u) * 2.5);
  background: #f3faff;
  border-color: #dbeaf3;
  padding: 0 calc(var(--u) * 2.8);
}

.cash-balance {
  flex-shrink: 0;
  color: #161e28;
}

.cash-number {
  font-size: calc(var(--u) * 4.8);
  font-weight: 750;
  letter-spacing: -.5px;
}

.cash-unit {
  font-size: calc(var(--u) * 3);
}

.cash-caption {
  display: block;
  margin-top: calc(var(--u) * 1);
  text-align: center;
  font-size: calc(var(--u) * 2.8);
  color: #92979f;
}

.cash-description {
  min-width: 0;
  flex: 1;
  font-size: calc(var(--u) * 3.1);
  white-space: nowrap;
}

.alipay-icon {
  display: inline-flex;
  width: calc(var(--u) * 4);
  height: calc(var(--u) * 4);
  align-items: center;
  justify-content: center;
  margin-right: 3px;
  background: #20abed;
  border-radius: 50%;
  color: #fff;
  font-size: calc(var(--u) * 3);
}

.cash-subtitle {
  display: block;
  margin-top: calc(var(--u) * 1);
  color: #9499a0;
  font-size: calc(var(--u) * 2.8);
}

.cash-detail {
  flex-shrink: 0;
  padding: calc(var(--u) * 1.5) calc(var(--u) * 2.8) !important;
  color: #1b9fdb !important;
  border: 1px solid #5eb9e1 !important;
  border-radius: calc(var(--u) * 5);
  font-size: calc(var(--u) * 3.6);
  font-weight: 700;
  line-height: 1.2;
}

.lottery-recommendations {
  padding-top: calc(var(--u) * 1);
  background: #fff;
}

.recommend-search {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 1.5);
  height: calc(var(--u) * 9.39);
  box-sizing: border-box;
  margin: 0 calc(var(--u) * 3.18);
  padding: 0 calc(var(--u) * 3.5);
  border: 1px solid #e87c9c;
  border-radius: calc(var(--u) * 7);
  font-size: calc(var(--u) * 3.8);
  white-space: nowrap;
}

.recommend-keyword {
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recommend-search .search-reward-tag {
  flex-shrink: 0;
  color: #d91347;
  background: #fff0f3;
  border: 1px solid #f3d8df;
  border-radius: 2px;
  padding: 1px 2px;
  font-size: calc(var(--u) * 2.5);
}

.recommend-search .search-icon {
  flex-shrink: 0;
  width: calc(var(--u) * 3.7);
  height: calc(var(--u) * 3.7);
  margin-right: calc(var(--u) * .7);
  border: 1.5px solid #29272f;
  border-radius: 50%;
  position: relative;
  box-sizing: content-box;
}

.recommend-search .search-icon:after {
  content: "";
  width: calc(var(--u) * 1.8);
  height: 2px;
  position: absolute;
  bottom: -2px;
  right: -4px;
  transform: rotate(50deg);
  background: #29272f;
}

.search-word {
  margin-left: auto;
  padding-left: calc(var(--u) * 3);
  font-weight: 700;
}

.recommend-tabs {
  display: flex;
  gap: calc(var(--u) * 5.4);
  padding: calc(var(--u) * 4) calc(var(--u) * 4) calc(var(--u) * 3.2);
  font-size: calc(var(--u) * 3.7);
  color: #67676c;
  white-space: nowrap;
  overflow: hidden;
}

.recommend-tabs > span {
  flex-shrink: 0;
}

.recommend-tab.active {
  position: relative;
  font-weight: 700;
  color: #25232a;
}

.recommend-tab.active:after {
  content: "";
  position: absolute;
  bottom: calc(var(--u) * -1.7);
  left: 25%;
  width: 50%;
  height: 3px;
  border-radius: 2px;
  background: #ff2d60;
}

/* ---------- 中奖弹窗 ---------- */
.reward-overlay {
  --ru: min(1vw, 4.8px);
  --card-blue: #39c1f7;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
  background: rgba(255, 255, 255, .87);
  color: #17191d;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  overscroll-behavior: none;
  touch-action: none;
  outline: none;
  transition: background-color .25s ease;
}

.reward-overlay button {
  margin: 0;
  padding: 0;
  border: 0;
  line-height: 1.2;
  background: transparent;
  font-family: inherit;
}

.phase-result {
  background: linear-gradient(rgba(255, 255, 255, .84), rgba(255, 255, 255, .97) 43%, #fff 68%);
}

.is-redpacket {
  --card-blue: #ff4381;
}

.reward-reveal {
  position: absolute;
  top: clamp(28px, 10vh, 112px);
  width: calc(var(--ru) * 88);
  max-width: 380px;
  height: calc(var(--ru) * 91);
}

.golden-glow {
  position: absolute;
  top: -5%;
  right: -12%;
  bottom: 8%;
  left: -12%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center 42%, #fff9b9 0%, rgba(255, 244, 144, .66) 24%, rgba(255, 249, 188, .24) 48%, transparent 68%);
  animation: glow-appear 1.3s ease-out both;
}

.golden-rays {
  position: absolute;
  top: -8%;
  left: 0;
  width: 100%;
  height: 95%;
  border-radius: 50%;
  background: repeating-conic-gradient(from 10deg, rgba(255, 224, 88, .32) 0deg 13deg, transparent 13deg 30deg);
  -webkit-mask-image: radial-gradient(ellipse, #000 5%, rgba(0, 0, 0, .8) 25%, transparent 65%);
  mask-image: radial-gradient(ellipse, #000 5%, rgba(0, 0, 0, .8) 25%, transparent 65%);
  animation: rays-appear 1.3s ease-out both;
}

.reward-card {
  box-sizing: border-box;
  border: calc(var(--ru) * .55) solid #70c8ed;
  border-radius: calc(var(--ru) * 4.5);
  background: linear-gradient(115deg, #fff, #fff 65%, #f3fdff);
  overflow: hidden;
}

.floating-card {
  position: absolute;
  top: 18%;
  left: 50%;
  width: calc(var(--ru) * 29);
  height: calc(var(--ru) * 33);
  box-shadow: 0 calc(var(--ru) * 2.5) calc(var(--ru) * 5) rgba(92, 178, 237, .2);
  transform-origin: center bottom;
  animation: prize-lift 1.3s cubic-bezier(.18, .72, .3, 1) both;
}

.floating-card .reward-value {
  padding-top: calc(var(--ru) * 3);
}

.floating-card .reward-number {
  font-size: calc(var(--ru) * 12);
  font-style: italic;
}

.floating-card .reward-currency {
  margin-left: calc(var(--ru) * .6);
  font-size: calc(var(--ru) * 4.6);
}

.floating-card .reward-card-band {
  height: 34%;
  font-size: calc(var(--ru) * 4.6);
  gap: calc(var(--ru) * 1.4);
}

.reward-value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  white-space: nowrap;
}

.reward-number {
  font-weight: 950;
  line-height: 1.1;
  letter-spacing: -2px;
}

.reward-currency {
  font-weight: 650;
}

.reward-card-band {
  position: absolute;
  bottom: 0;
  left: -1%;
  width: 102%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50% 42% 0 0 / 14% 10% 0 0;
  background: linear-gradient(115deg, #35befb, #51c4f9 60%, #47b5f3);
  color: #fff;
  white-space: nowrap;
}

.payment-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  padding: 1px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: .8em;
  line-height: 1;
  box-sizing: content-box;
}

.is-redpacket .reward-card {
  border-color: #ff80ab;
  background: linear-gradient(115deg, #fff, #fff9ee 75%, #fff6df);
}

.is-redpacket .reward-card-band {
  background: linear-gradient(115deg, #ff9a43, #ff3573 45%, #ff2e9e);
}

.is-redpacket .floating-card .reward-value {
  color: #f61761;
}

.is-redpacket .floating-card {
  box-shadow: 0 calc(var(--ru) * 2.5) calc(var(--ru) * 5) rgba(255, 126, 170, .2);
}

.reveal-stars {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.reward-star {
  position: absolute;
  font-size: calc(var(--ru) * 4.2);
  animation: star-pop 1.3s ease-out both;
}

.star-1 {
  top: 39%;
  left: 13%;
  color: #f6a6bf;
}

.star-2 {
  top: 27%;
  right: 13%;
  color: #aa83e1;
  animation-delay: .07s;
}

.star-3 {
  top: 9%;
  left: 33%;
  color: #fff1a0;
  animation-delay: .12s;
  font-size: calc(var(--ru) * 3);
}

.star-4 {
  top: 53%;
  right: 24%;
  color: #82d3cf;
  animation-delay: .08s;
  font-size: calc(var(--ru) * 2.5);
}

.star-5 {
  top: 16%;
  right: 30%;
  color: #f8ce57;
  animation-delay: .02s;
}

.star-6 {
  top: 54%;
  left: 27%;
  color: #f6cc70;
  animation-delay: .15s;
  font-size: calc(var(--ru) * 2.5);
}

.star-7 {
  top: 33%;
  right: 34%;
  color: #fff;
  animation-delay: .1s;
  font-size: calc(var(--ru) * 3);
}

.mascot-glow {
  position: absolute;
  top: 70%;
  left: 24%;
  width: 54%;
  height: 19%;
  border-radius: 50%;
  background: radial-gradient(ellipse, #c5ffdb 0%, #d9ffe6 20%, rgba(248, 255, 184, .52) 42%, transparent 70%);
  filter: blur(5px);
  animation: glow-appear 1.3s ease-out both;
}

.reward-mascot {
  position: absolute;
  top: 62%;
  left: 50%;
  width: calc(var(--ru) * 22);
  height: calc(var(--ru) * 21);
  transform: translateX(-50%) rotate(-7deg);
  animation: mascot-enter 1.3s ease-out both;
}

.bag-body {
  position: absolute;
  top: 24%;
  right: 4%;
  bottom: 0;
  left: 4%;
  border-radius: 30% 30% 17% 20% / 65% 55% 11% 11%;
  background:
    radial-gradient(ellipse at 27% 28%, #ff9577, transparent 44%),
    linear-gradient(105deg, #ff6c4d, #ff1c60 58%, #eb0051);
  box-shadow: inset -5px -3px 7px rgba(198, 0, 67, .17), 3px 4px 8px rgba(232, 53, 90, .14);
  transform: perspective(100px) rotateY(-10deg);
}

.bag-handle {
  position: absolute;
  width: 45%;
  height: 37%;
  border: calc(var(--ru) * 1.5) solid #ff7047;
  border-bottom-color: transparent;
  border-radius: 50%;
  box-sizing: border-box;
}

.handle-front {
  top: 5%;
  left: 22%;
  transform: rotate(-9deg);
  box-shadow: inset 1px 1px 1px #ffe1a8;
}

.handle-back {
  top: 12%;
  right: 7%;
  transform: rotate(15deg);
  border-color: #7acffb;
  border-bottom-color: transparent;
}

.bag-eye {
  position: absolute;
  top: 26%;
  width: 22%;
  height: 31%;
  background: #fff;
  border-radius: 55% 50%;
  box-shadow: -1px 3px 2px rgba(161, 37, 49, .15);
  transform: rotate(21deg);
}

.eye-left {
  left: 21%;
}

.eye-right {
  left: 43%;
  top: 24%;
}

.eye-pupil {
  position: absolute;
  right: 10%;
  top: 5%;
  width: 55%;
  height: 70%;
  background: #22222c;
  border-radius: 50%;
}

.eye-pupil:after {
  content: "";
  position: absolute;
  top: 11%;
  left: 13%;
  width: 34%;
  height: 32%;
  background: #fff;
  border-radius: 50%;
}

.bag-tag {
  position: absolute;
  top: 49%;
  right: 0;
  width: 21%;
  height: 27%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  transform: rotate(-8deg);
  color: #fff;
  background: #25262e;
  font-size: calc(var(--ru) * 4);
  font-weight: 700;
}

.reward-result {
  position: relative;
  flex-shrink: 0;
  width: calc(var(--ru) * 89);
  max-width: 390px;
  margin-top: auto;
  margin-bottom: clamp(24px, 7.5vh, 80px);
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: result-enter .34s ease-out both;
}

.reward-close {
  --close-size: clamp(28px, calc(var(--ru) * 7.7), 36px);
  position: absolute;
  top: calc(var(--ru) * -8.5 - (44px - var(--close-size)) / 2);
  right: calc(var(--ru) * 1 - (44px - var(--close-size)) / 2);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent !important;
  outline: none;
}

.reward-close-icon {
  position: relative;
  width: var(--close-size);
  height: var(--close-size);
  border-radius: 50%;
  background: #b8b8bc;
  transition: background-color .16s ease, transform .16s ease;
}

.reward-close-icon:before,
.reward-close-icon:after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 46%;
  height: 1.5px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .95);
  transform: translate(-50%, -50%) rotate(45deg);
}

.reward-close-icon:after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.reward-close:active .reward-close-icon {
  background: #aaaab0;
  transform: scale(.96);
}

.reward-heading {
  width: 100%;
  text-align: center;
  font-size: calc(var(--ru) * 6);
  font-weight: 950;
  font-style: italic;
  white-space: nowrap;
  line-height: 1.3;
  letter-spacing: -.8px;
  animation: copy-enter .3s .09s both;
}

.heading-accent {
  display: inline;
  color: #341820;
}

.final-card-wrap {
  position: relative;
  width: calc(var(--ru) * 42.5);
  margin-top: calc(var(--ru) * 6.2);
}

.final-card {
  position: relative;
  width: 100%;
  height: calc(var(--ru) * 46);
  border-radius: calc(var(--ru) * 5);
  animation: card-enter .36s cubic-bezier(.16, .85, .35, 1) both;
}

.final-card .reward-value {
  padding-top: calc(var(--ru) * 5.5);
}

.final-card .reward-number {
  font-size: calc(var(--ru) * 15);
}

.final-card .reward-currency {
  margin-left: calc(var(--ru) * .8);
  font-size: calc(var(--ru) * 4.1);
  font-weight: 500;
}

.reward-card-caption {
  margin-top: calc(var(--ru) * 1);
  color: #343438;
  font-size: calc(var(--ru) * 3.5);
  line-height: 1.2;
  text-align: center;
}

.final-card .reward-card-band {
  height: 32%;
  gap: calc(var(--ru) * .9);
  font-size: calc(var(--ru) * 3.15);
}

.card-floor-glow {
  position: absolute;
  left: -27%;
  right: -27%;
  bottom: -5%;
  height: 20%;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(255, 206, 216, .5), transparent 45%),
    radial-gradient(ellipse at 75% 55%, rgba(159, 253, 223, .4), transparent 45%);
  filter: blur(4px);
}

.lucky-sticker {
  position: absolute;
  top: calc(var(--ru) * -1.5);
  left: calc(var(--ru) * -4);
  padding: calc(var(--ru) * .8) calc(var(--ru) * 2.5);
  border-radius: calc(var(--ru) * 2) calc(var(--ru) * 1.5) calc(var(--ru) * 2) calc(var(--ru) * .5);
  background: #fff819;
  color: #29270b;
  font-size: calc(var(--ru) * 3.25);
  font-weight: 900;
  font-style: italic;
  transform: rotate(-9deg);
  animation: sticker-enter .45s .13s both;
}

.lucky-sticker:after {
  content: "";
  position: absolute;
  left: 10%;
  bottom: -4px;
  width: 0;
  height: 0;
  border-top: 6px solid #fff819;
  border-right: 6px solid transparent;
}

.reward-confirm {
  width: calc(var(--ru) * 59);
  max-width: 280px;
  min-height: calc(var(--ru) * 13);
  margin-top: calc(var(--ru) * 7.5) !important;
  padding: calc(var(--ru) * 3) calc(var(--ru) * 4) !important;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(110deg, #ff8c1e, #ff5032 23%, #f05 64%, #ff008b) !important;
  font-size: calc(var(--ru) * 4.8);
  font-weight: 800;
  animation: copy-enter .3s .13s both;
}

.reward-confirm:active {
  filter: brightness(.96);
}

.reward-remaining {
  margin-top: calc(var(--ru) * 2.5);
  color: #aaa5a7;
  font-size: calc(var(--ru) * 2.8);
  line-height: 1.4;
  animation: copy-enter .3s .18s both;
}

@keyframes prize-lift {
  0% {
    opacity: 0;
    transform: translate(-50%, -45px) rotate(-10deg) scale(.32);
  }

  15% {
    opacity: 1;
  }

  55% {
    transform: translate(-50%, 0) rotate(13deg) scale(1.08);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -6px) rotate(10deg) scale(1);
  }
}

@keyframes glow-appear {
  0% {
    opacity: 0;
    transform: scale(.45);
  }

  45% {
    opacity: 1;
    transform: scale(1.05);
  }

  to {
    opacity: .9;
    transform: scale(1);
  }
}

@keyframes rays-appear {
  0% {
    opacity: 0;
    transform: rotate(-10deg) scale(.5);
  }

  35% {
    opacity: 1;
  }

  to {
    opacity: .7;
    transform: rotate(8deg) scale(1);
  }
}

@keyframes star-pop {
  0%,
  12% {
    opacity: 0;
    transform: scale(.2) translateY(15px);
  }

  50% {
    opacity: 1;
    transform: scale(1.15) translateY(0);
  }

  to {
    opacity: .8;
    transform: scale(1) translateY(-6px);
  }
}

@keyframes mascot-enter {
  0%,
  8% {
    opacity: 0;
    transform: translate(-50%, 20px) rotate(-7deg) scale(.85);
  }

  55%,
  to {
    opacity: 1;
    transform: translate(-50%, 0) rotate(-7deg) scale(1);
  }
}

@keyframes result-enter {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes card-enter {
  0% {
    opacity: .4;
    transform: scale(.72);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes copy-enter {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sticker-enter {
  0% {
    opacity: 0;
    transform: rotate(-12deg) scale(.7);
  }

  65% {
    opacity: 1;
    transform: rotate(-7deg) scale(1.06);
  }

  to {
    opacity: 1;
    transform: rotate(-9deg) scale(1);
  }
}

@media (max-height: 640px) and (orientation: portrait) {
  .reward-result {
    margin-bottom: max(18px, env(safe-area-inset-bottom));
  }

  .final-card-wrap {
    margin-top: calc(var(--ru) * 4.5);
  }

  .reward-confirm {
    margin-top: calc(var(--ru) * 5) !important;
  }

  .reward-reveal {
    top: 6vh;
  }
}

@media (max-height: 480px) {
  .reward-overlay {
    --ru: min(1vw, 1.08vh);
  }

  .reward-result {
    margin-top: auto;
    margin-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .reward-heading {
    font-size: max(18px, calc(var(--ru) * 6));
  }

  .reward-close {
    right: -10px;
    top: -8px;
  }

  .reward-reveal {
    top: 2vh;
  }

  .reward-remaining {
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reward-overlay {
    transition: none;
  }

  .golden-glow,
  .golden-rays,
  .floating-card,
  .reward-star,
  .mascot-glow,
  .reward-mascot,
  .reward-result,
  .reward-heading,
  .final-card,
  .lucky-sticker,
  .reward-confirm,
  .reward-remaining,
  .draw-backdrop {
    animation: none !important;
  }

  .floating-card {
    transform: translateX(-50%) rotate(10deg);
  }

  .is-spinning .wheel-disc {
    transition: none;
  }
}

/* ---------- 轻提示 ---------- */
.toast {
  position: fixed;
  z-index: 200;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 70%;
  padding: 10px 16px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .72);
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
}
