<script setup>
import { ref, onMounted } from "vue";
import { useRouter } from "vue-router";
import HeimaPage from "./components/HeimaPage.vue";

const router = useRouter();
// 跳转到详情页
const handleDetail = () => {
  router.push("/detail");
};
</script>
<template>
  <div class="home">
    <div class="logo">
      <img src="../assets/logqian.png" alt="">
      <div class="logo_title">
        <span>科驱数智创新室AI中台</span>
      </div>
    </div>
    <div class="main">
      <div class="banner">
        <div class="product">
          <p><span>智能陪练</span> <span class="separator"></span></p>
          <span>高效提升</span>
        </div>
        <div class="btn">
          <div>定制对话</div>
          <div>拟真复盘</div>
        </div>
      </div>
      <div class="card_list">
        <div class="card_item bg w">
          <p>1.定制专属训练场景</p>
          <img src="../assets/dingzhi.webp" alt="">
        </div>
        <div class="card_item tg w1">
          <p>2.自由设定客户角色</p>
          <div class="scence"></div>
        </div>
        <div class="card_item voice w">
          <p>3.拟真语音深度对话</p>
        </div>
        <div class="card_item bg w1 h">
          <HeimaPage></HeimaPage>
        </div>
      </div>
    </div>
    <div class="bottom">
      <van-button size="small" @click="handleDetail" class="w">立即体验</van-button>
    </div>

  </div>
</template>

<style scoped lang="less">

html {
  touch-action: manipulation;

}

.home {
  min-width: 100vw;
  min-height: 100vh;
  background-image: url(../assets/bg.jpg);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  // padding: 0;
  // margin: 0;
  box-sizing: border-box;
  // overflow: hidden;
}

.logo {
  padding: 1.5rem 1.3rem;
  display: flex;
  align-items: center;

  img {
    width: 1.7rem;
    height: 1.7rem;
    margin-right: 3px;

  }

  .logo_title {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  span {
    font-size: 1rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    // font-family: cursive;
  }
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.banner {
  box-sizing: border-box;
  margin: 1.3rem 0 0.65rem 1.3rem;

  .product {
    font-weight: 700;
    color: #fff;
    font-size: 2.5rem;
    p{
      display: flex;
      align-items: center;
    }

    .separator{
      margin-left: 3vw;
      display: inline-block;
      width: 0.8rem;
      height: 0.8rem;
      background: #fff;
    }
  }

  .btn {
    display: flex;
    color: rgba(255, 255, 255, 0.7);
    box-sizing: border-box;
    margin-top: 1.2rem;

    div {
      border: 1px solid rgba(255, 255, 255, 0.7);
      border-radius: 0.33rem;
      padding: 0.25rem 0.33rem;
      font-size: 0.65rem;
    }

    div:nth-child(1) {
      margin-right: 0.65rem;
    }
  }

}

.card_list {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 1.3rem 1.3rem 0 1.3rem;

  .card_item {
    width: 48%;
    box-sizing: border-box;
    padding: 0.5rem 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;

    p {
      font-size: 0.88rem;
      // text-align: center;
    }

    img {
      // width: 100%;
      height: 10.5rem;
      object-fit: cover;
      max-height: auto;
      max-width: 100%;
      // height: auto;
    }

    .scence {
      height: 100%;
      width: 100%;
      background-image: url(../assets/role_scene.webp);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
      background-repeat: no-repeat;
      background-size: cover;
      background-position: center;
    }
  }

  .bg {
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
  }

  .tg {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    color: #fff;
  }

  .voice {
    max-height: 11.5rem;
    height: 9.5rem;
    background-image: url(../assets/sence.png);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    padding-top: 0.5rem;
    font-size: 0.88rem;
    text-align: center;

    p {
      color: #fff;
    }
  }

  .w {
    width: 45%;
  }

  .w1 {
    width: 52%
  }
  .h{
    max-height: 11.5rem;
    height: 9.5rem;
  }
}

.bottom {
  // flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  // padding: 0 3vw 3vw 3vw;

  .w {
    width: 30vw;
    font-size: 3vw;
    background-color: rgb(255,102,51);
    color: #fff;
  }
}

@media (max-width: 767px) {
  html {
    touch-action: pan-y;
    /* 允许垂直滚动，禁止水平滚动和缩放 */
  }
}
</style>
