/* article-share.css — 文章详情页分享按钮响应式切换、微信兜底图与打印/PDF排版样式 */

/* 1. 默认（桌面端）：显示微信扫码、打印/PDF、复制链接；隐藏移动端系统分享按钮 */
.share-btn.share-native {
    display: none;
}

.share-btn.share-weixin,
.share-btn.share-print,
.share-btn.share-copy {
    display: inline-flex;
}

/* 2. 移动端（窄屏或触控设备）：隐藏微信扫码与打印，改为原生 Web Share API 系统分享 */
@media (max-width: 768px), (pointer: coarse) {
    .share-btn.share-weixin,
    .share-btn.share-print {
        display: none !important;
    }

    .share-btn.share-native {
        display: inline-flex !important;
    }
}

/* 3. 无配图文章的微信抓图兜底容器（禁止 display:none，保持屏幕不可见但可被客户端抓取） */
.wx-share-thumb {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    clip-path: inset(50%);
}

/* 4. 电脑端打印 / 导出 PDF 专用排版（覆写旧 responsive.min.css 打印规则） */
@media print {
    @page {
        size: A4;
        margin: 16mm 14mm;
    }

    /* 隐藏导航、页脚、面包屑、侧边栏、分享栏、弹窗、标签及全站悬浮工具 */
    .site-header,
    .site-footer,
    .header,
    .footer,
    .header-spacer,
    .nav-toggle,
    .breadcrumb-wrapper,
    .article-sidebar,
    .article-share,
    .article-nav,
    .article-tags,
    .modal,
    #wxShareModal,
    #shareToast,
    .back-to-top,
    .cw-privacy,
    .cw-controls,
    .floating-cta,
    .skip-link,
    .wx-share-thumb,
    [id*="chat"],
    [class*="chat-widget"],
    [class*="chat-btn"],
    [class*="chat-launcher"],
    [class*="ai-chat"] {
        display: none !important;
    }

    html,
    body {
        background: #fff !important;
        color: #111 !important;
        font-size: 11pt !important;
        line-height: 1.65 !important;
        max-width: none !important;
        overflow: visible !important;
    }

    .container {
        max-width: 100% !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .article-header,
    .article-content {
        padding: 0 !important;
        margin: 0 0 12pt !important;
        background: #fff !important;
    }

    .article-layout {
        display: block !important;
    }

    .article-main {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* 覆写旧 CSS 的 article { page-break-inside: avoid }，允许长文跨页正常排版 */
    article,
    .article-body {
        page-break-inside: auto !important;
        break-inside: auto !important;
    }

    h1,
    h2,
    h3,
    h4 {
        color: #000 !important;
        page-break-after: avoid !important;
        break-after: avoid !important;
    }

    figure,
    img,
    pre,
    blockquote,
    table tr {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    img {
        max-width: 100% !important;
        height: auto !important;
    }

    table {
        width: 100% !important;
        border-collapse: collapse !important;
    }

    /* 覆写旧 CSS 在所有正文链接后追加 URL 造成的噪声 */
    a[href]::after {
        content: none !important;
    }

    /* 在打印文末印出来源单位与原文链接 */
    .article-body[data-print-source]::after {
        content: attr(data-print-source);
        display: block;
        margin-top: 20pt;
        padding-top: 8pt;
        border-top: 1px solid #cbd5e1;
        font-size: 9pt;
        color: #475569;
        word-break: break-all;
    }
}
