/* =========================================================
   CNBlogs Modern IDE Theme — Clean Edition
   使用方法：删除原来的“页面定制 CSS”，完整替换为本文件
   ========================================================= */

/* ---------- 全局变量 ---------- */

:root {
    --page-bg: #edf3f9;
    --page-bg-deep: #e8eef6;
    --panel-bg: #ffffff;
    --panel-soft: #f7f9fc;
    --panel-hover: #f1f5fa;

    --text-main: #17243a;
    --text-normal: #43546c;
    --text-muted: #7f8da3;

    --border: #d7e0eb;
    --border-light: #e7edf4;

    --primary: #3978d4;
    --primary-hover: #2563b9;
    --primary-soft: #edf4ff;

    --success: #2ea043;

    --shadow:
        0 1px 2px rgba(15, 23, 42, 0.03),
        0 8px 24px rgba(49, 70, 99, 0.055);

    --content-width: 1280px;
    --sidebar-width: 276px;

}

/* ---------- 深色页面模式 ---------- */

html[data-ide-theme="dark"] {
    --page-bg: #111827;
    --page-bg-deep: #0f172a;
    --panel-bg: #172132;
    --panel-soft: #1d293b;
    --panel-hover: #243249;

    --text-main: #e8eef7;
    --text-normal: #b5c0d0;
    --text-muted: #8290a5;

    --border: #2d3b50;
    --border-light: #27354a;

    --primary: #69a7f8;
    --primary-hover: #8bbcff;
    --primary-soft: rgba(59, 130, 246, 0.14);

    --shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

/* =========================================================
   基础
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0 !important;
    color: var(--text-main);
    font-family:
        Inter,
        "Segoe UI",
        "PingFang SC",
        "Microsoft YaHei",
        system-ui,
        sans-serif;
    font-size: 15px;
    line-height: 1.72;
    background:
        linear-gradient(
            180deg,
            var(--page-bg),
            var(--page-bg-deep)
        ) fixed;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-hover);
}

img {
    max-width: 100%;
}

::selection {
    color: #ffffff;
    background: rgba(57, 120, 212, 0.82);
}

/* 隐藏博客园默认头部 */

#top_nav,
#blogTitle,
#navigator {
    display: none !important;
}

#header {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

/* =========================================================
   页面布局
   ========================================================= */

#home {
    width: min(calc(100% - 32px), var(--content-width)) !important;
    max-width: var(--content-width) !important;
    margin: 16px auto 40px !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

#main {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) var(--sidebar-width);
    align-items: start;
    gap: 18px;

    width: 100% !important;
    margin: 18px 0 0 !important;
    padding: 0 !important;
    background: transparent !important;
}

#mainContent {
    float: none !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#mainContent .forFlow {
    margin: 0 !important;
}

#sideBar,
#sidebar {
    float: none !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* =========================================================
   自定义 IDE 顶部
   ========================================================= */

.ide-header {
    position: sticky;
    z-index: 1000;
    top: 10px;
    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel-bg);
    box-shadow: var(--shadow);
}

.ide-window-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 34px;
    padding: 0 14px;

    color: var(--text-muted);
    font-family:
        "Cascadia Mono",
        Consolas,
        monospace;
    font-size: 11px;

    border-bottom: 1px solid var(--border-light);
    background: var(--panel-soft);
}

.ide-window-left,
.ide-window-right {
    display: flex;
    align-items: center;
    gap: 11px;
}

.ide-window-dots {
    display: flex;
    gap: 6px;
}

.ide-window-dots i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.ide-window-dots i:nth-child(1) {
    background: #ff605c;
}

.ide-window-dots i:nth-child(2) {
    background: #ffbd44;
}

.ide-window-dots i:nth-child(3) {
    background: #00ca4e;
}

.ide-online {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--success);
    font-weight: 700;
}

.ide-online::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.ide-main-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 68px;
    padding: 0 20px;
}

.ide-brand {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 12px;
}

.ide-brand-logo {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;

    color: #ffffff;
    font-family:
        "Cascadia Mono",
        Consolas,
        monospace;
    font-size: 14px;
    font-weight: 700;

    border-radius: 8px;
    background: var(--primary);
}

.ide-brand-text {
    min-width: 0;
}

.ide-brand-name {
    margin: 0;
    color: var(--text-main);
    font-size: 18px;
    font-weight: 750;
    line-height: 1.25;
}

.ide-brand-name a {
    color: inherit;
}

.ide-brand-desc {
    margin-top: 3px;
    overflow: hidden;
    color: var(--text-muted);
    font-family:
        "Cascadia Mono",
        Consolas,
        monospace;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ide-nav {
    display: flex;
    align-items: center;
    gap: 3px;
}

.ide-nav a,
.ide-theme-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 11px;

    color: var(--text-normal);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;

    border: 1px solid transparent;
    border-radius: 7px;
    outline: none;
    cursor: pointer;
    background: transparent;
}

.ide-nav a:hover,
.ide-theme-button:hover {
    color: var(--primary-hover);
    border-color: var(--border);
    background: var(--panel-hover);
}

.ide-nav a.ide-nav-active {
    color: var(--primary-hover);
    border-color: #d5e3f5;
    background: var(--primary-soft);
}

/* =========================================================
   首页文章列表
   ========================================================= */

/* 去掉日期分组 */

.dayTitle {
    display: none !important;
}

.day {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
}

.day:hover {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
}

.day > .clear,
.day > .postSeparator {
    display: none !important;
}

/* 每篇文章独立卡片 */

.day > .postTitle {
    margin: 0 !important;
    padding: 22px 26px 9px !important;

    border: 1px solid var(--border) !important;
    border-bottom: 0 !important;
    border-radius: 10px 10px 0 0 !important;

    background: var(--panel-bg) !important;
    box-shadow: var(--shadow);
}

.day > .postCon {
    margin: 0 !important;
    padding: 0 26px 14px !important;

    border-right: 1px solid var(--border) !important;
    border-left: 1px solid var(--border) !important;

    background: var(--panel-bg) !important;
}

.day > .postDesc {
    margin: 0 0 15px !important;
    padding: 11px 26px 15px !important;

    color: var(--text-muted) !important;
    font-family:
        "Cascadia Mono",
        Consolas,
        monospace;
    font-size: 10px !important;

    border: 1px solid var(--border) !important;
    border-top: 1px solid var(--border-light) !important;
    border-radius: 0 0 10px 10px !important;

    background: var(--panel-bg) !important;
    box-shadow: var(--shadow);
}

.postTitle,
.entrylistPosttitle,
#topics .postTitle {
    margin: 0 0 10px !important;
    padding: 0 !important;

    color: var(--text-main) !important;
    font-size: clamp(21px, 2vw, 26px) !important;
    font-weight: 760 !important;
    line-height: 1.4 !important;
    letter-spacing: -0.02em;

    border: 0 !important;
}

.postTitle a,
.entrylistPosttitle a {
    color: var(--text-main) !important;
}

.postTitle a:hover,
.entrylistPosttitle a:hover {
    color: var(--primary-hover) !important;
}

.postCon,
.entrylistPostSummary,
.c_b_p_desc {
    color: var(--text-normal) !important;
    font-size: 14px !important;
    line-height: 1.72 !important;
}

.c_b_p_desc_readmore {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    margin-left: 6px;
    padding: 0 9px;

    color: var(--primary-hover) !important;
    font-size: 11px;
    font-weight: 650;

    border: 1px solid #d5e3f5;
    border-radius: 6px;
    background: var(--primary-soft);
}

/* 文章详情卡片 */

#topics,
.post {
    margin: 0 0 18px !important;
    padding: 26px 28px !important;

    border: 1px solid var(--border) !important;
    border-radius: 11px !important;
    background: var(--panel-bg) !important;
    box-shadow: var(--shadow);
}

