/* 隐藏代码块中的滚动条 - 使用最高优先级和通配符 */
.post-content pre::-webkit-scrollbar,
.post-content pre code::-webkit-scrollbar,
.post-content .highlight::-webkit-scrollbar,
.post-content .highlight pre::-webkit-scrollbar,
.post-content .highlight pre code::-webkit-scrollbar,
.post-content .highlighttable td .highlight pre::-webkit-scrollbar,
.post-content .highlighttable td .highlight pre code::-webkit-scrollbar,
.post-content .highlighttable::-webkit-scrollbar,
.post-content .highlighttable td::-webkit-scrollbar,
.post-content .highlighttable td .highlight::-webkit-scrollbar,
.post-content *::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Firefox 浏览器滚动条隐藏 */
.post-content pre,
.post-content pre code,
.post-content .highlight,
.post-content .highlight pre,
.post-content .highlight pre code,
.post-content .highlighttable td .highlight pre,
.post-content .highlighttable td .highlight pre code,
.post-content .highlighttable,
.post-content .highlighttable td,
.post-content .highlighttable td .highlight,
.post-content * {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;  /* IE and Edge */
}

/* 确保代码块内容可以正常滚动，但不显示滚动条 */
.post-content pre,
.post-content .highlight pre,
.post-content .highlighttable td .highlight pre {
    overflow-x: auto !important;
    overflow-y: auto !important;
}

/* 针对内联代码的滚动条隐藏 */
.post-content code {
    overflow-x: auto !important;
}

