/* ============================================================
   HEADER — Logo / 标语 / 搜索 / 导航
   ============================================================ */

.header {
  background: var(--color-white) url("../image/header_background.png")
    center/cover no-repeat;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Logo 区域 */
.header__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 24px;
  gap: 12px;
}

.header__logos {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.header__logo {
  height: 52px;
  width: auto;
  object-fit: contain;
}

.header__divider {
  width: 1px;
  height: 48px;
  background: #ddd;
  flex-shrink: 0;
  margin: 0 15px;
}

/* 搜索 */
.header__search {
  display: flex;
  align-items: center;
  border-radius: 22px;
  background: #fff;
}

.header__search-icon {
  color: #aaa;
  flex-shrink: 0;
  margin-left: 14px;
}

.header__search-input {
  flex: 1;
  height: 38px;
  width: 180px;
  padding: 0 12px;
  border: none;
  outline: none;
  font-size: 13px;
  background: transparent;
}

.header__search-input::placeholder {
  color: #bbb;
}

.header__search-btn {
  height: 35px;
  padding: 20px;
  border: none;
  background: var(--color-primary);
  color: var(--color-white);
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  line-height: 1;
  border-radius: 22px;
  transform: translateX(1px);
  transition: background 0.2s ease;
}

.header__search-btn:hover {
  background: var(--color-primary-dark);
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.nav {
  background: rgba(25, 96, 55, 0.95);
  position: relative;
}

.nav__list {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 12px;
}

.nav__item {
  position: relative;
}

.nav__link {
  display: block;
  padding: 15px 20px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
  position: relative;
}

.nav__link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background: var(--color-accent);
  transition: width 0.3s ease;
}

.nav__link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.nav__link:hover::after {
  width: 60%;
}

.nav__item--active .nav__link {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  font-weight: 600;
}

.nav__item--active .nav__link::after {
  width: 70%;
}

/* 二级下拉 */
.nav__submenu {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #fff;
  min-width: 140px;
  border-radius: var(--radius-sm);
  box-shadow:
    0 6px 24px rgba(25, 96, 55, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.06);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.22s ease,
    visibility 0.22s ease,
    transform 0.22s ease;
  z-index: 200;
  padding: 6px 0;
}

.nav__submenu::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 6px solid #fff;
}

.nav__item:hover .nav__submenu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav__submenu li {
  list-style: none;
}

.nav__submenu a {
  display: flex;
  align-items: center;
  padding: 12px 22px 12px 18px;
  color: #555;
  font-size: 14px;
  white-space: nowrap;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.nav__submenu a::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #d0d0d0;
  margin-right: 10px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.nav__submenu a:hover {
  background: linear-gradient(
    90deg,
    var(--color-primary-lighter) 0%,
    #fff 100%
  );
  color: var(--color-primary);
  padding-left: 22px;
  border-left-color: var(--color-primary);
}

.nav__submenu a:hover::before {
  background: var(--color-primary);
  width: 6px;
  height: 6px;
  box-shadow: 0 0 6px rgba(25, 96, 55, 0.3);
}

.nav__submenu li + li {
  border-top: 1px solid #f5f5f5;
}

/* 响应式 */
@media (max-width: 900px) {
  .header__top {
    flex-direction: column;
    gap: 12px;
  }
  .header__logos {
    flex-wrap: wrap;
    gap: 10px;
  }
  .header__search-input {
    width: 160px;
  }
  .nav__link {
    padding: 10px 12px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .header__logo {
    height: 32px;
  }
  .header__divider {
    height: 24px;
  }
  .nav__link {
    padding: 8px 10px;
    font-size: 12px;
  }
}