/* =========================================================
   正文排版
   ========================================================= */

#cnblogs_post_body,
.blogpost-body,
.postBody {
    color: var(--text-main) !important;
    font-size: 15px !important;
    line-height: 1.76 !important;
}

#cnblogs_post_body p,
.blogpost-body p,
.postBody p {
    margin: 0.72em 0 !important;
}

#cnblogs_post_body li,
.blogpost-body li,
.postBody li {
    margin: 2px 0 !important;
}

#cnblogs_post_body h1,
#cnblogs_post_body h2,
#cnblogs_post_body h3,
#cnblogs_post_body h4,
.blogpost-body h1,
.blogpost-body h2,
.blogpost-body h3,
.blogpost-body h4 {
    color: var(--text-main) !important;
    font-weight: 750;
    line-height: 1.45;
    letter-spacing: -0.02em;
    scroll-margin-top: 115px;
}

#cnblogs_post_body h2,
.blogpost-body h2 {
    margin: 1.8em 0 0.75em;
    padding: 7px 11px;

    font-size: 22px;
    border-left: 4px solid var(--primary);
    border-radius: 3px;
    background: linear-gradient(
        90deg,
        var(--primary-soft),
        transparent 76%
    );
}

#cnblogs_post_body h3,
.blogpost-body h3 {
    margin: 1.55em 0 0.65em;
    font-size: 18px;
}

#cnblogs_post_body h3::before,
.blogpost-body h3::before {
    content: "##";
    margin-right: 8px;
    color: var(--primary);
    font-family:
        "Cascadia Mono",
        Consolas,
        monospace;
    font-size: 0.7em;
}

#cnblogs_post_body strong,
.blogpost-body strong {
    color: var(--primary-hover);
}

#cnblogs_post_body blockquote,
.blogpost-body blockquote {
    margin: 18px 0;
    padding: 13px 16px;

    color: var(--text-normal);
    border: 1px solid #d8e5f5;
    border-left: 4px solid var(--primary);
    border-radius: 7px;
    background: #f5f9ff;
}

#cnblogs_post_body img,
.blogpost-body img {
    display: block;
    margin: 20px auto;
    border: 1px solid var(--border);
    border-radius: 7px;
    box-shadow: var(--shadow);
}

/* 行内代码 */

#cnblogs_post_body p code,
#cnblogs_post_body li code,
.blogpost-body p code,
.blogpost-body li code {
    margin: 0 2px;
    padding: 2px 5px;

    color: #b4235a;
    font-family:
        "Cascadia Mono",
        Consolas,
        monospace;
    font-size: 0.9em;

    border: 1px solid #ead5df;
    border-radius: 5px;
    background: #fff5f8;
}

/* =========================================================
   普通表格
   ========================================================= */

#cnblogs_post_body table:not(.cnblogs_code table),
.blogpost-body table:not(.cnblogs_code table) {
    width: 100%;
    margin: 18px 0;
    border-spacing: 0;
    border-collapse: separate;
    border: 1px solid var(--border);
    border-radius: 8px;
}

#cnblogs_post_body table:not(.cnblogs_code table) th,
#cnblogs_post_body table:not(.cnblogs_code table) td,
.blogpost-body table:not(.cnblogs_code table) th,
.blogpost-body table:not(.cnblogs_code table) td {
    padding: 9px 12px;
    text-align: left;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

#cnblogs_post_body table:not(.cnblogs_code table) th,
.blogpost-body table:not(.cnblogs_code table) th {
    font-weight: 700;
    background: var(--panel-soft);
}

#cnblogs_post_body table:not(.cnblogs_code table) tr:last-child td,
.blogpost-body table:not(.cnblogs_code table) tr:last-child td {
    border-bottom: 0;
}

#cnblogs_post_body table:not(.cnblogs_code table) th:last-child,
#cnblogs_post_body table:not(.cnblogs_code table) td:last-child,
.blogpost-body table:not(.cnblogs_code table) th:last-child,
.blogpost-body table:not(.cnblogs_code table) td:last-child {
    border-right: 0;
}

/* =========================================================
   侧边栏
   ========================================================= */

#sideBar > div,
#sideBarMain > div,
.newsItem,
.catList {
    margin: 0 0 14px !important;
    padding: 16px !important;

    border: 1px solid var(--border) !important;
    border-radius: 9px !important;
    background: var(--panel-bg) !important;
    box-shadow: var(--shadow);
}

#sideBar h3,
#sideBar .catListTitle {
    position: relative;
    margin: 0 0 11px !important;
    padding: 0 0 9px 11px !important;

    color: var(--text-main) !important;
    font-size: 13px !important;
    font-weight: 700 !important;

    border-bottom: 1px solid var(--border-light) !important;
    background: transparent !important;
}

#sideBar h3::before,
#sideBar .catListTitle::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 0;
    width: 3px;
    height: 16px;
    border-radius: 2px;
    background: var(--primary);
}

#sideBar ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

#sideBar li {
    margin: 2px 0;
}

#sideBar li a {
    display: block;
    overflow: hidden;
    padding: 6px 7px;

    color: var(--text-normal);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;

    border-radius: 6px;
}

#sideBar li a:hover {
    color: var(--primary-hover);
    background: var(--panel-hover);
}

/* 侧边栏个人卡片 */

.ide-profile {
    color: var(--text-normal);
}

.ide-profile-head {
    display: flex;
    align-items: center;
    gap: 11px;
}

.ide-profile-avatar {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    overflow: hidden;

    color: #ffffff;
    font-family:
        "Cascadia Mono",
        Consolas,
        monospace;
    font-size: 16px;
    font-weight: 700;

    border-radius: 9px;
    background: var(--primary);
}

.ide-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ide-profile-name {
    margin: 0;
    color: var(--text-main);
    font-size: 15px;
    font-weight: 750;
}

.ide-profile-role {
    margin-top: 3px;
    color: var(--text-muted);
    font-family:
        "Cascadia Mono",
        Consolas,
        monospace;
    font-size: 9px;
}

.ide-profile-status {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 12px 0;
    padding: 7px 9px;

    color: var(--success);
    font-family:
        "Cascadia Mono",
        Consolas,
        monospace;
    font-size: 9px;

    border: 1px solid #d9eadf;
    border-radius: 6px;
    background: #f3fbf5;
}

.ide-profile-status::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.ide-profile-desc {
    margin: 10px 0;
    color: var(--text-normal);
    font-size: 11px;
    line-height: 1.7;
}

.ide-profile-label {
    margin: 13px 0 7px;
    color: var(--text-muted);
    font-family:
        "Cascadia Mono",
        Consolas,
        monospace;
    font-size: 9px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ide-profile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.ide-profile-tags span {
    padding: 3px 7px;
    color: #52749f;
    font-family:
        "Cascadia Mono",
        Consolas,
        monospace;
    font-size: 9px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--panel-soft);
}

.ide-profile-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 12px;
}

.ide-profile-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 31px;

    color: var(--text-normal);
    font-size: 10px;
    font-weight: 600;

    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--panel-soft);
}

/* =========================================================
   搜索框
   ========================================================= */

#sidebar_search_box,
#widget_my_zzk .div_my_zzk,
#widget_my_zzk > div:last-child {
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
    width: 100% !important;
    min-width: 0 !important;
}

#q,
.input_my_zzk {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    height: 36px !important;
    margin: 0 !important;
    padding: 0 10px !important;

    color: var(--text-main) !important;
    font-size: 11px;

    border: 1px solid var(--border) !important;
    border-radius: 7px !important;
    outline: none !important;
    background: var(--panel-soft) !important;
}

#q:focus,
.input_my_zzk:focus {
    border-color: #8cb8ee !important;
    box-shadow: 0 0 0 3px rgba(57, 120, 212, 0.09);
}

