:root {
    --bg-color:  #ffffff;
    --text-color: #333333;
    --code-block-bg-color: inherit;//#f8f8f8;
}

html {
    font-size: 14px;
    background-color: #ffffff;
    background-color: var(--bg-color);
    color: #333333;
    color: var(--text-color);
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    margin: 0;
    padding: 0;
    height: auto;
    bottom: 0;
    top: 0;
    left: 0;
    right: 0;
    font-size: 1rem;
    line-height: 1.42857143;
    overflow-x: hidden;
    background: inherit;
}

a:active,
a:hover {
    outline: 0;
}

*.in-text-selection,
::selection {
    background: #B5D6FC;
    text-shadow: none;
}

#write {
    margin: 0 auto 0;
    height: auto;
    width: inherit;
    word-break: normal;
    word-wrap: break-word;
    position: relative;
    padding-bottom: 70px;
    white-space: pre-wrap;
    overflow-x: visible;
    /*contain: layout paint;*/
}

.for-image #write {
    padding-left: 8px;
    padding-right: 8px;
}

body.typora-export {
    padding-left: 30px;
    padding-right: 30px;
}

@media screen and (max-width: 500px) {
    body.typora-export {
        padding-left: 0;
        padding-right: 0;
    }

    /** remove codemirror line number for small screen */
    .CodeMirror-sizer {
        margin-left: 0 !important;
    }
    .CodeMirror-gutters {
        display: none !important;
    }
}

.typora-export #write {
    margin: 0 auto;
}

#write > p:first-child,
#write > ul:first-child,
#write > ol:first-child,
#write > pre:first-child,
#write > blockquote:first-child,
#write > div:first-child,
#write > table:first-child {
    margin-top: 30px;
}

#write li > table:first-child {
    margin-top: -20px;
}

img {
    max-width: 100%;
    vertical-align: middle;
}

input,
button,
select,
textarea {
    font-size: inherit;
    color: inherit;
    font: inherit;
}

input[type="checkbox"],
input[type="radio"] {
    line-height: normal;
    padding: 0;
}

*:before,
*:after,
* {
    box-sizing: border-box;
}

#write p,
#write h1,
#write h2,
#write h3,
#write h4,
#write h5,
#write h6,
#write div,
#write pre {
    width: inherit;
}

#write p,
#write h1,
#write h2,
#write h3,
#write h4,
#write h5,
#write h6 {
    position: relative;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.8rem;
}

h3 {
    font-size: 1.6rem;
}

h4 {
    font-size: 1.4rem;
}

h5 {
    font-size: 1.2rem;
}

h6 {
    font-size: 1rem;
}

p {
    -webkit-margin-before: 1rem;
    -webkit-margin-after: 1rem;
    -webkit-margin-start: 0px;
    -webkit-margin-end: 0px;
}

.typora-export p {
    white-space: normal;
}

.mathjax-block {
    margin-top: 0;
    margin-bottom: 0;
    -webkit-margin-before: 0rem;
    -webkit-margin-after: 0rem;
}


/*
    Hack to remove background from Mobile Safari.
    Can't use it globally since it destroys checkboxes in Firefox and Opera
*/

.hidden {
    display: none;
}

.md-blockmeta {
    color: #CCCCCC;
    font-weight: bold;
    font-style: italic;
}

a {
    cursor: pointer;
}

sup.md-footnote {
    padding: 2px;
    padding-left: 4px;
    padding-right: 4px;
    background-color: rgba(238, 238, 238, 0.7);
    color: #555;
    border-radius: 4px;
}

#write input[type='checkbox'] {
    cursor: pointer;
    width: inherit;
    height: inherit;
    margin: 4px 0 0;
}

#write > figure:first-child {
    margin-top: 16px;
}

figure {
    overflow-x: auto;
    margin: 0;
    max-width: calc(100% + 16px);
    padding: 8px;
    margin-left: -8px;
    margin-top: -8px;
}

tr {
    page-break-inside: avoid;
    page-break-after: auto
}

thead {
    display: table-header-group
}

table {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
    overflow: auto;
    page-break-inside: auto;
    text-align: left;
}

table.md-table td {
    min-width: 80px;
}

.CodeMirror-gutters {
    border-right: 0;
    background-color: inherit;
}

.CodeMirror {
    text-align: left;
}

