/* ========== 1. 全局毛玻璃样式 ========== */
/* 明亮模式 */
#body-wrap #recent-posts > .recent-post-item,
#body-wrap .recent-post-item,
#body-wrap #aside-content .card-widget,
#body-wrap #nav .menus_items .menus_item .menus_item_child,
#body-wrap #pagination .page-number:not(.current),
#body-wrap #pagination .extend {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 8px 16px -4px rgba(138, 138, 138, 0.15);
    transition: background 0.3s ease, border 0.3s ease, box-shadow 0.3s ease;
}
/* 文章区和文章信息卡不用 backdrop-filter（会导致全屏异常），统一视觉 */
#body-wrap .layout > div:first-child:not(.recent-posts),
#page-header #post-info {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 8px 16px -4px rgba(138, 138, 138, 0.15);
    transition: background 0.3s ease, border 0.3s ease, box-shadow 0.3s ease;
}
#body-wrap #pagination .page-number:not(.current):hover,
#body-wrap #pagination .extend:hover {
    background: #ff7142d2;
    border-color: #ff7142d2;
    color: #fff;
}
/* 夜间模式 */
html[data-theme="dark"] #body-wrap #recent-posts > .recent-post-item,
html[data-theme="dark"] #body-wrap .recent-post-item,
html[data-theme="dark"] #body-wrap #aside-content .card-widget,
html[data-theme="dark"] #body-wrap #nav .menus_items .menus_item .menus_item_child,
html[data-theme="dark"] #body-wrap #pagination .page-number:not(.current),
html[data-theme="dark"] #body-wrap #pagination .extend,
html[data-theme="dark"] #page-header #post-info {
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.2);
}
/* 夜间模式下文章区不用 backdrop-filter */
html[data-theme="dark"] #body-wrap .layout > div:first-child:not(.recent-posts) {
    background: rgba(30, 30, 30, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.2);
}

/* ========== 2. 明亮主题文本颜色 ========== */
/* 主副标题 */
html:not([data-theme="dark"]) #site-title,
html:not([data-theme="dark"]) .site-title,
html:not([data-theme="dark"]) #site-name,
html:not([data-theme="dark"]) #site-info .site-subtitle,
html:not([data-theme="dark"]) #subtitle,
html:not([data-theme="dark"]) #nav #blog-info .site-name,
html:not([data-theme="dark"]) #nav #blog-info a {
    color: #ffffff !important;
    text-shadow: none !important;
}
/* 导航栏菜单、图标 */
html:not([data-theme="dark"]) #nav .site-page,
html:not([data-theme="dark"]) #nav .menus_items .menus_item > a > span,
html:not([data-theme="dark"]) #nav .menus_items .menus_item > a > i,
html:not([data-theme="dark"]) #search-button > a,
html:not([data-theme="dark"]) #search-button > a > span,
html:not([data-theme="dark"]) #search-button > a > i {
    color: #ffffff !important;
    text-shadow: none !important;
}
html:not([data-theme="dark"]) #nav .menus_item:hover > a,
html:not([data-theme="dark"]) #nav .menus_item:hover > a > span,
html:not([data-theme="dark"]) #nav .menus_item:hover > a > i {
    color: #49b1f5 !important;
}
/* 底部与 Meta 数据 */
html:not([data-theme="dark"]) #page-header .page-title,
html:not([data-theme="dark"]) #footer,
html:not([data-theme="dark"]) #footer a,
html:not([data-theme="dark"]) #footer div,
html:not([data-theme="dark"]) #footer p,
html:not([data-theme="dark"]) #footer span,
html:not([data-theme="dark"]) #footer .copyright *,
html:not([data-theme="dark"]) #post-info #post-meta,
html:not([data-theme="dark"]) #post-info #post-meta a,
html:not([data-theme="dark"]) #post-info #post-meta .post-meta-separator,
html:not([data-theme="dark"]) #post-info #post-meta i,
html:not([data-theme="dark"]) #post-info #post-meta .post-meta-label,
html:not([data-theme="dark"]) #post-info #post-meta time {
    color: #bbb !important;
    text-shadow: none !important;
}

/* ========== 3. 明亮主题导航栏子菜单颜色 ========== */
html:not([data-theme="dark"]) #nav .menus_items .menus_item .menus_item_child li:hover,
html:not([data-theme="dark"]) #nav .menus_items .menus_item .menus_item_child li.active {
    background: transparent !important;
}
html:not([data-theme="dark"]) #nav .menus_items .menus_item .menus_item_child li:hover a,
html:not([data-theme="dark"]) #nav .menus_items .menus_item .menus_item_child li:hover a span,
html:not([data-theme="dark"]) #nav .menus_items .menus_item .menus_item_child li.active a,
html:not([data-theme="dark"]) #post-info #post-meta a:hover {
    color: #49b1f5 !important;
}

