/* ==========================================================
   LVH · 数字宇宙 —— 霓虹极光风格个人网站
   零依赖手写样式，主题全部由 CSS 变量驱动
   ========================================================== */

/* ---------- 变量与主题 ---------- */
:root {
  --font-display: "Unbounded", "ZCOOL QingKe HuangYou", sans-serif;
  --font-cn-display: "ZCOOL QingKe HuangYou", "Unbounded", sans-serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;

  /* 极光色板（常驻多彩） */
  --c-cyan: #22d3ee;
  --c-magenta: #e879f9;
  --c-amber: #fbbf24;
  --c-lime: #a3e635;
  --c-rose: #fb7185;
  --c-violet: #8b5cf6;

  --radius: 18px;
  --nav-h: 64px;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

/* 主题色（accent）—— 由 data-accent 切换 */
[data-accent="cyan"]    { --accent: #22d3ee; --accent-2: #8b5cf6; }
[data-accent="magenta"] { --accent: #e879f9; --accent-2: #22d3ee; }
[data-accent="amber"]   { --accent: #fbbf24; --accent-2: #fb7185; }
[data-accent="lime"]    { --accent: #a3e635; --accent-2: #22d3ee; }
[data-accent="rose"]    { --accent: #fb7185; --accent-2: #fbbf24; }

/* 明暗主题 */
[data-theme="dark"] {
  --bg: #07070f;
  --bg-soft: #0d0d1c;
  --text: #eaeaf2;
  --text-dim: #9a9ab0;
  --line: rgba(255, 255, 255, .1);
  --glass: rgba(255, 255, 255, .045);
  --glass-strong: rgba(255, 255, 255, .08);
  --shadow: 0 20px 60px rgba(0, 0, 0, .45);
  --aurora-opacity: .5;
  --noise-opacity: .05;
}
[data-theme="light"] {
  --bg: #f4f2ec;
  --bg-soft: #ffffff;
  --text: #1c1b22;
  --text-dim: #5d5c6b;
  --line: rgba(20, 20, 40, .12);
  --glass: rgba(255, 255, 255, .6);
  --glass-strong: rgba(255, 255, 255, .85);
  --shadow: 0 20px 50px rgba(60, 50, 110, .12);
  --aurora-opacity: .32;
  --noise-opacity: .035;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  transition: background .5s, color .5s;
}

::selection { background: var(--accent); color: #07070f; }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--accent), var(--accent-2));
  border-radius: 8px;
}

/* 键盘焦点统一高亮（输入框有自己的 focus 样式，排除避免双重描边） */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.field input:focus-visible,
.field textarea:focus-visible,
#terminalInput:focus-visible { outline: none; }

.mono { font-family: var(--font-mono); }
.accent { color: var(--accent); }
.hl {
  color: var(--accent);
  font-weight: 500;
}
kbd {
  font-family: var(--font-mono);
  font-size: .8em;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: .1em .45em;
  background: var(--glass-strong);
}

/* ---------- 自定义光标 ---------- */
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 9999;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.cursor-dot {
  width: 8px; height: 8px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.cursor-ring {
  width: 36px; height: 36px;
  border: 1.5px solid color-mix(in srgb, var(--accent) 60%, transparent);
  transition: width .25s, height .25s, border-color .25s;
}
body.cursor-hover .cursor-ring {
  width: 56px; height: 56px;
  border-color: var(--accent);
}
@media (hover: none), (pointer: coarse) {
  .cursor-dot, .cursor-ring { display: none; }
}

/* ---------- 背景层 ---------- */
#particles {
  position: fixed; inset: 0;
  z-index: -3;
}
.aurora {
  position: fixed; inset: 0;
  z-index: -4; overflow: hidden;
  opacity: var(--aurora-opacity);
  transition: opacity .5s;
}
.aurora-blob {
  position: absolute;
  width: 55vmax; height: 55vmax;
  border-radius: 50%;
  filter: blur(90px);
  animation: drift 26s infinite alternate var(--ease-out);
}
.aurora-1 { background: radial-gradient(circle, var(--c-cyan), transparent 65%); top: -18%; left: -12%; }
.aurora-2 { background: radial-gradient(circle, var(--c-magenta), transparent 65%); bottom: -22%; right: -14%; animation-delay: -7s; }
.aurora-3 { background: radial-gradient(circle, var(--c-amber), transparent 68%); top: 30%; right: -20%; width: 42vmax; height: 42vmax; animation-delay: -13s; }
.aurora-4 { background: radial-gradient(circle, var(--c-lime), transparent 70%); bottom: 5%; left: -18%; width: 38vmax; height: 38vmax; animation-delay: -19s; }
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(9vmax, -7vmax) scale(1.18); }
}
.noise {
  position: fixed; inset: 0;
  z-index: -2; pointer-events: none;
  opacity: var(--noise-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 滚动进度条 ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0;
  height: 3px; width: 0;
  z-index: 1001;
  background: linear-gradient(90deg, var(--c-cyan), var(--c-magenta), var(--c-amber), var(--c-lime));
  box-shadow: 0 0 12px var(--accent);
}

/* ---------- 导航 ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
  z-index: 1000;
  transition: background .4s, backdrop-filter .4s, border-color .4s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: var(--bg); /* color-mix 不支持时的回退 */
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.nav-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: .04em;
  user-select: none;
}
.logo-dot { color: var(--accent); }
.nav-links {
  display: flex; gap: .25rem;
  list-style: none;
  margin-left: auto;
}
.nav-links a {
  display: block;
  padding: .45rem .8rem;
  color: var(--text-dim);
  text-decoration: none;
  font-size: .92rem;
  border-radius: 999px;
  transition: color .25s, background .25s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.nav-actions { display: flex; gap: .5rem; }
.icon-btn {
  width: 38px; height: 38px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: .95rem;
  cursor: pointer;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.icon-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 35%, transparent);
}
.nav-burger {
  display: none;
  flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer;
  padding: 6px; margin-left: auto;
}
.nav-burger span {
  width: 22px; height: 2px;
  background: var(--text);
  transition: transform .3s, opacity .3s;
}

/* 主题色选择弹层 */
.palette-pop {
  position: absolute;
  top: calc(var(--nav-h) + 8px);
  right: clamp(1rem, 4vw, 2.5rem);
  display: flex; gap: .6rem;
  padding: .7rem .9rem;
  background: var(--glass-strong);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.palette-pop[hidden] { display: none; }
.swatch {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--sw);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.swatch:hover { transform: scale(1.2); box-shadow: 0 0 14px var(--sw); }
.swatch.active { border-color: var(--text); }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh; /* svh 不支持时的回退 */
  min-height: 100svh;
  display: flex; flex-direction: column;
  justify-content: center; align-items: flex-start;
  padding: calc(var(--nav-h) + 4vh) clamp(1.2rem, 7vw, 7rem) 0;
  position: relative;
}
.hero-kicker {
  color: var(--accent);
  font-size: .92rem;
  letter-spacing: .12em;
  margin-bottom: 1.2rem;
  animation: fadeUp .8s var(--ease-out) both;
}
.hero-title {
  font-family: var(--font-cn-display);
  font-size: clamp(2.6rem, 8vw, 6.2rem);
  line-height: 1.12;
  font-weight: 400;
  letter-spacing: .02em;
  animation: fadeUp .8s .1s var(--ease-out) both;
}
.hero-name {
  font-family: var(--font-display);
  font-weight: 800;
  background: linear-gradient(100deg, var(--c-cyan) 0%, var(--c-magenta) 35%, var(--c-amber) 70%, var(--c-lime) 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientShift 8s ease infinite;
}
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
/* 故障风格描边 */
.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute; inset: 0;
  background: inherit;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0;
}
.glitch:hover::before {
  opacity: .8;
  transform: translate(3px, -2px);
  filter: hue-rotate(90deg);
  animation: glitchJitter .3s steps(2) infinite;
}
.glitch:hover::after {
  opacity: .8;
  transform: translate(-3px, 2px);
  filter: hue-rotate(-90deg);
  animation: glitchJitter .3s steps(2) infinite reverse;
}
@keyframes glitchJitter {
  0% { clip-path: inset(0 0 60% 0); }
  50% { clip-path: inset(40% 0 20% 0); }
  100% { clip-path: inset(70% 0 0 0); }
}
.hero-type {
  margin-top: 1.4rem;
  font-size: clamp(1rem, 2.4vw, 1.4rem);
  color: var(--text-dim);
  animation: fadeUp .8s .2s var(--ease-out) both;
}
#typed { color: var(--accent); font-weight: 700; }
.caret { animation: blink 1s steps(1) infinite; color: var(--accent); }
@keyframes blink { 50% { opacity: 0; } }
.hero-sub {
  margin-top: 1.2rem;
  color: var(--text-dim);
  max-width: 560px;
  animation: fadeUp .8s .3s var(--ease-out) both;
}
.hero-cta {
  display: flex; gap: 1rem; flex-wrap: wrap;
  margin-top: 2.2rem;
  animation: fadeUp .8s .4s var(--ease-out) both;
}

/* 按钮 */
.btn {
  display: inline-block;
  padding: .8rem 1.7rem;
  border-radius: 999px;
  font-size: .95rem;
  font-weight: 500;
  text-decoration: none;
  border: none; cursor: pointer;
  font-family: var(--font-body);
  transition: transform .25s var(--ease-out), box-shadow .25s;
}
.btn:active { transform: scale(.96); }
.btn-primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #0a0a14;
  box-shadow: 0 6px 24px color-mix(in srgb, var(--accent) 40%, transparent);
  position: relative;
  overflow: hidden;
}
/* 悬停时一道流光扫过 */
.btn-primary::after {
  content: "";
  position: absolute; top: 0; left: -70%;
  width: 45%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .5), transparent);
  transform: skewX(-20deg);
  transition: left .55s var(--ease-out);
  pointer-events: none;
}
.btn-primary:hover::after { left: 130%; }
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px color-mix(in srgb, var(--accent) 55%, transparent);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); }

