@import '~antd/es/style/themes/default.less';
@editor-height: 580px;

.playground {
  margin: 0;
  padding: 0;
  border: 1px solid @border-color-split;
  border-radius: 4px;
  background: #fff;
  height: @editor-height;
  overflow: hidden;
  position: relative;

  .preview,
  .editor {
    height: 100%;
  }

  .preview {
    padding: 24px 16px;
    overflow: auto;
    height: 100%;
    width: 100%;
  }

  .editor {
    overflow: hidden;
    height: 100%;

    .codemirror {
      overflow: hidden;
      height: 100%;

      :global(.react-codemirror2) {
        height: 100%;
        overflow: hidden;
        box-sizing: content-box;
        font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo,
          Courier, monospace;

        * {
          box-sizing: content-box;
        }
      }

      :global(.CodeMirror-scroll) {
        padding-bottom: 32px;
        margin-right: -32px;
      }

      :global(.CodeMirror) {
        background-image: none;
        font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
          monospace;
        line-height: 1.6;
        font-size: 13px;
        padding: 8px 16px;
        height: calc(100% - 50px);
      }
    }
  }

  // 非常关键
  // 参考：https://codesandbox.io/s/mow7x4zyqx
  :global {
    .Pane1,
    .Pane2 {
      overflow: auto;
    }
  }

  .exampleContainerWrapper {
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;

    > * {
      width: 100%;
      height: 100%;
    }
  }
}

@media (max-width: 768px) {
  .playground {
    height: 720px;
  }
}
