/* 全局样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 页面基础样式 */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  scroll-behavior: smooth;
}

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

/* 导航栏样式 */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  padding: 15px 0;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.navbar.visible {
  transform: translateY(0);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

.navbar .logo {
  font-size: 1.5em;
  font-weight: bold;
  color: #2c3e50;
}

.navbar .nav-links {
  display: flex;
  list-style: none;
  gap: 30px;
}

.navbar .nav-links a {
  text-decoration: none;
  color: #555;
  font-weight: 500;
  transition: color 0.3s ease;
}

.navbar .nav-links a:hover {
  color: #667eea;
}

/* 返回顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: #5a67d8;
  transform: translateY(-2px);
}

/* 头部样式 */
.header {
  text-align: center;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 40px;
  margin-bottom: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  animation: fadeInUp 0.8s ease;
}

.profile-img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: linear-gradient(45deg, #667eea, #764ba2);
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
  color: white;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
  cursor: pointer;
}

.profile-img:hover {
  transform: scale(1.05);
}

.header h1 {
  font-size: 2.5em;
  margin-bottom: 10px;
  color: #2c3e50;
  animation: fadeInUp 0.8s ease 0.2s both;
}

.header .subtitle {
  font-size: 1.2em;
  color: #7f8c8d;
  margin-bottom: 20px;
  animation: fadeInUp 0.8s ease 0.4s both;
}

.contact-info {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
  animation: fadeInUp 0.8s ease 0.6s both;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #555;
  transition: transform 0.3s ease, color 0.3s ease;
  cursor: pointer;
}

.contact-item:hover {
  transform: translateY(-2px);
  color: #667eea;
}

/* 打字机效果 */
.typewriter {
  overflow: hidden;
  border-right: 2px solid #667eea;
  white-space: nowrap;
  animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: #667eea; }
}

/* 章节样式 */
.section {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.section.visible {
  opacity: 1;
  transform: translateY(0);
}

.section h2 {
  color: #2c3e50;
  margin-bottom: 20px;
  font-size: 1.8em;
  border-bottom: 3px solid #667eea;
  padding-bottom: 10px;
  position: relative;
}

.section h2::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 3px;
  background: #27ae60;
  transition: width 0.8s ease;
}

.section.visible h2::after {
  width: 100px;
}

/* 技能网格样式 */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.skill-category {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 10px;
  border-left: 4px solid #667eea;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.skill-category:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.skill-category h3 {
  color: #2c3e50;
  margin-bottom: 15px;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  background: #667eea;
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.9em;
  transition: all 0.3s ease;
  cursor: pointer;
}

.skill-tag:hover {
  background: #5a67d8;
  transform: scale(1.05);
}

/* 项目样式 */
.project {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  border-left: 4px solid #27ae60;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.project:hover {
  transform: translateX(10px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.project h3 {
  color: #2c3e50;
  margin-bottom: 10px;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tech-tag {
  background: #27ae60;
  color: white;
  padding: 3px 8px;
  border-radius: 15px;
  font-size: 0.8em;
  transition: all 0.3s ease;
}

.tech-tag:hover {
  background: #219a52;
  transform: scale(1.1);
}

/* 时间线样式 */
.timeline {
  position: relative;
  padding-left: 30px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #667eea;
}

.timeline-item {
  position: relative;
  margin-bottom: 30px;
  background: #f8f9fa;
  padding: 20px;
  border-radius: 10px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-item:hover {
  transform: translateX(10px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -37px;
  top: 20px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #667eea;
  transition: all 0.3s ease;
}

.timeline-item:hover::before {
  background: #27ae60;
  transform: scale(1.2);
}

.timeline-date {
  color: #667eea;
  font-weight: bold;
  margin-bottom: 5px;
}

/* 动画效果 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.pulse {
  animation: pulse 2s infinite;
}

/* 模态框样式 */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 30px;
  border-radius: 15px;
  width: 90%;
  max-width: 600px;
  position: relative;
  animation: fadeInUp 0.3s ease;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  position: absolute;
  top: 15px;
  right: 20px;
}

.close:hover {
  color: #667eea;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  .header {
    padding: 20px;
  }

  .header h1 {
    font-size: 2em;
  }

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

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

  .navbar .nav-links {
    display: none;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
  }
}