/* 顶部导航栏 */
.top-navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--navbar-height);
  background: linear-gradient(to right, #5755d9, #7468ef);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
  z-index: 1040;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
}

body:not(.bg-none) .top-navbar {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
body:not(.bg-none) .top-navbar .navbar-logo,
body:not(.bg-none) .top-navbar .navbar-action,
body:not(.bg-none) .top-navbar .user-action-btn {
  color: #fff;
}
body:not(.bg-none) .top-navbar .navbar-action:hover,
body:not(.bg-none) .top-navbar .user-action-btn:hover {
  color: #ffd86b;
  background: rgba(255, 255, 255, 0.08);
}

.navbar-logo {
  display: flex;
  align-items: center;
  font-size: 25px;
  font-weight: 700;
  color: white;
  text-decoration: none;
  margin-left: var(--spacing-sm);
  transition: var(--transition-base);
  letter-spacing: 0.5px;
}

.navbar-logo:hover {
  color: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

.menu-toggle {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  cursor: pointer;
  border-radius: 50%;
  transition: var(--transition-base);
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* 搜索栏 */
.search-bar {
  flex-grow: 1;
  margin: 0 var(--spacing-md);
  position: relative;
  max-width: 600px;
}

.search-input {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: 30px;
  border: 1px solid #eee;
  outline: none;
  transition: var(--transition-base);
}

.search-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(112, 73, 240, 0.2);
}

.search-button {
  position: absolute;
  right: var(--spacing-sm);
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: var(--font-size-lg);
  cursor: pointer;
  transition: var(--transition-base);
}

.search-button:hover {
  color: var(--primary-color);
}

/* 用户操作区 */
.user-actions {
  display: flex;
  align-items: center;
}

.user-action-btn {
  margin-left: var(--spacing-sm);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: var(--font-size-lg);
  transition: var(--transition-base);
  cursor: pointer;
}

.user-action-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

/* 导航栏右侧 */
.navbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.navbar-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: white;
  text-decoration: none;
  transition: all 0.2s ease;
}

.navbar-action:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.navbar-action i {
  font-size: 1.2rem;
}

/* 用户下拉菜单 */
.user-dropdown {
  position: relative;
}

.user-dropdown-toggle {
  cursor: pointer;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.user-dropdown-toggle:hover .user-avatar {
  border-color: white;
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: rgba(20, 20, 20, 0.92);
  color: #fff;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.32);
  border-radius: 12px;
  width: 220px;
  z-index: 1050;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.user-dropdown:hover .user-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown-header {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: transparent;
  color: #fff;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  padding: 12px 18px;
  color: #fff;
  text-decoration: none;
  transition: all 0.2s ease;
}

.user-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffd86b;
  padding-left: 22px;
}

.user-dropdown-item i {
  font-size: 1.1rem;
}

/* 点击涟漪效果 */
.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.4);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(2.5);
    opacity: 0;
  }
}

/* 响应式调整 */
@media (max-width: 768px) {
  .search-bar {
    display: none;
  }

  .user-actions {
    margin-left: auto;
  }

  /* 移动设备上的下拉菜单 */
  .user-dropdown-menu {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
  }

  .user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

/* 有背景时导航栏样式 */
body:not(.bg-none) .navbar {
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
