/* 响应式布局样式 - 不修改原有样式 */

/* 全局响应式布局设置 */
@media screen and (max-width: 1200px) {
  .section {
    width: 90%;
    max-width: 960px;
  }
  .nav {
    width: 90%;
    max-width: 960px;
  }
  
  /* works区域调整 - 大屏幕 */
  .works-content .works-list {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .works-content .works-item {
    width: 300px;
    margin: 0 15px 30px !important;
    float: none;
    flex-shrink: 0;
  }
  
  /* 统一works-item中fade类的左边距 */
  .works-content .works-list .fade {
    left: 0;
  }
  
  .works-content .works-item.fade2,
  .works-content .works-item.fade3 {
    margin-left: 15px !important;
  }
}

/* 平板设备 (768px-991px) */
@media screen and (max-width: 991px) {
  .section {
    width: 95%;
  }
  .nav {
    width: 95%;
  }
  
  /* 修改导航布局 */
  .nav li a {
    padding: 40px 0;
    font-size: 24px;
  }
  
  .nav .back-home a {
    width: 80px;
    height: 80px;
    margin-left: -40px;
    top: 20px;
    -webkit-background-size: 80px 80px;
    background-size: 80px 80px;
  }
  
  /* About部分的span标签自适应处理 */
  .section-about .about-content .introli {
    margin-left: 150px;
  }
  
  .section-about .about-content .introli .left_icon,
  .section-about .about-content .introli .right_content {
    display: inline-block;
    vertical-align: middle;
  }
  
  .section-about .about-content .introli .left_icon {
    width: 80px;
    height: 80px;
  }
  
  .section-about .about-content .introli .right_content img {
    max-width: 400px;
    height: auto;
  }
  
  /* 作品展示区域调整 */
  .works-content {
    padding-top: 20px;
  }
  
  .works-content .works-list {
    text-align: center;
  }
  
  /* 统一左边距 */
  .works-content .works-item.fade,
  .works-content .works-item.fade1,
  .works-content .works-item.fade2,
  .works-content .works-item.fade3,
  .works-content .works-item.fade4 {
    float: none;
    display: inline-block;
    vertical-align: top;
    margin: 0 10px 30px !important;
    width: 280px;
    left: 0;
  }
  
  .works-content .works-item.first {
    margin-left: 10px !important;
  }
  
  .works-content .works-item img {
    width: 100%;
    height: auto;
    max-height: 168px; /* 保持纵横比 */
    object-fit: cover;
  }
  
  .works-content .works-item .work-info {
    height: auto;
    min-height: auto; /* 移除最小高度限制，让内容自适应决定高度 */
  }
  
  /* 技能和联系区域调整 */
  .skill-content {
    width: 90%;
    margin: 0 auto;
  }
  
  .contact-content {
    width: 90%;
    margin: 0 auto;
  }
  
  .section-about .about-content .introli .right_content p.bio-text {
    max-width: 400px;
    font-size: 15px;
  }
  
  /* 平板设备文字图标样式 */
  .section-about .about-content .introli .left_icon div {
    width: 75px;
    height: 75px;
    font-size: 15px;
    margin-top: 8px;
  }
}

/* 手机设备 (<= 767px) */
@media screen and (max-width: 767px) {
  /* 缩小导航按钮 */
  .nav li a {
    padding: 20px 0;
    font-size: 18px;
  }
  
  .nav .back-home a {
    width: 60px;
    height: 60px;
    margin-left: -30px;
    top: 10px;
    -webkit-background-size: 60px 60px;
    background-size: 60px 60px;
  }
  
  /* About部分在手机端的位置调整 - 修正 */
  .section-about .about-content.section-content {
    margin-top: 120px !important; /* 负值使其向上移动 */
  }
  
  /* 移除之前的错误修改 */
  .section-wrap.section-about {
    padding-top: initial;
    position: relative;
  }
  
  .section-wrap.section-about .section {
    position: static;
    top: auto;
    transform: none;
    -webkit-transform: none;
    padding: initial;
  }
  
  /* About部分的span标签自适应处理 */
  .section-about .about-content .introli {
    margin-left: 0;
    text-align: center;
    padding: 10px 0;
  }
  
  .section-about .about-content .introli .left_icon,
  .section-about .about-content .introli .right_content {
    display: block;
    width: 100%;
    text-align: center;
    margin: 10px 0;
  }
  
  .section-about .about-content .introli .left_icon {
    display: block;
    width: 100%;
    margin-bottom: 10px;
  }
  
  /* 移动端不需要图片样式 */
  .section-about .about-content .introli .left_icon img {
    display: none; /* 图片已被文字替代，隐藏图片 */
  }
  
  .section-about .about-content .introli .right_content img {
    max-width: 280px;
    width: 90%;
    height: auto;
    margin: 0 auto !important;
    display: block;
  }

  /* 禁用parallax效果在移动设备上，提高性能 */
  .section-about .about-content .introli img[data-stellar-ratio] {
    -webkit-transform: none !important;
    transform: none !important;
  }
  
  /* 作品展示区域改为可垂直滚动 */
  .works-content {
    padding-top: 0;
    height: auto;
    overflow: visible; /* 确保内容可见 */
  }
  
  /* 调整垂直滚动容器 */
  .section-works .section {
    height: 100vh !important; /* 强制使用视窗高度 */
    overflow: hidden; /* 容器本身不滚动 */
    position: relative;
  }
  
  .works-content .works-list {
    width: 100%;
    display: flex;
    flex-direction: column; /* 垂直方向排列 */
    flex-wrap: nowrap;
    align-items: center; /* 水平居中 */
    justify-content: flex-start;
    height: 600px !important; /* 设置固定高度900px */
    max-height: 600px !important; /* 同时调整最大高度 */
    overflow-y: auto; /* 允许垂直滚动 */
    overflow-x: hidden; /* 禁止水平滚动 */
    -webkit-overflow-scrolling: touch; /* 在iOS设备上提供更好的滚动体验 */
    padding: 15px 0 40px; /* 增加底部内边距确保内容全部可见 */
    margin: 0;
    box-sizing: border-box; /* 确保内边距不会增加总高度 */
  }
  
  /* 确保works-content容器也有足够高度 */
  .works-content {
    height: 100%;
  }
  
  .works-content .section-content {
    height: 100%;
  }
  
  /* 重新调整作品项目布局为垂直滚动 */
  .works-content .works-item,
  .works-content .works-item.fade,
  .works-content .works-item.fade1,
  .works-content .works-item.fade2,
  .works-content .works-item.fade3,
  .works-content .works-item.fade4 {
    width: 300px; /* 固定宽度 */
    max-width: 90%; /* 确保不超过容器 */
    margin: 0 0 30px !important; /* 添加底部边距 */
    float: none;
    display: block;
    box-sizing: border-box; /* 确保盒模型计算包含内边距 */
    left: 0; /* 确保所有fade类的左边距一致 */
  }
  
  .works-content .works-item:last-child {
    margin-bottom: 40px !important; /* 增加最后一个元素底部间距，确保完全显示 */
  }
  
  /* 移除水平滚动提示样式 */
  .works-content::after {
    display: none;
  }
  
  /* 添加滚动提示指示器 */
  .works-content::before {
    content: '';
    display: block;
    width: 100%;
    height: 20px;
    position: absolute;
    left: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(39, 174, 96, 0), rgba(39, 174, 96, 0.3));
    pointer-events: none; /* 不拦截点击事件 */
    z-index: 1;
  }
  
  .works-content .works-item img {
    width: 100%;
    height: auto;
    max-height: none;
    display: block; /* 确保图片不会有额外间距 */
  }
  
  /* 调整作品信息区块样式 - 自适应文本内容高度 */
  .works-content .works-item .work-info {
    position: relative; /* 改为相对定位，不使用绝对定位 */
    background: rgba(0, 0, 0, 0.8);
    padding: 15px;
    top: auto;
    height: auto; /* 自适应高度 */
    min-height: auto; /* 移除最小高度限制 */
    max-height: none;
    width: 100%;
    box-sizing: border-box;
    display: block; /* 确保信息区块始终显示 */
    overflow: visible; /* 允许内容超出显示 */
  }
  
  .works-content .works-item:hover .work-info {
    top: auto;
  }
  
  .works-content .works-item:hover img {
    -webkit-transform: none;
    -moz-transform: none;
    -ms-transform: none;
    -o-transform: none;
    transform: none;
  }
  
  /* 联系区域改为单列布局 */
  .section-contact .contact-content .left,
  .section-contact .contact-content .right {
    width: 100%;
    float: none;
  }
  
  .section-contact .contact-content .right {
    margin-top: 30px;
  }
  
  /* 首页内容调整 */
  .section-fristpage {
    font-size: 24px;
  }
  
  /* 个人介绍部分调整 */
  .section-about .about-content .introli {
    margin-left: 0;
  }
  
  .section-about .about-content .introli .left_icon .bio-icon-1,
  .section-about .about-content .introli .left_icon .bio-icon-2,
  .section-about .about-content .introli .left_icon .bio-icon-3 {
    margin-left: 0 !important;
  }
  
  .section-about .about-content .introli .right_content .bio-text-1,
  .section-about .about-content .introli .right_content .bio-text-2,
  .section-about .about-content .introli .right_content .bio-text-3 {
    margin-left: 0;
    max-width: 100%;
    height: auto;
  }
  
  /* 按钮及滚动提示调整 */
  .button2 {
    transform: scale(0.7);
    -webkit-transform: scale(0.7);
  }
  
  .section-about .about-content .introli .right_content p.bio-text {
    max-width: 280px;
    width: 90%;
    font-size: 14px;
    margin: 0 auto !important;
    text-align: center;
    padding: 8px 12px;
  }
  
  /* 移动端文字图标样式 */
  .section-about .about-content .introli .left_icon div {
    width: 70px;
    height: 70px;
    font-size: 14px;
    margin: 5px auto;
  }
  
  .section-about .about-content .introli {
    margin-left: 0;
    text-align: center;
  }
}

