@use 'variables' as vars;
@use 'mixin';

// 基本布局样式
.app-wrapper {
  @include mixin.clearfix;
  position: relative;
  height: 100%;
  width: 100%;

  &.mobile.openSidebar {
    position: fixed;
    top: 0;
  }
}

.fixed-header {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 9;
  width: calc(100% - #{vars.$sideBarWidth});
  transition: width 0.28s;
}

.hideSidebar .fixed-header {
  width: calc(100% - 54px);
}

.mobile .fixed-header {
  width: 100%;
}

// 主容器
#app {
  .main-container {
    min-height: 100%;
    transition: margin-left 0.28s;
    margin-left: vars.$sideBarWidth;
    position: relative;
  }

  // 移动端响应
  .mobile {
    .main-container {
      margin-left: 0;
    }

    .sidebar-container {
      transition: transform 0.28s;
      width: vars.$sideBarWidth !important;
    }

    &.hideSidebar {
      .sidebar-container {
        pointer-events: none;
        transition-duration: 0.3s;
        transform: translate3d(-#{vars.$sideBarWidth}, 0, 0);
      }
    }
  }

  .withoutAnimation {
    .main-container,
    .sidebar-container {
      transition: none;
    }
  }
}
