.site-header {
  position: -webkit-sticky; /* Safari 支持 */
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.7);
  /* border-bottom: 1px solid var(--border); */
  box-shadow: 0 5px 20px rgba(15, 23, 42, 0.08);
}

.topbar {
  background: #ffffff;
  /* border-bottom: 1px solid var(--border); */

}

.topbar__content {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  max-width: 1440px;
  margin: auto;
  padding: 0.5rem 6vw;
  color: var(--muted);
}

.topbar__left {
  display: flex;
  gap: 1.25rem;
}

.topbar__right {
  display: flex;
  gap: 0.75rem;
}

.navbar {
  display: flex;
  max-width: 1440px;
  margin: auto;
  align-items: stretch;
  justify-content: space-between;
  padding: 1rem 6vw;
  gap: 1.5rem;
}

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

.logo__image {
  height: 60px;
  width: auto;
  object-fit: contain;
}

.logo__mark {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  /* background: linear-gradient(135deg, var(--primary), var(--primary-light)); */
  display: grid;
  place-items: center;
  font-weight: 700;
}

.logo__text {
  display: flex;
  flex-direction: column;
  /*gap: 0.5rem;*/
  font-size: 0.85rem;
  line-height: 1.2;
}

.menu {
  display: flex;
  list-style: none;
  gap: 2.5rem;
  margin: 0;
  padding: 0;
}

.menu.menu--open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 100%;
  right: 0;
  padding: 1.5rem;
  /* border-radius: 16px; */
  background: var(--primary-light);
  border: 1px solid var(--border);
  width: 100%;
}

.menu li {
  position: relative;
  display: flex;
  align-items: center;
}

.menu a {
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s ease;
}
.menu.menu--open a{
  color: white;
}
.menu a:hover {
  color: var(--primary);
  transform: translateX(3px);
}

.has-sub:hover .mega,
.mega:hover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.mega {
  position: absolute;
  top: calc(100%);
  left: 0;
  display: grid;
  grid-template-columns: repeat(1, minmax(200px, 1fr));
  gap: 1.5rem;
  padding: 1.5rem;
  background: white;
  border-radius: 16px;
  border: 1px solid var(--border);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: 0.2s ease;
  /*min-width: 640px;*/
}

.mega h4 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.mega a {
  display: block;
  padding: 0.2rem 0;
  /*color: var(--muted);*/
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg);
}

/* Products mega menu - refined layout */
.mega__column {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.submenu__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.submenu__link {
  display: flex;
  flex-direction: column;
  padding: 0.35rem 0;
  text-decoration: none;
}

/*.submenu__title {*/
/*  font-weight: 500;*/
/*  color: var(--fg);*/
/*}*/

.submenu__subtitle {
  font-size: 0.8rem;
  color: var(--muted);
}

.mega-highlights {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.mega-highlights li::before {
  content: "•";
  color: var(--primary);
  margin-right: 0.35rem;
}

.mega-featured-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.mega-featured-item {
  display: flex;
  gap: 0.6rem;
  padding: 0.4rem;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid transparent;
  text-decoration: none;
}

.mega-featured-item:hover {
  border-color: var(--primary-light);
  background: #f5faf7;
}

.mega-featured-thumb img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
}

.mega-featured-content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.mega-featured-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg);
}

.mega-featured-excerpt {
  font-size: 0.8rem;
  color: var(--muted);
}

.mega-cta {
  margin-top: 0.75rem;
  align-self: flex-start;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s ease;
  padding: 0;
}

.header-search-btn:hover {
  background: rgba(54, 153, 102, 0.1);
  color: var(--primary);
}

.header-search-btn svg {
  width: 20px;
  height: 20px;
}

.header-btn-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 0.35rem;
  background: none;
  border: 0;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--fg);
}

/* 搜索栏区域 */
.header-search-bar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 2000;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.header-search-bar__container {
  position: relative;
  max-width: 1440px;
  margin: 0 auto;
  padding: 2.2rem 6vw;
}

.header-search-close {
  position: absolute;
  top: 50%;
  right: 6vw;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s ease;
  z-index: 10;
}

.header-search-close:hover {
  background: rgba(16, 24, 40, 0.08);
  color: var(--fg);
}

.header-search-close svg {
  width: 24px;
  height: 24px;
}

.header-search-form {
  display: flex;
  gap: 0.75rem;
  max-width: 800px;
  margin: 0 auto;
}

.header-search-form input {
  flex: 1;
  padding: 1rem 1.5rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
  background: #ffffff;
  color: var(--fg);
}

.header-search-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(54, 153, 102, 0.1);
}

.header-search-form input::placeholder {
  color: var(--muted);
}

.header-search-submit {
  padding: 1rem 2rem;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  font-size: 1rem;
  font-family: inherit;
}

.header-search-submit:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(54, 153, 102, 0.3);
}

.header-search-submit svg {
  width: 20px;
  height: 20px;
}

/* 移动端适配 */
@media (max-width: 1024px) {
  .menu {
    display: none;
  }

  .menu.menu--open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .header-actions {
    gap: 0.75rem;
  }

  .header-search-btn {
    width: 36px;
    height: 36px;
  }

  .header-search-bar__container {
    padding: 1.25rem 4vw;
  }

  .header-search-close {
    top: 50%;
    right: 4vw;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
  }

  .header-search-close svg {
    width: 20px;
    height: 20px;
  }

  .header-search-form {
    flex-direction: column;
    gap: 0.75rem;
  }

  .header-search-submit {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .logo{
      width: 39%;
  }
  .topbar {
    display: none;
  }
  .logo__text{
    font-size: 0.55rem;
  }
  .navbar {
    padding: 1rem 1.5rem;
  }

  .header-actions {
    gap: 0.5rem;
  }

  .header-search-btn {
    width: 32px;
    height: 32px;
  }

  .header-search-btn svg {
    width: 18px;
    height: 18px;
  }

  .header-search-bar__container {
    padding: 1rem 4vw;
  }

  .header-search-close {
    top: 30%;
    right: 4vw;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
  }

  .header-search-close svg {
    width: 18px;
    height: 18px;
  }

  .header-search-form input {
    padding: 0.875rem 1.25rem;
    font-size: 0.95rem;
  }

  .header-search-submit {
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
  }
}
@media (max-width: 400px){
  .header-btn-container .btn{
    font-size: 0.5rem;
  }
}