/* 夜间主题：只在 <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;
    border: 1px solid rgba(96, 165, 250, 0.55);
    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: #1e293b;
    color: #fbbf24;
    border: 1px solid rgba(148, 163, 184, 0.28);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] .music-ball:hover {
    background: #253449;
    border-color: rgba(148, 163, 184, 0.45);
}

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;
}



html[data-theme="dark"] .tree ul > li::before {
    border-top-color: rgba(129, 140, 248, 0.45);
}


/* ---------- 书签页（深色） ---------- */
html[data-theme="dark"] .bm-page .bm-add {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .bm-page .bm-add input {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

html[data-theme="dark"] .bm-page .bm-add input::placeholder {
    color: #64748b;
}

html[data-theme="dark"] .bm-page .bm-add input:focus {
    background: #0f172a;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

html[data-theme="dark"] .bm-page .bm-count {
    background: rgba(99, 102, 241, 0.22);
    color: #c7d2fe;
}

html[data-theme="dark"] .bm-page .lab-subtitle {
    color: #64748b;
}

html[data-theme="dark"] .bm-page .bm-btn-link {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

html[data-theme="dark"] .bm-page .bm-btn-link:hover {
    background: rgba(99, 102, 241, 0.18);
    border-color: #4f46e5;
    color: #c7d2fe;
}

html[data-theme="dark"] .bm-page .bm-toolbar input {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

html[data-theme="dark"] .bm-page .bm-toolbar input::placeholder {
    color: #64748b;
}

html[data-theme="dark"] .bm-page .bm-group-title {
    color: #cbd5e1;
}

html[data-theme="dark"] .bm-page .bm-card {
    background: #1e293b;
    border-color: #334155;
    box-shadow: none;
}

html[data-theme="dark"] .bm-page .bm-card:hover {
    border-color: #4f46e5;
    box-shadow: 0 10px 24px -14px rgba(0, 0, 0, 0.7);
}

html[data-theme="dark"] .bm-page .bm-avatar {
    background: linear-gradient(135deg, #312e81, #4c1d95);
    box-shadow: inset 0 0 0 1px rgba(165, 180, 252, 0.2);
}

html[data-theme="dark"] .bm-page .bm-title {
    color: #f1f5f9;
}

html[data-theme="dark"] .bm-page .bm-host {
    color: #94a3b8;
}

html[data-theme="dark"] .bm-page .bm-import-result {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
    color: #6ee7b7;
}

html[data-theme="dark"] .bm-page .bm-import-btn {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

html[data-theme="dark"] .bm-page .empty-tip {
    color: #64748b;
}


/* ---------- 构建历史（深色） ---------- */
html[data-theme="dark"] .build-table thead th {
    background: #1e293b;
    color: #e2e8f0;
    font-weight: 700;
    border-bottom-color: #334155;
}

html[data-theme="dark"] .build-table th,
html[data-theme="dark"] .build-table td {
    border-bottom-color: #263449;
    color: #cbd5e1;
}

html[data-theme="dark"] .build-table tbody tr:nth-child(even) {
    background: rgba(148, 163, 184, 0.06);
}

html[data-theme="dark"] .build-table td.build-version {
    color: #94a3b8;
}


html[data-theme="dark"] .build-table td:nth-child(5) {
    color: #e2e8f0;
}


/* ---------- 深色：导航当前项胶囊 ---------- */
html[data-theme="dark"] .site-nav > a.is-active {
    background: rgba(99, 102, 241, 0.22);
    color: #c7d2fe;
}

html[data-theme="dark"] .site-nav > a:hover {
    color: #c7d2fe;
}

html[data-theme="dark"] .nav-more-panel a.is-active {
    background: rgba(99, 102, 241, 0.22);
    color: #c7d2fe;
}


/* ---------- 深色：标签云与标签胶囊 ---------- */
html[data-theme="dark"] .tag {
    background: rgba(99, 102, 241, 0.2);
    color: #c7d2fe;
}

html[data-theme="dark"] .tag:hover {
    background: #4f46e5;
    color: #fff;
}

html[data-theme="dark"] .tag-cloud-item:nth-child(6n+1) {
    background: rgba(99, 102, 241, 0.2);
    color: #c7d2fe;
}

html[data-theme="dark"] .tag-cloud-item:nth-child(6n+2) {
    background: rgba(16, 185, 129, 0.18);
    color: #6ee7b7;
}

html[data-theme="dark"] .tag-cloud-item:nth-child(6n+3) {
    background: rgba(245, 158, 11, 0.18);
    color: #fcd34d;
}

html[data-theme="dark"] .tag-cloud-item:nth-child(6n+4) {
    background: rgba(244, 63, 94, 0.18);
    color: #fda4af;
}

html[data-theme="dark"] .tag-cloud-item:nth-child(6n+5) {
    background: rgba(14, 165, 233, 0.18);
    color: #7dd3fc;
}

html[data-theme="dark"] .tag-cloud-item:nth-child(6n+6) {
    background: rgba(168, 85, 247, 0.2);
    color: #d8b4fe;
}


/* ============================================================
   深色补齐：扫描出来的浅色写死项
   ============================================================ */

/* 表格与列表 */
html[data-theme="dark"] .post-body th {
    background: #1e293b;
    color: #cbd5e1;
}

html[data-theme="dark"] .data-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.08);
}

html[data-theme="dark"] .status-tabs a.active {
    background: #4f46e5;
    color: #fff;
}

/* 状态徽标 */
html[data-theme="dark"] .badge-pending_payment {
    background: rgba(245, 158, 11, 0.18);
    color: #fcd34d;
}

html[data-theme="dark"] .badge-pending_review,
html[data-theme="dark"] .badge-pending_ship {
    background: rgba(99, 102, 241, 0.2);
    color: #c7d2fe;
}

html[data-theme="dark"] .badge-shipped {
    background: rgba(14, 165, 233, 0.2);
    color: #7dd3fc;
}

html[data-theme="dark"] .badge-completed {
    background: rgba(16, 185, 129, 0.18);
    color: #6ee7b7;
}

html[data-theme="dark"] .badge-refunding {
    background: rgba(244, 63, 94, 0.18);
    color: #fda4af;
}

html[data-theme="dark"] .badge-refunded {
    background: rgba(168, 85, 247, 0.2);
    color: #d8b4fe;
}

/* 提示条与错误 */
html[data-theme="dark"] .auth-notice,
html[data-theme="dark"] .code-badge {
    background: rgba(59, 130, 246, 0.16);
    color: #93c5fd;
}

html[data-theme="dark"] .form-error,
html[data-theme="dark"] .flash-error {
    background: rgba(244, 63, 94, 0.14);
    border-color: rgba(244, 63, 94, 0.35);
    color: #fda4af;
}

html[data-theme="dark"] .flash-success {
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(16, 185, 129, 0.35);
    color: #6ee7b7;
}

/* 小标签与胶囊 */
html[data-theme="dark"] .chip {
    background: rgba(99, 102, 241, 0.16);
    color: #c7d2fe;
}

html[data-theme="dark"] .chip:hover {
    background: #4f46e5;
    color: #fff;
}

/* 演示系统左侧菜单 */
html[data-theme="dark"] .demo-menu li a:hover,
html[data-theme="dark"] .demo-menu li a.active {
    background: rgba(99, 102, 241, 0.18);
    color: #c7d2fe;
}

/* 播放器按钮悬停 */
html[data-theme="dark"] .music-btn:hover {
    background: rgba(148, 163, 184, 0.18);
}

/* 测试设计：脑图节点 */
html[data-theme="dark"] .tree-label {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

html[data-theme="dark"] .tree > li > .tree-label {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-color: transparent;
    color: #fff;
}

html[data-theme="dark"] li[data-kind="module"] > .tree-label {
    background: #312e81;
    border-color: #4338ca;
    color: #c7d2fe;
}

html[data-theme="dark"] li[data-kind="scenario"] > .tree-label {
    background: #422006;
    border-color: #a16207;
    color: #fde68a;
}

html[data-theme="dark"] li[data-kind="case"] > .tree-label {
    background: #052e2b;
    border-color: #0f766e;
    color: #99f6e4;
}

/* 脑图节点上的小标签 */
html[data-theme="dark"] li[data-kind="module"] > .tree-label .mark-module {
    background: #1e1b4b;
    border-color: #4338ca;
    color: #c7d2fe;
}

html[data-theme="dark"] li[data-kind="scenario"] > .tree-label .mark-scenario {
    background: #451a03;
    border-color: #a16207;
    color: #fde68a;
}

html[data-theme="dark"] li[data-kind="case"] > .tree-label .mark-case {
    background: #042f2e;
    border-color: #0f766e;
    color: #99f6e4;
}

html[data-theme="dark"] li[data-kind="module"] > .tree-label .node-count {
    background: #1e1b4b;
    border-color: #4338ca;
    color: #c7d2fe;
}

html[data-theme="dark"] li[data-kind="scenario"] > .tree-label .node-count {
    background: #451a03;
    border-color: #a16207;
    color: #fde68a;
}

/* 标签云的普通标签 */
html[data-theme="dark"] .tag-cloud .tag:nth-child(6n+1) {
    background: rgba(99, 102, 241, 0.2);
    color: #c7d2fe;
}

html[data-theme="dark"] .tag-cloud .tag:nth-child(6n+2) {
    background: rgba(16, 185, 129, 0.18);
    color: #6ee7b7;
}

html[data-theme="dark"] .tag-cloud .tag:nth-child(6n+3) {
    background: rgba(245, 158, 11, 0.18);
    color: #fcd34d;
}

html[data-theme="dark"] .tag-cloud .tag:nth-child(6n+4) {
    background: rgba(244, 63, 94, 0.18);
    color: #fda4af;
}

html[data-theme="dark"] .tag-cloud .tag:nth-child(6n+5) {
    background: rgba(14, 165, 233, 0.18);
    color: #7dd3fc;
}

html[data-theme="dark"] .tag-cloud .tag:nth-child(6n+6) {
    background: rgba(168, 85, 247, 0.2);
    color: #d8b4fe;
}


/* ---------- 深色：手机端「退出」按钮（覆盖中性灰规则） ---------- */
/* 深色「退出」按钮：选择器与基础规则同权重，才能覆盖浅色底 */
html[data-theme="dark"] .site-header nav a.nav-user {
    background: rgba(16, 185, 129, 0.18);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.4);
}

html[data-theme="dark"] .site-header nav a.nav-user:hover {
    background: rgba(16, 185, 129, 0.3);
    color: #a7f3d0;
}


/* ---------- 深色：迷你条按钮 ---------- */
html[data-theme="dark"] .mp-mini-btn {
    background: rgba(251, 191, 36, 0.16);
    color: #fbbf24;
}

html[data-theme="dark"] .mp-mini-btn:hover {
    background: rgba(251, 191, 36, 0.28);
}

html[data-theme="dark"] .mp-mini-stop {
    background: rgba(148, 163, 184, 0.16);
    color: #cbd5e1;
}

html[data-theme="dark"] .mp-mini-stop:hover {
    background: rgba(244, 63, 94, 0.25);
    color: #fda4af;
}

html[data-theme="dark"] .mp-mini-progress {
    background: rgba(148, 163, 184, 0.18);
}


/* ---------- 深色：全屏播放页主按钮 ---------- */
html[data-theme="dark"] .mp-stage-play {
    background: #f8fafc;
    color: #0b1020;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .mp-stage-play:hover {
    background: #ffffff;
}


/* ---------- 深色：正文表格 ---------- */
html[data-theme="dark"] .post-content table th,
html[data-theme="dark"] .post-body table th {
    background: #1e293b;
    color: #e2e8f0;
}

html[data-theme="dark"] .post-content table tbody tr:nth-child(even),
html[data-theme="dark"] .post-body table tbody tr:nth-child(even) {
    background: rgba(148, 163, 184, 0.08);
}

html[data-theme="dark"] .post-content table td,
html[data-theme="dark"] .post-body table td {
    border-color: #334155;
    color: #cbd5e1;
}
