/* 基础样式 */
body {
  margin: 0;
  font-family: Arial, sans-serif;
}

li {
  list-style-type: none;
}

a {
  text-decoration: none;
  color: inherit;
}

.navbar_box {
  position: static;
  background-color: transparent;
  /* 背景透明 */
  position: fixed;
  width: 100%;
  height: auto;
  top: 0;
  z-index: 999;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 30px 20px;
  position: relative;
}

.logo {
  display: block;
  color: white;
  font-weight: bold;
  max-width: 80px;
}

.logo img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.bar {
  width: 20px;
  height: 1px;
  background-color: white;
  margin: 2px 0;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}

.erji_nav {
  display: none;
  /* 默认隐藏 */
  list-style: none;
  padding-left: 20px;
}

.toggle-icon {
  display: none;
}
#toggle-icon {
  display: block;
}
.first_ul li:hover > a {
  color: rgb(215, 165, 37);
}
/* 响应式设计 */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #333;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.5s ease;
    z-index: 10;
  }

  .nav-links.active {
    transform: translateY(0);
  }

  .hamburger {
    display: flex;
    z-index: 20;
    padding: 12px 8px;
    background-color: rgb(71, 69, 68);
    border-radius: 5px;
  }

  /* 汉堡菜单动画 */
  .hamburger.active .bar:nth-child(1) {
    transform: translateY(4px) rotate(45deg);
  }

  .hamburger.active .bar:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active .bar:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .first_ul {
    width: 90%;
    height: auto;
    margin: 0 auto;
    padding: 20px 0;
    margin: 0 auto;
    margin-top: 50px;
  }

  .first_ul li {
    color: white;
    height: auto;
    width: 100%;
    padding: 10px 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .first_ul > li {
    font-size: 18px;
  }

  .first_ul li img {
    width: 20px;
    height: auto;
    object-fit: contain;
  }

  .erji_nav {
    width: 100%;
    height: auto;
    padding-left: 1rem;
  }

  .erji_nav li {
    font-size: 14px;
  }

  .toggle-icon {
    display: block;
    transform: rotate(180deg);
    transition: transform 0.3s ease;
    /* 向下图标旋转效果 */
  }

  .rotate {
    transform: rotate(0deg);
    /* 向下图标旋转180度 */
  }
}


@media (min-width: 768px) {
  .scrolled {
    background-color: rgba(0, 0, 0, 0.4);
    position: fixed;
    top: 0;
    z-index: 9999;
  }
  .navbar {
    width: 75%;
    margin: 0 auto;
    padding: 0;
    min-height: 90px;
  }

  .nav-links {
    width: 80%;
    height: auto;
  }

  .first_ul {
    width: 100%;
    height: auto;
    display: flex;
    /* justify-content: space-between; */
    gap: 30px;
    align-items: center;
    padding: 0;
    margin: 0;
    padding-right: 50px;
    position: relative;
  }
  #yuyan {
    position: absolute;
    /* right: -18%; */
    right: 0;
    display: flex;
  }
  #yuyan img {
    max-width: 21px;
    padding: 0 3px;
  }
  .first_ul > li {
    color: white;
    font-size: 16px;
    min-height: 75px;
    padding: 24px 5px;
    white-space: nowrap;
  }
  .first_ul > li > a {
    white-space: nowrap;
    padding: 10px 0;
  }
  .logo {
    max-width: 110px;
  }

  .parent {
    position: relative;
  }

  .erji_nav {
    position: absolute;
    top: 75px;
    left: 50%;
    transform: translate(-50%, 0);
    width: max-content;
    padding: 0 15px;
  }
  .black {
    background-color: rgba(0, 0, 0, 0.4);
  }
  .erji_nav li {
    padding: 4px 0;
  }
  .erji_nav li > a {
    font-size: 14px;
  }
  .parent:hover .erji_nav {
    display: block;
  }
  .navbar_box {
    min-height: 75px;
  }
}

@media (max-width: 1720px) {
  #yuyan {
    position: absolute;
    right: -18%;
    display: flex;
  }
}