/* ============================================================
   View Transitions（MPA 原生跨页过渡）
   ------------------------------------------------------------
   @view-transition 让多页应用在跳转时自动淡入淡出；
   共享元素（view-transition-name）由各模板内联声明，无需 JS。
   ============================================================ */
@view-transition { navigation: auto; }

::view-transition-old(root) {
  animation-duration: 0.2s;
  animation-timing-function: ease-out;
}
::view-transition-new(root) {
  animation-duration: 0.35s;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}
::view-transition-group(*) {
  animation-duration: 0.35s;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

/* 标签/作者等小元素：飞行时不换行、不形变 */
[style*="view-transition-name:"] {
  display: inline-flex !important;
  align-items: center;
  white-space: nowrap;
}

/* 标题例外：保持块级可换行，否则长标题会被 nowrap 撑出容器 */
h1[style*="view-transition-name:"],
h2[style*="view-transition-name:"],
h3[style*="view-transition-name:"] {
  display: block !important;
  white-space: normal;
}

/* ============================================================
   TechBlog 样式表 v6.0
   ============================================================ */

/* ============================================================
   1. 变量 & 重置
   ============================================================ */
/* 隐藏浏览器的原生滚动条（兼容所有现代浏览器） */
html, body {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

/* 隐藏 Chrome, Safari 和 Opera 的滚动条 */
::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
/* 引入鸿蒙字体 */
@font-face {
  font-family: 'HarmonyOS_Sans';
  src: url('/HarmonyOS_Sans_Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap; /* 让字体加载期间先显示默认字体，不白屏 */
}
:root {
  --hw-red: var(--brand-color, #e60012);
  /* Hover / 深色态主色：由主题色压暗生成，改主题色时自动跟随（原先写死 #c4000f 是 hover 变红的根因） */
  --hw-red-dark: color-mix(in srgb, var(--brand-color, #e60012) 85%, black);
  --hw-white: #ffffff;
  --hw-light-gray: #f5f5f5;
  --hw-dark-gray: #333333;
  --hw-medium-gray: #666666;
  --hw-border: #e6e6e6;

  /* 主题语义变量（亮色） */
  --bg: #ffffff;
  --text: #333333;
  --text-strong: #1a1a1a;
  /* 语义别名：标题主色（供 .ed-header 等使用，避免硬编码色值） */
  --text-main: var(--text-strong);
  --text-secondary: #444444;
  --text-muted: #666666;
  --text-faint: #999999;
  --card-bg: #ffffff;
  --surface-alt: #f5f7fa;
  --surface-muted: #f0f2f5;
  --surface-gray: #ebedef;
  --border: #e6e6e6;
  --border-strong: #d0d0d0;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --header-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  --menu-shadow: 0 8px 28px rgba(0, 0, 0, 0.15);
  /* 页脚：极简浅色（顶部 1px 细边框由 --footer-border 控制） */
  --footer-bg: #f7f8fa;
  --footer-text: #333333;
  --footer-muted: #888888;
  --footer-border: #ebedf0;
  /* 动态主题色别名：跟随 layout 注入的 --brand-color */
  --primary: var(--brand-color, #e60012);
  --accent-soft: color-mix(in srgb, var(--brand-color, #e60012) 8%, transparent);
  color-scheme: light;
}

.dark {
  --bg: #1a1a1a;
  --text: #e8e8e8;
  --text-strong: #f5f5f5;
  /* 语义别名：标题主色（暗色模式跟随 --text-strong） */
  --text-main: var(--text-strong);
  --text-secondary: #cccccc;
  --text-muted: #b0b0b0;
  --text-faint: #8f8f8f;
  --card-bg: #242424;
  --surface-alt: #202020;
  --surface-muted: #2f2f2f;
  --surface-gray: #222222;
  --border: #3d3d3d;
  --border-strong: #4a4a4a;
  --shadow: 0 2px 8px rgba(0,0,0,0.4);
  --header-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  --menu-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
  --footer-bg: #161616;
  --footer-text: #e8e8e8;
  --footer-muted: #9a9a9a;
  --footer-border: #2a2a2a;
  --accent-soft: color-mix(in srgb, var(--brand-color, #e60012) 22%, transparent);
  --hw-border: #3d3d3d;
  --hw-light-gray: #2f2f2f;
  --hw-medium-gray: #b0b0b0;
  --hw-dark-gray: #b0b0b0;
  color-scheme: dark;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  /* 把鸿蒙字体放在最前面 */
  font-family: 'HarmonyOS_Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* 仅在用户主动切换主题时启用过渡，避免首屏加载时产生闪烁 */
html.theme-transition body {
  transition: background 0.3s, color 0.3s;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================================
   2. Header 导航（PC 横向 + 移动端汉堡）
   ============================================================ */
/* ============================================================
   2.1 根元素防抖动（终极绝杀：隐藏滚动条）
   ============================================================ */
/* 【修改点】删掉了 overflow-y: scroll; 改为全局隐藏滚动条，彻底断绝宽度变化 */
html, body {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}
html::-webkit-scrollbar, 
body::-webkit-scrollbar {
  display: none;  /* Chrome, Safari, Opera */
  width: 0;
  height: 0;
}

/* ============================================================
   2.2 Header 导航（恢复原本的自然高度）
   ============================================================ */
header {
  background: var(--bg);
  /* 阴影代替 border，不占空间，完美解决上下跳动 */
  box-shadow: var(--header-shadow), 0 2px 0 var(--hw-red);
  border-bottom: none !important;

  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  /* 绝对不要在这里锁 height: 64px，让内部的 container 自己撑开 */
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* 恢复你原本的上下 padding */
  padding: 18px 0;
  gap: 40px;
  width: 100%; /* 确保撑满 */
  box-sizing: border-box;
}

/* ============================================================
   2.3 Hero 模式下的样式（只变颜色，不变骨架）
   ============================================================ */
body.has-hero header {
  background: transparent !important;
  box-shadow: none !important;
  position: sticky !important; /* 依然是 sticky，不脱离文档流 */
}

/* 只有文字变白，背景变透明 */
body.has-hero header .logo, 
body.has-hero header .logo i,
body.has-hero header .pc-nav a,
body.has-hero header .nav-right button {
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}


.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
  gap: 40px;
}

.logo {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--hw-red);
  flex-shrink: 0;
}

.logo i {
  margin-right: 8px;
}

.pc-nav {
  display: flex;
  gap: 36px;
  flex: 1;
  justify-content: center;
  align-items: center;
}

.pc-nav a {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 400;
  padding: 6px 0;
  position: relative;
  transition: color 0.25s;
  white-space: nowrap;
}

.pc-nav a:hover {
  color: var(--hw-red);
}

.pc-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 100%;
  height: 2px;
  background: var(--hw-red);
  transition: transform 0.25s;
  transform-origin: center;
}

.pc-nav a:hover::after {
  transform: translateX(-50%) scaleX(1);
}

.nav-right {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}

.nav-right button {
  background: none;
  border: none;
  font-size: 1.15rem;
  cursor: pointer;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

.nav-right button:hover {
  background: var(--hw-light-gray);
  color: var(--hw-red);
}

.menu-toggle {
  display: none;
}

/* ============================================================
   2.4 全屏汉堡菜单（移动端）
   ============================================================ */
.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh; /* 适配移动端动态视口 */
  
  /* 默认白底 */
  background: var(--bg);
  
  /* 必须压过 header：导航在文件末尾被提到 z-index:10000 !important，
     菜单取 10001 才能完整覆盖导航栏，避免菜单自己的头部 / 关闭按钮被导航遮住 */
  z-index: 10001 !important;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.35s;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain; /* 防止内部滚动传递到外层 */
  visibility: hidden; /* 隐藏时避免被穿透点击 */
}

/* Hero 模式下点开菜单：保持纯白，无毛玻璃 */
body.has-hero .mobile-menu {
  background: var(--bg) !important;
}

.dark body.has-hero .mobile-menu {
  background: var(--bg) !important;
}

.mobile-menu.show {
  transform: translateX(0);
  visibility: visible;
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--hw-border);
  /* 菜单内容较长时会内部滚动，头部必须吸顶，关闭按钮才始终可见可点 */
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg);
  flex: 0 0 auto;
}

.mobile-menu-header .logo {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--hw-red);
}

.menu-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text);
  cursor: pointer;
  /* 44px 最小触控区，避免手机上点不中 */
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 8px;
  line-height: 1;
  position: relative;
  z-index: 2;
  transition: background-color 0.2s, color 0.2s;
}

.menu-close:hover,
.menu-close:active {
  background: var(--hw-light-gray);
  color: var(--hw-red);
}

.mobile-menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
}

.mobile-menu-list li {
  border-bottom: 1px solid var(--hw-border);
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.mobile-menu.show .mobile-menu-list li:nth-child(1) { transition-delay: 0.08s; opacity: 1; transform: translateX(0); }
.mobile-menu.show .mobile-menu-list li:nth-child(2) { transition-delay: 0.14s; opacity: 1; transform: translateX(0); }
.mobile-menu.show .mobile-menu-list li:nth-child(3) { transition-delay: 0.20s; opacity: 1; transform: translateX(0); }
.mobile-menu.show .mobile-menu-list li:nth-child(4) { transition-delay: 0.26s; opacity: 1; transform: translateX(0); }
.mobile-menu.show .mobile-menu-list li:nth-child(5) { transition-delay: 0.32s; opacity: 1; transform: translateX(0); }
.mobile-menu.show .mobile-menu-list li:nth-child(6) { transition-delay: 0.38s; opacity: 1; transform: translateX(0); }
.mobile-menu.show .mobile-menu-list li:nth-child(7) { transition-delay: 0.44s; opacity: 1; transform: translateX(0); }

.mobile-menu-list li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  font-size: 1.1rem;
  color: var(--text);
  transition: background 0.2s;
}

.mobile-menu-list li a:hover {
  background: var(--hw-light-gray);
}

.mobile-menu-list li a .arrow {
  color: var(--text-faint);
  font-size: 1.4rem;
  font-weight: 300;
}

.mobile-menu-footer {
  display: flex;
  justify-content: center;
  /* 4 个入口（主题 / GitHub / 邮件 / RSS）：窄屏自动换行，不撑破屏幕 */
  flex-wrap: wrap;
  gap: 40px;
  row-gap: 24px;
  padding: 32px 24px;
  border-top: 1px solid var(--hw-border);
}

.circle-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--hw-medium-gray);
  font-size: 0.85rem;
}

.circle-btn i {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--hw-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.2s;
}

.circle-btn:hover i {
  border-color: var(--hw-red);
  color: var(--hw-red);
}

/* ============================================================
   3. 首页 Banner 轮播（圆角 + 无界）
   ============================================================ */
.banner-carousel {
  width: 100%;
  padding: 20px;
  margin: 0;
  box-sizing: border-box;
}

.banner-carousel .carousel-wrapper {
  max-width: 1000px;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
}

.banner-carousel .carousel-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.banner-carousel .carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  box-sizing: border-box;
}

.banner-carousel .slide-image {
  aspect-ratio: 2.5 / 1;
  background-size: cover;
  background-position: center;
  position: relative;
}

.banner-carousel .slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 40%, rgba(0, 0, 0, 0.6));
  display: flex;
  align-items: flex-end;
  padding: 40px 60px;
}

.banner-carousel .slide-overlay h2 {
  color: #fff;
  font-size: 2rem;
  font-weight: 600;
  margin: 0;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.4);
  color: white;
  border: none;
  padding: 12px 18px;
  cursor: pointer;
  z-index: 10;
  border-radius: 50%;
  font-size: 1.3rem;
  transition: background 0.3s;
}

.carousel-btn:hover {
  background: rgba(0, 0, 0, 0.75);
}

.carousel-btn.prev { left: 20px; }
.carousel-btn.next { right: 20px; }

.carousel-dots {
  position: absolute;
  bottom: 15px;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 5;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 0;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  margin: 0 6px;
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
}

.dot.active {
  background: var(--hw-red);
  transform: scale(1.2);
}

/* ============================================================
   4. 首页通用区块
   ============================================================ */
.section { padding: 80px 0; }
.section-light { background: var(--bg); }
.section-gray  { background: var(--surface-gray); }

.section-title {
  text-align: center;
  margin-bottom: 48px;
}

.section-title h2 {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-strong);
  margin: 0 0 8px;
  position: relative;
  display: inline-block;
  padding-bottom: 12px;
}

.section-title h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  background: var(--hw-red);
  border-radius: 2px;
}

.section-title p {
  color: var(--text-faint);
  font-size: 0.9rem;
  margin: 0;
}

/* ============================================================
   4.1 卡片网格（PC 3 列 / 中屏 2 列 / 手机 1 列）
   ============================================================ */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ============================================================
   4.2 卡片（图片大 + 底部紧凑）
   ============================================================ */
