/* ========================================
   niu2涓婚 - 夜间模式
   ======================================== */

body.dark-mode {
    --niu2-bg: #0f172a;
    --niu2-card-bg: #1e293b;
    --niu2-text: #f1f5f9;
    --niu2-text-secondary: #94a3b8;
    --niu2-text-muted: #64748b;
    --niu2-border: #334155;
    --niu2-border-light: #293548;
    --niu2-shadow: 0 1px 3px rgba(0,0,0,0.3);
    --niu2-shadow-md: 0 4px 6px rgba(0,0,0,0.4);
    --niu2-shadow-lg: 0 10px 15px rgba(0,0,0,0.5);

    background: var(--niu2-bg);
    color: var(--niu2-text);
}

body.dark-mode .niu2-header {
    background: rgba(30, 41, 59, 0.95);
    border-bottom: 1px solid var(--niu2-border);
}

body.dark-mode .nav-menu > li > a { color: var(--niu2-text); }
body.dark-mode .nav-menu > li > a:hover { color: var(--niu2-primary); }

body.dark-mode .sub-menu {
    background: var(--niu2-card-bg);
    border: 1px solid var(--niu2-border);
}

body.dark-mode .header-search .search-form { background: var(--niu2-bg); }
body.dark-mode .header-search .search-input { color: var(--niu2-text); }
body.dark-mode .dark-mode-toggle { background: var(--niu2-bg); color: var(--niu2-accent); }

body.dark-mode .post-card,
body.dark-mode .widget,
body.dark-mode .cms-block,
body.dark-mode .single-article,
body.dark-mode .uc-sidebar,
body.dark-mode .uc-content,
body.dark-mode .submit-form,
body.dark-mode .submit-login-required,
body.dark-mode .niu2-login-required,
body.dark-mode .pricing-card,
body.dark-mode .feature-item,
body.dark-mode .faq-item,
body.dark-mode .modal-content {
    background: var(--niu2-card-bg);
    border: 1px solid var(--niu2-border);
}

body.dark-mode .card-excerpt,
body.dark-mode .card-meta,
body.dark-mode .cms-card-excerpt,
body.dark-mode .cms-card-meta { color: var(--niu2-text-secondary); }

body.dark-mode .article-content blockquote {
    background: var(--niu2-bg);
    color: var(--niu2-text-secondary);
}

body.dark-mode .article-content code {
    background: var(--niu2-bg);
    color: #a5b4fc;
}

body.dark-mode .article-content pre {
    background: #0f172a;
    border: 1px solid var(--niu2-border);
}

body.dark-mode .article-content th { background: var(--niu2-bg); }
body.dark-mode .article-content th,
body.dark-mode .article-content td { border-color: var(--niu2-border); }

body.dark-mode .niu2-download-box,
body.dark-mode .article-author-box,
body.dark-mode .article-actions,
body.dark-mode .uc-stat-card,
body.dark-mode .aff-balance-card,
body.dark-mode .aff-link-card,
body.dark-mode .related-card,
body.dark-mode .comment-body,
body.dark-mode .niu2-notice {
    background: var(--niu2-bg);
}

body.dark-mode .action-btn {
    background: var(--niu2-card-bg);
    border-color: var(--niu2-border);
    color: var(--niu2-text-secondary);
}

body.dark-mode .uc-table th { background: var(--niu2-bg); }
body.dark-mode .uc-table th,
body.dark-mode .uc-table td { border-color: var(--niu2-border-light); }

body.dark-mode .uc-download-item,
body.dark-mode .uc-fav-item { background: var(--niu2-bg); }

body.dark-mode .uc-menu-item:hover { background: var(--niu2-bg); }
body.dark-mode .uc-menu-item.active {
    background: rgba(99, 102, 241, 0.15);
}

body.dark-mode .niu2-filter-bar {
    background: var(--niu2-card-bg);
    border: 1px solid var(--niu2-border);
}

body.dark-mode .filter-link { color: var(--niu2-text-secondary); }

