/* ==========================================================================
   Code Themes for WeChat Articles (macOS Style Window)
   Compliant with WeChat 2026:
   - Wrapped in section with data-ignore-width
   - Responsive horizontal scroll on mobile devices
   - Safe line-height: 1.5; font-size: 13px
   ========================================================================== */

.wx-code-container {
  margin: 20px 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  font-family: Consolas, "Fira Code", Monaco, Menlo, monospace;
  font-size: 13px;
  line-height: 1.6;
}

/* macOS Window Header Bar */
.wx-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  user-select: none;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.wx-mac-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.wx-mac-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.wx-mac-dot.red { background-color: #ff5f56; }
.wx-mac-dot.yellow { background-color: #ffbd2e; }
.wx-mac-dot.green { background-color: #27c93f; }

.wx-code-lang {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.75;
}

/* Code Pre/Code Area */
.wx-code-pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  white-space: pre;
  word-wrap: normal;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

.wx-code-pre code {
  background: transparent;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

/* ==========================================================================
   THEME 1: Mac One Dark (Default)
   ========================================================================== */
.code-theme-onedark .wx-code-header {
  background-color: #21252b;
  color: #9da5b4;
}
.code-theme-onedark .wx-code-pre {
  background-color: #282c34;
  color: #abb2bf;
}
.code-theme-onedark .hljs-keyword,
.code-theme-onedark .hljs-operator { color: #c678dd; }
.code-theme-onedark .hljs-string { color: #98c379; }
.code-theme-onedark .hljs-comment { color: #5c6370; font-style: italic; }
.code-theme-onedark .hljs-number { color: #d19a66; }
.code-theme-onedark .hljs-function,
.code-theme-onedark .hljs-title { color: #61afef; }
.code-theme-onedark .hljs-type,
.code-theme-onedark .hljs-class { color: #e5c07b; }
.code-theme-onedark .hljs-variable,
.code-theme-onedark .hljs-params { color: #e06c75; }
.code-theme-onedark .hljs-built_in { color: #56b6c2; }

/* ==========================================================================
   THEME 2: Mac VS Code Dark+
   ========================================================================== */
.code-theme-vscodedark .wx-code-header {
  background-color: #181818;
  color: #cccccc;
}
.code-theme-vscodedark .wx-code-pre {
  background-color: #1e1e1e;
  color: #d4d4d4;
}
.code-theme-vscodedark .hljs-keyword { color: #569cd6; }
.code-theme-vscodedark .hljs-string { color: #ce9178; }
.code-theme-vscodedark .hljs-comment { color: #6a9955; font-style: italic; }
.code-theme-vscodedark .hljs-number { color: #b5cea8; }
.code-theme-vscodedark .hljs-function,
.code-theme-vscodedark .hljs-title { color: #dcdcaa; }
.code-theme-vscodedark .hljs-type { color: #4ec9b0; }
.code-theme-vscodedark .hljs-variable { color: #9cdcfe; }
.code-theme-vscodedark .hljs-built_in { color: #4ec9b0; }

/* ==========================================================================
   THEME 3: Mac GitHub Light
   ========================================================================== */
.code-theme-githublight .wx-code-header {
  background-color: #eaeef2;
  color: #57606a;
  border-bottom: 1px solid #d0d7de;
}
.code-theme-githublight .wx-code-pre {
  background-color: #f6f8fa;
  color: #24292f;
}
.code-theme-githublight .hljs-keyword { color: #cf222e; font-weight: 600; }
.code-theme-githublight .hljs-string { color: #0a3069; }
.code-theme-githublight .hljs-comment { color: #6e7781; font-style: italic; }
.code-theme-githublight .hljs-number { color: #0550ae; }
.code-theme-githublight .hljs-function,
.code-theme-githublight .hljs-title { color: #8250df; }
.code-theme-githublight .hljs-type { color: #953800; }
.code-theme-githublight .hljs-variable { color: #953800; }
.code-theme-githublight .hljs-built_in { color: #116329; }

/* ==========================================================================
   THEME 4: Mac Dracula
   ========================================================================== */
.code-theme-dracula .wx-code-header {
  background-color: #21222c;
  color: #f8f8f2;
}
.code-theme-dracula .wx-code-pre {
  background-color: #282a36;
  color: #f8f8f2;
}
.code-theme-dracula .hljs-keyword { color: #ff79c6; }
.code-theme-dracula .hljs-string { color: #f1fa8c; }
.code-theme-dracula .hljs-comment { color: #6272a4; font-style: italic; }
.code-theme-dracula .hljs-number { color: #bd93f9; }
.code-theme-dracula .hljs-function,
.code-theme-dracula .hljs-title { color: #50fa7b; }
.code-theme-dracula .hljs-type { color: #8be9fd; }
.code-theme-dracula .hljs-variable { color: #ffb86c; }
.code-theme-dracula .hljs-built_in { color: #8be9fd; }

/* ==========================================================================
   THEME 5: Mac Monokai
   ========================================================================== */
.code-theme-monokai .wx-code-header {
  background-color: #1e1f1c;
  color: #f8f8f2;
}
.code-theme-monokai .wx-code-pre {
  background-color: #272822;
  color: #f8f8f2;
}
.code-theme-monokai .hljs-keyword { color: #f92672; }
.code-theme-monokai .hljs-string { color: #e6db74; }
.code-theme-monokai .hljs-comment { color: #75715e; font-style: italic; }
.code-theme-monokai .hljs-number { color: #ae81ff; }
.code-theme-monokai .hljs-function,
.code-theme-monokai .hljs-title { color: #a6e22e; }
.code-theme-monokai .hljs-type { color: #66d9ef; }
.code-theme-monokai .hljs-variable { color: #fd971f; }
.code-theme-monokai .hljs-built_in { color: #66d9ef; }
