:root, html[data-theme="light"] {
  --bg-canvas: #F7F7F8;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F1F1F3;
  --text-primary: #141416;
  --text-secondary: #52525B;
  --text-muted: #8E8E93;
  --border: #E4E4E7;
  --border-strong: #D4D4D8;
  --accent: #18181B;
  --accent-fg: #FFFFFF;
  --status-ok: #10B981;
  --sidebar-w: 236px;
  --radius: 8px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Noto Sans SC', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

html[data-theme="dark"] {
  --bg-canvas: #101012;
  --bg-surface: #161618;
  --bg-subtle: #1E1E22;
  --text-primary: #F4F4F5;
  --text-secondary: #A1A1AA;
  --text-muted: #71717A;
  --border: #27272A;
  --border-strong: #3F3F46;
  --accent: #F4F4F5;
  --accent-fg: #141416;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

.site-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

#site-sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  padding: 22px 16px 16px;
  z-index: 50;
  user-select: none;
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
  cursor: pointer;
}

.sidebar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: var(--text-primary);
  color: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.sidebar-name {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.sidebar-nav-wrap {
  flex: 1;
  overflow-y: auto;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.nav-item:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.nav-item[aria-current="page"] {
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-weight: 600;
}

.nav-item svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.85;
  flex-shrink: 0;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.sidebar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.sidebar-row-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 12px;
}

.backend-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.backend-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}

.backend-status[data-backend-status="online"] .backend-status-dot {
  background: var(--status-ok);
}

.backend-status[data-backend-status="offline"] .backend-status-dot {
  background: #EF4444;
}

.theme-options {
  display: inline-flex;
  background: var(--bg-subtle);
  padding: 2px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.theme-option {
  width: 25px;
  height: 21px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.12s;
}

.theme-option[aria-pressed="true"] {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.site-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  width: 100%;
}

#page-content {
  width: 100%;
  max-width: 960px;
  min-width: 0;
  margin: 0 auto;
  padding: 40px 40px 80px;
}

/* 页脚：侧边栏底部（版权 + 备案徽章，单色，跟随黑白主题） */
.sidebar-site-footer {
  margin-top: -2px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
  min-width: 0;
}

.sidebar-site-footer .footer-meta[hidden] { display: none !important; }

.sidebar-site-footer .footer-meta {
  display: block;
  word-break: break-word;
}

.sidebar-site-footer .footer-copy {
  display: block;
  line-height: 1.55;
  font-size: 10px;
  letter-spacing: -0.15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-site-footer .footer-rights {
  display: inline;
  white-space: nowrap;
  opacity: .85;
}

.sidebar-site-footer .footer-meta strong {
  color: var(--text-secondary);
  font-weight: 500;
}

.footer-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

/* 只显示图标；备案文字放浮窗里，鼠标悬停 / 键盘聚焦时出现 */
.footer-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.footer-badge:hover,
.footer-badge:focus-visible {
  color: var(--text-primary);
  border-color: var(--text-primary);
  outline: none;
}

.footer-badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.footer-badge-icon svg {
  width: 15px;
  height: 15px;
  display: block;
}

.footer-badge-tip {
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.5;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-2px, -50%);
  transition: opacity 0.12s ease, transform 0.12s ease;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
  z-index: 80;
}

.footer-badge:hover .footer-badge-tip,
.footer-badge:focus-visible .footer-badge-tip {
  opacity: 1;
  visibility: visible;
  transform: translate(0, -50%);
}

.footer-extra {
  font-size: 10.5px;
  color: var(--text-muted);
  word-break: break-word;
}

/* 手机端不显示页脚（侧边栏本身也不显示） */
@media (max-width: 860px) {
  .sidebar-site-footer {
    display: none;
  }
}

.home-minimal {
  min-height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 760px;
}

.home-title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.25;
  margin-bottom: 14px;
}

.home-bio {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.75;
}

.home-socials {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
}

.social-link {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.social-link:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.social-link svg {
  width: 16px;
  height: 16px;
}

.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  gap: 12px;
  flex-wrap: wrap;
}

.module-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.page-wrap-with-aside {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 32px;
  align-items: start;
  width: 100%;
}

.blog-list-main {
  min-width: 0;
  width: 100%;
}

.blog-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.subnav-btn {
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 13px;
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-weight: 500;
  flex-shrink: 0;
}

.blog-search {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  width: 190px;
  max-width: 100%;
}

