/* =============================================================
   xzd1314.top — UI 质感增强层 (drop-in override)
   用法：在 home.html 的 <head> 中，放在内联 <style> 之后引入
   <link rel="stylesheet" href="/assets/ui-upgrade.css">
   不改动任何 HTML 结构，纯增强；可随时删除回滚。
   ============================================================= */

/* ---------- 1. 设计 Token：语义色 / 表面 / 描边 ---------- */
:root {
  /* 品牌色：主 + 辅，用于渐变与高光 */
  --brand:      #2b5cff;
  --brand-2:    #06b6d4;
  --brand-soft: rgba(43, 92, 255, .10);
  --brand-ring: rgba(43, 92, 255, .35);

  /* 表面分层（替代原来的半透明黑叠加） */
  --bg:         #fbfbfd;
  --surface-1:  #ffffff;
  --surface-2:  #f5f6f9;
  --surface-3:  #eceef3;

  /* 文本三级 */
  --text-1:     #0b1020;
  --text-2:     #4a5266;
  --text-3:     #7b8296;

  /* 描边：hairline 弱、strong 强 */
  --hairline:        rgba(17, 24, 39, .08);
  --hairline-strong: rgba(17, 24, 39, .16);
  /* 玻璃高光：卡片顶部 1px 内高光，质感提升最明显的一招 */
  --glass-edge: inset 0 1px 0 rgba(255, 255, 255, .9);

  /* 圆角体系：4 档，全站统一 */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-pill: 999px;

  /* 阴影体系：环境光 + 直射光双层 */
  --e1: 0 1px 2px rgba(16, 24, 40, .06);
  --e2: 0 2px 6px rgba(16, 24, 40, .07), 0 1px 2px rgba(16, 24, 40, .05);
  --e3: 0 12px 28px -8px rgba(16, 24, 40, .16), 0 4px 10px -4px rgba(16, 24, 40, .08);
  --e4: 0 24px 56px -12px rgba(16, 24, 40, .24), 0 8px 20px -8px rgba(16, 24, 40, .10);
  --e5: 0 48px 96px -24px rgba(16, 24, 40, .32);

  /* 动效 Token：时长 + 曲线，全站只准用这几组 */
  --dur-1: 120ms;  /* 按压、开关 */
  --dur-2: 200ms;  /* hover */
  --dur-3: 320ms;  /* 面板、浮层 */
  --dur-4: 520ms;  /* 入场编排 */
  --dur-5: 800ms;  /* 大范围位移 */
  --ease-out:    cubic-bezier(.22, 1, .36, 1);      /* 入场：快出慢收 */
  --ease-io:     cubic-bezier(.65, 0, .35, 1);      /* 移动：两端缓 */
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);   /* 弹性：轻微回弹 */

  /* 流体间距：8pt 网格 + 视口自适应 */
  --pad-y: clamp(96px, 13vh, 168px);
  --pad-x: clamp(20px, 5vw, 64px);
}

body[data-theme="dark"] {
  --brand:      #8b5cf6;
  --brand-2:    #22d3ee;
  --brand-soft: rgba(139, 92, 246, .14);
  --brand-ring: rgba(139, 92, 246, .45);

  --bg:        #07080d;
  --surface-1: #0d0f17;
  --surface-2: #141824;
  --surface-3: #1c2231;

  --text-1: #f2f4fa;
  --text-2: #a8b0c4;
  --text-3: #6f7789;

  --hairline:        rgba(255, 255, 255, .09);
  --hairline-strong: rgba(255, 255, 255, .18);
  --glass-edge: inset 0 1px 0 rgba(255, 255, 255, .07);

  --e1: 0 1px 2px rgba(0, 0, 0, .40);
  --e2: 0 2px 8px rgba(0, 0, 0, .45), 0 1px 2px rgba(0, 0, 0, .30);
  --e3: 0 14px 32px -8px rgba(0, 0, 0, .60), 0 4px 12px -4px rgba(0, 0, 0, .40);
  --e4: 0 28px 60px -12px rgba(0, 0, 0, .72), 0 8px 22px -8px rgba(0, 0, 0, .50);
  --e5: 0 56px 110px -24px rgba(0, 0, 0, .82);
}

/* ---------- 2. 基础排版：流体字号 + 语言分行高 ---------- */
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
               'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  text-rendering: optimizeLegibility;
  font-synthesis-weight: none;
}
/* 中文行高更松、英文更紧 */
.section-desc, .skill-desc, .link-info p, .cookie-text { line-height: 1.75; }
body[data-lang="en"] .section-desc,
body[data-lang="en"] .skill-desc { line-height: 1.62; }

