pre code.hljs {
  display: block;
  overflow-x: auto;
  padding: 1.5em;
  line-height: 1.6;
  border-radius: 8px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.95rem;
}

code.hljs {
  padding: 3px 6px;
  border-radius: 4px;
}

.hljs {
  color: #e6edf3;
  background: #0d1117;
  border: 1px solid #30363d;
}

/* 关键字 - 更醒目的红色 */
.hljs-doctag,
.hljs-keyword,
.hljs-meta .hljs-keyword,
.hljs-template-tag,
.hljs-template-variable,
.hljs-type,
.hljs-variable.language_ {
  color: #ff7b72;
  font-weight: 600;
}

/* 函数名 - 更柔和的紫色 */
.hljs-title,
.hljs-title.class_,
.hljs-title.class_.inherited__,
.hljs-title.function_ {
  color: #d2a8ff;
}

/* 变量和属性 - 更明亮的蓝色 */
.hljs-attr,
.hljs-attribute,
.hljs-literal,
.hljs-meta,
.hljs-number,
.hljs-operator,
.hljs-selector-attr,
.hljs-selector-class,
.hljs-selector-id,
.hljs-variable {
  color: #79c0ff;
}

/* 字符串 - 更温暖的黄色 */
.hljs-meta .hljs-string,
.hljs-regexp,
.hljs-string {
  color: #ffd700;
}

/* 内置函数 - 更鲜艳的橙色 */
.hljs-built_in,
.hljs-symbol {
  color: #ffa657;
}

/* 注释 - 更明显的灰色 */
.hljs-code,
.hljs-comment,
.hljs-formula {
  color: #8b949e;
  font-style: italic;
}

/* 标签和选择器 - 更清新的绿色 */
.hljs-name,
.hljs-quote,
.hljs-selector-pseudo,
.hljs-selector-tag {
  color: #7ee787;
}

.hljs-subst {
  color: #e6edf3;
}

/* 标题和章节 - 更突出的蓝色 */
.hljs-section {
  color: #2f81f7;
  font-weight: 700;
}

/* 列表项 - 更明亮的黄色 */
.hljs-bullet {
  color: #f2cc60;
}

/* 强调文本 */
.hljs-emphasis {
  color: #e6edf3;
  font-style: italic;
}

.hljs-strong {
  color: #e6edf3;
  font-weight: 700;
}

/* 增删改标记 - 更高的对比度 */
.hljs-addition {
  color: #3fb950;
  background-color: rgba(46, 160, 67, 0.15);
  display: inline-block;
  width: 100%;
  padding: 2px 4px;
  border-left: 3px solid #3fb950;
}

.hljs-deletion {
  color: #ff7b72;
  background-color: rgba(248, 81, 73, 0.15);
  display: inline-block;
  width: 100%;
  padding: 2px 4px;
  border-left: 3px solid #ff7b72;
}

/* 新增：代码块行号样式 */
.hljs-ln-numbers {
  color: #6e7681;
  text-align: right;
  padding-right: 1rem;
  border-right: 1px solid #30363d;
  user-select: none;
}

/* 新增：代码块选中状态 */
.hljs ::selection {
  background-color: rgba(56, 139, 253, 0.4);
}

/* 响应式调整 */
@media (max-width: 768px) {
  pre code.hljs {
    padding: 1rem;
    font-size: 0.9rem;
    border-radius: 6px;
  }
}

/* 代码块滚动条美化 */
pre code.hljs::-webkit-scrollbar {
  height: 8px;
}

pre code.hljs::-webkit-scrollbar-track {
  background: rgba(240, 246, 252, 0.1);
  border-radius: 4px;
}

pre code.hljs::-webkit-scrollbar-thumb {
  background: rgba(139, 148, 158, 0.4);
  border-radius: 4px;
}

pre code.hljs::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 148, 158, 0.6);
}