/* ========================================
   Blog Post Detail Page
======================================== */
:root {
    --bp-bg: #FFFFFF;
    --bp-bg-soft: #F7F8FA;
    --bp-border: #E5E6EB;
}

.blog-post {
    background: var(--bp-bg);
}

/* ============ 面包屑 ============ */
.bp-breadcrumb {
    padding: 18px 0;
    background: var(--bp-bg-soft);
    border-bottom: 1px solid var(--bp-border);
    font-size: 13px;
    color: var(--text-secondary);
}

.bp-breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.bp-breadcrumb a:hover {
    color: var(--primary-color);
}

.bp-breadcrumb span {
    margin: 0 8px;
}

.bp-breadcrumb .current {
    color: var(--text-primary);
    font-weight: 600;
    margin-left: 8px;
}

/* ============ Hero 区 ============ */
.bp-hero {
    padding: 70px 0 50px;
    background: linear-gradient(180deg, var(--bp-bg-soft) 0%, var(--bp-bg) 100%);
    border-bottom: 1px solid var(--bp-border);
}

.bp-hero__inner {
    max-width: 820px;
    margin: 0 auto;
    text-align: center;
}

.bp-hero__category {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(229, 62, 62, 0.08);
    color: var(--primary-color);
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-bottom: 22px;
}

.bp-hero h1 {
    font-size: 42px;
    line-height: 1.25;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.5px;
    margin: 0 0 22px;
}

.bp-hero__lead {
    font-size: 18px;
    line-height: 1.75;
    color: var(--text-secondary);
    margin: 0 0 32px;
}

.bp-hero__meta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 24px;
    font-size: 13px;
    color: var(--text-secondary);
}

.bp-hero__meta>span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.bp-hero__meta svg {
    color: var(--primary-color);
}

.bp-hero__author {
    font-weight: 600;
    color: var(--text-primary);
}

/* ============ 文章主体 ============ */
.bp-article {
    padding: 60px 0 80px;
}

.bp-article__layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 60px;
    max-width: 1100px;
    margin: 0 auto;
}

/* ============ 侧边目录 ============ */
.bp-toc {
    position: relative;
}

.bp-toc__inner {
    position: sticky;
    top: 100px;
}

.bp-toc__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--bp-border);
}

.bp-toc__title svg {
    color: var(--primary-color);
}

.bp-toc__nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 32px;
}

.bp-toc__nav a {
    display: block;
    padding: 8px 12px 8px 14px;
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: all 0.3s ease;
    line-height: 1.4;
}

.bp-toc__nav a:hover {
    color: var(--primary-color);
    background: rgba(229, 62, 62, 0.04);
    border-left-color: rgba(229, 62, 62, 0.3);
}

.bp-toc__nav a.is-active {
    color: var(--primary-color);
    font-weight: 600;
    border-left-color: var(--primary-color);
    background: rgba(229, 62, 62, 0.06);
}

/* H3 缩进 */
.bp-toc__nav a.level-3 {
    padding-left: 26px;
    font-size: 12px;
}

/* 分享按钮 */
.bp-share {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 24px;
    border-top: 1px solid var(--bp-border);
}

.bp-share__label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-right: 4px;
}

.bp-share__btn {
    width: 32px;
    height: 32px;
    background: var(--bp-bg-soft);
    border: 1px solid var(--bp-border);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.bp-share__btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
}

/* ============ 文章内容样式 ============ */
.bp-content {
    min-width: 0;
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-primary);
}

.bp-content>p {
    margin: 0 0 22px;
}

.bp-content h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 50px 0 18px;
    line-height: 1.3;
    scroll-margin-top: 100px;
    position: relative;
    padding-left: 18px;
}

.bp-content h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

.bp-content h3 {
    font-size: 21px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 36px 0 14px;
    line-height: 1.35;
    scroll-margin-top: 100px;
}

.bp-content h4 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 28px 0 12px;
}

