<template>
  <div class="page-container">
    <header className="header flex items-center justify-between">
      <div class="logo">
        <img src="@/assets/image/logo.png" alt="logo" />
      </div>
      <div class="tabs">
        <div
          class="tab-item"
          :class="{ active: currentTab === 'home' }"
          @click="handleTabClick('home')"
        >
          首页
        </div>
        <div
          class="tab-item"
          :class="{ active: currentTab === 'company' }"
          @click="handleTabClick('company')"
        >
          公司概况
        </div>
        <div
          class="tab-item"
          :class="{ active: currentTab === 'business' }"
          @click="handleTabClick('business')"
        >
          业务介绍
        </div>
      </div>
    </header>
    <main>
      <section style="background: #ffffff">
        <div class="relative section-first h-[1524px] box-contain pt-[718px]">
          <div
            class="w-[640px] title ml-[188px]"
            :ref="
              (el) => {
                moveRefs[0].value = el;
              }
            "
          >
            <div>领航文艺全周期</div>
            <div>创变价值新巅峰</div>
          </div>
          <div
            :ref="
              (el) => {
                moveRefs[1].value = el;
              }
            "
            class="w-full text-[35px] text-[#8B59F7] w-[958px] ml-[188px] mt-[55px]"
          >
            FiEE立志成为文艺创作全周期的掌舵人，深度参与从灵感初绽、作品打磨完成，到市场推广宣传、文化广泛传播的每一处关键节点
          </div>

          <div ref="moveRef3" class="absolute top-[603px] right-[63px]">
            <img
              class="w-[949px] h-[574px]"
              src="@/assets/image/companyprofil/image-q.png"
            />
          </div>
        </div>

        <div class="w-[1920px] h-[955px]">
          <img src="@/assets/image/companyprofil/icon-lang.png" alt="logo" />
        </div>
      </section>

      <section style="background: #f8f9ff">
        <div class="flex flex-wrap justify-center">
          <div class="content w-full px-[188px] mt-[113px]">
            <div class="text-[#8B59F7] text-[40px]">公司介绍</div>
          </div>
          <div class="w-full title mt-[58px] px-[188px]">
            <div>独树一帜</div>
            <div>全周期价值赋能领航者</div>
          </div>
          <div class="w-full px-[188px] mt-[140px]">
            <div
              :ref="
                (el) => {
                  moveRefs[2].value = el;
                }
              "
              class="text-[#455363] text-[40px] w-[1345px]"
            >
              FiEE彻底打破传统单一服务机构的局限，以行业变革者的姿态，深度融合前沿技术与丰富多元的资源，精心构建起一套贯穿文艺创作从萌芽构思到辉煌绽放全流程的
              "全周期" 价值赋能体系。
            </div>
            <div
              :ref="
                (el) => {
                  moveRefs[3].value = el;
                }
              "
              class="mt-[60px] text-[#455363] text-[40px] w-[1345px]"
            >
              无论你是刚刚踏入文艺殿堂、怀揣梦想的创作新人，还是在文艺道路上摸爬滚打、渴望突破创作瓶颈、攀登更高文艺巅峰的成熟文艺工作者，FiEE都将成为你最坚实的伙伴，一路贴心陪伴，为你的文艺征途遮风挡雨，指引前行的方向。
            </div>
          </div>
          <div
            :ref="
              (el) => {
                moveRefs[4].value = el;
              }
            "
            class="mt-[140px] mb-[235px] overflow-hidden"
          >
            <img
              :ref="
                (el) => {
                  moveRefs[5].value = el;
                }
              "
              class="w-[1625px] h-[1038px]"
              src="@/assets/image/companyprofil/imageshow-2.png"
            />
          </div>
        </div>
      </section>

      <section class="relative" style="background: #fff">
        <div class="flex flex-wrap justify-center">
          <div class="content w-full px-[188px] mt-[113px]">
            <div class="text-[#8B59F7] text-[40px]">团队介绍</div>
          </div>
          <div class="w-full title mt-[58px] px-[188px]">
            <div>汇聚精英</div>
            <div>点燃文艺创变引擎</div>
          </div>
          <div class="w-full px-[188px] mt-[140px]">
            <div
              :ref="
                (el) => {
                  moveRefs[6].value = el;
                }
              "
              class="text-[#455363] text-[40px] w-[1345px]"
            >
              FiEE团队由运营专家、技术精英及国际顾问组成，提供从内容策划到全球推广的全方位支持。通过跨界合作与资源整合，FiEE突破传统边界，探索文艺新表达。依托前沿技术与精准营销，助力作品实现商业价值与社会影响力的双重提升，为文艺繁荣注入持久动力。
            </div>
          </div>
          <div class="mt-[143px] mb-[188px] overflow-hidden">
            <img
              :ref="
                (el) => {
                  moveRefs[7].value = el;
                }
              "
              class="w-[1625px] h-[1038px]"
              src="@/assets/image/companyprofil/imageshow-3.png"
            />
          </div>
          <div class="w-full px-[188px]">
            <img
              class="w-[145px] h-[145px]"
              src="@/assets/image/companyprofil/icon-lun.png"
            />

            <div class="w-full mt-[50px] text-[#10253E] text-[45px]">
              纵横全球 多元领航
            </div>
            <div class="mt-[38px] text-[#455363] text-[40px] w-[1345px]">
              海外精准营销，铺设多元渠道，塑造国际品牌。智能管理
              多语言平台，提供本地化服务。
            </div>
          </div>
          <div class="w-full px-[188px] mt-[170px]">
            <img
              class="w-[145px] h-[145px]"
              src="@/assets/image/companyprofil/icon-love.png"
            />

            <div class="w-full mt-[50px] text-[#10253E] text-[45px]">
              深耕粉丝 构筑生态
            </div>
            <div class="mt-[38px] text-[#455363] text-[40px] w-[1345px]">
              社区精细运营，提供多元增值服务。升级社群管理工具，精准触达用户。创新激励机制，开发特色衍生周边。
            </div>
          </div>
          <div class="w-full px-[188px] mt-[160px] mb-[250px]">
            <img
              class="w-[145px] h-[145px]"
              src="@/assets/image/companyprofil/icon-p.png"
            />

            <div class="w-full mt-[50px] text-[#10253E] text-[45px]">
              广纳贤才 团队进阶
            </div>
            <div class="mt-[38px] text-[#455363] text-[40px] w-[1345px]">
              广纳技术、营销精英，注入创新活力。强化内部培训，优化组织架构。引入先进理念，提升管理与服务效能。
            </div>
          </div>

          <div class="icon-langmul">
            <img
              class="w-[846px] h-[216px]"
              src="@/assets/image/companyprofil/icon-langmul.png"
            />
          </div>
        </div>
      </section>
      <section class="section-four">
        <div class="flex flex-wrap justify-center">
          <div class="content w-full px-[188px] mt-[458px]">
            <div class="text-[#8B59F7] text-[40px]">卓越建树</div>
          </div>
          <div
            :ref="
              (el) => {
                moveRefs[8].value = el;
              }
            "
            class="w-full title mt-[58px] px-[188px]"
          >
            <div>以开拓之姿</div>
            <div>登文艺之巅</div>
          </div>
          <div class="w-full px-[188px] mt-[140px]">
            <div
              :ref="
                (el) => {
                  moveRefs[9].value = el;
                }
              "
              class="text-[#455363] text-[40px] w-[1345px]"
            >
              长期深耕文艺领域，FiEE持续拓展业务版图，积累了深厚的行业资源，搭建起广泛的合作网络。目前已与多个全球热门自媒体平台深度携手，从多维度助力文艺创作者闪耀国际舞台，绽放独有的艺术光芒。
            </div>
          </div>
          <div
            :ref="
              (el) => {
                moveRefs[10].value = el;
              }
            "
            class="w-full mt-[260px] px-[188px] text-[55px] font-semibold"
          >
            <div>权威资质认证</div>
            <div>铸就文艺事业坚实根基</div>
          </div>
          <div
            :ref="
              (el) => {
                moveRefs[11].value = el;
              }
            "
            class="w-full px-[188px] mt-[60px]"
          >
            <div class="text-[#455363] text-[40px] w-[1345px]">
              FiEE提供专业且权威的资质认证服务，助力文艺创作者获取行业广泛认可的资质。这不仅能让文艺创作者的作品价值得到显著提升，更能使文艺创作者在竞争白热化的艺术市场中崭露头角，大幅增强文艺工作者的市场竞争力，为文艺创作者的事业铺就稳固基石。
            </div>
          </div>
          <div
            :ref="
              (el) => {
                moveRefs[12].value = el;
              }
            "
            class="mt-[120px] mb-[260px] overflow-hidden"
          >
            <img
              class="w-[1625px] h-[1038px]"
              src="@/assets/image/companyprofil/imageshow-4.png"
            />
          </div>
          <div
            :ref="
              (el) => {
                moveRefs[13].value = el;
              }
            "
            class="w-full px-[188px] text-[55px] font-semibold"
          >
            <div>全球平台矩阵</div>
            <div>拓展文艺传播边界</div>
          </div>
          <div class="w-full px-[188px] mt-[60px]">
            <div
              :ref="
                (el) => {
                  moveRefs[14].value = el;
                }
              "
              class="text-[#455363] text-[40px] w-[1345px]"
            >
              <div>
                FiEE凭借深厚的行业资源和广泛的合作网络，与超过 30
                个全球热门自媒体平台达成深度战略合作伙伴关系。
              </div>
              <div>
                从国际知名的社交平台，到专注文艺领域的专业媒体，我们为文艺创作者精心打造专属账号，并运用先进的优化策略，让文艺创作者的账号在众多创作者中脱颖而出。
              </div>
            </div>
          </div>
          <div class="mt-[120px] mb-[220px] overflow-hidden">
            <img
              :ref="
                (el) => {
                  moveRefs[15].value = el;
                }
              "
              class="w-[1625px] h-[1038px]"
              src="@/assets/image/companyprofil/imageshow-5.png"
            />
          </div>
        </div>
      </section>
      <section style="background: #fff">
        <div class="flex flex-wrap justify-center">
          <div class="content w-full px-[188px] mt-[245px]">
            <div class="text-[#8B59F7] text-[40px]">聚焦FiEE前沿动态</div>
          </div>
          <div
            :ref="
              (el) => {
                moveRefs[16].value = el;
              }
            "
            class="w-full title mt-[58px] px-[188px]"
          >
            <div>洞察趋势</div>
            <div>点亮文艺前行灯塔</div>
          </div>
          <div class="w-full px-[188px] mt-[140px]">
            <div
              :ref="
                (el) => {
                  moveRefs[17].value = el;
                }
              "
              class="text-[#455363] text-[40px] w-[1345px]"
            >
              FIEE始终扎根文艺领域，时刻紧跟全球艺术发展趋势。通过深度剖析案例、开展跨界研讨，探索文艺与科技、商业的深度融合，为文艺事业未来发展提供前瞻性洞察与灵感启迪。
            </div>
          </div>
          <div class="w-full mt-[143px] flex flex-wrap justify-end">
            <div class="flex flex-wrap">
              <div class="arrow-btn" @click="handlePrev">
                <img
                  class="w-[95px] h-[95px]"
                  src="@/assets/image/companyprofil/icon-left.png"
                />
              </div>
              <div class="arrow-btn ml-[63px] mr-[230px]" @click="handleNext">
                <img
                  class="w-[95px] h-[95px]"
                  src="@/assets/image/companyprofil/icon-right.png"
                />
              </div>
            </div>
          </div>
          <div
            class="mt-[73px] mb-[253px] carousel-container px-[80px] py-[40px]"
          >
            <div
              ref="carouselTrack"
              class="carousel-track"
              :style="{
                transform: `translateX(-${getSlideOffset()}px)`,
              }"
              @mousedown="handleDragStart"
              @mousemove="handleDragMove"
              @mouseup="handleDragEnd"
              @mouseleave="handleDragEnd"
              @touchstart="handleDragStart"
              @touchmove="handleDragMove"
              @touchend="handleDragEnd"
            >
              <div
                v-for="(item, idx) in getVisibleItems()"
                :key="idx"
                class="carousel-item"
                @click="handleCarouselClick(item, $event)"
              >
                <img class="carousel-image" :src="item.imgUrl" />
                <div class="carousel-content">
                  <div class="carousel-title">
                    <div>{{ item.title }}</div>
                  </div>
                  <div class="carousel-subtitle">
                    <div>{{ item.subTitle }}</div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </section>

      <section
        style="background: #fff"
        className="flex flex-wrap justify-center"
      >
        <img
          class="w-[580px] h-[55px] my-[85px]"
          src="@/assets/image/image-footer.png"
          alt="logo"
        />
      </section>
    </main>
  </div>
