<template>
  <div class="top-music-recommend">
    <h2 class="section-title">TOP音乐推荐</h2>
    <div class="music-list">
      <div class="music-item" v-for="music in musicList" :key="music.id">
        <div class="music-cover">
          <img :src="music.cover" :alt="music.title" />
          <div class="play-btn">▶</div>
        </div>
        <div class="music-info">
          <h3>{{ music.title }}</h3>
          <p>{{ music.artist }}</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref, onMounted } from 'vue';

const musicList = ref<any[]>([]);

onMounted(() => {
  // TODO: 加载音乐推荐数据
});
</script>

<style lang="scss" scoped>
.top-music-recommend {
  padding: 40px;
  background: white;
  border-radius: 8px;
  margin: 20px;
}

.section-title {
  font-size: 24px;
  font-weight: 600;
  color: #141F38;
  margin-bottom: 24px;
}

.music-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.music-item {
  cursor: pointer;
}

.music-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: #f5f5f5;
  border-radius: 8px;
  overflow: hidden;
  
  img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  .play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: rgba(198, 40, 40, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transition: opacity 0.3s;
  }
  
  &:hover .play-btn {
    opacity: 1;
  }
}

.music-info {
  margin-top: 12px;
  
  h3 {
    font-size: 16px;
    font-weight: 500;
    color: #141F38;
    margin-bottom: 4px;
  }
  
  p {
    font-size: 14px;
    color: #666;
  }
}
</style>

