/* ============================================================
   康弘主题页 · 文章详情（公众号风格 · 蓝白学术 VI）
   ============================================================ */

.article-body {
    background: #EFF7FD;
}

.article-shell {
    position: relative;
    width: 100%;
    max-width: 700px;
    min-height: 100vh;
    margin: 0 auto;
    background: #FFFFFF;
    box-shadow: 0 0 70px rgba(18, 54, 92, 0.1);
}

/* ---------------- 顶部导航 ---------------- */
.article-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    height: calc(50px + env(safe-area-inset-top));
    align-items: center;
    justify-content: space-between;
    padding: env(safe-area-inset-top) 8px 0;
    border-bottom: 1px solid #E7F2FB;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
}

.article-topbar__btn {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 50%;
    color: #1C3F60;
    transition: background 0.18s ease, transform 0.18s ease;
}

.article-topbar__btn:active {
    background: #EFF8FF;
    transform: scale(0.94);
}

.article-topbar__btn svg {
    width: 21px;
    height: 21px;
}

.article-topbar__title {
    overflow: hidden;
    color: #5F7A92;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.3px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* ---------------- 正文 ---------------- */
.article-main {
    padding: 26px 20px calc(92px + env(safe-area-inset-bottom));
}

.wx-article {
    max-width: 100%;
}

.wx-title {
    color: #172A3D;
    font-size: clamp(22px, 6vw, 26px);
    font-weight: 700;
    letter-spacing: 0.2px;
    line-height: 1.45;
    word-break: break-word;
}

.wx-byline {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid #E7F2FB;
}

.wx-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 50%;
    box-shadow: 0 3px 10px rgba(23, 78, 126, 0.14);
}

.wx-byline__info {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.wx-account {
    overflow: hidden;
    color: #2F6FBF;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.2px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.wx-date {
    color: #8A9EB0;
    font-size: 11.5px;
    letter-spacing: 0.2px;
}

.wx-body {
    margin-top: 24px;
    color: #1F2A33;
    font-size: 17px;
    letter-spacing: 0.1px;
    line-height: 1.9;
    text-align: justify;
    word-break: break-word;
}

html[data-article-size="sm"] .wx-body {
    font-size: 15.5px;
}

html[data-article-size="lg"] .wx-body {
    font-size: 19px;
}

.wx-body .wx-p {
    margin: 0 0 22px;
}

.wx-body .wx-p:last-child {
    margin-bottom: 8px;
}

.wx-body strong {
    color: #10263B;
    font-weight: 600;
}

.wx-body a {
    color: #2F6FBF;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* 导语：明确的蓝色内容框，参考公众号文章中的蓝框 */
.wx-lead {
    position: relative;
    margin: 16px 0 24px;
    padding: 20px 17px 16px;
    border: 1px solid #9ACBEA;
    border-left: 3px solid #2F6FBF;
    border-radius: 2px;
    background: #F3FAFF;
    box-shadow: 0 2px 8px rgba(23, 78, 126, 0.04);
}

.wx-lead::before {
    position: absolute;
    top: -10px;
    left: 13px;
    padding: 2px 8px;
    border-radius: 1px;
    background: #2F6FBF;
    color: #FFFFFF;
    content: "导语";
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    line-height: 1.6;
}

.wx-lead .wx-p {
    margin: 0;
}

/* 小标题：蓝底金边，呼应参考中的蓝色栏目条 */
.wx-h2 {
    position: relative;
    margin: 32px 0 18px;
    padding: 10px 14px;
    border-left: 3px solid var(--gold);
    border-radius: 2px;
    background: linear-gradient(100deg, #2F6FBF 0%, #1D4E8C 100%);
    box-shadow: 0 3px 10px rgba(23, 78, 126, 0.12);
    color: #FFFFFF;
    font-size: 1.05em;
    font-weight: 600;
    letter-spacing: 0.3px;
    line-height: 1.55;
}

/* 图片：蓝色细框 */
.wx-figure {
    margin: 26px 0;
    padding: 4px 4px 0;
    border: 1px solid #C3E0F4;
    border-radius: 2px;
    background: #FFFFFF;
}

.wx-figure img {
    width: 100%;
    border-radius: 1px;
    background: #F2F8FE;
    cursor: zoom-in;
}

.wx-figure figcaption {
    padding: 8px 4px 9px;
    color: #8298AA;
    font-size: 12px;
    line-height: 1.7;
    text-align: center;
}

/* 视频：蓝色细框 */
.wx-video {
    margin: 26px 0;
    padding: 4px 4px 0;
    border: 1px solid #C3E0F4;
    border-radius: 2px;
    background: #FFFFFF;
}

.wx-body > .wx-video:first-child {
    margin-top: 0;
}

.wx-video__frame {
    position: relative;
    overflow: hidden;
    border-radius: 1px;
    background: #061C30;
    aspect-ratio: 16 / 9;
}

.wx-video__frame video,
.wx-video__frame iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: contain;
    background: #061C30;
}

.wx-video__media {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #061C30;
}

.wx-video__play {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    width: 62px;
    height: 62px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 24px rgba(7, 32, 56, 0.22);
    transform: translate(-50%, -50%);
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.wx-video__play:hover {
    background: #FFFFFF;
}

.wx-video__play.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.9);
}

.wx-video__play-icon {
    width: 0;
    height: 0;
    margin-left: 4px;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 16px solid #2F6FBF;
}

.wx-video figcaption {
    padding: 8px 4px 9px;
    color: #8298AA;
    font-size: 12px;
    line-height: 1.7;
    text-align: center;
}

/* 引用 */
.wx-quote {
    margin: 26px 0;
    padding: 15px 17px;
    border-left: 3px solid #2F6FBF;
    border-radius: 0 2px 2px 0;
    background: #F2F9FE;
    color: #3A4C5E;
    font-size: 0.94em;
    line-height: 1.85;
    text-align: justify;
}

.wx-quote p {
    margin: 0;
}

.wx-divider {
    width: 44px;
    height: 1px;
    margin: 34px auto;
    border: 0;
    background: linear-gradient(90deg, transparent, rgba(47, 111, 191, 0.4), transparent);
}

.wx-end {
    margin: 38px 0 6px;
    color: #C3D6E4;
    font-size: 12px;
    letter-spacing: 6px;
    text-align: center;
}

.wx-note {
    margin-top: 26px;
    padding: 15px 16px;
    border: 1px solid #E4F1FA;
    border-radius: 2px;
    background: #FBFDFF;
    color: #8A9EB0;
    font-size: 12px;
    line-height: 1.9;
    text-align: justify;
}

.wx-note p + p {
    margin-top: 6px;
}

.wx-copyright {
    color: #A2B4C4;
    font-size: 11px;
}

/* ---------------- 底部操作栏 ---------------- */
.article-toolbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 50%;
    z-index: 45;
    display: flex;
    width: 100%;
    max-width: 700px;
    height: calc(56px + env(safe-area-inset-bottom));
    align-items: stretch;
    padding: 0 8px env(safe-area-inset-bottom);
    border-top: 1px solid #DDECF7;
    border-radius: 10px 10px 0 0;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -6px 22px rgba(23, 78, 126, 0.06);
    transform: translateX(-50%);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
}