</template>

<script setup>
import { onUnmounted, ref, onMounted, reactive, nextTick } from "vue";
import gsap from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";
import { useHome } from "@/store/home/index.js";
import { useTransitionComposable } from "@/composables/transition-composable";

// 定义组件的自定义事件
defineEmits(["sendCode"]);

// 注册 ScrollTrigger 插件
gsap.registerPlugin(ScrollTrigger);

const { transitionState } = useTransitionComposable();

const moveRefs = ref(
  Array(18)
    .fill(null)
    .map(() => ref(null))
);
const { currentTab } = useHome();
let ctx;

// 导入图片
import carouselShow1 from "@/assets/image/companyprofil/carouselShow-1.png";
import carouselShow2 from "@/assets/image/companyprofil/carouselShow-2.png";
import carouselShow3 from "@/assets/image/companyprofil/carouselShow-3.png";
import carouselShow4 from "@/assets/image/companyprofil/carouselShow-4.png";
import carouselShow5 from "@/assets/image/companyprofil/carouselShow-5.png";

const state = reactive({
  marqueeArr: [
    {
      title: "实现技术突破，引领文艺创作技术革新",
      subTitle:
        "在数字化浪潮以前所未有的态势席卷文艺领域的当下，文艺创作正经历着深刻变革。FiEE凭借着团队持之以恒的努力与创新精神，在文艺创作技术领域取得了具有里程碑意义的重大突破。 历经无数个日夜的艰苦攻坚，FiEE自主研发的新一代智能创作辅助系统正式上线，宛如一颗冉冉升起的璀璨新星，为文艺创作开辟了全新的发展路径，给整个行业带来了前所未有的变革与机遇。",
      imgUrl: carouselShow1,
    },
    {
      title:
        "全球化战略升级，FiEE与30+国际平台达成战略合作，构建文艺传播新矩阵",
      subTitle:
        "在全球文化交融以前所未有的迅猛之势加速推进的时代大背景下，文艺领域已然成为文化交流与创新的前沿阵地。作为文艺行业的领航者，FiEE 以敏锐的战略眼光和果敢的行动力，积极投身于这场全球文化交流的浪潮之中。 近日，FiEE 振奋人心地宣布与 TikTok、Instagram等 30 余家国际头部自媒体平台达成深度战略合作，同时正式启动具有深远意义的'文艺无界计划'，矢志破除地域之间的文化藩篱。",

      imgUrl: carouselShow2,
    },
    {
      title: "助力文艺创作者，FiEE 发布'AI × 短视频'全链路解决方案",
      subTitle:
        "对于文艺创作者而言，创作瓶颈与效率低下是横亘在前行道路上的两座大山。构思一个吸引人的短视频脚本，常常需要耗费大量时间和精力，创作者们不仅要绞尽脑汁思考独特的创意，还要兼顾受众喜好和市场趋势。 作品完成后的传播与推广，同样是一道难以跨越的鸿沟。",
      imgUrl: carouselShow3,
    },
    {
      title: "FiEE启动 18 个月艺术 KOL 孵化，培育文艺领域明日之星",
      subTitle:
        "在文艺产业蓬勃发展的当下，优质内容创作者的重要性愈发凸显。作为行业内的先锋企业，FiEE始终关注着文艺领域的人才培养与发展动态。 今日，FiEE正式宣布启动一项精心筹备长达 18 个月的艺术 KOL 孵化计划，旨在为文艺领域培育一批具有强大影响力的明日之星，推动整个行业的创新发展。",

      imgUrl: carouselShow4,
    },
    {
      title: "多元人才汇聚，FiEE 构筑文艺创新发展基石",
      subTitle:
        "在当下文艺行业蓬勃发展、百花齐放的黄金时代，创新俨然成为引领行业持续进步、突破传统格局的关键要素。而追根溯源，人才作为创新的核心驱动力，其重要性不言而喻。 FiEE 深明此理，以海纳百川的胸怀和高瞻远瞩的战略眼光，积极广纳贤才，精心汇聚运营专家、技术精英以及国际顾问。",

      imgUrl: carouselShow5,
    },
  ],
});