/* 小型手机设备 (<= 479px) */
@media screen and (max-width: 479px) {
  .nav li a {
    padding: 15px 0;
    font-size: 16px;
  }
  
  .nav .back-home a {
    width: 50px;
    height: 50px;
    margin-left: -25px;
    top: 5px;
    -webkit-background-size: 50px 50px;
    background-size: 50px 50px;
  }
  
  .section h1 {
    font-size: 28px;
    margin-bottom: 20px;
  }
  
  .section-fristpage {
    font-size: 20px;
  }
  
  .skill-content li {
    font-size: 16px;
    line-height: 1.8;
  }
  
  /* 超小屏幕上进一步调整about部分 */
  .section-about .about-content .introli .left_icon img {
    width: 50px;
  }
  
  .section-about .about-content .introli .right_content img {
    max-width: 220px;
  }
  
  /* works区域在超小屏幕上的额外调整 */
  .works-content .works-item {
    margin-bottom: 25px !important;
    width: 260px;
    max-width: 85%;
  }
  
  .works-content .works-item .work-info {
    min-height: auto; /* 确保超小屏幕上也自适应文本内容高度 */
    height: auto;
  }
  
  .works-content .works-item .work-info h2 {
    font-size: 18px;
    margin-bottom: 10px;
  }
  
  .works-content .works-item .work-info p {
    font-size: 12px;
  }
  
  .section-about .about-content .introli .right_content p.bio-text {
    max-width: 220px;
    font-size: 13px;
    padding: 5px 10px;
  }
  
  /* 超小屏幕文字图标样式 */
  .section-about .about-content .introli .left_icon div {
    width: 60px;
    height: 60px;
    font-size: 12px;
  }
}

