/* 引入飘逸的书法字体 */
@import url('https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&display=swap');

/* 修复：overflow-x 移到 html，避免破坏 fixed 定位 */
html { overflow-x: hidden; }

/* 基础重置 */
body { 
    cursor: url(https://files-cdn.cnblogs.com/files/zouwangblog/cursor.ico), auto; 
    background: transparent !important; 
    color: #314659; 
    font-family: Lato, "PingFang SC", "Microsoft YaHei", sans-serif !important; 
    margin: 0; padding: 0;
}
a { transition: all .3s ease !important; }
a:hover { color: #FE9600 !important; text-decoration: none !important; }

/* 隐藏原生丑组件 & 广告推荐 */
#sideBar, #ad_c1, #ad_c2, #ad_t2, .blogStats, #comment_nav, #header,
#div_digg, #green_channel, #blog_post_info, #blog_post_info_block, .blog_post_info, 
#author_profile, .follow_btn, .post_btn, .headertop, .main-header, .scroll-down, 
.notice, .c_ad_block, #blogTitle, #navigator, .esa-catalog, #footer,
#under_post_news, #under_post_kb, #HistoryToday, .recommend_list { 
    display: none !important; 
}

/* 全屏底层背景图 */
body::before {
    content: ''; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background-image: url(https://cdn.luogu.com.cn/upload/image_hosting/eit8yubn.png);
    background-size: cover; background-position: center;
    z-index: -999 !important; pointer-events: none;
}

/* 通用特效 */
@keyframes typing { from { width: 0; } to { width: 100%; } }
@keyframes blink-caret { from, to { border-color: transparent; } 50% { border-color: #fff; } }
@keyframes fade-caret { from { border-color: #fff; } to { border-color: transparent; } }

/* =========================================
   主页专属样式
   ========================================= */
body:not(.is-post) #main {
    margin: 100vh auto 50px !important; 
    position: relative; z-index: 10;
    background-color: rgba(255, 255, 255, 0.3) !important; 
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); 
    border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    width: 90% !important; max-width: 1000px;
    padding: 40px !important; box-sizing: border-box;
    display: block !important;
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

body:not(.is-post) #main:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(129, 212, 250, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

#home-title-box { 
    position: fixed; left: 50%; top: 50%; 
    transform: translate(-50%, -50%); 
    z-index: 99; display: flex; flex-direction: column; align-items: center; 
    pointer-events: none; 
    width: max-content;
    max-width: 90vw;
}
.home-title-text { 
    font-family: 'Ma Shan Zheng', cursive !important; 
    color: #fff; font-size: clamp(40px, 6vw, 80px); font-weight: 500; 
    text-shadow: 2px 2px 15px rgba(0,0,0,0.8); text-align: center; 
    overflow: hidden; border-right: .15em solid #fff; white-space: nowrap; margin: 0; 
    animation: typing 2s steps(4, end) forwards, blink-caret .75s step-end 3, fade-caret 0.5s ease-in 3.5s forwards; 
}
.home-subtitle { 
    position: fixed !important; top: 65% !important; left: 50% !important; 
    transform: translate(-50%, -50%) !important; 
    background: rgba(0, 0, 0, .6); padding: 10px 30px; border-radius: 10px; 
    color: #fff; backdrop-filter: blur(5px); font-size: 16px; 
    white-space: nowrap; z-index: 1000; pointer-events: none; 
}

#mainContent .day { display: block !important; border-bottom: 1px dashed rgba(255,255,255,0.3) !important; padding: 25px 0 !important; margin: 0 !important; }

/* 修复新随笔不显示：安全隐藏日期分组 */
#mainContent .dayTitle { 
    font-size: 0 !important; height: 0 !important; padding: 0 !important; 
    margin: 0 !important; overflow: hidden !important; border: none !important; line-height: 0 !important;
} 

#mainContent .postTitle { display: block !important; margin-bottom: 12px !important; }
#mainContent .postTitle a { font-size: 22px !important; font-weight: bold !important; color: #222 !important; }
#mainContent .c_b_p_desc { display: block !important; font-size: 15px !important; color: #444 !important; line-height: 1.8 !important; margin-bottom: 0 !important; }
#mainContent .postDesc { display: none !important; } 
#mainContent .c_b_p_desc_readmore { display: none !important; } 

/* =========================================
   文章页专属样式
   ========================================= */
body.is-post #main {
    margin-top: 100vh !important;
    position: relative;
    z-index: 10;
    width: 90% !important;
    max-width: 1000px;
    margin-left: auto !important;
    margin-right: auto !important;
    margin-bottom: 50px !important;
}

.my-post-title { 
    position: fixed; left: 50%; top: 50%; 
    transform: translateX(-50%); 
    z-index: 99; 
    font-family: 'Ma Shan Zheng', cursive !important; 
    color: #fff; font-size: clamp(40px, 7vw, 80px); font-weight: 500; 
    text-shadow: 2px 2px 15px rgba(0,0,0,0.8); text-align: center; 
    width: 90%; max-width: 1200px; overflow: hidden; 
    border-right: .15em solid #fff; white-space: nowrap; 
    animation: typing 3.5s steps(40, end) forwards, blink-caret .75s step-end 3, fade-caret 1s ease-in 4.5s forwards; 
    will-change: transform, top;
}

body.is-post #topics {
    background-color: rgba(255, 255, 255, 0.3) !important; 
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); 
    border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); 
    padding: 40px !important; box-sizing: border-box;
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