/* 统一字重：400 / 600 / 800 三档，去掉 900 的滥用（仅大标题保留） */
.section-desc, .skill-desc { font-weight: 400; }
.skill-name, .link-info h3 { font-weight: 600; }

/* ---------- 3. 区块节奏：流体留白，替代固定 120px ---------- */
.section {
  padding: var(--pad-y) var(--pad-x);
  transition: background var(--dur-4) var(--ease-io);
}
/* 每个区块用不同的上下留白制造呼吸感 */
#hero     { padding-top: clamp(120px, 18vh, 220px); }
#skills   { padding-block: clamp(112px, 15vh, 190px); }
#projects { padding-block: clamp(112px, 15vh, 190px); }

/* 标题：统一流体字号，清掉原来重复的两条 font-size */
/* 选区颜色用品牌色 —— 意外选中看着像刻意设计 */
::selection {
  background: color-mix(in srgb, var(--brand) 22%, transparent);
  color: var(--text-1);
}
::-moz-selection {
  background: color-mix(in srgb, var(--brand) 22%, transparent);
  color: var(--text-1);
}
.hero-title { -webkit-user-select: none; user-select: none; }

.section-title {
  font-size: clamp(44px, 7.2vw, 104px);
  line-height: 1.06;
  letter-spacing: -.035em;
  font-weight: 800;
  margin-bottom: clamp(20px, 3vw, 36px);
}
.hero-title {
  font-size: clamp(60px, 11.5vw, 172px);
  letter-spacing: -.05em;
  line-height: .96;
}
.contact-cta {
  font-size: clamp(38px, 5.6vw, 68px);
  letter-spacing: -.03em;
  line-height: 1.12;
  margin-bottom: clamp(32px, 5vw, 56px);
}
.section-label {
  font-size: 12px;
  letter-spacing: .18em;
  margin-bottom: 24px;
  color: var(--text-3);
}

/* ---------- 4. 液态玻璃卡片系统 ---------- */
.skill-card, .link-card {
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  /* 透明度从 72% 降到 48%，背景能透出来 —— 真正的玻璃 */
  background: color-mix(in srgb, var(--surface-1) 48%, transparent);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  backdrop-filter: blur(24px) saturate(190%);
  /* 三层叠加：玻璃高光 + 内描边让边缘亮起 + 投影 */
  box-shadow:
    var(--e1),
    var(--glass-edge),
    inset 0 1px 0 rgba(255,255,255,.6),
    inset 0 -1px 0 rgba(0,0,0,.04);
  transition:
    transform   var(--dur-4) var(--ease-out),
    box-shadow  var(--dur-3) var(--ease-out),
    border-color var(--dur-2) var(--ease-out),
    background  var(--dur-2) var(--ease-out);
  transform-style: preserve-3d;
  will-change: transform;
}
.skill-cards { perspective: 700px; }     /* 视角从 1200 拉到 700，倾斜更明显 */
.link-cards  { perspective: 700px; }
.project-list { perspective: 900px; }

/* 液态玻璃对深色模式专门调过：背景压暗一些，玻璃光更亮 */
body[data-theme="dark"] .skill-card,
body[data-theme="dark"] .link-card {
  background: color-mix(in srgb, var(--surface-1) 38%, transparent);
  box-shadow:
    var(--e1),
    inset 0 1px 0 rgba(255,255,255,.08),
    inset 0 -1px 0 rgba(0,0,0,.35);
}

/* ---------- 4b. 3D 倾斜：整张卡片作为刚体跟随鼠标 ----------
   perspective() 内联在 transform 里，不依赖父级；
   600px 视角 + 24° 最大角度，肉眼能明显看出。                  */
.skill-card, .link-card, .project-item, .project-cover {
  transform:
    perspective(600px)
    rotateX(var(--rx, 0deg))
    rotateY(var(--ry, 0deg))
    scale(var(--ts, 1));
  transition:
    transform   var(--dur-4) var(--ease-out),     /* 320→520ms，电影感 */
    box-shadow  var(--dur-3) var(--ease-out),
    border-color var(--dur-2) var(--ease-out),
    background  var(--dur-2) var(--ease-out);
  transform-style: preserve-3d;
}
.skill-card:hover, .link-card:hover,
.project-item:hover, .project-cover:hover { will-change: transform; }

