<template>
  <div class="guide-card">
    <div class="guide-illustration" style="background: linear-gradient(135deg, #f76b1c 0%, #fad961 100%);">
      <div class="illus-bubble bubble-1">🎁</div>
      <div class="illus-bubble bubble-2">💎</div>
      <div class="illus-center">🛒</div>
    </div>

    <div class="guide-body">
      <div class="guide-badge">Step 3</div>
      <h2 class="guide-title">积分商城，好礼等你</h2>
      <p class="guide-desc">用积分兑换心仪好礼！<br />从零食饮品到数码好物，应有尽有 🎉</p>

      <!-- 热门商品示意 -->
      <div class="goods-preview">
        <div class="goods-item" v-for="item in goods" :key="item.id">
          <div class="goods-emoji">{{ item.emoji }}</div>
          <div class="goods-name">{{ item.name }}</div>
          <div class="goods-points">{{ item.points }} 积分</div>
        </div>
      </div>
    </div>

    <div class="guide-footer">
      <button class="btn-primary" @click="handleGoMall">
        <span>🛍️</span> 去看看
      </button>
      <button v-if="false" class="btn-secondary" @click="$emit('next')">
        {{ isLast ? '完成新手教程 ✓' : '下一步' }}
      </button>
      <button class="btn-prev" v-if="!isFirst" @click="$emit('prev')">
        上一步
      </button>
    </div>
  </div>
</template>

<script>
export default {
  name: 'PointsMallGuide',
  props: {
    isLast: { type: Boolean, default: false },
    isFirst: { type: Boolean, default: false },
  },
  data() {
    return {
      goods: [
        { id: 1, emoji: '☕', name: '精品咖啡', points: 50 },
        { id: 2, emoji: '🎧', name: '无线耳机', points: 800 },
        { id: 3, emoji: '🧴', name: '护肤套装', points: 300 },
      ],
    }
  },
  methods: {
    handleGoMall() {
      this.$router.push('/home/pointsMall')
      setTimeout(() => this.$emit('next'), 500)
    },
  },
}
</script>

<style scoped>
.guide-card {
  width: 440px;
  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); }
}
.guide-illustration {
  position: relative;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.illus-center {
  font-size: 56px;
  z-index: 2;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.15));
}
.illus-bubble {
  position: absolute;
  font-size: 22px;
  animation: bubbleFloat 4s ease-in-out infinite;
}
.bubble-1 { top: 18px; left: 28px; animation-delay: 0s; }
.bubble-2 { bottom: 18px; right: 28px; animation-delay: 2s; }
@keyframes bubbleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.guide-body { padding: 24px 28px 16px; }
.guide-badge {
  display: inline-block;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #f76b1c;
  background: #fff4ec;
  border-radius: 12px;
  margin-bottom: 12px;
}
.guide-title {
  font-size: 20px;
  font-weight: 700;
  color: #1d2129;
  margin: 0 0 8px;
}
.guide-desc {
  font-size: 13px;
  line-height: 1.7;
  color: #86909c;
  margin: 0 0 16px;
}
.goods-preview {
  display: flex;
  gap: 10px;
}
.goods-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  background: #f7f9fc;
  border-radius: 12px;
  transition: all 0.25s;
}
.goods-item:hover { background: #fff4ec; transform: translateY(-2px); }
.goods-emoji { font-size: 26px; margin-bottom: 6px; }
.goods-name { font-size: 12px; color: #4e5969; font-weight: 500; margin-bottom: 4px; }
.goods-points { font-size: 12px; color: #f76b1c; font-weight: 700; }
.guide-footer {
  padding: 16px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #f76b1c, #fad961);
  border: none;
  border-radius: 22px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 14px rgba(247,107,28,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(247,107,28,0.45); }
.btn-secondary {
  height: 40px;
  font-size: 14px;
  font-weight: 500;
  color: #2C6FBF;
  background: #fff;
  border: 1.5px solid #2C6FBF;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.25s;
}
.btn-secondary:hover { background: #eaf2ff; }
.btn-prev {
  height: 40px;
  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>
