/**
 * 会销大转盘 H5 样式
 * 喜庆红金配色，移动端优先
 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #e63946;
  --accent: #f4a261;
  --gold: #ffd700;
  --bg: #fff5f0;
  --text: #2d3436;
  --text-light: #636e72;
  --border: #ffe0d0;
  --success: #00b894;
  --danger: #e63946;
}

html,
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: #fff;
  position: relative;
}

/* ---- 通用按钮 ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-block {
  width: 100%;
  margin-top: 12px;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
}

.btn-primary {
  background: linear-gradient(135deg, #e63946, #f4a261);
  color: #fff;
  box-shadow: 0 4px 12px rgba(230, 57, 70, 0.3);
}

.btn-outline {
  background: #fff;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-link {
  background: transparent;
  color: var(--primary);
  text-decoration: underline;
  padding: 4px 8px;
  font-size: 14px;
}

.btn.disabled,
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-text {
  background: transparent;
  color: var(--text-light);
  border: 1px dashed #ccc;
  font-size: 13px;
  padding: 10px;
  margin-top: 16px;
}

.operator-hint {
  text-align: center;
  color: var(--text-light);
  font-size: 12px;
  margin: 12px 0 16px;
  letter-spacing: 2px;
}

/* ---- 页面通用 ---- */
.page {
  padding: 24px 20px 40px;
  min-height: 100vh;
}

.page-title {
  font-size: 22px;
  text-align: center;
  margin-bottom: 20px;
  color: var(--primary);
}

/* ---- 信息填写页 ---- */
.info-page .page-header {
  text-align: center;
  padding: 30px 0 24px;
}

.info-page .logo {
  font-size: 56px;
  margin-bottom: 12px;
}

.info-page h1 {
  font-size: 22px;
  color: var(--primary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.info-page .subtitle {
  color: var(--text-light);
  font-size: 14px;
}

.welcome-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff5f0;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 14px;
}

.referral-banner {
  background: linear-gradient(135deg, #fff5e6, #fff);
  border: 1px solid #ffe0b3;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 13px;
  color: #b8860b;
  text-align: center;
}

.form {
  margin-bottom: 20px;
}

.form-item {
  margin-bottom: 16px;
}

.form-item label {
  display: block;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-item input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
  transition: border-color 0.2s;
}

.form-item input:focus {
  outline: none;
  border-color: var(--primary);
}

.form-item.error input {
  border-color: var(--danger);
  background: #fff5f5;
}

.error-hint {
  display: block;
  color: var(--danger);
  font-size: 12px;
  margin-top: 4px;
}

.privacy-tip {
  font-size: 12px;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 16px;
  line-height: 1.5;
}

/* ---- 大转盘页 ---- */
.lottery-page {
  padding-top: 16px;
}

.lottery-header {
  text-align: center;
  margin-bottom: 20px;
}

.lottery-header h2 {
  font-size: 20px;
  color: var(--primary);
  margin-bottom: 12px;
  line-height: 1.4;
}

.chance-display {
  display: inline-flex;
  align-items: baseline;
  background: linear-gradient(135deg, #fff5e6, #fff);
  border: 1px solid #ffe0b3;
  border-radius: 20px;
  padding: 6px 18px;
}

.chance-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
}

.chance-label {
  font-size: 14px;
  color: var(--text-light);
  margin-left: 4px;
}

.wheel-wrap {
  position: relative;
  width: fit-content;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wheel-center-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e63946, #c1121f);
  color: #fff;
  border: 4px solid #ffd700;
  font-weight: 700;
  cursor: pointer;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.1s;
}

.wheel-center-btn:active {
  transform: translate(-50%, -50%) scale(0.92);
}

.wheel-center-btn span {
  font-size: 14px;
}

.wheel-center-btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.lottery-bottom {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
}

.lottery-bottom .btn {
  flex: 1;
}

.rules-box {
  background: #fff9f5;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
}

.rules-box summary {
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  font-weight: 500;
}

.rules-content {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.rules-content p {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 6px;
}

/* ---- 弹窗 ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: #fff;
  border-radius: 16px;
  padding: 28px 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
}

@keyframes popIn {
  from {
    transform: scale(0.7);
    opacity: 0;
  }
}

.result-emoji {
  font-size: 56px;
  margin-bottom: 8px;
}

.result-title {
  font-size: 24px;
  color: var(--primary);
  margin-bottom: 8px;
}

.result-prize-name {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
  background: linear-gradient(135deg, #e63946, #f4a261);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 12px 0;
}

.result-desc {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 16px;
}

.result-code {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.code-label {
  font-size: 12px;
  color: var(--text-light);
}

.code-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 1px;
  font-family: monospace;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---- 我的奖品页 ---- */
.prize-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.prize-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #fff9f5;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.prize-item-left {
  flex: 1;
}

.prize-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.prize-code {
  font-size: 12px;
  color: var(--text-light);
  font-family: monospace;
  margin-bottom: 4px;
}

.prize-time {
  font-size: 12px;
  color: var(--text-light);
}

.prize-status {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.status-unused {
  background: #fff5e6;
  color: #d97706;
}

.status-used {
  background: #f0f0f0;
  color: var(--text-light);
}

.empty-state {
  text-align: center;
  padding: 60px 0;
  color: var(--text-light);
  font-size: 15px;
}

.page-tip {
  font-size: 12px;
  color: var(--text-light);
  text-align: center;
  padding: 12px;
}

/* ---- 邀请助力页 ---- */
.invite-poster {
  background: linear-gradient(135deg, #e63946, #f4a261);
  border-radius: 16px;
  padding: 28px 20px;
  text-align: center;
  color: #fff;
  margin-bottom: 20px;
}

.poster-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.poster-desc {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 16px;
}

.poster-emoji {
  font-size: 32px;
  margin-bottom: 16px;
}

.qr-placeholder {
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  display: inline-block;
}

.qr-mock {
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 14px;
}

.qr-canvas {
  display: block;
  width: 120px;
  height: 120px;
}

.share-link-box {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.share-link-input {
  flex: 1;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
}

.invite-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.stat-item {
  flex: 1;
  text-align: center;
  background: #fff9f5;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.stat-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

/* ---- 状态页 ---- */
.state-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 40vh;
}

.state-emoji {
  font-size: 64px;
  margin-bottom: 16px;
}

.state-page h2 {
  color: var(--primary);
  margin-bottom: 8px;
}

.state-page p {
  color: var(--text-light);
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 2000;
  opacity: 0;
  transition: all 0.3s;
  max-width: 80%;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ---- 响应式 ---- */
@media (max-width: 360px) {
  .page {
    padding: 16px 14px 32px;
  }
  .info-page h1 {
    font-size: 20px;
  }
  .result-prize-name {
    font-size: 28px;
  }
}
