/* ===== 隐藏页首博客园导航栏 ===== */
#top_nav {
  display: none !important;
}

/* 隐藏页面底部的广告和推荐 */
#cnblogs_c1,
#cnblogs_c2,
#ad_t2,
#opt_under_post,
#under_post_news,
#under_post_card1,
#under_post_card2 {
  display: none !important;
}

/* 隐藏博客园会员推广条（如果有的话） */
.charm-bar-wrapper {
  display: none !important;
}



/* ===== 文章目录弹出面板（层级分类版） ===== */

/* 1. 左下角触发按钮 */
#toc-toggle {
  position: fixed;
  bottom: 40px;
  left: 40px;
  width: 44px;
  height: 44px;
  background: #4a90d9;
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: background 0.2s, transform 0.2s;
}
#toc-toggle:hover {
  background: #357abd;
  transform: scale(1.1);
}

/* 2. 目录面板 */
#toc-panel {
  position: fixed;
  bottom: 95px;
  left: 40px;
  width: 320px;
  max-height: 460px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
  z-index: 1000;
  overflow-y: auto;
  padding: 20px 24px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
}
#toc-panel.toc-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 3. 目录标题 */
#toc-panel .toc-title {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e5e5e5;
}

/* 4. 目录列表基础样式 */
#toc-panel ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
#toc-panel ul li {
  margin: 0;
}

/* 5. 目录链接通用样式 */
#toc-panel ul li a {
  display: block;
  padding: 6px 8px;
  color: #555;
  text-decoration: none;
  line-height: 1.5;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#toc-panel ul li a:hover {
  background: #f0f4fa;
  color: #4a90d9;
}

/* 6. h2 一级标题样式 */
#toc-panel ul li.toc-h2 > a {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}
#toc-panel ul li.toc-h2 > a:hover {
  color: #4a90d9;
}

/* 7. h3 二级标题样式（缩进） */
#toc-panel ul li.toc-h3 > a {
  padding-left: 24px;
  font-size: 13px;
  font-weight: normal;
  color: #666;
}

/* 8. h4 三级标题样式（再缩进） */
#toc-panel ul li.toc-h4 > a {
  padding-left: 40px;
  font-size: 12px;
  font-weight: normal;
  color: #999;
}

/* 9. 当前阅读位置高亮 */
#toc-panel ul li a.toc-active {
  color: #4a90d9 !important;
  font-weight: bold;
  background: #eef3fb;
}

/* 10. 滚动条美化 */
#toc-panel::-webkit-scrollbar {
  width: 4px;
}
#toc-panel::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 2px;
}

/* h5 四级标题样式（再缩进） */
#toc-panel ul li.toc-h5 > a {
  padding-left: 56px;
  font-size: 12px;
  font-weight: normal;
  color: #aaa;
}

/* h5 四级标题样式（再缩进） */
#toc-panel ul li.toc-h5 > a {
  padding-left: 56px;
  font-size: 12px;
  font-weight: normal;
  color: #aaa;
}




/* ===== 日间/夜间模式切换按钮 ===== */
/* ===== 日间/夜间模式切换按钮 ===== */
#theme-toggle {
  position: fixed;
  bottom: 120px;
  right: 40px;
  width: 44px;
  height: 44px;
  background: #e0e0e0;              /* 日间：淡灰色 */
  color: #555;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: background 0.3s, color 0.3s, transform 0.2s;
  padding: 0;
}
#theme-toggle:hover {
  background: #d0d0d0;
  transform: scale(1.1);
}
#theme-toggle svg {
  width: 22px;
  height: 22px;
}

/* 夜间模式 */
body.night-mode #theme-toggle {
  background: #1a3a5c !important;   /* 夜间：暗蓝色 */
  color: #d4d4d4 !important;
}
body.night-mode #theme-toggle:hover {
  background: #1e4a7a !important;
}

/* ===== 夜间模式全局样式 ===== */
body.night-mode {
  background-color: #1e1e1e !important;
  color: #d4d4d4 !important;
}

/* 文章区域 */
body.night-mode #mainContent,
body.night-mode #main {
  background-color: #1e1e1e !important;
  color: #d4d4d4 !important;
}

/* 文章正文 */
body.night-mode #cnblogs_post_body,
body.night-mode .postBody {
  background-color: #1e1e1e !important;
  color: #d4d4d4 !important;
}

/* 标题 */
body.night-mode h1,
body.night-mode h2,
body.night-mode h3,
body.night-mode h4,
body.night-mode h5,
body.night-mode h6 {
  color: #e0e0e0 !important;
}

