/* EN / 中文 switch and Simplified Chinese typography. Shared by the site and the docs.
   Chinese uses system CJK fonts only; Latin names keep the brand faces and never break
   mid-word. */
.lang-switch{display:inline-flex;flex:none;align-items:center;gap:2px;padding:2px;border:1px solid var(--line);border-radius:999px;background:color-mix(in srgb,var(--card) 70%,transparent)}
.lang-switch button{min-width:44px;min-height:36px;margin:0;padding:0 10px;border:0;border-radius:999px;background:transparent;color:var(--ink-soft);font:600 13px/1 var(--font-body);letter-spacing:0;text-transform:none;cursor:pointer}
.lang-switch button[lang="zh-Hans"]{font-family:"PingFang SC","Hiragino Sans GB","Microsoft YaHei","Noto Sans SC","Noto Sans CJK SC",var(--font-body)}
.lang-switch button:hover{color:var(--ink)}
.lang-switch button[aria-pressed="true"]{background:var(--glow);color:var(--ground)}
.lang-switch button:focus-visible{outline:2px solid var(--glow);outline-offset:2px}
.nav-sheet .lang-switch{align-self:flex-start;margin:4px 0 8px}
@media (max-width:767px){.nav-bar>.lang-switch{display:none}}

/* Chinese: CJK system fonts after the Latin brand faces, so $CIPHR and Bittensor keep
   their letterforms while Han characters fall through to PingFang or YaHei. */
html:lang(zh){
  --font-display:"Geologica","PingFang SC","Hiragino Sans GB","Microsoft YaHei","Noto Sans SC","Noto Sans CJK SC",system-ui,sans-serif;
  --font-body:"Public Sans","PingFang SC","Hiragino Sans GB","Microsoft YaHei","Noto Sans SC","Noto Sans CJK SC",system-ui,sans-serif;
  --font-mono:ui-monospace,"Cascadia Mono",Consolas,"PingFang SC","Microsoft YaHei","Noto Sans SC","Noto Sans CJK SC",monospace;
  line-break:strict;
}
html:lang(zh) body{line-height:1.75}
html:lang(zh) :is(p,li,dd,dt,summary,figcaption,label,blockquote,td,th){line-height:1.75}
html:lang(zh) :is(h1,h2,h3,h4){line-height:1.3}
/* No tracking on Han text; uppercase has no effect on it either. */
html:lang(zh) body :not(code):not(kbd):not(.lang-switch *){letter-spacing:0}
/* Break between Han characters, never inside a Latin name. Code and hashes keep their own rules. */
html:lang(zh) :is(p,li,dd,dt,h1,h2,h3,h4,summary,figcaption,label,span,strong,em,a,button,small,output){word-break:normal;overflow-wrap:break-word}
/* The terminal types each line by character count; Han glyphs are two columns wide. */
@keyframes term-type-zh{to{max-width:calc(var(--n,20) * 2ch + 1px)}}
html:lang(zh) .ciphr-term .term-text{animation-name:term-type-zh}
html:lang(zh) .ciphr-term .terminal-step{min-width:9ch}
