nav {
    width: 100%;
    height:80px;
    /* border: 2px solid red; */
    position: fixed;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    background-color: rgba(255, 255, 255);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
    /* border-radius: 1px; */
    z-index: 100;
}
.nav_background {
    width:100%;
    height:80px;
    background-color: rgba(255, 255, 255, 0.633);
}
#logo{
    width: 30%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#logoimg{
    height: 30px;
}
/* #region nav_labels */

#nav_labels {
    width: 50%;
    /* height: 100px; */
    /* border: 2px solid red; */
    display: flex;
    flex-direction: row;
    justify-content:space-around;
    align-items: center;
}
.nav_label {
    color: #999999;
    height: 80px;
    font-size: small;
    /* background-color: red; */
    font-weight: 500;
    transition: all 0.3s ease; /* 添加过渡效果 */
    position: relative; /* 为下方的横线定位提供参照 */
    display: flex;
    flex-direction: center;
    align-items: center;
    cursor: pointer;
}

.nav_label:hover {
    color: black; /* 鼠标悬停时文字颜色变黑 */
    top: -2px; /* 鼠标悬停时文字上移 */
    font-weight: 500;
}

.nav_label::after {
    content: ''; /* 伪元素内容为空 */
    position: absolute; /* 绝对定位 */
    width: 100%; /* 宽度与文字相同 */
    height: 8px; /* 横线的高度 */
    background-color: gold; /* 金色背景 */
    left: 0; /* 与文字左侧对齐 */
    bottom: 0; /* 放在文字底部 */
    visibility: hidden; /* 默认不可见 */
    transition: visibility 0s, opacity 0.3s ease; /* 过渡效果 */
}

.nav_label:hover::after {
    visibility: visible; /* 鼠标悬停时显示横线 */
    opacity: 1; /* 透明度设置为1，使得横线完全可见 */
}


/* 添加二级菜单样式 */
.dropdown-content {
    font-size:x-small;
    /* background-color: red; */
    font-weight: 100;
    display: none; /* 默认隐藏二级菜单 */
    position: absolute; /*定位二级菜单 */
    background-color: rgba(241, 242, 245); /* 背景颜色 */
    min-width:300%; /* 最小宽度 */
    max-width:300%; /* 最小宽度 */
    height:500px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); /* 阴影 */
    z-index: 1; /* 层级 */
    top: 100%; /* 位置在父元素下方 */
    right: 0%;

}
/* 鼠标悬停时显示二级菜单 */
.nav_label:hover .dropdown-content {
    display: flex; /* 显示二级菜单 */
    flex-direction:column;
    justify-content: center;
    align-items:center;
}

/* 二级菜单样式 */
.dropdown-content-center {
    /* background-color: red; */
    height: 90%;
    width:90%;

}
/* 二级菜单选项样式 */
.dp-item {
    color: rgb(77, 76, 76);
    height: 50px;
    display: flex; 
    flex-direction:column;
    justify-content:center;
    align-items:start;
}

.dp-item:hover {
    font-weight: 500;
    color: black; /* 鼠标悬停时文字颜色变黑 */
    top: -2px; /* 鼠标悬停时文字上移 */
}
/* #endregion */

/* #region nav_icons */

#nav_icons {
    width: 30%;
    display: flex;
    flex-direction:row;
    justify-content:end;
    align-items:center;
    gap:10px;
    /* height: 100px; */
    /* border: 2px solid red; */
}

#nav_icon {
    display: flex;
    flex-direction:row;
    justify-content:end;
    align-items:center;
    width: 20%;
    fill:rgb(132, 145, 165);
}
#nav_text {
    width: 60%;
    font-size: x-small;
    color:rgb(132, 145, 165);
    cursor: pointer;
}
#nav_text:hover {
    font-weight: 500;
    color: black; /* 鼠标悬停时文字颜色变黑 */
    top: -2px; /* 鼠标悬停时文字上移 */
}
/* #endregion */

@media screen and (max-width: 768px) {
    #logoimg{
        height: 20px;
    }
    #nav_labels {
        width: 70%;
    }
    .nav_label {
        font-size: xx-small;
    }
    #nav_icons {
        width: 0%;
        display: none; 
    }
    #nav_icon {
        width: 0%;
        display: none; 
    }
    #nav_text {
        font-size: xx-small;
    }
    nav {
        width: 100svw; 
    }
  }


 /* 用户登录区域样式 */
#user-section {
    width: 30%;
    display: flex;
    align-items: center;
    display: flex;
      flex-direction:row;
      justify-content:center;
      align-items:center;
    gap: 20px;
  }
  
  .login-btn, .register-btn {
    padding: 8px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
  }
  
  .login-btn {
    color: #333;
    border: 1px solid #333;
  }
  
  .register-btn {
    background-color: #333;
    color: white;
  }
  
  .login-btn:hover {
    background-color: #f5f5f5;
  }
  
  .register-btn:hover {
    background-color: #444;
  }
  
  /* 用户信息下拉菜单样式 */
  .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
  }

  .user-name {
    color: #333;
    font-size: 14px;
    font-weight: 500;
  }

  .user-dropdown {
    position: relative;
  }

  .user-dropdown-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 12px;
    padding: 4px;
    transition: color 0.3s ease;
  }

  .user-dropdown-btn:hover {
    color: #333;
  }

  .user-dropdown-content {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    border-radius: 4px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
  }

  .user-dropdown-content.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .dropdown-item {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    transition: background-color 0.3s ease;
  }

  .dropdown-item:hover {
    background-color: #f5f5f5;
  }

  .dropdown-divider {
    border: none;
    border-top: 1px solid #eee;
    margin: 8px 0;
  }

  .logout-btn {
    color: #e74c3c !important;
  }

  .logout-btn:hover {
    background-color: #ffeaea !important;
  }

  /* 响应式设计 */
  @media screen and (max-width: 768px) {
    .user-name {
      font-size: 12px;
    }
    
    .user-dropdown-content {
      min-width: 140px;
    }
    
    .dropdown-item {
      padding: 10px 12px;
      font-size: 12px;
    }
  }
  