.bp-content a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1.5px solid rgba(229, 62, 62, 0.25);
    transition: all 0.3s ease;
}

.bp-content a:hover {
    border-bottom-color: var(--primary-color);
    background: rgba(229, 62, 62, 0.04);
}

.bp-content strong {
    color: var(--text-primary);
    font-weight: 700;
}

.bp-content ul,
.bp-content ol {
    margin: 0 0 22px;
    padding-left: 24px;
}

.bp-content li {
    margin-bottom: 8px;
    line-height: 1.75;
}

.bp-content blockquote {
    margin: 30px 0;
    padding: 24px 28px;
    background: var(--bp-bg-soft);
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    font-style: italic;
    color: var(--text-primary);
}

.bp-content blockquote p {
    margin: 0;
}

.bp-content blockquote cite {
    display: block;
    margin-top: 12px;
    font-size: 13px;
    font-style: normal;
    color: var(--text-secondary);
    font-weight: 600;
}

/* 代码 */
.bp-content code {
    padding: 2px 8px;
    background: var(--bp-bg-soft);
    border: 1px solid var(--bp-border);
    border-radius: 4px;
    font-family: 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
    font-size: 14px;
    color: var(--primary-color);
}

.bp-content pre {
    margin: 24px 0;
    padding: 20px;
    background: #1D2129;
    color: #E5E6EB;
    border-radius: 10px;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.6;
}

.bp-content pre code {
    background: transparent;
    border: 0;
    color: inherit;
    padding: 0;
}

/* 图片 */
.bp-content img {
    max-width: 100%;
    height: auto;
    margin: 30px 0;
    border-radius: 12px;
    border: 1px solid var(--bp-border);
}

.bp-content figure {
    margin: 30px 0;
}

.bp-content figcaption {
    margin-top: 10px;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    font-style: italic;
}

/* 表格 */
.bp-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 28px 0;
    background: var(--bp-bg);
    border: 1px solid var(--bp-border);
    border-radius: 10px;
    overflow: hidden;
    font-size: 14px;
}

.bp-content thead {
    background: linear-gradient(180deg, #FAFBFC, #F4F5F7);
}

.bp-content th,
.bp-content td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--bp-border);
}

