.news-body-editor { margin-top: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); overflow: hidden; }
.news-body-editor:focus-within { border-color: var(--pd); box-shadow: 0 0 0 1px var(--pd); }
.news-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 600; }
.news-editor-heading small { margin-left: 10px; color: var(--muted); font-size: 12px; font-weight: 400; }
.toolbox-app .news-body-editor button { width: 36px; height: 36px; min-height: 36px; padding: 7px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); }
.news-body-editor button svg { width: 21px; height: 21px; }
.toolbox-app .news-body-editor button:hover, .toolbox-app .news-body-editor button[aria-pressed="true"] { background: var(--pale); color: var(--pd); }
.news-editor-heading .visual-mode-icon, .markdown-mode .news-editor-heading button > svg:first-child { display: none; }
.markdown-mode .news-editor-heading .visual-mode-icon { display: block; }
.news-format-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 3px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.toolbox-app .html-form .news-body-editor .news-format-toolbar select[data-heading] { width: 142px; min-height: 36px; height: 36px; margin: 0 8px 0 0; padding: 6px 8px; font-size: 14px; border-color: var(--line); border-radius: 6px; }
.news-body-editor:not(.editor-ready) .news-format-toolbar, .news-body-editor:not(.editor-ready) [data-mode] { pointer-events: none; opacity: .4; }
.news-rich-surface { min-height: 320px; max-height: 640px; overflow-y: auto; }
.news-rich-surface .tiptap { min-height: 320px; padding: 24px; outline: none; color: var(--text); overflow-wrap: anywhere; font: 400 17px/1.75 var(--font); }
.news-rich-surface .tiptap > :first-child { margin-top: 0; }
.news-rich-surface .tiptap > :last-child { margin-bottom: 0; }
.news-rich-surface p { margin: 0 0 1em; }
.news-rich-surface .tiptap > p:only-child:has(> br:only-child)::before { content: attr(data-placeholder); }
.news-rich-surface .tiptap:has(> p:only-child > br:only-child)::before { content: attr(data-placeholder); color: var(--muted); float: left; height: 0; pointer-events: none; }
.toolbox-app .news-rich-surface :is(h1,h2,h3) { display: block; color: var(--text); margin: 1.2em 0 .55em; font-family: var(--display); line-height: 1.35; }
.toolbox-app .news-rich-surface h1 { font-size: 27px; }
.toolbox-app .news-rich-surface h2 { font-size: 22px; }
.toolbox-app .news-rich-surface h3 { font-size: 18px; }
.news-rich-surface :is(ul,ol), .news-body :is(ul,ol) { padding-left: 1.6em; margin: 1em 0; }
.news-rich-surface ul, .news-body ul { list-style: disc; }
.news-rich-surface ol, .news-body ol { list-style: decimal; }
.news-rich-surface li > p { margin: .2em 0; }
.news-rich-surface blockquote, .news-body blockquote { border-left: 3px solid var(--pd); padding: 8px 20px; margin: 24px 0; color: var(--muted); background: var(--pale); border-radius: 0 8px 8px 0; }
.news-rich-surface blockquote p:last-child, .news-body blockquote p:last-child { margin-bottom: 0; }
.news-rich-surface pre, .news-body pre { white-space: pre-wrap; overflow-wrap: anywhere; padding: 18px; margin: 20px 0; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); }
.news-rich-surface code, .news-body code { font: .88em/1.6 Consolas, monospace; background: var(--surface); border-radius: 3px; padding: 2px 4px; }
.news-rich-surface pre code, .news-body pre code { padding: 0; }
.news-rich-surface hr, .news-body hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.news-rich-surface img, .news-body img { display: block; max-width: 100%; height: auto; max-height: 700px; object-fit: contain; margin: 20px auto; border-radius: 8px; }
.news-rich-surface img.ProseMirror-selectednode { outline: 3px solid var(--pd); outline-offset: 3px; }
.news-rich-surface a { text-decoration: underline; }
.toolbox-app .html-form .news-body-editor textarea[data-source] { min-height: 360px; margin: 0; padding: 24px; border: 0; border-radius: 0; outline: none; background: var(--paper); font: 14px/1.75 Consolas, monospace; resize: vertical; }
.news-editor-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 10px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.editor-upload-state { display: none; }
.uploading .editor-upload-state { display: inline; }
.uploading .editor-paste-hint { display: none; }
.over-limit [data-count] { color: var(--error); font-weight: 600; }
.news-link-panel, .news-image-panel { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 14px 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.toolbox-app .html-form .news-body-editor .news-link-panel input { flex: 1 1 230px; width: auto; margin: 0; }
.toolbox-app .news-body-editor :is(.news-link-panel, .news-image-panel) button { width: auto; padding: 7px 10px; border: 1px solid var(--line); color: var(--pd); background: var(--paper); }
.toolbox-app .html-form .news-image-panel label { flex: 1 1 240px; width: auto; margin: 0; font-size: 13px; }
.news-image-panel { border-top: 1px solid var(--line); }
.ProseMirror .ProseMirror-gapcursor { display: none; pointer-events: none; position: absolute; margin: 0; }
.ProseMirror .ProseMirror-gapcursor::after { content: ""; display: block; position: absolute; top: -2px; width: 20px; border-top: 1px solid var(--text); }
.ProseMirror-focused .ProseMirror-gapcursor { display: block; }
.ProseMirror { position: relative; white-space: pre-wrap; word-wrap: break-word; }
@media (max-width: 600px) { .news-rich-surface .tiptap, .toolbox-app .html-form .news-body-editor textarea[data-source] { padding: 18px; } .news-format-toolbar { padding: 8px; } .news-editor-heading { padding: 12px; } .news-editor-foot { padding: 10px 12px; } }
