/* ============================================================
   字体开关 —— 全站中文字体只在这里控制
   ------------------------------------------------------------
   改下面 :root 里的 --font-active 一个值，即可切换：

     --font-active: var(--font-system);   默认。系统字体，零下载
     --font-active: var(--font-landing);  自带思源黑体，需下载约 25 MB

   切到 var(--font-landing) 之前，还要把下面每条 @font-face 的 src 里
   被注释包住的 url(...) 释放出来，否则浏览器只会去找系统装没装思源黑体，
   找不到就退回系统字体（不会报错，只是不生效）。

   字体文件留在 assets/fonts/，源目录不删。发布时是否打包由
   build_dist.py 的 INCLUDE_FONTS 控制，默认不打包。

   受影响的只有标题（.menu-head h1）和落地页；正文一直用 --ui-font，
   在 css/ui-system.css 里已有一份系统字体栈兜底。
   ============================================================ */
:root{
  --font-system:"PingFang SC","Microsoft YaHei","Hiragino Sans GB","Noto Sans CJK SC",-apple-system,"Segoe UI",sans-serif;
  --font-landing:LandingHan,"思源黑体 CN","Source Han Sans CN",var(--font-system);

  /* ↓ 唯一开关：想用自带字体时改成 var(--font-landing) */
  --font-active:var(--font-system);

  --ui-font:var(--font-active);
  --sans:var(--font-active);
}

/* 思源黑体：默认只用系统已安装的版本，不发起下载。
   font-display:swap 保证即使将来启用了 url 下载，字体未到时也能先显示文字。 */
@font-face{font-family:LandingHan;src:local("Source Han Sans CN Regular"),local("SourceHanSansCN-Regular")/*,url("../assets/fonts/SourceHanSansCN-Regular.otf") format("opentype")*/;font-weight:400;font-display:swap}
@font-face{font-family:LandingHan;src:local("Source Han Sans CN Medium"),local("SourceHanSansCN-Medium")/*,url("../assets/fonts/SourceHanSansCN-Medium.otf") format("opentype")*/;font-weight:500;font-display:swap}
@font-face{font-family:LandingHan;src:local("Source Han Sans CN Heavy"),local("SourceHanSansCN-Heavy")/*,url("../assets/fonts/SourceHanSansCN-Heavy.otf") format("opentype")*/;font-weight:900;font-display:swap}

.main-ui :is(#screen-menu,#screen-essay-list) .menu-head h1,
.spelling-ui #screen-menu .menu-head h1{font-family:var(--ui-font);font-weight:900}

:root[data-theme="light"] .main-ui .top-right :is(#btn-wordbook,#btn-wrong,#btn-spell-theme,#top-tools .icon-btn),
:root[data-theme="light"] .main-ui :is(#screen-menu,#screen-essay-list) :is(.menu-head p,.footer-note,.list-label),
:root[data-theme="light"] .spelling-ui #screen-menu :is(.menu-head .sub,.foot-note,kbd,.menu-tools .icon),
:root[data-theme="light"] :is(.main-ui,.spelling-ui) :is(.material-filters label,.material-folder-count){
  color:var(--ui-text);
}