/* 内层保持在同一平面：整卡刚体倾斜，不做 translateZ 分层 */
.skill-card > *, .link-card > *,
.project-item > *, .project-cover > * { transform: none; }
.link-card:hover .link-info { transform: translateX(6px); }

/* 液态玻璃边缘跟随光带：鼠标位置出现一道斜光，标志性 liquid glass 效果 */
.skill-card::before, .link-card::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur-3) var(--ease-out);
  background: radial-gradient(
    280px circle at var(--mx, 50%) var(--my, 50%),
    color-mix(in srgb, var(--brand) 22%, transparent),
    transparent 65%
  );
}
.skill-card:hover::before, .link-card:hover::before { opacity: 1; }

/* 第二层：跟随光带 —— 倾斜时压在卡面上 */
.skill-card::after, .link-card::after {
  content: '';
  position: absolute; inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur-3) var(--ease-out), background var(--dur-4);
  background: linear-gradient(
    115deg,
    transparent 40%,
    color-mix(in srgb, var(--brand) 35%, transparent) 50%,
    transparent 60%
  );
  background-size: 240% 240%;
  background-position: calc(var(--mx, 50%) - 100%) 50%;
}
.skill-card:hover::after, .link-card:hover::after { opacity: 1; }

/* 悬停：轻微放大，配合 JS 写入的旋转角 */
.skill-card:hover, .link-card:hover {
  --ts: 1.045;                                    /* 抬升更明显 */
  border-color: var(--hairline-strong);
  box-shadow:
    var(--e3),
    var(--glass-edge),
    inset 0 1px 0 rgba(255,255,255,.8);
}
.skill-card:active, .link-card:active {
  --ts: .995;
  transition-duration: var(--dur-1);
}

/* 性能修复：原来用 padding-left 驱动位移会触发重排，改成 transform */
.link-card:hover { padding-left: 24px; }

/* ---------- 5. 项目列表：3D 倾斜 + 渐显操作区 ---------- */
.project-item {
  border-top-color: var(--hairline);
  border-radius: var(--r-sm);
  transition:
    transform    var(--dur-3) var(--ease-out),
    background   var(--dur-3) var(--ease-out),
    box-shadow   var(--dur-2) var(--ease-out);
}
.project-item:last-child { border-bottom: 1px solid var(--border); }
/* 3D 倾斜 hover：保留原横向位移 + 旋转 + 微抬 */
.project-item:hover {
  padding-left: 0;
  --ts: 1.012;
  box-shadow: var(--e3);
}
.project-item::before {
  width: 100%;
  background: linear-gradient(90deg, var(--brand-soft), transparent 72%);
  opacity: 0;
  transform: scaleX(.6);
  transform-origin: left;
  transition: opacity var(--dur-3) var(--ease-out), transform var(--dur-4) var(--ease-out);
  z-index: -1; border-radius: var(--r-sm);
}
.project-item:hover::before { width: 100%; opacity: 1; transform: scaleX(1); }

.project-cover {
  border-radius: var(--r-lg);
  box-shadow: var(--e2), var(--glass-edge);
  overflow: hidden;
}
.project-cover:hover { --ts: 1.02; }
.project-cover img { transition: transform var(--dur-5) var(--ease-out); }
.project-cover:hover img { transform: scale(1.06); }

/* ---------- 6. 按钮：补全 hover / active / focus-visible 四态 ---------- */
.nav-btn, .project-btn, .cookie-btn, .feedback-submit,
.reply-close, .verify-modal-continue, .back-to-top {
  border-radius: var(--r-pill);
  transition:
    transform    var(--dur-1) var(--ease-out),
    box-shadow   var(--dur-2) var(--ease-out),
    background   var(--dur-2) var(--ease-out),
    color        var(--dur-2) var(--ease-out),
    border-color var(--dur-2) var(--ease-out);
}
.nav-btn:hover, .project-btn:hover, .cookie-btn:hover {
  transform: translateY(-1.5px);
  box-shadow: var(--e2);
}
.nav-btn:active, .project-btn:active, .cookie-btn:active,
.feedback-submit:active, .reply-close:active, .verify-modal-continue:active {
  transform: translateY(0) scale(.97);
  transition-duration: var(--dur-1);
}

