/* ========== 头部样式 ========== */
.header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 80px;
  z-index: 1000;
  display: flex;
  justify-content: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background-color: transparent;
}

/* 头部隐藏状态 */
.header.hidden {
  transform: translateX(-50%) translateY(-100%);
  opacity: 0;
}

/* 头部显示状态 */
.header.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* 确保头部在页面顶部时始终可见 */
.header:not(.scrolled) {
  background-color: transparent;
}

.header:not(.scrolled) .menu-item > span,
.header:not(.scrolled) .menu-item > a {
  color: #ffffff;
}

.header:not(.scrolled) .logo {
  filter: none;
}

.header-container {
  max-width: 1200px;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin: 0 30px;
}

.header-logo .logo {
  height: 34px;
}

.nav-menu .menu-list {
  display: flex;
  align-items: center;
  height: 80px;
}

.menu-item {
  margin-left: 32px;
  position: relative;
  cursor: pointer;
}

.menu-item:first-child {
  margin-left: 0;
}

.menu-item > span,
.menu-item > a {
  display: flex;
  align-items: center;
  height: 80px;
  color: #ffffff;
  font-size: 15px;
  font-family: "AlibabaPuHuiTi-2-65-Medium";
  transition: color 0.3s ease;
  text-decoration: none;
  white-space: nowrap;
  min-width: fit-content;
}

/* 为没有下拉箭头的菜单项添加右侧占位空间，保持对齐 */
.menu-item > a:not(:has(.dropdown-icon))::after {
  content: '';
  width: 18px;
  height: 12px;
  margin-left: 6px;
  flex-shrink: 0;
}

.menu-item:hover > span,
.menu-item:hover > a {
  color: #00bfb3;
}

.menu-item.active > span,
.menu-item.active > a {
  color: #00bfb3;
}

.menu-list .active > a {
  color: #00bfb3 !important;
  font-weight: 600;
}

.submenu .active {
  color: #00bfb3 !important;
  font-weight: 600;
}

/* 导航菜单下拉箭头图标 */
.menu-item .dropdown-icon {
  width: 12px;
  height: 12px;
  margin-left: 6px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
  opacity: 0.8;
  filter: brightness(0.9);
  flex-shrink: 0;
}

/* 鼠标悬停时的箭头动画效果 */
.menu-item:hover .dropdown-icon {
  transform: rotate(180deg);
  opacity: 1;
  filter: brightness(1);
}

/* 滚动状态下的图标样式 */
.header.scrolled .menu-item .dropdown-icon {
  filter: brightness(0.6);
}

.header.scrolled .menu-item:hover .dropdown-icon {
  filter: brightness(0.4);
}

/* 子菜单 */
.submenu {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  padding: 20px 0;
  min-width: 120px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.menu-item:hover .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(10px);
}

.submenu-item {
  padding: 8px 20px;
  color: #333;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: block;
  text-align: center;
}

.submenu-item:hover {
  background-color: #f5f5f5;
  color: #00bfb3;
}

/* 滚动时头部样式变化 */
.header.scrolled {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
}

.header.scrolled .menu-item > span,
.header.scrolled .menu-item > a {
  color: #333;
}

.header.scrolled .menu-item:hover > span,
.header.scrolled .menu-item:hover > a,
.header.scrolled .menu-item.active > span,
.header.scrolled .menu-item.active > a {
  color: #00bfb3;
}

.header.scrolled .logo {
  filter: brightness(0);
}
