/* 全站语言下拉 — 与顶栏风格统一 */

.header-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.lang-switch {
  position: relative;
  flex-shrink: 0;
  z-index: 1002;
}


.lang-switch-btn {
  box-sizing: border-box;
  height: 34px;
  min-width: 108px;
  padding: 0 10px 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-family: "Inter", Helvetica, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.lang-switch-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.4);
}

.lang-switch-caret {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  opacity: 0.85;
}

/* 内页浅色顶栏 */
.header--theme-light .lang-switch-btn {
  border-color: #e5e7eb;
  background: #f9fafb;
  color: #364153;
}

.header--theme-light .lang-switch-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.lang-switch-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 140px;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(15, 23, 42, 0.06);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.lang-switch-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-switch-menu li {
  margin: 0;
  padding: 0;
}

.lang-switch-menu button {
  all: unset;
  box-sizing: border-box;
  display: block;
  width: 100%;
  padding: 10px 14px;
  font-family: "Inter", Helvetica, system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.3;
  color: #1e293b;
  cursor: pointer;
  transition: background 0.12s ease;
}

.lang-switch-menu button:hover {
  background: #f1f5f9;
}

.lang-switch-menu button.is-active {
  color: #003399;
  font-weight: 600;
  background: #eff6ff;
}

/* 深色顶栏下下拉仍用白底卡片，无需额外变体 */

/* ========== 隐藏 Google 翻译原生顶栏（「已翻译为以下语言」横幅）========== */
html {
  margin-top: 0 !important;
}

body {
  top: 0 !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
  position: relative !important;
}

/* 顶栏 iframe 容器 */
.goog-te-banner-frame,
.goog-te-banner-frame.skiptranslate,
iframe.goog-te-banner-frame,
body > .skiptranslate,
body > iframe.skiptranslate {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  max-height: 0 !important;
  width: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  position: absolute !important;
  left: -9999px !important;
  clip: rect(0, 0, 0, 0) !important;
  pointer-events: none !important;
  border: none !important;
}

/* 部分版本把横幅放在固定层 */
#goog-gt-tt,
.goog-te-balloon-frame,
.goog-tooltip,
.goog-tooltip:hover {
  display: none !important;
  visibility: hidden !important;
}

/* 移动端抽屉内语言区 */
.lang-switch-mobile-label {
  font-family: "Inter", Helvetica, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 10px;
  padding: 0 20px;
}

.lang-switch--mobile {
  width: 100%;
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.lang-switch--mobile .lang-switch-btn {
  width: calc(100% - 40px);
  margin: 0 20px;
}

.lang-switch--mobile .lang-switch-menu {
  left: 20px;
  right: 20px;
  width: auto;
}

/* 内页浅色抽屉 */
.screen .mobile-menu--light .lang-switch-mobile-label {
  color: #64748b;
}

.screen .mobile-menu--light .lang-switch--mobile {
  border-top-color: #e5e7eb;
}

.screen .mobile-menu--light .lang-switch--mobile .lang-switch-btn {
  border-color: #e5e7eb;
  background: #f9fafb;
  color: #364153;
}

.screen .mobile-menu--light .lang-switch--mobile .lang-switch-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

/* 首页深色抽屉内按钮与顶栏一致 */
.screen .mobile-menu:not(.mobile-menu--light) .lang-switch-mobile-label {
  color: rgba(255, 255, 255, 0.55);
}

@media (max-width: 1024px) {
  .lang-switch-btn {
    min-width: 96px;
    height: 32px;
    font-size: 12px;
    padding: 0 8px 0 10px;
  }
}