/* 跑马灯 */
.marquee {
  position: absolute; bottom: 9vh; left: 0; right: 0;
  overflow: hidden;
  pointer-events: none; /* 纯装饰，不拦截 CTA 点击 */
  mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}
.marquee-track {
  display: inline-flex; gap: 2.2rem;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: .95rem;
  color: var(--text-dim);
  padding-block: .6rem;
  animation: marquee 26s linear infinite;
}
.marquee-track span:nth-child(even) { color: var(--accent); }
@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* 滚动提示 */
.scroll-hint {
  position: absolute; bottom: 2.4vh; left: 50%;
  transform: translateX(-50%);
}
.mouse {
  display: block;
  width: 24px; height: 38px;
  border: 2px solid var(--text-dim);
  border-radius: 14px;
  position: relative;
}
.wheel {
  position: absolute; top: 6px; left: 50%;
  width: 3px; height: 7px;
  margin-left: -1.5px;
  background: var(--accent);
  border-radius: 3px;
  animation: wheelMove 1.6s infinite;
}
@keyframes wheelMove {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(12px); opacity: 0; }
  100% { opacity: 0; }
}

/* ---------- 通用 Section ---------- */
.section {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(4rem, 10vh, 7rem) clamp(1.2rem, 5vw, 2.5rem);
}
.section-head {
  display: flex; align-items: baseline; gap: 1.2rem;
  margin-bottom: 2.6rem;
}
.section-num {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 700;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(128, 150, 200, .55); /* color-mix 回退 */
  -webkit-text-stroke: 1.5px color-mix(in srgb, var(--accent) 55%, transparent);
  line-height: 1;
}
.section-title {
  font-family: var(--font-cn-display);
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  font-weight: 400;
  letter-spacing: .04em;
}