const carouselTrack = ref(null);
const currentIndex = ref(0);

const getVisibleItems = () => {
  const items = state.marqueeArr;
  // 创建一个包含所有项目的数组，前后各复制一组用于无缝循环
  return [...items, ...items, ...items];
};

// 计算实际滑动距离
const getSlideOffset = () => {
  if (!carouselTrack.value) return 0;

  const firstItem = carouselTrack.value.querySelector(".carousel-item");
  if (!firstItem) return 0;

  const itemWidth = firstItem.offsetWidth;
  const itemMargin = parseInt(window.getComputedStyle(firstItem).marginRight);
  const totalWidth = itemWidth + itemMargin;

  // 初始偏移一组数据的长度，从而从中间组开始显示，并增加40px的额外偏移
  const initialOffset = state.marqueeArr.length * totalWidth + 32;
  return initialOffset + currentIndex.value * totalWidth;
};

// 定义 resize 处理函数
const handleResize = () => {
  if (carouselTrack.value) {
    carouselTrack.value.style.transform = `translateX(-${getSlideOffset()}px)`;
  }
};

// 监听窗口大小变化
onMounted(() => {
  console.log(moveRefs.value);
  ctx = gsap.context(() => {
    moveRefs.value.forEach((moveRef, index) => {
      if (moveRef.value) {
        // 修改初始状态设置
        gsap.set(moveRef.value, {
          opacity: 0,
          // 使用 translateX 替代 x，并且初始位置设置在元素自身宽度范围内
          transform: `translateX(${index % 2 === 0 ? "-100%" : "100%"})`,
          // 添加 overflow: hidden 确保不会影响布局
          overflow: "hidden",
        });

        // 修改动画设置
        gsap.to(moveRef.value, {
          opacity: 1,
          transform: "translateX(0)", // 使用 transform 替代 x
          duration: 1.2,
          ease: "power2.out",
          scrollTrigger: {
            trigger: moveRef.value,
            start: "top 80%",
            end: "top 40%",
            toggleActions: "play none none reverse",
            markers: false,
          },
        });
      }
    });
  });

  // 使用定义的 handleResize 函数
  window.addEventListener("resize", handleResize);

  // 初始化位置为第二组的开头
  currentIndex.value = 0;

  nextTick(() => {
    if (carouselTrack.value) {
      carouselTrack.value.style.transition = "none";
      carouselTrack.value.style.transform = `translateX(-${getSlideOffset()}px)`;

      // 重新启用过渡效果
      setTimeout(() => {
        carouselTrack.value.style.transition = "transform 0.5s ease-in-out";
      }, 50);
    }
  });
});

