* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: #ff6c65; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; color: #333; }
body { min-height: 100vh; }
img { max-width: 100%; display: block; user-select: none; }
button { font-family: inherit; border: 0; cursor: pointer; }
.app-shell { width: 100%; max-width: 750px; margin: 0 auto; position: relative; overflow: hidden; background: #ff6c65; min-height: 100vh; }
.page-img { width: 100%; height: auto; display: block; }
.hotspot { position: absolute; z-index: 30; border: 0; background: transparent; color: transparent; font-size: 0; }
.primary-glow-btn { position: absolute; z-index: 40; left: 50%; transform: translateX(-50%); width: 48%; height: 5.4%; border-radius: 999px; background: linear-gradient(180deg, #ffe36a 0%, #ffb229 43%, #ff7c0e 100%); box-shadow: 0 8px 0 rgba(255, 129, 11, .2), 0 0 24px rgba(255, 239, 125, .95), inset 0 5px 10px rgba(255,255,255,.78), inset 0 -7px 12px rgba(210,71,0,.12); color: #fff; text-shadow: 0 3px 2px rgba(203, 78, 0, .22); font-size: clamp(28px, 8vw, 58px); font-weight: 900; letter-spacing: 1px; }
.primary-glow-btn:active { transform: translateX(-50%) scale(.97); filter: brightness(.98); }
.welcome-btn { top: 80.1%; }
.welcome-prize-float { position: absolute; z-index: 65; right: 2.8%; top: 5.4%; width: 78px; height: 78px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 6px; color: #fff; font-size: 12px; font-weight: 900; line-height: 1.05; text-shadow: 0 2px 2px rgba(178,69,0,.22); background: radial-gradient(circle at 35% 22%, #fff7b1 0 6%, #ffd452 24%, #ff9e25 60%, #ff6f1f 100%); border: 2px solid rgba(255,255,255,.8); box-shadow: 0 8px 22px rgba(255,102,45,.34), inset 0 3px 8px rgba(255,255,255,.72); animation: prizeFloat 2.3s ease-in-out infinite; }
.welcome-prize-float .gift-dot { font-size: 23px; line-height: 1; filter: drop-shadow(0 2px 2px rgba(170,75,0,.14)); }
.welcome-prize-float:active { transform: scale(.95); }
@keyframes prizeFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.lottery-draw-btn { top: 57.5%; height: 4.8%; width: 43%; }
.lottery-draw-btn span { position: relative; z-index: 2; }
.lottery-draw-btn.is-loading { animation: btnPulse .55s ease-in-out infinite alternate; }
@keyframes btnPulse { from { filter: brightness(1); } to { filter: brightness(1.12); } }

.float-actions { position: absolute; z-index: 60; right: 0; top: 8.7%; display: flex; flex-direction: column; gap: 10px; }
.float-action { width: 48px; min-height: 72px; padding: 10px 8px; border-radius: 16px 0 0 16px; background: rgba(255,255,255,.76); box-shadow: 0 6px 16px rgba(255, 68, 71, .16); color: #47313a; font-size: 22px; font-weight: 700; line-height: 1.1; writing-mode: vertical-rl; letter-spacing: 2px; }
.float-action:active { transform: translateX(2px); }
.side-pill { position: absolute; z-index: 40; top: 57.75%; width: 20%; height: 3.2%; border-radius: 0 999px 999px 0; background: linear-gradient(180deg, rgba(255,223,103,.92), rgba(255,136,29,.88)); box-shadow: inset 0 2px 7px rgba(255,255,255,.75), 0 8px 18px rgba(255,126,38,.25); color: #fff; font-size: clamp(14px, 4vw, 26px); font-weight: 800; display: flex; align-items: center; justify-content: center; text-shadow: 0 2px 1px rgba(180,82,0,.2); }
.side-pill.more { right: 0; left: auto; border-radius: 999px 0 0 999px; }
.side-pill.share { left: 0; }

.machine-wrap { position: absolute; z-index: 20; top: 18.15%; left: 50%; width: 89.5%; transform: translateX(-50%); transform-origin: 50% 70%; pointer-events: none; }
.machine-base { width: 100%; position: relative; z-index: 1; }
.machine-glass { position: absolute; z-index: 7; left: 7.1%; top: 0.3%; width: 82.2%; pointer-events: none; opacity: .86; mix-blend-mode: screen; }
.machine-wrap.shaking { animation: machineShake 1.4s ease-in-out both; }
@keyframes machineShake { 0% { transform: translateX(-50%) rotate(0); } 10% { transform: translateX(-50%) rotate(-1.6deg); } 20% { transform: translateX(-50%) rotate(1.8deg); } 32% { transform: translateX(-50%) rotate(-1.5deg); } 46% { transform: translateX(-50%) rotate(1.4deg); } 62% { transform: translateX(-50%) rotate(-.9deg); } 76% { transform: translateX(-50%) rotate(.7deg); } 100% { transform: translateX(-50%) rotate(0); } }
.ball-layer { position: absolute; z-index: 4; left: 14%; top: 26%; width: 72%; height: 38%; pointer-events: none; overflow: hidden; border-radius: 42% 42% 46% 46%; }
.float-ball { position: absolute; width: 24%; animation: floatBall 3.8s ease-in-out infinite; filter: drop-shadow(0 8px 9px rgba(255,146,99,.15)); }
.float-ball.b1 { left: 7%; top: 20%; animation-delay: -.3s; }
.float-ball.b2 { left: 28%; top: 3%; width: 22%; animation-delay: -1.2s; }
.float-ball.b3 { left: 49%; top: 18%; width: 23%; animation-delay: -2.2s; }
.float-ball.b4 { left: 67%; top: 28%; width: 22%; animation-delay: -1.7s; }
.float-ball.b5 { left: 36%; top: 38%; width: 22%; animation-delay: -.8s; }
.float-ball.b6 { left: 15%; top: 43%; width: 20%; animation-delay: -2.6s; }
.shaking .float-ball { animation-name: shakeBall; animation-duration: .34s; animation-iteration-count: infinite; }
@keyframes floatBall { 0%,100% { transform: translate3d(0,0,0) rotate(-2deg); } 50% { transform: translate3d(4px,-12px,0) rotate(4deg); } }
@keyframes shakeBall { 0% { transform: translate(0,0) rotate(0deg); } 25% { transform: translate(7px,-8px) rotate(7deg); } 50% { transform: translate(-8px,5px) rotate(-6deg); } 75% { transform: translate(6px,8px) rotate(5deg); } 100% { transform: translate(0,0) rotate(0); } }
.hand { position: absolute; z-index: 45; width: 17%; left: 62%; top: 57.55%; pointer-events: none; animation: handTap 1.4s ease-in-out infinite; }
@keyframes handTap { 0%,100% { transform: translate(0,0) rotate(0); } 50% { transform: translate(-5px,-8px) rotate(-4deg); } }

.prize-grid { position: absolute; z-index: 35; left: 9.8%; top: 72.7%; width: 80.5%; display: grid; grid-template-columns: repeat(4, 1fr); row-gap: 4.4%; column-gap: 4%; }
.prize-item { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; min-height: 176px; background: transparent; border: none; padding: 0 2px; color: #222; }
.prize-item img { width: 84%; max-width: 112px; margin: 0 auto 7px; filter: drop-shadow(0 8px 8px rgba(248,131,112,.14)); transition: transform .2s ease; }
.prize-item:active img { transform: scale(.95); }
.prize-label { white-space: pre-line; text-align: center; font-size: clamp(10px, 2.5vw, 17px); font-weight: 600; line-height: 1.22; color: #373133; }

.modal-mask { position: fixed; z-index: 999; inset: 0; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(81, 33, 37, .52); backdrop-filter: blur(2px); }
.modal-mask.show { display: flex; }
.modal-card { position: relative; width: min(90vw, 420px); border-radius: 28px; padding: 28px 22px 22px; background: linear-gradient(180deg, #fffaf3 0%, #fff 72%, #fff1e8 100%); box-shadow: 0 24px 70px rgba(91,33,34,.32); text-align: center; animation: popIn .22s ease both; }
@keyframes popIn { from { transform: translateY(12px) scale(.94); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
.modal-title { margin: 2px 0 8px; color: #fa4a46; font-size: 26px; font-weight: 900; }
.modal-subtitle { color: #80524c; font-size: 15px; line-height: 1.55; margin: 0 auto 14px; }
.modal-img { max-height: 180px; object-fit: contain; margin: 0 auto 10px; }
.modal-prize-name { font-size: 20px; line-height: 1.35; color: #292323; font-weight: 800; margin: 8px 0 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 8px; }
.modal-btn { min-width: 114px; border-radius: 999px; padding: 12px 18px; background: linear-gradient(180deg, #ffe36a, #ff8b1c); color: #fff; font-weight: 900; font-size: 16px; box-shadow: 0 8px 18px rgba(255, 119, 22, .25), inset 0 2px 6px rgba(255,255,255,.55); }
.modal-btn.secondary { background: #fff1e4; color: #c76b34; box-shadow: none; }
.close-x { position: absolute; right: 16px; top: 12px; width: 36px; height: 36px; border-radius: 50%; background: transparent; color: #b88072; font-size: 28px; line-height: 36px; }
.rule-text { max-height: 62vh; overflow: auto; text-align: left; color: #5b443e; font-size: 15px; line-height: 1.65; padding: 0 4px; }
.rule-text h3 { text-align: center; margin-top: 0; color: #fa4a46; }
.rule-text p { margin: 0 0 9px; }
.toast { position: fixed; z-index: 1200; left: 50%; bottom: 8%; transform: translateX(-50%); background: rgba(0,0,0,.72); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, -8px); }

.dev-tip { position: fixed; z-index: 2000; inset: 0; background: linear-gradient(180deg,#fff7ee,#ffe1d9); display: none; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.dev-tip.show { display: flex; }
.dev-tip .card { background: #fff; border-radius: 24px; padding: 28px 22px; box-shadow: 0 18px 54px rgba(188,70,50,.18); max-width: 420px; }
.dev-tip h2 { margin: 0 0 10px; color: #f44743; }
.dev-tip p { margin: 0 0 12px; line-height: 1.6; color: #5b443e; }
.dev-tip small { display: block; margin-top: 12px; color: #999; word-break: break-all; }

.form-page { min-height: 100vh; padding: 28px 18px 70px; background: linear-gradient(180deg,#ff4752,#ff8b66 44%, #ffd6c2); }
.form-card { max-width: 540px; margin: 0 auto; background: rgba(255,255,255,.94); border-radius: 26px; padding: 24px 18px; box-shadow: 0 20px 70px rgba(123,34,35,.18); }
.form-title { margin: 0 0 6px; font-size: 24px; text-align: center; color: #f44743; font-weight: 900; }
.form-desc { text-align: center; color: #80524c; font-size: 14px; line-height: 1.5; margin-bottom: 20px; }
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 7px; color: #6e4641; font-size: 14px; font-weight: 700; }
.field input, .field textarea { width: 100%; border: 1px solid #ffe0d2; border-radius: 14px; padding: 13px 14px; font: inherit; outline: none; background: #fffaf7; color: #333; }
.field textarea { min-height: 86px; resize: vertical; }
.submit-btn { width: 100%; margin-top: 8px; border-radius: 999px; padding: 14px 18px; background: linear-gradient(180deg, #ffe36a, #ff8b1c); color: #fff; font-weight: 900; font-size: 20px; box-shadow: 0 12px 28px rgba(255, 119, 22, .25), inset 0 2px 6px rgba(255,255,255,.55); }
.my-prize-result { text-align: center; padding: 22px 8px 8px; }
.my-prize-result img { max-height: 190px; object-fit: contain; margin: 0 auto 14px; }
.status-pill { display: inline-flex; align-items: center; justify-content: center; padding: 9px 14px; border-radius: 999px; background: #fff1e4; color: #c76b34; font-size: 15px; font-weight: 700; }
@media (max-width: 390px) {
  .welcome-prize-float { width: 68px; height: 68px; font-size: 11px; }
  .welcome-prize-float .gift-dot { font-size: 20px; }
  .float-action { width: 42px; min-height: 66px; font-size: 19px; }
  .prize-label { font-size: 10px; }
  .modal-title { font-size: 23px; }
}

/* ===== V3 页面优化 ===== */
/* 欢迎页：左上角轻量“我的奖品”，不再使用大圆形悬浮球 */
.welcome-prize-float {
  left: 3.2%; right: auto; top: 3.6%;
  width: auto; height: 30px; min-width: 72px;
  border-radius: 999px; padding: 0 12px;
  display: inline-flex; flex-direction: row; align-items: center; justify-content: center;
  color: #b76432; font-size: 12px; font-weight: 800; line-height: 1;
  text-shadow: none;
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(255,255,255,.92);
  box-shadow: 0 4px 12px rgba(173,73,48,.12);
  animation: none;
}
.welcome-prize-float:active { transform: scale(.96); background: rgba(255,255,255,.95); }
.welcome-prize-float .gift-dot { display: none; }

/* “填写问卷”文字缩小一档，按钮尺寸保持 */
.welcome-btn { font-size: clamp(20px, 6vw, 42px); }

/* 抽奖页右上角规则/奖励入口整体约缩小 40% */
.float-actions { gap: 6px; top: 8.9%; }
.float-action {
  width: 30px; min-height: 44px; padding: 6px 4px;
  border-radius: 10px 0 0 10px;
  font-size: 13px; line-height: 1.05; letter-spacing: 1px;
  box-shadow: 0 4px 10px rgba(255, 68, 71, .12);
}

/* 奖品列表：两排完整落在底板内，球和文字均缩小 */
.prize-grid {
  left: 8.8%; top: 72.7%; width: 82.4%;
  row-gap: 8px; column-gap: 3%;
  align-items: start;
}
.prize-item {
  min-height: 126px;
  padding: 0 1px;
}
.prize-item img {
  width: 68%; max-width: 86px;
  margin: 0 auto 5px;
  filter: drop-shadow(0 5px 6px rgba(248,131,112,.12));
}
.prize-label {
  font-size: clamp(8.5px, 2.05vw, 13px);
  line-height: 1.18;
  font-weight: 600;
  letter-spacing: -.15px;
}

/* 弹窗补充 */
.my-prize-modal .modal-img,
.draw-result-card .modal-img { max-height: 170px; }
.prize-status-note { margin-top: 14px; margin-bottom: 2px; }
.empty-prize-icon { font-size: 48px; line-height: 1; margin: 4px 0 14px; }
.qr-modal { padding-top: 32px; }
.qr-img {
  width: min(62vw, 250px); aspect-ratio: 1 / 1; object-fit: contain;
  margin: 12px auto 10px; border-radius: 14px;
  background: #fff; padding: 7px;
  box-shadow: 0 8px 24px rgba(91,33,34,.10);
  user-select: auto; -webkit-user-select: auto;
}
.qr-tip { margin: 4px 0 2px; color: #8d635a; font-size: 13px; }
.share-guide-icon {
  width: 58px; height: 38px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  margin: 2px auto 14px; background: #fff0e7; color: #e97436;
  font-size: 26px; font-weight: 900; letter-spacing: 4px; padding-left: 4px;
}

@media (max-width: 390px) {
  .welcome-prize-float { min-width: 68px; height: 28px; padding: 0 10px; font-size: 11px; }
  .float-action { width: 29px; min-height: 42px; font-size: 12px; }
  .prize-item { min-height: 122px; }
  .prize-label { font-size: 8.5px; }
  .modal-title { font-size: 22px; }
}
