/* 重置默认样式 */
body {
  margin: 0;
  padding: 0;
  font-family: 'Arial', sans-serif;
  background-color: #222222;
  color: #ffffff;

;
}

header {
  background-color: rgba(0, 0, 0, 0.815);
  padding: 1rem;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  font-size: 40px; /* 设置字体大小 */
}

.logo-text {
  font-weight: bold; /* 粗体 */
  color: #2ecc71; /* 黄色 */
  text-decoration: none; /* 去掉下划线 */
}
/* 导航栏样式 */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 85%;
  margin: 0 auto;
}
.nav-links {
  list-style: none;
  display: flex;
  gap: 0rem;
  justify-content: flex-end; /* 右对齐 */
}

.nav-links li {
  position: relative; /* 用于伪元素定位 */
}

.nav-links li a {
  font-size: 1.2rem; /* 调整文字大小 */
  text-decoration: none;
  color: #ffffff;
  position: relative; /* 添加相对定位 */
  padding: 10px 20px; /* 给按钮添加内边距 */
  transition: color 0.3s ease; /* 文字颜色过渡效果 */
  white-space: nowrap; /* 防止文字换行 */
}
/* 下拉菜单样式 */
.dropdown-content {
  display: none;
  position: absolute;
  background-color: rgba(51, 51, 51, 0.9);
  min-width: 100px;
  z-index: 1;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  padding: 10px 0;
  top: 100%; /* 下拉菜单显示在导航文字正下方 */
  left: 0%;
}

/* 移除下拉选项前面的点 */
.dropdown-content li {
  list-style: none; /* 移除默认列表样式 */
  margin: 0; /* 确保没有额外的外边距 */
}


/* 下拉选项中的文字居中 */
.dropdown-content li a {
  color: #fff;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  transition: background-color 0.3s ease;
  border-radius: 5px; /* 圆角效果 */
  text-align: center; /* 水平居中 */
  line-height: 1.5; /* 垂直居中 */
}

.dropdown-content li a:hover {
  color: #fff;
}

/* 悬停显示下拉列表 */
.dropdown:hover .dropdown-content {
  display: block;
}


.nav-links li a::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background-color: #2ecc71; /* 绿色线条颜色 */
  bottom: 0;
  transition: width 0.3s ease; /* 线条宽度过渡效果 */
}
.nav-links li a:hover {
  color: #2ecc71; /* 悬停或激活时文字颜色变化 */
}

.nav-links li a:hover::after {
  width: 100%; /* 悬停或激活时线条扩展到按钮宽度 */
  left: 0;
  transform: translateX(0);
}

main {
  margin-top: 5rem;
}

section {
  padding: 4rem 2rem;
  text-align: center;
}

/* 轮播图样式 */
.carousel {
  width: 60%; /* 固定宽度 */
  height: 60%; /* 固定高度 */
  overflow: hidden; /* 隐藏超出部分 */
  border-radius: 10px; /* 圆角边框 */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* 添加阴影效果 */
  margin: 0 auto; /* 居中显示 */
}
.carousel-inner {
  display: flex;
  transition: transform 0.6s ease;
}

.carousel-item {
  max-width: 100%; /* 每个卡片的宽度 */
  max-height: 100%;
  margin: 0 0px;
  flex: 0 0 auto;
  position: relative;
}

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 确保图片等比缩放 */
  object-position: center; /* 确保图片居中显示 */
  display: block;
  border-radius: 8px;
}

.carousel-caption {
  position: absolute;
  bottom: 20px;
  left: 20px;
  color: white;
  background: rgba(0, 0, 0, 0.5);
  padding: 1rem;
  border-radius: 5px;
}

.carousel-control-prev,
.carousel-control-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none; /* 去掉背景色 */
  border: none;
  color: #ffffff;
  font-size: 5rem;
  cursor: pointer;
  z-index: 1;
}

.carousel-control-prev {
  left: 350px;
}

.carousel-control-next {
  right: 350px;
}
/* 作品集区域背景颜色 */
#portfolio {
  background-color: #ffffff; /* 设置作品集区域的背景颜色 */
  padding: 20px 0; /* 添加上下内边距 */
}
/* 作品集标题样式 */
.portfolio-title {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
}

.portfolio-title::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 30px;
  background-color: #2ecc71; /* 绿色竖线 */
  margin-right: 15px;
  margin-top: 3px;
}

.portfolio-title h2 {
  color: #2ecc71; /* 绿色文字 */
  font-size: 2rem;
  font-weight: bold;
  margin: 0;
}
/* 作品集分类按钮样式 */
.portfolio-categories {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
  gap: 1rem;
}

.category-btn {
  padding: 0.8rem 1.5rem;
  background-color: #333;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.category-btn:hover {
  background-color: #2ecc71;
}

.category-btn.active {
  background-color: #2ecc71;
}
/* 作品集竖向排列 */
#portfolio .portfolio-items {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.portfolio-item {
  background: #1a1a1a;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.portfolio-item img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 1rem;
}
/* 关于我板块样式 */
#about {
  background-color: #2c3e50; /* 深蓝色背景 */
  padding: 4rem 2rem;
  text-align: center;
}

.about-container {
  background-color: rgba(255, 255, 255, 0.616); /* 半透明白色背景 */
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  max-width: 1200px;
  margin: 0 auto;
}
/* 关于我标题样式 */
.about-title {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
}

.about-title::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 40px;
  background-color: #2ecc71; /* 绿色竖线 */
  margin-right: 15px;
}

.about-title h2 {
  color: #2ecc71; /* 绿色文字 */
  font-size: 2rem;
  font-weight: bold;
  margin: 0;
}

/* 关于我内容样式 */
.about-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  padding: 2rem 0;
}

.about-image img {
  width: 300px;
  height: 300px;
  object-fit: cover;
  border-radius: 100%; /* 圆形头像 */
  border: 4px solid #2ecc71; /* 绿色边框 */
}

.about-details {
  text-align: left;
  flex: 1;
}

.about-details p {
  color: #ffffff;
  line-height: 1.6;
  margin-bottom: 1rem;
}
/* 联系我板块样式 */
#contact {
  background-color: #1a1a1a; /* 深蓝色背景 */
  padding: 4rem 2rem;
}

.contact-container {
  background-color: rgba(255, 255, 255, 0.95); /* 半透明白色背景 */
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  max-width: 800px;
  margin: 0 auto;
  text-align: left;
}

.contact-container h2 {
  color: #2ecc71;
  font-size: 2rem;
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  color: #333;
}

input, textarea, button {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  color: #333;
  background-color: rgba(255, 255, 255, 0.95);
}

textarea {
  resize: vertical; /* 允许垂直调整大小 */
}

button {
  background-color: #2ecc71;
  color: white;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #27ae60;
}