/**
 * 富文本编辑器内容样式
 */

/* 基础样式 */
.rich-content {
    font-family: 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

/* 段落样式 */
.rich-content p {
    margin-bottom: 1em;
    text-indent: 2em;
}

/* 标题样式 */
.rich-content h1 {
    font-size: 24px;
    font-weight: bold;
    color: #1a1a1a;
    margin: 20px 0 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007bff;
}

.rich-content h2 {
    font-size: 20px;
    font-weight: bold;
    color: #2a2a2a;
    margin: 18px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.rich-content h3 {
    font-size: 18px;
    font-weight: bold;
    color: #3a3a3a;
    margin: 15px 0 10px;
}

.rich-content h4 {
    font-size: 16px;
    font-weight: bold;
    color: #4a4a4a;
    margin: 12px 0 8px;
}

/* 富文本编辑器容器样式 */
.rich-editor-container {
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    margin: 10px 0;
}

/* 工具栏样式 */
.rich-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 8px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #ddd;
    border-radius: 4px 4px 0 0;
}

.toolbar-group {
    display: flex;
    gap: 3px;
    padding: 0 5px;
    border-right: 1px solid #ddd;
}

.toolbar-group:last-child {
    border-right: none;
}

.toolbar-btn {
    padding: 6px 12px;
    border: 1px solid #ccc;
    background-color: #fff;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    white-space: nowrap;
}

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

.toolbar-btn:active,
.toolbar-btn.active {
    background-color: #007bff;
    color: #fff;
    border-color: #0056b3;
}

.toolbar-select {
    padding: 6px 10px;
    border: 1px solid #ccc;
    background-color: #fff;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
}

/* 编辑器内容区域 */
.rich-editor-content {
    padding: 12px;
    min-height: 200px;
    max-height: 600px;
    overflow-y: auto;
    outline: none;
    line-height: 1.6;
    font-family: 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
    font-size: 14px;
}

.rich-editor-content:focus {
    box-shadow: inset 0 0 3px rgba(0, 123, 255, 0.25);
}

/* 占位符样式 */
.rich-editor-content:empty:before {
    content: attr(data-placeholder);
    color: #aaa;
    pointer-events: none;
}

/* 编辑器内图片样式 */
.rich-editor-content img {
    max-width: 100%;
    height: auto;
    margin: 10px 0;
    border-radius: 4px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .rich-editor-toolbar {
        padding: 5px;
    }

    .toolbar-group {
        padding: 0 3px;
    }

    .toolbar-btn {
        padding: 5px 8px;
        font-size: 12px;
    }

    .rich-editor-content {
        padding: 10px;
        min-height: 150px;
    }
}

.rich-content h5, .rich-content h6 {
    font-size: 14px;
    font-weight: bold;
    color: #5a5a5a;
    margin: 10px 0 6px;
}

/* 列表样式 */
.rich-content ul, .rich-content ol {
    margin: 1em 0;
    padding-left: 2em;
}

.rich-content ul {
    list-style-type: disc;
}

.rich-content ol {
    list-style-type: decimal;
}

.rich-content li {
    margin-bottom: 0.5em;
}

/* 链接样式 */
.rich-content a {
    color: #007bff;
    text-decoration: none;
}

.rich-content a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* 图片样式 */
.rich-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 10px 0;
}

/* 表格样式 */
.rich-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

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

.rich-content th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.rich-content tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* 引用样式 */
.rich-content blockquote {
    border-left: 4px solid #007bff;
    padding: 10px 20px;
    margin: 1em 0;
    background-color: #f8f9fa;
    font-style: italic;
    color: #666;
}

/* 代码样式 */
.rich-content code {
    background-color: #f4f4f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
}

.rich-content pre {
    background-color: #1a1a1a;
    color: #fff;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1em 0;
}

.rich-content pre code {
    background-color: transparent;
    padding: 0;
    color: #fff;
}

/* 强调样式 */
.rich-content strong, .rich-content b {
    font-weight: bold;
    color: #1a1a1a;
}

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

/* 分隔线样式 */
.rich-content hr {
    border: none;
    border-top: 1px solid #ddd;
    margin: 20px 0;
}

/* 对齐样式 */
.rich-content .align-left {
    text-align: left;
}

.rich-content .align-center {
    text-align: center;
}

.rich-content .align-right {
    text-align: right;
}

.rich-content .align-justify {
    text-align: justify;
}

/* 图文混排样式 */
.rich-content .float-left {
    float: left;
    margin-right: 15px;
    margin-bottom: 10px;
}

.rich-content .float-right {
    float: right;
    margin-left: 15px;
    margin-bottom: 10px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .rich-content {
        font-size: 14px;
        line-height: 1.6;
    }
    
    .rich-content h1 {
        font-size: 20px;
    }
    
    .rich-content h2 {
        font-size: 18px;
    }
    
    .rich-content h3 {
        font-size: 16px;
    }
    
    .rich-content img {
        border-radius: 4px;
    }
    
    .rich-content table {
        font-size: 13px;
    }
    
    .rich-content th, .rich-content td {
        padding: 6px 8px;
    }
}

@media (max-width: 480px) {
    .rich-content {
        font-size: 13px;
    }
    
    .rich-content h1 {
        font-size: 18px;
        margin: 15px 0 10px;
    }
    
    .rich-content h2 {
        font-size: 16px;
        margin: 12px 0 8px;
    }
    
    .rich-content blockquote {
        padding: 8px 15px;
        margin: 10px 0;
    }
}

/* Editor.js 编辑器容器样式 */
#editor-container {
    margin-top: 10px;
}

.editor-js-container {
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    min-height: 300px;
    padding: 10px;
}

.editor-js-container:focus {
    outline: none;
    border-color: #007bff;
}

/* Editor.js 工具栏样式 */
.codex-editor__toolbar {
    background-color: #f8f9fa;
    border-bottom: 1px solid #ddd;
    padding: 8px;
}

/* Editor.js 内容区域样式 */
.codex-editor__redactor {
    padding: 10px;
}

/* Editor.js 块级元素样式 */
.ce-block__content {
    max-width: 100%;
}

.ce-paragraph {
    font-family: 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.8;
    color: #333;
}

.ce-header {
    font-family: 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
    font-weight: bold;
    color: #333;
}

/* Editor.js 图片样式 */
.ce-block--image .ce-block__content {
    max-width: 100%;
}

.ce-block--image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Editor.js 列表样式 */
.cdx-list {
    font-family: 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.8;
    color: #333;
}

/* Editor.js 占位符样式 */
.ce-placeholder {
    color: #aaa;
    font-style: italic;
}
