<script setup lang="ts"></script>

<template>
  <div class="box_container">
    <div class="box_header_line" />
    <div class="box_header">
      <template
        v-for="(name, index) in [
          '云主机CPU平均使用率TOP5',
          '云主机内存使用率TOP5',
          '物理机CPU平均使用率TOP5',
          '物理机内存使用率TOP5'
        ]"
        :key="index"
      >
        <div class="header_box flex justify-between">
          <div class="header_title">{{ name }}</div>
          <div class="header_addon">
            <div class="line">
              <img src="src/assets/screen/header_line.png" alt="" />
            </div>
            <div class="line">
              <img src="src/assets/screen/header_line.png" alt="" />
            </div>
            <div class="line">
              <img src="src/assets/screen/header_line.png" alt="" />
            </div>
            <div class="line">
              <img src="src/assets/screen/header_line.png" alt="" />
            </div>
            <div class="line">
              <img src="src/assets/screen/header_line.png" alt="" />
            </div>
            <div class="line">
              <img src="src/assets/screen/header_line.png" alt="" />
            </div>
          </div>
        </div>
      </template>
    </div>
    <div class="box_content">
      <div class="content">
        <slot name="content" />
      </div>
      <div class="element1">
        <svg
          xmlns="http://www.w3.org/2000/svg"
          width="20"
          height="3"
          viewBox="0 0 20 3"
          fill="none"
        >
          <path
            fill-rule="evenodd"
            clip-rule="evenodd"
            d="M3.52755 0H19.5541L16.0265 3H0L3.52755 0Z"
            fill="#1FC6FF"
          />
        </svg>
      </div>
      <div class="element2" />
      <div class="element3">
        <div class="sub1" />
        <div class="sub2" />
        <div class="sub3" />
      </div>
      <div class="element4">
        <div class="sub1" />
        <div class="sub2-container">
          <div class="sub2" />
          <div class="sub2" />
          <div class="sub2" />
        </div>
        <div class="sub2-container">
          <div class="sub2" />
          <div class="sub2" />
          <div class="sub2" />
        </div>
        <div class="sub1" />
      </div>
    </div>
  </div>
</template>

<style scoped>
.box_container {
  width: 100%;
  height: 100%;

  .box_header_line {
    width: 100%;
    height: 1px;
    background: #136480;
  }

  .box_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 44px;
    background: linear-gradient(
      90deg,
      rgb(31 180 255 / 12%) 0%,
      rgb(31 180 255 / 0%) 100%
    );

    .header_box {
      /* width: 460px; */
      flex: 1;

      &:nth-of-type(2) {
        margin-left: 10px;
      }
    }

    .header_title {
      margin-left: 20px;
      font-family: "Helvetica Neue", Helvetica, "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
      font-size: 20px;
      font-style: normal;
      font-weight: 400;
      line-height: 24px;
      color: white;
    }

    .header_addon {
      display: flex;

      .line {
        width: 28px;
        height: 24px;
      }
    }
  }

  .box_content {
    position: relative;
    width: 100%;
    height: calc(100% - 44px);
    padding: 8px;
    background: rgb(5 18 48 / 20%);
    box-shadow: 0 2px 4px 0 rgb(31 198 255 / 20%) inset,
      2px 0 4px 0 rgb(31 198 255 / 20%) inset,
      0 -2px 4px 0 rgb(31 198 255 / 20%) inset,
      -2px 0 4px 0 rgb(31 198 255 / 20%) inset;

    .content {
      display: flex;
      justify-content: space-between;
    }

    .element1 {
      position: absolute;
      top: -2px;
      right: 0;
    }

    .element2 {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 2px;
      background: linear-gradient(
        90deg,
        rgb(31 199 255 / 0%) 0%,
        #1fc7ff 50.42%,
        rgb(31 199 255 / 0%) 94.9%
      );
    }

    .element3 {
      position: absolute;
      top: 0;
      left: 0;
      display: flex;

      .sub1 {
        width: 8px;
        height: 2px;
        margin-top: -2px;
        background: #1fc6ff;
      }

      .sub2 {
        width: 8px;
        height: 2px;
        margin-top: -2px;
        margin-left: 2px;
        background: rgb(31 198 255 / 56%);
      }

      .sub3 {
        width: 8px;
        height: 2px;
        margin-top: -2px;
        margin-left: 2px;
        background: rgb(31 198 255 / 24%);
      }
    }

    .element4 {
      position: absolute;
      bottom: 0;
      left: 0;
      display: flex;
      justify-content: space-around;
      width: 100%;

      .sub1 {
        width: 8px;
        height: 2px;
        background: rgb(31 198 255 / 56%);
      }

      .sub2-container {
        display: flex;

        .sub2 {
          width: 8px;
          height: 2px;
          margin-left: 2px;
          background: rgb(31 198 255 / 56%);
        }
      }
    }
  }
}
</style>