/* ========== 4. 页头与页脚透明 ========== */
#footer, #page-header.post-bg, #page-header.page-bg {
    background: transparent !important;
}
#page-header.post-bg::before, #page-header.page-bg::before {
    background-color: transparent !important;
}

/* ========== 5. 文章卡片透明 ========== */
#body-wrap #recent-posts > .recent-post-item .recent-post-info,
#body-wrap #recent-posts > .recent-post-item .recent-post-info::before,
#body-wrap #recent-posts > .recent-post-item .recent-post-info::after,
#body-wrap #recent-posts > .recent-post-item .recent-post-info > .article-title,
#body-wrap #recent-posts > .recent-post-item .recent-post-info > .article-meta-wrap,
#body-wrap #recent-posts > .recent-post-item .recent-post-info > .content {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

/* ========== 6. 文章标题卡片透明 ========== */
/*
 * 对齐原理：
 *   .layout = max-width:1200px, padding:0 15px, content = 100vw - 30px
 *   .layout > div:first-child = width:74% of content = 74%×(100vw-30px) = 74vw - 22.2px
 *   #post-info 同理匹配，确保左右边缘与文章区对齐
 */
#page-header #post-info {
    position: absolute;
    bottom: 0px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1170px;
    margin: 0;
    padding: 20px 40px;
    box-sizing: border-box;
    display: block;
    text-align: left;
    border-radius: 10px;
}
/* 超大屏时，.layout 会缩到 60%，#post-info 也要同步 */
@media screen and (min-width: 2000px) {
    #page-header #post-info {
        width: 59%;
        max-width: none;
    }
}
/* 小屏时 #content-inner 会占满，#post-info 也要跟着 100% */
@media screen and (max-width: 900px) {
    #page-header #post-info {
        width: 100% !important;
        max-width: none !important;
        padding: 15px 14px !important;
        bottom: 20px !important;
    }

    #post-info #post-meta > .meta-firstline > span:not(.post-meta-wordcount),
    #post-info #post-meta > .meta-secondline > span:not(.post-meta-wordcount) {
        display: none !important;
    }

    #post-info #post-meta > .meta-firstline > .post-meta-separator,
    #post-info #post-meta > .meta-secondline > .post-meta-separator {
        display: none !important;
    }

    #post-info .post-title {
        text-align: justify !important;
        text-align-last: left !important;
        display: block;
        margin-bottom: 10px;
    }
}

/* ========== 7. Mermaid 流程图透明 ========== */
#article-container .mermaid,
#article-container .mermaid svg,
.mermaid-wrap,
#article-container .mermaid svg rect.mermaid-bg,
#article-container .mermaid svg rect:first-child {
    background: transparent !important;
    fill: transparent !important;
}

/* ========== 8. 代码块深色配色（明亮模式也生效） ========== */
html:not([data-theme="dark"]) {
    --hl-bg: #1e1e1e !important;
    --hltools-bg: #2d2d2d !important;
    --hlnumber-bg: #1e1e1e !important;
    --hlnumber-color: #858585 !important;
    --hlscrollbar-bg: #3c3c3c !important;
    --hlexpand-bg: linear-gradient(180deg, rgba(30,30,30,0), rgba(30,30,30,0.9)) !important;
}
html:not([data-theme="dark"]) #article-container .highlight table {
    background-color: #1e1e1e !important;
}
html:not([data-theme="dark"]) .highlight .code .keyword,
html:not([data-theme="dark"]) .highlight .code .built_in,
html:not([data-theme="dark"]) .highlight .code .type {
    color: #569cd6 !important;
}
html:not([data-theme="dark"]) .highlight .code .string {
    color: #8fca5c !important;
}
html:not([data-theme="dark"]) .highlight .code .comment {
    color: #5c7080 !important;
    font-style: italic !important;
}
html:not([data-theme="dark"]) .highlight .code .number {
    color: #f07178 !important;
}
html:not([data-theme="dark"]) .highlight .code .title,
html:not([data-theme="dark"]) .highlight .code .function {
    color: #82aaff !important;
}
html:not([data-theme="dark"]) .highlight .code .meta,
html:not([data-theme="dark"]) .highlight .code .meta-keyword {
    color: #c792ea !important;
}
html:not([data-theme="dark"]) .highlight .code .attr,
html:not([data-theme="dark"]) .highlight .code .variable,
html:not([data-theme="dark"]) .highlight .code .params {
    color: #a6bcdc !important;
}