/* 卡片 */
.card {
  border-radius: var(--radius);
  padding: 1.8rem;
}
.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}
.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1.1rem;
  letter-spacing: .03em;
}

/* 滚动显现 */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
}
.reveal.in { opacity: 1; transform: none; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 关于 ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 1.6rem;
}
.about-text + .about-text { margin-top: 1rem; }
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.stat { text-align: center; padding: 1.3rem .8rem; }
.stat-num {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 18px color-mix(in srgb, var(--accent) 50%, transparent);
}
.stat-unit { color: var(--text-dim); margin-left: .15rem; }
.stat p { font-size: .85rem; color: var(--text-dim); margin-top: .3rem; }

/* ---------- 技能 ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.6rem;
}
.skill + .skill { margin-top: 1.1rem; }
.skill-label {
  display: flex; justify-content: space-between;
  font-size: .92rem;
  margin-bottom: .45rem;
}
.skill-label .mono { color: var(--accent); }
.bar {
  height: 8px;
  background: rgba(128, 128, 128, .15); /* color-mix 回退 */
  background: color-mix(in srgb, var(--text) 8%, transparent);
  border-radius: 6px;
  overflow: hidden;
}
.bar-fill {
  height: 100%; width: 0;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 10px var(--accent);
  transition: width 1.2s var(--ease-out);
}
.in .bar-fill { width: var(--w); }
.tags { display: flex; flex-wrap: wrap; gap: .55rem; }
.tag {
  font-family: var(--font-mono);
  font-size: .82rem;
  padding: .35rem .8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-dim);
  transition: all .25s;
  cursor: default;
}
.tag:hover {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 30%, transparent);
  transform: translateY(-2px);
}
.tag-alt { border-style: dashed; }

