<template>
  <div class="step1-card">
    <!-- 顶部插画区域 -->
    <div class="step1-illustration">
      <div class="illustration-bubble bubble-1">🎁</div>
      <div class="illustration-bubble bubble-2">⭐</div>
      <!-- <div class="illustration-bubble bubble-3">🏆</div> -->
      <div class="illustration-icon-wrap">
        <div class="illustration-icon">🎉</div>
        <div class="illustration-ring ring-1"></div>
        <div class="illustration-ring ring-2"></div>
      </div>
    </div>

    <!-- 文字内容 -->
    <div class="guide-body step1-body">
      <h2 class="step1-title">欢迎来到誉商城！</h2>
      <p class="step1-desc">
        这里是你的<strong>专属积分奖励平台</strong><br />
        完成任务赚积分，积分兑换好礼！
      </p>

      <!-- 特性展示 -->
      <div class="step1-features">
        <div class="feature-item">
          <span class="feature-icon">📌</span>
          <span class="feature-text">每日签到赚积分</span>
        </div>
        <div class="feature-item">
          <span class="feature-icon">🛒</span>
          <span class="feature-text">积分商城兑好礼</span>
        </div>
        <div class="feature-item">
          <span class="feature-icon">🎊</span>
          <span class="feature-text">参与活动赢大奖</span>
        </div>
      </div>
    </div>

    <!-- 底部按钮 -->
    <div class="step1-footer">
      <button class="btn-start" @click="$emit('next')">
        {{ isLast ? '完成新手教程' : '开始探索' }}
        <span class="btn-arrow" v-if="!isLast">→</span>
        <span class="btn-check" v-else>✓</span>
      </button>
      <button class="btn-prev" v-if="!isFirst" @click="$emit('prev')">
        上一步
      </button>
    </div>
  </div>
</template>

<script>
export default {
  name: 'WelcomeGuide',
  props: {
    isLast: {
      type: Boolean,
      default: false,
    },
    isFirst: {
      type: Boolean,
      default: false,
    },
    isReplay: { type: Boolean, default: false },
  },
}
</script>

<style scoped>
.step1-card {
  width: 500px;
  max-width: 90vw;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  animation: cardFloat 0.5s ease-out;
}

@keyframes cardFloat {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ---- 插画区域 ---- */
.step1-illustration {
  position: relative;
  height: 180px;
  background: linear-gradient(135deg, #2C6FBF 0%, #5B9FE6 50%, #87CEEB 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.illustration-icon-wrap {
  position: relative;
  z-index: 2;
}

.illustration-icon {
  width: 80px;
  height: 80px;
  line-height: 80px;
  text-align: center;
  font-size: 52px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  backdrop-filter: blur(4px);
}

.illustration-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  animation: ringPulse 3s ease-in-out infinite;
}

.ring-1 {
  width: 120px;
  height: 120px;
  margin-top: -60px;
  margin-left: -60px;
  animation-delay: 0s;
}

.ring-2 {
  width: 160px;
  height: 160px;
  margin-top: -80px;
  margin-left: -80px;
  animation-delay: 1.5s;
}

@keyframes ringPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.3;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.6;
  }
}

.illustration-bubble {
  position: absolute;
  font-size: 24px;
  z-index: 1;
  animation: bubbleFloat 4s ease-in-out infinite;
}

.bubble-1 {
  top: 20px;
  left: 30px;
  animation-delay: 0s;
}
.bubble-2 {
  top: 30px;
  right: 40px;
  animation-delay: 1.3s;
}
.bubble-3 {
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  animation-delay: 2.6s;
}

@keyframes bubbleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ---- 内容区域 ---- */
.step1-body {
  text-align: center;
  min-height: calc(300px + 18px);
}

.step1-title {
  font-size: 22px;
  font-weight: 700;
  color: #1d2129;
  margin: 0 0 12px;
}

.step1-desc {
  font-size: 14px;
  line-height: 1.8;
  color: #86909c;
  margin: 0 0 24px;
}

.step1-desc strong {
  color: #2C6FBF;
}

/* ---- 特性卡片 ---- */
.step1-features {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  padding: 14px 8px;
  background: #f7f9fc;
  border-radius: 12px;
  transition: all 0.25s;
}

.feature-item:hover {
  background: #eaf2ff;
  transform: translateY(-2px);
}

.feature-icon {
  font-size: 22px;
}

.feature-text {
  font-size: 12px;
  color: #4e5969;
  font-weight: 500;
}

/* ---- 底部按钮 ---- */
.step1-footer {
  padding: 0 32px 28px;
  text-align: center;
}

.btn-start {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #2C6FBF, #5B9FE6);
  border: none;
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 16px rgba(44, 111, 191, 0.35);
}

.btn-start:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(44, 111, 191, 0.5);
}

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

.btn-arrow {
  font-size: 18px;
  transition: transform 0.25s;
}

.btn-start:hover .btn-arrow {
  transform: translateX(4px);
}

.btn-prev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 40px;
  margin-top: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #86909c;
  background: #f7f9fc;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.25s;
}

.btn-prev:hover {
  color: #4e5969;
  background: #eef1f6;
}
</style>
