/* =============================================================
 * lead-form.css —— 手机号领取表单（B站 BLG 夺冠活动页版）
 * 取值思路：卡片沿用海报的深海军蓝（#101733）+ 米金（#f3e2c0）+ 品牌粉（#ff6699），
 * 遮罩压暗、圆角 16、主按钮 46 高、输入框 44 高，全部字面量，无外部变量依赖。
 * ============================================================= */

/* 打开弹窗时锁住页面滚动 */
html.lead-lock,
html.lead-lock body {
  overflow: hidden !important;
}

/* ---------- 遮罩 + 卡片 ---------- */
.leadMask {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  background: rgba(4, 8, 20, 0.74);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  animation: leadMaskIn 0.18s ease-out;
}
.leadMask[hidden] {
  display: none;
}
@keyframes leadMaskIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.leadCard {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  max-width: 336px;
  padding: 26px 22px 18px;
  border-radius: 16px;
  border: 1px solid rgba(243, 226, 192, 0.18);
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(90, 130, 255, 0.28), transparent 60%),
    #101733;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  color: #f3e2c0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  animation: leadCardIn 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.05);
}
@keyframes leadCardIn {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.leadCard *,
.leadModal * { box-sizing: border-box; }

.leadClose {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(243, 226, 192, 0.55);
  font-size: 15px;
  line-height: 30px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.leadClose:hover {
  background: rgba(243, 226, 192, 0.1);
  color: #f3e2c0;
}

.leadTitle {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #f3e2c0;
}
.leadSub {
  margin: 0 0 16px;
  font-size: 12px;
  line-height: 18px;
  color: rgba(243, 226, 192, 0.6);
}

/* ---------- 输入行 ---------- */
.leadField,
.leadCodeRow {
  margin-bottom: 10px;
}
.leadCodeRow[hidden] { display: none; }
.leadCodeRow {
  display: flex;
  gap: 8px;
  align-items: center;
}

.leadInput {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(243, 226, 192, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 15px;
  letter-spacing: 1px;
  outline: none;
  transition: border-color 0.16s, background 0.16s;
  -webkit-appearance: none;
}
.leadInput::placeholder {
  color: rgba(243, 226, 192, 0.38);
  letter-spacing: 0;
  font-size: 13px;
}
.leadInput:focus {
  border-color: rgba(255, 102, 153, 0.72);
  background: rgba(255, 255, 255, 0.1);
}
.leadInput:disabled,
.leadInput[data-lead-locked="1"] {
  opacity: 0.55;
  cursor: not-allowed;
}
.leadCodeInput {
  flex: 1 1 auto;
  min-width: 0;
  letter-spacing: 3px;
}

/* 发码按钮 */
.leadSendBtn {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 12px;
  border-radius: 17px;
  border: 1px solid rgba(243, 226, 192, 0.34);
  background: transparent;
  color: #ffd9a0;
  font-size: 12.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 0.16s, border-color 0.16s, color 0.16s;
}
.leadSendBtn:hover:not(:disabled) {
  border-color: rgba(255, 102, 153, 0.8);
  color: #ff9dbe;
}
.leadSendBtn:disabled,
.leadSendBtn[data-state="countdown"],
.leadSendBtn[data-state="sending"],
.leadSendBtn[data-state="cooldown"],
.leadSendBtn[data-state="locked"] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- 主按钮 ---------- */
.leadClaimBtn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 46px;
  margin-top: 14px;
  border: 0;
  border-radius: 23px;
  overflow: hidden;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  background: linear-gradient(135deg, #ff6699 0%, #ff85b3 55%, #ffb0c9 100%);
  box-shadow: 0 8px 20px rgba(255, 102, 153, 0.28);
  transition: transform 0.12s ease, opacity 0.16s ease, background 0.2s;
  animation: leadBreath 2.6s ease-in-out infinite;
}
@keyframes leadBreath {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.012); }
}
/* 扫光 */
.leadClaimBtn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  transform: skewX(-18deg);
  animation: leadSweep 2.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes leadSweep {
  0% { left: -60%; }
  55% { left: 120%; }
  100% { left: 120%; }
}
.leadClaimBtn:active:not(:disabled) { transform: scale(0.985); }
.leadClaimBtn:disabled {
  cursor: not-allowed;
  animation: none;
  box-shadow: none;
}
.leadClaimBtn:disabled::after { display: none; }

/* 各状态配色 */
.leadClaimBtn[data-state="loading"],
.leadClaimBtn[data-state="polling"] {
  background: linear-gradient(135deg, #4a5680, #6b78a8);
  opacity: 0.92;
}
.leadClaimBtn[data-state="success"],
.leadClaimBtn[data-state="already"] {
  background: linear-gradient(135deg, #1f2a24, #2a3a30);
  color: #2fd48b;
  border: 1px solid rgba(47, 212, 139, 0.5);
}
.leadClaimBtn[data-state="locked"] {
  background: #2a2f3f;
  color: rgba(243, 226, 192, 0.45);
}
.leadClaimBtn[data-state="retry"] {
  background: linear-gradient(135deg, #3b4568, #52608f);
}
/* polling 态的省略号 */
.leadClaimText[data-dots]::after,
.leadClaimBtn[data-state="polling"] .leadClaimText::after {
  content: "";
  animation: leadDots 1.2s steps(4, end) infinite;
}
@keyframes leadDots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
  100% { content: ""; }
}

/* ---------- 提示 ---------- */
.leadTip {
  margin: 10px 0 0;
  min-height: 16px;
  font-size: 12px;
  line-height: 16px;
  text-align: center;
  color: rgba(243, 226, 192, 0.55);
  word-break: break-all;
}
.leadTip[data-kind="ok"] { color: #2fd48b; }
.leadTip[data-kind="warn"] { color: #ffcf6b; }
.leadTip[data-kind="error"] { color: #ff6b81; }

.leadAgree {
  margin: 12px 0 0;
  font-size: 11px;
  line-height: 15px;
  text-align: center;
  color: rgba(243, 226, 192, 0.34);
}

/* ---------- 内层：人机验证 / 第二条码 ---------- */
.leadModal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  background: rgba(2, 5, 14, 0.8);
  animation: leadMaskIn 0.16s ease-out;
}
.leadModal[hidden] { display: none; }

.leadModalCard {
  width: 100%;
  max-width: 304px;
  padding: 24px 20px 20px;
  border-radius: 14px;
  border: 1px solid rgba(243, 226, 192, 0.16);
  background: #131a2e;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  text-align: center;
  color: #f3e2c0;
}
.leadModalTitle {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
}
.leadModalDesc {
  margin: 0 0 14px;
  font-size: 12.5px;
  line-height: 19px;
  color: rgba(243, 226, 192, 0.66);
}
.leadModalSub {
  margin: 12px 0 0;
  font-size: 11.5px;
  line-height: 17px;
  color: rgba(243, 226, 192, 0.42);
}
.leadModalTip {
  margin: 10px 0 0;
  min-height: 15px;
  font-size: 12px;
  line-height: 15px;
  color: rgba(243, 226, 192, 0.55);
}
.leadModalTip[data-kind="ok"] { color: #2fd48b; }
.leadModalTip[data-kind="warn"] { color: #ffcf6b; }
.leadModalTip[data-kind="error"] { color: #ff6b81; }

/* 进度条 */
.leadProgress {
  position: relative;
  height: 4px;
  margin: 4px 0 2px;
  border-radius: 2px;
  overflow: hidden;
  background: rgba(243, 226, 192, 0.14);
}
.leadProgress[hidden] { display: none; }
.leadProgress > i {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 40%;
  border-radius: 2px;
  background: linear-gradient(90deg, #ff6699, #ffd9a0);
  animation: leadBar 1.15s ease-in-out infinite;
}
@keyframes leadBar {
  0% { left: -40%; width: 40%; }
  50% { left: 30%; width: 55%; }
  100% { left: 100%; width: 40%; }
}

/* 第二条码输入 */
.leadCode2Box {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.leadCode2Box[hidden] { display: none; }
.leadCode2Box .leadInput {
  flex: 1 1 auto;
  min-width: 0;
  height: 42px;
  text-align: center;
  letter-spacing: 4px;
}
.leadCode2Btn {
  flex: 0 0 auto;
  height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #ff6699, #ff8ab3);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}
.leadCode2Btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 窄屏微调 */
@media (max-width: 360px) {
  .leadCard { padding: 22px 16px 16px; border-radius: 14px; }
  .leadTitle { font-size: 17px; }
  .leadClaimBtn { height: 44px; font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .leadClaimBtn,
  .leadClaimBtn::after,
  .leadProgress > i { animation: none; }
  .leadCard, .leadMask, .leadModal { animation: none; }
}
