/* ============================================================
   陈默 · 全栈开发工程师 作品集
   主题变量集中在此，方便一键换肤
   ============================================================ */
:root {
  --bg: #05070d;
  --bg-soft: #0a0f1c;
  --bg-card: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.09);
  --text: #e8edf7;
  --muted: #8b95ab;
  --cyan: #22d3ee;
  --purple: #a855f7;
  --pink: #ec4899;
  --grad: linear-gradient(120deg, var(--cyan), var(--purple) 60%, var(--pink));
  --font-sans: "Noto Sans SC", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Consolas, monospace;
  --radius: 16px;
  --nav-h: 72px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.7;
  overflow-x: hidden;
}

/* 全局网格背景 + 氛围光 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

::selection { background: rgba(34, 211, 238, 0.35); color: #fff; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--cyan), var(--purple));
  border-radius: 8px;
  border: 2px solid var(--bg);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

/* ---------- 自定义光标 ---------- */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  border-radius: 50%;
  z-index: 9999;
  transform: translate(-50%, -50%);
}
.cursor-dot { width: 7px; height: 7px; background: var(--cyan); }
.cursor-ring {
  width: 38px; height: 38px;
  border: 1.5px solid rgba(34, 211, 238, 0.55);
  transition: width 0.25s, height 0.25s, background 0.25s, border-color 0.25s;
}
.cursor-ring.hovering {
  width: 60px; height: 60px;
  background: rgba(34, 211, 238, 0.1);
  border-color: var(--purple);
}
@media (hover: none), (pointer: coarse) {
  .cursor-dot, .cursor-ring { display: none; }
}

/* ---------- 滚动进度条 ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: var(--grad);
  transform-origin: 0 50%;
  transform: scaleX(0);
  z-index: 1001;
}

/* ---------- 导航 ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  transition: background 0.35s, box-shadow 0.35s, backdrop-filter 0.35s;
}
.nav.scrolled {
  background: rgba(5, 7, 13, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 var(--border), 0 12px 40px rgba(0, 0, 0, 0.45);
}
.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.nav-logo span {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nav-links {
  display: flex;
  gap: 6px;
  list-style: none;
  margin-left: auto;
}
.nav-links a {
  position: relative;
  display: block;
  padding: 8px 14px;
  font-size: 0.92rem;
  color: var(--muted);
  transition: color 0.25s;
}
.nav-links a span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--cyan);
  margin-right: 4px;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 2px;
  height: 2px;
  background: var(--grad);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }

.nav-cta {
  padding: 9px 22px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.45);
  border-radius: 999px;
  transition: all 0.3s;
}
.nav-cta:hover {
  background: rgba(34, 211, 238, 0.12);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.3);
  transform: translateY(-1px);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 6px;
  margin-left: auto;
}
.nav-toggle span {
  width: 24px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
#particleCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero-glow {
  position: absolute;
  top: -20%; right: -10%;
  width: 60vw; height: 60vw;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.16), transparent 60%);
  filter: blur(20px);
  animation: pulseGlow 7s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes pulseGlow {
  from { opacity: 0.6; transform: scale(1); }
  to { opacity: 1; transform: scale(1.12); }
}

.hero-deco {
  position: absolute;
  font-family: var(--font-mono);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.05);
  user-select: none;
  pointer-events: none;
  animation: floatY 7s ease-in-out infinite;
}
.deco-bracket { top: 18%; right: 12%; font-size: 7rem; }
.deco-tag { bottom: 22%; right: 22%; font-size: 4rem; animation-delay: 1.6s; }
.deco-semi { top: 30%; left: 6%; font-size: 6rem; animation-delay: 3s; }
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-22px); }
}

.hero-content { padding-top: var(--nav-h); }
.hero-greeting {
  font-family: var(--font-mono);
  color: var(--cyan);
  font-size: 1rem;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.hero-greeting::before {
  content: "";
  width: 42px; height: 1px;
  background: linear-gradient(90deg, var(--cyan), transparent);
}
.hero-name {
  font-size: clamp(3rem, 8vw, 5.6rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: 1px;
}
.hero-name em {
  font-style: normal;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-roles {
  margin-top: 14px;
  font-size: clamp(1.35rem, 3.4vw, 2.2rem);
  font-weight: 700;
  color: var(--muted);
}
.typing-wrap {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.caret {
  display: inline-block;
  width: 3px; height: 1.05em;
  margin-left: 4px;
  background: var(--cyan);
  vertical-align: -0.15em;
  animation: blink 0.85s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-tagline {
  margin-top: 24px;
  max-width: 560px;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-actions { display: flex; gap: 18px; margin-top: 40px; flex-wrap: wrap; }

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 999px;
  font-size: 0.98rem;
  font-weight: 600;
  border: none;
  transition: transform 0.3s, box-shadow 0.3s, background 0.3s, color 0.3s;
  overflow: hidden;
}
.btn-primary {
  background: var(--grad);
  color: #060a12;
  box-shadow: 0 8px 28px rgba(34, 211, 238, 0.28);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 40px rgba(168, 85, 247, 0.42);
}
.btn-ghost {
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  transform: translateY(-3px);
}
.btn-block { width: 100%; }

.hero-socials { display: flex; gap: 14px; margin-top: 44px; }
.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--muted);
  background: var(--bg-card);
  transition: all 0.3s;
}
.social-btn:hover {
  color: var(--cyan);
  border-color: rgba(34, 211, 238, 0.5);
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(34, 211, 238, 0.18);
}

.scroll-hint {
  position: absolute;
  bottom: 34px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  z-index: 2;
}
.mouse {
  width: 24px; height: 38px;
  border: 2px solid var(--muted);
  border-radius: 14px;
  display: flex;
  justify-content: center;
  padding-top: 6px;
}
.wheel {
  width: 3px; height: 8px;
  background: var(--cyan);
  border-radius: 3px;
  animation: wheel 1.6s ease-out infinite;
}
@keyframes wheel {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(12px); opacity: 0; }
  100% { opacity: 0; }
}
.scroll-hint-text {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 3px;
}

/* ---------- 通用 Section ---------- */
.section { padding: 120px 0; position: relative; }
.section-alt {
  background:
    radial-gradient(ellipse 60% 50% at 80% 10%, rgba(168, 85, 247, 0.07), transparent),
    radial-gradient(ellipse 50% 40% at 10% 90%, rgba(34, 211, 238, 0.06), transparent),
    var(--bg-soft);
}
section { scroll-margin-top: calc(var(--nav-h) - 8px); }

