/* 总后台 / 商户后台 — 语言切换（地球图标按钮） */
.portal-lang-switch {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  position: relative;
  z-index: 60;
}

.portal-i18n-widget {
  position: relative;
  z-index: 1200;
}

.portal-i18n-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px 0 10px;
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  background: #fff;
  color: #0f172a;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.portal-i18n-btn:hover {
  border-color: #94a3b8;
  background: #f8fafc;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.portal-i18n-btn.is-open {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}

.portal-i18n-btn__icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: block;
}

.portal-i18n-btn__flag {
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}

.portal-i18n-btn__label {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.portal-i18n-btn__caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #64748b;
  margin-left: -2px;
  transition: transform 0.15s;
}

.portal-i18n-btn.is-open .portal-i18n-btn__caret {
  transform: rotate(180deg);
}

.portal-i18n-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  max-height: 320px;
  overflow: auto;
  padding: 6px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
  z-index: 1201;
}

.portal-i18n-menu[hidden] {
  display: none;
}

.portal-i18n-menu__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #0f172a;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.portal-i18n-menu__item:hover {
  background: #f1f5f9;
}

.portal-i18n-menu__item.is-active {
  background: #eff6ff;
  color: #0369a1;
  font-weight: 600;
}

.portal-i18n-menu__flag {
  width: 1.25em;
  flex-shrink: 0;
}

html[dir="rtl"] .portal-i18n-menu {
  right: auto;
  left: 0;
}

html[dir="rtl"] .portal-i18n-menu__item {
  text-align: right;
}
