:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --ink: #1b1f27;
  --muted: #6b7280;
  --line: #e8eaef;
  --soft: #f3f4f7;
  --accent: #ff7a18;
  --accent2: #ff4d6d;
  --grad: linear-gradient(135deg, #ff7a18 0%, #ff4d6d 100%);
  --shadow: 0 8px 26px rgba(27, 31, 39, .07);
  --shadow-h: 0 16px 40px rgba(255, 122, 24, .16);
  --r: 16px;
}

[data-theme="dark"] {
  --bg: #0e1016;
  --card: #161a23;
  --ink: #e9ebf1;
  --muted: #98a0b3;
  --line: #242a37;
  --soft: #1b202b;
  --shadow: 0 8px 26px rgba(0, 0, 0, .4);
  --shadow-h: 0 16px 40px rgba(255, 122, 24, .22);
}

* { box-sizing: border-box; }
/* 不要全局 scroll-behavior:smooth —— 浏览器刷新时自动恢复滚动也会变成动画，
   停在中间态被再次记录，连续刷新就会「一小步一小步往下滑」。
   需要平滑的地方由 JS 显式 scrollTo({behavior:"smooth"}) 控制。 */
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.7;
  transition: background .3s, color .3s;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.wrap { width: min(900px, 92vw); margin: 0 auto; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 18px; height: 60px; }
.brand {
  display: flex; align-items: center;
  font-weight: 900; font-size: 27px; letter-spacing: 3px;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 8px rgba(255, 122, 24, .25));
  transition: filter .2s, transform .2s;
}
.brand:hover { filter: drop-shadow(0 5px 14px rgba(255, 122, 24, .45)) brightness(1.06); transform: scale(1.02); }
.top-nav { display: flex; gap: 20px; flex: 1; margin-left: 6px; }
.top-nav a { font-size: 14.5px; font-weight: 600; color: var(--muted); }
.top-nav a:hover { color: var(--accent); }
.top-nav a.nav-active {
  color: var(--accent);
  position: relative;
}
.top-nav a.nav-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 3px; border-radius: 3px; background: var(--grad);
}
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--card); cursor: pointer; display: grid; place-items: center;
  font-size: 14px; color: var(--ink);
}
.icon-btn:hover { border-color: var(--accent); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 8px 15px; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: .18s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--grad); border: none; color: #fff; box-shadow: 0 5px 16px rgba(255,122,24,.3); }
.btn-primary:hover { color: #fff; filter: brightness(1.05); transform: translateY(-1px); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 5px 11px; font-size: 13px; }
.btn-danger { color: #dc2626; border-color: #f3c7c7; }
.btn-danger:hover { background: #dc2626; color: #fff; border-color: #dc2626; }

/* ---------- 资料卡 ---------- */
.profile-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 26px; margin: 26px 0 22px; box-shadow: var(--shadow);
  display: flex; gap: 22px; align-items: flex-start;
}
.avatar {
  width: 84px; height: 84px; border-radius: 50%; flex: 0 0 84px;
  background: var(--grad); color: #fff; display: grid; place-items: center;
  font-size: 30px; font-weight: 800; overflow: hidden;
  box-shadow: 0 6px 18px rgba(255,122,24,.28);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-main { flex: 1; min-width: 0; }
.profile-name { font-size: 22px; font-weight: 800; margin: 0 0 3px; letter-spacing: -.4px; }
.profile-slogan { color: var(--accent); font-size: 14px; font-weight: 600; margin: 0 0 8px; }
.profile-bio { color: var(--muted); font-size: 14.5px; margin: 0 0 12px; }
.wechat-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.wechat-pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--soft); border: 1px dashed var(--line);
  padding: 6px 13px; border-radius: 10px; font-size: 14px; font-weight: 700;
}
.link-row { display: flex; flex-wrap: wrap; gap: 9px; }
.link-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent); padding: 6px 13px; border-radius: 999px;
  font-size: 13.5px; font-weight: 700; transition: .18s;
}
.link-chip:hover { background: var(--accent); color: #fff; }

/* ---------- 分类 ---------- */
/* 关键：scroll-margin 让"滚到分类条"时留出吸顶 header 的高度，
   否则分类条钻进 header 底下——看得见、点不着 */
.cat-bar { display: flex; flex-wrap: wrap; gap: 9px; margin: 8px 0 22px; scroll-margin-top: 84px; }
.cat-pill {
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  padding: 7px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: .15s;
}
.cat-pill:hover { border-color: var(--accent); color: var(--accent); }
.cat-pill.active { background: var(--grad); color: #fff; border-color: transparent; }

/* ---------- 文章列表 ---------- */
.section-title { font-size: 20px; font-weight: 800; margin: 0 0 16px; display: flex; align-items: center; gap: 9px; }
.section-title::before { content: ""; width: 4px; height: 18px; border-radius: 3px; background: var(--grad); }

.post-list { display: flex; flex-direction: column; gap: 14px; }
.post-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 20px 22px; box-shadow: var(--shadow); transition: .2s ease;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-h); border-color: transparent; }
.post-title { font-size: 18px; font-weight: 700; margin: 0 0 7px; letter-spacing: -.2px; line-height: 1.45; }
.post-card:hover .post-title { color: var(--accent); }
.pin-badge {
  display: inline-block; font-size: 11.5px; font-weight: 800; color: #fff;
  background: var(--grad); padding: 2px 8px; border-radius: 6px; margin-right: 7px; vertical-align: 2px;
}
.post-excerpt { color: var(--muted); font-size: 14.5px; margin: 0 0 12px; }
.post-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); }
.post-meta .cat-tag { color: var(--accent); font-weight: 700; }

