<template>
  <div 
    class="t2-theme-1" 
    :style="{
      '--primary-color': colors.primary,
      '--primary-light': colors.primaryLight,
    }"
  >
    <!-- 顶部渐变区域 -->
    <div class="t2-header-section">
      <!-- 装饰元素 -->
      <div class="t2-floating-shapes">
        <div class="t2-shape t2-shape-1"></div>
        <div class="t2-shape t2-shape-2"></div>
        <div class="t2-shape t2-shape-3"></div>
      </div>

      <!-- Logo和标题 -->
      <div class="t2-header-content">
        <div class="t2-logo-wrapper">
          <div class="t2-logo">
            <svg width="48" height="48" viewBox="0 0 24 24" fill="none">
              <path d="M12 2L2 7V11C2 16.55 6.84 21.74 12 23C17.16 21.74 22 16.55 22 11V7L12 2Z" fill="white" opacity="0.9"/>
              <circle cx="12" cy="12" r="4" fill="white"/>
            </svg>
          </div>
        </div>
        
        <h1 class="t2-main-title">{{ t("theme2.title") }}</h1>
        <p class="t2-main-subtitle">{{ t("theme2.subtitle") }}</p>
      </div>
    </div>

    <!-- 特性卡片 -->
    <div class="t2-features-section">
      <div class="t2-feature-card">
        <div class="t2-feature-icon">
          <svg width="28" height="28" viewBox="0 0 24 24" fill="none">
            <path d="M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM13 17H11V15H13V17ZM13 13H11V7H13V13Z" fill="currentColor"/>
          </svg>
        </div>
        <div class="t2-feature-text">
          <div class="t2-feature-title">{{ t("theme2.feature_realtime") }}</div>
        </div>
      </div>

      <div class="t2-feature-card">
        <div class="t2-feature-icon">
          <svg width="28" height="28" viewBox="0 0 24 24" fill="none">
            <path d="M20 6H17.82C17.93 5.69 18 5.35 18 5C18 3.34 16.66 2 15 2C13.95 2 13.04 2.54 12.5 3.35L12 4.02L11.5 3.34C10.96 2.54 10.05 2 9 2C7.34 2 6 3.34 6 5C6 5.35 6.07 5.69 6.18 6H4C2.89 6 2.01 6.89 2.01 8L2 19C2 20.11 2.89 21 4 21H20C21.11 21 22 20.11 22 19V8C22 6.89 21.11 6 20 6Z" fill="currentColor"/>
          </svg>
        </div>
        <div class="t2-feature-text">
          <div class="t2-feature-title">{{ t("theme2.feature_rewards") }}</div>
        </div>
      </div>

      <div class="t2-feature-card">
        <div class="t2-feature-icon">
          <svg width="28" height="28" viewBox="0 0 24 24" fill="none">
            <path d="M12 1L3 5V11C3 16.55 6.84 21.74 12 23C17.16 21.74 21 16.55 21 11V5L12 1Z" fill="currentColor"/>
          </svg>
        </div>
        <div class="t2-feature-text">
          <div class="t2-feature-title">{{ t("theme2.feature_secure") }}</div>
        </div>
      </div>
    </div>

    <!-- 主要查询区域 -->
    <div class="t2-query-section">
      <div class="t2-query-card">
        <!-- 卡片标题 -->
        <div class="t2-query-header">
          <div class="t2-query-icon-bg">
            <svg width="32" height="32" viewBox="0 0 24 24" fill="none">
              <path d="M15.5 14H14.71L14.43 13.73C15.41 12.59 16 11.11 16 9.5C16 5.91 13.09 3 9.5 3C5.91 3 3 5.91 3 9.5C3 13.09 5.91 16 9.5 16C11.11 16 12.59 15.41 13.73 14.43L14 14.71V15.5L19 20.49L20.49 19L15.5 14ZM9.5 14C7.01 14 5 11.99 5 9.5C5 7.01 7.01 5 9.5 5C11.99 5 14 7.01 14 9.5C14 11.99 11.99 14 9.5 14Z" fill="white"/>
            </svg>
          </div>
          <div class="t2-query-title-block">
            <h2 class="t2-query-title">{{ t("theme2.check_my_points") }}</h2>
            <p class="t2-query-subtitle">{{ t("theme2.query_subtitle") }}</p>
          </div>
        </div>

        <!-- 输入区域 -->
        <div class="t2-input-section">
          <label class="t2-input-label">{{ t("Phone number") }}</label>
          <div class="t2-phone-input-wrapper">
            <input
              type="tel"
              class="t2-phone-input"
              :placeholder="t('theme2.phone_placeholder')"
              maxlength="11"
              :value="modelValue"
              @input="$emit('update:modelValue', ($event.target as HTMLInputElement).value)"
            />
            <div class="t2-input-underline"></div>
          </div>
        </div>

        <!-- 查询按钮 -->
        <button class="t2-query-button" @click="$emit('submit')">
          <span class="t2-button-content">
            <svg width="20" height="20" viewBox="0 0 24 24" fill="none">
              <path d="M15.5 14H14.71L14.43 13.73C15.41 12.59 16 11.11 16 9.5C16 5.91 13.09 3 9.5 3C5.91 3 3 5.91 3 9.5C3 13.09 5.91 16 9.5 16C11.11 16 12.59 15.41 13.73 14.43L14 14.71V15.5L19 20.49L20.49 19L15.5 14Z" fill="currentColor"/>
            </svg>
            {{ t("theme2.query_btn") }}
          </span>
          <div class="t2-button-shine"></div>
        </button>

        <!-- 安全提示 -->
        <div class="t2-security-info">
          <svg width="16" height="16" viewBox="0 0 24 24" fill="none">
            <path d="M18 8H17V6C17 3.24 14.76 1 12 1C9.24 1 7 3.24 7 6V8H6C4.9 8 4 8.9 4 10V20C4 21.1 4.9 22 6 22H18C19.1 22 20 21.1 20 20V10C20 8.9 19.1 8 18 8ZM12 17C10.9 17 10 16.1 10 15C10 13.9 10.9 13 12 13C13.1 13 14 13.9 14 15C14 16.1 13.1 17 12 17ZM15.1 8H8.9V6C8.9 4.29 10.29 2.9 12 2.9C13.71 2.9 15.1 4.29 15.1 6V8Z" fill="currentColor"/>
          </svg>
          {{ t("theme2.security_note") }}
        </div>
      </div>
    </div>

  </div>
