/* 大图 */
.Quality-banner{
  width: 100%;
  overflow: hidden;
}
/* 使图片均匀填充容器 */
.Quality-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 使用 cover 使图片均匀填充容器 */
}

/* 通用图片方向修正 - 解决移动端图片旋转问题 */
img {
  image-orientation: from-image;
  transform: none !important;
}

/* 专门针对iOS设备的图片方向修正 */
@supports (-webkit-appearance: none) {
  .rd-main-image {
    /* iOS Safari 专用修复 */
    -webkit-transform: none !important;
    transform: none !important;
    /* 强制图片按原始方向显示 */
    image-orientation: from-image;
    /* 防止iOS Safari自动旋转 */
    -webkit-image-orientation: from-image;
  }
}

/* 针对Safari浏览器的特殊处理 */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  .rd-main-image {
    /* Safari专用属性 */
    -webkit-transform: none !important;
    transform: none !important;
    /* 确保图片不被旋转 */
    image-orientation: from-image;
  }
}

/* 专门针对iOS设备的强力修复 */
@media screen and (max-width: 768px) {
  .rd-main-image {
    /* 移除所有可能的变换 */
    -webkit-transform: none !important;
    -moz-transform: none !important;
    -ms-transform: none !important;
    -o-transform: none !important;
    transform: none !important;
    
    /* 强制图片方向 */
    image-orientation: from-image;
    -webkit-image-orientation: from-image;
    
    /* 确保图片不被CSS影响 */
    float: none !important;
    position: static !important;
    
    /* 重置所有可能的旋转 */
    transform-origin: center center !important;
    -webkit-transform-origin: center center !important;
  }
}

/* 针对iPhone的专门修复 */
@media screen and (max-width: 414px) {
  .rd-main-image {
    /* iPhone专用修复 */
    -webkit-transform: rotate(0deg) !important;
    transform: rotate(0deg) !important;
    image-orientation: from-image;
    -webkit-image-orientation: from-image;
  }
}

.footer {
  padding: 57px 95px 20px !important;
}
/* 按钮 */
.Quality-container {
  width: 100%;
  padding: 0;
}

.button-container {
  display: flex;
  box-sizing: border-box;
  /* border: 1px solid rgb(0, 0, 0); */
}

.button-container button{
  font-size: 1.7rem;
  letter-spacing: 2px;
}
.toggle-button {
  flex: 1; /* 按钮均分父容器的空间 */
  padding: 20px 0; /* 增加按钮的上下内边距 */
  background-color: #fff;
  border: 1px solid rgb(0, 0, 0);
  outline: none; /* 去除按钮点击时的轮廓线 */
  font-size: 1rem; /* 按钮字体大小调整 */
  cursor: pointer; /* 提示是可点击的区域 */
  transition: background-color 0.3s; /* 背景颜色过渡效果 */
}

.left-button {
  background-color: white; /* 初始为白色背景 */
  color: black; /* 初始为黑色字体 */
}

.right-button {
  background-color: white; /* 初始为白色背景 */
  color: black; /* 初始为黑色字体 */
}

.toggle-button.active {
  background-color:#479E83;/* 绿色背景 */
  color: white; /* 白色字体 */
  border: none;
}
.toggle-button:hover{
  background-color: #000;
  color: #fff;
}
button:focus {
  outline: none;
}

/* 媒体查询，用于确保在不同设备上的自适应布局 */
/* 确保在所有设备上，按钮都保持一行两列布局 */
@media (max-width: 768px) {
  .toggle-button {
      font-size: 0.9rem; /* 调整按钮字体大小以适应中等屏幕 */
      padding: 15px 0;  /* 调整填充以适应中等屏幕 */
  }
  .button-container button{
    font-size: 12.8px;
    letter-spacing: 0px;
  }
}

@media (max-width: 480px) {
  .button-container {
      display: flex;
      flex-wrap: nowrap; /* 确保在小屏幕设备上按钮保持在一行 */
  }

  .toggle-button {
      flex: 1 0 50%; /* 确保按钮在小屏幕上占据50%宽度 */
      font-size: 0.8rem; /* 调整按钮字体大小以适应小屏幕 */
      padding: 10px 0;  /* 调整填充以适应小屏幕 */
  }
}

