/**
 * 宝策网主题 - 文章详情页样式
 */

/* ========== Reading Progress Bar ========== */
.cbj-reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--cbj-primary), #6366F1);
    z-index: 1001;
    transition: width 0.1s linear;
}

/* ========== Detail Page Layout ========== */
.cbj-detail-page {
    padding: 30px 0 60px;
    background: var(--cbj-bg-light);
}

/* ========== Article ========== */
.cbj-article {
    background: var(--cbj-bg-white);
    border-radius: var(--cbj-radius-lg);
    padding: 35px 45px;
    border: 1px solid var(--cbj-border-light);
    margin-bottom: 30px;
}

.cbj-article-title {
    font-size: 26px;
    font-weight: 600;
    line-height: 1.45;
    margin-bottom: 15px;
    color: var(--cbj-text-primary);
    text-align: center;
    letter-spacing: 0.02em;
}

/* ========== Post Meta ========== */
.cbj-article .cbj-post-meta {
    padding-bottom: 18px;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--cbj-border-light);
    justify-content: center;
}

.cbj-article .cbj-post-meta span {
    font-size: 13px;
    color: var(--cbj-text-tertiary);
}

.cbj-article .cbj-post-meta .c_icon {
    color: var(--cbj-text-tertiary);
}

.cbj-meta-source a {
    color: var(--cbj-text-tertiary);
}

.cbj-meta-source a:hover {
    color: var(--cbj-primary);
}

/* ========== Article Content ========== */
.cbj-article .cbj-article-content {
    margin-bottom: 30px;
    overflow-x: auto;
}


/* ========== Disclaimer ========== */
.cbj-disclaimer {
    background: var(--cbj-bg-light);
    padding: 20px 25px;
    border-radius: var(--cbj-radius-md);
    margin-bottom: 25px;
    font-size: 13px;
    color: var(--cbj-text-secondary);
    line-height: 1.8;
    border-left: 3px solid var(--cbj-primary);
}

.cbj-disclaimer p {
    margin-bottom: 5px;
}

.cbj-disclaimer p:last-child {
    margin-bottom: 0;
}

.cbj-disclaimer a {
    color: var(--cbj-primary);
}

.cbj-disclaimer .c_icon {
    margin-right: 4px;
    color: #E73827;
}

/* ========== Article Ad ========== */
.cbj-article-ad {
    margin-bottom: 25px;
}

.cbj-article-ad img {
    max-width: 100%;
    border-radius: var(--cbj-radius-sm);
}

/* ========== Adjacent Posts ========== */
.cbj-adjacent-posts {
    background: var(--cbj-bg-white);
    border: 1px solid var(--cbj-border-light);
    border-radius: var(--cbj-radius-md);
    padding: 22px 25px;
    margin-bottom: 25px;
}

.cbj-prev-post,
.cbj-next-post {
    padding: 8px 0;
    font-size: 14px;
    line-height: 1.6;
}

.cbj-prev-post > span:first-child,
.cbj-next-post > span:first-child {
    color: var(--cbj-text-secondary);
    font-weight: 600;
}

.cbj-prev-post a,
.cbj-next-post a {
    color: var(--cbj-text-primary);
}

.cbj-prev-post a:hover,
.cbj-next-post a:hover {
    color: var(--cbj-primary);
}

.cbj-no-post {
    color: var(--cbj-text-light);
    font-size: 13px;
}

/* ========== Related Posts ========== */
.cbj-related-posts {
    padding-top: 20px;
}

.cbj-related-posts h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--cbj-text-primary);
    padding-left: 15px;
    position: relative;
}

.cbj-related-posts h4::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--cbj-primary);
    border-radius: 2px;
}

.cbj-related-item {
    display: block;
    margin-bottom: 15px;
}

.cbj-related-thumb {
    overflow: hidden;
    border-radius: var(--cbj-radius-sm);
    margin-bottom: 8px;
    aspect-ratio: 16/10;
}

.cbj-related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.cbj-related-item:hover .cbj-related-thumb img {
    transform: scale(1.05);
}

.cbj-related-item h5 {
    font-size: 13px;
    font-weight: 500;
    color: var(--cbj-text-primary);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.cbj-related-item:hover h5 {
    color: var(--cbj-primary);
}

/* ========== Article Topbar (Name Card) ========== */
.cbj-article-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    margin: -10px -10px 20px;
    background: var(--cbj-bg-light);
    border-radius: var(--cbj-radius-md);
    border: 1px solid var(--cbj-border-light);
}

.cbj-topbar-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.cbj-topbar-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.cbj-topbar-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cbj-topbar-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--cbj-text-primary);
    line-height: 1.3;
}

.cbj-topbar-desc {
    font-size: 12px;
    color: var(--cbj-text-light);
    line-height: 1.3;
}

.cbj-topbar-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.cbj-topbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cbj-topbar-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
}

.cbj-topbar-btn .c_icon {
    width: 22px;
    height: 22px;
}

.cbj-topbar-wechat {
    background: #07c160;
}

.cbj-topbar-wechat .c_icon {
    filter: brightness(0) invert(1);
}

