/* =========================================
   Global Adjustments
   ========================================= */

/* 全局隐藏自带的明暗模式切换按钮 */
.theme-toggle, #js-theme-toggle, label[for="js-theme-toggle"] {
    display: none !important;
}

/* 移动端菜单展开时防止页面滚动 */
body[data-expanded-HeadNav="true"] {
    overflow: hidden;
}

/* --- 修复非 Bamboo 页面在黑暗模式下的细节 --- */
html.dark-theme { --nz-rc-accent: var(--t-rc-primary) !important; }
html.dark-theme a:hover { color: rgba(var(--t-rc-primary), 0.8) !important; }
html.dark-theme .info_years a { color: rgba(255, 255, 255, 0.94) !important; border-color: rgba(255, 255, 255, 0.2) !important; }
html.dark-theme .info_years a:hover { color: rgb(var(--t-rc-primary)) !important; border-color: rgb(var(--t-rc-primary)) !important; }

/* =========================================
   Algolia Search Modal Fixes
   ========================================= */

.overlay, .search_input, .search_results { font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif !important; }
html.dark-theme .overlay { background: rgba(18, 18, 18, 0.9) !important; }
html.dark-theme .search_input { color: rgba(255, 255, 255, 0.94) !important; border-bottom-color: #444 !important; }
html.dark-theme .search_input::placeholder { color: rgba(255, 255, 255, 0.38) !important; }
html.dark-theme .search_input:focus { border-bottom-color: rgba(255, 255, 255, 0.8) !important; }
html.dark-theme .search_text h3 { color: rgba(255, 255, 255, 0.94) !important; }
html.dark-theme .search_text h4 { color: rgba(255, 255, 255, 0.58) !important; }
html.dark-theme .search_text p { color: rgba(255, 255, 255, 0.86) !important; }
html.dark-theme .overlay_close { color: #888 !important; }
html.dark-theme .overlay_close:hover { color: #fff !important; }

/* =========================================
   Bamboo Template Dark Mode Fixes
   ========================================= */

html.is-bamboo.dark-theme body { color: rgba(255, 255, 255, 0.86); background-color: #121212; }
html.is-bamboo.dark-theme { background-color: #121212; }
html.is-bamboo.dark-theme .site-nav { background-color: #1a1a1a; border-bottom: 1px solid #333; }
html.is-bamboo.dark-theme .site-link { color: #e0e0e0; }

/* 优雅书影音卡片设计 */
html.is-bamboo.dark-theme .subject {
    background-color: #1a1a1a !important;
    border: 1px solid #333 !important;
    border-radius: 12px !important;
    padding: 16px !important;
}
html.is-bamboo.dark-theme .subject_image img { border-radius: 6px !important; }
html.is-bamboo.dark-theme .subject_title { color: #fff; }
html.is-bamboo.dark-theme .subject_author, html.is-bamboo.dark-theme .review_summary { color: #bbb; }
html.is-bamboo.dark-theme .p-name { color: #eee; }
html.is-bamboo.dark-theme .e-content, html.is-bamboo.dark-theme .p-summary { color: rgba(255, 255, 255, 0.86); }

/* 修复 Bamboo 文章内排版元素在暗黑模式下呈现黑色的问题 */
html.is-bamboo.dark-theme h1, html.is-bamboo.dark-theme h2, html.is-bamboo.dark-theme h3, html.is-bamboo.dark-theme h4, html.is-bamboo.dark-theme h5, html.is-bamboo.dark-theme h6, html.is-bamboo.dark-theme strong, html.is-bamboo.dark-theme b, html.is-bamboo.dark-theme .yue h1, html.is-bamboo.dark-theme .yue h2, html.is-bamboo.dark-theme .yue h3, html.is-bamboo.dark-theme .yue h4, html.is-bamboo.dark-theme .yue h5, html.is-bamboo.dark-theme .yue h6, html.is-bamboo.dark-theme .yue strong, html.is-bamboo.dark-theme .yue b, html.is-bamboo.dark-theme .e-content h1, html.is-bamboo.dark-theme .e-content h2, html.is-bamboo.dark-theme .e-content h3, html.is-bamboo.dark-theme .e-content h4, html.is-bamboo.dark-theme .e-content h5, html.is-bamboo.dark-theme .e-content h6, html.is-bamboo.dark-theme .e-content strong, html.is-bamboo.dark-theme .e-content b { color: rgba(255, 255, 255, 0.94) !important; }
html.is-bamboo.dark-theme em, html.is-bamboo.dark-theme i, html.is-bamboo.dark-theme .yue em, html.is-bamboo.dark-theme .yue i, html.is-bamboo.dark-theme .e-content em, html.is-bamboo.dark-theme .e-content i { color: rgba(255, 255, 255, 0.86) !important; }
html.is-bamboo.dark-theme blockquote, html.is-bamboo.dark-theme .yue blockquote, html.is-bamboo.dark-theme .e-content blockquote { color: rgba(255, 255, 255, 0.58) !important; border-left-color: rgba(255, 255, 255, 0.2) !important; }
html.is-bamboo.dark-theme code, html.is-bamboo.dark-theme .yue code, html.is-bamboo.dark-theme .e-content code { background-color: rgba(255, 255, 255, 0.1) !important; color: #f8f8f2 !important; }
html.is-bamboo.dark-theme pre, html.is-bamboo.dark-theme .yue pre, html.is-bamboo.dark-theme .e-content pre { background-color: #1e1e1e !important; border: 1px solid #333 !important; }
html.is-bamboo.dark-theme pre code, html.is-bamboo.dark-theme .yue pre code, html.is-bamboo.dark-theme .e-content pre code { background-color: transparent !important; color: inherit !important; }
html.is-bamboo.dark-theme .item-meta, html.is-bamboo.dark-theme .entry-meta, html.is-bamboo.dark-theme .site-foot, html.is-bamboo.dark-theme .entry-section h2, html.is-bamboo.dark-theme time, html.is-bamboo.dark-theme .entry-author { color: rgba(255, 255, 255, 0.58) !important; }

/* 修复链接复刻红主题 */
html.is-bamboo.dark-theme a, html.is-bamboo.dark-theme .yue a, html.is-bamboo.dark-theme .e-content a { color: rgb(var(--t-rc-primary)) !important; border-bottom-color: rgba(var(--t-rc-primary), 0.4) !important; }
html.is-bamboo.dark-theme a:hover, html.is-bamboo.dark-theme .yue a:hover, html.is-bamboo.dark-theme .e-content a:hover { color: rgba(var(--t-rc-primary), 0.8) !important; border-bottom-color: rgba(var(--t-rc-primary), 0.8) !important; }
html.is-bamboo.dark-theme .shk-player { background: #1e1e1e; border-color: #333; color: #eee; }