#sidebar_search_box #btnZzk,
#sidebar_search_box .btn_my_zzk,
#widget_my_zzk .btn_my_zzk,
.btn_my_zzk {
    flex: 0 0 58px !important;
    width: 58px !important;
    min-width: 58px !important;
    height: 36px !important;
    margin: 0 !important;
    padding: 0 7px !important;

    color: #ffffff !important;
    font-size: 10px;
    font-weight: 650;
    line-height: 36px !important;
    text-align: center !important;
    white-space: nowrap !important;

    border: 0 !important;
    border-radius: 7px !important;
    cursor: pointer;
    background: var(--primary) !important;
}

/* =========================================================
   分页 / 评论 / 页脚
   ========================================================= */

.pager {
    margin: 24px 0 !important;
    text-align: center;
}

.pager a,
.pager span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    margin: 3px;
    padding: 0 8px;

    color: var(--text-normal);
    font-size: 11px;

    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--panel-bg);
}

.pager a:hover,
.pager .current {
    color: #ffffff;
    border-color: var(--primary);
    background: var(--primary);
}

.feedback_area_title,
.feedbackItem,
#comment_form_container {
    margin-top: 16px;
    padding: 18px;

    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--panel-bg);
    box-shadow: var(--shadow);
}

.comment_textarea {
    width: 100% !important;
    min-height: 140px !important;
    padding: 11px !important;

    color: var(--text-main) !important;
    border: 1px solid var(--border) !important;
    border-radius: 7px !important;
    outline: none;
    background: var(--panel-soft) !important;
}

#ide-reading-progress {
    position: fixed;
    z-index: 10000;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--primary);
}

.ide-floating-tools {
    position: fixed;
    z-index: 990;
    right: 16px;
    bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.ide-floating-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 37px;
    height: 37px;

    color: var(--text-normal);
    font-size: 14px;

    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    background: var(--panel-bg);
    box-shadow: var(--shadow);
}

.ide-custom-footer {
    width: min(calc(100% - 32px), var(--content-width));
    margin: 0 auto 22px;
    padding: 16px 20px;

    color: var(--text-muted);
    font-family:
        "Cascadia Mono",
        Consolas,
        monospace;
    font-size: 10px;
    text-align: center;

    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--panel-bg);
    box-shadow: var(--shadow);
}

#footer {
    color: var(--text-muted) !important;
    background: transparent !important;
}

/* =========================================================
   响应式
   ========================================================= */

@media screen and (max-width: 980px) {
    :root {
        --sidebar-width: 250px;
    }

    .ide-main-bar {
        padding: 0 16px;
    }

    .ide-nav a,
    .ide-theme-button {
        padding: 0 8px;
    }
}

@media screen and (max-width: 820px) {
    #home {
        width: calc(100% - 18px) !important;
        margin-top: 9px !important;
    }

    #main {
        grid-template-columns: 1fr;
    }

    #sideBar {
        order: 2;
    }

    .ide-header {
        top: 5px;
    }

    .ide-main-bar {
        align-items: flex-start;
        flex-direction: column;
        gap: 11px;
        padding: 14px;
    }

    .ide-nav {
        width: 100%;
        overflow-x: auto;
    }

    .ide-nav a {
        flex: 0 0 auto;
    }

    #topics,
    .post {
        padding: 22px 18px !important;
    }
}

@media screen and (max-width: 560px) {
    .ide-window-right,
    .ide-brand-desc {
        display: none;
    }

    .ide-main-bar {
        min-height: auto;
    }

    .ide-brand-name {
        font-size: 16px;
    }

    .day > .postTitle {
        padding: 18px 16px 7px !important;
    }

    .day > .postCon {
        padding: 0 16px 12px !important;
    }

    .day > .postDesc {
        padding: 10px 16px 13px !important;
    }

    .postTitle,
    .entrylistPosttitle {
        font-size: 20px !important;
    }

    #cnblogs_post_body,
    .blogpost-body,
    .postBody {
        font-size: 14px !important;
    }

    #cnblogs_post_body .cnblogs_code,
    #cnblogs_post_body > pre,
    #cnblogs_post_body .ide-code-shell,
    #cnblogs_post_body .mono-atom-shell,
    #cnblogs_post_body .mono-code-final,
    .blogpost-body .cnblogs_code,
    .blogpost-body > pre,
    .blogpost-body .ide-code-shell,
    .blogpost-body .mono-atom-shell,
    .blogpost-body .mono-code-final,
    .postBody .cnblogs_code,
    .postBody > pre,
    .postBody .ide-code-shell,
    .postBody .mono-atom-shell,
    .postBody .mono-code-final {
        width: 100% !important;
        max-width: none !important;
    }

    #cnblogs_post_body .cnblogs_code td,
    .blogpost-body .cnblogs_code td,
    .postBody .cnblogs_code td {
        height: 19px !important;
        min-height: 19px !important;
        font-size: 12.5px !important;
        line-height: 19px !important;
    }

    #cnblogs_post_body .cnblogs_code td:first-child,
    .blogpost-body .cnblogs_code td:first-child,
    .postBody .cnblogs_code td:first-child {
        width: 42px !important;
        min-width: 42px !important;
        padding-right: 7px !important;
    }

    #cnblogs_post_body .cnblogs_code td:last-child,
    .blogpost-body .cnblogs_code td:last-child,
    .postBody .cnblogs_code td:last-child {
        padding-left: 11px !important;
        padding-right: 39px !important;
    }

    #cnblogs_post_body > pre,
    .blogpost-body > pre,
    .postBody > pre,
    .cnblogs_code pre,
    .ide-code-shell pre,
    .mono-atom-shell pre,
    .mono-code-final pre {
        padding: 10px 40px 10px 12px !important;
        font-size: 12.5px !important;
        line-height: 1.45 !important;
    }

    .ide-code-body,
    .mono-atom-body {
        grid-template-columns: 42px minmax(0, 1fr) !important;
    }

    .ide-code-lines,
    .mono-atom-lines,
    .mono-code-final__gutter {
        padding: 10px 7px 10px 0 !important;
        font-size: 12.5px !important;
        line-height: 1.45 !important;
    }

    .ide-floating-tools {
        right: 9px;
        bottom: 11px;
    }
}

/* =========================================================
   Final priority: bright code-toolbar controls
   复制 / 折叠 / 全屏 / 语言标识在深色顶栏上保持清晰可见
   ========================================================= */

:root {
    --mono-atom-toolbar-fg: #f8fafc;
    --mono-atom-toolbar-muted: #dbe4ee;
    --mono-atom-toolbar-hover: rgba(255, 255, 255, 0.14);
    --mono-atom-toolbar-focus: rgba(125, 211, 252, 0.9);
}

