:root {
  --bg: #05050a;
  --bg-2: #0a0a16;
  --neon-cyan: #00f0ff;
  --neon-purple: #b829ff;
  --neon-pink: #ff0055;
  --text: #e8e8f0;
  --text-dim: #8a8aa3;
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Hiragino Sans GB", sans-serif;
  --font-mono: "SF Mono", "Fira Code", "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);
  overflow-x: hidden;
  line-height: 1.6;
}

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

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

/* 背景画布 */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  opacity: 0.35;
  pointer-events: none;
}

/* 扫描线 */
.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 240, 255, 0.03) 0px,
    rgba(0, 240, 255, 0.03) 1px,
    transparent 1px,
    transparent 4px
  );
  animation: scanMove 8s linear infinite;
}

@keyframes scanMove {
  0% { background-position: 0 0; }
  100% { background-position: 0 100px; }
}

/* 导航 */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1rem 4vw;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  background: rgba(5, 5, 10, 0.7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 240, 255, 0.15);
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--neon-cyan);
  text-shadow: 0 0 10px var(--neon-cyan), 0 0 20px var(--neon-cyan);
}

.main-nav {
  display: flex;
  gap: 2rem;
}

.main-nav a {
  position: relative;
  font-size: 0.9rem;
  color: var(--text-dim);
  transition: color 0.3s;
}

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

.main-nav a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
  transition: width 0.3s;
}

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

.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--neon-cyan);
  font-size: 1.8rem;
  cursor: pointer;
}

/* Glitch 效果 */
.glitch {
  position: relative;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.8;
}

.glitch::before {
  color: var(--neon-pink);
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
  transform: translate(-2px, -2px);
  animation: glitchTop 2s infinite linear alternate-reverse;
}

.glitch::after {
  color: var(--neon-cyan);
  clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
  transform: translate(2px, 2px);
  animation: glitchBottom 2s infinite linear alternate-reverse;
}

@keyframes glitchTop {
  0% { transform: translate(-2px, -2px); }
  20% { transform: translate(2px, 1px); }
  40% { transform: translate(-1px, 2px); }
  60% { transform: translate(3px, -1px); }
  80% { transform: translate(-2px, 0px); }
  100% { transform: translate(2px, -2px); }
}

@keyframes glitchBottom {
  0% { transform: translate(2px, 2px); }
  20% { transform: translate(-2px, -1px); }
  40% { transform: translate(1px, -2px); }
  60% { transform: translate(-3px, 1px); }
  80% { transform: translate(2px, 0px); }
  100% { transform: translate(-2px, 2px); }
}

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 8rem 4vw 4rem;
  position: relative;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  z-index: 2;
}

.portrait-wrap {
  position: relative;
  width: 180px;
  height: 180px;
  margin-bottom: 1rem;
}

.portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid rgba(0, 240, 255, 0.4);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.3), inset 0 0 30px rgba(0, 240, 255, 0.1);
  position: relative;
  z-index: 2;
}

.portrait-ring {
  position: absolute;
  top: -10px;
  left: -10px;
  width: calc(100% + 20px);
  height: calc(100% + 20px);
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--neon-cyan);
  border-right-color: var(--neon-purple);
  animation: ringSpin 4s linear infinite;
  z-index: 1;
}

.portrait-ring::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 6px;
  right: 6px;
  bottom: 6px;
  border-radius: 50%;
  border: 1px solid transparent;
  border-bottom-color: var(--neon-pink);
  border-left-color: var(--neon-cyan);
  animation: ringSpin 6s linear infinite reverse;
}

@keyframes ringSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.hero-name {
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 900;
  letter-spacing: 0.15em;
  color: var(--text);
  text-shadow: 0 0 20px rgba(0, 240, 255, 0.5), 0 0 40px rgba(184, 41, 255, 0.3);
}

.hero-title {
  font-size: clamp(1rem, 3vw, 1.5rem);
  color: var(--neon-purple);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.hero-slogan {
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  max-width: 700px;
  color: var(--text-dim);
}

.neon-text {
  color: var(--neon-cyan);
  text-shadow: 0 0 10px var(--neon-cyan), 0 0 20px var(--neon-cyan);
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  border-radius: 4px;
  transition: all 0.3s;
  cursor: pointer;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  color: var(--bg);
  border: none;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.6);
}

.btn-secondary {
  background: transparent;
  color: var(--neon-cyan);
  border: 1px solid var(--neon-cyan);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.1);
}

.btn-secondary:hover {
  background: rgba(0, 240, 255, 0.1);
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.3);
}

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-dim);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  font-family: var(--font-mono);
}