onUnmounted(() => {
  if (ctx) {
    ctx.revert();
  }
  ScrollTrigger.killAll();
  // 移除事件监听
  window.removeEventListener("resize", handleResize);
});

const handleTabClick = (tab) => {
  currentTab.value = tab;
};

const goToSection = (i) => {
  ctx.data.forEach((e) => {
    if (e.vars && e.vars.id === "scrollTween") {
      e.kill();
    }
  });
  ctx.add(() => {
    scrollTween = gsap.to(window, {
      scrollTo: { y: i * window.innerHeight, autoKill: false },
      duration: 1,
      id: "scrollTween",
      onComplete: () => (scrollTween = null),
      overwrite: true,
    });
  });
};

// 向前滑动
const handlePrev = () => {
  if (!carouselTrack.value) return;

  carouselTrack.value.style.transition = "transform 0.5s ease-in-out";
  currentIndex.value--;

  // 如果滑到第一组的开头，跳转到第二组的末尾
  if (currentIndex.value < -state.marqueeArr.length) {
    setTimeout(() => {
      carouselTrack.value.style.transition = "none";
      currentIndex.value = -1;
      nextTick(() => {
        carouselTrack.value.style.transition = "transform 0.5s ease-in-out";
      });
    }, 500);
  }
};

// 向后滑动
const handleNext = () => {
  if (!carouselTrack.value) return;

  carouselTrack.value.style.transition = "transform 0.5s ease-in-out";
  currentIndex.value++;

  // 如果滑到第三组的末尾，跳转到第二组的开头
  if (currentIndex.value >= state.marqueeArr.length) {
    setTimeout(() => {
      carouselTrack.value.style.transition = "none";
      currentIndex.value = 0;
      nextTick(() => {
        carouselTrack.value.style.transition = "transform 0.5s ease-in-out";
      });
    }, 500);
  }
};