.CodeMirror-placeholder {
    opacity: 0.3;
}

.CodeMirror pre {
    padding: 0 4px;
}

.CodeMirror-lines {
    padding: 0 0 0 0;
}

div.hr:focus {
    cursor: none;
}

pre {
    white-space: pre-wrap;
}

.CodeMirror-gutters {
    margin-right: 4px;
}

.md-fences {
    font-size: 0.9rem;
    position: relative !important;
    display: block;
    page-break-inside: avoid;
    text-align: left;
    overflow: visible;
    white-space: pre;
    background: inherit;
    background: var(--code-block-bg-color);
}

.md-diagram-panel {
    width: 100%;
    margin-top: 10px;
    text-align: center;
    padding-top: 0;
    padding-bottom: 8px;
    overflow-x: auto;
}

.md-fences .CodeMirror.CodeMirror-wrap {
    top: -1.6em;
    margin-bottom: -1.6em;
}

.md-fences.mock-cm {
    white-space: pre-wrap;
}

.show-fences-line-number .md-fences {
    padding-left: 0;
}

.show-fences-line-number .md-fences.mock-cm {
    padding-left: 40px;
}

.CodeMirror-line {
    page-break-inside: avoid;
}

.footnotes {
    opacity: 0.8;
    font-size: 0.9rem;
    padding-top: 1em;
    padding-bottom: 1em;
}

.footnotes+.footnotes {
    margin-top: -1em;
}

.md-reset {
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    vertical-align: top;
    background: transparent;
    text-decoration: none;
    text-shadow: none;
    float: none;
    position: static;
    width: auto;
    height: auto;
    white-space: nowrap;
    cursor: inherit;
    -webkit-tap-highlight-color: transparent;
    line-height: normal;
    font-weight: normal;
    text-align: left;
    -moz-box-sizing: content-box;
    -webkit-box-sizing: content-box;
    box-sizing: content-box;
    direction: ltr;
}

li div {
    padding-top: 0;
}

blockquote {
    margin: 1rem 0;
}

li p,
li .mathjax-block {
    margin: 0.5rem 0;
}

li {
    margin: 0;
    position: relative;
}

blockquote >:last-child {
    margin-bottom: 0;
}

blockquote >:first-child {
    margin-top: 0;
}

.footnotes-area {
    color: #888;
    margin-top: 0.714rem;
    /*10px*/
    padding-bottom: 0.143rem;
    /*20px*/
}

@media print {
    /**
     * needed to prevent extra blank page
     */
    html, body {
        border: 1px solid transparent;
        height: 99%;
        page-break-after: avoid;
        page-break-before: avoid;
    }

    .typora-export * {
        -webkit-print-color-adjust: exact;
    }

    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        page-break-after: avoid;
        break-after: avoid-page;
        orphans: 2;
    }

    p {
        orphans: 4;
    }

    html.blink-to-pdf {
        font-size: 13px;
    }

    .typora-export #write {
        padding-left: 1cm;
        padding-right: 1cm;
        padding-bottom: 0;
        page-break-after: avoid;
    }

    .typora-export #write:after {
        height: 0;
    }

    @page {
        margin-top: 20mm;
        margin-bottom: 20mm;
        margin-left: 0mm;
        margin-right: 0mm;
    }

    /*body.typora-export {
        padding-top: 30px;
        padding-bottom: 30px;
    }

    .md-toc {
        page-break-inside: avoid;
    }*/
}

.footnote-line {
    margin-top: 0.714em;
    font-size: 0.7em;
}

a img,
img a {
    cursor: pointer;
}

pre.md-meta-block {
    font-size: 0.8rem;
    min-height: 2.86rem;
    /*40px*/
    white-space: pre-wrap;
    ;
    background: #cccccc;
    display: block;
    overflow-x: hidden;
}

p > img:only-child {
    display: block;
    margin: auto;
}

p .md-image:only-child{
    display: inline-block;
    width: 100%;
    text-align: center;
}

#write .MathJax_Display {
    margin: 0.8em 0 0 0;
}

.mathjax-block {
    white-space: pre;
    overflow: hidden;
    width: 100%;
}

p + .mathjax-block {
    margin-top: -1.143rem;
}

.mathjax-block:not(:empty):after {
    display: none;
}

