<template>
  <view class="mine-skeleton-page">
    <!-- 顶部用户信息（对应新布局） -->
    <view class="sk-header">
      <view class="sk-header__left">
        <view class="sk-name skeleton-item"></view>
        <view class="sk-sub-row">
          <view class="sk-sub-text skeleton-item"></view>
          <view class="sk-badge skeleton-item"></view>
        </view>
        <view class="sk-date skeleton-item"></view>
      </view>
      <view class="sk-avatar skeleton-item"></view>
    </view>

    <!-- 三项数据胶囊卡 -->
    <view class="sk-stats skeleton-item">
      <view class="sk-stats__cell" v-for="i in 3" :key="i">
        <view class="sk-num skeleton-item"></view>
        <view class="sk-label skeleton-item"></view>
      </view>
      <view class="sk-divider" v-if="true"></view>
    </view>

    <!-- 会员横幅 -->
    <view class="sk-banner skeleton-item">
      <view class="sk-banner__title skeleton-item"></view>
      <view class="sk-banner__sub skeleton-item"></view>
    </view>

    <!-- 菜单列表卡片 -->
    <view class="sk-menu">
      <view class="sk-menu__row" v-for="i in 9" :key="i">
        <view class="sk-menu__left">
          <view class="sk-menu__icon skeleton-item"></view>
          <view class="sk-menu__text skeleton-item"></view>
        </view>
        <view class="sk-menu__arrow skeleton-item"></view>
      </view>
    </view>
  </view>
</template>

<script setup lang="ts">
// 个人主页骨架屏组件
</script>

<style scoped lang="scss">
// 通用骨架屏样式
.skeleton-item {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

// 闪烁动画
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.mine-skeleton-page {
  background-color: #f5f5f5;
  padding: 0 30rpx 30rpx;
}

.sk-header {
  padding-top: 32rpx;
  padding-bottom: 28rpx;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24rpx;

  &__left {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
  }
}

.sk-name {
  width: 420rpx;
  height: 44rpx;
  border-radius: 10rpx;
}

.sk-sub-row {
  margin-top: 12rpx;
  display: flex;
  align-items: center;
  gap: 12rpx;
}

.sk-sub-text {
  width: 200rpx;
  height: 22rpx;
  border-radius: 999rpx;
}

.sk-badge {
  width: 120rpx;
  height: 22rpx;
  border-radius: 999rpx;
}

.sk-date {
  margin-top: 10rpx;
  width: 360rpx;
  height: 22rpx;
  border-radius: 8rpx;
}

.sk-avatar {
  width: 130rpx;
  height: 130rpx;
  border-radius: 50%;
  flex-shrink: 0;
}

.sk-stats {
  margin-top: 24rpx;
  height: 120rpx;
  border-radius: 60rpx;
  background: #fff;
  box-shadow: 0 12rpx 30rpx rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  padding: 0 20rpx;
  position: relative;
}

.sk-stats__cell {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10rpx;
}

.sk-num {
  width: 70rpx;
  height: 30rpx;
  border-radius: 8rpx;
}

.sk-label {
  width: 90rpx;
  height: 20rpx;
  border-radius: 8rpx;
}

.sk-divider {
  display: none;
}

.sk-banner {
  margin-top: 24rpx;
  height: 152rpx;
  border-radius: 24rpx;
  overflow: hidden;
  background: #fff;
  padding: 22rpx 28rpx;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sk-banner__title {
  width: 420rpx;
  height: 32rpx;
  border-radius: 10rpx;
}

.sk-banner__sub {
  width: 520rpx;
  height: 20rpx;
  border-radius: 8rpx;
}

.sk-menu {
  margin-top: 14rpx;
  background: #fff;
  border-radius: 24rpx;
  overflow: hidden;
}

.sk-menu__row {
  padding: 28rpx 24rpx;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1rpx solid #efefef;

  &:last-child {
    border-bottom: none;
  }
}

.sk-menu__left {
  display: flex;
  align-items: center;
  gap: 18rpx;
}

.sk-menu__icon {
  width: 44rpx;
  height: 44rpx;
  border-radius: 10rpx;
}

.sk-menu__text {
  width: 240rpx;
  height: 26rpx;
  border-radius: 10rpx;
}

.sk-menu__arrow {
  width: 22rpx;
  height: 30rpx;
  border-radius: 8rpx;
}
</style> 