/**
 * 富文本编辑器内容显示样式
 * 用于前台展示后台编辑的内容
 */

/* 基础容器样式 */
.editor-content {
    font-size: 14px;
    line-height: 1.8;
    color: #374151;
    word-wrap: break-word;
    word-break: break-word;
}

/* 标题样式 */
.editor-content h1,
.editor-content h2,
.editor-content h3,
.editor-content h4,
.editor-content h5,
.editor-content h6 {
    font-weight: 600;
    line-height: 1.4;
    margin-top: 24px;
    margin-bottom: 16px;
    color: #111827;
}

.editor-content h1 {
    font-size: 32px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 12px;
}

.editor-content h2 {
    font-size: 28px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 10px;
}

.editor-content h3 {
    font-size: 24px;
}

.editor-content h4 {
    font-size: 20px;
}

.editor-content h5 {
    font-size: 18px;
}

.editor-content h6 {
    font-size: 16px;
}

/* 段落样式 */
.editor-content p {
    margin: 16px 0;
    line-height: 1.8;
}

.editor-content p:first-child {
    margin-top: 0;
}

.editor-content p:last-child {
    margin-bottom: 0;
}

/* 文字格式 */
.editor-content strong,
.editor-content b {
    font-weight: 600;
    color: #111827;
}

.editor-content em,
.editor-content i {
    font-style: italic;
}

.editor-content u {
    text-decoration: underline;
}

.editor-content s,
.editor-content del {
    text-decoration: line-through;
    opacity: 0.7;
}

.editor-content code {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 2px 6px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    color: #e11d48;
}

/* 链接样式 */
.editor-content a {
    color: #3470ff;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
}

.editor-content a:hover {
    border-bottom-color: #3470ff;
}

/* 列表样式 */
.editor-content ul,
.editor-content ol {
    margin: 16px 0;
    padding-left: 28px;
}

.editor-content ul {
    list-style-type: disc;
}

.editor-content ol {
    list-style-type: decimal;
}

.editor-content li {
    margin: 8px 0;
    line-height: 1.8;
}

.editor-content ul ul,
.editor-content ol ul {
    list-style-type: circle;
    margin-top: 8px;
    margin-bottom: 8px;
}

.editor-content ul ul ul,
.editor-content ol ul ul {
    list-style-type: square;
}

.editor-content ol ol {
    list-style-type: lower-alpha;
    margin-top: 8px;
    margin-bottom: 8px;
}

/* 引用块样式 */
.editor-content blockquote {
    margin: 24px 0;
    padding: 16px 20px;
    border-left: 4px solid #3470ff;
    background: #f9fafb;
    color: #6b7280;
    font-style: italic;
}

.editor-content blockquote p {
    margin: 0;
}

/* 代码块样式 */
.editor-content pre {
    margin: 24px 0;
    padding: 16px;
    background: #1f2937;
    border-radius: 8px;
    overflow-x: auto;
    line-height: 1.6;
}

.editor-content pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: #f9fafb;
    font-size: 14px;
}

/* 分割线样式 */
.editor-content hr {
    margin: 32px 0;
    border: none;
    border-top: 2px solid #e5e7eb;
}

/* 图片样式 */
.editor-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 24px 0;
    display: block;
}

.editor-content img[style*="float:left"],
.editor-content img[align="left"] {
    float: left;
    margin: 8px 16px 8px 0;
}

.editor-content img[style*="float:right"],
.editor-content img[align="right"] {
    float: right;
    margin: 8px 0 8px 16px;
}

/* 表格样式 */
.editor-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.editor-content table thead {
    background: #f9fafb;
}

.editor-content table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #111827;
    border-bottom: 2px solid #e5e7eb;
}

.editor-content table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    color: #374151;
}

.editor-content table tr:last-child td {
    border-bottom: none;
}

.editor-content table tr:hover {
    background: #f9fafb;
}

/* 视频样式 */
.editor-content video {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 24px 0;
    display: block;
    background: #000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.editor-content video::-webkit-media-controls-panel {
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.5));
}

/* 视频容器 */
.editor-content .video-container {
    position: relative;
    width: 100%;
    margin: 24px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.editor-content .video-container video {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
}

/* 对齐方式 */
.editor-content [style*="text-align: left"],
.editor-content .align-left {
    text-align: left;
}

.editor-content [style*="text-align: center"],
.editor-content .align-center {
    text-align: center;
}

.editor-content [style*="text-align: right"],
.editor-content .align-right {
    text-align: right;
}

.editor-content [style*="text-align: justify"],
.editor-content .align-justify {
    text-align: justify;
}

/* 缩进样式 */
.editor-content [data-indent="1"] {
    padding-left: 2em;
}

.editor-content [data-indent="2"] {
    padding-left: 4em;
}

.editor-content [data-indent="3"] {
    padding-left: 6em;
}

/* 待办列表样式 */
.editor-content input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

/* 清除浮动 */
.editor-content::after {
    content: "";
    display: table;
    clear: both;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .editor-content {
        font-size: 14px;
    }
    
    .editor-content h1 {
        font-size: 24px;
    }
    
    .editor-content h2 {
        font-size: 22px;
    }
    
    .editor-content h3 {
        font-size: 20px;
    }
    
    .editor-content h4 {
        font-size: 18px;
    }
    
    .editor-content table {
        font-size: 13px;
    }
    
    .editor-content table th,
    .editor-content table td {
        padding: 8px 12px;
    }
    
    .editor-content img[style*="float:left"],
    .editor-content img[style*="float:right"],
    .editor-content img[align="left"],
    .editor-content img[align="right"] {
        float: none;
        margin: 16px 0;
    }
}

/* 深色模式 */
.dark .editor-content {
    color: #d1d5db;
}

.dark .editor-content h1,
.dark .editor-content h2,
.dark .editor-content h3,
.dark .editor-content h4,
.dark .editor-content h5,
.dark .editor-content h6 {
    color: #f9fafb;
}

.dark .editor-content h1,
.dark .editor-content h2 {
    border-bottom-color: #374151;
}

.dark .editor-content strong,
.dark .editor-content b {
    color: #f9fafb;
}

.dark .editor-content code {
    background: #374151;
    border-color: #4b5563;
    color: #fca5a5;
}

.dark .editor-content blockquote {
    background: #1f2937;
    border-left-color: #3470ff;
    color: #9ca3af;
}

.dark .editor-content pre {
    background: #111827;
}

.dark .editor-content pre code {
    color: #f9fafb;
}

.dark .editor-content hr {
    border-top-color: #374151;
}

.dark .editor-content table {
    background: #1f2937;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.dark .editor-content table thead {
    background: #111827;
}

.dark .editor-content table th {
    color: #f9fafb;
    border-bottom-color: #374151;
}

.dark .editor-content table td {
    color: #d1d5db;
    border-bottom-color: #374151;
}

.dark .editor-content table tr:hover {
    background: #111827;
}