body.is-post #topics:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(129, 212, 250, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

/* =========================================
   正文高级质感优化 (呼吸感、代码块深海风)
   ========================================= */
body.is-post #cnblogs_post_body p,
body.is-post #cnblogs_post_body li,
body.is-post #cnblogs_post_body h1,
body.is-post #cnblogs_post_body h2,
body.is-post #cnblogs_post_body h3,
body.is-post #cnblogs_post_body h4,
body.is-post #cnblogs_post_body h5,
body.is-post #cnblogs_post_body h6,
body.is-post #cnblogs_post_body blockquote,
body.is-post #cnblogs_post_body td,
body.is-post #cnblogs_post_body th { 
    color: #1a1a1a !important; 
    line-height: 2.0 !important; 
    margin-bottom: 1.5em !important;
    letter-spacing: 0.5px !important;
}

body.is-post #cnblogs_post_body img {
    border-radius: 10px !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2) !important;
    transition: transform 0.3s ease;
    max-width: 100%;
    display: block;
    margin: 20px auto;
}
body.is-post #cnblogs_post_body img:hover { transform: scale(1.02); }

body.is-post #cnblogs_post_body blockquote {
    border-left: 4px solid #81d4fa !important;
    background: rgba(255, 255, 255, 0.2) !important;
    padding: 15px 20px !important;
    border-radius: 0 8px 8px 0 !important;
    margin: 20px 0 !important;
    font-style: italic;
}

/* 终极修复：代码块深海暗黑风 (彻底清理白边和工具栏) */
body.is-post #cnblogs_post_body pre,
body.is-post #cnblogs_post_body .cnblogs_code {
    background: rgba(20, 25, 30, 0.85) !important; 
    border: 1px solid rgba(129, 212, 250, 0.4) !important;
    border-radius: 10px !important;
    padding: 0 !important; 
    box-shadow: inset 0 0 20px rgba(0,0,0,0.6) !important;
    backdrop-filter: blur(10px);
    margin: 25px 0 !important;
    position: relative;
    overflow: hidden;
}

/* 强制把内部所有的白底和边框剥掉 */
body.is-post #cnblogs_post_body pre *,
body.is-post #cnblogs_post_body .cnblogs_code * {
    background: transparent !important; 
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* 代码块右上角工具栏暗黑化 */
body.is-post #cnblogs_post_body .code-toolbar,
body.is-post #cnblogs_post_body .hljs-toolbar,
body.is-post #cnblogs_post_body div[class*="toolbar"] {
    background: rgba(0, 0, 0, 0.4) !important;
    border-radius: 0 10px 0 10px !important;
    opacity: 0.3;
    transition: opacity 0.3s;
}
body.is-post #cnblogs_post_body pre:hover div[class*="toolbar"],
body.is-post #cnblogs_post_body .cnblogs_code:hover div[class*="toolbar"] {
    opacity: 1;
}
body.is-post #cnblogs_post_body div[class*="toolbar"] * {
    color: #81d4fa !important;
}

/* 剥夺所有默认颜色，强制覆盖为亮色 */
body.is-post #cnblogs_post_body pre code,
body.is-post #cnblogs_post_body pre span,
body.is-post #cnblogs_post_body .cnblogs_code span {
    color: #e0f7fa !important; 
    font-family: Consolas, Monaco, monospace !important;
    line-height: 1.7 !important;
    text-shadow: none !important;
    display: inline !important;
}
body.is-post #cnblogs_post_body pre code {
    display: block;
    padding: 20px !important; 
}