/* 全局焦点环：原来只有 textarea 有 outline */
a:focus-visible, button:focus-visible, input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* 品牌渐变实心按钮 */
.feedback-submit, .reply-close, .verify-modal-continue {
  background-image: linear-gradient(135deg, var(--brand), var(--brand-2));
  background-size: 180% 100%;
  box-shadow: 0 4px 16px var(--brand-ring);
  transition: background-position var(--dur-3) var(--ease-io),
              transform var(--dur-1) var(--ease-out),
              box-shadow var(--dur-2) var(--ease-out);
}
.feedback-submit:hover, .reply-close:hover, .verify-modal-continue:hover {
  background-position: 100% 0;
  transform: translateY(-1.5px);
  box-shadow: 0 8px 26px var(--brand-ring);
}

/* 像标签但不可点 —— 视觉上明确弱化 */
.project-tag {
  border-radius: var(--r-sm);
  border-color: transparent;
  background: var(--surface-3);
  color: var(--text-3);
  font-size: 11px;
  letter-spacing: .06em;
}

/* ---------- 7. 导航：向下滚隐藏，向上滚出现 ---------- */
.nav {
  background: color-mix(in srgb, var(--surface-1) 72%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid transparent;
  transition: transform var(--dur-3) var(--ease-io),
              padding var(--dur-3) var(--ease-io),
              border-color var(--dur-3) var(--ease-io),
              box-shadow var(--dur-3) var(--ease-io);
}
.nav.scrolled { box-shadow: var(--e2); border-bottom-color: var(--hairline); }
.nav.hide { transform: translateY(-104%); }

/* ---------- 8. 入场编排：用 --i 做 stagger，替代固定 delay ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px) scale(.985);
  transition:
    opacity   var(--dur-5) var(--ease-out),
    transform var(--dur-5) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.reveal.is-visible { opacity: 1; transform: none; }
/* 兼容原有 delay 类：转成 --i */
.reveal-delay-1 { --i: 1; }
.reveal-delay-2 { --i: 2; }
.reveal-delay-3 { --i: 3; }
.reveal-delay-1, .reveal-delay-2, .reveal-delay-3 { transition-delay: calc(var(--i) * 70ms); }

/* 滚动视差：由 ui-motion.js 写入 --p（0~1） */
[data-parallax] {
  transform: translate3d(0, calc(var(--p, 0) * var(--px, -60px)), 0);
  will-change: transform;
}

/* ---------- 9. 滚动进度条：发光拖尾 ---------- */
.scroll-progress {
  height: 3px;
  background-image: linear-gradient(90deg, var(--brand), var(--brand-2));
  box-shadow: 0 0 12px var(--brand-ring);
  transition: width 90ms linear;
}
.scroll-progress::after {
  content: '';
  position: absolute; right: -28px; top: 0;
  width: 28px; height: 100%;
  background: linear-gradient(90deg, var(--brand-ring), transparent);
}

/* ---------- 10. 头像：旋转渐变描边环 ---------- */
.avatar-wrap {
  position: relative;
  box-shadow: var(--e3);
}
.avatar-wrap::after {
  content: '';
  position: absolute; inset: -3px;
  border-radius: 50%;
  padding: 1.5px;
  background: conic-gradient(from 0deg, transparent 0 62%, var(--brand) 78%, var(--brand-2) 92%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--dur-3) var(--ease-out);
  animation: ringSpin 6s linear infinite;
  pointer-events: none;
}
.avatar-link:hover .avatar-wrap::after { opacity: 1; }
@keyframes ringSpin { to { transform: rotate(1turn); } }
.avatar-link:hover .avatar-wrap {
  transform: scale(1.04);
  box-shadow: var(--e4), 0 0 0 6px var(--brand-soft);
}

/* ---------- 11. 磁吸元素（JS 写入 --tx/--ty） ---------- */
.magnetic {
  transition: transform var(--dur-2) var(--ease-out);
  transform: translate3d(var(--tx, 0px), var(--ty, 0px), 0);
}
.magnetic.is-pulling { transition-duration: var(--dur-1); }

/* ---------- 12. 主题切换：View Transitions 圆形扩散 ---------- */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }
html.vt-theme::view-transition-new(root) {
  animation: vtReveal var(--dur-4) var(--ease-io) both;
}
@keyframes vtReveal {
  from { clip-path: circle(0% at var(--vt-x, 50%) var(--vt-y, 50%)); }
  to   { clip-path: circle(150% at var(--vt-x, 50%) var(--vt-y, 50%)); }
}