.bp-content th {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bp-content tbody tr:hover {
    background: rgba(229, 62, 62, 0.02);
}

.bp-content tbody tr:last-child td {
    border-bottom: 0;
}

/* 关键信息卡 */
.bp-callout {
    margin: 28px 0;
    padding: 22px 26px;
    background: rgba(229, 62, 62, 0.04);
    border: 1px solid rgba(229, 62, 62, 0.2);
    border-left: 4px solid var(--primary-color);
    border-radius: 10px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.bp-callout__icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.bp-callout__body {
    flex: 1;
}

.bp-callout__body strong {
    display: block;
    font-size: 14px;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 6px;
}

.bp-callout__body p {
    margin: 0;
    font-size: 15px;
}

/* Reusable engineering workbook download */
.bp-download-tool {
    margin: 32px 0 38px;
    padding: 28px;
    background: linear-gradient(145deg, #fff 0%, #f7f8fa 100%);
    border: 1px solid #dfe3e8;
    border-top: 4px solid var(--primary-color);
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(29, 33, 41, 0.07);
}

.bp-download-tool__eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: #5f6b7a;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    line-height: 1.3;
    text-transform: uppercase;
}

.bp-download-tool__eyebrow span {
    padding: 3px 7px;
    color: #9f2f2f;
    background: rgba(229, 62, 62, 0.08);
    border: 1px solid rgba(229, 62, 62, 0.22);
    border-radius: 999px;
    font-size: 10px;
    letter-spacing: 0.7px;
}

.bp-download-tool__title {
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 22px;
    font-weight: 750;
    letter-spacing: -0.2px;
    line-height: 1.35;
}

.bp-download-tool__summary {
    margin: 0 0 18px;
    color: #344054;
    font-size: 15px;
    line-height: 1.7;
}

.bp-download-tool .bp-download-tool__features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
}

.bp-download-tool__features li {
    position: relative;
    min-width: 0;
    margin: 0;
    padding: 11px 12px 11px 32px;
    color: #25313f;
    background: #fff;
    border: 1px solid var(--bp-border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.45;
}

.bp-download-tool__features li::before {
    content: '\2713';
    position: absolute;
    top: 11px;
    left: 12px;
    color: var(--primary-color);
    font-weight: 800;
}

.bp-download-tool__note {
    margin-bottom: 20px;
    padding: 13px 15px;
    color: #475467;
    background: #f2f4f7;
    border-left: 3px solid #98a2b3;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.65;
}

.bp-download-tool__note strong {
    color: #344054;
}

.bp-download-tool__footer {
    display: flex;
    align-items: center;
    gap: 14px;
}

.bp-content .bp-download-tool__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 18px;
    color: #fff;
    background: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 7px;
    box-shadow: 0 6px 16px rgba(229, 62, 62, 0.2);
    font-size: 14px;
    font-weight: 750;
    line-height: 1.35;
    text-decoration: none;
}

.bp-content .bp-download-tool__button:hover {
    color: #fff;
    background: #c92f2f;
    border-color: #c92f2f;
    box-shadow: 0 9px 22px rgba(201, 47, 47, 0.28);
    transform: translateY(-1px);
}

.bp-content .bp-download-tool__button:focus-visible {
    outline: 3px solid rgba(229, 62, 62, 0.28);
    outline-offset: 3px;
}

.bp-download-tool__button span {
    font-size: 17px;
    line-height: 1;
}

.bp-download-tool__meta {
    color: #667085;
    font-size: 12px;
    font-weight: 650;
}

@media (max-width: 640px) {
    .bp-download-tool {
        margin: 26px 0 32px;
        padding: 22px 18px;
    }

    .bp-download-tool__title {
        font-size: 19px;
    }

    .bp-download-tool .bp-download-tool__features {
        grid-template-columns: 1fr;
    }

    .bp-download-tool__footer {
        align-items: stretch;
        flex-direction: column;
    }

    .bp-content .bp-download-tool__button {
        width: 100%;
    }
}

/* 文末 CTA */
.bp-cta {
    margin: 60px 0 40px;
    padding: 40px 36px;
    background: linear-gradient(135deg, #1D2129 0%, #2D3748 100%);
    border-radius: 16px;
    color: #fff;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.bp-cta::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(229, 62, 62, 0.25) 0%, transparent 70%);
    pointer-events: none;
}

.bp-cta>* {
    position: relative;
    z-index: 1;
}

.bp-cta__icon {
    width: 56px;
    height: 56px;
    background: rgba(229, 62, 62, 0.2);
    color: var(--primary-color);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.bp-cta h3 {
    font-size: 24px;
    color: #fff;
    margin: 0 0 10px;
    font-weight: 700;
}

.bp-cta p {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.75);
    margin: 0 auto 24px;
    max-width: 480px;
    line-height: 1.7;
}

.bp-cta .btn-theme-cta {
    display: inline-block;
    padding: 14px 32px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(229, 62, 62, 0.4);
}

.bp-cta .btn-theme-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(229, 62, 62, 0.55);
}

/* 作者卡 */
.bp-author {
    margin-top: 40px;
    padding: 24px;
    background: var(--bp-bg-soft);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.bp-author__avatar {
    width: 56px;
    height: 56px;
    background: var(--primary-color);
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bp-author__info strong {
    display: block;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.bp-author__info p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* ============ Responsive ============ */
@media (max-width: 992px) {
    .bp-article__layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .bp-toc {
        order: 2;
    }

    .bp-toc__inner {
        position: static;
    }

    .bp-content {
        order: 1;
    }

    .bp-hero h1 {
        font-size: 32px;
    }

    .bp-hero__lead {
        font-size: 16px;
    }
}

@media (max-width: 576px) {
    .bp-hero {
        padding: 72px 0 40px;
    }

    .bp-hero h1 {
        font-size: 24px;
    }

    .bp-content {
        font-size: 15px;
    }

    .bp-content h2 {
        font-size: 22px;
    }

    .bp-content h3 {
        font-size: 18px;
    }

    .bp-content table {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        border-collapse: separate;
        border-spacing: 0;
        -webkit-overflow-scrolling: touch;
    }

    .bp-content th,
    .bp-content td {
        min-width: 120px;
        padding: 12px;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .bp-cta {
        padding: 32px 24px;
    }

    .bp-cta h3 {
        font-size: 20px;
    }
}


/* ============ Related Articles ============ */
.bp-related {
    padding: 60px 0 80px;
    background: var(--bp-bg-soft);
    border-top: 1px solid var(--bp-border);
}

.bp-related__title {
    text-align: center;
    margin-bottom: 35px;
}

.bp-related__label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 6px;
}

.bp-related__title {
    font-size: 26px;
    color: var(--text-primary);
    font-weight: 700;
}

.bp-related__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 1100px;
    margin: 0 auto;
}

.bp-related__card {
    display: block;
    background: var(--bp-bg);
    border: 1px solid var(--bp-border);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.bp-related__card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    border-color: rgba(229, 62, 62, 0.25);
}

.bp-related__card img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: #f0f0f0;
}

.bp-related__body {
    padding: 18px 20px 20px;
}

.bp-related__cat {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(229, 62, 62, 0.08);
    color: var(--primary-color);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.bp-related__body h4 {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* 标准属性（渐进增强）*/
    line-clamp: 2;
}

.bp-related__read {
    font-size: 12px;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .bp-related__grid {
        grid-template-columns: 1fr;
        padding: 0 20px;
    }
}

/* ========================================
   博客详情页 - 图片样式
   支持: 单张 / 带说明 / 大图突出
======================================== */

/* 基础图片样式 */
.bp-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 32px auto;
    border-radius: 12px;
    border: 1px solid var(--bp-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: zoom-in;
}

.bp-content img:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
    border-color: rgba(229, 62, 62, 0.2);
}

/* figure + figcaption(推荐用法,带图片说明) */
.bp-content figure {
    margin: 36px 0;
    text-align: center;
}

.bp-content figure img {
    margin: 0 auto;
    cursor: zoom-in;
}

.bp-content figure figcaption {
    margin-top: 14px;
    padding: 0 20px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
    font-style: italic;
    position: relative;
    display: inline-block;
}

.bp-content figure figcaption::before {
    content: '';
    display: block;
    width: 32px;
    height: 2px;
    background: var(--primary-color);
    margin: 0 auto 10px;
    border-radius: 2px;
}

/* 大图通栏样式(可选) */
.bp-content img.bp-img--wide,
.bp-content figure.bp-figure--wide {
    margin-left: -40px;
    margin-right: -40px;
    max-width: calc(100% + 80px);
}

.bp-content figure.bp-figure--wide img {
    width: 100%;
    border-radius: 16px;
}

/* 移动端 */
@media (max-width: 768px) {
    .bp-content img,
    .bp-content figure {
        margin: 24px 0;
    }
    .bp-content img.bp-img--wide,
    .bp-content figure.bp-figure--wide {
        margin-left: 0;
        margin-right: 0;
        max-width: 100%;
    }
    .bp-content figure figcaption {
        padding: 0 10px;
        font-size: 12px;
    }
}
.bp-hero__updated {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    color: #9f2f2f;
    border: 1px solid rgba(229, 62, 62, 0.24);
    border-radius: 999px;
    background: rgba(229, 62, 62, 0.08);
    font-size: 0.82rem;
    font-weight: 700;
}

.bp-author__info a {
    color: #0b5cab;
    font-weight: 700;
}

.bp-author__review {
    margin-top: 8px;
    color: #344a61;
}
