:root {
  --bg: #070b16;
  --bg-soft: #0b1226;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-border: rgba(255, 255, 255, 0.09);
  --text: #e8ecf8;
  --text-dim: #93a0bf;
  --cyan: #00f0ff;
  --purple: #7b2ff7;
  --pink: #ff2fb3;
  --grad: linear-gradient(120deg, var(--cyan), var(--purple) 55%, var(--pink));
  --radius: 16px;
  --maxw: 1180px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

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

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- 背景 ---------- */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}

.bg-aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(600px 400px at 15% 10%, rgba(123, 47, 247, 0.22), transparent 65%),
    radial-gradient(650px 420px at 85% 20%, rgba(0, 240, 255, 0.16), transparent 65%),
    radial-gradient(700px 500px at 50% 95%, rgba(255, 47, 179, 0.12), transparent 65%);
  animation: aurora 16s ease-in-out infinite alternate;
}

@keyframes aurora {
  from { transform: translate3d(-1.5%, -1%, 0) scale(1); }
  to { transform: translate3d(1.5%, 1%, 0) scale(1.08); }
}

/* ---------- 导航 ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 11, 22, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
}

.nav.is-scrolled { border-bottom-color: var(--panel-border); }

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--cyan);
}

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

.nav-links a {
  color: var(--text-dim);
  font-size: 14px;
  transition: color 0.25s;
}

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

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 120px 0 90px;
  text-align: center;
  overflow: hidden;
}

.hero-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  box-shadow: 0 0 22px var(--cyan);
  animation: scan 5s linear infinite;
  opacity: 0.6;
}

@keyframes scan {
  0% { top: 0; }
  50% { top: 100%; }
  100% { top: 0; }
}

.hero-eyebrow {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  color: var(--cyan);
  opacity: 0.8;
  letter-spacing: 2px;
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(40px, 7vw, 76px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
}

.hero-sub {
  margin: 26px auto 0;
  max-width: 620px;
  color: var(--text-dim);
  font-size: 16px;
}

.hero-cta {
  margin-top: 40px;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

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

.btn-primary {
  background: var(--grad);
  color: #05070d;
  box-shadow: 0 6px 26px rgba(123, 47, 247, 0.4);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 34px rgba(0, 240, 255, 0.4); }

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

.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); transform: translateY(-2px); }

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

.stat { text-align: center; }

.stat b {
  display: block;
  font-size: 34px;
  font-weight: 800;
  font-family: "SFMono-Regular", Consolas, monospace;
  color: var(--cyan);
  text-shadow: 0 0 18px rgba(0, 240, 255, 0.5);
}

.stat span { font-size: 13px; color: var(--text-dim); }

/* ---------- 通用 section ---------- */
.section-eyebrow {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  color: var(--pink);
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.section-title {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
  letter-spacing: -0.5px;
}

/* ---------- 作品墙 ---------- */
.works { padding: 90px 24px; }

.section-head { margin-bottom: 34px; }

.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.chip {
  padding: 8px 20px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.25s;
}

.chip:hover { color: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 18px rgba(0, 240, 255, 0.18); }

.chip.is-active {
  background: var(--grad);
  border-color: transparent;
  color: #05070d;
  font-weight: 600;
  box-shadow: 0 0 22px rgba(123, 47, 247, 0.4);
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 26px;
}

.work-card {
  --lift: 26px;
  --rx: 0deg;
  --ry: 0deg;
  --d: 0ms;
  position: relative;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
  cursor: pointer;
  opacity: 0;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(var(--lift));
  transition: transform 0.45s var(--d), border-color 0.35s, box-shadow 0.35s, opacity 0.5s var(--d);
  will-change: transform;
}

.work-card.is-visible { opacity: 1; --lift: 0px; }

.work-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 4;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--pink), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s;
}

.work-card:hover {
  --lift: -8px;
  transition-delay: 0s;
  border-color: rgba(0, 240, 255, 0.5);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45), 0 0 34px rgba(0, 240, 255, 0.16);
}

.work-card:hover::before { transform: scaleX(1); }

.card-glare {
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: var(--radius);
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(220px circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.1), transparent 70%);
  transition: opacity 0.3s;
}

.work-card:hover .card-glare { opacity: 1; }

.work-media {
  position: relative;
  height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: filter 0.4s;
}

.work-media::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 26px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 26px);
  mix-blend-mode: overlay;
  pointer-events: none;
}

.work-media::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -30%;
  height: 30%;
  background: linear-gradient(180deg, transparent, rgba(0, 240, 255, 0.18), transparent);
  pointer-events: none;
  opacity: 0;
}

