/* ===== 博客主题样式 ===== */
/* 主题变量 + 组件样式 + Lightbox + 监控卡片 */

/* ===== 全局变量与重置 ===== */
:root {
  --primary-color: rgb(84,155,245);
  --primary-hover: rgb(29,111,220);
  --text-primary: rgb(33,37,41);
  --text-secondary: rgb(73,80,87);
  --bg-light: #ffffff;
  --bg-dark: rgb(34,39,46);
  --card-bg-dark: rgba(45,51,59,0.3);
  --border-light: #e8eaed;
  --border-dark: rgba(255,255,255,0.05);
  --shadow-light: 0 1px 2px rgba(16,24,40,0.04), 0 4px 16px rgba(16,24,40,0.06);
  --shadow-dark: 0 1px 2px rgba(0,0,0,0.32), 0 6px 20px rgba(0,0,0,0.28);
  --font-stack: "PingFang SC", "Microsoft YaHei UI", "Segoe UI", system-ui, -apple-system, sans-serif;
}

html { touch-action: manipulation; } /* 禁双击放大 */
body {
  font-family: var(--font-stack);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background-color: rgb(255,229,209); }

/* ===== 全局滚动条（窄条 + 低对比暗色） ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.28); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.42); }
html { scrollbar-width: thin; scrollbar-color: rgba(0,0,0,0.28) transparent; }
a { text-decoration: none; }
.text-theme-color { color: var(--primary-color); }
h1,h2,h3 { font-weight: bold; }
h2 { margin-top: 1.75rem; margin-bottom: 1rem; }
img { max-width: 100%; height: auto; }

/* ===== 导航栏（毛玻璃通栏） ===== */
/* 玻璃层只涂通栏 .sticky-top：.navbar 嵌在限宽容器内，同涂半透明会双层叠加 */
.sticky-top,.dropdown-menu {
  background-color: rgba(30,34,40,0.78);
  border-color: rgba(255,255,255,0.08);
  backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* 导航内容层透明，视觉上与通栏玻璃融为一体 */
.navbar { background-color: transparent; }

.sticky-top.scrolled {
  background-color: rgba(30,34,40,0.92);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06), 0 8px 32px rgba(0,0,0,0.35);
}

/* ===== 下拉菜单 ===== */
/* 菜单嵌套在毛玻璃 navbar 内，backdrop-filter 嵌套会失效，用实底色 */
.dropdown-menu {
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background-color: rgb(32,36,43);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2), 0 12px 40px rgba(0,0,0,0.35);
  padding: 6px;
}
.dropdown-item {
  color: rgba(255,255,255,0.85);
  border-radius: 8px;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.dropdown-item:hover, .dropdown-item:focus {
  color: #fff;
  background-color: rgba(255,255,255,0.09);
}
.dropdown-item.text-white:hover { color: #fff !important; }
#navbarDropdown:hover { background-color: rgb(71,77,87); }
#navbarDropdown:focus { outline: none; }

/* ===== 搜索框（毛玻璃深底，与导航融合） ===== */
.form-control.search {
  transition: all 0.3s ease;
  border: 1px solid rgba(255,255,255,0.12);
  background-color: rgba(255,255,255,0.06);
  border-radius: 10px;
}
.form-control.search:focus {
  border-color: var(--primary-color);
  background-color: rgba(255,255,255,0.1);
  box-shadow: 0 0 0 3px rgba(84,155,245,0.25);
  outline: none;
}

/* ===== 文章卡片 ===== */
.post-outer {
  margin-bottom: 20px;
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
}
.post-outer:nth-child(1) { animation-delay: 0.1s; }
.post-outer:nth-child(2) { animation-delay: 0.2s; }
.post-outer:nth-child(3) { animation-delay: 0.3s; }
.post-outer:nth-child(4) { animation-delay: 0.4s; }
.post-outer:nth-child(5) { animation-delay: 0.5s; }
.post-outer:nth-child(6) { animation-delay: 0.6s; }
.post-outer:nth-child(7) { animation-delay: 0.7s; }
.post-outer:nth-child(8) { animation-delay: 0.8s; }
@keyframes fadeIn { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .post-outer { opacity: 1; animation: none; }
}

.post-outer .card {
  position: relative;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  background: var(--bg-light);
  box-shadow: var(--shadow-light);
  transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}
.post-outer:not(:has(.post-content)) .card:hover {
  border-color: rgba(84,155,245,0.35);
  box-shadow: 0 2px 4px rgba(16,24,40,0.05), 0 12px 32px rgba(74,144,226,0.14);
}
.post-outer .card-body { padding: 24px 28px; }
.post-outer .card-title {
  position: relative;
  display: inline-block;
  max-width: 100%;
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 12px;
  line-height: 1.5;
  color: var(--text-primary);
  text-wrap: balance;
}
.post-outer .card-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}
/* 首页卡片已不做整卡热区：摘要等纯文字区保持箭头光标，避免出现 I-beam（文章页正文不在 #BlogPost0 内，不受影响） */
.post-outer:not(:has(.post-content)) .card,
#BlogPost1 .popular-posts .card {
  cursor: default;
}

/* 标题下的渐隐横线：常驻但收起，首页卡片 hover 时从左向右展开（文章页正文卡无 hover 反馈） */
.post-outer .card-title::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(84,155,245,0.85) 0%, rgba(84,155,245,0) 100%);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
/* 触摸设备没有 hover：首页卡片标题的渐隐横线改为常驻，否则永远看不到 */
/* 按下即时反馈（桌面鼠标按下 / 触屏按压都生效，与标题变蓝同步）：展开下划线 */
.post-outer:not(:has(.post-content)) .card:active .card-title::after {
  transform: scaleX(1);
  transition-duration: 0.12s;
}

/* 文章页标题下的渐隐横线常驻显示（不做 hover 触发） */
.post-outer:has(.post-content) .card-title::after {
  transform: scaleX(1);
}

@media (hover: hover) {
  .post-outer:not(:has(.post-content)) .card:hover .card-title a {
    color: var(--primary-color);
  }
  .post-outer:not(:has(.post-content)) .card:hover .card-title::after {
    transform: scaleX(1);
  }
}
.post-outer .card:active .card-title a {
  color: var(--primary-color);
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 11px;
  font-size: 12.5px;
  color: var(--primary-color);
}
.post-meta .post-labels { display: flex; align-items: center; gap: 6px; }
.post-meta .post-cat {
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
}
.post-meta .meta-dot { opacity: 0.55; }
.post-divider {
  height: 1px;
  background: linear-gradient(to right, rgba(74,144,226,0.3), rgba(0,0,0,0.05), transparent);
  margin: 18px 0;
}
.post-outer .item-snippet {
  color: #555;
  line-height: 1.75;
  font-size: 15px;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== 首页热门文章网格（四个卡片）===== */
/* 外边距清零统一由文件后部 #BlogPost1 系列 !important 规则负责，此处不再重复声明 */

/* 首页左列热门区底部内衬，与右侧栏对称 */
/* 视觉齐平口径 = 热门卡底边 == 侧栏大卡底边框：热门区底距由下方全站 #BlogPost1 .popular-posts 规则清零 */

@media (min-width: 992px) {
  /* 两行两列用 flex wrap：grid 1fr 轨道按摘要未截断的 max-content 测高，会比实际卡高多出一截、
     行距虚大 48px；flex 下 col 同行等高、卡 height:100% 撑满 col，行距恒等于 gap */
  .col-lg-8 > #BlogPost1 .popular-posts.row {
    display: flex !important;
    flex-wrap: wrap;
    gap: 24px !important;
    /* row 自带 -12px 负边距，必须清掉才能和文章卡左缘对齐 */
    margin-left: 0 !important;
    margin-right: 0 !important;
    /* 与上方文章列表的段落间距（单一出处） */
    margin-top: 32px !important;
  }
  #BlogPost1 .popular-posts > div {
    width: calc(50% - 12px) !important;
    max-width: none;
    flex: 0 0 auto;
    padding: 0 !important;
    margin: 0 !important;
  }
}

#BlogPost1 .popular-posts .card {
  background: linear-gradient(145deg, rgba(84,155,245,0.08) 0%, rgba(139,92,246,0.05) 50%, rgba(255,255,255,0.6) 100%);
  border: 1px solid rgba(84,155,245,0.15);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(84,155,245,0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  height: 100%;
}

#BlogPost1 .popular-posts .card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color) 0%, rgb(139,92,246) 100%);
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

#BlogPost1 .popular-posts .card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(84,155,245,0.15);
  border-color: rgba(84,155,245,0.25);
}

#BlogPost1 .popular-posts .card:hover::before {
  opacity: 1;
}

/* 排名标识 */
#BlogPost1 .text-theme-color {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--primary-color);
  margin-bottom: 8px;
  padding: 4px 10px;
  background: rgba(84,155,245,0.1);
  border-radius: 20px;
  width: fit-content;
}

/* 不同排名的颜色区分 */
#BlogPost1 .popular-posts .col-lg-6:nth-child(1) .text-theme-color {
  background: rgba(245,158,11,0.12);
  color: rgb(217,119,6);
}
#BlogPost1 .popular-posts .col-lg-6:nth-child(1) .card::before {
  background: linear-gradient(90deg, rgb(245,158,11) 0%, rgb(251,191,36) 100%);
}

#BlogPost1 .popular-posts .col-lg-6:nth-child(2) .text-theme-color {
  background: rgba(148,163,184,0.15);
  color: rgb(100,116,139);
}
#BlogPost1 .popular-posts .col-lg-6:nth-child(2) .card::before {
  background: linear-gradient(90deg, rgb(148,163,184) 0%, rgb(203,213,225) 100%);
}

#BlogPost1 .popular-posts .col-lg-6:nth-child(3) .text-theme-color {
  background: rgba(180,83,9,0.12);
  color: rgb(180,83,9);
}
#BlogPost1 .popular-posts .col-lg-6:nth-child(3) .card::before {
  background: linear-gradient(90deg, rgb(180,83,9) 0%, rgb(217,119,6) 100%);
}

/* 标题样式 */
/* 热门徽章贴卡片左上角；标题下移避开徽章（徽章高约 24px + 8px 呼吸） */
#BlogPost1 .popular-posts .text-theme-color {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  border-radius: 11px 0 10px 0;
  z-index: 2;
}
#BlogPost1 .popular-posts .card-body > header {
  margin-top: 32px;
}

#BlogPost1 .popular-posts .card-title {
  color: var(--text-primary);
  font-size: 1.1em;
  line-height: 1.5;
  margin-bottom: 10px;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 摘要样式 */
#BlogPost1 .popular-posts .item-snippet {
  color: var(--text-secondary);
  font-size: 0.9em;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* 模板带 BS my-3 工具类（!important），需同权对抗才能让标题→简介收到 10px */
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
/* 卡片内容布局 */
#BlogPost1 .popular-posts .card-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 22px;
}
/* 热门文章标题链接 */
#BlogPost1 .popular-posts .card-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}
@media (hover: hover) {
  #BlogPost1 .popular-posts .card:hover .card-title a {
    color: var(--primary-color);
  }
}
#BlogPost1 .popular-posts .card:active .card-title a {
  color: var(--primary-color);
}
/* 阅读全文文字链 */
.read-more-link {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 5px;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary-color);
  text-decoration: none;
}
#BlogPost1 .popular-posts .read-more-link { margin-top: auto; }
.read-more-link .rm-arrow { transition: transform 0.25s ease; }
@media (hover: hover) {
  .read-more-link:hover .rm-arrow { transform: translate(2px, -2px); }
}

/* ===== 博文正文样式 ===== */
.post-content { padding: 1rem 0; font-size: 1em; line-height: 1.8; }
.post-content p { text-indent: 2em; margin-bottom: 1.2em; }
.post-content li p { text-indent: 0; margin-bottom: 0.5em; }
.post-content strong { color: var(--primary-color); font-weight: 600; }

/* 博文内图片尺寸限制 */
.post-content img,
.post-content a img,
.post-content .text-center img,
.text-center a[data-fancybox] img,
.post-content a[data-fancybox] img {
  max-width: 100% !important;
  max-height: 600px !important;    /* 限制最大高度 */
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;  /* 保持比例 */
  display: block !important;
  margin: 1rem auto !important;    /* 居中 */
  border-radius: 10px !important;   /* 圆角 */
  cursor: zoom-in !important;      /* 提示可点击放大 */
  transition: transform 0.3s ease;
}

/* 悬停效果 */
.post-content a:hover img,
.text-center a[data-fancybox]:hover img {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ===== 文章版权条 ===== */
.post-copyright-bar {
  margin-top: 32px;
  padding: 16px 0;
  border-top: 1px solid transparent;
  border-image: linear-gradient(90deg, transparent 0%, rgba(84,155,245,0.4) 20%, rgba(139,92,246,0.5) 50%, rgba(84,155,245,0.4) 80%, transparent 100%) 1;
  display: flex;
  justify-content: flex-end;
}
.copyright-content { display: flex; align-items: center; gap: 6px; font-size: 0.85em; color: rgb(108,117,125); }
.copy-symbol { 
  width: 14px; 
  height: 14px; 
  vertical-align: middle;
  opacity: 0.9;
  margin-left: 1px;
}
.copy-text { color: rgb(130,143,163); }

/* ===== 标签云 ===== */
.widget-content.cloud-label-widget-content { 
  line-height: 2.2; 
  margin: 1rem 0; 
}
.label-size {
  display: inline-block;
  margin: 4px 6px;
  padding: 5px 14px;
  border-radius: 20px;
  background: rgba(84,155,245,0.08);
  border: 1px solid rgba(84,155,245,0.25);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font-stack);
  font-weight: 500;
}
.label-size-1 { font-size: 12px; }
.label-size-2 { font-size: 13px; }
.label-size-3 { font-size: 14px; }
.label-size-4 { font-size: 15px; }
.label-size-5 { font-size: 16px; }
.label-size:hover {
  background: rgba(84,155,245,0.15);
  border-color: rgba(84,155,245,0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(84,155,245,0.15);
}
.label-size a { 
  color: var(--primary-color); 
  text-decoration: none; 
  transition: color 0.3s ease;
}
.label-size:hover a {
  color: var(--primary-hover);
}
.label-count { 
  margin-left: 4px; 
  font-size: 0.75em; 
  color: rgb(130,143,163) !important; 
  opacity: 0.7;
  font-weight: 400;
}

/* ===== 博友列表 ===== */
.blog-list-container ul { padding-left: 0; margin-left: 0; list-style-type: none; }
.blog-list-container ul li {
  padding: 10px 12px;
  margin: 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  position: relative;
  transition: all 0.2s ease;
}
.blog-list-container ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 41px;
  background: var(--primary-color);
  border-radius: 0 2px 2px 0;
  transition: all 0.2s ease;
}
.blog-list-container ul li:hover {
  background-color: rgba(0,0,0,0.02);
}
.blog-list-container ul li:hover::before {
  background: var(--primary-hover);
  height: 42px;
}
.blog-list-container ul li:last-child { border-bottom: none; }
.item-content {
  white-space: nowrap;
  overflow: hidden;
  max-width: 100%;
  display: block;
  mask-image: linear-gradient(to right, rgba(0,0,0,1) 80%, rgba(0,0,0,0) 100%);
  -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,1) 80%, rgba(0,0,0,0) 100%);
}
.blog-title-link {
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: color 0.3s ease;
}
.blog-title-link:hover { color: var(--primary-color); }
.blog-title-text { font-weight: 600; }
.item-title a { color: rgb(108,117,125); font-size: 0.95em; font-weight: 500; transition: color 0.3s ease; }
.item-title a:hover { color: var(--primary-color); }
.time-meta { font-size: 0.85em; color: rgb(108,117,125); display: inline-flex; align-items: center; gap: 6px; }
.separator { color: rgb(173,181,189); font-weight: 300; }

