/**
 * 通用内容编辑器核心样式
 */

/* 编辑器容器 */
.content-editor-wrapper {
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 工具栏 */
.content-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 10px;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
}

.content-editor-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.content-editor-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.content-editor-btn:active {
    background: #dee2e6;
    transform: scale(0.95);
}

.content-editor-divider {
    width: 1px;
    height: 36px;
    background: #dee2e6;
    margin: 0 4px;
}

/* 编辑区域 */
.content-editor-content {
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
    padding: 20px;
    font-size: 15px;
    line-height: 1.8;
    color: #212529;
}

/* 可编辑区域（Bundle 使用） */
.content-editor-editable {
    min-height: 400px;
    padding: 20px;
    font-size: 15px;
    line-height: 1.8;
    color: #212529;
    outline: none;
}

.content-editor-content:empty:before,
.content-editor-editable:empty:before {
    content: attr(data-placeholder);
    color: #adb5bd;
    pointer-events: none;
    font-style: italic;
}

/* 聚焦状态 */
.content-editor-content:focus,
.content-editor-editable:focus {
    outline: none;
}

/* 内容样式 */
.content-editor-content h1,
.content-editor-editable h1 {
    font-size: 2em;
    font-weight: 700;
    margin: 1em 0 0.5em;
    color: #000;
    line-height: 1.3;
}

.content-editor-content h2,
.content-editor-editable h2 {
    font-size: 1.6em;
    font-weight: 600;
    margin: 0.8em 0 0.4em;
    color: #111;
    line-height: 1.4;
}

.content-editor-content h3,
.content-editor-editable h3 {
    font-size: 1.3em;
    font-weight: 600;
    margin: 0.6em 0 0.3em;
    color: #333;
    line-height: 1.5;
}

.content-editor-content p,
.content-editor-editable p {
    margin: 0.6em 0;
    /* text-indent: 2em; */
}

.content-editor-content ul,
.content-editor-content ol,
.content-editor-editable ul,
.content-editor-editable ol {
    margin: 0.8em 0;
    /* padding-left: 2em; */
}

.content-editor-content li,
.content-editor-editable li {
    margin: 0.3em 0;
}

.content-editor-content ul,
.content-editor-editable ul {
    list-style-type: disc;
}

.content-editor-content ol,
.content-editor-editable ol {
    list-style-type: decimal;
}

.content-editor-content a,
.content-editor-editable a {
    color: #007bff;
    text-decoration: underline;
}

.content-editor-content a:hover,
.content-editor-editable a:hover {
    color: #0056b3;
}

.content-editor-content img,
.content-editor-editable img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1em auto;
    border-radius: 4px;
}

.content-editor-content b,
.content-editor-content strong,
.content-editor-editable b,
.content-editor-editable strong {
    font-weight: 700;
}

.content-editor-content i,
.content-editor-content em,
.content-editor-editable i,
.content-editor-editable em {
    font-style: italic;
}

.content-editor-content u,
.content-editor-editable u {
    text-decoration: underline;
}

/* 表格样式 */
.content-editor-content table,
.content-editor-editable table {
    border-collapse: collapse;
    width: 100%;
    margin: 1em 0;
    border: 1px solid #ddd;
}

.content-editor-content table td,
.content-editor-content table th,
.content-editor-editable table td,
.content-editor-editable table th {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
}

.content-editor-content table th,
.content-editor-editable table th {
    background: #f8f9fa;
    font-weight: 600;
}

/* 滚动条 */
.content-editor-content::-webkit-scrollbar {
    width: 8px;
}

.content-editor-content::-webkit-scrollbar-track {
    background: #f1f3f5;
}

.content-editor-content::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 4px;
}

.content-editor-content::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* 响应式 */
@media (max-width: 768px) {
    .content-editor-toolbar {
        gap: 2px;
        padding: 6px;
    }

    .content-editor-btn {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
        padding: 0 8px;
    }

    .content-editor-content {
        padding: 15px;
        font-size: 14px;
    }
}