.blog-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.blog-card a {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* 图片更大：900 × 600 比例 */
.card-image-wrapper {
  width: 100%;
  aspect-ratio: 900 / 600;
  overflow: hidden;
  position: relative;
  background: var(--surface-muted);
}

.card-image {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-color: var(--surface-muted);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.blog-card:hover .card-image {
  transform: scale(1.06);
}

/* 底部更小：padding 收窄 */
.card-content {
  padding: 14px 16px 16px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.card-meta {
  color: var(--text-faint);
  font-size: 0.75rem;
  margin: 0;
}

/* 标题完整显示，不截断 */
.card-content h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-strong);
  margin: 0;
  line-height: 1.5;
  min-height: 3em;      /* 保证至少两行的高度，让卡片对齐 */
}

.blog-card:hover .card-content h3 {
  color: var(--hw-red);
}

/* ============================================================
   4.3 标签胶囊
   ============================================================ */
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.6;
}

/* ============================================================
   4.4 动态列表
   ============================================================ */
 /* ---------- 动态列表（统一：首页 + 动态页共用） ---------- */
.moments-section {
  padding-bottom: 60px;
}

.moments-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.moment-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--hw-border);
  border-radius: 12px;
  padding: 28px 24px 48px;
  cursor: default;
}

.moment-date {
  color: var(--text-faint);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.moment-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-strong);
  margin: 0 0 12px;
  line-height: 1.5;
  transition: color 0.3s;
}

.moment-card:hover .moment-title {
  color: var(--hw-red);
}

.moment-content {
  color: var(--text);
  line-height: 1.7;
  font-size: 0.95rem;
  white-space: pre-wrap;
}

.moment-card:hover .moment-content {
  animation: momentBounce 0.4s ease;
}

@keyframes momentBounce {
  0%   { transform: translateY(0); }
  40%  { transform: translateY(-4px); }
  100% { transform: translateY(0); }
}

.moment-author {
  position: absolute;
  right: 24px;
  bottom: 20px;
  color: var(--text-faint);
  font-size: 0.78rem;
}
   /* ---------- 动态时间轴（前台动态页专用；不影响首页动态网格） ---------- */
.timeline {
  position: relative;
  max-width: 720px;          /* 卡片整体收窄 */
  margin: 0 auto;
  padding-left: 34px;
}
/* 竖轴 */
.timeline::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 1px;
  background: var(--hw-border);
}
.timeline-item {
  position: relative;
  margin-bottom: 20px;
}
.timeline-item:last-child { margin-bottom: 0; }
/* 轴上的节点圆点 */
.timeline-node {
  position: absolute;
  left: -34px;
  top: 18px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--hw-red);
  box-shadow: 0 0 0 3px var(--bg);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.timeline-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

/* ---------- 时间轴分组标题（年 / 月 / 日） ---------- */
.timeline-year {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-strong);
  margin: 22px 0 10px;
}
.timeline-month {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin: 14px 0 8px;
}
.timeline-day {
  font-size: 0.82rem;
  color: var(--text-faint);
  margin: 10px 0 6px;
}
.timeline-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.timeline-date {
  color: var(--text-faint);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}
.timeline-title {
  color: var(--text-faint);
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.3s;
}
.timeline-content {
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.timeline-author {
  display: block;
  text-align: right;
  margin-top: 8px;
  color: var(--text-faint);
  font-size: 0.8rem;
}
.timeline-pager { margin-top: 28px; margin-bottom: 20px; }

/* ---------- 时间轴悬浮动效（沿用原动态卡片动效） ---------- */
.timeline-item:hover .timeline-card {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.09);
}
.timeline-item:hover .timeline-title {
  color: var(--hw-red);
}
.timeline-card:hover .timeline-content {
  animation: momentBounce 0.4s ease;
}
.timeline-item:hover .timeline-node {
  transform: scale(1.4);
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px color-mix(in srgb, var(--brand-color, #e60012) 16%, transparent);
}

@media (max-width: 768px) {
  .timeline { padding-left: 26px; max-width: 100%; }
  .timeline::before { left: 5px; }
  .timeline-node { left: -26px; width: 10px; height: 10px; box-shadow: 0 0 0 2px var(--bg); }
  .timeline-card { padding: 14px 15px; }
  .timeline-year { margin-left: -26px; }
  .timeline-month, .timeline-day { margin-left: -26px; }
}

   /* 更多动态链接 */
.more-link {
  text-align: right;
  max-width: 1200px;
  margin: 32px auto 0;
  padding: 0;
}

.more-link a {
  color: var(--hw-red);
  font-size: 0.95rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.25s;
}

.more-link a:hover {
  gap: 10px;
}

.more-link a i {
  font-size: 0.75rem;
}

/* ============================================================
   4.5 侧栏笔记入口
   ------------------------------------------------------------
   旧版横向 .notes-container / .notes-grid / .notes-item 已废弃并删除；
   现在复用首页侧栏的 .tag-row，尺寸与悬浮底色完全一致。
   ============================================================ */
.notes-sidebar-item .tag-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.notes-sidebar-item .tag-name i {
  flex-shrink: 0;
  width: 1rem;
  text-align: center;
  font-size: 1rem;
  color: var(--primary);
}

.notes-arrow {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-faint);
  transition: transform 0.2s ease, color 0.2s ease;
}

.notes-sidebar-item:hover .notes-arrow {
  color: var(--primary);
  transform: translateX(2px);
}

/* ============================================================
   4.6 关于我
   ============================================================ */
.about-container {
  display: flex;
  gap: 40px;
  align-items: center;
  max-width: 900px;
  margin: 0 auto;
}

.about-image {
  flex-shrink: 0;
}

.avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--surface-muted);
}

.about-content {
  flex: 1;
  min-width: 0;
}

.about-content p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin: 0 0 12px;
  font-size: 0.95rem;
}

/* 4.7 通用空状态 */
.empty-hint {
  text-align: center;
  color: var(--text-faint);
}

/* ============================================================
   5. 文章列表页
   ============================================================ */
.posts-hero {
  padding: 60px 0 40px;
  text-align: center;
  border-bottom: 1px solid var(--hw-border);
  margin-bottom: 32px;
}
.posts-hero h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--text-strong);
}
.hero-line {
  width: 36px;
  height: 3px;
  background: var(--hw-red);
  border-radius: 2px;
  margin: 0 auto 16px;
}
.posts-hero p {
  color: var(--text-muted);
  font-size: 1rem;
  margin: 0;
}

.posts-layout {
  display: grid;
  grid-template-columns: 1fr 190px;
  gap: 28px;
  padding-bottom: 60px;
}
.posts-main { min-width: 0; }
/* ---------- 工具栏 ---------- */
.posts-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  align-items: center;
}
.posts-search {
  display: flex;
  flex: 1;
  border: 1px solid var(--hw-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--card-bg);
  transition: border-color 0.2s;
}
.posts-search:focus-within {
  border-color: var(--hw-red);
}
.posts-search input {
  flex: 1;
  border: none;
  padding: 12px 16px;
  font-size: 0.95rem;
  background: transparent;
  color: var(--text);
  outline: none;
  min-width: 0;
}
.posts-search button {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 0 16px;
  cursor: pointer;
  transition: color 0.2s;
}
.posts-search button:hover { color: var(--hw-red); }

.filter-toggle {
  display: none;
  padding: 12px 14px;
  background: var(--card-bg);
  border: 1px solid var(--hw-border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  transition: all 0.2s;
}
.filter-toggle:hover {
  border-color: var(--hw-red);
  color: var(--hw-red);
}

/* ---------- 文章网格 ---------- */
.posts-grid {
  /* 等高卡片：网格默认 stretch，同一行的卡片高度严格一致；
     卡片内部用 flex 纵向布局把 meta 推到最底部，形成对齐基线 */
  align-items: stretch;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.post-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--card-bg);
  border: 1px solid var(--hw-border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}
.post-card-cover {
  aspect-ratio: 900 / 600;
  overflow: hidden;
  background: var(--surface-muted);
}
.post-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.post-card:hover .post-card-cover img {
  transform: scale(1.04);
}
.post-card-body {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  overflow: hidden; /* 防止内容过长撑爆卡片 */
}
.post-card-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-strong);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 3em;
  transition: color 0.2s;
}
.post-card:hover .post-card-title { color: var(--hw-red); }

/* ---------- 卡片摘要：仅无封面卡片渲染，PC 最多 6 行省略 ---------- */
.post-card-excerpt {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

/* ---------- 卡片底部：日期 + 作者 | 标签 ---------- */
.post-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto; /* 沉底：把底部信息推到卡片最下方 */
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.post-card-meta-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--text-faint);
  min-width: 0;
}
.post-card-date {
  font-size: 0.78rem;
  color: var(--text-faint);
  flex-shrink: 0;
}
.post-card-author {
  font-size: 0.78rem;
  color: var(--text-faint);
  white-space: nowrap;
}
.post-card-tags {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
  overflow: hidden;
  min-width: 0;
}
.post-card-tag {
  padding: 2px 8px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 0.72rem;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---------- 侧边栏 ---------- */
.posts-sidebar {
  position: sticky;
  top: 100px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.sidebar-header {
  display: none;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--hw-border);
}
.sidebar-header h3 { margin: 0; font-size: 1rem; color: var(--text-strong); }
.sidebar-close {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
}

.filter-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 12px;
}
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.filter-chip {
  padding: 4px 10px;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 0.78rem;
  border-radius: 999px;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}
.filter-chip:hover { background: var(--hw-light-gray); }
.filter-chip.active {
  background: var(--hw-red);
  color: #fff;
}
.chip-hidden { display: none; }
.filter-chips.expanded .chip-hidden { display: inline-block; }
.filter-expand {
  margin-top: 12px;
  padding: 0;
  background: none;
  border: none;
  color: var(--hw-red);
  font-size: 0.82rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.filter-expand:hover { text-decoration: underline; }

.filter-clear {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--hw-border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.85rem;
  text-align: center;
  text-decoration: none;
  transition: all 0.2s;
}
.filter-clear:hover {
  border-color: var(--hw-red);
  color: var(--hw-red);
}

/* ---------- 遮罩 ---------- */
.sidebar-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s;
}
.sidebar-mask.show {
  display: block;
  opacity: 1;
}

/* ---------- 无结果 ---------- */
.no-results {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.no-results i {
  font-size: 3rem;
  display: block;
  margin-bottom: 20px;
  color: var(--hw-border);
}
.no-results h3 { margin-bottom: 8px; color: var(--text-strong); }
.no-results p { color: var(--text-faint); font-size: 0.9rem; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .posts-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  /* ==========================================
     修复：让搜索框和筛选按钮绝对水平对齐
     ========================================== */
  .posts-toolbar {
    align-items: stretch; /* 强制子元素拉伸对齐 */
  }
  .posts-search {
    height: 42px; /* 锁定搜索框高度 */
  }
  .posts-search input {
    padding: 0 16px; /* 去掉上下 padding，让高度由外壳决定 */
  }
  .filter-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px; /* 锁定按钮高度，与搜索框一致 */
    padding: 0 16px; /* 调整左右内边距 */
  }
  /* ========================================== */

  .posts-sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    max-height: 70vh;
    background: var(--bg);
    z-index: 100;
    padding: 20px 20px 32px;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.15);
  }
  .posts-sidebar.open { transform: translateY(0); }
  .sidebar-header { display: flex; }
}

@media (max-width: 600px) {
  .posts-hero { padding: 40px 0 16px; }
  .posts-hero h1 { font-size: 1.6rem; }
  .posts-grid { grid-template-columns: 1fr; gap: 16px; }
  .post-card-cover { aspect-ratio: 900 / 600; }
  /* 单列布局下空间更宽松，摘要多显示几行 */
  .post-card-excerpt { -webkit-line-clamp: 10; }
}

/* ============================================================
   6. 文章详情页
   ============================================================ */

/* ============================================================
   7. 页脚（极简浅色 SaaS 风格）
   结构见 views/partials/footer.ejs
   ============================================================ */
.site-footer {
  background: var(--footer-bg);
  border-top: 1px solid var(--footer-border);
  color: var(--footer-text);
  padding: 72px 24px 28px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

/* 四列：品牌占 2 份，右侧三列各 1 份 */
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 56px;
}

/* === 列 1：品牌 === */
.footer-brand .footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-strong);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-brand .footer-logo i {
  color: var(--primary);
  font-size: 1.15rem;
}

.footer-brand .footer-logo:hover {
  color: var(--primary);
}

.footer-brand h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-strong);
}

.footer-brand p {
  margin: 0;
  color: var(--footer-muted);
  font-size: 0.875rem;
  line-height: 1.7;
}

