/* Shared question typography for cards, A4 preview and exported PDF.
 * Font resources are declared by vendor/fonts/question-fonts.css or embedded by the exporter.
 * Special mathematical alphabets and scalable symbols retain KaTeX fonts.
 */
:is(.question-content, .answer-content, .answer-text, .options-inline,
    .basket-item-preview, .question-typography) {
    font-family: "Tiku Local Times", "Times New Roman", var(--question-cjk-font, "Tiku Local SimSun", "SimSun"), "Songti SC", "STSong", serif;
}

/* The KaTeX root supplies ordinary numbers and named functions by inheritance.
 * Do not target every .mord: mathbb, mathcal, mathfrak, mathscr, mathsf and
 * mathtt also use that class and need their own mathematical alphabet fonts.
 */
:is(.question-content, .answer-content, .answer-text, .options-inline,
    .basket-item-preview, .question-typography) .katex {
    font-family: "Tiku Local Times", "Times New Roman", var(--question-cjk-font, "Tiku Local SimSun", "SimSun"), "KaTeX_Main", serif !important;
    font-style: normal;
    font-weight: 400;
}

:is(.question-content, .answer-content, .answer-text, .options-inline,
    .basket-item-preview, .question-typography) .katex :is(.mathnormal, .mathit) {
    font-family: "Tiku Local Times", "Times New Roman", var(--question-cjk-font, "Tiku Local SimSun", "SimSun"), "KaTeX_Math", serif !important;
    font-style: italic;
}

:is(.question-content, .answer-content, .answer-text, .options-inline,
    .basket-item-preview, .question-typography) .katex :is(.mathrm, .textrm, .mainrm) {
    font-family: "Tiku Local Times", "Times New Roman", var(--question-cjk-font, "Tiku Local SimSun", "SimSun"), "KaTeX_Main", serif !important;
    font-style: normal;
}

:is(.question-content, .answer-content, .answer-text, .options-inline,
    .basket-item-preview, .question-typography) .katex .mathbf {
    font-family: "Tiku Local Times", "Times New Roman", var(--question-cjk-font, "Tiku Local SimSun", "SimSun"), "KaTeX_Main", serif !important;
    font-style: normal;
    font-weight: 700;
}

:is(.question-content, .answer-content, .answer-text, .options-inline,
    .basket-item-preview, .question-typography) .katex .boldsymbol {
    font-family: "Tiku Local Times", "Times New Roman", var(--question-cjk-font, "Tiku Local SimSun", "SimSun"), "KaTeX_Math", serif !important;
    font-style: italic;
    font-weight: 700;
}

/* Relations, binary operators, punctuation and fixed delimiters use math glyphs.
 * Inner delimsizing/op-symbol nodes keep the explicit KaTeX_Size font family.
 */
:is(.question-content, .answer-content, .answer-text, .options-inline,
    .basket-item-preview, .question-typography) .katex
    :is(.mrel, .mbin, .mopen, .mclose, .mpunct, .minner, .accent-body) {
    font-family: "KaTeX_Main", serif;
}

/* Blue explanations replace only the Chinese face. Keep Times first for Latin
 * and digits; the inherited CJK choice also reaches Chinese inside formulas.
 */
:is(.question-content, .answer-content, .answer-text, .options-inline,
    .basket-item-preview, .question-typography) :is(.hl, .v2-explanation) {
    --question-cjk-font: "Tiku Local KaiTi", "KaiTi", "STKaiti", "楷体", "Tiku Local SimSun", "SimSun";
    font-family: "Tiku Local Times", "Times New Roman", var(--question-cjk-font), serif;
}
:is(.question-content, .answer-content, .answer-text, .options-inline,
    .basket-item-preview, .question-typography) .v2-explanation {
    color: #2563EB;
}

/* JSON2 table headings are structural; boldness comes from source formatting. */
:is(.question-content, .answer-content, .answer-text, .options-inline,
    .basket-item-preview, .question-typography) .v2-table th {
    font-weight: 400;
}

:is(.question-content, .answer-content, .answer-text, .options-inline,
    .basket-item-preview, .question-typography) .v2-blank {
    display: inline-block;
    width: calc(var(--blank-chars, 5) * 0.72em);
    min-width: 3.6em;
    height: 1em;
    margin: 0 0.12em;
    border-bottom: 1px solid currentColor;
    vertical-align: baseline;
}
