/* =========================================================
   yg-prose.css — 内容详情正文商业级排版系统(2026-11-11)
   覆盖:教程详情(.yg-prose) / 文章·公告详情(.yg-article-content)
   设计 token 见 docs/内容栏目商业级视觉升级文档.md §2.1
   注意:表格排除带 inline style 的表(custom-meta 自带样式)
   ========================================================= */

/* ---------- 基础(腾讯云:pingfang SC 栈 + #333 文字) ---------- */
.yg-prose,
.yg-article-content {
    font-size: 15px;
    line-height: 1.85;
    color: #333;
    font-family: "pingfang SC", "helvetica neue", arial, "hiragino sans gb", "microsoft yahei ui", "microsoft yahei", sans-serif;
    word-break: break-word;
}

.yg-prose p,
.yg-article-content p {
    margin: 0 0 13px;
}

/* ---------- 标题层级(腾讯云风:柔黑 600/400,非黑砖;间距收紧) ---------- */
.yg-prose h2,
.yg-article-content h2 {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    margin: 30px 0 14px;
    padding: 0;
    border: 0;
}

.yg-prose h2:first-child,
.yg-article-content h2:first-child {
    margin-top: 4px;
}

.yg-prose h3,
.yg-article-content h3 {
    font-size: 17.5px;
    font-weight: 600;
    color: #333;
    line-height: 1.5;
    margin: 24px 0 10px;
    padding: 0;
    position: static;
}

.yg-prose h3::before,
.yg-article-content h3::before {
    display: none;
}

.yg-prose h4,
.yg-article-content h4 {
    font-size: 15.5px;
    font-weight: 600;
    color: #333;
    margin: 18px 0 8px;
}

.yg-prose h5,
.yg-article-content h5 {
    font-size: 14.5px;
    font-weight: 600;
    color: #444;
    margin: 16px 0 8px;
}

.yg-prose h6,
.yg-article-content h6 {
    font-size: 13.5px;
    font-weight: 600;
    color: #555;
    margin: 14px 0 8px;
}

/* ---------- 列表(源站 style.min.css 全局 ul{list-style:none} 被命中,prose 内显式还原圆点/数字) ---------- */
.yg-prose ul,
.yg-prose ol,
.yg-article-content ul,
.yg-article-content ol {
    margin: 0 0 16px;
    padding-left: 26px;
    list-style: disc outside;
}

.yg-prose ol,
.yg-article-content ol {
    list-style: decimal outside;
}

.yg-prose li,
.yg-article-content li {
    margin: 6px 0;
    line-height: 1.8;
    list-style: inherit;
}

.yg-prose ul li::marker,
.yg-article-content ul li::marker {
    color: #5D87FF;
}

.yg-prose ol li::marker,
.yg-article-content ol li::marker {
    color: #5D87FF;
    font-weight: 600;
}

/* ---------- 引用/注意块(腾讯云风:黄色 callout + ⚠ 图标) ---------- */
.yg-prose blockquote,
.yg-article-content blockquote {
    margin: 20px 0;
    padding: 14px 18px 14px 44px;
    border: 0;
    border-left: 3px solid #f0a020;
    background: #fff8eb;
    border-radius: 4px;
    color: #5c4a1e;
    position: relative;
}

.yg-prose blockquote::before,
.yg-article-content blockquote::before {
    content: "\eab1"; /* ti-alert-circle 近似位;若图标字体不命中退化为圆点 */
    font-family: "tabler-icons";
    position: absolute;
    left: 16px;
    top: 14px;
    font-size: 18px;
    color: #f0a020;
}

.yg-prose blockquote p:last-child,
.yg-article-content blockquote p:last-child {
    margin-bottom: 0;
}

