@import 'variable';

/*.banner begin*/
.banner {
  background: url(https://res.fudou6.com/c/4/20160730/tayYmFubmVy_1920x677.jpg) no-repeat center center;
  background-size: cover;
  padding-top: 120px;
  padding-bottom: 160px;
  .banner-box {
    margin: 0 auto;
    color: #fff;
    h1 {
      margin-top: 0;
      margin-bottom: 35px;
      text-align: center;
      font-weight: normal;
      font-size: 64px;
    }
    p {
      font-size: 20px;
      line-height: 35px;
    }
  }
}

/*.banner end*/
/*.download begin*/
.download {
  position: relative;
  padding-top: 400px;
  margin: 0 auto;
  .android,
  .iphone {
    position: absolute;
    left: 50%;
    top: 140px;
    //margin-left: -@container-width / 2;
    //margin-left: -467px;
    height: 68px;
    width: 268px;
    line-height: 68px;
    font-size: 18px;
    border-radius: 4px;
    i {
      display: inline-block;
      height: 68px;
      width: 68px;
      margin-right: 22px;
      font-size: 32px;
      text-align: center;
      color: #fff;
      border-right: 1px solid rgba(255, 255, 255, 0.3);
    }
  }
  .android {
    background-color: #82b21c;
  }
  .iphone {
    margin-top: 88px;
    background-color: #0079c2;
  }
  .qr-code {
    position: absolute;
    top: 140px;
    left: 50%;
    margin-left: -150px;
    text-align: center;
    font-size: 14px;
    img {
      display: block;
      margin-bottom: 5px;
    }
  }
  .app-screen {
    position: absolute;
    left: 50%;
    top: -140px;
    //margin-left: (@container-width - 990) / 1.2;
    //margin-left: 10px;
    width: 467px;
    height: 558px;
    background: url(http://res.fudou6.com/c/4/20160730/tq9bW9iaWxlXzAx_467x558.png) no-repeat;
    &:after {
      content: '';
      background: url(http://res.fudou6.com/c/4/20160730/nw3bW9iaWxlLWNvbnRlbnRfMDM=_375x384.jpg) no-repeat 51px 62px;
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
    }

  }
  hr {
    width: 95%;
  }
}

/*download end*/
/*character begin*/
@keyframes stretch-delay {
  0%, 50%, 100% {
    transform: scale(0);
    opacity: 0;
  }
  5%, 45% {
    transform: scale(1);
    opacity: 1;
  }
}

.character {
  ul {
    margin: 80px auto;
    li {
      float: left;
      width: 25%;
      height: 160px;
      text-align: center;
      position: relative;
      & > div {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        transform: scale(0);
        opacity: 0;
        animation-name: stretch-delay;
        animation-duration: 10s;
        animation-iteration-count: infinite;
        animation-fill-mode: forwards;
        &:first-child {
          h3 {
            margin-top: 50px;
            font-size: 44px;
            color: #111d2b;
          }
          h4 {
            font-size: 16px;
            color: #888;
          }

        }
        &:last-child {
          img {
            display: block;
            margin: auto;
          }
          h3 {
            font-size: 36px;
          }
          h4 {
            font-size: 14px;
          }
        }
      }
      .loop(@c) when (@c > 0) {
        .loop((@c - 1));
        &:nth-child(@{c}) {
          & > div {
            &:first-child {
              animation-delay: @c*0.25s;
            }
            &:last-child {
              animation-delay: 5 + @c*0.25s;
            }
          }
        }
      }
      .loop(4);
    }
  }
}

/* character end */
/* projects begin */
.projects {
  background-color: #f6f6f6;
  & > header {
    & > div {
      float: left;
      height: 300px;
      position: relative;
      width: 50%;
      &:first-child {
        background-color: #111d2b;
        & > div {
          position: relative;
          float: right;
          height: 300px;
          .logo {
            position: absolute;
            top: 50%;
            right: 50px;
            height: 94px;
            width: 227px;
            margin-top: -47px;
            background: url(/images/index/icon_01.png) no-repeat;
            background-size: cover;
          }
        }
      }
      &:last-child {
        background-color: #2e2e2e;
        & > div {
          position: relative;
          background-color: #2e2e2e;
          height: 300px;
        }
        h3 {
          position: absolute;
          top: 50%;
          left: 20px;
          height: 80px;
          padding-bottom: 45px;
          margin-top: -64px;
          font-size: 48px;
          color: #fff;
          background: url(/images/index/icon_02.jpg) no-repeat left bottom;
        }
      }
    }
  }
  & > section {
    width: @container-width;
    height: 500px;
    margin: 0 auto;
    & > div {

      &:first-child {
        width: @container-width/2-121;
        float: left;
        margin-top: 50px;
        margin-left: 20px;
        border-right: 1px solid #7f7f7f;
        p {
          position: relative;
          margin-top: 20px;
          font-size: 23px;
          line-height: 30px;
          color: #565656;
          &:before {
            content: '·';
            position: absolute;
            left: -20px;
            font-size: 50px;
            top: -3px;
          }
        }

      }
      &:last-child {
        width: @container-width/2+100;
        float: left;
        position: relative;
        .computer {
          position: absolute;
          top: -80px;
          right: 0;
          width: 542px;
          height: 483px;
          background: url(/images/index/computer.jpg) no-repeat;
        }
      }
    }
  }
}

/* projects end*/

/*product begin*/
.products {
  background-color: #f6f6f6;
  ul {
    width: @container-width;
    margin: 0 auto;
    padding-bottom: 50px;
    li {
      position: relative;
      color: #fff;

      &:nth-child(1),
      &:nth-child(2) {
        margin-bottom: 30px;
        & > div {
          height: 400px;
          float: left;
          &:first-child {
            width: (@container-width + 30)/3*2-30;
            margin-right: 30px;
            background-size: cover;

          }
          &:last-child {
            width: (@container-width + 30)/3-30;
            background-color: #2e2e2e;
            text-align: center;
            h3 {
              font-size: 25px;
              margin-top: 80px;
              text-align: center;
            }
            hr {
              width: 237px;
              border: none;
              border-bottom: 1px solid #979797;
              margin: 7px auto 20px;
            }
            & > div {
              width: 100%;
              margin-bottom: 24px;
              span {
                width: 33%;
                display: block;
                float: left;
                font-size: 16px;
                strong {
                  font-size: 32px;
                  font-weight: normal;
                }
              }
            }
            a {
              font-size: 14px;
              color: #fff;
            }
          }
        }
      }
      &:nth-child(n+3) {
        float: left;
        width: (@container-width + 30)/3-30;
        height: 400px;
        position: relative;
        margin-right: 30px;
        &:last-child {
          margin-right: 0;
        }
        & > div {
          position: absolute;
          width: 100%;
          height: 100%;
          &:first-child {
            background-size: cover;
          }
          &:last-child {
            position: relative;
            transition: background .3s;
            &:hover {
              background-color: rgba(0, 0, 0, .75);
            }
            h3 {
              font-size: 25px;
              padding-top: 80px;
              //margin-top: 80px;
              text-align: center;
              line-height: 30px;
            }
            hr {
              border: transparent;
            }
            & > div:nth-child(3) {
              width: 100%;
              margin-bottom: 24px;
              position: absolute;
              left: 0;
              top: 152px;
              span {
                width: 33%;
                display: block;
                float: left;
                font-size: 16px;
                text-align: center;
                strong {
                  font-size: 32px;
                  font-weight: normal;
                }
              }
            }
            & > div:last-child {
              position: absolute;
              top: 270px;
              left: 0;
              width: 100%;
              text-align: center;
              font-size: 14px;
              a {
                color: #fff;
              }
            }
          }
        }
      }
    }
  }
}

/*product end*/

.screen() {
  .media(@screen-width-small, @container-width-small);
  .media(@screen-width, @container-width);
  .media(@screen-width-large, @container-width-large);

  .media(@sw, @cw) {
    @media screen and (min-width: @sw) {
      .rules(@cw);
    }
  }

  .rules(@cw) {
    .banner {
      .banner-box {
        width: @cw;
      }
    }
    .download {
      width: @cw;
      .mixin(@cw);

      .download-element(@a, @b) {
        .android,
        .iphone {
          margin-left: @a;
        }
        .app-screen {
          margin-left: @b;
        }
      }

      .mixin(@cw) when (@cw = @container-width-small) {
        .download-element(-467px, 10px);
      }

      .mixin(@cw) when (@cw = @container-width) {
        .download-element(-500px, 50px);
      }

      .mixin(@cw) when (@cw = @container-width-large) {
        .download-element(-540px, 120px);
      }

    }
    .character {
      ul {
        width: @cw;
      }
    }
    .projects {
      & > header {
        & > div {
          &:first-child {
            & > div {
              width: @cw/4 + 50;
              margin-right: @cw/4 - 50;
            }
          }
          &:last-child {
            & > div {
              width: @cw / 4 * 3 - 50;
              margin-left: -@cw/4 + 50;
            }
          }
        }
      }
      & > section {
        width: @cw;
        & > div {
          &:first-child {
            width: @cw/2-121;
          }
          &:last-child {
            width: @cw/2+100;
          }
        }
      }
    }
    .products {
      ul {
        width: @cw;
        @mr: @cw/33;
        li {
          &:nth-child(1),
          &:nth-child(2) {
            & > div {
              &:first-child {
                width: (@cw + @mr)/3*2-@mr;
                margin-right: @mr;
              }
              &:last-child {
                width: (@cw + @mr)/3-@mr;
              }
            }
            margin-bottom: @mr;
          }
          &:nth-child(n+3) {
            width: (@cw + @mr)/3-@mr;
            margin-right: @mr;
          }
        }
      }
    }

  }
}

body {
  .screen();
}