/* ===== 宝贝时光机 ===== */
.bb-time-machine {
  --bb-primary: rgb(84,155,245);
  --bb-bg: rgba(255,255,255,0.6);
  --bb-border: rgba(0,0,0,0.08);
  --bb-text-secondary: rgb(108,117,125);
  max-width: 380px;
  margin: 1.25rem auto 0.25rem;
  font-family: var(--font-stack);
}
.bb-card {
  background: var(--bb-bg);
  border: 1px solid var(--bb-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  transition: all 0.3s ease;
}
.bb-card:hover { box-shadow: 0 8px 32px rgba(84,155,245,0.12); border-color: rgba(84,155,245,0.2); }
.bb-media { position: relative; width: 100%; background: linear-gradient(180deg, #f8f8f8 0%, #e8e8e8 100%); overflow: hidden; }
.bb-media img { width: 100%; height: auto; display: block; object-fit: contain; }
.bb-media::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
  pointer-events: none;
}
.bb-clock {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 48px;
  height: 48px;
  background: rgba(0,0,0,0.8);
  border-radius: 50%;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  border: 2px solid var(--bb-primary);
  z-index: 5;
}
.bb-clock-center { position: absolute; width: 4px; height: 4px; background: var(--bb-primary); border-radius: 50%; top: 50%; left: 50%; transform: translate(-50%,-50%); z-index: 3; }
.bb-clock-hand { position: absolute; left: 50%; transform-origin: bottom center; border-radius: 2px; }
.bb-clock-hour { width: 2px; height: 13px; top: calc(50% - 13px); background: #fff; margin-left: -1px; }
.bb-clock-minute { width: 2px; height: 16px; top: calc(50% - 16px); background: rgba(255,255,255,0.7); margin-left: -1px; }
.bb-clock-second { width: 1.5px; height: 18px; top: calc(50% - 18px); background: var(--bb-primary); margin-left: -0.75px; z-index: 2; }
.bb-title { position: absolute; bottom: 12px; left: 12px; font-size: 1.1em; font-weight: 700; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,0.8); z-index: 5; }
.bb-timer { padding: 12px 16px 14px; display: flex; justify-content: space-between; gap: 4px; flex-wrap: nowrap; }
.bb-timer-item { display: flex; align-items: baseline; gap: 1px; white-space: nowrap; }
.bb-timer-number { font-size: 0.95em; font-weight: 700; color: var(--bb-primary); font-variant-numeric: tabular-nums; line-height: 1; }
.bb-timer-label { font-size: 0.65em; color: var(--bb-text-secondary); font-weight: 500; }
.bb-link { text-decoration: none; color: inherit; display: block; }

/* ===== About模块 ===== */
.about-widget { width: 100%; text-align: center; background: transparent !important; border: none !important; box-shadow: none !important; padding: 20px 0; margin-bottom: 0;  font-family: var(--font-stack);}
.about-header { margin-bottom: 0.5rem; }
.about-title { font-size: 1.6rem; font-weight: 800; color: var(--text-primary); letter-spacing: 4px; display: inline-block; position: relative; margin: 0 0 6px 0; padding-right: 5px; }
.about-icon { width: 28px; height: auto; position: absolute; top: -18px; right: -25px; opacity: 0.85; }
.about-domain { font-size: 12px; color: var(--primary-color); letter-spacing: 5px; text-transform: uppercase; font-weight: 500; opacity: 0.9; display: block; }
.about-divider { width: 85%; height: 1px; margin: 1.2rem auto; background: radial-gradient(circle, rgba(84,155,245,0.5) 0%, transparent 90%); position: relative; overflow: hidden; }
.about-divider::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(84,155,245,0.6), rgba(139,92,246,0.4), transparent);
  animation: about-shimmer 4s infinite ease-in-out;
}
@keyframes about-shimmer { 0% { left: -150%; } 50% { left: 150%; } 100% { left: 150%; } }
.about-desc { font-size: 15px; color: rgb(108,117,125); line-height: 2; margin: 0; padding: 0 10px; letter-spacing: 1px; font-style: italic; opacity: 0.9; }

/* ===== 页脚 ===== */
footer.text-muted { font-size: 14px; color: #666 !important; }
footer.text-muted a { color: inherit !important; text-decoration: none !important; }
footer.text-muted img, footer.text-muted svg { vertical-align: middle; }
footer.text-muted .beian-icon { width: 14px; height: auto; }
footer.text-muted .foreverblog-logo { max-height: 16px; width: auto; }
footer.text-muted svg { width: 16px; height: 16px; }
footer.text-muted .separator { margin: 0 5px; opacity: 0.6; }
#pageFooter .container>div { display: flex; flex-direction: column; gap: 6px; }
.beian-line, .copy-line, .forever-line, .divider-line { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; }
.copy-line img[alt='Party logo'] { height: 1em; width: auto; margin: 0 3px; }
.divider-line { width: 100%; justify-content: center; }
.divider-line .line { flex: 1; border-top: 1px solid red; margin: 0 10px; max-width: 100px; }
.divider-line .star-container { display: flex; align-items: center; }
.divider-line .star-container svg { fill: red; width: 20px; height: 20px; animation: rotateStar 8s linear infinite; }
@keyframes rotateStar { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ===== 按钮与交互 ===== */
.btn { position: relative; overflow: hidden; transform: translate3d(0,0,0); }
.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255,255,255,0.3);
  border-radius: 50%;
  transform: translate(-50%,-50%);
  transition: width 0.6s ease, height 0.6s ease;
}
.btn:active::after { width: 200%; height: 200%; }

