.dv-border-box {
  display: flex;
  flex-direction: column;
  position: relative;

  &-header {
    display: flex;
    align-items: center;
    padding: $content-padding;
    flex-shrink: 0;
    position: relative;

    &-right {
      position: absolute;
      right: $content-padding;
      top: $content-padding;
    }
  }
  &-title {
    flex: 1;
    font-weight: bold;
    user-select: none;
    font-size: $font-size-small;
    margin: 0;

    &-center {
      text-align: center;
    }
    &-right {
      text-align: right;
    }
  }
  &-sub-header {
    text-align: center;
    color: $secondary-text-color;
    font-size: $font-size-small;
    font-weight: normal;
    padding: 0 $content-padding;
  }
  &-sub-title {
    margin: 0;
  }
  &-body {
    flex: 1;
    overflow: visible;
    position: relative;

    ::-webkit-scrollbar {
      display: none;
    }
  }

  &.dark {
    &.style-0 {
      background-image: url("#{$dvResourceRoot}/images/border-box/0/background.png");
      background-size: 100% 100%;
    }
    &.style-1 {
      background-image: url("#{$dvResourceRoot}/images/border-box/1/background.png");
      background-size: 100% 100%;
    }
    &.style-2 {
      background-image: url("#{$dvResourceRoot}/images/border-box/2/background.png");
      background-size: 100% 100%;
    }
    &.style-3 {
      background-image: url("#{$dvResourceRoot}/images/border-box/3/background.png");
      background-size: 100% 100%;
    }
    &.style-4 {
      .dv-border-box-title {
        position: absolute;
        user-select: none;
        background: transparent;
        text-align: center;
        top: 5px;
        font-size: $font-size-small;
        font-weight: bold;
        padding: 0 $content-padding;
        display: inline-block;
        transform: translateX(-50%);
        margin: 0 auto;
        left: 50%;
        color: $dv-dark-primary-text-color;
        border: $border-width solid $dv-dark-primary-text-color;
        border-radius: $module-radius;
      }
      .dv-border-box-header {
        background: url("#{$dvResourceRoot}/images/border-box/4/background_01.png") no-repeat;
        background-size: 100% 100%;
        background-position: center;
        height: 44px;
      }
      .dv-border-box-body {
        padding: 0 20px;
        background: url("#{$dvResourceRoot}/images/border-box/4/background_02.png") no-repeat;
        background-size: 100% 100%;
        background-position: center;
      }
      .dv-border-box-footer {
        background: url("#{$dvResourceRoot}/images/border-box/4/background_03.png") no-repeat;
        background-size: 100% 100%;
        background-position: center;
        height: 44px;
      }
    }
    &.style-5 {
      border-color: rgba(255, 255, 255, 0.4);
      border-radius: $border-radius-large;

      &:before {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        content: '';
        z-index: -1;
        background-color: rgba(0, 0, 0, 0);
        background-image: url(https://datav.oss-cn-hangzhou.aliyuncs.com/uploads/images/fb26689989fe9e9f074d4ac87fa2973d.png);
        background-repeat: no-repeat;
        background-size: 100% 100%;
        filter: blur(2px);
      }
      .dv-border-box-title {
        color: $dv-dark-primary-text-color;
        font-size: $font-size-larger;
      }
    }
  }
}

.dark {
  .dv-border-box {
    &-title {
      color: $dv-dark-primary-text-color;
    }
  }
}
