/**
 * ergo-360-product.css
 * 产品交互展示区域样式
 * PC 端专用，16:9 固定比例
 */

/* ========== 容器 ========== */
.ergo-360-product {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  padding-top: var(--section-padding-top, 0);
  padding-bottom: var(--section-padding-bottom, 0);
}

/* ========== 背景层 ========== */
.ergo-360-product__bg {
  transition: opacity 0.6s ease-in-out;
}

.ergo-360-product__bg.is-active {
  opacity: 1;
}

/* PC 端默认隐藏移动端背景图 */
.ergo-360-product__bg--mobile {
  display: none;
}

/* ========== 毛玻璃遮罩 ========== */
.ergo-360-product__mask {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
}

/* ========== 导航栏定位 ========== */
.ergo-360-product__nav {
  /* 基于 1920x1080: top: 80px → 80/1080 ≈ 7.4%, left: 80px → 80/1920 ≈ 4.17% */
  top: 7.4%;
  left: 4.17%;
  /* 2xl (1536px+) 默认值 */
  gap: 20px;
}

/* 主导航容器 */
.ergo-360-product__nav-main {
  border-radius: 20px;
  padding: 4px 4px 4px 24px;
  gap: 4px;
}

/* ========== 导航按钮 ========== */
.ergo-360-product__nav-btn {
  /* 2xl (1536px+) 默认值 */
  font-size: 26px;
  font-weight: 500;
  background: transparent;
  color: #33363e;
  transition: background-color 0.3s ease, color 0.3s ease;
  padding: 20px 24px;
  border-radius: 16px;
}

.ergo-360-product__nav-btn:hover {
  background: rgba(19, 75, 214, 0.1);
}

.ergo-360-product__nav-btn.is-active {
  background: #134BD6;
  color: white;
}

/* 图标默认隐藏，激活时显示并反色 */
.ergo-360-product__nav-icon {
  display: none;
  /* 2xl (1536px+) 默认值 */
  width: 36px;
  height: 36px;
}

.ergo-360-product__nav-btn.is-active .ergo-360-product__nav-icon {
  display: block;
  filter: brightness(0) invert(1);
}

/* 前缀文字 */
.ergo-360-product__nav-prefix {
  font-weight: 500;
  /* 2xl (1536px+) 默认值 */
  font-size: 20px;
  padding-right: 12px;
}

/* ========== 左侧内容区（卡片 + Result） ========== */
.ergo-360-product__left-content {
  position: absolute;
  /* 基于 1920x1080: left: 80px → 80/1920 ≈ 4.17%, top: 204px → 204/1080 ≈ 18.9% */
  left: 4.17%;
  top: 18.9%;
  z-index: 10;
}

/* Result 按钮 - PC 端在导航栏内（默认隐藏，通过 JS 添加 is-visible 类显示） */
.ergo-360-product__result--desktop {
  /* 2xl (1536px+) 默认值 */
  display: none;
  border-radius: 20px;
}

.ergo-360-product__result--desktop.is-visible {
  display: flex;
}

.ergo-360-product__result--desktop .ergo-360-product__result-inner {
  /* 2xl (1536px+) 默认值 */
  width: 75px;
  height: 76px;
  padding: 16px 16px 20px;
}

.ergo-360-product__result--desktop .ergo-360-product__result-icon {
  /* 2xl (1536px+) 默认值 */
  width: 36px;
  height: 36px;
}

.ergo-360-product__result--desktop .ergo-360-product__result-text {
  /* 2xl (1536px+) 默认值 */
  font-size: 14px;
  margin-top: 8px;
}

/* Result 按钮 - 移动端在卡片下方 */
.ergo-360-product__result--mobile {
  /* PC 端隐藏移动端版本 */
  display: none;
}

/* ========== 左侧内容卡片 ========== */
.ergo-360-product__card {
  /* PC 端绝对定位，卡片重叠，用 opacity 切换 */
  position: absolute;
  left: 0;
  top: 0;
  /* 2xl (1536px+) 默认值 */
  width: 560px;
  padding: 40px;
  border-radius: 20px;
  transform: translateX(-20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.ergo-360-product__card.is-active {
  opacity: 1;
  transform: translateX(0);
}

/* 卡片标题 */
.ergo-360-product__card-title {
  font-size: 24px;
  margin-bottom: 40px;
}

/* 卡片主文字 */
.ergo-360-product__card-main {
  margin-bottom: 40px;
}

.ergo-360-product__card-main p,
.ergo-360-product__card-main-text {
  font-size: 24px;
}

/* 卡片图标 */
.ergo-360-product__card-icon {
  width: 36px;
  height: 36px;
}

/* 统计数据文字 */
.ergo-360-product__card-stat {
  font-size: 24px;
  margin-bottom: 40px;
}

.ergo-360-product__card-stat p {
  font-size: inherit;
  line-height: 1.35;
  color: #33363e;
}

.ergo-360-product__card-stat strong {
  font-weight: 700;
}

/* 结尾文字 */
.ergo-360-product__card-cta {
  font-size: 24px;
}

/* ========== 产品标签 (Hotspots) ========== */
.ergo-360-product__hotspot {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  transition-delay: 0s; /* 淡出时无延时 */
  /* 定位锚点容器 */
}

.ergo-360-product__hotspot.is-visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition-delay: var(--hotspot-delay, 0s); /* 淡入时使用 JS 设置的延时 */
}

/* 展开时提升 z-index */
.ergo-360-product__hotspot.is-expanding-width,
.ergo-360-product__hotspot.is-expanded {
  z-index: 20;
}

/* + 号图标 - 绝对定位，中心对齐坐标点 */
.ergo-360-product__hotspot-icon {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #134BD6;
  z-index: 2;
}

/* 外围呼吸灯效果 */
.ergo-360-product__hotspot-icon::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(19, 75, 214, 0.15);
  z-index: -1;
  animation: hotspot-pulse 2s ease-in-out infinite;
}

