<template>
  <div class="container">
    <h2 class="section-title">团队成员</h2>
    <div class="profile-container">
      <div class="profile" v-for="member in teamMembers" :key="member.id">
        <div class="profile-image">
          <img :src="member.image" alt="头像">
        </div>
        <div class="profile-info">
          <h3>{{ member.name }}</h3>
          <p class="profile-subtitle">学号：{{ member.studentId }}</p>
          <p class="profile-subtitle">具体分工：</p>
          <ul class="task-list">
            <li v-for="(task, index) in member.task" :key="index">{{ task }}</li>
          </ul>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { reactive } from 'vue';
     const teamMembers=reactive([
        {
          id: 1,
          name: '冯炜祖',
          studentId:'2023400958',
          image: '/public/image/f.png',
          task: ['前端页面开发', '用户登录模块', 'API 对接']
        },
        {
          id: 2,
          name: '华宇诚',
          studentId:'2023400922',
          image: '/public/image//h.png',
          task: ['数据库设计', '硬件接口开发', '报表生成模块']
        },
        {
          id: 3,
          name: '朱锦捷',
          studentId:'2023400924',
          image: '/public/image/z.png',
          task: ['项目规划', '实现后端逻辑', '测试系统功能']
        }
      ]);
</script>

<style>
.container {
  width: 90;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.section-title {
  color: #3182ce;
  font-size: 22px;
  margin-bottom: 20px;
}

.profile-container {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  width: 100%;
  overflow-x: auto;
}

.profile {
  display: flex;
  align-items: center;
  gap: 20px;
  background-color: #ffffff;
  border: 1px solid #bee3f8;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 6px rgba(66, 153, 225, 0.1);
  transition: all 0.3s ease;
  width: calc(100% / 3 - 20px);
}

.profile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.profile-info h3 {
  color: #2b6cb0;
  font-size: 28px;
}

.profile-info p {
  color: #4a5568;
  font-size: 18px;
}

.task-list {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.task-list li {
  margin-bottom: 8px;
  color: #2c5282;
}

.profile-container::-webkit-scrollbar {
  height: 8px;
  background-color: #f8faff;
}

.profile-container::-webkit-scrollbar-thumb {
  background-color: #bee3f8;
  border-radius: 4px;
}
</style>
