/* 顶部导航栏样式 - 完全按照图片设计 */

.top-navigation {
  background-color: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

/* 左侧Logo和品牌文字区域 */
.nav-left {
  display: flex;
  align-items: center;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo {
  display: flex;
  align-items: center;
}

.logo-image {
  height: 45px;
  width: auto;
  max-width: 200px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text span {
  font-family: 'museo', sans-serif;
  font-size: 16px;
  font-weight: bold; /* 加粗品牌文字 */
  color: #333333;
  letter-spacing: 0.5px;
}

/* 右侧导航区域 */
.nav-right {
  display: flex;
  align-items: center;
  gap: 25px;
}

/* 导航菜单 */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 30px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  font-family: 'museo', sans-serif;
  font-size: 16px;
  font-weight: bold;
  color: #333333;
  text-decoration: none;
  transition: color 0.3s ease;
  position: relative;
}

.nav-link:hover {
  color: #f97316;
}

/* 搜索功能 */
.search-container {
  position: relative;
}

.search-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  cursor: pointer;
  color: #6b7280;
  transition: color 0.3s ease;
}

.search-icon:hover {
  color: #f97316;
}

/* 搜索弹框 */
.search-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

.search-popup.show {
  display: flex;
}

.search-popup-content {
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow: hidden;
  animation: searchPopupIn 0.3s ease-out;
}

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

.search-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
}

.search-header h3 {
  font-family: 'museo', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}

.search-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #6b7280;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.search-close:hover {
  background-color: #f3f4f6;
  color: #374151;
}

.search-body {
  padding: 24px;
}

.search-input-group {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.search-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-family: 'museo', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s ease;
}

.search-input:focus {
  border-color: #f97316;
}

.search-input::placeholder {
  color: #9ca3af;
}

.search-submit {
  background-color: #f97316;
  color: #ffffff;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-family: 'museo', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.3s ease;
}

.search-submit:hover {
  background-color: #ea580c;
}

.search-suggestions {
  margin-top: 20px;
}

.suggestion-title {
  font-family: 'museo', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  margin-bottom: 12px;
}

.suggestion-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.suggestion-tag {
  background-color: #f3f4f6;
  color: #374151;
  padding: 6px 12px;
  border-radius: 20px;
  font-family: 'museo', sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.suggestion-tag:hover {
  background-color: #f97316;
  color: #ffffff;
}

/* 语言选择器 */
.language-selector {
  position: relative;
  display: flex;
  align-items: center;
}

.language-button {
  background-color: #1e3a8a; /* 深蓝色背景，与图片一致 */
  color: #ffffff;
  border: none;
  padding: 8px 30px 8px 12px;
  font-family: 'museo', sans-serif;
  font-size: 12px;
  font-weight: 400;
  border-radius: 4px;
  cursor: pointer;
  outline: none;
  min-width: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background-color 0.3s ease;
}

.language-button:hover {
  background-color: #1e40af;
}

.dropdown-arrow {
  margin-left: 8px;
  color: #ffffff;
  width: 12px;
  height: 12px;
  transition: transform 0.3s ease;
}

.language-button.active .dropdown-arrow {
  transform: rotate(180deg);
}

/* 语言弹框 */
.language-popup {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  width: 480px; /* 调整宽度适配4列布局 */
  max-width: 95vw; /* 在小屏幕上限制最大宽度 */
  margin-top: 5px;
  display: none;
}

.language-popup.show {
  display: block;
}

.language-items {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* 改为4列布局 */
  gap: 8px;
  max-height: 400px; /* 40个语言大约10行，适当增加高度 */
  overflow-y: auto; /* 如果内容过多，允许滚动 */
}

.lang-item {
  display: flex;
  flex-direction: column; /* 改为垂直布局，图标在上，文字在下 */
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  color: #374151;
  text-decoration: none;
  font-family: 'museo', sans-serif;
  font-size: 12px;
  font-weight: 400;
  transition: background-color 0.2s ease;
  gap: 6px;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  min-height: 60px; /* 增加高度，适配4列布局 */
  word-break: break-word; /* 允许长单词换行 */
}

.lang-item:hover {
  background-color: #f3f4f6;
  color: #1e3a8a;
}

.lang-item img {
  width: 16px;
  height: 12px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0; /* 防止图片被压缩 */
}

/* 汉堡菜单按钮（默认隐藏） */
.hamburger-menu {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 1001;
  position: relative;
  order: 2; /* 确保在右侧显示 */
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.hamburger-menu:hover {
  background-color: #f3f4f6;
}

.hamburger-menu:active {
  background-color: #e5e7eb;
}

.hamburger-line {
  width: 100%;
  height: 2px;
  background-color: #374151;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform-origin: center;
  border-radius: 1px;
}

.hamburger-menu.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
  background-color: #f97316;
}

.hamburger-menu.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scale(0);
}