body.dark-mode .page-numbers {
    background: var(--niu2-card-bg);
    border-color: var(--niu2-border);
    color: var(--niu2-text-secondary);
}

body.dark-mode .comment-form input,
body.dark-mode .comment-form textarea,
body.dark-mode .uc-profile-form input,
body.dark-mode .uc-profile-form textarea,
body.dark-mode .submit-form input,
body.dark-mode .submit-form select,
body.dark-mode .form-group input {
    background: var(--niu2-bg);
    border-color: var(--niu2-border);
    color: var(--niu2-text);
}

body.dark-mode .aff-link-input {
    background: var(--niu2-card-bg);
    border-color: var(--niu2-border);
    color: var(--niu2-text);
}

body.dark-mode .pricing-card.premium {
    background: linear-gradient(135deg, #422006, #78350f);
}

body.dark-mode .niu2-footer { background: #020617; }

body.dark-mode .mobile-menu-panel {
    background: var(--niu2-card-bg);
}
body.dark-mode .mobile-nav li a {
    color: var(--niu2-text);
    border-color: var(--niu2-border-light);
}

body.dark-mode .niu2-top-notice { opacity: 0.95; }

body.dark-mode .search-form .search-field {
    background: var(--niu2-bg);
    border-color: var(--niu2-border);
    color: var(--niu2-text);
}

body.dark-mode .thumb-placeholder { background: var(--niu2-bg); }

body.dark-mode .widget .tag-cloud-link,
body.dark-mode .wp-tag-cloud a {
    background: var(--niu2-bg);
    color: var(--niu2-text-secondary);
}

body.dark-mode .niu2-widget-stats .stat-row { border-color: var(--niu2-border-light); }
body.dark-mode .niu2-widget-hot li { border-color: var(--niu2-border-light); }
body.dark-mode .rank-num { background: var(--niu2-bg); color: var(--niu2-text-muted); }

body.dark-mode .home-vip-intro { opacity: 0.95; }

body.dark-mode .paid-content-tip {
    background: rgba(99, 102, 241, 0.08);
}

/* 夜间模式过渡 */
body, .niu2-header, .post-card, .widget, .cms-block,
.single-article, .uc-sidebar, .uc-content {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* 夜间模式切换按钮图标变化 */
body.dark-mode .dark-mode-toggle .dashicons-moon::before {
    content: "\f145"; /* sun icon */
}

/* ===== 夜间模式可读性增强 ===== */
body.dark-mode .article-title,
body.dark-mode .single-title,
body.dark-mode .entry-title,
body.dark-mode .related-title,
body.dark-mode .resource-list-title,
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
    color: #f1f5f9;
}
body.dark-mode .article-content,
body.dark-mode .single-article,
body.dark-mode .article-content p,
body.dark-mode .article-content li,
body.dark-mode .article-content div {
    color: #d1d5db;
}
body.dark-mode .article-content a {
    color: #a5b4fc;
}
body.dark-mode .post-meta,
body.dark-mode .article-meta,
body.dark-mode .meta-item,
body.dark-mode .card-meta {
    color: #94a3b8;
}
body.dark-mode .niu2-download-box,
body.dark-mode .download-box,
body.dark-mode .download-url-input,
body.dark-mode .download-info-box {
    color: #d1d5db;
}
body.dark-mode .download-url-input {
    background: #0f172a;
    border-color: #334155;
}
body.dark-mode .widget-title {
    color: #f1f5f9;
}
body.dark-mode .widget a {
    color: #cbd5e1;
}
body.dark-mode .widget a:hover {
    color: var(--niu2-primary);
}
/* 悬浮按钮深色模式：图标保持清晰 */
body.dark-mode .float-btn {
    background: #1e293b;
    border: 1px solid #334155;
}

/* ===== 暗色模式框选区域配色优化（统一主题紫色系） ===== */

/* 1. 课程/文章卡片 */
body.dark-mode .post-card {
    background: var(--niu2-card-bg);
    border: 1px solid var(--niu2-border);
}
body.dark-mode .post-card:hover {
    border-color: var(--niu2-primary);
    box-shadow: 0 6px 22px rgba(0,0,0,0.45);
}
body.dark-mode .post-card .card-title a,
body.dark-mode .cms-card-title a {
    color: #f1f5f9;
}
body.dark-mode .post-card .card-title a:hover,
body.dark-mode .cms-card-title a:hover {
    color: var(--niu2-primary);
}
body.dark-mode .card-price,
body.dark-mode .cms-card-price {
    color: var(--niu2-warning);
}

/* 2. 加载更多按钮（深色下用主题紫色渐变） */
body.dark-mode .load-more-btn {
    background: linear-gradient(135deg, var(--niu2-primary), var(--niu2-secondary));
    border: none;
    color: #fff;
    box-shadow: 0 2px 10px rgba(99,102,241,0.3);
}
body.dark-mode .load-more-btn:hover {
    color: #fff;
    box-shadow: 0 4px 16px rgba(99,102,241,0.45);
}

/* 3. VIP套餐卡（premium 金色暗调，与浅色模式终身SVIP金色一致） */
body.dark-mode .pricing-card.premium {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.20), rgba(217, 119, 6, 0.10));
    border-color: rgba(245, 158, 11, 0.55);
}
body.dark-mode .pricing-card .pricing-price {
    color: #f1f5f9;
}
body.dark-mode .pricing-card .pricing-features li {
    border-color: var(--niu2-border-light);
    color: #cbd5e1;
}
body.dark-mode .pricing-card .pricing-header h3 {
    color: #f1f5f9;
}
body.dark-mode .pricing-badge {
    background: var(--niu2-primary);
}
body.dark-mode .pricing-card.premium .pricing-badge {
    background: var(--niu2-accent);
}

