.case {
  -webkit-column-count: 5;
  -moz-column-count: 5;
  column-count: 5;
  -webkit-column-gap: 15px;
  -moz-column-gap: 15px;
  column-gap: 15px;
  padding: 120px calc(5vw + 40px);
}

/* 第一行固定高度 */
.case_list:nth-child(-n+5) {
  height: 200px;
}

.case_list img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media screen and (max-width: 768px) {
  .case {
    -webkit-column-count: 2;
    -moz-column-count: 2;
    column-count: 2;
    padding:30px 20px;
    margin-top: 60px;
  }
  
  .case_list:nth-child(-n+2) {
    height: 150px;
  }
  .modal-content {
    max-height: 70% !important;
}
}

/* 图片加载完成后恢复自动高度 */
.case.loaded .case_list {
  height: auto;
}

.case_list a img:hover{
    transition: transform 0.5s ease;  /* 1秒过渡时间 */
    transform: scale(1.1);
}
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    cursor: pointer;
}
.modal-content {
    max-width: 90%;
    max-height: 80%;
    margin: auto;
    display: block;
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.prev, .next {
    position: absolute;
    top: 45%;
    transform: translateY(-50%);
    color: white;
    font-size: 24px;
    padding: 16px;
    cursor: pointer;
    user-select: none;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.prev {
    left: 20px;
}
.next {
    right: 20px;
}
.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}
.thumbnail-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    max-width: 90%;
    overflow-x: auto;
}
.thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 5px;
    transition: all 0.3s ease;
}
.thumbnail.active {
    border-color: #fff;
}
.thumbnail:hover {
    transform: scale(1.1);
}
