html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: "Arial", "Helvetica Neue", Arial, sans-serif;
  background: #010b1a url("assets/bg.svg") no-repeat center center fixed;
  background-size: cover;
  color: #fff;
  overflow: hidden;
  width: 100vw;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

.container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.logo-wrapper {
  margin-top: 60px;
  margin-bottom: 20px; /* 正常的底部间距，不再使用负margin */
  width: 460px;
  height: 80px; /* 控制参与布局的高度，只考虑文字部分 */
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.logo {
  width: 460px;
  height: auto;
  /* logo正常显示，但布局高度由wrapper控制 */
}
.subtitle {
  font-size: 37px;
  font-weight: 400;
  margin-bottom: 40px;
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
}
.countdown {
  display: flex;
  background: rgba(10, 20, 40, 0.5);
  border-radius: 16px;
  box-shadow: 0 4px 32px #0008;
  padding: 24px 48px;
  margin-bottom: 32px;
  gap: 0;
}
.countdown-sep {
  display: flex;
  align-items: center;
  font-size: 64px;
  color: #ff4b2b;
  font-weight: bold;
  margin: 0 18px 0 18px;
  height: 80px;
  line-height: 1;
  user-select: none;
}
.countdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}
.countdown-value {
  display: flex;
  font-size: 64px;
  font-weight: bold;
  letter-spacing: 2px;
  min-width: 80px;
  height: 80px;
  overflow: hidden;
  position: relative;
  justify-content: center;
}
.digit-wrapper {
  display: inline-block;
  width: 32px;
  height: 80px;
  overflow: hidden;
  position: relative;
  vertical-align: bottom;
}
.digit-inner,
.digit-next {
  display: block;
  width: 100%;
  height: 80px;
  line-height: 80px;
  text-align: center;
  font-size: 64px;
  background: linear-gradient(180deg, #ab3327 5.77%, #de4233 50%, #78241c 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
  position: absolute;
  left: 0;
  top: 0;
  transition: transform 0.95s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
  pointer-events: none;
}
.digit-next {
  z-index: 2;
}
.countdown-label {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.48);
  margin-top: 8px;
  letter-spacing: 1px;
}
.desc {
  font-size: 30px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 60px;
  text-align: center;
  text-shadow: 0 2px 8px #000a;
}
.buttons {
  display: flex;
  gap: 48px;
  margin: 40px;
  justify-content: center;
  position: relative;
  z-index: 1000; /* 确保按钮区域在遮罩上方 */
}
.btn {
  padding: 18px 48px;
  border: 1px solid #ffb62f;
  border-radius: 100px;
  background: rgba(10, 10, 20, 0.7);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 0 16px #ffe7a055;
  transition: all 0.5s ease;
  opacity: 1;
  transform: scale(1);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}
.btn:hover {
  box-shadow: 0 0 16px #ffe7a055, 0 0 32px #ffb62f66, 0 0 48px #ffb62f44;
  border-color: #ffe7a0;
  transform: translateY(-2px);
}

/* 遮罩和模糊效果 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 999; /* 降低遮罩层级 */
  opacity: 0;
  transform: scale(1.05);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  pointer-events: none;
  visibility: hidden;
}

.modal-overlay.show {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
  visibility: visible;
}

.email-input-container {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  z-index: 1001; /* 确保在遮罩上方 */
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  visibility: hidden;
  white-space: nowrap; /* 防止换行 */
  font-size: 0; /* 消除行内元素间隙 */
}