/* ---------- 文章详情（三栏：名片 | 正文 | 其他文章） ---------- */
.post-wrap {
  width: min(1240px, 94vw);
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr) 252px;
  gap: 20px;
  align-items: start;
  padding: 26px 0 40px;
}
.post-detail {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 30px; margin: 0; box-shadow: var(--shadow);
}
.post-detail h1 { font-size: 25px; margin: 0 0 12px; letter-spacing: -.6px; line-height: 1.4; }
.post-body { font-size: 15.5px; line-height: 1.85; color: var(--ink); overflow-wrap: anywhere; word-break: break-word; }
.post-body p { margin: 0 0 15px; }
.post-body h2 { font-size: 19px; margin: 24px 0 12px; }
.post-body h3 { font-size: 16.5px; margin: 20px 0 10px; }
.post-body img { border-radius: 12px; margin: 12px 0; }
.post-body a { color: var(--accent); text-decoration: underline; word-break: break-all; }
.post-body a:hover { opacity: .8; }
.post-body blockquote {
  margin: 16px 0; padding: 12px 18px; border-left: 4px solid var(--accent);
  background: var(--soft); border-radius: 0 10px 10px 0; color: var(--muted);
}
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; margin: 20px 0 0; }
.back-link:hover { color: var(--accent); }

/* 左右侧栏 */
.side-col { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.side-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px; box-shadow: var(--shadow);
}
.side-title { font-size: 15px; font-weight: 800; margin: 0 0 10px; letter-spacing: -.2px; }

