/*
 * 项目长文在编辑器、发布预览、PC 详情和移动详情之间共用的正文样式。
 */
.ibrief-rich-text {
    --rich-text-font-size: 16px;
    --rich-text-line-height: 1.8;
    min-width: 0;
    color: #34383f;
    font-size: var(--rich-text-font-size);
    line-height: var(--rich-text-line-height);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.ibrief-rich-text--mobile {
    --rich-text-font-size: 14px;
}

.ibrief-rich-text--editor {
    padding: 8px;
}

.ibrief-rich-text > :first-child {
    margin-top: 0;
}

.ibrief-rich-text > :last-child {
    margin-bottom: 0;
}

.ibrief-rich-text p,
.ibrief-rich-text div {
    margin-top: 0;
    margin-bottom: 1em;
}

.ibrief-rich-text h1,
.ibrief-rich-text h2,
.ibrief-rich-text h3,
.ibrief-rich-text h4,
.ibrief-rich-text h5,
.ibrief-rich-text h6 {
    margin-top: 1.35em;
    margin-bottom: .55em;
    color: inherit;
    font-weight: 600;
    line-height: 1.4;
}

.ibrief-rich-text h1 {
    font-size: 2em;
}

.ibrief-rich-text h2 {
    font-size: 1.65em;
}

.ibrief-rich-text h3 {
    font-size: 1.35em;
}

.ibrief-rich-text h4 {
    font-size: 1.2em;
}

.ibrief-rich-text h5 {
    font-size: 1.1em;
}

.ibrief-rich-text h6 {
    font-size: 1em;
}

.ibrief-rich-text ul,
.ibrief-rich-text ol {
    margin-top: .75em;
    margin-bottom: 1em;
    padding-left: 2em;
}

.ibrief-rich-text li {
    margin-bottom: .35em;
}

/*
 * UEditor 的自定义列表依赖类名表达编号类型，这里使用本地 marker 保持跨端一致。
 */
.ibrief-rich-text .list-paddingleft-1 {
    padding-left: 0;
}

.ibrief-rich-text .list-paddingleft-2 {
    padding-left: 2em;
}

.ibrief-rich-text .list-paddingleft-3 {
    padding-left: 4em;
}

.ibrief-rich-text ol.custom_cn > li::marker,
.ibrief-rich-text ol.custom_cn1 > li::marker {
    content: counter(list-item, cjk-ideographic) "、";
}

.ibrief-rich-text ol.custom_cn2 > li::marker {
    content: "（" counter(list-item, cjk-ideographic) "）";
}

.ibrief-rich-text ol.custom_num > li::marker {
    content: counter(list-item, decimal) ". ";
}

.ibrief-rich-text ol.custom_num1 > li::marker {
    content: counter(list-item, decimal) ") ";
}

.ibrief-rich-text ol.custom_num2 > li::marker {
    content: "(" counter(list-item, decimal) ") ";
}

.ibrief-rich-text ul.custom_dash {
    list-style-type: "—  ";
}

.ibrief-rich-text ul.custom_dot {
    list-style-type: "•  ";
}

.ibrief-rich-text blockquote {
    margin: 1em 0;
    padding: .65em 1em;
    border-left: 4px solid #cfd8e6;
    background: #f7f9fc;
    color: #596273;
}

.ibrief-rich-text a {
    color: #1677ff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ibrief-rich-text img,
.ibrief-rich-text video {
    display: block;
    width: auto;
    max-width: 100% !important;
    height: auto !important;
    margin: 1em auto;
}

.ibrief-rich-text table {
    display: block;
    width: max-content;
    max-width: 100%;
    margin: 1em 0;
    border-collapse: collapse;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ibrief-rich-text caption {
    padding: .5em;
    font-weight: 600;
    text-align: left;
}

.ibrief-rich-text th,
.ibrief-rich-text td {
    min-width: 5em;
    padding: .55em .75em;
    border: 1px solid #d9dde3;
    background: #fff;
    text-align: left;
    vertical-align: top;
}

.ibrief-rich-text th {
    background: #f7f8fa;
    font-weight: 600;
}

.ibrief-rich-text hr {
    margin: 1.5em 0;
    border: 0;
    border-top: 1px solid #e1e5eb;
}

@media (max-width: 639px) {
    .ibrief-rich-text {
        --rich-text-font-size: 14px;
    }

    .ibrief-rich-text table {
        font-size: 13px;
    }
}
