/* Scoped cases module styles adapted to site variables */
.cases-module {
  --cm-bg: var(--bg);
  --cm-surface: var(--surface);
  --cm-surface-elevated: var(--bg-section);
  --cm-accent: var(--primary);
  --cm-accent-warm: var(--accent-light);
  --cm-text-primary: var(--text);
  --cm-text-secondary: rgba(17, 24, 39, 0.88);
  /* deeper secondary */
  --cm-text-muted: rgba(17, 24, 39, 0.64);
  /* deeper muted for better contrast */
  --cm-border: var(--border);
  --cm-radius: 8px;

  background: var(--cm-bg);
  color: var(--cm-text-primary);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.65;
  overflow-x: hidden;
  position: relative;
}

.cases-module::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 15% 20%, rgba(15, 23, 42, 0.03) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 80%, rgba(15, 23, 42, 0.02) 0%, transparent 50%);
  pointer-events: none;
}

.cases-module .cm-container {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 28px;
}

.cases-module .cm-header {
  padding: 48px 0 28px;
  text-align: center;
}

.cases-module .cm-label {
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--cm-accent);
  border: 1px solid var(--cm-border);
  padding: 3px 14px;
  border-radius: 100px;
  font-weight: 500;
  display: inline-block;
  margin-bottom: 12px;
  opacity: 0;
  animation: cmFadeDown 0.5s ease forwards 0.1s;
}

.cases-module .cm-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 900;
  margin-bottom: 8px;
  opacity: 0;
  animation: cmFadeDown 0.5s ease forwards 0.2s;
}

.cases-module .cm-subtitle {
  font-size: 13px;
  color: var(--cm-text-secondary);
  opacity: 0;
  animation: cmFadeDown 0.5s ease forwards 0.3s;
}

.cases-module .cm-hero {
  margin-bottom: 36px;
  opacity: 0;
  animation: cmFadeUp 0.6s ease forwards 0.4s;
}

.cases-module .cm-hero-img {
  position: relative;
  width: 100%;
  aspect-ratio: 21 / 9;
  border-radius: var(--cm-radius);
  overflow: hidden;
  border: 1px solid var(--cm-border);
  background: linear-gradient(135deg, var(--cm-surface) 0%, var(--cm-surface-elevated) 100%);
}

.cases-module .cm-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.cases-module .cm-ph-icon {
  width: 36px;
  height: 36px;
  border: 1.5px dashed var(--cm-text-muted);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.4;
}

.cases-module .cm-ph-icon svg {
  width: 16px;
  height: 16px;
  stroke: var(--cm-text-muted);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cases-module .cm-ph-text {
  font-size: 11px;
  color: var(--cm-text-muted);
}

.cases-module .cm-hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px 24px 20px;
  background: linear-gradient(
    to top,
    rgba(242, 245, 249, 0.98) 0%,
    rgba(242, 245, 249, 0.85) 60%,
    transparent 100%
  );
  z-index: 10;
  pointer-events: none;
  opacity: 1;
  transition: opacity 320ms ease;
}

/* 介绍蒙版只负责展示，鼠标事件必须穿透到全景查看器 */
.cases-module .cm-hero-overlay * {
  pointer-events: none;
}

.cases-module .cm-hero-img.is-interactive .cm-hero-overlay {
  opacity: 0;
}

.cases-module .cm-badge {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #fff;
  background: var(--cm-accent);
  padding: 2px 10px;
  border-radius: 100px;
  font-weight: 700;
  display: inline-block;
  margin-bottom: 6px;
}

.cases-module .cm-hero-title {
  font-family: var(--font-display);
  font-size: clamp(16px, 2.5vw, 20px);
  font-weight: 700;
  margin-bottom: 2px;
  color: var(--cm-text-primary);
}

.cases-module .cm-hero-sub {
  font-size: 12px;
  color: var(--cm-text-secondary);
  font-weight: 500;
}

.cases-module .cm-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 36px;
  opacity: 0;
  animation: cmFadeUp 0.6s ease forwards 0.5s;
}