[contenteditable="true"]:active,
[contenteditable="true"]:focus {
    outline: none;
    box-shadow: none;
}

.task-list {
    list-style-type: none;
}

.task-list-item {
    position: relative;
    padding-left: 1em;
}

.task-list-item input {
    position: absolute;
    top: 0px;
    left: 0px;
}

.math {
    font-size: 1rem;
}

.md-toc {
    min-height: 3.58rem;
    position: relative;
    font-size: 0.9rem;
    border-radius: 10px;
}

.md-toc-content {
    position: relative;
    margin-left: 0px;
}

.md-toc:after,
.md-toc-content:after {
    display: none;
}

.md-toc-item {
    display: block;
    color: #4183c4;
}

.md-toc-item a {
    text-decoration: none;
}

.md-toc-inner:hover {
    //text-decoration: underline;
}

.md-toc-inner {
    display: inline-block;
    cursor: pointer;
}

.md-toc-h1 .md-toc-inner {
    margin-left: 0;
    font-weight: bold;
}

.md-toc-h2 .md-toc-inner {
    margin-left: 2em;
}

.md-toc-h3 .md-toc-inner {
    margin-left: 4em;
}

.md-toc-h4 .md-toc-inner {
    margin-left: 6em;
}

.md-toc-h5 .md-toc-inner {
    margin-left: 8em;
}

.md-toc-h6 .md-toc-inner {
    margin-left: 10em;
}

@media screen and (max-width: 48em) {
    .md-toc-h3 .md-toc-inner {
        margin-left: 3.5em;
    }
    .md-toc-h4 .md-toc-inner {
        margin-left: 5em;
    }
    .md-toc-h5 .md-toc-inner {
        margin-left: 6.5em;
    }
    .md-toc-h6 .md-toc-inner {
        margin-left: 8em;
    }
}

a.md-toc-inner {
    font-size: inherit;
    font-style: inherit;
    font-weight: inherit;
    line-height: inherit;
}

.footnote-line a:not(.reversefootnote) {
    color: inherit;
}

.md-attr {
    display: none;
}

.md-fn-count:after {
    content: ".";
}

.md-tag {
    opacity: 0.5;
}

.md-comment {
    color: #a27f03;
    opacity: 0.8;
    font-family: monospace;
}

code {
    text-align: left;
}

h1 .md-tag,
h2 .md-tag,
h3 .md-tag,
h4 .md-tag,
h5 .md-tag,
h6 .md-tag {
    font-weight: initial;
    opacity: 0.35;
}

a.md-print-anchor {
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: none !important;
    display: inline-block !important;
    position: absolute !important;
    width: 1px !important;
    right: 0 !important;
    outline: none !important;
    background: transparent !important;
    text-decoration: initial !important;
    text-shadow: initial !important;
}

.md-inline-math .MathJax_SVG .noError {
    display: none !important;
}

.mathjax-block .MathJax_SVG_Display{
    display: block!important;
    text-align: center;
    margin: 1em 0em;
    position: relative;
    text-indent: 0;
    max-width: none;
    max-height: none;
    min-width: 0;
    min-height: 0;
    min-width: 100%;
    width: auto;
}

.MathJax_SVG_Display,
.md-inline-math .MathJax_SVG_Display{
    display: inline-block !important;
    width: auto;
    margin: inherit;
}

.MathJax_SVG .MJX-monospace {
    font-family: monospace
}

.MathJax_SVG .MJX-sans-serif {
    font-family: sans-serif
}

.MathJax_SVG {
    display: inline;
    font-style: normal;
    font-weight: normal;
    line-height: normal;
    zoom: 90%;
    font-size-adjust: none;
    text-indent: 0;
    text-align: left;
    text-transform: none;
    letter-spacing: normal;
    word-spacing: normal;
    word-wrap: normal;
    white-space: nowrap;
    float: none;
    direction: ltr;
    max-width: none;
    max-height: none;
    min-width: 0;
    min-height: 0;
    border: 0;
    padding: 0;
    margin: 0
}

.MathJax_SVG * {
    transition: none;
    -webkit-transition: none;
    -moz-transition: none;
    -ms-transition: none;
    -o-transition: none
}

/* for pretty print*/
.md-diagram-panel>svg {
    max-width: 100%;
}

[lang="flow"] svg,
[lang="mermaid"] svg  {
    max-width: 100%;
}