.work-card:hover .work-media::after { animation: media-scan 0.9s ease-out; }

@keyframes media-scan {
  from { transform: translateY(0); opacity: 0; }
  12% { opacity: 1; }
  to { transform: translateY(400%); opacity: 0; }
}

.work-card:hover .work-media { filter: brightness(1.3); }

.work-media svg {
  position: relative;
  z-index: 1;
  width: 88px;
  height: 88px;
  filter: drop-shadow(0 0 16px rgba(0, 240, 255, 0.35));
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.4s;
}

.work-card:hover .work-media svg {
  transform: scale(1.12) rotate(-4deg);
  filter: drop-shadow(0 0 26px rgba(0, 240, 255, 0.55));
}

.work-badge {
  position: absolute;
  top: 14px;
  right: 16px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 2px 12px;
  backdrop-filter: blur(4px);
}

.media-tech    { background: radial-gradient(140% 140% at 20% 0%, rgba(0, 240, 255, 0.28), rgba(7, 11, 22, 0.4)); }
.media-print   { background: radial-gradient(140% 140% at 80% 0%, rgba(123, 47, 247, 0.32), rgba(7, 11, 22, 0.4)); }
.media-wood    { background: radial-gradient(140% 140% at 50% 100%, rgba(255, 168, 68, 0.22), rgba(7, 11, 22, 0.4)); }
.media-smart   { background: radial-gradient(140% 140% at 30% 80%, rgba(0, 240, 255, 0.24), rgba(123, 47, 247, 0.16)); }
.media-tech2   { background: radial-gradient(140% 140% at 70% 30%, rgba(255, 47, 179, 0.24), rgba(7, 11, 22, 0.4)); }
.media-print2  { background: radial-gradient(140% 140% at 20% 70%, rgba(123, 47, 247, 0.28), rgba(0, 240, 255, 0.12)); }

.work-body { padding: 20px 22px 24px; }

.work-tags { display: flex; gap: 8px; margin-bottom: 10px; }

.work-tags span {
  font-size: 12px;
  color: var(--cyan);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 6px;
  padding: 1px 10px;
  font-family: "SFMono-Regular", Consolas, monospace;
}

.work-body h3 { font-size: 19px; margin-bottom: 6px; }

.work-body p { font-size: 14px; color: var(--text-dim); }

/* 筛选过渡 */
.work-card.is-leaving {
  opacity: 0;
  --rx: 0deg;
  --ry: 0deg;
  --lift: 20px;
  transform: perspective(900px) scale(0.92) translateY(var(--lift));
  transition: transform 0.4s, opacity 0.4s, border-color 0.35s, box-shadow 0.35s;
}

.work-card.is-hidden { display: none; }

/* ---------- About ---------- */
.about { padding: 40px 24px 90px; }

.about-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  align-items: center;
  padding: 44px;
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  background: var(--panel);
}

.about-avatar {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #05070d;
  background: var(--grad);
  box-shadow: 0 0 44px rgba(123, 47, 247, 0.5);
  justify-self: center;
}

.about-text p { color: var(--text-dim); margin-top: 14px; font-size: 15px; }

.about-skills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

.about-skills span {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: var(--bg-soft);
  font-size: 13px;
  color: var(--text);
}

/* ---------- Footer ---------- */
.footer {
  padding: 40px 24px 34px;
  border-top: 1px solid var(--panel-border);
  margin-top: 20px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 30px;
  flex-wrap: wrap;
}

.footer-left p:first-child { font-weight: 700; color: var(--cyan); letter-spacing: 1px; }

.footer-left p:last-child { color: var(--text-dim); font-size: 14px; margin-top: 4px; }

.footer-links { display: flex; flex-direction: column; gap: 10px; }

.footer-links a { color: var(--text-dim); font-size: 14px; transition: color 0.25s; }

.footer-links a:hover { color: var(--pink); }

.footer-copy {
  margin-top: 30px;
  text-align: center;
  font-size: 13px;
  color: rgba(147, 160, 191, 0.6);
}

/* ---------- 响应式 ---------- */
@media (max-width: 820px) {
  .hero { padding: 90px 0 60px; }
  .hero-stats { gap: 40px; }
  .work-grid { grid-template-columns: 1fr; }
  .about-card { grid-template-columns: 1fr; padding: 30px; }
  .about-avatar { width: 140px; height: 140px; font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .bg-aurora, .hero-scan { animation: none; }
  .work-card { transition: none; }
  .work-card:hover { --lift: 0px; }
  .work-card:hover .work-media::after { animation: none; }
  html { scroll-behavior: auto; }
}
