/*
 * 文件: css/home/home-cases.css
 * 引用: index.html（首页客户案例模块 — 标签+网格架构）
 * 依赖: header.css
 * 区块: .home-cases
 * 架构: 行业标签 Tab 切换 + 网格卡片展示
 */

.home-cases {
  padding: 80px 0 88px;
  background: #fff;
  overflow-x: clip;
}

/* 夹在 RCU（深色）与 ABOUT US（深色）之间的案例过渡带 */
.home-cases--bridge {
  background: #f4f7fb;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  padding: 72px 0 80px;
}

.home-rcu + .home-cases--bridge {
  margin-top: 0;
}

.home-cases--bridge .home-case-item {
  background: #fff;
  box-shadow: 0 2px 12px rgba(15, 52, 96, 0.06);
}

.home-cases--bridge .home-cases__tab {
  background: #fff;
  border: 1px solid #e2e8f0;
}

.home-cases--bridge .home-cases__tab.is-active {
  border-color: transparent;
}

/* ========== 标题区 ========== */
.home-cases__head {
  text-align: center;
  margin-bottom: 44px;
}

.home-cases__head h2 {
  font-size: clamp(26px, 3.2vw, 36px);
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 12px;
  line-height: 1.25;
}

.home-cases__head p {
  font-size: 16px;
  color: #666;
  margin: 0;
  line-height: 1.6;
}

.home-cases__head .head-line {
  display: block;
  width: 48px;
  height: 3px;
  background: #FC6B00;
  margin: 16px auto 0;
  border-radius: 2px;
}

/* ========== 标签栏 ========== */
.home-cases__tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 40px;
}

.home-cases__tab {
  font-size: 14px;
  font-weight: 500;
  color: #555;
  background: #f4f5f7;
  border: none;
  border-radius: 24px;
  padding: 10px 24px;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
  line-height: 1;
}

.home-cases__tab:hover {
  background: rgba(29, 81, 152, 0.08);
  color: #1D5198;
}

.home-cases__tab.is-active {
  background: #1D5198;
  color: #fff;
  box-shadow: 0 2px 10px rgba(29, 81, 152, 0.22);
}

.home-cases__tab:focus-visible {
  outline: 2px solid #FC6B00;
  outline-offset: 2px;
}

/* ========== 内容面板 ========== */
.home-cases__panel {
  display: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.home-cases__panel.is-active {
  display: block;
  animation: panelIn 0.5s ease forwards;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== 案例网格 ========== */
.home-cases__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

/* ========== 案例卡片 ========== */
.home-case-item {
  position: relative;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #eee;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              border-color 0.3s ease;
}

.home-case-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(29, 81, 152, 0.1);
  border-color: rgba(29, 81, 152, 0.2);
}

.home-case-item__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #f0f2f5;
}

.home-case-item__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.home-case-item:hover .home-case-item__media img {
  transform: scale(1.06);
}

.home-case-item__badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(29, 81, 152, 0.88);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  line-height: 1;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.home-case-item__body {
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.home-case-item__title {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 8px;
  line-height: 1.35;
}

.home-case-item__desc {
  font-size: 13px;
  color: #777;
  line-height: 1.65;
  margin: 0 0 16px;
  flex: 1 1 auto;
}

.home-case-item__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #1D5198;
  text-decoration: none;
  transition: color 0.2s ease, gap 0.25s ease;
}

.home-case-item__link:hover {
  color: #FC6B00;
  gap: 8px;
}

.home-case-item__link .bx {
  font-size: 16px;
  line-height: 1;
}

/* ========== 底部 CTA ========== */
.home-cases__foot {
  text-align: center;
  margin-top: 48px;
}

.home-cases__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1D5198;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  padding: 13px 32px;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 4px 14px rgba(29, 81, 152, 0.25);
}

.home-cases__btn:hover {
  background: #16407a;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(29, 81, 152, 0.3);
}

.home-cases__btn .bx {
  font-size: 18px;
  line-height: 1;
}

/* ========== 响应式 ========== */
@media (max-width: 992px) {
  .home-cases__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

@media (max-width: 768px) {
  .home-cases {
    padding: 56px 0 60px;
  }

  .home-cases__head {
    margin-bottom: 36px;
  }

  .home-cases__tabs {
    gap: 8px;
    margin-bottom: 28px;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .home-cases__tabs::-webkit-scrollbar {
    display: none;
  }

  .home-cases__tab {
    flex-shrink: 0;
    padding: 8px 18px;
    font-size: 13px;
  }

  .home-cases__grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

/* ========== 减弱动效 ========== */
@media (prefers-reduced-motion: reduce) {
  .home-cases__panel.is-active {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .home-case-item:hover {
    transform: none;
  }

  .home-case-item__media img {
    transition: none;
  }

  .home-case-item:hover .home-case-item__media img {
    transform: none;
  }
}
