/* ============================================================
   个人主页（深色 + 便当格）
   动效只做三件事：滚动触发展开、卡片悬停微交互、数字滚动。
   全部 CSS + 原生 JS，不依赖任何 CDN 或动画库。
   ============================================================ */

:root {
  --bg: #0a0b0f;
  --bg-soft: #0f1116;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.055);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e9ecf1;
  --text-soft: #b7bfcc;
  --muted: #8b95a5;
  --accent: #6d8bff;
  --accent-2: #34d8c0;
  --accent-3: #b57bff;
  --radius: 18px;
  --radius-sm: 12px;
  --wrap: 1140px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body.space-body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.icon { flex: 0 0 auto; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* ---------------- 背景层 ---------------- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.aurora-blob {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
}
.aurora-1 {
  width: 46vw; height: 46vw; min-width: 380px; min-height: 380px;
  top: -14vw; left: -8vw;
  background: radial-gradient(circle at 30% 30%, rgba(109, 139, 255, 0.85), transparent 68%);
  animation: drift1 26s ease-in-out infinite;
}
.aurora-2 {
  width: 40vw; height: 40vw; min-width: 320px; min-height: 320px;
  top: 24vh; right: -10vw;
  background: radial-gradient(circle at 60% 40%, rgba(52, 216, 192, 0.55), transparent 68%);
  animation: drift2 32s ease-in-out infinite;
}
.aurora-3 {
  width: 38vw; height: 38vw; min-width: 300px; min-height: 300px;
  bottom: -12vw; left: 24vw;
  background: radial-gradient(circle at 50% 50%, rgba(181, 123, 255, 0.45), transparent 68%);
  animation: drift3 38s ease-in-out infinite;
}
@keyframes drift1 {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(6vw, 5vh, 0) scale(1.12); }
}
@keyframes drift2 {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-7vw, -6vh, 0) scale(1.15); }
}
@keyframes drift3 {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(5vw, -7vh, 0) scale(1.1); }
}

/* 细网格：暗示"技术感"，比噪点更干净 */
.noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 60px 60px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 20%, transparent 78%);
}

.space-main, .space-header, .space-footer { position: relative; z-index: 1; }

/* ---------------- 头部导航 ---------------- */
.space-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), backdrop-filter 0.3s;
}
.space-header.is-scrolled {
  background: rgba(10, 11, 15, 0.72);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom-color: var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 68px;
}
.space-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.2px; }
.brand-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 14px rgba(109, 139, 255, 0.8);
  animation: pulse 3.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(109, 139, 255, 0.55); }
  50% { box-shadow: 0 0 20px rgba(52, 216, 192, 0.9); }
}
.brand-name { font-size: 15.5px; }

.space-nav { display: flex; align-items: center; gap: 4px; }
.space-nav > a {
  padding: 7px 13px;
  border-radius: 9px;
  font-size: 14px;
  color: var(--text-soft);
  transition: color 0.18s, background 0.18s;
}
.space-nav > a:hover { color: var(--text); background: var(--surface-2); }
.space-nav > a.is-active { color: var(--text); background: var(--surface-2); }
.space-nav > a.nav-blog {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: 8px;
  padding: 7px 15px;
  color: var(--text);
  border: 1px solid var(--border-strong);
  background: var(--surface);
}
.space-nav > a.nav-blog:hover {
  border-color: rgba(109, 139, 255, 0.6);
  background: rgba(109, 139, 255, 0.14);
  color: #fff;
}
.space-burger, #space-nav-toggle { display: none; }

