
/* Title line with blue accent */
.title-line {
  position: relative;
  padding-top: 23px;
  text-align: left !important;
  text-align: center !important;
}

.title-line:before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  display: block;
  width: 60px;
  height: 5px;
  transform: translateX(-50%);
  background-color: var(--esp-color-blue);
}

.esp32-h21-wrap p {
  margin-top: 0;
  margin-bottom: 0;
}
.esp32-h21-wrap p + p {
  margin-top: 16px;
}

.esp32-h21-wrap .overview-wrap {
  padding-top: 60px;
  max-width: 1160px !important;
}

.esp32-h21-wrap .features-wrap {
  padding-top: 0;
  padding-bottom: 0;
  max-width: 1246px !important;
}

/* Features section */
.features-wrap .title-line {
  margin-bottom: 40px;
}

.features-content-wrap {
  width: 100%;
}

/* PC端：主内容区为浅灰圆角卡片，带柔和阴影 */
.features-main-content {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 68px;
  padding: 0 0 0 68px;
  min-height: 488px;
  background: linear-gradient(180deg, #F7FBFF 0%, #E8F1FA 100%);
  box-sizing: border-box;
}
.features-main-content:has(.features-text-item[data-value="1"].active) {
  border-radius: 68px 68px 68px 0;
}
.features-main-content:has(.features-text-item[data-value="4"].active) {
  border-radius: 68px 68px 0 68px;
}

.features-text-content {
  flex: 0 0 43.2%;
}
.features-text-content .features-text-slider h3 {
  margin-bottom: 24px;
}

.features-text-slider {
 position: relative;
}

/* 文字区域：PC 用 fadeUp，移动端用从右到左滑入 */
@keyframes featuresFadeUp {
  from {
    opacity: 0;
    transform: translateY(36px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 移动端：从右到左滑入（文字用） */
@keyframes featuresSlideInRight {
  from {
    opacity: 1;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 移动端：图片滑入，稍慢 + 轻微淡入，与文字错开 */
@keyframes featuresSlideInRightImage {
  from {
    opacity: 0.6;
    transform: translateX(80%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.features-text-item {
  opacity: 0;
  display: none;
  transition: none;
}

.features-text-item.active {
  opacity: 1;
  display: block;
}


/* fade-up：先置为 0 再播动画，避免一出现就全亮再动 */
.features-text-item.active {
  animation: featuresFadeUp 0.35s ease forwards;
}

.features-text-item h3 {
  margin: 0 0 12px 0;
  color: #38393a;
}

.features-text-item p {
  color: #38393a;
  margin: 0 0 16px 0;
}

.features-text-item p:last-child {
  margin-bottom: 0;
}

.features-image-content {
  position: absolute;
  right: 0;
  bottom: 0;
  height: 518px;
  width: 586px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.features-image-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* 图片区域：独立的 fadeUp / fadeDown，与文字错开 */
.features-image-item {
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transition: none;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.features-image-item.active {
  opacity: 1;
}


/* fade-up 时先置为 0，避免先出现再播动画导致闪烁；forwards 保持动画结束状态 */
.features-image-item.active {
  opacity: 0;
  animation: featuresFadeUp 0.5s ease forwards;
}

.features-image-item img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

/* Features tabs */
.features-tabs {
  display: flex;
  justify-content: space-between;
}

.features-tab-item {
  flex: 1;
  display: flex;
  align-items: center;
  text-align: center;
  cursor: pointer;
  padding: 20px 24px;
  transition: all 0.3s ease;
  position: relative;
  color: rgba(69, 69, 69, 0.6);
  text-align: left;
  line-height: 1.125;
  max-width: 256px;
  box-sizing: border-box;
}

.features-tab-item::after {
  display: none;
}

.features-tab-item:hover {
  color: #454545;
}
.features-tab-item:hover img {
  opacity: 1;
}

/* 纯 CSS 实现右上内凹圆角 */
.features-tab-item {
  font-family: var(--esp-font-family-regular);
}
.features-tab-item.active {
  position: relative;
  font-family: var(--esp-font-family-maison-bold);
  color: #454545;
}
/* 用伪元素做背景图，并沿 X 轴翻转（上下翻转） */
.features-tab-item.active::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  left: 0;
  right: -20px;
  background-image: url(../images/esp32-h21/active-bg.png);
  background-size: 100% 100%;
  background-position: center center;
  background-repeat: no-repeat;
  pointer-events: none;
}
.features-tab-item.active > * {
  position: relative;
  z-index: 1;
}
.features-tab-item[data-value="4"].active::before {
  background-image: url(../images/esp32-h21/active-bg.png);
  transform: scaleX(-1);
  right: 0;
  left: -20px;
}

.features-tab-item img {
  width: 36px;
  height: 36px;
  display: block;
  opacity: 0.6;
  margin-right: 16px;
}

.features-tab-item.active img {
  opacity: 1;
}

.features-tab-item span {
  color: inherit;
}

/* 移动端进度条（参考 H4）：仅小屏显示 */
.features-mobile-progress {
  display: none;
  position: relative;
  width: 100%;
  height: 4px;
  margin-top: 40px;
  background: transparent;
}
.features-mobile-progress-bg {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(56, 57, 58, 0.15);
  border-radius: 2px;
}
.features-mobile-progress-active {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 25%;
  background: #38393a;
  border-radius: 2px;
  transition: left 0.35s ease;
}

/* Responsive: < 1024px，取消卡片样式 + 移动端 transform 轨道滑动、进度条、导航 */
@media (max-width: 1023px) {
  .features-main-content {
    flex-direction: column;
    gap: 30px;
    background: transparent;
    box-shadow: none;
    padding: 0;
    background: linear-gradient(180.34deg, rgba(247, 251, 255, 0.968627) 48.45%, rgba(225, 237, 247, 0.968627) 112.32%);
    border-radius: 32px !important;
  }
  
  .features-text-content {
    flex: 1;
    max-width: 100% !important;
    min-width: 100% !important;
    order: 2;
    overflow: hidden;
  }
  
  /* 文字轨道：用 transform translateX 滑动 */
  .features-text-slider {
    position: static;
    display: flex;
    flex-direction: row;
    width: 400%;
    max-width: 400%;
    min-width: 400%;
    min-height: auto;
    transition: transform 0.35s ease;
    will-change: transform;
  }
  
  .features-text-slider .features-text-item {
    flex: 0 0 25%;
    width: 25%;
    min-width: 25%;
    display: block;
    opacity: 1;
    box-sizing: border-box;
    position: static;
    padding: 0 21px 30px 21px !important;
  }
  .features-image-item.active {
    animation: none !important;
  }
  
  .features-image-content {
    max-width: 100%;
    width: 100%;
    min-height: 300px;
    overflow: hidden;
    touch-action: pan-y pinch-zoom;
    position: static;
    height: fit-content;
    display: block;
  }
  .features-image-slider {
    position: static;
    display: flex;
    flex-direction: row;
    width: 400%;
    max-width: 400%;
    min-width: 400%;
    min-height: auto;
    transition: transform 0.35s ease;
    will-change: transform;
  }
  .features-image-slider .features-image-item {
    flex: 0 0 25%;
    width: 25%;
    min-width: 25%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    box-sizing: border-box;
  }
  .features-image-content .features-image-item {
    position: static;
    opacity: 1;
  }
  .features-image-content .features-image-item.active {
    animation: none !important;
  }
  
  .features-tabs {
    display: none;
  }
  
  .features-mobile-progress {
    display: block;
  }
}

/* Responsive: < 768px - 小屏仅做间距与字号微调 */
@media (max-width: 768px) {
  .esp32-h21-wrap .overview-wrap {
    padding-top: 28px;
    padding-bottom: 40px;
  }
  
  .features-wrap .title-line {
    padding-top: 16px;
    margin-bottom: 20px;
  }
  
  .features-text-item h3 {
    margin-bottom: 8px;
  }
  
  .features-image-content {
    min-height: 250px;
  }
  .features-mobile-progress  {
    margin-top: 20px;
  }
  .features-main-content {
    gap: 28px;
  }
  body:not(.views-display-home-dynews) .new-banner-video-wrap .video-banner-container {
    display: none !important;
  }
  body:not(.views-display-home-dynews) .new-banner-video-wrap picture {
    display: block !important;
  }
}

/* Responsive: < 1280px */
@media (max-width: 1280px) {
  .features-main-content {
    gap: 30px;
  }
  
  .features-text-content {
    flex: 0 0 42%;
    max-width: 42%;
  }
}

