<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 class="mb-insight-header">
      <h2 class="mb-insight-title">安全洞见&nbsp;&nbsp;&nbsp;全网感知</h2>
      <p class="mb-insight-subtitle">实时攻防态势数据</p>
    </section>
    <StatsSection />
    <section class="mb-insight-header">
      <h3 class="mb-insight-h3">助力各行业客户成功</h3>
    </section>

    <section class="mb-industry">
      <div class="mb-industry-other">
        <div class="mb-industry-item">
          <img src="~/assets/svg/home/icon1.svg" alt="icon">
          <div class="mb-industry-text">金融</div>
        </div>
        <div class="mb-industry-item">
          <img src="~/assets/svg/home/icon2.svg" alt="icon">
          <div class="mb-industry-text">互联网</div>
        </div>
        <div class="mb-industry-item">
          <img src="~/assets/svg/home/icon3.svg" alt="icon">
          <div class="mb-industry-text">医疗健康</div>
        </div>
        <div class="mb-industry-item">
          <img src="~/assets/svg/home/icon4.svg" alt="icon">
          <div class="mb-industry-text">制造</div>
        </div>
        <div class="mb-industry-item">
          <img src="~/assets/svg/home/icon5.svg" alt="icon">
          <div class="mb-industry-text">教育</div>
        </div>
        <div class="mb-other-item">
          <NuxtImg height="26" src="/images/home/icon6.png" alt="卓越教育" />
        </div>
        <div class="mb-other-item">
          <NuxtImg height="26" src="/images/home/icon7.png" alt="华福证券" />
        </div>
        <div class="mb-other-item">
          <NuxtImg height="26" src="/images/home/icon8.png" alt="汉王" />
        </div>
        <div class="mb-other-item">
          <NuxtImg height="26" src="/images/home/icon9.png" alt="隧道股份" />
        </div>
        <div class="mb-other-item">
          <NuxtImg height="26" src="/images/home/icon10.png" alt="岳阳医院" />
        </div>
        <div class="mb-other-item">
          <NuxtImg height="26" src="/images/home/icon11.png" alt="杉德" />
        </div>
        <div class="mb-other-item">
          <NuxtImg height="26" src="/images/home/icon12.png" alt="易班" />
        </div>
        <div class="mb-other-item">
          <NuxtImg height="26" src="/images/home/icon13.png" alt="银联商务" />
        </div>
        <div class="mb-other-item">
          <NuxtImg height="26" src="/images/home/icon14.png" alt="长海医院" />
        </div>
        <div class="mb-other-item">
          <NuxtImg height="26" src="/images/home/icon15.png" alt="斗象科技" />
        </div>
        <div class="mb-other-item">
          <NuxtImg height="26" src="/images/home/icon16.png" alt="瑞金" />
        </div>
        <div class="mb-other-item">
          <NuxtImg height="26" src="/images/home/icon17.png" alt="3L" />
        </div>
        <div class="mb-other-item">
          <NuxtImg height="26" src="/images/home/icon18.png" alt="宝付" />
        </div>
        <div class="mb-other-item">
          <NuxtImg height="26" src="/images/home/icon19.png" alt="新华医院" />
        </div>
        <div class="mb-other-item">
          <NuxtImg height="26" src="/images/home/icon20.png" alt="中船重工物贸集团" />
        </div>
      </div>

      <div class="mb-join-container">
        <div class="mb-join-left">
          <h3>立即加入 &nbsp;安全之旅</h3>
          <div class="mb-join-subtitle">完成注册，即可免费体验 DDoS防护、CC防护、DNS解析等多款安全产品</div>
        </div>
        <img class="mb-join-img" src="~/assets/svg/home/aq.svg" alt="安全之旅" />
      </div>
    </section>

  </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'
import StatsSection from '~/components/mobile/home/StatsSection.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;
  }

  .mb-insight-header {
    width: 174px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;

    .mb-insight-title {
      color: #FFF;
      font-size: 20px;
      font-weight: 400;
      line-height: 24px;
    }

    .mb-insight-subtitle {
      color: #A39DFF;
      font-size: 12px;
      font-weight: 400;
    }

    .mb-insight-h3 {
      color: #FFF;
      font-size: 18px;
      font-weight: 400;
      line-height: 36px;
    }
  }

  .mb-industry {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding-bottom: 48px;
    width: 100%;
    overflow: hidden;

    .mb-industry-other {
      display: grid;
      grid-template-rows: repeat(4, auto);
      grid-template-columns: repeat(5, 105px);
      gap: 10px;
      width: 100%;
      overflow-x: auto;
      scrollbar-width: none;
      -ms-overflow-style: none;

      &::-webkit-scrollbar {
        display: none;
      }

      .mb-industry-item {
        flex-shrink: 0;
        box-sizing: border-box;
        display: flex;
        width: 105px;
        height: 48px;
        justify-content: center;
        align-items: center;
        border-radius: 4px;
        border: 0.5px solid #C6BAFF;
        background: linear-gradient(169deg, rgba(101, 70, 255, 0.60) -37.16%, rgba(101, 70, 255, 0.10) 193.82%);
        backdrop-filter: blur(0.5px);
        gap: 10px;

        img {
          width: 18px;
          height: 18px;
        }

        .mb-industry-text {
          color: #FFF;
          font-size: 14px;
          font-weight: 400;
        }
      }

      .mb-other-item {
        box-sizing: border-box;
        display: flex;
        justify-content: center;
        align-items: center;
        width: 105px;
        height: 48px;
        border-radius: 4px;
        border: 0.5px solid #B2A1FF;
        background: #1C192B;

        :deep(img) {
          max-width: 80%;
          object-fit: contain;
        }
      }
    }

    .mb-join-container {
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      align-items: center;
      width: calc(100% - 32px);
      margin-top: 48px;
      text-align: left;
      gap: 20px;

      .mb-join-left {
        flex: 1;

        h3 {
          color: #FFF;
          font-size: 16px;
          font-weight: 400;
        }

        .mb-join-subtitle {
          margin-top: 12px;
          margin-bottom: 20px;
          color: rgba(255, 255, 255, 0.80);
          font-size: 12px;
          font-weight: 400;
        }
       }

      .mb-join-img {
        width: 130px;
        height: auto;
        margin-top: 0;
      }
    }
  }
}
</style>
