<script setup>
import {useRoute, useRouter} from 'vue-router'

const router = useRouter()
const route = useRoute()

const menuItems = [
  {name: '首页', path: '/'},
  {name: '产品服务', path: '/products'},
  {name: '关于我们', path: '/about'},
  {name: '联系我们', path: '/contact'}
]
</script>

<template>
  <div class="header-wrapper">
    <el-menu
        :default-active="route.path"
        :ellipsis="false"
        class="header-menu"
        mode="horizontal"
    >
      <div class="logo">
        <span class="logo-text">团队名</span>
      </div>
      <div class="menu-items">
        <router-link
            v-for="item in menuItems"
            :key="item.path"
            :to="item.path"
            class="menu-item"
        >
          {{ item.name }}
        </router-link>
      </div>
    </el-menu>
  </div>
</template>

<style scoped>
.header-wrapper {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-menu {
  max-width: 1200px;
  margin: 0 auto;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 70px;
}

.logo {
  display: flex;
  align-items: center;
}

.logo-text {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, #0066ff 0%, #00d4ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  cursor: pointer;
}

.menu-items {
  display: flex;
  gap: 40px;
  align-items: center;
}

.menu-item {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
}

.menu-item:hover {
  color: var(--primary-color);
  background: rgba(0, 102, 255, 0.05);
}

.menu-item.router-link-active {
  color: var(--primary-color);
  font-weight: 600;
}

.menu-item.router-link-active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

@media (max-width: 768px) {
  .header-menu {
    padding: 0 16px;
  }

  .menu-items {
    gap: 20px;
  }

  .menu-item {
    font-size: 14px;
    padding: 6px 12px;
  }

  .logo-text {
    font-size: 20px;
  }
}
</style>