:root {
    --bg-color: #ffffff;
    --bg-inner-color: #eeeeee;
    --bg-canvas-color: #000000;
    --text-color: #444444;
    --table-bg-dark-color: #dfe2e5;
    --table-bg-light-color: #f8f8f8;
    --link-text-color: #4183C4;
    --nav-btn-bg-color: #e3e3e3;
    --select-text-bg-color: #B5D6FC;
    --select-text-font-color: auto;
    --monospace: "Lucida Console", Consolas, "Courier", monospace;
    --title-bar-height: 20px;
}

/* Background */
html {
    background-color: var(--bg-color);
    color: var(--text-color);
}

body {
    font-size: 18px;
    font-family: "Open Sans", "Clear Sans", "Helvetica Neue", Helvetica, Arial, 'Segoe UI Emoji', sans-serif;
    line-height: 1.6;

    tab-size: 4;

    word-break: normal;
    overflow-wrap: break-word;
}

/* Main content area for typical pages */
div.content-main {
    margin: 40px auto;
    max-width: 1000px;
    height: auto;

    background-color: var(--bg-inner-color);

    display: block;

    padding-top: 40px;
    padding-left: 60px;
    padding-right: 60px;
    padding-bottom: 100px;
}

/* Table of Contents */
div.content-toc {
    height: auto;
    width: 0;

    position: absolute;
    z-index: 1;
    top: 40px;
    left: 0px;
    
    background-color: var(--table-bg-light-color);

    overflow-x: hidden;
    overflow-y: scroll;
    overflow-wrap: normal;

    line-height: 1.1;
    font-size: smaller;
    
    padding-top: 40px;
    margin-left: 10px;

    transition: width 0.5s;
}

div.content-toc .toc-btn-close {
    position: absolute;
    top: 0;
    right: 25px;
    font-size: 36px;
    margin-left: 50px;
}

.toc-btn-open {
    display: flex;
    float: left;
    
    margin-top: -40px;
    margin-left: -60px;
    overflow: hidden;
}

.toc-btn-open button {
    background-color: var(--nav-btn-bg-color);
    color: var(--text-color);
    
    padding: 10px 15px;

    font-size: 20px;
    cursor: pointer;
    
    border: none;
}

div.content-toc ol {
    padding-left: 20px;
}

/* Basic style inherited from Typora */
.in-text-selection, ::selection {
    text-shadow: none;
    background: var(--select-text-bg-color);
    color: var(--select-text-font-color);
}

*, ::after, ::before {
    box-sizing: border-box;
}

a {
    color: var(--link-text-color);
}

canvas {
    background-color: var(--bg-canvas-color);
    display: block;
    padding: 0;
    margin: auto;
}

/* Headers */
h1, h2, h3 {
    line-height: 1.2;
}

h1, h2, h3, h4, h5, h6 {
    position: relative;
    margin-top: 1rem;
    margin-bottom: 1rem;
    font-weight: bold;
    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 {
    font-size: 2.25em;
    line-height: 1.2;
    border-bottom: 1px solid #ddd;
}
h2 {
    font-size: 1.75em;
    line-height: 1.225;
    border-bottom: 1px solid #ddd;
}

h3 {
    font-size: 1.5em;
    line-height: 1.43;
}
h4 {
    font-size: 1.25em;
}

/* Basic <p>, <li> styles */
p {
    line-height: inherit;
    display: block;
    margin-block-start: 1em;
    margin-block-end: 1em;
    margin-inline-start: 0px;
    margin-inline-end: 0px;
}

li {
    margin: 0px;
    position: relative;
}

li p {
    margin: 0.5rem 0px;
}


/* Tables */
figure {
    overflow-x: auto;
    margin: 1.2em 0px;
    max-width: calc(100% + 16px);
    padding: 0px;
}
figure > table {
    margin: 0px;
}

table {
    padding: 0;
    word-break: initial;
    margin: 0.8em 0;
    
    border-collapse: collapse;
    border-spacing: 0px;

    text-align: left;
}
table tr {
    border: 1px solid var(--table-bg-dark-color);
    margin: 0;
    padding: 0;
}
table thead, table tr:nth-child(2n) {
    background-color: var(--table-bg-light-color);
}
table thead, table tr {
    break-inside: avoid;
    break-after: auto;
}
table th {
    font-weight: bold;
    border: 1px solid var(--table-bg-dark-color);
    border-bottom: 0;
    margin: 0;
    padding: 6px 13px;
}
table td {
    border: 1px solid var(--table-bg-dark-color);
    margin: 0;
    padding: 6px 13px;
}
table th:first-child, table td:first-child { margin-top: 0; }
table th:last-child, table td:last-child { margin-bottom: 0; }
table tr th { border-bottom: 0; }

/* Code Formatting */
code.cordy, code.c-lang {
    font-family: monospace;
    white-space: pre-wrap;
}

span.cordy-keyword { color: #b5f; font-weight: bold; }
span.cordy-constant { color: #27f; font-weight: bold; }
span.cordy-native { color: #b80; }
span.cordy-type { color: #2aa; }
span.cordy-number { color: #385; }
span.cordy-string { color: #b10; }
span.cordy-comment { color: #aaa; }

span.c-comment { color: #aaa }
span.c-keyword { color: #27f; font-weight: bold; }
span.c-define { color: rgb(197, 119, 249); }
span.c-string { color: #b10; }
span.c-ident { color: #d1a13a; }


/* Block links */
a span.inline-block-link {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Navigation Tabs */
div.nav-tabs {
    display: flex;
    float: right;

    margin-right: -60px;
    margin-top: -40px;

    overflow: hidden;
}
div.nav-tab {
    position: relative;

    padding-left: 35px;
    padding-right: 15px;

    border-right: 3px solid var(--bg-inner-color);
    background-color: var(--nav-btn-bg-color);

    transform: skew(20deg);
    transform-origin: top;
    overflow: hidden;
}
div.nav-tab-selected {
    background-color: #d7dce7;
}
div.nav-tab:hover {
    background-color: var(--select-text-bg-color);
}
div.nav-tab p {
    margin: 0px;
    height: 40px;
    line-height: 40px;
    text-align: center;

    transform: skew(-20deg);
    transform-origin: top;
}

/* Rows */
.two-rows {
    position: relative;
}
.row {
    display: inline-block;
    margin-block-start: 0em;
    margin-block-end: 0em;
}
.row-small {
    font-family: monospace;
    font-size: smaller;
    line-height: 1.0;
}