/**
 * 首页「我们做过的 · CASES」案例区
 */
body.page-home .yksite-home-cases {
  padding-bottom: 50px;
  background: #fff;
}

body.page-home .yksite-home-cases__nav.index_center {
  padding-left: 16px;
  padding-right: 16px;
}

body.page-home .yksite-home-cases__nav .ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  max-width: 100%;
}

body.page-home .yksite-home-cases__nav .Case_nav {
  float: none !important;
  flex: 1 1 0;
  min-width: 130px;
  max-width: 190px;
  margin: 0 !important;
  padding: 0 10px;
  line-height: 46px;
  height: 46px;
  font-size: 15px;
  border-radius: 6px;
  border: 1px solid #ececec;
  background: #fafafa;
  color: #333;
  opacity: 1;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease,
    box-shadow 0.22s ease;
}

body.page-home .yksite-home-cases__nav .Case_nav:hover,
body.page-home .yksite-home-cases__nav .Case_nav.is-active {
  background: #e62022;
  border-color: #e62022;
  color: #fff;
  box-shadow: 0 6px 16px rgba(230, 32, 34, 0.25);
}

body.page-home .yksite-home-cases__grid.qpDiv {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, auto);
  gap: 18px;
  padding: 0 16px 8px;
  text-align: center;
  overflow: hidden;
}

/* 仅展示 7 个案例 + 1 个「更多案例」（共 2 行 × 4 列） */
body.page-home .yksite-home-cases__grid > li:nth-child(n + 8):not(.yksite-case-more) {
  display: none !important;
}

body.page-home .yksite-home-cases__grid > li {
  float: none !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #ececec;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}

body.page-home .yksite-home-cases__grid > li:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

body.page-home .yksite-home-cases__grid > li > a {
  display: block;
  position: relative;
  aspect-ratio: 4 / 3;
  width: 100%;
  height: 100%;
}

body.page-home .yksite-home-cases__grid > li img {
  float: none !important;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  vertical-align: top;
}

body.page-home .yksite-home-cases__grid > li img[src*="nopic"] {
  object-fit: contain;
  padding: 28px 20px;
  box-sizing: border-box;
  background: linear-gradient(160deg, #f7f7f7 0%, #ebebeb 100%);
  opacity: 0.92;
}

body.page-home .yksite-home-cases__grid .qpzhe {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

body.page-home .yksite-home-cases__grid .qpzhe h3 {
  font-size: 22px;
  margin-top: 0;
  line-height: 1.35;
  font-weight: 600;
}

body.page-home .yksite-home-cases__grid .qpzhe p {
  font-size: 14px;
  line-height: 1.5;
  margin-top: 8px;
  max-height: 3em;
  overflow: hidden;
}

body.page-home .yksite-home-cases__grid .qpzhe p:empty {
  display: none;
}

body.page-home .yksite-home-cases__grid > li.yksite-case-more {
  background: #2a2a2a;
}

body.page-home .yksite-home-cases__grid > li.yksite-case-more img {
  object-fit: cover;
  opacity: 0.55;
}

body.page-home .yksite-home-cases__grid > li.yksite-case-more .qpzhe {
  transform: scale(1);
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.15) 0%,
    rgba(0, 0, 0, 0.72) 100%
  );
}

body.page-home .yksite-home-cases__grid > li.yksite-case-more:hover .qpzhe {
  transform: scale(1);
}

@media screen and (min-width: 992px) {
  body.page-home .yksite-home-cases__grid.qpDiv {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, auto);
  }
}

@media screen and (max-width: 991px) {
  body.page-home .yksite-home-cases__grid.qpDiv {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, auto);
    gap: 12px;
  }

  body.page-home .yksite-home-cases__grid > li {
    width: auto !important;
  }

  body.page-home .yksite-home-cases__nav .Case_nav {
    flex: 1 1 calc(50% - 10px);
    max-width: none;
    min-width: 0;
    font-size: 14px;
  }
}

@media screen and (max-width: 575px) {
  body.page-home .yksite-home-cases__grid.qpDiv {
    grid-template-columns: 1fr;
  }

  body.page-home .yksite-home-cases__nav .Case_nav {
    flex: 1 1 100%;
  }
}
