/*
 * 导航组件样式
 * Trx-Tt-Sleek Theme Navigation CSS
 */

/* 基础导航栏样式 */
.navbar {
  background-color: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: all 0.3s ease;
}

.navbar.scrolled {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.95);
}

/* 导航容器 */
.navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

/* 导航链接 */
.navbar-link {
  color: #374151;
  padding: 0.75rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s ease, background-color 0.2s ease;
  position: relative;
}

.navbar-link:hover {
  color: #2563eb;
  transform: translateY(-1px);
}

.navbar-link.active {
  color: #2563eb;
  font-weight: 600;
}

.navbar-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background-color: #3B82F6;
  border-radius: 1px;
}

/* 导航菜单 */
.navbar-menu {
  display: none;
}

@media (min-width: 768px) {
  .navbar-menu {
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }
}

.navbar-menu.mobile {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: white;
  z-index: 40;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  transform: translateY(-100%);
  transition: transform 0.3s ease-in-out;
}

@media (min-width: 768px) {
  .navbar-menu.mobile {
    display: none;
  }
}

.navbar-menu.mobile.open {
  transform: translateY(0);
}

/* 移动端菜单切换按钮 */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
}

@media (min-width: 768px) {
  .mobile-menu-toggle {
    display: none;
  }
}

.mobile-menu-icon {
  width: 1.5rem;
  height: 0.125rem;
  background-color: #374151;
  transition: all 0.3s ease;
}

.mobile-menu-icon::before,
.mobile-menu-icon::after {
  content: '';
  width: 1.5rem;
  height: 0.125rem;
  background-color: #374151;
  transition: all 0.3s ease;
  position: absolute;
}

.mobile-menu-icon::before {
  transform: translateY(-8px);
}

.mobile-menu-icon::after {
  transform: translateY(8px);
}

.mobile-menu-icon.open {
  background-color: transparent;
}

.mobile-menu-icon.open::before {
  transform: rotate(45deg);
}

.mobile-menu-icon.open::after {
  transform: rotate(-45deg);
}

/* Logo样式 */
.navbar-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  max-height: 60px;
}

.navbar-logo:hover {
  color: #2563eb;
}

.navbar-logo img {
  max-height: 3rem;
  height: auto;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  transition: all 0.3s ease;
}

/* Logo链接样式 */
.navbar-logo-link {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  transition: color 0.2s ease;
  display: block;
  line-height: 1;
}

.navbar-logo-link:hover {
  color: #2563eb;
}

/* Logo容器 */
.site-logo {
  display: flex;
  align-items: center;
  max-height: 60px;
}

.site-logo a {
  display: block;
  line-height: 1;
}

.site-logo img {
  max-height: 3rem;
  height: auto;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  transition: all 0.3s ease;
}

/* 响应式Logo样式 */
@media (max-width: 768px) {
  .navbar-logo img,
  .site-logo img {
    max-height: 2rem;
    max-width: 150px;
  }
  
  .navbar-logo {
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  .navbar-logo img,
  .site-logo img {
    max-height: 1.5rem;
    max-width: 120px;
  }
  
  .navbar-logo {
    font-size: 1.125rem;
  }
}

/* 搜索栏在导航中的样式 */
.navbar-search {
  display: none;
  align-items: center;
}

@media (min-width: 1024px) {
  .navbar-search {
    display: flex;
  }
}

.navbar-search-form {
  position: relative;
}

.navbar-search-input {
  width: 16rem;
  padding-left: 2.5rem;
  padding-right: 1rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 9999px;
  outline: none;
  transition: all 0.2s ease;
}

.navbar-search-input:focus {
  border-color: transparent;
  box-shadow: 0 0 0 2px #3b82f6;
}

.navbar-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  width: 1rem;
  height: 1rem;
}

/* 导航按钮样式 */
.navbar-button {
  padding: 0.375rem;
  color: #374151;
  transition: all 0.2s ease;
  background-color: transparent;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
}

.navbar-button:hover {
  color: #2563eb;
  background-color: #f3f4f6;
  transform: translateY(-1px);
}

/* SVG图标尺寸控制 */
.navbar-button svg {
  width: 16px;
  height: 16px;
}

/* 移动端菜单按钮图标 */
#mobile-menu-toggle svg {
  width: 18px;
  height: 18px;
}

