<template>
  <section class="banner">
    <div class="banner-bg">
      <!-- 替换为实际背景图路径 -->
      <img src="https://images.health.ufutx.com/202506/13/c963e7b0e605f16d139fb88789f3a452.png" alt="Banner背景" />
    </div>
    <div class="news-panel">
      <div
        v-for="(item, index) in newsList"
        :key="index"
        class="news-item"
        :class="{ active: activeIndex === index }"
        @mouseenter="activeIndex = index"
        @mouseleave="activeIndex = null"
      >
        <div class="icon">
          <img :src="activeIndex === index ? item.hoverIcon : item.icon" />
        </div>
        <span class="text">{{ item.title }}</span>
      </div>
    </div>
    <!--    <div class="banner-content">-->
    <!--      <h1 class="main-title">友福同享智能AI健康方案</h1>-->
    <!--      <h2 class="sub-title">智慧科技创造未来</h2>-->
    <!--      <button class="action-btn">用AI智能创造未来</button>-->
    <!--      <p class="contact-phone">181-4852-2763</p>-->
    <!--    </div>-->
  </section>
</template>

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

const activeIndex = ref<number | null>(null)

const newsList = [
  {
    title: '新闻！热门健康方案服务',
    icon: 'https://images.health.ufutx.com/202506/13/2acac19e00b1621a7fc2143323deafd7.png',
    hoverIcon: 'https://images.health.ufutx.com/202506/13/2acac19e00b1621a7fc2143323deafd7.png'
  },
  {
    title: '新闻专访！健康方案',
    icon: 'https://images.health.ufutx.com/202506/13/00b620ad60ad988755f8609422a3b13a.png',
    hoverIcon: 'https://images.health.ufutx.com/202506/13/00b620ad60ad988755f8609422a3b13a.png'
  },
  {
    title: '新闻！健康方案专访频道',
    icon: 'https://images.health.ufutx.com/202506/13/00b620ad60ad988755f8609422a3b13a.png',
    hoverIcon: 'https://images.health.ufutx.com/202506/13/00b620ad60ad988755f8609422a3b13a.png'
  },
  {
    title: '专访新闻！健康方案',
    icon: 'https://images.health.ufutx.com/202506/13/27550d3aa8786ca56a1b73f64967d45d.png',
    hoverIcon: 'https://images.health.ufutx.com/202506/13/27550d3aa8786ca56a1b73f64967d45d.png'
  },
  {
    title: '新闻！健康方案专访频道',
    icon: 'https://images.health.ufutx.com/202506/13/11ccc759cfe3bbbc27ff9bcd34f074d0.png',
    hoverIcon: 'https://images.health.ufutx.com/202506/13/11ccc759cfe3bbbc27ff9bcd34f074d0.png'
  }
]
// 暂无逻辑，纯展示
</script>

<style scoped lang="less">
.banner {
  //width: 100%;
  position: relative;
  text-align: center;
  color: #fff;

  .banner-bg {
    width: 100%;
    overflow: hidden;

    img {
      width: 100%;
      height: auto;
      display: block;
    }
  }

  .news-panel {
    position: absolute;
    top: 230px;
    right: 169px;
    padding: 20px 20px 0 20px;
    width: 330px;
    height: 384px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    background: rgba(51, 51, 51, 0.3);
    backdrop-filter: blur(10px);
    .news-item {
      display: flex;
      align-items: center;
      padding: 12px;
      border-radius: @border-radius-md;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      cursor: pointer;
      margin-bottom: 12px;
      &:hover,
      &.active {
        background: rgba(255, 255, 255, 0.3);
        transform: translateX(6px);
      }

      .icon {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        overflow: hidden;
        margin-right: 15px;
        transition: transform 0.3s ease;

        img {
          width: 100%;
          height: 100%;
          object-fit: cover;
          transition: all 0.3s ease;
        }
      }

      .text {
        font-size: @font-size-md;
        color: #ffffff;
        transition: color 0.3s ease;
      }

      &:hover .text,
      &.active .text {
        color: @text-color;
      }

      &:hover .icon,
      &.active .icon {
        background-image: linear-gradient(to bottom, #6280d0, #4bbce9);
        transform: scale(1.15); // 图标轻微放大
      }
    }
  }
}

// 响应式适配
@media (max-width: 768px) {
  .banner-content {
    .main-title {
      font-size: 32px;
    }
    .sub-title {
      font-size: 18px;
    }
    .action-btn {
      font-size: 16px;
      padding: 10px 24px;
    }
  }
}
</style>
