/* 基础重置和变量定义 */
:root {
  --primary-color: #ff2a6d;
  --secondary-color: #05d9e8;
  --accent-color: #d1f7ff;
  --dark-color: #000;
  --light-color: #fff;
  --gradient-start: #ff2a6d;
  --gradient-end: #05d9e8;
  --transition: all 0.4s ease;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--dark-color);
  color: var(--light-color);
  overflow-x: hidden;
  line-height: 1.6;
}

/* 粒子背景容器 */
#particles-js {
  position: fixed;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
  z-index: -1;
}

/* 容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 导航栏 */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  position: fixed;
  top: 0;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  z-index: 1000;
  transition: var(--transition);
}

.navbar.scrolled {
  padding: 15px 0;
  backdrop-filter: blur(10px);
  background: rgba(0, 0, 0, 0.7);
}

.nav-brand h2 {
  font-size: 1.8rem;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 10px rgba(255, 42, 109, 0.3);
}

.nav-menu {
  display: flex;
  list-style: none;
}

.nav-menu li {
  margin-left: 30px;
}

.nav-menu a {
  color: var(--light-color);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  padding: 5px 0;
  transition: var(--transition);
}

.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--secondary-color);
  transition: var(--transition);
}

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

.nav-menu a:hover {
  color: var(--secondary-color);
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.bar {
  width: 25px;
  height: 3px;
  background-color: var(--light-color);
  margin: 3px 0;
  transition: var(--transition);
}

/* 主页部分 */
.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
}

.hero-content h1 {
  font-size: 5rem;
  margin-bottom: 20px;
  position: relative;
  text-transform: uppercase;
  letter-spacing: 3px;
}

/* 故障效果 */
.glitch {
  position: relative;
  color: var(--light-color);
  text-shadow: 0.05em 0 0 var(--primary-color), -0.05em -0.025em 0 var(--secondary-color);
  animation: glitch 500ms infinite;
}

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

.glitch::before {
  left: 2px;
  text-shadow: -2px 0 var(--primary-color);
  clip: rect(44px, 450px, 56px, 0);
  animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
  left: -2px;
  text-shadow: -2px 0 var(--secondary-color);
  clip: rect(44px, 450px, 56px, 0);
  animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch {
  0% {
    text-shadow: 0.05em 0 0 var(--primary-color), -0.05em -0.025em 0 var(--secondary-color);
  }
  14% {
    text-shadow: 0.05em 0 0 var(--primary-color), -0.05em -0.025em 0 var(--secondary-color);
  }
  15% {
    text-shadow: -0.05em -0.025em 0 var(--primary-color), 0.025em 0.025em var(--secondary-color);
  }
  49% {
    text-shadow: -0.05em -0.025em 0 var(--primary-color), 0.025em 0.025em var(--secondary-color);
  }
  50% {
    text-shadow: 0.025em 0.025em 0 var(--primary-color), 0.05em -0.05em 0 var(--secondary-color);
  }
  99% {
    text-shadow: 0.025em 0.025em 0 var(--primary-color), 0.05em -0.05em 0 var(--secondary-color);
  }
  100% {
    text-shadow: 0.025em 0.025em 0 var(--primary-color), 0.05em -0.05em 0 var(--secondary-color);
  }
}

@keyframes glitch-anim {
  0% {
    clip: rect(32px, 9999px, 28px, 0);
  }
  5% {
    clip: rect(13px, 9999px, 37px, 0);
  }
  10% {
    clip: rect(40px, 9999px, 37px, 0);
  }
  15% {
    clip: rect(22px, 9999px, 94px, 0);
  }
  20% {
    clip: rect(94px, 9999px, 80px, 0);
  }
  25% {
    clip: rect(23px, 9999px, 56px, 0);
  }
  30% {
    clip: rect(97px, 9999px, 87px, 0);
  }
  35% {
    clip: rect(64px, 9999px, 55px, 0);
  }
  40% {
    clip: rect(32px, 9999px, 84px, 0);
  }
  45% {
    clip: rect(23px, 9999px, 41px, 0);
  }
  50% {
    clip: rect(82px, 9999px, 42px, 0);
  }
  55% {
    clip: rect(94px, 9999px, 12px, 0);
  }
  60% {
    clip: rect(20px, 9999px, 35px, 0);
  }
  65% {
    clip: rect(54px, 9999px, 73px, 0);
  }
  70% {
    clip: rect(48px, 9999px, 48px, 0);
  }
  75% {
    clip: rect(61px, 9999px, 83px, 0);
  }
  80% {
    clip: rect(38px, 9999px, 95px, 0);
  }
  85% {
    clip: rect(82px, 9999px, 99px, 0);
  }
  90% {
    clip: rect(51px, 9999px, 25px, 0);
  }
  95% {
    clip: rect(65px, 9999px, 7px, 0);
  }
  100% {
    clip: rect(62px, 9999px, 48px, 0);
  }
}

@keyframes glitch-anim2 {
  0% {
    clip: rect(65px, 9999px, 100px, 0);
  }
  5% {
    clip: rect(52px, 9999px, 74px, 0);
  }
  10% {
    clip: rect(79px, 9999px, 85px, 0);
  }
  15% {
    clip: rect(75px, 9999px, 5px, 0);
  }
  20% {
    clip: rect(67px, 9999px, 61px, 0);
  }
  25% {
    clip: rect(14px, 9999px, 79px, 0);
  }
  30% {
    clip: rect(1px, 9999px, 66px, 0);
  }
  35% {
    clip: rect(86px, 9999px, 30px, 0);
  }
  40% {
    clip: rect(23px, 9999px, 98px, 0);
  }
  45% {
    clip: rect(85px, 9999px, 72px, 0);
  }
  50% {
    clip: rect(71px, 9999px, 75px, 0);
  }
  55% {
    clip: rect(2px, 9999px, 48px, 0);
  }
  60% {
    clip: rect(30px, 9999px, 16px, 0);
  }
  65% {
    clip: rect(59px, 9999px, 50px, 0);
  }
  70% {
    clip: rect(41px, 9999px, 62px, 0);
  }
  75% {
    clip: rect(2px, 9999px, 82px, 0);
  }
  80% {
    clip: rect(47px, 9999px, 73px, 0);
  }
  85% {
    clip: rect(3px, 9999px, 27px, 0);
  }
  90% {
    clip: rect(26px, 9999px, 55px, 0);
  }
  95% {
    clip: rect(42px, 9999px, 97px, 0);
  }
  100% {
    clip: rect(38px, 9999px, 49px, 0);
  }
}

.hero-content p {
  font-size: 1.5rem;
  margin-bottom: 30px;
  color: var(--accent-color);
  text-shadow: 0 0 10px rgba(5, 217, 232, 0.5);
}

.btn {
  display: inline-block;
  padding: 12px 30px;
  background: transparent;
  border: 2px solid var(--secondary-color);
  color: var(--secondary-color);
  text-decoration: none;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  border-radius: 30px;
}

.btn:hover {
  background: var(--secondary-color);
  color: var(--dark-color);
  box-shadow: 0 0 20px var(--secondary-color);
}

/* 部分标题 */
.section-title {
  text-align: center;
  margin: 80px 0 50px;
}

.section-title h2 {
  font-size: 2.5rem;
  display: inline-block;
  position: relative;
  padding-bottom: 10px;
}

.section-title h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
}