/* ---------- 14. 移动端专项 ---------- */

/* a) 视口高度：100vh 在移动浏览器会因地址栏收放而跳动，改用 dvh */
@supports (height: 100dvh) {
  .section, #hero { min-height: 100dvh; }
}

/* b) 刘海屏 / 底部横条安全区 */
@supports (padding: env(safe-area-inset-bottom)) {
  .nav { padding-left: max(var(--pad-x), env(safe-area-inset-left));
         padding-right: max(var(--pad-x), env(safe-area-inset-right)); }
  .section { padding-left: max(var(--pad-x), env(safe-area-inset-left));
             padding-right: max(var(--pad-x), env(safe-area-inset-right)); }
  .footer { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
  .cookie-banner { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
  .back-to-top { bottom: calc(28px + env(safe-area-inset-bottom)); }
}

/* c) 触屏：hover 状态会在点完后"粘住"，全部还原 */
@media (hover: none) {
  .skill-card:hover, .link-card:hover,
  .project-item:hover, .project-cover:hover {
    transform: none; --ts: 1;
    border-color: var(--hairline);
    box-shadow: var(--e1), var(--glass-edge);
  }
  .skill-card::after, .link-card::after { opacity: 0 !important; }
  .project-cover:hover img { transform: none; }
  /* 触屏用 :active 做按压反馈，替代 hover 抬升 */
  .skill-card:active, .link-card:active { transform: scale(.985); background: var(--surface-2); }
  .project-item:active { background: var(--surface-2); }
  .stat-card:active { transform: scale(.985); }
  .wall-card:active { transform: scale(.985); }
}

/* d) 触摸目标尺寸：iOS/Android 建议 >= 44x44 */
@media (pointer: coarse) {
  .nav-btn, .project-btn, .cookie-btn,
  .back-to-top, .bgm-ctrl-btn, .bgm-tab-btn {
    min-height: 44px; min-width: 44px;
  }
  .project-btn { padding: 12px 18px; }
  .link-card { min-height: 72px; }
  .contact-link { min-height: 48px; display: inline-flex; align-items: center; }
}

/* e) iOS 输入框字号 <16px 会触发自动缩放 */
@media (max-width: 768px) {
  html { -webkit-text-size-adjust: 100%; }
  input, textarea, select { font-size: 16px !important; }
  .feedback-input { font-size: 16px !important; }
  /* 移动端缩小背景星空强度，省电 */
  .bg-canvas { opacity: .5; }
  /* 悬浮元素避让：FAB 与返回顶部错开，避免遮挡内容 */
  .bgm-fab { top: 68px; right: 12px; width: 48px; height: 48px; }
  .back-to-top { right: 16px; }
}

/* f) 窄屏排版：标题再收紧一档，行高放宽 */
@media (max-width: 480px) {
  .section-title { font-size: clamp(34px, 9vw, 52px); line-height: 1.12; }
  .hero-title { font-size: clamp(46px, 13vw, 76px); }
  .contact-cta { font-size: clamp(28px, 7.5vw, 42px); }
  .section-desc, .skill-desc { font-size: 15px; line-height: 1.8; }
  .skill-card { padding: 20px; }
  .link-card { padding: 18px; gap: 14px; }
  .project-item { padding: 22px 8px; gap: 16px; }
  .project-cover { height: 150px; }
}



/* ---------- Now 卡片 ---------- */
.now-card {
  padding: clamp(28px, 4vw, 40px);
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--surface-1) 48%, transparent);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  backdrop-filter: blur(24px) saturate(190%);
  border: 1px solid var(--hairline);
  box-shadow: var(--e1), var(--glass-edge), inset 0 1px 0 rgba(255,255,255,.6);
}
body[data-theme="dark"] .now-card {
  background: color-mix(in srgb, var(--surface-1) 38%, transparent);
}
.now-head {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--hairline);
}
.now-pulse {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--brand); flex-shrink: 0;
  box-shadow: 0 0 0 0 var(--brand-ring);
  animation: nowPulse 2s ease-in-out infinite;
}
@keyframes nowPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(43,92,255,.5); transform: scale(1); }
  50%     { box-shadow: 0 0 0 8px rgba(43,92,255,0); transform: scale(.92); }
}
body[data-theme="dark"] .now-pulse { animation-name: nowPulseDark; }
@keyframes nowPulseDark {
  0%,100% { box-shadow: 0 0 0 0 rgba(139,92,246,.5); transform: scale(1); }
  50%     { box-shadow: 0 0 0 8px rgba(139,92,246,0); transform: scale(.92); }
}
.now-date { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.now-list { list-style: none; }
.now-list li {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 0; font-size: 14px; color: var(--text-2); line-height: 1.65;
}
.now-list li + li { border-top: 1px dashed var(--hairline); }
.now-bullet {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand); margin-top: 9px; flex-shrink: 0;
}
.now-foot {
  margin-top: 18px; padding-top: 14px;
  border-top: 1px solid var(--hairline);
  font-size: 12px; color: var(--text-3); text-align: center;
}

