<template>
  <section class="mb-index">
    <section>
      <div class="mb-home-title">
        <h1>您专注业务，我们守护安全再强的攻击,也有攻不破的防线</h1>
        <p>高防服务器 | 高防DNS | 游戏盾SDK高防CDN 全方位守护您的业务</p>
      </div>
      <div class="mb-video-content">
        <video ref="videoRef" class="mb-video" preload="auto" :src="homeVideo" autoplay loop muted playsinline
          @loadedmetadata="onVideoLoaded"></video>
        <ParticlesCanvas :size="1" class="canvas-overlay" />
        <ProductTabs class="mb-tabs-positioner" />
      </div>
    </section>
    <PlansSection class="mb-plans-section" />
    <section class="mb-subtitle">
      <h2>全景技术架构让技术成为增长引擎</h2>
      <p>从基础设施、数据引擎、服务中台到业务应用，层层协同，将算力、数据与能力统一管理</p>
    </section>
    <Flowchart class="mb-flowchart" />
  </section>
</template>

<script setup>
import homeVideo from '~/assets/video/home.webm'
import ProductTabs from '~/components/mobile/home/ProductTabs.vue'
import PlansSection from '~/components/mobile/home/PlansSection.vue'
import Flowchart from '~/components/mobile/home/Flowchart.vue'
</script>

<style scoped lang="scss">
.mb-index {
  .mb-home-title {
    position: relative;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 1;

    h1 {
      text-align: center;
      width: 240px;
      font-size: 18px;
      font-weight: 500;
      line-height: 26px;
      background: linear-gradient(90deg, #7C4DFF 0.24%, #DEB9FF 45.03%, #617FFF 132.52%);
      background-clip: text;
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }

    p {
      color: rgba(255, 255, 255, 0.80);
      width: 184px;
      text-align: center;
      font-size: 12px;
      font-weight: 350;
      line-height: 20px;
    }
  }

  .mb-video-content {
    height: 500px;
    position: relative;
    z-index: 0;

    .mb-video {
      width: 100%;
      height: auto;
      position: absolute;
      top: 20%;
      transform: translateY(-50%);
      left: 0;
    }

    .canvas-overlay {
      position: absolute;
      top: 18%;
      transform: translateY(-50%);
      left: 0;
      height: 80px;
      z-index: 1;
    }

    .mb-tabs-positioner {
      position: absolute;
      top: 56%;
      left: 0;
      transform: translateY(-50%);
      z-index: 1
    }
  }

  .mb-plans-section {
    margin-top: 18px;
    padding-bottom: 20px;
  }

  .mb-subtitle {
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;

    h2 {
      width: 216px;
      color: #FFF;
      text-align: center;
      font-size: 24px;
      font-weight: 400;
      line-height: 36px;
    }

    p {
      width: 322px;
      color: rgba(255, 255, 255, 0.80);
      text-align: center;
      font-size: 12px;
      font-weight: 400;
      line-height: 16px;
    }
  }

  .mb-flowchart {
    margin-top: 24px;
    padding-bottom: 32px;
  }
}
</style>
