/* Code Highlight Theme - GitHub Light for Hexo */

/* Syntax Colors */
.hljs { color: #24292e; background: transparent; }
.hljs-keyword, .hljs-selector-tag, .hljs-type { color: #d73a49; font-weight: 500; }
.hljs-string, .hljs-addition { color: #032f62; }
.hljs-number, .hljs-literal, .hljs-variable { color: #005cc5; }
.hljs-title, .hljs-section, .hljs-function .title { color: #6f42c1; font-weight: bold; }
.hljs-comment, .hljs-quote { color: #6a737d; font-style: italic; }
.hljs-meta, .hljs-deletion { color: #b31d28; }
.hljs-name, .hljs-selector-class { color: #6f42c1; font-weight: bold; }
.hljs-built_in { color: #e36209; }
.hljs-regexp, .hljs-symbol { color: #005cc5; }

/* Code Block Container */
figure.highlight {
  margin: 20px 0;
  border-radius: 8px;
  border: 1px solid #d0d7de;
  background: #fff;
}

figure.highlight table {
  width: 100%;
  border-collapse: collapse;
  border: none;
  margin: 0;
  background: transparent;
}

figure.highlight table td {
  border: none;
  padding: 0;
  vertical-align: top;
  background: transparent;
}

/* Line Numbers (Gutter) */
figure.highlight td.gutter {
  width: 44px;
  background: #f6f8fa;
  border-right: 1px solid #d0d7de;
  user-select: none;
}

figure.highlight td.gutter pre {
  padding: 16px 8px;
  margin: 0;
  text-align: right;
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #999;
  white-space: pre;
}

figure.highlight td.gutter pre .line {
  display: block;
}

/* Code Content */
figure.highlight td.code {
  background: #fff;
}

figure.highlight td.code pre {
  padding: 16px 20px;
  margin: 0;
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #24292e;
  white-space: pre;
  overflow-x: auto;
}

figure.highlight td.code pre code {
  display: block;
  background: none;
  padding: 0;
  border: none;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  white-space: pre;
}

/* Code Header Bar */
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
  padding: 0 12px;
  background: #f6f8fa;
  border-bottom: 1px solid #d0d7de;
  font-size: 12px;
  color: #57606a;
}

.code-lang { font-weight: 500; text-transform: lowercase; }

.code-copy-btn {
  padding: 3px 10px;
  background: #fff;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
  color: #57606a;
}
.code-copy-btn:hover { background: #f3f4f6; border-color: #3b82f6; color: #3b82f6; }
.code-copy-btn.copied { background: #dcfce7; border-color: #22c55e; color: #16a34a; }

/* Fallback for non-Hexo code blocks */
pre:not(figure pre) {
  margin: 16px 0;
  padding: 16px 20px;
  border-radius: 8px;
  border: 1px solid #d0d7de;
  background: #f6f8fa;
  overflow-x: auto;
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
}

pre:not(figure pre) code {
  background: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
}

/* Inline Code */
p code, li code, td code:not(figure td code) {
  padding: 2px 6px;
  margin: 0 2px;
  background: #f6f8fa;
  border-radius: 4px;
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 0.85em;
  color: #d73a49;
}
