/* NEXAGAIN 语言切换按钮 —— 中英文两版共用
   桌面端：页头 .nx-right 内；移动端：抽屉 #nx-drawer 顶部
   配色跟随页头深浅两种状态（首页透明深底 / 子页白色实底） */

.nx-lang {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 999px;
  background: rgba(255, 255, 255, .10);
  backdrop-filter: blur(4px);
  flex: none;
}

.nx-lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .01em;
  color: rgba(255, 255, 255, .82);
  text-decoration: none;
  white-space: nowrap;
  transition: background .18s ease, color .18s ease;
}

.nx-lang-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, .18);
}

.nx-lang-btn.is-active {
  background: #2563eb;
  color: #fff;
}

/* 实底白色页头 */
.nx-header.is-solid .nx-lang,
.nx-header--solid .nx-lang {
  border-color: rgba(15, 23, 42, .12);
  background: rgba(15, 23, 42, .03);
  backdrop-filter: none;
}

.nx-header.is-solid .nx-lang-btn,
.nx-header--solid .nx-lang-btn {
  color: #475569;
}

.nx-header.is-solid .nx-lang-btn:hover,
.nx-header--solid .nx-lang-btn:hover {
  color: #1d4ed8;
  background: rgba(37, 99, 235, .08);
}

.nx-header.is-solid .nx-lang-btn.is-active,
.nx-header--solid .nx-lang-btn.is-active {
  background: #2563eb;
  color: #fff;
}

/* 移动端抽屉 */
.nx-lang--drawer {
  margin: 10px 0 6px;
  border-color: rgba(15, 23, 42, .12);
  background: rgba(15, 23, 42, .03);
  backdrop-filter: none;
}

.nx-lang--drawer .nx-lang-btn {
  color: #475569;
  height: 30px;
  min-width: 46px;
  font-size: 13px;
}

.nx-lang--drawer .nx-lang-btn.is-active {
  background: #2563eb;
  color: #fff;
}

.nx-drawer .nx-lang--drawer a.nx-lang-btn {
  display: inline-flex;
  padding: 0 12px;
  border-bottom: 0;
}

/* 桌面端隐藏抽屉里的那份（抽屉本身在桌面端不显示，双保险）
   断点必须与 tw-static.css 的导航折叠点一致（1280），否则会出现两份或零份切换按钮 */
@media (min-width: 1280px) {
  .nx-lang--drawer { display: none; }
}

/* 导航折叠后页头右侧整体隐藏，切换按钮只保留抽屉里那份 */
@media (max-width: 1279px) {
  .nx-header .nx-right .nx-lang { display: none; }
}