@keyframes hotspot-pulse {
  0%, 100% {
    width: 100%;
    height: 100%;
    opacity: 0.6;
  }
  50% {
    width: 150%;
    height: 150%;
    opacity: 0.3;
  }
}

/* 标签内容容器 - 相对于+号定位 */
.ergo-360-product__hotspot-content {
  position: absolute;
  /* 默认：图标在左，内容在右侧，垂直居中 */
  left: 32px; /* +号半径(24px) + 间距(8px) */
  top: 0;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.4);
  border-radius: 24px;
  overflow: hidden;
  /* 动态宽度 */
  white-space: nowrap;
  /* 分阶段动画 - Phase 1: 宽度和位置 */
  transition: width 0.2s ease, transform 0.2s ease;
}

/* Phase 1: 宽度展开 - 固定宽度，向下展开 */
.ergo-360-product__hotspot.is-expanding-width .ergo-360-product__hotspot-content {
  width: 377px !important; /* 视频宽度(361px) + padding(16px) */
  white-space: normal;
  /* 展开时取消居中，改为固定偏移（header高度约48px，偏移一半保持标题位置） */
  transform: translateY(-24px);
}

/* 向上展开时 */
.ergo-360-product__hotspot--expand-up.is-expanding-width .ergo-360-product__hotspot-content {
  transform: translateY(24px);
}

/* 展开时移除 backdrop-filter 避免与视频交互产生闪烁 */
.ergo-360-product__hotspot.is-expanding-width .ergo-360-product__hotspot-content,
.ergo-360-product__hotspot.is-expanded .ergo-360-product__hotspot-content {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: rgba(0, 0, 0, 0.6);
}

/* 图标在右侧时 - 内容向左展开 */
.ergo-360-product__hotspot--icon-right .ergo-360-product__hotspot-content {
  left: auto;
  right: 32px; /* +号半径(24px) + 间距(8px) */
}

/* 标题区 */
.ergo-360-product__hotspot-header {
  padding: 12px 24px;
  gap: 24px;
}

/* 展开时标题和 view 两端分布 */
.ergo-360-product__hotspot.is-expanding-width .ergo-360-product__hotspot-header,
.ergo-360-product__hotspot.is-expanded .ergo-360-product__hotspot-header {
  justify-content: space-between;
}

.ergo-360-product__hotspot-name {
  font-size: 24px;
}

.ergo-360-product__hotspot-view {
  font-size: 18px;
}

/* 视频区 - 默认收起 */
.ergo-360-product__hotspot-video {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  /* Phase 2: 高度展开 - 延迟等待宽度动画完成 */
  transition: max-height 0.25s ease, opacity 0.25s ease, padding 0.25s ease;
  padding: 0 8px;
}

.ergo-360-product__hotspot-video video {
  width: 361px;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  object-fit: cover;
  display: block;
}

/* Phase 2: 视频展开 */
.ergo-360-product__hotspot.is-expanded .ergo-360-product__hotspot-video {
  max-height: 220px;
  opacity: 1;
  padding: 0 8px 8px 8px;
}

/* ========== 向上展开变体 ========== */
.ergo-360-product__hotspot--expand-up .ergo-360-product__hotspot-content {
  top: auto;
  bottom: 0;
  transform: translateY(50%); /* 垂直居中，向上展开 */
  display: flex;
  flex-direction: column-reverse;
}

.ergo-360-product__hotspot--expand-up.is-expanded .ergo-360-product__hotspot-video {
  padding: 8px 8px 0 8px;
}

/* 向上展开 + 图标在右侧 */
.ergo-360-product__hotspot--expand-up.ergo-360-product__hotspot--icon-right .ergo-360-product__hotspot-content {
  left: auto;
  right: 32px;
}

/* ========== 响应式调整 ========== */