.hamburger-menu.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
  background-color: #f97316;
}

.hamburger-line {
  width: 25px;
  height: 3px;
  background-color: #333333;
  margin: 3px 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

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

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* 移动端菜单覆盖层 */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 1050;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
  display: block;
  opacity: 1;
}

/* 移动端菜单侧边栏 */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 300px;
  height: 100vh;
  background-color: #ffffff;
  z-index: 1100;
  transition: right 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.mobile-menu.active {
  right: 0;
}

.mobile-menu-header {
  padding: 20px 20px 15px 20px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f8fafc;
  min-height: 60px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.mobile-menu-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  font-family: 'museo', sans-serif;
}

.mobile-menu-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #6b7280;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}

.mobile-menu-close:hover {
  background-color: #e5e7eb;
  color: #374151;
  transform: scale(1.05);
}

.mobile-menu-content {
  flex: 1;
  overflow-y: auto;
}

/* 移动端导航区域 */
.mobile-nav {
  padding: 0;
  border-bottom: 1px solid #e5e7eb;
}

.mobile-nav-link {
  display: block;
  font-family: 'museo', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #374151;
  text-decoration: none;
  padding: 16px 20px;
  border-bottom: 1px solid #f3f4f6;
  transition: all 0.2s ease;
  position: relative;
}

.mobile-nav-link:hover {
  color: #f97316;
  background-color: #fef3f2;
  padding-left: 24px;
}

.mobile-nav-link:after {
  display: none !important;
}

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

/* 移动端Products下拉菜单样式 */
.mobile-nav-dropdown {
  border-bottom: 1px solid #f3f4f6;
  position: relative;
  z-index: 200; /* 确保下拉菜单在语言选择器之上 */
  /* 为absolute定位的子元素提供定位上下文 */
}

.mobile-nav-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
}

.mobile-dropdown-arrow {
  transition: transform 0.3s ease;
  color: #9ca3af;
}

.mobile-nav-toggle.active .mobile-dropdown-arrow {
  transform: rotate(180deg);
}

.mobile-nav-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background-color: #f8fafc;
  position: relative;
  z-index: 201;
  /* 通过transform创建新的层叠上下文 */
  transform: translateZ(0);
  will-change: max-height;
}

.mobile-nav-submenu.active {
  max-height: 800px;
}

.mobile-nav-sublink {
  display: block;
  font-family: 'museo', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #6b7280;
  text-decoration: none;
  padding: 12px 20px 12px 40px;
  border-bottom: 1px solid #e5e7eb;
  transition: all 0.2s ease;
  position: relative;
}

.mobile-nav-sublink:hover {
  color: #f97316;
  background-color: #fef3f2;
  padding-left: 44px;
}

.mobile-nav-sublink:last-child {
  border-bottom: none;
}

/* 移动端功能区域 */
.mobile-functions {
  border-bottom: 1px solid #e5e7eb;
}

/* 功能切换按钮 */
.mobile-function-toggle {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid #f3f4f6;
  position: relative;
}

.mobile-function-toggle:hover {
  background-color: #f9fafb;
  padding-left: 24px;
}

.mobile-function-toggle.active {
  background-color: #fef3f2;
  border-left: 3px solid #f97316;
}

.mobile-function-toggle:last-child {
  border-bottom: none;
}

.function-icon {
  margin-right: 12px;
  color: #6b7280;
  display: flex;
  align-items: center;
}

.function-text {
  flex: 1;
  font-size: 16px;
  font-weight: 500;
  color: #374151;
  font-family: 'museo', sans-serif;
}

.function-arrow {
  color: #9ca3af;
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
}

.mobile-function-toggle.active .function-arrow {
  transform: rotate(180deg);
}

