/**
 * qet-translate 语言切换器样式（外链版，0.4.16；0.4.21 弹窗 UI 全面升级）
 * 升级插件只需覆盖本文件；静态译文页通过 ?ver= 版本号自动同步，无需重新生成。
 */
.qet-switcher {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, sans-serif;
  --qet-accent: #2f6fe4;
  --qet-accent-deep: #1f53bd;
  --qet-ink: #101a2e;
  --qet-muted: #7a879b;
  --qet-line: #e7edf6;
}

/* ---------- 触发按钮 ---------- */
.qet-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px 7px 8px;
  border: 1px solid #cfe0f6;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #f3f8ff 100%);
  color: var(--qet-accent-deep);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(31, 83, 189, .08);
  transition: box-shadow .18s ease, border-color .18s ease, transform .18s ease;
}
.qet-toggle:hover {
  border-color: #9dc2f2;
  box-shadow: 0 4px 14px rgba(31, 83, 189, .15);
  transform: translateY(-1px);
}
.qet-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4a8bf0, #2660c9);
  color: #fff;
  box-shadow: 0 2px 6px rgba(38, 96, 201, .35);
  flex: none;
}
.qet-caret {
  font-size: 13px;
  line-height: 1;
  opacity: .7;
  margin-left: 1px;
  transition: transform .2s ease;
}
.qet-switcher.is-open .qet-caret { transform: rotate(180deg); }

/* ---------- 弹窗容器 ---------- */
.qet-modal {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 600px;
  max-width: calc(100vw - 24px);
  background: #fff;
  border: 1px solid var(--qet-line);
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(16, 34, 66, .20), 0 6px 18px rgba(16, 34, 66, .08);
  box-sizing: border-box;
  z-index: 2147483647;
  overflow: hidden;
  transform-origin: top right;
  animation: qet-pop .2s cubic-bezier(.2, .8, .3, 1);
}
.qet-modal[hidden] { display: none; }
@keyframes qet-pop {
  from { opacity: 0; transform: translateY(-8px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 顶部渐变高光条 */
.qet-modal::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, #2f6fe4, #5aa0f5 45%, #7cc0ff);
}

/* ---------- 标题区 ---------- */
.qet-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--qet-line);
}
.qet-title-wrap { display: flex; align-items: center; gap: 12px; min-width: 0; }
.qet-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #eef5ff, #dceaff);
  color: var(--qet-accent);
  flex: none;
}
.qet-head-text { min-width: 0; }
.qet-modal-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: .1px;
  color: var(--qet-ink);
  line-height: 1.3;
}
.qet-subtitle {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--qet-muted);
  line-height: 1.4;
}
.qet-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: #f3f6fa;
  color: #93a0b2;
  cursor: pointer;
  flex: none;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.qet-close:hover { background: #e8eef6; color: #33415a; transform: rotate(90deg); }

/* ---------- 语言网格 ---------- */
.qet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 18px 22px 22px;
}
.qet-lang {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #e8edf5;
  border-radius: 12px;
  background: #fff;
  color: #243247;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}
.qet-lang:hover {
  border-color: #a9c9f5;
  background: #f6faff;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(47, 111, 228, .10);
}
.qet-lang.is-active {
  background: linear-gradient(135deg, #eaf3ff, #f5f9ff);
  border-color: #6aa2ee;
  box-shadow: inset 0 0 0 1px rgba(47, 111, 228, .12);
  color: var(--qet-accent-deep);
}
.qet-flag {
  font-size: 21px;
  line-height: 1;
  flex: none;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .08));
}
.qet-lang-text { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.qet-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 550;
}
.qet-code {
  font-size: 10px;
  letter-spacing: .6px;
  color: #a3b0c2;
  text-transform: uppercase;
  font-weight: 700;
}
.qet-lang.is-active .qet-code { color: #7ba4e0; }
.qet-check {
  margin-left: auto;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--qet-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(47, 111, 228, .35);
}

/* ---------- 窄屏适配 ---------- */
@media (max-width: 700px) {
  .qet-modal { width: 420px; }
  .qet-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 14px 16px 18px; }
  .qet-modal-head { padding: 16px 16px 12px; }
  .qet-lang { padding: 10px; gap: 9px; font-size: 13px; }
}
@media (max-width: 420px) {
  .qet-modal { width: calc(100vw - 24px); }
}

/**
 * 0.4.17 导航二级菜单层级补偿
 * 背景：静态译文页由 DOMDocument 重排生成，部分主题（如本客户的 global 主题）会被
 * 重排成「banner 被卷进 header 的 .web_head 容器」，使 banner(z-index:999) 与导航
 * 容器(.container z-index:9) 成为兄弟层，banner 盖住导航的所有二级下拉菜单。
 * 主域动态页无此问题（banner 在 header 外）。这里把导航容器层级提到 banner 之上，
 * 抵消重排副作用。仅当页面同时存在 .web_head 与 .banner 时命中，对其它主题无影响。
 * 实测：修复后 Products/Exhibitions/Project cases 三个二级菜单全部恢复正常显示。
 */
.web_head .container { z-index: 1000 !important; }