/* === 列 2~4：标题 + 链接列表 === */
.footer-col h4 {
  margin: 0 0 20px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-strong);
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-nav a,
.footer-nav span {
  color: var(--footer-muted);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

/* 悬浮变动态主题色 */
.footer-nav a:hover {
  color: var(--primary);
}

.footer-contact {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-contact i {
  flex-shrink: 0;
  width: 16px;
  color: var(--text-faint);
  font-size: 0.85rem;
}

/* === 底部版权：居中 === */
.footer-bottom {
  border-top: 1px solid var(--footer-border);
  padding-top: 24px;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-faint);
}

.footer-bottom p {
  margin: 0;
}

.footer-bottom a {
  color: var(--footer-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-bottom a:hover {
  color: var(--primary);
}

@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 36px;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .site-footer {
    padding: 48px 20px 24px;
  }

  /* 移动端改为两列：快速链接 | 资源，第二行 联系我 | 空 */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px 16px;      /* 上下 32px，左右 16px */
    margin-bottom: 36px;
  }

  /* 品牌区（Logo + 标语）横跨两列 */
  .footer-brand {
    grid-column: 1 / -1;
    margin-bottom: 8px;
  }

  /* 邮箱强制单行：不换行 + 略缩字号与字距 */
  .footer-contact {
    flex-wrap: nowrap;
  }
  .footer-contact a {
    white-space: nowrap !important;
    font-size: 12px !important;
    letter-spacing: -0.5px;
    word-break: keep-all;
  }
  .contact-email {
    word-break: keep-all;
  }
}

/* 版权区保持居中，不受两列布局影响 */
.footer-bottom {
  text-align: center;
}

/* ============================================================
   8. 响应式
   ============================================================ */
@media (max-width: 1024px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  /* Header 收窄 */
  .pc-nav { display: none; }
  .menu-toggle { display: block; }
  /* 新增：隐藏 PC 端主题切换按钮，防止在移动端导航栏溢出 */
  .nav-right .theme-switch { display: none !important; }
  
  .header-container { padding: 14px 0; gap: 0; }
  .logo { font-size: 1.3rem; }

  /* 区块 */
  .section { padding: 48px 0; }
  .section-title { margin-bottom: 32px; }
  .section-title h2 { font-size: 1.4rem; }

  /* Banner */
  .banner-carousel { padding: 12px; }
  .banner-carousel .slide-image {
    height: auto;
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center;
  }
  .banner-carousel .slide-overlay { padding: 20px 24px; }
  .banner-carousel .slide-overlay h2 { font-size: 1.2rem; }
  .carousel-btn { padding: 8px 12px; font-size: 1rem; }
  .carousel-btn.prev { left: 8px; }
  .carousel-btn.next { right: 8px; }

  /* 卡片 */
  .blog-grid { grid-template-columns: 1fr; gap: 16px; }
  .card-image-wrapper { height: 160px; }
  .card-content { padding: 16px 18px 18px; }

  /* 关于我 */
  .about-container {
    flex-direction: column;
    text-align: center;
    gap: 24px;
  }
  /* 文章列表页 */
  .article-item { padding: 20px; }
  .page-title h1 { font-size: 2rem; }

  /* 页脚 */
  .footer-content { gap: 24px; }
}
img,video,iframe{max-width:100%;height:auto}
.article-body {
  overflow-wrap: break-word;
  word-break: break-word;
}
.article-body a {
  word-break: break-all;
}
/* ============================================================
   13. 代码块长内容换行，防溢出
   ============================================================ */
.article-body pre,
article pre,
main pre {
  white-space: pre-wrap;      /* ← 关键：从 pre 改成 pre-wrap，允许换行 */
  word-break: break-all;      /* 长串无空格字符也能断 */
  overflow-wrap: anywhere;
  max-width: 100%;
  overflow-x: auto;           /* 兜底：万一还是超宽，横向滚动 */
}

/* 代码块里的 code 标签同样处理 */
.article-body pre code,
article pre code,
main pre code {
  white-space: pre-wrap;
  word-break: break-all;
  overflow-wrap: anywhere;
}
/* ============================================================
   14. 服务器状态页
   ============================================================ */
/* PC：默认 3 列 */
.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.status-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  text-align: center;
  min-width: 0;             /* ← 新增：允许网格项收缩 */
  overflow: hidden;         /* ← 新增：防溢出 */
}

.status-label {
  color: var(--text-faint);
  font-size: 0.9rem;
  margin-bottom: 14px;
}

.status-label i {
  color: var(--hw-red);
  margin-right: 6px;
}

.status-value {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--hw-red);
  line-height: 1;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
  word-break: keep-all;
}

.status-unit {
  font-size: 1.1rem;
  font-weight: 400;
  margin-left: 2px;
  color: var(--text-faint);
}

/* 强制压住大数字，专门给运行时长用 */
.status-value.status-uptime {
  font-size: 1.15rem !important; 
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 14px;
  letter-spacing: 0;
  word-break: keep-all;
}

.status-bar {
  width: 100%;
  height: 8px;
  background: var(--surface-muted);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.status-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand-color), #ff4d5e);
  border-radius: 4px;
  transition: width 0.6s ease;
}

.status-hint {
  color: var(--text-faint);
  font-size: 0.82rem;
  line-height: 1.6;
}

/* ===== 状态页独有组件（从 status.ejs 内联迁移） ===== */

