/* ===== Header 整体设置 (单层结构) ===== */
.header {
  background-color: var(--color-primary);
  border-bottom: 1px solid var(--color-primary-dark);
  position: sticky;
  top: 0;
  z-index: 50000;
}

.header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px; /* 贴近原站高度 */
}

/* 1. 左侧 Logo 占位 */
.header__logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  gap: 10px;
}

.header__logo-placeholder {
  width: 160px;
  height: 45px;
  background-color: var(--color-white);
  border-radius: 2px;
}

.header__logo-img {
  display: block;
  max-height: 45px;
  width: auto;
  height: auto;
}

.header__logo-text {
  color: var(--color-white);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.6px;
  line-height: 1;
  white-space: nowrap;
}

/* 2. 中间 主导航菜单 */
.header__nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.header__menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 35px; /* 控制菜单间距 */
}

.header__menu-item {
  position: relative;
  display: flex;
  align-items: center;
}

.header__menu-link {
  color: var(--color-white);
  text-decoration: none;
  font-family: inherit;
  font-size: clamp(22px, 0.25vw + 13px, 24px);
  font-weight: 400;
  letter-spacing: 0.2px;
  text-transform: none;
  display: block;
  padding: 30px 0; /* 撑满高度，增加 hover 热区 */
  position: relative;
}

.header__menu-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  height: 2px;
  background-color: var(--color-white);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.25s ease;
}

.header__menu-item:hover > .header__menu-link::after,
.header__menu-link:hover::after {
  transform: scaleX(1);
}

.current-menu-item > .header__menu-link::after,
.current-menu-ancestor > .header__menu-link::after {
  transform: scaleX(1);
}

/* 交互要求: 下拉菜单 hover 显示 */
.header__dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  background-color: var(--color-primary);
  list-style: none;
  margin: 0;
  padding: 10px 0;
  min-width: 220px;
  border: 1px solid var(--color-primary-dark);
  border-radius: 0;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
  z-index: 52000;
  opacity: 0;
  transform: translate(-50%, 10px);
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    visibility 0s linear 160ms;
}

.header__menu-item--has-dropdown:hover > .header__dropdown,
.header__menu-item--has-dropdown:focus-within > .header__dropdown,
.header__menu-item--has-dropdown.active > .header__dropdown {
  opacity: 1;
  transform: translate(-50%, 0);
  visibility: visible;
  pointer-events: auto;
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    visibility 0s linear 0s;
}

.header__dropdown .header__menu-item {
  display: block;
  width: 100%;
}

.header__dropdown-item {
  display: block;
}

.header__dropdown-link {
  display: block;
  padding: 12px 20px 12px 38px;
  color: var(--color-white);
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.2px;
  position: relative;
  transition:
    background-color 0.3s,
    color 0.3s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
}

.header__dropdown > li:last-child > .header__dropdown-link {
  border-bottom: 0;
}

.header__dropdown-link::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 50%;
  width: 8px;
  height: 8px;
  background-color: var(--color-accent);
  transform: translateY(-50%) scale(0.6);
  opacity: 0;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.header__dropdown-link:hover {
  color: var(--color-accent);
  background-color: transparent;
}

.header__dropdown-link:hover::before,
.header__dropdown-link:focus-visible::before {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.header__dropdown-link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.header__dropdown .header__menu-item--has-dropdown {
  position: relative;
}

.header__dropdown .header__dropdown {
  top: 0;
  left: 100%;
  transform: translate(10px, 0);
  min-width: 240px;
}

.header__dropdown .header__menu-item--has-dropdown:hover > .header__dropdown,
.header__dropdown
  .header__menu-item--has-dropdown:focus-within
  > .header__dropdown,
.header__dropdown .header__menu-item--has-dropdown.active > .header__dropdown {
  transform: translate(0, 0);
}

.header__menu-link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 6px;
}

@media (hover: none) {
  .header__menu-item--has-dropdown:hover > .header__dropdown {
    opacity: 0;
    transform: translate(-50%, 10px);
    visibility: hidden;
    pointer-events: none;
  }
}

/* 3. 右侧 搜索 + 语言切换 */
.header__actions {
  display: flex;
  align-items: center;
  gap: 25px;
}

/* 搜索图标占位 */
.header__search {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  padding: 0;
}

.header__search-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-white);
  border-radius: 50%;
  position: relative;
  transition: border-color 0.3s;
}

.header__search-icon::after {
  content: '';
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 6px;
  height: 2px;
  background-color: var(--color-white);
  transform: rotate(45deg);
  transition: background-color 0.3s;
}

.header__search:hover .header__search-icon,
.header__search:hover .header__search-icon::after {
  border-color: var(--color-accent);
  background-color: var(--color-accent);
}
.header__search:hover .header__search-icon {
  background-color: transparent;
}

