/**
 * 导航组件样式
 * 支持桌面和移动端响应式布局
 */

/* 导航容器 */
#main-navigation {
  background-color: var(--primary-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 60px;
}

/* 品牌/Logo */
.nav-brand a {
  color: white;
  font-size: 1.5rem;
  font-weight: bold;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.nav-brand a:hover {
  opacity: 0.9;
}

/* 导航菜单 */
.nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.5rem;
}

.nav-item {
  margin: 0;
}

.nav-link {
  display: block;
  padding: 0.75rem 1rem;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.3s ease;
  font-weight: 500;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
  background-color: rgba(255, 255, 255, 0.2);
  font-weight: 600;
}

/* 汉堡菜单按钮（默认隐藏） */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 25px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.hamburger {
  width: 100%;
  height: 3px;
  background-color: white;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* 汉堡菜单动画 */
.nav-toggle.active .hamburger:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle.active .hamburger:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active .hamburger:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* 移动端样式 (max-width: 768px) */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }
  
  .nav-container {
    padding: 0 1rem;
    min-height: 56px;
  }
  
  .nav-brand a {
    font-size: 1.25rem;
  }

  .nav-menu {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    flex-direction: column;
    background-color: var(--primary-color);
    padding: 0;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }

  .nav-menu.active {
    max-height: 500px;
    opacity: 1;
  }

  .nav-item {
    width: 100%;
  }

  .nav-link {
    padding: 1rem 1.5rem;
    border-radius: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 1rem;
    text-align: left;
  }

  .nav-item:last-child .nav-link {
    border-bottom: none;
  }

  .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
  }

  .nav-link.active {
    background-color: rgba(255, 255, 255, 0.25);
  }
}

/* 小屏幕手机优化 (max-width: 480px) */
@media (max-width: 480px) {
  .nav-container {
    padding: 0 0.75rem;
    min-height: 52px;
  }
  
  .nav-brand a {
    font-size: 1.1rem;
  }
  
  .nav-toggle {
    width: 28px;
    height: 22px;
  }
  
  .hamburger {
    height: 2.5px;
  }
  
  .nav-menu {
    top: 52px;
  }
  
  .nav-link {
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
  }
}

/* 平板端样式优化 */
@media (min-width: 769px) and (max-width: 1024px) {
  .nav-container {
    padding: 0 1.5rem;
  }

  .nav-menu {
    gap: 0.25rem;
  }

  .nav-link {
    padding: 0.75rem 0.75rem;
    font-size: 0.95rem;
  }
}

/* 大屏幕优化 */
@media (min-width: 1200px) {
  .nav-container {
    padding: 0 2rem;
  }

  .nav-menu {
    gap: 1rem;
  }

  .nav-link {
    padding: 0.75rem 1.25rem;
  }
}

/* 语言切换器样式 */
.nav-item-language {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.language-switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.lang-btn {
  background: transparent;
  border: none;
  color: white;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
  border-radius: 4px;
}

.lang-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.lang-btn.active {
  background-color: rgba(255, 255, 255, 0.2);
  font-weight: 600;
}

.lang-separator {
  color: rgba(255, 255, 255, 0.5);
  margin: 0 0.25rem;
}

/* 移动端语言切换器 */
@media (max-width: 768px) {
  .nav-item-language {
    margin-left: 0;
    width: 100%;
    justify-content: center;
    padding: 0.75rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
  }

  .language-switcher {
    gap: 0.75rem;
  }

  .lang-btn {
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
  }

  .lang-separator {
    margin: 0 0.5rem;
  }
}