/* 网络卡 */
.status-net { margin-bottom: 10px; }
.net-row { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 4px 0; font-size: .92rem; }
.net-arrow { font-weight: bold; font-size: 1.05rem; }
.net-arrow.down { color: #10b981; }
.net-arrow.up { color: #f59e0b; }
.net-value { font-family: 'HarmonyOS_Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif; font-variant-numeric: tabular-nums; color: var(--text); min-width: 80px; text-align: left; }

/* 异常卡 */
.status-card-anomaly { text-align: left; padding: 22px 20px; }
.status-card-anomaly .status-label { text-align: center; margin-bottom: 14px; }
.anomaly-mini-empty { color: var(--text-faint); font-size: .85rem; text-align: center; padding: 24px 0; }
.anomaly-mini-list { display: flex; flex-direction: column; gap: 10px; }
.anomaly-mini-item { display: flex; align-items: flex-start; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.anomaly-mini-item:last-child { border-bottom: none; padding-bottom: 0; }
.anomaly-mini-tag { flex-shrink: 0; font-size: .72rem; padding: 2px 7px; border-radius: 4px; font-weight: 500; line-height: 1.4; }
.anomaly-mini-tag.anomaly { background: #ffe0e0; color: #c4000f; }
.anomaly-mini-tag.recover { background: #d4edda; color: #155724; }
.anomaly-mini-body { flex: 1; min-width: 0; }
.anomaly-mini-text { font-size: .84rem; color: var(--text); line-height: 1.4; word-break: break-all; }
.anomaly-mini-meta { font-size: .72rem; color: var(--text-faint); font-family: 'HarmonyOS_Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif; font-variant-numeric: tabular-nums; margin-top: 2px; }

/* ===== 最近异常卡片：最多 3 条 + 固定可视高度，长文本不撑破 ===== */
.status-card-anomaly .anomaly-list-box {
  max-height: 160px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0;
  margin: 0;
  list-style: none;
}
.status-card-anomaly .anomaly-list-box li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
  font-size: .84rem;
  line-height: 1.5;
  word-break: break-all;
  overflow-wrap: anywhere;
}
.status-card-anomaly .anomaly-list-box li:last-child { border-bottom: none; }
.status-card-anomaly .anomaly-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
}
.status-card-anomaly .anomaly-content {
  color: var(--text-strong);
  white-space: normal;
  word-break: break-all;
  overflow-wrap: anywhere;
}
.status-card-anomaly .anomaly-empty {
  padding: 24px 0;
  text-align: center;
  color: var(--text-faint);
  font-size: .85rem;
}
.status-card-anomaly .tag-badge {
  flex-shrink: 0;
  font-size: .72rem;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 500;
  line-height: 1.4;
}
.status-card-anomaly .tag-badge.tag-danger { background: #ffe0e0; color: #c4000f; }
.status-card-anomaly .tag-badge.tag-success { background: #d4edda; color: #155724; }
html.dark .status-card-anomaly .tag-badge.tag-danger { background: rgba(230, 0, 18, .18); color: #ff8a8a; }
html.dark .status-card-anomaly .tag-badge.tag-success { background: rgba(21, 87, 36, .35); color: #7ee2a0; }

/* ===== 备份卡 ===== */
.status-card-backup { 
  text-align: left; 
  padding: 20px 24px; 
  grid-column: 1 / -1; 
}
.status-card-backup .status-label { 
  text-align: left; 
  margin-bottom: 14px; 
}
.backup-row { 
  display: flex; 
  align-items: center; 
  padding: 10px 0; 
  border-bottom: 1px solid var(--border); 
  font-size: 0.92rem; 
}
.backup-row:last-child { 
  border-bottom: none; 
}
.backup-name { 
  flex: 0 0 90px; 
  color: var(--text-muted); 
}
.backup-value { 
  flex: 1; 
  font-weight: 600; 
  color: var(--text); 
}
.backup-value.ok { color: #28a745; }
.backup-value.fail { color: #c4000f; }
.backup-value.unknown { color: #f0a500; }
.backup-meta { 
  flex: 0 0 auto; 
  color: var(--text-faint); 
  font-weight: 600; 
}
.backup-meta.stale { color: #c4000f; }

/* 行内 style 语义化 class */
.disk-io-note { font-size: .72rem; color: var(--text-faint); }
.status-hint--mt { margin-top: 14px; }

/*  关键：把空标签撑成方块 */
.status-chart-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin: 0 4px 0 12px;
  vertical-align: middle;
}

/* 图例颜色 */
.status-chart-legend .legend-cpu { background: var(--brand-color); }
.status-chart-legend .legend-mem { background: #3b82f6; }
.status-chart-legend .legend-disk { background: #10b981; }
.status-chart-legend .legend-net { background: #f59e0b; }
.status-chart-legend .legend-diskwrite { background: #8b5cf6; }

.status-chart-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap; /* 允许整个图例掉到下一行 */
  gap: 8px;
}
.status-chart-legend {
  display: flex;
  flex-wrap: wrap; /* 允许整体换行 */
  gap: 8px 12px;
  justify-content: flex-end; /* 靠右对齐 */
}
.legend-item {
  display: inline-flex;
  align-items: center;
  white-space: nowrap; /* 坚决不让文字折行 */
}
/* ============================================================
   图表区域完美样式（覆盖旧版）
   ============================================================ */

/* 1. 外层卡片 */
.status-chart-wrap {
  max-width: 1200px;
  margin: 36px auto 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* 2. 标题和图例 */
.status-chart-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 0.9rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 12px;
}

.status-chart-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.status-chart-legend .legend-item {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.status-chart-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}

.status-chart-legend .legend-cpu { background: var(--brand-color); }
.status-chart-legend .legend-mem { background: #3b82f6; }
.status-chart-legend .legend-disk { background: #10b981; }
.status-chart-legend .legend-net { background: #f59e0b; }
.status-chart-legend .legend-diskwrite { background: #8b5cf6; }

/* 3. 关键：锁死图表高度，防止无限拉伸 */
.chart-box {
  position: relative;
  height: 250px; /* PC 端固定高度 */
  width: 100%;
}

/* 4. 画布撑满容器 */
#statusChart {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* 5. 手机端高度微调 */
@media (max-width: 768px) {
  .chart-box {
    height: 200px;
  }
}
.status-footer {
  text-align: center;
  color: var(--text-faint);
  font-size: 0.85rem;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================================
   状态页响应式断点（合并精简版）
   ============================================================ */


/* 手机端：保持 2 列，但全面缩小字号和间距，防撑爆 */
@media (max-width: 480px) {
  .status-grid { 
    grid-template-columns: repeat(2, minmax(0, 1fr)); 
    gap: 10px; 
  }
  
  /* 缩小卡片内边距 */
  .status-card { 
    padding: 14px 8px; 
  }
  
  /* 大数字 */
  .status-value { 
    font-size: 1.4rem; 
    margin-bottom: 8px;
  }
  .status-unit { font-size: 0.85rem; }
  
  /* ==========================================
     解决运行时长换行问题
     依靠宽度限制和自动换行，无需插 <br>
     ========================================== */
  .status-value.status-uptime {
    font-size: 0.85rem !important; 
    line-height: 1.3;
    white-space: normal;
    word-break: keep-all;
  }
  
  /* 标签和提示文字缩小 */
  .status-label { 
    font-size: 0.75rem; 
    margin-bottom: 8px; 
  }
  .status-hint { 
    font-size: 0.65rem; 
    line-height: 1.4;
  }
  .status-hint--mt {
    margin-top: 8px;
  }
  
  /* ==========================================
     解决磁盘“读/写”换行问题（纯 CSS 魔法）
     ========================================== */
  .disk-io-note {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0; /* 隐藏原来的纯文本（读、写、中间的点） */
    line-height: 1.5;
  }
  
  /* 恢复数字部分的字体大小 */
  .disk-io-note span[id] {
    font-size: 0.7rem; 
  }
  
  /* 用伪元素重新画出 "读" 和 "写" */
  #diskRead::before { content: "读 "; }
  #diskWrite::before { content: "写 "; }

  /* 网络卡文字缩小 */
  .net-row { font-size: 0.8rem; margin: 2px 0; }
  .net-value { min-width: 60px; }
  
  /* 趋势图标题缩小 */
  .status-chart-title { font-size: 0.75rem; margin-bottom: 8px; }
  .status-chart-legend i { margin: 0 2px 0 8px; }
  
  /* 备份卡防溢出 */
  .status-card-backup { padding: 14px 12px; }
  .backup-row { font-size: 0.75rem; padding: 8px 0; }
  .backup-name { flex: 0 0 60px; font-size: 0.75rem; }
  .backup-value { font-size: 0.75rem; }
  .backup-meta { font-size: 0.65rem; }
}
/* ============================================================
   15. Toast 通知（底部居中，带进度条，悬停暂停）
   ============================================================ */
.toast-container {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}

/* 评论区等前台场景使用顶部居中提示（comments.js 调用 showToast 时传 position='top'） */
.toast-container-top {
  top: 24px;
  bottom: auto;
}

.toast {
  position: relative;
  pointer-events: auto;
  background: #5cb85c;
  color: #fff;
  border-radius: 8px;
  padding: 18px 48px 22px 22px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18), 0 2px 6px rgba(0,0,0,0.1);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 420px;                        /* ← 固定宽度，更宽 */
  max-width: 100%;
  overflow: hidden;
  animation: toast-in 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: default;
}

.toast.toast-error { background: #d9534f; }

.toast.toast-hide {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
}

.toast-icon {
  font-size: 1.7rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 2px;
}

.toast-body { flex: 1; min-width: 0; }

.toast-title {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.4;
}

.toast-message {
  font-size: 0.92rem;
  line-height: 1.5;
  margin-top: 5px;
  opacity: 0.92;
  word-break: break-word;
}

.toast-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  color: #fff;
  opacity: 0.7;
  cursor: pointer;
  padding: 4px 6px;
  font-size: 1rem;
  border-radius: 4px;
  transition: opacity 0.2s, background 0.2s;
}

.toast-close:hover {
  opacity: 1;
  background: rgba(255,255,255,0.15);
}

/* 底部进度条（用动画控制，方便暂停） */
.toast-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  width: 100%;
  background: rgba(255,255,255,0.9);
  transform-origin: left center;
  transform: scaleX(1);
  animation-name: toast-progress-shrink;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
  animation-play-state: paused;
}

.toast-progress.toast-progress-run {
  animation-play-state: running;
}

@keyframes toast-progress-shrink {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

@keyframes toast-in {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@media (max-width: 480px) {
  .toast-container {
    bottom: 20px;
    left: 16px;
    right: 16px;
    transform: none;
    max-width: none;
  }
  .toast { width: 100%; min-width: 0; }
}
/* ===== 16移动端后台适配 ===== */
/* ===== 移动到admin.css了 ===== */

/* ============================================================
   17. 主题切换（跟随系统 / 浅色 / 深色）
   ============================================================ */
.theme-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  font-size: 1.15rem;
  padding: 8px 10px;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

.theme-toggle:hover {
  background: var(--hw-light-gray);
  color: var(--hw-red);
}

.theme-toggle:focus-visible,
.theme-menu button:focus-visible {
  outline: 2px solid var(--hw-red);
  outline-offset: 2px;
}

.theme-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 140px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--menu-shadow);
  padding: 6px;
  z-index: 3000;
  display: none;
  flex-direction: column;
  gap: 2px;
}

.theme-switch.open .theme-menu {
  display: flex;
}

.theme-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  font-size: 0.9rem;
  padding: 9px 10px;
  border-radius: 7px;
  text-align: left;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.theme-menu button:hover {
  background: var(--hw-light-gray);
  color: var(--hw-red);
}

.theme-menu button.active {
  background: var(--hw-light-gray);
  color: var(--hw-red);
  font-weight: 600;
}

.theme-menu button i {
  width: 16px;
  text-align: center;
}

/* 移动端全屏菜单里的主题按钮（圆形样式） */
.theme-switch--circle .theme-toggle {
  flex-direction: column;
  gap: 8px;
  padding: 0;
  font-size: 0.85rem;
  color: var(--hw-medium-gray);
  border-radius: 0;
}

.theme-switch--circle .theme-toggle:hover {
  background: none;
  color: var(--hw-red);
}

.theme-switch--circle .theme-toggle i {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--hw-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.2s;
}

.theme-switch--circle .theme-toggle:hover i {
  border-color: var(--hw-red);
  color: var(--hw-red);
}

.mobile-menu-footer .theme-menu,
.theme-menu--up {
  top: auto;
  bottom: calc(100% + 10px);
  right: auto;
  left: 50%;
  transform: translateX(-50%);
}

/* 后台导航里的主题切换 */
.admin-nav .theme-toggle {
  color: var(--text);
  font-size: 1rem;
  padding: 4px 6px;
}

@media (max-width: 768px) {
  .admin-nav .theme-switch {
    justify-content: center;
  }
}

/* ============================================================
   18. 文章正文（Markdown 渲染）主题化
   ============================================================ */
.article-body h1, .article-body h2, .article-body h3,
.article-body h4, .article-body h5, .article-body h6 {
  color: var(--text-strong);
  margin: 1.2em 0 0.6em;
  line-height: 1.4;
}

.article-body p {
  color: var(--text);
}

.article-body a {
  color: var(--hw-red);
}

.article-body code {
  background: var(--surface-muted);
  color: var(--text-strong);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

.article-body pre {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.article-body pre code {
  background: none;
  padding: 0;
}

.article-body blockquote {
  border-left: 4px solid var(--hw-red);
  background: var(--surface-alt);
  color: var(--text-muted);
  padding: 10px 18px;
  margin: 16px 0;
  border-radius: 0 8px 8px 0;
}

.article-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

.article-body table {
  border-collapse: collapse;
  width: 100%;
  margin: 16px 0;
}

.article-body th, .article-body td {
  border: 1px solid var(--border);
  padding: 8px 12px;
}

.article-body th {
  background: var(--surface-muted);
  color: var(--text-strong);
}

.article-body img {
  border-radius: 8px;
}
/* ============================================================
   19. 动态页
   ============================================================ */

/* ---------- 页面标题（与博文页统一） ---------- */
.page-hero {
  padding: 60px 0 40px;
  text-align: center;
  border-bottom: 1px solid var(--hw-border);
  margin-bottom: 40px;
}
.page-hero h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--text-strong);
}
.page-hero .hero-line {
  width: 36px;
  height: 3px;
  background: var(--hw-red);
  border-radius: 2px;
  margin: 0 auto 16px;
}
.page-hero p {
  color: var(--text-muted);
  font-size: 1rem;
  margin: 0;
}

/* ---------- 动态列表 ---------- */
/* 动态卡样式统一在 4.4 节，本区不再重复 */
/* ---------- 底部返回链接 ---------- */
.moments-back {
  text-align: center;
  margin-top: 40px;
}
.back-link {
  color: var(--hw-red);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.2s;
}
.back-link:hover {
  opacity: 0.8;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .moments-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .page-hero { padding: 40px 0 24px; }
  .page-hero h1 { font-size: 1.6rem; }
  .moments-grid { grid-template-columns: 1fr; gap: 16px; }
  .moment-card { padding: 20px 20px 44px; }
  .more-link { text-align: center; }
}
/* ============================================================
   20. 卡片悬停变色反馈（极简版）
   ============================================================ */

/* 给卡片加背景色过渡动画 */
.blog-card, .post-card, .moment-card, .status-card {
  transition: background-color 0.3s ease;
}

/* 
  悬停时：使用你项目里现成的 --surface-muted 变量
  亮色模式下它是 #f0f2f5（比纯白深一点）
  暗色模式下它是 #2f2f2f（比黑底浅一点）
*/
.blog-card:hover, 
.post-card:hover, 
.moment-card:hover, 
.status-card:hover {
  background-color: var(--surface-muted);
}
/* ============================================================
   21. 通用分页器
   ============================================================ */
.pagination-wrap {
  display: flex;
  justify-content: center;
  margin-top: 40px;
  width: 100%;
}
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.page-btn,
.page-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--hw-border);
  transition: all 0.2s;
  background: var(--card-bg);
}
.page-btn:hover {
  background: var(--hw-light-gray);
  border-color: var(--border-strong);
}
.page-num.active {
  background: var(--hw-red);
  color: #fff;
  border-color: var(--hw-red);
  font-weight: 600;
}
.page-btn.disabled {
  color: var(--text-faint);
  background: var(--surface-muted);
  cursor: not-allowed;
  border-color: transparent;
}
@media (max-width: 600px) {
  .pagination {
    width: 100%;
    justify-content: space-between;
  }
  .pagination li {
    flex: 1;
  }
  .page-btn, .page-num {
    width: 100%;
  }
}

/* ============================================================
   沉浸式首屏（首页 / 隐私页）：只在最上方"盖一层帷幕"，不影响原有结构
   ============================================================ */
.hero-cover {
  position: fixed;              /* 固定帷幕：内容在其下，收起时才真正滚动 */
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;              /* 移动端地址栏友好 */
  overflow: hidden;
  z-index: 1001;                /* 盖在导航栏之上（导航另提到 1002 保持可见） */
  will-change: transform;
  display: flex;                /* 默认全屏：首帧即覆盖全屏，避免先闪出下方内容 */
  align-items: center;
  justify-content: center;
  background: #111;
  transform: translateY(0);
}
.hero-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  /* 缓慢呼吸缩放，静态图也有"动"感 */
  animation: hero-kenburns 28s ease-in-out infinite alternate;
}
/* 暗色渐变遮罩，保证白字在任何图片上都可读 */
.hero-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0,0,0,.1) 0%, rgba(0,0,0,.02) 45%, rgba(0,0,0,.2) 100%);
}
/* 未设置背景图时的兜底渐变（同样有流动感） */
.hero-noimg {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 45%, #0f3460 100%);
  background-size: 200% 200%;
  animation: hero-gradient 18s ease infinite;
}
/* 精准命中 .hero-bottom-area 下的 p 标签，无视它原本的内联样式 */
.hero-bottom-area p {
  color: #ffffff !important; /* 强行覆盖为纯白 */
  font-size: 16px !important;
  font-weight: 500;
  /* 暴力阴影 */
  text-shadow: 0 1px 3px rgba(0,0,0,.9), 0 2px 8px rgba(0,0,0,.8), 0 0 15px rgba(0,0,0,.7) !important;
}
.hero-title {
  position: relative;
  z-index: 2;
  color: #fff;
  font-size: clamp(1.8rem, 5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: .04em;
  text-align: center;
  padding: 0 24px;
  text-shadow: 0 4px 24px rgba(0,0,0,.5);
}
/* 向下箭头强化：纯白、加大、发光、强弹跳 */
.hero-arrow {
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  z-index: 2;

  color: #ffffff !important;
  font-size: 36px !important;

  opacity: 1 !important;
  text-shadow: 0 0 15px rgba(255, 255, 255, .8), 0 2px 5px rgba(0, 0, 0, .6);

  animation: bounceStrong 2s infinite;
}

/* 图标本身加粗 */
.hero-arrow,
.hero-arrow i {
  font-weight: 900;
}

@keyframes hero-kenburns {
  from { transform: scale(1); }
  to   { transform: scale(1.08); }
}
@keyframes hero-gradient {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes bounceStrong {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-15px);
  }
  60% {
    transform: translateX(-50%) translateY(-8px);
  }
}


/* 有 Hero 的页面：导航透明浮在首屏之上，滚动 50px 后转毛玻璃 */
body.has-hero header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: transparent;
  box-shadow: none;
  border-bottom-color: transparent;
  width: 100%;
}
body.has-hero header .logo,
body.has-hero header .logo span,
body.has-hero header .pc-nav a {
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .hero-media, .hero-noimg, .hero-arrow { animation: none !important; }
}
@media (max-width: 600px) {
  .hero-title { padding: 0 18px; }
}

/* 首屏透明导航：大图铺满到导航底下，导航浮在图上 */
header.transparent-header {
  background: transparent !important;
  border-bottom: none !important;
  box-shadow: none !important;
}
header.transparent-header a,
header.transparent-header .logo span,
header.transparent-header button i {
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}
/* 有 Hero 时导航需要浮在帷幕之上 */
body.has-hero header { z-index: 1002; }
/* ============================================================
   移动端手势加固 + 主题弹窗定位修正
   ============================================================ */
/* 禁止浏览器默认下拉刷新与回弹（华为/安卓国产浏览器的手势优先级很高） */
html, body {
  overscroll-behavior-y: none;
  overscroll-behavior-x: none;
}

/* Hero 上彻底禁用原生滑动/缩放，全部交由 JS 手势处理 */
.hero-cover {
  touch-action: none;
}

/* 主题弹窗：贴按钮正下方、靠右对齐（深色模式同样适用，背景由 .theme-menu 原规则决定） */
.theme-menu {
  top: calc(100% + 8px);
  right: 0;
  left: auto;
}

/* 覆盖移动端菜单里的居中定位（原 left:50% + translateX(-50%) 会把弹窗推到左边、甚至飞出屏幕） */
.mobile-menu-footer .theme-menu,
.theme-menu--up {
  top: auto;
  bottom: calc(100% + 8px);
  right: 0;
  left: auto;
  transform: none;
}

@media (max-width: 768px) {
  .theme-menu { right: -10px; }
  /* 移动菜单 footer 里的主题弹窗：按钮右边缘仅约 131px，140px 宽会左溢 9px，
     收窄到 130px 才能同时满足「贴右对齐」与「完整在视口内」 */
  .mobile-menu-footer .theme-menu {
    min-width: 130px;
    width: 130px;
  }
}

/* ============================================================
   终极精简：导航仅「透明 / 白底」两态，禁用一切毛玻璃
   ============================================================ */
header {
  background: var(--bg) !important;
  box-shadow: var(--header-shadow), 0 2px 0 var(--hw-red) !important;
  border-bottom: none !important;
  transition: background-color 0.3s, box-shadow 0.3s;
}

/* 全屏 Hero 状态：直接全透明，不要毛玻璃 */
body.has-hero header {
  background: transparent !important;
  box-shadow: none !important;
}

/* 全屏 Hero 状态下，文字变白以看清大图 */
body.has-hero header .logo,
body.has-hero header .logo i,
body.has-hero header .logo span,
body.has-hero header .pc-nav a,
body.has-hero header .nav-right button {
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* 汉堡菜单：任何状态下都是纯白背景 */
.mobile-menu,
body.has-hero .mobile-menu {
  background: var(--bg) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* ============================================================
   HarmonyOS 提示语义色（设计令牌）
   ------------------------------------------------------------
   来源：HarmonyOS 官方状态色。核心逻辑是用「警示 Warning」
   与「提示 Caution」区分严重等级，并把「成功 Connected」作为
   独立系统语义色。弹窗 / 提示条只引用这里的令牌，
   调整品牌或对比度时只改本段，组件本身不动。
   ============================================================ */
:root {
  /* --- 中性色 --- */
  --hm-bg-base: #f1f3f5;          /* 浅色页面底 */
  --hm-bg-card: #ffffff;          /* 浅色卡片 / 弹窗底 */
  --hm-text-primary: #182431;     /* 一级文本 */
  --hm-text-secondary: #666666;   /* 二级文本 */

  /* --- 1. 错误 / 危险（Warning） --- */
  --hm-danger: #e84026;
  --hm-danger-bg: #fde8e6;
  --hm-danger-text: #c0392b;

  /* --- 2. 警告 / 注意（Caution） --- */
  --hm-warning: #ed6f21;
  --hm-warning-bg: #fef0e6;
  --hm-warning-text: #b85c1a;

  /* --- 3. 成功（Connected） --- */
  --hm-success: #64bb5c;
  --hm-success-bg: #eef7ec;
  --hm-success-text: #3e8e37;

  /* --- 4. 品牌 / 信息（Accent） --- */
  --hm-primary: #0a59f7;
  --hm-primary-bg: #e6efff;
  --hm-primary-text: #0a59f7;
}

.dark {
  --hm-bg-base: #000000;
  --hm-bg-card: #1a1a1a;
  --hm-text-primary: #e5e5e5;
  --hm-text-secondary: #999999;

  --hm-danger: #d94838;
  --hm-danger-bg: #2e1a17;
  --hm-danger-text: #ff6b52;

  --hm-warning: #db6b42;
  --hm-warning-bg: #2a1f18;
  --hm-warning-text: #ffa366;

  --hm-success: #5ba854;
  --hm-success-bg: #17221a;
  --hm-success-text: #7dcc75;

  --hm-primary: #317af7;
  --hm-primary-bg: #1a2438;
  --hm-primary-text: #5291ff;
}

/* ============================================================
   鸿蒙风格全局弹窗（hm-ui.js）
   DOM 由 JS 注入，本段只负责外观；颜色全部取自上面的语义令牌，
   深色模式（.dark）自动跟随。
   ============================================================ */
.hm-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(24px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0.28s;
}

.hm-modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.hm-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

html.dark .hm-modal-overlay {
  background: rgba(0, 0, 0, 0.62);
}

.hm-modal-content {
  position: relative;
  width: 100%;
  max-width: 340px;
  padding: 24px;
  box-sizing: border-box;
  background: var(--hm-bg-card, #fff);
  color: var(--hm-text-primary, #182431);
  border: 1px solid var(--border, #e6e6e6);
  border-radius: 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.92) translateY(18px);
  transition: transform 0.34s cubic-bezier(0.2, 0.8, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.hm-modal.active .hm-modal-content {
  transform: scale(1) translateY(0);
}

.hm-modal-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 20px;
}

/* 语义图标：成功 / 警告 / 危险 各自用对应语义色，普通提示用品牌色 */
.hm-modal-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.hm-icon-primary {
  background: var(--hm-primary-bg);
  color: var(--hm-primary-text);
}

.hm-icon-success {
  background: var(--hm-success-bg);
  color: var(--hm-success-text);
}

.hm-icon-caution {
  background: var(--hm-warning-bg);
  color: var(--hm-warning-text);
}

.hm-icon-danger {
  background: var(--hm-danger-bg);
  color: var(--hm-danger-text);
}

/* 免责声明 / 补充说明：外链拦截时必显，红色警示 */
.hm-modal-note {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.55;
  text-align: left;
  border: 1px solid transparent;
}

.hm-note-danger {
  background: var(--hm-danger-bg);
  color: var(--hm-danger-text);
  border-color: color-mix(in srgb, var(--hm-danger) 28%, transparent);
}

.hm-note-caution {
  background: var(--hm-warning-bg);
  color: var(--hm-warning-text);
  border-color: color-mix(in srgb, var(--hm-warning) 28%, transparent);
}

.hm-modal-title {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  color: var(--hm-text-primary, #182431);
}

.hm-modal-desc {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  text-align: center;
  color: var(--hm-text-secondary, #666);
  word-break: break-word;
}

.hm-modal-url {
  margin-top: 16px;
  padding: 10px 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  text-align: left;
  color: var(--hm-text-secondary, #666);
  background: var(--hm-bg-base, #f1f3f5);
  border: 1px solid var(--border, #e6e6e6);
  border-radius: 12px;
  word-break: break-all;
  overflow-wrap: anywhere;
  max-height: 100px;
  overflow-y: auto;
}

.hm-modal-actions {
  display: flex;
  gap: 12px;
  width: 100%;
  flex-wrap: wrap;
}

/* 三个及以上按钮：纵向排列，避免中文按钮在窄屏被挤成两行字 */
.hm-modal-actions[data-count="3"],
.hm-modal-actions[data-count="4"],
.hm-modal-actions[data-count="5"],
.hm-modal-actions[data-count="6"] {
  flex-direction: column;
}

.hm-modal-actions .hm-btn {
  flex: 1 1 auto;
  min-width: 104px;
  min-height: 46px;
  padding: 12px 14px;
  font-size: 16px;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.2;
  border: none;
  border-radius: 23px;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.12s ease, background-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.hm-modal-actions .hm-btn:active {
  transform: scale(0.97);
}

.hm-modal-actions .hm-btn:focus-visible {
  /* 中性描边：主按钮蓝 / 危险按钮红都能看清，且不会与站点主题色冲突 */
  outline: 2px solid var(--hm-text-primary, #182431);
  outline-offset: 2px;
}

/* ---------- 按钮语义色（全部走 HarmonyOS 令牌） ---------- */
.hm-btn-cancel {
  background: var(--hm-bg-base, #f1f3f5);
  color: var(--hm-text-primary, #182431);
}

.hm-btn-cancel:hover {
  background: color-mix(in srgb, var(--hm-text-primary, #182431) 8%, var(--hm-bg-base, #f1f3f5));
}

.hm-btn-primary {
  background: var(--hm-primary, #0a59f7);
  color: #fff;
}

.hm-btn-primary:hover {
  opacity: 0.88;
}

.hm-btn-danger {
  background: var(--hm-danger, #e84026);
  color: #fff;
}

.hm-btn-danger:hover {
  opacity: 0.88;
}

.hm-btn-caution {
  background: var(--hm-warning, #ed6f21);
  color: #fff;
}

.hm-btn-caution:hover {
  opacity: 0.88;
}

.hm-btn-success {
  background: var(--hm-success, #64bb5c);
  color: #fff;
}

.hm-btn-success:hover {
  opacity: 0.88;
}

@media (max-width: 380px) {
  .hm-modal-content {
    padding: 20px;
    border-radius: 20px;
  }

  .hm-modal-title {
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hm-modal,
  .hm-modal-content,
  .hm-modal-actions .hm-btn {
    transition: none !important;
  }
}

/* ============================================================
   9. 首页 v5：第二屏双栏布局
   ------------------------------------------------------------
   首屏 .hero-cover（fixed 帷幕 + main.js 手势）保持原样，
   本段只作用于 hero 之后的主内容区。
   ============================================================ */

.home-main {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto 80px;
  padding: 0 24px;
  box-sizing: border-box;
  /* 第二屏刚好填满剩余视口：总高 - 导航 - 露出的图片 */
  min-height: calc(100vh - var(--nav-h, 76px) - 40vh);
}

/* 第二屏顶部大字：直接复用首屏副标题 */
.home-headline {
  text-align: center !important;
  width: 100%;
  display: block;
  /* 上下 10px、左右 20px 安全边距，绝不让文字贴边 */
  padding: 10px 20px !important;
  box-sizing: border-box;
  margin: 10px auto 12px !important;
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5), 0 8px 28px rgba(0, 0, 0, 0.35);
}

/* 双栏栅格 */
.home-grid {
  display: grid;
  grid-template-columns: 2.5fr 1fr;
  gap: 32px;
  /* 列高不拉伸：右侧 sticky 才能跟随左栏一路滚到底 */
  align-items: start;
}

/* 首页首屏与私密页同为沉浸式帷幕（fixed 全屏 + 手势收起）。
   收起后在视口顶部保留一条图片（132px ≈ 导航 72 + 露头 60），
   下方 banner / 名片压在这条图上，形成「卡片入侵图片」的沉浸感。
   图片条的 z-index 低于内容，滚动时卡片会自然从图片上滑过。 */
body:not(.has-hero) #homeHero.hero-cover {
  /* 收起后改为 absolute：图片条跟随文档一起滚走，不固定在视口顶部 */
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100%;
  transform: translateY(calc(-100% + 40vh)) !important;
  z-index: 1 !important;
}

/* 收起后图片条只留背景：首屏的标题 / 副标题 / 箭头全部淡出，
   避免与第二屏大字重复出现 */
body:not(.has-hero) #homeHero .hero-center-title,
body:not(.has-hero) #homeHero .hero-bottom-area,
body:not(.has-hero) #homeHero .hero-arrow {
  opacity: 0 !important;
  transition: opacity 0.2s ease;
  pointer-events: none;
}


.home-left {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.home-side {
  /* 不做 sticky 吸附：侧栏随页面自然滚动，标签、笔记能完整露出来 */
  position: static;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 24px;
  /* 与 Banner 同高，视觉平衡 */
  min-height: calc(100vh - 30vh - 120px);
}

.home-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  box-sizing: border-box;
}

.home-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.home-card-head h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-strong);
}

.home-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.home-more:hover {
  color: var(--primary);
}

.home-empty {
  margin: 8px 0;
  font-size: 0.88rem;
  color: var(--text-faint);
  text-align: center;
  padding: 24px 0;
}

/* ---------- A. 大 Banner（轮播只换皮，结构未改） ---------- */
.home-banner {
  padding: 0;
  margin: 0;
}

.home-banner.banner-carousel .carousel-wrapper {
  max-width: none;
  /* 锁定 900×600（3:2），避免移动端被拉成竖条 */
  width: 100%;
  aspect-ratio: 900 / 600 !important;
  height: auto !important;
  min-height: auto !important;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
}

.home-banner.banner-carousel .carousel-track,
.home-banner.banner-carousel .carousel-slide {
  height: 100%;
}

.home-banner.banner-carousel .carousel-slide > a {
  display: block;
  height: 100%;
}

.home-banner.banner-carousel .slide-image {
  height: 100%;
  aspect-ratio: auto;
  background-size: cover;
  background-position: center;
  background-color: var(--surface-muted);
}

/* 半透明黑色渐变遮罩 + 左下文案 */
.home-banner.banner-carousel .slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.62) 0%, rgba(0, 0, 0, 0.18) 45%, transparent 75%);
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 40px;
}

.home-banner.banner-carousel .slide-overlay h2 {
  max-width: 80%;
  margin: 0;
  color: #fff;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.4;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.home-banner.banner-carousel .carousel-btn {
  background: rgba(255, 255, 255, 0.82);
  color: var(--text-strong);
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 0.95rem;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.home-banner.banner-carousel:hover .carousel-btn {
  opacity: 1;
}

.home-banner.banner-carousel .carousel-btn:hover {
  background: #fff;
}

.home-banner.banner-carousel .carousel-btn.prev { left: 16px; }
.home-banner.banner-carousel .carousel-btn.next { right: 16px; }

.home-banner.banner-carousel .carousel-dots {
  bottom: 18px;
}

/* 空态：浅蓝底 + 大字 + 药丸按钮 */
.home-banner-empty {
  width: 100%;
  aspect-ratio: 900 / 600 !important;
  height: auto !important;
  min-height: auto !important;
  border-radius: 20px;
  background: var(--hm-primary-bg, #e6efff);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
}

.home-banner-empty h1 {
  margin: 0;
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--primary);
}

.home-pill {
  display: inline-block;
  padding: 10px 26px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.12s ease;
}

.home-pill:hover {
  opacity: 0.88;
}

.home-pill:active {
  transform: scale(0.97);
}

/* ---------- B. 最新文章：左文右图 ---------- */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.post-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: inherit;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.post-item:hover {
  background: var(--surface-alt);
  border-color: var(--border);
}

.post-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.post-item-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-strong);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
}

.post-item:hover .post-item-title {
  color: var(--primary);
}

.post-item-desc {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-item-meta {
  display: flex;
  flex-wrap: wrap;          /* 窄屏允许整体换行，而不是把日期压扁 */
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-faint);
  min-width: 0;
}

/* 每个信息块内部不折行：图标 + 文字始终同一行 */
.post-item-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.post-item-meta i {
  flex-shrink: 0;
}

/* 封面统一比例裁切：140 × 100，绝不拉伸 */
.post-item-thumb {
  flex: 0 0 140px;
  width: 140px;
  height: 100px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-muted);
}

.post-item-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 文章 meta 里的标签组：贴右显示，最多 2 个 */
.post-item-tags {
  display: inline-flex;
  gap: 6px;
  margin-left: auto;
  min-width: 0;
}

/* 标签药丸（全局）：描边/底色全部由主题色动态推导 */
.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.6;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.tag-pill.js-tag-click {
  cursor: pointer;
}

.tag-pill:hover,
.tag-pill.active {
  /* 浅蓝底 */
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  /* 浅蓝描边 */
  border-color: color-mix(in srgb, var(--primary) 35%, transparent);
  /* 字体变主题色 */
  color: var(--primary);
  text-decoration: none;
}

/* 热门标签：第 6 个起在移动端隐藏 */
.tag-item-more {
  display: flex;
}

/* ---------- C. 最新动态：竖向时间轴 ---------- */
.home-timeline {
  position: relative;
  padding-left: 8px;
}

.home-timeline::before {
  content: '';
  position: absolute;
  left: 13px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
}

.tl-item {
  position: relative;
  padding-left: 32px;
  margin-bottom: 18px;
}

.tl-item:last-child {
  margin-bottom: 0;
}

.tl-item::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 20px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.tl-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.tl-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 0.78rem;
  color: var(--text-faint);
}

.tl-head i {
  margin-right: 5px;
}

.tl-title {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-strong);
  transition: color 0.3s;
}

.tl-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 首页动态悬浮动效（与动态页时间轴一致） ---------- */
.tl-item:hover .tl-card {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.09);
}

.tl-item:hover .tl-title {
  color: var(--hw-red);
}

.tl-card:hover .tl-text {
  animation: momentBounce 0.4s ease;
}

.tl-item:hover::before {
  transform: scale(1.4);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent),
    0 0 0 5px color-mix(in srgb, var(--brand-color, #e60012) 16%, transparent);
}

/* ---------- 右栏：个人名片 ---------- */
.profile-card {
  text-align: center;
}

.profile-avatar {
  display: block;
  width: 88px;
  height: 88px;
  margin: 0 auto 16px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.profile-avatar-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-muted);
  color: var(--text-faint);
  font-size: 1.6rem;
}

.profile-name {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-strong);
}

.profile-desc {
  margin: 0 0 20px;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.profile-stats {
  display: flex;
  justify-content: space-around;   /* 均匀分布 */
  gap: 16px;                       /* 强制拉开间距 */
  padding: 16px 0;
  margin-bottom: 20px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.profile-stats .stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 56px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-num {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-strong);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-faint);
}

/* ---------- 右栏：热门标签 ---------- */
.tag-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tag-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--surface-alt);
  text-decoration: none;
  transition: background 0.2s ease;
}

.tag-row:hover {
  background: var(--surface-muted);
}

.tag-name {
  overflow: hidden;
  font-size: 0.85rem;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-count {
  flex-shrink: 0;
  padding: 1px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .home-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .home-side {
    position: static;
    /* 移动端单列时，右栏三张卡按 笔记 → 标签 → 名片 排列
       （DOM 顺序是 名片 → 标签 → 笔记，这里用 order 反排） */
  }

  .home-side .side-notes { order: 1; }
  .home-side .side-tags { order: 2; }
  .home-side .profile-card { order: 3; }

  .home-banner.banner-carousel .carousel-wrapper,
  .home-banner-empty {
    height: 360px;
  }
}

@media (max-width: 768px) {
  .home-main {
    margin: 0 auto 56px;
    padding: 0 16px;
    min-height: calc(100vh - 56px - 30vh);
  }

  .home-grid {
    gap: 20px;
  }

  .tag-item-more {
    display: none !important;
  }

  .home-headline {
    margin-bottom: 10px;
  }

  .home-card {
    padding: 20px;
    border-radius: 16px;
  }

  /* 移动端没有侧栏名片，露头更少一点 */
  body:not(.has-hero) #homeHero.hero-cover {
    transform: translateY(calc(-100% + 30vh)) !important;
  }

  /* 手机端侧栏在下方堆叠，不需要强制高度 */
  .home-side {
    min-height: 0;
    height: auto;
  }

  .home-banner.banner-carousel .slide-overlay {
    padding: 20px;
  }

  .home-banner.banner-carousel .slide-overlay h2 {
    max-width: 90%;
    font-size: 1.15rem;
  }

  .home-banner-empty h1 {
    font-size: 2.4rem;
  }

  .home-banner.banner-carousel .carousel-btn {
    opacity: 1;
    width: 34px;
    height: 34px;
    font-size: 0.8rem;
  }

  .post-item {
    gap: 14px;
    padding: 12px;
  }

  .post-item-thumb {
    flex: 0 0 104px;
    width: 104px;
    height: 78px;
  }

  .post-item-title {
    font-size: 0.95rem;
  }

  /* 移动端卡片不显示标签：作者 + 日期已经够挤，标签直接隐藏保持清爽 */
  .post-item-meta .post-item-tags,
  .post-item-meta .tag-pill {
    display: none !important;
  }

  /* 移动端动态只保留 3 条（PC 仍是 6 条） */
  .home-timeline .tl-item:nth-child(n + 4) {
    display: none;
  }

  .home-card-head h2 {
    font-size: 1.05rem;
  }
}

/* ============================================================
   文章详情页 v5（detail-*）
   结构见 views/posts/detail.ejs / private-detail.ejs
   ============================================================ */
.detail-container {
  max-width: 860px;          /* 限宽，长文阅读更舒服 */
  margin: 0 auto;
  padding: 0 20px;
}

.detail-header { padding: 48px 0 32px; }

.detail-title {
  margin: 0 0 16px;
  font-size: clamp(1.6rem, 3.2vw, 2rem);
  font-weight: 800;
  line-height: 1.4;
  color: var(--text-strong);
  word-break: break-word;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: var(--text-faint);
}

.detail-meta > span > i,
.detail-meta > i {
  margin-right: 4px;
}

/* 标签组：跟随 meta 行，窄屏整体换行 */
.detail-tags {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.detail-tags > i {
  margin-right: 4px;
  color: var(--text-faint);
}

.detail-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.dark .detail-card {
  box-shadow: none;
}

/* 正文样式沿用已有的 .article-body，这里只补卡片内边界 */
.detail-card .article-body > :first-child { margin-top: 0; }
.detail-card .article-body > :last-child { margin-bottom: 0; }

.detail-video {
  position: relative;
  margin: 30px 0;
  padding-bottom: 56.25%;
  height: 0;
}

.detail-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.detail-footer {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.detail-back:hover {
  background: var(--primary);
  color: #fff;
}

/* 私密文章的标识徽标 */
.detail-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
}

@media (max-width: 768px) {
  .detail-header { padding: 28px 0 20px; }
  .detail-title { font-size: 24px; }
  .detail-card { padding: 24px; border-radius: 16px; }
  .detail-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

/* ============================================================
   关于我（About）
   ============================================================ */
.about-wrapper {
  max-width: 1040px;
  margin: 104px auto 80px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 32px;
}

.about-card-left {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 40px 24px;
  border: 1px solid var(--border);
  text-align: center;
  position: sticky;
  top: 96px;
  height: fit-content;
}

/* 未配置头像时：保持圆形占位，但不显示破图图标（不引入任何默认图） */
.about-avatar[src=""],
.about-avatar:not([src]) {
  opacity: 0;          /* 隐藏破图图标，但保留 120×120 的圆位 */
  background: var(--surface-alt);
  border-radius: 50%;
}

.about-avatar {
  display: block;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 20px;
  border: 4px solid #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.about-name { font-size: 24px; font-weight: 800; margin: 0 0 8px; color: var(--text-strong); }
.about-title { font-size: 14px; color: var(--primary); font-weight: 500; margin-bottom: 24px; display: block; }

.social-links { display: flex; justify-content: center; gap: 16px; margin-bottom: 24px; }
.social-links a {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface-alt); color: var(--text); font-size: 18px;
  text-decoration: none; transition: all 0.2s ease;
}
.social-links a:hover { background: var(--primary); color: #fff; transform: translateY(-2px); }

.contact-email { font-size: 13px; color: var(--text-muted); font-family: monospace; }

.about-card-right {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 48px;
  border: 1px solid var(--border);
  line-height: 1.8;
  font-size: 15px;
}

.section-title {
  font-size: 20px; font-weight: 800;
  margin: 40px 0 20px;
  display: flex; align-items: center; gap: 12px;
  color: var(--text-strong);
}
.section-title:first-child { margin-top: 0; }
.section-title::before {
  content: ''; display: block;
  width: 4px; height: 20px;
  background: var(--primary); border-radius: 2px;
}

.about-card-right p { color: var(--text); margin-bottom: 16px; }

.tech-stack { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 40px; }

/* 时间轴 */
.history-list {
  border-left: 2px solid var(--border);
  margin-left: 8px;
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.history-item { position: relative; }
.history-item::before {
  content: '';
  position: absolute; left: -31px; top: 6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--card-bg);
}
.history-date { font-size: 13px; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; display: block; }
.history-title { font-weight: 700; font-size: 16px; margin-bottom: 4px; color: var(--text-strong); }
.history-desc { font-size: 14px; color: var(--text-muted); }
.history-desc code {
  background: var(--surface-alt);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
  font-family: monospace;
}

@media (max-width: 900px) {
  .about-wrapper { grid-template-columns: 1fr; gap: 24px; margin-top: 84px; }
  .about-card-left { position: relative; top: 0; padding: 32px 24px; }
  .about-card-right { padding: 24px; }
  .history-list { padding-left: 20px; }
  .history-item::before { left: -27px; }
}

/* ============================================================
   笔记入口：PC 保持列表，≤768px 变三列方块
   ============================================================ */
@media (max-width: 768px) {
  /* 容器：纵向列表 → 三列网格 */
  .side-notes .tag-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  /* 单个入口：横排 → 竖向居中方块 */
  .side-notes .notes-sidebar-item {
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 16px 8px;
    text-align: center;
    border-radius: 14px;
  }

  /* 图标在上、文字在下 */
  .side-notes .notes-sidebar-item .tag-name {
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    overflow: visible;
    white-space: normal;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-strong);
  }

  /* 图标放大 */
  .side-notes .notes-sidebar-item .tag-name i {
    width: auto;
    font-size: 24px;
  }

  /* 方块状入口不需要右侧小箭头 */
  .side-notes .notes-arrow {
    display: none !important;
  }
}

/* ============================================================
   首屏与头像：修复换页瞬间的「大头像漂浮」闪烁
   ============================================================ */
/* 1) 首屏必须是不透明实体，加载瞬间挡住下方所有内容 */
.hero-cover {
  background-color: #111 !important;
}

/* 2) 未收起时提到最顶层；收起态仍由 #homeHero.hero-cover 的 z-index:1 接管 */
body.has-hero .hero-cover {
  z-index: 9999 !important;
}

/* 3) 头像固定尺寸并裁剪，避免转场 / 图片未加载时被拉伸 */
.profile-avatar {
  width: 88px !important;
  height: 88px !important;
  overflow: hidden !important;
  border-radius: 50% !important;
}

/* ============================================================
   层级修正：导航永远压过首屏大图（hero 基础 z-index 为 1001）
   ============================================================ */
header {
  z-index: 10000 !important;
}

/* 首屏：低于导航、高于普通内容（内容 z-index 2） */
body.has-hero .hero-cover {
  z-index: 999 !important;
}

/* ============================================================
   层级栈（从低到高，改层级只改这一段，避免各处互相打架）
   ------------------------------------------------------------
   普通内容 2 → 首屏帷幕 999 → 导航栏 10000
   → 全屏菜单 10001 → 全局弹窗 10050 → Toast 99999
   ============================================================ */
.mobile-menu,
body.has-hero .mobile-menu {
  z-index: 10001 !important;   /* 必须压过 header(10000)，否则菜单头部与关闭按钮被导航遮住 */
}

/* 全局弹窗（hm-ui.js 注入）永远在最上层，菜单展开时也能正常显示 */
.hm-modal {
  z-index: 10050 !important;
}

/* ============================================================
   第二屏高度基准：导航高度变量 + 名片拉伸
   ============================================================ */
:root {
  --nav-h: 76px;          /* 与 header 实际高度保持一致 */
}

/* 侧栏高于其余两张卡时，个人名片吃掉剩余空间 */
.home-side .profile-card {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;   /* 防止「关于我」胶囊按钮被拉伸成整宽 */
}

/* ============================================================
   微信内置浏览器提示（移动端全屏遮罩）
   ------------------------------------------------------------
   核心是 pointer-events: none —— 遮罩只负责「挡住内容 + 指引」，
   绝不拦截手势，否则用户点不到右上角「…」→「在浏览器打开」。
   显示由 /js/wechat-guard.js 添加 .show 控制，默认不渲染。
   ============================================================ */
#wechat-mobile-mask {
  position: fixed;
  inset: 0;
  z-index: 999999;            /* 高于 toast(99999) 与全屏菜单(10001)，微信里一律盖住 */
  display: none;
  color: #fff;
  background: rgba(28, 28, 30, 0.96);
  pointer-events: none;       /* 点击穿透：用户才能操作微信右上角菜单 */
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#wechat-mobile-mask.show {
  display: block;
}

/* 右上角虚线弯箭头：指向微信「…」菜单 */
.wechat-mask-arrow {
  position: absolute;
  top: calc(8px + env(safe-area-inset-top));
  right: 10px;
  width: 104px;
  height: 104px;
  color: #fff;
  opacity: 0.92;
}

/* 中间虚线提示框 */
.wechat-mask-tip {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: max-content;
  max-width: 84vw;
  padding: 18px 34px;
  border: 2px dashed rgba(255, 255, 255, 0.8);
  border-radius: 50px;
  font-size: 17px;
  line-height: 1.7;
  letter-spacing: 2px;
  text-align: center;
  font-family: "KaiTi", "STKaiti", "Songti SC", serif;
}

/* 底部模拟微信菜单的指示条 */
.wechat-mask-hint {
  position: absolute;
  top: 62%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.92);
  white-space: nowrap;
}

.wechat-mask-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  color: #000;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 1px;
}

/* 轻微呼吸动效，引导视线到右上角；尊重系统「减少动态效果」设置 */
@media (prefers-reduced-motion: no-preference) {
  #wechat-mobile-mask.show .wechat-mask-arrow {
    animation: wechatArrowNudge 1.8s ease-in-out infinite;
  }
}

@keyframes wechatArrowNudge {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* ============================================================
   状态页标题：居中、无左侧色条，保留下划线（跟随站点主题色）
   ============================================================ */
.status-heading {
  display: block;            /* 覆盖全局 .section-title 的 flex 横排 */
  text-align: center;
  margin: 0 0 40px;
}

.status-heading::before { display: none; }   /* 去掉标题前的红色竖条 */

/* 系统日志写入异常提示（管理状态页，仅 logsWriteFailures > 0 时渲染） */
.status-write-alert {
  margin: 0 0 20px;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(230, 0, 18, .06);
  border: 1px solid rgba(230, 0, 18, .28);
  color: var(--brand-color, #e60012);
  font-size: 13px;
  line-height: 1.6;
}
.status-write-alert strong { font-weight: 700; }
.status-write-alert p { margin: 6px 0 0; color: var(--text-weak, #6b7280); font-size: 12px; }
html.dark .status-write-alert { background: rgba(230, 0, 18, .12); }

.status-heading h2 {
  display: inline-block;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-strong);
  margin: 0 0 8px;
  padding-bottom: 12px;
  position: relative;
}

.status-heading h2::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  background: var(--brand-color, #e60012);   /* 动态注入的站点主题色 */
  border-radius: 2px;
}

/* 「数据每秒自动更新」独占一行 */
.status-heading p { display: block; margin: 0; }

/* 进度条宽度交给 CSS 变量（模板不再写 width 内联样式） */
.status-bar i { width: var(--pct, 0%); }

/* 趋势图 CPU 曲线固定红色，与 JS 绘制颜色、图例保持一致 */
.status-chart-legend .legend-cpu { background: #e60012; }

/* ============================================================
   公网状态页（复刻 demo：浅灰底 + 白卡片 + 状态条）
   作用域：.status-public，避免影响前台其它页面
   ============================================================ */
.section.status-public {
  --sp-bg: #f7f8fa;
  --sp-card: #ffffff;
  --sp-text: #111111;
  --sp-sub: #888888;
  --sp-light: #b0b0b0;
  --sp-border: #e5e7eb;
  --sp-success: #10b981;
  --sp-success-bg: #ecfdf5;
  --sp-warning: #f59e0b;
  --sp-warning-bg: #fffbeb;
  --sp-danger: #ef4444;
  --sp-danger-bg: #fef2f2;
  --sp-off: #e8ebef;

  font-family: 'HarmonyOS_Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
  background: var(--sp-bg);
  padding: 40px 20px 24px;
}

.status-public .sp-container { width: 100%; max-width: 860px; margin: 0 auto; }

/* ---------- 头部 ---------- */
.status-public .page-header {
  text-align: center;
  margin: 0 0 28px;
  background: transparent;   /* 防止继承全局 header 的白色底栏与阴影 */
  box-shadow: none;
  border: 0;
}
.status-public .page-header h1 {
  font-size: 32px;
  font-weight: 800;
  color: var(--sp-text);
  letter-spacing: 1px;
  margin: 0;
}
.status-public .page-header h1::after {
  content: '';
  display: block;
  width: 32px;
  height: 3px;
  background-color: var(--brand-color, #e60012);
  border-radius: 2px;
  margin: 12px auto 0;
}
.status-public .page-header p { font-size: 14px; color: var(--sp-sub); margin: 12px 0 0; }

/* ---------- 总览横幅 ---------- */
.status-public .status-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
  border: 1px solid transparent;
}
.status-public .status-banner.is-ok {
  background: var(--sp-success-bg);
  border-color: rgba(16, 185, 129, .25);
}
.status-public .status-banner.is-bad {
  background: var(--sp-danger-bg);
  border-color: rgba(239, 68, 68, .25);
}
.status-public .status-banner.is-warn {
  background: var(--sp-warning-bg);
  border-color: rgba(245, 158, 11, .28);
}
.status-public .status-icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  background: rgba(255, 255, 255, .55);
}
.status-public .status-banner.is-ok .status-icon { color: var(--sp-success); }
.status-public .status-banner.is-warn .status-icon { color: var(--sp-warning); }
.status-public .status-banner.is-bad .status-icon { color: var(--sp-danger); }
.status-public .status-banner.is-loading .status-icon,
.status-public .status-banner.is-unknown .status-icon { color: var(--sp-sub); }
.status-public .status-banner.is-loading,
.status-public .status-banner.is-unknown {
  background: #f3f4f6;
  border-color: var(--sp-border);
}
.status-public .status-banner h3 { margin: 0 0 4px; font-size: 15px; font-weight: 700; }
.status-public .status-banner.is-ok h3 { color: var(--sp-success); }
.status-public .status-banner.is-warn h3 { color: var(--sp-warning); }
.status-public .status-banner.is-bad h3 { color: var(--sp-danger); }
.status-public .status-banner.is-loading h3,
.status-public .status-banner.is-unknown h3 { color: var(--sp-sub); }
.status-public .status-banner p { margin: 0; font-size: 13px; color: var(--sp-sub); }

/* ---------- 卡片 ---------- */
.status-public .card {
  background: var(--sp-card);
  border: 1px solid var(--sp-border);
  border-radius: 12px;
  margin-bottom: 24px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .02);
}
.status-public .card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--sp-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.status-public .card-header h2 { font-size: 16px; font-weight: 700; color: var(--sp-text); margin: 0; }
.status-public .time-switcher { display: flex; gap: 12px; align-items: center; font-size: 13px; color: var(--sp-sub); }
.status-public .time-label { font-weight: 500; color: var(--sp-text); white-space: nowrap; }

/* ---------- 服务状态 ---------- */
.status-public .service-list { padding: 20px; display: flex; flex-direction: column; gap: 24px; }
.status-public .service-item { display: flex; flex-direction: column; gap: 10px; }
.status-public .service-info { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; }
.status-public .service-name {
  font-weight: 600;
  color: var(--sp-text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-public .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sp-success); flex: 0 0 auto; }
.status-public .dot.is-bad { background: var(--sp-danger); }
.status-public .dot.is-muted { background: var(--sp-light); }
.status-public .service-uptime { color: var(--sp-sub); font-size: 13px; white-space: nowrap; }
.status-public .service-uptime.is-ok { color: var(--sp-success); }
.status-public .service-uptime.is-warn { color: var(--sp-warning); }
.status-public .service-uptime.is-bad { color: var(--sp-danger); }
.status-public .service-empty { color: var(--sp-sub); font-size: 14px; }

.status-public .status-bars { display: flex; gap: 1px; height: 36px; }
.status-public .status-bar {
  flex: 1;
  height: 100%;              /* 覆盖前台旧状态页的 .status-bar { height: 8px } */
  margin: 0;
  border-radius: 2px;
  background: var(--sp-success);
  cursor: pointer;
  position: relative;
  overflow: visible;
}
.status-public .status-bar.warning { background: var(--sp-warning); }
.status-public .status-bar.danger { background: var(--sp-danger); }
.status-public .status-bar.unknown { background: #d9dde3; }
.status-public .status-bar::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(5px);
  background: #1f2937;
  color: #fff;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
}
.status-public .status-bar:hover::after { opacity: 1; }

/* ---------- 备份 ---------- */
.status-public .backup-grid { display: flex; flex-wrap: wrap; padding: 20px; gap: 32px; }
.status-public .backup-info { display: flex; flex-direction: column; gap: 8px; }
.status-public .backup-label { font-size: 13px; color: var(--sp-sub); }
.status-public .backup-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--sp-success);
  display: flex;
  align-items: center;
  gap: 6px;
}
.status-public .backup-val.is-bad { color: var(--sp-danger); }
.status-public .backup-val.is-muted { color: var(--sp-sub); }
.status-public .backup-val.is-neutral { color: var(--sp-text); }

/* ---------- 异常记录 ---------- */
.status-public .anomaly-list { padding: 0; margin: 0; list-style: none; }
.status-public .anomaly-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--sp-border);
  font-size: 14px;
  color: var(--sp-text);
}
.status-public .anomaly-item:last-child { border-bottom: none; }
.status-public .anomaly-main { min-width: 0; }
.status-public .anomaly-time {
  color: var(--sp-sub);
  font-family: 'HarmonyOS_Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  white-space: nowrap;
}
.status-public .anomaly-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  margin-right: 8px;
}
.status-public .anomaly-tag.danger { background: var(--sp-danger-bg); color: var(--sp-danger); }
.status-public .anomaly-tag.success { background: var(--sp-success-bg); color: var(--sp-success); }
.status-public .anomaly-empty { padding: 16px 20px; color: var(--sp-sub); font-size: 14px; }

/* ---------- 底部倒计时 ---------- */
.status-public .footer-timer {
  text-align: center;
  font-size: 13px;
  color: var(--sp-sub);
  margin-top: 40px;
  padding-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.status-public .footer-timer svg { animation: spTimerSpin 3s linear infinite; }
@keyframes spTimerSpin { 100% { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .status-public .footer-timer svg { animation: none; }
}

/* ---------- 深色模式 ---------- */
.dark .section.status-public,
html.dark .status-public {
  --sp-bg: #0f1216;
  --sp-card: #15181f;
  --sp-text: #e6e9ef;
  --sp-sub: #98a1b0;
  --sp-light: #5d6a7d;
  --sp-border: #242a36;
  --sp-success-bg: rgba(16, 185, 129, .10);
  --sp-warning-bg: rgba(245, 158, 11, .12);
  --sp-danger-bg: rgba(239, 68, 68, .12);
  --sp-off: #222833;
}
.dark .status-public .status-banner.is-loading,
.dark .status-public .status-banner.is-unknown { background: #1b1f28; }
.dark .status-public .status-bar.unknown { background: #2a3140; }
.dark .status-public .status-bar::after { background: #0b0d11; border: 1px solid #2a3140; }

/* ---------- 移动端 ---------- */
@media (max-width: 600px) {
  .section.status-public { padding: 24px 12px 16px; }
  .status-public .page-header h1 { font-size: 26px; }
  .status-public .status-bars { height: 24px; gap: 1px; }
  .status-public .card-header { padding: 12px 16px; flex-direction: column; align-items: flex-start; gap: 8px; }
  .status-public .service-list { padding: 16px; gap: 20px; }
  .status-public .service-info { flex-direction: column; align-items: flex-start; gap: 6px; }
  .status-public .backup-grid { flex-direction: column; gap: 16px; padding: 16px; }
  .status-public .anomaly-item { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* ============================================================
   status-public v2：运行信息 + 7×24 热力图（迁移自 demo）
   作用域：.status-public，避免影响前台其它页面
   ============================================================ */
.status-public .runbar {
  background: var(--sp-card);
  border: 1px solid var(--sp-border);
  border-radius: 12px;
  margin-bottom: 18px;
  overflow: hidden;
}
.status-public .run-now {
  padding: 14px 20px;
  border-bottom: 1px solid var(--sp-border);
  font-size: 13.5px;
  color: var(--sp-sub);
}
.status-public .run-now b { color: var(--sp-text); font-weight: 700; font-variant-numeric: tabular-nums; }
.status-public .run-now .sep { margin: 0 10px; color: var(--sp-light); }
.status-public .run-facts { display: grid; grid-template-columns: repeat(3, 1fr); }
.status-public .run-facts .rf { padding: 16px 20px; border-left: 1px solid var(--sp-border); }
.status-public .run-facts .rf:first-child { border-left: none; }
.status-public .run-facts .l { font-size: 12px; color: var(--sp-sub); margin-bottom: 4px; }
.status-public .run-facts .v { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.status-public .run-facts .v small { font-size: 12px; font-weight: 500; color: var(--sp-light); margin-left: 2px; }

.status-public .legend { display: flex; gap: 14px; font-size: 12px; color: var(--sp-sub); flex-wrap: wrap; }
.status-public .legend span { display: inline-flex; align-items: center; gap: 6px; }
.status-public .legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.status-public .i-ok { background: var(--sp-success); }
.status-public .i-warn { background: var(--sp-warning); }
.status-public .i-bad { background: var(--sp-danger); }
.status-public .i-off { background: var(--sp-off); border: 1px solid var(--sp-border); }

.status-public .heat { padding: 20px 20px 12px; overflow-x: auto; overflow-y: hidden; }
.status-public .grid {
  display: grid;
  grid-template-columns: 44px repeat(24, 18px);
  gap: 4px;
  width: max-content;
  margin: 0 auto;
}
.status-public .grid .h { font-size: 10px; color: var(--sp-sub); text-align: center; font-variant-numeric: tabular-nums; }
.status-public .grid .d {
  font-size: 11px;
  color: var(--sp-sub);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 4px;
}
.status-public .cell {
  height: 16px;
  border-radius: 3px;
  background: var(--sp-off);
  cursor: pointer;
  transition: filter .15s ease;
}
.status-public .cell:hover { filter: brightness(1.08); }
.status-public .cell.ok { background: color-mix(in srgb, var(--sp-success) 78%, transparent); }
/* 性能异常 = 黄色；服务中断 = 红色 */
.status-public .cell.warn { background: var(--sp-warning); }
.status-public .cell.bad { background: var(--sp-danger); }

/* 悬停气泡：fixed 定位，横向滚动时不被热力图容器裁剪 */
.sp-tip {
  position: fixed;
  z-index: 9999;
  background: #1f2937;
  color: #fff;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  display: none;
  transform: translate(-50%, -100%);
}
.sp-tip.below { transform: translate(-50%, 0); }
html.dark .sp-tip { background: #0b0d11; border: 1px solid #2a3140; }

.status-public .heat-note {
  padding: 10px 20px 18px;
  font-size: 12px;
  color: var(--sp-sub);
  border-top: 1px dashed var(--sp-border);
  margin-top: 10px;
}
.status-public .heat-note b { color: var(--sp-text); }

.status-public .maint { padding: 0; margin: 0; list-style: none; }
.status-public .maint li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--sp-border);
  font-size: 14px;
}
.status-public .maint li:last-child { border-bottom: none; }
.status-public .maint .t { color: var(--sp-sub); font-variant-numeric: tabular-nums; white-space: nowrap; }
.status-public .maint-empty { color: var(--sp-sub); }
.status-public .tag { font-size: 12px; padding: 2px 8px; border-radius: 4px; margin-right: 8px; font-weight: 500; }
.status-public .tag.success { background: var(--sp-success-bg); color: var(--sp-success); }
.status-public .tag.warn { background: var(--sp-warning-bg); color: var(--sp-warning); }
.status-public .tag.danger { background: var(--sp-danger-bg); color: var(--sp-danger); }

@media (max-width: 600px) {
  .status-public .run-facts { grid-template-columns: 1fr 1fr; }
  .status-public .run-facts .rf:nth-child(3) {
    border-left: none;
    border-top: 1px solid var(--sp-border);
    grid-column: 1 / -1;
  }
  .status-public .grid { grid-template-columns: 34px repeat(24, 14px); gap: 3px; }
  .status-public .cell { height: 14px; }
}

/* ============================================================
   评论区（文章详情页，脚本 /js/comments.js）
   ------------------------------------------------------------
   所有用户内容均由 JS textContent 写入；这里的 white-space: pre-wrap
   只负责保留用户输入的换行，不解析任何 HTML。
   ============================================================ */
/* 评论区所在 section：独立块级容器，正常文档流。
   z-index 必须低于 header（header z-index: 10000 / has-hero 1002），
   避免任何情况下评论标题/卡片盖住顶部导航；scroll-margin-top 防止锚点被吸顶头遮挡。 */
.comment-section {
  position: relative;
  z-index: 1;
  padding: 8px 0 72px;
  scroll-margin-top: 96px;
}

/* 静态镜像站提示条：纯文本、无链接，颜色跟随主题 */
.comment-static-tip {
  margin: 40px 0 0;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-alt);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}
/* 提示条与静态评论容器之间不再叠加 40px */
.comment-static-tip + .comment-root { margin-top: 16px; }

/* 评论根节点：强制静态定位、无负边距，只负责占位，不做任何悬浮/吸顶 */
.comment-root {
  position: static;
  display: block;
  width: 100%;
  margin: 40px 0 0;
  padding: 0;
  z-index: auto;
  clear: both;
}

/* 评论容器：透明、无白底、无边框、无阴影，只做布局占位，避免嵌套白框 */
.comment-panel {
  position: static;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

/* 标题直接位于评论容器，不再包一层 head；不画任何分割线 / 红线 */
.comment-panel-title {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-strong);
  border: none;
}
.comment-count {
  display: inline-block;
  margin-left: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.comment-form-wrap { margin-bottom: 24px; }
.comment-form { display: flex; flex-direction: column; gap: 12px; }
.comment-input {
  width: 100%;
  min-height: 110px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
  resize: vertical;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s, background 0.2s;
}
.comment-input:focus { border-color: var(--primary); background: var(--card-bg); box-shadow: 0 0 0 3px var(--accent-soft); }

.comment-form-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.comment-counter { font-size: 12px; color: var(--text-faint); margin-left: auto; font-variant-numeric: tabular-nums; }
.comment-counter.is-over { color: #ef4444; }

.comment-reply-hint { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }
.comment-reply-hint[hidden] { display: none; }
.comment-reply-text { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comment-reply-cancel { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 12px; padding: 2px 4px; font-family: inherit; }
.comment-reply-cancel:hover { text-decoration: underline; }

.comment-submit {
  padding: 9px 20px;
  border-radius: 8px;
  border: none;
  background: var(--hw-red);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, transform 0.1s;
}
.comment-submit:hover { background: var(--hw-red-dark); }
.comment-submit:active { transform: scale(0.98); }
.comment-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.comment-login-tip { font-size: 14px; color: var(--text-muted); padding: 16px; border: 1px dashed var(--border); border-radius: 10px; text-align: center; }
.comment-login-link { color: var(--primary); margin-left: 6px; font-weight: 600; text-decoration: none; }
.comment-login-link:hover { text-decoration: underline; }

.comment-list { display: flex; flex-direction: column; gap: 4px; }
.comment-item { padding: 16px 0; border-top: 1px solid var(--border); }
.comment-item:first-child { border-top: none; padding-top: 0; }

/* 第一行：用户名 + 角色标签 + 时间 + 回复按钮（不再有头像/圆圈） */
.comment-item-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.comment-author { font-size: 14px; font-weight: 600; color: var(--text-strong); }
.comment-role { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--surface-muted); color: var(--text-muted); border: 1px solid var(--border); }
.comment-role-admin { background: var(--accent-soft); color: var(--primary); border-color: transparent; }
.comment-reply-to { font-size: 12px; color: var(--text-muted); }
.comment-time { font-size: 12px; color: var(--text-faint); }

/* 第二行：正文 */
.comment-content { font-size: 14px; line-height: 1.75; color: var(--text); white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; }

/* 回复按钮固定在首行右侧，与小号文字按钮风格一致 */
.comment-act-reply { margin-left: auto; background: none; border: none; padding: 2px 0; font-size: 12px; color: var(--text-muted); cursor: pointer; font-family: inherit; }
.comment-act-reply:hover { color: var(--primary); }

.comment-children { margin: 12px 0 0 24px; padding-left: 16px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.comment-children .comment-item { padding: 0; border-top: none; }

.comment-empty { padding: 32px 0; text-align: center; font-size: 14px; color: var(--text-muted); }
.comment-loading { padding: 16px 0; text-align: center; font-size: 13px; color: var(--text-faint); }

@media (max-width: 600px) {
  .comment-panel { padding: 18px 16px; border-radius: 12px; }
  .comment-panel-title { font-size: 18px; }
  .comment-input { min-height: 96px; font-size: 15px; }
  .comment-children { margin-left: 20px; padding-left: 12px; }
  .comment-form-foot { gap: 8px; }
  .comment-counter { order: 3; width: 100%; margin-left: 0; text-align: right; }
  .comment-submit { padding: 10px 18px; }
}

/* ============================================================
   前台评论：移动端底部悬浮输入（≤768px）
   - 三个移动端组件默认强制隐藏，PC 端零影响
   - --keyboard-height 由 comments.js 依据 visualViewport 计算
   ============================================================ */
.mobile-bottom-bar,
.mobile-mask,
.mobile-input-panel { display: none !important; }

/* 页脚哨兵（替代内联 style：1px 高度 + 负 margin 抵消占位） */
.footer-sentinel { height: 1px; margin-bottom: -1px; }

@media (max-width: 768px) {
  /* 移动端隐藏 PC 内嵌输入框 */
  .pc-only { display: none !important; }

  .mobile-bottom-bar {
    display: flex !important;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    align-items: center;
    gap: 12px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    transition: transform 0.3s ease-in-out;
  }
  .mobile-bottom-bar.hidden { transform: translateY(100%); }

  .mobile-fake-input {
    flex: 1;
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--surface-alt);
    color: var(--text-faint);
    font-size: 14px;
    line-height: 1.4;
  }

  .mobile-mask {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .mobile-mask.active {
    display: block !important;
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-input-panel {
    display: flex !important;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1001;
    flex-direction: column;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
    background: var(--card-bg);
    border-radius: 20px 20px 0 0;
    transform: translateY(calc(100% - var(--keyboard-height, 0px)));
    transition: transform 0.25s ease-out;
  }
  .mobile-input-panel.active {
    transform: translateY(calc(0px - var(--keyboard-height, 0px)));
  }

  .mobile-panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
  .mobile-panel-title { font-size: 15px; font-weight: 700; color: var(--text-strong); }
  .mobile-panel-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
  }
  .mobile-panel-close:hover { background: var(--surface-muted); color: var(--text-strong); }

  .mobile-comment-input {
    width: 100%;
    min-height: 96px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-alt);
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.7;
    resize: none;
    outline: none;
  }
  .mobile-comment-input:focus { border-color: var(--primary); background: var(--card-bg); }

  .mobile-panel-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; gap: 12px; }
  .mobile-char-count { font-size: 12px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
  .mobile-send-btn {
    padding: 9px 20px;
    border: none;
    border-radius: 8px;
    background: var(--hw-red);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
  }
  .mobile-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

  /* 悬浮条会覆盖页面末尾，评论区预留安全高度 */
  .comment-section { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
}
