/* ===================================
   V4 合并样式表 - 去重优化版
   =================================== */

/* ===================================
   1. 基础样式重置
   =================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

body {
  background-color: #fff;
  color: #333;
  line-height: 1.6;
}

html {
  scroll-behavior: smooth;
}

/* ===================================
   2. Tailwind 配置
   =================================== */
tailwind.config = {
  theme: {
    extend: {
      colors: {
        primary: '#0071e3',
        secondary: '#666',
        success: '#34c759',
        neutral: {
          100: '#f5f5f7',
          200: '#e8e8ed',
          800: '#333',
          900: '#111'
        }
      },
      boxShadow: {
        'gift': '0 4px 14px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1)',
        'gift-hover': '0 10px 25px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(0, 0, 0, 0.06)',
      }
    }
  }
}

/* Container 样式 */
.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container {
    max-width: 640px;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 768px;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1024px;
  }
}

@media (min-width: 1280px) {
  .container {
    max-width: 1280px;
  }
}

@media (min-width: 1536px) {
  .container {
    max-width: 1536px;
  }
}

/* ===================================
   3. 输入框样式
   =================================== */
.input-container {
  position: relative;
  max-width: 500px;
  margin: 0 auto;
}

.form-input {
  font-size: 1.2rem;
  padding: 1rem 1rem 1rem 3.5rem;
  border-radius: 30px;
  border: 1px solid #ddd;
  transition: all 0.3s ease;
}

.form-input:focus {
  border-color: #0071e3;
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
  outline: none;
}

.form-input.error {
  border-color: #ff3b30;
  box-shadow: 0 0 0 4px rgba(255, 59, 48, 0.1);
}

.input-icon {
  position: absolute;
  left: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
}

.toggle-password {
  position: absolute;
  right: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  cursor: pointer;
}

/* ===================================
   4. 错误提示样式
   =================================== */
.error-message {
  color: #ff3b30;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  text-align: left;
  padding-left: 3.5rem;
  display: none;
}

/* ===================================
   5. 按钮样式
   =================================== */
.primary-btn {
  background-color: #0071e3;
  color: white;
  transition: all 0.3s ease;
}

.primary-btn:hover {
  background-color: #0066cc;
  transform: translateY(-2px);
}

.primary-btn:active {
  transform: translateY(0);
}

.login-btn {
  background-color: #0071e3;
  color: white;
  transition: all 0.3s ease;
}

.login-btn:hover {
  background-color: #0066cc;
  transform: translateY(-2px);
}

.login-btn:active {
  transform: translateY(0);
}

.claim-btn {
  background-color: #34c759;
  color: white;
  transition: all 0.3s ease;
}

.claim-btn:hover {
  background-color: #2db54e;
  transform: translateY(-2px);
}

.claim-btn:active {
  transform: translateY(0);
}

/* ===================================
   6. 加载动画
   =================================== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(0, 113, 227, 0.1);
  border-top-color: #0071e3;
  border-radius: 50%;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===================================
   7. 步骤指示器
   =================================== */
.steps-indicator {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.step {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #e8e8ed;
  margin: 0 4px;
}

.step.active {
  background-color: #0071e3;
}

/* ===================================
   8. 礼品卡组件样式
   =================================== */
.gift-card {
  background-color: #fff;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
}

.gift-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: var(--tw-shadow-gift-hover);
}

.gift-card-image {
  position: relative;
  overflow: hidden;
}

.gift-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0) 100%);
  pointer-events: none;
}

/* 成功页礼品卡覆盖层样式 */
.gift-card-overlay:not(.gift-card-image .gift-card-overlay) {
  background: linear-gradient(135deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0) 70%);
}

.card-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0) 100%);
  transform: skewX(-25deg);
  transition: all 0.7s ease;
}

.gift-card:hover .card-shine {
  left: 125%;
}

.card-content {
  position: relative;
  z-index: 10;
}

/* ===================================
   9. 验证码倒计时样式
   =================================== */
.countdown {
  color: #0071e3;
  font-size: 0.9rem;
  cursor: pointer;
}

.countdown.disabled {
  color: #999;
  cursor: not-allowed;
}

/* ===================================
   10. 页面特定样式
   =================================== */

/* 页面容器（用于多页面合并） */
.page {
  display: none;
  min-height: 100vh;
  width: 100%;
}

.page.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* 欢迎页面特殊处理 - 不需要垂直居中 */
#welcomePage.page.active {
  display: block;
  justify-content: flex-start;
}

/* 主要CTA按钮样式增强 */
#goToLoginBtn {
  position: relative;
  overflow: hidden;
  z-index: 1;
}

#goToLoginBtn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
  z-index: -1;
}

#goToLoginBtn:hover::before {
  left: 100%;
}

/* 登录、验证等页面需要居中 */
#loginPage.page.active,
#verificationPage.page.active,
#waitingPage.page.active,
#waitingVerificationPage.page.active {
  display: flex;
  min-height: 100vh;
}

/* 回到顶部按钮 */
#back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background-color: #0071e3;
  color: white;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

#back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

#back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}