docs/src/components/preview/style.scss
.dl-doc-preview {
  $prefix: &;

  &__playground {
    height: 500px;
  }

  &__wrapper {
    margin: var(--d-gap-sm) 0 40px;
    box-shadow: 0 10px 24px rgba(9, 16, 30, 0.04), 0px 6px 40px rgba(9, 16, 30, 0.08);
    border-radius: 8px;

    &:empty {
      display: none;
    }

    iframe {
      width: 100%;
      height: 100%;
      border: 0;
    }

    .shiki {
      margin-top: 0;
      background: none !important;
      border: 0;
    }
  }

  // PC 模式
  &__desktop {
    padding: 16px;

    .dl-doc-preview__runtime {
      padding-bottom: 0;
      padding-left: 0;
      padding-right: 0;
    }

    #{&} {
      &-header {
        display: flex;
        justify-content: space-between;
      }

      &-title {
        margin: 0 !important;
        font-size: 16px;
        font-weight: 500;
      }

      &-toolbar {
        cursor: pointer;

        a {
          color: var(--d-primary-text-color);

          &:hover {
            color: var(--d-primary);
          }
        }
      }

      &-code {
        display: none;
        width: 100%;
        overflow-x: auto;

        &--active {
          display: block;
        }

        .shiki {
          padding-top: 10px;
        }
      }
    }
  }

  // Mobile 模式
  &__mobile {
    $mPrefix: &;
    display: flex;
    flex-direction: column;
    max-height: 500px;

    &--iframe {
      #{$mPrefix} {
        &-runtime-inner {
          overflow: hidden;
        }
      }
    }

    &--self {
      #{$mPrefix} {
        &-runtime-inner {
          background: #f7f8fa;
        }
      }
    }

    &-content {
      flex: 1;
      display: flex;
      overflow: hidden;
    }

    &-left {
      flex: 1;
      display: flex;
      flex-direction: column;
      border-right: var(--d-border);
      overflow: hidden;
    }

    &-code {
      flex: 1;
      overflow: auto;
    }

    &-runtime {
      display: flex;
      flex-direction: column;
      width: 375px;
      overflow: hidden;

      &-inner {
        flex: 1;
        overflow-y: auto;
      }

      #{$mPrefix} {
        &-toolbar {
          border-top: var(--d-border);
          border-bottom: 0;
        }
      }
    }

    &-toolbar {
      padding: var(--d-gap-xs) var(--d-gap-sm);
      border-bottom: var(--d-border);

      a {
        cursor: pointer;
        color: var(--d-primary-text-color);

        &:hover {
          color: var(--d-primary);
        }
      }

      h3 {
        margin: 0 !important;
      }
    }
  }

  &__runtime {
    padding: var(--d-gap-sm);
  }

  &__toolbar {
    display: flex;
    justify-content: space-between;
    margin-top: var(--d-gap-sm);
    padding: var(--d-gap-xs) var(--d-gap-sm);
    border-top: 1px dashed var(--d-border-color);
    text-align: center;

    .d-space__item > * {
      cursor: pointer;
    }

    &--active {
      border-bottom: 1px dashed var(--d-border-color);
    }

    img {
      width: 20px;
      height: 20px;
      vertical-align: middle;
    }
  }

  &__qrcode {
    position: relative;

    &-trigger {
      &:hover + * {
        display: initial;
      }
    }

    &-img {
      position: absolute;
      top: -100%;
      right: 0;
      display: none;
      width: 100px;
      height: 100px;
      border: var(--d-border);
      transform: translate(0px, -86px);

      img {
        width: 100px;
        height: 100px;
        margin: initial !important;
      }
    }
  }

  &__code {
    display: none;

    &--active {
      display: block;
    }
  }

  &__copy {
    width: 22px;
    height: 24px;
    overflow: hidden;

    &-scroll {
      transition: 0.3s;
      &--success {
        transform: translateY(-50%);
      }
    }
  }
}
