/* HomeworkOS · 共享字体
 *
 * 策略：local() 优先（本机秒开）→ url('/fonts/...') 可下载文件（手机/云端一致）。
 * 文件目录：public/fonts/（开发）或服务器 /usr/share/fonts/exam-split（部署可挂 HWOS_FONT_DIR）。
 * 文件名尽量与 exam-split 扁平命名一致；中文文件名另有 ASCII 别名。
 *
 * 默认题文字体：MiSans（替代微软雅黑，跨端可嵌入）。
 * 不包含 PingFang（不宜再分发）。
 */

/* ── 小米黑体 MiSans（默认题文）── */
@font-face {
  font-family: 'MiSans';
  src: local('MiSans'), local('MiSans Regular'),
       url('/fonts/MiSans-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: block; /* 题面：宁可稍等，勿用错误字体量宽 */
}
@font-face {
  font-family: 'MiSans';
  src: local('MiSans Light'),
       url('/fonts/MiSans-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: 'MiSans';
  src: local('MiSans Medium'),
       url('/fonts/MiSans-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: 'MiSans';
  src: local('MiSans Semibold'), local('MiSans Demibold'),
       url('/fonts/MiSans-Semibold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: 'MiSans';
  src: local('MiSans Bold'),
       url('/fonts/MiSans-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: block;
}

/* ── 鸿蒙黑体 HarmonyOS Sans SC ── */
@font-face {
  font-family: 'HarmonyOS Sans SC';
  src: local('HarmonyOS Sans SC'), local('HarmonyOS_Sans_SC_Regular'),
       url('/fonts/HarmonyOS_Sans_SC_Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'HarmonyOS Sans SC';
  src: local('HarmonyOS Sans SC Light'),
       url('/fonts/HarmonyOS_Sans_SC_Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'HarmonyOS Sans SC';
  src: local('HarmonyOS Sans SC Medium'),
       url('/fonts/HarmonyOS_Sans_SC_Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'HarmonyOS Sans SC';
  src: local('HarmonyOS Sans SC Bold'),
       url('/fonts/HarmonyOS_Sans_SC_Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── 阿里普惠体 3 ── */
@font-face {
  font-family: 'Alibaba PuHuiTi 3';
  src: local('Alibaba PuHuiTi 3.0 55 Regular'), local('AlibabaPuHuiTi-3-55-Regular'),
       url('/fonts/AlibabaPuHuiTi-3-55-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Alibaba PuHuiTi 3';
  src: local('Alibaba PuHuiTi 3.0 65 Medium'),
       url('/fonts/AlibabaPuHuiTi-3-65-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Alibaba PuHuiTi 3';
  src: local('Alibaba PuHuiTi 3.0 85 Bold'),
       url('/fonts/AlibabaPuHuiTi-3-85-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── 荣耀黑体 ── */
@font-face {
  font-family: 'HONOR Sans CN';
  src: local('HONOR Sans CN'), local('HONORSansCN-Regular'),
       url('/fonts/HONORSansCN-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'HONOR Sans CN';
  src: local('HONORSansCN-Medium'),
       url('/fonts/HONORSansCN-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'HONOR Sans CN';
  src: local('HONORSansCN-Bold'),
       url('/fonts/HONORSansCN-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── vivo 黑体 ── */
@font-face {
  font-family: 'vivo Sans';
  src: local('vivo Sans'), local('vivoSans-Regular'),
       url('/fonts/vivoSans-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'vivo Sans';
  src: local('vivoSans-Medium'),
       url('/fonts/vivoSans-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'vivo Sans';
  src: local('vivoSans-Bold'),
       url('/fonts/vivoSans-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── 思源宋体 2.0（可下载）── */
@font-face {
  font-family: 'Source Han Serif SC';
  src: local('Source Han Serif SC'), local('Noto Serif CJK SC'), local('思源宋体'),
       url('/fonts/SourceHanSerifSC-Regular.otf') format('opentype'),
       url('/fonts/%E6%80%9D%E6%BA%90%E5%AE%8B%E4%BD%932.0-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Source Han Serif SC';
  src: local('Source Han Serif SC Medium'),
       url('/fonts/SourceHanSerifSC-Medium.otf') format('opentype'),
       url('/fonts/%E6%80%9D%E6%BA%90%E5%AE%8B%E4%BD%932.0-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Source Han Serif SC';
  src: local('Source Han Serif SC Bold'),
       url('/fonts/SourceHanSerifSC-Bold.otf') format('opentype'),
       url('/fonts/%E6%80%9D%E6%BA%90%E5%AE%8B%E4%BD%932.0-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── 屏显臻宋（项目已在用：本机 local + 站点文件）── */
@font-face {
  font-family: 'PingXianZhenSong';
  src: local('屏显臻宋'), local('PingXianZhenSong'),
       url('/fonts/PingXianZhenSong.ttf') format('truetype'),
       url('/fonts/%E5%B1%8F%E6%98%BE%E8%87%BB%E5%AE%8B.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ── 装饰字体：仅本机 local（无站点文件时手机不可用，勿作默认题文）── */
@font-face {
  font-family: 'JinZiSheTongYuanTi';
  src: local('金字社统圆体');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'ZiXiaoHunLiuLiSong';
  src: local('字小魂琉璃宋');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'ZiHunYingHuaShaoNvTi';
  src: local('字魂樱花少女体');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'ZiTiQuanXinYiJiXiangSong';
  src: local('字体圈欣意吉祥宋');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* 共享测量 div：PageRender / CanvasCommon.wrapTextDom 依赖 */
.measure-div {
  position: absolute; visibility: hidden; z-index: -1;
  left: -9999px; top: -9999px;
  white-space: nowrap; word-break: normal; line-height: 1.4; letter-spacing: normal;
  padding: 0; margin: 0;
}