.blog-search input {
  width: 100%;
  font-size: 12.5px;
}

.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.post-row {
  padding: 16px 4px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  min-width: 0;
}

/* 列表项改为真实 <a> 链接（SEO 可抓取），视觉与原 li 保持一致 */
.post-row-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.post-row:hover .post-row-title {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.post-row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  min-width: 0;
}

.post-row-title {
  font-size: 15px;
  font-weight: 600;
  min-width: 0;
  overflow-wrap: break-word;
}

.post-row-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.post-row-firstline {
  font-size: 13.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.blog-stats {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.blog-stats-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
  letter-spacing: 0.04em;
}

.blog-stats-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.blog-stats-item {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.blog-stats-value {
  font-family: var(--font-mono);
  color: var(--text-primary);
  font-weight: 500;
}

.moments-feed {
  max-width: 640px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.moment-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  min-width: 0;
}

.moment-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.moment-body {
  font-size: 14px;
  word-break: break-word;
  line-height: 1.7;
}

.moment-body p {
  margin-bottom: 10px;
}

.moment-body p:last-child {
  margin-bottom: 0;
}

.moment-body ul, .moment-body ol,
.reader-content ul, .reader-content ol {
  margin: 0 0 16px;
  padding-left: 1.6em;
}
.moment-body .task-list, .reader-content .task-list { list-style: none; padding-left: 0; }
.moment-body .task-list-item, .reader-content .task-list-item { list-style: none; }
.moment-body .task-list-item input, .reader-content .task-list-item input { margin-right: 6px; accent-color: var(--status-ok); }
.moment-body table, .reader-content table { border-collapse: collapse; width: 100%; }
.moment-body th, .moment-body td,
.reader-content th, .reader-content td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}
.moment-body th, .reader-content th { background: var(--bg-subtle); font-weight: 600; }
.moment-body .markdown-table-wrap, .reader-content .markdown-table-wrap { max-width: 100%; overflow-x: auto; margin: 12px 0 18px; }

.moment-body a {
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: break-all;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  width: 100%;
}

.tool-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  transition: border-color 0.15s ease;
}

.tool-card:hover {
  border-color: var(--text-primary);
}

.tool-icon {
  width: 36px;
  height: 36px;
  border-radius: 7px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
  overflow: hidden;
}

.tool-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tool-info {
  min-width: 0;
  flex: 1;
}

.tool-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.probe-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--text-secondary);
}

.probe-actions a:hover { color: var(--text-primary); }
.probe-actions button { padding: 5px 10px; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }
.probe-actions button:hover { background: var(--bg-subtle); }
.probe-actions button:disabled { opacity: 0.5; cursor: wait; }

.probe-overview {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
}

.probe-overview strong { color: var(--text-primary); font-size: 14px; }
.probe-overview i, .probe-state i { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--status-ok); }
.probe-overview i[data-state="warn"] { background: #F59E0B; }
.probe-overview i[data-state="false"] { background: #EF4444; }
.probe-server-list { display: flex; flex-direction: column; }

.probe-server-card {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.probe-server-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.probe-server-heading h2 { display: inline; font-size: 15px; font-weight: 600; }
.probe-server-heading > div > span { margin-left: 9px; color: var(--text-muted); font-size: 12px; }
.probe-state { flex: 0 0 auto; color: var(--status-ok); font-size: 12px; }
.probe-state[data-online="false"] { color: #EF4444; }
.probe-state[data-online="false"] i { background: #EF4444; }

.probe-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.probe-metrics > div { min-width: 0; }
.probe-metrics small, .probe-metrics strong { display: block; }
.probe-metrics small { color: var(--text-muted); font-size: 11px; }
.probe-metrics strong { margin-top: 3px; font-family: var(--font-mono); font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }

.probe-ping-list { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; color: var(--text-secondary); font-family: var(--font-mono); font-size: 12px; }
.probe-ping-list small { margin-right: 6px; color: var(--text-muted); font-family: var(--font-sans); }
.probe-server-updated { margin-top: 12px; color: var(--text-muted); font-size: 11px; }

.status-overview {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.status-pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--status-ok);
  display: inline-block;
  margin-right: 10px;
}

.status-service-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.status-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  min-width: 0;
}

.status-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 13.5px;
  font-weight: 600;
}

.status-uptime-bars {
  display: grid;
  grid-template-columns: repeat(45, minmax(0, 1fr));
  gap: 3px;
  height: 22px;
  width: 100%;
}

.uptime-bar {
  background: var(--status-ok);
  opacity: 0.85;
  border-radius: 2px;
  height: 100%;
}

.empty-box {
  padding: 56px 20px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 13px;
}

/* 文章阅读页 */
.article-reader {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  cursor: pointer;
}

.back-btn:hover {
  color: var(--text-primary);
}

.reader-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 10px;
  overflow-wrap: break-word;
}

.reader-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

/* 文章页底部：MIT 许可证声明 */
.article-license {
  /* 分隔线与标题下方那条线（.reader-meta）等长：整行铺满，内容仍保持 760px 居中 */
  width: 100%;
  max-width: none;
  margin: 28px 0 0;
  padding: 16px max(0px, calc((100% - 760px) / 2)) 0;
  border-top: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-muted);
  text-align: center;
}
.article-license a {
  color: var(--text-secondary);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.article-license a:hover { color: var(--text-primary); }

.reader-content {
  font-size: 15px;
  line-height: 1.8;
  width: 100%;
  max-width: 760px; /* 与评论区同宽，列表页→文章页无宽度跳变 */
  overflow-wrap: break-word;
  word-break: break-word;
}

.reader-content p {
  margin-bottom: 16px;
}

.reader-content h2,
.reader-content h3 {
  margin: 28px 0 12px;
  font-weight: 600;
}

.reader-content a {
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: break-all;
}

.reader-content pre {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px;
  overflow-x: auto;
  max-width: 100%;
  font-family: var(--font-mono);
  font-size: 12.5px;
  margin-bottom: 16px;
}

.reader-content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-subtle);
  padding: 2px 5px;
  border-radius: 4px;
}

