html.i18n-pending body {
  visibility: hidden;
}

.language-switcher {
  height: var(--control-h, 2.375rem);
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line, rgba(22, 37, 42, 0.16));
  border-radius: 999px;
  background: color-mix(in srgb, var(--cream, #fffdf8) 74%, transparent);
  font-family: var(--font-mono, var(--mono, monospace));
  font-size: var(--text-2xs, 12px);
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1;
}

.language-switcher button {
  min-width: 38px;
  height: calc(var(--control-h, 2.375rem) - 8px);
  margin: 0;
  padding: 0 9px;
  border: 0;
  border-radius: 999px;
  color: var(--muted, #667c74);
  background: transparent;
  font: inherit;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.language-switcher button:hover {
  color: var(--ink, #16252a);
}

.language-switcher button:active {
  transform: scale(0.96);
}

.language-switcher button[aria-pressed="true"] {
  color: #fbfcf6;
  background: var(--ink, #16252a);
}

.language-switcher button:focus-visible {
  outline: 3px solid var(--focus-ring, currentColor);
  outline-offset: 2px;
}

.language-switcher-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html[lang="zh-CN"] body {
  font-family: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    var(--font-sans, var(--sans, sans-serif));
  line-height: 1.75;
}

html[lang="zh-CN"] .mono,
html[lang="zh-CN"] .language-switcher {
  font-family: var(--font-mono, var(--mono, "DM Mono")), "PingFang SC", "Microsoft YaHei", monospace;
}

/* Han glyphs sit on a fixed em square, so the optical tracking that tightens
   Latin display type only makes them collide. Reset it and give the extra
   stroke density a little more room to breathe. */
html[lang="zh-CN"] h1,
html[lang="zh-CN"] h2,
html[lang="zh-CN"] h3,
html[lang="zh-CN"] h4,
html[lang="zh-CN"] blockquote {
  letter-spacing: 0;
  line-height: 1.22;
}

/* For the same reason a heading set for Latin reads oversized in Chinese, and
   because Chinese wraps between any two characters, display type is stepped
   down to roughly 80% and the measure widened — otherwise a two-character word
   splits across lines. */
html[lang="zh-CN"] {
  --display-2xs: clamp(1.125rem, 0.19vw + 1.05rem, 1.25rem);
  --display-xs: clamp(1.25rem, 0.66vw + 1.09rem, 1.6875rem);
  --display-sm: clamp(1.4375rem, 1.04vw + 1.19rem, 2.125rem);
  --display-md: clamp(1.8125rem, 1.79vw + 1.39rem, 3rem);
  --display-lg: clamp(2.1875rem, 2.64vw + 1.56rem, 3.9375rem);
  --display-xl: clamp(2.375rem, 3.68vw + 1.5rem, 4.8125rem);
}

html[lang="zh-CN"] h1 {
  max-width: 22ch;
}

@media (max-width: 650px) {
  .nav-actions,
  .header-right {
    gap: 10px;
  }

  .language-switcher {
    height: 34px;
  }

  .language-switcher button {
    min-width: 31px;
    height: 26px;
    padding: 0 7px;
  }
}

@media (max-width: 420px) {
  .github-button {
    width: 38px;
    height: 34px;
    padding: 0;
    gap: 0;
    font-size: 0;
    justify-content: center;
  }

  .github-button span {
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .language-switcher button {
    transition: none;
  }
}
