/* ============================================================
   暗色主题覆盖层 —— html[data-theme="dark"] 时生效
   调色板：底 #181a1b / 面 #242628 / 字 #c9c9c9 / 主色 #2fa4bd
   ============================================================ */

html[data-theme="dark"] {
  color-scheme: dark;
}

/* --- 基础 --- */
html[data-theme="dark"] body {
  background-color: #181a1b;
  color: #c9c9c9;
}

html[data-theme="dark"] a {
  color: #c9c9c9;
}
html[data-theme="dark"] a:hover,
html[data-theme="dark"] a:focus {
  color: #2fa4bd;
}

html[data-theme="dark"] blockquote {
  color: #9a9a9a;
}

html[data-theme="dark"] .text-muted {
  color: #8f9296;
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6 {
  color: #d6d6d6;
}

html[data-theme="dark"] hr.small {
  border-color: #4a4d4f;
}

/* 表格 */
html[data-theme="dark"] table.table > tbody th,
html[data-theme="dark"] table.table > tbody td,
html[data-theme="dark"] table.table > thead th,
html[data-theme="dark"] table.table > thead td {
  border-color: #333638 !important;
  color: #c9c9c9;
}
html[data-theme="dark"] table.table > thead > tr > th {
  background-color: #242628;
}
html[data-theme="dark"] table.table > tbody > tr:nth-of-type(odd) {
  background-color: #1e2022;
}

/* 行内代码在暗色下加边界以免与底色融合 */
html[data-theme="dark"] .post-container code {
  background-color: #242628;
  color: #d8d8d8;
}

/* 多语言选择器（关于页） */
html[data-theme="dark"] select {
  background: rgba(0, 133, 161, 0.18);
  color: #4fb8cc;
  border-color: #2b6b7a;
}

/* --- 导航栏 ---
   头图上的透明导航保持原主题的白色链接（与亮色一致），
   暗色文字仅用于滚动后固定（is-fixed 有深色背景）的状态 */
html[data-theme="dark"] .navbar-custom.is-fixed {
  background-color: rgba(24, 26, 27, 0.95);
  border-bottom: 1px solid #2e3133;
}
html[data-theme="dark"] .navbar-custom.is-fixed .navbar-brand,
html[data-theme="dark"] .navbar-custom.is-fixed .nav li a {
  color: #c9c9c9;
}
html[data-theme="dark"] .navbar-custom.is-fixed .navbar-brand:hover,
html[data-theme="dark"] .navbar-custom.is-fixed .navbar-brand:focus,
html[data-theme="dark"] .navbar-custom.is-fixed .nav li a:hover,
html[data-theme="dark"] .navbar-custom.is-fixed .nav li a:focus {
  color: #2fa4bd;
}
html[data-theme="dark"] .navbar-custom .nav li a:hover,
html[data-theme="dark"] .navbar-custom .nav li a:focus {
  background-color: rgba(255, 255, 255, 0.06);
}
/* 移动端下拉菜单（原 background: white 的暗色对应，仅移动端有此面板） */
@media (max-width: 767px) {
  html[data-theme="dark"] .navbar-default .navbar-collapse {
    background: #202325;
  }
  html[data-theme="dark"] .navbar-default .navbar-toggle {
    background-color: #242628;
  }
  html[data-theme="dark"] .navbar-default .navbar-toggle .icon-bar {
    background-color: #c9c9c9;
  }
}

/* --- 主题切换按钮 ---
   颜色完全跟随相邻导航项（头图上白色 / 固定后灰色 / 暗色浅灰），
   由 .nav li a 的既有规则控制，这里只做 hover 强调 */
.navbar-custom .nav li.theme-toggle a:hover,
.navbar-custom .nav li.theme-toggle a:focus {
  color: #2fa4bd !important;
  background: transparent !important;
}

/* --- 分页 pager（原 background-color: white） --- */
html[data-theme="dark"] .pager li > a,
html[data-theme="dark"] .pager li > span {
  background-color: #242628;
  color: #c9c9c9;
}
html[data-theme="dark"] .pager li > a:hover,
html[data-theme="dark"] .pager li > a:focus {
  color: #fff;
  background-color: #0085a1;
  border: 1px solid #0085a1;
}

/* --- 全屏搜索页 --- */
html[data-theme="dark"] .search-page {
  background: #181a1b;
}
html[data-theme="dark"] .search-page #search-input {
  color: #e2e2e2;
}
html[data-theme="dark"] .search-icon a,
html[data-theme="dark"] .search-icon-close {
  color: #c9c9c9;
}
html[data-theme="dark"] .search-page .post-preview > a {
  color: #c9c9c9;
}
html[data-theme="dark"] .search-page .post-preview > a:hover {
  color: #2fa4bd;
}
html[data-theme="dark"] .search-page hr {
  border-color: #333638;
}

/* --- 侧边目录高亮（原 #f5f5f5） --- */
html[data-theme="dark"] .side-catalog .catalog-body .active {
  background-color: #2a2d2f;
}

/* --- 页脚 --- */
html[data-theme="dark"] footer .copyright {
  color: #8f9296;
}

/* --- 标签按钮（正文与侧栏内，避开头图上的白色标签） --- */
html[data-theme="dark"] .sidebar-container .tag,
html[data-theme="dark"] .post-container .tag {
  color: #b8b8b8;
  border-color: #565a5d;
}
html[data-theme="dark"] .sidebar-container .tag:hover,
html[data-theme="dark"] .post-container .tag:hover {
  color: #2fa4bd;
  border-color: #2fa4bd;
}

/* --- 图片略微压暗，减小暗色页面上的刺眼感 --- */
html[data-theme="dark"] .post-container img {
  filter: brightness(0.92);
}

/* --- 滚动条 --- */
html[data-theme="dark"] {
  scrollbar-color: #3d4043 transparent;
}
html[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background-color: #3d4043;
}
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background-color: #55595c;
}

/* --- 分隔线与引用块边线（默认浅色在暗色下不可见） --- */
html[data-theme="dark"] hr {
  border-color: #333638;
}
html[data-theme="dark"] blockquote {
  border-left-color: #3d4043;
}
html[data-theme="dark"] .table-responsive {
  border-color: #333638;
}
