<template>
  <!-- 今日推荐容器 -->
  <view class="today-recommend">
    <!-- 区域标题栏 -->
    <view class="section-header">
      <!-- 区域标题 -->
      <text class="section-title">今日推荐</text>
      <!-- 查看更多按钮 -->
      <view class="view-more">
        <text>查看更多</text>
        <text class="arrow">
			<uni-icons type="right" size="20" color="#8CA0B0"></uni-icons>
		</text>
      </view>
    </view>

    <!-- 推荐列表 -->
    <view class="recommend-list">
      <!-- 推荐项 -->
      <view
        v-for="(item, index) in recommends"
        :key="index"
        class="recommend-item"
      >
        <!-- 推荐项图片 -->
        <image :src="item.image" mode="aspectFill" class="item-image" />
        <!-- 推荐项内容区域 -->
        <view class="item-content">
          <!-- 推荐项标题 -->
          <text class="item-title">{{ item.title }}</text>
          <!-- 推荐项标签列表 -->
          <view class="item-tags">
            <text v-for="(tag, tagIndex) in item.tags" :key="tagIndex" class="tag">{{ tag }}</text>
          </view>
          <!-- 推荐项描述 -->
          <text class="item-desc">{{ item.desc }}</text>
        </view>
        <!-- 推荐项操作区域 -->
        <view class="item-action">
          <!-- 开始训练按钮 -->
          <view class="start-btn">
            <text class="start-btn-text">开始训练</text>
          </view>
          <!-- 参与人数 -->
          <text class="participants">{{ item.participants }}人参与</text>
        </view>
      </view>
    </view>
  </view>
</template>

<script setup>
// 今日推荐数据列表
const recommends = [
  {
    image: 'https://images.unsplash.com/photo-1571019613454-1cb2f99b2d8b?w=300&q=80',
    title: '晨间活力唤醒跑',
    tags: ['20分钟', '初级'],
    desc: '唤醒身体，开启活力一天',
    participants: '2784'
  },
  {
    image: 'https://images.unsplash.com/photo-1517836357463-d25dfeac3438?w=300&q=80',
    title: '全身力量塑形',
    tags: ['50分钟', '中级'],
    desc: '全身综合训练，塑造完美线条',
    participants: '4126'
  },
  {
    image: 'https://images.unsplash.com/photo-1490645935967-10de6ba17061?w=300&q=80',
    title: '蛋白增肌饮食指南',
    tags: ['营养饮食', '12分钟'],
    desc: '科学饮食搭配，助力肌肉增长',
    participants: '1865'
  }
]
</script>

<style lang="scss" scoped>
.today-recommend {
  padding: 0 24rpx;
  position: relative;
  z-index: 1;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24rpx;
}

.section-title {
  font-size: 34rpx;
  font-weight: 700;
  color: #2D4A5A;
}

.view-more {
  display: flex;
  align-items: center;
  gap: 4rpx;
  font-size: 26rpx;
  color: var(--tabbar-text-inactive);
}

.arrow {
  font-size: 32rpx;
}

.recommend-list {
  display: flex;
  flex-direction: column;
  gap: 24rpx;
}

.recommend-item {
  display: flex;
  gap: 24rpx;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 24rpx;
  padding: 20rpx;
  box-shadow: 0 8rpx 28rpx var(--shadow-blue-light);
  border: 1rpx solid rgba(255, 255, 255, 0.6);
}

.item-image {
  width: 200rpx;
  height: 160rpx;
  border-radius: 16rpx;
  flex-shrink: 0;
}

.item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.item-title {
  font-size: 30rpx;
  font-weight: 600;
  color: #2D4A5A;
  margin-bottom: 12rpx;
}

.item-tags {
  display: flex;
  gap: 12rpx;
  margin-bottom: 12rpx;
}

.tag {
  padding: 6rpx 16rpx;
  background: rgba(122, 181, 204, 0.12);
  border-radius: 8rpx;
  font-size: 22rpx;
  color: #6BA8C0;
}

.item-desc {
  font-size: 24rpx;
  color: var(--tabbar-text-inactive);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-action {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 16rpx;
  flex-shrink: 0;
}

.start-btn {
  padding: 16rpx 28rpx;
  background: rgba(130, 220, 130, 0.9);
  border-radius: 9999rpx;
  box-shadow: 0 6rpx 20rpx rgba(130, 220, 130, 0.4);
}

.start-btn-text {
  font-size: 24rpx;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
}

.participants {
  font-size: 22rpx;
  color: var(--tabbar-text-inactive);
  white-space: nowrap;
}
</style>