.scroll-line {
  width: 1px;
  height: 60px;
  background: linear-gradient(180deg, var(--neon-cyan), transparent);
  animation: scrollPulse 2s infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.5); transform-origin: top; }
  50% { opacity: 1; transform: scaleY(1); transform-origin: top; }
}

/* 通用 section */
.section {
  padding: 7rem 4vw;
  position: relative;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  margin-bottom: 3rem;
  text-align: center;
}

.section-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  color: var(--neon-pink);
  margin-bottom: 0.5rem;
  padding: 0.25rem 0.75rem;
  border: 1px solid rgba(255, 0, 85, 0.3);
  background: rgba(255, 0, 85, 0.05);
}

.section-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 关于 */
.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.about-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 8px;
  padding: 2rem;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.about-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
  transition: left 0.5s;
}

.about-card:hover::before {
  left: 100%;
}

.about-card:hover {
  border-color: rgba(0, 240, 255, 0.4);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.1);
  transform: translateY(-5px);
}

.about-card h3 {
  font-size: 1.25rem;
  color: var(--neon-cyan);
  margin-bottom: 1rem;
}

.about-card p {
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.8;
}

/* 技能 */
.skills {
  background: linear-gradient(180deg, var(--bg), var(--bg-2), var(--bg));
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.skill-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(184, 41, 255, 0.1);
  border-radius: 8px;
  padding: 1.5rem;
}

.skill-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.75rem;
  position: relative;
}

.skill-fill {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple), var(--neon-pink));
  border-radius: 4px;
  box-shadow: 0 0 10px var(--neon-purple);
  transition: width 1.5s ease-out;
}

.skill-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.skill-info strong {
  color: var(--text);
  font-weight: 600;
}

.skill-info span {
  color: var(--neon-cyan);
  font-family: var(--font-mono);
  font-weight: 700;
}

/* 经历 */
.works-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.work-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 0, 85, 0.1);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s;
}

.work-card:hover {
  transform: translateY(-8px);
  border-color: rgba(255, 0, 85, 0.4);
  box-shadow: 0 0 30px rgba(255, 0, 85, 0.15);
}

.work-thumb {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.work-thumb.placeholder {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.1), rgba(184, 41, 255, 0.1));
  border-bottom: 1px solid rgba(255, 0, 85, 0.1);
}

.work-thumb.placeholder span {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  letter-spacing: 0.15em;
  color: var(--neon-cyan);
  text-shadow: 0 0 10px var(--neon-cyan);
}

.work-body {
  padding: 1.25rem;
}

.work-body h3 {
  color: var(--text);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.work-body p {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* 联系 */
.contact {
  text-align: center;
}

.contact-card {
  max-width: 700px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 12px;
  padding: 3rem;
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.08);
}

.contact-lead {
  font-size: 1.1rem;
  color: var(--text-dim);
  margin-bottom: 2rem;
  line-height: 1.8;
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  transition: all 0.3s;
}

.contact-item:hover {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.15);
  transform: translateX(5px);
}

.contact-label {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--neon-purple);
}

.contact-value {
  font-size: 1.05rem;
  color: var(--text);
  font-weight: 500;
}

/* Footer */
.site-footer {
  padding: 2rem 4vw;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  font-size: 0.85rem;
}

.footer-tag {
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  letter-spacing: 0.3em;
  color: var(--neon-cyan);
  text-shadow: 0 0 10px var(--neon-cyan);
}

/* 移动端 */
@media (max-width: 992px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
  .skills-grid {
    grid-template-columns: 1fr;
  }
  .works-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .site-header {
    padding: 0.75rem 4vw;
  }

  .main-nav {
    position: fixed;
    top: 60px;
    right: -100%;
    width: 70%;
    max-width: 280px;
    height: calc(100vh - 60px);
    flex-direction: column;
    gap: 0;
    background: rgba(5, 5, 10, 0.97);
    border-left: 1px solid rgba(0, 240, 255, 0.2);
    padding: 1rem 0;
    transition: right 0.3s;
    z-index: 99;
  }

  .main-nav.open {
    right: 0;
  }

  .main-nav a {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .menu-toggle {
    display: block;
  }

  .hero {
    padding: 7rem 4vw 3rem;
  }

  .portrait-wrap {
    width: 140px;
    height: 140px;
  }

  .works-grid {
    grid-template-columns: 1fr;
  }

  .contact-card {
    padding: 2rem 1.25rem;
  }

  .contact-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
}

@media (max-width: 480px) {
  .hero-cta {
    flex-direction: column;
    width: 100%;
  }

  .btn {
    width: 100%;
  }
}
