/* 三语切换器：位于顶部导航「电话号码」之后，🌐 语言 ▾ 触发器 + hover/点击展开下拉菜单（简体 / 英文 / 繁体）
   作为 .hdr-actions 的普通 flex 子元素内联显示，不再悬浮于页面右下角。 */
.zl-lang-switch {
  position: relative;           /* 为下拉菜单提供定位基准 */
  flex: none;
  font-family: var(--font, system-ui, sans-serif);
  -webkit-tap-highlight-color: transparent;
}

/* 触发器：与 .hdr-tel 等高（var(--hdr-cta-h)=40px），默认浅色导航深字 */
.zl-lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: var(--hdr-cta-h, 40px);
  padding: 0 12px;
  border: 1px solid rgba(31,35,41,.14);
  border-radius: 999px;
  background: rgba(255,255,255,.5);
  color: #4e5969;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}
.zl-globe { font-size: 14px; line-height: 1; }
.zl-lang-label { letter-spacing: .02em; }
.zl-caret { font-size: 10px; color: #64748b; transition: transform .2s; line-height: 1; }
.zl-lang-trigger:hover { background: #eef5ff; border-color: rgba(0,105,234,.45); color: #0069ea; }
/* 展开箭头翻转 */
.zl-lang-switch:hover .zl-caret,
.zl-lang-switch:focus-within .zl-caret,
.zl-lang-switch.is-open .zl-caret { transform: rotate(180deg); }

/* 下拉菜单：默认隐藏，hover / focus-within / .is-open(触屏点击) 时展开。
   位于顶部导航，故向下展开（top）而非向上。 */
.zl-lang-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 118px;
  padding: 5px;
  border: 1px solid rgba(0, 105, 234, .18);
  border-radius: 12px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 12px 32px rgba(15, 45, 90, .18);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .18s, transform .18s, visibility .18s;
}
/* 桥接触发器与菜单之间的空隙：伪元素向上延伸覆盖 gap，
   鼠标经过这段区域时仍视为在 .zl-lang-switch 内，hover 不中断、菜单不收起，可直接移入点选语言 */
.zl-lang-menu::before{
  content:"";position:absolute;left:0;right:0;top:-12px;height:12px;
}
.zl-lang-switch:hover .zl-lang-menu,
.zl-lang-switch:focus-within .zl-lang-menu,
.zl-lang-switch.is-open .zl-lang-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* 菜单项 */
.zl-lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  height: 34px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #4e5969;
  font-size: 13px;
  font-weight: 600;
  line-height: 34px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: background .18s, color .18s;
}
.zl-lang-option:hover,
.zl-lang-option:focus { background: #eef5ff; color: #0069ea; outline: none; }
.zl-lang-option.is-active { background: #0069ea; color: #fff; box-shadow: 0 2px 8px rgba(0, 105, 234, .28); }
.zl-opt-check { font-size: 12px; line-height: 1; }
.zl-lang-option:not(.is-active) .zl-opt-check { visibility: hidden; }

/* ---------- 首屏深色 hero 态：切换器文字/边框转白，与电话、导航一致 ---------- */
body[data-page="home"] .hdr.is-over-hero .zl-lang-trigger {
  color: rgba(255,255,255,.92);
  border-color: rgba(255,255,255,.42);
  background: rgba(255,255,255,.12);
}
body[data-page="home"] .hdr.is-over-hero .zl-lang-trigger:hover {
  color: #fff;
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.7);
}
body[data-page="home"] .hdr.is-over-hero .zl-globe,
body[data-page="home"] .hdr.is-over-hero .zl-caret { color: rgba(255,255,255,.9); }

/* 不支持 backdrop-filter 的浏览器（旧版 Edge / IE、部分国产内核）：用不透明纯白兜底 */
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
  .zl-lang-menu{background:#ffffff;}
}

/* 触控设备：补到 44px 热区，去掉点击高亮方块；菜单项同一并放大 */
@media (hover:none),(pointer:coarse){
  .zl-lang-trigger{ min-width:44px; }
  .zl-lang-menu{ min-width:128px; }
  .zl-lang-option{ height:44px; line-height:44px; font-size:14px; padding:0 13px; }
}

/* 小屏：电话被隐藏后，切换器是 hdr-actions 里唯一的语言入口，保留但收紧 */
@media (max-width:640px){
  .zl-lang-trigger{ padding:0 10px; }
  .zl-lang-label{ font-size:11px; }
}
