@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;1,700&display=swap');

/* 全站共享样式（Topbar） */

body {
  margin: 0;
  padding: 0;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 5px 12px;
  background: #f5f5f5;
  color: #555;
  font-size: 12px;
  margin: 0;
  border-bottom: 1px solid #ddd;
}

.topbar__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar__left,
.topbar__right {
  display: flex;
  gap: 16px;
  align-items: center;
}

.topbar__right {
  justify-content: flex-end;
}

.topbar__item {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  text-decoration: none;
  color: #666;
  font-size: 12px;
  white-space: nowrap;
  transition: color 0.2s;
}

.topbar__item:hover {
  color: #333;
}

.topbar__icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  opacity: 0.8;
}

.topbar__social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #666;
  font-size: 11px;
  font-weight: 600;
  transition: color 0.2s;
}

.topbar__social:hover {
  color: #333;
}

.topbar__lang {
  color: #666;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}

.topbar__lang:hover {
  color: #333;
}

@media (max-width: 768px) {
  /* 手机端完全隐藏 topbar */
  .topbar {
    display: none;
  }
}

@media (max-width: 720px) {
  .topbar__text {
    display: none;
  }

  .topbar__left {
    gap: 8px;
  }

  .topbar__lang {
    font-size: 11px;
  }
}

/* 可选：简单 header（未来扩展用） */
.site-header {
  margin-top: 52px;
  padding: 12px 12px;
}

.site-header__inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header__brand {
  font-weight: 700;
}

.site-header__nav a {
  margin-left: 10px;
  color: #111827;
}

/* ==================== Search Bar (Logo + Tagline + Search) ==================== */

.search-bar {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 8px 0;
}

.search-bar__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.search-bar__logo {
  flex-shrink: 0;
}

.search-bar__logo a {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.search-bar__logo-img {
  max-height: 55px;
  width: auto;
  object-fit: contain;
}

.search-bar__logo-text {
  font-size: 24px;
  font-weight: 800;
  color: #1565C0;
  letter-spacing: 0.5px;
}

.search-bar__tagline {
  flex: 1;
  font-size: 15px;
  color: #1565C0;
  font-weight: 500;
  padding-left: 16px;
  line-height: 1.4;
}

.search-bar__company {
  flex: 1;
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-size: 20px;
  font-weight: 700;
  color: #1a3a5c;
  letter-spacing: 0.5px;
  font-style: italic;
}

.search-bar__search {
  flex: 0 0 240px;
  position: relative;
  margin-left: auto;
}

.search-bar__form {
  display: flex;
  align-items: center;
  border: 1px solid #ccc;
  border-radius: 0;
  overflow: hidden;
  transition: border-color 0.2s;
  background: #fff;
}

.search-bar__form:focus-within {
  border-color: #1565C0;
}

.search-bar__input {
  flex: 1;
  border: none;
  outline: none;
  padding: 5px 10px;
  font-size: 12px;
  color: #333;
  background: transparent;
}

.search-bar__input::placeholder {
  color: #999;
}

.search-bar__btn {
  border: none;
  background: transparent;
  color: #666;
  padding: 5px 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.search-bar__btn:hover {
  color: #1565C0;
}

.search-bar__dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  max-height: 360px;
  overflow-y: auto;
  z-index: 200;
}

.search-bar__result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  text-decoration: none;
  color: #111827;
  transition: background 0.15s;
  border-bottom: 1px solid #f3f4f6;
}

.search-bar__result-item:last-child {
  border-bottom: none;
}

.search-bar__result-item:hover {
  background: #f0f7ff;
}

.search-bar__result-img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  background: #f3f4f6;
  flex-shrink: 0;
}

.search-bar__result-info {
  flex: 1;
  min-width: 0;
}

