@import './core/flex';
@import './core/position';
@import './core/spacing';
@import './core/color';
@import './core/align';
@import './core/form';

* {
  box-sizing: border-box
}

ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

a {
  cursor: pointer;
  text-decoration: none;
  color: var(--color-primary)
}

p,
span {
  font-size: 12px
}

dialog {
  padding: 0
}

label {
  font-size: 12px
}

// width & height
.fit {
  height: 100%;
  width: 100%;
}

.full-width {
  width: 100%;
  margin: 0
}

.full-height {
  height: 100%;
  margin: 0
}

// display
.inline-block {
  display: inline-block
}
.block {
  display: block
}

.hidden {
  display: none;
}

// border
.round-border {
  border-radius: 50px!important
}
.border-radius {
  border-radius: 4px
}
.no-border {
  border: none!important
}
.border-default {
  border: 1px solid #ddd
}
.border-top-default {
  border-top: 1px solid #ddd
}
.border-left-default {
  border-left: 1px solid #ddd
}
.border-right-default {
  border-right: 1px solid #ddd
}
.border-bottom-default {
  border-bottom: 1px solid #ddd
}
.border-transparent {
  border: 1px solid transparent
}

// transition
.transition-primary {
  transition: all ease 0.3s
}

// shadow
.shadow-1 {
  box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.06)
}

// cursor
.cursor-pointer {
  cursor: pointer
}

// overflow
.overflow-hidden {
  overflow: hidden
}
.overflow-auto {
  overflow: auto
}
.text-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
}
.text-bold {
  font-weight: 600!important
}

.f-btn {
  cursor: pointer;
  position: relative;
  outline: none;
  border: none;
  border-radius: 4px;
  padding: 8px 15px;
  text-align: center;
  overflow: hidden;
  border: none;
}
.f-btn-sm {
  font-size: 9px
}
.f-btn-md {
  font-size: 14px
}
.f-btn-lg {
  font-size: 20px
}
.f-btn-round {
  padding: 0;
  height: 1.2rem;
  width: 1.2rem;
  border-radius: 50%
}
.f-btn:after {
  content: "";
  display: block;
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  //设置径向渐变
  background-image: radial-gradient(circle, #666 10%, transparent 10.01%);
  background-repeat: no-repeat;
  background-position: 50%;
  transform: scale(10, 10);
  opacity: 0;
  transition: transform .3s, opacity .5s;
}

.f-btn:active:after {
    transform: scale(0, 0);
    opacity: .3;
    //设置初始状态
    transition: 0s;
}

// z-index
.z-top {
  z-index: 99999999999999999999999
}
.z-middle {
  z-index: 999
}
// table
.f-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;

  tr {
    transition: all ease 0.3s;
    border-bottom: 1px solid #ddd;
    &:hover {
      background-color: rgba(241, 241, 241, 0.4)
    }
  }

  th,
  td {
    padding: 15px 0;
  }

  .no-data-container {
    padding: 30px 0
  }
}

// loading
.f-loading {
  background-color: rgba(255, 255, 255, 0.5);
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

// mask-layer
.mask-layer {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3);
  z-index: 99
}

// modal
.modal {
  border: none;
  z-index: 999999;
  margin: 0;
  background-color: #fff;
  position: fixed;
  overflow: hidden;
  width: auto;
  height: auto;
  transition: all ease 0.3s
}
.modal-middle {
  border-radius: 4px;
  border: 1px solid #ddd;
  margin: 0 auto;
  display: none;
}
.modal-left {
  left: 0;
  top: 0;
  height: 100vh;
  transform: translateX(-100%);
}
.modal-right {
  right: 0;
  top: 0;
  height: 100vh;
  transform: translateX(100%);
}
.modal-top {
  left: 0;
  top: 0;
  width: 100vw;
  transform: translateY(-100%);
}
.modal-bottom {
  left: 0;
  bottom: 0;
  width: 100vw;
  transform: translateY(100%);
}
@media screen and (max-width: 768px) {
  .modal-middle {
    width: 90%;
    left: 5%;
    min-height: 40vh
  }
  .modal-left,
  .modal-right {
    max-width: 90vw
  }
  .modal-top,
  .modal-bottom {
    min-height: 40vh;
    max-height: 100vh
  }
}
@media screen and (min-width: 768px) {
  .modal-middle {
    min-width: 60vw;
    max-width: 90vw;
    height: 60vh;
  }
  .modal-left,
  .modal-right {
    min-width: 30vw;
    max-width: 50vw;
  }
  .modal-top,
  .modal-bottom {
    min-height: 40vh;
  }
}

.toolbar {
  display: flex;
  align-items: center;
  padding: 4px 8px;
  overflow: hidden;
  position: relative;
  min-height: 35px;
  border-bottom: 1px solid #f0f0f0;

  .toolbar-title {
    flex: 1;
    min-width: 1px;
    max-width: 100%;
    align-items: center;
    font-size: 14px;
    font-weight: 400;
  }
}

.font-normal {
  font-size: 12px
}

