/* ===== 富文本编辑器样式（前缀 ne- ，避免全局污染）===== */
.ne-wrap {
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: #333;
}
.ne-toolbar {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
  padding: 6px; border: 1px solid #ddd; border-bottom: none;
  background: #f7f7f7; border-radius: 6px 6px 0 0;
}
.ne-toolbar button,
.ne-toolbar select {
  padding: 4px 8px; border: 1px solid #ccc; background: #fff;
  border-radius: 4px; cursor: pointer; font-size: 14px; line-height: 1.4;
  color: inherit;
}
.ne-toolbar button:hover { background: #eaeaea; }
.ne-toolbar button.active { background: #d0e2ff; border-color: #7aa7e0; }
.ne-toolbar .ne-sep { width: 1px; height: 20px; background: #ddd; margin: 0 4px; }
.ne-toolbar label { display: flex; align-items: center; gap: 2px; font-size: 13px; }
.ne-toolbar input[type="color"] {
  width: 28px; height: 26px; border: none; padding: 0; cursor: pointer; background: none;
}
.ne-editor {
  min-height: 320px; padding: 12px; border: 1px solid #ddd;
  border-radius: 0 0 6px 6px; outline: none; line-height: 1.7;
  overflow-y: auto; background: #fff; word-wrap: break-word;
}
.ne-wrap.ne-focus .ne-editor { border-color: #7aa7e0; }
.ne-editor:empty::before {
  content: attr(data-placeholder); color: #aaa; pointer-events: none;
}
.ne-editor img { max-width: 100%; height: auto; }
.ne-editor video, .ne-editor iframe { max-width: 100%; border: 0; }
.ne-editor blockquote {
  border-left: 3px solid #ccc; margin: 8px 0; padding-left: 12px; color: #666;
}
.ne-editor a { color: #1a73e8; }
.ne-status {
  margin-top: 8px; color: #888; font-size: 13px; min-height: 18px;
}

/* ===== 源码编辑 / HTML 视图 ===== */
.ne-source {
  display: none;
  box-sizing: border-box;
  width: 100%;
  min-height: 320px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 0 0 6px 6px;
  outline: none;
  background: #fff;
  color: #333;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.6;
  tab-size: 2;
  resize: vertical;
  overflow: auto;
}
.ne-source:focus { border-color: #7aa7e0; }
.ne-wrap.ne-source-mode .ne-editor { display: none; }
.ne-wrap.ne-source-mode .ne-source { display: block; }
/* 源码模式下只保留「源码」「全屏」两个按钮 */
.ne-wrap.ne-source-mode .ne-toolbar > *:not([data-action="source"]):not([data-action="fullscreen"]) {
  display: none !important;
}

/* ===== 全屏模式 ===== */
.ne-wrap.ne-fullscreen {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 2050;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: 10px;
  background: #fff;
}
.ne-wrap.ne-fullscreen .ne-toolbar { flex: 0 0 auto; }
.ne-wrap.ne-fullscreen .ne-editor {
  flex: 1 1 auto;
  min-height: 0 !important;
  max-height: none !important;
  border-radius: 0;
}
.ne-wrap.ne-fullscreen .ne-source {
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 0;
}
.ne-wrap.ne-fullscreen .ne-status { flex: 0 0 auto; }
/* 全屏时锁住背景页面滚动（模态框自身已由 .modal-open 锁住） */
body.ne-fullscreen-open { overflow: hidden !important; }