/* ==================== 基础 ==================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

.container { max-width: 480px; margin: 0 auto; padding: 10px; }

/* 防止非微信浏览器看到表单区一闪而过（JS未执行时默认不可见，JS会控制显示） */
/* 注意：不能用 display:none，否则JS无法控制；用 visibility+opacity 平滑过渡 */


/* ==================== 头部 ==================== */
.header-bg {
  background: linear-gradient(135deg, #4a90a4, #5ba3b5);
  border-radius: 16px;
  padding: 30px 20px;
  text-align: center;
  color: #fff;
  margin-bottom: 12px;
}

.header-badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-size: 12px;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 12px;
  letter-spacing: 1px;
}

.header-title {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 4px;
  margin-bottom: 6px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-sub { 
  font-size: 13px; 
  color: rgba(255,255,255,0.9); 
  margin-bottom: 14px; 
}

.header-dates {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-size: 13px;
  padding: 6px 16px;
  border-radius: 20px;
}

.header-dot { opacity: 0.5; }

/* ==================== 卡片 ==================== */
.card {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 16px;
}

.label-icon { font-size: 18px; }

/* ==================== 用户表单 ==================== */
.input-row {
  display: flex;
  gap: 10px;
  margin-bottom: 4px;
}

.input-group { flex: 1; }

.input-group input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  font-size: 15px;
  background: #fafafa;
  color: #333;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.input-group input::placeholder { color: #bbb; }

.input-group input:focus {
  border-color: #4a90a4;
  box-shadow: 0 0 0 3px rgba(74,144,164,0.1);
  background: #fff;
}

/* 分割线 */
.card-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, #eee, transparent);
  margin: 16px 0;
}