/* 社交按钮颜色 */
.yt-red { color: red; border-color: red; }
.yt-red:hover { background-color: red; border-color: red; }
.ig-orange { color: orange; border-color: orange; }
.ig-orange:hover { background-color: orange; border-color: orange; }
.line-green { color: #03C755; border-color: #03C755; }
.line-green:hover { border-color: #03C755; background-color: #03C755; }
.twitter-blue { color: #1EA1F1; border-color: #1EA1F1; }
.twitter-blue:hover { border-color: #1EA1F1; background-color: #1EA1F1; }
.facebook-blue { color: #2D88FF; border-color: #2D88FF; }
.facebook-blue:hover { border-color: #2D88FF; background-color: #2D88FF; }
.purple { color: #A96FFF; border-color: #A96FFF; }
.purple:hover { border-color: #A96FFF; background-color: #A96FFF; }
.GitHub-white { color: rgb(205,217,229); border-color: rgb(205,217,229); }
.GitHub-white:hover { color: rgb(45,51,59); border-color: rgb(205,217,229); background-color: rgb(205,217,229); }
.Share-btn { color: rgb(71,77,87); border-color: rgb(71,77,87); }
.Share-btn:hover { color: white; border-color: rgb(71,77,87); background-color: rgb(71,77,87); }
.badge { color: rgb(29,111,220); background-color: rgb(221,244,255); }
.badge:hover { color: white; background-color: rgb(29,111,220); }

/* ===== 组件样式 ===== */
.position-sticky>.card { background-color: rgb(247,248,250); }
tr { background-color: rgb(247,248,250); }
#blog-pager { display: none; }

/* ===== 返回顶部按钮 ===== */
#simpleBackToTop {
  position: fixed;
  right: 30px;
  bottom: -50px;
  width: 45px;
  height: 45px;
  background: rgba(45,51,59,0.9);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.68,-0.55,0.265,1.55);
  z-index: 100;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
#simpleBackToTop::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  border: 3px solid rgba(200,200,200,0.8);
  border-right: none;
  border-bottom: none;
  transform: translate(-50%,-30%) rotate(45deg);
  transition: all 0.3s ease;
}
#simpleBackToTop.show { bottom: 30px; opacity: 1; }
#simpleBackToTop:hover { background: rgba(84,155,245,0.9); transform: translateY(-3px); box-shadow: 0 5px 20px rgba(84,155,245,0.4); }
#simpleBackToTop:hover::before { border-color: white; transform: translate(-50%,-40%) rotate(45deg); }
#simpleBackToTop:active { transform: scale(0.95); }

/* ===== 阅读进度条 ===== */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, rgb(84,155,245), rgb(139,92,246), rgb(78,201,176));
  background-size: 200% 100%;
  animation: gradient-shift 3s linear infinite;
  z-index: 9999;
  transition: width 0.1s linear;
}
@keyframes gradient-shift { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }

/* ===== 代码块与复制按钮 ===== */
.code-container { position: relative; margin: 1em 0; }
/* 浅色模式代码块（默认） */
.post-content pre { background: #fafafa; border: 1px solid #e5e5e5; border-radius: 10px; overflow: hidden; }
.post-content pre code { background: transparent; color: #383a42; padding: 1em; }
.post-content code:not(pre code) {
  background: rgba(84,155,245,0.08);
  color: #d19a66;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9em;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}
/* 浅色模式 hljs — Atom One Light */
.hljs { color: #383a42; background: #fafafa; }
.hljs-comment, .hljs-quote { color: #a0a1a7; font-style: italic; }
.hljs-doctag, .hljs-formula, .hljs-keyword { color: #a626a4; }
.hljs-deletion, .hljs-name, .hljs-section, .hljs-selector-tag, .hljs-subst { color: #e45649; }
.hljs-literal { color: #0184bb; }
.hljs-addition, .hljs-attribute, .hljs-meta .hljs-string, .hljs-regexp, .hljs-string { color: #50a14f; }
.hljs-attr, .hljs-number, .hljs-selector-attr, .hljs-selector-class, .hljs-selector-pseudo, .hljs-template-variable, .hljs-type, .hljs-variable { color: #986801; }
.hljs-bullet, .hljs-link, .hljs-meta, .hljs-selector-id, .hljs-symbol, .hljs-title { color: #4078f2; }
.hljs-built_in, .hljs-class .hljs-title, .hljs-title.class_ { color: #c18401; }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }
.hljs-link { text-decoration: underline; }
/* 浅色模式代码块滚动条 */
pre code.hljs::-webkit-scrollbar { height: 6px; width: 6px; }
pre code.hljs::-webkit-scrollbar-track { background: rgba(0,0,0,0.04); border-radius: 3px; }
pre code.hljs::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 3px; }
pre code.hljs::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }
pre code.hljs { scrollbar-width: thin; scrollbar-color: rgba(0,0,0,0.15) rgba(0,0,0,0.04); }
/* 复制按钮 — hover 显示 + 图标风格 */
.copy-btn {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 32px;
  height: 32px;
  padding: 0;
  background: rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.code-container:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: rgba(84,155,245,0.12); border-color: rgba(84,155,245,0.2); }
.copy-btn svg { width: 16px; height: 16px; pointer-events: none; }
.copy-btn.copied { background: rgba(34,197,94,0.12); border-color: rgba(34,197,94,0.2); }
.copy-btn.copied svg { color: #22c55e; }
/* 复制成功提示 */
.copy-alert {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(34,197,94,0.9);
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  display: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 9999;
}

/* ===== 猫猫按钮 ===== */
#maomao {
  position: fixed;
  bottom: 60px;
  right: -5px;
  width: 57px;
  height: 70px;
  background-image: url(https://img.eebk.com/blog/20210808215127.svg );
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  transition: background 0.3s;
  z-index: 21;
}
#maomao:hover { background-position: 60px 50%; }

/* ===== 移动端适配 ===== */
@media (max-width: 768px) {
  .post-outer .card-body { padding: 18px 20px; }
  .post-outer .card-title { font-size: 1.15rem; }
  .post-meta { flex-wrap: wrap; gap: 10px; }
  .beian-line { flex-wrap: nowrap; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; justify-content: center; padding-bottom: 2px; transform: scale(0.95); transform-origin: center; }
  .beian-line>* { transform: scale(0.92); white-space: nowrap; }
  .beian-line::-webkit-scrollbar { display: none; }
  footer.text-muted { font-size: 13px; }
  .beian-icon { width: 12px !important; height: auto !important; }
  footer.text-muted .separator { margin: 0 3px; }
}
@media (max-width: 575.98px) {
  .beian-line { transform: scale(0.88); }
  footer.text-muted { font-size: 12px; }
  .beian-icon { width: 11px !important; height: auto !important; }
}

/* ===== 深色模式 ===== */

:where([data-bs-theme="dark"]) ::selection { color: white; background-color: rgb(108,117,125); }
:where([data-bs-theme="dark"]) body {
    background-color: var(--bg-dark);
    background-image:
      radial-gradient(1100px 480px at 12% -8%, rgba(84,155,245,0.055), transparent 62%),
      radial-gradient(900px 420px at 92% -4%, rgba(139,92,246,0.045), transparent 60%);
    background-attachment: fixed;
    background-repeat: no-repeat;
  }
:where([data-bs-theme="dark"]) .label-size {
    background: rgba(84,155,245,0.1);
    border-color: rgba(84,155,245,0.2);
  }
:where([data-bs-theme="dark"]) .label-size:hover {
    background: rgba(84,155,245,0.18);
    border-color: rgba(84,155,245,0.4);
    box-shadow: 0 4px 12px rgba(84,155,245,0.2);
  }
:where([data-bs-theme="dark"]) .label-size a { 
    color: var(--primary-color); 
  }
:where([data-bs-theme="dark"]) .label-count {
    color: rgb(130,143,163);
  }
:where([data-bs-theme="dark"]) .blog-list-container ul li {
    border-bottom-color: rgba(255,255,255,0.05);
  }
:where([data-bs-theme="dark"]) .blog-list-container ul li::before {
    background: rgba(84,155,245,0.6);
  }
:where([data-bs-theme="dark"]) .blog-list-container ul li:hover {
    background-color: rgba(255,255,255,0.03);
  }
:where([data-bs-theme="dark"]) .blog-list-container ul li:hover::before {
    background: var(--primary-color);
  }
  /* 深色模式图片样式 */
:where([data-bs-theme="dark"]) .post-content img,
:where([data-bs-theme="dark"]) .post-content a[data-fancybox] img {
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  }
:where([data-bs-theme="dark"]) .post-outer .card { border: 1px solid var(--border-dark); background: var(--card-bg-dark); box-shadow: var(--shadow-dark); }
:where([data-bs-theme="dark"]) .post-outer:not(:has(.post-content)) .card:hover { background: rgba(45,51,59,0.6); border-color: rgba(84,155,245,0.3); box-shadow: 0 2px 6px rgba(0,0,0,0.35), 0 12px 36px rgba(0,0,0,0.4); }
:where([data-bs-theme="dark"]) .post-outer .card-title { color: rgb(205,217,229); }
@media (hover: hover) {
  :where([data-bs-theme="dark"]) .post-outer:not(:has(.post-content)) .card:hover .card-title a {
    color: var(--primary-color);
  }
}
:where([data-bs-theme="dark"]) .post-outer .card:active .card-title a {
  color: var(--primary-color);
}
:where([data-bs-theme="dark"]) .post-meta { color: rgb(130,143,163); }
:where([data-bs-theme="dark"]) .post-divider { background: linear-gradient(to right, rgba(84,155,245,0.3), rgba(255,255,255,0.05), transparent); }
:where([data-bs-theme="dark"]) .post-outer .item-snippet { color: rgb(173,186,199); }
:where([data-bs-theme="dark"]) tr { color: rgb(205,217,229); background-color: rgb(45,51,59); border-color: rgb(205,217,229); }
:where([data-bs-theme="dark"]) tr:hover { color: rgb(45,51,59); background-color: rgb(205,217,229); border-color: rgb(45,51,59); }
:where([data-bs-theme="dark"]) .sticky-top,
:where([data-bs-theme="dark"]) .dropdown-menu { background-color: rgba(26,30,35,0.82); }
  /* 下拉菜单实底：嵌套毛玻璃失效，深色下也用不透明底防文字透出 */
:where([data-bs-theme="dark"]) .dropdown-menu { background-color: rgb(26,30,35); backdrop-filter: none; -webkit-backdrop-filter: none; }
:where([data-bs-theme="dark"]) .navbar-nav>a.active { color: rgb(205,217,229) !important; }
:where([data-bs-theme="dark"]) .card { color: rgb(205,217,229); background-color: var(--bg-dark); border-color: rgb(67,76,86); }
:where([data-bs-theme="dark"]) a,
:where([data-bs-theme="dark"]) .btn-outline-primary { color: var(--primary-color); border-color: var(--primary-color); }
:where([data-bs-theme="dark"]) .btn-outline-primary { background: rgba(84,155,245,0.1); border-radius: 8px; font-weight: 500; }
:where([data-bs-theme="dark"]) .btn-outline-primary:hover { border-color: rgba(84,155,245,0.55); background-color: rgba(84,155,245,0.18); color: rgb(140,190,250); box-shadow: 0 2px 10px rgba(0,0,0,0.25); }
:where([data-bs-theme="dark"]) .badge { color: var(--primary-color); background-color: rgb(39,52,73); }
:where([data-bs-theme="dark"]) .badge:hover { color: white; background-color: var(--primary-color); }
:where([data-bs-theme="dark"]) .position-sticky>.card { background-color: rgb(45,51,59); }
:where([data-bs-theme="dark"]) .Share-btn { color: rgb(205,217,229); border-color: rgb(205,217,229); }
:where([data-bs-theme="dark"]) .Share-btn:hover { color: var(--bg-dark); border-color: rgb(205,217,229); background-color: rgb(205,217,229); }
:where([data-bs-theme="dark"]) #BlogPost1 .popular-posts .card {
    background: linear-gradient(145deg, rgba(84,155,245,0.12) 0%, rgba(139,92,246,0.08) 50%, rgba(45,51,59,0.5) 100%);
    border: 1px solid rgba(84,155,245,0.2);
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  }
:where([data-bs-theme="dark"]) #BlogPost1 .popular-posts .card:hover {
    box-shadow: 0 8px 28px rgba(84,155,245,0.2);
    border-color: rgba(84,155,245,0.35);
  }
:where([data-bs-theme="dark"]) #BlogPost1 .popular-posts .card-title {
    color: rgb(205,217,229);
  }
:where([data-bs-theme="dark"]) #BlogPost1 .popular-posts .item-snippet {
    color: rgb(173,186,199);
  }
:where([data-bs-theme="dark"]) .post-copyright-bar { border-image: linear-gradient(90deg, transparent 0%, rgba(84,155,245,0.3) 20%, rgba(139,92,246,0.4) 50%, rgba(84,155,245,0.3) 80%, transparent 100%) 1; }
:where([data-bs-theme="dark"]) .copyright-content { color: rgb(130,143,163); }
:where([data-bs-theme="dark"]) .copy-text { color: rgb(108,117,125); }
:where([data-bs-theme="dark"]) .about-title { color: rgb(205,217,229); }
:where([data-bs-theme="dark"]) .about-domain { color: var(--primary-color); opacity: 1; }
:where([data-bs-theme="dark"]) .about-divider { background: radial-gradient(circle, rgba(84,155,245,0.4) 0%, transparent 90%); }
:where([data-bs-theme="dark"]) .about-desc { color: rgb(130,143,163); }
:where([data-bs-theme="dark"]) .item-content { mask-image: linear-gradient(to right, rgba(255,255,255,1) 80%, rgba(255,255,255,0) 100%); -webkit-mask-image: linear-gradient(to right, rgba(255,255,255,1) 80%, rgba(255,255,255,0) 100%); }
:where([data-bs-theme="dark"]) .blog-title-link { color: rgb(205,217,229); }
:where([data-bs-theme="dark"]) .blog-title-link:hover { color: var(--primary-color); }
:where([data-bs-theme="dark"]) .item-title a { color: rgb(130,143,163); }
:where([data-bs-theme="dark"]) .item-title a:hover { color: var(--primary-color); }
:where([data-bs-theme="dark"]) .time-meta { color: rgb(130,143,163); }
:where([data-bs-theme="dark"]) .separator { color: rgb(67,76,86); }
:where([data-bs-theme="dark"]) .bb-time-machine { --bb-bg: rgba(45,51,59,0.4); --bb-border: rgba(255,255,255,0.06); --bb-text-secondary: rgb(130,143,163); }
:where([data-bs-theme="dark"]) .bb-card { box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
:where([data-bs-theme="dark"]) .bb-card:hover { box-shadow: 0 8px 32px rgba(84,155,245,0.2); }
:where([data-bs-theme="dark"]) .bb-media { background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%); }
  /* 深色模式代码块 — Atom One Dark */
:where([data-bs-theme="dark"]) .post-content pre { background: #282c34; border-color: #21252b; border-radius: 10px; }
:where([data-bs-theme="dark"]) .post-content pre code { color: #abb2bf; }
:where([data-bs-theme="dark"]) .post-content code:not(pre code) {
    background: rgba(255,255,255,0.06);
    color: #e6c07b;
  }

  /* 深色模式代码块滚动条 */
:where([data-bs-theme="dark"]) pre code.hljs::-webkit-scrollbar { height: 6px; width: 6px; }
:where([data-bs-theme="dark"]) pre code.hljs::-webkit-scrollbar-track { background: rgba(255,255,255,0.06); border-radius: 3px; }
:where([data-bs-theme="dark"]) pre code.hljs::-webkit-scrollbar-thumb { background: #4b5264; border-radius: 3px; }
:where([data-bs-theme="dark"]) pre code.hljs::-webkit-scrollbar-thumb:hover { background: #5c6370; }
:where([data-bs-theme="dark"]) pre code.hljs { scrollbar-width: thin; scrollbar-color: #4b5264 rgba(255,255,255,0.06); }

  /* 深色模式全局滚动条 */
:where([data-bs-theme="dark"]) ::-webkit-scrollbar { width: 8px; height: 8px; }
:where([data-bs-theme="dark"]) ::-webkit-scrollbar-track { background: transparent; }
:where([data-bs-theme="dark"]) ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 4px; }
:where([data-bs-theme="dark"]) ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.24); }
:where([data-bs-theme="dark"]) html { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.14) transparent; }

  /* 深色模式复制按钮 */
:where([data-bs-theme="dark"]) .copy-btn {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.08);
  }
:where([data-bs-theme="dark"]) .copy-btn:hover { background: rgba(84,155,245,0.15); border-color: rgba(84,155,245,0.25); }

/* widget-content.popular-posts.row 是同一元素，带 Bootstrap mb-4；此条清零文章页等非首页的热门区底距 */
#BlogPost1 .popular-posts {
  margin-bottom: 0 !important;
}

/* 右边栏卡片圆角 */
aside.col-lg-4 .card {
  border-radius: 14px;
}

/* 客服对话框主体，绝对定位在按钮正下方 */
/* AI 客服按钮（41px 对齐） */
.btn-ai-nav {
    background: #18181b !important;
    border: 1px solid rgba(99, 102, 241, 0.4) !important;
    color: #fff !important;
    height: 41px !important;
    padding: 0 12px !important;
    display: inline-flex !important;
    align-items: center;
    border-radius: 6px;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.btn-ai-nav:hover {
    background: #232329 !important;
    border-color: rgba(129, 140, 248, 0.85) !important;
    box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.25), 0 4px 14px rgba(99, 102, 241, 0.35);
    transform: translateY(-1px);
}

/* 对话框 - 核心是 FIXED */
.ai-chat-box {
    position: fixed !important;
    z-index: 999999 !important; /* 增加到最高级 */
    background: #1a1a1e;
    flex-direction: column;
    box-shadow: 0 10px 50px rgba(0,0,0,0.8);
    transition: transform 0.3s ease, opacity 0.3s ease;
    border: 1px solid rgba(255,255,255,0.1);
}

/* PC端：右下角悬浮 */
@media (min-width: 769px) {
    .ai-chat-box {
        bottom: 30px !important;
        right: 30px !important;
        width: 360px !important;
        height: 520px !important;
        border-radius: 12px !important;
        opacity: 0;
        transform: translateY(20px);
        pointer-events: none;
        display: none;
    }
    
    .ai-chat-box.show {
        display: flex !important;
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    /* PC 端有 show 类名也不显示遮罩层 */
    .ai-chat-overlay.show {
        display: none !important;
    }
}

/* 手机端：底部全宽抽屉 */
@media (max-width: 768px) {
    .ai-chat-box {
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 80vh !important; /* 适当调高，确保键盘弹出时仍有空间 */
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        display: none;
    }
    .ai-chat-box.show {
        display: flex !important;
        transform: translateY(0);
    }
    /* 解决键盘遮挡 */
    .chat-footer {
        padding-bottom: env(safe-area-inset-bottom, 20px);
    }
}

/* 遮罩层 */
.ai-chat-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 999998;
    backdrop-filter: blur(4px);
}
.ai-chat-overlay.show { display: block; }

/* 聊天内容样式 */
.chat-header { background: #27272a; padding: 12px 15px; display: flex; justify-content: space-between; color: #fff; align-items: center; }
.status-dot { width: 8px; height: 8px; background: #10b981; border-radius: 50%; display: inline-block; margin-right: 5px; }

/* 聊天主体：增加了 Firefox 滚动条支持 */
.chat-body { 
    flex: 1; 
    overflow-y: auto; 
    padding: 15px; 
    background: #161618; 
    display: flex; 
    flex-direction: column; 
    gap: 12px;
    
    /* Firefox 专用：设置滚动条细度和颜色 */
    scrollbar-width: thin;
    scrollbar-color: #3f3f46 transparent;
}

/* Chrome, Edge, Safari 专用：自定义滚动条样式 */
.chat-body::-webkit-scrollbar {
    width: 6px; /* 建议 6px，既能看到又不突兀 */
}

.chat-body::-webkit-scrollbar-track {
    background: transparent;
}

.chat-body::-webkit-scrollbar-thumb {
    background: #3f3f46;
    border-radius: 10px;
}

.chat-body::-webkit-scrollbar-thumb:hover {
    background: #52525b;
}

/* 消息包装容器：实现左右对齐 */
.chat-message {
    display: flex;
    width: 100%;
    flex-direction: row;
}

/* AI 消息容器：内容靠左 */
.ai-message {
    justify-content: flex-start;
}

/* 用户消息容器：内容靠右 */
.user-message {
    justify-content: flex-end;
}

/* 气泡通用样式 */
.msg-content { 
    padding: 10px 14px; 
    border-radius: 12px; 
    font-size: 14px; 
    max-width: 85%; 
    color: #fff; 
    line-height: 1.5;
    word-wrap: break-word;
}

/* AI 气泡细节 */
.ai-message .msg-content { 
    background: #27272a; 
    border-bottom-left-radius: 4px; /* 左下角稍微尖一点，更有对话感 */
}

/* 用户气泡细节 */
.user-message .msg-content { 
    background: #4f46e5; 
    border-bottom-right-radius: 4px; /* 右下角稍微尖一点 */
}
.chat-footer { padding: 10px; background: #1a1a1e; display: flex; gap: 8px; }
.chat-input { flex: 1; background: #27272a; border: 1px solid #3f3f46; border-radius: 6px; color: #fff; padding: 8px; outline: none; font-size: 16px; }
.chat-send-btn { background: #fff; color: #18181b; border: none; padding: 0 15px; border-radius: 6px; font-weight: bold; }
.chat-close-btn { background: none; border: none; color: #aaa; font-size: 28px; cursor: pointer; line-height: 1; }

/* ===== 音乐播放器 ===== */
.mobile-player { gap: 10px; }

/* 波形条 - 6条 */
.wave-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
}
.wave-bars .bar {
  width: 3px;
  border-radius: 2px;
  background: #768390;
  transition: background 0.2s, height 0.1s;
}
/* 静止状态 */
.wave-bars .bar:nth-child(1) { height: 5px; }
.wave-bars .bar:nth-child(2) { height: 10px; }
.wave-bars .bar:nth-child(3) { height: 14px; }
.wave-bars .bar:nth-child(4) { height: 8px; }
.wave-bars .bar:nth-child(5) { height: 12px; }
.wave-bars .bar:nth-child(6) { height: 6px; }

/* 点击时即时反馈 - 波形条瞬间变大 */
.play-btn:active .wave-bars .bar {
  height: 16px !important;
  background: rgb(84,155,245);
  transition: none;
}

/* 播放状态 - 每根波形条独立跳动 */
.play-btn.playing .wave-bars .bar {
  background: rgb(84,155,245);
}
.play-btn.playing .wave-bars .bar:nth-child(1) {
  animation: wave1 0.45s ease-in-out infinite;
}
.play-btn.playing .wave-bars .bar:nth-child(2) {
  animation: wave2 0.6s ease-in-out infinite;
}
.play-btn.playing .wave-bars .bar:nth-child(3) {
  animation: wave3 0.5s ease-in-out infinite;
}
.play-btn.playing .wave-bars .bar:nth-child(4) {
  animation: wave4 0.55s ease-in-out infinite;
}
.play-btn.playing .wave-bars .bar:nth-child(5) {
  animation: wave5 0.4s ease-in-out infinite;
}
.play-btn.playing .wave-bars .bar:nth-child(6) {
  animation: wave6 0.65s ease-in-out infinite;
}

/* 每根波形条独立的跳动轨迹 */
@keyframes wave1 {
  0%, 100% { height: 4px; opacity: 0.5; }
  40% { height: 12px; opacity: 1; }
  70% { height: 6px; opacity: 0.7; }
}
@keyframes wave2 {
  0%, 100% { height: 5px; opacity: 0.5; }
  30% { height: 14px; opacity: 1; }
  60% { height: 8px; opacity: 0.8; }
}
@keyframes wave3 {
  0%, 100% { height: 3px; opacity: 0.5; }
  50% { height: 15px; opacity: 1; }
}
@keyframes wave4 {
  0%, 100% { height: 6px; opacity: 0.6; }
  35% { height: 10px; opacity: 0.9; }
  65% { height: 13px; opacity: 1; }
}
@keyframes wave5 {
  0%, 100% { height: 4px; opacity: 0.5; }
  25% { height: 11px; opacity: 1; }
  75% { height: 7px; opacity: 0.7; }
}
@keyframes wave6 {
  0%, 100% { height: 5px; opacity: 0.5; }
  45% { height: 9px; opacity: 0.8; }
  80% { height: 14px; opacity: 1; }
}

/* 按钮样式 */
.play-btn {
  border: none;
  background: transparent;
  padding: 2px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* PC端位置 */
#pcPlayer {
  margin-left: 60px;
  margin-right: 12px;
}

/* 1200–1399：xl 刚展开但横向紧，压缩间距避免导航折成两行（主题按钮掉到第二行） */
@media (min-width: 1200px) and (max-width: 1399.98px) {
  #pcPlayer {
    margin-left: 10px;
    margin-right: 6px;
  }
  .navbar .navbar-nav.flex-row > .nav-link.me-2 {
    margin-right: 0.3rem !important;
  }
  .navbar form.d-flex.me-1.my-1 {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    margin-right: 0.2rem !important;
  }
  .navbar .form-control.search {
    max-width: 160px;
  }
  .navbar .navbar-nav.flex-row.flex-wrap.ms-md-auto {
    flex-wrap: nowrap !important;
  }
  .navbar .btn.me-1.my-1 {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    margin-right: 0.2rem !important;
  }
  .navbar .btn-ai-nav.me-1.my-1 {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }
}

/* ===== 音乐播放器：错误态 + 歌单浮层 ===== */
.play-btn.music-error .wave-bars .bar {
  background: #6e7681 !important;
  animation: none !important;
  opacity: 0.55;
}
.play-btn.music-error { cursor: not-allowed; }

.music-popover {
  --mp-fg: #1f2328; --mp-sub: #8b949e; --mp-line: rgba(31,35,40,.08); --mp-acc: rgb(84,155,245);
  position: fixed; z-index: 1080;
  width: 180px; max-height: min(60vh, 200px);
  display: flex; flex-direction: column;
  overflow: hidden; padding: 0;
  border-radius: 9px;
  background: rgba(255,255,255,.74);
  -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6);
  border: .5px solid rgba(31,35,40,.1);
  box-shadow: 0 8px 24px -10px rgba(31,35,40,.22), 0 1px 2px rgba(31,35,40,.06), inset 0 .5px 0 rgba(255,255,255,.8);
  color: var(--mp-fg); font-size: 10.5px; line-height: 1.3;
  animation: mpIn .16s ease-out;
}
@keyframes mpIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.music-popover[hidden] { display: none !important; }
.music-pop-now { position: relative; display: flex; align-items: center; gap: 3px; padding: 6px 5px 7px 9px; }
.music-pop-title-wrap {
  flex: 1; min-width: 0; overflow: hidden; white-space: nowrap;
  -webkit-mask-image: linear-gradient(90deg,#000 88%,transparent); mask-image: linear-gradient(90deg,#000 88%,transparent);
}
.music-pop-title { display: inline; font-weight: 600; font-size: 11.5px; letter-spacing: .01em; color: var(--mp-fg); }
.music-pop-artist { display: inline; margin-left: 4px; font-size: 10px; color: var(--mp-sub); }
.music-pop-title.marquee { display: inline-block; animation: none; }
.music-pop-title-wrap:has(.marquee) > * { display: inline-block; animation: musicMarquee 10s linear infinite; }
@keyframes musicMarquee { 0%,15% { transform: translateX(0); } 85%,100% { transform: translateX(-40%); } }
.music-pop-controls { display: flex; gap: 1px; margin: 0; flex: none; }
.music-pop-btn {
  width: 16px; height: 16px; padding: 0; border: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--mp-sub); cursor: pointer; transition: color .15s, background .15s;
}
.music-pop-btn:hover { color: var(--mp-fg); background: var(--mp-line); }
.music-pop-btn.mp-toggle { color: var(--mp-fg); }
.mp-i-pause, .is-playing .mp-i-play { display: none; }
.is-playing .mp-i-pause { display: block; }
.music-pop-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--mp-line); margin: 0; border-radius: 0; }
.music-pop-progress-bar { height: 100%; width: 0; background: var(--mp-acc); box-shadow: 0 0 4px var(--mp-acc); transition: width .25s linear; }
.music-pop-list { list-style: none; margin: 0; padding: 2px 3px 3px; overflow-y: auto; max-height: 82px; overscroll-behavior: contain;
  -webkit-mask-image: linear-gradient(180deg,#000 calc(100% - 22px),transparent); mask-image: linear-gradient(180deg,#000 calc(100% - 22px),transparent); scrollbar-width: none; }
.music-pop-list::-webkit-scrollbar { display: none; width: 0; height: 0; }
.music-pop-list.at-end { -webkit-mask-image: none; mask-image: none; }
.music-pop-item {
  display: flex; align-items: baseline; gap: 4px; padding: 3px 6px; margin: 0;
  border-radius: 5px; cursor: pointer; white-space: nowrap; transition: background .15s;
}
.music-pop-item:hover { background: var(--mp-line); }
.music-pop-item-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 10.5px; color: var(--mp-fg); opacity: .78; }
.music-pop-item-artist { flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; margin-left: auto; font-size: 9.5px; color: var(--mp-sub); }
.mp-ind { flex: none; align-self: center; display: inline-flex; align-items: flex-end; gap: 1px; width: 7px; height: 8px; }
.mp-ind b { width: 1.6px; height: 1.6px; border-radius: 1px; background: var(--mp-sub); opacity: .35; }
.music-pop-item:not(.active) .mp-ind { display: none; }
.music-pop-item.active { background: transparent; }
.music-pop-item.active .music-pop-item-title { color: var(--mp-acc); opacity: 1; font-weight: 600; }
.music-pop-item.active .mp-ind b { background: var(--mp-acc); opacity: 1; height: 3px; }
.is-playing .music-pop-item.active .mp-ind b { animation: mpBar .9s ease-in-out infinite; }
.is-playing .music-pop-item.active .mp-ind b:nth-child(2) { animation-delay: -.3s; }
.is-playing .music-pop-item.active .mp-ind b:nth-child(3) { animation-delay: -.6s; }
@keyframes mpBar { 0%,100% { height: 2px; } 50% { height: 8px; } }
:where([data-bs-theme="dark"]) .music-popover {
  --mp-fg: #e6edf3; --mp-sub: #7d8590; --mp-line: rgba(205,217,229,.08); --mp-acc: rgb(110,175,255);
  background: rgba(34,39,46,.7);
  border-color: rgba(255,255,255,.08);
  box-shadow: 0 10px 28px -10px rgba(0,0,0,.6), 0 1px 2px rgba(0,0,0,.3), inset 0 .5px 0 rgba(255,255,255,.05);
}
@media (prefers-reduced-motion: reduce) {
  .music-pop-title-wrap > *, .mp-ind b { animation: none !important; }
}

/* ===== Swup 加载进度条 ===== */
.swup-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 4px;
  background: linear-gradient(90deg, rgb(84,155,245), rgb(139,92,246));
  box-shadow: 0 0 8px rgba(84,155,245,0.8);
  z-index: 9999;
  transition: width 0.3s ease-out;
  opacity: 0;
}
.swup-progress-bar.active {
  opacity: 1;
}
/* 慢加载（>2.5s）：闪烁脉冲提示仍在加载 */
.swup-progress-bar.slow {
  animation: swupSlowPulse 1.2s ease-in-out infinite;
}
@keyframes swupSlowPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
@media (prefers-reduced-motion: reduce) {
  .swup-progress-bar.slow { animation: none; }
}
/* 点击处即时反馈：链接进入加载态变灰半透明 */
a.swup-loading {
  opacity: 0.45;
  pointer-events: none;
}

/* ===== 组件样式 ===== */
/* Lightbox 灯箱 + 监控卡片 */

/* ===== 极简灯箱 ===== */
  .simple-lightbox {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
  }
  .simple-lightbox.active {
    opacity: 1;
    pointer-events: auto;
  }
  .simple-lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
  }
  .simple-lightbox .close {
    position: absolute;
    top: 20px; right: 40px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    line-height: 1;
  }

/* ===== Hermes Agent 监控卡片 ===== */
/* ===== 基础变量（白天模式默认值） ===== */
.hw-wrap{
  --hw-bg:#ffffff;
  --hw-border:rgba(0,0,0,0.08);
  --hw-text:#1f2937;
  --hw-hint:#6b7280;
  --hw-green:#16a34a;
  --hw-blue:#2563eb;
  --hw-orange:#ea580c;
  --hw-purple:#7c3aed;
  --hw-card-shadow:0 4px 20px rgba(0,0,0,0.08);
  --hw-hover-shadow:0 8px 32px rgba(0,0,0,0.12),0 0 20px rgba(37,99,235,0.1);
  --hw-glow-primary:rgba(37,99,235,0.4);
  --hw-glow-secondary:rgba(22,163,74,0.4);
  --hw-core-bg:rgba(188,150,25,0.12);
  --hw-stat-bg:rgba(188,150,25,0.06);
  --hw-write-bg:linear-gradient(135deg,rgba(234,88,12,0.08),rgba(234,88,12,0.02));
  --hw-query-bg:linear-gradient(135deg,rgba(37,99,235,0.08),rgba(37,99,235,0.02));
  --hw-brain-bg:linear-gradient(135deg,rgba(37,99,235,0.08),rgba(22,163,74,0.03));
  --hw-brain-pulse:rgba(37,99,235,0.2);
  --hw-neuron-color:rgba(37,99,235,0.4);
  --hw-neuron-glow:rgba(37,99,235,0.8);
  --hw-brain-count:#2563eb;
  max-width: 380px;
  margin: 0 0 12px;
  font-family: var(--font-stack);
}

/* ===== 黑夜模式 ===== */

:where([data-bs-theme="dark"]) .hw-wrap {
    --hw-bg:rgba(45,51,59,0.4);
    --hw-border:rgba(255,255,255,0.06);
    --hw-text:#e0e0e0;
    --hw-hint:#828fa3;
    --hw-green:#22c55e;
    --hw-blue:#3b82f6;
    --hw-orange:#f97316;
    --hw-purple:#8b5cf6;
    --hw-card-shadow:0 4px 20px rgba(0,0,0,0.3);
    --hw-hover-shadow:0 8px 32px rgba(0,0,0,0.4),0 0 20px rgba(59,130,246,0.15);
    --hw-glow-primary:rgba(59,130,246,0.4);
    --hw-glow-secondary:rgba(34,197,94,0.4);
    --hw-core-bg:rgba(255,255,255,0.08);
    --hw-stat-bg:rgba(255,255,255,0.03);
    --hw-write-bg:linear-gradient(135deg,rgba(249,115,22,0.12),rgba(249,115,22,0.03));
    --hw-query-bg:linear-gradient(135deg,rgba(59,130,246,0.12),rgba(59,130,246,0.03));
    --hw-brain-bg:linear-gradient(135deg,rgba(59,130,246,0.1),rgba(34,197,94,0.05));
    --hw-brain-pulse:rgba(59,130,246,0.25);
    --hw-neuron-color:rgba(59,130,246,0.5);
    --hw-neuron-glow:rgba(59,130,246,0.8);
    --hw-brain-count:#60a5fa;
  }

/* ===== 卡片主体 ===== */
.hw-card {
  background: var(--hw-bg);
  border: 1px solid var(--hw-border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--hw-card-shadow);
  overflow: hidden;
  position: relative;
  transition: box-shadow .4s ease, border-color .4s ease;
}
.hw-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 15px;
  padding: 1px;
  background: linear-gradient(135deg, transparent 40%, var(--hw-glow-primary), var(--hw-glow-secondary), transparent 60%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .4s ease;
  pointer-events: none;
}
.hw-card:hover {
  box-shadow: var(--hw-hover-shadow);
  border-color: rgba(59,130,246,0.3);
}
.hw-card:hover::before {
  opacity: 1;
  animation: hwGlowRotate 3s linear infinite;
}

@keyframes hwGlowRotate {
  0% { background: linear-gradient(0deg, transparent 40%, var(--hw-glow-primary), var(--hw-glow-secondary), transparent 60%); }
  25% { background: linear-gradient(90deg, transparent 40%, var(--hw-glow-primary), var(--hw-glow-secondary), transparent 60%); }
  50% { background: linear-gradient(180deg, transparent 40%, var(--hw-glow-primary), var(--hw-glow-secondary), transparent 60%); }
  75% { background: linear-gradient(270deg, transparent 40%, var(--hw-glow-primary), var(--hw-glow-secondary), transparent 60%); }
  100% { background: linear-gradient(360deg, transparent 40%, var(--hw-glow-primary), var(--hw-glow-secondary), transparent 60%); }
}

/* ===== 头部 ===== */
.hw-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.hw-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--hw-green); animation: hwPulse 2s infinite; }
@keyframes hwPulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
.hw-title { font-size: 13px; font-weight: 600; color: var(--hw-text); flex: 1; }
.hw-uptime { font-size: 10px; color: var(--hw-hint); }

/* ===== CPU 四核 ===== */
.hw-cpu { display: flex; gap: 3px; margin-bottom: 12px; height: 14px; }
.hw-core { flex: 1; background: var(--hw-core-bg); border-radius: 3px; position: relative; overflow: hidden; min-width: 0; }
.hw-core-fill { position: absolute; inset: 0; border-radius: 3px; transition: width .5s ease; }
.hw-core-text {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 0 4px; font-size: 7px; font-weight: 500; color: var(--hw-text); z-index: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* ===== 统计行 ===== */
.hw-stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 12px; }
.hw-stat { background: var(--hw-stat-bg); border-radius: 6px; padding: 8px 4px; text-align: center; }
.hw-stat-val { font-size: 14px; font-weight: 700; line-height: 1.3; }
.hw-stat-sub { font-size: 8px; color: var(--hw-hint); margin-top: 2px; }
.hw-stat-label { font-size: 9px; color: var(--hw-hint); margin-top: 2px; }
.hw-cpu-val { color: var(--hw-green); }
.hw-mem-val { color: var(--hw-blue); }
.hw-disk-val { color: var(--hw-purple); }
.hw-net-val { color: var(--hw-orange); }

/* ===== 记忆引擎 ===== */
.hw-engine { display: grid; grid-template-columns: .7fr 44px 1fr; gap: 0; position: relative; }
.hw-engine-left { display: flex; flex-direction: column; gap: 6px; }
.hw-engine-row {
  border-radius: 8px; padding: 8px 6px; display: flex; flex-direction: column;
  align-items: center; position: relative; overflow: hidden;
}
.hw-engine-row.write { background: var(--hw-write-bg); }
.hw-engine-row.query { background: var(--hw-query-bg); }
.hw-engine-num { font-size: 16px; font-weight: 700; }
.hw-engine-num.w { color: var(--hw-orange); }
.hw-engine-num.q { color: var(--hw-blue); }
.hw-engine-label { font-size: 8px; color: var(--hw-hint); }

/* ===== 流动桥 ===== */
.hw-flow-bridge { display: flex; flex-direction: column; justify-content: space-around; padding: 2px 0; }
.hw-bridge-row { height: 34px; position: relative; display: flex; align-items: center; }
.hw-bridge-dot { position: absolute; font-size: 7px; opacity: 0; }
.hw-write-dot { color: var(--hw-orange); animation: hwFlyRight 1.8s ease-in-out infinite; }
.hw-query-dot { color: var(--hw-blue); animation: hwFlyLeft 1.8s ease-in-out infinite; }
.hw-wd1 { animation-delay: 0s; }
.hw-wd2 { animation-delay: .6s; }
.hw-wd3 { animation-delay: 1.2s; }
.hw-qd1 { animation-delay: 0s; }
.hw-qd2 { animation-delay: .6s; }
.hw-qd3 { animation-delay: 1.2s; }
@keyframes hwFlyRight {
  0% { left: 0; opacity: .9; transform: scale(1); }
  70% { opacity: .7; }
  100% { left: calc(100% - 7px); opacity: 0; transform: scale(.5); }
}
@keyframes hwFlyLeft {
  0% { right: 0; left: auto; opacity: .9; transform: scale(1); }
  70% { opacity: .7; }
  100% { right: calc(100% - 7px); left: auto; opacity: 0; transform: scale(.5); }
}

/* ===== 大脑卡片 ===== */
.hw-brain-card {
  background: var(--hw-brain-bg); border-radius: 10px; padding: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative; overflow: hidden; grid-row: span 2;
}
.hw-brain { font-size: 28px; animation: hwBrainFloat 3s ease-in-out infinite; position: relative; z-index: 2; }
@keyframes hwBrainFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3px) scale(1.05); }
}
.hw-brain-count { font-size: 20px; font-weight: 700; color: var(--hw-brain-count); margin: 4px 0 2px; position: relative; z-index: 2; }
.hw-brain-label { font-size: 9px; color: var(--hw-hint); position: relative; z-index: 2; }
.hw-brain-pulse {
  position: absolute; width: 60px; height: 60px; border-radius: 50%;
  background: radial-gradient(circle, var(--hw-brain-pulse), transparent 70%);
  animation: hwBrainPulse 2s ease-in-out infinite;
}
@keyframes hwBrainPulse {
  0%, 100% { transform: scale(.8); opacity: .5; }
  50% { transform: scale(1.2); opacity: .2; }
}
.hw-neurons { position: absolute; inset: 0; pointer-events: none; }
.hw-neuron { position: absolute; font-size: 6px; color: var(--hw-neuron-color); animation: hwNeuronBlink 2s ease-in-out infinite; }
@keyframes hwNeuronBlink {
  0%, 100% { opacity: .2; }
  50% { opacity: 1; text-shadow: 0 0 8px var(--hw-neuron-glow); }
}

/* ===== 超链接 ===== */
.hw-link { display: block; text-decoration: none; color: inherit; cursor: pointer; }
.hw-link:hover { color: inherit; }

/* =========================================================================
   中文正文排版增强
   原则：只补模板缺失元素，不改已确认模式（缩进2em/段距1.2em/行高1.8/strong小标题主题色）
   生效范围：仅文章页 .post-content 内
   ========================================================================= */

/* --- 段落两端对齐（中文排版规范，去除右侧参差）--- */
.post-content p {
  text-align: justify;
  text-justify: inter-ideographic; /* 标点悬挂压缩，减少整句空隙 */
}

/* --- 引用块：主题色左边线 + 淡底 + 圆角 --- */
.post-content blockquote,
.post-content blockquote.border-start {
  position: relative;
  margin: 1.6em 0;
  padding: 0.8em 1.2em;
  border-left: 4px solid var(--primary-color);
  border-radius: 0 8px 8px 0;
  background: rgba(84,155,245,0.06);
  color: inherit;
}
.post-content blockquote.border-start { border-left: 4px solid var(--primary-color) !important; }
.post-content blockquote p { text-indent: 0; margin-bottom: 0.6em; }
.post-content blockquote p:last-child { margin-bottom: 0; }
.post-content blockquote cite { display: block; margin-top: 0.5em; font-size: 0.9em; font-style: normal; color: var(--text-secondary); }
.post-content blockquote cite::before { content: "—— "; }

/* --- 图片：一行多图（正文里两张并排）--- */
.post-content .img-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: flex-start;
  margin: 1.5em 0;
}
.post-content .img-row > * { flex: 0 1 calc(50% - 6px); min-width: 0; }
.post-content .img-row img {
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: none;
  margin: 0;
}
@media (max-width: 575.98px) {
  .post-content .img-row > * { flex-basis: 100%; }
}

/* --- 图片：下方说明文字（figcaption/小字）--- */
.post-content figure { margin: 1.5em 0; text-align: center; }
.post-content figure img { display: block; margin: 0 auto; }
.post-content figcaption,
.post-content figure figcaption {
  margin-top: 0.6em;
  font-size: 0.875em;
  line-height: 1.6;
  color: var(--text-secondary);
  text-align: center;
}
.post-content .img-caption { display: block; margin-top: 0.4em; font-size: 0.875em; color: var(--text-secondary); text-align: center; }

/* --- 列表：恢复中文排版样式（正文内）--- */
.post-content ul,
.post-content ol {
  margin: 0 0 1.2em 0;
  padding-left: 1.6em;
}
.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }
.post-content li {
  margin-bottom: 0.4em;
  line-height: 1.8;
}
.post-content li::marker { color: var(--primary-color); }
.post-content li > ul,
.post-content li > ol { margin-top: 0.3em; margin-bottom: 0.3em; }

/* --- 文章内分隔线 --- */
.post-content hr {
  width: 40%;
  height: 1px;
  margin: 2.2em auto;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--border-light) 20%, var(--border-light) 80%, transparent);
}

/* --- 表格（含代码类表格用）--- */
.post-content table {
  width: 100%;
  margin: 1.2em 0;
  border-collapse: collapse;
  font-size: 0.95em;
  line-height: 1.7;
}
.post-content table th,
.post-content table td {
  border: 1px solid var(--border-light);
  padding: 0.5em 0.8em;
  text-align: left;
  vertical-align: top;
}
.post-content table th { background: rgba(84,155,245,0.07); font-weight: 600; }
.post-content table tr:nth-child(even) td { background: rgba(0,0,0,0.015); }

/* --- 链接：正文内文字链接渐变下划线（图片链接除外）--- */
.post-content p a:not(.no-underline):not(:has(img)),
.post-content li a:not(.no-underline):not(:has(img)),
.post-content blockquote a:not(.no-underline):not(:has(img)) {
  color: var(--primary-color);
  text-decoration: none;
  background-image: linear-gradient(var(--primary-color), var(--primary-color));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size 0.25s ease;
  padding-bottom: 1px;
}
.post-content p a:hover:not(.no-underline):not(:has(img)),
.post-content li a:hover:not(.no-underline):not(:has(img)),
.post-content blockquote a:hover:not(.no-underline):not(:has(img)) { background-size: 100% 1px; }

/* --- 中西文混排（CJK 排版规范，渐进增强：支持 text-spacing 的浏览器自动加西文间距）--- */
@supports (text-spacing-trim: space-all) {
  .post-content p { text-spacing-trim: space-all; }
}

/* ============================ 深色模式适配 ============================ */

:where([data-bs-theme="dark"]) .post-content blockquote,
:where([data-bs-theme="dark"]) .post-content blockquote.border-start {
    background: rgba(84,155,245,0.10);
  }
:where([data-bs-theme="dark"]) .post-content blockquote cite { color: rgb(148,163,184); }
:where([data-bs-theme="dark"]) .post-content figcaption,
:where([data-bs-theme="dark"]) .post-content figure figcaption,
:where([data-bs-theme="dark"]) .post-content .img-caption { color: rgb(148,163,184); }
:where([data-bs-theme="dark"]) .post-content li::marker { color: var(--primary-color); }
:where([data-bs-theme="dark"]) .post-content hr { background: linear-gradient(90deg, transparent, var(--border-dark) 20%, var(--border-dark) 80%, transparent); }
:where([data-bs-theme="dark"]) .post-content table th,
:where([data-bs-theme="dark"]) .post-content table td { border-color: var(--border-dark); }
:where([data-bs-theme="dark"]) .post-content table th { background: rgba(84,155,245,0.13); }
:where([data-bs-theme="dark"]) .post-content table tr:nth-child(even) td { background: rgba(255,255,255,0.02); }

/* --- 加粗起头的段落（「一、二、三」小标题 / 「坑一」这类）：上方多留白、字号略提 ---
   :has(> strong:only-child) 只认元素子节点，段内夹文字的加粗段也会命中，故缩进一律保持 2em。 */
.post-content p:has(> strong:only-child) { margin-top: 1.9em; margin-bottom: .8em; line-height: 1.65; }
.post-content p:has(> strong:only-child) strong { font-size: 1.04em; letter-spacing: .02em; }

/* --- 正文链接：细下划线（半透明主题色），悬浮时加深 --- */
.post-content a:not(.btn):not(.hw-link):not(.fh-link):not(.tool-card) {
  text-decoration: underline; text-decoration-thickness: 1px;
  text-decoration-color: rgba(84,155,245,.38); text-underline-offset: 3px;
  transition: text-decoration-color .2s ease, color .2s ease;
}
.post-content a:not(.btn):not(.hw-link):not(.fh-link):hover { color: var(--primary-hover); text-decoration-color: currentColor; }

/* --- 正文图片：极细边框 + 轻微静止阴影（原来只有 hover 才有层次）--- */
.post-content img { border: 1px solid var(--border-light); box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 6px 18px rgba(16,24,40,.05); }

:where([data-bs-theme="dark"]) .post-content img { border-color: var(--border-dark); box-shadow: 0 2px 8px rgba(0,0,0,.3); }

/* ===== 正文装饰块（扁平：淡染底 + 同色描边 + 左侧色条）===== */
.post-content .callout {
  margin: 1.6em 0; padding: .95em 1.1em 1em 1.15em; border-radius: 12px;
  border: 1px solid rgba(84,155,245,.2); border-left: 3px solid var(--primary-color);
  background: linear-gradient(135deg, rgba(84,155,245,.07) 0%, rgba(84,155,245,.03) 55%, rgba(255,255,255,.72) 100%);
}
.post-content .callout > p { text-indent: 0; margin-bottom: .55em; }
.post-content .callout > p:last-child { margin-bottom: 0; }
.post-content .callout-title { text-indent: 0; margin: 0 0 .4em; font-weight: 600; color: var(--primary-color); display: flex; align-items: center; gap: .5em; }
.post-content .callout-title::before { content: ""; flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.post-content .callout-warn { border-color: rgba(217,119,6,.2); border-left-color: rgb(217,119,6);
  background: linear-gradient(135deg, rgba(217,119,6,.07) 0%, rgba(217,119,6,.03) 55%, rgba(255,255,255,.72) 100%); }
.post-content .callout-warn .callout-title { color: rgb(180,83,9); }
.post-content .callout-ok { border-color: rgba(22,163,74,.2); border-left-color: rgb(22,163,74);
  background: linear-gradient(135deg, rgba(22,163,74,.07) 0%, rgba(22,163,74,.03) 55%, rgba(255,255,255,.72) 100%); }
.post-content .callout-ok .callout-title { color: rgb(21,128,61); }

/* 行内小徽章 */
.post-content .tag { display: inline-block; padding: .05em .5em; margin: 0 .12em; border-radius: 6px; font-size: .85em; font-weight: 600; line-height: 1.65; vertical-align: 1px;
  background: rgba(84,155,245,.12); border: 1px solid rgba(84,155,245,.22); color: var(--primary-color); }
.post-content .tag-warn { background: rgba(217,119,6,.12); border-color: rgba(217,119,6,.22); color: rgb(180,83,9); }
.post-content .tag-ok { background: rgba(22,163,74,.12); border-color: rgba(22,163,74,.22); color: rgb(21,128,61); }

/* 数据小卡（并排，窄屏自动堆叠） */
.post-content .stat-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 1.5em 0; }
.post-content .stat { flex: 1 1 150px; padding: .7em .85em; border: 1px solid var(--border-light); border-radius: 12px;
  background: rgba(255,255,255,.72); box-shadow: 0 1px 2px rgba(16,24,40,.03); }
.post-content .stat-num { font-size: 1.25em; font-weight: 700; line-height: 1.3; color: var(--primary-color); font-variant-numeric: tabular-nums; }
.post-content .stat-label { margin-top: .15em; font-size: .8125rem; color: var(--text-secondary); }

/* 装饰分隔（三个小点） */
.post-content .deco-dots { margin: 1.8em 0; text-align: center; color: rgba(84,155,245,.45);
  font-size: .9em; letter-spacing: .6em; text-indent: .6em; }

:where([data-bs-theme="dark"]) .post-content .callout,
:where([data-bs-theme="dark"]) .post-content .callout-warn,
:where([data-bs-theme="dark"]) .post-content .callout-ok {
    background: rgba(255,255,255,.035); border-color: var(--border-dark);
  }
:where([data-bs-theme="dark"]) .post-content .callout { border-left-color: var(--primary-color); }
:where([data-bs-theme="dark"]) .post-content .callout-warn { border-left-color: rgb(217,119,6); }
:where([data-bs-theme="dark"]) .post-content .callout-ok { border-left-color: rgb(22,163,74); }
:where([data-bs-theme="dark"]) .post-content .callout-warn .callout-title { color: rgb(251,146,60); }
:where([data-bs-theme="dark"]) .post-content .callout-ok .callout-title { color: rgb(74,222,128); }
:where([data-bs-theme="dark"]) .post-content .stat { background: rgba(255,255,255,.04); border-color: var(--border-dark); box-shadow: none; }

/* ===== 双区小组件：监控卡 + 果蝇卡 ===== */
/* 上半区 #hw-* 样式沿用「监控卡片」段；数据源 bug.eebk.com/api/summary（逻辑在 blog-all.js） */
/* 外壳只做布局：透明无框，两卡间距由 .hw-wrap 的 margin-bottom 提供 */
.hb-wrap{display:block}
/* 上半区独立卡：淡蓝冷调渐变底（对应 Hermes 主题色） */
.hb-wrap .hw-card{border:1px solid rgba(188,150,25,.22);border-radius:14px;box-shadow:0 1px 2px rgba(16,24,40,.04),0 4px 16px rgba(188,150,25,.09);background:linear-gradient(150deg,rgba(188,150,25,.09) 0%,rgba(188,150,25,.04) 45%,rgba(255,255,255,.74) 100%);transition:box-shadow .25s ease,border-color .25s ease,background .25s ease}
.hb-wrap .hw-wrap:hover .hw-card{border-color:rgba(188,150,25,.34);box-shadow:0 2px 4px rgba(16,24,40,.05),0 8px 24px rgba(188,150,25,.15);background:linear-gradient(150deg,rgba(188,150,25,.13) 0%,rgba(188,150,25,.06) 45%,rgba(255,255,255,.8) 100%)}
/* 下半区独立卡：淡橙暖调渐变底（对应果蝇主题色） */
.hb-wrap .fh-card{border:1px solid rgba(217,119,6,.18);border-radius:14px;box-shadow:0 1px 2px rgba(16,24,40,.04),0 4px 16px rgba(217,119,6,.09);background:linear-gradient(150deg,rgba(217,119,6,.09) 0%,rgba(217,119,6,.04) 45%,rgba(255,255,255,.74) 100%);transition:box-shadow .25s ease,border-color .25s ease,background .25s ease}
.hb-wrap .fh-card:hover{border-color:rgba(217,119,6,.32);box-shadow:0 2px 4px rgba(16,24,40,.05),0 8px 24px rgba(217,119,6,.15);background:linear-gradient(150deg,rgba(217,119,6,.13) 0%,rgba(217,119,6,.06) 45%,rgba(255,255,255,.8) 100%)}
.fh-wrap *{box-sizing:border-box}
.fh-link{display:block;text-decoration:none;color:inherit;cursor:pointer}
.fh-card{position:relative;overflow:hidden;padding:14px 14px 12px;color:#1f2937}
.fh-header{display:flex;align-items:center;gap:7px;margin-bottom:12px;position:relative}
.fh-dot{flex:0 0 7px;width:7px;height:7px;border-radius:50%;background:#16a34a;animation:fhPulse 1.8s ease-out infinite}
@keyframes fhPulse{0%{box-shadow:0 0 0 0 rgba(34,197,94,.5)}70%{box-shadow:0 0 0 7px rgba(34,197,94,0)}100%{box-shadow:0 0 0 0 rgba(34,197,94,0)}}
.fh-title{font-size:.8125rem;font-weight:600;color:#1f2937;letter-spacing:.01em}
.fh-uptime{margin-left:auto;font-size:.6875rem;color:#9ca3af;font-variant-numeric:tabular-nums}
.fh-hero{display:flex;align-items:center;gap:9px;margin-bottom:12px;position:relative}
.fh-flybox{flex:0 0 36px;width:36px;height:36px;border-radius:12px;display:flex;align-items:center;justify-content:center;background:radial-gradient(circle at 50% 40%,rgba(255,190,120,.28),rgba(255,190,120,0) 70%),rgba(217,119,6,.06)}
.fh-fly{width:27px;height:27px;animation:fhFloat 3.4s ease-in-out infinite}
@keyframes fhFloat{0%,100%{transform:translateY(0) rotate(-3deg)}50%{transform:translateY(-3px) rotate(3deg)}}
.fh-act-wrap{flex:1 1 auto;min-width:0}
.fh-pill{display:inline-flex;align-items:center;gap:5px;max-width:100%;padding:3px 10px;border-radius:999px;font-size:.8125rem;font-weight:600;color:#b45309;background:linear-gradient(135deg,rgba(217,119,6,.14),rgba(217,119,6,.05));border:1px solid rgba(217,119,6,.18)}
.fh-pill i{flex:0 0 5px;width:5px;height:5px;border-radius:50%;background:#d97706;font-style:normal}
.fh-sub{margin-top:6px;font-size:.6875rem;color:#16a34a;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fh-nums{flex:0 0 auto;margin-left:auto;min-width:124px;display:flex;flex-direction:column;gap:4px;white-space:nowrap;padding:6px 10px;border-radius:10px;border:1px solid rgba(0,0,0,.05);background:linear-gradient(180deg,rgba(0,0,0,.035),rgba(0,0,0,.012))}
.fh-nrow{display:flex;align-items:baseline;justify-content:space-between;gap:14px;font-size:.5625rem;line-height:1.15}
.fh-nk{color:#9ca3af;letter-spacing:.02em}
.fh-nv{font-size:.625rem;font-weight:700;font-variant-numeric:tabular-nums}
.n-spark{color:#d97706}
.n-blue{color:#2563eb}
.n-slate{color:#64748b}
.fh-drives{display:grid;grid-template-columns:1fr 1fr;gap:6px 14px;margin-bottom:11px;position:relative}
.fh-drive{display:flex;align-items:center;gap:6px;font-size:.625rem}
.fh-dl{flex:0 0 auto;color:#9ca3af;letter-spacing:.02em}
.fh-bar-bg{flex:1 1 auto;height:6px;background:rgba(0,0,0,.06);border-radius:3px;overflow:hidden;min-width:0}
.fh-bar{height:100%;width:0;border-radius:3px;transition:width .5s ease}
.fh-dv{flex:0 0 30px;text-align:right;color:#9ca3af;font-variant-numeric:tabular-nums}
.fh-bar-hunger{background:linear-gradient(90deg,#f59e0b,#ef4444)}
.fh-bar-fear{background:linear-gradient(90deg,#8b5cf6,#ef4444)}
.fh-bar-curiosity{background:linear-gradient(90deg,#10b981,#3b82f6)}
.fh-bar-fatigue{background:linear-gradient(90deg,#64748b,#94a3b8)}
.fh-bar-groom{background:linear-gradient(90deg,#a3e635,#14b8a6)}
.fh-dv.n-blue{color:#2563eb}
.fh-bar-cpu{background:linear-gradient(90deg,#38bdf8,#818cf8)}
.fh-foot{display:block;position:relative;padding-top:9px;border-top:1px dashed rgba(0,0,0,.08);font-size:.6875rem;line-height:1.35;color:#6b7280}
.fh-env{white-space:nowrap}

/* 双卡深色底：蓝调半区 + 橙调半区，边框/阴影带各自色相 */
:where([data-bs-theme="dark"]) .hb-wrap .hw-card {border-color:rgba(96,165,250,.12);box-shadow:0 4px 20px rgba(0,0,0,.3),0 0 18px rgba(59,130,246,.05);background:linear-gradient(150deg,rgba(45,51,59,.55) 55%,rgba(59,130,246,.06) 100%)}
:where([data-bs-theme="dark"]) .hb-wrap .hw-wrap:hover .hw-card {border-color:rgba(96,165,250,.3);box-shadow:0 4px 20px rgba(0,0,0,.35),0 0 24px rgba(59,130,246,.12);background:linear-gradient(150deg,rgba(45,51,59,.6) 40%,rgba(59,130,246,.1) 100%)}
:where([data-bs-theme="dark"]) .hb-wrap .fh-card {border-color:rgba(245,158,11,.12);box-shadow:0 4px 20px rgba(0,0,0,.3),0 0 18px rgba(245,158,11,.05);background:linear-gradient(150deg,rgba(45,51,59,.55) 55%,rgba(245,158,11,.055) 100%)}
:where([data-bs-theme="dark"]) .hb-wrap .fh-card:hover {border-color:rgba(245,158,11,.3);box-shadow:0 4px 20px rgba(0,0,0,.35),0 0 24px rgba(245,158,11,.12);background:linear-gradient(150deg,rgba(45,51,59,.6) 40%,rgba(245,158,11,.09) 100%)}
:where([data-bs-theme="dark"]) .fh-card {color:#e0e0e0}
:where([data-bs-theme="dark"]) .fh-dot {background:#22c55e}
:where([data-bs-theme="dark"]) .fh-title {color:#e0e0e0}
:where([data-bs-theme="dark"]) .fh-uptime,
:where([data-bs-theme="dark"]) .fh-foot,
:where([data-bs-theme="dark"]) .fh-dl,
:where([data-bs-theme="dark"]) .fh-dv {color:#828fa3}
:where([data-bs-theme="dark"]) .fh-sub {color:#4ade80}
:where([data-bs-theme="dark"]) .fh-nums {background:linear-gradient(180deg,rgba(255,255,255,.05),rgba(255,255,255,.015));border-color:rgba(255,255,255,.06)}
:where([data-bs-theme="dark"]) .fh-nk {color:#828fa3}
:where([data-bs-theme="dark"]) .n-spark {color:#f59e0b}
:where([data-bs-theme="dark"]) .n-blue {color:#60a5fa}
:where([data-bs-theme="dark"]) .n-slate {color:#94a3b8}
:where([data-bs-theme="dark"]) .fh-bar-bg {background:rgba(255,255,255,.08)}
:where([data-bs-theme="dark"]) .fh-flybox {background:radial-gradient(circle at 50% 40%,rgba(255,190,120,.22),rgba(255,190,120,0) 70%),rgba(245,158,11,.08)}
:where([data-bs-theme="dark"]) .fh-pill {color:#fbbf24;background:linear-gradient(135deg,rgba(245,158,11,.16),rgba(245,158,11,.05));border-color:rgba(245,158,11,.22)}
:where([data-bs-theme="dark"]) .fh-pill i {background:#f59e0b}
:where([data-bs-theme="dark"]) .fh-foot {border-top-color:rgba(255,255,255,.06)}

@media (prefers-reduced-motion:reduce){.fh-dot,.fh-fly{animation:none}}

/* ===== 浅色模式增强（必须在文件末尾，避免被全局规则级联覆盖） ===== */
/* ===== 移动端单列堆叠：主列与右侧栏之间的间距（lg 断点以下两列变上下堆叠，Bootstrap 列无垂直间距） ===== */
@media (max-width: 991.98px) {
  aside.col-lg-4 { margin-top: 25px; }
}

/* 页面底色 off-white + 顶部极淡蓝紫氛围光晕，卡片保持白色形成层次 */
:where([data-bs-theme="light"]) body {
    background-color: #f7f4ee;
    background-image:
      radial-gradient(1100px 480px at 12% -8%, rgba(166,124,74,0.055), transparent 62%),
      radial-gradient(900px 420px at 92% -4%, rgba(178,140,92,0.04), transparent 60%),
      radial-gradient(rgba(120,99,68,0.05) 0.65px, rgba(0,0,0,0) 0.65px);
    background-attachment: fixed, fixed, scroll;
    background-size: auto, auto, 5px 5px;
    background-repeat: no-repeat, no-repeat, repeat;
  }

  /* 导航默认态与滚动态同深，避免浅底透出发白 */
:where([data-bs-theme="light"]) .sticky-top,
:where([data-bs-theme="light"]) .sticky-top.scrolled {
    background-color: rgba(30,34,40,0.92);
  }

  /* 文章卡片质感增强 */
:where([data-bs-theme="light"]) .post-outer .card {
    background: linear-gradient(145deg, 
      rgba(255,255,255,1) 0%, 
      rgba(247,242,233,0.9) 50%, 
      rgba(166,124,74,0.05) 100%);
    border: 1px solid rgba(166,124,74,0.2);
    box-shadow: 
      0 1px 2px rgba(16,24,40,0.04),
      0 4px 16px rgba(166,124,74,0.1);
  }
:where([data-bs-theme="light"]) .post-outer:not(:has(.post-content)) .card:hover {
    background: linear-gradient(145deg,
      rgba(255,255,255,1) 0%,
      rgba(247,242,233,0.95) 50%,
      rgba(166,124,74,0.1) 100%);
    border-color: rgba(166,124,74,0.32);
    box-shadow:
      0 2px 4px rgba(16,24,40,0.05),
      0 12px 32px rgba(166,124,74,0.16);
  }
:where([data-bs-theme="light"]) .post-divider {
    background: linear-gradient(to right, rgba(166,124,74,0.28), rgba(166,124,74,0.08), transparent);
  }
  
  /* 侧边栏卡片质感 */
:where([data-bs-theme="light"]) .position-sticky>.card {
    background: linear-gradient(145deg, 
      rgba(253,250,244,1) 0%, 
      rgba(245,240,230,0.92) 100%);
    border: 1px solid rgba(166,124,74,0.14);
    box-shadow: 0 2px 12px rgba(166,124,74,0.08);
  }
  
  /* 标签云质感 */
:where([data-bs-theme="light"]) .label-size {
    background: linear-gradient(135deg, rgba(166,124,74,0.08), rgba(178,140,92,0.05));
    border: 1px solid rgba(166,124,74,0.16);
    border-radius: 16px;
    padding: 4px 12px;
    transition: all 0.3s ease;
  }
:where([data-bs-theme="light"]) .label-size:hover {
    background: linear-gradient(135deg, rgba(166,124,74,0.15), rgba(178,140,92,0.1));
    border-color: rgba(166,124,74,0.32);
    box-shadow: 0 4px 12px rgba(166,124,74,0.15);
    transform: translateY(-1px);
  }
:where([data-bs-theme="light"]) .label-size a { color: var(--primary-color); }
  
  /* 博友列表质感 */
:where([data-bs-theme="light"]) .blog-list-container ul li {
    border-bottom: 1px solid rgba(166,124,74,0.12);
    transition: all 0.2s ease;
  }
:where([data-bs-theme="light"]) .blog-list-container ul li::before {
    background: rgba(166,124,74,0.55);
  }
:where([data-bs-theme="light"]) .blog-list-container ul li:hover {
    background: rgba(166,124,74,0.06);
  }
:where([data-bs-theme="light"]) .blog-list-container ul li:hover::before {
    background: var(--primary-color);
  }
  
  /* 全局卡片适配 */
:where([data-bs-theme="light"]) .card {
    background-color: rgba(253,250,244,0.98);
    border-color: rgba(166,124,74,0.14);
  }
  
  /* 按钮：悬浮用同色淡染加深，不做实心填充硬跳变 */
:where([data-bs-theme="light"]) .btn-outline-primary {
    border-color: rgba(84,155,245,0.3);
    background: rgba(84,155,245,0.05);
    border-radius: 8px;
    font-weight: 500;
  }
:where([data-bs-theme="light"]) .btn-outline-primary:hover {
    background: rgba(84,155,245,0.12);
    border-color: rgba(84,155,245,0.6);
    color: rgb(25,95,185);
    box-shadow: 0 2px 10px rgba(84,155,245,0.16);
  }

  /* 键盘焦点可见环（无障碍，鼠标点击不显示） */
:where([data-bs-theme="light"]) a:focus-visible,
:where([data-bs-theme="light"]) button:focus-visible,
:where([data-bs-theme="light"]) .btn:focus-visible,
:where([data-bs-theme="light"]) input:focus-visible,
:where([data-bs-theme="light"]) .form-control:focus-visible {
    outline: 2px solid rgba(84,155,245,0.7);
    outline-offset: 2px;
    border-radius: 4px;
  }

  /* 热门文章卡：金黄染对齐全站暖色调（暗色由 dark 块覆盖不受影响） */
:where([data-bs-theme="light"]) #BlogPost1 .popular-posts .card {
    background: linear-gradient(145deg, rgba(188,150,25,0.08) 0%, rgba(178,140,92,0.05) 50%, rgba(255,255,255,0.6) 100%);
    border-color: rgba(188,150,25,0.2);
    box-shadow: 0 4px 16px rgba(188,150,25,0.1);
  }
:where([data-bs-theme="light"]) #BlogPost1 .popular-posts .card::before {
    background: linear-gradient(90deg, rgb(188,150,25) 0%, rgb(178,140,92) 100%);
  }
:where([data-bs-theme="light"]) #BlogPost1 .popular-posts .card:hover {
    border-color: rgba(188,150,25,0.32);
    box-shadow: 0 8px 28px rgba(188,150,25,0.16);
  }

  /* 宝贝时光机：金黄淡染对齐暖光照片（计时数字/标签恢复模板蓝色系文字，暗色模式由 dark 块覆盖不受影响） */
:where([data-bs-theme="light"]) .bb-time-machine {
    --bb-primary: rgb(188,150,25);
    --bb-number: rgb(84,155,245);
    --bb-bg: linear-gradient(145deg, rgba(188,150,25,0.08) 0%, rgba(178,140,92,0.05) 55%, rgba(255,255,255,0.65) 100%);
    --bb-border: rgba(188,150,25,0.22);
    --bb-text-secondary: rgb(108,117,125);
  }
:where([data-bs-theme="light"]) .bb-card { box-shadow: 0 4px 20px rgba(188,150,25,0.1); }
:where([data-bs-theme="light"]) .bb-card:hover {
    border-color: rgba(188,150,25,0.34);
    box-shadow: 0 8px 28px rgba(188,150,25,0.16);
  }
:where([data-bs-theme="light"]) .bb-media { background: linear-gradient(180deg, #faf6ec 0%, #efe5d0 100%); }
:where([data-bs-theme="light"]) .bb-media::after {
    background: linear-gradient(to top, rgba(58,42,14,0.62) 0%, rgba(58,42,14,0.22) 50%, transparent 100%);
  }
:where([data-bs-theme="light"]) .bb-clock {
    background: rgba(48,36,16,0.82);
    box-shadow: 0 2px 12px rgba(58,42,14,0.35);
  }
:where([data-bs-theme="light"]) .bb-title { text-shadow: 0 2px 8px rgba(40,28,8,0.85); }
:where([data-bs-theme="light"]) .bb-timer-number { color: var(--bb-number); }

/* ===== 博友列表页头像尺寸锁死（防外链大图/模板全局 img 规则把头像撑超模）===== */
.friends-grid .friend-card img { max-width: 56px !important; max-height: 56px !important; width: 56px !important; height: 56px !important; }
.my-info .info-header img { max-width: 52px !important; max-height: 52px !important; width: 52px !important; height: 52px !important; }
@media (max-width: 767px) {
  .friends-grid .friend-card img { max-width: 48px !important; max-height: 48px !important; width: 48px !important; height: 48px !important; }
}

/* =========================================================================
   文章排版组件 v2
   章节标题(h2.sec) / 导语(.lede) / 工具卡片(.tool-card)
   原则：沿用主题变量 --primary-color；仅作用于 .post-content 内
   ========================================================================= */

/* --- 章节标题：编号徽章 + 标题文字 + 底部细线 --- */
.post-content h2.sec {
  display: flex;
  align-items: center;
  gap: .55em;
  margin: 2.1em 0 1.15em;
  padding: 0 0 .55em;
  border: 0;
  border-bottom: 1px solid var(--border-light);
  background: none;
  font-size: 1.22em;
  font-weight: 700;
  line-height: 1.5;
  text-indent: 0;
  color: inherit;
}
.post-content h2.sec .sec-num {
  flex: 0 0 auto;
  min-width: 1.75em;
  height: 1.75em;
  padding: 0 .4em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: .6em;
  background: rgba(84,155,245,.13);
  border: 1px solid rgba(84,155,245,.3);
  color: var(--primary-color);
  font-size: .8em;
  font-weight: 700;
  line-height: 1;
}

/* --- 导语：首段放大、取消缩进 --- */
/* 编号徽章与标题之间的间隔号 */
.post-content h2.sec .sec-num { position: relative; }
.post-content h2.sec .sec-num::after {
  content: "\00B7";
  position: absolute;
  left: calc(100% + .3em);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 1em;
  font-weight: 400;
}

.post-content .lede {
  text-indent: 0;
  font-size: 1.06em;
  line-height: 1.9;
  margin-bottom: 1.5em;
}

/* --- 工具卡片：小工具推荐（图标 + 名称 + 描述 + 箭头） --- */
.post-content .tool-card {
  display: flex;
  align-items: center;
  gap: .95em;
  margin: 1.4em 0;
  padding: .95em 1.15em;
  border: 1px solid rgba(84,155,245,.28);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(84,155,245,.1) 0%, rgba(84,155,245,.03) 60%, rgba(255,255,255,.6) 100%);
  background-image: linear-gradient(135deg, rgba(84,155,245,.1) 0%, rgba(84,155,245,.03) 60%, rgba(255,255,255,.6) 100%);
  color: inherit;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease;
}
.post-content a.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(84,155,245,.2);
  color: inherit;
}
.post-content .tool-card .tool-ico {
  flex: 0 0 auto;
  width: 2.7em;
  height: 2.7em;
  border-radius: .85em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgb(84,155,245), rgb(52,120,220));
  color: #fff;
  box-shadow: 0 2px 8px rgba(84,155,245,.35);
}
.post-content .tool-card .tool-ico svg { width: 1.35em; height: 1.35em; }
.post-content .tool-card .tool-text {
  display: flex;
  flex-direction: column;
  gap: .15em;
  min-width: 0;
}
.post-content .tool-card .tool-name { font-weight: 700; font-size: 1.02em; }
.post-content .tool-card .tool-desc {
  font-size: .88em;
  line-height: 1.6;
  color: var(--text-secondary);
}
.post-content .tool-card .tool-go {
  margin-left: auto;
  flex: 0 0 auto;
  color: var(--primary-color);
  font-weight: 700;
  font-size: 1.2em;
  transition: transform .18s ease;
}
.post-content a.tool-card:hover .tool-go { transform: translateX(3px); }

:where([data-bs-theme="dark"]) .post-content h2.sec { border-bottom-color: var(--border-dark); }
:where([data-bs-theme="dark"]) .post-content .tool-card {
    background: rgba(255,255,255,.035);
    background-image: none;
    border-color: var(--border-dark);
  }
:where([data-bs-theme="dark"]) .post-content a.tool-card:hover { box-shadow: 0 8px 22px rgba(0,0,0,.4); }

/* --- 版权条小图标：不受「博文内图片尺寸限制」等通用图片规则影响 ---
   版权条位于 article.post-content 内部，.post-content img 通配规则（含 !important）
   会误伤这里的 14px 行内小图标，此处用更高优先级的例外规则还原 */
.post-content .post-copyright-bar img.copy-symbol {
  width: 14px !important;
  height: 14px !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-block !important;
  vertical-align: middle !important;
  object-fit: fill !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  cursor: default !important;
  opacity: .9;
}
/* 收紧版权文字与小图标之间的间距 */
.post-content .post-copyright-bar .copyright-content { gap: 1px; }

/* 文章内容组件，选择器限定在 .post-content 内 */
/* 明暗模式均适配：浅色用默认，深色用 data-bs-theme=dark 覆盖 */
/* 首字下沉段不参与正文段首缩进（浮动首字与 text-indent:2em 冲突） */
.post-content .bk-dropcap { text-indent: 0; }
/* 组件容器内段落不参与正文段首缩进（缩进只属于正文段落） */
.post-content .bk-takeaways p,
.post-content .bk-grad-card p,
.post-content .bk-dash-card p,
.post-content .bk-timeline p { text-indent: 0; }
.post-content .bk-dropcap::first-letter {
  float: left;
  font-size: 3.2em;
  line-height: 0.85;
  padding-right: 0.12em;
  padding-top: 0.05em;
  font-weight: 800;
  color: #1a73e8;
}
.post-content .bk-quote {
  margin: 1.5em 0;
  padding: 1em 1.2em;
  border-left: 4px solid #1a73e8;
  background: #f6f9ff;
  color: #333;
  font-size: 1.05em;
  line-height: 1.7;
  border-radius: 0 8px 8px 0;
}
.post-content .bk-quote p { margin: 0; }
.post-content .bk-takeaways {
  margin: 1.5em 0;
  padding: 1.2em 1.4em;
  background: #fffbe6;
  border: 1px solid #f0d860;
  border-radius: 10px;
  color: #333;
}
.post-content .bk-takeaways .bk-takeaways-title {
  font-weight: 700;
  margin: 0 0 0.6em 0;
  color: #8a6d00;
}
.post-content .bk-takeaways ul { margin: 0; padding-left: 1.4em; }
.post-content .bk-takeaways li { margin: 0.3em 0; line-height: 1.6; }
.post-content .bk-divider {
  border: none;
  margin: 2em auto;
  width: 60%;
  border-top: 2px dashed #ddd;
}
@media (max-width: 600px) {
  .post-content .bk-dropcap::first-letter { font-size: 2.6em; }
}
/* 暗黑模式适配 */

:where([data-bs-theme="dark"]) .post-content .bk-quote {
    background: #1a2340;
    color: #dbe4ff;
    border-left-color: #5b8cff;
  }
:where([data-bs-theme="dark"]) .post-content .bk-takeaways {
    background: #2a2410;
    border-color: #8a6d00;
    color: #f0e6c8;
  }
:where([data-bs-theme="dark"]) .post-content .bk-takeaways .bk-takeaways-title { color: #f0d060; }
:where([data-bs-theme="dark"]) .post-content .bk-divider { border-top-color: #444; }
  /* 炫酷卡片暗黑版 */
:where([data-bs-theme="dark"]) .post-content .bk-grad-card {
    background: linear-gradient(135deg,#2b2f4a,#3d3a5c) !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4) !important;
  }
:where([data-bs-theme="dark"]) .post-content .bk-grad-card p { color: #dbe0f0 !important; }
:where([data-bs-theme="dark"]) .post-content .bk-grad-card p:first-child { color: #fff !important; }
:where([data-bs-theme="dark"]) .post-content .bk-dash-card {
    background: #221a35 !important;
    border-color: #8b5cf6 !important;
  }
:where([data-bs-theme="dark"]) .post-content .bk-dash-card p:first-child { color: #c4b5fd !important; }
:where([data-bs-theme="dark"]) .post-content .bk-dash-card p:last-child { color: #a8a0c0 !important; }

/* 炫酷卡片基础样式（类名化，替代内联硬编码） */
.post-content .bk-grad-card {
  background: linear-gradient(135deg,#f5f7fa,#c3cfe2);
  border-radius: 12px;
  padding: 1.4em;
  margin: 1.2em 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.post-content .bk-grad-card p { margin: 0; color: #555; }
.post-content .bk-grad-card p:first-child { font-weight: 700; font-size: 1.1em; color: #333; margin-bottom: 0.5em; }
.post-content .bk-dash-card {
  border: 2px dashed #a78bfa;
  border-radius: 12px;
  padding: 1.2em;
  margin: 1.2em 0;
  background: #faf5ff;
}
.post-content .bk-dash-card p { margin: 0; }
.post-content .bk-dash-card p:first-child { color: #7c3aed; font-weight: 600; }
.post-content .bk-dash-card p:last-child { color: #666; font-size: 0.95em; margin-top: 0.5em; }
/* 徽章标签 */
.post-content .bk-badges { display: flex; gap: 12px; flex-wrap: wrap; margin: 1.2em 0; }
.post-content .bk-badge {
  padding: 4px 14px; border-radius: 999px; font-size: 0.85em; font-weight: 600;
}
.post-content .bk-badge-blue { background: #eef2ff; color: #4f46e5; }
.post-content .bk-badge-green { background: #ecfdf5; color: #059669; }
.post-content .bk-badge-red { background: #fef2f2; color: #dc2626; }

:where([data-bs-theme="dark"]) .post-content .bk-badge-blue { background: #2a3560; color: #a5b4fc; }
:where([data-bs-theme="dark"]) .post-content .bk-badge-green { background: #1a3a2e; color: #6ee7b7; }
:where([data-bs-theme="dark"]) .post-content .bk-badge-red { background: #3a1e1e; color: #fca5a5; }

/* =========================================================================
   移动端侧栏抽屉：Bootstrap 5.3 offcanvas-lg
   <992px：右侧滑出抽屉；≥992px：官方规则自动恢复文档流原布局
   抽屉仅 <992px 存在（offcanvas-lg 断点），桌面端不受影响
   ========================================================================= */
/* 导航栏入口按钮（极简风，同 .play-btn 语言） */
/* 抽屉态（<992px） */
@media (max-width: 991.98px) {
  /* 移动端：侧栏抽屉（右侧滑出，z-index 低于吸顶导航栏，顶部被导航栏压住无缝衔接） */
  #blogSidebar {
    --bs-offcanvas-width: min(80vw, 350px);
    z-index: 1019; /* header.sticky-top = 1020，压住抽屉顶部（无缝） */
    margin-top: 0; /* 覆盖 aside.col-lg-4 的移动端堆叠间距，否则 fixed 抽屉被下推 25px */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 64px 10px 8px; /* 顶部兜底吸顶导航高度 + 8px 呼吸空间（JS 按实际高度覆盖） */
    box-shadow: -10px 0 36px rgba(0,0,0,.4);
  }
  .offcanvas-backdrop { z-index: 1018; } /* 遮罩同步降到导航栏之下，导航栏保持明亮可点 */
  #blogSidebar .position-sticky { zoom: 0.9; } /* 内容整体缩放 90% */
  #blogSidebar .drawer-nav { zoom: 0.9; }
  /* 工具行按钮均分占满抽屉宽度 */
  #blogSidebar .drawer-tools { flex-wrap: nowrap; justify-content: space-between; gap: 7px; } /* 不写 display：默认 none 由基础规则控制，⋯ 按钮切换 */
  #blogSidebar .drawer-tools > a, #blogSidebar .drawer-tools > button { flex: 1 1 0; min-width: 0; } /* 导航区同比例缩放，与下方内容视觉统一（搜索框逻辑字号保持 16px 防 iOS 聚焦放大） */
  #blogSidebar .position-sticky > .card { margin-bottom: 0 !important; } /* 对齐 Bootstrap mb-4 工具类，滚到底无多余空白 */
  /* 抽屉内标签云压缩：flex 换行消除空白间隙，一行排 3 个（PC 值在桌面侧栏不受影响） */
  #blogSidebar .widget-content.cloud-label-widget-content { display: flex; flex-wrap: wrap; align-items: flex-start; align-content: flex-start; gap: 6px; line-height: 1.4; margin: 0.6rem 0; }
  /* 标签云容器是 flex：Blogger 挂在 widget-content 末尾的 <hr> 会被压成 0 宽（移动端分割线消失），强制独占一行 */
  #blogSidebar .widget-content.cloud-label-widget-content > hr {
    flex: 0 0 100%;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
  #blogSidebar .label-size { margin: 0; padding: 3px 9px; border-radius: 13px; }
  #blogSidebar .label-size-1 { font-size: 11px; }
  #blogSidebar .label-size-2 { font-size: 12px; }
  #blogSidebar .label-size-3 { font-size: 13px; }
  #blogSidebar .label-size-4 { font-size: 14.5px; }
  #blogSidebar .label-size-5 { font-size: 16px; }
  #blogSidebar .fh-nums { min-width: 104px; padding: 5px 8px; } /* 抽屉内数据块收窄留白，给状态胶囊腾空间 */
  #blogSidebar .fh-pill { font-size: 11px; padding: 2px 7px; gap: 4px; white-space: nowrap; } /* 状态胶囊压小、强制单行 */
  #blogSidebar .fh-sub { font-size: 9.5px; margin-top: 4px; }
  #blogSidebar .fh-nrow { font-size: 8.5px; }
  #blogSidebar .fh-nv { font-size: 10px; }
  #blogSidebar .hw-stats-row { gap: 4px; }
  #blogSidebar .hw-stat-val { font-size: 12px; }
  #blogSidebar .offcanvas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 4px 6px;
  }
}

/* 浅色模式适配 */

:where([data-bs-theme="light"]) #blogSidebar { box-shadow: 10px 0 36px rgba(0,0,0,.14); }

/* =========================================================================
   BS 5.3 变量桥接：站内主题色 → --bs-* 变量
   效果：offcanvas/backdrop/modal 等一切 BS 组件自动吃站内主题色
   html 的 data-bs-theme 由模板 head 内联脚本设置（跟随系统或手动切换）
   ========================================================================= */
:root {
  --bs-body-bg: var(--bg-dark);
  --bs-body-bg-rgb: 34, 39, 46;
  --bs-body-color: #ADBAC7;
  --bs-body-color-rgb: 173, 186, 199;
  color-scheme: dark;
}
[data-bs-theme="light"] {
  --bs-body-bg: #f7f4ee;
  --bs-body-bg-rgb: 247, 244, 238;
  --bs-body-color: #24292f;
  --bs-body-color-rgb: 36, 41, 47;
  color-scheme: light;
}

/* ===== 深浅切换按钮：导航栏恒暗底，配色不随主题；图标按 data-bs-theme 显隐 ===== */
.theme-toggle-btn { color: #549bf5; border-color: rgba(84,155,245,.35); background: transparent; }
@media (hover: hover) {
  .theme-toggle-btn:hover { color: #7ab8ff; border-color: rgba(84,155,245,.65); background: rgba(84,155,245,.12); }
}
.theme-toggle-btn:focus { box-shadow: none; outline: none; background: transparent; }
.theme-toggle-btn:focus-visible { box-shadow: 0 0 0 2px rgba(84,155,245,.5); outline: none; }
.theme-icon-to-dark { display: none; }              /* 暗色模式：只显示太阳（点击切亮） */
[data-bs-theme="light"] .theme-icon-to-dark { display: inline-block; }   /* 亮色模式：显示月亮 */
[data-bs-theme="light"] .theme-icon-to-light { display: none; }

/* ===== 抽屉内导航区（<992px；深浅走变量自动适配） ===== */
@media (max-width: 991.98px) {
  .drawer-nav { margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,.08); }
  .drawer-search { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
  .drawer-search input {
    flex: 1;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.12);
    color: #ADBAC7;
    padding: 7px 11px;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
  }
  .drawer-search input::placeholder { color: rgba(173,186,199,.55); }
  .drawer-search input:focus { border-color: rgba(84,155,245,.55); }
  .drawer-search button {
    border: none;
    background: rgba(255,255,255,.06);
    color: #ADBAC7;
    width: 34px; height: 34px;
    border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
  }
  .drawer-search button:hover { background: rgba(255,255,255,.12); color: #fff; }
  .drawer-links { display: flex; align-items: center; justify-content: space-between; padding: 0 2px; }
  .drawer-tools {
    display: none;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 0;
    padding: 8px 2px 2px;
    border-top: 1px solid rgba(255,255,255,.07);
  }
  .drawer-tools.open { display: flex; animation: drawerToolsIn .18s ease-out; }
  .drawer-tools a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 6px;
    background: transparent;
    color: #ADBAC7;
    text-decoration: none;
    transition: color .15s, background .15s, border-color .15s;
  }
  .drawer-tools a:hover {
    color: #fff;
    background: rgba(130,140,150,.15);
    border-color: rgba(255,255,255,.45);
  }
  .drawer-ai-text { font-size: 12px; font-weight: 700; margin-left: 3px; }
  .drawer-more-btn {
    border: none;
    background: transparent;
    color: rgba(173,186,199,.6);
    font-size: 16px;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 6px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: color .15s, background .15s;
  }
  @media (hover: hover) {
    .drawer-more-btn:hover { color: #fff; background: rgba(255,255,255,.06); }
  }
  @keyframes drawerToolsIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
  .drawer-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 5px;
    border-radius: 6px;
    color: #ADBAC7;
    text-decoration: none;
    font-size: 13px;
    transition: background .15s, color .15s;
  }
  .drawer-links a svg { opacity: .62; transition: opacity .15s, color .15s; flex: 0 0 auto; }
  .drawer-links a:hover svg { opacity: 1; color: #549bf5; }
  .drawer-links a:hover { background: rgba(255,255,255,.06); color: #fff; }
}
:where([data-bs-theme="light"]) .drawer-search input { background: rgba(0,0,0,.03); border-color: rgba(0,0,0,.12); color: #24292f; }
:where([data-bs-theme="light"]) .drawer-search input::placeholder { color: rgba(36,41,47,.45); }
:where([data-bs-theme="light"]) .drawer-search button { background: rgba(0,0,0,.05); color: #57606a; }
:where([data-bs-theme="light"]) .drawer-search button:hover { background: rgba(0,0,0,.1); color: #24292f; }
:where([data-bs-theme="light"]) .drawer-links a { color: #24292f; }
:where([data-bs-theme="light"]) .drawer-links a:hover { background: rgba(0,0,0,.06); color: #000; }
@media (prefers-reduced-motion: reduce) {
  .drawer-tools.open { animation: none; }
}
:where([data-bs-theme="light"]) .drawer-more-btn { color: rgba(36,41,47,.5); }
:where([data-bs-theme="light"]) .drawer-more-btn:hover, :where([data-bs-theme="light"]) .drawer-more-btn.active { color: #24292f; background: rgba(0,0,0,.05); }
:where([data-bs-theme="light"]) .drawer-tools { border-top-color: rgba(0,0,0,.09); }
:where([data-bs-theme="light"]) .drawer-tools a { border-color: rgba(0,0,0,.22); color: #57606a; }
:where([data-bs-theme="light"]) .drawer-tools a:hover { background: rgba(0,0,0,.05); border-color: rgba(0,0,0,.4); color: #24292f; }
:where([data-bs-theme="light"]) .drawer-nav { border-bottom-color: rgba(0,0,0,.09); }

/* ===== 深浅按钮 hover 提示（纯 CSS；仅支持 hover 的设备显示，移动端 tap 永不触发） ===== */
.theme-toggle-btn { position: relative; }
@media (hover: hover) {
  .theme-toggle-btn:hover::after {
    content: '深浅模式';
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #2d333b;
    color: #ADBAC7;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,.3);
    z-index: 2000;
    animation: themeTipIn .15s ease-out;
    pointer-events: none;
  }
}
@keyframes themeTipIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .theme-toggle-btn:hover::after { animation: none; }
}

/* ===== navbar-toggler 点击后 focus 残留清理（键盘 focus-visible 保留） ===== */
.navbar-toggler:focus { box-shadow: none; outline: none; }
.navbar-toggler:focus-visible { box-shadow: 0 0 0 2px rgba(84,155,245,.5); outline: none; }

/* ===== AI 客服弹窗浅色适配（默认深色规则原样不动） ===== */
:where([data-bs-theme="light"]) .ai-chat-box { background: #fdfcf9; border-color: rgba(0,0,0,.1); box-shadow: 0 10px 50px rgba(0,0,0,.18); }
:where([data-bs-theme="light"]) .chat-header { background: #f3efe7; color: #24292f; }
:where([data-bs-theme="light"]) .chat-body { background: #faf8f4; scrollbar-color: rgba(0,0,0,.25) transparent; }
:where([data-bs-theme="light"]) .chat-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,.2); }
:where([data-bs-theme="light"]) .chat-body::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.35); }
:where([data-bs-theme="light"]) .msg-content { color: #24292f; }
:where([data-bs-theme="light"]) .ai-message .msg-content { background: #efe9de; }
:where([data-bs-theme="light"]) .user-message .msg-content { background: #4f46e5; color: #fff; }
:where([data-bs-theme="light"]) .chat-footer { background: #f3efe7; border-top: 1px solid rgba(0,0,0,.08); }
:where([data-bs-theme="light"]) .chat-input { background: #fff; border-color: rgba(0,0,0,.15); color: #24292f; }
:where([data-bs-theme="light"]) .chat-send-btn { background: #24292f; color: #fff; }
:where([data-bs-theme="light"]) .chat-close-btn { color: #57606a; }

/* ===== 移动端深浅切换按钮（与播放器按钮统一极简风格） ===== */
.theme-toggle-mobile {
  border: none;
  background: transparent;
  color: #549bf5;
  padding: 2px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color .2s, background .2s;
}
@media (hover: hover) {
  .theme-toggle-mobile:hover { color: #7ab8ff; background: rgba(84,155,245,.12); }
}
.theme-toggle-mobile:active { transform: scale(.94); }
/* 移动端导航栏：汉堡贴左 + 右侧图标组（音乐/AI客服/深浅）统一 32px 间距 8px */
@media (max-width: 1199.98px) {
  .navbar { padding-left: 0; padding-right: 0; }
  .navbar .container-fluid { padding-left: 0; padding-right: 12px; }
  /* 汉堡/深浅/音乐按钮的尺寸统一由下方 1199.98px 第二段（40px 触控区）负责，此处只保留形态声明 */
  .navbar-toggler {
    padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: none; background: transparent; border-radius: 6px;
  }
  .navbar-toggler-icon { width: 20px; height: 20px; }
  .hdr-actions { margin-left: auto; gap: 8px; }
  .hdr-actions > * { margin: 0 !important; }
  .theme-toggle-mobile, .mobile-player .play-btn {
    padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: none; background: transparent; border-radius: 6px;
  }
  /* AI 客服：与抽屉工具行按钮同款（方形描边 + 16px 图标 + AI 文字） */
  .hdr-ai-btn {
    padding: 5px 10px; margin-right: 12px !important;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255,255,255,.28); border-radius: 6px;
    background: transparent; color: #ADBAC7;
    line-height: 1;
    cursor: pointer; transition: color .15s, border-color .15s, background .15s;
  }
  .hdr-ai-text { font-size: 12px; font-weight: 700; margin-left: 3px; }
}
@media (max-width: 1199.98px) and (hover: hover) {
  .hdr-ai-btn:hover { color: #7ab8ff; border-color: rgba(84,155,245,.6); background: rgba(84,155,245,.08); }
}
@media (max-width: 1199.98px) and (hover: none) {
  .hdr-ai-btn:active { background: rgba(84,155,245,.14); }
}

/* ===== 导航栏：统一图标按钮 / 当前页指示 / 搜索 / 移动端 logo 与触控 ===== */
@media (min-width: 1200px) {
  /* 链接：去掉常驻橙色，当前页 = 亮字 + 蓝色短线 */
  .navbar .navbar-nav.flex-row > a.nav-link {
    position: relative;
    color: rgba(205,217,229,.66) !important;
    font-size: 14.5px; font-weight: 500; letter-spacing: .02em;
    padding-top: 9px; padding-bottom: 7px;
    transition: color .2s;
  }
  .navbar .navbar-nav.flex-row > a.nav-link:hover { color: #e6edf3 !important; }
  .navbar .navbar-nav.flex-row > a.nav-link.is-current { color: #fff !important; }
  .navbar .navbar-nav.flex-row > a.nav-link.is-current::after {
    content: ''; position: absolute; left: 50%; bottom: 2px;
    width: 14px; height: 2px; margin-left: -7px; border-radius: 2px;
    background: #549bf5; box-shadow: 0 0 6px rgba(84,155,245,.6);
  }
  /* 右侧图标按钮：统一细描边 + 灰色图标，悬停才显示品牌色 */
  .navbar .navbar-nav.flex-wrap .btn,
  .navbar .btn-ai-nav,
  .navbar .theme-toggle-btn:not(.theme-toggle-mobile) {
    --nb-c: #e6edf3;
    width: 34px; height: 34px !important; padding: 0 !important;
    margin: 0 0 0 6px !important;
    display: inline-flex !important; align-items: center; justify-content: center;
    border: 1px solid rgba(205,217,229,.14) !important; border-radius: 8px !important;
    background: transparent !important; color: #8b949e !important;
    box-shadow: none !important; transform: none !important;
    transition: color .18s, border-color .18s, background-color .18s !important;
  }
  .navbar .btn-ai-nav { width: auto !important; padding: 0 10px !important; }
  .navbar .btn-ai-nav .ai-btn-content { display: inline-flex; flex-direction: row; align-items: center; gap: 4px; }
  .navbar .btn-ai-nav svg { width: 13px; height: 13px; }
  .navbar .btn-ai-nav .ai-text { font-size: 12px; font-weight: 600; letter-spacing: .03em; }
  .navbar .navbar-nav.flex-wrap .btn svg,
  .navbar .theme-toggle-btn:not(.theme-toggle-mobile) svg { width: 15px; height: 15px; }
  .navbar .navbar-nav.flex-wrap .btn.orange { --nb-c: #ff6b6b; }
  .navbar .navbar-nav.flex-wrap .btn.line-green { --nb-c: #03C755; }
  .navbar .navbar-nav.flex-wrap .btn.GitHub-white { --nb-c: #f0f6fc; }
  .navbar .navbar-nav.flex-wrap .btn.purple { --nb-c: #A96FFF; }
  .navbar .btn-ai-nav { --nb-c: #8b9cff; }
  .navbar .theme-toggle-btn:not(.theme-toggle-mobile) { --nb-c: #549bf5; }
  .navbar .navbar-nav.flex-wrap .btn:hover,
  .navbar .btn-ai-nav:hover,
  .navbar .theme-toggle-btn:not(.theme-toggle-mobile):hover {
    color: var(--nb-c) !important;
    border-color: color-mix(in srgb, var(--nb-c) 55%, transparent) !important;
    background: color-mix(in srgb, var(--nb-c) 10%, transparent) !important;
  }
  .navbar .theme-toggle-btn:not(.theme-toggle-mobile):hover::after { display: none; }
  /* 音乐：32px 热区，与图标对齐 */
  #pcPlayer .play-btn { width: 32px; height: 32px; border-radius: 8px; }
  #pcPlayer .play-btn:hover { background: rgba(205,217,229,.06); }
  /* 搜索：200px，放大镜内嵌，32px 高 */
  .navbar form[action='/search'] { margin: 0 4px 0 0 !important; }
  .navbar form[action='/search'] .input-group { position: relative; width: 200px; flex-wrap: nowrap; }
  .navbar .form-control.search {
    height: 32px; padding: 0 10px 0 30px; font-size: 13px;
    border-radius: 8px !important; max-width: none;
    background-color: rgba(205,217,229,.06) !important;
    border: 1px solid rgba(205,217,229,.12) !important; color: #cdd9e5 !important;
  }
  .navbar .form-control.search::placeholder { color: rgba(205,217,229,.42); }
  .navbar form[action='/search'] button[type=submit] {
    position: absolute; left: 2px; top: 0; z-index: 5;
    width: 28px; height: 32px; padding: 0; border: 0 !important;
    background: transparent !important; color: rgba(205,217,229,.5) !important; box-shadow: none !important;
  }
  .navbar form[action='/search'] button[type=submit] svg { width: 13px; height: 13px; }
}
@media (min-width: 1200px) and (max-width: 1399.98px) {
  .navbar form[action='/search'] .input-group { width: 168px; }
  .navbar .navbar-nav.flex-wrap .btn, .navbar .btn-ai-nav,
  .navbar .theme-toggle-btn:not(.theme-toggle-mobile) { margin-left: 4px !important; }
}
@media (min-width: 1400px) {
  #pcPlayer { margin-left: 20px; margin-right: 14px; }
}

@media (max-width: 1199.98px) {
  /* 40px 触控区，图标尺寸不变，栏高仍 48 */
  .navbar { padding-top: 4px; padding-bottom: 4px; }
  .hdr-actions { gap: 2px; }
  .navbar-toggler { width: 40px; height: 40px; margin-left: -13px; }
  .theme-toggle-mobile, .mobile-player .play-btn { width: 40px; height: 40px; }
  /* AI 按钮：磨砂小方片 + 渐变字（变体 C） */
  .hdr-ai-btn {
    position: relative; height: 26px; padding: 0 8px 0 7px;
    margin-right: 6px !important; gap: 4px;
    border: 0; border-radius: 8px;
    background: rgba(255,255,255,.05);
    box-shadow: inset 0 0 0 .5px rgba(255,255,255,.16), inset 0 1px 0 rgba(255,255,255,.06);
    color: #8b949e;
  }
  .hdr-ai-btn::after { content: ''; position: absolute; inset: -7px -3px; }
  .hdr-ai-btn svg { width: 12px; height: 12px; color: #8b949e; }
  .hdr-ai-text {
    font-size: 11px; font-weight: 700; letter-spacing: .04em; margin-left: 0;
    background: linear-gradient(90deg,#7ab8ff,#b48cff);
    -webkit-background-clip: text; background-clip: text; color: transparent;
  }
}
@media (max-width: 1199.98px) and (hover: hover) {
  .hdr-ai-btn:hover {
    border: 0; background: rgba(255,255,255,.08);
    box-shadow: inset 0 0 0 .5px rgba(122,184,255,.35), inset 0 1px 0 rgba(255,255,255,.08);
  }
}

/* 桌面 AI 按钮：与移动端变体 C 统一（磨砂小方片 + 渐变 AI），略宽 */
@media (min-width: 1200px) {
  .navbar .navbar-nav #aiChatToggle.btn-ai-nav {
    width: auto !important; padding: 0 12px 0 11px !important;
    background: rgba(255,255,255,.05) !important;
    border: 1px solid rgba(205,217,229,.14) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.06) !important;
    color: #8b949e !important;
  }
  .navbar .navbar-nav #aiChatToggle.btn-ai-nav .ai-btn-content { gap: 5px; }
  .navbar .navbar-nav #aiChatToggle.btn-ai-nav svg { width: 13px; height: 13px; color: #8b949e; transition: color .18s; }
  .navbar .navbar-nav #aiChatToggle.btn-ai-nav .ai-text {
    font-size: 12px; font-weight: 700; letter-spacing: .05em;
    background: linear-gradient(90deg,#7ab8ff,#b48cff);
    -webkit-background-clip: text; background-clip: text; color: transparent !important;
  }
  .navbar .navbar-nav #aiChatToggle.btn-ai-nav:hover {
    background: rgba(139,156,255,.1) !important;
    border-color: rgba(139,156,255,.5) !important;
  }
  .navbar .navbar-nav #aiChatToggle.btn-ai-nav:hover svg { color: #a5b4ff; }
}

/* ===== 模板行内样式收编 ===== */
.nav-avatar-link { display: block; border-radius: 13%; }
.ai-chat-wrapper { display: inline-block; }
#aiChatBox { display: none; }
.comment-favicon { margin-bottom: -2px; }
.arrow-gap { margin-right: 4px; }
.sidebar-sticky-top { top: 5rem; }
.flag-icon { vertical-align: text-top; height: 1.2em; margin-left: 1px; position: relative; }

/* 猫猫挂件移动端缩小，防压卡片按钮 */
@media (max-width: 768px) {
  #maomao { width: 42px; height: 52px; bottom: 26px; right: -6px; opacity: .85; }
}

/* ===== 博友动态侧栏（FCLite 数据源） ===== */
#fcl-list { padding-left: 0; list-style: none; margin-bottom: 0; }
#fcl-list .fcl-avatar { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; vertical-align: -4px; border: 1px solid rgba(0,0,0,0.08); }

#fcl-list .blog-title-link { gap: 4px; }
/* 骨架占位：数据加载前撑出 5 条框架，防布局跳动 */
#fcl-list li.fcl-skeleton { display: block; min-height: 58px; }
#fcl-list li.fcl-skeleton .sk-line { display: block; height: 13px; border-radius: 6px; background: rgba(0,0,0,0.07); margin: 6px 0; width: 62%; animation: fclPulse 1.6s ease-in-out infinite; }
#fcl-list li.fcl-skeleton .sk-line.short { width: 84%; opacity: 0.7; }
#fcl-list li.fcl-skeleton .sk-avatar { display: inline-block; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,0.07); vertical-align: -6px; margin-right: 6px; animation: fclPulse 1.6s ease-in-out infinite; }
@keyframes fclPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { #fcl-list li.fcl-skeleton .sk-line, #fcl-list li.fcl-skeleton .sk-avatar { animation: none; } }

:where([data-bs-theme="dark"]) #fcl-list li.fcl-skeleton .sk-line,
:where([data-bs-theme="dark"]) #fcl-list li.fcl-skeleton .sk-avatar { background: rgba(255,255,255,0.09); }

/* ===== 导航 Logo：等高共渐变版（2026-11-01）===== */
.ek-logo {
  display: inline-flex;
  align-items: center;
  position: relative;
  padding: 0.32em 0.8em;
  gap: 0.28em;
  font-family: var(--font-stack);
  font-size: clamp(1rem, 2.6vw, 1.1rem);
  text-decoration: none;
  line-height: 1;
  -webkit-user-select: none;
  user-select: none;
}

/* 四角括角：原样保留 */
.ek-logo::before,
.ek-logo::after {
  content: '';
  position: absolute;
  width: 0.82em;
  height: 0.82em;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1.5px solid rgba(255, 255, 255, 0.7);
}
.ek-logo::before { top: -2px; left: -2px; border-right: none; border-bottom: none; }
.ek-logo::after { bottom: -2px; right: -2px; border-left: none; border-top: none; }

/* 奕奕：800 → 700，渐变保留 */
.ek-logo .logo-cn {
  font-weight: 800;
  letter-spacing: 0.04em;
  transition: filter 0.2s ease;
  background: linear-gradient(94deg, #79b8ff 0%, #549bf5 45%, #59d4ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* 圆点：保留，略缩小 */
.ek-logo .logo-dot {
  width: 0.24em;
  height: 0.24em;
  border-radius: 50%;
  background: #f0883e;
  flex: none;
}

/* Blog：与中文同字号光学等高，共用同一条渐变；padding-bottom 扩渐变绘制区保 g 降部可见 */
.ek-logo .logo-en {
  font-size: 1em;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding-bottom: 0.22em;
  margin-bottom: -0.22em;
  transition: filter 0.2s ease;
  background: linear-gradient(94deg, #79b8ff 0%, #549bf5 45%, #59d4ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@media (hover: hover) {
  .ek-logo:hover::before,
  .ek-logo:hover::after { width: calc(100% + 8px); height: calc(100% + 8px); }
  .ek-logo:hover .logo-cn,
  .ek-logo:hover .logo-en { filter: brightness(1.15); }
}

/* 触屏按下反馈：按下瞬间生效，松开即消失（不粘滞） */
.ek-logo:active::before,
.ek-logo:active::after { width: calc(100% + 8px); height: calc(100% + 8px); }
.ek-logo:active .logo-cn,
.ek-logo:active .logo-en { filter: brightness(1.15); }

/* 触屏点击反馈：括角展开→停留→收回；渐变文字下 color 动画会破坏渐变，
   旧 logo-tap-en 已删除，英文也走 filter 发光。类名钩子与 blog-all.js 兼容 */
@keyframes logo-tap-flash {
  0%   { width: 0.82em; height: 0.82em; }
  30%  { width: calc(100% + 8px); height: calc(100% + 8px); }
  65%  { width: calc(100% + 8px); height: calc(100% + 8px); }
  100% { width: 0.82em; height: 0.82em; }
}
@keyframes logo-tap-glow {
  0%, 100% { filter: none; }
  30%, 65% { filter: brightness(1.15); }
}
.ek-logo.logo-tap::before,
.ek-logo.logo-tap::after { animation: logo-tap-flash 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.ek-logo.logo-tap .logo-cn,
.ek-logo.logo-tap .logo-en { animation: logo-tap-glow 0.6s ease; }

@media (max-width: 1199.98px) {
  .ek-logo { padding: 0.22em 0.5em; gap: 0.2em; }
}

@media (prefers-reduced-motion: reduce) {
  .ek-logo::before,
  .ek-logo::after { transition: none; }
  .ek-logo .logo-cn,
  .ek-logo .logo-en { transition: none; }
  .ek-logo.logo-tap::before,
  .ek-logo.logo-tap::after,
  .ek-logo.logo-tap .logo-cn,
  .ek-logo.logo-tap .logo-en { animation: none; }
}

/* ===== 侧栏排版：首页与文章页共用同一套间距（侧栏是同一个组件，不该两页不一致） ===== */
@media (min-width: 992px) {
  aside.col-lg-4 .position-sticky > .card {
    padding: 32px 24px 22px !important;
  }
  /* About 描述：行距撑开，底部分隔线（必须 !important：上面 .about-widget 有 border:none !important） */
  aside.col-lg-4 .about-widget {
    line-height: 2;
    margin-bottom: 0;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--bb-border, rgba(0,0,0,0.08)) !important;
  }
  /* 各区块标题的段距（首标题不留上边距） */
  aside.col-lg-4 .position-sticky > .card h4.fw-bold {
    margin-top: 24px !important;
    margin-bottom: 14px !important;
  }
  aside.col-lg-4 .position-sticky > .card > h4.fw-bold {
    margin-top: 0 !important;
  }
  /* 标签云行距；margin-top 16 清零，使标题→标签云与其他区块统一为 14px */
  aside.col-lg-4 .cloud-label-widget-content {
    line-height: 2.1;
    margin-top: 0;
  }
  /* 时光机上间距同 14px */
  aside.col-lg-4 .bb-time-machine {
    margin-top: 14px;
  }
}
