/* ========== 基础重置 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #333;
  background: #ffffff;
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* ========== 导航栏 ========== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 60px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #eee;
  z-index: 1000;
}

.nav-brand {
  font-size: 20px;
  font-weight: 700;
  color: #2563eb;
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a {
  font-size: 15px;
  color: #555;
  transition: color 0.2s;
  padding: 4px 0;
}

.nav-links a:hover {
  color: #2563eb;
}

/* 汉堡菜单按钮（手机端） */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #333;
  border-radius: 2px;
  transition: all 0.3s;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ========== Hero 首屏 ========== */
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 80px 24px 40px;
  text-align: center;
  background: linear-gradient(135deg, #f0f5ff 0%, #e8f0fe 100%);
}

.hero-content {
  max-width: 600px;
}

.avatar {
  width: 120px;
  height: 120px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: #dbeafe;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  border: 4px solid #2563eb;
}

.hero h1 {
  font-size: 36px;
  font-weight: 700;
  color: #111;
  margin-bottom: 12px;
}

.subtitle {
  font-size: 18px;
  color: #666;
  margin-bottom: 32px;
}

.btn {
  display: inline-block;
  padding: 12px 32px;
  background: #2563eb;
  color: #fff;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  transition: background 0.2s, transform 0.2s;
}

.btn:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
}

/* ========== 通用区块 ========== */
.section {
  padding: 80px 24px;
}

.section-alt {
  background: #f8fafc;
}

.container {
  max-width: 900px;
  margin: 0 auto;
}

.section-title {
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 48px;
  color: #111;
  position: relative;
}

.section-title::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  background: #2563eb;
  margin: 12px auto 0;
  border-radius: 2px;
}

/* ========== 关于我 ========== */
.about-content {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.about-content p {
  font-size: 16px;
  color: #555;
  margin-bottom: 16px;
  line-height: 1.8;
}

/* ========== 技能 ========== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.skill-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 28px 20px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.skill-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.skill-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.skill-card h3 {
  font-size: 18px;
  color: #111;
  margin-bottom: 8px;
}

.skill-card p {
  font-size: 14px;
  color: #888;
}

/* ========== 项目作品 ========== */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.project-card {
  display: flex;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.project-img {
  width: 120px;
  min-height: 120px;
  background: #dbeafe;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  flex-shrink: 0;
}

.project-info {
  padding: 20px;
  flex: 1;
}

.project-info h3 {
  font-size: 18px;
  color: #111;
  margin-bottom: 8px;
}

.project-info p {
  font-size: 14px;
  color: #666;
  margin-bottom: 12px;
  line-height: 1.6;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-block;
  padding: 4px 12px;
  background: #eff6ff;
  color: #2563eb;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

/* ========== 联系方式 ========== */
.contact-content {
  max-width: 640px;
  margin: 0 auto;
}

.contact-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.contact-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 28px 16px;
  text-align: center;
  transition: transform 0.2s;
}

.contact-card:hover {
  transform: translateY(-4px);
}

.contact-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.contact-card h3 {
  font-size: 16px;
  color: #111;
  margin-bottom: 8px;
}

.contact-card p {
  font-size: 13px;
  color: #888;
  word-break: break-all;
}

/* ========== 页脚 ========== */
.footer {
  text-align: center;
  padding: 24px;
  background: #111;
  color: #999;
  font-size: 14px;
}

/* ========== 淡入动画 ========== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========== 响应式（手机端） ========== */
@media (max-width: 768px) {
  /* 导航：汉堡菜单 */
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    gap: 0;
    border-bottom: 1px solid #eee;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s, opacity 0.3s;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links li {
    width: 100%;
    text-align: center;
  }

  .nav-links a {
    display: block;
    padding: 14px 0;
    font-size: 16px;
  }

  /* Hero */
  .hero h1 {
    font-size: 28px;
  }

  .subtitle {
    font-size: 16px;
  }

  .avatar {
    width: 100px;
    height: 100px;
    font-size: 40px;
  }

  /* 区块 */
  .section {
    padding: 60px 20px;
  }

  .section-title {
    font-size: 24px;
    margin-bottom: 36px;
  }

  /* 技能：手机端单列 */
  .skills-grid {
    grid-template-columns: 1fr;
  }

  /* 项目卡片：手机端纵向排列 */
  .project-card {
    flex-direction: column;
  }

  .project-img {
    width: 100%;
    min-height: 100px;
  }

  /* 联系卡片：手机端单列 */
  .contact-cards {
    grid-template-columns: 1fr;
  }
}
