/* ================= VEPO 全局头部样式（所有前台页面共用） ================= */
:root {
  --primary: #174187;
  --primary-dark: #0e2e68;
  --primary-light: #2a57a8;
  --border-light: #eef1f6;
  --text-dark: #1a2744;
}

/* ===== Header（吸顶；首页透明渐变，其余页面白底） ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: #fff;
  transition: background .15s linear, box-shadow .25s ease;
}
/* 首页：初始透明，由 JS 滚动渐变 */
.page-home .header {
  background: rgba(255, 255, 255, 0);
}
.header-topbar {
  width: 100%;
  height: 4px;
  background: var(--primary);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform .3s ease;
}
.header.has-bg .header-topbar {
  transform: scaleY(1);
}
.header .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 92px;
}
.logo img { height: 46px; object-fit: contain; }

/* 右侧整体（导航 + 操作区），两者挨近靠右 */
.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav-list {
  display: flex;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-link {
  font-size: 15px;
  color: var(--text-dark);
  font-weight: 500;
  padding: 8px 0;
  position: relative;
  text-decoration: none;
}
.nav-link:hover { color: var(--primary); }
.nav-link.active {
  color: var(--primary);
  font-weight: 600;
}
.nav-link.active::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -2px;
  transform: translateX(-50%);
  width: 26px;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 搜索：默认只显示图标，点击后右侧滑出输入框 */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.header-search {
  width: 38px; height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dark);
  border-radius: 50%;
  transition: all .25s ease;
  cursor: pointer;
  background: none;
  border: 0;
}
.header-search:hover {
  background: rgba(23, 65, 135, .1);
  color: var(--primary);
}
.header-search-form {
  position: absolute;
  right: calc(100% + 6px);
  top: 50%;
  transform: translateY(-50%) scaleX(0);
  transform-origin: right center;
  opacity: 0;
  visibility: hidden;
  transition: transform .25s ease, opacity .2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 6px;
  padding: 4px 6px 4px 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .08);
  width: 260px;
  box-sizing: border-box;
}
.search-wrap.open .header-search-form {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) scaleX(1);
}
.header-search-form input {
  border: 0;
  outline: none;
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: #333;
  background: transparent;
  padding: 6px 0;
}
.header-search-form button {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  cursor: pointer;
  padding: 4px;
  border: 0;
  background: none;
}

/* ===== 自定义多语言下拉 ===== */
.lang-switch {
  position: relative;
  min-width: 124px;
  z-index: 20;
}
.lang-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 14px 9px 16px;
  border: 1px solid #e2e2e2;
  border-radius: 6px;
  color: #333;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s ease;
  box-sizing: border-box;
}
.lang-trigger:hover { border-color: #cfcfcf; }
.lang-trigger:focus {
  outline: none;
  border-color: #c4c4c4;
}
.lang-current {
  flex: 1 1 auto;
  text-align: left;
  line-height: 1.4;
}
.lang-trigger .caret {
  color: #333;
  opacity: 1;
  flex-shrink: 0;
  transition: transform .25s ease;
}
.lang-switch.open .lang-trigger .caret {
  transform: rotate(180deg);
}
.lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 100%;
  list-style: none;
  margin: 0;
  padding: 6px 0;
  background: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all .22s ease;
  overflow: hidden;
}
.lang-switch.open .lang-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.lang-option {
  padding: 11px 20px;
  color: #444;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
  border-top: 1px solid #f0f0f0;
  white-space: nowrap;
}
.lang-option:first-child { border-top: none; }
.lang-option:hover {
  background: #f6f8fb;
  color: var(--primary);
}
.lang-option.active {
  color: #111;
  font-weight: 600;
  background: transparent;
}

/* ===== 移动端汉堡按钮 ===== */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
}
.mobile-menu-btn span {
  width: 24px; height: 2px; background: var(--text-dark);
  transition: all .3s ease;
}
.mobile-menu-btn.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== 非首页：fixed 吸顶需要给内容让位（4px 装饰条 + 92px 内容区） ===== */
body:not(.page-home):not(.in-iframe) {
  padding-top: 96px;
}

/* ================= Responsive ================= */
@media (max-width: 1024px) {
  .nav-list { gap: 18px; }
  .nav-link { font-size: 14px; }
}

@media (max-width: 768px) {
  body:not(.page-home):not(.in-iframe) {
    padding-top: 76px;
  }
  .header-inner { height: 72px; }
  .logo img { height: 36px; }
  .mobile-menu-btn { display: flex; }
  /* 移动端首屏显示多语言：只隐藏搜索按钮 */
  .header-actions { display: flex; gap: 6px; }
  .header-actions .header-search { display: none; }
  .nav {
    position: fixed;
    top: 72px;
    left: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .1);
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
    z-index: 99;
  }
  .header.has-bg .nav { top: 76px; }
  .nav.active { max-height: 500px; }
  .nav-list { flex-direction: column; gap: 0; padding: 12px 0; }
  .nav-list li { border-bottom: 1px solid var(--border-light); }
  .nav-link { display: block; padding: 16px 24px; font-size: 15px; color: #2a2a2a !important; }
  .nav-link.active::after { display: none; }
}
