/* ==========================================================================
   代码高亮 — 纸面版
   --------------------------------------------------------------------------
   语法配色取自 GitHub Primer 的浅色/深色两套, 饱和度整体压低了一档:
   GitHub 原色在暖白纸面上偏荧光, 长文里读久了刺眼, 也容易显得"模板化"。
   背景不在此处声明, 由 style.css 的 --code-bg 统一决定。
   ========================================================================== */

pre code.hljs {
  display: block;
  overflow-x: auto;
  padding: 0;
}
code.hljs {
  padding: 0;
}

.hljs {
  color: #24211c;
  background: transparent;
}
.hljs-doctag,
.hljs-keyword,
.hljs-meta .hljs-keyword,
.hljs-template-tag,
.hljs-template-variable,
.hljs-type,
.hljs-variable.language_ {
  color: #9a3412;
}
.hljs-title,
.hljs-title.class_,
.hljs-title.class_.inherited__,
.hljs-title.function_ {
  color: #6b3fa0;
}
.hljs-attr,
.hljs-attribute,
.hljs-literal,
.hljs-meta,
.hljs-number,
.hljs-operator,
.hljs-selector-attr,
.hljs-selector-class,
.hljs-selector-id,
.hljs-variable {
  color: #1f5b8a;
}
.hljs-meta .hljs-string,
.hljs-regexp,
.hljs-string {
  color: #2c6a3f;
}
.hljs-built_in,
.hljs-symbol {
  color: #9a5b12;
}
.hljs-code,
.hljs-comment,
.hljs-formula {
  color: #8a8478;
  font-style: italic;
}
.hljs-name,
.hljs-quote,
.hljs-selector-pseudo,
.hljs-selector-tag {
  color: #47631d;
}
.hljs-subst {
  color: #24211c;
}
.hljs-section {
  color: #1f5b8a;
  font-weight: 700;
}
.hljs-bullet {
  color: #755e0c;
}
.hljs-emphasis {
  font-style: italic;
}
.hljs-strong {
  font-weight: 700;
}
.hljs-addition {
  color: #2c6a3f;
  background-color: rgba(44, 106, 63, 0.08);
}
.hljs-deletion {
  color: #9a2412;
  background-color: rgba(154, 36, 18, 0.08);
}

/* 深色模式: 同一组色相提亮, 保持可读但不刺眼 */
html[data-mode="dark"] .hljs {
  color: #ddd7cb;
}
html[data-mode="dark"] .hljs-doctag,
html[data-mode="dark"] .hljs-keyword,
html[data-mode="dark"] .hljs-meta .hljs-keyword,
html[data-mode="dark"] .hljs-template-tag,
html[data-mode="dark"] .hljs-template-variable,
html[data-mode="dark"] .hljs-type,
html[data-mode="dark"] .hljs-variable.language_ {
  color: #e3a07a;
}
html[data-mode="dark"] .hljs-title,
html[data-mode="dark"] .hljs-title.class_,
html[data-mode="dark"] .hljs-title.class_.inherited__,
html[data-mode="dark"] .hljs-title.function_ {
  color: #c4a8e8;
}
html[data-mode="dark"] .hljs-attr,
html[data-mode="dark"] .hljs-attribute,
html[data-mode="dark"] .hljs-literal,
html[data-mode="dark"] .hljs-meta,
html[data-mode="dark"] .hljs-number,
html[data-mode="dark"] .hljs-operator,
html[data-mode="dark"] .hljs-selector-attr,
html[data-mode="dark"] .hljs-selector-class,
html[data-mode="dark"] .hljs-selector-id,
html[data-mode="dark"] .hljs-variable {
  color: #8cbfe0;
}
html[data-mode="dark"] .hljs-meta .hljs-string,
html[data-mode="dark"] .hljs-regexp,
html[data-mode="dark"] .hljs-string {
  color: #9fcfa8;
}
html[data-mode="dark"] .hljs-built_in,
html[data-mode="dark"] .hljs-symbol {
  color: #e0b87a;
}
html[data-mode="dark"] .hljs-code,
html[data-mode="dark"] .hljs-comment,
html[data-mode="dark"] .hljs-formula {
  color: #7d766a;
}
html[data-mode="dark"] .hljs-name,
html[data-mode="dark"] .hljs-quote,
html[data-mode="dark"] .hljs-selector-pseudo,
html[data-mode="dark"] .hljs-selector-tag {
  color: #b3c98a;
}
html[data-mode="dark"] .hljs-subst {
  color: #ddd7cb;
}
html[data-mode="dark"] .hljs-section {
  color: #8cbfe0;
  font-weight: 700;
}
html[data-mode="dark"] .hljs-bullet {
  color: #d6bd7a;
}
html[data-mode="dark"] .hljs-addition {
  color: #9fcfa8;
  background-color: rgba(159, 207, 168, 0.1);
}
html[data-mode="dark"] .hljs-deletion {
  color: #e3a07a;
  background-color: rgba(227, 160, 122, 0.1);
}