/* 移动端搜索区域 */
.mobile-search-section {
  padding: 20px;
  background-color: #f9fafb;
  animation: slideDown 0.3s ease;
  border-left: 3px solid #f97316;
  margin: 0;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
  to {
    opacity: 1;
    max-height: 200px;
    padding-top: 20px;
    padding-bottom: 20px;
  }
}

.mobile-search-section h4 {
  margin: 0 0 15px 0;
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
}

.mobile-search-input-group {
  display: flex;
  margin-bottom: 15px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  overflow: hidden;
}

.mobile-search-input {
  flex: 1;
  padding: 12px 15px;
  border: none;
  outline: none;
  font-size: 14px;
  background-color: #ffffff;
}

.mobile-search-input::placeholder {
  color: #9ca3af;
}

.mobile-search-submit {
  padding: 12px 15px;
  background-color: #f97316;
  border: none;
  color: white;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.mobile-search-submit:hover {
  background-color: #ea580c;
}

.mobile-search-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mobile-search-tag {
  padding: 6px 12px;
  background-color: #f3f4f6;
  color: #6b7280;
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid #e5e7eb;
}

.mobile-search-tag:hover {
  background-color: #f97316;
  color: white;
  border-color: #f97316;
}

/* 移动端语言选择区域 */
.mobile-language-section {
  padding: 20px;
  background-color: #f9fafb;
  animation: slideDown 0.3s ease;
  border-left: 3px solid #f97316;
  margin: 0;
}

.mobile-language-section h4 {
  margin: 0 0 15px 0;
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
}

.mobile-language-items {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mobile-lang-item {
  display: flex;
  align-items: center;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  text-decoration: none;
  color: #374151;
  font-size: 14px;
  transition: all 0.2s ease;
  gap: 8px;
}

.mobile-lang-item:hover {
  background-color: #f3f4f6;
  border-color: #f97316;
}

.mobile-lang-item img {
  width: 20px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}

/* 移动端响应式样式 */
@media (max-width: 768px) {
  .nav-container {
    padding: 0 15px;
    height: 60px;
    justify-content: space-between;
  }
  
  .logo-image {
    height: 35px;
    max-width: 120px;
  }
  
  .brand-text span {
    font-size: 11px;
  }
  
  /* 隐藏桌面端导航菜单 */
  .nav-menu {
    display: none;
  }
  
  /* 隐藏桌面端导航右侧 */
  .nav-right {
    display: none;
  }
  
  /* 显示移动端汉堡菜单 */
  .hamburger-menu {
    display: flex;
  }
  
  .language-button {
    padding: 6px 20px 6px 8px;
    font-size: 11px;
    min-width: 60px;
  }
  
  .language-popup {
    width: 90vw;
    max-width: 90vw;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
  
  .language-items {
    grid-template-columns: repeat(4, 1fr);
    padding: 12px;
    gap: 6px;
    max-height: 250px;
  }
  
  .lang-item {
    font-size: 10px;
    padding: 8px 4px;
    gap: 4px;
    min-height: 50px;
  }
  
  .search-popup-content {
    width: 95%;
    max-width: 400px;
  }
}

@media (max-width: 480px) {
  .nav-container {
    padding: 0 10px;
    height: 55px;
  }
  
  .logo-image {
    height: 30px;
    max-width: 100px;
  }
  
  .brand-text span {
    font-size: 9px;
  }
  
  .language-button {
    padding: 5px 15px 5px 6px;
    font-size: 10px;
    min-width: 50px;
  }
  
  .mobile-menu {
    width: 280px;
  }
  
  .mobile-nav-link {
    font-size: 15px;
    padding: 14px 20px;
  }
  
  .mobile-function-toggle {
    padding: 14px 20px;
  }
  
  .function-text {
    font-size: 15px;
  }
  
  .language-items {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }
  
  .lang-item {
    font-size: 9px;
    padding: 6px 2px;
    gap: 3px;
    min-height: 45px;
  }
  
  .search-popup-content {
    width: 98%;
    max-width: 350px;
  }
  
  .search-body {
    padding: 16px;
  }
  
  .search-input-group {
    flex-direction: column;
    gap: 8px;
  }
  
  .search-submit {
    width: 100%;
    justify-content: center;
  }
}

/* 确保导航栏在页面顶部固定 */
body {
  padding-top: 0;
}

/* 调整主内容区域，避免被固定导航栏遮挡 */
.site-main {
  margin-top: 0;
}