.cases-module .cm-detail-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cases-module .cm-detail-text h3 {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--cm-accent);
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

.cases-module .cm-detail-text p {
  font-size: 13px;
  color: var(--cm-text-secondary);
  line-height: 1.8;
}

.cases-module .cm-detail-img {
  position: relative;
  min-width: 0;
  aspect-ratio: 4/3;
  border-radius: var(--cm-radius);
  border: 1px dashed var(--cm-border);
  background: var(--cm-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.cases-module .cm-stats {
  margin-bottom: 36px;
  opacity: 0;
  animation: cmFadeUp 0.6s ease forwards 0.55s;
}

.cases-module .cm-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--cm-border);
  border-radius: var(--cm-radius);
  overflow: hidden;
}

.cases-module .cm-stat {
  background: var(--cm-surface);
  padding: 20px 12px;
  text-align: center;
  transition: background 0.3s;
}

.cases-module .cm-stat:hover {
  background: var(--cm-surface-elevated);
}

.cases-module .cm-stat-val {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 900;
  color: var(--cm-accent);
  line-height: 1;
  margin-bottom: 2px;
}

.cases-module .cm-stat-unit {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 300;
  color: var(--cm-accent);
  opacity: 0.7;
}

.cases-module .cm-stat-label {
  font-size: 10px;
  color: var(--cm-text-muted);
  margin-top: 6px;
}

.cases-module .cm-caps {
  margin-bottom: 36px;
  opacity: 0;
  animation: cmFadeUp 0.6s ease forwards 0.6s;
}

.cases-module .cm-caps-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 18px;
  text-align: center;
}

.cases-module .cm-caps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.cases-module .cm-cap {
  background: var(--cm-surface);
  border: 1px solid var(--cm-border);
  border-radius: var(--cm-radius);
  padding: 20px 18px;
  position: relative;
  overflow: hidden;
  transition:
    border-color 0.3s,
    transform 0.3s;
}

.cases-module .cm-cap:hover {
  border-color: rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.cases-module .cm-cap-num {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  color: var(--cm-accent);
  opacity: 0.08;
  position: absolute;
  top: 10px;
  right: 14px;
}

.cases-module .cm-cap h4 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}

.cases-module .cm-cap p {
  font-size: 11px;
  color: var(--cm-text-secondary);
  line-height: 1.7;
}

.cases-module .cm-partners {
  margin-bottom: 36px;
  opacity: 0;
  animation: cmFadeUp 0.6s ease forwards 0.65s;
}

.cases-module .cm-partners-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 16px 0;
  border-top: 1px solid var(--cm-border);
  border-bottom: 1px solid var(--cm-border);
  flex-wrap: wrap;
}

.cases-module .cm-plabel {
  font-size: 9px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--cm-text-muted);
  font-weight: 500;
}

.cases-module .cm-pname {
  font-size: 12px;
  color: var(--cm-text-secondary);
}

.cases-module .cm-pdot {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--cm-text-muted);
}

.cases-module .cm-upcoming {
  padding-bottom: 48px;
  opacity: 0;
  animation: cmFadeUp 0.6s ease forwards 0.7s;
}

.cases-module .cm-upcoming-label {
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--cm-text-muted);
  text-align: center;
  margin-bottom: 16px;
  font-weight: 500;
}

.cases-module .cm-upcoming-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.cases-module .cm-ucard {
  background: var(--cm-surface);
  border: 1px dashed var(--cm-border);
  border-radius: var(--cm-radius);
  padding: 20px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  opacity: 0.5;
  transition: opacity 0.3s;
}

.cases-module .cm-ucard:hover {
  opacity: 0.75;
}

.cases-module .cm-uicon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--cm-surface-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cases-module .cm-uicon svg {
  width: 15px;
  height: 15px;
  stroke: var(--cm-text-muted);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cases-module .cm-uinfo h4 {
  font-size: 13px;
  font-weight: 500;
  color: var(--cm-text-secondary);
  margin-bottom: 2px;
}

.cases-module .cm-uinfo p {
  font-size: 10px;
  color: var(--cm-text-muted);
}

.cases-module .cm-coming-tag {
  font-size: 8px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--cm-accent-warm);
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 1px 8px;
  border-radius: 100px;
  display: inline-block;
  margin-top: 4px;
  font-weight: 500;
}

