/* 客户案例列表页 — 主色 #00A85A / 深绿 #05763a */
body.case-studies-page {
  background: var(--home-color-surface, #f9fafb);
  --cs-sticky-header: var(--site-header-height, 76px);
  --cs-filters-header-gap: 0;
}

@media (max-width: 767px) {
  body.case-studies-page {
    --cs-filters-header-gap: 0;
  }
}

.cs-page {
  --cs-sticky-header: var(--site-header-height, 76px);
}

.case-studies-page main.site-main {
  padding-bottom: 0;
}

.cs-page {
  --cs-primary: var(--theme-default-color, #00a85a);
  --cs-primary-dark: color-mix(in srgb, var(--cs-primary) 78%, #000);
  --cs-primary-soft: color-mix(in srgb, var(--cs-primary) 12%, #fff);
  --cs-text: #101828;
  --cs-text-soft: #4a5565;
  --cs-text-muted: #6a7282;
  --cs-border: #e5e7eb;
  --cs-surface: #f3f4f6;
  --cs-white: #fff;
  --cs-radius-lg: var(--home-radius-md, 18px);
  color: var(--cs-text);
}

/* 顶部 Banner */
.cs-hero {
  position: relative;
  height: var(--cs-hero-height, 420px);
  min-height: var(--cs-hero-height, 420px);
  overflow: hidden;
  color: #fff;
  background: #0a1628;
}

.cs-hero-media {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.cs-hero.has-responsive-bg .cs-hero-media {
  background-image: var(--responsive-bg-pc);
}

@media (max-width: 640px) {
  .cs-hero.has-responsive-bg .cs-hero-media {
    background-image: var(--responsive-bg-mobile, var(--responsive-bg-pc));
  }
}

.cs-hero-media--fallback {
  background:
    radial-gradient(circle at 72% 18%, rgba(0, 168, 90, 0.28), transparent 42%),
    linear-gradient(115deg, #05080d 0%, #101828 55%, #0a1628 100%);
}

.cs-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(5, 8, 13, 0.82) 0%,
    rgba(16, 24, 40, 0.45) 52%,
    rgba(16, 24, 40, 0.55) 100%
  );
  pointer-events: none;
}

.cs-hero-container {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 96px 24px 48px;
}

.cs-hero-content {
  max-width: 760px;
}

.cs-hero-content h1 {
  margin: 0 0 16px;
  font-size: clamp(32px, 4.5vw, 52px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.cs-hero-content p {
  margin: 0;
  max-width: 640px;
  font-size: clamp(15px, 1.6vw, 17px);
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.86);
  white-space: pre-wrap;
}

@media (max-width: 767px) {
  .cs-hero-container {
    padding: 88px 20px 40px;
    align-items: flex-end;
  }
}

/* 精选轮播 */
.cs-featured {
  max-width: 1200px;
  margin: 32px auto 24px;
  padding: 0 24px;
}

@media (max-width: 767px) {
  .cs-featured {
    margin-top: 24px;
  }
}

.cs-featured__shell {
  display: none;
  grid-template-columns: 1fr;
  background: var(--cs-white);
  box-shadow: var(--home-shadow-soft, 0 20px 50px rgba(16, 24, 40, 0.08));
  border-radius: var(--cs-radius-lg);
  overflow: hidden;
}

.cs-featured__shell.is-active {
  display: grid;
}

@media (min-width: 960px) {
  .cs-featured__shell {
    grid-template-columns: 1.35fr 1fr;
    height: 420px;
    min-height: 420px;
    max-height: 420px;
  }
}

.cs-featured__media {
  position: relative;
  aspect-ratio: 3 / 2;
  background: var(--cs-surface);
  overflow: hidden;
}

.cs-featured__media a {
  display: block;
  height: 100%;
  overflow: hidden;
}

@media (min-width: 960px) {
  .cs-featured__media {
    aspect-ratio: auto;
    height: 100%;
    min-height: 100%;
    border-radius: var(--cs-radius-lg) 0 0 var(--cs-radius-lg);
  }
}

.cs-featured__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

.cs-featured__aside {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--cs-surface);
}

@media (min-width: 960px) {
  .cs-featured__aside {
    height: 100%;
    min-height: 420px;
  }
}

.cs-featured__bar {
  flex-shrink: 0;
  background: var(--cs-primary);
  color: var(--cs-white);
  padding: 20px 24px;
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

@media (min-width: 640px) {
  .cs-featured__bar {
    align-items: center;
  }
}

.cs-featured__bar-main {
  flex: 1;
  min-width: 0;
}

.cs-featured__bar h2 {
  margin: 0;
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cs-featured__bar h2 a {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cs-featured__nav {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
  align-self: center;
}

.cs-featured__nav button,
.cs-featured__nav-btn {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  color: var(--cs-white);
  cursor: pointer;
  border-radius: 4px;
}

.cs-featured__nav button:hover,
.cs-featured__nav-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.cs-featured__panel {
  padding: 24px;
  background: var(--cs-surface);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

@media (min-width: 960px) {
  .cs-featured__panel {
    padding: 40px;
    flex: 1 1 auto;
  }
}

.cs-featured__panel p {
  flex: 0 1 auto;
  align-self: stretch;
  width: 100%;
  max-height: 7em;
  margin: 0 0 20px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--cs-text);
  overflow: hidden;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
}

.cs-featured__meta {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--cs-text-muted);
  margin-top: auto;
  margin-bottom: 16px;
}

.cs-featured__meta span + span::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: 14px;
  background: var(--cs-text-muted);
  margin-right: 12px;
  vertical-align: middle;
}

.cs-featured__tags {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cs-featured__tags span {
  font-size: 13px;
  padding: 4px 12px;
  border: 1px solid var(--cs-border);
  border-radius: 4px;
  background: var(--cs-white);
  color: var(--cs-text-soft);
}

.cs-featured__dots {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.cs-featured__dot {
  width: 16px;
  height: 4px;
  padding: 0;
  border: none;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
}

.cs-featured__dot.is-active {
  background: var(--cs-white);
}

/* 筛选 + 列表 */
.cs-list-wrap {
  background: var(--cs-surface);
  padding: 36px 0 80px;
  scroll-margin-top: var(--site-header-height, var(--cs-sticky-header, 76px));
}

.cs-list-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.cs-filters {
  position: sticky;
  top: var(--site-header-height, var(--cs-sticky-header, 76px));
  scroll-margin-top: var(--site-header-height, var(--cs-sticky-header, 76px));
  z-index: 20;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0 24px;
  margin: 0 0 8px;
  background: var(--cs-surface);
  scrollbar-width: none;
}

.cs-filters::-webkit-scrollbar {
  display: none;
}

.cs-filters a {
  flex-shrink: 0;
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 4px;
  text-decoration: none;
  color: var(--cs-text-soft);
  background: var(--cs-white);
  border: 1px solid transparent;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.cs-filters a:hover,
.cs-filters a.is-active,
.cs-filters a.is-active:hover {
  color: var(--theme-default-font-color, var(--cs-text));
}

.cs-filters a.is-active {
  background: color-mix(in srgb, var(--theme-default-color, var(--cs-primary)) 10%, var(--cs-white));
  font-weight: 500;
}

.cs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 768px) {
  .cs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.cs-card {
  display: flex;
  flex-direction: column;
  background: var(--cs-white);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.25s, transform 0.25s;
  border-radius: var(--cs-radius-lg);
  overflow: hidden;
}

.cs-card:hover {
  box-shadow: var(--home-shadow-card);
  transform: translateY(-2px);
}

.cs-card__media {
  aspect-ratio: 16 / 10;
  background: var(--cs-surface);
  overflow: hidden;
}

.cs-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: var(--cs-radius-lg) var(--cs-radius-lg) 0 0;
}

.cs-card__body {
  padding: 16px 20px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 180px;
}

@media (min-width: 960px) {
  .cs-card__body {
    min-height: 208px;
    padding: 20px 24px 24px;
  }
}

.cs-card__body h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--cs-text);
  transition: color 0.2s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cs-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--cs-text-muted);
  margin-bottom: 8px;
}

.cs-card__excerpt {
  margin: 0;
  flex: none;
  font-size: 14px;
  line-height: 1.5;
  max-height: 3em;
  color: var(--cs-text-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
  word-break: normal;
}

.cs-card__meta .cs-divider {
  width: 1px;
  height: 14px;
  background: var(--cs-text-muted);
}

.cs-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
}

.cs-card__tags span {
  font-size: 13px;
  padding: 4px 12px;
  border: 1px solid var(--cs-border);
  border-radius: 4px;
  color: var(--cs-text-soft);
}

.cs-card__arrow {
  position: absolute;
  right: 24px;
  bottom: 24px;
  width: 24px;
  height: 24px;
  color: var(--theme-default-color, var(--cs-primary));
  opacity: 0;
  transition: opacity 0.2s, color 0.2s;
}

.cs-card {
  position: relative;
}

.cs-card:hover .cs-card__body h3 {
  color: var(--theme-default-font-color, var(--cs-text));
}

.cs-card:hover .cs-card__arrow {
  opacity: 1;
  color: var(--theme-default-color, var(--cs-primary));
}

@media (max-width: 767px) {
  .cs-card__body {
    min-height: auto;
    padding-bottom: 44px;
    padding-right: 40px;
  }

  .cs-card__arrow,
  .cs-card:hover .cs-card__arrow,
  .cs-card:focus .cs-card__arrow,
  .cs-card:focus-visible .cs-card__arrow {
    display: block;
    opacity: 1;
    z-index: 2;
    right: 20px;
    bottom: 20px;
    color: var(--theme-default-color, var(--cs-primary));
    pointer-events: none;
  }
}

.cs-pagination {
  margin-top: 40px;
  display: flex;
  justify-content: center;
}

.cs-pagination nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.cs-pagination a,
.cs-pagination span {
  min-width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  font-size: 14px;
  border-radius: 4px;
  text-decoration: none;
  color: var(--cs-text-soft);
}

.cs-pagination a:hover {
  background: var(--cs-white);
  color: var(--cs-primary);
}

.cs-pagination span[aria-current="page"] span,
.cs-pagination .active span {
  background: var(--cs-primary);
  color: var(--theme-default-button-text-color, var(--cs-white));
}

.cs-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px 24px;
  color: var(--cs-text-muted);
  background: var(--cs-white);
}

/* 详情页框架 */
.cs-detail {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.cs-detail__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  color: var(--cs-primary);
  text-decoration: none;
  font-size: 14px;
}

.cs-detail__cover {
  border-radius: var(--cs-radius-lg);
  overflow: hidden;
  margin-bottom: 32px;
  aspect-ratio: 16 / 9;
  background: var(--cs-surface);
}

.cs-detail__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

.cs-detail h1 {
  font-size: clamp(24px, 3vw, 36px);
  margin: 0 0 16px;
}

.cs-detail__related-title {
  font-size: 24px;
  margin: 0 0 24px;
}

.cs-detail__content {
  font-size: 16px;
  line-height: 1.8;
  color: var(--cs-text-soft);
}

.cs-detail__content :first-child {
  margin-top: 0;
}

.cs-detail__content img,
.cs-page .cms-rich-content img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--cs-radius-lg);
}

/* 响应式见 public/css/site-responsive.css */