/* 模态框样式 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease-in-out;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  width: 90%;
  max-width: 600px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s ease-in-out;
}

.modal-overlay.active .modal-container {
  transform: scale(1);
}

.modal-header {
  padding: 20px;
  background: linear-gradient(135deg, #27ae60, #16a085);
  color: white;
  position: relative;
}

.modal-header h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
}

.modal-close {
  position: absolute;
  right: 15px;
  top: 15px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.2);
  transition: all 0.2s;
}

.modal-close:hover {
  background-color: rgba(255, 255, 255, 0.4);
}

.modal-close:before, .modal-close:after {
  content: '';
  position: absolute;
  width: 15px;
  height: 2px;
  background-color: white;
}

.modal-close:before {
  transform: rotate(45deg);
}

.modal-close:after {
  transform: rotate(-45deg);
}

.modal-body {
  padding: 25px;
  line-height: 1.6;
  color: #444;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-body p {
  margin: 0 0 15px;
}

.modal-body p:last-child {
  margin-bottom: 0;
}

.modal-footer {
  padding: 15px 20px;
  border-top: 1px solid #e0e0e0;
  text-align: right;
}

.modal-btn {
  display: inline-block;
  padding: 8px 16px;
  margin-left: 10px;
  background-color: #27ae60;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.modal-btn:hover {
  background-color: #219955;
}

.modal-btn.secondary {
  background-color: #e0e0e0;
  color: #444;
}

.modal-btn.secondary:hover {
  background-color: #d0d0d0;
}

/* 模态框在移动设备上的响应式调整 */
@media screen and (max-width: 767px) {
  .modal-container {
    width: 95%;
    max-width: 400px;
  }
  
  .modal-header h3 {
    font-size: 20px;
  }
  
  .modal-body {
    padding: 15px;
    font-size: 14px;
  }
}

