@import '~antd/es/style/themes/default.less';
@import '~bootstrap-icons/font/bootstrap-icons.css';
@import '~shepherd.js/dist/css/shepherd.css';
@import '~nprogress/nprogress.css';
// @import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.2/font/bootstrap-icons.css");

@keyframes arrow-animation {
  0% {
    transform: translate3d(0, 0, 0);
  }
  25% {
    transform: translate3d(0, 5px, 0);
  }
  50% {
    transform: translate3d(0, 10px, 0);
  }
  75% {
    transform: translate3d(0, 5px, 0);
  }
  100% {
    transform: translate3d(0, 0, 0);
  }
}

.home-page-title {
  &::after {
    content: '点击标题开始设计！！！';
    display: block;
    position: relative;
    top: -4px;
    margin: 0 auto;
    animation: arrow-animation 1s linear infinite;
    font-size: 1vw;
  }
}

html {
  scrollbar-width: thin;
}

*,
*:before,
*:after {
  scrollbar-width: inherit;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 99, 99, 0.8) rgba(99, 99, 99, 0.8);
}

// 伪元素无法继承
*::-webkit-scrollbar {
  width: 4px;
  height: 4px;
  transition: 0.5s;
}
*::-webkit-scrollbar-thumb {
  background: #434b55;
  border-radius: 4px;
}
*::-webkit-scrollbar-corner {
  background-color: transparent;
}

.zero-scrollbar {
  &::-webkit-scrollbar {
    width: 0;
    height: 0;
  }
  scrollbar-width: none;
}

html,
body,
#root {
  height: 100%;
  overflow: hidden;
  & * {
    // font-size: 12px;
  }
}

.colorWeak {
  filter: invert(80%);
}

.ant-layout {
  min-height: 100vh;
}

canvas {
  display: block;
}

body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

ul,
ol {
  list-style: none;
}

@media (max-width: @screen-xs) {
  .ant-table {
    width: 100%;
    overflow-x: auto;

    &-thead > tr,
    &-tbody > tr {
      > th,
      > td {
        white-space: pre;

        > span {
          display: block;
        }
      }
    }
  }
}

// 兼容IE11
@media screen and(-ms-high-contrast: active), (-ms-high-contrast: none) {
  body .ant-design-pro > .ant-layout {
    min-height: 100vh;
  }
}

// variable