/* ---------- 项目 ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.project {
  padding: 1.4rem;
  transition: transform .2s ease-out, box-shadow .3s;
  transform-style: preserve-3d;
  will-change: transform;
}
.project:hover {
  box-shadow: 0 24px 60px color-mix(in srgb, var(--accent) 18%, transparent);
}
.project-art {
  height: 130px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 2.6rem;
  background:
    radial-gradient(circle at 25% 20%, color-mix(in srgb, var(--g1) 55%, transparent), transparent 60%),
    radial-gradient(circle at 80% 85%, color-mix(in srgb, var(--g2) 55%, transparent), transparent 60%),
    var(--bg-soft);
  border: 1px solid var(--line);
  margin-bottom: 1.1rem;
  transform: translateZ(28px);
}
.project h3 {
  font-size: 1.08rem;
  margin-bottom: .5rem;
  transform: translateZ(20px);
}
.project p {
  font-size: .88rem;
  color: var(--text-dim);
  transform: translateZ(12px);
}
.project-meta {
  display: flex; gap: .8rem; flex-wrap: wrap;
  margin-top: 1rem;
  font-size: .74rem;
  color: var(--accent);
}
.project-meta span::before { content: "# "; opacity: .6; }
.project-links {
  display: flex; gap: .6rem;
  margin-top: 1rem;
  transform: translateZ(16px);
}
.project-links a {
  font-family: var(--font-mono);
  font-size: .78rem;
  padding: .3rem .8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-dim);
  text-decoration: none;
  transition: all .25s;
}
.project-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 30%, transparent);
}

/* ---------- 时间线 ---------- */
.timeline {
  position: relative;
  padding-left: 2rem;
}
.timeline::before {
  content: "";
  position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--c-cyan), var(--c-magenta), var(--c-amber), var(--c-lime));
  border-radius: 2px;
}
.tl-item { position: relative; margin-bottom: 1.6rem; }
.tl-dot {
  position: absolute; left: -2rem; top: 1.5rem;
  width: 16px; height: 16px;
  margin-left: 0;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
  box-shadow: 0 0 14px var(--accent);
}
.tl-date { color: var(--accent); font-size: .82rem; letter-spacing: .08em; }
.tl-item h3 { margin: .4rem 0 .35rem; font-size: 1.05rem; }
.tl-item p { color: var(--text-dim); font-size: .92rem; }

/* ---------- 游乐场 ---------- */
.playground-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.6rem;
  align-items: start;
}
.game-card { text-align: center; }
.game-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap; gap: .5rem;
}
.game-head .card-title { margin-bottom: 0; }
.game-scores { font-size: .85rem; color: var(--text-dim); display: flex; gap: 1.2rem; }
.game-scores b { color: var(--accent); }
#snake:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
#snake {
  width: min(100%, 360px);
  aspect-ratio: 1;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  /* 游戏无触摸手势监听，manipulation 只禁双击缩放、不阻断页面滚动 */
  touch-action: manipulation;
}
.game-controls { margin-top: 1rem; }
.game-hint { font-size: .78rem; color: var(--text-dim); margin-top: .7rem; }
.dpad {
  display: none;
  grid-template-areas: ". up ." "left down right";
  gap: .5rem;
  justify-content: center;
  margin-top: 1rem;
}
.dpad button {
  width: 52px; height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--glass-strong);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
}
.dpad [data-dir="up"] { grid-area: up; }
.dpad [data-dir="left"] { grid-area: left; }
.dpad [data-dir="down"] { grid-area: down; }
.dpad [data-dir="right"] { grid-area: right; }
@media (pointer: coarse) { .dpad { display: grid; } }