/* 关于部分 */
.about {
  padding: 100px 0;
}

.about-content {
  display: flex;
  align-items: center;
  gap: 50px;
}

.profile-img {
  flex: 1;
}

.img-placeholder {
  width: 100%;
  height: 400px;
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.img-placeholder::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(30deg);
  animation: shine 3s infinite;
}

@keyframes shine {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(30deg);
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(30deg);
  }
}

.profile-text {
  flex: 1;
}

.profile-text h3 {
  font-size: 2rem;
  margin-bottom: 20px;
  color: var(--secondary-color);
}

.profile-text p {
  margin-bottom: 20px;
  font-size: 1.1rem;
  color: #ccc;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 30px;
}

.skill-item {
  padding: 8px 20px;
  background: rgba(5, 217, 232, 0.1);
  border: 1px solid var(--secondary-color);
  border-radius: 30px;
  font-size: 0.9rem;
  transition: var(--transition);
}

.skill-item:hover {
  background: var(--secondary-color);
  color: var(--dark-color);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(5, 217, 232, 0.4);
}

/* 作品集部分 */
.portfolio {
  padding: 100px 0;
  background: rgba(0, 0, 0, 0.3);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.portfolio-item {
  position: relative;
  height: 300px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: var(--transition);
}

.portfolio-img {
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
}

.portfolio-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: var(--transition);
}

.portfolio-item:hover .portfolio-overlay {
  opacity: 1;
}

.portfolio-overlay h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: var(--secondary-color);
  transform: translateY(20px);
  transition: var(--transition);
}

.portfolio-overlay p {
  color: var(--accent-color);
  transform: translateY(20px);
  transition: var(--transition);
  transition-delay: 0.1s;
}

.portfolio-item:hover .portfolio-overlay h3,
.portfolio-item:hover .portfolio-overlay p {
  transform: translateY(0);
}

/* 联系方式部分 */
.contact {
  padding: 100px 0;
}

.contact-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 50px;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.contact-item h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: var(--secondary-color);
}

.contact-item p {
  font-size: 1.1rem;
  color: #ccc;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-form input,
.contact-form textarea {
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  color: var(--light-color);
  font-size: 1rem;
  transition: var(--transition);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 10px rgba(5, 217, 232, 0.5);
}

.contact-form textarea {
  min-height: 150px;
  resize: vertical;
}

/* 页脚 */
.footer {
  padding: 50px 0 30px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 50px;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.social-link {
  color: var(--light-color);
  text-decoration: none;
  font-size: 1.1rem;
  transition: var(--transition);
  position: relative;
  padding: 5px 0;
}

.social-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: var(--transition);
}

.social-link:hover::after {
  width: 100%;
}

.social-link:hover {
  color: var(--primary-color);
}

.footer p {
  color: #777;
  font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 992px) {
  .hero-content h1 {
    font-size: 3.5rem;
  }
  
  .about-content {
    flex-direction: column;
  }
  
  .profile-img,
  .profile-text {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }
  
  .nav-menu {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background: rgba(0, 0, 0, 0.9);
    flex-direction: column;
    align-items: center;
    padding-top: 50px;
    transition: var(--transition);
  }
  
  .nav-menu.active {
    left: 0;
  }
  
  .nav-menu li {
    margin: 20px 0;
  }
  
  .hero-content h1 {
    font-size: 2.5rem;
  }
  
  .hero-content p {
    font-size: 1.2rem;
  }
  
  .section-title h2 {
    font-size: 2rem;
  }
}

@media (max-width: 576px) {
  .hero-content h1 {
    font-size: 2rem;
  }
  
  .portfolio-grid {
    grid-template-columns: 1fr;
  }
}