/* Language switcher — shared by the SPA header and the standalone pages. */
.xh-lang {
  font-family: "Fusion Pixel 12px Mono zh_hans", ui-monospace, SFMono-Regular, monospace;
  position: relative;
  z-index: 60;
}

.xh-lang-toggle {
  align-items: center;
  background: rgba(6, 8, 12, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.38);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 13px;
  gap: 6px;
  height: 30px;
  line-height: 1;
  padding: 0 10px;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
}

.xh-lang-toggle::after {
  content: "▾";
  font-size: 10px;
  opacity: 0.7;
}

.xh-lang-toggle:hover,
.xh-lang-toggle:focus-visible {
  background: #fff;
  border-color: #fff;
  color: #000;
}

.xh-lang-menu {
  background: #05070b;
  border: 1px solid rgba(255, 255, 255, 0.38);
  display: flex;
  flex-direction: column;
  min-width: 132px;
  padding: 4px;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
}

.xh-lang-menu[hidden] {
  display: none;
}

.xh-lang-option {
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  line-height: 1;
  padding: 8px 10px;
  text-align: left;
  white-space: nowrap;
}

.xh-lang-option:hover,
.xh-lang-option:focus-visible {
  background: #fff;
  color: #000;
}

.xh-lang-option.is-active {
  color: #fff;
}

.xh-lang-option.is-active::before {
  content: "· ";
}

/* Only the short code fits next to the burger on a phone. */
@media (max-width: 767px) {
  .xh-lang-toggle {
    font-size: 12px;
    height: 28px;
    padding: 0 8px;
  }

  .xh-lang-name {
    display: none;
  }
}
