/* 文章内容中的图片居中样式 */
.view-article-main{
    padding-top: 60px;
}

.rich-text img {
    display: block;
    margin: 20px auto;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    /* box-shadow: 0 2px 8px rgba(0,0,0,0.1); */
}

.rich-text p {
    text-align: justify;
    line-height: 1.8;
    margin-bottom: 16px;
    /* 取消段落缩进，覆盖可能的全局样式 */
    text-indent: 0 !important;
    margin-left: 0 !important;
}

.rich-text figure {
    text-align: center;
    margin: 20px 0;
}

.rich-text figure img {
    margin: 0 auto;
}

/* 修复文章内容中的标题样式（h1、h2、h3 不同层级的展示） */
.rich-text h1,
.rich-text h2,
.rich-text h3,
.rich-text h4,
.rich-text h5,
.rich-text h6 {
    color: #222;
    word-break: break-word;
}

.rich-text h1 {
    font-size: 28px;
    line-height: 1.35;
    font-weight: 700;
    margin: 24px 0 12px;
}

.rich-text h2 {
    font-size: 24px;
    line-height: 1.4;
    font-weight: 700;
    margin: 22px 0 10px;
}

.rich-text h3 {
    font-size: 20px;
    line-height: 1.45;
    font-weight: 600;
    margin: 20px 0 8px;
}

/* 标题后的首段留出更紧凑的间距 */
.rich-text h1 + p,
.rich-text h2 + p,
.rich-text h3 + p {
    margin-top: 8px;
}

/* 防止固定头部遮挡锚点跳转位置 */
.view-article-main .rich-text h1,
.view-article-main .rich-text h2,
.view-article-main .rich-text h3 {
    scroll-margin-top: 70px;
}

/* 移动端字号适配 */
@media (max-width: 768px) {
    .rich-text h1 { font-size: 22px; }
    .rich-text h2 { font-size: 20px; }
    .rich-text h3 { font-size: 18px; }
}

/* 引言块 */
.rich-text blockquote {
    position: relative;
    padding: 12px 16px 12px 40px;
    margin: 20px 0;
    border-left: 4px solid #e5e5e5;
    background: #f9fafb;
    font-weight: 500;
    color: #222;
}

.rich-text blockquote::before {
    content: "";
    display: inline-block;
    position: absolute;
    left: 12px;
    top: 3px;
    height: 14px;
    width: 18px;
    margin-top: 10px;
    background-image: url(/static/icons/quote.png);
    background-repeat: no-repeat;
    background-size: contain;
}

.rich-text blockquote p {
    margin: 0;
    text-indent: 0 !important;
    margin-left: 0 !important;
}