<template>
  <div class="page">
    <div class="page-top flex flex-col justify-center items-center">
      <img class="logo" src="https://picsum.photos/200/200" />
      <span class="name mt-2">上海品辉医疗科技有限公司</span>
    </div>
    <div class="page-content">
      <!-- 搜索区域 -->
      <div class="search">
        <simple-search />
      </div>
      <div class="divider"></div>
      <!-- tabbar -->
      <simple-tabs></simple-tabs>
      <div class="list">
        <div class="section">
          <div class="info">
            <div class="name">
              VISIA第七代皮肤图像检测分析系统皮肤检测以色列无针水光JDV/优斐斯/瑞漾小白盒希腊YELLOWROSE，无针透皮注入
            </div>
            <div class="date">2022-02-16 17:42</div>
            <div class="download">保存所有图片</div>
          </div>
          <div class="images grid grid-cols-4 md:grid-cols-8 gap-3 md:gap-4">
            <div class="item">
              <img
                class="object-cover"
                src="https://picsum.photos/200/400?random=1"
              />
            </div>
            <div class="item">
              <img
                class="object-cover"
                src="https://picsum.photos/800/400?random=1"
              />
            </div>
            <div class="item">
              <img
                class="object-cover"
                src="https://picsum.photos/60/400?random=1"
              />
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  layout: 'app',
}
</script>

<style scoped lang="scss">
/* scss中可以用mixin来扩展 */
@mixin ellipsis($line: 1) {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: $line;
  -webkit-box-orient: vertical;
}

// pc 端
@media screen and (min-width: 768px) {
  .page-top {
    height: 360px;
    background: url(https://static.caimei365.com/www/authentic/pc/bg-doc.png);
    background-size: auto 360px;
    .logo {
      display: block;
      width: 120px;
      height: 120px;
      border-radius: 50%;
    }
    .name {
      font-size: 30px;
      color: #fff;
    }
  }
  .page-content {
    width: 1200px;
    margin: 0 auto;
    background-color: #fff;
    .divider {
      height: 16px;
      background: #f7f7f7;
    }
    .search {
      display: none;
    }
  }
  .list {
    border-top: 16px solid #f7f7f7;
    border-bottom: 16px solid #f7f7f7;
    .section {
      padding: 32px 0;
      margin: 0 24px;
      background: #fff;
      border-bottom: 1px solid #d8d8d8;

      &:last-child {
        border-bottom: 0;
      }

      .info {
        position: relative;
        .name {
          font-size: 18px;
          color: #404040;
          line-height: 1.6;
          margin-bottom: 18px;
          text-align: justify;
        }
        .date {
          font-size: 18px;
          color: #b2b2b2;
          line-height: 1.4;
        }

        .download {
          bottom: 0;
          right: 0;
          position: absolute;
          color: #bc1724;
          font-size: 16px;
          cursor: pointer;
        }
      }

      .images {
        margin-top: 24px;
        .item {
          width: 126px;
          height: 126px;
          overflow: hidden;
          img {
            display: block;
            width: 100%;
            height: 100%;
          }
        }
      }
    }
  }
}

// 移动 端
@media screen and (max-width: 768px) {
  .page-top {
    height: 46vw;
    background: url(https://static.caimei365.com/www/authentic/h5/bg-club.png);
    background-size: auto 46vw;
    .logo {
      display: block;
      width: 14.8vw;
      height: 14.8vw;
      border-radius: 50%;
    }
    .name {
      font-size: 4vw;
      color: #fff;
    }
  }

  .page-content {
    position: relative;
    .divider {
      border-bottom: 3.2vw solid #f7f7f7;
      height: 12.4vw;
    }
  }

  .search {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translate(-50%, -50%);
  }

  .list {
    .section {
      position: relative;
      padding: 2.4vw 0;
      margin: 0 4vw;
      padding-bottom: 9.8vw;
      background: #fff;
      border-bottom: 0.1vw solid #d8d8d8;

      &:first-child {
        border-top: 0.1vw solid #d8d8d8;
      }

      .info {
        .name {
          font-size: 3.6vw;
          color: #404040;
          line-height: 1.5;
          margin-bottom: 2.4vw;
          @include ellipsis(2);
          text-align: justify;
        }
        .date {
          bottom: 2.4vw;
          left: 0;
          position: absolute;
          font-size: 3.2vw;
          color: #b2b2b2;
          line-height: 1.4;
        }

        .download {
          bottom: 2.4vw;
          right: 0;
          position: absolute;
          color: #bc1724;
          font-size: 3.6vw;
          cursor: pointer;
        }
      }

      .images {
        margin-top: 2.4vw;
        .item {
          width: 21vw;
          height: 21vw;
          overflow: hidden;
          img {
            display: block;
            width: 100%;
            height: 100%;
          }
        }
      }
    }
  }
}
</style>