.header__search-modal {
  position: fixed;
  inset: 0;
  z-index: 70000;
  pointer-events: none;
}

.header__search-modal--open {
  pointer-events: auto;
}

.header__search-modal-overlay {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(10, 18, 35, 0.62);
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 0;
}

.header__search-modal--open .header__search-modal-overlay {
  opacity: 1;
}

.header__search-modal-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(900px, calc(100vw - 40px));
  transform: translate(-50%, -54%);
  opacity: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  padding: 34px 34px 24px;
  transition: all 0.25s ease;
  z-index: 1;
}

.header__search-modal--open .header__search-modal-panel {
  transform: translate(-50%, -50%);
  opacity: 1;
}

.header__search-form {
  margin: 0;
}

.header__search-input {
  width: 100%;
  height: 76px;
  border: 2px solid #d7deea;
  border-radius: 10px;
  font-size: clamp(24px, 1.2vw + 18px, 36px);
  line-height: 1.2;
  padding: 0 24px;
  color: #16263f;
  outline: none;
}

.header__search-input:focus {
  border-color: var(--color-primary);
}

.header__search-hint {
  margin: 14px 2px 0;
  color: #4f627f;
  font-size: 18px;
  line-height: 1.4;
}

.header__search-close {
  position: absolute;
  top: 6px;
  right: 10px;
  border: 0;
  background: transparent;
  color: #7a8598;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  z-index: 2;
}

/* 语言切换 */
.header__lang {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--color-white);
  transition: color 0.3s;
  position: relative;
}

.header__lang-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.header__lang-text img {
  width: 16px;
  height: 11px;
  display: block;
}

.header__lang-text abbr {
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.header__lang-arrow {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--color-white);
  transition: border-color 0.3s;
}

.header__lang:hover {
  color: var(--color-accent);
}

.header__lang:hover .header__lang-arrow {
  border-top-color: var(--color-accent);
}

.header__lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 170px;
  background-color: var(--color-white);
  border: 1px solid var(--color-primary-dark);
  padding: 6px 0;
  box-sizing: border-box;
}

.header__lang--open .header__lang-dropdown {
  display: block;
}

.header__lang-option {
  width: 100%;
  text-align: left;
  border: 0;
  background-color: var(--color-white);
  color: var(--color-gray);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 14px;
  cursor: pointer;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 8px;
}

.header__lang-option img {
  width: 16px;
  height: 11px;
  display: block;
}

.header__lang-option abbr {
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.header__lang-option:hover {
  color: var(--color-accent);
}

.header__burger {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--color-primary-dark);
  background-color: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.header__burger-line {
  display: block;
  width: 18px;
  height: 2px;
  background-color: var(--color-white);
}

.header__burger-line + .header__burger-line {
  margin-top: 4px;
}

.header__drawer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60000;
}

.header__drawer--open {
  pointer-events: auto;
}

.header__drawer-overlay {
  position: fixed;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(10, 18, 35, 0.72);
  opacity: 0;
  transition: opacity 0.3s;
  cursor: pointer;
  z-index: 0;
}

.header__drawer--open .header__drawer-overlay {
  opacity: 0.7;
}

.header__drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 360px;
  background-color: var(--color-white, #ffffff);
  color: #1a1f2b;
  transform: translateX(100%);
  transition: transform 0.3s;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  z-index: 1;
}

.header__drawer--open .header__drawer-panel {
  transform: translateX(0);
}

.header__drawer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px;
  border-bottom: 1px solid var(--color-primary-dark, #162f57);
}

.header__drawer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.header__drawer-top .header__logo-placeholder {
  width: 40px;
  height: 32px;
}

.header__drawer-top .header__logo-img {
  max-height: 32px;
}