.cnblogs_code_toolbar,
.cnblogs_code .code-toolbar,
.cnblogs_code .tools,
.ide-code-toolbar,
.mono-atom-toolbar,
.mono-code-final__toolbar,
#cnblogs_post_body [class*="code"] [class*="toolbar"],
#cnblogs_post_body [class*="code"] [class*="tools"],
.blogpost-body [class*="code"] [class*="toolbar"],
.blogpost-body [class*="code"] [class*="tools"],
.postBody [class*="code"] [class*="toolbar"],
.postBody [class*="code"] [class*="tools"] {
    color: var(--mono-atom-toolbar-muted) !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* 按钮、链接和文字标签。 */

.cnblogs_code button,
.cnblogs_code .tools a,
.cnblogs_code .tools span,
.cnblogs_code_toolbar button,
.cnblogs_code_toolbar a,
.cnblogs_code_toolbar span,
.ide-code-toolbar button,
.ide-code-toolbar a,
.ide-code-toolbar span,
.mono-atom-toolbar button,
.mono-atom-toolbar a,
.mono-atom-toolbar span,
.mono-code-final__toolbar button,
.mono-code-final__toolbar a,
.mono-code-final__toolbar span,
#cnblogs_post_body [class*="code"] [class*="copy"],
#cnblogs_post_body [class*="code"] [class*="fold"],
#cnblogs_post_body [class*="code"] [class*="full"],
#cnblogs_post_body [class*="code"] [class*="language"],
.blogpost-body [class*="code"] [class*="copy"],
.blogpost-body [class*="code"] [class*="fold"],
.blogpost-body [class*="code"] [class*="full"],
.blogpost-body [class*="code"] [class*="language"],
.postBody [class*="code"] [class*="copy"],
.postBody [class*="code"] [class*="fold"],
.postBody [class*="code"] [class*="full"],
.postBody [class*="code"] [class*="language"] {
    color: var(--mono-atom-toolbar-fg) !important;
    -webkit-text-fill-color: var(--mono-atom-toolbar-fg) !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45) !important;
    opacity: 1 !important;
    visibility: visible !important;
    filter: none !important;
}

/* SVG、字体图标和伪元素也强制使用亮色。 */

