/* Identical article-only cascade in the visitor reader and administrator preview. */
.arow[aria-busy="true"] { cursor:progress;opacity:.7 }
#apBox:has(#apBody.article-presentation){width:900px!important;max-width:calc(100vw - 40px)!important}
#artMask #dBody.article-presentation,#artPrevMask #apBody.article-presentation{
 box-sizing:border-box!important;width:100%!important;max-width:none!important;margin:0!important;
 padding:14px 22px!important;background:#fff;
 font-family:var(--article-font-family,SimHei,"Microsoft YaHei",sans-serif)!important;
 font-size:var(--article-font-size,28px)!important;font-weight:var(--article-font-weight,700)!important;
 font-style:var(--article-font-style,normal)!important;color:var(--article-text-color,#000)!important;
 line-height:2.1!important;letter-spacing:normal!important;word-break:break-word!important;overflow-wrap:break-word!important;white-space:normal!important;
}


#artMask #dBody.article-presentation p,#artPrevMask #apBody.article-presentation p{margin:0 0 10px}
#artMask #dBody.article-presentation img,#artPrevMask #apBody.article-presentation img{max-width:100%;height:auto}
#artMask #dBody.article-presentation pre,#artPrevMask #apBody.article-presentation pre{white-space:pre-wrap;overflow-wrap:break-word}
#artMask #dBody.article-presentation table,#artPrevMask #apBody.article-presentation table{border-collapse:collapse;max-width:100%}
#artMask #dBody.article-presentation td,#artPrevMask #apBody.article-presentation td,
#artMask #dBody.article-presentation th,#artPrevMask #apBody.article-presentation th{font-family:inherit;font-size:inherit;line-height:inherit;color:inherit}
@media(max-width:800px){
 #artMask #dBody.article-presentation .res-keep,#artPrevMask #apBody.article-presentation .res-keep{white-space:nowrap!important;display:inline-block!important}
 #artPrevMask:has(.article-presentation) #apTitle{font-size:var(--article-preview-title,10px)!important}
 #apBox:has(#apBody.article-presentation){width:100%!important;max-width:100%!important}
 #artMask #dBody.article-presentation,#artPrevMask #apBody.article-presentation{padding:8px 10px!important}
}

@media(max-width:800px){
#artMask:has(.article-presentation),#artPrevMask:has(.article-presentation){padding:16px!important}
#artMask:has(.article-presentation) .d-modal,#artPrevMask #apBox:has(.article-presentation){width:calc(100vw - 32px)!important;max-width:calc(100vw - 32px)!important}
#artMask #dBody.article-presentation,#artPrevMask #apBody.article-presentation{zoom:1!important;width:100%!important;max-width:none!important}
#artMask:has(.article-presentation) .d-modal,#artPrevMask #apBox:has(.article-presentation){zoom:var(--article-modal-compensation,1)!important}
#artMask #dBody.article-presentation>.article-content,#artPrevMask #apBody.article-presentation>.article-content{zoom:var(--article-mobile-scale,.5)!important}
}

/* Shared HTML source editor: same dark readable code surface in front/admin preview. */
#apCode,#edCode{
 background:#1E293B!important;color:#F1F5F9!important;
 font-family:Consolas,Monaco,"Courier New",monospace!important;
 font-size:13px!important;line-height:1.75!important;
 white-space:pre-wrap!important;overflow-wrap:anywhere!important;word-break:break-word!important;
 overflow-x:auto!important;max-width:100%!important;box-sizing:border-box!important;
 caret-color:#7DD3FC!important;tab-size:2;
}
#apCode::selection,#edCode::selection{background:#334155!important;color:#fff!important}

#artMask #dBody.article-presentation .art-lines,#artPrevMask #apBody.article-presentation .art-lines{
 font-family:inherit;font-size:inherit;font-weight:inherit;font-style:inherit;color:inherit;line-height:inherit;
}
#artMask #dBody.article-presentation .hl-hit,#artPrevMask #apBody.article-presentation .hl-hit,
#artMask #dBody.article-presentation .hl-res,#artPrevMask #apBody.article-presentation .hl-res{color:#E5342B;background-color:#FFF8E1}

