/* ============================================================
   小辰园区 · 富文本编辑器样式（rich-editor.js 配套，MC百科风格）
   前后台通用：前台 MC 主题 / 后台 Bootstrap 主题下均正常显示
   ============================================================ */

.xc-editor {
    border: 2px solid #2b2b31;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* ---------- 工具栏 ---------- */
.xc-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    background: linear-gradient(180deg, #3a3a42 0%, #2b2b31 100%);
    border-bottom: 2px solid #1d1d21;
}

.xc-editor-btn {
    min-width: 30px;
    height: 30px;
    padding: 0 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #55555e;
    border-radius: 4px;
    background: #44444d;
    color: #e8e8ef;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    transition: background .12s, color .12s, transform .08s;
}
.xc-editor-btn i { font-size: 0.95rem; }
.xc-editor-btn:hover {
    background: #5EBD3E;
    border-color: #3E8E2A;
    color: #fff;
    box-shadow: inset 1px 1px 0 rgba(255,255,255,.35), inset -1px -1px 0 rgba(0,0,0,.35);
}
.xc-editor-btn:active { transform: translateY(1px); }

.xc-editor-sep {
    width: 1px;
    height: 22px;
    margin: 0 6px;
    background: #56565e;
}

/* ---------- 编辑区 ---------- */
.xc-editor-area {
    min-height: 260px;
    max-height: 640px;
    overflow-y: auto;
    padding: 16px 18px;
    background: #fff;
    color: #24292f;
    font-size: 0.95rem;
    line-height: 1.8;
    outline: none;
    word-break: break-word;
}
.xc-editor-area:focus { background: #fdfffd; }

.xc-editor-area:empty::before {
    content: attr(data-placeholder);
    color: #9aa0a6;
    pointer-events: none;
}

/* 编辑区内容排版（输出与编辑保持一致观感） */
.xc-editor-area h2,
.article-content h2 { font-size: 1.45rem; font-weight: 800; margin: 0.9em 0 0.5em; line-height: 1.4; }
.xc-editor-area h3,
.article-content h3 { font-size: 1.25rem; font-weight: 700; margin: 0.8em 0 0.4em; }
.xc-editor-area h4,
.article-content h4 { font-size: 1.08rem; font-weight: 700; margin: 0.7em 0 0.35em; }
.xc-editor-area p { margin: 0.45em 0; }
.xc-editor-area blockquote {
    margin: 0.8em 0;
    padding: 8px 14px;
    border-left: 4px solid #5EBD3E;
    background: #f0f7ec;
    color: #374151;
    border-radius: 0 6px 6px 0;
}
.xc-editor-area pre {
    margin: 0.8em 0;
    padding: 12px 14px;
    background: #1d1d21;
    color: #7ED957;
    border-radius: 6px;
    font-size: 0.86rem;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
}
.xc-editor-area ul,
.xc-editor-area ol { padding-left: 1.6em; margin: 0.5em 0; }
.xc-editor-area ul li { list-style: disc; }
.xc-editor-area ol li { list-style: decimal; }
.xc-editor-area a { color: #2f7d32; text-decoration: underline; }
.xc-editor-area img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 6px 0;
    border: 1px solid #e5e7eb;
}
.xc-editor-area hr {
    border: none;
    border-top: 2px dashed #d1d5db;
    margin: 1.2em 0;
}

/* ---------- 底栏 ---------- */
.xc-editor-footer {
    display: flex;
    justify-content: flex-end;
    padding: 4px 12px;
    background: #f6f8fa;
    border-top: 1px solid #e5e7eb;
    color: #6b7280;
    font-size: 0.78rem;
}

/* 后台浅色环境微调（admin-content 内） */
.admin .xc-editor { border-color: #c9ccd4; }
.admin .xc-editor-toolbar {
    background: linear-gradient(180deg, #f3f4f6 0%, #e9ebef 100%);
    border-bottom: 1px solid #c9ccd4;
}
.admin .xc-editor-btn {
    border-color: #c3c7cf;
    background: #fff;
    color: #374151;
}
.admin .xc-editor-btn:hover {
    background: #5EBD3E;
    border-color: #3E8E2A;
    color: #fff;
}
.admin .xc-editor-sep { background: #c9ccd4; }
