/* nav.css */

nav#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 60px;
  background: #fff;
  border-bottom: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 9999;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  user-select: none;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* 暗黑模式导航栏背景 */
body.dark-mode nav#nav {
  background: #222;
  border-bottom-color: #444;
  color: #eee;
}

#nav-group {
  display: flex;
  align-items: center;
  gap: 25px;
}

#blog_name a#site-name {
  font-weight: 700;
  font-size: 1.4rem;
  color: #333;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.3s ease;
}

body.dark-mode #blog_name a#site-name {
  color: #eee;
}

#menus {
  display: flex;
  align-items: center;
  gap: 25px;
}

.menus_items {
  display: flex;
  gap: 20px;
}

.menus_item {
  position: relative;
}

.menus_item > a.site-page {
  display: block;
  color: #444;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  padding: 8px 10px;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.menus_item > a.site-page:hover {
  color: #0078d7;
}

body.dark-mode .menus_item > a.site-page {
  color: #ccc;
}

body.dark-mode .menus_item > a.site-page:hover {
  color: #3399ff;
}

.menus_item_child {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border-radius: 4px;
  min-width: 150px;
  padding: 8px 0;
  z-index: 10000;
  transition: background-color 0.3s ease;
}

body.dark-mode .menus_item_child {
  background: #333;
  box-shadow: 0 4px 15px rgba(0,0,0,0.7);
}

.menus_item:hover > .menus_item_child {
  display: block;
}

.recursion_menus_item > a.site-page.child {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  color: #555;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.recursion_menus_item > a.site-page.child:hover {
  background-color: #0078d7;
  color: #fff;
  border-radius: 3px;
}

body.dark-mode .recursion_menus_item > a.site-page.child {
  color: #bbb;
}

body.dark-mode .recursion_menus_item > a.site-page.child:hover {
  background-color: #3399ff;
  color: #fff;
}

#nav-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.nav-button a {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #444;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 6px 8px;
  text-decoration: none;
  transition: color 0.3s ease;
}

.nav-button a:hover {
  color: #0078d7;
}

body.dark-mode .nav-button a {
  color: #ccc;
}

body.dark-mode .nav-button a:hover {
  color: #3399ff;
}

@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .navbar-menu {
    display: none;
    flex-direction: column;
    width: 100%;
  }

  .navbar-toggle {
    display: block;
    cursor: pointer;
  }

  .navbar.open .navbar-menu {
    display: flex;
  }
}