/* 左侧迷你名片 */
.profile-mini { text-align: center; }
.pm-avatar {
  width: 62px; height: 62px; border-radius: 50%; margin: 0 auto 10px;
  background: var(--grad); color: #fff; display: grid; place-items: center;
  font-size: 24px; font-weight: 800; overflow: hidden;
  box-shadow: 0 5px 14px rgba(255, 122, 24, .28);
}
.pm-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pm-name { font-size: 16.5px; font-weight: 800; }
.pm-slogan { color: var(--accent); font-size: 12.5px; font-weight: 600; margin-top: 2px; }
.pm-bio {
  color: var(--muted); font-size: 12.5px; line-height: 1.7; margin-top: 8px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.pm-wx {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 12px; padding: 7px 10px; border-radius: 10px;
  background: var(--soft); border: 1px dashed var(--line); font-size: 13px; font-weight: 700;
  flex-wrap: wrap;
}
.side-home-btn { width: 100%; margin-top: 12px; font-size: 13px; }

/* 右侧其他文章 */
.related-card { padding: 16px; }
.side-item {
  display: flex; flex-direction: column; gap: 3px;
  padding: 10px 2px; border-bottom: 1px dashed var(--line);
  transition: .15s;
}
.side-item:last-of-type { border-bottom: none; }
.side-item:hover { background: var(--soft); border-radius: 8px; padding-left: 8px; padding-right: 8px; }
.si-title {
  font-size: 13.5px; font-weight: 600; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.side-item:hover .si-title { color: var(--accent); }
.si-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--grad); margin-right: 6px; vertical-align: 2px;
}
.si-meta { font-size: 12px; color: var(--muted); }
.side-more { display: block; margin-top: 10px; font-size: 13px; font-weight: 700; color: var(--accent); text-align: center; }
.side-empty { color: var(--muted); font-size: 13px; }

@media (max-width: 1020px) {
  .post-wrap { grid-template-columns: minmax(0, 1fr); width: min(900px, 92vw); }
  .side-col { position: static; }
  /* 手机/窄屏：正文在前，名片和其他文章垫在下面 */
  .post-wrap { display: flex; flex-direction: column; }
  #sideProfile { order: 2; }
  .post-detail { order: 1; }
  #sideRelated { order: 3; }
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 50px; padding: 28px 0 40px; text-align: center; }
.site-footer p { color: var(--muted); font-size: 13.5px; margin: 5px 0; }

/* ---------- 后台 ---------- */
.admin-wrap { width: min(980px, 94vw); margin: 0 auto; padding: 24px 0 60px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.admin-head h1 { font-size: 24px; margin: 0; }
.mode-tip {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px dashed var(--accent); color: var(--ink);
  border-radius: 12px; padding: 12px 16px; font-size: 13.5px; margin-bottom: 18px;
}
.mode-tip code {
  background: var(--soft); padding: 1px 6px; border-radius: 5px; font-size: 12.5px;
}

/* ---------- 动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .55s cubic-bezier(.2,.7,.3,1), transform .55s cubic-bezier(.2,.7,.3,1);
}
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* 背景装饰：用径向渐变代替 blur(90px) 滤镜。
   blur 大色块在滚动时会持续触发大面积重绘/合成，渐变是纯 GPU 一次绘制，明显更顺。 */
.bg-decor {
  position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  /* 极淡的点阵纹理，纯 CSS，零网络请求 */
  background-image: radial-gradient(circle at 1px 1px,
    color-mix(in srgb, var(--ink) 6%, transparent) 1px, transparent 0);
  background-size: 26px 26px;
}
.bg-decor::before, .bg-decor::after {
  content: ""; position: absolute; border-radius: 50%;
}
.bg-decor::before {
  width: 780px; height: 780px; top: -280px; left: -240px;
  background: radial-gradient(circle,
    color-mix(in srgb, var(--accent) 30%, transparent) 0%, transparent 68%);
}
.bg-decor::after {
  width: 680px; height: 680px; top: 120px; right: -240px;
  background: radial-gradient(circle,
    color-mix(in srgb, var(--accent2) 22%, transparent) 0%, transparent 68%);
}
[data-theme="dark"] .bg-decor { opacity: .55; }

/* 卡片悬浮顶部渐变条 */
.post-card { position: relative; overflow: hidden; }
.post-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--grad); opacity: 0; transition: opacity .25s;
}
.post-card:hover::before { opacity: 1; }

/* 置顶徽章：用 transform 做呼吸，GPU 合成，不触发 box-shadow 重绘 */
.pin-badge { animation: pinPulse 2.8s ease-in-out infinite; }
@keyframes pinPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.075); }
}

/* 按钮点击反馈 */
.btn { transition: .18s ease; }
.btn:active { transform: scale(.97); }

.login-box {
  max-width: 380px; margin: 12vh auto; background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 30px; box-shadow: var(--shadow); text-align: center;
}
.login-box h2 { margin: 0 0 6px; font-size: 20px; }
.login-box p { color: var(--muted); font-size: 13.5px; margin: 0 0 18px; }

