﻿/* 搜索框：默认只显示圆形图标，点击后展开输入框 */

.header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1002; /* 楂樹簬鍙充笅瑙掓偓娴寜閽?1000)锛屽叏灞忚彍鍗曞彲鐩栦綇 */
  background: #000;
  color: #fff;
  transition: box-shadow 0.25s ease;
}

/* 婊氬姩鍚庣粰瀵艰埅鍔犱竴灞傞槾褰憋紝绐佸嚭缃《鏁堟灉 */
.header.scrolled {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.header-inner {
  box-sizing: border-box;
  width: 100%;
  height: 70px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
}

/* ---------- Logo ---------- */
.header .logo {
  display: flex;
}

.header .logo a {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

/* logo 鍥剧墖锛氭寜瀹藉害绛夋瘮缂╂斁锛岄珮搴﹁嚜閫傚簲 */
.header .logo .logo-img {
  display: block;
  width: auto;
  height: 32px;
  object-fit: contain;
}

/* ---------- 鐢佃剳绔鑸?---------- */
.header .nav {
  display: flex;
  align-items: center;
  gap: 40px;
  margin-left: auto; /* 鑿滃崟涓庡彸渚ф悳绱竴璧烽潬鍙虫帓鐗?*/
  margin-right: 16px; /* 搜索框：默认只显示圆形图标，点击后展开输入框 */
}

.header .nav a {
  position: relative;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  padding: 8px 0;
  transition: color 0.2s;
}

.header .nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  right: 50%;
  bottom: 0;
  height: 2px;
  background: #fff;
  transition:
    left 0.3s ease,
    right 0.3s ease;
}

.header .nav a:hover {
  color: #fff;
}

.header .nav a:hover::after {
  left: 0;
  right: 0;
}

/* 当前页高亮：白色文字 + 底部下划线 */
.header .nav a.active {
  color: #fff;
}

.header .nav a.active::after {
  left: 0;
  right: 0;
}

/* ---------- 右侧：搜索 + 汉堡按钮 ---------- */
.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* 搜索框：默认只显示圆形图标，点击后展开输入框 */
.header .search {
  position: relative;
  display: flex;
  align-items: center;
  height: 36px;
  min-width: 36px; /* 鏈睍寮€鏃朵篃鍗犱綅锛岄伩鍏嶆寜閽粷瀵瑰畾浣嶅悗濉岄櫡 */
}

.header .search .search-input {
  width: 0;
  height: 36px;
  padding: 0;
  border: none;
  outline: none;
  background: #1a1a1a;
  color: #fff;
  font-size: 14px;
  border-radius: 18px;
  opacity: 0;
  transition:
    width 0.28s ease,
    padding 0.28s ease,
    opacity 0.2s ease;
}

.header .search.open .search-input {
  width: 170px;
  padding: 0 40px 0 16px;
  opacity: 1;
}

.header .search-btn {
  position: absolute;
  right: 0;
  top: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: #1a1a1a;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  /* remove mobile tap highlight & default press/focus styles */
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  user-select: none;
}

.header .search-btn:hover {
  background: #333;
}

/* no browser default background block while pressed or focused */
.header .search-btn:focus,
.header .search-btn:focus-visible,
.header .search-btn:active {
  background: #1a1a1a;
  outline: none;
  box-shadow: none;
}

/* press feedback: slight shrink + lighter background */
.header .search-btn:active {
  transform: scale(0.9);
  background: #333;
}

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

/* ---------- 涓嫳鏂囧垏鎹紙鐢佃剳绔級 ---------- */
.lang-switch {
  position: relative;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 36px;
  padding: 0 12px;
  border: none;
  border-radius: 18px;
  background: #1a1a1a;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.lang-btn:hover {
  background: #333;
}

.lang-arrow {
  width: 12px;
  height: 12px;
  transition: transform 0.2s;
}

.lang-switch.open .lang-arrow {
  transform: rotate(180deg);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 120px;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 6px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition:
    opacity 0.2s,
    transform 0.2s,
    visibility 0.2s;
  z-index: 999;
}

.lang-switch.open .lang-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-dropdown a {
  display: block;
  padding: 9px 16px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition:
    background 0.2s,
    color 0.2s;
}

.lang-dropdown a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* ---------- 姹夊牎鎸夐挳锛堜粎鎵嬫満绔樉绀猴級 ---------- */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: end;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  /* remove mobile tap highlight & default button press/focus styles */
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  user-select: none;
  /* smooth press feedback */
  transition: transform 0.15s;
}

