/* ============================================================
   我的优惠券（v=fv）
   ============================================================ */

/* 顶部兑换条 */
.coupon-redeem {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  margin-top: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-md);
}

.coupon-redeem-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: var(--fs-md);
  letter-spacing: 2px;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
}

.coupon-redeem-input::placeholder {
  letter-spacing: 0.5px;
  font-family: inherit;
  color: var(--ink-3);
}

.coupon-redeem-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap-min);
  padding: 0 var(--sp-4);
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent, #41648f);
  color: #fff;
  font-size: var(--fs-md);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.coupon-redeem-btn:disabled { opacity: 0.55; }

/* 扫码按钮（v=gb）：和输入框同高，图标按钮 */
.coupon-redeem-scan {
  flex: none;
  width: var(--tap-min);
  height: var(--tap-min);
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.34);
  color: var(--ink-2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.coupon-redeem-scan:active { background: rgba(255, 255, 255, 0.5); }

.coupon-redeem-scan svg { width: 19px; height: 19px; }

.coupon-redeem-hint {
  margin: var(--sp-2) var(--sp-1) 0;
  font-size: var(--fs-xs);
  line-height: 1.5;
  color: var(--ink-3);
}

/* ---------- 扫码兑换弹窗（v=gb） ---------- */
.scan-mask {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5);
  background: rgba(8, 12, 18, 0.84);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.scan-panel {
  width: 100%;
  max-width: 360px;
}

.scan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
  color: #fff;
}

.scan-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.scan-close {
  width: var(--tap-min);
  height: var(--tap-min);
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: var(--fs-xl);
  line-height: 1;
  cursor: pointer;
}

.scan-view {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
}

#scan-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 取景框：横长条（条码本身是横的），上下留白给手指和阴影
   位置与 JS 里的裁剪区域对应：水平 4% 边距、垂直 26% 边距 */
.scan-frame {
  position: absolute;
  top: 26%;
  right: 4%;
  bottom: 26%;
  left: 4%;
  overflow: hidden;
}

.scan-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255, 255, 255, 0.92);
}

.scan-corner.tl { top: 0; left: 0; border-right: none; border-bottom: none; border-radius: 8px 0 0 0; }
.scan-corner.tr { top: 0; right: 0; border-left: none; border-bottom: none; border-radius: 0 8px 0 0; }
.scan-corner.bl { bottom: 0; left: 0; border-right: none; border-top: none; border-radius: 0 0 0 8px; }
.scan-corner.br { bottom: 0; right: 0; border-left: none; border-top: none; border-radius: 0 0 8px 0; }

.scan-line {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(110, 231, 255, 0), #6ee7ff 22%, #b8f3ff 50%, #6ee7ff 78%, rgba(110, 231, 255, 0));
  box-shadow: 0 0 12px rgba(110, 231, 255, 0.65);
  animation: scanMove 2.2s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

/* 用 top 而不是 translateY：translateY 的百分比是相对元素自身 2px 高度，
   扫不动；这里要的是相对取景框高度。 */
@keyframes scanMove {
  0% { top: 0; opacity: 0.35; }
  10% { opacity: 1; }
  50% { top: calc(100% - 2px); opacity: 1; }
  90% { opacity: 1; }
  100% { top: 0; opacity: 0.35; }
}

.scan-tip {
  margin-top: var(--sp-4);
  text-align: center;
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
}

.scan-tip.is-warn { color: #ffd7a8; }

/* 扫码弹窗底部的图标按钮（v=gl）：
   只有图标没有文字，圆形按钮；图形一律正立 —— 任何旋转都会让用户觉得「图标歪了」 */
.scan-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}

.scan-icon-btn {
  width: var(--tap-min);
  height: var(--tap-min);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* 图标本体：块级居中，**不写 transform / rotate**，保持正立 */
.scan-icon-btn > svg {
  display: block;
  transform: none;
}

.scan-icon-btn:active { background: rgba(255, 255, 255, 0.24); }

/* 相册上传用青色区分；手电筒点亮时变暖黄 */
.scan-photo {
  border-color: rgba(110, 231, 255, 0.55);
  background: rgba(110, 231, 255, 0.16);
  color: #d9f7ff;
}

.scan-photo:active { background: rgba(110, 231, 255, 0.3); }

.scan-torch.on {
  background: rgba(255, 214, 130, 0.92);
  border-color: rgba(255, 214, 130, 0.92);
  color: #3a2a05;
}


/* 券卡片 */
.coupon-list { margin-top: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-4); }

.coupon-empty {
  padding: var(--sp-6) var(--sp-3);
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--ink-3);
}

/* 卡片用站内统一的液态玻璃：和 .form-card / .liquid-glass 同一套变量，
   不再自己写一层半透明白，否则跟其它页面比会显得「薄」 */
.coupon-item {
  position: relative;
  padding: var(--sp-4);
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-right-color: var(--glass-border-dim);
  border-bottom-color: var(--glass-border-dim);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 1px 0 0 rgba(255, 255, 255, 0.4),
    0 8px 22px rgba(22, 26, 32, 0.07);
}

/* 失效 / 已使用：灰底 + 右上角红标 */
.coupon-item.is-dead {
  background: rgba(232, 234, 238, 0.72);
  border-color: rgba(200, 205, 214, 0.7);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.coupon-item.is-dead .coupon-name,
.coupon-item.is-dead .coupon-amount { color: var(--ink-3); }

.coupon-dead-tag {
  position: absolute;
  top: var(--sp-3);
  right: var(--sp-4);
  padding: 2px var(--sp-2);
  border-radius: var(--radius-xs);
  background: rgba(192, 92, 82, 0.12);
  color: #b4443f;
  font-size: var(--fs-2xs);
  font-weight: 600;
}

.coupon-top { display: flex; align-items: flex-start; gap: var(--sp-3); }

.coupon-amount {
  flex: none;
  min-width: 74px;
  font-size: var(--fs-2xl);
  font-weight: 800;
  color: var(--accent, #41648f);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.coupon-amount small { font-size: var(--fs-xs); font-weight: 600; margin-left: 2px; }

.coupon-main { flex: 1; min-width: 0; }

.coupon-name {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--ink);
  padding-right: 56px;
}

.coupon-rule {
  margin-top: var(--sp-1);
  font-size: var(--fs-xs);
  color: var(--ink-2);
}

.coupon-meta {
  margin-top: var(--sp-2);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
}

.coupon-chip {
  padding: 2px var(--sp-2);
  border-radius: var(--radius-xs);
  background: rgba(65, 100, 143, 0.09);
  color: #41648f;
  font-size: var(--fs-2xs);
}

.coupon-chip.is-auto {
  background: rgba(47, 143, 91, 0.1);
  color: #2f7a4f;
}

.coupon-date {
  margin-top: var(--sp-2);
  font-size: var(--fs-2xs);
  color: var(--ink-3);
}

/* ============================================================
   v=gy · 优惠券页精修（只改观感）
   ============================================================ */

/* 兑换按钮：和全站主按钮同一个蓝（原来偏亮偏紫一档） */
.coupon-redeem-btn {
  background: linear-gradient(160deg, #6a8fc2 0%, #4f72aa 60%, #476a9f 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 6px 16px -8px rgba(74, 108, 168, 0.55);
}

/* 券码输入：字距保持 2px（8 位码好读），占位文字压深一档 */
.coupon-redeem-input::placeholder {
  color: var(--ink-3);
}

/* 空状态文案行高放宽，长句不再挤成一团 */
.coupon-empty,
.coupon-list-empty {
  line-height: 1.75;
}