.section-title {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 800;
  margin-bottom: 22px;
}
.section-num {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--cyan);
  padding-top: 6px;
}
.section-title::after {
  content: "";
  flex: 1;
  max-width: 280px;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}
.section-sub { color: var(--muted); margin-bottom: 46px; }

/* 滚动入场动画 */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1), transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- 关于我 ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  margin-top: 40px;
  align-items: start;
}
.about-text p { color: var(--muted); margin-bottom: 18px; }
.about-text strong { color: var(--text); }
.about-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

.chip {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--bg-card);
  transition: all 0.25s;
}
.chip:hover { color: var(--cyan); border-color: rgba(34, 211, 238, 0.5); transform: translateY(-2px); }

.about-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.stat-card {
  padding: 28px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.stat-card:hover {
  transform: translateY(-5px);
  border-color: rgba(34, 211, 238, 0.4);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}
.stat-value {
  font-family: var(--font-mono);
  font-size: 2.3rem;
  font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-label { color: var(--muted); font-size: 0.9rem; margin-top: 4px; }

/* ---------- 技能 ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 46px;
}
.skill-card {
  padding: 32px 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  transition: transform 0.35s, border-color 0.35s, box-shadow 0.35s;
}
.skill-card:hover {
  transform: translateY(-6px);
  border-color: rgba(168, 85, 247, 0.45);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
}
.skill-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}
.skill-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px; height: 46px;
  border-radius: 12px;
  color: var(--cyan);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.14), rgba(168, 85, 247, 0.14));
  border: 1px solid rgba(34, 211, 238, 0.25);
}
.skill-head h3 { font-size: 1.12rem; }

.skill-bar { margin-bottom: 18px; }
.skill-bar-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  margin-bottom: 8px;
}
.skill-bar-head span:last-child {
  font-family: var(--font-mono);
  color: var(--cyan);
  font-size: 0.8rem;
}
.skill-track {
  height: 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.skill-fill {
  height: 100%;
  width: 0;
  border-radius: 6px;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.55);
  transition: width 1.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in .skill-fill { width: var(--w); }

/* ---------- 项目案例 ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
.project-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s ease-out, border-color 0.35s, box-shadow 0.35s;
  will-change: transform;
}
.project-card:hover {
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(34, 211, 238, 0.15);
}
.project-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.project-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.project-card:hover .project-media img { transform: scale(1.07); }
.project-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(5, 7, 13, 0.9));
}
.project-index {
  position: absolute;
  top: 16px; right: 18px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--cyan);
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, 0.35);
  background: rgba(5, 7, 13, 0.6);
  backdrop-filter: blur(6px);
}
.project-type {
  position: absolute;
  top: 16px; left: 18px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 5px 12px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}
.project-type.app {
  color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.4);
  background: rgba(34, 211, 238, 0.12);
}
.project-type.web {
  color: var(--purple);
  border: 1px solid rgba(168, 85, 247, 0.4);
  background: rgba(168, 85, 247, 0.14);
}
.project-body { padding: 26px 26px 28px; }
.project-title { font-size: 1.28rem; font-weight: 700; }
.project-sub {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--cyan);
  margin: 6px 0 12px;
}
.project-desc {
  color: var(--muted);
  font-size: 0.94rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.project-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}
.project-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
}
.project-more {
  flex-shrink: 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--cyan);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.25s;
}
.project-card:hover .project-more { gap: 12px; }

/* ---------- 经历时间线 ---------- */
.timeline {
  position: relative;
  margin-top: 56px;
  padding: 10px 0;
}
.timeline::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, var(--cyan), var(--purple), transparent);
  opacity: 0.5;
}
.timeline-item {
  position: relative;
  width: calc(50% - 42px);
  margin-bottom: 48px;
}
.timeline-item:nth-child(odd) { margin-left: 0; text-align: right; }
.timeline-item:nth-child(even) { margin-left: calc(50% + 42px); }
.timeline-dot {
  position: absolute;
  top: 26px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--cyan);
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.8);
}
.timeline-item:nth-child(odd) .timeline-dot { right: -50px; }
.timeline-item:nth-child(even) .timeline-dot { left: -50px; }

