/**
 * 全局中英文切换（仅 zh / en），与 siteI18n 无关
 */
.flocale-switch {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  vertical-align: middle;
}

/* 下拉选择 */
.flocale-switch--select {
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  overflow: hidden;
  background: #fff;
  height: 26px;
}

.flocale-switch--select .flocale-select {
  display: block;
  margin: 0;
  padding: 0 28px 0 12px;
  height: 24px;
  line-height: 24px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  color: #374151;
  cursor: pointer;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  box-sizing: border-box;
  min-width: 9rem;
}

.flocale-switch--select .flocale-select:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.flocale-switch--select .flocale-select:hover {
  background-color: #f9fafb;
  color: #111827;
}

/* 旧版分段按钮（保留兼容） */
.flocale-switch:not(.flocale-switch--select) {
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  overflow: hidden;
  background: #fff;
  height: 26px;
}

.flocale-switch .flocale-btn {
  margin: 0;
  padding: 0 12px;
  height: 26px;
  line-height: 24px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: #374151;
  cursor: pointer;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  box-sizing: border-box;
}

.flocale-switch .flocale-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.flocale-switch .flocale-btn:hover {
  background: #f9fafb;
  color: #111827;
}

.flocale-switch .flocale-btn.is-active {
  background: #2563eb;
  color: #fff;
}

.flocale-switch .flocale-btn.is-active:hover {
  background: #1d4ed8;
  color: #fff;
}

.top-nav .nav-links .flocale-switch {
  margin-left: 4px;
}

.header .top .fr .flocale-switch {
  margin-top: -2px;
}

/* 手机端 Hero：窄宽度避免挤掉跑马灯；白底黑字易读 */
.hero-lang .flocale-switch--select {
  border-color: rgba(255, 255, 255, 0.45);
  background: #fff;
  height: 24px;
}

.hero-lang .flocale-switch--select .flocale-select {
  min-width: 0;
  max-width: 6.25rem;
  width: 100%;
  height: 22px;
  line-height: 22px;
  padding: 0 20px 0 8px;
  font-size: 11px;
  font-weight: 700;
  color: #111827;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23374151' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 6px center;
}

.hero-lang .flocale-switch--select .flocale-select:hover {
  background-color: #f3f4f6;
  color: #111827;
}

.hero-lang .flocale-switch:not(.flocale-switch--select) {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
}

.hero-lang .flocale-switch .flocale-btn {
  color: #fff;
}

.hero-lang .flocale-switch .flocale-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.hero-lang .flocale-switch .flocale-btn.is-active {
  background: #fff;
  color: #5b21b6;
}

.hero-lang .flocale-switch .flocale-btn.is-active:hover {
  background: #f3f4f6;
  color: #5b21b6;
}

.hero-lang .flocale-switch .flocale-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 2px;
}