</template>

<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import type { ThemeColors } from '@/config/themes';

interface Props {
  modelValue: string;
  colors: ThemeColors;
}

defineProps<Props>();

const { t } = useI18n();

const emit = defineEmits<{
  (e: 'update:modelValue', value: string): void;
  (e: 'submit'): void;
}>();
</script>

<style scoped>
.t2-theme-1 {
  background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
  padding-bottom: 2rem;
}

/* 顶部区域 */
.t2-header-section {
  position: relative;
  background: var(--primary-color);
  padding: 2rem 1rem 3rem;
  overflow: hidden;
}

.t2-floating-shapes {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  opacity: 0.1;
}

.t2-shape {
  position: absolute;
  background: white;
  border-radius: 50%;
}

.t2-shape-1 {
  width: 120px;
  height: 120px;
  top: -40px;
  right: -20px;
  animation: float 6s ease-in-out infinite;
}

.t2-shape-2 {
  width: 80px;
  height: 80px;
  bottom: 20px;
  left: -10px;
  animation: float 8s ease-in-out infinite;
  animation-delay: 1s;
}

.t2-shape-3 {
  width: 60px;
  height: 60px;
  top: 50%;
  left: 20%;
  animation: float 7s ease-in-out infinite;
  animation-delay: 2s;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(180deg); }
}

.t2-header-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.t2-logo-wrapper {
  margin-bottom: 1.5rem;
}

.t2-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.t2-main-title {
  font-size: 32px;
  font-weight: 900;
  color: white;
  margin: 0 0 0.5rem;
  letter-spacing: 1px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.t2-main-subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.95);
  margin: 0;
  font-weight: 500;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* 特性卡片 */
.t2-features-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding: 0 1rem;
  margin-top: -2rem;
  position: relative;
  z-index: 2;
}

