/* ============================================================
   header.css — 固定导航栏
   毛玻璃效果、导航链接金色下划线、语言切换器、CTA 按钮
   ============================================================ */

/* ----------------------------------------------------------
   导航栏主体
   ---------------------------------------------------------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: var(--z-header);
  padding: var(--space-4) var(--space-12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-white-85);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border-bottom: 1px solid var(--color-border-subtle);
  transition: background var(--transition-base),
              box-shadow var(--transition-base);
}

/* 滚动后状态 — JS 添加 .scrolled 类 */
.header.scrolled {
  background: var(--color-white-95);
  box-shadow: var(--shadow-header);
}

/* 移动菜单打开时，Header 必须高于全屏遮罩，保证关闭按钮可点击。 */
.header.menu-open {
  z-index: calc(var(--z-mobile-menu) + 1);
  background: transparent;
  border-bottom-color: transparent;
  box-shadow: none;
}

/* ----------------------------------------------------------
   Logo
   ---------------------------------------------------------- */
.header-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-en);
  font-size: var(--text-4xl);
  font-weight: var(--weight-semibold);
  color: var(--color-graphite-black);
  letter-spacing: var(--tracking-wide);
  white-space: nowrap;
}

/* ----------------------------------------------------------
   导航菜单
   ---------------------------------------------------------- */
.header-nav {
  display: flex;
  gap: var(--space-8);
  list-style: none;
  align-items: center;
}

.nav-link {
  text-decoration: none;
  color: var(--color-graphite-black);
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  position: relative;
  transition: color var(--transition-base);
  padding: var(--space-1) 0;
}

/* 金色下划线指示器 */
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-champagne-gold);
  transition: width var(--transition-base);
  border-radius: var(--radius-full);
}

.nav-link:hover {
  color: var(--color-champagne-gold);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link.active {
  color: var(--color-champagne-gold);
}

/* ----------------------------------------------------------
   右侧操作区
   ---------------------------------------------------------- */
.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  flex-shrink: 0;
}

/* ----------------------------------------------------------
   语言切换器 — 药丸式设计
   ---------------------------------------------------------- */
.lang-switcher {
  display: flex;
  background: var(--color-bg-hover);
  border-radius: var(--radius-2xl);
  padding: 3px;
  gap: 2px;
}

.lang-btn {
  padding: 6px 14px;
  border-radius: var(--radius-xl);
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-platinum-gray);
  transition: all var(--transition-base);
  white-space: nowrap;
}

.lang-btn:hover {
  color: var(--color-graphite-black);
}

.lang-btn.active {
  background: var(--color-pure-white);
  color: var(--color-graphite-black);
  box-shadow: var(--shadow-xs);
}

/* ----------------------------------------------------------
   CTA 按钮 — 金色主按钮
   ---------------------------------------------------------- */
.cta-btn {
  background: var(--color-champagne-gold);
  color: var(--color-pure-white);
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius-2xl);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: all var(--transition-base);
  letter-spacing: var(--tracking-tight);
  white-space: nowrap;
}

.cta-btn:hover {
  background: var(--color-gold-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-gold);
}

.cta-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

/* ----------------------------------------------------------
   移动端菜单按钮 — 汉堡图标
   ---------------------------------------------------------- */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  z-index: calc(var(--z-mobile-menu) + 1);
  position: relative;
}

.mobile-menu-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-graphite-black);
  margin: 5px 0;
  transition: all var(--transition-base);
  border-radius: var(--radius-full);
}

/* 汉堡图标 → X 变形动画 */
.mobile-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
  transform: translateX(-10px);
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ----------------------------------------------------------
   移动端全屏菜单
   ---------------------------------------------------------- */
.mobile-menu {
  display: none;
}

.mobile-menu.active {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background: var(--color-white-98);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: var(--space-8);
  z-index: var(--z-mobile-menu);
  animation: menuFadeIn 0.3s ease forwards;
}

/* 菜单打开动画 */
@keyframes menuFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.mobile-menu .nav-link {
  font-size: 1.5rem;
  font-weight: var(--weight-semibold);
  color: var(--color-graphite-black);
  opacity: 0;
  transform: translateY(20px);
  animation: menuItemSlide 0.4s ease forwards;
}

.mobile-menu .nav-link:nth-child(1) { animation-delay: 0.1s; }
.mobile-menu .nav-link:nth-child(2) { animation-delay: 0.15s; }
.mobile-menu .nav-link:nth-child(3) { animation-delay: 0.2s; }
.mobile-menu .nav-link:nth-child(4) { animation-delay: 0.25s; }
.mobile-menu .nav-link:nth-child(5) { animation-delay: 0.3s; }
.mobile-menu .nav-link:nth-child(6) { animation-delay: 0.35s; }

@keyframes menuItemSlide {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-menu .lang-switcher {
  margin-top: var(--space-6);
}

.mobile-menu .cta-btn {
  margin-top: var(--space-4);
  padding: 14px 36px;
  font-size: var(--text-xl);
}

/* ----------------------------------------------------------
   响应式 — 平板 & 移动端
   ---------------------------------------------------------- */
@media (max-width: 1024px) {
  .header {
    padding: var(--space-4) var(--space-6);
  }

  .header-nav {
    gap: var(--space-6);
  }
}

@media (max-width: 768px) {
  .header {
    padding: var(--space-3) var(--space-5);
  }

  .header-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
  }

  .header-right .cta-btn {
    display: none;
  }

  .header-right .lang-switcher {
    display: none;
  }
}