.text-ellipsis {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.text-ellipsis-2 {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.text-ellipsis-3 {
  &:extend(.text-ellipsis-2);
  -webkit-line-clamp: 3;
}

// padding
@size-list: {
  2: 2px;
  4: 4px;
  6: 6px;
  8: 8px;
  10: 10px;
  12: 12px;
  14: 14px;
  16: 16px;
  18: 18px;
  20: 20px;
  22: 22px;
  24: 24px;
};

each(@size-list, {
  .p-@{key} {
    padding: @value;
  }
  .p-lr-@{key} {
    padding: 0 @value;
  }
  .p-tb-@{key} {
    padding: @value 0;
  }
  .m-@{key} {
    margin: @value;
  }
  .m-lr-@{key} {
    margin: 0 @value;
  }
  .m-tb-@{key} {
    margin: @value 0;
  }
  .m-l-@{key} {
    margin-left: @value;
  }
  .m-r-@{key} {
    margin-right: @value;
  }
  .m-t-@{key} {
    margin-top: @value;
  }
  .m-b-@{key} {
    margin-bottom: @value;
  }
  .border-r-@{key} {
    border-radius: @value;
  }
  
});

@border-size-list: {
  1: 1px;
  2: 2px;
  3: 3px;
  4: 4px;
};

each(@border-size-list, {
  .border-@{key} {
    border: @value solid @border-color-base;
  }
  .border-@{key}-a {
    border: @value solid @primary-color;
  }
  .p-tb-@{key} {
    padding: @value 0;
  }
  
});

// box-sizing
.box-sizing-border {
  box-sizing: border-box;
}

// cursor
.c-po {
  cursor: pointer;
}
.c-def {
  cursor: default;
}
.c-n-a {
  cursor: not-allowed;
}

// width
.w-100 {
  width: 100%;
}

.w-100-vw {
  width: 100vw;
}

.h-100 {
  height: 100%;
}
.h-a {
  height: auto !important;
}

.h-100-vh {
  height: 100vh;
}

// line-height
.line-height-2 {
  line-height: 2;
}

// display flex
.dis-flex {
  display: flex;
}
.flex-al-cen {
  align-items: center;
}

.dis-flex-cen {
  &:extend(.dis-flex);
  &:extend(.flex-al-cen);
  justify-content: center;
}

// display inline-block
.dis-in-b {
  display: inline-block;
}

.dis-flex-column {
  &:extend(.dis-flex);
  flex-direction: column;
}

.dis-flex-column-between {
  &:extend(.dis-flex-column);
  justify-content: space-between;
}

.over-hide {
  overflow: hidden;
}

// position
.pos-ab {
  position: absolute;
  left: 0;
  top: 0;
}

.pos-re {
  position: relative;
}

.pos-sti {
  position: sticky;
}

.pos-sti-t {
  &:extend(.pos-sti);
  top: 0;
}

.pos-sti-l {
  &:extend(.pos-sti);
  left: 0;
}

// action icon
.ac-i-size-m {
  font-size: 20px !important;
}

// text-align
.ali-l {
  text-align: left;
}
.ali-cen {
  text-align: center;
}

.ali-r {
  text-align: right;
}

// background
.normal-background {
  background-color: @component-background;
}
.normal-color {
  color: @primary-color;
}

// css var
body {
  --config-component-height: 24px;
}

// config font-size
.design-config-select-dropdown {
  .ant-select-item {
    font-size: 12px;
  }
}
.f-b {
  font-weight: bold;
}
.design-config-pop {
  .ant-popover-buttons .ant-btn,
  .ant-popover-message-title {
    font-size: 12px;
  }
}
.c-f-s {
  font-size: 12px;
}
.design-config-format-font-size {
  .ant-input-number,
  .ant-input,
  .ant-radio-wrapper,
  .ant-radio,
  .ant-checkbox-wrapper {
    font-size: 12px;
    padding-left: 0;
    padding-right: 0;
  }

  .ant-steps-item-title {
    font-size: 12px;
  }

  .ant-radio-wrapper {
    line-height: var(--config-component-height);
    margin-right: 4px;
    .ant-radio-inner {
      width: 12px;
      height: 12px;
    }
  }
  .ant-checkbox-inner {
    width: 14px;
    height: 14px;
  }

  .ant-slider-handle {
    width: 12px;
    height: 12px;
    margin-top: -4px;
    border-radius: 0;
  }

  .ant-badge-status-text {
    font-size: 12px;
  }
}

// scroll bar
.ps__rail-x,
.ps__rail-y {
  background-color: transparent !important;
}

// transition
.bor-c {
  transition: border-color 0.2s;
}

// ----end

.design-layer-drawer {
  .ant-drawer-content {
    overflow: hidden;
  }
}

:global {
  .ant-drawer-title {
    font-size: 14px;
  }
  .ant-table * {
    font-size: 12px;
  }
  .ant-btn {
    font-size: 12px;
    line-height: 1.8333;
  }
  .ant-dropdown-menu-item,
  .ant-tabs-dropdown-menu-item {
    font-size: 12px;
    padding: 3px 6px;
  }
  .ant-tabs-dropdown-menu-item {
    min-width: 100px;
  }
  .ant-input-number {
    input {
      font-size: 12px;
    }
  }
  .ant-modal-title {
    font-size: 14px;
  }
  .ant-modal-header {
    padding: 8px 12px;
  }
  .ant-modal-close-x {
    width: 46px;
    height: 46px;
    font-size: 14px;
    line-height: 46px;
  }
  .ant-tooltip-inner {
    min-height: 28px;
    padding: 3px 4px;
    font-size: 12px;
    line-height: 1.6667;
  }
}

// react-split-pane ------start
// .Resizer {
//   background: #000;
//   opacity: 0.2;
//   z-index: 1;
//   -moz-box-sizing: border-box;
//   -webkit-box-sizing: border-box;
//   box-sizing: border-box;
//   -moz-background-clip: padding;
//   -webkit-background-clip: padding;
//   background-clip: padding-box;
// }

// .Resizer:hover {
//   -webkit-transition: all 2s ease;
//   transition: all 2s ease;
// }

// .Resizer.horizontal {
//   height: 11px;
//   margin: -5px 0;
//   border-top: 5px solid rgba(255, 255, 255, 0);
//   border-bottom: 5px solid rgba(255, 255, 255, 0);
//   cursor: row-resize;
//   width: 100%;
// }

// .Resizer.horizontal:hover {
//   border-top: 5px solid rgba(0, 0, 0, 0.5);
//   border-bottom: 5px solid rgba(0, 0, 0, 0.5);
// }

// .Resizer.vertical {
//   width: 11px;
//   margin: 0 -5px;
//   border-left: 5px solid rgba(255, 255, 255, 0);
//   border-right: 5px solid rgba(255, 255, 255, 0);
//   cursor: col-resize;
// }

// .Resizer.vertical:hover {
//   border-left: 5px solid rgba(0, 0, 0, 0.5);
//   border-right: 5px solid rgba(0, 0, 0, 0.5);
// }
// .Resizer.disabled {
//   cursor: not-allowed;
// }
// .Resizer.disabled:hover {
//   border-color: transparent;
// }
// react-split-pane ------end

// component rule tree -----start

.component-rule-tree-curve {
  fill: transparent;
  stroke: rgb(115, 124, 128);
  stroke-width: 2;
}

.component-rule-tree-cap {
  stroke: @component-background;
  stroke-width: 1px;
  fill: rgb(115, 124, 128);
}

.component-rule-tree-path {
  width: 100%;
  height: 24px;
  overflow: visible;
}

.component-rule-tree-connect {
  position: relative;
  &::before,
  &::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: 1px solid black;
    background-color: @primary-color;
    position: absolute;
    left: 50%;
    box-sizing: content-box;
    z-index: 1;
  }
  &::before {
    top: 0;
    transform: translateX(-50%) translateY(-50%);
  }
  &::after {
    bottom: 0;
    transform: translateX(-50%) translateY(50%);
  }
}
.component-rule-tree-connect-no-before {
  &::before {
    display: none;
  }
}
.component-rule-tree-connect-no-after {
  &::after {
    display: none;
  }
}

// component rule tree -----end

// component condition -----start
.component-condition-visible {
}
.component-condition-hidden {
  display: none;
}
.component-condition-ease-in-out {
  animation-name: condition-ease-in-out;
  animation-duration: 1s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: 1;
}
@keyframes condition-ease-in-out {
  0% {
    opacity: 1;
  }
  25% {
    opacity: 0.5;
  }
  50% {
    opacity: 0;
  }
  75% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

// component condition -----start

// nprogress ----------start

#nprogress .bar {
  background: @primary-color;
}
#nprogress .peg {
  box-shadow: 0 0 10px @primary-color, 0 0 5px @primary-color;
}
#nprogress .spinner-icon {
  border-top-color: @primary-color;
  border-left-color: @primary-color;
}

// nprogress ----------end

// 下划线动画
.underline-anime-color-white {
  color: white;
}
.underline-anime {
  position: relative;
  font-weight: bold;
  &::after {
    content: '';
    width: 100%;
    height: 2px;
    position: absolute;
    left: 0;
    bottom: -1px;
    background-color: currentColor;
    transform: scale(0);
    transition: transform 0.5s;
  }
  &:hover {
    color: currentColor;
  }
  &:hover::after {
    transform: scale(1);
  }
}