.reader-content img,
.moment-body img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--border);
  margin: 10px 0;
  display: block;
}

/* ============================================================================
 * 评论区：多级嵌套（层中层）+ 缩进结构 + 推特风格黑白认证徽章
 * ============================================================================ */
.comments-section {
  /* 分隔线铺满整行（与 .reader-meta 的线等长），内容与正文左对齐、同为 760px */
  margin: 48px 0 0;
  padding: 32px 0 0;
  border-top: 1px solid var(--border);
  width: 100%;
  max-width: none;
}

/* 评论区里的每一块都与正文同宽同起点，不再居中缩进 */
.comments-section > * {
  max-width: 760px;
}

.comments-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
}

.comments-title {
  font-size: 16px;
  font-weight: 600;
}

.comments-note {
  font-size: 12px;
  color: var(--text-muted);
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

/* 正在回复某条评论的状态提示横幅 */
.replying-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--text-primary);
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.replying-banner[data-active="true"] {
  display: flex;
}

.replying-cancel-btn {
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.replying-cancel-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
}

.comment-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.comment-input,
.comment-textarea {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 13.5px;
  transition: border-color 0.15s ease;
  width: 100%;
}

.comment-input:focus,
.comment-textarea:focus {
  border-color: var(--text-primary);
}

.comment-textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.6;
}

.comment-submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.captcha-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.captcha-question {
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 5px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}

.captcha-input {
  width: 76px;
  text-align: center;
  font-family: var(--font-mono);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13.5px;
}

.captcha-input:focus {
  border-color: var(--text-primary);
}

.comment-submit-btn {
  padding: 8px 18px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-fg);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.comment-submit-btn:hover {
  opacity: 0.88;
}

.comment-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.comment-feedback {
  font-size: 12.5px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.comment-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.comment-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.comment-item:last-child {
  border-bottom: none;
}

.comment-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 12.5px;
}

