<template>
  <div
    class="general"
  >
    <img
      class="map-mask"
      src="@/assets/images/mask-general-map.png"
      alt=""
      draggable="false"
    >
    <h1
      :title="activeCorpInfo?.name || '上海市工业博物馆'"
    >
      {{ activeCorpInfo?.name || '上海市工业博物馆' }}
    </h1>
    <form @submit.prevent="onSearch">
      <input
        v-model="filterKeyword"
        type="text"
        placeholder="请输入企业名称"
      >
      <button type="submit">
        <img
          class=""
          src="@/assets/images/icon_search.png"
          alt=""
          draggable="false"
        >
      </button>
    </form>
    <ul>
      <li
        v-for="(decade) in corpListMap.keys()"
        :key="decade"
      >
        <h2>
          <img
            class=""
            src="@/assets/images/decade-decorator-left.png"
            alt=""
            draggable="false"
          >
          <span>{{ decade }}</span>
          <img
            class=""
            src="@/assets/images/decade-decorator-right.png"
            alt=""
            draggable="false"
          >
        </h2>
        <div
          v-for="(corpItem) in corpListMap.get(decade)"
          :id="`corp-item-${corpItem.id}`"
          :key="corpItem.id"
          class="corp-item"
          :class="{
            active: activeCorpId === corpItem.id
          }"
          @click="onClickCorpItem(corpItem.id)"
        >
          <div class="item-icon" />
          <div class="verticle-line" />
          <span
            class="corp-name"
            :title="corpItem.name"
          >
            {{ corpItem.name }}
          </span>
          <span class="corp-time">
            {{ corpItem.createDay }}
          </span>
        </div>
      </li>
    </ul>
    <article v-if="activeCorpInfo && isShowDesc">
      <button
        class="close"
        @click="isShowDesc = false"
      />
      <h2>{{ activeCorpInfo.name }}</h2>
      <img
        class="splitter"
        src="@/assets/images/splitter.png"
        alt=""
        draggable="false"
      >
      <img
        v-if="bannerImgList.value.length"
        class="banner"
        :src="`${prefix}/${bannerImgList.value[0].filePath}`"
        alt=""
        draggable="false"
      >
      <div
        class="txt"
        v-html="activeCorpInfo?.description ? activeCorpInfo.description.replace(/\x20\x20/g, '&emsp;&emsp;') : ''"
      />
    </article>

    <!-- element-ui的loading效果从调用到出现有延时，这期间要遮盖住组件 -->
    <div
      v-show="isShowLoadingMask"
      class="loading-mask"
    />
  </div>
</template>

<script>
import {
  computed,
  onMounted,
  onUnmounted,
  watch,
  reactive,
  ref,
} from 'vue'

