/* ===== 基础变量 ===== */
:root {
  --bg: #0a0b10;
  --bg-soft: #11121b;
  --card: rgba(255, 255, 255, 0.035);
  --card-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #ecedf3;
  --text-dim: #a2a3b8;
  --text-mute: #6c6d82;
  --accent: #a855f7;
  --grad-1: #a855f7;
  --grad-2: #06b6d4;
  --maxw: 1180px;
  --radius: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

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

/* ===== 背景光斑 ===== */
.bg-orbs {
  position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
}
.orb {
  position: absolute; border-radius: 50%; filter: blur(110px); opacity: 0.4;
}
.orb-1 {
  width: 520px; height: 520px; background: #6d28d9;
  top: -120px; left: -100px; animation: drift1 22s ease-in-out infinite;
}
.orb-2 {
  width: 460px; height: 460px; background: #0891b2;
  top: 30%; right: -120px; animation: drift2 26s ease-in-out infinite;
}
.orb-3 {
  width: 420px; height: 420px; background: #be123c;
  bottom: -120px; left: 30%; animation: drift3 30s ease-in-out infinite;
}
@keyframes drift1 { 50% { transform: translate(120px, 80px) scale(1.15); } }
@keyframes drift2 { 50% { transform: translate(-100px, 120px) scale(0.9); } }
@keyframes drift3 { 50% { transform: translate(80px, -90px) scale(1.1); } }

/* ===== 背景粒子星座 canvas ===== */
#bgCanvas {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  width: 100%; height: 100%;
}

/* ===== 鼠标聚光灯 ===== */
.cursor-glow {
  position: fixed; top: 0; left: 0; width: 480px; height: 480px;
  border-radius: 50%; pointer-events: none; z-index: 2;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.16) 0%, rgba(6, 182, 212, 0.08) 35%, transparent 65%);
  transform: translate(-50%, -50%);
  mix-blend-mode: screen;
  transition: opacity 0.4s;
  opacity: 0;
}
.cursor-glow.active { opacity: 1; }

/* ===== 布局容器 ===== */
main { position: relative; z-index: 1; }
section { max-width: var(--maxw); margin: 0 auto; padding: 100px 24px; }

/* ===== 顶部导航 ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 32px;
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  background: rgba(10, 11, 16, 0.55);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, padding 0.3s, background 0.3s;
}
.nav.scrolled { border-bottom-color: var(--border); background: rgba(10, 11, 16, 0.8); padding: 14px 32px; }
.nav-brand { display: flex; align-items: center; gap: 10px; font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 1.05rem; }
.nav-mark { color: var(--accent); font-size: 1.3rem; animation: spin 8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.nav-links { display: flex; gap: 32px; }
.nav-links a {
  color: var(--text-dim); font-size: 0.92rem; font-weight: 500; position: relative; transition: color 0.25s;
}
.nav-links a::after {
  content: ''; position: absolute; left: 0; bottom: -6px; width: 0; height: 2px;
  background: var(--accent); transition: width 0.3s var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after { width: 100%; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: 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 {
  min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
  padding-top: 120px; padding-bottom: 60px; position: relative;
}
.hero-inner { max-width: 760px; }
.hero-eyebrow {
  font-family: 'Space Grotesk', sans-serif; font-size: 0.8rem; letter-spacing: 0.3em;
  color: var(--accent); margin-bottom: 24px; font-weight: 500;
}
.hero-title {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: clamp(2.3rem, 6vw, 4.2rem); line-height: 1.15; letter-spacing: -0.02em;
  margin-bottom: 28px;
}
.grad-text {
  background: linear-gradient(120deg, var(--grad-1), var(--grad-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub { color: var(--text-dim); font-size: 1.1rem; margin-bottom: 40px; max-width: 600px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 64px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 14px 28px; border-radius: 999px;
  font-size: 0.95rem; font-weight: 500; transition: all 0.3s var(--ease); cursor: pointer; border: none;
}
.btn-primary {
  background: linear-gradient(120deg, var(--grad-1), var(--grad-2)); color: #fff;
  box-shadow: 0 8px 30px rgba(168, 85, 247, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(168, 85, 247, 0.5); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border-strong); }
.btn-ghost:hover { background: var(--card-hover); border-color: var(--text-dim); }
.arrow { transition: transform 0.3s; }
.btn-primary:hover .arrow { transform: translateY(3px); }

.hero-stats { display: flex; gap: 48px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat-num { font-family: 'Space Grotesk', sans-serif; font-size: 2rem; font-weight: 700; color: var(--text); }
.stat-label { font-size: 0.82rem; color: var(--text-mute); letter-spacing: 0.05em; }

.scroll-hint {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 0.7rem; letter-spacing: 0.3em; color: var(--text-mute); text-transform: uppercase;
}
.scroll-hint span {
  width: 1px; height: 40px; background: linear-gradient(var(--accent), transparent);
  animation: scrolldown 2s ease-in-out infinite;
}
@keyframes scrolldown { 0%, 100% { transform: scaleY(0.4); transform-origin: top; } 50% { transform: scaleY(1); } }

/* ===== Section 通用 ===== */
.section-head { margin-bottom: 56px; }
.section-tag {
  display: inline-block; font-family: 'Space Grotesk', sans-serif; font-size: 0.78rem;
  letter-spacing: 0.2em; color: var(--accent); margin-bottom: 16px; font-weight: 500;
}
.section-title {
  font-family: 'Space Grotesk', sans-serif; font-weight: 600;
  font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.2; letter-spacing: -0.01em; max-width: 720px;
}