.comment-author-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.comment-author {
  font-weight: 600;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.comment-reply-to {
  font-size: 12px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.comment-reply-to strong {
  color: var(--text-secondary);
  font-weight: 500;
}

.comment-meta-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.comment-date {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
}

.comment-reply-btn {
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 1px 6px;
  border-radius: 4px;
  transition: color 0.12s ease, background-color 0.12s ease;
}

.comment-reply-btn:hover {
  color: var(--text-primary);
  background: var(--bg-subtle);
}

.comment-body {
  font-size: 14px;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.65;
}

/* 子评论与站长回复的缩进容器（与主评论形成明显缩进，绝不对齐） */
.comment-children {
  list-style: none;
  margin-top: 12px;
  margin-left: 24px;
  padding-left: 16px;
  border-left: 2px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 层中层继续嵌套时的缩进 */
.comment-children .comment-children {
  margin-left: 18px;
  padding-left: 14px;
}

.comment-child-item {
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 7px;
}

/* 站长回复块：同样位于缩进层级内，带有更醒目的边框强调 */
.comment-admin-reply {
  padding: 11px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--text-primary);
  border-radius: 6px;
}

/* 推特/X 认证对勾徽章（纯黑白、随日夜间主题自动反转颜色） */
.verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  vertical-align: middle;
}

.verified-badge svg {
  width: 16px;
  height: 16px;
  display: block;
}

.verified-badge-bg {
  fill: var(--text-primary);
}

.verified-badge-check {
  stroke: var(--bg-surface);
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.ext-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}

.ext-modal-backdrop[data-open="true"] {
  opacity: 1;
  pointer-events: auto;
}

.ext-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  width: 100%;
  max-width: 420px;
  padding: 22px 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  transform: translateY(6px);
  transition: transform 0.16s ease;
}

.ext-modal-backdrop[data-open="true"] .ext-modal {
  transform: translateY(0);
}

.ext-modal-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ext-modal-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.55;
}

.ext-modal-url {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 11px;
  word-break: break-all;
  margin-bottom: 18px;
}

.ext-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.ext-btn {
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
}

.ext-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.ext-btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}

.ext-btn-primary:hover {
  opacity: 0.9;
  color: var(--accent-fg);
}

.mobile-dock {
  display: none;
  position: fixed;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 5px 8px;
  gap: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  z-index: 90;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.mobile-dock::-webkit-scrollbar {
  display: none;
}

.mobile-dock-btn {
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

.mobile-dock-btn[aria-current="page"] {
  background: var(--text-primary);
  color: var(--bg-surface);
  font-weight: 500;
}

@media (max-width: 860px) {
  #site-sidebar {
    display: none;
  }
  .site-main {
    margin-left: 0;
    width: 100%;
  }
  #page-content {
    padding: 24px 16px 24px;
    width: 100%;
    max-width: 100%;
  }
  .page-wrap-with-aside {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .blog-aside {
    display: none !important;
  }
  .home-minimal {
    min-height: calc(100vh - 160px);
    max-width: 100%;
  }
  .home-title {
    font-size: 24px;
  }
  .home-bio {
    font-size: 14.5px;
  }
  .blog-bar {
    gap: 10px;
  }
  .blog-search {
    flex: 1;
    width: auto;
    min-width: 140px;
  }
  .blog-search input,
  .comment-input,
  .comment-textarea,
  .captcha-input {
    font-size: 16px;
  }
  .comment-form-row {
    grid-template-columns: 1fr;
  }
  .comment-children {
    margin-left: 14px;
    padding-left: 10px;
  }
  .comment-children .comment-children {
    margin-left: 10px;
    padding-left: 8px;
  }
  .tools-grid {
    grid-template-columns: 1fr;
  }
  .status-uptime-bars {
    gap: 2px;
    height: 18px;
  }
  .status-card {
    padding: 14px 16px;
  }
  .probe-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mobile-dock {
    display: flex;
    max-width: calc(100vw - 24px);
    overflow-x: auto;
  }
}

/* 窄屏（iPhone SE / 13 mini 等 ≤430px）：底部导航压缩到一屏放得下，不再横向滚动 */
@media (max-width: 430px) {
  .mobile-dock {
    gap: 2px;
    padding: 5px 6px;
    max-width: calc(100vw - 16px);
  }

  .mobile-dock-btn {
    padding: 6px 7px;
    font-size: 12px;
  }
}

/* ============================================================================
 * Markdown 增强：引用 / 分隔线 / 表格横向滚动 / 代码块（语言 + 行号 + 复制 + 灯箱）
 * / mermaid 流程图 / 图片灯箱
 * ============================================================================ */
.reader-content blockquote,
.moment-body blockquote {
  margin: 18px 0;
  padding: 10px 16px;
  border-left: 3px solid var(--border-strong);
  border-radius: 0 6px 6px 0;
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.reader-content blockquote p:last-child,
.moment-body blockquote p:last-child {
  margin-bottom: 0;
}

.reader-content blockquote blockquote,
.moment-body blockquote blockquote {
  margin: 10px 0 0;
  background: transparent;
  border-left-color: var(--border);
}

.reader-content hr,
.moment-body hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 26px 0;
}

.reader-content mark,
.moment-body mark {
  background: #FDE68A;
  color: #141416;
  padding: 0 3px;
  border-radius: 3px;
}

html[data-theme="dark"] .reader-content mark,
html[data-theme="dark"] .moment-body mark {
  background: #4A4116;
  color: #FDE68A;
}

.reader-content del,
.moment-body del {
  color: var(--text-muted);
}

.markdown-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  margin-bottom: 16px;
}

