/**
 * 导航栏样式
 */

.navbar {
  background: rgba(255, 255, 255, 0.95);
  padding: 0 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.nav-brand {
  font-size: 1.3rem;
  font-weight: 700;
}

.nav-brand a {
  color: #667eea;
  text-decoration: none;
  transition: color 0.3s;
}

.nav-brand a:hover {
  color: #764ba2;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 10px;
  margin: 0;
  padding: 0;
  flex: 1;
  justify-content: center;
}

.nav-item {
  position: relative;
}

.nav-item a {
  display: block;
  padding: 15px 20px;
  color: #666;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s;
  font-size: 0.95rem;
}

.nav-item a:hover {
  background: #f5f5f5;
  color: #667eea;
}

.nav-item.active a {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.nav-item.active a:hover {
  background: linear-gradient(135deg, #5568d3 0%, #6a3d8f 100%);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 15px;
}

.nav-user-name {
  color: #666;
  font-size: 0.9rem;
}

.nav-logout-btn {
  background: #667eea;
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.3s;
}

.nav-logout-btn:hover {
  background: #5568d3;
}

/* 登录按钮样式 */
.nav-auth {
  display: flex;
  align-items: center;
}

.nav-login-btn {
  background: #667eea;
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.3s;
}

.nav-login-btn:hover {
  background: #5568d3;
}

/* 移动端响应式 */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    padding: 15px;
  }

  .nav-menu {
    flex-direction: column;
    width: 100%;
    gap: 5px;
  }

  .nav-item a {
    padding: 12px 15px;
    text-align: center;
  }

  .nav-user,
  .nav-auth {
    width: 100%;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
  }
}

/* 二级菜单样式 */
.nav-item.has-dropdown {
  position: relative;
}

.nav-arrow {
  font-size: 0.7rem;
  margin-left: 5px;
  transition: transform 0.3s ease;
}

.nav-item.has-dropdown.active .nav-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  list-style: none;
  padding: 8px 0;
  margin: 0;
  min-width: 180px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  z-index: 1001;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-menu .nav-item {
  display: block;
  position: static;
}

.dropdown-menu .nav-item a {
  padding: 10px 20px;
  border-radius: 0;
  font-size: 0.9rem;
}

.dropdown-menu .nav-item a:hover {
  background: #f5f5f5;
  color: #667eea;
}

.dropdown-menu .nav-item.active a {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

/* 小屏幕隐藏部分菜单项 */
@media (max-width: 480px) {
  .nav-menu {
    flex-wrap: wrap;
  }

  .nav-item a {
    font-size: 0.85rem;
    padding: 10px 12px;
  }

  /* 移动端二级菜单样式 */
  .dropdown-menu {
    position: static;
    box-shadow: none;
    background: #f9f9f9;
    margin-top: 5px;
    margin-bottom: 5px;
    border-radius: 4px;
  }

  .dropdown-menu .nav-item a {
    padding: 8px 25px;
  }
}