/* 内容 */
.rd-container {
  display: flex;
  flex-wrap: wrap;
  /* padding: 20px 20px 0px 0px; */
  align-items: flex-end; /* 对齐底部 */
}

/* 左侧大标题和主图 */
.rd-left-section {
  flex: 1.2;
  min-width: 300px;
  /* margin-right: 20px; */
  text-align: right; /* 标题右对齐 */
}

.rd-title {
  font-size: 3rem;

  color: rgb(238, 238, 238);
  font-family: Montserrat;
  text-align: left;
  margin-bottom: 20px;
}



/* 右侧 文本内容和小图 */
.rd-right-section {
  flex: 1;
  min-width: 300px;
  position: relative;
  margin-top: 30px;
  margin-right: 116px;
}
.rd-right-topBod{
  /* margin-bottom: 10px; */
  width: 24%;
  margin-right: 23px;
  border-top: 5px solid black;
  float: right;
}
.rd-right-section::after {
  content: '';
  display: block;
  width: 72px;
  border-top: 5px solid black;
  position: absolute;
  right: 10%;
  top: 0%;
  transform: translateY(-50%);
}

.rd-subtitle {
  font-size: 2.9em;
  line-height: 1.2;
  font-weight: bold;
  margin: 20px 0px;
  clear: both;
  /* position: relative; */
  color: rgb(0, 0, 0);
  letter-spacing: 4px;
}
.rd-text {
  margin-bottom: 20px;
  line-height: 1.5;
  color: rgb(0, 0, 0);
  font-family: Montserrat;
  font-size: 2rem;
}

/* 额外的小图 */
.rd-additional-images {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start; /* 将图片对齐在顶部 */
}

.rd-small-image {
  flex: 1;
  min-width: calc(50% - 10px); /* 每行显示两个图片 */
  height: auto;
}

/* 基础样式，不适用于特定设备 */
.rd-container {
  display: flex;
  flex-wrap: wrap;
  /* padding: 20px; */
  align-items: flex-end; /* 对齐底部 */
}

.rd-left-section {
  flex: 1.2;
  min-width: 300px;
  /* margin-right: 20px; */
  text-align: right; /* 标题右对齐 */
}

/* 标题部分 */
.rd-title {
  font-size: 4rem;
  color: rgb(238, 238, 238);
  letter-spacing: 6px;
  font-family: Montserrat;
  text-align: left;
  margin-bottom: 20px;
  font-weight: 600;
}

.rd-main-image {
  height: auto;
  float:right;
  width: 90%;

}

/* 右侧内容部分 */
.rd-right-section {
  flex: 1;
  min-width: 300px;
  position: relative;
  margin-top: 30px;
}

.rd-right-section::after {
  content: '';
  display: block;
  width: 200px;
  border-top: 5px solid black;
  position: absolute;
  right: 0%;
  top: -3%;
  transform: translateY(-50%);
}

.rd-subtitle {
  line-height: 1.2;
  font-weight: bold;
  margin: 0px 0px 20px;
  color: rgb(0, 0, 0);
}

.rd-text {
  margin-bottom: 20px;
  line-height: 1.5;
  color: rgb(0, 0, 0);
  font-family: Montserrat;
  font-size: 1.5rem;
}

/* 额外小图 */
.rd-additional-images {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start; /* 将图片对齐在顶部 */
}

.rd-small-image {
  flex: 1;
  min-width: calc(50% - 10px); /* 每行显示两个图片 */
  height: auto;
}

/* 平板设备和较小屏幕 */
@media (min-width: 1920px) {
  .rd-right-section {
    flex: 1.6;
    margin-top: 50px;
    margin-right: 117px;
}
.rd-left-section {
  flex: 1.5;
}
}

