:root {
    --primary-color: #37352f;
    --bg-color: #ffffff;
    --bg-color-dark: #f7f6f3;
    --dark-trait: #e9e9e7;
    --light-trait-100: #ecedec;
    --light-trait-200: #c70000;
    --light-trait-300: #37352f;
    --light-trait-400: #f7f6f3;
    --text-color: #37352f;
    --text-color-secondary: #73726e;
    --text-highlight-color: #fff;
    --text-highlight-bg: rgba(var(--primary-color-rgb), 0.3);
    --select-text-bg-color: #c0e5f4;
	--search-select-text-color:#448361;
    --search-select-bg-color: #edf3ec;
    --code-color: #9a6e3a;
    --border-radius: 4px;
    --font-size: 16px;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
    --monospace: 'SF Mono Medium', 'Fira Code', 'Cousine', 'Consolas', monospace;
    --heading-char-color: var(--light-trait-400);
    --color-popover-bg-color: var(--text-color);
    --rawblock-edit-panel-bd: var(--bg-color-dark);
    --control-text-color: #72706b;
    --meta-content-color: var(--primary-color);
    --primary-btn-border-color: var(--primary-color);
    --side-bar-bg-color: var(--bg-color-dark);
    --item-hover-bg-color: #e8e7e4;
    --active-file-bg-color: #e8e7e4;
    --active-file-border-color: var(--bg-color);
    --window-border: 1px solid var(--bg-color);
    --focus-ring-color: transparent;
}

html {
    font-size: var(--font-size);
}

body {
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
    color: var(--text-color);
    line-height: 1.6;
}

code {
    background-color: #f7f6f3;
    padding: 0 2px 0 2px;
}

#write {
    max-width: 860px;
    margin: 0 auto;
    padding: 30px;
    padding-bottom: 100px;
}

@media only screen and (min-width: 1400px) {
    #write {
        max-width: 1024px;
    }
}

@media only screen and (min-width: 1800px) {
    #write {
        max-width: 1200px;
    }
}

#write>ul:first-child, #write>ol:first-child {
    margin-top: 30px;
}

a {
    color: var(--primary-color);
}

h1, h2, h3, h4, h5, h6 {
    position: relative;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.4;
    cursor: text;
}

h1:hover a.anchor, h2:hover a.anchor, h3:hover a.anchor, h4:hover a.anchor, h5:hover a.anchor, h6:hover a.anchor {
    text-decoration: none;
}

h1 tt, h1 code, h2 tt, h2 code, h3 tt, h3 code, h4 tt, h4 code, h5 tt, h5 code, h6 tt, h6 code {
    font-size: inherit;
}

h1 {
    padding-bottom: 0.3em;
    font-size: 2.2em;
    line-height: 1.3;
}

h2 {
    padding-bottom: 0.3em;
    font-size: 1.75em;
    line-height: 1.225;
}

h3 {
    font-size: 1.4em;
    line-height: 1.43;
}

h4 {
    font-size: 1.2em;
}

h5 {
    font-size: 1em;
}

h6 {
    font-size: 1em;
    color: var(--light-trait-300);
}

p, blockquote, ul, ol, dl, table {
    margin: 0.8em 0;
}

li>ol, li>ul {
    margin: 0 0;
}

hr {
    background-color: var(--light-trait-100);
    height: 1.5px;
    border: none
}

a,
.md-def-url {
    color: var(--text-color);
    text-decoration: none;
    border-bottom:0.05em solid;
    border-color: #37352f;
    opacity:0.6;
    transition: all .1s ease-in; 
}

a:hover {
    text-decoration: none;
    opacity:1;
}

sup.md-footnote {
    background-color: var(--light-trait-400);
    color: #888884;
}

li p.first {
    display: inline-block;
}

ul, ol {
    padding-left: 30px;
}

ul:first-child, ol:first-child {
    margin-top: 0.35%;
}

ul:last-child, ol:last-child {
    margin-bottom: 0;
}

mark, .ty-file-search-match-text, .md-search-hit {
    background: #fdebec;
	color: #d44c47;
}