/* ---------------- Hero ---------------- */
.hero { padding: 76px 0 40px; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 56px;
  align-items: center;
}
.hero-eyebrow {
  margin: 0 0 10px;
  font-size: 15px;
  color: var(--accent-2);
  letter-spacing: 0.08em;
}
.hero-name {
  margin: 0 0 14px;
  font-size: clamp(38px, 6vw, 60px);
  line-height: 1.08;
  font-weight: 750;
  letter-spacing: -1.6px;
  background: linear-gradient(120deg, #fff 8%, #cfd8ff 42%, var(--accent-2) 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-tagline {
  margin: 0 0 16px;
  font-size: clamp(20px, 2.6vw, 27px);
  line-height: 1.5;
  font-weight: 600;
  letter-spacing: -0.4px;
  color: var(--text);
  max-width: 22em;
}
.hero-intro { margin: 0 0 24px; color: var(--muted); font-size: 15.5px; max-width: 34em; }

.hero-keywords { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.kw {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-soft);
  border: 1px solid var(--border);
  background: var(--surface);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 11px;
  font-size: 14px;
  color: var(--text-soft);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform 0.2s var(--ease), border-color 0.2s, color 0.2s, background 0.2s;
}
.social-btn:hover {
  transform: translateY(-2px);
  color: #fff;
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.social-btn-primary {
  color: #fff;
  border-color: rgba(109, 139, 255, 0.5);
  background: linear-gradient(120deg, rgba(109, 139, 255, 0.9), rgba(52, 216, 192, 0.85));
  box-shadow: 0 8px 26px rgba(109, 139, 255, 0.28);
}
.social-btn-primary:hover { filter: brightness(1.08); border-color: transparent; }
.social-btn .arrow { transition: transform 0.2s var(--ease); }
.social-btn:hover .arrow { transform: translateX(3px); }

/* 头像 */
.hero-visual { position: relative; display: grid; place-items: center; }
.avatar-ring {
  position: relative;
  width: 228px; height: 228px;
  border-radius: 50%;
  padding: 4px;
  background: conic-gradient(from 0deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent));
  animation: spin 14s linear infinite;
  box-shadow: 0 0 60px rgba(109, 139, 255, 0.28);
}
@keyframes spin { to { transform: rotate(360deg); } }
.avatar-img, .avatar-letter {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #12141a;
  animation: spin 14s linear infinite reverse;
}
.avatar-letter {
  display: grid; place-items: center;
  font-size: 76px;
  font-weight: 700;
  color: #fff;
  background: radial-gradient(circle at 35% 30%, #22283a, #0e1016 70%);
}
.orbit-dot {
  position: absolute;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 12px var(--accent-2);
}
.orbit-1 { top: 12%; right: 20%; animation: float1 5.5s ease-in-out infinite; }
.orbit-2 { bottom: 14%; left: 18%; background: var(--accent-3); box-shadow: 0 0 12px var(--accent-3); animation: float1 7s ease-in-out infinite reverse; }
@keyframes float1 {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -14px, 0); }
}
.hero-handle {
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}

/* ---------------- 数字条 ---------------- */
.stats-bar {
  display: grid;
  /* 自适应列数：数字条写 3 项还是 5 项都不会留空档 */
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  margin-top: 54px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--border);
  overflow: hidden;
}
.stat { padding: 20px 22px; background: rgba(12, 14, 19, 0.72); backdrop-filter: blur(8px); }
.stat-value {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -1px;
  background: linear-gradient(120deg, #fff, var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---------------- 区块通用 ---------------- */
.section { padding: 76px 0; scroll-margin-top: 80px; }
.section-head { margin-bottom: 34px; }
.section-index {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent-2);
  letter-spacing: 0.15em;
  margin-bottom: 8px;
}
.section-head h2 {
  margin: 0 0 6px;
  font-size: clamp(26px, 3.6vw, 34px);
  font-weight: 700;
  letter-spacing: -0.9px;
}
.section-head p { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------------- 便当格 ---------------- */
.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 148px;
  gap: 16px;
}
.tile {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.3s var(--ease), border-color 0.3s, background 0.3s;
}
/* 悬停时跟随鼠标的高光 */
.tile::before, .honor-card::before, .hobby-card::before, .cta-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), rgba(109, 139, 255, 0.16), transparent 62%);
  pointer-events: none;
}
.tile:hover, .honor-card:hover, .hobby-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.tile:hover::before, .honor-card:hover::before, .hobby-card:hover::before, .cta-card:hover::before { opacity: 1; }

.tile-sm { grid-column: span 1; grid-row: span 1; }
.tile-wide { grid-column: span 2; }
.tile-full { grid-column: span 4; grid-row: span 1; }
.tile-tall { grid-row: span 2; }
.tile-lg { grid-column: span 2; grid-row: span 2; }

.tile-about { display: flex; flex-direction: column; justify-content: center; }
.tile-about h3 {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 14px;
  font-size: 17px;
  color: #fff;
}
.tile-about h3 .icon { color: var(--accent-2); }
.tile-about p { margin: 0 0 11px; color: var(--text-soft); font-size: 15px; line-height: 1.78; }
.tile-about p:last-child { margin-bottom: 0; }

