@import '../../../../style/variables.less';
@import '../components/ProBackBtn/style/index';

.pro-header {
  padding: 10px 0 0 0 !important;
  background-color: var(--zaui-base-bg, #ffffff);
  box-shadow: 0px 3px 8px 1px rgba(0, 55, 93, 0.1);

  &.pro-header-no-back.pro-header-has-describe {
    .pro-header-top {
      padding-left: var(--zaui-space-size-md, 16px);
    }
  }

  &.pro-header-no-back {
    .pro-header-top {
      padding-left: 0;
    }

    .pro-header-left {
      &.pro-header-left-space {
        margin-left: 0 !important;
      }
    }
  }

  &.pro-header-no-describe {
    margin-bottom: calc(var(--zaui-space-size-md; 16px) * var(--zaui-size; 1));
    box-shadow: none;

    .pro-header-title,
    .pro-header-top {
      margin: 0;
      padding: 0;
    }
  }

  &.pro-header-fixed.pro-header-no-describe {
    .pro-header-top {
      padding-bottom: calc(
        var(--zaui-space-size-md; 16px) * var(--zaui-size; 1) - var(--zaui-space-size-xs; 4px) *
          var(--zaui-size; 1)
      );
    }
  }

  .pro-header-describe {
    transition: height 0.2s ease-in-out;
    a {
      color: var(--zaui-link, #006aff);
    }
    .pro-header-describe-items-calc {
      position: relative;
    }
    &.pro-header-describe-hidden {
      height: 0;
      padding: 0;
      overflow: hidden;
      border: 0;
    }
    .@{ant-prefix}-space {
      .pro-header-describe-label {
        font-weight: normal;
      }
      .pro-header-describe-value {
        font-weight: 600;
        .@{ant-prefix}-space-item {
          font-weight: 600;
        }
        .pro-header-describe-items {
          span:first-child {
            margin-right: 2px;
          }
          .pro-header-describe-items-omit {
            position: absolute;
            right: 0;
            background: #fff;
            letter-spacing: 2px;
            height: 24px;
          }
        }
      }
    }
  }

  .pro-header-copy {
    display: flex;
    align-items: center;
    width: 16px;
    margin-bottom: 0;

    .@{ant-prefix}-typography-copy-success {
      svg {
        display: inline-block;
        width: 16px;
        height: 16px;
        fill: var(--zaui-success, #00ae4d);
      }
    }

    .drag-icon {
      div {
        display: flex;
      }

      svg {
        display: inline-block;
        width: 16px;
        height: 16px;
        fill: var(--zaui-brand, #006aff);
      }
    }
  }

  .pro-header-tag {
    display: inline-block;
    padding: 4px 8px;
    color: var(--zaui-brand, #006aff);
    font-weight: normal;
    font-size: var(--zaui-font-size-sm, 12px);
    line-height: 16px;
    white-space: pre;
    background: var(--ant-primary-1, #e6f4ff);
    border-radius: var(--zaui-border-radius-card, 4px);
  }

  .pro-header-title {
    padding: 0 var(--zaui-space-size-md, 16px);
    font-weight: 500;
    font-size: var(--zaui-font-size-xl, 18px);
    line-height: 22px;
  }

  &.pro-header-fixed {
    position: sticky;
    z-index: 101;
    box-shadow: 0px 2px 4px 0px rgba(0, 55, 93, 0.2);
  }

  &.pro-header-shadow {
    box-shadow: 0px 2px 4px 0px rgba(0, 55, 93, 0.2);
  }

  .@{ant-prefix}-breadcrumb {
    li {
      color: #1d2129;
      font-weight: 500;
    }

    .@{ant-prefix}-breadcrumb-link {
      display: inline-flex;
      font-size: var(--zaui-font-size-xl, 18px);
    }

    .@{ant-prefix}-breadcrumb-separator {
      margin: 0 var(--zaui-space-size-xs, 4px);
      color: #1d2129;
      font-weight: 500;
      font-size: var(--zaui-font-size-xl, 18px);
    }
  }

  .pro-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: calc(var(--zaui-space-size-sm; 8px) * var(--zaui-size; 1));
    padding: 0 var(--zaui-space-size-md, 16px);

    .pro-header-left {
      display: flex;
      align-items: center;
      margin-right: var(--zaui-space-size-md, 16px);

      &.pro-header-left-space {
        margin-left: var(--zaui-space-size-md, 16px);
      }

      ul {
        display: flex;
        align-items: center;

        li {
          display: flex;
          color: #1d2129;
          font-weight: 500;
          font-size: var(--zaui-font-size-xl, 18px);

          .breadcrumb-value {
            display: inline-block;
          }

          & > span {
            display: flex;
          }

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

          b {
            font-size: var(--zaui-font-size-lg, 16px);
          }

          .@{ant-prefix}-typography {
            display: flex;
            margin-bottom: 0;
          }

          &.version {
            height: 24px;
            padding: 0 var(--zaui-space-size-sm, 8px);
            color: var(--zaui-brand, #006aff);
            font-size: var(--zaui-font-size-sm, 12px);
            font-style: initial;
            line-height: 24px;
            background: var(--ant-primary-1, #e6f4ff);
            border-radius: var(--zaui-border-radius, 8px);
          }

          &.hidden {
            display: none;
          }
        }
      }
    }

    .pro-header-right {
      .@{ant-prefix}-btn-link {
        color: #616161;
      }

      .@{ant-prefix}-btn-primary {
        color: #ffffff;
      }

      .@{ant-prefix}-btn-link {
        padding: var(--zaui-space-size-xs, 4px), var(--zaui-space-size-sm, 8px);
      }

      .@{ant-prefix}-divider-vertical {
        margin: 0;
      }
    }
  }

  .pro-header-nav {
    position: relative;
    display: flex;
    background: #fafafa;
    border-top: 1px solid #f2f2f2;

    &.pro-header-nav-open {
      .pro-header-fold {
        .pro-header-fold-bg {
          transform: rotate(180deg);
        }
      }
    }

    &.pro-header-nav-hidden {
      padding: 0;
      border: none;

      ul {
        height: 0;
        overflow: hidden;
      }
    }

    .pro-header-fold {
      position: absolute;
      bottom: -13px;
      left: 50%;
      transform: translateX(-50%);
      cursor: pointer;

      .pro-header-fold-bg {
        position: relative;
        z-index: 2;
        height: 26px;
        background: #fff;
        transform: rotate(0deg);
        transform-origin: center;
      }

      &::before {
        position: absolute;
        bottom: 13px;
        left: 50%;
        z-index: 1;
        width: 140px;
        height: 1px;
        background: linear-gradient(
          90deg,
          rgba(238, 238, 238, 0) 0%,
          var(--zaui-brand, #006aff) 37%,
          var(--zaui-brand, #006aff) 57%,
          rgba(216, 216, 216, 0) 100%
        );
        transform: translateX(-50%);
        content: '';
      }

      svg {
        fill: var(--zaui-brand, #006aff);
      }
    }

    ul {
      display: flex;
      flex-wrap: wrap;
      height: 60px;
      padding: 0 16px;
      overflow: hidden;
      transition: height 0.2s ease-in-out;

      li {
        margin-top: 4px;
        margin-right: 52px;
        margin-bottom: calc(var(--zaui-space-size-md; 16px) * var(--zaui-size; 1));

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

        span {
          font-weight: 400;
          font-size: var(--zaui-font-size, 14px);

          &:first-child {
            display: block;
            font-weight: 500;
          }
        }

        .describe-value {
          color: var(--zaui-text, #343434);
          font-weight: 400;

          & > * {
            color: var(--zaui-text, #343434);
            font-weight: 400 !important;
          }
        }
      }
    }
  }

  .pro-header-info {
    li {
      margin-right: var(--zaui-space-size-sm, 8px);
    }
  }

  .pro-header-describe {
    display: flex;
    flex-wrap: wrap;
    padding: 0 var(--zaui-space-size-md, 16px);
    padding-bottom: calc(
      var(--zaui-space-size-md; 16px) * var(--zaui-size; 1) - var(--zaui-space-size-xs; 4px) *
        var(--zaui-size; 1)
    );
    font-size: var(--zaui-font-size, 14px);

    li {
      flex: 0 0 auto;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      &.pro-header-only-tag {
        margin-left: var(--zaui-space-size-sm, 8px);

        span:first-child {
          margin-right: 0;
        }
      }

      span {
        color: #0a0a0a;
        font-weight: 400;

        &:first-child {
          margin-right: 12px;
        }

        &:last-child {
          display: inline-grid;
          font-weight: 600;

          .pro-header-tag {
            margin-left: 4px;
          }
        }
      }
    }
  }
}

.pro-header-describe-items-tip {
  max-width: 600px;
  .pro-header-describe-items-tip-value {
    margin-bottom: var(--zaui-space-size-sm, 8px);
  }
}

@media (max-width: 1366px) {
  .pro-header-describe {
    li span:last-child {
      max-width: 350px;
    }
  }
}