/* 链接 */
body.night-mode a {
  color: #4facfe !important;
}
body.night-mode a:hover {
  color: #7ec8ff !important;
}

/* 侧边栏 */
body.night-mode #sideBar,
body.night-mode .sidebar {
  background-color: #252526 !important;
  color: #d4d4d4 !important;
}

/* 代码块 */
body.night-mode pre,
body.night-mode code {
  background-color: #2d2d2d !important;
  color: #d4d4d4 !important;
  border-color: #444 !important;
}

/* 文章卡片/列表项 */
body.night-mode .postTitle,
body.night-mode .postDesc,
body.night-mode .entrylistPosttitle,
body.night-mode .dayTitle,
body.night-mode .post {
  background-color: #252526 !important;
  color: #d4d4d4 !important;
  border-color: #333 !important;
}

/* 评论区域 */
body.night-mode .feedbackItem,
body.night-mode .commentform {
  background-color: #252526 !important;
  color: #d4d4d4 !important;
}

/* 输入框 */
body.night-mode input,
body.night-mode textarea {
  background-color: #2d2d2d !important;
  color: #d4d4d4 !important;
  border-color: #555 !important;
}

/* 目录面板 */
body.night-mode #toc-panel {
  background-color: #252526 !important;
  color: #d4d4d4 !important;
}
body.night-mode #toc-panel .toc-title {
  color: #e0e0e0 !important;
  border-bottom-color: #444 !important;
}
body.night-mode #toc-panel ul li a {
  color: #aaa !important;
}
body.night-mode #toc-panel ul li a:hover {
  background-color: #333 !important;
  color: #4facfe !important;
}
body.night-mode #toc-panel ul li a.toc-active {
  color: #4facfe !important;
  background-color: #333 !important;
}

/* 顶部导航 */
body.night-mode #navigator,
body.night-mode #navList,
body.night-mode .header {
  background-color: #252526 !important;
}

/* 页脚 */
body.night-mode #footer {
  background-color: #1e1e1e !important;
  color: #888 !important;
}

/* 表格 */
body.night-mode table {
  border-color: #444 !important;
}
body.night-mode th {
  background-color: #2d2d2d !important;
  color: #e0e0e0 !important;
}
body.night-mode td {
  border-color: #444 !important;
}

/* 引用块 */
body.night-mode blockquote {
  background-color: #2d2d2d !important;
  border-left-color: #4facfe !important;
  color: #bbb !important;
}

/* 分割线 */
body.night-mode hr {
  border-color: #444 !important;
}

/* 图片降低亮度，避免夜间刺眼 */
body.night-mode img {
  opacity: 0.85;
  transition: opacity 0.3s;
}
body.night-mode img:hover {
  opacity: 1;
}

/* 平滑过渡 */
body.night-mode,
body.night-mode *,
body.night-mode *::before,
body.night-mode *::after {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
}




/* ===== 夜间模式 - 侧边栏补充样式 ===== */

/* 侧边栏整体容器 */
body.night-mode #blog-sidecolumn,
body.night-mode #sideBar,
body.night-mode .sidebar {
  background-color: #1e1e1e !important;
  color: #d4d4d4 !important;
}

/* 公告模块 */
body.night-mode #sidebar_news,
body.night-mode .newsItem,
body.night-mode #sidebar_news_content {
  background-color: #252526 !important;
  color: #d4d4d4 !important;
  border-color: #444 !important;
}

/* 搜索模块 */
body.night-mode #sidebar_search,
body.night-mode #sidebar_search_box {
  background-color: #252526 !important;
  color: #d4d4d4 !important;
  border-color: #444 !important;
}
body.night-mode #sidebar_search_box input[type="text"] {
  background-color: #2d2d2d !important;
  color: #d4d4d4 !important;
  border-color: #555 !important;
}

/* 侧边栏标题（如"公告"、"搜索"、"常用链接"等小标题） */
body.night-mode .catListTitle,
body.night-mode #sidebar_news h3,
body.night-mode #sidebar_search h3,
body.night-mode .sidebar-block h3 {
  color: #e0e0e0 !important;
  border-color: #444 !important;
}