.cnblogs_code_toolbar svg,
.cnblogs_code_toolbar svg *,
.cnblogs_code .tools svg,
.cnblogs_code .tools svg *,
.ide-code-toolbar svg,
.ide-code-toolbar svg *,
.mono-atom-toolbar svg,
.mono-atom-toolbar svg *,
.mono-code-final__toolbar svg,
.mono-code-final__toolbar svg *,
#cnblogs_post_body [class*="code"] [class*="toolbar"] svg,
#cnblogs_post_body [class*="code"] [class*="toolbar"] svg *,
.blogpost-body [class*="code"] [class*="toolbar"] svg,
.blogpost-body [class*="code"] [class*="toolbar"] svg *,
.postBody [class*="code"] [class*="toolbar"] svg,
.postBody [class*="code"] [class*="toolbar"] svg * {
    color: var(--mono-atom-toolbar-fg) !important;
    fill: currentColor !important;
    stroke: currentColor !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.cnblogs_code_toolbar i,
.cnblogs_code .tools i,
.ide-code-toolbar i,
.mono-atom-toolbar i,
.mono-code-final__toolbar i,
.cnblogs_code_toolbar button::before,
.cnblogs_code_toolbar button::after,
.cnblogs_code .tools button::before,
.cnblogs_code .tools button::after,
.ide-code-toolbar button::before,
.ide-code-toolbar button::after,
.mono-atom-toolbar button::before,
.mono-atom-toolbar button::after,
.mono-code-final__toolbar button::before,
.mono-code-final__toolbar button::after {
    color: var(--mono-atom-toolbar-fg) !important;
    border-color: currentColor !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* 如果按钮图标是位图，转换成亮色。 */

.cnblogs_code_toolbar img,
.cnblogs_code .tools img,
.ide-code-toolbar img,
.mono-atom-toolbar img,
.mono-code-final__toolbar img {
    opacity: 1 !important;
    filter: grayscale(1) brightness(0) invert(1) !important;
}

/* 悬停、键盘聚焦和按下状态。 */

.cnblogs_code button:hover,
.cnblogs_code .tools a:hover,
.cnblogs_code_toolbar button:hover,
.cnblogs_code_toolbar a:hover,
.ide-code-toolbar button:hover,
.ide-code-toolbar a:hover,
.mono-atom-toolbar button:hover,
.mono-atom-toolbar a:hover,
.mono-code-final__toolbar button:hover,
.mono-code-final__toolbar a:hover {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background: var(--mono-atom-toolbar-hover) !important;
    opacity: 1 !important;
}

.cnblogs_code button:focus-visible,
.cnblogs_code .tools a:focus-visible,
.cnblogs_code_toolbar button:focus-visible,
.cnblogs_code_toolbar a:focus-visible,
.ide-code-toolbar button:focus-visible,
.ide-code-toolbar a:focus-visible,
.mono-atom-toolbar button:focus-visible,
.mono-atom-toolbar a:focus-visible,
.mono-code-final__toolbar button:focus-visible,
.mono-code-final__toolbar a:focus-visible {
    color: #ffffff !important;
    outline: 2px solid var(--mono-atom-toolbar-focus) !important;
    outline-offset: 1px !important;
    background: var(--mono-atom-toolbar-hover) !important;
}

.cnblogs_code button:active,
.cnblogs_code_toolbar button:active,
.ide-code-toolbar button:active,
.mono-atom-toolbar button:active,
.mono-code-final__toolbar button:active {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.2) !important;
}

/* =========================================================
   Compact Borderless Code - 图二式紧凑代码 / 样例区
   最终覆盖：无外框、无单元格线、无行号栏
   ========================================================= */

/* 普通正文表格也不再显示纵横网格。 */

#cnblogs_post_body table,
.blogpost-body table,
.postBody table {
    margin: 10px 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    border-spacing: 0 !important;
    border-collapse: collapse !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

#cnblogs_post_body table tr,
#cnblogs_post_body table th,
#cnblogs_post_body table td,
.blogpost-body table tr,
.blogpost-body table th,
.blogpost-body table td,
.postBody table tr,
.postBody table th,
.postBody table td {
    height: auto !important;
    min-height: 0 !important;
    padding: 3px 7px !important;
    line-height: 1.45 !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}

/* 代码块整体更扁平、紧凑，不显示描边和悬浮阴影。 */

#cnblogs_post_body .cnblogs_code,
#cnblogs_post_body > pre,
#cnblogs_post_body .ide-code-shell,
#cnblogs_post_body .mono-atom-shell,
#cnblogs_post_body .mono-code-final,
.blogpost-body .cnblogs_code,
.blogpost-body > pre,
.blogpost-body .ide-code-shell,
.blogpost-body .mono-atom-shell,
.blogpost-body .mono-code-final,
.postBody .cnblogs_code,
.postBody > pre,
.postBody .ide-code-shell,
.postBody .mono-atom-shell,
.postBody .mono-code-final {
    margin: 10px 0 14px !important;
    border: 0 !important;
    border-radius: 5px !important;
    outline: 0 !important;
    background: var(--mono-atom-bg) !important;
    box-shadow: none !important;
}

/* 博客园代码表、SyntaxHighlighter 与自定义 Mono Atom 表全部去格。 */

#cnblogs_post_body .cnblogs_code table,
#cnblogs_post_body table.cnblogs_code,
#cnblogs_post_body .syntaxhighlighter table,
#cnblogs_post_body .codehilite table,
#cnblogs_post_body [class*="code-shell"] table,
#cnblogs_post_body [class*="mono-atom"] table,
#cnblogs_post_body [class*="mono-code"] table,
.blogpost-body .cnblogs_code table,
.blogpost-body table.cnblogs_code,
.blogpost-body .syntaxhighlighter table,
.blogpost-body .codehilite table,
.blogpost-body [class*="code-shell"] table,
.blogpost-body [class*="mono-atom"] table,
.blogpost-body [class*="mono-code"] table,
.postBody .cnblogs_code table,
.postBody table.cnblogs_code,
.postBody .syntaxhighlighter table,
.postBody .codehilite table,
.postBody [class*="code-shell"] table,
.postBody [class*="mono-atom"] table,
.postBody [class*="mono-code"] table {
    margin: 0 !important;
    padding: 8px 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    border-spacing: 0 !important;
    border-collapse: collapse !important;
    background: var(--mono-atom-bg) !important;
    box-shadow: none !important;
}

#cnblogs_post_body .cnblogs_code tr,
#cnblogs_post_body .cnblogs_code th,
#cnblogs_post_body .cnblogs_code td,
#cnblogs_post_body table.cnblogs_code tr,
#cnblogs_post_body table.cnblogs_code th,
#cnblogs_post_body table.cnblogs_code td,
#cnblogs_post_body .syntaxhighlighter tr,
#cnblogs_post_body .syntaxhighlighter td,
#cnblogs_post_body .codehilite tr,
#cnblogs_post_body .codehilite td,
#cnblogs_post_body [class*="code-shell"] tr,
#cnblogs_post_body [class*="code-shell"] td,
#cnblogs_post_body [class*="mono-atom"] tr,
#cnblogs_post_body [class*="mono-atom"] td,
#cnblogs_post_body [class*="mono-code"] tr,
#cnblogs_post_body [class*="mono-code"] td,
.blogpost-body .cnblogs_code tr,
.blogpost-body .cnblogs_code th,
.blogpost-body .cnblogs_code td,
.blogpost-body table.cnblogs_code tr,
.blogpost-body table.cnblogs_code th,
.blogpost-body table.cnblogs_code td,
.blogpost-body .syntaxhighlighter tr,
.blogpost-body .syntaxhighlighter td,
.blogpost-body .codehilite tr,
.blogpost-body .codehilite td,
.blogpost-body [class*="code-shell"] tr,
.blogpost-body [class*="code-shell"] td,
.blogpost-body [class*="mono-atom"] tr,
.blogpost-body [class*="mono-atom"] td,
.blogpost-body [class*="mono-code"] tr,
.blogpost-body [class*="mono-code"] td,
.postBody .cnblogs_code tr,
.postBody .cnblogs_code th,
.postBody .cnblogs_code td,
.postBody .syntaxhighlighter tr,
.postBody .syntaxhighlighter td,
.postBody .codehilite tr,
.postBody .codehilite td,
.postBody [class*="code-shell"] tr,
.postBody [class*="code-shell"] td,
.postBody [class*="mono-atom"] tr,
.postBody [class*="mono-atom"] td,
.postBody [class*="mono-code"] tr,
.postBody [class*="mono-code"] td {
    height: 20px !important;
    min-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    font-size: 13.5px !important;
    line-height: 20px !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}

/* 图二没有左侧行号：隐藏所有常见 gutter / line-number 容器。 */

#cnblogs_post_body .cnblogs_code td:first-child,
#cnblogs_post_body table.cnblogs_code td:first-child,
#cnblogs_post_body .syntaxhighlighter .gutter,
#cnblogs_post_body .codehilite .linenos,
#cnblogs_post_body [class*="code-shell"] td:first-child,
#cnblogs_post_body [class*="mono-atom"] td:first-child,
#cnblogs_post_body [class*="mono-code"] td:first-child,
.blogpost-body .cnblogs_code td:first-child,
.blogpost-body table.cnblogs_code td:first-child,
.blogpost-body .syntaxhighlighter .gutter,
.blogpost-body .codehilite .linenos,
.blogpost-body [class*="code-shell"] td:first-child,
.blogpost-body [class*="mono-atom"] td:first-child,
.blogpost-body [class*="mono-code"] td:first-child,
.postBody .cnblogs_code td:first-child,
.postBody table.cnblogs_code td:first-child,
.postBody .syntaxhighlighter .gutter,
.postBody .codehilite .linenos,
.postBody [class*="code-shell"] td:first-child,
.postBody [class*="mono-atom"] td:first-child,
.postBody [class*="mono-code"] td:first-child,
.ide-code-lines,
.mono-atom-lines,
.mono-code-final__gutter,
.line-numbers-rows,
.code-line-number,
.code-linenumber,
.lineno {
    display: none !important;
    width: 0 !important;
    min-width: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

#cnblogs_post_body .cnblogs_code td:last-child,
#cnblogs_post_body table.cnblogs_code td:last-child,
#cnblogs_post_body [class*="code-shell"] td:last-child,
#cnblogs_post_body [class*="mono-atom"] td:last-child,
#cnblogs_post_body [class*="mono-code"] td:last-child,
.blogpost-body .cnblogs_code td:last-child,
.blogpost-body table.cnblogs_code td:last-child,
.blogpost-body [class*="code-shell"] td:last-child,
.blogpost-body [class*="mono-atom"] td:last-child,
.blogpost-body [class*="mono-code"] td:last-child,
.postBody .cnblogs_code td:last-child,
.postBody table.cnblogs_code td:last-child,
.postBody [class*="code-shell"] td:last-child,
.postBody [class*="mono-atom"] td:last-child,
.postBody [class*="mono-code"] td:last-child {
    width: 100% !important;
    padding: 0 13px !important;
    white-space: pre !important;
}

/* 单个 pre 采用图二的紧凑留白。 */

#cnblogs_post_body > pre,
.blogpost-body > pre,
.postBody > pre,
.cnblogs_code pre,
.ide-code-shell pre,
.mono-atom-shell pre,
.mono-code-final pre,
pre code.hljs {
    padding: 10px 13px !important;
    font-size: 13.5px !important;
    line-height: 1.45 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: var(--mono-atom-bg) !important;
    box-shadow: none !important;
}

/* 工具栏更紧凑，并去掉底部分隔线。 */

.cnblogs_code_toolbar,
.cnblogs_code .code-toolbar,
.cnblogs_code .tools,
.ide-code-toolbar,
.mono-atom-toolbar,
.mono-code-final__toolbar {
    min-height: 28px !important;
    padding: 0 8px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: var(--mono-atom-topbar) !important;
    box-shadow: none !important;
}

.cnblogs_code button,
.ide-code-shell button,
.mono-atom-shell button,
.mono-code-final button {
    min-height: 22px !important;
    padding: 0 6px !important;
    font-size: 10px !important;
}

/* 若正文保留 Codeforces 的 sample-test 结构，自动排成图二的输入 / 输出双栏。 */

#cnblogs_post_body .sample-test,
.blogpost-body .sample-test,
.postBody .sample-test {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    margin: 12px 0 !important;
}

#cnblogs_post_body .sample-test > .input,
#cnblogs_post_body .sample-test > .output,
.blogpost-body .sample-test > .input,
.blogpost-body .sample-test > .output,
.postBody .sample-test > .input,
.postBody .sample-test > .output {
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

@media screen and (max-width: 640px) {
    #cnblogs_post_body .sample-test,
    .blogpost-body .sample-test,
    .postBody .sample-test {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    #cnblogs_post_body .cnblogs_code td,
    #cnblogs_post_body table.cnblogs_code td,
    .blogpost-body .cnblogs_code td,
    .blogpost-body table.cnblogs_code td,
    .postBody .cnblogs_code td {
        height: 19px !important;
        font-size: 12.5px !important;
        line-height: 19px !important;
    }
}

/* =========================================================
   正文去格 + VS Code Mono Atom 代码区
   放在文件末尾，用于覆盖博客园默认代码表格样式
   ========================================================= */

:root {
    --mono-atom-bg: #282c34;
    --mono-atom-topbar: #21252b;
    --mono-atom-gutter: #252931;
    --mono-atom-fg: #abb2bf;
    --mono-atom-muted: #636d83;
    --mono-atom-divider: rgba(171, 178, 191, 0.12);
    --mono-atom-selection: rgba(97, 175, 239, 0.26);

    --mono-atom-red: #e06c75;
    --mono-atom-orange: #d19a66;
    --mono-atom-yellow: #e5c07b;
    --mono-atom-green: #98c379;
    --mono-atom-cyan: #56b6c2;
    --mono-atom-blue: #61afef;
    --mono-atom-purple: #c678dd;
    --mono-atom-comment: #5c6370;
}

/* 正文段落不使用卡片、描边或网格背景。 */

#cnblogs_post_body p,
.blogpost-body p,
.postBody p {
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* 行内代码保留语义色，但不再形成一个个小矩形。 */

#cnblogs_post_body p code,
#cnblogs_post_body li code,
.blogpost-body p code,
.blogpost-body li code,
.postBody p code,
.postBody li code {
    margin: 0 0.12em !important;
    padding: 0 !important;
    color: #a33bb7 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* 代码编辑器外壳。仅保留一个整体编辑器面板，不给每一行画框。 */

#cnblogs_post_body .cnblogs_code,
#cnblogs_post_body > pre,
#cnblogs_post_body .ide-code-shell,
#cnblogs_post_body .mono-atom-shell,
#cnblogs_post_body .mono-code-final,
.blogpost-body .cnblogs_code,
.blogpost-body > pre,
.blogpost-body .ide-code-shell,
.blogpost-body .mono-atom-shell,
.blogpost-body .mono-code-final,
.postBody .cnblogs_code,
.postBody > pre,
.postBody .ide-code-shell,
.postBody .mono-atom-shell,
.postBody .mono-code-final {
    position: relative;
    width: 100% !important;
    max-width: 100% !important;
    margin: 22px 0 !important;
    padding: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-inline: contain;

    color: var(--mono-atom-fg) !important;
    font-family:
        "Cascadia Mono",
        "JetBrains Mono",
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace !important;
    font-variant-ligatures: contextual;

    border: 0 !important;
    border-radius: 10px !important;
    outline: 0 !important;
    background: var(--mono-atom-bg) !important;
    box-shadow:
        0 12px 30px rgba(15, 23, 42, 0.16),
        0 0 0 1px rgba(15, 23, 42, 0.1) !important;
}

/* 博客园可能把代码渲染成 table；彻底清除 table/tr/td 的矩形格子。 */

#cnblogs_post_body .cnblogs_code table,
#cnblogs_post_body table.cnblogs_code,
.blogpost-body .cnblogs_code table,
.blogpost-body table.cnblogs_code,
.postBody .cnblogs_code table,
.postBody table.cnblogs_code,
.ide-code-shell table,
.mono-atom-shell table,
.mono-code-final table {
    width: 100% !important;
    margin: 0 !important;
    padding: 12px 0 !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    border-spacing: 0 !important;
    border-collapse: collapse !important;
    outline: 0 !important;
    background: var(--mono-atom-bg) !important;
    box-shadow: none !important;
}

#cnblogs_post_body .cnblogs_code tbody,
#cnblogs_post_body .cnblogs_code tr,
#cnblogs_post_body .cnblogs_code th,
#cnblogs_post_body .cnblogs_code td,
#cnblogs_post_body table.cnblogs_code tbody,
#cnblogs_post_body table.cnblogs_code tr,
#cnblogs_post_body table.cnblogs_code th,
#cnblogs_post_body table.cnblogs_code td,
.blogpost-body .cnblogs_code tbody,
.blogpost-body .cnblogs_code tr,
.blogpost-body .cnblogs_code th,
.blogpost-body .cnblogs_code td,
.blogpost-body table.cnblogs_code tbody,
.blogpost-body table.cnblogs_code tr,
.blogpost-body table.cnblogs_code th,
.blogpost-body table.cnblogs_code td,
.postBody .cnblogs_code tbody,
.postBody .cnblogs_code tr,
.postBody .cnblogs_code th,
.postBody .cnblogs_code td,
.ide-code-shell tbody,
.ide-code-shell tr,
.ide-code-shell td,
.mono-atom-shell tbody,
.mono-atom-shell tr,
.mono-atom-shell td,
.mono-code-final tbody,
.mono-code-final tr,
.mono-code-final td {
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}

#cnblogs_post_body .cnblogs_code tr,
#cnblogs_post_body table.cnblogs_code tr,
.blogpost-body .cnblogs_code tr,
.blogpost-body table.cnblogs_code tr,
.postBody .cnblogs_code tr,
.ide-code-shell tr,
.mono-atom-shell tr,
.mono-code-final tr {
    height: auto !important;
    min-height: 0 !important;
}

#cnblogs_post_body .cnblogs_code td,
#cnblogs_post_body table.cnblogs_code td,
.blogpost-body .cnblogs_code td,
.blogpost-body table.cnblogs_code td,
.postBody .cnblogs_code td,
.ide-code-shell td,
.mono-atom-shell td,
.mono-code-final td {
    height: 22px !important;
    min-height: 22px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    color: var(--mono-atom-fg) !important;
    font-family: inherit !important;
    font-size: 13.5px !important;
    line-height: 22px !important;
    vertical-align: top !important;
}

/* 行号区只有一条整体分隔线，不再为每个行号画格子。 */

#cnblogs_post_body .cnblogs_code td:first-child,
#cnblogs_post_body table.cnblogs_code td:first-child,
.blogpost-body .cnblogs_code td:first-child,
.blogpost-body table.cnblogs_code td:first-child,
.postBody .cnblogs_code td:first-child,
.ide-code-shell td:first-child,
.mono-atom-shell td:first-child,
.mono-code-final td:first-child,
.ide-code-lines,
.mono-atom-lines,
.mono-code-final__gutter {
    width: 54px !important;
    min-width: 54px !important;
    padding-right: 14px !important;
    padding-left: 8px !important;
    color: var(--mono-atom-muted) !important;
    text-align: right !important;
    user-select: none;
    border: 0 !important;
    background: var(--mono-atom-gutter) !important;
    box-shadow: inset -1px 0 var(--mono-atom-divider) !important;
}

#cnblogs_post_body .cnblogs_code td:last-child,
#cnblogs_post_body table.cnblogs_code td:last-child,
.blogpost-body .cnblogs_code td:last-child,
.blogpost-body table.cnblogs_code td:last-child,
.postBody .cnblogs_code td:last-child,
.ide-code-shell td:last-child,
.mono-atom-shell td:last-child,
.mono-code-final td:last-child {
    padding-right: 18px !important;
    padding-left: 16px !important;
    white-space: pre !important;
}

/* pre 与 code：纯色背景，无横线、竖线和行级背景图。 */

#cnblogs_post_body > pre,
.blogpost-body > pre,
.postBody > pre,
.cnblogs_code pre,
.ide-code-shell pre,
.mono-atom-shell pre,
.mono-code-final pre,
pre code.hljs {
    margin: 0 !important;
    padding: 16px 20px !important;
    overflow: auto !important;

    color: var(--mono-atom-fg) !important;
    font-family:
        "Cascadia Mono",
        "JetBrains Mono",
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace !important;
    font-size: 13.5px !important;
    line-height: 1.65 !important;
    tab-size: 4;
    white-space: pre !important;
    word-break: normal !important;
    overflow-wrap: normal !important;

    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    background: var(--mono-atom-bg) !important;
    background-image: none !important;
    box-shadow: none !important;
}

.cnblogs_code td pre,
.ide-code-shell td pre,
.mono-atom-shell td pre,
.mono-code-final td pre {
    padding: 0 !important;
    overflow: visible !important;
}

#cnblogs_post_body .cnblogs_code code,
.blogpost-body .cnblogs_code code,
.postBody .cnblogs_code code,
.ide-code-shell code,
.mono-atom-shell code,
.mono-code-final code {
    padding: 0 !important;
    color: inherit !important;
    font: inherit !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* 顶部语言、复制、折叠工具栏统一为 VS Code 风格。 */

.cnblogs_code_toolbar,
.cnblogs_code .code-toolbar,
.cnblogs_code .tools,
.ide-code-toolbar,
.mono-atom-toolbar,
.mono-code-final__toolbar {
    min-height: 36px !important;
    margin: 0 !important;
    padding: 0 12px !important;
    color: var(--mono-atom-muted) !important;
    border: 0 !important;
    border-bottom: 1px solid var(--mono-atom-divider) !important;
    border-radius: 0 !important;
    background: var(--mono-atom-topbar) !important;
    box-shadow: none !important;
}

.cnblogs_code button,
.ide-code-shell button,
.mono-atom-shell button,
.mono-code-final button,
.mono-code-final__toolbar button {
    min-height: 26px !important;
    padding: 0 8px !important;
    color: #8b95a7 !important;
    font-family: inherit !important;
    font-size: 11px !important;
    border: 0 !important;
    border-radius: 5px !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.cnblogs_code button:hover,
.ide-code-shell button:hover,
.mono-atom-shell button:hover,
.mono-code-final button:hover {
    color: #d7dae0 !important;
    background: rgba(171, 178, 191, 0.1) !important;
}

/* Atom One Dark / VS Code 语法配色：兼容 highlight.js、Prism 与博客园内联色值。 */

.hljs-comment,
.hljs-quote,
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata,
.cnblogs_code [style*="color: #008000"],
.cnblogs_code [style*="color:#008000"],
.cnblogs_code [style*="color: green"] {
    color: var(--mono-atom-comment) !important;
    font-style: italic;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-section,
.hljs-link,
.token.keyword,
.token.boolean,
.token.important,
.cnblogs_code [style*="color: #0000ff"],
.cnblogs_code [style*="color:#0000ff"],
.cnblogs_code [style*="color: blue"] {
    color: var(--mono-atom-purple) !important;
}

.hljs-title,
.hljs-title.function_,
.hljs-function .hljs-title,
.token.function,
.token.method {
    color: var(--mono-atom-blue) !important;
}

.hljs-string,
.hljs-regexp,
.hljs-addition,
.hljs-attribute,
.token.string,
.token.char,
.token.regex,
.cnblogs_code [style*="color: #a31515"],
.cnblogs_code [style*="color:#a31515"],
.cnblogs_code [style*="color: #ff0000"],
.cnblogs_code [style*="color:#ff0000"] {
    color: var(--mono-atom-green) !important;
}

.hljs-number,
.hljs-symbol,
.hljs-bullet,
.token.number,
.token.constant {
    color: var(--mono-atom-orange) !important;
}

.hljs-type,
.hljs-class .hljs-title,
.hljs-built_in,
.token.class-name,
.token.builtin,
.cnblogs_code [style*="color: #2b91af"],
.cnblogs_code [style*="color:#2b91af"] {
    color: var(--mono-atom-yellow) !important;
}

.hljs-meta,
.hljs-meta .hljs-keyword,
.token.operator,
.token.entity,
.token.url,
.cnblogs_code [style*="color: #800000"],
.cnblogs_code [style*="color:#800000"] {
    color: var(--mono-atom-cyan) !important;
}

.hljs-variable,
.hljs-template-variable,
.hljs-attr,
.token.variable,
.token.parameter,
.token.property {
    color: var(--mono-atom-red) !important;
}

.hljs-punctuation,
.token.punctuation {
    color: var(--mono-atom-fg) !important;
}

/* 编辑器选区与滚动条。 */

.cnblogs_code ::selection,
.ide-code-shell ::selection,
.mono-atom-shell ::selection,
.mono-code-final ::selection,
pre ::selection {
    color: inherit;
    background: var(--mono-atom-selection);
}

.cnblogs_code pre::-webkit-scrollbar,
.cnblogs_code::-webkit-scrollbar,
.ide-code-shell pre::-webkit-scrollbar,
.mono-atom-shell pre::-webkit-scrollbar,
.mono-code-final pre::-webkit-scrollbar {
    width: 11px;
    height: 11px;
}

.cnblogs_code pre::-webkit-scrollbar-track,
.cnblogs_code::-webkit-scrollbar-track,
.ide-code-shell pre::-webkit-scrollbar-track,
.mono-atom-shell pre::-webkit-scrollbar-track,
.mono-code-final pre::-webkit-scrollbar-track {
    background: var(--mono-atom-bg);
}

.cnblogs_code pre::-webkit-scrollbar-thumb,
.cnblogs_code::-webkit-scrollbar-thumb,
.ide-code-shell pre::-webkit-scrollbar-thumb,
.mono-atom-shell pre::-webkit-scrollbar-thumb,
.mono-code-final pre::-webkit-scrollbar-thumb {
    border: 3px solid var(--mono-atom-bg);
    border-radius: 10px;
    background: #4b5263;
}

@media screen and (max-width: 560px) {
    #cnblogs_post_body .cnblogs_code td,
    #cnblogs_post_body table.cnblogs_code td,
    .blogpost-body .cnblogs_code td,
    .blogpost-body table.cnblogs_code td,
    .postBody .cnblogs_code td,
    .ide-code-shell td,
    .mono-atom-shell td,
    .mono-code-final td {
        height: 20px !important;
        min-height: 20px !important;
        font-size: 12.5px !important;
        line-height: 20px !important;
    }

    #cnblogs_post_body .cnblogs_code td:first-child,
    #cnblogs_post_body table.cnblogs_code td:first-child,
    .blogpost-body .cnblogs_code td:first-child,
    .blogpost-body table.cnblogs_code td:first-child,
    .postBody .cnblogs_code td:first-child,
    .ide-code-shell td:first-child,
    .mono-atom-shell td:first-child,
    .mono-code-final td:first-child,
    .ide-code-lines,
    .mono-atom-lines,
    .mono-code-final__gutter {
        width: 44px !important;
        min-width: 44px !important;
        padding-right: 10px !important;
    }

    #cnblogs_post_body > pre,
    .blogpost-body > pre,
    .postBody > pre,
    .cnblogs_code pre,
    .ide-code-shell pre,
    .mono-atom-shell pre,
    .mono-code-final pre,
    pre code.hljs {
        padding: 13px 14px !important;
        font-size: 12.5px !important;
        line-height: 1.6 !important;
    }
}

/* ---------- Final priority: compact and completely borderless ---------- */

#cnblogs_post_body .cnblogs_code,
#cnblogs_post_body .ide-code-shell,
#cnblogs_post_body .mono-atom-shell,
#cnblogs_post_body .mono-code-final,
.blogpost-body .cnblogs_code,
.blogpost-body .ide-code-shell,
.blogpost-body .mono-atom-shell,
.blogpost-body .mono-code-final,
.postBody .cnblogs_code,
.postBody .ide-code-shell,
.postBody .mono-atom-shell,
.postBody .mono-code-final {
    margin: 10px 0 14px !important;
    border: 0 !important;
    border-radius: 5px !important;
    outline: 0 !important;
    box-shadow: none !important;
}

#cnblogs_post_body .cnblogs_code table,
#cnblogs_post_body table.cnblogs_code,
#cnblogs_post_body .cnblogs_code tr,
#cnblogs_post_body .cnblogs_code th,
#cnblogs_post_body .cnblogs_code td,
#cnblogs_post_body table.cnblogs_code tr,
#cnblogs_post_body table.cnblogs_code th,
#cnblogs_post_body table.cnblogs_code td,
#cnblogs_post_body [class*="code-shell"] table,
#cnblogs_post_body [class*="code-shell"] tr,
#cnblogs_post_body [class*="code-shell"] td,
#cnblogs_post_body [class*="mono-atom"] table,
#cnblogs_post_body [class*="mono-atom"] tr,
#cnblogs_post_body [class*="mono-atom"] td,
#cnblogs_post_body [class*="mono-code"] table,
#cnblogs_post_body [class*="mono-code"] tr,
#cnblogs_post_body [class*="mono-code"] td,
.blogpost-body .cnblogs_code table,
.blogpost-body .cnblogs_code tr,
.blogpost-body .cnblogs_code th,
.blogpost-body .cnblogs_code td,
.blogpost-body [class*="code-shell"] table,
.blogpost-body [class*="code-shell"] tr,
.blogpost-body [class*="code-shell"] td,
.blogpost-body [class*="mono-atom"] table,
.blogpost-body [class*="mono-atom"] tr,
.blogpost-body [class*="mono-atom"] td,
.blogpost-body [class*="mono-code"] table,
.blogpost-body [class*="mono-code"] tr,
.blogpost-body [class*="mono-code"] td,
.postBody .cnblogs_code table,
.postBody .cnblogs_code tr,
.postBody .cnblogs_code th,
.postBody .cnblogs_code td,
.postBody [class*="code-shell"] table,
.postBody [class*="code-shell"] tr,
.postBody [class*="code-shell"] td,
.postBody [class*="mono-atom"] table,
.postBody [class*="mono-atom"] tr,
.postBody [class*="mono-atom"] td,
.postBody [class*="mono-code"] table,
.postBody [class*="mono-code"] tr,
.postBody [class*="mono-code"] td {
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    background-image: none !important;
    box-shadow: none !important;
}

#cnblogs_post_body .cnblogs_code table,
#cnblogs_post_body table.cnblogs_code,
.blogpost-body .cnblogs_code table,
.blogpost-body table.cnblogs_code,
.postBody .cnblogs_code table,
.postBody table.cnblogs_code,
.ide-code-shell table,
.mono-atom-shell table,
.mono-code-final table {
    margin: 0 !important;
    padding: 7px 0 !important;
    border-spacing: 0 !important;
    border-collapse: collapse !important;
}

#cnblogs_post_body .cnblogs_code td,
#cnblogs_post_body table.cnblogs_code td,
.blogpost-body .cnblogs_code td,
.blogpost-body table.cnblogs_code td,
.postBody .cnblogs_code td,
.postBody table.cnblogs_code td,
.ide-code-shell td,
.mono-atom-shell td,
.mono-code-final td {
    height: 20px !important;
    min-height: 20px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    font-size: 13.5px !important;
    line-height: 20px !important;
}

#cnblogs_post_body .cnblogs_code td:first-child,
#cnblogs_post_body table.cnblogs_code td:first-child,
.blogpost-body .cnblogs_code td:first-child,
.blogpost-body table.cnblogs_code td:first-child,
.postBody .cnblogs_code td:first-child,
.postBody table.cnblogs_code td:first-child,
.ide-code-shell td:first-child,
.mono-atom-shell td:first-child,
.mono-code-final td:first-child,
.ide-code-lines,
.mono-atom-lines,
.mono-code-final__gutter,
.line-numbers-rows,
.code-line-number,
.code-linenumber,
.lineno {
    display: none !important;
    width: 0 !important;
    min-width: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

#cnblogs_post_body .cnblogs_code td:last-child,
#cnblogs_post_body table.cnblogs_code td:last-child,
.blogpost-body .cnblogs_code td:last-child,
.blogpost-body table.cnblogs_code td:last-child,
.postBody .cnblogs_code td:last-child,
.postBody table.cnblogs_code td:last-child,
.ide-code-shell td:last-child,
.mono-atom-shell td:last-child,
.mono-code-final td:last-child {
    width: 100% !important;
    padding-right: 12px !important;
    padding-left: 12px !important;
}

.cnblogs_code_toolbar,
.cnblogs_code .code-toolbar,
.cnblogs_code .tools,
.ide-code-toolbar,
.mono-atom-toolbar,
.mono-code-final__toolbar {
    min-height: 28px !important;
    padding: 0 8px !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.cnblogs_code pre,
.ide-code-shell pre,
.mono-atom-shell pre,
.mono-code-final pre {
    padding: 9px 12px !important;
    font-size: 13.5px !important;
    line-height: 1.45 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

@media screen and (max-width: 560px) {
    #cnblogs_post_body .cnblogs_code td,
    #cnblogs_post_body table.cnblogs_code td,
    .blogpost-body .cnblogs_code td,
    .blogpost-body table.cnblogs_code td,
    .postBody .cnblogs_code td,
    .postBody table.cnblogs_code td {
        height: 19px !important;
        min-height: 19px !important;
        font-size: 12.5px !important;
        line-height: 19px !important;
    }
}

/* ---------- Absolute final override: bright toolbar controls ---------- */

.cnblogs_code_toolbar,
.cnblogs_code .code-toolbar,
.cnblogs_code .tools,
.ide-code-toolbar,
.mono-atom-toolbar,
.mono-code-final__toolbar,
#cnblogs_post_body [class*="code"] [class*="toolbar"],
#cnblogs_post_body [class*="code"] [class*="tools"],
.blogpost-body [class*="code"] [class*="toolbar"],
.blogpost-body [class*="code"] [class*="tools"],
.postBody [class*="code"] [class*="toolbar"],
.postBody [class*="code"] [class*="tools"] {
    color: #eaf2fb !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.cnblogs_code button,
.cnblogs_code .tools a,
.cnblogs_code .tools span,
.cnblogs_code_toolbar button,
.cnblogs_code_toolbar a,
.cnblogs_code_toolbar span,
.ide-code-toolbar button,
.ide-code-toolbar a,
.ide-code-toolbar span,
.mono-atom-toolbar button,
.mono-atom-toolbar a,
.mono-atom-toolbar span,
.mono-code-final__toolbar button,
.mono-code-final__toolbar a,
.mono-code-final__toolbar span,
#cnblogs_post_body [class*="code"] [class*="copy"],
#cnblogs_post_body [class*="code"] [class*="fold"],
#cnblogs_post_body [class*="code"] [class*="full"],
.blogpost-body [class*="code"] [class*="copy"],
.blogpost-body [class*="code"] [class*="fold"],
.blogpost-body [class*="code"] [class*="full"],
.postBody [class*="code"] [class*="copy"],
.postBody [class*="code"] [class*="fold"],
.postBody [class*="code"] [class*="full"] {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-weight: 600 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
    opacity: 1 !important;
    visibility: visible !important;
    filter: none !important;
}

.cnblogs_code_toolbar svg,
.cnblogs_code_toolbar svg *,
.cnblogs_code .tools svg,
.cnblogs_code .tools svg *,
.ide-code-toolbar svg,
.ide-code-toolbar svg *,
.mono-atom-toolbar svg,
.mono-atom-toolbar svg *,
.mono-code-final__toolbar svg,
.mono-code-final__toolbar svg * {
    color: #ffffff !important;
    fill: currentColor !important;
    stroke: currentColor !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.cnblogs_code_toolbar i,
.cnblogs_code .tools i,
.ide-code-toolbar i,
.mono-atom-toolbar i,
.mono-code-final__toolbar i,
.cnblogs_code_toolbar button::before,
.cnblogs_code_toolbar button::after,
.cnblogs_code .tools button::before,
.cnblogs_code .tools button::after,
.ide-code-toolbar button::before,
.ide-code-toolbar button::after,
.mono-atom-toolbar button::before,
.mono-atom-toolbar button::after,
.mono-code-final__toolbar button::before,
.mono-code-final__toolbar button::after {
    color: #ffffff !important;
    border-color: currentColor !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.cnblogs_code_toolbar img,
.cnblogs_code .tools img,
.ide-code-toolbar img,
.mono-atom-toolbar img,
.mono-code-final__toolbar img {
    opacity: 1 !important;
    filter: grayscale(1) brightness(0) invert(1) !important;
}

.cnblogs_code button:hover,
.cnblogs_code .tools a:hover,
.cnblogs_code_toolbar button:hover,
.cnblogs_code_toolbar a:hover,
.ide-code-toolbar button:hover,
.ide-code-toolbar a:hover,
.mono-atom-toolbar button:hover,
.mono-atom-toolbar a:hover,
.mono-code-final__toolbar button:hover,
.mono-code-final__toolbar a:hover {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background: rgba(255, 255, 255, 0.16) !important;
}
