/* 从 hzq 0.0.2 的 styles.css 提取的题目面板样式，作用域限定在 .preview-frame 内，
   保证编辑器预览与比赛现场的排版一致（同一套字体、字号、KaTeX 参数）。 */

.preview-frame {
    font-family: 仿宋, FangSong, STFangsong, 'Songti SC', serif;
    font-size: 16px;
    color: #333;
    position: relative;
}

.preview-frame .question-panel {
    flex-basis: 60%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.preview-frame .question-content {
    font-family: 仿宋, FangSong, STFangsong, 'Songti SC', serif;
    font-weight: bold;
    font-size: 2em;
    text-align: center;
    width: 100%;
    margin-bottom: 20px;
    line-height: 1.45;
    word-break: break-word;
}

.preview-frame .question-content .plain-digit,
.preview-frame .choice-content .plain-digit {
    font-family: 仿宋, FangSong, STFangsong, 'Songti SC', serif;
}

.preview-frame .question-content .katex,
.preview-frame .choice-content .katex {
    font-size: 1.05em;
    font-family: KaTeX_Main, "Times New Roman", serif;
}

.preview-frame .katex * { font-family: unset; }

.preview-frame .question-content .katex-display {
    margin: 0.4em 0;
    overflow-x: auto;
    overflow-y: hidden;
}

.preview-frame .latex-error { color: #c62828; }

.preview-frame .question-choices {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    column-gap: 20px;
    row-gap: 8px;
    justify-items: center;
    width: 100%;
}

.preview-frame .choice-content {
    font-family: 仿宋, FangSong, STFangsong, 'Songti SC', serif;
    font-weight: bold;
    font-size: 1.5em;
    text-align: center;
    width: 100%;
    padding: 4px 10px;
    border-radius: 6px;
    border: 2px solid transparent;
}

.preview-frame .choice-content .letter {
    font-weight: bold;
    margin-right: .35em;
}

/* markdown 会把选项包成 <p>，在单行选项里要还原为行内，否则字母会另起一行 */
.preview-frame .choice-content p {
    display: inline;
    margin: 0;
}

/* 预览里把正确答案标出来（比赛时是操作员点选后才高亮） */
.preview-frame .choice-content.is-answer {
    background-color: #4CAF50;
    color: #fff;
}

.preview-frame .question-content img,
.preview-frame .choice-content img {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    margin: 10px auto;
    border-radius: 6px;
}

.preview-frame .choice-content img { max-height: 4.5em; margin: 4px auto; }

.preview-frame .question-content p { margin: .35em 0; }
.preview-frame .question-content ul,
.preview-frame .question-content ol { text-align: left; display: inline-block; margin: .35em 0; }
.preview-frame .question-content blockquote {
    margin: .4em 0;
    padding: 2px 12px;
    border-left: 4px solid #b9c6d4;
    color: #4a5b6c;
    text-align: left;
}
.preview-frame .question-content table,
.preview-frame .choice-content table {
    border-collapse: collapse;
    margin: .4em auto;
    font-size: .6em;
}
.preview-frame .question-content th,
.preview-frame .question-content td,
.preview-frame .choice-content th,
.preview-frame .choice-content td {
    border: 1px solid #9fb0c2;
    padding: 3px 8px;
}
.preview-frame .question-content code,
.preview-frame .choice-content code {
    font-family: Consolas, Menlo, monospace;
    background: #eef2f7;
    border-radius: 4px;
    padding: 0 4px;
    font-size: .8em;
}
.preview-frame .question-content pre,
.preview-frame .choice-content pre {
    text-align: left;
    background: #eef2f7;
    border-radius: 6px;
    padding: 8px 10px;
    overflow-x: auto;
    font-size: .62em;
}
.preview-frame .question-content hr {
    border: none;
    border-top: 2px solid #c9d3de;
    margin: .6em 0;
}

.preview-frame .missing-asset {
    display: inline-block;
    color: #c62828;
    border: 1px dashed #c62828;
    border-radius: 5px;
    padding: 0 8px;
    font-size: .6em;
    font-family: -apple-system, "Microsoft YaHei", sans-serif;
}

/* 全库预览用的小标题 */
.preview-frame .preview-index {
    position: absolute;
    top: 6px;
    left: 10px;
    font-size: 12px;
    color: #8a99aa;
    font-family: -apple-system, "Microsoft YaHei", sans-serif;
}

/* 全库预览时缩小一些，便于总览 */
.preview-frame.compact .question-content { font-size: 1.35em; }
.preview-frame.compact .choice-content { font-size: 1.05em; }
