/* ========== 语言切换器 ========== */
.lang-switcher {
  position: relative;
  display: inline-block;
}

.lang-switcher-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.lang-switcher-btn:hover {
  border-color: rgba(37, 99, 235, 0.28);
  background: rgba(37, 99, 235, 0.06);
}

.lang-switcher-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22);
}

.lang-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 160px;
  max-height: 320px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  margin-top: 4px;
}

.lang-switcher.open .lang-dropdown {
  display: block;
}

.lang-option {
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
  color: #374151;
  transition: background-color 0.15s;
}

.lang-option:hover {
  background-color: #f3f4f6;
}

.lang-option.active {
  background-color: #eff6ff;
  color: #2563eb;
  font-weight: 500;
}

.login-page .lang-switcher {
  position: absolute;
  top: clamp(18px, 3vw, 32px);
  right: clamp(18px, 3vw, 36px);
  z-index: 20;
}

.login-page .lang-switcher-btn {
  min-height: 44px;
  padding: 10px 16px;
  border-color: rgba(37, 99, 235, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--primary);
  font-weight: 700;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
}

.login-page .lang-switcher-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.35);
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.login-page .lang-dropdown {
  min-width: 180px;
  margin-top: 8px;
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* ========== RTL 布局适配 ========== */
[dir="rtl"] .login-page {
  direction: rtl;
}

[dir="rtl"] .login-shell {
  flex-direction: row-reverse;
}

[dir="rtl"] .tab-btn {
  margin-left: 0;
  margin-right: 4px;
}

[dir="rtl"] input,
[dir="rtl"] textarea,
[dir="rtl"] select {
  text-align: right;
}

[dir="rtl"] th,
[dir="rtl"] td {
  text-align: right;
}

[dir="rtl"] .pagination-btn svg {
  transform: scaleX(-1);
}

[dir="rtl"] .search-bar,
[dir="rtl"] .filter-bar {
  flex-direction: row-reverse;
}

[dir="rtl"] .header-right {
  margin-left: 0;
  margin-right: auto;
}

[dir="rtl"] .lang-dropdown {
  left: auto;
  right: 0;
}

[dir="rtl"] .login-hero {
  border-radius: 0 24px 24px 0;
}

[dir="rtl"] .login-card {
  border-radius: 24px 0 0 24px;
}