.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.panel h2 { font-size: 17px; margin: 0 0 16px; display: flex; align-items: center; gap: 8px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 6px; }
.field .hint { font-size: 12.5px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.input, .textarea, select.input {
  width: 100%; padding: 10px 13px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--soft); color: var(--ink); font-size: 14px; font-family: inherit; outline: none;
}
.input:focus, .textarea:focus { border-color: var(--accent); }
.textarea { min-height: 90px; resize: vertical; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }

.avatar-edit { display: flex; align-items: center; gap: 16px; }
.avatar-edit .avatar { width: 72px; height: 72px; flex: 0 0 72px; font-size: 26px; }

.editor-toolbar { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 8px; }
.editor-toolbar button {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 5px 11px; border-radius: 8px; font-size: 13px; cursor: pointer; font-weight: 600;
}
.editor-toolbar button:hover { border-color: var(--accent); color: var(--accent); }
.editor {
  min-height: 260px; padding: 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--soft); color: var(--ink); font-size: 15px; line-height: 1.8; outline: none;
  overflow-wrap: anywhere; word-break: break-word;
}
.editor:focus { border-color: var(--accent); }
.editor img { max-width: 100%; border-radius: 8px; }

.list-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 9px;
  background: var(--soft);
}
.list-item .li-title { font-weight: 700; font-size: 14.5px; flex: 1; min-width: 0; }
.list-item .li-sub { font-size: 12.5px; color: var(--muted); }
.list-actions { display: flex; gap: 7px; flex: 0 0 auto; }

.save-bar {
  position: sticky; bottom: 0; background: var(--card); border-top: 1px solid var(--line);
  padding: 14px 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.save-msg { font-size: 13.5px; color: var(--muted); flex: 1; }
.save-msg.ok { color: #16a34a; font-weight: 700; }
.save-msg.err { color: #dc2626; font-weight: 700; }

.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 11px 22px; border-radius: 12px;
  font-size: 14px; font-weight: 600; z-index: 999; box-shadow: var(--shadow);
}

@media (max-width: 680px) {
  /* 移动端导航改成第二行横向滚动，不再直接隐藏（之前手机上导航整个没了） */
  .header-inner { flex-wrap: wrap; height: auto; padding: 9px 0 6px; gap: 8px; }
  .brand { font-size: 22px; letter-spacing: 1.5px; }
  .header-actions { margin-left: auto; }
  .top-nav {
    order: 3; flex: 1 0 100%; margin: 2px 0 0;
    gap: 16px; overflow-x: auto; white-space: nowrap;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .top-nav::-webkit-scrollbar { display: none; }
  .top-nav a { font-size: 13.5px; }
  .top-nav a.nav-active::after { bottom: -3px; }
  .profile-card { flex-direction: column; align-items: center; text-align: center; }
  .wechat-row, .link-row { justify-content: center; }
  .post-detail { padding: 22px; }
  .post-detail h1 { font-size: 23px; }
  .post-card { padding: 17px 16px; }
  .post-title { font-size: 16.5px; }
  .to-top { right: 14px; bottom: 18px; }
}

/* ============================================================
   视觉 / 动效 / 流畅度增强层
   原则：零外部请求（所有图标、纹理、插画都是内联 SVG 或纯 CSS），
   动画只动 transform / opacity，不触发重排重绘。
   ============================================================ */

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Apple Color Emoji",
    "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}
.post-meta, .views-num, .si-meta, .cat-count { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* 深浅色切换：支持 View Transitions 的浏览器做平滑过渡 */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .38s; }

/* --- 文章卡片：交错入场 -----------------------------------------
   不再依赖 IntersectionObserver，也不把 opacity:0 当初始态：
   动画只动 transform，卡片在任何时刻（含 delay 期间、动画被暂停、
   减弱动效模式）都保持可见，永远不会再出现「筛选后一片空白」。 */
.card-enter {
  animation: cardIn .5s cubic-bezier(.2, .7, .3, 1) both;
  animation-delay: calc(var(--i, 0) * 42ms);
}
@keyframes cardIn {
  from { transform: translateY(16px) scale(.985); }
  to   { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .card-enter { animation: none; }
}

/* 置顶文章单独一个视觉层级 */
.post-card.is-pinned {
  border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--accent) 6%, var(--card)) 0%, var(--card) 60%);
}
.post-card.is-pinned::after {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--grad); opacity: .8;
}
.post-card:hover { transform: translateY(-4px); }