.tile-fact { display: flex; flex-direction: column; justify-content: center; gap: 5px; }
.fact-icon {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  margin-bottom: 6px;
  color: var(--accent-2);
  background: rgba(52, 216, 192, 0.1);
  border: 1px solid rgba(52, 216, 192, 0.18);
}
.fact-label { font-size: 12.5px; color: var(--muted); }
.fact-value { font-size: 15.5px; font-weight: 600; color: #fff; line-height: 1.45; }

.tile-quote { display: flex; align-items: center; gap: 16px; padding: 22px 28px; }
.quote-mark {
  font-size: 58px; line-height: 0.6;
  color: var(--accent);
  opacity: 0.4;
  font-family: Georgia, serif;
  transform: translateY(10px);
}
.tile-quote p {
  margin: 0;
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.3px;
}

/* ---------------- 时间线 ---------------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px; top: 8px; bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg, rgba(109, 139, 255, 0.7), rgba(52, 216, 192, 0.25), transparent);
}
.timeline-item { position: relative; padding: 0 0 30px 40px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute; left: 0; top: 7px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(109, 139, 255, 0.1);
  transition: box-shadow 0.3s, border-color 0.3s;
}
.timeline-item:hover .timeline-dot {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 6px rgba(52, 216, 192, 0.16);
}
.timeline-body {
  padding: 18px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(10px);
  transition: border-color 0.25s, background 0.25s, transform 0.25s var(--ease);
}
.timeline-item:hover .timeline-body {
  border-color: var(--border-strong);
  background: var(--surface-2);
  transform: translateX(4px);
}
.timeline-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.timeline-period {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent-2);
}
.timeline-org { font-size: 13px; color: var(--muted); }
.timeline-title { margin: 0 0 8px; font-size: 17.5px; font-weight: 650; color: #fff; letter-spacing: -0.2px; }
.timeline-desc { margin: 0; color: var(--text-soft); font-size: 14.8px; line-height: 1.78; }

.tag-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.tag-chip {
  padding: 3px 10px;
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
}

/* ---------------- 荣誉 ---------------- */
.honor-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.honor-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 24px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(10px);
  transition: transform 0.3s var(--ease), border-color 0.3s, background 0.3s;
}
.honor-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.honor-icon {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: 12px;
  color: #ffd479;
  background: rgba(255, 212, 121, 0.1);
  border: 1px solid rgba(255, 212, 121, 0.2);
  transition: transform 0.35s var(--ease);
}
.honor-card:hover .honor-icon { transform: rotate(-8deg) scale(1.06); }
.honor-year { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.honor-title { margin: 0 0 6px; font-size: 16.5px; font-weight: 650; color: #fff; line-height: 1.5; }
.honor-org { margin: 0 0 8px; font-size: 13.5px; color: var(--accent-2); }
.honor-desc { margin: 0 0 14px; font-size: 14px; color: var(--text-soft); line-height: 1.72; flex: 1; }
.honor-level {
  align-self: flex-start;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  color: #ffd479;
  background: rgba(255, 212, 121, 0.1);
  border: 1px solid rgba(255, 212, 121, 0.22);
}

/* ---------------- 爱好 ---------------- */
.hobby-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.hobby-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 24px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(10px);
  transition: transform 0.3s var(--ease), border-color 0.3s, background 0.3s;
}
/* 顶部一道随分类变色的高光 */
.hobby-card::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.85;
}
.hobby-icon {
  display: grid; place-items: center;
  width: 48px; height: 48px;
  border-radius: 14px;
  margin-bottom: 16px;
  color: var(--accent);
  /* 先给个兜底色，支持 color-mix 的浏览器再用分类色微调 */
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  transition: transform 0.35s var(--ease);
}
.hobby-card:hover .hobby-icon { transform: translateY(-3px) scale(1.06); }
.hobby-card h3 { margin: 0 0 8px; font-size: 17px; font-weight: 650; color: #fff; }
.hobby-desc { margin: 0 0 16px; font-size: 14px; color: var(--text-soft); line-height: 1.72; flex: 1; }
.hobby-items { display: flex; flex-wrap: wrap; gap: 6px; }
.hobby-items span {
  padding: 3px 10px;
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

/* ---------------- 结尾 CTA ---------------- */
.section-cta { padding-bottom: 96px; }
.cta-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  padding: 38px 40px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background:
    radial-gradient(700px circle at 12% 0%, rgba(109, 139, 255, 0.18), transparent 60%),
    radial-gradient(600px circle at 92% 100%, rgba(52, 216, 192, 0.14), transparent 60%),
    var(--surface);
  backdrop-filter: blur(12px);
}
.cta-text h2 { margin: 0 0 8px; font-size: clamp(21px, 2.8vw, 27px); font-weight: 700; letter-spacing: -0.7px; }
.cta-text p { margin: 0; color: var(--muted); font-size: 15px; }
.cta-btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 26px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 30px rgba(109, 139, 255, 0.3);
  transition: transform 0.2s var(--ease), filter 0.2s, box-shadow 0.2s;
}
.cta-btn:hover { transform: translateY(-2px); filter: brightness(1.08); box-shadow: 0 14px 38px rgba(109, 139, 255, 0.4); }
.cta-btn .icon { transition: transform 0.2s var(--ease); }
.cta-btn:hover .icon { transform: translateX(4px); }

