/* ==========================================
   1. 社交图标渲染修复
========================================== */
.social-links { display: flex !important; justify-content: center; align-items: center; gap: 20px; margin: 30px 0; }
.social-links a::before, .social-svg-link::before { content: none !important; display: none !important; }
.social-svg-link { display: inline-flex !important; width: 28px !important; height: 28px !important; text-decoration: none !important; color: #555; transition: all 0.3s ease; }
.social-svg-link:hover { color: #c05b4d; }
.social-svg-icon { width: 100%; height: 100%; fill: currentColor; display: block; }

/* ==========================================
   2. 按钮样式统一 (评论加载 & Memo 加载更多)
========================================== */
#load-comments-btn, .load-more-btn { padding: 10px 25px; cursor: pointer; font-size: 15px; border-radius: 6px; background-color: #f8f9fa; border: 1px solid transparent; color: #555; transition: all 0.3s ease; letter-spacing: 0.5px; }
#load-comments-btn:hover, .load-more-btn:hover { background-color: #ffffff; border-color: #c05b4d; color: #c05b4d; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }

/* ==========================================
   3. 夜间模式全局基础 UI 重构
========================================== */
html.night-mode body, html.night-mode .container, html.night-mode main, html.night-mode .header { background-color: #121212 !important; color: #d4d4d4 !important; }
html.night-mode .header .logo { color: #e8e8e8 !important; }
html.night-mode .menu .menu-item a { color: #c5c8c6 !important; }
html.night-mode .menu .menu-item a:hover { color: #d87e72 !important; }
html.night-mode .post .post-header .post-title, html.night-mode .post .post-header .post-title a, html.night-mode .archive-post .archive-post-title a, html.night-mode .archive-year { color: #e8e8e8 !important; transition: color 0.3s ease; }
html.night-mode .post .post-header .post-title a:hover, html.night-mode .archive-post .archive-post-title a:hover { color: #d87e72 !important; }
html.night-mode .post .post-meta { color: #888888 !important; }
html.night-mode .post .post-content .read-more .read-more-link { color: #d87e72 !important; }
html.night-mode .post { border-bottom: 1px solid #2c2c2c !important; }

/* 翻页器穿透 */
html.night-mode .pagination .prev, html.night-mode .pagination .next, html.night-mode .pagination .prev-text, html.night-mode .pagination .next-text, html.night-mode .pagination .iconfont, html.night-mode .post-nav .prev, html.night-mode .post-nav .next, html.night-mode .post-nav .prev-text, html.night-mode .post-nav .next-text, html.night-mode .post-nav .iconfont { color: #e8e8e8 !important; transition: color 0.3s ease; }
html.night-mode .pagination .prev:hover, html.night-mode .pagination .next:hover, html.night-mode .pagination .prev:hover .prev-text, html.night-mode .pagination .next:hover .next-text, html.night-mode .pagination .prev:hover .iconfont, html.night-mode .pagination .next:hover .iconfont, html.night-mode .post-nav .prev:hover, html.night-mode .post-nav .next:hover, html.night-mode .post-nav .prev:hover .prev-text, html.night-mode .post-nav .next:hover .next-text, html.night-mode .post-nav .prev:hover .iconfont, html.night-mode .post-nav .next:hover .iconfont { color: #d87e72 !important; }

/* 底部社交图标、爱心与按钮 */
html.night-mode .social-svg-link { color: #a0a0a0 !important; }
html.night-mode .social-svg-link:hover { color: #d87e72 !important; }
html.night-mode .copyright .heart .iconfont { color: #d87e72 !important; }
html.night-mode #load-comments-btn, html.night-mode .load-more-btn { background-color: #1e1e1e !important; color: #a0a0a0 !important; border-color: transparent !important; }
html.night-mode #load-comments-btn:hover, html.night-mode .load-more-btn:hover { background-color: #121212 !important; border-color: #d87e72 !important; color: #d87e72 !important; box-shadow: 0 2px 12px rgba(0,0,0,0.3) !important; }

/* 修复文章目录 (TOC) */
html.night-mode .post-toc { background-color: #1e1e1e !important; }
html.night-mode .post-toc .post-toc-title { color: #e8e8e8 !important; }
html.night-mode .post-toc .post-toc-content a { color: #a0a0a0 !important; }
html.night-mode .post-toc .post-toc-content a:hover, html.night-mode .post-toc .post-toc-content .active > a, html.night-mode .post-toc .has-active > a { color: #d87e72 !important; }

/* 【新增修复】：分类/标签云页面的蓝色链接 */
html.night-mode .terms .terms-tags .terms-link {
    color: #c5c8c6 !important;
}
html.night-mode .terms .terms-tags .terms-link:hover {
    color: #d87e72 !important;
}


/* ==========================================
   4. 移动端全局与夜间模式深度优化
========================================== */
/* 【核心修复升级】：指名道姓干掉所有交互元素的手机端点击蓝色闪烁 */
html, body, a, button, input, div, span, svg, img, .mobile-navbar-icon, .slideout-menu {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;
}

html.night-mode .mobile-navbar { 
    background-color: #121212 !important; 
    border-bottom: 1px solid #2c2c2c !important; 
    box-shadow: none !important; 
}
html.night-mode .mobile-navbar .mobile-header-logo a { color: #e8e8e8 !important; }
html.night-mode .mobile-navbar .mobile-navbar-icon span { background-color: #a0a0a0 !important; }

/* 杀掉侧滑菜单与主屏幕的漏光白边阴影 */
html.night-mode .slideout-panel {
    box-shadow: none !important;
}
html.night-mode .mobile-menu { 
    background-color: #1c1c1c !important; 
    box-shadow: none !important;
    border-right: 1px solid #2c2c2c !important; 
}
html.night-mode .mobile-menu, 
html.night-mode .mobile-menu .mobile-menu-list, 
html.night-mode .mobile-menu .mobile-menu-item { 
    border-color: #2c2c2c !important; 
}
html.night-mode .mobile-menu .mobile-menu-item { color: #c5c8c6 !important; }
html.night-mode .mobile-menu .mobile-menu-item:hover, 
html.night-mode .mobile-menu .mobile-menu-item.active { 
    color: #d87e72 !important; 
    background-color: #252525 !important; 
}

/* ==========================================
   5. 终极代码块“透视”战术 (解决无限套娃)
========================================== */
/* 第一步：给最外层容器（含 .chroma）加上绝对的深色背景 */
html.night-mode .post .post-content .highlight,
html.night-mode .post .post-content .highlight .chroma {
    background: #1e1e1e !important;
    background-color: #1e1e1e !important;
    border-color: #2c2c2c !important;
}

/* 第二步：掏空内部结构！强制把内部所有套娃（table, td, pre, code等）的背景变成透明！ */
html.night-mode .post .post-content .highlight table,
html.night-mode .post .post-content .highlight tbody,
html.night-mode .post .post-content .highlight tr,
html.night-mode .post .post-content .highlight td,
html.night-mode .post .post-content .highlight pre,
html.night-mode .post .post-content .highlight code {
    background: transparent !important;
    background-color: transparent !important;
    border-color: #2c2c2c !important;
}

/* 强杀顶部的 "Code" 伪元素栏 */
html.night-mode .post .post-content .highlight::before {
    background: #252525 !important;
    background-color: #252525 !important;
    color: #a0a0a0 !important;
    border-bottom: 1px solid #2c2c2c !important;
}

/* 确保代码基础文字不糊掉，且不破坏彩色语法高亮 */
html.night-mode .post .post-content .highlight code,
html.night-mode .post .post-content .highlight .lntd,
html.night-mode .post .post-content code {
    color: #d4d4d4;
}


/* ==========================================
   6. Memo 页面专属夜间深度优化
========================================== */
html.night-mode .memo-body { background-color: #1a1a1a !important; color: #d4d4d4 !important; }
/* 修复刺眼的白色时间轴：压暗为深灰色 */
html.night-mode .memo-timeline { border-left-color: #2c2c2c !important; }

/* 优化卡片质感：增加极细边框和微弱投影，与背景拉开层次 */
html.night-mode .memo-body { 
    background-color: #1a1a1a !important; 
    color: #d4d4d4 !important; 
    border: 1px solid #252525 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
    transition: all 0.3s ease !important;
}

/* 卡片悬停时的交互反馈：微微提亮并浮现主题色边框 */
html.night-mode .memo-item:hover .memo-body {
    background-color: #222 !important;
    border-color: #5a3530 !important; 
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4) !important;
}

/* 柔化时间轴上的圆点节点，不再喧宾夺主 */
html.night-mode .memo-dot { 
    background-color: #121212 !important; 
    border-color: #333 !important; 
}

/* 悬停或最新一条的圆点高亮：亮起为主题红 */
html.night-mode .memo-item:hover .memo-dot,
html.night-mode .memo-item:first-child .memo-dot {
    background-color: #d87e72 !important;
    border-color: #121212 !important;
    box-shadow: 0 0 0 4px rgba(216, 126, 114, 0.15) !important;
}

/* 时间与标签的视觉微调 */
html.night-mode .memo-date .d-day { color: #a0a0a0 !important; }
html.night-mode .memo-date .d-time { color: #555 !important; }
html.night-mode .memo-body .memo-tag { 
    background-color: rgba(216, 126, 114, 0.1) !important; 
    color: #c05b4d !important; 
    border: 1px solid rgba(216, 126, 114, 0.2) !important;
}
html.night-mode .memo-body .memo-tag:hover {
    background-color: #d87e72 !important;
    color: #121212 !important;
}