/* ============================================
   个人简历网站 - 样式表
   设计风格：简约、高级、极简
   ============================================ */

/* CSS 变量 */
:root {
  /* 主色调 */
  --color-bg: #FFFFFF;
  --color-bg-alt: #F8FAFC;
  --color-text: #333333;
  --color-text-muted: #64748B;
  
  /* 强调色 */
  --color-accent: #2563EB;
  --color-accent-hover: #1E3A8A;
  
  /* 边框与阴影 */
  --color-border: #E2E8F0;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  
  /* 字体 */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  
  /* 布局 */
  --max-width: 1200px;
  --spacing: 1.5rem;
  --transition: 0.2s ease;
}

/* 基础重置 */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px; /* 为固定导航栏留出空间 */
}

body {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-accent-hover);
}

/* ============================================
   导航栏
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  z-index: 1000;
  transition: box-shadow var(--transition);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem var(--spacing);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-text);
}

.nav-logo:hover {
  color: var(--color-accent);
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-link {
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.25rem 0;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-accent);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-accent);
  border-radius: 1px;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--color-text);
  cursor: pointer;
  padding: 0.5rem;
}

/* ============================================
   Hero 区域
   ============================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8rem 2rem 4rem;
  background: linear-gradient(180deg, var(--color-bg-alt) 0%, var(--color-bg) 100%);
}

.hero-content {
  text-align: center;
  max-width: 600px;
}

.hero-avatar {
  font-size: 6rem;
  color: var(--color-accent);
  margin-bottom: 1.5rem;
  opacity: 0.9;
}

.hero-name {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.hero-title {
  font-size: 1.25rem;
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.hero-bio {
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

.hero-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.contact-divider {
  color: var(--color-border);
  font-weight: 300;
}

/* ============================================
   通用区块
   ============================================ */
.section {
  padding: 5rem 2rem;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 2.5rem;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title i {
  color: var(--color-accent);
}

/* 教育背景 - 时间线 */
.education {
  background: var(--color-bg);
}

.timeline {
  position: relative;
  padding-left: 2rem;
  border-left: 2px solid var(--color-border);
  margin-left: 0.5rem;
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -2.5rem;
  top: 0.25rem;
  width: 12px;
  height: 12px;
  background: var(--color-accent);
  border-radius: 50%;
  border: 3px solid var(--color-bg);
  box-shadow: var(--shadow-sm);
}

.timeline-content h3 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.timeline-degree {
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: 0.25rem;
}

.timeline-date {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
}

.timeline-honor {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* 项目经历 */
.projects {
  background: var(--color-bg-alt);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.project-card {
  background: var(--color-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition), box-shadow var(--transition);
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.project-placeholder {
  height: 160px;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-hover) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: rgba(255, 255, 255, 0.9);
}

.project-body {
  padding: 1.5rem;
}

.project-body h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.project-body p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.project-tags span {
  padding: 0.25rem 0.75rem;
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
  font-size: 0.8rem;
  border-radius: 20px;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.project-link[href="#"] {
  opacity: 0.6;
  pointer-events: none;
}

/* 个人技能 */
.skills {
  background: var(--color-bg);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.skill-category h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.skill-category h3 i {
  color: var(--color-accent);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tags span {
  padding: 0.4rem 1rem;
  background: var(--color-bg-alt);
  color: var(--color-text);
  font-size: 0.9rem;
  border-radius: 8px;
  transition: background var(--transition), color var(--transition);
}

.skill-tags span:hover {
  background: var(--color-accent);
  color: white;
}

/* 社交联系 */
.contact {
  background: var(--color-bg-alt);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: var(--color-bg);
  border-radius: 12px;
  font-size: 1.5rem;
  color: var(--color-text-muted);
  transition: color var(--transition), background var(--transition), transform var(--transition);
  box-shadow: var(--shadow-sm);
}

.social-link:hover {
  color: var(--color-accent);
  background: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.social-link-disabled {
  cursor: default;
  pointer-events: none;
  opacity: 0.5;
}

/* 页脚 */
.footer {
  padding: 2rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* ============================================
   动画 - 淡入
   ============================================ */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/*  staggered 动画延迟 */
.hero-content.fade-in { animation-delay: 0.1s; }
.timeline-item:nth-child(1).fade-in { animation-delay: 0.1s; }
.timeline-item:nth-child(2).fade-in { animation-delay: 0.2s; }
.project-card:nth-child(1).fade-in { animation-delay: 0.1s; }
.project-card:nth-child(2).fade-in { animation-delay: 0.2s; }
.project-card:nth-child(3).fade-in { animation-delay: 0.3s; }
.skill-category:nth-child(1).fade-in { animation-delay: 0.1s; }
.skill-category:nth-child(2).fade-in { animation-delay: 0.2s; }
.skill-category:nth-child(3).fade-in { animation-delay: 0.3s; }

/* ============================================
   响应式设计
   ============================================ */

/* 平板 (640px - 1024px) */
@media (max-width: 1024px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }
}

/* 手机 (< 640px) */
@media (max-width: 640px) {
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 280px;
    height: 100vh;
    background: var(--color-bg);
    flex-direction: column;
    padding: 5rem 1.5rem 2rem;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    transition: right var(--transition);
    gap: 0;
  }

  .nav-menu.active {
    right: 0;
  }

  .nav-menu li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
  }

  .nav-toggle {
    display: block;
    z-index: 1001;
  }

  .hero {
    padding: 6rem 1.5rem 3rem;
  }

  .hero-avatar {
    font-size: 4.5rem;
  }

  .hero-name {
    font-size: 1.75rem;
  }

  .section {
    padding: 3rem 1.5rem;
  }

  .section-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .timeline {
    padding-left: 1.5rem;
    margin-left: 0.25rem;
  }

  .timeline-marker {
    left: -1.75rem;
    width: 10px;
    height: 10px;
  }
}
