/* 清除浏览器默认格式 */
* {
    margin: 0;
    padding: 0;
    /* 内减模式 */
    box-sizing: border-box;
    font-family: MyFont,Lora,Verdana, Geneva, Tahoma, sans-serif;
    scroll-behavior: smooth;
  }

  li {
    list-style: none;
  }

  a {
    text-decoration: none;
  }

  /* 清除浮动 */
  .clearfix::before,
  .clearfix::after {
    content: '';
    display: table;
  }

  .clearfix::after {
    clear: both;
  }

  .navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5vw 1vw;
    background-color: #3C374D;
    box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.25);
    height: 8vh;
    position: fixed; 
    top: 0; /* Ensure it sticks to the top */
    left: 0;
    width: 100%; /* Ensure it spans the full width of the viewport */
    z-index: 1000; /* Optional: ensures the navbar stays on top of other content */
    transition: transform 0.3s ease;
  }

.logo img{
    margin-top: 0.5vh;
    margin-left: 1vw;
    height: 7vh;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: right;
    margin-right: 7.2%;
}

.nav-links li {
    margin-left: 2vw;
}


.nav-links a {
    text-decoration: none;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.2vw 0.3vw;
}

.nav-links a:hover {
    background-color: #B8EFFF;  /* 蓝色背景 */
    border-radius: 25px;
}


.nav-links img {
    width: 5.5vw;
    height: 8vh;
}

.nav-links span {
    font-size: 2.2vh;
    color: #B8EFFF;
    font-weight: bold;
    padding: 0.5vw 0.3vw;
}
.nav-links span:hover {
    color: #3C374D;
}

.navbar.hide {
  transform: translateY(-100%);
  transition: transform 0.3s ease; 
}

/* Dropdown container */
.dropdown {
  position: relative;
  display: inline-block;
}

/* Dropdown Menu */
.dropdown-menu {
  display: none;
  position: absolute;
  background-color: #909FA2;
  width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index: 1000;
  padding: 5px 0;
  border-radius: 10px;
  
}

.dropdown-menu li {
  list-style: none;
  padding: 8px 12px;
  text-align: center;
  margin-left: 0;
}

.dropdown-menu li a {
  color: white;
  text-decoration: none;
  display: block;
}

.dropdown-menu li a:hover {
  color: #3C374D;
}

/* Show the dropdown menu on hover */
.dropdown:hover .dropdown-menu {
  display: block;
}

.navbar .menu{
  display:none;
}

/* 页面自适应 */
@media (max-width: 768px) {
  .nav-links img{
      display: none;
  }
  .navbar .logo .img1 img{
    margin-top: 2vh;
    margin-left: 1vw;
    height: 7vh;
}
.navbar .logo .img2 img{
    margin-top: -2vh;
    margin-left: 0.2vw;
    height: 6vh;
}
  .navbar .menu{
    display:block;
    background-color: transparent;
    color: #cec3ed;
    font-size: 8vw;
    border:none;
    position:fixed;
    top:-6.5vh;
    right: -3vw;
    cursor: pointer;
  }
  .nav-links{
    background-color: #4a3c61;
    position:fixed;
    flex-direction: column;
    width: 100vw;
    margin-left: -1vh;
    top:-100%;
    text-align: center;
  }
  .nav-links.activate{
    top:13vh;;
  }
  .dropdown:hover .dropdown-menu {
    width: 110vw;
    margin-left:-49vw;
    position: absolute;
    display: block;
  }

  @media (max-width: 768px) {
    .navbar.hide {
        transform: translateY(calc(-100% - 13vh)); /* 补偿移动端菜单高度 */
    }
    
    .nav-links.activate {
        top: 13vh !important; /* 确保菜单展开时不会被隐藏 */
    }
}
}