/* 添加works-item的鼠标悬停效果 */
.works-item {
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.works-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.works-item:active {
  transform: translateY(0);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

/* 添加一些视觉提示，表明item可点击 */
.works-item:after {
  content: '点击查看详情';
  position: absolute;
  bottom: 10px;
  right: 10px;
  background-color: rgba(39, 174, 96, 0.8);
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.works-item:hover:after {
  opacity: 1;
}

@media screen and (max-width: 767px) {
  .works-item:after {
    bottom: auto;
    top: 10px;
    right: 10px;
  }
}

/* 添加简历下载按钮样式 */
.resume-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 25px;
  background: linear-gradient(135deg, #27ae60, #16a085);
  color: white;
  border-radius: 50px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  margin-top: 20px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
  position: relative;
  overflow: hidden;
}

.resume-download-btn:hover {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
  transform: translateY(-2px);
}

.resume-download-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(39, 174, 96, 0.3);
}

.resume-download-btn:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.resume-download-btn:hover:before {
  transform: translateX(100%);
}

.resume-icon {
  width: 20px;
  height: 20px;
  margin-right: 10px;
  vertical-align: middle;
  filter: brightness(0) invert(1); /* 将图标变为白色 */
  transition: transform 0.3s ease;
}

/* 响应式调整 */
@media screen and (max-width: 767px) {
  .resume-download-btn {
    padding: 10px 20px;
    font-size: 14px;
    width: 80%;
    margin: 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
  
  /* 图标与文本水平对齐 */
  .resume-download-btn .resume-icon {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    vertical-align: middle;
    position: relative;
    top: -1px; /* 微调位置实现更精确的对齐 */
  }
  
  .resume-download-btn span {
    display: inline-block;
    vertical-align: middle;
    line-height: 1.2;
    position: relative;
    top: 0;
  }
  
  /* 确保在手机端右侧栏中按钮容器居中显示 */
  .section-contact .contact-content .right {
    text-align: center;
  }
}

.resume-download-btn.clicked {
  animation: pulse 0.3s ease-out;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
  }
}

/* PDF查看提示样式 */
.pdf-viewer-tip {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(39, 174, 96, 0.9);
  color: white;
  padding: 12px 20px;
  border-radius: 50px;
  font-size: 14px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  max-width: 90%;
  text-align: center;
  animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.pdf-viewer-tip.active {
  display: block;
}

/* 文字替换图片的样式 */
.section-about .about-content .introli .right_content p.bio-text {
  color: #333;
  font-size: 16px;
  line-height: 1.6;
  padding: 10px 15px;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  max-width: 500px;
  opacity: 0;
  margin: 0;
  text-align: left;
} 