/* 全局样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 全局变量定义 */
:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --light-color: #ecf0f1;
  --dark-color: #1a2530;
  --gray-color: #95a5a6;
  --shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

body {
  line-height: 1.6;
  color: var(--primary-color);
  background-color: #f8f9fa;
}

/* 导航栏样式 */
nav {
  background-color: var(--primary-color);
  color: white;
  padding: 1rem 5%;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
}

.nav-links {
  display: flex;
  list-style: none;
}

.nav-links li {
  margin-left: 2rem;
}

.nav-links a {
  color: white;
  text-decoration: none;
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--secondary-color);
}

/* 主要内容区域 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 5%;
}

/* 个人信息部分 */
.profile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2rem;
  margin-bottom: 4rem;
  padding: 2rem;
  background-color: white;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.profile-img {
  flex: 1;
  min-width: 250px;
  text-align: center;
}

.profile-img img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid var(--light-color);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.profile-img img:hover {
  transform: scale(1.05);
}

.profile-info {
  flex: 2;
  min-width: 300px;
}

.profile-info h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.profile-info .title {
  color: var(--secondary-color);
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.profile-info p {
  margin-bottom: 1rem;
  color: var(--primary-color);
  font-size: 1.1rem;
}

.contact-info {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 2rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.contact-item i {
  color: var(--secondary-color);
  font-size: 1.2rem;
}

/* 技能部分 */
.skills {
  margin-bottom: 4rem;
}

.section-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 2rem;
  position: relative;
  padding-bottom: 1rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background-color: var(--secondary-color);
  border-radius: 2px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.skill-card {
  background-color: white;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  text-align: center;
}

.skill-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.skill-card i {
  font-size: 2.5rem;
  color: var(--secondary-color);
  margin-bottom: 1rem;
}

.skill-card h3 {
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.skill-card p {
  color: var(--gray-color);
}

/* 项目展示部分 */
.projects {
  margin-bottom: 4rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.project-card {
  background-color: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.project-img {
  height: 200px;
  overflow: hidden;
}

.project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.project-card:hover .project-img img {
  transform: scale(1.1);
}

.project-info {
  padding: 1.5rem;
}

.project-info h3 {
  margin-bottom: 0.8rem;
  color: var(--primary-color);
}

.project-info p {
  color: var(--gray-color);
  margin-bottom: 1rem;
}

.project-link {
  display: inline-block;
  color: var(--secondary-color);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.project-link:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

/* 页脚样式 */
footer {
  background-color: var(--dark-color);
  color: white;
  padding: 2rem 5%;
  margin-top: 4rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.footer-info {
  margin-bottom: 1.5rem;
}

.footer-info p {
  margin-bottom: 0.5rem;
}

.record-info {
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.9rem;
  color: var(--gray-color);
}

/* 响应式调整 */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .profile {
    padding: 1.5rem;
  }

  .profile-info h1 {
    font-size: 2rem;
  }

  .section-title {
    font-size: 1.8rem;
  }
}

/* 返回顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: var(--secondary-color);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}