.fortune {
  min-height: 3.2em;
  color: var(--text-dim);
  font-size: .95rem;
  margin-bottom: 1rem;
}
.fortune.flash { animation: fortunePop .5s var(--ease-out); color: var(--text); }
@keyframes fortunePop {
  0% { opacity: 0; transform: translateY(8px) scale(.97); }
  100% { opacity: 1; transform: none; }
}
.divider {
  border: none; height: 1px;
  background: var(--line);
  margin: 1.5rem 0;
}
.egg-list { list-style: none; }
.egg-list li {
  font-size: .9rem;
  color: var(--text-dim);
  padding: .35rem 0 .35rem 1.4rem;
  position: relative;
}
.egg-list li::before {
  content: "✦";
  position: absolute; left: 0;
  color: var(--accent);
}

/* ---------- 留言板 ---------- */
.guestbook-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 1.6rem;
  align-items: start;
}
.field { display: block; margin-bottom: 1.1rem; }
.field span {
  display: block;
  font-size: .85rem;
  color: var(--text-dim);
  margin-bottom: .4rem;
}
.field input, .field textarea {
  width: 100%;
  background: color-mix(in srgb, var(--text) 5%, transparent);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .75rem 1rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: .95rem;
  resize: vertical;
  transition: border-color .25s, box-shadow .25s;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.gb-actions {
  display: flex; justify-content: space-between; align-items: center;
}
.gb-count { font-size: .8rem; color: var(--text-dim); }
.gb-foot {
  display: flex; justify-content: space-between; align-items: center;
  gap: .8rem;
  margin-top: 1rem;
}
.gb-note { font-size: .74rem; color: var(--text-dim); opacity: .8; }
.gb-export {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-dim);
  font-size: .74rem;
  padding: .3rem .8rem;
  cursor: pointer;
  transition: all .25s;
}
.gb-export:hover { color: var(--accent); border-color: var(--accent); }
.gb-list { display: flex; flex-direction: column; gap: 1rem; }
.gb-item {
  padding: 1.1rem 1.3rem;
  border-radius: 14px;
  background: var(--glass);
  border: 1px solid var(--line);
  animation: fadeUp .5s var(--ease-out);
  position: relative;
}
.gb-item-head {
  display: flex; align-items: center; gap: .6rem;
  margin-bottom: .4rem;
}
.gb-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: .8rem; font-weight: 700;
  color: #0a0a14;
  background: linear-gradient(135deg, var(--av1, var(--accent)), var(--av2, var(--accent-2)));
}
.gb-name { font-weight: 600; font-size: .92rem; }
.gb-time { font-size: .74rem; color: var(--text-dim); margin-left: auto; }
.gb-text { font-size: .92rem; color: var(--text-dim); word-break: break-word; }
.gb-del {
  position: absolute; top: .6rem; right: .8rem;
  background: none; border: none;
  color: var(--text-dim);
  cursor: pointer; font-size: .8rem;
  opacity: 0; transition: opacity .2s;
}
.gb-item:hover .gb-del { opacity: .7; }
.gb-del:hover { color: var(--c-rose); }
.gb-del:focus-visible {
  opacity: 1;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.gb-empty {
  color: var(--text-dim);
  font-size: .9rem;
  text-align: center;
  padding: 2rem 0;
  border: 1px dashed var(--line);
  border-radius: 14px;
}

/* ---------- 联系 ---------- */
.contact { text-align: center; padding: 3rem 2rem; }
.contact-big {
  font-family: var(--font-cn-display);
  font-size: clamp(1.5rem, 3.6vw, 2.2rem);
  margin-bottom: 1.8rem;
}
.contact-links {
  display: flex; gap: 1rem; flex-wrap: wrap;
  justify-content: center;
}
.contact-link {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .7rem 1.3rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  font-size: .92rem;
  transition: all .25s;
}
.copy-btn {
  background: transparent;
  cursor: pointer;
  font-family: var(--font-body);
}
.contact-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 25%, transparent);
}

/* ---------- 页脚 ---------- */
.footer {
  text-align: center;
  padding: 2.5rem 1rem 3rem;
  border-top: 1px solid var(--line);
  color: var(--text-dim);
  font-size: .85rem;
}
.footer-tip { margin-top: .4rem; opacity: .6; font-size: .76rem; }