/* 4. 上一篇/下一篇导航（原浅灰背景，深色下适配） */
body.dark-mode .nav-prev a,
body.dark-mode .nav-next a {
    background: var(--niu2-card-bg);
    border: 1px solid var(--niu2-border);
    color: #d1d5db;
}
body.dark-mode .nav-prev a:hover,
body.dark-mode .nav-next a:hover {
    background: rgba(99,102,241,0.14);
    border-color: var(--niu2-primary);
    color: #fff;
}
body.dark-mode .nav-arrow {
    color: var(--niu2-text-muted);
}
body.dark-mode .nav-label {
    color: var(--niu2-text-muted);
}

/* 5. 相关推荐 */
body.dark-mode .related-card {
    background: var(--niu2-card-bg);
    border: 1px solid var(--niu2-border);
}
body.dark-mode .related-card h4 a {
    color: #e5e7eb;
}
body.dark-mode .related-card h4 a:hover {
    color: var(--niu2-primary);
}

/* 6. 立即下载按钮（绿色改为主题紫色渐变） */
body.dark-mode .download-btn {
    background: linear-gradient(135deg, var(--niu2-primary), var(--niu2-secondary)) !important;
    color: #fff !important;
    box-shadow: 0 2px 10px rgba(99,102,241,0.35) !important;
}

/* 7. 下载信息/资源详情列表 */
body.dark-mode .download-widget .download-title,
body.dark-mode .download-widget h3 {
    color: #f1f5f9;
}
body.dark-mode .download-resource-list {
    border-color: var(--niu2-border-light);
}
body.dark-mode .resource-list-title {
    color: #e5e7eb;
}
body.dark-mode .download-resource-list li {
    color: #cbd5e1;
    border-color: var(--niu2-border-light);
}

/* 8. 用户中心搜索框 */
body.dark-mode .widget .search-form .search-field {
    background: var(--niu2-bg);
    border-color: var(--niu2-border);
    color: var(--niu2-text);
}
body.dark-mode .widget .search-form .search-submit {
    background: var(--niu2-primary);
    color: #fff;
}

/* 9. 近期文章/侧边栏列表 */
body.dark-mode .widget .recent-posts li,
body.dark-mode .widget ul li {
    border-color: var(--niu2-border-light);
}
body.dark-mode .widget .recent-posts li a,
body.dark-mode .widget ul li a {
    color: #cbd5e1;
}
body.dark-mode .widget .recent-posts li a:hover,
body.dark-mode .widget ul li a:hover {
    color: var(--niu2-primary);
}