export default {
  name: 'GeneralView',
  components: {
  },

  setup () {
    const prefix = ref(process.env.VUE_APP_API_ORIGIN)

    const filterKeyword = ref('')

    // 初始化数据列表
    const corpListRaw = reactive({ value: null })
    const corpListMap = reactive(new Map())
    onMounted(async () => {
      corpListRaw.value = await api.getGeneralList()
      corpListRaw.value.forEach(element => {
        let decade = ''
        if (element.createDay.substring(0, 2) === '18') {
          decade = `十九世纪`
        } else if (element.createDay.substring(0, 2) === '19') {
          const decadeValue = element.createDay[2]
          decade = `上世纪${decadeValue}0年代`
        } else {
          const decadeValue = element.createDay[2]
          decade = `本世纪${decadeValue}0年代`
        }
        if (!corpListMap.get(decade)) {
          corpListMap.set(decade, [])
        }
        corpListMap.get(decade).push(element)
      })
    })

    // 自动选中第一个条目
    function selectFirstItemAuto() {
      onClickCorpItem(corpListRaw.value[0].id)
    }
    window.gMitt.on('RequestApiSuccess-general', selectFirstItemAuto)
    onUnmounted(() => {
      window.gMitt.off('RequestApiSuccess-general', selectFirstItemAuto)
    })

    // 搜索框功能
    // watch(filterKeyword, utils.debounce(async (vNew) => {
    // }, 500, false), {
    //   immediate: true,
    // })

    // 被选中的数据
    const activeCorpId = ref(null)
    const isShowDesc = ref(true)
    const activeCorpInfo = computed(() => {
      if (corpListRaw.value) {
        return corpListRaw.value.find((item) => {
          return item.id === activeCorpId.value
        })
      } else {
        return {}
      }
    })
    const bannerImgList = reactive({ value: [] })
    watch(activeCorpId, async (vNew) => {
      if (vNew) {
        const res = await api.getGeneralDetail(vNew)
        bannerImgList.value = res.file
      } else {
        bannerImgList.value = []
      }

    })

    // 无论是网页里还是unity内部点击了企业，都调用这个
    function onClickCorpItem(id) {
      // 被选中的，既显示位置又显示名字，还要有选中特效。在它之前的，只显示位置。
      let isFound = false
      for (let index = 0; index < corpListRaw.value.length; index++) {
        const element = corpListRaw.value[index]
        window.gUnityInst.SendMessage('Panel1', 'HideEnterprise', element.id) //隐藏某个企业
        window.gUnityInst.SendMessage('Panel1', 'HideEnterpriseName', element.id) //隐藏某个企业
        if (element.id === id) {
          isFound = true
          window.gUnityInst.SendMessage('Panel1', 'ShowEnterprise', element.id) //显示某个企业
          window.gUnityInst.SendMessage('Panel1', 'ShowEnterpriseName', element.id) //显示某个企业
          window.gUnityInst.SendMessage('Panel1', 'SetEnterpriseSelected', element.id) //高亮某个企业
        } else if (!isFound) {
          window.gUnityInst.SendMessage('Panel1', 'ShowEnterprise', element.id) //显示某个企业
        } else {
        }
      }
      activeCorpId.value = id
      isShowDesc.value = true
      const clickedElement = document.querySelector(`#corp-item-${id}`)
      if (clickedElement) {
        clickedElement.scrollIntoView()
      }

      // // 只显示选中的
      // if (activeCorpId.value === id) {
      //   activeCorpId.value = ''
      //   isShowDesc.value = false
      //   window.gUnityInst.SendMessage('Panel1', 'HideEnterprise', id) //隐藏某个企业
      // } else {
      //   for (let index = 0; index < corpListRaw.value.length; index++) {
      //     const element = corpListRaw.value[index]
      //     if (element.id === id) {
      //       window.gUnityInst.SendMessage('Panel1', 'ShowEnterprise', element.id) //显示某个企业
      //       window.gUnityInst.SendMessage('Panel1', 'SetEnterpriseSelected', element.id) //高亮某个企业
      //     } else {
      //       window.gUnityInst.SendMessage('Panel1', 'SetEnterpriseUnselected', element.id) //高亮某个企业
      //       window.gUnityInst.SendMessage('Panel1', 'HideEnterprise', element.id) //隐藏某个企业
      //     }
      //   }
      //   activeCorpId.value = id
      //   isShowDesc.value = true
      //   // const clickedElement = document.querySelector(`#corp-item-${id}`)
      //   // if (clickedElement) {
      //   //   clickedElement.scrollIntoView()
      //   // }
      // }
    }
    window.handleClickEnterprise = onClickCorpItem

    // loading mask相关
    const isShowLoadingMask = ref(true)
    onMounted(() => {
      setTimeout(() => {
        isShowLoadingMask.value = false
      }, 200)
    })

    return {
      activeCorpId,
      activeCorpInfo,
      bannerImgList,
      corpListMap,
      filterKeyword,
      isShowDesc,
      isShowLoadingMask,
      onClickCorpItem,
      prefix,
    }
  },
  data() {
    return {
    }
  },
  computed: {
    ...mapState([
    ]),
  },
  mounted() {
  },
  beforeUnmount() {
  },
  unmounted() {
  },
  methods: {
    ...mapMutations([
    ]),
    onSearch() {
      console.log('search!')
    }
  },
}
</script>