.email-input {
  display: inline-block;
  width: 406px;
  height: 50px; /* 输入框高度50px */
  padding: 0 16px;
  border: 1px solid rgba(232, 197, 170, 0);
  border-radius: 100px;
  background: rgba(8, 16, 38, 0.4);
  color: #fff;
  font-size: 16px;
  font-weight: 400;
  text-align: left;
  outline: none;
  cursor: text;
  box-shadow: 0 5px 24px 0 rgba(232, 215, 144, 0.3);
  backdrop-filter: blur(5px);
  transition: all 0.3s ease;
  vertical-align: top;
  margin-right: 8px; /* 与按钮的间距 */
  box-sizing: border-box;
  line-height: 50px; /* 文字垂直居中 */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.send-btn {
  display: inline-flex;
  width: 50px; /* 按钮宽度50px，与高度一致 */
  height: 50px; /* 按钮高度50px，与输入框一致 */
  padding: 0;
  border-radius: 100px;
  border: 1px solid rgba(255, 182, 47, 0);
  background: rgba(8, 16, 38, 0.4);
  box-shadow: 0 5px 24px 0 rgba(232, 215, 144, 0.3);
  backdrop-filter: blur(5px);
  cursor: pointer;
  transition: all 0.3s ease;
  vertical-align: top;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}

.send-btn .send-icon {
  width: 24px;
  height: 24px;
  transition: all 0.3s ease;
  display: block;
}

.send-btn .check-icon {
  width: 24px;
  height: 24px;
  position: absolute;
  opacity: 0;
  transform: scale(0);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  display: block;
}

.send-btn .error-icon {
  width: 24px;
  height: 24px;
  position: absolute;
  opacity: 0;
  transform: scale(0);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  display: block;
}

.send-btn:hover {
  border-color: rgba(255, 182, 47, 0.4);
  box-shadow: 0 5px 32px 0 rgba(232, 215, 144, 0.5);
  transform: translateY(-2px);
}

/* 纸飞机飞行动画 */
.send-btn.flying .send-icon {
  animation: flyAway 1.5s ease-out forwards;
}

@keyframes flyAway {
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
    opacity: 1;
  }
  50% {
    transform: translate(100px, -50px) scale(0.8) rotate(15deg);
    opacity: 0.8;
  }
  100% {
    transform: translate(300px, -150px) scale(0.3) rotate(45deg);
    opacity: 0;
  }
}

/* 成功状态 - 显示绿色勾 */
.send-btn.success .send-icon {
  opacity: 0;
  transform: scale(0);
}

.send-btn.success .check-icon {
  opacity: 1;
  transform: scale(1);
  animation: checkPulse 0.6s ease-out;
}

.send-btn.success {
  background: rgba(0, 200, 81, 0.1);
  border-color: rgba(0, 200, 81, 0.3);
  box-shadow: 0 5px 24px 0 rgba(0, 200, 81, 0.3);
  animation: successGlow 0.6s ease-out;
}

/* 失败状态 - 显示红色X */
.send-btn.error .send-icon {
  opacity: 0;
  transform: scale(0);
}

.send-btn.error .error-icon {
  opacity: 1;
  transform: scale(1);
  animation: errorShake 0.6s ease-out;
}

.send-btn.error {
  background: rgba(255, 59, 48, 0.1);
  border-color: rgba(255, 59, 48, 0.3);
  box-shadow: 0 5px 24px 0 rgba(255, 59, 48, 0.3);
  animation: errorGlow 0.6s ease-out;
}

