/* ===== MiSans Font Family — Single weight, local only ===== */
/* Only one font file (MiSans-Normal 400) is loaded. All other weights
   fall through to this via browser synthetic bold/italic or system fonts. */

/* --- MiSans (CJK) — single weight 400 --- */
@font-face {
  font-family: 'MiSans';
  src: url('/static/fonts/MiSans/MiSans-Normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* --- MiSansLatin — single weight 400 --- */
@font-face {
  font-family: 'MiSansLatin';
  src: url('/static/fonts/MiSansLatin/MiSansLatin-Normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ===== Font Stack Variables ===== */
:root {
  --font: 'MiSans', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-latin: 'MiSansLatin', 'MiSans', system-ui, sans-serif;
  --font-preview: 'MiSansLatin', 'MiSans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

html.lang-zh,
html[lang="zh-CN"],
html[lang="zh-TW"] {
  --font: 'MiSans', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-latin: 'MiSans', system-ui, sans-serif;
}

html.lang-en,
html[lang="en"] {
  --font: 'MiSansLatin', 'MiSans', system-ui, sans-serif;
  --font-latin: 'MiSansLatin', 'MiSans', system-ui, sans-serif;
}

html.lang-fr,
html[lang="fr"] {
  --font: 'MiSansLatin', 'MiSans', system-ui, sans-serif;
  --font-latin: 'MiSansLatin', 'MiSans', system-ui, sans-serif;
}

html.lang-es,
html[lang="es"] {
  --font: 'MiSansLatin', 'MiSans', system-ui, sans-serif;
  --font-latin: 'MiSansLatin', 'MiSans', system-ui, sans-serif;
}

html.lang-ru,
html[lang="ru"] {
  --font: 'MiSansLatin', 'MiSans', system-ui, sans-serif;
  --font-latin: 'MiSansLatin', 'MiSans', system-ui, sans-serif;
}

html.lang-ar,
html[lang="ar"] {
  --font: 'MiSansLatin', 'MiSans', 'Noto Sans Arabic', system-ui, sans-serif;
  --font-latin: 'MiSansLatin', 'MiSans', system-ui, sans-serif;
}

html.lang-ja,
html[lang="ja"] {
  --font: 'MiSans', 'MiSansLatin', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', system-ui, sans-serif;
  --font-latin: 'MiSansLatin', 'MiSans', system-ui, sans-serif;
}

html.lang-ko,
html[lang="ko"] {
  --font: 'MiSans', 'MiSansLatin', 'Apple SD Gothic Neo', 'Noto Sans KR', system-ui, sans-serif;
  --font-latin: 'MiSansLatin', 'MiSans', system-ui, sans-serif;
}

.preview-text,
.doc-viewer,
.chunk-content,
.markdown-body,
.recall-content {
  font-family: var(--font-preview) !important;
}

code, pre, .mono, kbd, samp {
  font-family: var(--mono);
}