/* 侧边栏链接列表 */
body.night-mode .catListEssay a,
body.night-mode .catListLink a,
body.night-mode .catListTag a,
body.night-mode .catListArticleCategory a,
body.night-mode #sidebar_recentposts a,
body.night-mode #sidebar_recentcomments a,
body.night-mode #sidebar_topviewedposts a,
body.night-mode #sidebar_topcommentedposts a,
body.night-mode #sidebar_topdiggedposts a {
  color: #aaa !important;
}
body.night-mode .catListEssay a:hover,
body.night-mode .catListLink a:hover,
body.night-mode .catListTag a:hover,
body.night-mode #sidebar_recentposts a:hover,
body.night-mode #sidebar_recentcomments a:hover {
  color: #4facfe !important;
}

/* 侧边栏日期/统计文字 */
body.night-mode .entrylistItemPostDesc,
body.night-mode .postDesc,
body.night-mode .sidebar-block span,
body.night-mode .sidebar-block li {
  color: #aaa !important;
}

/* 侧边栏所有模块通用 */
body.night-mode .sidebar-block {
  background-color: #252526 !important;
  color: #d4d4d4 !important;
  border-color: #333 !important;
}

/* 侧边栏分割线 */
body.night-mode #sideBar hr,
body.night-mode .sidebar-block hr {
  border-color: #444 !important;
}


/* ===== 夜间模式 - #home 最外层容器 ===== */
body.night-mode #home {
  background-color: #1e1e1e !important;
  color: #d4d4d4 !important;
}

/* 同时确保 header 区域也变黑 */
body.night-mode #header {
  background-color: #1e1e1e !important;
}

/* 确保 header 中的博客标题和副标题颜色适配 */
body.night-mode #header h1 a,
body.night-mode #header h2 {
  color: #e0e0e0 !important;
}

/* 顶部导航栏 */
body.night-mode #navigator,
body.night-mode #navList {
  background-color: #252526 !important;
}
body.night-mode #navList li a {
  color: #d4d4d4 !important;
}
body.night-mode #navList li a:hover {
  color: #4facfe !important;
  background-color: #333 !important;
}

/* 主内容区域 */
body.night-mode #main {
  background-color: #1e1e1e !important;
}

/* 页脚 */
body.night-mode #footer {
  background-color: #1e1e1e !important;
  color: #888 !important;
}
body.night-mode #footer a {
  color: #4facfe !important;
}


/* ===== 夜间模式 - .catListView 列表内容区 ===== */
body.night-mode .catListView {
  background-color: #252526 !important;
  color: #d4d4d4 !important;
  border-color: #444 !important;
}

/* 列表项 */
body.night-mode .catListView li {
  color: #d4d4d4 !important;
  border-color: #333 !important;
}

/* 列表项中的链接 */
body.night-mode .catListView li a {
  color: #aaa !important;
}
body.night-mode .catListView li a:hover {
  color: #4facfe !important;
}








/* ===== 目录切换按钮 #toc-toggle ===== */

/* 日间：淡灰色 */
#toc-toggle {
  background: #e0e0e0 !important;
  color: #555 !important;
  border-color: #e0e0e0 !important;
  transition: background 0.3s, color 0.3s, transform 0.2s;
}
#toc-toggle:hover {
  background: #d0d0d0 !important;
  transform: scale(1.1);
}

/* 夜间：暗蓝色 */
body.night-mode #toc-toggle {
  background: #1a3a5c !important;
  color: #d4d4d4 !important;
  border-color: #1a3a5c !important;
}
body.night-mode #toc-toggle:hover {
  background: #1e4a7a !important;
}





/* ===== 太阳图标改为白色 ===== */
#theme-toggle #icon-sun path {
  fill: #ffffff !important;
}






/* ===== 夜间模式 - 我的标签 ===== */

/* 标签列表容器 */
body.night-mode #taglist,
body.night-mode .catListTag {
  background-color: #1e1e1e !important;
  color: #d4d4d4 !important;
  border-color: #333 !important;
}

/* 标签列表中的链接 */
body.night-mode #taglist a,
body.night-mode .catListTag a {
  color: #4facfe !important;
}
body.night-mode #taglist a:hover,
body.night-mode .catListTag a:hover {
  color: #7dc4ff !important;
}

/* 标签列表标题（"我的标签"文字） */
body.night-mode #taglist .category .categoryRead,
body.night-mode .catListTag .category .categoryRead {
  color: #e0e0e0 !important;
}




/* ===== 文章标题放大 ===== */

/* 文章详情页标题 */
.postTitle,
.postTitle a {
  font-size: 28px !important;
}

/* 文章列表页标题（主页/分类页等） */
.postTitle2,
.postTitle2 a {
  font-size: 22px !important;
}