/* xl (1280px - 1535px) */
@media screen and (min-width: 1280px) and (max-width: 1535px) {
  .ergo-360-product__nav {
    gap: 16px;
  }

  .ergo-360-product__nav-main {
    border-radius: 16px;
    padding: 4px 4px 4px 20px;
  }

  .ergo-360-product__nav-prefix {
    font-size: 17px;
    padding-right: 8px;
  }

  .ergo-360-product__nav-btn {
    font-size: 22px;
    padding: 16px 20px;
    border-radius: 14px;
  }

  .ergo-360-product__nav-icon {
    width: 32px;
    height: 32px;
  }

  .ergo-360-product__result--desktop {
    border-radius: 16px;
  }

  .ergo-360-product__result--desktop .ergo-360-product__result-inner {
    width: 68px;
    height: 69px;
    padding: 12px 12px 16px;
  }

  .ergo-360-product__result--desktop .ergo-360-product__result-icon {
    width: 32px;
    height: 32px;
  }

  .ergo-360-product__result--desktop .ergo-360-product__result-text {
    font-size: 12px;
    margin-top: 4px;
  }

  .ergo-360-product__card {
    width: 440px;
    padding: 32px;
    border-radius: 16px;
  }

  .ergo-360-product__card-title {
    font-size: 24px;
    margin-bottom: 32px;
  }

  .ergo-360-product__card-main {
    margin-bottom: 32px;
  }

  .ergo-360-product__card-main p,
  .ergo-360-product__card-main-text,
  .ergo-360-product__card-stat,
  .ergo-360-product__card-cta {
    font-size: 24px;
  }

  .ergo-360-product__card-stat {
    margin-bottom: 32px;
  }

  .ergo-360-product__card-icon {
    width: 32px;
    height: 32px;
  }

  .ergo-360-product__hotspot-name {
    font-size: 20px;
  }

  .ergo-360-product__hotspot-view {
    font-size: 14px;
  }

  .ergo-360-product__hotspot-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
  }

  /* 内容块位置随+号尺寸调整 */
  .ergo-360-product__hotspot-content {
    left: 28px;
    border-radius: 20px;
  }

  .ergo-360-product__hotspot--icon-right .ergo-360-product__hotspot-content {
    left: auto;
    right: 28px;
  }

  /* Phase 1 展开宽度 */
  .ergo-360-product__hotspot.is-expanding-width .ergo-360-product__hotspot-content {
    width: 320px !important;
  }

  .ergo-360-product__hotspot-header {
    padding: 10px 20px;
    gap: 16px;
  }

  .ergo-360-product__hotspot-video video {
    width: 300px;
    border-radius: 12px;
  }
}

/* lg (1024px - 1279px) */
@media screen and (min-width: 1024px) and (max-width: 1279px) {
  .ergo-360-product__nav {
    gap: 12px;
  }

  .ergo-360-product__nav-main {
    border-radius: 14px;
    padding: 4px 4px 4px 16px;
  }

  .ergo-360-product__nav-prefix {
    font-size: 15px;
    padding-right: 8px;
  }

  .ergo-360-product__nav-btn {
    font-size: 18px;
    padding: 12px 16px;
    border-radius: 12px;
  }

  .ergo-360-product__nav-icon {
    width: 28px;
    height: 28px;
  }

  .ergo-360-product__result--desktop {
    border-radius: 14px;
  }

  .ergo-360-product__result--desktop .ergo-360-product__result-inner {
    width: 60px;
    height: 61px;
    padding: 8px 8px 12px;
  }

  .ergo-360-product__result--desktop .ergo-360-product__result-icon {
    width: 28px;
    height: 28px;
  }

  .ergo-360-product__result--desktop .ergo-360-product__result-text {
    font-size: 11px;
    margin-top: 4px;
  }

  .ergo-360-product__card {
    width: 360px;
    padding: 24px;
    border-radius: 14px;
  }

  .ergo-360-product__card-title {
    font-size: 20px;
    margin-bottom: 24px;
  }

  .ergo-360-product__card-main {
    margin-bottom: 24px;
  }

  .ergo-360-product__card-main p,
  .ergo-360-product__card-main-text,
  .ergo-360-product__card-stat,
  .ergo-360-product__card-cta {
    font-size: 20px;
  }

  .ergo-360-product__card-stat {
    margin-bottom: 24px;
  }

  .ergo-360-product__card-icon {
    width: 28px;
    height: 28px;
  }

  .ergo-360-product__hotspot-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
  }

  /* 内容块位置随+号尺寸调整 */
  .ergo-360-product__hotspot-content {
    left: 24px; /* 半径(18px) + 间距(6px) */
    border-radius: 16px;
  }

  .ergo-360-product__hotspot--icon-right .ergo-360-product__hotspot-content {
    left: auto;
    right: 24px;
  }

  /* Phase 1 展开宽度 */
  .ergo-360-product__hotspot.is-expanding-width .ergo-360-product__hotspot-content {
    width: 296px !important; /* 视频宽度(280px) + padding(16px) */
  }

  .ergo-360-product__hotspot-header {
    padding: 8px 16px;
    gap: 12px;
  }

  .ergo-360-product__hotspot-name {
    font-size: 16px;
  }

  .ergo-360-product__hotspot-view {
    font-size: 12px;
  }

  .ergo-360-product__hotspot-video video {
    width: 280px;
    border-radius: 10px;
  }
}