<style lang="less" scoped>
.general {
  height: 100%;
  >.map-mask {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
  }
  >h1 {
    position: absolute;
    top: 51px;
    left: 81px;
    max-width: 50%;
    overflow: hidden;
    white-space: pre;
    text-overflow: ellipsis;
    font-size: 48px;
    font-family: Source Han Sans CN-Heavy, Source Han Sans CN;
    font-weight: 800;
    color: #FFFFFF;
    padding-top: 20px;
    padding-bottom: 20px;
    border-top: 1px solid rgba(217, 217, 217, 0.2);
    border-bottom: 1px solid rgba(217, 217, 217, 0.2);
  }
  >form {
    position: absolute;
    top: 196px;
    left: 81px;
    display: flex;
    align-items: center;
    >input {
      background: rgba(255,255,255,0.1);
      border-radius: 3px 3px 3px 3px;
      border: 1px solid rgba(255, 255, 255, 0.5);
      width: 220px;
      height: 40px;
      padding-left: 13px;
      padding-right: 13px;
      font-size: 16px;
      font-family: Source Han Sans CN-Light, Source Han Sans CN;
      font-weight: 400;
      color: #FFFFFF;
      &:focus {
        border: 1px solid rgba(255, 255, 255, 1);
      }
      &::placeholder {
        font-size: 16px;
        font-family: Source Han Sans CN-Light, Source Han Sans CN;
        font-weight: 400;
        color: rgba(255, 255, 255, 0.5);
      }
    }
    >button {
      margin-left: 8px;
      width: 40px;
      height: 40px;
      background: rgba(255,255,255,0.3);
      border-radius: 3px 3px 3px 3px;
      opacity: 1;
      border: 1px solid #FFFFFF;
      &:hover {
        background: rgba(255,255,255,0.5);
      }
      >img {
        width: 100%;
        height: 100%;
      }
    }
  }
  >ul {
    position: absolute;
    top: 272px;
    left: 81px;
    max-height: calc(100% - 305px);
    overflow: auto;
    user-select: none;
    >li {
      display: block;
      color: #fff;
      >h2 {
        width: 323px;
        height: 47px;
        background: linear-gradient(92deg, rgba(176,161,121,0) 0%, rgba(176,161,121,0.3) 50%, rgba(176,161,121,0) 100%);
        // border-radius: 3px;
        font-size: 16px;
        font-family: Source Han Sans CN-Bold, Source Han Sans CN;
        font-weight: bold;
        color: #FFFFFF;
        text-shadow: 0px 0px 5px #FFD15B;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-bottom: 17px;
        >span {
          margin-left: 13px;
          margin-right: 13px;
        }
        >img {
          width: 60px;
          height: 15px;
        }
      }
      >.corp-item {
        position: relative;
        width: 363px;
        height: 50px;
        background: linear-gradient(90deg, rgba(58, 69, 79, 0.5) 0%, rgba(22,28,33,0) 100%);
        // background: linear-gradient(90deg, #3A454F 0%, rgba(22,28,33,0) 100%);
        backdrop-filter: blur(3px);
        border-radius: 3px 3px 3px 3px;
        opacity: 1;
        border: 1px solid;
        border-right: none;
        border-image: linear-gradient(98deg, rgba(78, 96, 112, 1), rgba(78, 96, 112, 0)) 1 1;
        padding-left: 72px;
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        align-items: flex-start;
        margin-bottom: 24px;
        cursor: pointer;
        >.item-icon {
          position: absolute;
          border-radius: 50%;
          left: 35px;
          top: 50%;
          transform: translateY(-50%);
          width: 8px;
          height: 8px;
          background: #9AA4AB;
          z-index: 2;
          box-shadow: 0px 0px 12px 0px #6D9DC6, 0px 0px 8px 0px #6D9DC6;
        }
        >.verticle-line {
          position: absolute;
          top: -1px;
          left: 38px;
          width: 2px;
          height: 75px;
          background: #B0A179 50%;
          z-index: 1;
        }
        &:first-of-type {
          >.verticle-line {
            top: 50%;
          }
        }
        &:last-of-type {
          >.verticle-line {
            height: 25px;
          }
        }
        &:first-of-type:last-of-type {
          >.verticle-line {
            display: none;
          }
        }
        >span.corp-name {
          display: block;
          font-size: 16px;
          font-family: Source Han Sans CN-Bold, Source Han Sans CN;
          font-weight: bold;
          color: #FFFFFF;
          overflow: hidden;
          white-space: pre;
          text-overflow: ellipsis;
          opacity: 0.6;
        }
        &.active {
          >span.corp-name {
            font-size: 20px;
            font-family: Source Han Sans CN-Bold, Source Han Sans CN;
            text-shadow: 0px 0px 16px #BD9D48;
            opacity: initial;
          }
        }
        >span.corp-time {
          display: block;
          font-size: 16px;
          font-family: Source Han Sans CN-Light, Source Han Sans CN;
          font-weight: 400;
          color: #FFFFFF;
          opacity: 0.5;
        }
        &:hover {
          background: linear-gradient(90deg, #B0A179 0%, rgba(255,209,91,0) 100%);
          border-image: linear-gradient(98deg, rgba(176, 161, 121, 1), rgba(176, 161, 121, 0)) 1 1;
        }
        &.active {
          background: linear-gradient(90deg, #B0A179 0%, rgba(255,209,91,0) 100%);
          border-image: linear-gradient(98deg, rgba(176, 161, 121, 1), rgba(176, 161, 121, 0)) 1 1;
          >.item-icon {
            background: #FFFFFF;
            box-shadow: 0px 0px 12px 0px #FFD15B, 0px 0px 8px 0px #FFD15B, 0px 0px 10px 0px #FFD15B, 0px 0px 5px 0px #FFD15B;
          }
        }
      }
    }
    &::-webkit-scrollbar { background: transparent; width: 4px; } /*宽度是对垂直滚动条而言，高度是对水平滚动条而言*/
    &::-webkit-scrollbar-thumb {
      background: transparent;
      border-radius: 2px;
    }
    &:hover {
      &::-webkit-scrollbar-thumb {
        background: rgba(220, 231, 240, 0.2);
      }
    }
  }
  >article {
    position: absolute;
    top: 74px;
    right: 102px;
    width: 653px;
    height: calc(100% - 74px - 50px);
    max-height: 740px;
    backdrop-filter: blur(10px);
    background-image: url(@/assets/images/general-article-bg.png);
    background-size: 100% auto;
    background-repeat: no-repeat;
    background-position: left top;
    padding: 32px 50px 50px 50px;
    display: flex;
    flex-direction: column;
    @media only screen and (max-width: 1700px) {
      right: 0;
    }
    >button.close {
      position: absolute;
      top: 30px;
      right: 50px;
      width: 32px;
      height: 32px;
      background-image: url(@/assets/images/icon-close.png);
      background-size: cover;
      background-repeat: no-repeat;
      background-position: center center;
    }
    >h2 {
      flex: 0 0 auto;
      font-size: 24px;
      font-family: Source Han Sans CN-Bold, Source Han Sans CN;
      font-weight: bold;
      color: #FFFFFF;
      margin-bottom: 21px;
    }
    >img.splitter {
      flex: 0 0 auto;
      width: 100%;
      margin-bottom: 37px;
    }
    >img.banner {
      flex: 0 0 auto;
      width: 100%;
      height: 34.8%;
      object-fit: contain;
      margin-bottom: 20px;
    }
    >.txt {
      flex: 1 0 1px;
      font-size: 20px;
      font-family: Source Han Sans CN-Light, Source Han Sans CN;
      font-weight: 400;
      color: rgba(255, 255, 255, 0.8);
      line-height: 1.5;
      overflow: auto;
      padding-right: 10px;
      margin-right: -10px;
      white-space: pre-wrap;
      // text-indent: 2em;
      &::-webkit-scrollbar { background: transparent; width: 4px; } /*宽度是对垂直滚动条而言，高度是对水平滚动条而言*/
      &::-webkit-scrollbar-thumb {
        background: rgba(220, 231, 240, 0.2);
        border-radius: 2px;
      }
    }
  }
  .loading-mask {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: black;
  }
}

.mobile {
  .general {
    height: 100%;
    >.map-mask {
      position: absolute;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
    }
    >h1 {
      position: absolute;
      top: calc(51 / 1080 * 83vh);
      left: calc(81 / 1080 * 83vh);
      max-width: 50%;
      overflow: hidden;
      white-space: pre;
      text-overflow: ellipsis;
      font-size: calc(48 / 1080 * 83vh);
      font-family: Source Han Sans CN-Heavy, Source Han Sans CN;
      font-weight: 800;
      color: #FFFFFF;
      padding-top: calc(20 / 1080 * 83vh);
      padding-bottom: calc(20 / 1080 * 83vh);
      border-top: 1px solid rgba(217, 217, 217, 0.2);
      border-bottom: 1px solid rgba(217, 217, 217, 0.2);
    }
    >form {
      position: absolute;
      top: calc(196 / 1080 * 110vh);
      left: calc(81 / 1080 * 110vh);
      display: flex;
      align-items: center;
      >input {
        background: rgba(255,255,255,0.1);
        border-radius: calc(3 / 1080 * 110vh);
        border: 1px solid rgba(255, 255, 255, 0.5);
        width: calc(220 / 1080 * 110vh);
        height: calc(40 / 1080 * 110vh);
        padding-left: calc(13 / 1080 * 110vh);
        padding-right: calc(13 / 1080 * 110vh);
        font-size: calc(16 / 1080 * 110vh);
        font-family: Source Han Sans CN-Light, Source Han Sans CN;
        font-weight: 400;
        color: #FFFFFF;
        &:focus {
          border: 1px solid rgba(255, 255, 255, 1);
        }
        &::placeholder {
          font-size: calc(16 / 1080 * 110vh);
          font-family: Source Han Sans CN-Light, Source Han Sans CN;
          font-weight: 400;
          color: rgba(255, 255, 255, 0.5);
        }
      }
      >button {
        margin-left: calc(8 / 1080 * 110vh);
        width: calc(40 / 1080 * 110vh);
        height: calc(40 / 1080 * 110vh);
        background: rgba(255,255,255,0.3);
        border-radius: 3px 3px 3px 3px;
        opacity: 1;
        border: 1px solid #FFFFFF;
        &:hover {
          background: rgba(255,255,255,0.5);
        }
        >img {
          width: 100%;
          height: 100%;
        }
      }
    }
    >ul {
      position: absolute;
      top: calc(272 / 1080 * 110vh);
      left: calc(81 / 1080 * 110vh);
      max-height: 50vh;
      overflow: auto;
      user-select: none;
      >li {
        display: block;
        color: #fff;
        >h2 {
          width: calc(323 / 1080 * 110vh);
          height: calc(47 / 1080 * 110vh);
          background: linear-gradient(92deg, rgba(176,161,121,0) 0%, rgba(176,161,121,0.3) 50%, rgba(176,161,121,0) 100%);
          // border-radius: 3px;
          font-size: calc(16 / 1080 * 110vh);
          font-family: Source Han Sans CN-Bold, Source Han Sans CN;
          font-weight: bold;
          color: #FFFFFF;
          text-shadow: 0px 0px 5px #FFD15B;
          display: flex;
          justify-content: center;
          align-items: center;
          margin-bottom: calc(17 / 1080 * 110vh);
          >span {
            margin-left: calc(13 / 1080 * 110vh);
            margin-right: calc(13 / 1080 * 110vh);
          }
          >img {
            width: calc(60 / 1080 * 110vh);
            height: calc(15 / 1080 * 110vh);
          }
        }
        >.corp-item {
          position: relative;
          width: calc(363 / 1080 * 110vh);
          height: calc(50 / 1080 * 110vh);
          background: linear-gradient(90deg, rgba(58, 69, 79, 0.5) 0%, rgba(22,28,33,0) 100%);
          // background: linear-gradient(90deg, #3A454F 0%, rgba(22,28,33,0) 100%);
          backdrop-filter: blur(3px);
          border-radius: 3px 3px 3px 3px;
          opacity: 1;
          border: 1px solid;
          border-right: none;
          border-image: linear-gradient(98deg, rgba(78, 96, 112, 1), rgba(78, 96, 112, 0)) 1 1;
          padding-left: calc(72 / 1080 * 110vh);
          display: flex;
          flex-direction: column;
          justify-content: space-around;
          align-items: flex-start;
          margin-bottom: calc(24 / 1080 * 110vh);
          cursor: pointer;
          >.item-icon {
            position: absolute;
            border-radius: 50%;
            left: calc(35 / 1080 * 110vh);
            top: 50%;
            transform: translateY(-50%);
            width: calc(8 / 1080 * 110vh);
            height: calc(8 / 1080 * 110vh);
            background: #9AA4AB;
            z-index: 2;
            box-shadow: 0px 0px 12px 0px #6D9DC6, 0px 0px 8px 0px #6D9DC6;
          }
          >.verticle-line {
            position: absolute;
            top: -1px;
            left: calc(38 / 1080 * 110vh);
            width: calc(2 / 1080 * 110vh);
            height: calc(75 / 1080 * 110vh);
            background: #B0A179 50%;
            z-index: 1;
          }
          &:first-of-type {
            >.verticle-line {
              top: 50%;
            }
          }
          &:last-of-type {
            >.verticle-line {
              height: calc(25 / 1080 * 110vh);
            }
          }
          &:first-of-type:last-of-type {
            >.verticle-line {
              display: none;
            }
          }
          >span.corp-name {
            display: block;
            font-size: calc(16 / 1080 * 110vh);
            font-family: Source Han Sans CN-Bold, Source Han Sans CN;
            font-weight: bold;
            color: #FFFFFF;
            overflow: hidden;
            white-space: pre;
            text-overflow: ellipsis;
            opacity: 0.6;
          }
          &.active {
            >span.corp-name {
              font-size: calc(20 / 1080 * 110vh);
              font-family: Source Han Sans CN-Bold, Source Han Sans CN;
              text-shadow: 0px 0px calc(16 / 1080 * 110vh) #BD9D48;
              opacity: initial;
            }
          }
          >span.corp-time {
            display: block;
            font-size: calc(16 / 1080 * 110vh);
            font-family: Source Han Sans CN-Light, Source Han Sans CN;
            font-weight: 400;
            color: #FFFFFF;
            opacity: 0.5;
          }
          &:hover {
            background: linear-gradient(90deg, #B0A179 0%, rgba(255,209,91,0) 100%);
            border-image: linear-gradient(98deg, rgba(176, 161, 121, 1), rgba(176, 161, 121, 0)) 1 1;
          }
          &.active {
            background: linear-gradient(90deg, #B0A179 0%, rgba(255,209,91,0) 100%);
            border-image: linear-gradient(98deg, rgba(176, 161, 121, 1), rgba(176, 161, 121, 0)) 1 1;
            >.item-icon {
              background: #FFFFFF;
              box-shadow: 0px 0px calc(12 / 1080 * 110vh) 0px #FFD15B, 0px 0px calc(8 / 1080 * 110vh) 0px #FFD15B, 0px 0px calc(10 / 1080 * 83vh) 0px #FFD15B, 0px 0px calc(5 / 1080 * 83vh) 0px #FFD15B;
            }
          }
        }
      }
      &::-webkit-scrollbar { background: transparent; width: calc(4 / 1080 * 110vh); } /*宽度是对垂直滚动条而言，高度是对水平滚动条而言*/
      &::-webkit-scrollbar-thumb {
        background: transparent;
        border-radius: 2px;
      }
      &:hover {
        &::-webkit-scrollbar-thumb {
          background: rgba(220, 231, 240, 0.2);
        }
      }
    }
    >article {
      position: absolute;
      top: calc(74 / 1080 * 83vh);
      right: calc(102 / 1080 * 83vh);
      width: calc(653 / 1080 * 83vh);
      height: 55vh;
      backdrop-filter: blur(10px);
      background-image: url(@/assets/images/general-article-bg.png);
      background-size: 100% auto;
      background-repeat: no-repeat;
      background-position: left top;
      padding: calc(32 / 1080 * 83vh) calc(50 / 1080 * 83vh) calc(50 / 1080 * 83vh) calc(50 / 1080 * 83vh);
      display: flex;
      flex-direction: column;
      @media only screen and (max-width: 1700px) {
        right: 0;
      }
      >button.close {
        position: absolute;
        top: calc(30 / 1080 * 83vh);
        right: calc(50 / 1080 * 83vh);
        width: calc(32 / 1080 * 83vh);
        height: calc(32 / 1080 * 83vh);
        background-image: url(@/assets/images/icon-close.png);
        background-size: cover;
        background-repeat: no-repeat;
        background-position: center center;
      }
      >h2 {
        flex: 0 0 auto;
        font-size: calc(24 / 1080 * 83vh);
        font-family: Source Han Sans CN-Bold, Source Han Sans CN;
        font-weight: bold;
        color: #FFFFFF;
        margin-bottom: calc(21 / 1080 * 83vh);
      }
      >img.splitter {
        flex: 0 0 auto;
        width: 100%;
        margin-bottom: calc(37 / 1080 * 83vh);
      }
      >img.banner {
        flex: 0 0 auto;
        width: 100%;
        height: 34.8%;
        object-fit: contain;
        margin-bottom: calc(20 / 1080 * 83vh);
      }
      >.txt {
        flex: 1 0 1px;
        font-size: calc(20 / 1080 * 83vh);
        font-family: Source Han Sans CN-Light, Source Han Sans CN;
        font-weight: 400;
        color: rgba(255, 255, 255, 0.8);
        line-height: 1.5;
        overflow: auto;
        padding-right: calc(10 / 1080 * 83vh);
        margin-right: -calc(10 / 1080 * 83vh);
        white-space: pre-wrap;
        // text-indent: 2em;
        &::-webkit-scrollbar { background: transparent; width: calc(4 / 1080 * 83vh); } /*宽度是对垂直滚动条而言，高度是对水平滚动条而言*/
        &::-webkit-scrollbar-thumb {
          background: rgba(220, 231, 240, 0.2);
          border-radius: 2px;
        }
      }
    }
    .loading-mask {
      position: absolute;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      background: black;
    }
  }
}
</style>