/* ---------- 返回顶部 ---------- */
.to-top {
  position: fixed;
  right: 1.6rem; bottom: 1.6rem;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--glass-strong);
  backdrop-filter: blur(10px);
  color: var(--accent);
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0; pointer-events: none;
  transform: translateY(12px);
  transition: all .35s var(--ease-out);
  z-index: 900;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { border-color: var(--accent); box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 40%, transparent); }

/* ---------- 终端 ---------- */
.terminal-overlay {
  position: fixed; inset: 0;
  z-index: 2000;
  background: rgba(4, 4, 12, .6);
  backdrop-filter: blur(6px);
  display: grid; place-items: center;
  padding: 1rem;
}
.terminal-overlay[hidden] { display: none; }
.terminal {
  width: min(680px, 100%);
  border-radius: 14px;
  overflow: hidden;
  background: #0b0b16;
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 40px color-mix(in srgb, var(--accent) 20%, transparent);
  animation: termIn .35s var(--ease-out);
}
@keyframes termIn {
  from { opacity: 0; transform: translateY(24px) scale(.97); }
  to { opacity: 1; transform: none; }
}
.terminal-bar {
  display: flex; align-items: center; gap: .5rem;
  padding: .6rem .9rem;
  background: rgba(255, 255, 255, .05);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.t-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--c); }
.terminal-title {
  margin-left: .6rem;
  font-size: .8rem;
  color: #9a9ab0;
}
.terminal-close {
  margin-left: auto;
  background: none; border: none;
  color: #9a9ab0; cursor: pointer;
  font-size: .9rem;
}
.terminal-close:hover { color: #fff; }
.terminal-body {
  height: 300px;
  overflow-y: auto;
  padding: 1rem 1.1rem;
  font-size: .85rem;
  color: #c8c8dc;
  line-height: 1.75;
}
.terminal-body p { white-space: pre-wrap; word-break: break-word; }
.terminal-body b { color: var(--accent); }
.terminal-body .t-cmd { color: #eaeaf2; }
.terminal-body .t-cmd::before { content: "➜ ~ "; color: var(--c-lime); }
.terminal-input-row {
  display: flex; align-items: center; gap: .6rem;
  padding: .7rem 1.1rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.prompt { color: var(--c-lime); font-size: .85rem; }
#terminalInput {
  flex: 1;
  background: none; border: none; outline: none;
  color: #eaeaf2;
  font-family: var(--font-mono);
  font-size: .88rem;
  caret-color: var(--accent);
}

/* ---------- 彩虹模式（Konami 彩蛋） ---------- */
body.rainbow .aurora { opacity: .85; }
body.rainbow .aurora-blob { animation-duration: 6s; filter: blur(70px) saturate(1.6); }
body.rainbow .hero-name { animation-duration: 2s; }

/* 彩带粒子 */
.confetti {
  position: fixed;
  top: -12px;
  z-index: 3000;
  width: 9px; height: 14px;
  pointer-events: none;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  to {
    transform: translateY(105vh) rotate(720deg);
    opacity: .2;
  }
}

/* Toast 提示 */
.toast {
  position: fixed;
  left: 50%; bottom: 2.4rem;
  transform: translateX(-50%) translateY(20px);
  background: var(--glass-strong);
  backdrop-filter: blur(14px);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: .7rem 1.4rem;
  border-radius: 999px;
  font-size: .9rem;
  z-index: 3001;
  opacity: 0;
  transition: all .35s var(--ease-out);
  box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 30%, transparent);
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .about-grid, .skills-grid, .playground-grid, .guestbook-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 840px) {
  .nav-links {
    position: fixed;
    top: var(--nav-h); left: 0; right: 0;
    flex-direction: column;
    background: var(--bg); /* color-mix 不支持时的回退 */
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
    padding: 1rem 1.4rem 1.4rem;
    gap: .3rem;
    transform: translateY(-130%);
    /* 收起态延迟置为 visibility:hidden，链接退出 Tab 序列且不破坏滑出动画 */
    visibility: hidden;
    transition: transform .4s var(--ease-out), visibility 0s .4s;
  }
  .nav-links.open {
    transform: none;
    visibility: visible;
    transition: transform .4s var(--ease-out), visibility 0s;
  }
  .nav-burger { display: flex; }
  .nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .projects-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .desk-only { display: none; }
  .marquee { bottom: 12vh; }
}

/* 矮视口（横屏手机）下跑马灯会压到 CTA 按钮，直接隐藏 */
@media (max-height: 520px) {
  .marquee { display: none; }
}

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