@keyframes cmFadeDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cmFadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* carousel styles for device gallery (aligned with news/iedu sliders) */
.cases-module .cm-carousel {
  /* All slides share one fixed frame, including while fading out. */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--cm-surface);
  overflow: hidden;
  cursor: zoom-in;
}

.cases-module .cm-carousel-item {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 350ms ease,
    visibility 350ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cases-module .cm-carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  cursor: zoom-in;
}

.cases-module .cm-carousel-item.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 2;
}

.cases-module .cm-carousel-controls {
  position: absolute;
  top: 50%;
  left: 16px;
  right: 16px;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 30;
}

/* ensure controls visually pop on light backgrounds */
.cases-module .cm-carousel-controls .slider-nav {
  pointer-events: auto;
  cursor: pointer;
  background: rgba(10, 20, 30, 0.72);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.08);
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.cases-module .cm-carousel-dots {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 16px;
  display: flex;
  gap: 8px;
  z-index: 3;
}

/* on light backgrounds use dark dots; active dot uses accent */
.cases-module .cm-carousel-dot,
.cases-module .news-slider-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(0, 0, 0, 0.08);
  cursor: pointer;
}

.cases-module .cm-carousel-dot.active,
.cases-module .news-slider-dot.active {
  background: var(--cm-accent);
  transform: scale(1.15);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

/* ensure carousel controls visible above light backgrounds */
.cases-module .cm-carousel-controls .slider-nav {
  z-index: 20;
  box-shadow: 0 6px 18px rgba(16, 30, 50, 0.08);
}

.cases-module .cm-carousel-controls .slider-nav:hover {
  transform: scale(1.02);
}

.cases-module .cm-panorama-viewer {
  position: absolute;
  inset: 0;
  margin: 0;
  width: 100%;
  max-width: none;
  border-radius: inherit;
  overflow: hidden;
  background: #0f172e;
  min-height: 0;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.16);
  cursor: grab;
  touch-action: none;
  -ms-touch-action: none;
}

.cases-module .cm-panorama-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: transparent;
  position: relative;
  z-index: 2;
  touch-action: none;
  -ms-touch-action: none;
  cursor: grab;
}

.cases-module .cm-panorama-source {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.cases-module .cm-panorama-viewer:active {
  cursor: grabbing;
}

.cases-module .cm-panorama-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 20px;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 220ms ease,
    visibility 220ms ease;
}

.cases-module .cm-panorama-viewer:hover .cm-panorama-overlay,
.cases-module .cm-panorama-viewer:focus-within .cm-panorama-overlay,
.cases-module .cm-panorama-viewer:fullscreen .cm-panorama-overlay {
  opacity: 1;
  visibility: visible;
}

