.markdown-workbench { --writer-height: clamp(460px, 62vh, 700px); --writer-split: 46%; --writer-muted: #737775; --writer-ink: #303432; border-radius: 6px; background: #fff; box-shadow: 0 5px 32px #26302906; color: var(--writer-ink); }
.editor-menubar { min-height: 52px; padding: 8px 14px; background: #fff; gap: 10px; }
.editor-modes { background: #f3f4f2; padding: 3px; gap: 2px; }
.editor-modes button { display: inline-flex; align-items: center; justify-content: center; width: 68px; gap: 6px; height: 30px; font-size: 12px; color: #686d68; }
.editor-modes button svg { width: 14px; height: 14px; }
.editor-modes button.active { color: #922a25; box-shadow: 0 1px 5px #222a2010; }
.editor-utilities { gap: 5px; }
.sync-control { color: #777c76; margin-right: 10px; }
.admin-body .sync-control input { accent-color: #963631; }
.copy-rich-button { display: inline-flex; align-items: center; gap: 6px; color: #fff; font-size: 12px; font-weight: 650; border-radius: 4px; background: #8c0000; padding: 8px 12px; margin-left: 8px; box-shadow: 0 4px 12px #8c00001c; }
.copy-rich-button:hover { background: #730000; }
.copy-rich-button:disabled { opacity: .62; cursor: wait; }
.editor-toolbar { position: relative; min-height: 46px; background: #f7f8f6; padding: 6px 12px; gap: 6px; }
.format-tools { display: flex; gap: 3px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; min-width: 0; }
.format-tools .icon-button { width: 33px; height: 32px; color: #555d55; }
.format-tools .icon-button svg { width: 17px; height: 17px; }
.format-tools .tool-break { margin-left: 10px; }
.format-tools .icon-button[aria-pressed="true"] { color: #992f29; background: #f1e3df; }
.format-tools .heading-button { width: 50px; gap: 2px; }
.editor-toolbar > #find-editor,
.editor-toolbar > #focus-editor {
  flex: 0 0 auto;
  width: 33px;
  height: 32px;
  color: #555d55;
}
.editor-toolbar > #find-editor { margin-left: auto; }
.editor-toolbar > #focus-editor[aria-pressed="true"] {
  color: #992f29;
  background: #f1e3df;
}
.editor-toolbar > #find-editor svg,
.editor-toolbar > #focus-editor svg { width: 17px; height: 17px; }
.heading-button .heading-chevron { width: 11px !important; }
.heading-menu { position: absolute; top: calc(100% - 2px); left: 90px; z-index: 15; width: 174px; padding: 6px; background: #fff; box-shadow: 0 6px 28px #222c2424; border-radius: 6px; }
.heading-menu button { display: flex; justify-content: space-between; gap: 16px; width: 100%; padding: 10px; text-align: left; color: #3f4840; border: 0; background: transparent; font-size: 13px; border-radius: 3px; }
.heading-menu button span { color: #9b9d96; font-size: 11px; }
.heading-menu button:hover { color: #94332d; background: #faf2ef; }
.editor-search { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 9px 14px; background: #f2f4f0; }
.admin-body .editor-search input { width: 160px; padding: 7px 9px; font-size: 12px; background: white; }
.editor-search > span { color: #747e6d; font-size: 11px; min-width: 36px; margin: 0 4px; }
.search-command { color: #59664d; font-size: 12px; padding: 6px 8px; border: 0; background: transparent; }
.search-command:hover { color: #922d27; }
.editor-panes { display: grid; grid-template-columns: minmax(0,var(--writer-split)) 7px minmax(0,1fr); }
.source-pane { background: #fafbf9; }
.pane-heading, .preview-controls { height: 42px; min-height: 42px; padding: 6px 24px; font-size: 11px; color: #8a8f87; }
.pane-heading > span:first-child { display: flex; gap: 7px; align-items: center; color: #7a8175; }
.pane-heading svg { width: 13px; height: 13px; }
.pane-heading .file-type { font: 10px Consolas,monospace; color: #969c90; }
.preview-controls { flex-wrap: nowrap; gap: 9px; padding: 6px 20px 6px 30px; }
.preview-label { color: #7f8778; white-space: nowrap; font-size: 11px; margin-right: auto; }
.theme-picker { gap: 8px; margin: 0 7px 0 0; }
.theme-picker .theme-swatch { width: 12px; height: 12px; }
.theme-picker > .theme-name { display: inline; }
.preview-controls > .icon-button { width: 28px; height: 28px; }
.preview-controls > .icon-button svg { width: 16px; height: 16px; }
.pane-resizer { background: #f4f5f2; cursor: col-resize; position: relative; touch-action: none; }
.pane-resizer::after { content: ""; width: 2px; height: 28px; background: #c7cdc1; border-radius: 2px; position: absolute; left: 2px; top: 45%; opacity: 0; transition: opacity .15s; }
.pane-resizer:hover::after, .pane-resizer:focus-visible::after { opacity: 1; }
.pane-resizer:focus-visible { outline: 2px solid #a54b4344; outline-offset: -2px; }
.markdown-workbench.resizing { user-select: none; }
.preview-scroll { height: var(--writer-height); padding: 24px 38px 50px; background: #fff; scrollbar-color: #d6dacf transparent; scrollbar-gutter: stable; }
.preview-scroll > .markdown-article { max-width: 690px; margin: 0 auto; }
.preview-scroll.mobile-preview { background: #f1f3ef; padding: 24px; }
.preview-scroll.mobile-preview .markdown-article { padding: 26px 22px; min-height: 100%; width: min(100%,375px); box-shadow: 0 2px 16px #26312207; }
.preview-placeholder { color: #a9aea4; font-size: 14px; padding: 36px 0; }
.typesetting-popover { position: absolute; right: 18px; top: 42px; z-index: 12; width: 244px; padding: 18px; background: #fff; border-radius: 6px; box-shadow: 0 6px 30px #27322320; display: grid; gap: 18px; }
.typesetting-popover > label, .typesetting-popover > div { display: flex; align-items: center; justify-content: space-between; gap: 15px; font-size: 12px; color: #687160; }
.admin-body .typesetting-popover select, .admin-body .typesetting-popover #article-font { background: #f3f5f0; width: 132px; font-size: 12px; padding: 7px 8px; }
.font-stepper { gap: 10px; }
.font-stepper .icon-button { width: 28px; height: 28px; background: #f3f5f0; }
.font-stepper output { width: 38px; font-size: 13px; color: #485342; }
.font-stepper output::after { content: " px"; font-size: 10px; color: #8b9384; }
.article-outline { right: 15px; top: 42px; }
.editor-statusbar { min-height: 34px; background: #f7f8f5; padding: 8px 18px; font-size: 11px; color: #8a9282; }
.admin-body .CodeMirror { height: var(--writer-height); background: #fafbf9; color: #424b3f; font: 15px/1.9 Consolas,"Microsoft YaHei",monospace; }
.CodeMirror-lines { padding: 24px 0 50px; }
.CodeMirror pre.CodeMirror-line, .CodeMirror pre.CodeMirror-line-like { padding: 0 24px 0 12px; }
.CodeMirror-gutters { background: transparent; }
.CodeMirror-linenumber { padding: 0 6px 0 14px; font-size: 11px; color: #aeb7a5; }
.CodeMirror-cursor { border-left-color: #9e3e34; border-left-width: 2px; }
.CodeMirror-selected { background: #e5e9df !important; }
.CodeMirror-focused .CodeMirror-selected { background: #e8e1da !important; }
.cm-s-default .cm-header { color: #973c32; font-weight: 650; }
.cm-s-default .cm-formatting { color: #a9b09f; }
.cm-s-default .cm-strong { color: #33422e; font-weight: 650; }
.cm-s-default .cm-em { color: #52614a; }
.cm-s-default .cm-quote { color: #7b886e; }
.cm-s-default .cm-link, .cm-s-default .cm-string { color: #3c8074; }
.cm-s-default .cm-comment { color: #7f6647; }
.CodeMirror-empty { color: #a7b19b; }
.admin-body .CodeMirror textarea { min-height: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; outline: none; line-height: normal; }
.cm-searching { background: #f6e6a5; }
.markdown-workbench:not([data-mode="split"]) .pane-resizer { display: none; }
.markdown-workbench[data-mode="preview"] .editor-toolbar, .markdown-workbench[data-mode="preview"] .editor-search { display: none; }
.markdown-workbench[data-mode="write"] .editor-panes, .markdown-workbench[data-mode="preview"] .editor-panes { grid-template-columns: minmax(0,1fr); }
.markdown-workbench[data-mode="write"] .CodeMirror-lines { max-width: 920px; margin: auto; }
.editor-focused .markdown-workbench { inset: 0; border-radius: 0; box-shadow: none; }
.editor-focused .editor-panes { flex: 1; min-height: 0; }
.editor-focused .source-pane, .editor-focused .preview-pane { min-height: 0; }
.editor-focused .CodeMirror, .editor-focused .preview-scroll { height: 0; flex: 1; }
body.editor-focused {
  overflow: hidden;
}
body.editor-focused .site-footer,
body.editor-focused .topbar,
body.editor-focused .important-reminder,
body.editor-focused .wechat-share-guide {
  display: none !important;
}
body.editor-focused .markdown-workbench {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  flex-direction: column;
  width: auto;
  max-width: none;
  border-radius: 0;
  box-shadow: none;
}
.block-dialog { width: min(530px,calc(100% - 32px)); }
.media-insert-dialog { width: min(520px,calc(100% - 32px)); }
.media-insert-dialog #image-source-fields { display: grid; gap: 14px; }
.image-source-tabs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 3px; padding: 3px; background: #f0f2ee; border-radius: 5px; }
.image-source-tabs button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 3px; background: transparent; color: #778071; font: inherit; font-weight: 650; cursor: pointer; }
.image-source-tabs button.active { background: #fff; color: #8c0000; box-shadow: 0 1px 7px #2a362215; }
.image-source-tabs svg { width: 15px; height: 15px; }
#image-upload-pane { display: grid; gap: 12px; }
.image-dropzone { min-height: 126px; place-items: center; align-content: center; gap: 5px !important; padding: 20px; border: 1px dashed #bdc4b8; border-radius: 6px; background: #fafbf9; text-align: center; cursor: pointer; transition: border-color .15s ease,background-color .15s ease; }
.image-dropzone:hover,.image-dropzone.dragging { border-color: #8c0000; background: #fbf6f5; }
.image-dropzone svg { width: 26px; height: 26px; color: #8c0000; }
.image-dropzone strong { color: #394238; font-size: 14px; }
.image-dropzone span,.image-storage-note { color: #8a9285; font-size: 11px; }
.image-file-summary { display: grid; grid-template-columns: 56px minmax(0,1fr) 32px; gap: 12px; align-items: center; min-height: 66px; padding: 8px; background: #f6f7f4; border-radius: 5px; }
.image-file-summary img { width: 56px; height: 50px; object-fit: cover; border-radius: 3px; background: #fff; }
.image-file-summary div { min-width: 0; display: grid; gap: 3px; }
.image-file-summary strong { overflow: hidden; color: #394238; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.image-file-summary span { color: #8a9285; font-size: 11px; }
.image-storage-note,.dialog-message { min-height: 18px; margin: 0; line-height: 1.6; }
.dialog-message { color: #8c0000; font-size: 12px; }
.nsd-image-loading { opacity: .45; }
.block-fields { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.block-wide { grid-column: 1 / -1; }
.block-dialog textarea { font: 14px/1.7 Consolas,"Microsoft YaHei",monospace; min-height: 120px; resize: vertical; }
#math-fields { display: grid; gap: 16px; }
.math-dialog-preview { overflow: auto; padding: 16px; min-height: 74px; color: #3f4c35; background: #f8f9f5; }
.math-dialog-preview .katex { font-size: 1.2em; }
.export-dialog .export-word-note { margin: 0; color: #7a817c; font-size: 12px; line-height: 1.65; }
.export-dialog form { gap: 18px; }
.export-dialog .dialog-heading > div { display: grid; gap: 2px; }
.dialog-eyebrow { color: #9b3029; font: 650 10px/1.2 Arial,sans-serif; }
.export-kind-tabs { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 3px; padding: 3px; border-radius: 5px; background: #eef0ec; }
.export-kind-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; border: 0; border-radius: 3px; color: #6d746c; background: transparent; font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
.export-kind-tabs button.active { color: #8c0000; background: #fff; box-shadow: 0 1px 7px #26312212; }
.export-kind-tabs svg { width: 16px; height: 16px; }
.export-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.export-fields[hidden] { display: none; }
#image-export-fields label { grid-column: 1 / -1; }
#word-export-fields { grid-template-columns: minmax(0,1fr); }
.export-summary { display: grid; grid-template-columns: 62px minmax(0,1fr); align-items: center; gap: 16px; min-height: 92px; padding: 14px 16px; border-left: 3px solid #8c0000; background: #f6f7f4; }
.export-summary > div:last-child { display: grid; gap: 5px; }
.export-summary strong { color: #343c35; font-size: 14px; }
.export-summary small { color: #7c847b; font-size: 11px; line-height: 1.55; }
#export-type-note { color: #8c0000; }
.export-live-preview { display: grid; gap: 8px; margin-top: 2px; }
.export-live-preview[hidden] { display: none; }
.export-live-preview-stage {
  display: grid;
  place-items: center;
  max-height: min(42vh, 420px);
  overflow: auto;
  padding: 10px;
  border: 1px solid #e4e6e2;
  background: #f3f4f0;
}
.export-live-preview-stage img {
  display: block;
  max-width: 100%;
  height: auto;
  background: #faf9f6;
  box-shadow: 0 8px 24px #26312214;
}
.export-live-preview-stage iframe {
  width: 100%;
  min-height: 280px;
  height: min(38vh, 360px);
  border: 0;
  background: #fff;
}
#export-preview-caption { margin: 0; color: #6d746c; font-size: 12px; }
.export-paper-preview { position: relative; width: 52px; height: 68px; justify-self: center; overflow: hidden; border: 1px solid #d7c1bd; background: #fff; box-shadow: 3px 4px 0 #e6e8e3; transition: width .18s ease,height .18s ease; }
.export-paper-preview::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 4px; background: #8c0000; }
.export-paper-preview span { display: block; height: 2px; margin: 14px 9px 0; background: #dfe2dc; }
.export-paper-preview span + span { margin-top: 6px; }
.export-paper-preview[data-shape="long"] { width: 38px; height: 76px; }
.export-paper-preview[data-shape="landscape"] { width: 72px; height: 50px; }
.export-status { min-height: 19px; margin: -2px 0 0; color: #667064; font-size: 12px; line-height: 1.55; }
.export-status[data-state="error"] { color: #8c0000; }
.export-qr-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 12px;
  padding: 8px 12px;
  border: 1px solid #e4e6e2;
  border-radius: 6px;
  background: #fafbf9;
  color: #4a514d;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  cursor: pointer;
  user-select: none;
}
.export-qr-toggle:hover { border-color: #d7c1bd; background: #fff; }
.export-qr-toggle:has(input:checked) {
  border-color: rgba(140, 0, 0, .28);
  background: #f7ecea;
  color: #6d1212;
}
.export-qr-toggle input {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  max-width: 16px;
  margin: 0;
  padding: 0 !important;
  flex: 0 0 16px;
  border: 1.5px solid #b8bfb9;
  border-radius: 4px;
  background: #fff;
  accent-color: #8c0000;
  cursor: pointer;
}
.export-qr-toggle input:checked {
  border-color: #8c0000;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.2l2.8 2.8 6.2-6.2'/%3E%3C/svg%3E") center / 12px 12px no-repeat,
    #8c0000;
}
.export-qr-toggle input:focus-visible {
  outline: 2px solid rgba(140, 0, 0, .28);
  outline-offset: 2px;
}
.export-qr-note {
  margin: 0 0 12px;
  color: #8a918b;
  font-size: 12px;
  line-height: 1.5;
}
.export-qr-toggle[hidden],
.export-qr-note[hidden] { display: none !important; }
.export-status[data-state="busy"]::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: #9b3029; animation: export-pulse 1s ease-in-out infinite alternate; }
.export-dialog .dialog-actions { gap: 8px; }
.export-dialog .dialog-actions .button { min-width: 96px; justify-content: center; }
.export-dialog .dialog-actions .button svg { width: 15px; height: 15px; }
.export-dialog button:disabled { cursor: wait; opacity: .58; }
.editor-export-stage { position: fixed; left: -100000px; top: 0; z-index: -1; box-sizing: border-box; overflow: visible; padding: 0; color: #1f2320; background: #faf9f6; pointer-events: none; }
.editor-export-stage .export-doc-shell {
  position: relative;
  box-sizing: border-box;
  padding: 28px 56px 40px;
  overflow: hidden;
  background: #faf9f6;
}
.editor-export-stage .export-doc-meta {
  position: relative;
  z-index: 1;
  margin: 0 0 22px;
  padding: 0 0 16px;
  border-bottom: 1px solid rgba(140, 0, 0, 0.12);
}
.editor-export-stage .export-doc-meta strong {
  display: block;
  margin: 0 0 8px;
  color: #1f2320;
  font-family: "Noto Serif SC", "Songti SC", STSong, Georgia, serif;
  font-size: calc(var(--article-size, 20px) * 1.55);
  font-weight: 650;
  line-height: 1.38;
  letter-spacing: 0.01em;
}
.editor-export-stage .export-doc-shell[data-font="sans"] .export-doc-meta strong {
  font-family: "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}
.editor-export-stage .export-doc-meta span {
  color: #7a817c;
  font-family: "Times New Roman", Georgia, serif;
  font-size: calc(var(--article-size, 20px) * 0.68);
  letter-spacing: 0.02em;
}
.editor-export-stage .export-doc-body { position: relative; z-index: 1; }
.editor-export-stage .export-doc-body > .markdown-article {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin: 0;
  color: #1f2320;
  line-break: strict;
  word-break: normal;
  overflow-wrap: anywhere;
}
.editor-export-stage .export-doc-body img {
  display: block !important;
  width: auto !important;
  max-width: 50% !important;
  height: auto !important;
  margin: 18px auto !important;
  object-fit: contain;
  break-inside: avoid;
  page-break-inside: avoid;
}
.editor-export-stage .export-doc-body figure,
.editor-export-stage .export-doc-body .qa-image-link {
  max-width: 50%;
  margin-left: auto;
  margin-right: auto;
  break-inside: avoid;
  page-break-inside: avoid;
}
.editor-export-stage .export-doc-body figure img,
.editor-export-stage .export-doc-body .qa-image-link img {
  max-width: 100% !important;
  margin: 0 auto !important;
}
.editor-export-stage .export-nowrap-punct { white-space: nowrap; }
.editor-export-stage .preview-placeholder { display: none; }
.editor-export-stage .export-doc-foot { position: relative; z-index: 1; margin-top: 28px; padding-top: 12px; border-top: 1px solid #e4e6e2; color: #8a918b; font-size: 11px; letter-spacing: .02em; }
@keyframes export-pulse { to { opacity: .3; transform: scale(.82); } }
@media (max-width: 1050px) {
  .preview-controls { padding-left: 18px; padding-right: 12px; gap: 5px; }
  .preview-scroll { padding: 24px; }
  .pane-heading { padding-left: 18px; padding-right: 15px; }
  .preview-label { font-size: 10px; }
  .theme-picker { gap: 7px; margin-right: 3px; }
  .theme-picker > .theme-name { display: none; }
}
@media (max-width: 680px) {
  .export-dialog { padding: 18px; }
  .export-fields { grid-template-columns: minmax(0,1fr); }
  .export-summary { grid-template-columns: 52px minmax(0,1fr); padding: 12px; }
  .export-paper-preview { transform: scale(.88); }
  .media-insert-dialog { padding: 18px; }
  .image-dropzone { min-height: 112px; }
  .markdown-workbench { --writer-height: 480px; }
  .editor-menubar { padding: 8px; flex-wrap: wrap; gap: 7px; }
  .editor-modes button { width: 53px; height: 31px; font-size: 11px; gap: 4px; }
  .editor-modes button svg { display: none; }
  .editor-utilities { margin-left: auto; gap: 1px; }
  .editor-utilities > .icon-button { width: 28px; height: 29px; }
  .editor-utilities > .icon-button svg { width: 15px; }
  .copy-rich-button { margin-left: 2px; padding: 6px; width: 29px; height: 29px; justify-content: center; }
  .copy-rich-button span { display: none; }
  .copy-rich-button svg { width: 15px; height: 15px; }
  .sync-control { display: none; }
  .editor-toolbar { padding: 6px; flex-wrap: nowrap; }
  .format-tools { flex: 1; gap: 1px; }
  .format-tools .icon-button { width: 32px; height: 34px; }
  .format-tools .tool-break { margin-left: 7px; }
  .format-tools .heading-button { width: 44px; }
  .editor-panes { grid-template-columns: minmax(0,1fr); }
  .pane-resizer { display: none; }
  .pane-heading, .preview-controls { padding: 6px 16px; height: 40px; min-height: 40px; }
  .preview-controls { gap: 8px; }
  .preview-label { font-size: 11px; }
  .preview-scroll { padding: 24px 22px 38px; }
  .admin-body .CodeMirror { font-size: 15px; }
  .CodeMirror pre.CodeMirror-line, .CodeMirror pre.CodeMirror-line-like { padding-right: 16px; padding-left: 8px; }
  .CodeMirror-linenumber { padding-left: 8px; }
  .CodeMirror-lines { padding-top: 22px; }
  .editor-statusbar { font-size: 10px; gap: 10px; padding: 8px 12px; }
  .editor-statusbar #cursor-position { display: none; }
  .editor-search { padding: 8px; }
  .admin-body .editor-search input { width: calc(50% - 4px); }
  .editor-focused .markdown-workbench { inset: 0; border-radius: 0; }
  .editor-focused .markdown-workbench[data-mode="split"] .CodeMirror, .editor-focused .markdown-workbench[data-mode="split"] .preview-scroll { height: 420px; flex: none; }
  .heading-menu { left: 68px; }
}
