/*!
 * 博客专用编辑器 · 内容块样式
 *
 * 这份 CSS 同时用于两处：
 *   1. 前台文章页（插件通过 front_header / front_pjax_main_inner 注入）
 *   2. 后台编辑器内部（作为 TinyMCE content_style，写的时候即所见）
 *
 * 只依赖 class，不依赖任何主题变量；选择器都带 blog- 前缀，避免和主题冲突。
 */

/* ---------- 导语 ---------- */
.blog-lead {
    margin: 0 0 24px;
    padding: 16px 18px 16px 20px;
    border-left: 4px solid #4f46e5;
    background: #f6f7ff;
    border-radius: 0 8px 8px 0;
    font-size: 16px;
    line-height: 1.9;
    color: #3f4358;
}
.blog-lead p {
    margin: 0;
}

/* ---------- 引用 ---------- */
.blog-quote {
    margin: 22px 0;
    padding: 14px 20px;
    border-left: 3px solid #d0d5dd;
    background: #fafbfc;
    color: #4b5563;
    font-style: normal;
}
.blog-quote p {
    margin: 0;
}

/* ---------- 提示框 ---------- */
.blog-callout {
    margin: 22px 0;
    padding: 14px 18px;
    border: 1px solid #e4e7ec;
    border-radius: 10px;
    background: #f8fafc;
    font-size: 14.5px;
    line-height: 1.85;
}
.blog-callout__title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .02em;
}
.blog-callout__title::before {
    content: "i";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: #4f46e5;
}
.blog-callout__body p {
    margin: 0 0 8px;
}
.blog-callout__body p:last-child {
    margin-bottom: 0;
}

.blog-callout--tip {
    border-color: #bfdbfe;
    background: #eff6ff;
}
.blog-callout--tip .blog-callout__title {
    color: #1d4ed8;
}
.blog-callout--tip .blog-callout__title::before {
    content: "i";
    background: #2563eb;
}

.blog-callout--success {
    border-color: #bbf7d0;
    background: #f0fdf4;
}
.blog-callout--success .blog-callout__title {
    color: #15803d;
}
.blog-callout--success .blog-callout__title::before {
    content: "✓";
    background: #16a34a;
}

.blog-callout--warn {
    border-color: #fde68a;
    background: #fffbeb;
}
.blog-callout--warn .blog-callout__title {
    color: #b45309;
}
.blog-callout--warn .blog-callout__title::before {
    content: "!";
    background: #d97706;
}

.blog-callout--danger {
    border-color: #fecaca;
    background: #fef2f2;
}
.blog-callout--danger .blog-callout__title {
    color: #b91c1c;
}
.blog-callout--danger .blog-callout__title::before {
    content: "×";
    background: #dc2626;
}

/* ---------- 图片 + 图注 ---------- */
.blog-figure {
    margin: 26px 0;
    text-align: center;
}
.blog-figure img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(15, 23, 42, .08);
}
.blog-figure figcaption {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.7;
    color: #8a8f9c;
}
.blog-figure figcaption::before {
    content: "▲ ";
    font-size: 11px;
    opacity: .7;
}

/* ---------- 商品卡 ---------- */
.blog-goods-card {
    margin: 26px 0;
    border: 1px solid #e8eaef;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(15, 23, 42, .05);
    overflow: hidden;
    transition: box-shadow .2s ease, transform .2s ease;
}
.blog-goods-card:hover {
    box-shadow: 0 8px 24px rgba(15, 23, 42, .1);
}
.blog-goods-card__link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    color: inherit;
    text-decoration: none;
}
.blog-goods-card__img {
    flex: 0 0 88px;
    width: 88px;
    height: 88px;
    border-radius: 8px;
    object-fit: cover;
    background: #f2f3f5;
}
.blog-goods-card__img--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #b6bbc6;
    border: 1px dashed #dcdfe6;
}
.blog-goods-card__info {
    flex: 1 1 auto;
    min-width: 0;
}
.blog-goods-card__title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
    color: #1f2430;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-goods-card__price {
    margin-top: 6px;
    font-size: 15px;
    font-weight: 700;
    color: #e5484d;
}
.blog-goods-card__desc {
    margin-top: 4px;
    font-size: 12.5px;
    line-height: 1.6;
    color: #9097a3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-goods-card__btn {
    flex: 0 0 auto;
    padding: 7px 14px;
    border-radius: 999px;
    background: #4f46e5;
    color: #fff;
    font-size: 12.5px;
    white-space: nowrap;
}

/* ---------- 文章内链 ---------- */
.blog-post-link {
    color: #4f46e5;
    text-decoration: none;
    border-bottom: 1px dashed rgba(79, 70, 229, .45);
    padding-bottom: 1px;
}
.blog-post-link:hover {
    border-bottom-style: solid;
}