.search-bar__result-name {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-bar__result-cat {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

.search-bar__no-result {
  padding: 20px;
  text-align: center;
  color: #9ca3af;
  font-size: 14px;
}

@media (max-width: 768px) {
  .search-bar__inner {
    flex-wrap: wrap;
    gap: 10px;
  }

  .search-bar__logo-img {
    max-height: 40px;
  }

  .search-bar__logo-text {
    font-size: 18px;
  }

  .search-bar__tagline {
    display: none;
  }

  .search-bar__company {
    display: none;
  }

  .search-bar__search {
    flex: 1 1 100%;
  }
}

/* ==================== Header Navigation 导航菜单 ==================== */

.header {
  background: #2196F3;
  color: white;
  position: sticky;
  top: 0;
  z-index: 90;
  margin: 0;
}

.header__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.header__menu {
  list-style: none;
  display: flex;
  gap: 0;
  margin: 0;
  padding: 0;
  align-items: center;
}

.header__item {
  position: relative;
  margin: 0;
}

.header__link {
  display: block;
  padding: 14px 22px;
  color: white;
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.5px;
  transition: background 0.2s ease;
  white-space: nowrap;
  text-transform: uppercase;
}

.header__link:hover {
  background: rgba(255, 255, 255, 0.15);
  text-decoration: none;
}

/* 当前激活的菜单项 */
.header__item.active .header__link {
  background: rgba(255, 255, 255, 0.15);
}

.header__dropdown-icon {
  font-size: 10px;
  margin-left: 6px;
  transition: transform 0.2s;
}

.header__item:hover .header__dropdown-icon {
  transform: rotate(180deg);
}

/* ==================== 下拉菜单 ==================== */

.header__dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  list-style: none;
  padding: 8px 0;
  min-width: 280px;
  z-index: 100;
  border-radius: 0 0 8px 8px;
  animation: dropdownFadeIn 0.2s ease;
}

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

.header__item:hover .header__dropdown {
  display: block;
}

.header__dropdown li {
  margin: 0;
}

.header__dropdown a {
  display: block;
  padding: 12px 20px;
  color: #1f2937;
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.header__dropdown a:hover {
  background: #f3f4f6;
  text-decoration: none;
  border-left-color: #3b82f6;
  padding-left: 23px;
}

/* ==================== 二级子菜单 ==================== */

.header__dropdown .has-submenu {
  position: relative;
}

.submenu-arrow {
  float: right;
  margin-left: 8px;
  font-size: 16px;
  transition: transform 0.2s;
}

.header__submenu {
  display: none;
  position: absolute;
  top: 0;
  left: 100%;
  background: white;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  list-style: none;
  padding: 8px 0;
  min-width: 280px;
  z-index: 101;
  border-radius: 8px;
  animation: submenuFadeIn 0.2s ease;
}

@keyframes submenuFadeIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.header__dropdown .has-submenu:hover .header__submenu {
  display: block;
}

.header__submenu li {
  margin: 0;
}

.header__submenu a {
  display: block;
  padding: 12px 20px;
  color: #1f2937;
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.header__submenu a:hover {
  background: #f3f4f6;
  text-decoration: none;
  border-left-color: #3b82f6;
  padding-left: 23px;
}

/* ==================== 汉堡菜单按钮 ==================== */

.header__hamburger {
  display: none;
}

/* ==================== 响应式设计 ==================== */

@media (max-width: 768px) {
  /* 隐藏 search-bar 公司名 */
  .search-bar__company {
    display: none;
  }

  /* search-bar logo 缩小 */
  .search-bar__logo-img {
    max-height: 36px;
  }

  .search-bar__logo-text {
    font-size: 14px;
  }

  /* 搜索框占满宽度 */
  .search-bar__inner {
    gap: 8px;
  }

  /* Header 定位改为相对 */
  .header {
    position: relative;
    top: 0;
  }

  .header__container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 0;
  }

  /* 汉堡按钮显示 */
  .header__hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 16px;
    margin-left: auto;
  }

  .header__hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.25s;
  }

  .header__hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .header__hamburger.active span:nth-child(2) {
    opacity: 0;
  }

  .header__hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* 菜单默认收起 */
  .header__menu {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .header__menu.open {
    display: flex;
  }

  .header__item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .header__link {
    padding: 12px 20px;
    font-size: 14px;
  }

  .header__dropdown {
    position: static;
    box-shadow: none;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 0;
    padding: 0;
    min-width: unset;
    /* 手机端子菜单默认收起 */
    display: none;
  }

  .header__dropdown a {
    padding: 9px 20px 9px 36px;
    color: rgba(255, 255, 255, 0.85);
    border-left: none;
    font-size: 13px;
  }

  .header__dropdown a:hover {
    background: rgba(255, 255, 255, 0.1);
  }

  /* 点击父菜单展开子菜单 */
  .header__item.has-dropdown.expanded .header__dropdown {
    display: block;
  }

  .header__dropdown-icon {
    transition: transform 0.2s;
  }

  .header__item.has-dropdown.expanded .header__dropdown-icon {
    transform: rotate(180deg);
  }
}

/* ==================== 桌面端优化 ==================== */

@media (min-width: 769px) {
  .header__hamburger {
    display: none;
  }

  .header__menu {
    justify-content: center;
  }

  .header__link {
    padding: 14px 24px;
  }
}
