:root {
  --bg: #0a0c14;
  --bg-soft: #10131f;
  --card: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8eaf2;
  --muted: #9aa0b4;
  --primary: #6366f1;
  --primary-2: #8b5cf6;
  --accent: #22d3ee;
  --radius: 16px;
  --max-width: 1100px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
}

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

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

img {
  max-width: 100%;
  display: block;
}

/* ---------- 背景光斑与噪点 ---------- */
.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  animation: drift 18s ease-in-out infinite alternate;
}

.orb-1 {
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.35), transparent 70%);
  top: -140px;
  left: -120px;
}

.orb-2 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.25), transparent 70%);
  top: 30%;
  right: -160px;
  animation-delay: -6s;
}

.orb-3 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.28), transparent 70%);
  bottom: -200px;
  left: 20%;
  animation-delay: -12s;
}

@keyframes drift {
  to {
    transform: translate(60px, -40px) scale(1.1);
  }
}

.noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.03;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 导航栏 ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(10, 12, 20, 0.6);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}

.nav.scrolled {
  border-bottom-color: var(--border);
  background: rgba(10, 12, 20, 0.85);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.logo-dot {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  transition: color 0.2s;
  position: relative;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.3s;
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-cta {
  padding: 9px 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(34, 211, 238, 0.1));
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.nav-cta:hover {
  transform: translateY(-1px);
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 4px 24px rgba(99, 102, 241, 0.25);
}

.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav-burger span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-burger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-burger.open span:nth-child(2) {
  opacity: 0;
}

.nav-burger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 120px 24px 80px;
}

.hero-inner {
  text-align: center;
  max-width: 760px;
}

.hero-greeting {
  color: var(--accent);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 2px;
  margin-bottom: 12px;
  font-family: var(--mono);
}

.hero-name {
  font-size: clamp(56px, 10vw, 108px);
  font-weight: 800;
  letter-spacing: -3px;
  line-height: 1.05;
  background: linear-gradient(120deg, #fff 20%, #a5b4fc 50%, #22d3ee 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 6s ease infinite;
  background-size: 200% auto;
}

@keyframes gradient-shift {
  0%, 100% {
    background-position: 0% center;
  }
  50% {
    background-position: 100% center;
  }
}

.hero-title {
  margin: 18px 0 20px;
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 600;
  color: var(--text);
  min-height: 1.5em;
}

.cursor {
  display: inline-block;
  margin-left: 2px;
  color: var(--accent);
  animation: blink 0.9s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.hero-desc {
  color: var(--muted);
  font-size: clamp(16px, 2vw, 19px);
  max-width: 560px;
  margin: 0 auto 36px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 13px 32px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(99, 102, 241, 0.5);
}

.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--card);
}

.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 56px;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat strong {
  font-size: 30px;
  font-weight: 800;
  background: linear-gradient(120deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat span {
  color: var(--muted);
  font-size: 14px;
  margin-top: 2px;
}

.scroll-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
}

.mouse {
  width: 24px;
  height: 38px;
  border: 2px solid var(--muted);
  border-radius: 14px;
  display: flex;
  justify-content: center;
  padding-top: 7px;
}

.wheel {
  width: 3px;
  height: 8px;
  border-radius: 3px;
  background: var(--accent);
  animation: scroll-wheel 1.8s ease infinite;
}

@keyframes scroll-wheel {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  70% {
    transform: translateY(10px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 0;
  }
}

/* ---------- 通用区块 ---------- */
.section {
  padding: 110px 24px;
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-tag {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.section-title {
  font-size: clamp(28px, 4.5vw, 44px);
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 56px;
  line-height: 1.2;
}

/* ---------- 关于 ---------- */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.about-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 34px 30px;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.about-card:hover {
  transform: translateY(-6px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.about-avatar {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
}

.about-card:nth-child(2) .about-avatar {
  background: linear-gradient(135deg, var(--accent), #0ea5e9);
}

.about-card:nth-child(3) .about-avatar {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.about-card h3 {
  font-size: 20px;
  margin-bottom: 10px;
}

.about-card p {
  color: var(--muted);
  font-size: 15px;
}

/* ---------- 技能 ---------- */
.skill-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
}

.skill-group h3 {
  font-size: 18px;
  margin-bottom: 22px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.skill-group h3::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

.skill-bar {
  margin-bottom: 18px;
}

.bar-label {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 8px;
}

.bar-fill {
  display: block;
  height: 6px;
  width: 0;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  position: relative;
  transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.bar-fill::after {
  content: "";
  position: absolute;
  right: 0;
  top: -3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

/* ---------- 项目 ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.project-cover {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  color: rgba(255, 255, 255, 0.85);
  background: radial-gradient(circle at 30% 30%, var(--c1), var(--c2));
  position: relative;
}

.project-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(10, 12, 20, 0.35));
}

.project-body {
  padding: 26px;
}

.project-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
  font-family: var(--mono);
}

.project-body h3 {
  font-size: 20px;
  margin-bottom: 10px;
}

.project-body p {
  color: var(--muted);
  font-size: 14.5px;
  margin-bottom: 18px;
  min-height: 66px;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-tech span {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
  font-family: var(--mono);
}

/* ---------- 联系 ---------- */
.contact {
  text-align: center;
  position: relative;
  overflow: hidden;
}

.contact .section-title {
  margin-bottom: 16px;
}

.contact-sub {
  color: var(--muted);
  font-size: 17px;
  margin-bottom: 40px;
}

.contact-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.socials {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
}

.socials a {
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--muted);
  transition: all 0.25s;
}

.socials a:hover {
  color: var(--text);
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(99, 102, 241, 0.1);
  transform: translateY(-2px);
}

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- 滚动出现动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .nav-links,
  .nav-cta {
    display: none;
  }

  .nav-burger {
    display: flex;
  }

  .nav-menu-open {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: rgba(10, 12, 20, 0.96);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 24px;
    backdrop-filter: blur(20px);
  }

  .nav-menu-open a {
    padding: 12px 8px;
    font-size: 16px;
    color: var(--text);
    border-radius: 10px;
  }

  .nav-menu-open a:hover {
    background: rgba(255, 255, 255, 0.06);
  }

  .hero-stats {
    gap: 32px;
  }

  .stat strong {
    font-size: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