/* ===== 暗色模式白色区域改为暗色系 ===== */

/* 首页 CMS 课程卡片（原 !important 白色） */
body.dark-mode .cms-card {
    background: var(--niu2-card-bg) !important;
    border: 1px solid var(--niu2-border) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}
body.dark-mode .cms-card:hover {
    border-color: var(--niu2-primary) !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.45) !important;
}
body.dark-mode .cms-card-title a {
    color: #f1f5f9;
}
body.dark-mode .cms-card-title a:hover {
    color: var(--niu2-primary);
}
body.dark-mode .cms-card-excerpt {
    color: #94a3b8;
}
body.dark-mode .cms-card-meta {
    color: #64748b;
}

/* 分类过滤栏（原白色） */
body.dark-mode .latest-category-filter {
    background: var(--niu2-card-bg) !important;
    border: 1px solid var(--niu2-border) !important;
}
body.dark-mode .latest-category-filter .cat-filter-item {
    background: var(--niu2-bg) !important;
    color: #cbd5e1 !important;
    border: 1px solid var(--niu2-border) !important;
}
body.dark-mode .latest-category-filter .cat-filter-item:hover,
body.dark-mode .latest-category-filter .cat-filter-item.active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    color: #fff !important;
    border-color: transparent !important;
}

/* 下载地址框（原白色） */
body.dark-mode .download-url-title {
    color: #f1f5f9 !important;
}
body.dark-mode .download-url-content {
    background: var(--niu2-card-bg) !important;
    border-color: var(--niu2-border) !important;
}
body.dark-mode .download-url-content a,
body.dark-mode .download-url-content .download-link {
    color: #a5b4fc !important;
}

/* 无图占位 */
body.dark-mode .no-thumb-v2 {
    background: var(--niu2-bg) !important;
}
body.dark-mode .no-thumb-v2 .dashicons {
    color: #64748b !important;
}

/* 横幅搜索框（原白色） */
body.dark-mode .banner-search {
    background: var(--niu2-card-bg) !important;
    border: 1px solid var(--niu2-border) !important;
    box-shadow: 0 6px 24px rgba(0,0,0,0.35) !important;
}
body.dark-mode .banner-search-input {
    color: var(--niu2-text) !important;
}
body.dark-mode .banner-search-input::placeholder {
    color: var(--niu2-text-muted) !important;
}

/* 复制按钮（下载地址区） */
body.dark-mode .copy-url-btn {
    background: var(--niu2-bg) !important;
    border-color: var(--niu2-border) !important;
    color: #cbd5e1 !important;
}
body.dark-mode .copy-url-btn:hover {
    background: rgba(99,102,241,0.15) !important;
    border-color: var(--niu2-primary) !important;
    color: var(--niu2-primary) !important;
}

/* 价格对比项（原白色） */
body.dark-mode .price-item {
    background: var(--niu2-card-bg) !important;
    border-color: var(--niu2-border) !important;
}
body.dark-mode .price-item.normal {
    border-top-color: #64748b !important;
}
body.dark-mode .price-item.vip {
    border-top-color: #f5a623 !important;
    background: rgba(245,166,35,0.08) !important;
}
body.dark-mode .price-item.svip {
    border-top-color: var(--niu2-primary) !important;
    background: rgba(99,102,241,0.1) !important;
}
body.dark-mode .price-label {
    color: #94a3b8 !important;
}
body.dark-mode .price-original {
    color: #64748b !important;
}
body.dark-mode .price-current {
    color: #f1f5f9 !important;
}

/* ===== v12.35 深色模式剩余白底全面改暗色 ===== */

