@import '../../../global.scss'; // 根据实际情况调整路径

.sidebar {
  width: 220px;
  padding: 8px 24px;
  border-right: 1px solid var(--color-line1-1, #e8e8e8);
  height: 100%;
  position: relative;
  transition: all 0.3s ease;
  &[data-hidden='true'] {
    width: 16px;
    padding: 8px 0;
    .sidebarTrigger {
      transform: rotateZ(180deg);
    }
  }
  &Trigger {
    transition: all 0.5s ease;
    position: absolute;
    right: -12px;
    background-color: var(--color-white, #fff);
    height: 24px;
    top: 20px;
    width: 24px;
    border-radius: 50%;
    border: 1px solid var(--color-line1-1, #e8e8e8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text1-3, #575757);
    cursor: pointer;
    z-index: 10;
  }
  :global {
    .teamix-layout-section {
      overflow: hidden;
    }
    .teamix-layout-section-title {
      width: 100%;
      white-space: nowrap;
    }
  }
}

.header {
  &Desc {
    display: flex;
    align-items: center;
    :global(.teamix-avatar-image img) {
      width: 20px;
      height: 20px;
    }
  }
  &Right {
    &Copy {
      height: 32px;
      background-color: var(--color-fill1-2, #f7f7f7);
      display: flex;
      align-items: center;
      font-size: 14px;
      color: var(--color-text1-3, #575757);
      line-height: 32px;
      padding: 0 2px;
      border-radius: 4px;
    }
    &Sn {
      height: 32px;
      text-align: right;
      border-right: 1px solid var(--color-line1-1, #e8e8e8);
      margin-right: 4px;
      padding-right: 4px;
      padding-left: 4px;
    }
  }
}

.orderBody {
  padding: 0;
  margin: 0;

  :global {
    .teamix-layout-side-bar {
      padding: 0;
      margin: 0;
    }

    .teamix-layout-side-bar-content {
      overflow-y: overlay;
      padding: 0 32px;
    }

    .teamix-layout-body-content {
      padding: 0;
      margin: 0;
    }
  }
}

.order {
  padding: 0 !important;
  margin: 0 !important;;

  :global {
    .collapse-card {
      &:only-child {
        min-height: 100%;
        display: flex;
        flex-direction: column;
        .collapse-card-body-open {
          flex: 1;
          display: flex;
          flex-direction: column;
          align-items: center;
        }
      }
    }
  }
}

.basicInfo {
  margin: 0 16px;
}

.orderTitle {
  margin-right: 12px;
}

.progressArea {
  display: flex;
  flex: 1;
  :global {
    .teamix-layout-section {
      flex: 1;
      display: flex;
      flex-direction: column;
      .teamix-layout-section-body {
        flex: 1;
      }
    }
  }
}

.basicInfoBorder {
  margin: 6px -16px 0;
  border-top: 1px solid var(--color-line1-1, #e8e8e8);
}

.orderStatus {
  color: var(--color-text1-3, #575757);
  font-size: 12px;
}

.envCard {
  box-sizing: border-box;
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 8px;
  margin-left: -8px;
  margin-right: -8px;
  padding: 4px 6px;
  line-height: 22px;
  height: 32px;
  overflow: hidden;
  &[data-active='true'] {
    background-color: var(--color-brand1-2, #c5e8ff);
  }
  &:hover {
    .envName > .envGoBtn {
      display: inline-block;
    }
  }
}

.jobResource {
  font-size: 13px;
  line-height: 20px;
  font-weight: 400;
  color: var(--color-text1-3, #575757);
  padding: 0 16px 0 0;
  margin-top: 5px;
  a {
    margin-left: 12px;
  }

  :global {
    .flex-center-col {
      display: inline-block;
    }

    .mr24 {
      margin-right: 24px;
    }

    .mr4 {
      margin-right: 4px;
    }
  }
}

.envName {
  font-size: 14px;
  color: var(--color-text1-4, #292929);
  font-weight: 500;
  display: flex;
  align-items: center;
  white-space: nowrap;
  & > span {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  & > .envGoBtn {
    display: none;
  }
}

.envLink {
  font-weight: 400;
  &,
  &:link,
  &:visited {
    color: var(--color-brand3-6, rgba(125, 131, 137, 1));
  }
  &:hover {
    color: var(--color-brand1-6, #1b9aee);
    text-decoration: underline;
    font-weight: 500;
  }
}

.scrollWrap {
  overflow: auto;
  position: relative;
}

.stageWrap {
  width: 100%;
  transform: rotateZ(0deg);
  background-color: var(--color-Brand3-1, #f2f5f7);
  &:before,
  &:after {
    transition: all 0.3s ease;
    background: transparent;
    content: ' ';
    display: block;
    color: var(--color-brand1-6, #006ad4);
    width: 100px;
    height: 100%;
    z-index: 12;
    pointer-events: none;
    position: fixed;
    top: 0;
  }

  &[data-left='true'] {
    &:before {
      left: 0;
      background-image: linear-gradient(90deg, #f2f5f7 0%, transparent 100%);
    }
  }
  &[data-right='true'] {
    &:after {
      right: 0;
      background-image: linear-gradient(270deg, #f2f5f7 0%, transparent 100%);
    }
  }
}

.stages {
  padding: 4px 16px 16px;
  display: flex;
  flex-wrap: nowrap;
  width: fit-content;
  position: relative;
  &[data-hidden='true'] {
    padding: 0;
    .stage {
      display: none;
    }
  }
  &:after {
    content: ' ';
    position: absolute;
    display: block;
    left: 32px;
    right: 32px;
    height: 1px;
    background-color: var(--color-brand3-3, #dae0e5);
    top: 30px;
    z-index: 1;
  }
}

.stage {
  width: 320px;
  height: fit-content;
  border-radius: 4px;
  position: relative;
  padding-bottom: 4px;
  overflow: hidden;
  background-color: var(--color-white, #fff);
  z-index: 10;
  transition: all 0.3s ease-in-out;
  @include with-border;
  border-color: var(--color-Brand3-3, #dae0e5);
  &[data-active='false'] {
    background-color: var(--color-white, #fff);
    .stageBg {
      top: 0;
      left: 0;
    }
  }
  &[data-error='true'] {
    .stageTitle {
      color: var(--color-error-5, #cd3021);
      background-color: var(--color-error-1, #ffe8e6);
    }
  }
  &:not(:last-child) {
    margin-right: 16px;
  }
}


.stageTitle {
  background-color: var(--color-Brand3-2, #e9edf0);
  font-weight: 500;
  line-height: 40px;
  padding-left: 20px;
  margin-bottom: 12px;
  color: var(--color-text1-4, #292929);
}

.task {
  border-radius: 4px;
  display: flex;
  font-size: 13px;
  margin-bottom: 8px;
  margin-left: 12px;
  margin-right: 12px;
  align-items: center;
  color: var(--color-text1-3, #575757);
  padding: 8px 8px;
  transition: all 0.3s ease;
  cursor: pointer;
  &:hover {
    background-color: var(--color-brand1-2, #c5e8ff);
  }
  &[data-active='true'] {
    background-color: var(--color-brand1-2, #c5e8ff);
    color: var(--color-text1-4, #292929);
    font-weight: 500;
  }
  & > span:nth-child(2) {
    color: var(--color-text1-1, #adadad);
    font-size: 12px;
    flex: 1;
    padding-left: 8px;
  }
  & > span:last-child {
    font-size: 14px;
    margin: 0 8px;
  }
}

.breathing {
  @keyframes breath {
    from {
      opacity: 1;
    }
    50% {
      opacity: 0.5;
    }
    75% {
      opacity: 0.75;
    }
    to {
      opacity: 1;
    }
  }
  animation-duration: 2s;
  animation-name: breath;
  animation-iteration-count: infinite;
}

.taskInfo {
  animation: fadeIn 200ms ease-in;
  animation: Vmove 200ms ease-out;
  border-top: 1px solid var(--color-line1-1, #e8e8e8);
  padding: 0 0 8px;
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  &:empty {
    display: none;
  }
  :global(.teamix-layout-section:only-child) {
    .basicInfoBorder {
      display: none;
    }
  }
  :global {
    .teamix-layout-section-title {
      height: 54px;
      padding: 0 16px;
      margin-bottom: -8px;
    }
    .teamix-layout-section-operation {
      padding: 0 16px;
    }
  }
}

@keyframes Vmove {
  0% {
    bottom: -16px;
  }

  100% {
    bottom: 0;
  }
}
@keyframes fadeIn {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

.yamlDialog {
  width: 640px !important;
  :global {
    .next-dialog-body {
      padding: 0 !important;
    }
  }
  pre {
    min-height: 400px;
    margin: 0;
    padding: 16px !important;
  }
}

.batchs {
  padding: 0 48px 6px 16px;
  border-bottom: 1px solid var(--color-brand3-2, #e9edf0);
  :global {
    .next-col {
      margin-bottom: 6px;
    }
  }
}

.batchTitle {
  font-size: 12px;
  color: var(--color-fill1-7, #595959);
  display: flex;
  align-items: center;
  height: 28px;
  min-width: 96px;
  width: max-content;
  position: relative;
  left: -10px;
  top: 0;
  z-index: 10;
  padding: 4px;
  background-color: var(--color-white, #fff);
  border-radius: 4px;
  border: 1px solid var(--color-brand3-2, #e9edf0);
}

.operateDialog {
  :global {
    .next-dialog-body {
      padding: 0 !important;
    }
  }
}
.operateLog {
  height: 500px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 16px 0;
  background: linear-gradient(var(--color-white, #fff), transparent 100%),
    linear-gradient(rgba(0, 0, 0, 0.1), transparent 100%);
  background-size: 100% 30px, 100% 10px;
  background-repeat: no-repeat;
  background-attachment: local, scroll;

  --timeline-item-left-content-width: 100px;
}

.operateLoading {
  height: 86px;
  margin-top: -18px;
  padding-bottom: 16px;
  img {
    height: 86px;
    margin-left: -24px;
    position: relative;
    z-index: -1;
  }
}

.host {
  &Content {
    display: grid;
    height: 100%;
    grid-template-columns: 280px 1fr;
    border-top: 1px solid var(--color-line1-1, #e8e8e8);
    &[data-full='true'] {
      min-height: calc(100vh - 440px);
    }
  }
  &Batchs {
    border-right: 1px solid var(--color-line1-1, #e8e8e8);
    height: 100%;
  }
  &Batch {
    height: 56px;
    padding: 12px 16px;
    cursor: pointer;
    &[data-active='true'] {
      background-color: var(--color-brand1-1, #f0f9ff);
    }
    & > div:first-child {
      line-height: 20px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      color: var(--color-text1-3, #575757);
      font-size: 13px;
      margin-bottom: -4px;
    }
  }
  &List {
    padding: 0 16px;
  }
}

.reactflow {
  height: 300px;
  min-height: 300px;
  :global {
    .react-flow__node:not(.react-flow__node-Title) {
      transition: all ease .3s;
    }
    .react-flow__attribution {
      visibility: hidden;
    }
    .react-flow__edge {
      animation-name: fade-in;
      animation-duration: .2s;
    }
    .next-only-content {
      padding: 0 4px !important;
      display: flex !important;
      align-items: center !important;
      .next-message-content {
        padding-left: 4px !important;
      }
    }
  }
}

.node {
  width: 320px;
  height: 64px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  background-color: var(--color-white, #fff);
  @include with-border;
  padding-right: 12px;
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  :global(.react-flow__handle) {
    visibility: hidden;
  }
  &:hover {
    // box-shadow: $hover-shadow-border, 0 3px 8px 0 var(--no-var, rgba(0, 0, 0, 0.06));
  }
}

.nodeCover {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 12px;
  margin-right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 4px;
  background-color: var(--color-brand3-1, #f2f5f7);
}

.nodeInfo {
  flex: 1;
  overflow: hidden;
  color: var(--color-text1-4, #292929);
  .nodeName {
    zoom: calc(1 / min(var(--node-zoom, 1), 1));
  }
  .nodeDescription {
    opacity: calc(min(var(--node-zoom, 1), 1) - 0.3);
    zoom: min(var(--node-zoom, 1), 1);
  }
}

.nodeName {
  font-size: 14px;
  font-weight: 500;
  line-height: 22px;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.nodeDescription {
  font-size: 12px;
  font-weight: normal;
  line-height: 18px;
  width: 100%;
  overflow: hidden;
  display: none;
}

.nodeCount {
  padding-top: 3px;
  font-family: 'DINPro';
  position: absolute;
  right: -8px;
  top: 23px;
  z-index: 10;
  display: flex;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  border: 1.5px solid var(--color-brand1-4, #2a9feb);
  color: var(--color-brand1-6, #006ad4);
  font-size: 12px;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  background-color: var(--color-white, #fff);
  &:hover {
    background: var(--color-notice-1, #ddf1ff);
    transform: scale(1.2);
    transition: all ease .2s;
    padding-top: 3px;
  }
}

.nodeStatus {
  position: absolute;
  left: -10px;
  top: 22px;
  z-index: 10;
  display: flex;
  width: 20px;
  height: 20px;
  border-radius: 10px;
  background-color: var(--color-white, #fff);
  color: var(--color-brand1-6, #006ad4);
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.Title {
  line-height: 50px;
  font-size: 14px;
  color: var(--color-brand3-6, #7d8389);
}

.pod {
  @keyframes breath {
    from {
      opacity: 1;
    }
    50% {
      opacity: 0.6;
    }
    75% {
      opacity: 1;
    }
    to {
      opacity: 1;
    }
  }
  width: 24px;
  height: 24px;
  border-radius: 2px;
  border: 2px solid var(--color-transparent, transparent);
  transition: all 0.3s ease;
  position: relative;
  flex-shrink: 0;
  &[data-breath='true'] {
    animation-duration: 1.2s;
    animation-name: breath;
    animation-iteration-count: infinite;
  }
}