/* 勾的脉冲动画 */
@keyframes checkPulse {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* 按钮成功发光动画 */
@keyframes successGlow {
  0% {
    box-shadow: 0 5px 24px 0 rgba(0, 200, 81, 0);
  }
  50% {
    box-shadow: 0 5px 32px 0 rgba(0, 200, 81, 0.5);
  }
  100% {
    box-shadow: 0 5px 24px 0 rgba(0, 200, 81, 0.3);
  }
}

/* X图标的抖动动画 */
@keyframes errorShake {
  0% {
    opacity: 0;
    transform: scale(0) rotate(0deg);
  }
  25% {
    opacity: 1;
    transform: scale(1.2) rotate(-5deg);
  }
  50% {
    transform: scale(1) rotate(5deg);
  }
  75% {
    transform: scale(1.1) rotate(-3deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

/* 按钮失败发光动画 */
@keyframes errorGlow {
  0% {
    box-shadow: 0 5px 24px 0 rgba(255, 59, 48, 0);
  }
  50% {
    box-shadow: 0 5px 32px 0 rgba(255, 59, 48, 0.5);
  }
  100% {
    box-shadow: 0 5px 24px 0 rgba(255, 59, 48, 0.3);
  }
}

/* 苹果风格的抖动动画 */
@keyframes shake {
  0%,
  100% {
    transform: translateX(-50%) translateX(0);
  }
  8%,
  24%,
  40%,
  56%,
  72%,
  88% {
    transform: translateX(-50%) translateX(-8px);
  }
  16%,
  32%,
  48%,
  64%,
  80% {
    transform: translateX(-50%) translateX(8px);
  }
}

.email-input-container.shake {
  animation: shake 0.65s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

/* 抖动时边框变红提示错误 */
.email-input-container.shake .email-input {
  border-color: rgba(255, 59, 48, 0.8) !important;
  box-shadow: 0 5px 24px 0 rgba(255, 59, 48, 0.4) !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.email-input-container.shake .send-btn {
  border-color: rgba(255, 59, 48, 0.4) !important;
  box-shadow: 0 5px 24px 0 rgba(255, 59, 48, 0.3) !important;
}

.email-input-container.show {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  pointer-events: auto;
  visibility: visible;
}

/* 淡出时的透明消失效果 */
.email-input-container.hiding {
  opacity: 0;
  transform: translateX(-50%) scale(1); /* 保持正常大小，只改变透明度 */
  transition: opacity 0.6s cubic-bezier(0.55, 0.085, 0.68, 0.53),
    transform 0.6s cubic-bezier(0.55, 0.085, 0.68, 0.53);
  white-space: nowrap; /* 保持不换行 */
}

.buttons.email-mode .btn {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
}

.email-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  font-weight: 400;
}

.email-input:focus {
  border-color: rgba(232, 197, 170, 0.4);
  box-shadow: 0 5px 32px 0 rgba(232, 215, 144, 0.5);
}
/* 移动端适配 */
@media (max-width: 900px) {
  .logo-wrapper {
    margin-top: 30px;
    margin-bottom: 15px;
    width: 280px;
    height: 50px;
  }

  .logo {
    width: 280px;
    height: auto;
  }

  .subtitle {
    font-size: 24px;
    margin-bottom: 25px;
  }

  .countdown {
    padding: 16px 24px;
    margin-bottom: 20px;
    gap: 0;
  }

  .countdown-sep {
    font-size: 36px;
    margin: 0 8px;
    height: 50px;
  }

  .countdown-item {
    min-width: 50px;
  }

  .countdown-value {
    font-size: 36px;
    min-width: 50px;
    height: 50px;
  }

  .digit-wrapper {
    width: 20px;
    height: 50px;
  }

  .digit-inner,
  .digit-next {
    height: 50px;
    line-height: 50px;
    font-size: 36px;
  }

  .countdown-label {
    font-size: 12px;
    margin-top: 4px;
  }

  .desc {
    font-size: 18px;
    margin-bottom: 30px;
  }

  .buttons {
    gap: 20px;
    margin: 20px;
    flex-direction: column;
    align-items: center;
  }

  .btn {
    padding: 14px 32px;
    font-size: 14px;
    width: 280px;
    max-width: 90vw;
  }

  .email-input {
    width: 280px;
    max-width: 90vw;
    height: 44px;
    font-size: 14px;
    line-height: 44px;
  }

  .send-btn {
    width: 44px;
    height: 44px;
  }

  .send-btn .send-icon,
  .send-btn .check-icon,
  .send-btn .error-icon {
    width: 20px;
    height: 20px;
  }
}

/* 超小屏幕适配 */
@media (max-width: 480px) {
  .logo-wrapper {
    width: 240px;
    height: 40px;
  }

  .logo {
    width: 240px;
  }

  .subtitle {
    font-size: 20px;
  }

  .countdown {
    padding: 12px 16px;
  }

  .countdown-sep {
    font-size: 28px;
    margin: 0 6px;
    height: 40px;
  }

  .countdown-value {
    font-size: 28px;
    height: 40px;
  }

  .digit-wrapper {
    width: 16px;
    height: 40px;
  }

  .digit-inner,
  .digit-next {
    height: 40px;
    line-height: 40px;
    font-size: 28px;
  }

  .countdown-label {
    font-size: 10px;
  }

  .desc {
    font-size: 16px;
  }

  .btn {
    width: 240px;
    padding: 12px 24px;
    font-size: 13px;
  }

  .email-input {
    width: 240px;
    height: 40px;
    font-size: 13px;
    line-height: 40px;
  }

  .send-btn {
    width: 40px;
    height: 40px;
  }

  .send-btn .send-icon,
  .send-btn .check-icon,
  .send-btn .error-icon {
    width: 18px;
    height: 18px;
  }
}
