/* 内置富文本编辑器样式 */
.editor { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card-2); }
.editor-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 7px 8px; background: var(--card); border-bottom: 1px solid var(--line);
}
.tb-group { display: flex; gap: 2px; align-items: center; }
.tb-group.tb-right { margin-left: auto; }
.editor-toolbar button {
  min-width: 30px; height: 30px; padding: 0 8px; background: transparent; border: 1px solid transparent;
  border-radius: 7px; color: var(--text-2); cursor: pointer; font: inherit; font-size: 13px;
}
.editor-toolbar button:hover { background: var(--card-2); color: var(--text); border-color: var(--line); }
.editor-toolbar button.active { background: var(--primary); color: #fff; }
.editor-body { position: relative; }
.editor-area, .editor-md, .editor-html {
  min-height: 240px; max-height: 620px; overflow-y: auto; padding: 14px 16px;
  font-size: 14.5px; line-height: 1.75; outline: none; color: var(--text);
}
.editor.compact .editor-area, .editor.compact .editor-md, .editor.compact .editor-html { min-height: 130px; }
.editor-area:empty:before { content: attr(data-placeholder); color: var(--text-3); pointer-events: none; }
.editor-md, .editor-html {
  display: block; width: 100%; border: 0; background: transparent; resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px;
}
.editor-md:focus, .editor-html:focus { outline: none; }
.editor-status { padding: 6px 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); background: var(--card); }
.editor-status b { color: var(--text-2); }

.emoji-panel {
  position: absolute; z-index: 40; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px; width: 320px; max-height: 280px; overflow: auto;
}
.emoji-panel .ep-title { font-size: 12px; color: var(--text-3); margin: 0 0 6px; }
.emoji-panel .ep-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; margin-bottom: 10px; }
.emoji-panel button { background: none; border: 0; font-size: 20px; cursor: pointer; border-radius: 7px; padding: 3px; line-height: 1; }
.emoji-panel button:hover { background: var(--card-2); }

.upload-progress { height: 3px; background: var(--primary); width: 0; transition: width .2s; }
.editor-area img { max-width: 100%; border-radius: 6px; }
.editor-area:focus { background: color-mix(in srgb, var(--card-2) 60%, var(--card)); }
.editor.drag-over { outline: 2px dashed var(--primary); outline-offset: -4px; }
.wp-insert { display: inline-flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; margin: 4px; font-size: 12px; }
.wp-insert img { width: 46px; height: 46px; object-fit: cover; border-radius: 6px; }
