/* =========================================================
   原生富文本编辑器
   ========================================================= */
.ed-wrap { border: 1px solid var(--line-dark); border-radius: 8px; overflow: hidden; background: #fff; }
.ed-toolbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
    padding: 8px; background: #f7f8fa; border-bottom: 1px solid var(--line);
}
.ed-btn {
    padding: 5px 10px; border: 1px solid var(--line-dark); background: #fff; color: var(--text-mid);
    border-radius: 5px; font-size: 13px; cursor: pointer; line-height: 1.4; font-family: inherit;
}
.ed-btn:hover { background: #eef1f4; color: var(--primary); border-color: var(--accent); }
.ed-status { margin-left: auto; color: #2f7a3d; font-size: 12px; }

.ed-panel { max-height: 240px; overflow-y: auto; padding: 10px; background: #fafbfc; border-bottom: 1px solid var(--line); }
.ed-emoji-group { margin-bottom: 8px; }
.ed-emoji-title { font-size: 12px; color: var(--text-light); margin-bottom: 4px; }
.ed-emoji-row { display: flex; flex-wrap: wrap; gap: 2px; }
.ed-emoji { border: none; background: transparent; font-size: 20px; line-height: 1; cursor: pointer; padding: 3px; border-radius: 5px; }
.ed-emoji:hover { background: #eef1f4; }
.ed-panel-sticker { display: flex; flex-wrap: wrap; gap: 4px; }
.ed-sticker { border: 1px solid transparent; background: transparent; padding: 3px; cursor: pointer; border-radius: 6px; line-height: 0; }
.ed-sticker:hover { background: #eef1f4; border-color: var(--line-dark); }
.ed-sticker img { width: 40px; height: 40px; object-fit: contain; }

.ed-content {
    min-height: 320px; max-height: 640px; overflow-y: auto; padding: 16px;
    font-size: 15px; line-height: 1.9; color: var(--text); outline: none;
}
.ed-content:focus { background: #fff; }
.ed-content img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; margin: 8px 0; }
.ed-content img[src*="/uploads/sticker/"] { width: 42px; height: 42px; border: none; border-radius: 0; margin: 0 2px; vertical-align: middle; }
.ed-content h2, .ed-content h3 { color: var(--primary); margin: 18px 0 10px; }
.ed-content p { margin: 0 0 12px; }
.ed-content a { color: #2f6db3; text-decoration: underline; }
.ed-source {
    width: 100%; min-height: 320px; padding: 14px; border: none; outline: none;
    font-family: Consolas, Monaco, monospace; font-size: 13px; line-height: 1.6; box-sizing: border-box;
}

@media (max-width: 720px) {
    .ed-btn { padding: 5px 8px; font-size: 12px; }
    .ed-sticker img { width: 34px; height: 34px; }
}

/* 封面上传预览 */
.cover-preview { position: relative; display: inline-block; margin-top: 10px; }
.cover-preview img { max-width: 240px; max-height: 160px; border: 1px solid var(--line-dark); border-radius: 8px; display: block; }
.cover-remove { position: absolute; top: 6px; right: 6px; padding: 3px 10px; font-size: 12px; border: none; border-radius: 4px; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; }
.cover-remove:hover { background: #b23b3b; }
