/* ==========================================================================
   自包含中文字体模块（简体）：中文=思源黑体 CN，数字/英文=HarmonyOS Sans
   —— 复制整个 fonts/ 目录并在页面引入本文件即可复用，无需依赖任何业务 CSS ——
   按语言拆分：简体 font-cn.css / 繁体 font-tw.css，各自定义同名族 'MixFont'，
   一个页面只引入其中一种（切勿同时引入，否则同族 @font-face 会相互竞争）。
   ========================================================================== */

/* ========== 全局字体入口（语言无关，随本模块自带以便复用） ========== */
body {
  font-family: 'MixFont', system-ui, sans-serif;
}
/* 表单控件默认不继承 body 字体，统一 inherit 后其伪元素（placeholder 等）自动跟随 MixFont */
button,
input,
textarea,
select {
  font-family: inherit;
}

/* ========== 字体定义：src 用 ../fonts/woff2/ 前缀（从 fonts/ 解析到主题根/fonts/，若日后移入 css/ 亦可正确解析） ========== */
/* font-display 统一用 swap：optional 只有约 100ms 阻塞窗口，中文字体包体积大必然赶不上，
   导致「首次打开回退系统字体且整页不重绘、刷新命中缓存却用上 MixFont」的字体漂移，swap 可保证最终一致 */

/* Light 300 */
@font-face {
  font-family: 'MixFont';
  src: url('../fonts/woff2/HarmonyOS_Sans_Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+20A0-20CF;
}
@font-face {
  font-family: 'MixFont';
  src: url('../fonts/woff2/SourceHanSansCN-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
  unicode-range: U+4E00-9FFF, U+3400-4DBF, U+20000-2A6DF, U+3000-303F, U+FF00-FFEF;
}

/* Regular 400 */
@font-face {
  font-family: 'MixFont';
  src: url('../fonts/woff2/HarmonyOS_Sans_Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+20A0-20CF;
}
@font-face {
  font-family: 'MixFont';
  src: url('../fonts/woff2/SourceHanSansCN-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+4E00-9FFF, U+3400-4DBF, U+20000-2A6DF, U+3000-303F, U+FF00-FFEF;
}

/* Medium 500 */
@font-face {
  font-family: 'MixFont';
  src: url('../fonts/woff2/HarmonyOS_Sans_Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+20A0-20CF;
}
@font-face {
  font-family: 'MixFont';
  src: url('../fonts/woff2/SourceHanSansCN-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+4E00-9FFF, U+3400-4DBF, U+20000-2A6DF, U+3000-303F, U+FF00-FFEF;
}

/* Bold 700 */
@font-face {
  font-family: 'MixFont';
  src: url('../fonts/woff2/HarmonyOS_Sans_Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+20A0-20CF;
}
@font-face {
  font-family: 'MixFont';
  src: url('../fonts/woff2/SourceHanSansCN-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+4E00-9FFF, U+3400-4DBF, U+20000-2A6DF, U+3000-303F, U+FF00-FFEF;
}