/* ---------- 代码 ---------- */
.yg-prose code,
.yg-article-content code {
    background: #f3f6fb;
    color: #2b6de0;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.yg-prose pre,
.yg-article-content pre {
    position: relative;
    margin: 16px 0;
    padding: 16px;
    background: #1e2a44;
    border-radius: 10px;
    overflow-x: auto;
    color: #e8eefc;
    line-height: 1.7;
}

.yg-prose pre code,
.yg-article-content pre code {
    display: block;
    background: none;
    color: inherit;
    padding: 0;
    font-size: 13px;
    white-space: pre;
}

/* pre 右上复制按钮(yg-prose.js 注入) */
.yg-prose-copy {
    position: absolute;
    top: 8px;
    right: 8px;
    border: 0;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    font-size: 11.5px;
    line-height: 1;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    opacity: .75;
    transition: opacity .15s, background .15s;
}

.yg-prose-copy:hover {
    opacity: 1;
    background: rgba(255, 255, 255, .24);
}

/* ---------- 表格(腾讯云文档风:通栏浅灰表头+行列细线,去卡片圆角) ---------- */
.yg-prose table:not([style]),
.yg-article-content table:not([style]) {
    width: 100%;
    margin: 20px 0;
    border-collapse: collapse;
    font-size: 14px;
    display: table;
    overflow-x: auto;
    border: 1px solid #e3e8ef;
}

.yg-prose table:not([style]) th,
.yg-article-content table:not([style]) th {
    background: #f5f7fa;
    color: #1a1a1a;
    font-weight: 600;
    text-align: left;
    padding: 10px 14px;
    white-space: nowrap;
    border: 1px solid #e3e8ef;
}

.yg-prose table:not([style]) td,
.yg-article-content table:not([style]) td {
    padding: 10px 14px;
    border: 1px solid #e3e8ef;
    color: #24292f;
}

/* ---------- 图片 ---------- */
.yg-prose img,
.yg-article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(17, 25, 45, .08);
    cursor: zoom-in;
}

/* ---------- 链接/分隔线 ---------- */
.yg-prose a,
.yg-article-content a {
    color: #2b6de0;
    text-decoration: none;
}

.yg-prose a:hover,
.yg-article-content a:hover {
    text-decoration: underline;
    color: #1e56c8;
}

.yg-prose hr,
.yg-article-content hr {
    border: 0;
    height: 2px;
    margin: 28px 0;
    background: linear-gradient(90deg, transparent, #dfe6f1 18%, #dfe6f1 82%, transparent);
}

/* =========================================================
   目录卡滚动联动高亮(商业级标配)
   ========================================================= */
/* 覆盖 v4 的 h3+ 大 SVG 图标(data-url 无宽高会渲染成巨大圆圈)→ 5px 小圆点 */
.yg-article-directory-content-h3::before,
.yg-article-directory-content-h4::before,
.yg-article-directory-content-h5::before,
.yg-article-directory-content-h6::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #ff9875;
    margin-right: 6px;
    vertical-align: middle;
}

.yg-article-directory-item a.yg-toc-active {
    color: #5D87FF !important;
    font-weight: 600;
}

.yg-article-directory-item.yg-toc-current {
    position: relative;
}

.yg-article-directory-item.yg-toc-current::after {
    content: "";
    position: absolute;
    left: -1px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    border-radius: 2px;
    background: #5D87FF;
}

/* 移动端目录折叠(<992px 抽屉式,yg-prose.js 注入切换) */
.yg-article-directory-toggle {
    display: none;
}

@media (max-width: 991.98px) {
    .yg-toc-collapsible .yg-article-directory-content {
        display: none;
    }

    .yg-toc-collapsible.yg-toc-open .yg-article-directory-content {
        display: block;
    }

    .yg-toc-collapsible .yg-article-directory-title {
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .yg-toc-collapsible .yg-article-directory-title::after {
        font-family: "tabler-icons" !important;
        content: "\eb51"; /* ti-chevron-down */
        font-size: 15px;
        color: #9aa5b1;
        transition: transform .2s;
    }

    .yg-toc-collapsible.yg-toc-open .yg-article-directory-title::after {
        transform: rotate(180deg);
    }
}

/* =========================================================
   图片灯箱(yg-prose.js 注入)
   ========================================================= */
.yg-prose-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(15, 20, 34, .84);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .18s ease;
    cursor: zoom-out;
}

.yg-prose-lightbox.yg-prose-lightbox-show {
    opacity: 1;
}

.yg-prose-lightbox img {
    max-width: 92vw;
    max-height: 88vh;
    border-radius: 8px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, .4);
    cursor: default;
}

.yg-prose-lightbox-close {
    position: absolute;
    top: 18px;
    right: 22px;
    border: 0;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
}