/* 首页侧边栏搜索框（原 #f8f9fc 浅底） */
body.dark-mode .search-input-wrap {
    background: var(--niu2-bg) !important;
    border-color: var(--niu2-border) !important;
}
body.dark-mode .search-input-wrap:focus-within {
    background: var(--niu2-card-bg) !important;
    border-color: var(--niu2-primary) !important;
}
body.dark-mode .widget-search-box .widget-search-input {
    color: var(--niu2-text) !important;
}
body.dark-mode .widget-search-box .widget-search-input::placeholder {
    color: var(--niu2-text-muted) !important;
}
body.dark-mode .search-prefix-icon {
    color: var(--niu2-text-muted) !important;
}

/* 用户中心模块内部链接（深色高对比） */
body.dark-mode .user-center-links a {
    color: #cbd5e1 !important;
}
body.dark-mode .user-center-links a:hover {
    color: var(--niu2-primary) !important;
}
body.dark-mode .widget-recent-list li a,
body.dark-mode .widget-recent-comments li a {
    color: #cbd5e1 !important;
}
body.dark-mode .widget-recent-list li a:hover,
body.dark-mode .widget-recent-comments li a:hover {
    color: var(--niu2-primary) !important;
}

/* 分类页筛选栏（原 #fff !important） */
body.dark-mode .niu2-archive .archive-filter {
    background: var(--niu2-card-bg) !important;
    border: 1px solid var(--niu2-border) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}
body.dark-mode .niu2-archive .archive-filter .filter-tab {
    background: var(--niu2-bg) !important;
    color: #cbd5e1 !important;
    border: 1px solid var(--niu2-border) !important;
}
body.dark-mode .niu2-archive .archive-filter .filter-tab:hover,
body.dark-mode .niu2-archive .archive-filter .filter-tab.active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    color: #fff !important;
    border-color: transparent !important;
}

/* 内容页下载信息侧边栏（原浅绿/浅紫底） */
body.dark-mode .download-granted {
    background: rgba(16,185,129,0.12) !important;
    color: #34d399 !important;
}
body.dark-mode .download-price-box {
    background: rgba(99,102,241,0.12) !important;
    border: 1px solid var(--niu2-border) !important;
}
body.dark-mode .download-price-label {
    color: var(--niu2-text-muted) !important;
}
body.dark-mode .download-price-value .price-current-large {
    color: #f1f5f9 !important;
}
body.dark-mode .download-price-value .price-original-small {
    color: var(--niu2-text-muted) !important;
}
body.dark-mode .download-vip-tip {
    color: #cbd5e1 !important;
}
body.dark-mode .download-resource-list li {
    color: #cbd5e1 !important;
}

/* ===== v12.36 白底区域全面强化修复（全 !important，确保深色下无白底） ===== */

/* 侧边栏 widget 容器（首页/内容页） */
body.dark-mode .latest-sidebar .widget,
body.dark-mode .single-sidebar .widget,
body.dark-mode .widget {
    background: var(--niu2-card-bg) !important;
    border: 1px solid var(--niu2-border) !important;
}
body.dark-mode .widget-header,
body.dark-mode .widget-title {
    color: #f1f5f9 !important;
    border-bottom-color: var(--niu2-border) !important;
}
body.dark-mode .widget-header {
    background: var(--niu2-bg) !important;
}
body.dark-mode .widget-header .dashicons,
body.dark-mode .widget-title .dashicons {
    color: var(--niu2-primary) !important;
}

/* 首页侧边栏搜索框（原 #f8f9fc 浅底） */
body.dark-mode .widget-search-box,
body.dark-mode .widget-search-box .widget-body {
    background: transparent !important;
}
body.dark-mode .search-input-wrap {
    background: var(--niu2-bg) !important;
    border-color: var(--niu2-border) !important;
}
body.dark-mode .search-input-wrap:focus-within {
    background: var(--niu2-card-bg) !important;
    border-color: var(--niu2-primary) !important;
}
body.dark-mode .widget-search-input {
    color: var(--niu2-text) !important;
}
body.dark-mode .widget-search-input::placeholder {
    color: var(--niu2-text-muted) !important;
}
body.dark-mode .search-prefix-icon {
    color: var(--niu2-text-muted) !important;
}