.reader-content .markdown-table-wrap table,
.moment-body .markdown-table-wrap table {
  margin-bottom: 0;
  min-width: 100%;
}

.reader-content ul.task-list {
  list-style: none;
  padding-left: 2px;
}

.reader-content li.task-list-item input {
  margin-right: 6px;
  vertical-align: 1px;
}

.reader-content img.md-image,
.moment-body img.md-image {
  cursor: zoom-in;
  transition: opacity .12s ease;
}

.reader-content img.md-image:hover,
.moment-body img.md-image:hover {
  opacity: .92;
}

/* 代码块：头部工具条 + 行号 + 灯箱按钮 */
.code-block {
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-subtle);
  overflow: hidden;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px 6px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}

.code-lang {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .3px;
  color: var(--text-muted);
  text-transform: lowercase;
}

.code-actions {
  display: flex;
  gap: 4px;
}

.code-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 11.5px;
  line-height: 1;
  padding: 5px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: background .14s ease, color .14s ease;
}

.code-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border-color: var(--border);
}

.code-btn.is-done {
  color: var(--status-ok);
}

.reader-content .code-block pre.code-pre,
.moment-body .code-block pre.code-pre {
  margin: 0;
  padding: 12px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow-x: auto;
  counter-reset: md-code-line;
}

.code-pre code {
  display: block;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  background: none;
  padding: 0;
  border-radius: 0;
}

.code-pre .code-line {
  display: block;
  counter-increment: md-code-line;
  padding: 0 14px 0 52px;
  position: relative;
  white-space: pre;
}

.code-pre .code-line::before {
  content: counter(md-code-line);
  position: absolute;
  left: 0;
  width: 36px;
  padding-right: 10px;
  text-align: right;
  color: var(--text-muted);
  opacity: .55;
  user-select: none;
  -webkit-user-select: none;
}

/* mermaid 流程图 */
.mermaid-figure {
  margin: 18px 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-surface);
  overflow-x: auto;
  text-align: center;
}

.mermaid-figure .mermaid {
  font-family: var(--font-sans);
  color: var(--text-secondary);
  white-space: pre;
  text-align: left;
  font-size: 12.5px;
  line-height: 1.7;
}

.mermaid-figure .mermaid svg {
  max-width: 100%;
  height: auto;
  display: inline-block;
}

.mermaid-figure .mermaid.mermaid-error {
  white-space: pre-wrap;
  color: var(--text-muted);
  border-left: 3px dashed var(--border-strong);
  padding-left: 12px;
}

/* 灯箱 */
body.md-lightbox-locked {
  overflow: hidden;
}

.md-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background: rgba(9, 9, 11, .72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.md-lightbox.is-open {
  display: flex;
}

.md-lightbox-inner {
  display: flex;
  flex-direction: column;
  width: min(1080px, 100%);
  max-height: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .45);
  overflow: hidden;
}

.md-lightbox.is-image .md-lightbox-inner {
  width: auto;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.md-lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}

.md-lightbox.is-image .md-lightbox-bar {
  border: 0;
  background: transparent;
}

.md-lightbox-lang {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
}

.md-lightbox-actions {
  display: flex;
  gap: 6px;
}

.md-lightbox-btn {
  appearance: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  transition: color .14s ease, border-color .14s ease;
}

.md-lightbox-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.md-lightbox-btn.is-done {
  color: var(--status-ok);
  border-color: var(--status-ok);
}

.md-lightbox-body {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.md-lightbox-body pre {
  margin: 0;
  padding: 16px 0;
  background: var(--bg-subtle);
  border: 0;
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.75;
  counter-reset: md-code-line;
}

.md-lightbox.is-image .md-lightbox-body {
  overflow: visible;
  padding: 0;
}

.md-lightbox-image {
  max-width: min(1200px, 92vw);
  max-height: 82vh;
  border-radius: 8px;
  display: block;
}

@media (max-width: 640px) {
  .md-lightbox {
    padding: 14px 10px;
  }
  .code-pre .code-line {
    padding-left: 42px;
    padding-right: 10px;
  }
  .code-pre .code-line::before {
    width: 28px;
    padding-right: 8px;
  }
}

/* ================= 栏目开关 / 自定义图标 / 栏目已关闭 ================= */
.sidebar-nav li[hidden],
.sidebar-nav .nav-item[hidden],
.mobile-dock-btn[hidden] {
  display: none !important;
}

.nav-item img.nav-icon-img {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-subtle);
}