.article-toolbar__item {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 5px;
    background: none;
    color: #6B8298;
    font-size: 10px;
    gap: 4px;
    line-height: 1;
    transition: color 0.18s ease, background 0.18s ease;
}

.article-toolbar__item span:last-child {
    letter-spacing: 0.2px;
}

.article-toolbar__item svg {
    width: 20px;
    height: 20px;
}

.article-toolbar__item:active {
    background: #F0F8FE;
    color: #1D4E8C;
}

.article-toolbar__aa {
    color: #1C4E80;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1;
}

.article-body .toast {
    bottom: calc(78px + env(safe-area-inset-bottom));
}

/* ---------------- 外链预览（后台） ---------------- */
.external-preview {
    padding: 34px 4px;
}

.external-preview__badge {
    display: inline-flex;
    height: 24px;
    align-items: center;
    padding: 0 10px;
    border-radius: 2px;
    background: #EAF4FF;
    color: #2F6FBF;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.4px;
}

.external-preview h1 {
    margin-top: 18px;
    color: var(--ink);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.45;
}

.external-preview__cover {
    width: 100%;
    margin-top: 20px;
    border: 1px solid var(--line-blue);
    border-radius: 2px;
}

.external-preview__summary {
    margin-top: 18px;
    color: var(--ink-2);
    font-size: 14px;
    line-height: 1.9;
}

.external-preview__url {
    margin-top: 18px;
    padding: 12px 14px;
    overflow-wrap: anywhere;
    border: 1px solid #E4F1FA;
    border-radius: 2px;
    background: #F7FBFF;
    color: #2F6FBF;
    font-size: 12px;
    line-height: 1.7;
}

.external-preview__open {
    display: inline-flex;
    height: 42px;
    align-items: center;
    margin-top: 20px;
    padding: 0 20px;
    border-radius: 3px;
    background: linear-gradient(135deg, #2F6FBF, #1D4E8C);
    box-shadow: 0 8px 20px rgba(23, 78, 126, 0.18);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
}

.external-preview__tip {
    margin-top: 18px;
    color: var(--ink-3);
    font-size: 12px;
    line-height: 1.8;
}

/* ---------------- 桌面适配 ---------------- */
@media (min-width: 640px) {
    .article-shell {
        margin-top: 28px;
        margin-bottom: 28px;
        min-height: calc(100vh - 56px);
        border-radius: 12px;
    }

    .article-topbar {
        padding-top: 0;
        border-radius: 12px 12px 0 0;
    }

    .article-main {
        padding: 32px 28px 96px;
    }

    .article-toolbar {
        bottom: 16px;
        border-radius: 8px;
        box-shadow: 0 8px 28px rgba(23, 78, 126, 0.12);
    }

    .article-body .toast {
        bottom: 92px;
    }
}


/* ---------------- 图片放大查看 ---------------- */
.image-zoom {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: rgba(5, 24, 42, 0.94);
    opacity: 0;
    cursor: zoom-out;
    transition: opacity 0.18s ease;
}

.image-zoom.is-visible {
    opacity: 1;
}

.image-zoom img {
    max-width: 96vw;
    max-height: 88vh;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 2px;
    background: #FFFFFF;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    object-fit: contain;
}

.image-zoom__close {
    position: fixed;
    top: max(16px, env(safe-area-inset-top));
    right: 16px;
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
}

.image-zoom__close svg {
    width: 18px;
    height: 18px;
}