.cbj-topbar-phone {
    background: var(--cbj-primary);
}

.cbj-topbar-phone .c_icon {
    filter: brightness(0) invert(1);
}

/* Wechat Popup */
.cbj-topbar-wechat-mask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.cbj-topbar-wechat-mask.active {
    display: flex;
}

.cbj-topbar-wechat-popup {
    background: #fff;
    border-radius: 16px;
    max-width: 340px;
    width: 88%;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    animation: fadeInUp 0.3s ease;
}

.cbj-topbar-wechat-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 26px;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    z-index: 2;
    min-width: 44px;
    min-height: 44px;
    line-height: 1;
}

.cbj-topbar-wechat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px 18px;
    background: linear-gradient(135deg, #4a9cf5, #3b7de8);
    color: #fff;
}

.cbj-topbar-wechat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.4);
    flex-shrink: 0;
}

.cbj-topbar-wechat-name {
    font-size: 17px;
    font-weight: 700;
}

.cbj-topbar-wechat-phone {
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    margin-top: 2px;
}

.cbj-topbar-wechat-desc {
    padding: 16px 20px 12px;
    font-size: 13px;
    color: var(--cbj-text-light);
    line-height: 1.6;
    margin: 0;
}

.cbj-topbar-wechat-qrcode {
    display: block;
    width: 180px;
    height: 180px;
    margin: 0 auto 10px;
    border-radius: 8px;
}

.cbj-topbar-wechat-tip {
    text-align: center;
    font-size: 13px;
    color: var(--cbj-primary);
    padding: 0 20px 20px;
    margin: 0;
}

/* ========== Article CTA ========== */
.cbj-article-cta {
    margin: 30px 0;
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fd 100%);
    border: 1px solid #d0e3f7;
    border-radius: 12px;
    overflow: hidden;
}

.cbj-article-cta-inner {
    display: flex;
    align-items: center;
    padding: 28px 32px;
    gap: 32px;
}

.cbj-article-cta-text {
    flex: 1;
}

.cbj-article-cta-text h4 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: #1a365d;
}

.cbj-article-cta-text p {
    margin: 0 0 16px;
    font-size: 14px;
    color: #4a5568;
    line-height: 1.6;
}

.cbj-article-cta-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.cbj-article-cta-actions .cbj-btn-accent {
    padding: 10px 28px;
    font-size: 14px;
    font-weight: 600;
}

.cbj-article-cta-phone {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 600;
    color: var(--cbj-primary);
    text-decoration: none;
}

.cbj-article-cta-phone:hover {
    color: #2563eb;
}

.cbj-article-cta-qrcode {
    flex-shrink: 0;
    text-align: center;
}

.cbj-article-cta-qrcode img {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.cbj-article-cta-qrcode span {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #64748b;
}

/* ========== Responsive ========== */
@media (max-width: 992px) {
    .cbj-article {
        padding: 25px 20px;
    }
}

@media (max-width: 768px) {
    .cbj-detail-page {
        padding: 20px 0 40px;
    }

    .cbj-article {
        padding: 20px 15px;
    }

    .cbj-article-title {
        font-size: 20px;
    }

    .cbj-disclaimer {
        padding: 15px;
        font-size: 12px;
    }

    .cbj-adjacent-posts {
        padding: 15px;
    }

    .cbj-article-cta {
        margin: 24px 0;
    }

    .cbj-article-cta-inner {
        flex-direction: column;
        padding: 20px;
        text-align: center;
        gap: 16px;
    }

    .cbj-article-cta-text h4 {
        font-size: 16px;
        margin-bottom: 6px;
    }

    .cbj-article-cta-text p {
        font-size: 13px;
        margin-bottom: 12px;
    }

    .cbj-article-cta-actions {
        justify-content: center;
        gap: 12px;
    }

    .cbj-article-cta-actions .cbj-btn-accent {
        padding: 9px 24px;
        font-size: 13px;
    }

    .cbj-article-cta-phone {
        font-size: 14px;
    }

    .cbj-article-cta-qrcode img {
        width: 90px;
        height: 90px;
    }

    .cbj-article-cta-qrcode span {
        font-size: 11px;
    }
}

@media (max-width: 576px) {
    .cbj-article {
        padding: 18px 12px;
    }

    .cbj-article-title {
        font-size: 18px;
    }

    .cbj-article-cta {
        margin: 18px 0;
    }

    .cbj-article-cta-inner {
        padding: 16px;
        gap: 14px;
    }

    .cbj-article-cta-text h4 {
        font-size: 15px;
    }

    .cbj-article-cta-text p {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .cbj-article-cta-actions {
        flex-direction: row;
        width: 100%;
    }

    .cbj-article-cta-actions .cbj-btn-accent {
        flex: 1;
        text-align: center;
        padding: 9px 0;
    }

    .cbj-article-cta-phone {
        flex: 1;
        justify-content: center;
        font-size: 13px;
        padding: 9px 0;
        background: var(--cbj-primary-light);
        border-radius: var(--cbj-radius-round);
    }

    .cbj-article-cta-qrcode img {
        width: 80px;
        height: 80px;
    }
}