.module-closed {
  max-width: 560px;
  margin: 16vh auto 0;
  padding: 0 24px;
  text-align: center;
}

.module-closed-title {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

.module-closed-text {
  margin: 12px 0 26px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.8;
}

@media (max-width: 860px) {
  .module-closed {
    margin-top: 12vh;
  }
}

/* ── 部署版本气泡（悬停「节点 ONLINE」时出现） ── */
.backend-status {
  position: relative;
}
.deploy-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  max-width: min(320px, calc(100vw - 24px));
  z-index: 30;
  padding: 6px 9px;
  border-radius: 7px;
  white-space: nowrap;
  font-family: var(--font-sans);
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-elevated, var(--bg-subtle));
  border: 1px solid var(--border-subtle);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .16);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 3px);
  transition: opacity .14s ease, transform .14s ease, visibility .14s;
  pointer-events: none;
}
.deploy-tip[hidden] { display: block; }
.backend-status:hover .deploy-tip,
.backend-status:focus-visible .deploy-tip,
.backend-status:focus-within .deploy-tip {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* 回到顶部（内容超过一页时出现） */
.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  z-index: 45;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease, color 0.15s ease, border-color 0.15s ease;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.to-top[data-show="true"] {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.to-top:hover,
.to-top:focus-visible {
  color: var(--text-primary);
  border-color: var(--text-primary);
  outline: none;
}

.to-top svg {
  width: 15px;
  height: 15px;
}

@media (max-width: 860px) {
  .to-top {
    right: 14px;
    bottom: 88px;
    width: 34px;
    height: 34px;
  }
}

/* ============================================================================
 * 移动端底部导航：液态玻璃（仅 ≤860px 生效，PC 端完全不受影响）
 * - 毛玻璃底座：backdrop-filter 模糊 + 饱和度提升 + 高光描边
 * - 选中胶囊：独立的 .dock-glider，切换栏目时平滑滑过去
 * ============================================================================ */
@media (max-width: 860px) {
  .mobile-dock {
    position: fixed;
    /* 宽度按内容自适应，一屏放得下就整条铺开，避免最右边的栏目被裁掉 */
    width: max-content;
    max-width: calc(100vw - 20px);
    overflow: visible;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.78);
    -webkit-backdrop-filter: blur(30px) saturate(185%);
    backdrop-filter: blur(30px) saturate(185%);
    box-shadow:
      0 10px 30px rgba(15, 18, 24, 0.16),
      0 2px 6px rgba(15, 18, 24, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.75),
      inset 0 -1px 0 rgba(255, 255, 255, 0.28);
    isolation: isolate;
    -webkit-tap-highlight-color: transparent;
    touch-action: pan-y;
  }

  /* 顶部的柔光反射：让玻璃不只是“加了模糊的底板” */
  .mobile-dock::before {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 46%);
    pointer-events: none;
    z-index: 0;
  }

  html[data-theme="dark"] .mobile-dock::before {
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 50%);
  }

  html[data-theme="dark"] .mobile-dock {
    background: rgba(28, 30, 34, 0.7);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow:
      0 10px 30px rgba(0, 0, 0, 0.45),
      0 2px 6px rgba(0, 0, 0, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.16),
      inset 0 -1px 0 rgba(255, 255, 255, 0.05);
  }

  /* 选中胶囊：玻璃质感的高光块，位置由 JS 计算 */
  .dock-glider {
    position: absolute;
    top: 5px;
    left: 0;
    height: calc(100% - 10px);
    width: 64px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(246, 248, 251, 0.94));
    border: 1px solid rgba(255, 255, 255, 1);
    box-shadow:
      0 0 0 1px rgba(15, 18, 24, 0.05),
      0 3px 10px rgba(15, 18, 24, 0.16),
      inset 0 1px 0 rgba(255, 255, 255, 1),
      inset 0 -3px 8px rgba(15, 18, 24, 0.06);
    -webkit-backdrop-filter: blur(8px) saturate(160%);
    backdrop-filter: blur(8px) saturate(160%);
    transform: translate3d(0, 0, 0);
    transition:
      transform 480ms cubic-bezier(0.34, 1.4, 0.5, 1),
      width 480ms cubic-bezier(0.34, 1.4, 0.5, 1),
      border-radius 300ms ease;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    will-change: transform, width;
  }

  html[data-theme="dark"] .dock-glider {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.13));
    border-color: rgba(255, 255, 255, 0.34);
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.06),
      0 3px 12px rgba(0, 0, 0, 0.5),
      inset 0 1px 0 rgba(255, 255, 255, 0.38),
      inset 0 -3px 8px rgba(0, 0, 0, 0.14);
  }

  .dock-glider.is-ready {
    opacity: 1;
    transition:
      opacity 180ms ease,
      transform 480ms cubic-bezier(0.34, 1.4, 0.5, 1),
      width 480ms cubic-bezier(0.34, 1.4, 0.5, 1),
      border-radius 300ms ease;
  }


  /* 滚动隐藏：除了首页，向下滚就收起来，向上滚再出现 */
  .mobile-dock {
    transition: transform 340ms cubic-bezier(0.22, 0.9, 0.3, 1), opacity 260ms ease;
    will-change: transform;
  }

  .mobile-dock.is-hidden {
    transform: translate(-50%, calc(100% + 26px));
    opacity: 0;
    pointer-events: none;
  }

  /* 一条缓慢游走的高光，让玻璃在静止时也有“液体”的呼吸感 */
  .mobile-dock::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
      radial-gradient(120% 180% at 18% 0%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 42%),
      radial-gradient(90% 140% at 82% 100%, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 46%);
    mix-blend-mode: screen;
    opacity: 0.9;
    pointer-events: none;
    z-index: 0;
    animation: dock-sheen 9s ease-in-out infinite alternate;
  }

  html[data-theme="dark"] .mobile-dock::after {
    mix-blend-mode: normal;
    background:
      radial-gradient(120% 180% at 18% 0%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 42%),
      radial-gradient(90% 140% at 82% 100%, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0) 46%);
    opacity: 0.85;
  }

  @keyframes dock-sheen {
    from { opacity: 0.55; transform: translate3d(-2%, 0, 0) scale(1); }
    to   { opacity: 0.95; transform: translate3d(2%, 0, 0) scale(1.02); }
  }

  @media (prefers-reduced-motion: reduce) {
    .mobile-dock::after { animation: none; }
  }

  /* 胶囊内部再叠一层高光，接近玻璃折射的层次 */
  .dock-glider::after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0) 58%);
    opacity: 0.9;
    pointer-events: none;
  }

  html[data-theme="dark"] .dock-glider::after {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 62%);
    opacity: 0.8;
  }

  .mobile-dock-btn {
    position: relative;
    z-index: 2;
    background: transparent;
    color: var(--text-secondary);
    transition: color 220ms ease, transform 220ms ease;
  }

  .mobile-dock-btn[aria-current="page"] {
    background: transparent;
    color: var(--text-primary);
    font-weight: 600;
  }

  html[data-theme="dark"] .mobile-dock-btn[aria-current="page"] {
    color: #f5f6f8;
  }

  .mobile-dock-btn:active {
    transform: scale(0.94);
  }
}