/* ==================== 抽奖区 ==================== */
.coupon-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.coupon-item {
  flex: 1;
  background: linear-gradient(145deg, #fff9f5, #fff0ea);
  border: 2px solid #f0e0d8;
  border-radius: 14px;
  padding: 18px 12px;
  text-align: center;
  transition: all 0.2s;
}

.coupon-item.active {
  background: linear-gradient(145deg, #ffd700, #ffe44d);
  border-color: #e6a800;
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
  transform: scale(1.06);
}

.coupon-price {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: #c0392b;
  line-height: 1.1;
}

.coupon-item.active .coupon-price { color: #7a5000; }

.coupon-label { 
  display: block; 
  font-size: 12px; 
  color: #999; 
  margin-top: 2px; 
}

.coupon-item.active .coupon-label { color: #8a6000; }

.coupon-vs { 
  font-size: 13px; 
  color: #ccc; 
  font-weight: 600; 
  flex-shrink: 0; 
}

/* 领取按钮 */
.draw-btn {
  width: 100%;
  height: 52px;
  background: linear-gradient(145deg, #e74c3c, #c0392b);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  border: none;
  border-radius: 26px;
  cursor: pointer;
  letter-spacing: 2px;
  box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
  transition: all 0.2s;
  animation: pulse-btn 2.5s ease-in-out infinite;
}

.draw-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(231, 76, 60, 0.45);
  animation: none;
}

.draw-btn:active { transform: translateY(0); }

.draw-btn:disabled {
  background: #ccc;
  box-shadow: none;
  animation: none;
  cursor: not-allowed;
}

@keyframes pulse-btn {
  0%, 100% { box-shadow: 0 6px 20px rgba(231,76,60,0.4); }
  50%       { box-shadow: 0 6px 28px rgba(231,76,60,0.6); }
}

/* 奖品展示 */
.prize-display { 
  text-align: center; 
  padding: 8px 0 16px; 
}

.prize-amount { 
  display: block; 
  font-size: 52px; 
  font-weight: 900; 
  color: #e74c3c; 
  line-height: 1; 
  margin-bottom: 4px; 
}

.prize-type { 
  font-size: 15px; 
  color: #888; 
}

.verify-btn {
  width: 100%;
  height: 50px;
  background: linear-gradient(145deg, #4a90a4, #3d7a8c);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  letter-spacing: 1px;
  box-shadow: 0 4px 16px rgba(74, 144, 164, 0.35);
  transition: all 0.2s;
}

.verify-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(74,144,164,0.4);
}

/* ==================== 信息卡 ==================== */
.info-card { 
  background: linear-gradient(145deg, #f8fbfc, #f0f7f9); 
}

.info-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #e8f0f2;
}

.info-row:last-child { 
  border-bottom: none; 
}

.info-icon { 
  font-size: 20px; 
  margin-top: 2px; 
}

.info-text { 
  display: flex; 
  flex-direction: column; 
}

.info-text strong { 
  font-size: 15px; 
  color: #333; 
}

.info-text span { 
  font-size: 13px; 
  color: #888; 
  margin-top: 2px; 
}

/* ==================== 操作按钮行 ==================== */
.action-row {
  display: flex;
  gap: 12px;
  margin: 14px 0;
}

.action-btn {
  flex: 1;
  height: 50px;
  background: #fff;
  color: #4a90a4;
  font-size: 15px;
  font-weight: 600;
  border: 1.5px solid #d0e0e5;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.action-btn:hover {
  background: #f0f7f9;
  border-color: #b0d0d8;
  transform: translateY(-1px);
}

.action-btn span:first-child { 
  font-size: 16px; 
}

/* ==================== 底部 ==================== */
.footer { 
  text-align: center; 
  padding: 20px 0 10px; 
  font-size: 11px; 
  line-height: 1.8; 
}

.footer p { 
  color: #aaa; 
}

.copyright { 
  margin-top: 6px; 
  color: #bbb; 
}

/* ==================== 弹窗 ==================== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 320px;
  overflow: hidden;
  animation: modalPop 0.25s ease;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}

.modal-header {
  text-align: center;
  padding: 24px 20px 12px;
  background: linear-gradient(145deg, #f0f7f9, #e8f0f2);
}

.modal-icon { 
  font-size: 48px; 
  display: block; 
  margin-bottom: 10px; 
}

.modal-header h3 { 
  font-size: 20px; 
  color: #333; 
}

.modal-body { 
  padding: 16px 20px; 
  text-align: center; 
}

.modal-footer { 
  padding: 0 20px 20px; 
}

.modal-footer.two-btns { 
  display: flex; 
  gap: 10px; 
}

/* 结果弹窗 */
.result-amount { 
  font-size: 56px; 
  font-weight: 900; 
  color: #e74c3c; 
  line-height: 1; 
  margin-bottom: 4px; 
}

.result-type { 
  font-size: 16px; 
  color: #888; 
  margin-bottom: 12px; 
}

.result-hint { 
  font-size: 13px; 
  color: #bbb; 
  padding: 10px; 
  background: #f9f9f9; 
  border-radius: 8px; 
}

/* 核销码 */
.verify-code-display {
  font-size: 26px;
  font-weight: 800;
  color: #c0392b;
  letter-spacing: 3px;
  font-family: 'Courier New', monospace;
  background: #fef5f4;
  border: 2px dashed #e74c3c;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 10px;
  word-break: break-all;
}

.verify-info { 
  text-align: left; 
  font-size: 13px; 
  color: #666; 
  margin-bottom: 10px; 
}

.verify-info p { 
  margin-bottom: 4px; 
}

.verify-warning { 
  font-size: 12px; 
  color: #e74c3c; 
  font-weight: 600; 
}

/* 通用按钮 */
.modal-btn {
  width: 100%;
  height: 48px;
  background: linear-gradient(145deg, #4a90a4, #3d7a8c);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.modal-btn:hover { 
  opacity: 0.88; 
}

.modal-btn-ghost { 
  background: #f5f5f5; 
  color: #666; 
}

/* 通用弹窗提示 */
#alertText { 
  font-size: 16px; 
  color: #333; 
  line-height: 1.6; 
}

/* ==================== 我的券码弹窗 ==================== */
.my-coupon-result { 
  padding: 4px 0; 
}

.mc-amount { 
  font-size: 48px; 
  font-weight: 900; 
  color: #e74c3c; 
  line-height: 1; 
  margin-bottom: 4px; 
}

.mc-type { 
  font-size: 15px; 
  color: #888; 
  margin-bottom: 16px; 
}

.mc-code-box {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 14px;
}

.mc-code {
  flex: 1;
  font-size: 20px;
  font-weight: 800;
  color: #c0392b;
  letter-spacing: 2px;
  font-family: 'Courier New', monospace;
  background: #fef5f4;
  border: 2px dashed #e74c3c;
  border-radius: 10px;
  padding: 12px 14px;
  text-align: center;
  word-break: break-all;
}

.mc-copy-btn {
  padding: 0 16px;
  background: #e74c3c;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s;
}

.mc-copy-btn:hover { 
  opacity: 0.85; 
}

.mc-meta { 
  text-align: left; 
}

.mc-meta-item { 
  font-size: 13px; 
  color: #666; 
  margin-bottom: 4px; 
}

/* 未领取状态 */
.my-coupon-empty { 
  padding: 8px 0; 
}

.mc-empty-icon { 
  font-size: 52px; 
  margin-bottom: 12px; 
}

.mc-empty-text { 
  font-size: 17px; 
  font-weight: 600; 
  color: #333; 
  margin-bottom: 6px; 
}

.mc-empty-hint { 
  font-size: 13px; 
  color: #999; 
}

/* ==================== 活动规则弹窗 ==================== */
.rules-modal-content { 
  max-width: 340px; 
}

.rules-body { 
  padding: 12px 20px 4px; 
  text-align: left; 
  max-height: 60vh; 
  overflow-y: auto; 
}

.rules-block { 
  margin-bottom: 18px; 
}

.rules-block-title {
  font-size: 15px;
  font-weight: 700;
  color: #4a90a4;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e8f0f2;
}

.rules-block-content { 
  font-size: 14px; 
  color: #555; 
  line-height: 1.8; 
}

.rules-list { 
  padding-left: 18px; 
}

.rules-list li { 
  margin-bottom: 8px; 
}

.rules-list li:last-child { 
  margin-bottom: 0; 
}

/* ==================== 加载中 ==================== */
.loading {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.loading-spinner {
  width: 44px; height: 44px;
  border: 4px solid #e0e8ea;
  border-top-color: #4a90a4;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 14px;
}

@keyframes spin { 
  to { transform: rotate(360deg); } 
}

.loading p { 
  color: #888; 
  font-size: 15px; 
}

/* ==================== 微信引导提示（PC端/非微信浏览器） ==================== */
.wechat-guide-wrap {
  text-align: center;
  padding: 28px 16px 24px;
}

.wechat-guide-icon {
  font-size: 44px;
  margin-bottom: 10px;
  line-height: 1;
}

.wechat-guide-title {
  font-size: 22px;
  font-weight: 700;
  color: #333;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.wechat-guide-desc {
  font-size: 14px;
  color: #888;
  line-height: 1.8;
  margin-bottom: 20px;
}

/* 二维码容器 */
.wechat-qr-box {
  width: 160px;
  height: 160px;
  margin: 0 auto 18px;
  border: 2px dashed #ddd;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #fafafa;
  position: relative;
}

.wechat-qr-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
}

/* 二维码加载失败时的占位 */
.qr-fallback .qr-placeholder-text {
  display: block !important;
  font-size: 13px;
  color: #bbb;
  padding: 10px;
}

.qr-placeholder-text {
  display: none;
  position: absolute;
}

/* 搜一搜行 */
.wechat-search-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.wechat-search-label {
  font-size: 14px;
  color: #aaa;
  white-space: nowrap;
}

.wechat-search-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #07c160, #05a84e);
  color: #fff;
  padding: 10px 28px;
  border-radius: 24px;
  font-size: 17px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(7, 193, 96, 0.3);
}

.search-icon { font-size: 18px; }
.search-text { letter-spacing: 2px; }

.wechat-search-hint {
  font-size: 13px;
  color: #aaa;
  margin: 8px 0 20px;
}

/* 操作步骤 */
.wechat-guide-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  background: #f8fbfc;
  border-radius: 12px;
  padding: 14px 16px;
}

.guide-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #555;
}

.step-num {
  width: 22px;
  height: 22px;
  background: linear-gradient(135deg, #4a90a4, #3d7a8c);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

/* 旧版兼容（保留） */
.wechat-search-guide {
  text-align: center;
  padding: 24px 16px;
}
.wechat-search-header {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin-bottom: 16px;
}
.wechat-icon { font-size: 28px; }
.wechat-search-title {
  font-size: 22px; font-weight: 600; color: #07c160; letter-spacing: 2px;
}

/* ==================== 响应式 ==================== */
@media (max-width: 375px) {
  .header-title { 
    font-size: 26px; 
    letter-spacing: 2px; 
  }
  .input-row { 
    flex-direction: column; 
  }
  .coupon-price { 
    font-size: 24px; 
  }
  .rules-modal-content { 
    max-width: 300px; 
  }
}
