/* =========================================================
   Language switcher (133 languages) + Google Translate host
   ========================================================= */

.i18n-switch {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  font-family: Arial, Helvetica, sans-serif;
}

.i18n-switch select,
.i18n-switch option {
  font-family: Arial, Helvetica, sans-serif;
}

.i18n-floating {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9990;
  transition: top .35s ease;
}

.i18n-select-box {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.i18n-globe {
  position: absolute;
  left: 11px;
  display: flex;
  width: 15px;
  height: 15px;
  color: #6a4dc8;
  pointer-events: none;
}

.i18n-globe svg {
  display: block;
  width: 100%;
  height: 100%;
}

.i18n-switch select {
  -webkit-appearance: none;
  appearance: none;
  max-width: min(260px, 62vw);
  padding: 9px 30px 9px 34px;
  border: 1px solid rgba(29, 28, 25, .16);
  border-radius: 999px;
  outline: none;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231d1c19' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px 14px;
  color: #1d1c19;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  box-shadow: 0 6px 18px rgba(40, 30, 15, .14);
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.i18n-switch select:hover {
  border-color: #7a58d8;
}

.i18n-switch select:focus-visible {
  border-color: #7a58d8;
  box-shadow: 0 0 0 3px rgba(122, 88, 216, .28);
}

.i18n-status {
  position: absolute;
  top: 100%;
  right: 0;
  max-width: 280px;
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(29, 28, 25, .95);
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .22);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.i18n-status.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.i18n-status.is-error {
  background: #8c2f2f;
}

/* ===== Header placement (information pages) ===== */
.legal-header-inner {
  flex-wrap: wrap;
  row-gap: 10px;
}

.legal-header-nav {
  margin-right: auto;
}

.legal-header .i18n-switch select {
  max-width: 190px;
  padding: 8px 28px 8px 32px;
  box-shadow: none;
}

/* ===== Hidden Google Translate host ===== */
#google_translate_element {
  position: absolute;
  top: auto;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

body > .skiptranslate,
.goog-te-banner-frame.skiptranslate,
#goog-gt-tt,
.goog-te-balloon-frame {
  display: none !important;
}

body {
  top: 0 !important;
}

.goog-te-gadget,
.goog-logo-link {
  display: none !important;
  font-size: 0 !important;
}

.goog-tooltip,
.goog-tooltip:hover {
  display: none !important;
}

/* Google Translate 会改写文字颜色，保持站点配色可控 */
.goog-text-highlight {
  background: rgba(122, 88, 216, .16) !important;
  box-shadow: none !important;
}

/* ===== Responsive ===== */
@media (max-width: 1080px) {
  .legal-header-nav {
    display: none;
  }
}

@media (max-width: 640px) {
  .i18n-floating {
    top: 12px;
    right: 12px;
  }

  .i18n-switch select {
    max-width: 52vw;
    padding: 8px 26px 8px 30px;
    font-size: 12.5px;
  }

  .i18n-globe {
    left: 10px;
    width: 13px;
    height: 13px;
  }

  .legal-header .i18n-switch select {
    max-width: 46vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  .i18n-floating,
  .i18n-status,
  .i18n-switch select {
    transition: none;
  }
}