.timeline-card {
  padding: 26px 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  text-align: left;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.timeline-card:hover {
  transform: translateY(-4px);
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.45);
}
.timeline-period {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--cyan);
  letter-spacing: 1px;
}
.timeline-role { font-size: 1.15rem; font-weight: 700; margin-top: 8px; }
.timeline-company { color: var(--purple); font-size: 0.92rem; margin: 2px 0 12px; }
.timeline-desc { color: var(--muted); font-size: 0.92rem; }
.timeline-tech { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* ---------- 联系 ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 56px;
  margin-top: 46px;
  align-items: start;
}
.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  transition: transform 0.3s, border-color 0.3s;
}
.contact-item:hover { transform: translateX(6px); border-color: rgba(34, 211, 238, 0.4); }
.contact-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  color: var(--cyan);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.14), rgba(168, 85, 247, 0.14));
  border: 1px solid rgba(34, 211, 238, 0.25);
}
.contact-item-label { font-size: 0.78rem; color: var(--muted); }
.contact-item-value { font-weight: 600; font-size: 0.98rem; }
.contact-note { color: var(--muted); font-size: 0.92rem; margin-top: 10px; }

.contact-form {
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 14px 18px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(5, 7, 13, 0.55);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  resize: vertical;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.14);
}
.contact-form ::placeholder { color: rgba(139, 149, 171, 0.6); }

/* ---------- 页脚 ---------- */
.footer {
  padding: 36px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  border-top: 1px solid var(--border);
}
.footer-heart {
  font-family: var(--font-mono);
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}

