<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 flex justify-between items-center">
          <div class="info">
            <div class="name">
              以色列无针水光JDV/优斐斯/瑞漾小白盒及
              希腊YELLOWROSE，无针透皮注入技...
            </div>
            <div class="date">2021-07-08 17:42</div>
          </div>
          <img class="cover" src="https://picsum.photos/200/200" />
        </div>
        <div class="section flex justify-between items-center">
          <div class="info">
            <div class="name">
              以色列无针水光JDV/优斐斯/瑞漾小白盒及
              希腊YELLOWROSE，无针透皮注入技...
            </div>
            <div class="date">2021-07-08 17:42</div>
          </div>
          <img class="cover" src="https://picsum.photos/200/200" />
        </div>
        <div class="section flex justify-between items-center">
          <div class="info">
            <div class="name">
              以色列无针水光JDV/优斐斯/瑞漾小白盒及
              希腊YELLOWROSE，无针透皮注入技...
            </div>
            <div class="date">2021-07-08 17:42</div>
          </div>
          <img class="cover" src="https://picsum.photos/200/200" />
        </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;
      transition: all 0.4s;
      cursor: pointer;

      &:hover {
        .name {
          color: #bc1724 !important;
        }
      }

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

      .info {
        width: 1000px;
        height: 100%;

        .name {
          font-size: 18px;
          color: #404040;
          line-height: 1.6;
          margin-bottom: 18px;
          text-align: justify;
          @include ellipsis(2);
        }
        .date {
          font-size: 18px;
          color: #b2b2b2;
          line-height: 1.4;
        }
      }

      .cover {
        width: 106px;
        height: 106px;
        border-bottom: 1px solid #d8d8d8;
      }
    }
  }
}

// 移动 端
@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 {
      padding: 2.4vw 0;
      margin: 0 4vw;
      background: #fff;
      border-bottom: 0.1vw solid #d8d8d8;

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

      .info {
        width: 67.3vw;
        height: 100%;

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

      .cover {
        width: 18vw;
        height: 18vw;
        border-bottom: 0.1vw solid #d8d8d8;
      }
    }
  }
}
</style>
