/* 共享 Markdown 编辑器样式（前台 + 后台通用） */
.md-editor {
  border: 1px solid var(--line, #e5e9ef);
  border-radius: var(--radius-lg, 12px);
  background: #fff;
  overflow: hidden;
}
.md-editor:focus-within { border-color: var(--brand-400, #3a86b8); box-shadow: 0 0 0 3px rgba(58, 134, 184, .14); }

.md-tools {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line, #e5e9ef);
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8fc 100%);
}
.md-tools .btn.sm { height: 32px; padding: 0 10px; font-size: 13px; }
.md-tools .btn.sm .ico { width: 15px; height: 15px; }
.mdl-upload { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.mdl-upload input[type=file] { display: none; }
.md-tools .btn[aria-pressed="true"] { border-color: var(--brand, #0f5c8c); color: var(--brand, #0f5c8c); background: var(--brand-50, #eef5fa); }

.md-panes { position: relative; }
.mdl-textarea {
  width: 100%; border: 0; border-radius: 0; resize: vertical;
  min-height: 220px; padding: 14px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13.5px; line-height: 1.8; background: #fff;
}
.mdl-textarea:focus { outline: none; box-shadow: none; }
.md-preview {
  padding: 16px 18px; min-height: 220px; overflow: auto;
  font-size: 14.5px; line-height: 1.85; border-top: 1px solid var(--line, #e5e9ef);
}
.md-preview > :first-child { margin-top: 0; }
.md-preview img { max-width: 100%; height: auto; border-radius: 8px; }

.md-foot {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-top: 1px solid var(--line, #e5e9ef); background: #fafcfe;
  font-size: 12.5px; color: var(--muted, #6b7a89);
}
.md-foot .md-msg { color: var(--brand, #0f5c8c); }
.md-foot .md-msg.err { color: #c0392b; }
.md-foot .md-msg.ok { color: #1a8f5a; }
.md-editor.md-short { border-color: #e8b93b; }

/* 拖拽上传高亮 */
.md-editor.md-drag { border-color: var(--brand, #0f5c8c); box-shadow: 0 0 0 3px rgba(15, 92, 140, .12); }

/* 图片字段（Logo / 横幅）通用 */
.img-field { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.img-preview { max-width: 320px; max-height: 120px; border-radius: 8px; border: 1px solid var(--line, #e5e9ef); }
.img-actions { display: grid; gap: 8px; }
.img-tip { margin: 0; font-size: 12.5px; color: var(--muted, #6b7a89); }
.img-remove { font-weight: 400; }

/* 移动端：工具栏横向滚动、预览与源码竖向堆叠 */
@media (max-width: 640px) {
  .md-tools { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .md-tools .btn.sm { flex: 0 0 auto; height: 36px; }
  .mdl-textarea { min-height: 200px; padding: 12px; font-size: 13px; }
  .md-foot { flex-direction: column; align-items: flex-start; gap: 4px; }
}