/* ---------- 项目详情弹窗 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.35s, visibility 0.35s;
}
.modal.open { visibility: visible; opacity: 1; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 9, 0.8);
  backdrop-filter: blur(10px);
}
.modal-panel {
  position: relative;
  width: min(760px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #0b1120;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7), 0 0 60px rgba(34, 211, 238, 0.08);
  transform: translateY(30px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.modal.open .modal-panel { transform: none; }
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  z-index: 2;
  width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(5, 7, 13, 0.7);
  color: var(--text);
  backdrop-filter: blur(6px);
  transition: all 0.25s;
}
.modal-close:hover { color: var(--pink); border-color: var(--pink); transform: rotate(90deg); }
.modal-media {
  position: relative;
  overflow: hidden;
  background: #060a12;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-media img {
  width: 100%;
  height: auto;
  max-height: 72vh;
  object-fit: contain;
  transition: opacity 0.28s ease;
}
.modal-media img.fading { opacity: 0; }

/* 图片画廊 */
.gallery-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 42px; height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(5, 7, 13, 0.65);
  color: var(--text);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.25s, color 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.modal-media:hover .gallery-btn { opacity: 1; }
.gallery-btn:hover {
  color: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.35);
}
.gallery-prev { left: 14px; }
.gallery-next { right: 14px; }
.gallery-counter {
  position: absolute;
  top: 14px; left: 14px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--cyan);
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, 0.35);
  background: rgba(5, 7, 13, 0.65);
  backdrop-filter: blur(6px);
}
.gallery-dots {
  position: absolute;
  bottom: 12px; left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(5, 7, 13, 0.5);
  backdrop-filter: blur(6px);
}
.gallery-dot {
  width: 8px; height: 8px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  transition: all 0.3s;
}
.gallery-dot.active {
  width: 22px;
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.7);
}
@media (hover: none) {
  .gallery-btn { opacity: 1; }
}
.modal-body { padding: 32px 36px 38px; }
.modal-body h3 { font-size: 1.55rem; }
.modal-sub {
  font-family: var(--font-mono);
  color: var(--cyan);
  font-size: 0.85rem;
  margin: 6px 0 16px;
}
.modal-desc { color: var(--muted); }
.modal-h4 {
  margin: 24px 0 12px;
  font-size: 1rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-h4::before {
  content: "";
  width: 18px; height: 2px;
  background: var(--grad);
  border-radius: 2px;
}
.modal-features { list-style: none; }
.modal-features li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.94rem;
}
.modal-features li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--cyan);
}
.modal-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.modal-links { display: flex; gap: 14px; margin-top: 28px; }
.modal-links .btn { padding: 11px 26px; font-size: 0.9rem; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 34px; left: 50%;
  transform: translate(-50%, 80px);
  z-index: 3000;
  padding: 14px 28px;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, 0.4);
  background: rgba(10, 15, 28, 0.92);
  backdrop-filter: blur(12px);
  color: var(--text);
  font-size: 0.92rem;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s;
  pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .about-grid,
  .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .skills-grid { grid-template-columns: 1fr 1fr; }
  .timeline::before { left: 12px; }
  .timeline-item,
  .timeline-item:nth-child(even) {
    width: 100%;
    margin-left: 0;
    padding-left: 44px;
    text-align: left;
  }
  .timeline-item:nth-child(odd) .timeline-dot,
  .timeline-item:nth-child(even) .timeline-dot { left: 6px; right: auto; }
}

@media (max-width: 680px) {
  .section { padding: 84px 0; }
  .nav-links {
    position: fixed;
    top: var(--nav-h); right: 0;
    flex-direction: column;
    width: min(300px, 78vw);
    padding: 24px;
    gap: 4px;
    background: rgba(5, 7, 13, 0.96);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-radius: 0 0 0 20px;
    transform: translateX(105%);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .nav-links.open { transform: none; }
  .nav-links a { padding: 12px 14px; font-size: 1rem; }
  .nav-cta { display: none; }
  .nav-toggle { display: flex; }
  .skills-grid,
  .projects-grid { grid-template-columns: 1fr; }
  .about-stats { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .contact-form { padding: 24px; }
  .hero-deco { display: none; }
  .modal-body { padding: 24px; }
}

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