/* ---------- 分割线 ---------- */
.blog-divider {
    height: 1px;
    margin: 34px 0;
    border: 0;
    background: linear-gradient(to right, transparent, #e5e7eb 15%, #e5e7eb 85%, transparent);
}

/* ---------- 目录 ---------- */
.blog-toc {
    margin: 26px 0;
    padding: 16px 18px;
    border: 1px solid #edeef2;
    border-radius: 10px;
    background: #fbfbfd;
}
.blog-toc__title {
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #5b6070;
    letter-spacing: .04em;
}
.blog-toc__list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.blog-toc__list li {
    margin: 0 0 6px;
    font-size: 13.5px;
    line-height: 1.7;
}
.blog-toc__list li:last-child {
    margin-bottom: 0;
}
.blog-toc__list li.is-sub {
    padding-left: 16px;
    font-size: 13px;
    opacity: .88;
}
.blog-toc__list a {
    color: #4b5563;
    text-decoration: none;
}
.blog-toc__list a:hover {
    color: #4f46e5;
}
.blog-toc__list a.is-active {
    color: #4f46e5;
    font-weight: 600;
}
.blog-toc__list a.is-active::before {
    content: "";
    display: inline-block;
    width: 3px;
    height: 11px;
    margin-right: 7px;
    border-radius: 2px;
    background: #4f46e5;
    vertical-align: -1px;
}
.blog-toc__empty {
    font-size: 12.5px;
    color: #a0a6b3;
}

/* 原生锚点跳转（含目录里的 href="#id"）也避开固定头部 */
.detail-body h2,
.detail-body h3 {
    scroll-margin-top: 68px;
}

/* ---------- 代码块（编辑器 codesample 输出的是 pre > code，这里统一正文样式） ---------- */
.blog-code,
pre.blog-code,
.detail-body pre {
    margin: 22px 0;
    padding: 14px 16px;
    border-radius: 10px;
    background: #1f2430;
    color: #e6e8ee;
    font-family: ui-monospace, Menlo, Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.75;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.blog-code code,
pre.blog-code code,
.detail-body pre code {
    color: inherit;
    background: none;
    padding: 0;
    font-family: inherit;
}

/* ---------- 移动端 ---------- */
@media (max-width: 640px) {
    .blog-goods-card__link {
        gap: 10px;
        padding: 10px;
    }
    .blog-goods-card__img {
        flex-basis: 64px;
        width: 64px;
        height: 64px;
    }
    .blog-goods-card__btn {
        display: none;
    }
    .blog-figure img {
        border-radius: 8px;
    }
}

/* ---------- 步骤条 ---------- */
.blog-steps {
    margin: 22px 0;
}
.blog-steps__title {
    margin-bottom: 14px;
    font-size: 15px;
    font-weight: 600;
    color: #333845;
}
.blog-steps__item {
    position: relative;
    display: flex;
    gap: 12px;
    padding-bottom: 18px;
}
.blog-steps__item:last-child {
    padding-bottom: 0;
}
.blog-steps__item::before {
    content: "";
    position: absolute;
    left: 15px;
    top: 34px;
    bottom: 0;
    width: 2px;
    background: #eceef2;
}
.blog-steps__item:last-child::before {
    display: none;
}
.blog-steps__no {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #2563eb);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 32px;
    text-align: center;
}
.blog-steps__content {
    flex: 1 1 auto;
    padding-top: 4px;
}
.blog-steps__head {
    margin-bottom: 4px;
    font-size: 14.5px;
    font-weight: 600;
    color: #1f2430;
}
.blog-steps__desc {
    font-size: 13.5px;
    line-height: 1.8;
    color: #6b7280;
}

/* ---------- 评分卡 ---------- */
.blog-rating {
    margin: 24px 0;
    padding: 18px 20px;
    border: 1px solid #e8e9f5;
    border-radius: 12px;
    background: linear-gradient(135deg, #f7f5ff, #f2f7ff);
}
.blog-rating__head {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 14px;
}
.blog-rating__score {
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
    color: #4f46e5;
}
.blog-rating__max {
    font-size: 13px;
    color: #8b90a0;
}
.blog-rating__label {
    margin-left: auto;
    font-size: 12.5px;
    color: #8b90a0;
}
.blog-rating__bars {
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.blog-rating__row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}
.blog-rating__name {
    flex: 0 0 56px;
    color: #4b5563;
}
.blog-rating__track {
    flex: 1 1 auto;
    height: 8px;
    border-radius: 4px;
    background: #e6e8f0;
    overflow: hidden;
}
.blog-rating__fill {
    display: block;
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #4f46e5, #2563eb);
}
.blog-rating__num {
    flex: 0 0 30px;
    font-weight: 600;
    text-align: right;
    color: #333845;
}
.blog-rating__note {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed #e5e7f0;
    font-size: 13px;
    line-height: 1.8;
    color: #6b7280;
}

@media (max-width: 640px) {
    .blog-rating {
        padding: 14px 14px;
    }
    .blog-rating__score {
        font-size: 26px;
    }
    .blog-steps__desc {
        font-size: 13px;
    }
}

/* 模板里的图片占位 */
.blog-figure__ph {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    border: 1px dashed #d6d9e2;
    border-radius: 10px;
    background: #fbfbfd;
    color: #a0a6b3;
    font-size: 13px;
}

/* ---------- 对比表 ---------- */
.blog-compare {
    margin: 24px 0;
    overflow-x: auto;
}
.blog-compare table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: #fff;
}
.blog-compare th,
.blog-compare td {
    padding: 9px 12px;
    border: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}
.blog-compare thead th {
    background: #f5f6fa;
    font-weight: 600;
    color: #1f2430;
}
.blog-compare tbody th {
    background: #fafbfd;
    font-weight: 600;
    color: #4b5563;
    white-space: nowrap;
}
.blog-compare tbody tr:nth-child(even) td {
    background: #fbfbfd;
}
@media (max-width: 640px) {
    .blog-compare table {
        min-width: 460px;
    }
    .blog-compare th,
    .blog-compare td {
        padding: 8px 10px;
        font-size: 13px;
    }
}

/* ---------- 结尾引导卡 ---------- */
.blog-cta {
    margin: 28px 0;
    padding: 22px 20px;
    border: 1px solid #e8e9f5;
    border-radius: 12px;
    background: linear-gradient(135deg, #f5f4ff, #f2f7ff);
    text-align: center;
}
.blog-cta__title {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 700;
    color: #1f2430;
}
.blog-cta__desc {
    margin: 0 0 14px;
    font-size: 13.5px;
    line-height: 1.8;
    color: #6b7280;
}
.blog-cta__btn {
    display: inline-block;
    padding: 9px 24px;
    border-radius: 999px;
    background: linear-gradient(135deg, #4f46e5, #2563eb);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}
.blog-cta__btn:hover {
    opacity: 0.9;
}
@media (max-width: 640px) {
    .blog-cta {
        padding: 18px 14px;
    }
    .blog-cta__title {
        font-size: 15.5px;
    }
}

/* ---------- 图片相册 ---------- */
.blog-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 24px 0;
}
.blog-gallery__item {
    margin: 0;
    overflow: hidden;
    border-radius: 10px;
    background: #f7f8fa;
}
.blog-gallery__item img {
    display: block;
    width: 100%;
    height: 210px;
    object-fit: cover;
}
.blog-gallery__item figcaption {
    padding: 8px 10px;
    background: #fff;
    font-size: 12.5px;
    line-height: 1.6;
    color: #6b7280;
}
.blog-gallery__item:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}
.blog-gallery__item:last-child:nth-child(odd) img {
    height: 260px;
}

/* ---------- 常见问题 ---------- */
.blog-faq {
    margin: 26px 0;
    border: 1px solid #eceef2;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}
.blog-faq__title {
    padding: 12px 16px;
    background: #f7f8fa;
    font-size: 15px;
    font-weight: 700;
    color: #1f2430;
}
.blog-faq__item {
    padding: 14px 16px;
    border-top: 1px solid #f0f1f5;
}
.blog-faq__q {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.7;
    color: #1f2430;
}
.blog-faq__badge {
    flex: 0 0 auto;
    margin-top: 2px;
    padding: 1px 6px;
    border-radius: 4px;
    background: #4f46e5;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
}
.blog-faq__a {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.85;
    color: #4b5563;
}

/* ---------- 参考资料 ---------- */
.blog-refs {
    margin: 28px 0;
    padding: 16px 18px;
    border-radius: 8px;
    background: #fbfbfd;
    border-top: 1px solid #eceef2;
}
.blog-refs__title {
    margin-bottom: 8px;
    font-size: 13.5px;
    font-weight: 700;
    color: #4b5563;
}
.blog-refs__list {
    margin: 0;
    padding-left: 20px;
    font-size: 12.5px;
    line-height: 1.9;
    color: #6b7280;
}
.blog-refs__list li {
    margin-bottom: 4px;
    word-break: break-all;
}
.blog-refs__list a {
    margin-left: 2px;
    color: #4f46e5;
    text-decoration: none;
}

@media (max-width: 640px) {
    .blog-gallery__item img {
        height: 150px;
    }
    .blog-gallery__item:last-child:nth-child(odd) img {
        height: 190px;
    }
    .blog-faq__q {
        font-size: 14px;
    }
}

/* ---------- 文章卡（站内文章推荐） ---------- */
.blog-post-card {
    margin: 24px 0;
}
.blog-post-card__link {
    display: flex;
    align-items: stretch;
    gap: 14px;
    padding: 12px;
    border: 1px solid #e8eaf0;
    border-radius: 10px;
    background: #fff;
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.blog-post-card__link:hover {
    border-color: #c7c9e8;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.08);
}
.blog-post-card__img {
    flex: 0 0 120px;
    height: 86px;
    border-radius: 8px;
    overflow: hidden;
    background: #f3f4f8;
    display: flex;
    align-items: center;
    justify-content: center;
}
.blog-post-card__img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.blog-post-card__img--empty span {
    font-size: 13px;
    color: #a0a6b3;
}
.blog-post-card__info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}
.blog-post-card__title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
    color: #1f2430;
}
.blog-post-card__desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.6;
    color: #6b7280;
}
.blog-post-card__more {
    font-size: 12.5px;
    color: #4f46e5;
}
@media (max-width: 640px) {
    .blog-post-card__link {
        flex-direction: column;
    }
    .blog-post-card__img {
        flex: none;
        width: 100%;
        height: 150px;
    }
}
