/* 导航栏样式 */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1050;
  background-color: #f9fafb;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  padding: 0;
  transition: all 0.3s ease;
  height: 60px;
}

.navbar.scrolled {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  background-color: rgba(255, 255, 255, 0.98);
}

/* 导航栏内的容器样式 */
.navbar .container {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  flex-direction: row !important; /* 强制保持水平排列 */
  flex-wrap: nowrap !important; /* 强制不换行 */
}

/* 导航栏左侧区域 */
.nav-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 100%;
  padding: 0 1rem;
}

/* Logo样式 */
.logo-link {
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: opacity 0.2s;
  height: 100%;
  outline: none; /* 移除点击时的轮廓 */
  border: none; /* 确保没有边框 */
}

.logo-link:hover {
  opacity: 0.85;
}

.logo-link:focus {
  outline: none; /* 移除焦点状态的轮廓 */
  box-shadow: none; /* 移除焦点状态的阴影 */
}

.logo-image {
  height: 28px;
  width: auto;
  display: block;
  -webkit-tap-highlight-color: transparent; /* 移除移动设备上的点击高亮 */
}



/* 搜索框样式 */
.search-container {
  flex: 1;
  max-width: 400px;
  margin: 0 1.5rem;
}

.search-form {
  display: flex;
  align-items: center;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.6rem 1rem;
  padding-right: 2.5rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50px;
  font-size: 0.95rem;
  transition: all 0.3s;
  background-color: rgba(255, 255, 255, 0.8);
}

.search-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  background-color: white;
}

.search-button {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #6366f1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
}

.search-button:hover {
  background-color: rgba(99, 102, 241, 0.1);
}

/* 用户导航 */
.user-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 100%;
  padding: 0 1rem;
}

.user-nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #374151;
  text-decoration: none;
  font-weight: 500;
  padding: 0 0.75rem;
  border-radius: 4px;
  transition: all 0.2s;
  height: 100%;
  font-size: 1rem;
}

.user-nav-item:hover {
  background-color: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}

.user-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
}

.user-dropdown {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  width: 160px;
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  padding: 0.5rem 0;
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transform: translateY(0);
  overflow: hidden;
  margin-top: 0;
}

.user-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: all 0.3s;
}

.dropdown-item {
  display: block;
  padding: 0.75rem 1rem;
  color: #374151;
  text-decoration: none;
  
}

.dropdown-item:hover {
  background-color: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}

/* 下拉菜单分割线 */
.dropdown-divider {
  height: 1px;
  margin: 0.5rem 0;
  background-color: rgba(0, 0, 0, 0.05);
}

/* 退出登录按钮样式 */
#logout-btn.dropdown-item {
  color: #ef4444;
}

#logout-btn.dropdown-item:hover {
  color: #dc2626;
}

/* 为固定导航栏添加内容区域的顶部内边距 */
.content-wrapper {
  padding-top: 60px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .navbar {
    height: auto;
    padding: 0.5rem 0;
  }
  
  .navbar .container {
    flex-wrap: nowrap !important;
    gap: 0.5rem;
    flex-direction: row !important;
  }
  
  .nav-left {
    flex: 0 0 auto;
    min-width: auto !important;
    justify-content: flex-start;
    height: auto;
    padding: 0.5rem 1rem;
  }
  
  .search-container {
    order: 2;
    margin: 0;
    max-width: 200px;
    width: auto;
    flex: 1;
  }
  
  .user-nav {
    order: 3;
    height: auto;
    padding: 0.5rem 1rem;
    flex: 0 0 auto;
  }
  
  .content-wrapper {
    padding-top: 4.5rem;
  }

  .user-nav-item {
    font-size: 0.9rem;
    padding: 0.4rem;
    height: auto;
  }
  
  .user-avatar {
    width: 1.8rem;
    height: 1.8rem;
    font-size: 0.8rem;
  }
  
  .user-dropdown {
    height: auto;
  }
}

/* 超小屏幕设备适配 */
@media (max-width: 480px) {
  .navbar {
    padding: 0.5rem 0;
  }
  
  .content-wrapper {
    padding-top: 4.5rem;
  }
  
  .logo-image {
    height: 24px;
  }
  
  .search-container {
    max-width: 150px;
  }
  
  .search-input {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
  }
  
  #user-phone {
    display: none;
  }
}