
.gallery_main{
  background-color: #000;
  padding: 50px 0px;
}

.gallery {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    column-gap: 24px;
    row-gap: 24px;
  }

.gallery_bd {
    display: grid;
}

  .btn_bd {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr ;
    max-width: 1200px;
    justify-self: center;
    column-gap: 24px;
    padding: 30px 0px;
  }

  .btn_bd button {
    display: inline-block;
    padding: 10px 20px;
    position: relative;
    border: none;
    background-color: transparent;
    color: #fff;
    font-size: 19px;
    font-weight: 300;
    cursor: pointer;
    border-bottom: 2px solid transparent; /* 初始状态下透明边框 */
    justify-self: center;
    text-align: center;
  }

  .btn_bd button::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: transparent;
    animation-name: border-animation;
    animation-duration: 0.5s;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
    display: block;
    transition: all 0.5s;
  }
  

  .btn_bd button:hover::after {
    animation-name: border-animation;
    animation-duration: 0.5s;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
    background-color: black;
  }

  .gallery-img {
    width: 100%;
    transition: opacity 0.3s, transform 0.3s;
    overflow: hidden;
    position: relative;
  }

  .gallery-img img {
    height: 100%;
    width: 100%;
    filter: brightness(50%);
    transition: all 0.3s;
  }

  .gallery-img img:hover {
    scale: 1.1;
    filter: brightness(100%);
  }

  .gallery-img img:hover + p {
    opacity: 1;
  }

  .gallery-img a p:hover {
    opacity: 1;
  }


  .gallery-img p {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 10px 20px;
    width: 100%;
    font-size: 18px;
    font-weight: 700;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    text-align: center;
    line-height: 30px;
    opacity: 0;
  }

  .hidden {
    display: none;
    visibility: hidden;
  }
  

  @keyframes border-animation {
    0% {
      width: 0;
      left: 0;
      opacity: 0;
    }
    100% {
      width: 100%;
      left: 0;
      opacity: 1;
    }
  }

  @media (max-width: 991px) {

    .gallery {
      display: grid;
      grid-template-columns: 1fr 1fr;
      column-gap: 24px;
      row-gap: 24px;
    }
  }

  @media (max-width: 576px) {

    .gallery_main .w {
      width: 100%;
    }

    .btn_bd {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr 1fr ;
      max-width: 1200px;
      justify-self: center;
      column-gap: 0px;
      padding: 30px 0px;
    }
  

    .btn_bd button {
      display: inline-block;
      padding: 10px 20px;
      position: relative;
      border: none;
      background-color: transparent;
      color: #fff;
      font-size: 16px;
      font-weight: 300;
      cursor: pointer;
      border-bottom: 2px solid transparent; /* 初始状态下透明边框 */
      justify-self: center;
      text-align: center;
      line-height: 25px;
    }

    .gallery {
      display: grid;
      grid-template-columns: 1fr;
      column-gap: 24px;
      row-gap: 24px;
    }

    .gallery-img img {
      height: 100%;
      width: 100%;
      filter: brightness(100%);
      transition: all 0.3s;
    }
  }