/* Dark mode variables */
:root {
    --dark-bg: #1a1a1a;
    --dark-text: #e0e0e0;
    --dark-link: #58a6ff;
    --dark-border: #333;
    --dark-code-bg: #2d2d2d;
    --dark-hover: #333;
    --dark-content-bg: #242424;
    --dark-header-bg: #1a1a1a;
    --dark-footer-bg: #1a1a1a;
}

/* Basic dark mode styling */
body.dark-mode {
    background-color: var(--dark-bg);
    color: var(--dark-text);
}

.dark-mode a {
    color: var(--dark-link);
}

.dark-mode .section {
    background-color: var(--dark-content-bg);
    border-color: var(--dark-border);
}

.dark-mode header {
    background-color: var(--dark-header-bg);
}

.dark-mode footer {
    background-color: var(--dark-footer-bg);
}

/* Code elements in dark mode */
.dark-mode pre, .dark-mode code {
    background-color: var(--dark-code-bg);
    color: #e0e0e0;
}

/* Article items in dark mode */
.dark-mode .article-item {
    background-color: var(--dark-content-bg);
    border-left-color: var(--dark-link);
}

.dark-mode .article-item:hover {
    background-color: var(--dark-hover);
}

/* Table styling in dark mode */
.dark-mode table th {
    background-color: #333;
}

.dark-mode table td {
    border-color: #444;
}

.dark-mode table tr:nth-child(even) {
    background-color: #2a2a2a;
}

/* Syntax highlighting in dark mode */
.dark-mode .hljs {
    background: #1e1e1e !important;
    color: #e0e0e0 !important;
}

/* Global variable overrides for dark mode */
.dark-mode {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --content-bg-color: #1e1e1e;
    --sidebar-bg-color: #1a1a1a;
    --sidebar-text-color: #a0a0a0;
    --sidebar-hover-color: #ffffff;
    --table-header-bg: #2d2d2d;
    --table-even-row: #2a2a2a;
    --article-bg: #252525;
    --article-hover-bg: #303030;
    --code-bg: #1a1a1a;
    --inline-code-bg: rgba(0,0,0,0.3);
}

/* Markdown body styling in dark mode */
.dark-mode .markdown-body {
    color-scheme: dark;
    background-color: #0d1117;
    color: #c9d1d9;
}

/* Scrollbar styling */
.dark-mode *::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.dark-mode *::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.dark-mode *::-webkit-scrollbar-thumb {
    background-color: #333;
    border-radius: 6px;
    border: 3px solid #1a1a1a;
}

/* 代码高亮夜间模式 */
.dark-mode .hljs {
    background: #161b22 !important;
    color: #c9d1d9 !important;
}

.dark-mode .markdown-body pre {
    background-color: #161b22 !important;
}

.dark-mode .markdown-body code:not(.hljs) {
    background-color: rgba(240,246,252,0.15) !important;
    color: #c9d1d9 !important;
}

/* TOC夜间模式 */
.dark-mode #toc a {
    color: #c9d1d9;
}

.dark-mode #toc a:hover {
    color: #58a6ff;
}

.dark-mode .markdown-body pre {
    background-color: #161b22;
}

.dark-mode .markdown-body code {
    background-color: rgba(240,246,252,0.15);
    color: #c9d1d9;
}