/* 近期文章/评论列表（widget 内部列表） */
body.dark-mode .widget ul li {
    border-bottom-color: var(--niu2-border-light) !important;
}
body.dark-mode .widget ul li a {
    color: #cbd5e1 !important;
}
body.dark-mode .widget ul li a:hover {
    color: var(--niu2-primary) !important;
}

/* 分类页/首页文章卡片（卡片整体深色） */
body.dark-mode .niu2-archive .post-card,
body.dark-mode .post-card {
    background: var(--niu2-card-bg) !important;
    border: 1px solid var(--niu2-border) !important;
}
body.dark-mode .post-card .card-title a,
body.dark-mode .cms-card-title a {
    color: #f1f5f9 !important;
}
body.dark-mode .post-card .card-title a:hover,
body.dark-mode .cms-card-title a:hover {
    color: var(--niu2-primary) !important;
}
body.dark-mode .post-card .card-excerpt,
body.dark-mode .post-card .card-meta,
body.dark-mode .cms-card-excerpt,
body.dark-mode .cms-card-meta {
    color: var(--niu2-text-secondary) !important;
}
body.dark-mode .post-card .card-cat a {
    color: #a5b4fc !important;
}

/* 内容页下载信息侧边栏（原浅绿/浅紫底） */
body.dark-mode .download-widget,
body.dark-mode .download-widget-body {
    background: var(--niu2-card-bg) !important;
}
body.dark-mode .download-granted {
    background: rgba(16,185,129,0.12) !important;
    color: #34d399 !important;
}
body.dark-mode .download-price-box {
    background: rgba(99,102,241,0.12) !important;
    border: 1px solid var(--niu2-border) !important;
}
body.dark-mode .download-price-label {
    color: var(--niu2-text-muted) !important;
}
body.dark-mode .download-price-value .price-current-large {
    color: #f1f5f9 !important;
}
body.dark-mode .download-price-value .price-original-small {
    color: var(--niu2-text-muted) !important;
}
body.dark-mode .download-vip-tip {
    color: #cbd5e1 !important;
}
body.dark-mode .download-resource-list .resource-list-title {
    color: #f1f5f9 !important;
}
body.dark-mode .download-resource-list li {
    color: #cbd5e1 !important;
}

/* 内容页下载地址区域（原白色，标题用深色文字看不见） */
body.dark-mode .resource-download-area {
    background: var(--niu2-bg) !important;
    border-top-color: var(--niu2-border) !important;
}
body.dark-mode .download-url-box {
    background: transparent !important;
}
body.dark-mode .download-url-title {
    color: #f1f5f9 !important;
}
body.dark-mode .download-url-title .dashicons {
    color: var(--niu2-primary) !important;
}
body.dark-mode .download-url-content {
    background: var(--niu2-card-bg) !important;
    border-color: var(--niu2-border) !important;
}
body.dark-mode .download-url-content a {
    color: #a5b4fc !important;
}
body.dark-mode .copy-url-btn {
    background: var(--niu2-bg) !important;
    border-color: var(--niu2-border) !important;
    color: #cbd5e1 !important;
}
body.dark-mode .copy-url-btn:hover {
    background: rgba(99,102,241,0.15) !important;
    border-color: var(--niu2-primary) !important;
    color: var(--niu2-primary) !important;
}

/* === 移动端菜单暗色模式 === */
body.dark-mode .mobile-menu-header {
    border-bottom-color: #334155;
    color: var(--niu2-text);
}
body.dark-mode .mobile-menu-close {
    color: var(--niu2-text-secondary);
}
body.dark-mode .mobile-menu-close:hover {
    color: var(--niu2-primary);
}
body.dark-mode .mobile-nav li {
    border-bottom-color: #334155;
}
body.dark-mode .mobile-nav li a {
    color: var(--niu2-text);
}
body.dark-mode .mobile-nav li a:hover {
    background: rgba(99,102,241,0.12);
    color: var(--niu2-primary);
}
body.dark-mode .mobile-nav .sub-menu {
    background: #0f172a;
}
body.dark-mode .mobile-menu-panel {
    background: var(--niu2-card-bg) !important;
}