/* ===== About ===== */
.about-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; max-width: 1000px; }
.about-col { display: flex; flex-direction: column; gap: 20px; }
.about-text { color: var(--text-dim); font-size: 1.05rem; line-height: 1.9; }
.hl { color: var(--text); font-weight: 500; }

.about-quote {
  position: relative; padding: 26px 28px 26px 36px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(6, 182, 212, 0.06));
  border: 1px solid rgba(168, 85, 247, 0.2);
}
.about-quote p { font-family: 'Space Grotesk', sans-serif; font-size: 1.02rem; line-height: 1.65; color: var(--text); font-weight: 500; }
.quote-mark {
  position: absolute; top: -8px; left: 14px; font-family: 'Space Grotesk', sans-serif;
  font-size: 3.4rem; line-height: 1; color: var(--accent); opacity: 0.5;
}

.about-highlights { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.hl-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; background: var(--card); border: 1px solid var(--border); transition: all 0.3s var(--ease); }
.hl-item:hover { transform: translateX(4px); border-color: var(--border-strong); background: var(--card-hover); }
.hl-emoji { font-size: 1.3rem; flex-shrink: 0; }
.hl-item div { font-size: 0.92rem; color: var(--text-dim); }
.hl-item strong { color: var(--text); font-weight: 600; }

/* ===== Projects ===== */
.projects { padding-bottom: 80px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 40px; }
.chip {
  padding: 8px 18px; border-radius: 999px; font-size: 0.85rem; font-weight: 500;
  background: var(--card); color: var(--text-dim); border: 1px solid var(--border);
  cursor: pointer; transition: all 0.25s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }

