/* ===== CSS 变量和主题 ===== */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --card-bg: #ffffff;
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --navbar-bg: rgba(255, 255, 255, 0.8);
  --transition: all 0.3s ease;
}

[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --card-bg: #1e293b;
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
  --navbar-bg: rgba(15, 23, 42, 0.8);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: var(--transition);
  overflow-x: hidden;
}

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

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  background-color: var(--navbar-bg);
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

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

.logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 32px;
  align-items: center;
}

.nav-menu a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  transition: var(--transition);
  position: relative;
}

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

.theme-toggle,
.mobile-toggle {
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 20px;
  padding: 8px;
  border-radius: 8px;
  transition: var(--transition);
}

.theme-toggle:hover,
.mobile-toggle:hover {
  background-color: var(--bg-secondary);
}

.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
}

.mobile-toggle span {
  width: 24px;
  height: 2px;
  background-color: var(--text-primary);
  transition: var(--transition);
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  transform: translateY(-100%);
  opacity: 0;
  transition: var(--transition);
  z-index: 999;
}

.mobile-menu.active {
  transform: translateY(0);
  opacity: 1;
}

.mobile-menu ul {
  list-style: none;
  padding: 16px 24px;
}

.mobile-menu li {
  margin-bottom: 12px;
}

.mobile-menu a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 18px;
  display: block;
  padding: 8px 0;
}

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  padding-top: 70px;
  overflow: hidden;
}

.hero-content {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 64px;
  align-items: center;
}

.hero-title {
  font-size: clamp(40px, 8vw, 72px);
  line-height: 1.1;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
}

.greeting {
  font-size: 0.4em;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.name {
  font-weight: 700;
  color: var(--text-primary);
}

.hero-subtitle {
  font-size: 24px;
  color: var(--accent-primary);
  margin-bottom: 24px;
  font-weight: 500;
}

.hero-description {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 32px;
  max-width: 500px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 12px;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

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

.btn-outline {
  color: var(--text-primary);
  border: 2px solid var(--border-color);
  background: transparent;
}

.btn-outline:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-2px);
}

.btn-full {
  width: 100%;
}

.social-links {
  display: flex;
  gap: 16px;
}

.social-links a {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  transition: var(--transition);
  font-size: 20px;
}

.social-links a:hover {
  background: var(--accent-gradient);
  color: white;
  transform: translateY(-3px);
}

.hero-image {
  display: flex;
  justify-content: center;
  align-items: center;
}

.avatar-container {
  position: relative;
}

.avatar-bg {
  position: absolute;
  width: 350px;
  height: 350px;
  background: var(--accent-gradient);
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  opacity: 0.2;
  animation: morph 8s ease-in-out infinite;
}

.avatar {
  position: relative;
  width: 300px;
  height: 300px;
  background: var(--accent-gradient);
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: morph 8s ease-in-out infinite;
  box-shadow: var(--card-shadow-hover);
}

.avatar i {
  font-size: 80px;
  color: white;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  overflow: hidden;
}

.circle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.4;
  filter: blur(60px);
}

.circle-1 {
  width: 400px;
  height: 400px;
  background: rgba(99, 102, 241, 0.2);
  top: -100px;
  right: -100px;
}

.circle-2 {
  width: 300px;
  height: 300px;
  background: rgba(139, 92, 246, 0.2);
  bottom: -50px;
  left: -50px;
}

.section {
  padding: 100px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 64px;
}

.section-header h2 {
  font-size: 42px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.section-header p {
  font-size: 18px;
  color: var(--text-secondary);
}

.about {
  background-color: var(--bg-secondary);
}

.about-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 64px;
  align-items: start;
}

.about-text h3 {
  font-size: 24px;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 16px;
  line-height: 1.8;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.skill-tag {
  padding: 8px 16px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}

.skill-tag:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-2px);
}

.about-stats {
  display: grid;
  gap: 24px;
}

.stat-card {
  background-color: var(--card-bg);
  padding: 24px;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  text-align: center;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--card-shadow-hover);
}

.stat-number {
  font-size: 40px;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 14px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 32px;
}

.project-card {
  background-color: var(--card-bg);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--card-shadow-hover);
}

.project-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.project-placeholder {
  width: 100%;
  height: 100%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-placeholder i {
  font-size: 60px;
  color: white;
  opacity: 0.8;
}

.project-content {
  padding: 24px;
}

.project-title {
  font-size: 22px;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.project-description {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 15px;
  line-height: 1.7;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.project-tags span {
  padding: 4px 12px;
  background-color: var(--bg-secondary);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.project-links {
  display: flex;
  gap: 16px;
}

.project-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}

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

.contact {
  background-color: var(--bg-secondary);
}

.contact-content {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 64px;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.contact-item i {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-gradient);
  color: white;
  border-radius: 12px;
  font-size: 20px;
  flex-shrink: 0;
}

.contact-item h4 {
  font-size: 18px;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.contact-item p {
  color: var(--text-secondary);
}

.contact-form {
  background-color: var(--card-bg);
  padding: 32px;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-primary);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 16px;
  font-family: inherit;
  transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.footer {
  background-color: var(--bg-primary);
  padding: 32px 0;
  border-top: 1px solid var(--border-color);
}

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

.footer p {
  color: var(--text-secondary);
}

.footer-social {
  display: flex;
  gap: 16px;
}

.footer-social a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  transition: var(--transition);
}

.footer-social a:hover {
  background: var(--accent-gradient);
  color: white;
  transform: translateY(-2px);
}

@keyframes morph {
  0% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  }
  50% {
    border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
  }
  100% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  }
}

@media (max-width: 968px) {
  .hero-content {
    grid-template-columns: 1fr;
    gap: 48px;
    text-align: center;
  }

  .hero-description {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-buttons {
    justify-content: center;
  }

  .social-links {
    justify-content: center;
  }

  .about-content {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .contact-content {
    grid-template-columns: 1fr;
    gap: 48px;
  }

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

  .avatar-bg {
    width: 280px;
    height: 280px;
  }

  .avatar {
    width: 240px;
    height: 240px;
  }

  .nav-menu {
    display: none;
  }

  .mobile-toggle {
    display: flex;
  }

  .mobile-menu {
    display: block;
  }

  .section-header h2 {
    font-size: 32px;
  }

  .section {
    padding: 60px 0;
  }
}

@media (max-width: 640px) {
  .hero-title {
    font-size: 36px;
  }

  .hero-subtitle {
    font-size: 20px;
  }

  .hero-description {
    font-size: 16px;
  }

  .btn {
    padding: 12px 24px;
    font-size: 15px;
  }

  .footer-content {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .avatar-bg {
    width: 240px;
    height: 240px;
  }

  .avatar {
    width: 200px;
    height: 200px;
  }

  .avatar i {
    font-size: 60px;
  }
}
