/* MarkdownEditor 组件局部样式（类名前缀 md-*，避免污染工单主站 Element 风格） */

.md-editor {
  border: 1px solid #dcdfe6;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.md-editor.is-disabled { background: #f7f8fa; }

/* 顶部工具栏 */
.md-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 6px 8px;
  border-bottom: 1px solid #ebeef5;
  background: #fafbfc;
}
.md-tb-left, .md-tb-right { display: flex; flex-wrap: nowrap; align-items: center; gap: 1px; }
.md-tb-btn {
  min-width: 26px; height: 26px; padding: 0 5px;
  border: 0; border-radius: 4px; background: transparent;
  color: #606266; font-size: 12px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background-color .15s; white-space: nowrap;
}
.md-tb-btn:hover { background: #eef1f5; color: #303133; }
.md-tb-btn.md-tb-h { font-weight: 700; }
.md-tb-btn.md-tb-danger:hover { background: #fef0f0; color: #f56c6c; }
.md-tb-div { width: 1px; height: 16px; background: #dcdfe6; margin: 0 4px; }

.md-view-btn {
  min-width: 26px; height: 26px; padding: 0 5px; border: 1px solid transparent; border-radius: 4px;
  background: transparent; color: #606266; font-size: 12px; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center;
}
.md-view-btn.is-active { background: #ecf5ff; color: #2563eb; border-color: #b3d8ff; }
.md-view-switch { display: flex; background: #f0f2f5; border-radius: 4px; padding: 2px; gap: 2px; }

/* 主体：编辑 / 预览双栏 */
.md-editor-body { display: flex; overflow: hidden; }
.md-pane { overflow-y: auto; min-width: 0; }
.md-pane-editor { flex: 1; display: flex; border-right: 1px solid #ebeef5; }
.md-pane-editor.is-hidden, .md-pane-preview.is-hidden { display: none; }
.md-pane-preview { flex: 1; }

.md-lines {
  width: 38px; flex-shrink: 0; padding: 12px 6px 12px 0; text-align: right;
  font-family: 'JetBrains Mono', Consolas, Menlo, monospace; font-size: 13px;
  line-height: 1.65; color: #c0c4cc; background: #f7f8fa; overflow: hidden;
  border-right: 1px solid #f0f2f5; user-select: none;
}
.md-textarea {
  flex: 1; height: 100%; padding: 12px; border: 0; resize: none; outline: none;
  font-family: 'JetBrains Mono', Consolas, Menlo, monospace; font-size: 13.5px;
  line-height: 1.65; background: transparent; color: #303133; tab-size: 2;
}
.md-textarea:disabled { color: #909399; background: transparent; }

.md-preview { padding: 12px 16px; }

/* 底部状态栏 */
.md-editor-status {
  display: flex; gap: 16px; padding: 4px 12px; border-top: 1px solid #ebeef5;
  font-size: 12px; color: #909399; background: #fafbfc;
}

.md-hidden { display: none; }

/* ---------- 全屏大窗：可拖动位置、拖拽边框改大小 ---------- */
.md-big-mask { position: fixed; inset: 0; z-index: 3000; background: rgba(15, 23, 42, .28); }
.md-big-win {
  position: fixed; display: flex; flex-direction: column;
  background: #fff; border-radius: 10px; overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .3);
}
.md-big-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid #ebeef5;
  background: #fafbfc; cursor: move; user-select: none; flex-shrink: 0;
}
.md-big-title { font-size: 13.5px; font-weight: 600; color: #303133; }
.md-big-close { border: 0; background: transparent; font-size: 18px; line-height: 1; color: #909399; cursor: pointer; padding: 2px 8px; border-radius: 4px; }
.md-big-close:hover { background: #f0f2f5; color: #303133; }
.md-big-body { flex: 1; height: auto !important; }
.md-big-resize {
  position: absolute; right: 4px; bottom: 2px; width: 20px; height: 20px;
  cursor: nwse-resize; color: #c0c4cc; font-size: 15px; line-height: 20px; text-align: center;
}
.md-big-resize:hover { color: #2563eb; }

/* ---------- Markdown 预览排版（markdown-body） ---------- */
.markdown-body { line-height: 1.75; word-wrap: break-word; color: #303133; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
  font-weight: 600; margin: 1em 0 0.6em;
}
.markdown-body h1 { font-size: 1.5em; padding-bottom: 0.3em; border-bottom: 1px solid #ebeef5; }
.markdown-body h2 { font-size: 1.3em; padding-bottom: 0.25em; border-bottom: 1px solid #ebeef5; }
.markdown-body h3 { font-size: 1.15em; }
.markdown-body p { margin-bottom: 0.8em; }
.markdown-body a { color: #2563eb; text-decoration: underline; text-underline-offset: 2px; }
.markdown-body ul, .markdown-body ol { padding-left: 1.6em; margin-bottom: 0.8em; }
.markdown-body ul { list-style: disc; }
.markdown-body ol { list-style: decimal; }
.markdown-body li { margin-bottom: 0.25em; }
.markdown-body li > input[type="checkbox"] { margin-right: 0.5em; accent-color: #2563eb; }
.markdown-body blockquote {
  border-left: 4px solid #3b82f6; background: rgba(59,130,246,.06);
  padding: 0.6em 1em; margin-bottom: 0.8em; border-radius: 0 6px 6px 0; color: #606266;
}
.markdown-body code:not(pre code) {
  background: rgba(175,184,193,.2); padding: 0.2em 0.4em; border-radius: 4px;
  font-family: 'JetBrains Mono', Consolas, monospace; font-size: 0.875em; color: #e11d48;
}
.markdown-body pre {
  background: #f6f8fa; border: 1px solid #ebeef5; border-radius: 8px;
  padding: 1em; overflow-x: auto; margin-bottom: 0.8em;
}
.markdown-body pre code { font-family: 'JetBrains Mono', Consolas, monospace; font-size: 0.875em; background: transparent; padding: 0; }
.markdown-body table { width: 100%; border-collapse: collapse; margin-bottom: 0.8em; }
.markdown-body th, .markdown-body td { border: 1px solid #d1d5db; padding: 0.5em 0.85em; text-align: left; }
.markdown-body th { background: #f3f4f6; font-weight: 600; }
.markdown-body tr:nth-child(even) { background: rgba(243,244,246,.5); }
.markdown-body hr { border: 0; border-top: 1px solid #ebeef5; margin: 1.5em 0; }
.markdown-body img { max-width: 100%; border-radius: 8px; margin: 0.5em 0; }