/* ========== 移动端响应式 (< 1024px) ========== */
@media screen and (max-width: 1023px) {
  /* 容器 - 移除固定比例，设置最小高度确保卡片可见 */
  .ergo-360-product {
    aspect-ratio: unset;
    min-height: calc(100vw * 1620 / 1125 + 280px); /* 图片高度 + 卡片区预留空间 */
    padding-bottom: 0；
  }

  /* 背景容器 - 相对定位 + 固定高度作为图片区域 */
  .ergo-360-product__bg-container {
    position: relative;
    height: calc(100vw * 1620 / 1125); /* 144vw */
  }

  /* 内容层 - 绝对定位覆盖图片区域，但允许溢出显示卡片 */
  .ergo-360-product__content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: calc(100vw * 1620 / 1125); /* 144vw */
    overflow: visible; /* 允许卡片区溢出到图片下方 */
  }

  /* 背景图切换 */
  .ergo-360-product__bg--desktop {
    display: none !important;
  }

  .ergo-360-product__bg--mobile {
    display: block !important;
    background-color: #ffffff;
  }

  /* 移动端背景图片 - 固定比例 1125:1620，顶部对齐 */
  .ergo-360-product__bg--mobile img {
    width: 100%;
    height: auto;
    aspect-ratio: 1125 / 1620;
    object-fit: cover;
    object-position: top;
  }

  /* 导航栏 */
  .ergo-360-product__nav {
    top: 24px;
    left: 24px;
    right: 24px;
    flex-direction: column;
    gap: 8px;
  }

  .ergo-360-product__nav-prefix {
    display: none;
  }

  .ergo-360-product__nav-main {
    width: 100%;
    padding: 2px;
    border-radius: 10px;
    justify-content: space-between;
  }

  .ergo-360-product__nav-btn {
    font-size: 12px;
    padding: 10px 8px;
    height: 38px;
    border-radius: 8px;
    flex: 1;
    justify-content: center;
  }

  .ergo-360-product__nav-icon {
    width: 18px;
    height: 18px;
  }

  /* 左侧内容区 - 绝对定位在图片下方 */
  .ergo-360-product__left-content {
    position: absolute;
    top: 100%; /* 相对于内容层，100% = 144vw，在图片正下方 */
    bottom: auto;
    left: 24px;
    right: 24px;
    margin-top: 0;
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  /* 内容卡片 - 移动端相对定位，文档流 */
  .ergo-360-product__card {
    position: relative !important;
    left: auto;
    top: auto;
    width: auto;
    padding: 16px;
    border-radius: 10px;
    /* 隐藏非激活卡片，激活卡片显示 */
    display: none;
  }

  .ergo-360-product__card.is-active {
    display: block;
    opacity: 1 !important;
    transform: none !important;
  }

  /* PC 端 Result 按钮 - 移动端隐藏 */
  .ergo-360-product__result--desktop {
    display: none !important;
  }

  /* 移动端 Result 按钮 - 显示在导航栏下方（默认隐藏，通过 JS 添加 is-visible 类显示） */
  .ergo-360-product__result--mobile {
    display: none;
    position: absolute;
    left: 22px;
    top: 70px;
    border-radius: 10px;
    padding: 2px;
    width: fit-content;
  }

  .ergo-360-product__result--mobile.is-visible {
    display: flex;
  }

  .ergo-360-product__result--mobile .ergo-360-product__result-icon {
    width: 18px;
    height: 18px;
  }

  .ergo-360-product__result--mobile .ergo-360-product__result-text {
    font-size: 7px;
  }

  .ergo-360-product__result--mobile .ergo-360-product__result-inner {
    padding: 10px 8.5px;
    width: 37.5px;
    height: 38px;
    gap: 2px;
  }

  .ergo-360-product__card-title {
    font-size: 14px;
    margin-bottom: 16px;
  }

  .ergo-360-product__card-main p,
  .ergo-360-product__card-stat p,
  .ergo-360-product__card-cta {
    font-size: 14px;
  }

  .ergo-360-product__card-main {
    margin-bottom: 16px;
  }

  .ergo-360-product__card-stat {
    margin-bottom: 16px;
  }

  .ergo-360-product__card-icon {
    width: 18px;
    height: 18px;
  }

  /* Hotspot - 使用 vw 单位定位（原 top% 相对于 765px 容器，换算为 vw） */
  .ergo-360-product__hotspot {
    left: calc(var(--mobile-left) * 1vw) !important;
    top: calc(var(--mobile-top) * 2.04vw) !important;
  }

  .ergo-360-product__hotspot-icon {
    width: 32px;
    height: 32px;
  }

  .ergo-360-product__hotspot-icon svg {
    width: 16px;
    height: 16px;
  }

  .ergo-360-product__hotspot-content {
    left: 20px;
    border-radius: 12px;
  }

  /* 移动端：重置 PC 的 icon-right，默认 icon 在左边 */
  .ergo-360-product__hotspot--icon-right .ergo-360-product__hotspot-content {
    left: 20px;
    right: auto;
  }

  /* 移动端：icon-right-mobile 类让 icon 在右边 */
  .ergo-360-product__hotspot--icon-right-mobile .ergo-360-product__hotspot-content {
    left: auto !important;
    right: 20px !important;
  }

  .ergo-360-product__hotspot-header {
    padding: 6px 12px;
    gap: 8px;
  }

  .ergo-360-product__hotspot-name {
    font-size: 12px;
  }

  .ergo-360-product__hotspot-view {
    font-size: 12px;
  }

  /* 移动端禁用 hover 展开 */
  .ergo-360-product__hotspot-video {
    display: none !important;
  }

  .ergo-360-product__hotspot.is-expanding-width .ergo-360-product__hotspot-content,
  .ergo-360-product__hotspot.is-expanded .ergo-360-product__hotspot-content {
    width: auto !important;
    transform: translateY(-50%);
  }

  .ergo-360-product__hotspot--expand-up.is-expanding-width .ergo-360-product__hotspot-content,
  .ergo-360-product__hotspot--expand-up.is-expanded .ergo-360-product__hotspot-content {
    transform: translateY(50%);
  }

  /* PC 弹窗隐藏 */
  .ergo-360-product__popup {
    display: none !important;
  }

  /* ========== 移动端 Line 装饰图层 ========== */
  .ergo-360-product__lines--mobile .ergo-360-product__line {
    position: absolute;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
  }

  .ergo-360-product__lines--mobile .ergo-360-product__line.is-active {
    opacity: 1;
  }

  /* NECK line - Figma: 258/194, 64x128 @ 375x812 */
  /* top 换算为 vw：原 top% * 2.04 */
  .ergo-360-product__lines--mobile .ergo-360-product__line[data-state="NECK"] {
    left: 68.8%; /* 258/375 */
    top: calc(21.92 * 2.04vw); /* 原 21.92% → 44.72vw */
    width: 17.07%; /* 64/375 */
    height: auto;
    aspect-ratio: 1 / 2; /* 64:128 序列帧比例 */
  }

  /* SPINE line - Figma: 69/201, 72x144 @ 375x812 */
  .ergo-360-product__lines--mobile .ergo-360-product__line[data-state="SPINE"] {
    left: 18.4%; /* 69/375 */
    top: calc(24.75 * 2.04vw); /* 原 24.75% → 50.49vw */
    width: 19.2%; /* 72/375 */
    height: auto;
    aspect-ratio: 1 / 2; /* 72:144 序列帧比例 */
  }

  /* LEGS line - Figma: 141/289, 94x187 @ 375x812 */
  .ergo-360-product__lines--mobile .ergo-360-product__line[data-state="LEGS"] {
    left: 32.6%; /* 141/375 */
    top: calc(35.59 * 2.04vw); /* 原 35.59% → 72.6vw */
    width: 25.07%; /* 94/375 */
    height: auto;
    aspect-ratio: 1 / 2; /* 94:187 序列帧比例 */
  }

  /* HIPS line - Figma: 214/270, 65x129 @ 375x812 */
  .ergo-360-product__lines--mobile .ergo-360-product__line[data-state="HIPS"] {
    left: 57.07%; /* 214/375 */
    top: calc(33.25 * 2.04vw); /* 原 33.25% → 67.83vw */
    width: 17.33%; /* 65/375 */
    height: auto;
    aspect-ratio: 1 / 2; /* 65:129 序列帧比例 */
  }
}