.article-reading .article-read-row {
 display:grid;grid-template-columns:minmax(0,1fr) minmax(0,56%) minmax(0,1fr);container-type:inline-size;
 align-items:baseline;gap:.15em 0;padding:.24em 0;line-height:1.55;font-variant-numeric:tabular-nums;
}
.article-reading .article-read-row > :is(.article-read-period,.article-read-labels,.article-read-result) { font-size:min(1em,4.4cqi) }
.article-reading .article-read-period { grid-area:1 / 1;text-align:left;white-space:nowrap }
.article-reading .article-read-labels { grid-area:1 / 2;display:flex;align-items:baseline;justify-content:center;gap:.32em;min-width:0;text-align:center }
.article-reading .article-read-author { display:inline-flex;align-items:baseline;gap:.15em;min-width:0 }
.article-reading .article-read-sign { font-size:.86em;flex:none }
.article-reading .article-read-label,.article-reading .article-read-play { min-width:0;overflow-wrap:anywhere }
@media(max-width:800px) {
 .article-reading { -webkit-text-size-adjust:100%;text-size-adjust:100%;container-type:inline-size }
 .article-reading .article-read-row {
  container-type:normal;
  grid-template-columns:minmax(0,26%) minmax(0,48%) minmax(0,26%);
 }
 .article-reading :is(.article-read-row,.article-read-draw) {
  /* The viewport fallback uses unscaled lengths; the container reflects the actual room inside the article. */
  font-size:min(var(--article-font-size,28px),calc(4vw / var(--article-mobile-scale,.5)));
  font-size:min(var(--article-font-size,28px),4.7cqi);
 }
 .article-reading .article-read-row > :is(.article-read-period,.article-read-labels,.article-read-result) { font-size:inherit }
 .article-reading .article-read-labels { flex-wrap:wrap;row-gap:0 }
 .article-reading :is(.article-read-author,.article-read-play) { max-width:100% }
 .article-reading .article-read-result { white-space:nowrap;overflow-wrap:normal;word-break:normal }
 .article-reading :is(.article-read-row,.article-read-draw) :is([style*="font-size" i],font[size],small,big) { font-size:inherit!important }
}
.article-reading .article-read-label:has(>span[style]:only-child),.article-reading .article-read-play:has(>span[style]:only-child) { background:transparent }
.article-reading .article-read-label:has(>span[style]:only-child)>span,.article-reading .article-read-play:has(>span[style]:only-child)>span {
 border-radius:.22em;padding:.04em .15em;box-decoration-break:clone;
}
.article-reading .article-read-label:not(:has([style*="background"])) { color:#6A1B9A;background:#F4E7F8;border-radius:.22em;padding:0 .15em }
.article-reading .article-read-play:not(:has([style*="background"])) { color:#2E7D32;background:#E6F6E8;border-radius:.22em;padding:0 .15em }
.article-reading .article-read-play[style*="--article-play-contrast"],
.article-reading .article-read-play[style*="--article-play-contrast"] * { color:var(--article-play-contrast)!important }
.article-reading .article-read-prediction { grid-area:2 / 1 / 3 / -1;min-width:0;text-align:center;overflow-wrap:anywhere }
.article-reading .article-read-suffix { grid-area:3 / 1 / 4 / -1;min-width:0;text-align:center;overflow-wrap:anywhere }
.article-reading .article-read-suffix :is([style*="font-size" i],font[size],small,big) { font-size:inherit!important }
.article-reading .article-read-group,.article-reading .article-read-number-part { display:inline-block;width:max-content;max-width:100% }
.article-reading .article-read-result { grid-area:1 / 3;justify-self:end;max-width:100%;text-align:right;overflow-wrap:anywhere }
.article-reading .article-read-summary-hit { color:#E5342B;background-color:#FFF8E1 }
.article-reading .article-read-summary:empty { display:none }
.article-reading .article-read-draw { display:block;padding:0 0 .28em;text-align:center;line-height:1.55;overflow-wrap:anywhere }
@media(max-width:300px) {
 .article-reading .article-read-row { grid-template-columns:1fr 1fr }
 .article-reading .article-read-result { grid-area:1 / 2 }
 .article-reading .article-read-labels { grid-area:2 / 1 / 3 / -1 }
 .article-reading .article-read-prediction { grid-area:3 / 1 / 4 / -1 }
 .article-reading .article-read-suffix { grid-area:4 / 1 / 5 / -1 }
 .article-reading :is(.article-read-row,.article-read-draw) {
  font-size:min(var(--article-font-size,28px),calc(5vw / var(--article-mobile-scale,.5)));
  font-size:min(var(--article-font-size,28px),5.8cqi);
 }
}
.article-reading .article-read-break { display:none }
/* Older templates inserted their ads as standalone lines without a marker. */
.article-reading .art-lines { text-align:center }
.article-reading .art-lines :is([data-qh-notes],[data-pubtime]) { text-align:left }
.article-presentation [data-art-ad] { display:block;max-width:100%;box-sizing:border-box;text-align:center!important;overflow-wrap:anywhere }
.article-presentation [data-art-ad] :is(p,div) { text-align:inherit!important }
.article-presentation :is(br:has(+[data-art-ad]),[data-art-ad]+br) { display:none }
.article-reading-edit [data-article-edit-cell] { cursor:text }
.article-reading-edit [data-article-edit-cell]:focus { outline:1px solid #8aa7d8;outline-offset:1px;border-radius:.14em }
