.post-widget {
    width: @asideW - 10px;
    position: absolute;
    right: -@asideW - 30px;
    top: -@postOffsetY + 10px;
    max-height: calc(~"100% - @{topBarH} * 3 - 40px - 16px");
    overflow-y: scroll;
    &.fixed {
        // .transition(0.4s);
        position: fixed;
        top: @topBarH + 10px;
    }
}

.post-article {
    width: calc( ~"100% - 200px" );
    position: relative;

    .card {
        padding: 20px;
        .card(3px);
        > *:last-child {
            margin-bottom: 0;
        }
        > *:first-child {
            // padding-top: 0;
            margin-top: 0;
        }
    }

    .card,
    .column{
        margin-bottom: 20px;
    }
}

@media screen and (max-width: 1040px) {
	.post-widget {
        display: none;
    }
    .post-article {
        width: 100%;
    }
}

.post-toc-wrap {
    overflow-x: hidden;
    ol,
    ul {
        list-style: none;
        margin: 0;
    }

    strong {
        line-height: 2rem;
        font-size: @font-size + 1;
        font-weight: bold;
        color: @textSecondaryColor;
    }
}
.post-toc-child {
    padding-left: 10px;
}
.post-toc {
    padding: 0;
    font-size: @font-size - 1;
}
.post-toc-item {
    line-height: 1.5rem;
    color: @textSecondaryColor;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    cursor: pointer;
    .transition(0.3s);
    &:not(.active) ol{
        display: none;
    }
    &:not(.active){
        text-shadow: initial;
        color: @textSecondaryColor;
        .post-toc-link{
            color: @textSecondaryColor;
        }
        .post-toc-number{
            color: @textSecondaryColor;
        }
    }
    &:hover,
    &.active {
        color: @primaryColor_2;
        text-shadow: 0 0 0.5px @primaryColor_2;
        .post-toc-link{
            color: @primaryColor_2;
        }
    }
}
.post-toc-link {
    padding-right: 10px;
    color: @textSecondaryColor;
    .transition(none);
    &:hover{
        text-decoration: none;
    }
}

.toc-bar{
    width: calc(~"100% + 10px");
    height: 1.5rem;
    background: rgba(0, 0, 0, .1);
    position: absolute;
    left: -10px;
    top: 2rem;
    border-left: 2px solid @primaryColor_2;
    .transition(0.2s);
}

.post-article {
    .post-content {
        padding-top: 20px;
    }
}
.post-card {
    margin-top: @postOffsetY;
    min-height: 100px;
    padding: 35px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
    .post-meta {
        margin-top: 8px;
    }
}
.post-card-title {
    color: @primaryColor_1;
    font-size: @font-size + 18;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}
.post-nav {
    margin-top: 30px;
    padding: 16px 0 0;

    .prev,
    .next {
        width: 47%;
    }

    .next {
        text-align: right;
    }
}

.post-nav-link {
    display: block;
    line-height: 2em;
    font-size: @font-size + 2;
    padding: 10px 16px;
    .transition(0.2s);
    .hoverLine(@primaryColor_1);
    &:hover{
        text-decoration: none;
    }

    .icon {
        vertical-align: -9%;
    }

    .tips {
        color: @textSecondaryColor;
    }
    
}

.post-copyright {
    margin-bottom: 100px;
    font-size: @font-size;

    .content {
        margin-bottom: 1em;
        padding: 20px 30px;
        word-break: break-all;
        color: @textSecondaryColor;
        background: @copyrightColor;
        border-radius: 30px 30px 0;
    }

    footer {
        float: right;

        a {
            position: relative;
            display: block;
            overflow: hidden;
            padding: 0 16px 0 42px;
            height: 28px;
            line-height: 28px;
            color: @textSecondaryColor;
            background: @copyrightColor;
            border-radius: 14px;
        }
        img {
            position: absolute;
            top: 0;
            left: 0;
            width: 28px;
            height: 28px;
            border-radius: 50%;
        }
    }
}

.post-footer {
    position: relative;
    margin: 0 -35px;
    padding: 20px 35px 0;
    border-top: 1px solid #ddd;
}

