/* 夜间主题：只在 <html data-theme="dark"> 时生效 */

html[data-theme="dark"] {
    color-scheme: dark;
}

html[data-theme="dark"] body {
    background: #0b1220;
    color: #cbd5e1;
}

/* 页头 / 页脚 */
html[data-theme="dark"] .site-header {
    background: #0f172a;
    border-bottom-color: #1e293b;
}

html[data-theme="dark"] .site-title,
html[data-theme="dark"] .site-nav a,
html[data-theme="dark"] .nav-more-btn {
    color: #e2e8f0;
}

html[data-theme="dark"] .site-nav a:hover,
html[data-theme="dark"] .nav-more-btn:hover {
    color: #93c5fd;
}

html[data-theme="dark"] .nav-search input {
    background: #111c33;
    border-color: #24324a;
    color: #e2e8f0;
}

html[data-theme="dark"] .nav-search button {
    background: #2563eb;
    color: #fff;
}

html[data-theme="dark"] .nav-user {
    background: #1e2a44;
    color: #c7d2fe;
}

html[data-theme="dark"] .nav-more-panel {
    background: #111c33;
    border-color: #24324a;
}

html[data-theme="dark"] .nav-more-panel a {
    color: #cbd5e1;
}

html[data-theme="dark"] .nav-more-panel a:hover {
    background: #1b2741;
    color: #93c5fd;
}

html[data-theme="dark"] .site-footer {
    background: #0f172a;
    border-top-color: #1e293b;
    color: #94a3b8;
}

/* 卡片与正文 */
html[data-theme="dark"] .post-item,
html[data-theme="dark"] .post-content,
html[data-theme="dark"] .widget,
html[data-theme="dark"] .home-hero,
html[data-theme="dark"] .series-item,
html[data-theme="dark"] .container-plain .post-item {
    background: #0f172a;
    border-color: #1e293b;
    box-shadow: none;
}

html[data-theme="dark"] .post-item h2 a,
html[data-theme="dark"] .post-content h1,
html[data-theme="dark"] .post-content h2,
html[data-theme="dark"] .post-content h3,
html[data-theme="dark"] .post-content h4,
html[data-theme="dark"] .home-hero h1,
html[data-theme="dark"] .series-card-link h2,
html[data-theme="dark"] .widget h3,
html[data-theme="dark"] .lab-title {
    color: #e2e8f0;
}

html[data-theme="dark"] .post-content p,
html[data-theme="dark"] .post-content li,
html[data-theme="dark"] .post-content td,
html[data-theme="dark"] .post-excerpt,
html[data-theme="dark"] .series-card-meta,
html[data-theme="dark"] .post-meta,
html[data-theme="dark"] .post-date,
html[data-theme="dark"] .post-read {
    color: #a8b6cc;
}

html[data-theme="dark"] .post-content a,
html[data-theme="dark"] .read-more,
html[data-theme="dark"] .series-badge {
    color: #7dd3fc;
}

html[data-theme="dark"] .post-content blockquote {
    background: #111c33;
    border-left-color: #334155;
    color: #cbd5e1;
}

html[data-theme="dark"] .post-content pre,
html[data-theme="dark"] .post-content code {
    background: #0b1220;
    border-color: #1e293b;
    color: #e2e8f0;
}

html[data-theme="dark"] .post-content table th,
html[data-theme="dark"] .post-content table td {
    border-color: #1e293b;
}

html[data-theme="dark"] .post-content table th {
    background: #111c33;
}

/* 标签、徽章、分页 */
html[data-theme="dark"] .tag,
html[data-theme="dark"] .tag-cloud-item {
    background: #16233c;
    color: #c7d2fe;
    border-color: #24324a;
}

html[data-theme="dark"] .pager-info,
html[data-theme="dark"] .build-hint {
    color: #7c8aa0;
}

html[data-theme="dark"] .pager a,
html[data-theme="dark"] .pager span,
html[data-theme="dark"] .btn-ghost {
    background: #111c33;
    border-color: #24324a;
    color: #cbd5e1;
}

/* 侧栏 */
html[data-theme="dark"] .sidebar .widget,
html[data-theme="dark"] .post-nav-inner {
    background: #0f172a;
    border-color: #1e293b;
}

html[data-theme="dark"] .post-nav-head,
html[data-theme="dark"] .post-nav-title {
    color: #cbd5e1;
}

html[data-theme="dark"] .post-nav-item,
html[data-theme="dark"] .post-nav-item a {
    color: #a8b6cc;
}

html[data-theme="dark"] .post-nav-item.is-active {
    background: #16233c;
    color: #93c5fd;
}

/* 表单与测试中心 */
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background: #111c33;
    border-color: #24324a;
    color: #e2e8f0;
}

html[data-theme="dark"] .lab-nav-item {
    background: #0f172a;
    border-color: #1e293b;
    border-left-color: #3b4a6b;
}

html[data-theme="dark"] .lab-nav-title {
    color: #e2e8f0;
}

html[data-theme="dark"] .lab-nav-desc,
html[data-theme="dark"] .lab-subtitle {
    color: #8b9ab1;
}

html[data-theme="dark"] .data-table th {
    background: #111c33;
    color: #cbd5e1;
}

html[data-theme="dark"] .data-table td {
    border-color: #1e293b;
    color: #a8b6cc;
}

