/* 基本样式 */
body {
  font-family: 'Arial', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f4f4f4;
  color: #333;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* 导航栏样式 */
header {
  background-color: #333;
  color: #fff;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

nav .logo {
  font-size: 1.5rem;
  font-weight: bold;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.menu-toggle span {
  height: 3px;
  width: 25px;
  background: #fff;
  margin-bottom: 5px;
  border-radius: 2px;
}

nav ul li {
  margin-left: 20px;
}

nav ul li a {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
}

nav ul li a:hover {
  color: #00bcd4;
}

/* 英雄区样式 */
.hero {
  background: linear-gradient(to right, #6dd5ed, #2193b0);
  color: #fff;
  text-align: center;
  padding: 100px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 20px;
  border: 5px solid rgba(255, 255, 255, 0.8);
}

.hero h1 {
  margin: 0;
  font-size: 3rem;
}

.hero p {
  font-size: 1.2rem;
  max-width: 600px;
  line-height: 1.6;
}

/* 部分通用样式 */
section {
  padding: 60px 20px;
  margin-bottom: 20px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

section h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 40px;
  color: #2193b0;
  position: relative;
}

section h2::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -10px;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background-color: #00bcd4;
  border-radius: 2px;
}

/* 关于我样式 */
.about-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 40px;
  justify-content: center;
  padding: 30px; /* 增加内边距 */
  background-color: #f9f9f9; /* 浅色背景 */
  border-radius: 12px; /* 更大的圆角 */
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15); /* 更深的阴影 */
}

.about-text {
  flex: 2;
  min-width: 300px;
  line-height: 1.8;
  font-size: 1.1rem; /* 调整字体大小 */
  color: #555; /* 调整字体颜色 */
  padding-right: 20px; /* 增加右侧内边距 */
}

.about-text p {
  margin-bottom: 15px; /* 段落间距 */
}

.about-image {
  flex: 1;
  min-width: 200px;
  text-align: center;
  transition: transform 0.3s ease; /* 添加过渡效果 */
}

.about-image:hover {
  transform: scale(1.03); /* 悬停放大效果 */
}

.about-image img {
  max-width: 100%;
  height: auto;
  border-radius: 12px; /* 调整圆角 */
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25); /* 更深的阴影 */
  border: 4px solid #00bcd4; /* 添加边框 */
}

@media (max-width: 768px) {
  .about-text {
    padding-right: 0; /* 移动端取消右侧内边距 */
  }
}

/* 技能样式 */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  text-align: center;
}

.skill-item {
  background-color: #e0f7fa;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
}

.skill-item:hover {
  transform: translateY(-5px);
}

.skill-item i {
  font-size: 3rem;
  color: #00bcd4;
  margin-bottom: 10px;
}

.skill-item h3 {
  margin: 0;
  font-size: 1.2rem;
}

/* 作品集样式 */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.portfolio-item {
  background-color: #f8f8f8;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.portfolio-item:hover {
  transform: translateY(-10px);
}

.portfolio-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.portfolio-info {
  padding: 20px;
}

.portfolio-info h3 {
  margin-top: 0;
  font-size: 1.5rem;
  color: #2193b0;
}

.portfolio-info p {
  font-size: 0.9rem;
  color: #666;
}

.portfolio-info a {
  display: inline-block;
  margin-top: 15px;
  text-align: center;
  color: #00bcd4;
  text-decoration: none;
  font-weight: bold;
}

.portfolio-info a:hover {
  text-decoration: underline;
}

/* 联系方式样式 */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-form label {
  font-weight: bold;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

.contact-form textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-form button {
  background-color: #00bcd4;
  color: #fff;
  padding: 12px 20px;
  border: none;
  border-radius: 4px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.contact-form button:hover {
  background-color: #0097a7;
}

.btn-contact {
  display: inline-block;
  background-color: #00bcd4;
  color: #fff;
  padding: 12px 25px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  margin-top: 20px;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.btn-contact:hover {
  background-color: #0097a7;
  transform: translateY(-3px);
}

/* 页脚样式 */
footer {
  background-color: #333;
  color: #fff;
  text-align: center;
  padding: 20px 0;
  margin-top: 40px;
}

footer .social-links a {
  color: #fff;
  font-size: 1.5rem;
  margin: 0 10px;
  transition: color 0.3s ease;
}

footer .social-links a:hover {
  color: #00bcd4;
}

/* 响应式设计 */
@media (max-width: 768px) {
  nav {
    flex-direction: row; /* 保持水平布局 */
    justify-content: space-between; /* 保持两端对齐 */
    align-items: center; /* 垂直居中 */
  }

  nav ul {
    display: none; /* 默认隐藏导航菜单 */
    flex-direction: column;
    width: 100%;
    margin-top: 10px;
    position: absolute;
    top: 60px; /* 调整为 header 的高度 */
    left: 0;
    background-color: #333;
    padding: 10px 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  }

  nav ul.active {
    display: flex; /* 显示激活状态的导航菜单 */
  }

  nav ul li {
    margin: 10px 0;
  }

  .menu-toggle {
    display: flex; /* 在移动设备上显示汉堡菜单 */
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .about-content {
    flex-direction: column;
  }

  .about-text,
  .about-image {
    min-width: unset;
    width: 100%;
  }

  section {
    padding: 40px 15px;
  }

  section h2 {
    font-size: 2rem;
  }
}
