/* TranslatePress-style floating language switcher */
.trp-floating-switcher {
  display: flex;
  flex-direction: column;
  position: fixed;
  z-index: 99999;
  overflow: hidden;
  padding: var(--switcher-padding, 8px 0);
  border: var(--border, 1px solid #e6e6e6);
  border-radius: var(--border-radius, 0 0 8px 8px);
  background: var(--bg, #ffffff);
  width: var(--switcher-width, auto);
  top: var(--top, 0);
  right: var(--right, 10vw);
  box-shadow: 0 8px 18px rgba(0,0,0,.08);
  box-sizing: border-box;
}

.trp-language-switcher-inner {
  display: flex;
  flex-direction: column;
}

.trp-switcher-dropdown-list {
  display: flex;
  flex-direction: column;
  overflow-y: hidden;
  max-height: 0;
  transition: max-height var(--transition-duration, 0.2s) ease-in-out;
}

.trp-ls-dropdown.is-open .trp-switcher-dropdown-list {
  overflow-y: auto;
  max-height: min(350px, 70vh);
}

.trp-language-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  text-decoration: none;
  min-height: 19px;
  box-sizing: content-box;
  cursor: pointer;
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
}

.trp-language-item:hover {
  background: var(--bg-hover, #f3f3f3);
}

.trp-language-item:hover .trp-language-item-name {
  color: var(--text-hover, #111);
}

.trp-language-item__current {
  cursor: default;
}

.trp-language-item-name {
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text, #222);
  font-size: var(--font-size, 13px);
  line-height: 1.2;
  font-family: "Microsoft YaHei UI", "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 500;
}

.trp-flag-image {
  border-radius: var(--flag-radius, 2px) !important;
  aspect-ratio: var(--aspect-ratio, 4/3) !important;
  width: var(--flag-size, 18px) !important;
  display: inline-block !important;
  height: auto !important;
  flex-shrink: 0;
}

/* Hide Google Translate chrome */
#google_translate_element,
.goog-te-banner-frame,
.goog-te-balloon-frame,
.goog-tooltip,
.goog-tooltip:hover,
#goog-gt-tt,
.goog-te-spinner-pos,
.skiptranslate iframe {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
}
body {
  top: 0 !important;
}
.goog-text-highlight {
  background: none !important;
  box-shadow: none !important;
}

@media (max-width: 768px) {
  .trp-floating-switcher {
    --right: 12px;
    --font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .trp-switcher-dropdown-list {
    transition: none !important;
  }
}
