// --root
.view-port {
  .content-body {
    position: absolute;
    top: $top-height;
    left: 0;
    width: 100%;
    height: $content-height;
    overflow: hidden;
    opacity: 1;
    transition: opacity;
    transition-duration: 0.45s;
    backface-visibility: hidden;
  }
}

.main-view {
  width: 100%;
  height: 100%;
  background: $main-content-bg-color;

  > .main-content {
    overflow: auto;
  }
}

.amos-main-content {
  background: $main-content-bg-color;
}

.menu-item-link {
  text-decoration: none;

  &:active,
  &:focus,
  &:hover {
    color: $menu-common-color;
    text-decoration: none;
  }
}

.active {
  color: $menu-active-color;
}

// submenu footer
.nav-menu-item-footer {
  position: absolute;
  left: 0;
  display: flex;
  width: 100%;
  height: $submenu-item-footer-height;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  .footer-icon {
    width: 40px;
    height: 40px;
  }

  .footer-line {
    display: none;
    width: 50%;
    height: 3px;
    margin-bottom: -3px;
    background: #345fa6;
  }
}

// menu-wrapper
.menusub-wrapper {
  position: absolute;
  left: 0;
  width: 100%;
  cursor: pointer;
  border-left: 1px solid #dce2ed;
  transition: height 0.3s;

  &:hover {
    .nav-menu-item-footer {
      .footer-line {
        display: inline-block;
      }
    }
  }
}

// item 隔行颜色变化
.nav-menu-list {
  .nav-menu-item {
    &:nth-of-type(odd) {
      .menusub-wrapper {
        background: white;
      }
    }

    &:nth-of-type(even) {
      .menusub-wrapper {
        background: #f3f3f3;
      }
    }
  }
}

.menu-subitem a,
.nav-menu-item-label a {
  color: $menu-color;
}
.nav-menu-nonchild-item a {
  color: #fff;
}
.nav-menu-nonchild-item a:hover {
  color: #fff;
}

// 递归 menu
.recursive-level-menu {
  position: absolute;
  top: 0;
  left: $menu-item-width;
  z-index: 3;
  display: none;
  width: $menu-item-width;
  height: 100%;
  background: $submenu-item-active;
  border-left: 1px solid #dce2ed;

  .menu-subitem {
    &:hover {
      background: $submenu-item-active2;
    }
  }

  &.content-level1 {
    border-left: none;
  }
}

// 通用 menu subitem hover等
.menu-subitem {
  &:hover {
    background: $submenu-item-active;

    > .recursive-level-menu {
      display: block;
    }
  }

  &.active {
    background: $submenu-item-active;
  }

  .menu-subitem-icon {
    position: absolute;
    right: 5px;
    display: none;
    font-size: 12px;
    transition: display 0.3s;
  }
}

// header menu
.nav-menu-wrapper {
  position: relative;
  z-index: 3;
  height: $top-height;

  .nav-menu-box {
    position: relative;
    height: 100%;

    .nav-menu-list {
      height: 100%;

      .nav-menu-item {
        position: relative;
        float: left;
        width: $menu-item-width;
        padding: 0 1rem;
        text-align: center;
        cursor: pointer;

        .nav-menu-item-label {
          display: inline-block;
          color: $menu-common-color;
        }

        .nav-triangle {
          position: absolute;
          bottom: 0;
          left: 50%;
          z-index: 1;
          display: none;
          margin-left: -8px;
          border: 8px solid;
          border-color: transparent transparent $menu-common-color;
        }

        .nav-menu-item-icon {
          position: absolute;
          top: 0;
          right: 0;
          font-size: 12px;
          transform: rotate(0);
          transition: transform 0.2s ease-in;
        }

        .menu-sublist {
          display: block;
          height: $menu-sublist-height;
          overflow: hidden;

          .menu-subitem {
            z-index: 2;
            padding: 0.5rem 0;
            clear: both;
            line-height: 2;
            cursor: pointer;

            &:first-child {
              margin-top: 0.5rem;
            }
          }
        }

        &.active {
          .nav-menu-item-label {
            color: $menu-active-color;
          }
        }

        &:hover {
          .nav-triangle {
            display: block;
          }

          .nav-menu-item-label {
            color: $menu-active-color;
          }

          .nav-menu-item-icon {
            color: $menu-active-color;
            transform: rotate(180deg);
          }
        }
      }
    }
  }
}

// --header
.header {
  position: relative;
  top: 0;
  left: 0;
  width: 100%;
  height: $top-height;
  line-height: $top-height;
  color: $head-color;
  background: $head-bg-color;
  border-bottom: 1px solid;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(47, 53, 87, 0.2);

  .logo-wrapper {
    position: relative;
    display: flex;

    .header-logo-extra {
      width: 3rem;
      text-align: center;
    }

    .header-logo {
      display: flex;
      justify-content: center;
      align-items: center;
      height: $top-height;
      padding-right: 1rem;
      background: $head-logo-bg;
      border-right: 1px solid $head-logo-brr-color;

      &::before {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 0;
        border-bottom: 1px solid $head-logo-brb-color;
        content: '';
        transition: width 0.3s ease-in;
      }

      &:hover::before {
        width: 100%;
      }

      .logo-img {
        width: 4rem;
        height: $top-height;

        &:hover {
          transform: scaleX(-1);
          transition: transform 1s;
        }
      }
    }
  }

  .nav-menu-bg {
    position: absolute;
    top: $top-height;
    left: 0;
    display: block;
    width: 100%;
    height: 0;
    background: white;
    box-shadow: 0 2px 3px #bbb;
    transition: height 0.3s;
  }

  .header-navs {
    position: relative;
    display: flex;
    z-index: 300;
  }

  .sys-tools {
    position: absolute;
    right: 0;
    display: flex;
    margin-right: 2rem;
    border-left: 1px solid $head-menu-border-color;
    align-items: center;

    .ui-menu {
      .ui-menu-item {
        display: flex;
        height: $top-height;
        padding: 0 0.5rem;
        margin: 0;
        color: $head-color;
        border-right: 1px solid $head-menu-border-color;
        justify-content: center;
        align-items: center;

        &.amos-nav-item-active {
          border-bottom: 1px solid $head-menu-border-color;
        }

        &:hover {
          color: $head-color;
          background: $head-menu-background;
        }

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

      &.horizontal {
        display: flex;
        justify-content: flex-end;
        align-items: center;
      }
    }

    &.sys-tools-min {
      .ui-menu {
        &.horizontal {
          display: flex;
          justify-content: flex-end;
          align-items: center;
          padding-right: 0;
          border-right: 1px solid $head-menu-border-color;

          .ui-menu-item {
            padding: 0 0.5rem;
            border-right: 1px solid transparent;

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

.user-area {
  .amos-single-pop-trigger {
    height: $top-height;
    line-height: $top-height + 2;
  }

  .amos-single-pop-content {
    .user-profile {
      padding: 1.5rem;
      line-height: 1;

      .user-profile-detail {
        line-height: 1.5;
      }
    }

    .profile-divider {
      margin: 0 1.5rem;
    }
  }
}

.amos-jump-spiner {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 999;
  transform: translate(-50%, -50%);
}

// icon display toggle
.menu-expanded {
  .menu-subitem .menu-subitem-icon {
    display: inline-block;
  }
}