mark {
    border-radius: 4px;
    color: #402c1b;
    font-weight: inherit;
    background-color: #fdecc8;
    padding-left: 4px;
    padding-right: 4px;
    padding-top: 2px;
    padding-bottom: 2px;
    margin-left: 2px;
    margin-right: 2px;
}

.md-search-hit * {
    color: var(--search-select-text-color);
}

/* Search highlight */
.cm-search-hit.CodeMirror-selectedtext, .md-search-hit.md-search-select, .md-search-select {
    outline: 0px solid var(--search-select-text-color);
}

.outline-item.select, .ty-search-item-line.select, .ty-search-item.select {
    outline-width: 2px;
}

.outline-item.select {
    outline-offset: 0px;
}

blockquote {
    margin-left: 1.75px;
    margin-right: 0px;
    border-left: 4px solid var(--text-color);
    padding: 10px 14px 7px 22px;
    /* change the quote highlight */
    background-color: #f7f7f7;
}

blockquote blockquote {
    padding-right: 0;
}

/* Alternating color rows in table*/
table tr:nth-child(2n) {
    background-color: #f7f7f7;
  }

table tr:nth-child(2n + 1) {
    background-color: #fdfdfd;
}
/* Alternating color rows in table*/

table {
    padding: 0;
    word-break: initial;
}

table tr {
    border-top: 1px solid var(--dark-trait);
    margin: 0;
    padding: 0;
}

table tr th {
    font-weight: bold;
    border: 1px solid var(--dark-trait);
    border-bottom: 0;
    margin: 0;
    padding: 6px 13px;
}

table tr td {
    border: 1px solid var(--dark-trait);
    margin: 0;
    padding: 6px 13px;
}

table tr th:first-child, table tr td:first-child {
    margin-top: 0;
}

table tr th:last-child, table tr td:last-child {
    margin-bottom: 0;
}


kbd {
    font-size: 0.875rem;
    background: var(--bg-color-dark);
    border: 1px solid var(--dark-trait);
    box-shadow: 0 2px 0 var(--dark-trait);
    color: var(--text-color-secondary);
}

.md-fences, code, tt {
    border: none;
    background-color: #f7f6f3;
    border-radius: var(--border-radius);
    padding: 2px 4px 0px 4px;
    font-size: 0.975em;
    font-weight: medium;
    font-family: var(--monospace)
}
.md-fences {
    margin-bottom: 15px;
    margin-top: 15px;
    padding-top: 8px;
    padding-bottom: 6px;
}

#write pre.md-meta-block {
    padding: 1rem;
    font-size: 85%;
    line-height: 1.45;
    background-color: var(--bg-color-dark);
    border: 0;
    border-radius: var(--border-radius);
    color: var(--text-color-secondary);
    margin-top: 0 !important;
}

#write .mathjax-block .md-rawblock-tooltip {
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
}

#write .mathjax-block .md-math-container {
    border-top-left-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
    border-bottom-left-radius: var(--border-radius);
}

#write .md-mathblock-panel .md-rawblock-control:first-of-type {
    border-top-left-radius: var(--border-radius);
}

.md-mathjax-midline {
    background-color: var(--bg-color);
    color: var(--text-color);
}

.md-inline-math script {
    color: var(--code-color);
}

.CodeMirror-lines {
    padding-left: 4px;
}

.code-tooltip {
    box-shadow: none;
    border-radius: var(--border-radius);
}

#write .code-tooltip {
    bottom: initial;
    top: 100%;
    left: initial;
    right: -1px;
    background: var(--bg-color-dark);
    border: 1px solid var(--dark-trait);
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-top: 0;
    font-family: var(--monospace);
}

#write .md-mathblock-panel .code-tooltip {
    right: 0;
    border: none;
}

/* TODO */
#write .md-task-list-item>input {
    -webkit-appearance: initial;
    display: inline-block;
    text-align: center;
    vertical-align: middle;
    position: absolute;
    border: 1px solid var(--text-color);
    /* border-radius: 100%; */
    margin-left: -1.45rem;
    height: 0.95rem;
    width: 0.95rem;
    transition: all 0.35s;
}