@media (min-width: 1500px) {
  .rd-main-image {
    height: 950px;
  }
}
@media (max-width: 1024px) {
  .rd-title {
      font-size: 2rem;
      text-align: left;
      margin-bottom: 10px;
  }

  .rd-main-image {
    min-width: 100%;
      margin-left: 0;
  }

  .rd-left-section {
      text-align: left;
      margin-right: 0;

  }

  .rd-right-section {
      margin-top: 20px;
      flex: auto;
      padding: 10px;
      margin-right: 0px;
  }

  .rd-right-section::after {
    content: '';
    display: block;
    width: 200px;
    border-top: 5px solid black;
    position: absolute;
    right: 0%;
    top: 0%;
    transform: translateY(-50%);
  }

 

  .rd-additional-images {
      gap: 8px;
  }
}

/* 手机端 */
@media (max-width: 768px) {
  .rd-container {
      align-items: flex-start; /* 顶部对齐 */
      flex-direction: column;
  }

  .rd-left-section {
      text-align: center;
      width: 100%;
      margin-right: 0;
  }
  #knit-lab > div > div:nth-child(1){
    flex-grow: unset !important;
  }
  .rd-title {
      font-size: 1.5rem;
      margin-bottom: 10px;
  }

  .rd-main-image {
      max-width: 100%;
      margin-left: 0;
      /* 移动端图片方向修正 */
      image-orientation: from-image;
      transform: none !important;
      /* 确保图片在移动端正确显示 */
      float: none;
      display: block;
      margin: 0 auto;
      /* iOS Safari 专用修复 */
      -webkit-transform: none !important;
      -webkit-image-orientation: from-image;
      /* 移除所有可能的变换 */
      -moz-transform: none !important;
      -ms-transform: none !important;
      -o-transform: none !important;
      /* 确保图片不被CSS影响 */
      position: static !important;
      /* 重置所有可能的旋转 */
      transform-origin: center center !important;
      -webkit-transform-origin: center center !important;
  }

  .rd-right-section {
      width: 100%;
      margin-top: 20px;
      padding: 0px;
  }

  .rd-right-section::after {
    width: 200px;
    border-top: 3px solid black;
    right: 0px;
    top: 0;
    transform: translateY(-50%);
  }



  .rd-text {
      font-size: 0.8rem;
  }

  .rd-additional-images {
      justify-content: center;
  }

  .rd-small-image {
      min-width: 100%;
  }
  .description-section h1{
    margin: 0px 0px 40px;
  }
  .description-section::after{
    top: 0% !important;
  }
}

/* 另一个按钮 */
.lab-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.lab-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lab-left-large-image {
  flex: 2;
}

.lab-left-small-images {
  flex: 1;
  display: flex;
  gap: 10px;
}

.lab-small-image {
  flex: 1;
  height: auto;
  width: 100%;
}

.lab-large-image, .lab-bottom-image {
  width: 100%;
  height: auto;
}

.lab-right {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.lab-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 20px;
  position: relative;
}

.lab-title::after {
  content: '';
  display: block;
  width: 50px;
  border-top: 5px solid black;
  margin-top: 10px;
  left: 0;
  top: 100%;
}

.lab-description {
  margin-bottom: 20px;
  font-size: 1rem;
}

.lab-bottom-image {
  margin-top: auto;
}

/* 平板设备和小屏幕样式 */
@media (max-width: 1024px) {
  .lab-container {
      flex-direction: column;
      padding: 20px;
      margin: 20px 0px;
  }
 .forEach1{
  margin: 0px 0px !important;
  padding: 0px 20px !important;
 }
  .lab-left {
      order: 2;
  }

  .lab-right {
      order: 1;
  }
}

/* 手机设备样式 */
@media (max-width: 768px) {
  .lab-left-large-image {
      flex: none;
      width: 100%;
  }

  .lab-left-small-images {
      flex-direction: column;
  }

  .lab-small-image {
      width: 100%;
      margin-bottom: 10px;
  }

  .lab-bottom-image {
      width: 100%;
  }

  .lab-title {
      font-size: 1.2rem;
  }

  .lab-description {
      font-size: 0.9rem;
  }
}

/* 另一个按钮 */
.main-container {
  margin: 0 auto;
  font-family: Arial, sans-serif;
  color: #333333;
  line-height: 1.6;
  padding: 50px 117px;
  display: flex;
  gap: 20px; /* 增加左右列之间的间距 */
  align-items: flex-end;
}

.description-section, .photos-section {
  flex: 1;
}

.description-section {
  position: relative;
}