/* 手动补充高亮语法（防覆盖） */
body.is-post #cnblogs_post_body pre .hljs-keyword,
body.is-post #cnblogs_post_body pre .hljs-built_in,
body.is-post #cnblogs_post_body pre .hljs-type,
body.is-post #cnblogs_post_body .cnblogs_code span[style*="color: #0000ff"],
body.is-post #cnblogs_post_body .cnblogs_code span[style*="color: blue"] { color: #00e5ff !important; }
body.is-post #cnblogs_post_body pre .hljs-string,
body.is-post #cnblogs_post_body pre .hljs-comment,
body.is-post #cnblogs_post_body .cnblogs_code span[style*="color: #008000"],
body.is-post #cnblogs_post_body .cnblogs_code span[style*="color: green"] { color: #80cbc4 !important; font-style: italic; }
body.is-post #cnblogs_post_body pre .hljs-number,
body.is-post #cnblogs_post_body pre .hljs-literal { color: #b39ddb !important; }

/* ★ 行内代码高亮胶囊（加深底色，提亮文字）★ */
body.is-post #cnblogs_post_body p code,
body.is-post #cnblogs_post_body li code,
body.is-post #cnblogs_post_body h1 code,
body.is-post #cnblogs_post_body h2 code,
body.is-post #cnblogs_post_body h3 code {
    background: rgba(0, 0, 0, 0.6) !important; /* 加深底色，变成不透明的黑底 */
    color: #00e5ff !important; /* 提亮文字为亮青色 */
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-family: Consolas, monospace !important;
    border: 1px solid rgba(0, 229, 255, 0.4) !important; /* 加上发光的边框 */
    box-shadow: 0 0 5px rgba(0, 229, 255, 0.2) !important; /* 微微发光 */
    font-weight: bold !important;
    margin: 0 3px !important;
}

/* 暴力隐藏正文最前面的 H1/H2/H3 标题 */
#cnblogs_post_body > h1:first-child,
#cnblogs_post_body > h2:first-child,
#cnblogs_post_body > h3:first-child,
#cnblogs_post_body > div:first-child > h1:first-child,
#cnblogs_post_body > div:first-child > h2:first-child,
#cnblogs_post_body > div:first-child > h3:first-child { 
    display: none !important; 
}

/* =========================================
   评论区深度美化 (扒皮穿透)
   ========================================= */
#comment_form h3, .comment_icon, .commentbox_tab { display: none !important; }
#comment_form { margin-top: 40px !important; padding: 20px !important; background: rgba(255, 255, 255, 0.15) !important; backdrop-filter: blur(15px) !important; -webkit-backdrop-filter: blur(15px) !important; border-radius: 12px !important; border: 1px solid rgba(255, 255, 255, 0.3) !important; box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important; }

#comment_form .commentbox_main, #comment_form .comment_textarea, #comment_form .CodeMirror {
    background: transparent !important; border: 1px solid rgba(255, 255, 255, 0.2) !important; border-radius: 8px !important; color: #fff !important;
}
.CodeMirror-scroll, .CodeMirror-gutters, .CodeMirror-lines { background: rgba(0, 0, 0, 0.25) !important; border-radius: 8px !important; }
.CodeMirror-lines { padding: 10px 0 !important; }
.CodeMirror pre.CodeMirror-line { padding: 0 15px !important; }
.CodeMirror-cursor { border-left: 2px solid #81d4fa !important; }
.CodeMirror-placeholder { color: rgba(255, 255, 255, 0.4) !important; }
.CodeMirror pre, .CodeMirror-line span { color: #e0f7fa !important; font-family: inherit !important; }
#comment_form .CodeMirror-focused { border-color: #81d4fa !important; box-shadow: 0 0 10px rgba(129, 212, 250, 0.3) !important; }
.editor-toolbar, .editor-statusbar { display: none !important; }

#btn_comment_submit { background-color: #FE9600 !important; color: white !important; border: none !important; padding: 8px 25px !important; border-radius: 20px !important; font-weight: bold !important; box-shadow: 0 4px 10px rgba(254, 150, 0, 0.3) !important; transition: all 0.3s ease; cursor: pointer; margin-top: 10px !important; }
#btn_comment_submit:hover { background-color: #e68a00 !important; transform: translateY(-2px); }
.comment_btn_tip { color: rgba(255,255,255,0.6) !important; font-size: 12px !important; margin-top: 10px !important; }
#comment_form a { color: #81d4fa !important; }

.my-copyright-box { margin-top: 40px; margin-bottom: 20px; padding: 15px 20px; background: rgba(255,255,255,0.2); border-radius: 10px; border-left: 4px solid #FE9600; backdrop-filter: blur(5px); font-size: 14px; color: #444; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.my-copyright-box p { margin: 0; display: flex; align-items: center; gap: 8px; }
.my-copyright-box a { color: #FE9600; font-weight: bold; text-decoration: none; }