/* ==========================================================================
   案例列表页 —— 作用域：body.page-cases
   共用部分（导航 / 页脚 / 弹窗 / 底部渐变）见 cases-shared.css
   ========================================================================== */

/* ---------- 标题 + 分类 ---------- */
body.page-cases .cases-main {
  position: relative;
}

body.page-cases .cases-head {
  padding: calc(var(--header-height, 80px) + 64px) 0 0;
  text-align: center;
}

body.page-cases .cases-title {
  font-size: clamp(1.9rem, 3.2vw, 2.7rem);
  font-weight: 900;
  letter-spacing: -0.01em;
  color: #14141a;
  margin: 0 0 34px;
}

body.page-cases .cases-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 56px;
}

body.page-cases .cases-tab {
  padding: 11px 30px;
  font-size: 0.9375rem;
  font-weight: 500;
  font-family: inherit;
  color: #6b6b76;
  background: #fff;
  border: 1px solid rgba(16, 16, 22, 0.1);
  border-radius: 100px;
  cursor: pointer;
  transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease,
    box-shadow 0.25s ease, transform 0.25s ease;
}

body.page-cases .cases-tab:hover {
  color: #14141a;
  border-color: rgba(232, 56, 47, 0.32);
  transform: translateY(-2px);
}

body.page-cases .cases-tab.active {
  color: #fff;
  background: var(--accent);
  border-color: transparent;
  box-shadow: 0 10px 26px rgba(232, 56, 47, 0.34);
}

/* ---------- 网格：两列，卡片 560 × 618 ---------- */
body.page-cases .cases-body {
  position: relative;
  padding: 0 0 10px;
}

body.page-cases .cases-grid {
  display: grid;
  grid-template-columns: repeat(2, 560px);
  justify-content: center;
  gap: 64px 52px;
  align-items: start;
}

body.page-cases .cases-item {
  display: block;
  width: 560px;
  text-decoration: none;
  color: inherit;
}

/* 卡片：圆角大图容器 */
body.page-cases .cases-thumb {
  position: relative;
  width: 560px;
  height: 618px;
  aspect-ratio: 251 / 277;
  border-radius: 26px;
  overflow: hidden;
  background: #f2f2f4;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.4s ease;
}

body.page-cases .cases-item:hover .cases-thumb {
  box-shadow: 0 26px 60px rgba(16, 16, 22, 0.18);
}

/* 实拍图铺满 */
body.page-cases .cases-thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

body.page-cases .cases-item:hover .cases-thumb-img {
  transform: scale(1.04);
}

/* 无图兜底：柔和渐变 + 首字母 */
body.page-cases .cases-thumb.is-fallback {
  background: linear-gradient(135deg, #f4f4f7 0%, #e9e9ee 100%);
}

body.page-cases .cases-thumb.is-fallback::after {
  content: attr(data-initial);
  font-size: 3.4rem;
  font-weight: 900;
  color: rgba(16, 16, 22, 0.12);
  letter-spacing: 0.04em;
}

/* 每张卡的强调色（按序号轮转，参考图里卡片底色各不相同） */
body.page-cases .cases-item:nth-child(6n + 1) .cases-thumb.is-fallback { background: linear-gradient(140deg, #2a2a2e 0%, #101013 100%); }
body.page-cases .cases-item:nth-child(6n + 2) .cases-thumb.is-fallback { background: linear-gradient(140deg, #d9b98a 0%, #c39a5f 100%); }
body.page-cases .cases-item:nth-child(6n + 3) .cases-thumb.is-fallback { background: linear-gradient(140deg, #cfd8f5 0%, #b9a6e8 100%); }
body.page-cases .cases-item:nth-child(6n + 4) .cases-thumb.is-fallback { background: linear-gradient(140deg, #4a7bab 0%, #c99a5c 100%); }
body.page-cases .cases-item:nth-child(6n + 5) .cases-thumb.is-fallback { background: linear-gradient(140deg, #cfcfcf 0%, #9f9f9f 100%); }
body.page-cases .cases-item:nth-child(6n + 6) .cases-thumb.is-fallback { background: linear-gradient(140deg, #b6f14a 0%, #8fd41f 100%); }

/* 左上角标签（始终显示，位于蒙版之上） */
body.page-cases .cases-badges {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: calc(100% - 36px);
}

body.page-cases .cases-badge {
  padding: 7px 16px;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  color: #fff;
  background: rgba(20, 20, 26, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 100px;
  backdrop-filter: blur(10px);
  white-space: nowrap;
}

/* 浅色图上的标签改用浅色胶囊 + 深色字，避免看不清 */
body.page-cases .cases-thumb.is-light .cases-badge {
  color: #2b2b33;
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(16, 16, 22, 0.1);
}

/* 悬停蒙版 + 居中“查看”按钮 */
body.page-cases .cases-thumb-mask {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 12, 16, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

body.page-cases .cases-item:hover .cases-thumb-mask {
  opacity: 1;
  visibility: visible;
}

body.page-cases .cases-view-btn {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: 0 12px 32px rgba(232, 56, 47, 0.5);
  transform: scale(0.86);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

body.page-cases .cases-item:hover .cases-view-btn {
  transform: scale(1);
}

/* 卡片标题（图下方居中） */
body.page-cases .cases-name {
  margin: 24px 0 0;
  font-size: 1.125rem;
  font-weight: 600;
  text-align: center;
  color: #14141a;
  transition: color 0.25s ease;
}

body.page-cases .cases-item:hover .cases-name {
  color: var(--accent);
}

/* 隐藏（筛选用） */
body.page-cases .cases-item.is-hidden {
  display: none;
}

/* ---------- 加载 / 空状态 ---------- */
body.page-cases .cases-loading {
  grid-column: 1 / -1;
  padding: 90px 0;
  text-align: center;
  color: #a0a0aa;
}

body.page-cases .cases-loading-spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 16px;
  border: 3px solid rgba(16, 16, 22, 0.08);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: cv-spin 0.8s linear infinite;
}

@keyframes cv-spin {
  to { transform: rotate(360deg); }
}

body.page-cases .cases-empty {
  padding: 80px 0;
  text-align: center;
  color: #a0a0aa;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1240px) {
  body.page-cases .cases-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 48px 32px;
  }

  body.page-cases .cases-item {
    width: 100%;
  }

  body.page-cases .cases-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 251 / 277;
  }
}

@media (max-width: 900px) {
  body.page-cases .cases-head {
    padding-top: calc(var(--header-height, 80px) + 44px);
  }

  body.page-cases .cases-tabs {
    margin-bottom: 40px;
  }
}

@media (max-width: 768px) {
  body.page-cases .cases-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  body.page-cases .cases-name {
    margin-top: 18px;
    font-size: 1rem;
  }

  body.page-cases .cases-view-btn {
    width: 84px;
    height: 84px;
    font-size: 1rem;
  }
}

@media (max-width: 560px) {
  body.page-cases .cases-tab {
    padding: 9px 20px;
    font-size: 0.875rem;
  }

  body.page-cases .cases-tabs {
    gap: 8px;
  }

  body.page-cases .cases-badge {
    padding: 6px 12px;
    font-size: 0.75rem;
  }
}