/* ---------------- 页脚 ---------------- */
.space-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0 32px;
  background: rgba(10, 11, 15, 0.6);
}
.footer-inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 28px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 8px; }
.footer-note { margin: 0; color: var(--muted); font-size: 13.5px; max-width: 44em; }
.footer-right { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.footer-socials { display: flex; gap: 8px; }
.footer-socials a {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all 0.2s var(--ease);
}
.footer-socials a:hover { color: #fff; border-color: var(--border-strong); transform: translateY(-2px); }
.footer-copy { margin: 0; color: var(--muted); font-size: 13px; }

/* ---------------- 相册（摄影） ---------------- */
.section-count {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 11px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--surface);
}

.gallery { display: grid; gap: 14px; }
/* 瀑布流：图片高低不一也贴得紧，照片墙首选 */
.gallery-masonry { grid-template-columns: repeat(3, 1fr); align-items: start; }
.gallery-masonry .shot:nth-child(3n + 2) { transform: translateY(26px); }
/* 规整网格：统一裁成 4:3 */
.gallery-grid { grid-template-columns: repeat(3, 1fr); }

.shot {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  cursor: zoom-in;
  transition: transform 0.35s var(--ease), border-color 0.3s, box-shadow 0.3s;
}
.shot:hover, .shot:focus-visible {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  outline: none;
}
.gallery-masonry .shot:nth-child(3n + 2):hover { transform: translateY(22px); }

.shot img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.5s var(--ease);
}
.gallery-grid .shot img { height: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.shot:hover img { transform: scale(1.045); }

.shot figcaption {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 34px 16px 14px;
  background: linear-gradient(180deg, transparent, rgba(6, 7, 10, 0.88));
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  pointer-events: none;
}
.shot:hover figcaption, .shot:focus-visible figcaption { opacity: 1; transform: none; }
.shot-title { font-size: 14.5px; font-weight: 600; color: #fff; }
.shot-caption {
  font-size: 12.5px;
  color: var(--text-soft);
  line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.shot-zoom {
  position: absolute;
  top: 12px; right: 12px;
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  color: #fff;
  background: rgba(10, 11, 15, 0.55);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.shot:hover .shot-zoom, .shot:focus-visible .shot-zoom { opacity: 1; transform: none; }

/* 目录为空时的提示（只在本地开发环境出现） */
.media-hint {
  padding: 34px 32px;
  border-radius: var(--radius);
  border: 1px dashed var(--border-strong);
  background: var(--surface);
  text-align: center;
}
.hint-icon {
  display: inline-grid; place-items: center;
  width: 54px; height: 54px;
  border-radius: 16px;
  margin-bottom: 16px;
  color: var(--accent-2);
  background: rgba(52, 216, 192, 0.1);
  border: 1px solid rgba(52, 216, 192, 0.22);
}
.media-hint h3 { margin: 0 0 10px; font-size: 17px; color: #fff; }
.media-hint p { margin: 0 0 10px; color: var(--text-soft); font-size: 14.5px; line-height: 1.75; }
.media-hint .hint-sub { color: var(--muted); font-size: 13.5px; }
.media-hint .hint-note { margin-bottom: 0; font-size: 12.5px; color: var(--muted); opacity: 0.75; }
.media-hint code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 2px 7px;
  border-radius: 6px;
  color: var(--accent-2);
  background: rgba(52, 216, 192, 0.1);
  border: 1px solid rgba(52, 216, 192, 0.18);
}

/* ---------------- 图片灯箱 ---------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: rgba(6, 7, 10, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s var(--ease), visibility 0.28s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }

.lightbox-figure {
  margin: 0;
  max-width: min(1200px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  transform: scale(0.965);
  transition: transform 0.32s var(--ease);
}
.lightbox.is-open .lightbox-figure { transform: none; }
.lightbox-figure img {
  max-width: 100%;
  max-height: calc(100vh - 180px);
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
}
.lightbox-meta { text-align: center; max-width: 60ch; }
.lightbox-title { display: block; font-size: 16px; font-weight: 600; color: #fff; }
.lightbox-caption { display: block; margin-top: 4px; font-size: 13.5px; color: var(--text-soft); line-height: 1.65; }
.lightbox-counter {
  display: block; margin-top: 8px;
  font-family: var(--font-mono); font-size: 12.5px; color: var(--muted);
}

.lightbox-btn {
  position: absolute;
  display: grid; place-items: center;
  width: 46px; height: 46px;
  border-radius: 12px;
  cursor: pointer;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  transition: background 0.2s, transform 0.2s var(--ease);
}
.lightbox-btn:hover { background: rgba(255, 255, 255, 0.16); transform: scale(1.05); }
.lightbox-close { top: 24px; right: 24px; }
.lightbox-prev { left: 24px; top: 50%; margin-top: -23px; }
.lightbox-next { right: 24px; top: 50%; margin-top: -23px; }
.lightbox-btn[disabled] { opacity: 0.3; cursor: default; }
.lightbox-btn[disabled]:hover { background: rgba(255, 255, 255, 0.08); transform: none; }

body.lightbox-open { overflow: hidden; }

/* ---------------- 滚动触发动效 ---------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}
[data-reveal].is-visible { opacity: 1; transform: none; }
[data-reveal-delay="1"] { transition-delay: 0.07s; }
[data-reveal-delay="2"] { transition-delay: 0.14s; }
[data-reveal-delay="3"] { transition-delay: 0.21s; }
[data-reveal-delay="4"] { transition-delay: 0.28s; }
[data-reveal-delay="5"] { transition-delay: 0.35s; }
[data-reveal-delay="6"] { transition-delay: 0.42s; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .hero-visual { justify-items: start; }
  .hobby-grid { grid-template-columns: repeat(2, 1fr); }
  .honor-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-masonry, .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-masonry .shot:nth-child(3n + 2) { transform: none; }
  .gallery-masonry .shot:nth-child(2n):hover, .gallery-masonry .shot:hover { transform: translateY(-4px); }
}

@media (max-width: 860px) {
  .bento { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 150px; }
  .tile-full { grid-column: span 2; grid-row: span 1; }
  .tile-lg { grid-column: span 2; grid-row: span 2; }
  .tile-wide { grid-column: span 2; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .space-burger {
    display: flex; flex-direction: column; justify-content: center; gap: 4px;
    width: 40px; height: 40px; padding: 0 9px; cursor: pointer;
    border: 1px solid var(--border); border-radius: 10px;
  }
  .space-burger span { display: block; height: 2px; background: var(--text-soft); border-radius: 2px; }
  #space-nav-toggle:checked ~ .space-burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  #space-nav-toggle:checked ~ .space-burger span:nth-child(2) { opacity: 0; }
  #space-nav-toggle:checked ~ .space-burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  .space-nav {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 12px 20px 18px;
    background: rgba(10, 11, 15, 0.97);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    display: none;
  }
  #space-nav-toggle:checked ~ .space-nav { display: flex; }
  .space-nav > a { padding: 11px 12px; }
  .space-nav > a.nav-blog { margin: 8px 0 0; justify-content: center; }

  .hero { padding: 44px 0 24px; }
  .avatar-ring { width: 168px; height: 168px; }
  .avatar-letter { font-size: 56px; }
  .section { padding: 56px 0; }
  .honor-grid, .hobby-grid { grid-template-columns: 1fr; }
  .cta-card { padding: 28px 24px; }
  .footer-inner { flex-direction: column; }
  .footer-right { align-items: flex-start; }

  /* 手机端相册保持两列，单列太长、翻起来累 */
  .gallery-masonry, .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .lightbox { padding: 20px 12px; }
  .lightbox-close { top: 12px; right: 12px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-figure img { max-height: calc(100vh - 220px); }
  .media-hint { padding: 26px 20px; }
}

@media (max-width: 420px) {
  .stats-bar { grid-template-columns: 1fr; }
  .tile-quote { padding: 20px; }
  .quote-mark { font-size: 44px; }
}

/* ---------------- 无障碍：尊重系统的"减少动态效果"设置 ---------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}