.description-section::after {
  content: '';
  display: block;
  width: 24%;
  border-top: 5px solid black;
  position: absolute;
  left: 0;
  top: -3%;
  transform: translateY(-50%);
}

.description-section h1 {
  font-size: 2.9rem;
  line-height: 1.2;
  font-weight: bold;
  margin: 50px 0px 40px;
  color: rgb(0, 0, 0);
  letter-spacing: 2px;
}

.description-section p {
  margin: 20px 0;
  padding: 0px !important;
  color: rgb(0, 0, 0);
  font-family: Montserrat;
  font-size: 1.5rem;
}

.photos-section p {
  padding: 0px !important;
  color: rgb(0, 0, 0);
  font-family: Montserrat;
  font-size: 1.5rem;
  margin-top: 25px;
}

.photo-large {
  display: flex;
  gap: 10px;
  justify-content: space-around;
}

.photo-large img {
  width: 48%; /* 调整宽度以更好适应比列 */
  height: auto; /* 保持图片比例 */
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 设置两列布局 */
  gap: 30px;
}

.photo-grid img:first-child {
  grid-column: span 2; /* 独占第一行 */
  width: 100%;
}

.photo-grid img:nth-child(2),
.photo-grid img:nth-child(3) {
  width: 100%;
  height: 278px;
}
@media (min-width: 1921px) {
 .col {
  /* flex-grow:1 !important; */
  padding-top: 40px;
 }
}

/* 自适应布局 */
@media (max-width: 1024px) {
  .main-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 0px;
  }

  .description-section{
    max-width: 100%;
    flex: none;
    margin: 40px 0px 10px;
  }

  .photo-large {
    flex-direction: column;
  }

  .photo-large img {
    width: 100%;
    margin: 5px 0; /* 增加垂直间距 */
  }

  .photo-grid {
    grid-template-columns: 1fr;
  }

  .photo-grid img:nth-child(2),
  .photo-grid img:nth-child(3) {
    width: 100%;
    height: 278px;
  }
    .description-section::after {
        top: -1% !important;
}
}

@media (max-width: 1280px) {
  .description-section h1 {
    font-size: 1.5rem;
  }

  .description-section p, .photos-section p {
    font-size: 0.9rem;
  }

  .photo-grid img:first-child {
    height: auto;
  }
  .rd-subtitle{
    font-size: 1.4em;
  }
  .rd-right-topBod{
    border-top: 5px solid black;
    margin: 20px 0px 0px; 
  }
  .description-section::after{
    border-top: 5px solid black;
    width: 15%;
  }
  .col{
    margin-right: 0px !important;
    padding: 20px;
  }
  .photos-section {
    padding: 0px 10px;
}
  .container-fluid{
    margin: 0px !important;
  }
  .fluid1 {
    align-items: stretch !important;
    flex-direction: column;
}
.row {
  align-items: flex-end;
  flex-direction: column;
}
}

@media (max-width: 480px) {
  .main-container {
    padding: 0px;
  }
  .col{
    margin-right: 0px !important;
  }
  .description-section h1 {
    font-size: 1.2rem;
    margin: 0px 0px 40px;
  }

  .description-section p, .photos-section p {
    font-size: 0.8rem;
  }

  .photo-large img {
    width: 100%;
  }

  .photo-grid img:first-child {
    height: auto;
  }
  
  /* 小屏幕设备的图片方向修正 */
  .rd-main-image {
    image-orientation: from-image;
    transform: none !important;
    float: none;
    display: block;
    margin: 0 auto;
    width: 100%;
  }
}
@media (max-width: 450px) {
  .description-section::after {
    top: -1.5% !important;
}
.photo-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
}

.row{
  align-items: flex-end;
}
.fluid1{
  align-items: stretch !important;
}


@media (max-width: 1680px){
  .rd-subtitle{
    font-size: 2.4rem;
  }
  .description-section h1{
    font-size: 2.4rem;
  }
}

@media (max-width: 1600px){
  .rd-subtitle{
    font-size: 2.2rem;
  }
  .description-section h1{
    font-size: 2.2rem;
  }
  .description-section p{
    font-size: 1.6rem;
  }
}