/* no background block when pressed or focused */
.menu-toggle:focus,
.menu-toggle:focus-visible,
.menu-toggle:active {
  background: transparent;
  outline: none;
  box-shadow: none;
}

/* press feedback: slight shrink */
.menu-toggle:active {
  transform: scale(0.9);
}

/* keep the three bars white while pressing */
.menu-toggle:active span {
  background: #fff;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 1px;
  margin: 3.25px 0;
  border-radius: 1px;
  background: #fff;
  transition:
    transform 0.25s,
    opacity 0.25s;
}

/* 鑿滃崟灞曞紑鏃讹紝涓夋潯绾垮彉鎴?X */
.menu-toggle.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-46deg);
}

/* 鍏ㄥ睆鑿滃崟鎵撳紑鏃堕攣瀹氶〉闈㈡粴鍔?*/
/* ---------- 鎵嬫満绔叏灞忚彍鍗?---------- */
.mobile-nav {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  flex-direction: column;
  background: #000;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-nav.open {
  display: flex;
  opacity: 1;
  visibility: visible;
}

/* 浠呯洿鎺ュ瓙绾ц彍鍗曢」锛堜笉浣滅敤浜庤瑷€鍒囨崲閲岀殑 a锛?*/
.mobile-nav > a {
  display: block;
  padding: 14px 28px;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18); /* 涓庨〉鑴氬垎鍓茬嚎涓€鑷?*/
  transition:
    background 0.2s,
    color 0.2s;
}

.mobile-nav > a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.mobile-nav > a.active {
  color: #fff;
  font-weight: 600;
}

/* 鏈€鍚庝竴涓彍鍗曢」锛堣仈绯伙級涓嶅姞鍒嗗壊绾?*/
.mobile-nav > a:last-of-type {
  border-bottom: none;
}

/* 鎵嬫満绔叏灞忚彍鍗曢噷鐨勬悳绱紙鏀惧湪鑿滃崟椤逛笂鏂癸級 */
.mobile-nav .search-mobile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.mobile-nav .search-mobile input {
  flex: 1;
  height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 19px;
  background: #1a1a1a;
  color: #fff;
  font-size: 14px;
  outline: none;
  /* remove mobile tap highlight on the input too */
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav .search-mobile button {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: #1a1a1a;
  color: #fff;
  cursor: pointer;
  /* remove mobile tap highlight & default press/focus styles */
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  user-select: none;
  /* smooth press feedback */
  transition: transform 0.15s, background 0.15s;
}

/* keep the dark round background while pressed or focused */
.mobile-nav .search-mobile button:focus,
.mobile-nav .search-mobile button:focus-visible,
.mobile-nav .search-mobile button:active {
  background: #1a1a1a;
  outline: none;
  box-shadow: none;
}

/* press feedback: slight shrink + lighter background */
.mobile-nav .search-mobile button:active {
  transform: scale(0.9);
  background: #333;
}

.mobile-nav .search-mobile svg {
  width: 16px;
  height: 16px;
}

/* 鎵嬫満绔腑鑻辨枃鍒囨崲锛堝浐瀹氬湪鑿滃崟鏈€搴曢儴锛屾棤涓嬫í绾匡級 */
.lang-mobile {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: auto; /* 璐村埌鍏ㄥ睆鑿滃崟搴曢儴 */
  padding: 14px 28px;
}

.lang-mobile a {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  border-bottom: none;
  transition: color 0.2s;
}

.lang-mobile a:hover {
  color: #fff;
}

.lang-mobile .lang-divider {
  color: rgba(255, 255, 255, 0.3);
  font-size: 14px;
}

/* ---------- 鍝嶅簲寮忥細骞虫澘 / 鎵嬫満 ---------- */
@media (max-width: 860px) {
  .header-inner {
    height: 60px;
    padding: 0 20px;
  }

  /* 鎵嬫満绔細姹夊牎鎸夐挳鎺ㄥ埌鏈€鍙宠竟 */
  .header-right {
    margin-left: auto;
  }

  /* 鎵嬫満绔殣钘忛《鏍忚瑷€涓嬫媺锛堣彍鍗曞唴鏈?lang-mobile 鍒囨崲锛?*/
  .lang-switch {
    display: none;
  }

  /* 鎵嬫満鐗?logo锛氬浐瀹氬搴?180px锛屼笂涓嬪眳涓?*/
  .header .logo .logo-img {
    width: 180px;
    height: auto;
  }

  /* 搜索框：默认只显示圆形图标，点击后展开输入框 */
  .header .nav {
    display: none;
  }

  .header .search {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .mobile-nav {
    display: flex;
  }
}
