/* 1. 基础背景与字体设置 */
.cnblogs-markdown .hljs,
.cnblogs-post-body .hljs {
  font-family: Consolas, Monaco, monospace !important;
  background: #f8f8f8 !important; /* 浅灰色背景 */
  color: #333 !important;        /* 主文本颜色改为深灰 */
}

.cnblogs-markdown code,
.cnblogs-post-body code {
  background: #f8f8f8 !important;
  color: #333 !important;
  font-family: Consolas, Monaco, monospace !important;
}

.hljs {
  display: block;
  overflow-x: auto;
  padding: 1em;
  background: #f8f8f8 !important;
  color: #333 !important;
  border: 1px solid #ddd; /* 增加浅色边框让代码块更有轮廓感 */
  border-radius: 4px;
}

/* 2. 语法高亮颜色调整（针对浅色背景优化） */

/* 注释 */
.hljs-comment,
.hljs-quote {
  color: #998 !important;
  font-style: italic !important;
}

/* 关键字、变量类型 */
.hljs-keyword,
.hljs-selector-tag,
.hljs-doctag,
.hljs-formula {
  color: #d73a49 !important; /* 红色/深粉色 */
  font-weight: bold !important;
}

/* 字符串、正则表达式 */
.hljs-string,
.hljs-regexp,
.hljs-addition,
.hljs-attribute,
.hljs-meta-string {
  color: #22863a !important; /* 绿色 */
}

/* 数字、常量、属性 */
.hljs-attr,
.hljs-variable,
.hljs-template-variable,
.hljs-type,
.hljs-number,
.hljs-literal {
  color: #005cc5 !important; /* 深蓝色 */
}

/* 函数名、类名、标题 */
.hljs-title,
.hljs-section,
.hljs-name,
.hljs-built_in,
.hljs-class .hljs-title {
  color: #6f42c1 !important; /* 紫色 */
}

/* 标签、CSS选择器 */
.hljs-tag,
.hljs-selector-id,
.hljs-selector-class {
  color: #22863a !important;
}

/* 强调 */
.hljs-emphasis { font-style: italic !important; }
.hljs-strong { font-weight: bold !important; }