/* Material Icons — 字体**自托管**（2026-10-17）
 *
 * 背景（实测）：原先 CSS 已是本地文件，但 @font-face 的 src 仍指向 cdn.jsdelivr.net
 * （解析到 Cloudflare 104.17.x.x）。国内移动端冷启动时这一段常超时/被阻断，而
 * font-display:block 等不到字体就会回退成**连字原文**，再被 mdui 图标自身的
 * overflow:hidden 截成两三个字母 —— 于是出现 "me / ho / sea / arr / em"
 * 或侧边栏 "hor首页 / fav我的收藏" 这种中英挤在一起的现象。
 *
 * 现改为同源本地字体：无第三方依赖、无跨域、与页面共用同一条连接，命中率 100%。
 * 文件在 assets/fonts/（woff2 125KB / 152KB，woff 仅作老浏览器兜底、正常不会被请求）。
 *
 * 注意：图标字体**不能**改成 font-display:swap —— swap 会立刻拿回退字体渲染，
 * 也就是立刻显示连字原文，正是本次要修的现象。这里保留 block，并用页面上的
 * .pg-fonts-ready 遮罩兜底（见文件末尾）。
 */
@font-face {
    font-family: "Material Icons";
    font-style: normal;
    font-weight: 400;
    font-display: block;
    src: url("fonts/material-icons.woff2?v=20261017") format("woff2"),
         url("fonts/material-icons.woff?v=20261017") format("woff");
}

@font-face {
    font-family: "Material Icons Outlined";
    font-style: normal;
    font-weight: 400;
    font-display: block;
    src: url("fonts/material-icons-outlined.woff2?v=20261017") format("woff2"),
         url("fonts/material-icons-outlined.woff?v=20261017") format("woff");
}

.material-icons {
    font-family: "Material Icons";
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "liga";
}

.material-icons-outlined {
    font-family: "Material Icons Outlined";
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "liga";
}

/* MDUI 图标组件 fallback */
mdui-icon {
    font-family: "Material Icons", sans-serif;
    font-feature-settings: "liga";
}

/* ── 兜底遮罩（2026-10-17）──────────────────────────────────────────
 * 字体就绪前先把连字原文隐藏，避免首屏闪出 "sea"/"hor" 这类英文片段与中文挤在一起。
 * 注意：MDUI 2 是 Web Components，实测站点 25 个 <mdui-icon> / 108 个 shadow host 里的
 * 图标文字都在 **Shadow DOM** 中，页面级 CSS **够不到**（实测匹配 0 个元素）。
 * 因此 Shadow DOM 内的图标由页面内联脚本按「无子节点 + 文本匹配图标名 + font-family
 * 命中 Material Icons」逐个加 visibility:hidden 精确遮罩（见各页面的 pg-icon-mask 脚本）。
 * 下面这两条只覆盖万一有页面直接用 light-DOM 类名写图标的情况。
 */
html:not(.pg-fonts-ready) .material-icons,
html:not(.pg-fonts-ready) .material-icons-outlined {
    visibility: hidden;
}