// 添加滑动相关的状态
const isDragging = ref(false);
const startX = ref(0);
const scrollLeft = ref(0);

// 处理鼠标/触摸按下事件
const handleDragStart = (e) => {
  isDragging.value = true;
  startX.value = e.type === "mousedown" ? e.pageX : e.touches[0].pageX;
  scrollLeft.value = getSlideOffset();

  // 禁用过渡效果，实现平滑拖动
  if (carouselTrack.value) {
    carouselTrack.value.style.transition = "none";
  }
};

// 处理鼠标/触摸移动事件
const handleDragMove = (e) => {
  if (!isDragging.value) return;
  e.preventDefault();

  const x = e.type === "mousemove" ? e.pageX : e.touches[0].pageX;
  const walk = startX.value - x;

  if (carouselTrack.value) {
    carouselTrack.value.style.transform = `translateX(-${
      scrollLeft.value + walk
    }px)`;
  }
};

// 处理鼠标/触摸释放事件
const handleDragEnd = (e) => {
  if (!isDragging.value) return;
  isDragging.value = false;

  if (carouselTrack.value) {
    // 恢复过渡效果
    carouselTrack.value.style.transition = "transform 0.5s ease-in-out";

    const x = e.type === "mouseup" ? e.pageX : e.changedTouches[0].pageX;
    const walk = startX.value - x;

    // 获取单个项目的宽度
    const firstItem = carouselTrack.value.querySelector(".carousel-item");
    if (!firstItem) return;

    const itemWidth = firstItem.offsetWidth;
    const itemMargin = parseInt(window.getComputedStyle(firstItem).marginRight);
    const totalWidth = itemWidth + itemMargin;

    // 根据滑动距离决定是否切换到下一个/上一个
    if (Math.abs(walk) > totalWidth / 3) {
      if (walk > 0) {
        handleNext();
      } else {
        handlePrev();
      }
    } else {
      // 如果滑动距离不够，回到当前位置
      carouselTrack.value.style.transform = `translateX(-${getSlideOffset()}px)`;
    }
  }
};
import { useRouter } from "vue-router";
const router = useRouter();
const handleCarouselClick = (item, event) => {
  // 检查事件类型是否为点击
  if (event.type === "click") {
    event.stopPropagation(); // 阻止事件传播
    event.preventDefault(); // 阻止默认行为
    console.log(item);
    router.push({
      path: "/companyprofildetail",
      query: {
        title: item.title,
      },
    });
  }
};
</script>

