<template>
  <view class="container">
    <!-- 微信绿色头部 -->
    <view class="header">
      <view class="header-bg"></view>
      <!-- 成功图标 -->
      <view class="success-icon-wrap">
        <svg class="success-icon" viewBox="0 0 120 120">
          <circle cx="60" cy="60" r="52" fill="none" stroke="#FFFFFF" stroke-width="4" opacity="0.3"/>
          <circle cx="60" cy="60" r="44" fill="rgba(255,255,255,0.15)"/>
          <path d="M 38 60 L 52 76 L 82 46" fill="none" stroke="#FFFFFF" stroke-width="6" stroke-linecap="round" stroke-linejoin="round"/>
        </svg>
      </view>
      <text class="header-title">开通成功</text>
      <text class="header-subtitle">微信支付分已开通</text>
    </view>

    <!-- 分数卡片 -->
    <view class="score-card">
      <text class="score-label">当前微信支付分</text>
      <view class="score-value-row">
        <text class="score-number">650</text>
        <text class="score-unit">分</text>
      </view>
      <view class="score-badge">
        <text class="badge-dot"></text>
        <text class="badge-text">已达标 · 可享受先享后付服务</text>
      </view>
    </view>

    <!-- 权益卡片 -->
    <view class="benefits-section">
      <text class="section-title">已解锁权益</text>
      <view class="benefits-grid">
        <view class="benefit-card">
          <view class="benefit-icon benefit-icon-1">
            <text class="icon-emoji">💳</text>
          </view>
          <text class="benefit-title">先享后付</text>
          <text class="benefit-desc">开门后付款</text>
        </view>

        <view class="benefit-card">
          <view class="benefit-icon benefit-icon-2">
            <text class="icon-emoji">🛡️</text>
          </view>
          <text class="benefit-title">免密支付</text>
          <text class="benefit-desc">小额自动扣款</text>
        </view>

        <view class="benefit-card">
          <view class="benefit-icon benefit-icon-3">
            <text class="icon-emoji">⚡</text>
          </view>
          <text class="benefit-title">快速开门</text>
          <text class="benefit-desc">扫码即开</text>
        </view>
      </view>
    </view>

    <!-- 品牌标语 -->
    <view class="brand-wrap">
      <BrandSlogan type="score" :score="550" :dark="true" />
    </view>

    <!-- 底部按钮 -->
    <view class="footer">
      <button class="btn-start" @click="handleStart">开始使用</button>
    </view>
  </view>
</template>

<script setup lang="ts">
import BrandSlogan from '@/components/BrandSlogan.vue'

const handleStart = () => {
  uni.reLaunch({
    url: '/pages/index/index'
  })
}
</script>

<style lang="scss" scoped>
.container {
  min-height: 100vh;
  background: $color-bg-secondary;
  padding-bottom: 160rpx;
}

/* 绿色头部 */
.header {
  background: $color-wechat-green;
  padding: 48rpx 40rpx 44rpx;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.header-bg {
  position: absolute;
  top: -60rpx;
  right: -40rpx;
  width: 240rpx;
  height: 240rpx;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.success-icon-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 24rpx;
}

.success-icon {
  width: 120rpx;
  height: 120rpx;
}

.header-title {
  font-size: 44rpx;
  font-weight: 700;
  color: #FFFFFF;
  display: block;
  margin-bottom: 8rpx;
  letter-spacing: 4rpx;
}

.header-subtitle {
  font-size: 26rpx;
  color: rgba(255, 255, 255, 0.8);
  display: block;
}

/* 分数卡片 */
.score-card {
  margin: -30rpx 30rpx 30rpx;
  background: $color-bg-primary;
  border-radius: 20rpx;
  padding: 40rpx 32rpx;
  text-align: center;
  box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.06);
  position: relative;
  z-index: 1;
}

.score-label {
  font-size: 26rpx;
  color: $color-text-secondary;
  display: block;
  margin-bottom: 16rpx;
}

.score-value-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  margin-bottom: 20rpx;
}

.score-number {
  font-size: 96rpx;
  font-weight: 800;
  color: $color-wechat-green;
  line-height: 1;
}

.score-unit {
  font-size: 32rpx;
  color: $color-text-secondary;
  margin-left: 8rpx;
}

.score-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(7, 193, 96, 0.08);
  padding: 12rpx 28rpx;
  border-radius: 24rpx;
}

.badge-dot {
  width: 12rpx;
  height: 12rpx;
  border-radius: 50%;
  background: $color-wechat-green;
  margin-right: 10rpx;
  flex-shrink: 0;
}

.badge-text {
  font-size: 24rpx;
  color: $color-wechat-green;
}

/* 权益 */
.benefits-section {
  padding: 0 30rpx;
  margin-bottom: 30rpx;

  .section-title {
    font-size: 30rpx;
    font-weight: 600;
    color: $color-text-primary;
    margin-bottom: 20rpx;
    display: block;
  }

  .benefits-grid {
    display: flex;
    justify-content: space-between;
    gap: 20rpx;
  }

  .benefit-card {
    flex: 1;
    background: $color-bg-primary;
    border-radius: 16rpx;
    padding: 28rpx 16rpx;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04);

    .benefit-icon {
      width: 72rpx;
      height: 72rpx;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 16rpx;
      background: $color-wechat-green;

      .icon-emoji {
        font-size: 36rpx;
        color: #FFFFFF;
      }
    }

    .benefit-title {
      font-size: 26rpx;
      font-weight: 600;
      color: $color-text-primary;
      margin-bottom: 6rpx;
    }

    .benefit-desc {
      font-size: 22rpx;
      color: $color-text-secondary;
    }
  }
}

/* 品牌标语 */
.brand-wrap {
  display: flex;
  justify-content: center;
  padding: 0 30rpx;
  margin-bottom: 16rpx;
}

/* 底部按钮 */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24rpx 40rpx;
  padding-bottom: calc(24rpx + env(safe-area-inset-bottom));
  background: $color-bg-primary;
  box-shadow: 0 -2rpx 12rpx rgba(0, 0, 0, 0.05);
}

.btn-start {
  width: 100%;
  height: 88rpx;
  background: $color-wechat-green;
  border-radius: 44rpx;
  border: none;
  font-size: 32rpx;
  font-weight: 600;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;

  &:active {
    opacity: 0.9;
    transform: scale(0.98);
  }
}
</style>