.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card {
  position: relative; padding: 30px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--border);
  overflow: hidden; transition: transform 0.4s var(--ease), border-color 0.4s, box-shadow 0.4s;
  display: flex; flex-direction: column; min-height: 320px;
}
.card-glow {
  position: absolute; top: -40%; right: -30%; width: 200px; height: 200px; border-radius: 50%;
  background: var(--c); filter: blur(60px); opacity: 0.12; transition: opacity 0.4s; pointer-events: none;
}
.card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 20px 50px -20px rgba(168, 85, 247, 0.45);
}
.card:hover { /* 渐进增强：支持 color-mix 的浏览器用卡片主题色 */
  border-color: color-mix(in srgb, var(--c) 45%, transparent);
  box-shadow: 0 20px 50px -20px color-mix(in srgb, var(--c) 60%, transparent);
}
.card:hover .card-glow { opacity: 0.28; }
.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.card-icon { font-size: 1.7rem; filter: drop-shadow(0 0 12px rgba(168, 85, 247, 0.4)); }
.card-icon { filter: drop-shadow(0 0 12px color-mix(in srgb, var(--c) 50%, transparent)); }
.card-type {
  font-family: 'Space Grotesk', sans-serif; font-size: 0.7rem; letter-spacing: 0.08em;
  color: var(--c); padding: 5px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.18);
  background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
}
.card-title { font-family: 'Space Grotesk', sans-serif; font-size: 1.32rem; font-weight: 600; margin-bottom: 12px; line-height: 1.3; }
.card-desc { color: var(--text-dim); font-size: 0.94rem; line-height: 1.7; flex: 1; margin-bottom: 20px; }
.card-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; }
.card-tags span {
  font-size: 0.72rem; padding: 4px 10px; border-radius: 6px; color: var(--text-mute);
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border);
}
.card-folder {
  font-family: 'Space Grotesk', sans-serif; font-size: 0.75rem; color: var(--text-mute);
  border-top: 1px dashed var(--border); padding-top: 14px; letter-spacing: 0.02em;
}
.card.hide { display: none; }

/* ===== Focus ===== */
.focus-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.focus-item {
  padding: 28px 24px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--border);
  transition: all 0.35s var(--ease);
}
.focus-item:hover { transform: translateY(-4px); border-color: var(--border-strong); background: var(--card-hover); }
.focus-emoji { font-size: 1.8rem; display: block; margin-bottom: 16px; }
.focus-item h3 { font-family: 'Space Grotesk', sans-serif; font-size: 1.08rem; font-weight: 600; margin-bottom: 10px; }
.focus-item p { color: var(--text-dim); font-size: 0.9rem; line-height: 1.65; }

/* ===== Contact ===== */
.contact {
  text-align: center; padding: 120px 24px; position: relative;
}
.contact-inner { max-width: 680px; margin: 0 auto; }
.contact-eyebrow { font-family: 'Space Grotesk', sans-serif; font-size: 0.78rem; letter-spacing: 0.2em; color: var(--accent); margin-bottom: 18px; }
.contact-title {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.2; letter-spacing: -0.01em; margin-bottom: 36px;
}
.contact-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 24px; }
.contact-note { color: var(--text-mute); font-size: 0.82rem; }

/* ===== Footer ===== */
.footer { position: relative; z-index: 1; border-top: 1px solid var(--border); padding: 32px 24px; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-brand { font-family: 'Space Grotesk', sans-serif; font-weight: 600; color: var(--text); }
.footer-text { color: var(--text-mute); font-size: 0.85rem; }
.footer-top { color: var(--text-dim); font-size: 0.85rem; transition: color 0.25s; }
.footer-top:hover { color: var(--text); }

/* ===== 滚动渐入 ===== */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ===== 响应式 ===== */
@media (max-width: 980px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .focus-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 720px) {
  section { padding: 70px 20px; }
  .nav { padding: 14px 20px; }
  .nav.scrolled { padding: 12px 20px; }
  .nav-links {
    position: fixed; top: 56px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: rgba(10, 11, 16, 0.97); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border);
    padding: 0; max-height: 0; overflow: hidden; transition: max-height 0.35s var(--ease);
  }
  .nav-links.open { max-height: 320px; padding: 8px 0; }
  .nav-links a { padding: 16px 24px; border-bottom: 1px solid var(--border); }
  .nav-links a::after { display: none; }
  .nav-toggle { display: flex; }
  .card-grid { grid-template-columns: 1fr; }
  .focus-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 28px; }
  .stat-num { font-size: 1.6rem; }
  .footer-inner { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
