/* ================= 顶栏导航优化 ================= */
#nav {
  padding: 0 calc((100% - 1420px) / 2);
  backdrop-filter: saturate(180%) blur(20px);
  transition: all 0.4s cubic-bezier(0.65, 0, 0.35, 1); /* 更顺滑的过渡 */
}

/* ---------- 主菜单项 ---------- */
#menus > div.menus_items > div > a {
  letter-spacing: 0.3rem;
  font-weight: 700;
  padding: 0 0.8em; /* 增加左右内边距 */
  height: 40px; /* 增加高度 */
  line-height: 40px; /* 同步调整行高 */
  font-size: 1.1em; /* 放大字体 */
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transform: translateZ(0); /* 启用GPU加速 */
}

/* 悬停效果增强 */
#nav a:hover {
  background: var(--anzhiyu-main);
  color: var(--anzhiyu-white) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--anzhiyu-main-rgb), 0.3);
}

/* 方法2：更精准的选择器（防止被覆盖） */
#blog-info .nav-site-title .site-name {
  font-size: 1.3em;
  transition: all 0.3s ease;
}
/* ---------- 子菜单优化 ---------- */
#nav .menus_items .menus_item .menus_item_child {
  top: 44px;
  padding: 8px 6px !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

#nav .menus_items .menus_item:hover .menus_item_child {
  transform: translateX(-50%) scaleY(1);
  opacity: 1;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

/* 子菜单项 */
#nav .menus_items .menus_item .menus_item_child li {
  margin: 4px;
  border-radius: 8px;
  transition: all 0.2s;
}

#nav .menus_items .menus_item .menus_item_child li:hover {
  background: rgba(var(--anzhiyu-main-rgb), 0.9);
}

/* ---------- 返回顶部按钮 ---------- */
#nav-totop {
  width: 35px;
  transition: all 0.3s;
  position: relative;
}

#nav-totop #percent {
  font-size: 12px;
  background: var(--anzhiyu-white);
  color: var(--anzhiyu-main);
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  font-weight: 700;
}

#nav-totop:hover #percent {
  transform: scale(1.2);
  background: var(--anzhiyu-main);
  color: white;
}



/* ---------- 响应式优化 ---------- */
@media screen and (max-width: 1200px) {
  #nav {
    padding: 0 2%;
  }
  
  .menus_items {
    left: 45% !important;
  }
}

@media screen and (max-width: 768px) {
  #nav .menus_items {
    display: none !important;
  }
  
  #blog_name {
    margin-right: auto !important;
  }
}

/* ---------- 特殊状态 ---------- */
.nav-fixed #nav {
  transform: translateY(58px) !important;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
}

.page #nav a:hover {
  box-shadow: var(--anzhiyu-shadow-main);
}

/* ---------- 首页按钮优化 ---------- */
.back-home-button {
  width: 35px;
  height: 35px;
  border-radius: 50% !important;
  transition: all 0.3s;
}

.back-home-button:hover {
  transform: rotate(15deg);
}

.back-menu-list-groups {
  border-radius: 16px !important;
  padding: 8px;
}