/* --- 分类磁贴：计数 + 悬浮反馈 --- */
.cat-pill { will-change: auto; }
.cat-pill:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(27, 31, 39, .08); }
.cat-pill:active { transform: translateY(0) scale(.97); }
.cat-pill.active { box-shadow: 0 6px 18px rgba(255, 122, 24, .28); }
.cat-count {
  display: inline-block; margin-left: 7px; padding: 0 6px;
  border-radius: 999px; font-size: 11.5px; font-weight: 700;
  background: var(--soft); color: var(--muted); line-height: 18px;
}
.cat-pill.active .cat-count { background: rgba(255, 255, 255, .24); color: #fff; }

/* 分类标签药丸化 */
.post-meta .cat-tag {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  padding: 1px 9px; border-radius: 999px; font-size: 12px;
}

/* --- 空状态（内联 SVG 插画由 JS 注入） --- */
.empty-state { text-align: center; padding: 42px 20px 46px; }
.empty-state svg { width: 108px; height: 108px; opacity: .85; }
.empty-state p { color: var(--muted); font-size: 14.5px; margin: 14px 0 0; }

/* --- 滚动进度条 / 回到顶部 --- */
.scroll-progress {
  position: fixed; top: 0; left: 0; width: 100%; height: 3px; z-index: 90;
  background: var(--grad); transform: scaleX(0); transform-origin: 0 50%;
  pointer-events: none; will-change: transform;
}
.to-top {
  position: fixed; right: 24px; bottom: 26px; z-index: 80;
  width: 42px; height: 42px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--card); color: var(--accent); font-size: 19px; font-weight: 800;
  cursor: pointer; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(14px) scale(.9); pointer-events: none;
  transition: opacity .25s, transform .25s, border-color .2s;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { border-color: var(--accent); transform: translateY(-3px); }

/* --- 正文图片：懒加载占位，避免长文章一次性拉几十张图导致卡顿 --- */
.post-body img {
  display: block; height: auto; background: var(--soft);
  border: 1px solid var(--line);
}
.post-body img.img-failed {
  min-height: 96px; background:
    repeating-linear-gradient(45deg, var(--soft), var(--soft) 10px,
      color-mix(in srgb, var(--muted) 8%, var(--soft)) 10px,
      color-mix(in srgb, var(--muted) 8%, var(--soft)) 20px);
}
.post-body a { text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* --- 资料卡细节 --- */
.avatar { border: 3px solid var(--card); outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.profile-slogan { display: inline-block; padding: 1px 0; }
.profile-card { transition: transform .25s, box-shadow .25s; }
.profile-card:hover { box-shadow: 0 14px 36px rgba(27, 31, 39, .09); }
.link-chip:hover { transform: translateY(-2px); }
.link-chip:active { transform: translateY(0) scale(.96); }

/* 侧栏「继续阅读」条目左侧指示条 */
.side-item { position: relative; }
.side-item::before {
  content: ""; position: absolute; left: 0; top: 12px; bottom: 12px;
  width: 2px; border-radius: 2px; background: var(--grad);
  opacity: 0; transform: scaleY(.4); transition: .2s;
}
.side-item:hover::before { opacity: 1; transform: scaleY(1); }

/* 版本戳 */
.build-tag { letter-spacing: .4px; }
.site-footer { background: color-mix(in srgb, var(--card) 55%, transparent); }

/* 手机上给底部按钮让出安全区 */
@supports (padding: env(safe-area-inset-bottom)) {
  .to-top { bottom: calc(18px + env(safe-area-inset-bottom)); }
}