.header__drawer-top .header__logo-text {
  color: var(--color-primary, #1f3a66);
  font-size: 14px;
}

.header__drawer-close {
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-primary-dark, #162f57);
  background-color: transparent;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 6l12 12M18 6L6 18' stroke='%23000000' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
}

.header__drawer-nav {
  padding: 10px 18px;
  flex: 1;
  overflow: auto;
  box-sizing: border-box;
  display: block;
  color: #1a1f2b;
}

.header__drawer-langdrop {
  margin: 6px 0 14px;
  border: 1px solid var(--color-primary-dark, #162f57);
  background: #fff;
}

.header__drawer-langdrop-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  user-select: none;
  color: var(--color-gray, #333333);
  font-weight: 700;
  font-size: 14px;
  list-style: none;
}

.header__drawer-langdrop-summary::-webkit-details-marker {
  display: none;
}

.header__drawer-langdrop-icon {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--color-gray, #333333);
  border-bottom: 2px solid var(--color-gray, #333333);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.header__drawer-langdrop[open] .header__drawer-langdrop-icon {
  transform: rotate(-135deg);
}

.header__drawer-langdrop-menu {
  border-top: 1px solid rgba(31, 58, 102, 0.14);
}

.header__drawer-langdrop-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--color-gray, #333333);
  font-weight: 650;
  font-size: 14px;
}

.header__drawer-langdrop-item.is-active {
  color: var(--color-accent, #00bcd4);
}

.header__drawer-langdrop-item:hover {
  color: var(--color-accent, #00bcd4);
}

.header__drawer-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.header__drawer-item {
  border-bottom: 1px solid var(--color-primary-dark, #162f57);
}

.header__drawer-link {
  display: block;
  padding: 14px 0;
  color: var(--color-gray, #333333);
  text-decoration: none;
  font-weight: 600;
  font-size: clamp(16px, 1.3vw + 12px, 20px);
}

.header__drawer-link:hover {
  color: var(--color-accent);
}

.header__drawer-subtoggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border: 0;
  background-color: transparent;
  color: var(--color-gray, #333333);
  font-weight: 600;
  cursor: pointer;
  font-size: clamp(16px, 1.3vw + 12px, 20px);
}

.header__drawer-subtoggle--row {
  padding: 14px 0;
}

.header__drawer-subrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.header__drawer-subrow--root .header__drawer-link {
  flex: 1;
}

.header__drawer-sublink--parent {
  flex: 1;
}

.header__drawer-subtoggle--icon {
  width: 40px;
  height: 40px;
  padding: 0;
  flex: 0 0 40px;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
}

.header__drawer-subtoggle--icon .header__drawer-subtoggle-icon {
  border-right-color: rgba(12, 20, 27, 0.72);
  border-bottom-color: rgba(12, 20, 27, 0.72);
}

.header__drawer-item--subopen .header__drawer-subtoggle--icon .header__drawer-subtoggle-icon {
  transform: rotate(-135deg);
}

.header__drawer-subtoggle:hover {
  color: var(--color-accent);
}

.header__drawer-subtoggle-icon {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--color-gray, #333333);
  border-bottom: 2px solid var(--color-gray, #333333);
  transform: rotate(45deg);
  transition: transform 0.3s;
}

.header__drawer-item--subopen .header__drawer-subtoggle-icon {
  transform: rotate(-135deg);
}

.header__drawer-submenu {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s;
}

.header__drawer-item--subopen .header__drawer-submenu {
  max-height: 900px;
}

.header__drawer-submenu .header__drawer-subtoggle {
  padding: 12px 0 12px 14px;
  font-size: clamp(14px, 1vw + 11px, 16px);
}

.header__drawer-submenu > .header__drawer-subitem > .header__drawer-sublink {
  font-size: clamp(14px, 1vw + 11px, 16px);
}

.header__drawer-submenu .header__drawer-submenu .header__drawer-subtoggle {
  font-size: clamp(12px, 0.8vw + 10px, 14px);
}

.header__drawer-submenu .header__drawer-submenu .header__drawer-sublink {
  padding-left: 28px;
  font-size: clamp(12px, 0.8vw + 10px, 14px);
}

.header__drawer-submenu .header__drawer-submenu .header__drawer-subtoggle {
  padding-left: 28px;
}

.header__drawer-sublink {
  display: block;
  padding: 12px 0 12px 14px;
  color: var(--color-gray, #333333);
  text-decoration: none;
  font-weight: 600;
}

.header__drawer-sublink:hover {
  color: var(--color-accent);
}

.header__drawer-bottom {
  padding: 18px 18px;
  border-top: 1px solid var(--color-primary-dark);
  box-sizing: border-box;
}

.header__drawer-lang {
  display: flex;
  gap: 10px;
}

.header__drawer-lang-btn {
  border: 1px solid var(--color-primary-dark);
  background-color: transparent;
  color: var(--color-gray);
  padding: 10px 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.header__drawer-lang-btn img {
  width: 16px;
  height: 11px;
  display: block;
}

.header__drawer-lang-btn abbr {
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.header__drawer-lang-btn--active {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

body.is-menu-open {
  overflow: hidden;
}

@media (min-width: 950px) {
  .header__burger {
    display: none;
  }
}

@media (min-width: 768px) and (max-width: 949px) {
  .header__nav {
    display: none;
  }

  .header__burger {
    display: flex;
    flex-direction: column;
  }
}

@media (max-width: 767px) {
  .header__nav {
    display: none;
  }

  .header__lang {
    display: none;
  }

  .header__burger {
    display: flex;
    flex-direction: column;
  }

  .header__drawer-panel {
    width: 320px;
  }

  .header__search-modal-panel {
    width: calc(100vw - 22px);
    padding: 24px 16px 16px;
  }

  .header__search-input {
    height: 62px;
    font-size: 24px;
    padding: 0 16px;
  }

  .header__search-hint {
    font-size: 15px;
  }
}