.cases-module .cm-panorama-viewer:not(.is-ready) .cm-panorama-overlay,
.cases-module .cm-panorama-viewer:not(.is-ready) .cm-panorama-controls {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.cases-module .cm-panorama-hint {
  pointer-events: none;
  color: #fff;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  border-radius: 999px;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cases-module .cm-panorama-hint::before {
  content: '⇆';
  display: inline-block;
  font-size: 1.05rem;
}

.cases-module .cm-panorama-zoom {
  pointer-events: auto;
  border: 0;
  background: rgba(18, 126, 255, 0.94);
  color: #fff;
  padding: 11px 16px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
  cursor: pointer;
  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

.cases-module .cm-panorama-zoom:hover {
  transform: translateY(-1px);
  background: rgba(56, 189, 248, 0.96);
}

.cases-module .cm-panorama-controls {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  pointer-events: none;
  z-index: 10;
}

.cases-module .cm-panorama-btn {
  pointer-events: auto;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(15, 23, 42, 0.26);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    background 0.2s ease;
  backdrop-filter: blur(4px);
}

.cases-module .cm-panorama-btn svg {
  width: 22px;
  height: 22px;
  display: block;
}

.cases-module .cm-panorama-btn:hover {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.24);
}

.cases-module .cm-panorama-canvas:focus {
  outline: 2px solid rgba(56, 189, 248, 0.55);
  outline-offset: -2px;
}

.cases-module .cm-panorama-zoom {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cases-module .cm-panorama-load {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 9;
  pointer-events: auto;
  border: 1px solid rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  padding: 13px 20px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow:
    0 10px 30px rgba(2, 12, 27, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    opacity 0.2s ease;
}

.cases-module .cm-panorama-load:hover {
  transform: translate(-50%, calc(-50% - 2px));
  background: rgba(56, 189, 248, 0.36);
}

.cases-module .cm-panorama-load:disabled {
  cursor: wait;
  opacity: 0.72;
}

.cases-module .cm-panorama-viewer.is-loading .cm-panorama-load,
.cases-module .cm-panorama-viewer.is-ready .cm-panorama-load {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.cases-module .cm-panorama-loading {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 16, 28, 0.28);
  color: #fff;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.cases-module .cm-panorama-viewer.is-loading .cm-panorama-loading {
  opacity: 1;
  visibility: visible;
}

.cases-module .cm-panorama-loading::before {
  content: '';
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: cm-panorama-spin 0.8s linear infinite;
}

@keyframes cm-panorama-spin {
  to {
    transform: rotate(360deg);
  }
}

.cases-module .cm-panorama-zoom svg {
  width: 18px;
  height: 18px;
}

.cases-module .cm-panorama-viewer:fullscreen {
  width: 100vw;
  height: 100vh;
  min-height: 0;
  max-width: none;
  margin: 0;
  border-radius: 0;
}

.cases-module .cm-panorama-viewer:fullscreen .cm-panorama-canvas {
  width: 100vw;
  height: 100vh;
}

.team-certificates-marquee.is-paused .team-certificates-track {
  animation-play-state: paused;
}

.team-certificates-track {
  gap: 0;
}

.team-certificates-group {
  display: flex;
  flex: 0 0 auto;
  gap: 14px;
  padding-right: 14px;
}

.team-certificate-card,
.team-certificate-trigger,
.team-certificate-trigger img,
.cm-carousel-item img,
.news-slider-item img,
.news-card-image {
  cursor: zoom-in;
}

.team-certificate-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
}

.team-certificate-trigger:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 4px;
  border-radius: 10px;
}

.pswp__custom-caption {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 20px;
  color: #fff;
  text-align: center;
  font-size: 14px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

.pswp__img {
  object-fit: contain;
}

@media (max-width: 700px) {
  .cases-module .cm-container {
    padding: 0 16px;
  }

  .cases-module .cm-detail {
    grid-template-columns: 1fr;
  }

  .cases-module .cm-stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .cases-module .cm-caps-grid {
    grid-template-columns: 1fr 1fr;
  }

  .cases-module .cm-upcoming-grid {
    grid-template-columns: 1fr;
  }

  .cases-module .cm-partners-inner {
    gap: 10px;
  }

  .cases-module .cm-pdot {
    display: none;
  }
}

@media (max-width: 480px) {
  .cases-module .cm-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cases-module .cm-caps-grid {
    grid-template-columns: 1fr;
  }

  .cases-module .cm-hero-img {
    aspect-ratio: 16 / 11;
  }

  .cases-module .cm-panorama-viewer {
    border-radius: inherit;
  }

  .cases-module .cm-panorama-controls {
    padding: 0 10px;
  }

  .cases-module .cm-panorama-btn {
    width: 44px;
    height: 44px;
  }

  .cases-module .cm-panorama-overlay {
    bottom: 12px;
    padding: 0 12px;
  }

  .cases-module .cm-panorama-hint {
    font-size: 12px;
    padding: 8px 10px;
  }

  .cases-module .cm-panorama-zoom {
    padding: 10px 12px;
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cases-module .cm-hero-overlay,
  .cases-module .cm-carousel-item {
    transition: none;
  }

  .team-certificates-track {
    animation: none;
  }
}