/* ---------- 09 站点数据看板 ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.stat-card {
  padding: 28px 22px;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--surface-1) 48%, transparent);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  backdrop-filter: blur(24px) saturate(190%);
  border: 1px solid var(--hairline);
  box-shadow: var(--e1), var(--glass-edge), inset 0 1px 0 rgba(255,255,255,.6);
  text-align: center;
  transition: transform var(--dur-3) var(--ease-out), box-shadow var(--dur-3);
}
body[data-theme="dark"] .stat-card {
  background: color-mix(in srgb, var(--surface-1) 38%, transparent);
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--e3), var(--glass-edge);
}
.stat-num {
  font-family: var(--mono);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
  font-style: italic;
  letter-spacing: -.02em;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.05;
  margin-bottom: 6px;
}
.stat-label {
  font-size: 13px;
  color: var(--text-3);
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 600;
}
.stats-foot {
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
  margin-top: 8px;
}
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
  .stat-card { padding: 22px 12px; }
  .stat-num { font-size: 26px; }
  .stat-label { font-size: 11px; }
}


/* ---------- 08 公开留言墙 ---------- */
.wall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.wall-card {
  padding: 22px 22px 18px;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--surface-1) 48%, transparent);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  backdrop-filter: blur(24px) saturate(190%);
  border: 1px solid var(--hairline);
  box-shadow: var(--e1), var(--glass-edge), inset 0 1px 0 rgba(255,255,255,.6);
  transition: transform var(--dur-3) var(--ease-out), box-shadow var(--dur-3);
  display: flex; flex-direction: column;
}
body[data-theme="dark"] .wall-card {
  background: color-mix(in srgb, var(--surface-1) 38%, transparent);
}
.wall-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--e3), var(--glass-edge);
}
.wall-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.wall-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3);
}
.wall-time {
  font-family: var(--mono); font-size: 11px; color: var(--text-3);
  margin-left: auto; letter-spacing: .04em;
}
.wall-content {
  font-size: 14.5px; color: var(--text-1);
  line-height: 1.7; flex: 1;
  word-break: break-word;
}
.wall-reply {
  margin-top: 14px; padding: 10px 14px;
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  border-left: 2px solid var(--brand);
  border-radius: 0 8px 8px 0;
  font-size: 13px; color: var(--text-2);
  line-height: 1.6;
}
.wall-reply::before {
  content: '回 · ';
  color: var(--brand); font-weight: 600;
}
.wall-empty {
  grid-column: 1 / -1;
  text-align: center; padding: 60px 20px;
  color: var(--text-3); font-size: 14px;
}
.wall-go {
  display: inline-block; margin-left: 12px;
  color: var(--brand); font-weight: 600;
  border-bottom: 1px solid color-mix(in srgb, var(--brand) 40%, transparent);
  padding-bottom: 1px; transition: border-color var(--dur-2);
}
.wall-go:hover { border-color: var(--brand); }
@media (max-width: 480px) {
  .wall-grid { grid-template-columns: 1fr; gap: 12px; }
  .wall-card { padding: 18px; }
}

/* ---------- 13. 降低动效偏好：全面降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
  .bg-canvas { display: none !important; }
  .cursor-trail { display: none !important; }
  [data-parallax] { transform: none !important; }
  .avatar-wrap::after { animation: none; }
  /* 3D 倾斜：reduced-motion 用户直接禁用旋转/抬升 */
  .skill-card, .link-card, .project-item, .project-cover,
  .skill-card > *, .link-card > *, .project-cover img,
  .stat-card, .stat-card::before, .stat-card::after,
  .wall-card, .wall-card::before, .wall-card::after {
    transform: none !important;
    --rx: 0deg !important;
    --ry: 0deg !important;
    --ts: 1 !important;
  }
}
