<template>
  <div class="guide-card">
    <div class="guide-illustration" style="background: linear-gradient(135deg, #11998e 0%, #38ef7d 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 5</div>
      <h2 class="guide-title">完成任务，积分翻倍</h2>
      <p class="guide-desc">多种积分获取渠道，轻松累积积分！<br />完成不同任务获取丰厚积分奖励。</p>

      <!-- 积分渠道 -->
      <div class="channel-grid">
        <div class="channel-item" v-for="item in channels" :key="item.id">
          <span class="channel-icon">{{ item.icon }}</span>
          <span class="channel-name">{{ item.name }}</span>
          <span class="channel-points">+{{ item.points }}</span>
        </div>
      </div>
    </div>

    <div class="guide-footer">
      <button class="btn-primary" @click="handleGoEarn">
        <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: 'EarnPointsGuide',
  props: {
    isLast: { type: Boolean, default: false },
    isFirst: { type: Boolean, default: false },
  },
  data() {
    return {
      channels: [
        { id: 1, icon: '✅', name: '每日签到', points: 10 },
        { id: 2, icon: '🎓', name: '培训学习', points: 50 },
        { id: 3, icon: '🏆', name: '员工表彰', points: 200 },
        { id: 4, icon: '📊', name: '完成指标', points: 100 },
        { id: 5, icon: '🎉', name: '参与活动', points: 80 },
        { id: 6, icon: '👥', name: '投票调研', points: 20 },
      ],
    }
  },
  methods: {
    handleGoEarn() {
      this.$router.push('/home/earnPoints')
      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; }
.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: #11998e;
  background: #e8fdf5;
  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;
}
.channel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.channel-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  background: #f7f9fc;
  border-radius: 10px;
  transition: all 0.25s;
}
.channel-item:hover { background: #e8fdf5; transform: translateY(-2px); }
.channel-icon { font-size: 20px; }
.channel-name { font-size: 11px; color: #4e5969; font-weight: 500; }
.channel-points { font-size: 12px; color: #11998e; 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, #11998e, #38ef7d);
  border: none;
  border-radius: 22px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 14px rgba(17,153,142,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(17,153,142,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>