.post-content {
    padding-bottom: 20px;
    line-height: 1.8;

    >.highlight,
    >.image-bubble,
    >pre {
        margin-left: -35px;
        margin-right: -35px;
    }

    >.highlight,
    >pre {
        padding: 20px 35px;
    }

    .image-bubble {
        margin-top: 20px;
        margin-bottom: 20px;
        text-align: center;
    }
    .image-caption {
        display: inline-block;
        margin-top: 10px;
        color: @textSecondaryColor;
    }

    .headerlink {
        opacity: 0;
        margin-left: -1em;
        padding-right: 5px;
        color: @lightPrimaryColor;
        transition: 0.2s;
        &:before {
            content: "#";
        }
    }

    p {
        word-wrap: break-word;
    }

    p,
    li {
        a {
            color: @primaryColor_2;
            border-bottom: 1px dotted lighten(@primaryColor_2, 20%);
            word-break: break-all;
            &:hover,
            &:active {
                text-decoration: none;
                border-bottom-style: solid;
                opacity: .7;
            }
        }
    }

    strong {
        font-weight: bold;
        color: @primaryColor_2;
        a {
            border-color: @primaryColor_2
        }
    }

    em {
        color: @textSecondaryColor;
    }

    h1 {
        font-size: @font-size + 10;
    }

    h2 {
        font-size: @font-size + 6;
    }

    h3 {
        font-size: @font-size + 3;
    }

    h4 {
        font-size: @font-size + 2;
    }

    h5 {
        font-size: @font-size + 1;
    }

    h6 {
        font-size: @font-size;
    }

    h1,
    h2,
    h3,
    h4,
    h5 {
        padding-top: @topBarH;
        margin-top: @topBarH * -1;
    }

    h1,
    h2,
    h3,
    h4,
    blockquote,
    ol,
    p,
    pre,
    table,
    ul,
    figure,
    .video-container {
        margin-bottom: 20px;
    }
    .video-container iframe {
        max-width: 100%;
    }

    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        color: @primaryColor_1;
        &:hover {
            .headerlink {
                opacity: 1;
            }
        }
    }

    blockquote p:first-child,
    blockquote:first-child,
    ol:first-child,
    p:first-child,
    pre:first-child,
    table:first-child,
    ul:first-child,
    figure:first-child {
        margin-top: 0
    }

    ol,
    ul {
        font-size: @font-size;
        line-height: 30px;
    }

    video,
    audio {
        max-width: 100%;
    }


    blockquote {
        position: relative;
        padding: 16px 20px;
        border-left: 4px solid @primaryColor_2;
        color: @textSecondaryColor;
        background: @backColor;
        font-size: @font-size;
        border-radius: 0 2px 2px 0;

        p {
            margin: 0;
        }

        footer {
            margin-top: 10px;
            text-align: right;
            font-size: 80%;
        }

        ul:first-child{
            margin-bottom: 0;
        }
        ul:not(:first-child){
            margin-top: 20px;
        }
    }

    table {
        width: 100%;
        border: 1px solid #dedede;
        margin: 15px 0;
        border-collapse: collapse;

        tr,
        td {
            height: 35px;
        }

        thead {
            tr {
                background: #f8f8f8;
            }
        }

        tbody {
            tr {
                &:hover {
                    background: #efefef;
                }
            }
        }

        td,
        th {
            border: 1px solid #dedede;
            padding: 0 10px;
        }
    }

    figure {
        table {
            border: none;
            width: auto;
            margin: 0;

            tbody {
                tr {
                    &:hover {
                        background: none;
                    }
                }

                td {
                    border: none;
                }
            }
        }
    }

    code,
    kbd,
    pre,
    samp {
        font-family: @font-code;
    }

    code,
    pre {
        display: inline-block;
        vertical-align: middle;
    }

    p code,
    li code {
        color: @primaryColor_2;
        line-height: 1;
        margin: 0 4px;
        font-size: 80%;
        padding: 3px 5px;
        border: 1px solid #eee;
        border-radius: 2px;
        word-wrap: break-word;
    }

    blockquote code{
        background: @textPrimaryColorWhite;
    }

    pre {
        margin: 24px 0;
        code {
            border-radius: 0;
            font-size: inherit;
            margin: 0;
            padding: 0;
        }
    }

    .column-2,
    .column-3 {
        .flex-row;
        .flex-row-wrap;
        .flex-justify-between;

        // > * {
        //     .flex-col;
        // }
    }

    .column-2 {
        > * {
            width: 48%;
        }
    }

    .column-3 {
        > * {
            width: 31%;
        }
    }
}


.comments {
    padding: 40px 0 0;
}

@media screen and (max-width:760px) {
    .post-widget {
        display: none
    }

    .post-article {
        float: none;
        width: 100%!important;
        padding-right: 0!important;
    }

    .post-card {
        position: relative;
        margin: 0 -16px;
        border-radius: 0;
        padding: 16px;

        .post-meta {
            margin-top: -40px;
            padding: 20px 12px;
            background: #fff;
            box-shadow: 0 1px 4px 0 rgba(0,0,0,.16);
            border-radius: 2px;
        }
    }

    .post-card-title {
        display: none
    }

    .post-nav {
        padding: 0;
        margin-left: -16px;
        margin-right: -16px;
        .prev,
        .next {
            width: 50%;
            background: #fff;
            border-bottom: 1px solid @borderColor;
            box-shadow: @boxShadow;
        }
        h4 {
            font-size: @font-size + 2;
            line-height: 1.5;
        }
    }

    .has-jax {
        font-size: @font-size - 1;
    }
    .MJXc-display {
        overflow-x: auto;
        overflow-y: hidden;
    }

    .comments {
        margin-left: -16px;
        margin-right: -16px
    }
}

@media screen and (max-width:480px) {
    .has-jax {
        font-size: @font-size - 4;
    }
    .post-content {
        .highlight,
        .image-bubble,
        >pre {
            margin-left: -16px;
            margin-right: -16px;
        }
        .highlight,
        >pre {
            padding: 16px;
        }
    }
}