#write .md-task-list-item>input:focus {
    outline: none;
    box-shadow: none;
}

#write .md-task-list-item>input[checked] {
    background: #2eaadc;
    border: 1px solid #2eaadc;
    text-decoration: line-through;
}

#write .md-task-list-item>input[checked]::before {
    display: inline-block;
    vertical-align: middle;
    content: '✓';
    position: absolute;
    margin-top: 0.05rem;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    text-align: absolute;
    color: var(--bg-color);
    font-size: 0.75em;
    font-weight: 760;
}

#write .md-task-list-item>input[checked]::after {
    text-decoration: line-through;
}

/* TODO */
.md-image>.md-meta {
    border-radius: var(--border-radius);
    padding: 2px 0px 0px 4px;
    font-size: 0.9em;
    color: inherit;
}

.md-toc {
    margin-top: 20px;
    padding-bottom: 20px;
}

/* Source mode */
.CodeMirror.cm-s-typora-default *, .cm-s-typora-default * {
    background: inherit;
    color: var(--text-color);
    font-family: var(--monospace);
    font-size: var(--font-size) !important;
    font-style: normal;
    font-weight: medium;
}

.CodeMirror.cm-s-typora-default div.CodeMirror-cursor {
    border-left: 2px solid var(--text-color);
}

.sidebar-tabs {
    border-bottom: none;
}

.outline-expander {
    width: 1.5rem;
    vertical-align: initial;
}

.outline-expander:before, .outline-expander:hover:before, .outline-item-open>.outline-item>.outline-expander:before, .outline-item-open>.outline-item>.outline-expander:hover:before {
    content: "\f125";
    transition: transform 125ms ease-in-out;
}

.outline-item-open>.outline-item>.outline-expander:hover:before, .outline-item-open>.outline-item>.outline-expander:before {
    transform: rotate(90deg);
}

.outline-label:hover {
    text-decoration: none;
}

#toc-dropmenu {
    background: var(--bg-color-dark);
}

#toc-dropmenu .outline-title {
    font-size: 1rem;
    text-transform: uppercase;
}

.dropdown-menu .divider {
    display: none;
}

.context-menu {
    border: none!important;
    backdrop-filter: saturate(180%) blur(20px) brightness(1.1);
    background-color: var(--bg-color-dark);
    box-shadow: 0 25.6px 57.6px 0 rgba(0, 0, 0, .22), 0 4.8px 14.4px 0 rgba(0, 0, 0, .18)!important;
}

.file-node-background {
    height: 31px;
}

.file-node-content:hover .file-node-icon, .file-node-content:hover .file-node-open-state {
    visibility: visible;
}

.file-node-icon {
    margin-right: 8px;
}

.file-library-node:not(.file-node-root):focus>.file-node-content {
    outline: none;
}

/* New file animation */
.blink-area {
    animation: none;
}

.file-list-item-summary {
    font-size: var(--font-size);
    font-family: var(--font-family);
}

#md-searchpanel input {
    border-radius: var(--border-radius);
    box-shadow: none;
}

#md-searchpanel input:focus {
    box-shadow: none;
    border-color: var(--meta-content-color);
}

#md-searchpanel .search-type-selection {
    width: auto;
}

#md-searchpanel .btn:not(.close-btn):hover {
    box-shadow: none;
}

.mac-seamless-mode #typora-sidebar {
    background-color: var(--side-bar-bg-color);
}

#md-notification .btn {
    border: 0;
}

/* CODE HIGHLIGHT */
pre.CodeMirror-line {
    color: #999999!important
}

.cm-variable {
    color: #37352f!important;
}

.cm-keyword {
    color: #0277aa !important
}

.cm-tag {
    color: #ff5a5a!important
}

.cm-variable-3 {
    color: #48ff00!important;
}

.cm-bracket, .cm-error {
    color: #ff5a5a!important
}

.cm-attribute {
    color: #0277aa!important;
}

.cm-def {
    color: #dc4a68!important;
}

.cm-comment {
    color: #708090!important;
}