/* ========== 移动端第一层弹窗 ========== */
.ergo-360-product__mobile-popup {
  z-index: 9999 !important;
  transition: visibility 0.3s, opacity 0.3s;
}

.ergo-360-product__mobile-popup.is-open {
  visibility: visible !important;
  opacity: 1 !important;
  display: block !important;
}

/* 遮罩层强制显示 */
.ergo-360-product__mobile-popup-mask {
  display: block !important;
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

.ergo-360-product__mobile-popup.is-open .ergo-360-product__mobile-popup-mask {
  opacity: 1;
}

/* 弹窗卡片从底部滑入 - 抽屉动效 */
.ergo-360-product__mobile-popup-card {
  display: block !important;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}

.ergo-360-product__mobile-popup.is-open .ergo-360-product__mobile-popup-card {
  transform: translateY(0);
}

/* ========== 移动端第二层弹窗 (PC 弹窗覆盖) ========== */
@media screen and (max-width: 1023px) {
  /* 移动端显示 PC 弹窗为第二层 */
  .ergo-360-product__popup {
    z-index: 9999 !important;
  }

  .ergo-360-product__popup.is-open {
    display: block !important;
  }

  /* 新布局：使用 Tailwind 类控制，注释掉旧的 CSS 覆盖 */
  /*
  .ergo-360-product__popup-container {
    left: 0 !important;
    right: 0 !important;
    height: auto !important;
    max-height: calc(100vh - 60px);
    border-radius: 16px 16px 0 0;
    overflow-y: auto;
    padding-bottom: 100px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  }
  */

  .ergo-360-product__popup.is-open .ergo-360-product__popup-container {
    transform: translateY(0);
  }

  /* 新布局：关闭按钮位置由 Tailwind 控制 */
  /*
  .ergo-360-product__popup-close {
    right: 14px !important;
    top: 8px !important;
    width: 32px !important;
    height: 32px !important;
  }

  .ergo-360-product__popup-close svg {
    width: 32px;
    height: 32px;
  }
  */

  /* 新布局：内容区域由 Tailwind 控制 */
  /*
  .ergo-360-product__popup-content {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: auto !important;
    padding: 45px 29px 0 29px;
  }

  .ergo-360-product__popup-content p,
  .ergo-360-product__popup-content div {
    font-size: 12px !important;
  }

  .ergo-360-product__popup-product-name {
    font-size: 24px !important;
    margin-top: 24px !important;
    margin-bottom: 8px !important;
  }

  .ergo-360-product__popup-content span[class*="yd-px-5"] {
    font-size: 10px;
    padding: 4px 12px;
  }

  .ergo-360-product__popup-content ul {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 12px !important;
    margin-top: 16px !important;
  }

  .ergo-360-product__popup-content ul img {
    width: 20px !important;
    height: 20px !important;
  }

  .ergo-360-product__popup-content ul span {
    font-size: 12px !important;
    letter-spacing: -0.3px !important;
  }

  .ergo-360-product__popup-content ul li {
    gap: 8px !important;
  }
  */

  /* 新布局：视频区域由 Tailwind 控制 */
  /*
  .ergo-360-product__popup-video {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: calc(100% - 58px) !important;
    margin: 16px 29px;
    height: auto !important;
    aspect-ratio: 311 / 175;
    border-radius: 12px;
    overflow: hidden;
  }

  .ergo-360-product__popup-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  */

  /* 新布局：Scrub 控制器由 Tailwind 控制 */
  /*
  .ergo-360-product__scrub-control {
    display: block !important;
    position: relative !important;
    left: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: calc(100% - 66px) !important;
    height: auto !important;
    margin: 16px 33px !important;
  }

  .ergo-360-product__scrub-control .ergo-360-product__scrub-title {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    display: block !important;
    font-size: 14px !important;
    margin-bottom: 8px;
  }

  .ergo-360-product__scrub-control .ergo-360-product__scrub-labels {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    font-size: 10px !important;
    margin-bottom: 8px;
  }

  .ergo-360-product__scrub-control .ergo-360-product__scrub-label {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    font-size: 10px !important;
  }

  .ergo-360-product__scrub-control .ergo-360-product__scrub-track {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    height: 16px !important;
  }

  .ergo-360-product__scrub-control .ergo-360-product__scrub-thumb {
    width: 24px !important;
    height: 24px !important;
  }

  .ergo-360-product__scrub-control .ergo-360-product__scrub-values {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    font-size: 10px !important;
    margin-top: 8px;
  }

  .ergo-360-product__scrub-control .ergo-360-product__scrub-value {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    font-size: 10px !important;
  }
  */

  /* 新布局：Segment 控制器由 Tailwind 控制 */
  /*
  .ergo-360-product__segment-control {
    display: block !important;
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: calc(100% - 74px) !important;
    margin: 16px 37px !important;
  }

  .ergo-360-product__segment-buttons {
    width: 100% !important;
    gap: 8px !important;
  }

  .ergo-360-product__segment-btn {
    flex: 1 !important;
    font-size: 14px !important;
    padding: 8px 16px !important;
    background: rgba(0, 0, 0, 0.08) !important;
    color: #000 !important;
    opacity: 0.6;
    border: none !important;
    border-radius: 8px !important;
  }

  .ergo-360-product__segment-btn.is-active {
    background: rgba(19, 75, 214, 0.15) !important;
    border: 1.5px solid #134BD6 !important;
    color: #134BD6 !important;
    opacity: 1;
    font-weight: 500 !important;
  }

  .ergo-360-product__popup-setup {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    display: block !important;
    font-size: 14px !important;
    margin: 16px 37px 0 37px !important;
  }
  */

  /* 新布局：ADD TO CART 按钮由 Tailwind 控制 */
  /*
  .ergo-360-product__popup-btn {
    position: absolute !important;
    left: 40px !important;
    right: 40px !important;
    bottom: 24px !important;
    top: auto !important;
    width: auto !important;
    background: transparent !important;
    border: 1px solid #134BD6 !important;
    color: #134BD6 !important;
  }

  .ergo-360-product__popup-btn:hover {
    background: rgba(19, 75, 214, 0.1) !important;
  }

  .ergo-360-product__popup-btn svg {
    color: #134BD6;
  }
  */
}

/* ========== Footrest 弹窗 ========== */

/* 弹窗过渡动画 */
.ergo-360-product__popup {
  transition: visibility 0.3s, opacity 0.3s;
}

.ergo-360-product__popup.is-open {
  visibility: visible !important;
  opacity: 1 !important;
}

/* 遮罩层 webkit 兼容 */
.ergo-360-product__popup-mask {
  -webkit-backdrop-filter: blur(25px);
  backdrop-filter: blur(25px);
}

/* 弹窗容器滑入动画 */
.ergo-360-product__popup-container {
  transition: transform 0.4s ease-out;
}

.ergo-360-product__popup.is-open .ergo-360-product__popup-container {
  transform: translateY(0);
}

/* 产品名称 */
.ergo-360-product__popup-product-name {
}

/* ADD TO CART 按钮状态 */
.ergo-360-product__popup-btn {
  transition: background-color 0.2s, opacity 0.2s;
}

.ergo-360-product__popup-btn.is-loading {
  pointer-events: none;
  opacity: 0.7;
}

.ergo-360-product__popup-btn.is-success {
  background: #22c55e !important;
}

.ergo-360-product__popup-btn.is-error {
  background: #ef4444 !important;
}

/* ========== 弹窗响应式 ========== */

/* 中等屏幕 (1280px - 1919px) */
@media screen and (min-width: 1280px) and (max-width: 1919px) {
  .ergo-360-product__popup-container {
    left: 4.17%;
    right: 4.17%;
    height: 830px;
  }

  /* 新网格布局：注释掉旧的绝对定位样式 */
  /* .ergo-360-product__popup-content {
    left: 8.33%;
    top: 12.5%;
    width: 37.5%;
  } */

  .ergo-360-product__popup-content p,
  .ergo-360-product__popup-content div {
    font-size: 18px;
  }

  .ergo-360-product__popup-product-name {
    margin-top: 80px;
  }

  .ergo-360-product__popup-content ul {
    gap: 26px;
  }

  .ergo-360-product__popup-content ul img {
    width: 27px;
    height: 27px;
  }

  .ergo-360-product__popup-content ul span {
    font-size: 18px;
  }

  /* 新网格布局：注释掉旧的绝对定位样式 */
  /* .ergo-360-product__popup-video {
    left: 50.8%;
    top: 19.7%;
    width: 37.3%;
    height: auto;
    aspect-ratio: 717 / 476;
  } */

  /* 新网格布局：按钮在左侧，注释掉旧的右下角定位 */
  .ergo-360-product__popup-btn {
    /* right: 13.7%;
    bottom: 14.2%; */
    padding: 14px 18px;
    font-size: 15px;
  }

  .ergo-360-product__popup-close {
    right: 12px;
    top: 12px;
    width: 42px;
    height: 42px;
  }
}

/* 较小桌面 (1024px - 1279px) */
@media screen and (min-width: 1024px) and (max-width: 1279px) {
  .ergo-360-product__popup-container {
    left: 40px;
    right: 40px;
    height: 700px;
    border-radius: 24px 24px 0 0;
  }

  /* 新网格布局：注释掉旧的绝对定位样式 */
  /* .ergo-360-product__popup-content {
    left: 80px;
    top: 80px;
    width: 380px;
  } */

  .ergo-360-product__popup-content p,
  .ergo-360-product__popup-content div {
    font-size: 16px;
  }

  .ergo-360-product__popup-product-name {
    margin-top: 60px;
    margin-bottom: 8px;
  }

  .ergo-360-product__popup-content ul {
    margin-top: 24px;
    gap: 20px;
  }

  .ergo-360-product__popup-content ul img {
    width: 24px;
    height: 24px;
  }

  .ergo-360-product__popup-content ul span {
    font-size: 16px;
  }

  /* 新网格布局：注释掉旧的绝对定位样式 */
  /* .ergo-360-product__popup-video {
    left: 500px;
    top: 120px;
    width: 450px;
    height: auto;
    aspect-ratio: 717 / 476;
  } */

  /* 新网格布局：按钮在左侧，注释掉旧的右下角定位 */
  .ergo-360-product__popup-btn {
    /* right: 80px;
    bottom: 80px; */
    padding: 12px 16px;
    font-size: 14px;
    border-radius: 6px;
  }

  .ergo-360-product__popup-close {
    right: 12px;
    top: 12px;
    width: 36px;
    height: 36px;
  }

  .ergo-360-product__popup-close svg {
    width: 36px;
    height: 36px;
  }
}

/* ========== 分段按钮样式 (Monitor Mount) ========== */
.ergo-360-product__segment-btn {
  background: rgba(0, 0, 0, 0.08);
  color: #000;
  opacity: 0.6;
  font-weight: 400;
  transition: all 0.2s ease;
}

.ergo-360-product__segment-btn:hover {
  opacity: 0.8;
}

.ergo-360-product__segment-btn.is-active {
  background: rgba(19, 75, 214, 0.15);
  color: #134bd6;
  opacity: 1;
  font-weight: 500;
  border: 2px solid #134bd6;
}

/* ========== Tab Line 装饰图层 (PC端) ========== */
.ergo-360-product__line {
  position: absolute;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  transition-delay: 0s; /* 淡出时无延时 */
  pointer-events: none;
}

.ergo-360-product__line.is-active {
  opacity: 1;
  transition-delay: 0.6s; /* 淡入时延时 0.6s，等背景图先淡入 */
}

/* Neck line - Figma: 1403/321, 140x280 @ 1920x1080 */
.ergo-360-product__line[data-state="NECK"] {
  left: 73.07%; /* 1403/1920 */
  top: 29.72%; /* 321/1080 */
  width: 7.29%; /* 140/1920 */
  height: auto;
  aspect-ratio: 1 / 2; /* 140:280 序列帧比例 */
}

/* Spine line - Figma: 1000/385, 153x306 @ 1920x1080 */
.ergo-360-product__line[data-state="SPINE"] {
  left: 52.08%; /* 1000/1920 */
  top: 35.65%; /* 385/1080 */
  width: 7.97%; /* 153/1920 */
  height: auto;
  aspect-ratio: 1 / 2; /* 153:306 序列帧比例 */
}

/* Legs line - Figma: 1160/540, 234x467 @ 1920x1080 */
.ergo-360-product__line[data-state="LEGS"] {
  left: 60.42%; /* 1160/1920 */
  top: 50%; /* 540/1080 */
  width: 12.19%; /* 234/1920 */
  height: auto;
  aspect-ratio: 1 / 2; /* 234:467 序列帧比例 */
}

/* Hips line - Figma: 1304/521, 146x293 @ 1920x1080 */
.ergo-360-product__line[data-state="HIPS"] {
  left: 67.92%; /* 1304/1920 */
  top: 48.24%; /* 521/1080 */
  width: 7.6%; /* 146/1920 */
  height: auto;
  aspect-ratio: 1 / 2; /* 146:293 序列帧比例 */
}

/* ========== Canvas 序列帧播放器 ========== */
.ergo-360-product__line-canvas {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  background: transparent;
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

/* Canvas 序列帧播放中状态 - 淡入显示 */
.ergo-360-product__line-canvas.is-playing {
  opacity: 1;
}

/* 移动端 canvas 序列帧：确保 .is-playing 正确覆盖移动端基础样式 */
.ergo-360-product__lines--mobile .ergo-360-product__line-canvas.is-playing {
  opacity: 1;
}

/* ========== 入场动画（PC端专用） ========== */
@media screen and (min-width: 1024px) {
  /* 初始状态：未触发入场动画时 */
  .ergo-360-product:not(.is-entrance-triggered) .ergo-360-product__bg {
    transform: scale(1.2);
    opacity: 0;
  }

  .ergo-360-product:not(.is-entrance-triggered) .ergo-360-product__nav,
  .ergo-360-product:not(.is-entrance-triggered) .ergo-360-product__card {
    transform: translateY(20px);
    opacity: 0;
  }

  /* 线条初始状态：隐藏（覆盖 is-active 的 opacity），排除 canvas */
  .ergo-360-product:not(.is-entrance-triggered) .ergo-360-product__line:not(.ergo-360-product__line-canvas),
  .ergo-360-product.is-entrance-triggered .ergo-360-product__line.is-active:not(.is-animating):not(.ergo-360-product__line-canvas) {
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    opacity: 0 !important;
  }

  /* Canvas 序列帧：由 .is-playing 类控制显示，不受入场动画影响 */

  /* 标签初始状态：隐藏（覆盖 is-visible 的 opacity） */
  .ergo-360-product:not(.is-entrance-triggered) .ergo-360-product__hotspot,
  .ergo-360-product.is-entrance-triggered .ergo-360-product__hotspot.is-visible:not(.is-animating) {
    transform: scale(1.16);
    opacity: 0 !important;
  }

  /* 入场触发后 - 背景 */
  .ergo-360-product.is-entrance-triggered .ergo-360-product__bg.is-active {
    animation: entrance-bg 700ms ease-out forwards;
  }

  /* 入场触发后 - 导航 */
  .ergo-360-product.is-entrance-triggered .ergo-360-product__nav {
    animation: entrance-fade-up 700ms ease-out forwards;
  }

  /* 入场触发后 - 卡片（延迟 100ms） */
  .ergo-360-product.is-entrance-triggered .ergo-360-product__card.is-active {
    animation: entrance-fade-up 700ms ease-out 100ms forwards;
  }

  /* 线条入场动画 - 通过 JS 添加 .is-animating 类触发 */
  /* NECK: 从上到下生长（仅适用于静态图片，canvas 由 JS 控制） */
  .ergo-360-product__line[data-state="NECK"]:not(.ergo-360-product__line-canvas).is-animating {
    animation: line-grow-down 1800ms ease-out forwards;
  }

  /* SPINE: 从上到下生长（仅适用于静态图片，canvas 由 JS 控制） */
  .ergo-360-product__line[data-state="SPINE"]:not(.ergo-360-product__line-canvas).is-animating {
    animation: line-grow-down-spine 1800ms ease-out forwards;
  }

  /* LEGS: 从左到右生长（仅适用于静态图片，canvas 由 JS 控制） */
  .ergo-360-product__line[data-state="LEGS"]:not(.ergo-360-product__line-canvas).is-animating {
    animation: line-grow-right 1800ms ease-out forwards;
  }

  /* HIPS: 从左到右生长（仅适用于静态图片，canvas 由 JS 控制） */
  .ergo-360-product__line[data-state="HIPS"]:not(.ergo-360-product__line-canvas).is-animating {
    animation: line-grow-right-hips 1800ms ease-out forwards;
  }

  /* 标签入场动画 - 通过 JS 控制 */
  .ergo-360-product__hotspot.is-animating {
    animation: entrance-hotspot 700ms ease-out forwards;
  }
}

/* ========== @keyframes 定义 ========== */

/* 背景缩放动画：120% → 100%，透明度 0 → 1 */
@keyframes entrance-bg {
  from {
    transform: scale(1.2);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* 淡入上浮动画：向上 20px，透明度 0 → 1 */
@keyframes entrance-fade-up {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* 线条生长动画 - 从上到下（NECK） */
@keyframes line-grow-down {
  0% {
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    opacity: 0;
    transform: scale(1);
  }
  5% {
    opacity: 1;
  }
  33.3% {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    transform: scale(1.16);
  }
  100% {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    transform: scale(1);
    opacity: 1;
  }
}

/* 线条生长动画 - 从上到下 + 保持旋转（SPINE） */
@keyframes line-grow-down-spine {
  0% {
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-7.28deg) scale(1);
  }
  5% {
    opacity: 1;
  }
  33.3% {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    transform: translate(-50%, -50%) rotate(-7.28deg) scale(1.16);
  }
  100% {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    transform: translate(-50%, -50%) rotate(-7.28deg) scale(1);
    opacity: 1;
  }
}

/* 线条生长动画 - 从左到右（LEGS） */
@keyframes line-grow-right {
  0% {
    clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
    opacity: 0;
    transform: scale(1);
  }
  5% {
    opacity: 1;
  }
  33.3% {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    transform: scale(1.16);
  }
  100% {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    transform: scale(1);
    opacity: 1;
  }
}

/* 线条生长动画 - 从左到右 + 保持旋转（HIPS） */
@keyframes line-grow-right-hips {
  0% {
    clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
    opacity: 0;
    transform: rotate(3.44deg) scale(1);
  }
  5% {
    opacity: 1;
  }
  33.3% {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    transform: rotate(3.44deg) scale(1.16);
  }
  100% {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    transform: rotate(3.44deg) scale(1);
    opacity: 1;
  }
}

/* 标签入场动画：缩放 116% → 100%，透明度 0 → 1 */
@keyframes entrance-hotspot {
  from {
    transform: scale(1.16);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ========== Quiz Result 弹窗样式 ========== */

/* 弹窗过渡动画 */
.ergo-360-product__quiz-popup {
  transition: visibility 0.3s ease-out, opacity 0.3s ease-out;
}

/* 弹窗打开状态 - 覆盖 Tailwind 的 yd-invisible yd-opacity-0 */
.ergo-360-product__quiz-popup.is-open {
  visibility: visible !important;
  opacity: 1 !important;
}

/* 遮罩层 webkit 兼容 */
.ergo-360-product__quiz-popup-mask {
  -webkit-backdrop-filter: blur(25px);
  backdrop-filter: blur(25px);
}

/* 弹窗卡片入场动画 */
.ergo-360-product__quiz-popup-card {
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
  transform: translateX(-50%) translateY(-50%) scale(0.95);
  opacity: 0;
}

.ergo-360-product__quiz-popup.is-open .ergo-360-product__quiz-popup-card {
  transform: translateX(-50%) translateY(-50%) scale(1);
  opacity: 1;
}
