
/* ===== 富文本正文：与后台 CKEditor 编辑器默认内容样式（.ck-content）保持一致 ===== */
.editor-wrap { color: #37474f; font-size: 14px; line-height: 1.9; overflow-wrap: anywhere;word-wrap: break-word;}
.editor-wrap * {
    max-width: 100%!important;
    box-sizing: border-box!important;
    -webkit-box-sizing: border-box!important;
    word-break: break-all!important;
    word-wrap: break-word!important;
}
/* 浮动图片后的清浮动，避免影响后续段落 */
.editor-wrap::after { content: ''; display: block; clear: both; }

/* 段落与标题 */
.editor-wrap p { margin: 0 0 1em; }
.editor-wrap > *:first-child { margin-top: 0; }
.editor-wrap > *:last-child { margin-bottom: 0; }
.editor-wrap h1, .editor-wrap h2, .editor-wrap h3,
.editor-wrap h4, .editor-wrap h5, .editor-wrap h6 {
    margin: 1.4em 0 .6em;
    color: #263238;
    font-weight: 600;
    line-height: 1.4;
}
.editor-wrap h1 { font-size: 1.8em; }
.editor-wrap h2 { font-size: 1.5em; }
.editor-wrap h3 { font-size: 1.3em; }
.editor-wrap h4 { font-size: 1.15em; }
.editor-wrap h5 { font-size: 1.05em; }
.editor-wrap h6 { font-size: 1em; color: #546e7a; }

/* 行内文本样式 */
.editor-wrap strong, .editor-wrap b { font-weight: 600; }
.editor-wrap a { color: var(--primary-blue); text-decoration: underline; }
.editor-wrap a:hover { color: #0e42b3; }
.editor-wrap a.styled-link { text-decoration: none; border-bottom: 1px solid currentColor; }
.editor-wrap sup, .editor-wrap sub { font-size: .75em; line-height: 1; }

/* 列表：与编辑器一致的多级编号/符号 */
.editor-wrap ul, .editor-wrap ol { margin: 0 0 1em; padding-left: 2em; }
.editor-wrap li { margin-bottom: .3em; }
.editor-wrap li > ul, .editor-wrap li > ol { margin: .3em 0 0; }
.editor-wrap ul { list-style-type: disc; }
.editor-wrap ul ul { list-style-type: circle; }
.editor-wrap ul ul ul, .editor-wrap ul ul ul ul { list-style-type: square; }
.editor-wrap ol { list-style-type: decimal; }
.editor-wrap ol ol { list-style-type: lower-latin; }
.editor-wrap ol ol ol { list-style-type: lower-roman; }
.editor-wrap ol ol ol ol { list-style-type: upper-latin; }
.editor-wrap ol ol ol ol ol { list-style-type: upper-roman; }

/* 待办列表 */
.editor-wrap .todo-list { list-style: none; }
.editor-wrap .todo-list li { margin-bottom: 5px; }
.editor-wrap .todo-list .todo-list { margin-top: 5px; }
.editor-wrap .todo-list__label > input {
    -webkit-appearance: none;
    appearance: none;
    display: inline-block;
    position: relative;
    width: 16px;
    height: 16px;
    vertical-align: middle;
    border: 0;
    left: -25px;
    margin-right: -15px;
}
.editor-wrap .todo-list__label > input::before {
    display: block;
    position: absolute;
    box-sizing: border-box;
    content: '';
    width: 100%;
    height: 100%;
    border: 1px solid hsl(0, 0%, 20%);
    border-radius: 2px;
}
.editor-wrap .todo-list__label > input::after {
    display: block;
    position: absolute;
    box-sizing: content-box;
    content: '';
    left: calc(16px / 3);
    top: calc(16px / 5.3);
    width: calc(16px / 5.3);
    height: calc(16px / 2.6);
    border-style: solid;
    border-color: transparent;
    border-width: 0 calc(16px / 8) calc(16px / 8) 0;
    transform: rotate(45deg);
}
.editor-wrap .todo-list__label > input[checked]::before {
    background: hsl(126, 64%, 41%);
    border-color: hsl(126, 64%, 41%);
}
.editor-wrap .todo-list__label > input[checked]::after { border-color: hsl(0, 0%, 100%); }
.editor-wrap .todo-list__label__description { vertical-align: middle; }

/* 引用 */
.editor-wrap blockquote {
    overflow: hidden;
    margin: 1em 0;
    padding: 0 1.5em;
    font-style: italic;
    color: #546e7a;
    border-left: 5px solid hsl(0, 0%, 80%);
}

/* 行内代码与代码块 */
.editor-wrap code {
    padding: .15em;
    border-radius: 2px;
    background-color: hsla(0, 0%, 78%, 0.3);
    font-family: Menlo, Consolas, Monaco, "Courier New", monospace;
    font-size: .9em;
}
.editor-wrap pre {
    padding: 1em;
    margin: 1em 0;
    color: hsl(0, 0%, 20.8%);
    background: hsla(0, 0%, 78%, 0.3);
    border: 1px solid hsl(0, 0%, 77%);
    border-radius: 2px;
    text-align: left;
    tab-size: 4;
    white-space: pre-wrap;
    overflow-x: auto;
}
.editor-wrap pre code { padding: 0; background: none; border-radius: 0; }

/* 分割线 */
.editor-wrap hr { margin: 15px 0; height: 4px; background: hsl(0, 0%, 87%); border: 0; }

/* 表格（编辑器输出为 <figure class="table"><table>…） */
.editor-wrap .table { display: table; margin: .9em auto; }
.editor-wrap .table table {
    width: 100%;
    height: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    border: 1px double hsl(0, 0%, 70%);
}
.editor-wrap .table td, .editor-wrap .table th {
    min-width: 2em;
    padding: .4em;
    border: 1px solid hsl(0, 0%, 75%);
}
.editor-wrap .table th { font-weight: bold; background: hsla(0, 0%, 0%, 5%); text-align: left; }
.editor-wrap .table > figcaption {
    display: table-caption;
    caption-side: top;
    padding: .6em;
    font-size: .75em;
    text-align: center;
    color: hsl(0, 0%, 20%);
    background-color: hsl(0, 0%, 97%);
}

/* 图片（<figure class="image"> / 行内图片 / 对齐样式 / 缩放后样式） */
.editor-wrap .image { display: table; clear: both; margin: .9em auto; min-width: 50px; text-align: center; }
.editor-wrap .image img { display: block; margin: 0 auto; max-width: 100%; }
.editor-wrap .image > figcaption {
    display: table-caption;
    caption-side: bottom;
    padding: .6em;
    font-size: .75em;
    color: hsl(0, 0%, 20%);
    background-color: hsl(0, 0%, 97%);
}
.editor-wrap .image-inline { display: inline-flex; align-items: flex-start; max-width: 100%; }
.editor-wrap .image-inline picture, .editor-wrap .image-inline img { flex-grow: 1; flex-shrink: 1; max-width: 100%; }
.editor-wrap .image.image_resized { display: block; max-width: 100%; }
.editor-wrap .image.image_resized > figcaption { display: block; }
.editor-wrap .image-style-block-align-left,
.editor-wrap .image-style-block-align-right { max-width: calc(100% - 1.5em); }
.editor-wrap .image-style-align-left,
.editor-wrap .image-style-align-right { clear: none; }
.editor-wrap .image-style-side { float: right; margin-left: 1.5em; max-width: 50%; }
.editor-wrap .image-style-align-left { float: left; margin-right: 1.5em; }
.editor-wrap .image-style-align-center { margin-left: auto; margin-right: auto; }
.editor-wrap .image-style-align-right { float: right; margin-left: 1.5em; }
.editor-wrap .image-style-block-align-left { margin-left: 0; margin-right: auto; }
.editor-wrap .image-style-block-align-right { margin-right: 0; margin-left: auto; }
/* 模拟与上一段的 margin 合并（浮动元素不参与合并） */
.editor-wrap p + .image-style-align-left,
.editor-wrap p + .image-style-align-right,
.editor-wrap p + .image-style-side { margin-top: 0; }

/* 媒体嵌入（视频等） */
.editor-wrap .media { display: block; clear: both; margin: .9em 0; min-width: 15em; }
.editor-wrap .media iframe { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; }

/* 字号类（编辑器 fontSize 预设） */
.editor-wrap .text-tiny { font-size: .7em; }
.editor-wrap .text-small { font-size: .85em; }
.editor-wrap .text-big { font-size: 1.4em; }
.editor-wrap .text-huge { font-size: 1.8em; }

/* 高亮类（编辑器 highlight 配置项） */
.editor-wrap .marker-yellow { background-color: rgb(255, 255, 0); }
.editor-wrap .marker-green { background-color: rgb(0, 255, 0); }
.editor-wrap .marker-pink { background-color: rgb(255, 192, 203); }
.editor-wrap .marker-blue { background-color: rgb(173, 216, 230); }
.editor-wrap .pen-red { color: rgb(255, 0, 0); background-color: transparent; }
.editor-wrap .pen-green { color: rgb(0, 128, 0); background-color: transparent; }

/* 分页符 */
.editor-wrap .page-break {
    position: relative;
    clear: both;
    padding: 5px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.editor-wrap .page-break::after {
    content: '';
    position: absolute;
    border-bottom: 2px dashed hsl(0, 0%, 77%);
    width: 100%;
}
.editor-wrap .page-break__label {
    position: relative;
    z-index: 1;
    padding: .3em .6em;
    display: block;
    text-transform: uppercase;
    border: 1px solid hsl(0, 0%, 77%);
    border-radius: 2px;
    font-family: Helvetica, Arial, Tahoma, Verdana, Sans-Serif;
    font-size: .75em;
    font-weight: bold;
    color: hsl(0, 0%, 20%);
    background: hsl(0, 0%, 100%);
}

/* 移动端：表格可横向滚动，浮动图片改为独占一行居中 */
@media (max-width: 768px) {
    .editor-wrap { font-size: 13px; line-height: 1.8; }
    .editor-wrap .table { display: block; overflow-x: auto; }
    .editor-wrap .image-style-side,
    .editor-wrap .image-style-align-left,
    .editor-wrap .image-style-align-right {
        float: none;
        max-width: 100%;
        margin: .9em auto;
    }
}