/* =========================================================
   元宇宙ID · 中英双语切换器样式
   ---------------------------------------------------------
   两种呈现方式（由 i18n.js 自动决定）：
   1) 内联：页面存在 <div data-lang-switch></div> 挂载点时嵌入其中；
   2) 悬浮：页面没有挂载点时固定于右上角。
   主题：默认浅色（后台页）；挂 <html data-i18n-theme="dark"> 时为深色（门户/官网/H5）。
   ========================================================= */

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(99, 102, 241, .10);
  border: 1px solid rgba(99, 102, 241, .26);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  line-height: 1;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  vertical-align: middle;
  flex: 0 0 auto;
}

.lang-switch__btn {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: #4f46e5;
  font: inherit;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s, color .18s, box-shadow .18s;
}

.lang-switch__btn:hover { background: rgba(99, 102, 241, .14); }

.lang-switch__btn[aria-pressed="true"] {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, .34);
}

/* ---------- 深色主题 ---------- */
.lang-switch--dark {
  background: rgba(255, 255, 255, .10);
  border-color: rgba(255, 255, 255, .22);
}
.lang-switch--dark .lang-switch__btn { color: #e2e8f0; }
.lang-switch--dark .lang-switch__btn:hover { background: rgba(255, 255, 255, .16); }
.lang-switch--dark .lang-switch__btn[aria-pressed="true"] {
  background: linear-gradient(135deg, #6366f1, #d946ef);
  color: #fff;
  box-shadow: 0 2px 10px rgba(99, 102, 241, .45);
}

/* ---------- 悬浮模式 ---------- */
.lang-switch--float {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 9998;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 22px rgba(2, 6, 23, .20);
}

.lang-switch--float.lang-switch--dark {
  background: rgba(15, 23, 42, .62);
  border-color: rgba(255, 255, 255, .20);
}

/* H5 页面底部有悬浮按钮时，避免与其重叠 */
@media (max-width: 700px) {
  .lang-switch { font-size: 12px; }
  .lang-switch__btn { padding: 5px 9px; }
  .lang-switch--float { top: 10px; right: 10px; }
}
