/* ============================================================
   川渝好门户 - 专业导航栏系统 v2.1
   ============================================================ */

/* ========== 导航栏总览 ========== */
#nv-bar {
  background: var(--cy-primary);
  position: relative;
  z-index: 999;
  box-shadow: var(--cy-shadow-lg);
}

#nv-bar .wp {
  max-width: var(--cy-container);
  margin: 0 auto;
  padding: 0 var(--cy-space-4);
}

#nv {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  height: var(--cy-nav-h);
  overflow-x: auto;
  scrollbar-width: none;
}

#nv::-webkit-scrollbar {
  display: none;
}

#nv li {
  position: relative;
  flex-shrink: 0;
}

#nv li a {
  display: flex;
  align-items: center;
  gap: var(--cy-space-1);
  padding: 0 var(--cy-space-3);
  height: var(--cy-nav-h);
  color: rgba(255, 255, 255, 0.9);
  font-size: var(--cy-text-sm);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: var(--cy-transition-slow);
  position: relative;
}

#nv li a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

#nv li.a a {
  color: #fff;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
}

#nv li.a a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  background: #fff;
  border-radius: 3px 3px 0 0;
  transition: var(--cy-transition);
}

/* ========== 导航图标系统 ========== */
.nav-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.nav-icon-home {
  width: 16px;
  height: 16px;
}

.nav-icon-forum {
  width: 18px;
  height: 18px;
}

.nav-icon-portal {
  width: 20px;
  height: 20px;
}

.nav-icon-weibo {
  width: 18px;
  height: 18px;
}

.nav-icon-food {
  width: 18px;
  height: 18px;
}

.nav-icon-house {
  width: 18px;
  height: 18px;
}

.nav-icon-auto {
  width: 18px;
  height: 18px;
}

.nav-icon-travel {
  width: 18px;
  height: 18px;
}

.nav-icon-life {
  width: 18px;
  height: 18px;
}

.nav-icon-info {
  width: 18px;
  height: 18px;
}

.nav-icon-news {
  width: 18px;
  height: 18px;
}

.nav-icon-game {
  width: 18px;
  height: 18px;
}

.nav-icon-baby {
  width: 18px;
  height: 18px;
}

.nav-icon-health {
  width: 18px;
  height: 18px;
}

.nav-icon-edu {
  width: 18px;
  height: 18px;
}

/* ========== 导航下拉菜单 ========== */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  background: var(--cy-bg-card);
  border-radius: 0 0 var(--cy-radius-lg) var(--cy-radius-lg);
  box-shadow: var(--cy-shadow-xl);
  z-index: 1001;
  padding: var(--cy-space-2) 0;
  border-top: 3px solid var(--cy-primary);
  animation: nav-dropdown-fade 0.25s ease;
}

@keyframes nav-dropdown-fade {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.nav-dropdown:hover .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-item {
  display: block;
  padding: 8px var(--cy-space-4);
  color: var(--cy-text-secondary);
  font-size: var(--cy-text-sm);
  text-decoration: none;
  transition: var(--cy-transition);
  display: flex;
  align-items: center;
  gap: var(--cy-space-2);
  white-space: nowrap;
}

.nav-dropdown-item:hover {
  background: var(--cy-primary-bg);
  color: var(--cy-primary);
  padding-left: 24px;
  border-left: 3px solid var(--cy-primary);
}

.nav-dropdown-item .item-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.nav-dropdown-divider {
  height: 1px;
  background: var(--cy-border);
  margin: var(--cy-space-2) 0;
}

/* ========== 导航搜索功能 ========== */
.nav-search {
  position: absolute;
  top: 100%;
  right: 0;
  width: 320px;
  background: var(--cy-bg-card);
  border-radius: 0 0 var(--cy-radius-lg) var(--cy-radius-lg);
  box-shadow: var(--cy-shadow-xl);
  z-index: 1001;
  padding: var(--cy-space-3);
  display: none;
  animation: nav-search-fade 0.25s ease;
}

@keyframes nav-search-fade {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.nav-search.show {
  display: block;
}

.nav-search form {
  display: flex;
  gap: var(--cy-space-2);
}

.nav-search input {
  flex: 1;
  padding: 8px var(--cy-space-3);
  border: 1px solid var(--cy-border);
  border-radius: var(--cy-radius);
  font-size: var(--cy-text-sm);
  background: var(--cy-gray-50);
  color: var(--cy-text);
}

.nav-search input:focus {
  border-color: var(--cy-primary);
  background: #fff;
}

.nav-search button {
  padding: 8px var(--cy-space-4);
  background: var(--cy-primary);
  color: #fff;
  border: none;
  border-radius: var(--cy-radius);
  font-size: var(--cy-text-sm);
  cursor: pointer;
}

/* ========== 导航悬浮效果 ========== */
#nv li:hover {
  background: rgba(255, 255, 255, 0.1);
}

#nv li:hover a {
  color: #fff;
}

/* ========== 导航响应式优化 ========== */
@media (max-width: 1024px) {
  #nv li a {
    padding: 0 var(--cy-space-3);
    font-size: var(--cy-text-sm);
  }
}

@media (max-width: 768px) {
  #nv-bar {
    display: none;
  }
}

/* ========== 导航用户提示 ========== */
.nav-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  background: var(--cy-danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--cy-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.nav-badge-dot {
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 8px;
  background: var(--cy-danger);
  border-radius: var(--cy-radius-full);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ========== 导航动画效果 ========== */
.nav-enter {
  animation: nav-enter 0.3s ease;
}

@keyframes nav-enter {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.nav-leave {
  animation: nav-leave 0.2s ease;
}

@keyframes nav-leave {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-10px); }
}