/* 窄屏：7 个栏目一屏放得下（配合液态玻璃滑块，避免横向滚动够不到最后一项） */
@media (max-width: 430px) {
  .mobile-dock {
    gap: 1px;
    padding: 5px 6px;
    max-width: calc(100vw - 16px);
  }

  .mobile-dock-btn {
    padding: 6px 7px;
    font-size: 11.5px;
    letter-spacing: -0.2px;
  }
}

/* 系统开启「减弱动态效果」时，滑块不做回弹动画 */
@media (prefers-reduced-motion: reduce) {
  .mobile-dock .dock-glider,
  .mobile-dock .dock-glider.is-ready {
    transition: opacity 120ms linear !important;
  }
}

/* ============================================================================
 * 页面切换的过渡与骨架屏（减少「整块刷新」的割裂感）
 * ============================================================================ */
#page-content {
  view-transition-name: page-content;
}

::view-transition-old(page-content) {
  animation: page-leave 160ms ease both;
}

::view-transition-new(page-content) {
  animation: page-enter 260ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

@keyframes page-leave {
  to { opacity: 0; transform: translateY(-4px); }
}

@keyframes page-enter {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 接口返回后的二次填充：只做很轻的淡入 */
/* 内容载入：整块先虚化再聚焦，逐个子元素轻微错峰，遮住内容替换的那一下 */
/* 文章详情页不做内容入场动画：正文本来就在 SSR 里，再动一次反而像闪 */
#page-content.is-reading.view-fade > * {
  animation: none !important;
}

#page-content.view-fade > * {
  animation: content-enter 420ms cubic-bezier(0.19, 0.72, 0.24, 1) both;
  animation-delay: calc(var(--reveal-i, 0) * 38ms);
  will-change: opacity, transform, filter;
}