/* 播放器 */
html[data-theme="dark"] .global-music-player {
    background: #0f172a;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] .music-info,
html[data-theme="dark"] .mp-meta .music-info {
    color: #e2e8f0;
}

html[data-theme="dark"] .music-list li {
    color: #a8b6cc;
}

html[data-theme="dark"] .music-list li.active {
    color: #93c5fd;
}

html[data-theme="dark"] .mp-mini-bar {
    background: #0f172a;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .mp-mini-title {
    color: #cbd5e1;
}

html[data-theme="dark"] .music-ball {
    background: #0f172a;
    color: #fbbf24;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] .back-to-top {
    background: #0f172a;
    border-color: #24324a;
    color: #cbd5e1;
}


/* 侧栏 / 系列目录补充 */
html[data-theme="dark"] .post-nav-head,
html[data-theme="dark"] .post-nav-title,
html[data-theme="dark"] .post-nav-group summary,
html[data-theme="dark"] .post-nav-item a,
html[data-theme="dark"] .post-nav-group a {
    color: #cbd5e1;
}

html[data-theme="dark"] .post-nav-item.is-active a,
html[data-theme="dark"] .post-nav-item.is-active {
    color: #93c5fd;
    background: #16233c;
}

html[data-theme="dark"] .series-badge {
    background: #16233c !important;
    color: #93c5fd !important;
    border-color: #24324a !important;
}

html[data-theme="dark"] .sidebar .widget h3,
html[data-theme="dark"] .widget h3 {
    color: #e2e8f0;
}

html[data-theme="dark"] .widget-list a,
html[data-theme="dark"] .widget a,
html[data-theme="dark"] .toc a {
    color: #a8b6cc;
}

html[data-theme="dark"] .widget-list a:hover,
html[data-theme="dark"] .toc a:hover {
    color: #93c5fd;
}

html[data-theme="dark"] .tag-cloud-item {
    background: #16233c !important;
    color: #c7d2fe !important;
    border-color: #24324a !important;
}

html[data-theme="dark"] .stat-row,
html[data-theme="dark"] .stat-row span,
html[data-theme="dark"] .stat-row strong {
    color: #cbd5e1 !important;
}


/* 三级系列树（文章页左栏） */
html[data-theme="dark"] .nav-tree,
html[data-theme="dark"] .nav-tree a,
html[data-theme="dark"] .nav-tree-name,
html[data-theme="dark"] .nav-tree-subname,
html[data-theme="dark"] .nav-tree-count,
html[data-theme="dark"] .post-nav-head a,
html[data-theme="dark"] .post-nav-head span,
html[data-theme="dark"] .nav-tree-title,
html[data-theme="dark"] .nav-tree-subtitle {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .nav-tree-leaves a {
    color: #a8b6cc !important;
}

html[data-theme="dark"] .nav-tree-leaves a.is-active,
html[data-theme="dark"] .nav-tree-leaves li.is-active a {
    color: #93c5fd !important;
    background: #16233c;
}

html[data-theme="dark"] .post-nav-inner {
    background: #0f172a;
    border-color: #1e293b;
}


/* 测试中心的演示卡与测试卡片 */
html[data-theme="dark"] .lab-card {
    background: #0f172a !important;
    border-color: #1e293b !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .lab-card h3,
html[data-theme="dark"] .lab-card .card-label,
html[data-theme="dark"] .lab-card-title,
html[data-theme="dark"] .lab-card-owner {
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .lab-card p,
html[data-theme="dark"] .lab-card .card-desc,
html[data-theme="dark"] .lab-card-link {
    color: #a8b6cc !important;
}

html[data-theme="dark"] .lab-card .card-tag,
html[data-theme="dark"] .card-tag {
    background: #1e293b !important;
    color: #fbbf24 !important;
}

html[data-theme="dark"] .lab-card:hover {
    border-color: #334155 !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .lab-card .card-edit input,
html[data-theme="dark"] .lab-card .card-edit textarea {
    background: #111c33 !important;
    border-color: #24324a !important;
    color: #e2e8f0 !important;
}


html[data-theme="dark"] .lab-card h2,
html[data-theme="dark"] .lab-card h3,
html[data-theme="dark"] .lab-card.card-new summary,
html[data-theme="dark"] .lab-card.card-new[open] summary {
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .lab-card p,
html[data-theme="dark"] .lab-card.card-new summary {
    color: #a8b6cc !important;
}

html[data-theme="dark"] .lab-card .lab-card-link {
    color: #7dd3fc !important;
}

html[data-theme="dark"] .lab-card.card-new {
    background: #0d1930 !important;
    border-color: #24324a !important;
}

html[data-theme="dark"] .lab-card input,
html[data-theme="dark"] .lab-card textarea {
    background: #111c33 !important;
    border-color: #24324a !important;
    color: #e2e8f0 !important;
}


/* 系列页卡片（浅色样式里有 !important，需要同等强度覆盖） */
html[data-theme="dark"] .series-grid .series-item,
html[data-theme="dark"] .container-plain .post-item {
    background: #0f172a !important;
    border-color: #1e293b !important;
    border-left-color: #3b4a6b !important;
}

html[data-theme="dark"] .series-grid .series-item:hover {
    background: #131f36 !important;
}

html[data-theme="dark"] .series-card-link h2,
html[data-theme="dark"] .series-grid .series-item h2 {
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .series-card-link:hover h2 {
    color: #93c5fd !important;
}

html[data-theme="dark"] .series-grid .series-item .post-excerpt,
html[data-theme="dark"] .series-card-meta {
    color: #8b9ab1 !important;
}

html[data-theme="dark"] .series-card-link .read-more {
    color: #7dd3fc !important;
}

html[data-theme="dark"] .series-subtitle,
html[data-theme="dark"] .container-plain .tag-heading {
    color: #cbd5e1 !important;
}