.t2-feature-card {
  background: white;
  border-radius: 12px;
  padding: 1rem 0.75rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  text-align: center;
  transition: all 0.3s ease;
  border: 1px solid rgba(0, 65, 142, 0.08);
}

.t2-feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color);
}

.t2-feature-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.5rem;
  background: var(--primary-color);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.t2-feature-text {
  color: #1e293b;
}

.t2-feature-title {
  font-size: 14px;
  font-weight: 700;
}

/* 查询区域 */
.t2-query-section {
  padding: 1.5rem 1rem;
}

.t2-query-card {
  background: white;
  border-radius: 20px;
  padding: 1.5rem 1.25rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.t2-query-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.t2-query-icon-bg {
  width: 56px;
  height: 56px;
  background: var(--primary-color);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.t2-query-title-block {
  flex: 1;
}

.t2-query-title {
  font-size: 20px;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 0.25rem;
}

.t2-query-subtitle {
  font-size: 13px;
  color: #64748b;
  margin: 0;
}

.t2-input-section {
  margin-bottom: 1.5rem;
}

.t2-input-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.75rem;
}

.t2-phone-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
}

.t2-country-code {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary-color);
  padding: 0.5rem 0;
}

.t2-phone-input {
  flex: 1;
  font-size: 20px;
  font-weight: 600;
  color: #1e293b;
  border: none;
  outline: none;
  background: transparent;
  padding: 0.5rem 0;
  letter-spacing: 1px;
}

.t2-phone-input::placeholder {
  color: #cbd5e1;
  font-weight: 500;
}

.t2-input-underline {
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary-color);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.t2-phone-input:focus ~ .t2-input-underline {
  transform: scaleX(1);
}

.t2-query-button {
  width: 100%;
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 12px;
  background: var(--primary-color);
  color: white;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.t2-button-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.t2-button-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.t2-query-button:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.t2-query-button:hover .t2-button-shine {
  left: 100%;
}

.t2-query-button:active {
  transform: translateY(0);
}

.t2-security-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 12px;
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

.t2-security-info svg {
  color: #10b981;
  flex-shrink: 0;
}

/* 信息卡片 */
.t2-info-section {
  padding: 0 1.5rem 1.5rem;
}

.t2-info-card-modern {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.15);
}

.t2-info-header {
  margin-bottom: 1.25rem;
}

.t2-info-badge {
  background: rgba(255, 255, 255, 0.9);
  color: #92400e;
  font-size: 13px;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  display: inline-block;
  letter-spacing: 0.5px;
}

.t2-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.t2-info-item {
  text-align: center;
}

.t2-info-number {
  font-size: 24px;
  font-weight: 900;
  color: #92400e;
  margin-bottom: 0.25rem;
}

.t2-info-label {
  font-size: 12px;
  color: #78350f;
  font-weight: 600;
}

/* 底部提示 */
.t2-footer-tips {
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.t2-tip-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

.t2-tip-dot {
  width: 6px;
  height: 6px;
  background: var(--primary-color);
  border-radius: 50%;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .t2-main-title {
    font-size: 26px;
  }

  .t2-main-subtitle {
    font-size: 13px;
  }

  .t2-logo {
    width: 56px;
    height: 56px;
  }

  .t2-logo-wrapper {
    margin-bottom: 1.25rem;
  }

  .t2-features-section {
    gap: 0.5rem;
    padding: 0 0.75rem;
  }

  .t2-feature-card {
    padding: 0.75rem 0.5rem;
  }

  .t2-feature-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 0.375rem;
  }

  .t2-feature-title {
    font-size: 12px;
  }

  .t2-query-section {
    padding: 1rem 0.75rem;
  }

  .t2-query-card {
    padding: 1.25rem 1rem;
  }

  .t2-query-icon-bg {
    width: 48px;
    height: 48px;
  }

  .t2-query-title {
    font-size: 18px;
  }

  .t2-query-subtitle {
    font-size: 12px;
  }

  .t2-info-grid {
    gap: 0.75rem;
  }

  .t2-info-number {
    font-size: 20px;
  }
}
</style>