<style scoped lang="scss">
.page-container {
  width: 100%;
  overflow-x: hidden;
  position: relative;
}

.header {
  width: 100%;
  height: 155px;
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  right: 0;
  padding: 0 10rem;
  background-color: transparent;
}
.logo {
  img {
    width: 270px;
    height: 83px;
  }
}

.tabs {
  display: flex;
  gap: 32px;
  margin-right: 32px;
}

.tab-item {
  font-size: 30px;
  color: #000000;
  cursor: pointer;
  transition: color 0.3s ease;
  padding: 4px 8px;

  &.active {
    color: #8b59fa;
  }

  &:hover {
    color: #8b59fa;
  }
}

.title {
  font-size: 85px;
  font-weight: 600;
}
.section-first {
  background: url("@/assets/image/companyprofil/image-x.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.section-four {
  background: url("@/assets/image/companyprofil/bg-3.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.icon-langmul {
  position: absolute;
  bottom: -80px;
  right: 0;
}
.carousel-container {
  width: 96%;
  overflow: hidden;
  position: relative;
}

.arrow-btn {
  cursor: pointer;
}

.carousel-track {
  display: flex;
  will-change: transform;
  cursor: grab;
  user-select: none;

  &:active {
    cursor: grabbing;
  }
}

.carousel-item {
  width: 785px;
  margin-right: 28px;
  flex: 0 0 auto;
  display: block;
  padding: 23px 20px 40px;
  border-radius: 30px;
  box-shadow: 0 8px 35px 3px rgba(0, 0, 0, 0.16);
}

.carousel-image {
  width: 748px;
  height: 563px;
  object-fit: cover;
  display: block;
}

.carousel-content {
  padding: 0 20px 0 60px;
  margin-top: 38px;
}

.carousel-title {
  font-size: 50px;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
  max-height: calc(1.5em * 5);
}

.carousel-subtitle {
  margin-top: 23px;
  color: #455363;
  font-size: 40px;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
  max-height: calc(1.5em * 5);
}

// 添加一个通用的溢出控制类
.overflow-hidden {
  overflow: hidden;
}

// 为所有可能需要动画的容器添加溢出隐藏
[ref*="moveRef"] {
  position: relative;
}

// 标题容器也需要控制溢出
.title {
  position: relative;
}
</style>
