/* Shared display typography; these rules never alter stored Markdown. */
:is(.text-editor-page,.text-reading-page,.project-reading-page){--text-paragraph-gap:18px;--text-heading-before:32px;--text-heading-after:16px}
:is(.text-editor-page .text-editor .toastui-editor-contents,.text-reading-page .text-detail__body,.project-reading-page .reading-body){font:400 16px/1.8 var(--room-font-content);letter-spacing:normal;overflow-wrap:anywhere;font-variant-ligatures:none;font-feature-settings:"liga" 0}
.text-editor-page .text-editor .toastui-editor-ww-container{position:relative;--text-editor-padding:22px 24px}
.text-editor-page .text-editor .toastui-editor-contents{box-sizing:border-box;width:100%;max-width:none;margin-inline:0;padding:var(--text-editor-padding,22px 24px)}
/* Keep the empty hint outside the editable DOM so it cannot interrupt IME composition. */
.text-editor-page .text-editor .toastui-editor-ww-container:has(.ProseMirror>p:only-child:empty,.ProseMirror>p:only-child>.ProseMirror-trailingBreak:only-child)::after{content:'请输入内容';position:absolute;inset:0 auto auto 0;padding:var(--text-editor-padding);pointer-events:none;color:var(--room-muted);font:400 16px/1.8 var(--room-font-content)}
:is(.text-reading-page .text-detail__body,.project-reading-page .reading-body){max-width:680px;margin-inline:auto}
/* Toast UI assigns 160% to descendants; setting only the root is insufficient. */
:is(.text-editor-page .text-editor .toastui-editor-contents,.text-reading-page .text-detail__body,.project-reading-page .reading-body) :is(p,li,ul,ol,blockquote,strong,em,s,a,span){line-height:inherit}
:is(.text-editor-page .text-editor .toastui-editor-contents,.text-reading-page .text-detail__body,.project-reading-page .reading-body) p{margin:0 0 var(--text-paragraph-gap)}
:is(.text-editor-page .text-editor .toastui-editor-contents,.text-reading-page .text-detail__body,.project-reading-page .reading-body) :is(li,td,th)>p{margin:0}
:is(.text-editor-page .text-editor .toastui-editor-contents,.text-reading-page .text-detail__body,.project-reading-page .reading-body) :is(ul,ol){margin:0 0 var(--text-paragraph-gap);padding-left:1.6em}
:is(.text-editor-page .text-editor .toastui-editor-contents,.text-reading-page .text-detail__body,.project-reading-page .reading-body) li+li{margin-top:6px}
:is(.text-editor-page .text-editor .toastui-editor-contents,.text-reading-page .text-detail__body,.project-reading-page .reading-body) :is(h1,h2,h3,h4,h5,h6){margin:var(--text-heading-before) 0 var(--text-heading-after);padding-bottom:0;border-bottom:0;font-family:var(--room-font-display);font-weight:700;line-height:1.4;letter-spacing:normal}
:is(.text-editor-page .text-editor .toastui-editor-contents,.text-reading-page .text-detail__body,.project-reading-page .reading-body) h1{font-size:28px}
:is(.text-editor-page .text-editor .toastui-editor-contents,.text-reading-page .text-detail__body,.project-reading-page .reading-body) h2{font-size:24px}
:is(.text-editor-page .text-editor .toastui-editor-contents,.text-reading-page .text-detail__body,.project-reading-page .reading-body) h3{font-size:20px;--text-heading-before:28px;--text-heading-after:12px}
:is(.text-editor-page .text-editor .toastui-editor-contents,.text-reading-page .text-detail__body,.project-reading-page .reading-body) :is(h4,h5,h6){--text-heading-before:24px;--text-heading-after:8px}
:is(.text-editor-page .text-editor .toastui-editor-contents,.text-reading-page .text-detail__body,.project-reading-page .reading-body) h4{font-size:18px}
:is(.text-editor-page .text-editor .toastui-editor-contents,.text-reading-page .text-detail__body,.project-reading-page .reading-body) :is(h5,h6){font-size:16px}
:is(.text-editor-page .text-editor .toastui-editor-contents,.text-reading-page .text-detail__body,.project-reading-page .reading-body)>:first-child{margin-top:0}
:is(.text-editor-page .text-editor .toastui-editor-contents,.text-reading-page .text-detail__body,.project-reading-page .reading-body)>:last-child{margin-bottom:0}
/* Empty editable paragraphs reserve the same line box as typed text. */
.text-editor-page .text-editor .toastui-editor-contents p{min-height:1lh}
.text-editor-page .text-editor .toastui-editor-contents p:has(+p.is-markdown-separator){margin-bottom:0}
.text-editor-page .text-editor .toastui-editor-contents p.is-markdown-separator{min-height:var(--text-paragraph-gap);height:var(--text-paragraph-gap);line-height:var(--text-paragraph-gap);margin:0}
/* Shared special-format rules override both native-editor and legacy-reader defaults. */
:is(.text-editor-page .text-editor .toastui-editor-contents,.text-reading-page .text-detail__body,.project-reading-page .reading-body) blockquote{margin:1.3em 0;padding:.2em 1em;border-left:3px solid var(--room-primary);color:var(--room-muted)}
:is(.text-editor-page .text-editor .toastui-editor-contents,.text-reading-page .text-detail__body,.project-reading-page .reading-body) blockquote :is(p,ul,ol,li){color:inherit}
.text-editor-page .text-editor .toastui-editor-contents blockquote p{margin:0}
:is(.text-editor-page .text-editor .toastui-editor-contents,.text-reading-page .text-detail__body,.project-reading-page .reading-body) blockquote>:first-child{margin-top:0}
:is(.text-editor-page .text-editor .toastui-editor-contents,.text-reading-page .text-detail__body,.project-reading-page .reading-body) blockquote>:last-child{margin-bottom:0}
:is(.text-editor-page .text-editor .toastui-editor-contents,.text-reading-page .text-detail__body,.project-reading-page .reading-body) pre{margin:14px 0;padding:16px;font:400 14px/1.6 var(--room-font-mono);letter-spacing:normal;white-space:pre;overflow:auto;background:var(--room-subtle-surface);border-radius:var(--room-radius-panel)}
:is(.text-editor-page .text-editor .toastui-editor-contents,.text-reading-page .text-detail__body,.project-reading-page .reading-body) pre code{padding:0;font:inherit;letter-spacing:normal;white-space:inherit;background:transparent;color:var(--room-ink)}
:is(.text-editor-page .text-editor .toastui-editor-contents,.text-reading-page .text-detail__body,.project-reading-page .reading-body) :not(pre)>code{padding:2px 4px;font-family:var(--room-font-mono);font-size:inherit;line-height:inherit;letter-spacing:normal;white-space:break-spaces;background:var(--room-preview-surface);color:var(--room-ink)}
:is(.text-editor-page .text-editor .toastui-editor-contents,.text-reading-page .text-detail__body,.project-reading-page .reading-body) table{margin:16px 0;border:0;border-collapse:collapse}
:is(.text-editor-page .text-editor .toastui-editor-contents,.text-reading-page .text-detail__body,.project-reading-page .reading-body) :is(th,td){height:auto;font-size:inherit;line-height:1.8}
:is(.text-editor-page .text-editor .toastui-editor-contents,.text-reading-page .text-detail__body,.project-reading-page .reading-body) :is(th,td)>p{padding:0}
.text-detail__body .text-literal{white-space:break-spaces}
@media(max-width:600px){
:is(.text-editor-page,.text-reading-page,.project-reading-page){--text-paragraph-gap:16px;--text-heading-before:28px;--text-heading-after:12px}
:is(.text-editor-page .text-editor .toastui-editor-contents,.text-reading-page .text-detail__body,.project-reading-page .reading-body) h3{--text-heading-before:24px;--text-heading-after:12px}
:is(.text-editor-page .text-editor .toastui-editor-contents,.text-reading-page .text-detail__body,.project-reading-page .reading-body) :is(h4,h5,h6){--text-heading-before:20px;--text-heading-after:8px}
.text-editor-page .text-editor .toastui-editor-ww-container{--text-editor-padding:16px}
:is(.text-editor-page .text-editor .toastui-editor-contents,.text-reading-page .text-detail__body,.project-reading-page .reading-body) h1{font-size:26px}
:is(.text-editor-page .text-editor .toastui-editor-contents,.text-reading-page .text-detail__body,.project-reading-page .reading-body) h2{font-size:22px}
}