/* 使用更高优先级的选择器来覆盖主题CSS */
body .post-content pre::-webkit-scrollbar,
body .post-content pre code::-webkit-scrollbar,
body .post-content .highlight::-webkit-scrollbar,
body .post-content .highlight pre::-webkit-scrollbar,
body .post-content .highlight pre code::-webkit-scrollbar,
body .post-content .highlighttable::-webkit-scrollbar,
body .post-content .highlighttable td::-webkit-scrollbar,
body .post-content .highlighttable td .highlight::-webkit-scrollbar,
body .post-content .highlighttable td .highlight pre::-webkit-scrollbar,
body .post-content .highlighttable td .highlight pre code::-webkit-scrollbar,
body .post-content *::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* 强制覆盖所有可能的滚动条显示 */
html body .post-content pre::-webkit-scrollbar,
html body .post-content pre code::-webkit-scrollbar,
html body .post-content .highlight::-webkit-scrollbar,
html body .post-content .highlight pre::-webkit-scrollbar,
html body .post-content .highlight pre code::-webkit-scrollbar,
html body .post-content .highlighttable::-webkit-scrollbar,
html body .post-content .highlighttable td::-webkit-scrollbar,
html body .post-content .highlighttable td .highlight::-webkit-scrollbar,
html body .post-content .highlighttable td .highlight pre::-webkit-scrollbar,
html body .post-content .highlighttable td .highlight pre code::-webkit-scrollbar,
html body .post-content *::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* 使用!important强制覆盖所有滚动条相关样式 */
.post-content pre,
.post-content .highlight,
.post-content .highlighttable,
.post-content .highlighttable td,
.post-content .highlighttable td .highlight,
.post-content .highlighttable td .highlight pre {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

.post-content pre::-webkit-scrollbar,
.post-content .highlight::-webkit-scrollbar,
.post-content .highlighttable::-webkit-scrollbar,
.post-content .highlighttable td::-webkit-scrollbar,
.post-content .highlighttable td .highlight::-webkit-scrollbar,
.post-content .highlighttable td .highlight pre::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* 优化列表和段落间距 */
.post-content p {
    margin-bottom: 0.1em !important;
}

.post-content ol,
.post-content ul {
    margin-top: 0.1em !important;
    margin-bottom: 0.4em !important;
}

.post-content li {
    margin-top: 2px !important;
    margin-bottom: 4px !important;
    line-height: 1.5 !important;
    padding: 4px 0 !important;
}

/* 确保列表和上方文本之间有适当间距 */
.post-content p + ol,
.post-content p + ul {
    margin-top: 0.4em !important;
}

/* 优化图片和文本之间的间距 */
.post-content img {
    margin: 0.5rem 0 0.1rem 0 !important; /* 进一步减少底部间距 */
}

.post-content img + p,
.post-content img + div,
.post-content img + h1,
.post-content img + h2,
.post-content img + h3,
.post-content img + h4,
.post-content img + h5,
.post-content img + h6,
.post-content img + ul,
.post-content img + ol,
.post-content img + blockquote,
.post-content img + pre {
    margin-top: 0.15em !important; /* 图片后面的元素顶部间距进一步缩小 */
}

/* 处理figure标签中的图片 */
.post-content figure {
    margin: 0.5rem 0 0.1rem 0 !important;
}

.post-content figure + p,
.post-content figure + div,
.post-content figure + h1,
.post-content figure + h2,
.post-content figure + h3,
.post-content figure + h4,
.post-content figure + h5,
.post-content figure + h6,
.post-content figure + ul,
.post-content figure + ol,
.post-content figure + blockquote,
.post-content figure + pre {
    margin-top: 0.15em !important;
}

/* 确保图片说明文字和下方内容间距合适 */
.post-content figcaption {
    margin-bottom: 0.1em !important;
}

/* 处理所有可能的图片容器和相邻元素 */
.post-content .highlight + img,
.post-content pre + img,
.post-content blockquote + img,
.post-content table + img,
.post-content .highlight + figure,
.post-content pre + figure,
.post-content blockquote + figure,
.post-content table + figure {
    margin-top: 0.5rem !important;
}

/* 确保图片在代码块后面时也有合适的间距 */
.post-content img + .highlight,
.post-content figure + .highlight,
.post-content img + pre,
.post-content figure + pre {
    margin-top: 0.3em !important;
}

/* 处理图片在列表中的情况 */
.post-content li img {
    margin: 0.3rem 0 0.1rem 0 !important;
}

.post-content li figure {
    margin: 0.3rem 0 0.1rem 0 !important;
}

/* 隐藏文章详情页的封面图片 */
.post-single .post-header .cover {
    display: none !important;
}

.post-single .post-header .post-cover {
    display: none !important;
}

/* 代码高亮颜色优化 - 高饱和度鲜艳配色方案 */
/* 使用更高的CSS优先级覆盖主题默认样式 */

/* 关键字 - 使用鲜艳的紫色 - 覆盖主题默认 */
body .chroma .k, 
body .chroma .kp, 
body .chroma .kr, 
body .chroma .kn, 
body .chroma .kc {
    color: #8b5cf6 !important; /* 鲜艳紫色 */
    font-weight: 600 !important;
}

/* 字符串插值 - 确保变量在字符串中正确显示 */
body .chroma .si {
    color: #10b981 !important; /* 绿色字符串颜色 */
    font-weight: 500 !important;
}

/* 变量名 - 确保不被误识别为关键字 */
body .chroma .nv, 
body .chroma .vc, 
body .chroma .vg, 
body .chroma .vi, 
body .chroma .vm {
    color: #ec4899 !important; /* 鲜艳粉色 - 变量颜色 */
    font-weight: 500 !important;
}

/* 字符串插值中的变量保持字符串颜色 */
body .chroma .si .nv, 
body .chroma .si .vc, 
body .chroma .si .vg, 
body .chroma .si .vi, 
body .chroma .si .vm {
    color: #10b981 !important; /* 保持绿色字符串颜色 */
    font-weight: 500 !important;
}

/* 强制覆盖主题中可能的变量样式 */
body .chroma span[class*="nv"],
body .chroma span[class*="vc"],
body .chroma span[class*="vg"],
body .chroma span[class*="vi"],
body .chroma span[class*="vm"] {
    color: #ec4899 !important; /* 确保变量显示为粉色 */
    font-weight: 500 !important;
}

/* 关键字声明和类型 - 使用鲜艳的红色 */
.chroma .kd, .chroma .kt {
    color: #ef4444 !important; /* 鲜艳红色 */
    font-weight: 600 !important;
}

/* 字符串 - 使用鲜艳的绿色 */
.chroma .s, .chroma .s1, .chroma .s2, .chroma .sb, .chroma .sc, .chroma .si, .chroma .sx {
    color: #10b981 !important; /* 鲜艳绿色 */
    font-weight: 500 !important;
}

/* 数字 - 使用鲜艳的橙色 */
.chroma .m, .chroma .mb, .chroma .mf, .chroma .mh, .chroma .mi, .chroma .il, .chroma .mo {
    color: #f59e0b !important; /* 鲜艳橙色 */
    font-weight: 600 !important;
}

/* 类名 - 使用鲜艳的橙红色 */
.chroma .nc {
    color: #f97316 !important; /* 鲜艳橙红色 */
    font-weight: 700 !important;
}

/* 函数名 - 使用鲜艳的蓝色 */
.chroma .nf, .chroma .fm {
    color: #3b82f6 !important; /* 鲜艳蓝色 */
    font-weight: 600 !important;
}

/* 操作符 - 使用鲜艳的青色 */
.chroma .o, .chroma .ow {
    color: #06b6d4 !important; /* 鲜艳青色 */
    font-weight: 700 !important;
}

/* 标点符号 - 使用中等灰色 */
.chroma .p {
    color: #6b7280 !important; /* 中等灰色 */
    font-weight: 500 !important;
}

/* 注释 - 使用柔和但可见的灰色 */
.chroma .c, .chroma .c1, .chroma .cm, .chroma .ch, .chroma .cs, .chroma .cp {
    color: #9ca3af !important; /* 柔和灰色 */
    font-style: italic;
}

/* 变量名 - 使用鲜艳的粉色 */
.chroma .nv, .chroma .vc, .chroma .vg, .chroma .vi, .chroma .vm {
    color: #ec4899 !important; /* 鲜艳粉色 */
    font-weight: 500 !important;
}

/* 内置函数和属性 - 使用鲜艳的靛蓝色 */
.chroma .nb, .chroma .bp, .chroma .na {
    color: #6366f1 !important; /* 鲜艳靛蓝色 */
    font-weight: 500 !important;
}

/* 常量 - 使用鲜艳的黄绿色 */
.chroma .no {
    color: #84cc16 !important; /* 鲜艳黄绿色 */
    font-weight: 600 !important;
}

/* 装饰器 - 使用鲜艳的玫瑰色 */
.chroma .nd {
    color: #f43f5e !important; /* 鲜艳玫瑰色 */
    font-weight: 600 !important;
}
