/* ===== Reset & Base ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: linear-gradient(135deg, #0a0e27 0%, #1a1040 40%, #0d1b3e 100%);
  color: #e0e0e0;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: #64b5f6;
  text-decoration: none;
  transition: color 0.3s;
}

a:hover {
  color: #90caf9;
}

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

.hero-logo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(100, 181, 246, 0.5);
  margin-bottom: 1.5rem;
  box-shadow: 0 0 30px rgba(100, 181, 246, 0.2);
}

.hero h1 {
  font-size: 2.8rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.5rem;
  letter-spacing: 2px;
}

.hero .subtitle {
  font-size: 1.1rem;
  color: #90a4ae;
  margin-bottom: 1rem;
  min-height: 1.6em;
}

.hero .tagline {
  font-size: 0.95rem;
  color: #607d8b;
  max-width: 600px;
  line-height: 1.8;
}

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  animation: bounce 2s infinite;
  color: #607d8b;
  font-size: 0.85rem;
  cursor: pointer;
}

.scroll-hint::after {
  content: "↓";
  display: block;
  text-align: center;
  font-size: 1.2rem;
  margin-top: 0.3rem;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* ===== Section Common ===== */
.section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.section-title {
  font-size: 1.8rem;
  color: #ffffff;
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}

.section-title::after {
  content: "";
  display: block;
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, #64b5f6, #ce93d8);
  margin: 0.8rem auto 0;
  border-radius: 2px;
}

/* ===== About ===== */
.about-content {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 2rem 2.5rem;
  line-height: 2;
  font-size: 0.95rem;
  color: #b0bec5;
}

.about-content p {
  margin-bottom: 0.8rem;
}

.about-content p:last-child {
  margin-bottom: 0;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.2rem;
}

.tech-tag {
  background: rgba(100, 181, 246, 0.1);
  border: 1px solid rgba(100, 181, 246, 0.2);
  color: #64b5f6;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
}

/* ===== Projects ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 2rem;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  position: relative;
  overflow: hidden;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(100, 181, 246, 0.12);
  border-color: rgba(100, 181, 246, 0.3);
}

.project-card h3 {
  font-size: 1.2rem;
  color: #ffffff;
  margin-bottom: 0.8rem;
}

.project-card .desc {
  font-size: 0.9rem;
  color: #90a4ae;
  line-height: 1.7;
  margin-bottom: 1.2rem;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  font-size: 0.8rem;
  background: rgba(100, 181, 246, 0.1);
  border: 1px solid rgba(100, 181, 246, 0.2);
  color: #64b5f6;
  transition: background 0.3s, color 0.3s;
}

.project-link:hover {
  background: rgba(100, 181, 246, 0.25);
  color: #ffffff;
}

.project-link.qq {
  background: rgba(206, 147, 216, 0.1);
  border-color: rgba(206, 147, 216, 0.2);
  color: #ce93d8;
}

.project-link.qq:hover {
  background: rgba(206, 147, 216, 0.25);
  color: #ffffff;
}

.badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(206, 147, 216, 0.15);
  border: 1px solid rgba(206, 147, 216, 0.3);
  color: #ce93d8;
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
}

/* ===== Footer ===== */
footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 2rem;
}

footer p {
  font-size: 0.8rem;
  color: #546e7a;
  margin-bottom: 0.3rem;
}

footer a {
  color: #546e7a;
}

footer a:hover {
  color: #90a4ae;
}

/* ===== Typewriter cursor ===== */
.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background: #64b5f6;
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ===== Fade-in animation ===== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero .subtitle {
    font-size: 0.95rem;
  }

  .section {
    padding: 3rem 1.2rem;
  }

  .section-title {
    font-size: 1.4rem;
  }

  .about-content {
    padding: 1.5rem;
  }

  .project-card {
    padding: 1.5rem;
  }

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