<template>
  <div class="guide-card wide">
    <div class="guide-illustration short" style="background: linear-gradient(135deg, #e87722 0%, #f9ca24 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 compact">
      <div class="guide-badge compact">Step 6</div>
      <h2 class="guide-title small">个人中心 — 我的积分</h2>
      <p class="guide-desc compact">点击顶部头像进入个人中心，查看积分明细：</p>

      <!-- 子功能说明 -->
      <div class="tab-list">
        <div class="tab-item" v-for="tab in tabs" :key="tab.id">
          <div class="tab-num">{{ tab.num }}</div>
          <div class="tab-info">
            <div class="tab-title">{{ tab.title }}</div>
            <div class="tab-desc">{{ tab.desc }}</div>
          </div>
          <span class="tab-icon">{{ tab.icon }}</span>
        </div>
      </div>
    </div>

    <div class="guide-footer compact">
      <button class="btn-primary" @click="handleGoProfile">
        <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>
import { setTab } from '@/utils/auth'

export default {
  name: 'ProfileGuide',
  props: {
    isLast: { type: Boolean, default: false },
    isFirst: { type: Boolean, default: false },
    isReplay: { type: Boolean, default: false },
  },
  data() {
    return {
      tabs: [
        { id: 1, num: '1', icon: '📋', title: '积分列表', desc: '查看积分收支明细与类型' },
        { id: 2, num: '2', icon: '📖', title: '积分规则', desc: '了解积分获取与扣减规则' },
        { id: 3, num: '3', icon: '⚡', title: '活跃度判定', desc: '查看活跃度评估标准' },
      ],
    }
  },
  methods: {
    handleGoProfile() {
      setTab('integral')
      this.$router.push('/myCenter')
      setTimeout(() => this.$emit('next'), 500)
    },
  },
}
</script>

<style scoped>
@import './guide-common.css';

/* Step 6 专属样式 */
.guide-badge { color: #e87722; background: #fff4e8; }
.btn-primary {
  background: linear-gradient(135deg, #e87722, #f9ca24);
  box-shadow: 0 4px 14px rgba(232,119,34,0.3);
}
.btn-primary:hover { box-shadow: 0 6px 18px rgba(232,119,34,0.45); }

/* Tab 列表 */
.tab-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 0; }
.tab-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f7f9fc;
  border-radius: 10px;
  transition: all 0.25s;
}
.tab-item:hover { background: #fff4e8; }
.tab-num {
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: #e87722;
  border-radius: 50%;
  flex-shrink: 0;
}
.tab-info { flex: 1; }
.tab-title { font-size: 13px; font-weight: 600; color: #1d2129; }
.tab-desc { font-size: 12px; color: #86909c; margin-top: 2px; }
.tab-icon { font-size: 20px; }
</style>
