.code-box {
    border: 1px solid @site-border-color-split;
    border-radius: @border-radius-sm;
    display: inline-block;
    width: 100%;
    position: relative;
    margin: 0 0 16px;
    transition: all 0.2s;
    &:target {
        border: 1px solid @primary-color;
    }
    &-expand-trigger {
        cursor: pointer;
        font-size: 14px;
        color: #9199ac;
        margin-left: 5px;
        opacity: 0.8;
        transition: all 0.3s;
        top: -2px;
        position: relative;
        &-active {
            color: #3b4357;
        }
    }
    &-title {
        position: absolute;
        top: -14px;
        padding: 1px 8px;
        margin-left: -8px;
        color: #777;
        border-radius: @border-radius-sm @border-radius-sm 0 0;
        background: #fff;
        transition: background-color 0.4s;
        a,
        a:hover {
            color: @site-text-color;
            font-size: @font-size-base;
            font-weight: 500;
        }
    }
    a.edit-button {
        position: absolute;
        right: -16px;
        top: 7px;
        font-size: 12px;
        transform: scale(0.9);
        background: #fff;
        padding-right: 6px;
        text-decoration: none;
    }
    &-demo {
        border-bottom: 1px solid @site-border-color-split;
        padding: 42px 24px 50px;
        color: rgba(0, 0, 0, 0.65);
    }
    iframe {
        width: 100%;
        border: 0;
    }
    &-meta {
        position: relative;
        padding: 18px 32px;
        border-radius: 0 0 @border-radius-sm @border-radius-sm;
        transition: background-color 0.4s;
        font-size: @font-size-base;

        & section > h4,
        & section > h3,
        & > h4,
        & > h3 {
            margin: 0;
            position: absolute;
            top: -14px;
            width: auto;
            margin-left: -8px;
            padding: 1px 8px;
            font-size: 14px;
            color: #777;
            border-radius: 2px 2px 0 0;
            background: #fff;
            a.header-anchor {
                opacity: 0;
                display: none;
            }
            &:hover a.header-anchor {
                opacity: 0;
                display: none;
            }
        }
        &-copy {
            position: absolute;
            top: 10px;
            right: 15px;
            opacity: 1;
        }

        blockquote {
            margin: 0;
        }
        section& p {
            margin: 0;
            width: 98%;
        }
        > p {
            font-size: 12px;
            margin: 0.5em 0;
            padding-right: 25px;
            width: 100%;
            word-break: break-word;
        }
    }
    &.expand &-meta {
        border-radius: 0;
        border-bottom: 1px dashed @site-border-color-split;
    }
    .code-expand-icon {
        position: absolute;
        right: 16px;
        bottom: 23px;
        cursor: pointer;
        width: 16px;
        height: 16px;
        line-height: 16px;
        text-align: center;
    }
    .code-expand-icon-show,
    .code-expand-icon-hide {
        transition: all 0.4s;
        user-select: none;
        position: absolute;
        left: 0;
        top: 0;
        margin: 0;
        max-width: 100%;
        vertical-align: baseline;
        box-shadow: none;
    }
    .code-expand-icon-show {
        opacity: 0.55;
        pointer-events: auto;
        &:hover {
            opacity: 1;
        }
    }
    .code-expand-icon.ant-tooltip-open .code-expand-icon-show {
        opacity: 1;
    }
    .code-expand-icon-hide {
        opacity: 0;
        pointer-events: none;
    }
    .highlight-wrapper {
        display: none;
        overflow: auto;
        border-radius: 0 0 @border-radius-sm @border-radius-sm;
        &-expand {
            display: block;
        }
        pre[class*='language-'] {
            margin: 0;
        }
    }
    .highlight {
        position: relative;
        pre {
            margin: 0;
            padding: 0;
            background: #fff;
        }
        &:not(:first-child) {
            border-top: 1px dashed @site-border-color-split;
        }
    }
    &-actions {
        position: absolute;
        top: 10px;
        right: 12px;
        text-align: right;
        > i,
        > form {
            display: inline-block;
            margin-left: 8px;
        }
    }

    pre {
        margin: 0;
        width: auto;
        font-size: 16px;
        padding: 16px 32px;
        line-height: 2;
        code {
            border: none;
            background: #fff;
        }
    }
}