/* ========== 9. 夜间主题代码块配色（浅色底，与深色页面形成对比） ========== */
html[data-theme="dark"] {
    --hl-bg: #1e1e1e !important;
    --hltools-bg: #2d2d2d !important;
    --hlnumber-bg: #1e1e1e !important;
    --hlnumber-color: #858585 !important;
    --hlscrollbar-bg: #3c3c3c !important;
    --hlexpand-bg: linear-gradient(180deg, rgba(30,30,30,0), rgba(30,30,30,0.9)) !important;
}
html[data-theme="dark"] #article-container .highlight table {
    background-color: #1e1e1e !important;
}
html[data-theme="dark"] .highlight .code .keyword,
html[data-theme="dark"] .highlight .code .built_in,
html[data-theme="dark"] .highlight .code .type {
    color: #569cd6 !important;
}
html[data-theme="dark"] .highlight .code .string {
    color: #ce9178 !important;
}
html[data-theme="dark"] .highlight .code .comment {
    color: #6a9955 !important;
    font-style: italic !important;
}
html[data-theme="dark"] .highlight .code .number {
    color: #b5cea8 !important;
}
html[data-theme="dark"] .highlight .code .title,
html[data-theme="dark"] .highlight .code .function {
    color: #dcdcaa !important;
}
html[data-theme="dark"] .highlight .code .meta,
html[data-theme="dark"] .highlight .code .meta-keyword {
    color: #c586c0 !important;
}
html[data-theme="dark"] .highlight .code .attr,
html[data-theme="dark"] .highlight .code .variable,
html[data-theme="dark"] .highlight .code .params {
    color: #9cdcfe !important;
}

/* ========== 10. 表格样式 ========== */
/* 表头居中 */
#article-container table th,
#article-container table thead th {
    text-align: center !important;
}

/* 明亮模式 */
html:not([data-theme="dark"]) #article-container table {
    background-color: rgba(255, 255, 255, 0.5) !important;
}
html:not([data-theme="dark"]) #article-container table,
html:not([data-theme="dark"]) #article-container table th,
html:not([data-theme="dark"]) #article-container table td {
    border-color: #919191da !important;
    border-width: 1px !important;
}
html:not([data-theme="dark"]) #article-container table tbody tr:nth-child(even) {
    background-color: rgba(240, 244, 248, 0.5) !important;
}

/* 夜间模式 */
html[data-theme="dark"] #article-container table {
    background-color: rgba(22, 27, 34, 0.5) !important;
}
html[data-theme="dark"] #article-container table,
html[data-theme="dark"] #article-container table th,
html[data-theme="dark"] #article-container table td {
    border-color: #5c6c7f !important;
    border-width: 1px !important;
}
html[data-theme="dark"] #article-container table tbody tr:nth-child(even) {
    background-color: rgba(30, 36, 44, 0.5) !important;
}

/* ========== 11. 排版美化 ========== */
/* 无顶图页面正文标题居中 */
#body-wrap #page .page-title {
    text-align: center !important;
}
/* 文章排版改为两端对齐 */
#article-container {
    text-align: justify;
}
/* 视频自适应页面尺寸 */
iframe[src*="youtube.com"],
iframe[src*="youtu.be"],
/* ========== 12. 代码块全屏修正 ========== */
figure.highlight.code-fullpage {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    z-index: 9999 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    background: #f4f7fa !important;
}
html[data-theme="dark"] figure.highlight.code-fullpage {
    background: #0b0f19 !important;
}
figure.highlight.code-fullpage .highlight-tools {
    background: #e9eef4 !important;
}
html[data-theme="dark"] figure.highlight.code-fullpage .highlight-tools {
    background: #111726 !important;
}
figure.highlight.code-fullpage .highlight-tools ~ pre,
figure.highlight.code-fullpage .highlight-tools ~ table {
    height: calc(100vh - 2.15em) !important;
}

/* ========== 13. 背景遮罩层 ========== */
#web_bg {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: -2;
}
#web_bg::after {
    content: "";
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: -1;
    background: rgba(0, 0, 0, 0.3);
    pointer-events: none;
}
html[data-theme="dark"] #web_bg::after {
    background: rgba(0, 0, 0, 0.5);
}

/* ========== 14. 头像旋转 8s 一圈 ========== */
.avatar-img {
    animation: avatar_turn_around 8s linear infinite !important;
}

/* ========== 15. 阅读模式代码块修正 ========== */
/* 15.1 代码块行号 td 和内容 td 背景统一为深色，去掉右边黑色留白 */
.read-mode #article-container figure.highlight table,
.read-mode #article-container figure.highlight table td.gutter,
.read-mode #article-container figure.highlight table td.code,
.read-mode #article-container figure.highlight pre,
.read-mode #article-container figure.highlight {
    background-color: #1e1e1e !important;
}
/* 15.2 阅读模式下代码块不限制高度，去掉下方的渐变蒙层（hlexpand-bg） */
.read-mode #article-container figure.highlight {
    max-height: none !important;
    overflow: visible !important;
}
.read-mode #article-container figure.highlight .code pre {
    max-height: none !important;
    overflow: visible !important;
}
.read-mode #article-container figure.highlight::after {
    background: transparent !important;
}

/* ========== 16. 文章页标题颜色 ========== */
html:not([data-theme="dark"]) #post-info .post-title {
    color: #333 !important;
}





