.nav-menu {
  display: flex;
  list-style: none;
  align-items: center;
  height: 78px;
  margin: 0;
  padding: 0;
  flex-grow: 1;
  justify-content: end;
  margin-right: calc(4vw + 20px);
}
/* 添加导航栏透明样式 */
.navbar {
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  z-index: 1000;
  transition: all 0.3s ease;
  background-color: transparent;
  padding: 5px 0;
}

/* 透明导航样式 */
.navbar.transparent {
  background-color: transparent;
}
.mobile-close-header {
  display: none;
}

.navbar.transparent .nav-menu > li > a {
  color: #fff;
}

.navbar.transparent .search-icon img {
  filter: brightness(0) invert(1); /* 将图标变为白色 */
}

/* 添加透明状态下的子菜单样式 */
.navbar.transparent .submenu {
  background-color: transparent; /* 半透明黑色背景 */
}

.navbar.transparent .submenu li a {
  color: #fff; /* 子菜单文字变白 */
}

/* 透明状态下的导航栏背景 设置呈白色  */
/* 下划线颜色 */

/* 下划线颜色也改为白色 */
.navbar.transparent .nav-menu > li .nav-link::after {
  background-color: #fff;
}

.navbar.transparent .submenu li::after {
  background-color: #fff; /* 分隔线变为半透明白色 */
}
/* 添加导航栏滚动样式 */
.navbar.scrolled {
  background-color: #fff;
}
/* 滚动时的子菜单背景 */
.navbar.scrolled .submenu {
  background-color: rgba(255, 255, 255, 0.8);
}


/* 滚动时的搜索图标 */
.navbar.scrolled .search-icon img {
  filter: none;
}
/* 默认导航样式 */
.logo {
  flex-shrink: 0;
}
.logo img {
  height: 43px;
}
/* 搜索图标样式 */
.search-icon {
  flex-shrink: 0;
  cursor: pointer;
}
.mobile-menu-icon {
  display: none;
}

.search-icon img {
  width: 20px; /* 调整图标大小 */
  height: 20px;
  margin-left: 20px;
}
.nav-menu > li > a {
  color: var(--dark-color);
  font-size: var(--font-size-18);
  white-space: nowrap;
  padding: 0 30px; 
  transition: all 0.3s ease;
}
.nav-link {
  display: block;
  position: relative;
  transition: color 0.3s;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  width: 50%;
  height: 2px;
  background-color: var(--primary-color);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}
/* 修改submenu样式使其占满屏幕宽度 */
.submenu {
  position: absolute;
  width: 100vw;
  top: 100%;
  left: 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.submenu li a.submenu-link {
  color: var(--primary-color);
}

/* 添加竖线分隔符的样式 */
.submenu li {
  position: relative;
}

/* 为除了第一个和最后一个之外的所有li添加竖线 */
.submenu li:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 16px; /* 竖线高度 */
  width: 1px;
  background-color: var(--text-color); /* 竖线颜色 */
}

.nav-menu > li:hover .submenu {
  opacity: 1;
  visibility: visible;
}
html[lang="en"] .submenu li a {
  text-align: center;
}
.submenu li a {
  display: block;
  padding: 12px 20px;

  color: var(--text-color);
  text-decoration: none;
  /* white-space: nowrap; */
  font-size: var(--font-size-16);
}

.submenu li a:hover {
  color: var(--primary-color);
}

/* 激活状态 */
.nav-menu > li > a:hover {
  color: var(--primary-color);
}


/* 中等屏幕 (1280px - 1439px) */
@media screen and (min-width: 1280px) and (max-width: 1439px) {
  .nav-menu > li > a {
    font-size: var(--font-size-16);
    padding: 0 20px;
  }
  .submenu li a {
    font-size: var(--font-size-14);
  }
}

/* 平板及小屏幕 (1024px - 1279px) */
@media screen and (min-width: 1024px) and (max-width: 1279px) {
  .nav-menu > li > a {
    font-size: var(--font-size-14);
    padding: 0 20px;
  }
  .submenu li a {
    font-size: var(--font-size-12);
  }
}
/* 在你现有的CSS基础上添加移动端菜单样式 */
@media screen and (max-width: 1023px) {
  html[lang="en"] .submenu li a {
    text-align: left;
  }
  .nav-menu {
    display: none;
    position: absolute;
    top: 0; /* 导航栏高度 */
    left: 0;
    width: 100%;
    height: 100vh;
    background: #fff;
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
    margin: 0;
    justify-content: flex-start;
    overflow: hidden;
    overflow-y: auto;
  }
  .nav-link::after{
    display: none;
  }
  
  .navbar.transparent .nav-menu > li > a {
    color: var(--dark-color);
  }
  
  .navbar.transparent .submenu li a {
    color: var(--dark-color);
  }

  .nav-menu.show .nav-item .nav-link {
    color: var(--primary-color);
  }
  .nav-menu.show {
    display: flex;
  }

  .nav-menu > li {
    width: 100%;
    border-bottom: 1px solid #eee;
  }

  .nav-menu > li > a {
    padding: 15px 20px;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  /* 子菜单样式 */
  .submenu {
    position: static;
    width: 100%;
    display: none;
    opacity: 1;
    visibility: visible;
    padding: 0;
  }

  .submenu.show {
    display: block;
  }

  .submenu li {
    border-top: 1px solid #eee;
  }

  .submenu li::after {
    display: none; /* 移除竖线 */
  }

  .submenu li a {
    padding: 12px 30px;
  }

  /* 添加箭头指示器 */
  .nav-item:not(:first-child) > a::after,
  .nav-item:not(:last-child) > a::after{
    content: '';
    width: 8px;
    height: 8px;
    border-right: 2px solid #666;
    border-bottom: 2px solid #666;
    transform: rotate(45deg);
    transition: transform 0.3s;
  }

  /* 首页不需要箭头指示器 */
  .nav-item.active:first-child > a::after {
    display: none;
  }
  .nav-item.active:last-child > a::after {
    display: none;
  }
/*   .nav-item.active > a::after {
    transform: rotate(-135deg);
  } */

  /* 移动端菜单图标样式 */
  .mobile-menu-icon {
    display: inline-block;
    cursor: pointer;
  }
  
  .mobile-close-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 20px;
    height: 78px;
  }
  .mobile-close-header .logo-mini img {
    height: 36px;
  }
  .mobile-close-btn {
    width: 20px;
    height: 20px;
  }

}
/* 平板 (768px - 1023px) */
@media screen and (min-width: 768px) and (max-width: 1023px) {
  .mobile-menu-icon {
    display: inline-block;
  }
}

/* 移动端 (480px - 767px) */
@media screen and (min-width: 480px) and (max-width: 767px) {
  .mobile-menu-icon {
    display: inline-block;
  }
}

/* 小屏手机 (375px 及以下) */
@media screen and (max-width: 479px) {
  .mobile-menu-icon {
    display: inline-block;
  }
}