.cm-string {
    color: #669900!important;
    font-variant-ligatures: common-ligatures!important;
}

.cm-tag:not() {
    font-weight: 700;
}

.cm-operator {
    color: #9a6e3b!important;
}

.cm-number {
    color: #990055!important;
}

.cm-meta {
    color: var(--text-color) !important;
    font-weight: 700!important;
}

.cm-atom { color: #845dc4; }

.cm-builtin {
    color: #669900 !important;
}

.cm-property {
    color: var(--text-color) !important;
}

.cm-variable-2 {
    color: var(--text-color) !important;
}

.cm-variable-3 {
    color: #845dc4;
}

/* CODE HIGHLIGHT */
.file-tree-node.active>.file-node-background {
    background-color: var(--active-file-bg-color);
    border-left: 0px solid #dad9d6!important;
    border-color: #dad9d6!important;
    background-color: #e8e7e4!important;
}

.CodeMirror-gutters {
    border-right: 1px solid #f1f3f450;
    background: inherit;
    white-space: nowrap;
}

.ty-footer, .sidebar-footer, footer {
    backdrop-filter: saturate(120%) blur(20px) brightness(0.85);
    border: none!important;
    background: none;
    background-color: #f7f6f3;
}

.code-tooltip {
    border-radius: 4px;
    background-color: #313334;
    box-shadow: 0 25.6px 57.6px 0 rgba(0, 0, 0, .52), 0 4.8px 14.4px 0 rgba(0, 0, 0, .28)!important;
}

#sidebar-files-menu {
    border-radius: 4px;
    border: none!important;
    box-shadow: 0 25.6px 57.6px 0 #f7f6f3, 0 4.8px 14.4px 0 rgba(0, 0, 0, .28);
}

.code-tooltip.md-tooltip-hide.md-hover-tip {
    box-shadow: 0 25.6px 57.6px 0 rgba(0, 0, 0, .52), 0 4.8px 14.4px 0 rgba(0, 0, 0, .28);
}

#typora-sidebar {
    border: none !important;
}

#footer-word-count-info, #spell-check-panel {
    border: none!important;
    backdrop-filter: saturate(120%) blur(20px) brightness(0.85)!important;
    box-shadow: 0 25.6px 57.6px 0 rgba(0, 0, 0, .32), 0 4.8px 14.4px 0 rgba(0, 0, 0, .28)!important;
}

/* Windows/Linux unibody mode */
.megamenu-content,
.megamenu-opened header {
    color:  var(--primary-color);
    background: var(--bg-color-dark);
}

#recent-file-panel-action-btn {
    background: inherit;
    border: 1px var(--light-trait-300) solid;
}

.megamenu-menu-panel table td:nth-child(1) {
    color: var(--text-color);
    background: var(--bg-color-dark);
}

.megamenu-menu-panel table td:nth-child(2) {
    color: var(--text-color);
    background: var(--bg-color-dark);
}

.megamenu-menu-panel tbody tr:hover td:nth-child(1) {
    color: var(--text-color);
    background: var( --active-file-bg-color);
}

.megamenu-menu-panel tbody tr:hover td:nth-child(2) {
    color: var(--text-color);
    background: var( --active-file-bg-color);
}

.megamenu-menu-panel input[type='text'] {
    background: inherit;
    border: 1px var(--control-text-color) solid;
}

#recent-file-panel-action-btn {
    background: inherit;
}

.megamenu-menu, .megamenu-content {
	background: var(--side-bar-bg-color);
	color: var(--text-color);
}

#top-titlebar, #top-titlebar * {
    background: inherit;
	color: var(--text-color);
}

.megamenu-menu-header #megamenu-menu-header-title:before {
	color:  var(--text-color);
}

megamenu-back-btn {
	color: var(--text-color);
	border-color: var(--text-color);
}

.megamenu-menu-header #megamenu-menu-header-title,
.megamenu-menu-header:hover,
.megamenu-menu-header:focus {
	color: inherit;
}

.megamenu-menu-panel table tr:nth-child(2n + 1) {
    background-color:  var(--side-bar-bg-color);
}