diff --git a/web/src/components/Editor.tsx b/web/src/components/Editor.tsx index 5fa29d6..119706b 100644 --- a/web/src/components/Editor.tsx +++ b/web/src/components/Editor.tsx @@ -128,7 +128,7 @@ export default function Editor({ basicSetup={{ lineNumbers: true, foldGutter: false, highlightActiveLine: true }} theme={isDarkMode(mode) ? 'dark' : 'light'} height="100%" - style={{ height: '100%', minHeight: 420 }} + style={{ height: '100%', minHeight: 240 }} onCreateEditor={(view) => { viewRef.current = { view } appliedSourceMode.current = sourceMode diff --git a/web/src/index.css b/web/src/index.css index 96548bd..07ddc3b 100644 --- a/web/src/index.css +++ b/web/src/index.css @@ -1659,6 +1659,23 @@ button.ant-btn.pn-admin-mobile-act { grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; + /* 编辑卡默认吃满视口剩余高度:短文也有开阔的编辑区,长文在编辑器内部滚动 + 而不再把页面撑到几万像素(topbar 62px + content padding 24px×2)。 */ + height: calc(100vh - 110px); + min-height: 520px; +} +/* 编辑卡(含 antd Card 的 body)拉成纵向 flex,把剩余高度让给编辑区 */ +.pn-ae-main { + align-self: stretch; + display: flex; + flex-direction: column; + min-height: 0; +} +.pn-ae-main > .ant-card-body { + display: flex; + flex-direction: column; + flex: 1 1 auto; + min-height: 0; } /* 编辑卡与发布卡的 Card 基础样式由 ui/card 承接(gap-0/p-6 等) */ /* 提权至 (0,1,1)+:压过 antd .ant-input 的同名字段(cssinjs 无 layer 且后注入)。 @@ -1746,8 +1763,11 @@ button.pn-ae-tool svg { white-space: nowrap; } .pn-ae-body-wrap { - min-height: 420px; + /* 吃掉卡片内的剩余高度(滚动由 CodeMirror 的 .cm-scroller 承担) */ + flex: 1 1 auto; + min-height: 280px; border-radius: var(--radius-sm); + overflow: hidden; } .pn-ae-upload-alert { margin-top: 10px; @@ -1801,9 +1821,18 @@ button.pn-ae-tool svg { .ant-divider.pn-ae-divider { margin: 14px 0; } +@media (max-width: 1023px) { + .pn-ae-grid { + /* 该断点下 content padding 收紧为 20px */ + height: calc(100vh - 102px); + } +} @media (max-width: 900px) { .pn-ae-grid { grid-template-columns: minmax(0, 1fr); + /* 堆叠布局:回到内容高度,避免编辑区被压扁 */ + height: auto; + min-height: 0; } .pn-ae-side { position: static;