.round-icon {
  display: inline-block;
  cursor: pointer;
  border-radius: 50%;

  &:hover {
    background-color: #f3f3f3
  }
}

.f-card {
  border-radius: 4px;
  box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);

  .f-card-body {
    min-height: 100px;
    max-height: 65vh;
    max-width: 100vw;
    width: 100%;
    height: auto;
    overflow: hidden;
    padding: 5px 8px;
    animation: f-popup-down 0.42s;
    transform-origin: left top 0;
    animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1)
  }
}

.f-popover {
  display: none;
  background-color: #fff;
  box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
  position: absolute;
  width: 100%;
  left: 0;
  height: auto;
  min-height: 100px;
  max-height: 65vh;
  max-width: 100vw;
  z-index: 99;
  animation: f-popup-down 0.42s;
  transform-origin: left top 0;
  animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1)
}

.f-tips {
  position: absolute;
  padding: 5px 10px;
  border-radius: 5px;
  background-color: #fff;
  box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
  display: none;
  z-index: 99;
  animation: f-popup-up 0.42s;
  transform-origin: left top 0;
  animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1);

  &::after {
    content: '';
    width: 10px;
    height: 10px;
    z-index: 98;
    background-color: #fff;
    position: absolute;
    left: calc(20%);
    bottom: -5px;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    transform: rotate(45deg)
  }
}

@keyframes f-popup-up {
  0% {
    opacity: 0;

    transform: translateY(1) scaleY(0.5);
    pointer-events: none;
  }
  100% {
    opacity: 1;
  }
}

@keyframes f-popup-down {
  0% {
    opacity: 0;
    transform: translateY(0) scaleY(.3);
    pointer-events: none;
  }
  100% {
    opacity: 1
  }
}

.disabled {
  cursor: not-allowed!important;
  opacity: 0.7!important;
}

.hidden {
  display: none!important;
}

.f-notify {
  position: fixed;
  top: 40px;
  text-align: center;
  left: 50%;
  transform: translateX(-50%);
  min-width: 200px;
  padding: 10px 20px;
  color: #fff;
  background-color: var(--q-warning);
  font-size: 14px;
  line-height: 1.4rem;
  border-radius: 4px;
  z-index: 1000;
  box-shadow: 0 0 10px rgba(0, 0, 0, .3);

  &.info {
    background-color: var(--color-info)
  }
  &.success {
    background-color: var(--color-positive)
  }
  &.error {
    background-color: var(--color-negative)
  }
  &.warning {
    background-color: var(--color-warning)
  }
}

.f-focus-helper {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0.1;
  transition: background-color 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);
}

.f-focusable {
  position: relative;

  &:hover,
  &:focus {
    .f-focus-helper {
      opacity: 0.15;
      background-color: currentColor
    }
  }
}

.f-breadcrumb {
  width: 100%;
  font-size: 12px;

  .active {
    color: #000000;
    pointer-events: none;
    font-weight: 600;
  }
}

.float-left {
  float: left
}
.float-right {
  float: right
}

.f-carousel {
  width: 100%;
  min-height: 200px;
  min-height: 220px;
  overflow: hidden;
  position: relative;

  .f-carousel-prev {
    position: absolute;
    left: 10px;
    top: calc(50% - 12px);
  }

  .f-carousel-next {
    position: absolute;
    right: 10px;
    top: calc(50% - 12px);
  }

  .left-icon,
  .right-icon {
    padding: 5px;
    border-radius: 50%;
    cursor: pointer;
    color: #fff;
    background-color: rgba(189, 189, 189, 0.6);
    transition: background 0.3s ease;

    &:hover {
      background: rgba(189, 189, 189, 1);
    }
  }

  .f-carousel-controls {
    position: absolute;
    bottom: 0px;
    width: 100%;
    text-align: center;
    padding: 8px 20px;
    background-color: rgba(189, 189, 189, 0.6);

    .f-carousel-controls-item {
      color: #fff;
      opacity: 0.5;
      font-size: 14px;
      padding: 5px;
      height: 100%;
      margin: 0 3px;
      cursor: pointer;
      display: inline-block;
      transition: all ease 0.3s;

      &.active,
      &:hover {
        opacity: 1;
        background-color: rgba(255, 255, 255, 0.5);
        border-radius: 4px;
      }
    }
  }

  .f-carousel-item-caontainer {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    height: 100%;
  }

  .f-carousel-item {
    flex: 0 0 100%;
    position: relative;
  }
}

.f-progress {
  min-width: 150px;
  border-radius: 5px;
  background: #ddd;
  position: relative;
  min-height: 5px;

  .f-progress-active {
    transition: all ease 0.3s;
    position: absolute;
    left: 0;
    border-radius: 5px;
    height: 100%;
  }
  .f-progress-label {
    font-size: 12px;
  }
}

.f-tree {
  color: #777;

  .f-tree-node {
    cursor: pointer;

    .f-tree-node-content {
      height: 30px;
      line-height: 30px;
      border-radius: 5px;
      padding: 0 10px;

      &:hover {
        background-color: #f4f4f4
      }

      &.active {
        color: var(--color-primary)
      }
    }

  }
}
