:root {
  color-scheme: light;
  --theme-background: #fff;
  --theme-surface: #f3f4f6;
  --theme-text: #30343b;
  --theme-muted: #a2a9b4;
  --theme-border: #dfe2e5;
  --theme-accent: #006cff;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --theme-background: #17191d;
  --theme-surface: #23272e;
  --theme-text: #e5e7eb;
  --theme-border: #3d4450;
  --theme-accent: #91baff;
  background: var(--theme-background);
}

:root[data-theme="dark"] body,
:root[data-theme="dark"] .main {
  background: var(--theme-background);
  color: var(--theme-text);
}

:root[data-theme="dark"] a,
:root[data-theme="dark"] .post-content a {
  color: var(--theme-text);
  border-bottom-color: var(--theme-border);
}

:root[data-theme="dark"] a:hover,
:root[data-theme="dark"] .post-content a:hover,
:root[data-theme="dark"] .post-abstract a {
  color: var(--theme-accent);
  border-bottom-color: currentColor;
}

:root[data-theme="dark"] :is(.site-description, .social-container a, .post-info > span,
  .site-footer, .next, .year, .time, .toc-container a, .post-content blockquote, .footer) {
  color: var(--theme-muted);
}

:root[data-theme="dark"] .post-info > span:not(:first-child)::before,
:root[data-theme="dark"] .post-content blockquote::before,
:root[data-theme="dark"] .post-content hr::before {
  color: var(--theme-muted);
}

:root[data-theme="dark"] .post-content :is(tr, td, th),
:root[data-theme="dark"] .post-content .footnotes::before,
:root[data-theme="dark"] .footer {
  border-color: var(--theme-border);
}

:root[data-theme="dark"] .post-content img { box-shadow: none; }
:root[data-theme="dark"] .toc-container .markdownIt-TOC::before { background: var(--theme-border); }

:root[data-theme="dark"] .tags-container .tag,
:root[data-theme="dark"] .toc-container a:hover,
:root[data-theme="dark"] .toc-container a.current {
  background: var(--theme-surface);
  color: var(--theme-accent);
}

:root[data-theme="dark"] .post-content :is(p, li) code,
:root[data-theme="dark"] .post-abstract code {
  background: var(--theme-surface);
  color: #ffb4bd;
  border-color: var(--theme-border);
}

:root[data-theme="dark"] .post-content pre code,
:root[data-theme="dark"] .hljs {
  background: var(--theme-surface);
  color: var(--theme-text);
}

:root[data-theme="dark"] :is(.hljs-comment, .hljs-quote, .hljs-meta) { color: var(--theme-muted); }
:root[data-theme="dark"] :is(.hljs-keyword, .hljs-selector-tag, .hljs-subst) { color: #d8b4fe; }
:root[data-theme="dark"] :is(.hljs-number, .hljs-literal, .hljs-variable, .hljs-template-variable, .hljs-attr) { color: #8bd5ca; }
:root[data-theme="dark"] :is(.hljs-string, .hljs-doctag, .hljs-regexp, .hljs-link) { color: #b5d99c; }
:root[data-theme="dark"] :is(.hljs-title, .hljs-section, .hljs-selector-id, .hljs-type, .hljs-symbol, .hljs-bullet) { color: #ffd58a; }
:root[data-theme="dark"] :is(.hljs-tag, .hljs-name, .hljs-attribute, .hljs-built_in, .hljs-builtin-name) { color: var(--theme-accent); }
:root[data-theme="dark"] .hljs-deletion { background: #512c35; }
:root[data-theme="dark"] .hljs-addition { background: #294535; }

:root[data-theme="dark"] :is(.number, .text, .btn) { color: var(--theme-text); }
:root[data-theme="dark"] .btn { background: var(--theme-surface); border-color: var(--theme-border); }
:root[data-theme="dark"] .btn svg { fill: currentColor; }