/* 通用按钮图标尺寸 */
.btn svg {
  width: 16px;
  height: 16px;
}

/* 搜索框内的图标 */
.search-form svg {
  width: 16px;
  height: 16px;
}

/* 响应式图标尺寸 */
@media (max-width: 768px) {
  .navbar-button {
    padding: 0.25rem;
    min-width: 28px;
    min-height: 28px;
  }
  
  .navbar-button svg {
    width: 14px;
    height: 14px;
  }
  
  #mobile-menu-toggle svg {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 480px) {
  .navbar-button {
    padding: 0.125rem;
    min-width: 24px;
    min-height: 24px;
  }
  
  .navbar-button svg {
    width: 12px;
    height: 12px;
  }
  
  #mobile-menu-toggle svg {
    width: 14px;
    height: 14px;
  }
}

/* 下拉菜单 */
.navbar-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.5rem;
  width: 12rem;
  background-color: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  transform: translateY(-10px);
}

.navbar-item:hover .navbar-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.navbar-dropdown-link {
  display: block;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: #374151;
  transition: all 0.2s ease;
  background-color: transparent;
}

.navbar-dropdown-link:hover {
  color: #2563eb;
  background-color: #f9fafb;
}

.navbar-dropdown-link:first-child {
  border-top-left-radius: 0.5rem;
  border-top-right-radius: 0.5rem;
}

.navbar-dropdown-link:last-child {
  border-bottom-left-radius: 0.5rem;
  border-bottom-right-radius: 0.5rem;
}

/* 面包屑导航 */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 1.5rem;
}

.breadcrumb-item {
  transition: color 0.2s ease;
}

.breadcrumb-item:hover {
  color: #2563eb;
}

.breadcrumb-item:not(:last-child)::after {
  content: '/';
  margin-left: 0.5rem;
  color: #9ca3af;
}

.breadcrumb-item.current {
  color: #111827;
  font-weight: 500;
}

/* 页面头部 */
.page-header {
  background: linear-gradient(to right, #eff6ff, #e0e7ff);
  padding: 3rem 0;
  margin-bottom: 2rem;
}

.page-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 1rem;
}

.page-subtitle {
  font-size: 1.25rem;
  color: #6b7280;
  margin-bottom: 1.5rem;
}

/* 副导航栏 */
.sub-navbar {
  background-color: #f3f4f6;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 4rem;
  z-index: 40;
}

.sub-navbar-menu {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.sub-navbar-link {
  font-size: 0.875rem;
  color: #374151;
  transition: color 0.2s ease;
}

.sub-navbar-link:hover {
  color: #2563eb;
}

.sub-navbar-link.active {
  color: #2563eb;
  font-weight: 500;
}

/* 导航动画效果 */
.nav-fade-in {
  animation: navFadeIn 0.6s ease-out;
  will-change: transform, opacity;
}

.nav-slide-down {
  animation: navSlideDown 0.4s ease-out;
  will-change: transform, opacity;
}

/* 动画性能优化 - will-change属性 */
.navbar {
  will-change: transform, opacity;
}

.navbar-link {
  will-change: transform, opacity;
}

.navbar-logo {
  will-change: transform, opacity;
}

.navbar-button {
  will-change: transform, opacity;
}

.navbar-dropdown {
  will-change: transform, opacity;
}

.mobile-menu-toggle {
  will-change: transform, opacity;
}

.navbar-menu.mobile {
  will-change: transform, opacity;
}

@keyframes navFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes navSlideDown {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 移动端优化 */
@media (max-width: 768px) {
  .navbar-menu {
    display: block;
  }
  
  .navbar-search {
    display: none;
  }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
  .navbar,
  .navbar-link,
  .navbar-logo,
  .navbar-button,
  .navbar-dropdown,
  .mobile-menu-toggle,
  .navbar-menu.mobile,
  .nav-fade-in,
  .nav-slide-down {
    transition: none !important;
    animation: none !important;
  }
  
  .navbar-link:hover,
  .navbar-button:hover,
  .navbar-logo:hover {
    transform: none !important;
  }
  
  .navbar.scrolled {
    backdrop-filter: none !important;
  }
  
  .mobile-menu-icon,
  .mobile-menu-icon::before,
  .mobile-menu-icon::after {
    transition: none !important;
  }
  
  .navbar-search-input:focus {
    box-shadow: none !important;
  }
}