/* 學齡前學習單樣式（運筆、注音符號描寫、數字描寫、數與量、合成分解）
 * 疊在 css/math/sheet.css 上：紙張、頁首、分頁、列印規則都沿用，這裡只放學齡前工具的元件。
 * 線條、圖形都用 border 或 SVG（Chrome 列印預設不印背景色）。
 */
@font-face { font-family: 'BpmfZihiOnly'; src: url('/fonts/BpmfZihiOnly-R.ttf') format('truetype'); font-display: block; }
@font-face { font-family: 'EduKai'; src: url('/fonts/edukai-5.0.ttf') format('truetype'); font-display: block; }

/* 頁首欄位：學齡前只有姓名、日期，兩欄一樣寬 */
.ps-page .ms-fields .ms-f1 { width: 24mm; }
.ps-page .ms-title { font-size: 6.5mm; }

/* ===== 描寫格（注音、數字共用）===== */
.ps-row { display: flex; align-items: center; gap: 0; }
.ps-cells { display: flex; gap: 0; }
.ps-cell {
    position: relative; box-sizing: border-box; flex: none;
    border: .3mm solid #444; margin-left: -.3mm;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.ps-cell:first-child { margin-left: 0; }
/* 十字虛線（用 border 畫，列印才看得到） */
.ps-cell.has-cross::before, .ps-cell.has-cross::after { content: ''; position: absolute; border: 0 dashed #b8b8b8; pointer-events: none; }
.ps-cell.has-cross::before { left: 50%; top: 0; bottom: 0; border-left-width: .25mm; }
.ps-cell.has-cross::after { top: 50%; left: 0; right: 0; border-top-width: .25mm; }
.ps-cell > svg { position: relative; z-index: 1; display: block; }
.ps-cell.is-ex { border-width: .45mm; }
/* 行首的說明（數量點點、國字讀音…） */
.ps-lead { flex: none; display: flex; align-items: center; justify-content: center; box-sizing: border-box; padding: 0 1.5mm; }
.ps-lead svg { display: block; }
.ps-no { flex: none; width: 6mm; font-size: 3.2mm; color: #666; text-align: left; }

.ps-row.is-center { justify-content: center; }
/* 一頁一個符號（幼幼班、小班）：上方大範例＋行首說明，下面幾行置中的練習格 */
.ps-block { box-sizing: border-box; display: flex; flex-direction: column; }
.ps-block-head { display: flex; align-items: center; justify-content: center; gap: 12mm; }
.ps-block-lead { display: flex; align-items: center; }
.ps-block-lead svg { display: block; }

/* 每頁 n 個符號的區塊：左邊範例（下面可放例詞、插圖），右邊練習格 */
.ps-grid { display: flex; align-items: center; gap: 3mm; box-sizing: border-box; }   /* 1 行時上下留白平均分 */
.ps-grid-ex { flex: none; display: flex; flex-direction: column; align-items: center; align-self: flex-start; }
.ps-grid-lead { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.5mm; margin-top: 1mm; }
.ps-grid-lead .ps-wlead { gap: 1.5mm; }
.ps-grid-lead .ps-wpic { width: 22mm !important; height: 22mm !important; }
.ps-grid-lead .ps-word { font-size: 6.5mm !important; }
.ps-grid-cells { display: flex; flex-direction: column; gap: 1.5mm; min-width: 0; align-self: flex-start; }

/* 例詞：左邊楷體國字、右邊直排注音（同一個字用 BpmfZihiOnly 顯示，字型自己會疊成直的，和注音字帖一樣） */
.ps-word { display: flex; align-items: center; gap: .18em; white-space: nowrap; color: #222; line-height: 1; }
.ps-wpair { display: inline-flex; align-items: center; }
.ps-wk { font-family: 'EduKai', '標楷體', DFKai-SB, serif; font-size: 1em; line-height: 1; }
.ps-wz { font-family: 'BpmfZihiOnly', sans-serif; font-size: .58em; line-height: 1; margin-left: .05em; width: .62em; text-align: center; }
.ps-word.is-big { gap: .2em; }

/* 例詞插圖：列印保留、不裁切 */
.ps-wpic { display: block; object-fit: contain; flex: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.ps-lead .ps-wpic { margin-right: 1.5mm; }
.ps-wlead { display: flex; flex-direction: column; align-items: center; gap: 4mm; }

/* 數字順序填空 */
.ps-seq { display: flex; align-items: center; gap: 0; }
.ps-seq .ps-cell { font-family: "Noto Sans TC", Arial, sans-serif; font-weight: 500; }
.ps-seq .ps-cell .ms-ans { font-weight: 700; }

/* ===== 運筆 ===== */
.ps-trace { display: block; }
.ps-trace-wrap { display: flex; flex-direction: column; gap: 1mm; }
.ps-trace-cap { font-size: 3.4mm; line-height: 5mm; color: #444; padding-left: 1mm; }

/* ===== 數與量 ===== */
.ps-q { display: flex; flex-direction: column; gap: 1.5mm; box-sizing: border-box; border: .3mm solid #666; border-radius: 2.5mm; padding: 2mm 2.5mm; }
.ps-q-head { display: flex; align-items: center; gap: 2mm; font-size: 4.2mm; line-height: 6mm; font-weight: 500; }
.ps-q-head .ms-no { font-size: 3.4mm; color: #666; }
.ps-q-body { display: flex; align-items: center; gap: 3mm; }
.ps-q-body svg { display: block; }
.ps-box { box-sizing: border-box; border: .35mm solid #444; border-radius: 1.5mm; display: flex; align-items: center; justify-content: center; font-family: "Noto Sans TC", Arial, sans-serif; font-weight: 700; flex: none; }
.ps-box .ms-ans { font-size: inherit; }
.ps-bignum { font-family: "Noto Sans TC", Arial, sans-serif; font-weight: 700; line-height: 1; }

/* ===== 合成分解 ===== */
.ps-bond { display: flex; align-items: center; gap: 3mm; }
.ps-bond svg { display: block; }
.ps-bond-text { font-size: 4.4mm; line-height: 7mm; }
.ps-bond-text .ps-box { display: inline-flex; vertical-align: middle; margin: 0 1mm; }
