/* 文章/公告等富文本正文：防止大图撑破页面 */
.blog-content,
.blog-post,
.article-body {
    max-width: 100%;
    overflow-x: hidden;
    overflow-wrap: break-word;
    word-wrap: break-word;
    box-sizing: border-box;
}

.article-body *,
.blog-post .article-body * {
    max-width: 100%;
    box-sizing: border-box;
}

.article-body img,
.blog-post img,
.blog-content img,
.article-body p img,
.article-body div img,
.article-body figure img,
.article-body span img,
.article-body a img {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* 编辑器常带 width 属性或内联 width，强制按容器缩放 */
.article-body img[width],
.article-body img[style] {
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
}

.article-body video,
.article-body iframe,
.article-body embed,
.article-body object {
    max-width: 100% !important;
    height: auto;
}

.article-body table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed;
    display: block;
    overflow-x: auto;
}

.article-body pre {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
}

/* 商品详情 / 购买提示等富文本 */
.buy-product,
.buy-product .card-body,
.modal-body {
    max-width: 100%;
    overflow-x: hidden;
    overflow-wrap: break-word;
}

.buy-product img,
.buy-product .card-body img,
.modal-body img,
.buy-product iframe,
.modal-body iframe {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
}

.buy-product img[width],
.buy-product img[style],
.modal-body img[width],
.modal-body img[style] {
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
}