@keyframes content-enter {
  0% {
    opacity: 0;
    filter: blur(7px);
    transform: translateY(6px) scale(0.996);
  }
  55% {
    opacity: 1;
    filter: blur(1.4px);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

/* 骨架叠层：内容在它下面淡入，叠层自身淡出，形成交叉溶解 */
.sk-overlay {
  opacity: 1;
  transition: opacity 240ms ease;
  background: var(--bg-canvas);
}
.sk-overlay * {
  animation: none !important;
}

/* 骨架屏 */
.page-skeleton {
  padding: 6px 0;
}

.sk-line,
.sk-card {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: var(--bg-subtle);
}

.sk-line::after,
.sk-card::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: sk-shimmer 1.15s ease-in-out infinite;
}

html[data-theme="dark"] .sk-line::after,
html[data-theme="dark"] .sk-card::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
}

@keyframes sk-shimmer {
  100% { transform: translateX(100%); }
}

.sk-line { height: 12px; margin-bottom: 10px; }
.sk-line--head { width: 32%; height: 22px; margin-bottom: 22px; }
.sk-line--title { width: 62%; height: 15px; margin: 16px 0 10px; }
.sk-line--body { width: 92%; }
.sk-line--short { width: 48%; margin-bottom: 0; }
.sk-card { display: block; height: 92px; margin-bottom: 14px; background: transparent; }
.sk-card > .sk-line { background: var(--bg-subtle); }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(page-content),
  ::view-transition-new(page-content),
  #page-content.view-fade > * { animation: none !important; }
  .sk-overlay { transition: none; }
  .sk-line::after, .sk-card::after { animation: none; }
}

/* ---------- 友链 ---------- */
.links-view {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.links-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.links-head-text { min-width: 0; }

.links-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.links-sub {
  margin: 0;
  max-width: 62ch;
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-secondary);
}

.links-apply-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.friend-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 12px;
}

.friend-card { margin: 0; }

.friend-link {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  padding: 14px 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-surface);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.friend-link:hover {
  border-color: var(--border-strong);
  background: var(--bg-subtle);
  transform: translateY(-1px);
}

.friend-icon,
.friend-initial {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
  object-fit: cover;
  background: var(--bg-subtle);
}

.friend-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  user-select: none;
}

.friend-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.friend-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-host {
  font-size: 11.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-note {
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.links-empty {
  padding: 44px 20px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.links-empty p { margin: 0 0 14px; }

.links-head--form { padding-bottom: 16px; }

.links-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 560px;
}

.links-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.links-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.links-optional {
  font-weight: 400;
  font-size: 11px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 4px;
  line-height: 1.5;
}

.links-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.links-input:focus {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px var(--bg-subtle);
}

.links-hint {
  font-size: 11.5px;
  color: var(--text-muted);
}

.links-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 4px;
}

.links-feedback {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.links-feedback[data-ok="true"] { color: var(--text-primary); }

/* 蜜罐字段：真人看不见，机器人会填 */
.links-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 640px) {
  .links-head { flex-direction: column; gap: 14px; }
  .links-apply-btn { width: 100%; }
  .friend-grid { grid-template-columns: 1fr; }
  .links-actions { flex-direction: column; align-items: flex-start; }
}

/* 友链页里的按钮（前台没有全局 .btn 样式，单独定义一套黑白按钮） */
.links-view .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.6;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.links-view .btn:hover {
  background: var(--bg-subtle);
  transform: translateY(-1px);
}

.links-view .btn:active { transform: translateY(0); }

.links-view .btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.links-view .btn-primary {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: var(--bg-surface);
}

.links-view .btn-primary:hover {
  background: var(--text-primary);
  border-color: var(--text-primary);
  opacity: 0.88;
}
