.scrollable-image-text-wrapper {
  min-height: 100vh;
  height: auto;
  position: relative;
  overflow-x: clip;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

.scrollable-image-text-wrapper .scrollable-image-text-sticky {
  position: relative;
  min-height: 100vh;
  width: 100%;
}

/* 背景图片 - 添加具体选择器 */
.scrollable-image-text-wrapper .background-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
}

.scrollable-image-text-wrapper .background-image:before {
  content: "";
  /* 右侧渐变：左侧透明保留图片，右侧（文字区）适度压暗提升可读性 */
  background: linear-gradient(to right, transparent 25%, rgba(0, 0, 0, 0.38) 100%);
  position: absolute;
  height: 100%;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

.scrollable-image-text-wrapper .background-image__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* 背景占位图样式 */
.scrollable-image-text-wrapper .background-image svg.background-image__img {
  background-color: rgba(60, 60, 70, 1);
  color: rgba(255, 255, 255, 0.3);
}

/* 前景内容层 - 添加具体选择器 */
.scrollable-image-text-wrapper .content-overlay {
  position: relative;
  z-index: 2;
  height: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.scrollable-image-text-wrapper .content-wrapper {
  width: 80%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 30px;
  padding: 10vh 0;
}

/* 图片容器 - 添加具体选择器避免与image-comparison冲突 */
.scrollable-image-text-wrapper .image-container {
  width: 40%;
  aspect-ratio: var(--image-ratio, 3/4);
  min-height: var(--image-min-height, 420px);
  max-height: 70vh;
  flex-shrink: 0;
  overflow: hidden;
  position: sticky;
  top: 15vh;
  align-self: flex-start;
}

/* 图片样式 - 添加具体选择器 */
.scrollable-image-text-wrapper .image-container img {
  width: 100%;
  height: 100%;
  object-fit: var(--image-fit, cover);
  object-position: var(--image-position, center center);
  transition: opacity 0.4s ease-out; /* 优化：更快的过渡 */
  position: absolute;
  top: 0;
  left: 0;
  will-change: opacity; /* 优化：启用 GPU 加速 */
}

/* 当前显示的图片 */
.scrollable-image-text-wrapper .image-container img.active {
  opacity: 1;
  z-index: 2;
}

/* 隐藏的图片 */
.scrollable-image-text-wrapper .image-container img.inactive {
  opacity: 0;
  z-index: 1;
}

/* 图片占位符样式 */
.scrollable-image-text-wrapper .image-container svg {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  background-color: rgba(80, 80, 90, 0.9);
  color: rgba(255, 255, 255, 0.4);
  transition: opacity 0.4s ease-out;
  will-change: opacity;
}

.scrollable-image-text-wrapper .image-container svg.active {
  opacity: 1;
  z-index: 2;
}

.scrollable-image-text-wrapper .image-container svg.inactive {
  opacity: 0;
  z-index: 1;
}

/* 文本区域 - 添加具体选择器 */
.scrollable-image-text-wrapper .text-column {
  width: 50%;
  height: auto;
  position: relative;
  overflow: visible;
}

/* 文本对齐 - 左对齐 */
.scrollable-image-text-wrapper .text-column.text-left {
  margin-left: 0;
  margin-right: auto;
  text-align: left;
}

/* 文本对齐 - 居中 */
.scrollable-image-text-wrapper .text-column.text-center {
  margin-left: 15%;
  margin-right: auto;
  text-align: center;
}

/* 文本对齐 - 右对齐 */
.scrollable-image-text-wrapper .text-column.text-right {
  margin-left: auto;
  margin-right: 0;
  text-align: right;
}

.scrollable-image-text-wrapper .text-content {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  color: rgb(var(--color-text));
  max-width: 450px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
  opacity: 0.3;
  transition: opacity 0.7s ease;
  will-change: opacity;
  position: relative;
}

/* 文本对齐影响内部 flex 排列 */
.scrollable-image-text-wrapper .text-column.text-left .text-content {
  align-items: flex-start;
  text-align: left;
  margin-left: 0;
  margin-right: auto;
}

.scrollable-image-text-wrapper .text-column.text-center .text-content {
  align-items: center;
  text-align: center;
}

.scrollable-image-text-wrapper .text-column.text-right .text-content {
  align-items: flex-end;
  text-align: right;
  margin-left: auto;
  margin-right: 0;
}

/* 激活的文本块高亮 */
.scrollable-image-text-wrapper .text-content.active {
  opacity: 1;
}

/* 文本滚动容器 - 纵向堆叠，不限制高度 */
.scrollable-image-text-wrapper .text-scroll-container {
  position: relative;
  width: 100%;
  height: auto;
}

.scrollable-image-text-wrapper .page-number {
  font-size: 12px;
  margin-bottom: 10px;
  letter-spacing: 0.18em;
  font-weight: 400;
  text-transform: uppercase;
}

.scrollable-image-text-wrapper .page-title {
  font-size: 26px;
  margin-bottom: 15px;
  letter-spacing: 2px;
  font-weight: 400;
}

.scrollable-image-text-wrapper .page-content-text {
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 25px;
  max-width: 600px; /* 从500px增加到600px */
}

.scrollable-image-text-wrapper .page-button {
  cursor: pointer;
  position: relative;
  color: rgb(var(--color-text));
  text-decoration: none;
  display: inline-block;
  padding-bottom: 1px;
  font-size: 14px;
  margin: 20px 5px 0px 5px;
}

.scrollable-image-text-wrapper .page-button:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: rgb(var(--color-text));
  transform: scaleX(1);
  transform-origin: left center;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scrollable-image-text-wrapper .page-button:hover::after {
  transform: scaleX(0);
  transform-origin: left center;
}

.scrollable-image-text-wrapper .page-button:not(:hover)::after {
  transform: scaleX(1);
  transform-origin: left center;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s;
}

/* 导航小点 - 桌面和移动端均显示（多项时） */
.scrollable-image-text-wrapper .mobile-dots {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

/* 平板设备优化 */
@media (max-width: 1024px) and (min-width: 769px) {
  .scrollable-image-text-wrapper .image-container {
    max-height: 40vh;
  }
  
  .scrollable-image-text-wrapper .content-wrapper {
    gap: 25px;
  }
  
  .scrollable-image-text-wrapper .text-content {
    height: 50vh; /* 优化：调整文本高度 */
    max-width: 350px;
  }
  
  .scrollable-image-text-wrapper .text-scroll-container {
    height: 100vh; /* 优化：匹配新的滚动高度 */
    justify-content: flex-start;
    padding-top: 25vh; /* 优化：调整文本位置 */
  }
  
  .scrollable-image-text-wrapper .text-column {
    display: flex;
    align-items: flex-start; /* 文本列从顶部开始 */
    justify-content: center;
  }
  
  .scrollable-image-text-wrapper .image-container {
    align-self: center; /* 图片容器保持垂直居中 */
    margin-top: 5vh; /* 图片稍微向下偏移 */
  }
}

@media (max-width: 768px) {
  .scrollable-image-text-wrapper {
    height: auto;
    min-height: 100vh;
    position: relative; /* 确保容器作为定位父元素 */
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    overflow: hidden;
  }

  .scrollable-image-text-wrapper .scrollable-image-text-sticky {
    position: relative;
    height: auto;
    min-height: 100vh;
    overflow: hidden;
  }

  .scrollable-image-text-wrapper .content-overlay {
    min-height: 100vh;
  }

  .scrollable-image-text-wrapper .content-wrapper {
    flex-direction: column;
    width: 90%;
    gap: 20px;
    padding: 40px 0 64px 0; /* 底部留出空间给容器内指示器 */
  }
  
  .scrollable-image-text-wrapper .image-container {
    width: 100%;
    min-height: min(var(--image-min-height, 420px), 40vh);
    max-height: 40vh;
    margin: 0 auto 30px auto; /* 水平居中，底部间距 */
    overflow: hidden;
  }
  
  .scrollable-image-text-wrapper .text-column {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    height: auto;
    overflow: visible;
  }
  
  /* 移动端强制重置桌面对齐偏移，避免文案被挤压或截断 */
  .scrollable-image-text-wrapper .text-column.text-left,
  .scrollable-image-text-wrapper .text-column.text-center,
  .scrollable-image-text-wrapper .text-column.text-right {
    margin-left: 0;
    margin-right: 0;
    text-align: center;
  }
  
  .scrollable-image-text-wrapper .text-scroll-container {
    position: relative;
    height: auto;
    transform: none;
    transition: none;
  }
  
  .scrollable-image-text-wrapper .text-content {
    height: auto;
    width: 100%;
    max-width: 100%;
    padding: 24px 12px;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    transform: translateY(10px);
    overflow: visible;
    box-sizing: border-box;
  }

  .scrollable-image-text-wrapper .page-title {
    font-size: clamp(2.2rem, 7.2vw, 3rem);
    line-height: 1.25;
    letter-spacing: 0.4px;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .scrollable-image-text-wrapper .page-content-text {
    line-height: 1.65;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  
  .scrollable-image-text-wrapper .text-content.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
  }
  
  .scrollable-image-text-wrapper .text-content.fade-in {
    animation: scrollableMobileTextFadeIn 0.4s ease-out forwards;
  }
  
  .scrollable-image-text-wrapper .text-content.fade-out {
    animation: scrollableMobileTextFadeOut 0.3s ease-in forwards;
  }
  
  .scrollable-image-text-wrapper .mobile-dots {
    display: flex !important;
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0;
    z-index: 10;
    justify-content: center;
    width: auto;
  }
  
  .scrollable-image-text-wrapper .mobile-dots .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgb(var(--color-text) / 0.5);
    margin: 0 8px;
    cursor: pointer;
    transition: all 0.3s ease;
  }
  
  .scrollable-image-text-wrapper .mobile-dots .dot.active {
    background: rgb(var(--color-text));
    transform: scale(1.3);
  }
}

/* 重命名移动端文本切换动画，避免冲突 */
@keyframes scrollableMobileTextFadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scrollableMobileTextFadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* 桌面端特定样式 */
@media (min-width: 1000px) {
  .scrollable-image-text-wrapper .text-column.text-center {
    max-width: 400px; /* 从375px增加到400px */
  }
}
