/* Shared CJK typography. Fonts are self-hosted OFL derivatives of Source Han Sans.
 * The font faces cover CJK only, so Latin text and numeric telemetry keep their
 * system sans/monospace metrics. See fonts/source-han-sans/README.md. */
@import url("./fonts/source-han-sans/faces.css?v=20261017-fonts");

:root {
  --cs-han-face: "CSHanSansSC", "CSHanSansTC";
  --cs-system-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
[lang|="zh-Hant"], [lang|="zh-TW"], [lang|="zh-HK"], [lang|="zh-MO"] {
  --cs-han-face: "CSHanSansTC", "CSHanSansSC";
  --cs-system-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Microsoft JhengHei", sans-serif;
}
[lang|="zh-Hans"], [lang|="zh-CN"], [lang|="zh-SG"] { --cs-han-face: "CSHanSansSC", "CSHanSansTC"; }
/* Japanese and Korean retain their regional glyph forms and native UI stacks. */
[lang|="ja"] {
  --cs-han-face: "CSNativeCJK";
  --cs-system-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
}
[lang|="ko"] {
  --cs-han-face: "CSNativeCJK";
  --cs-system-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}
[lang|="th"] { --cs-system-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif; }
[lang|="ar"] { --cs-system-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Arabic", Tahoma, Arial, sans-serif; }

:root, [lang] {
  /* Existing components use --font. Keep this central choice authoritative over
   * their older platform-specific declarations without changing other tokens. */
  --font: var(--cs-han-face), var(--cs-system-sans) !important;
}
:root body,
:root :where(button, input, select, textarea),
:root [lang]:not(html),
:root .csie-dialog,
:root cs-camera-console {
  font-family: var(--cs-han-face), var(--cs-system-sans);
}
:root :is(.mono, code, pre, kbd, samp, .assets-version, .output-ratio-size, .camera-parameter output, .vc-camera-readouts strong) {
  font-family: var(--cs-han-face), ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}
