:root {
  --color-background: #F5F5DC;
  --color-text: #333;
  --color-link: #555;
  --color-link-visited: #777;
  --color-code-block: #222;
  --color-code-inline: #AAA;
  --color-code-inline-background: #444;
  --color-tag: #555;
  --color-highlight: #DDD;
  --color-highlight-border: #555;
  --color-scrollbar: rgba(0, 0, 0, .2);
  --color-scrollbar-hover: rgba(0, 0, 0, .5);
  --color-scrollbar-track-hover: rgba(0, 0, 0, .15);
  --switch-filter: invert(0);
  --line-width: 0.125rem;
}

.dark {
  --color-background: #222;
  --color-text: #CCC;
  --color-link: #AAA;
  --color-link-visited: #999;
  --color-code-block: #999;
  --color-code-inline: #222;
  --color-code-inline-background: #AAA;
  --color-tag: #AAA;
  --color-highlight: #222;
  --color-highlight-border: #DDD;
  --color-scrollbar: rgba(255, 255, 255, .2);
  --color-scrollbar-hover: rgba(255, 255, 255, .5);
  --color-scrollbar-track-hover: rgba(255, 255, 255, .15);
  --switch-filter: invert(100%);
}



body {
  margin: 40px auto;
  max-width: 650px;
  line-height: 1.6;
  font-family: Noto, 'PingFang HK', 'Microsoft Sans Serif', 'Microsoft JHengHei', sans-serif;
  font-size: 18px;
  background-color: var(--color-background);
  color: var(--color-text);
  padding: 0 10px;
}

h1,
h2,
h3 {
  line-height: 1.2
}

/* header extension */

h1:before {
  content: "# ";
}

h2:before {
  content: "## ";
}

h3:before {
  content: "### ";
}

h4:before {
  content: "#### ";
}

h5:before {
  content: "##### ";
}

h6:before {
  content: "###### ";
}

/* footer extension */

.footer {
  text-align: center;
  font-size: 16px;
}

/* link extension */

a:link {
  text-decoration: underline;
  color: var(--color-link);
}

a:visited {
  text-decoration: none;
  color: var(--color-link-visited);
}

a:hover,
a:active {
  text-decoration: underline;
  color: #77beec;
}

/* general extension */

img {
  outline: none;
  border: none;
  max-width: 100%;
}

table {
  width: 100%;
}

blockquote {
  border-left-width: 2px;
  border-left-color: gray;
  border-left-style: solid;
  padding: 0 10px 0;
}

/* index extension */

.header {
  text-align: center;
  margin-bottom: 15px;
}

.header>h1 {
  line-height: 1;
}

.header>h1:before {
  content: "";
}

.home-title {
  margin: 20px 0 20px;
}

.home-nav {
  text-align: center;
}

.hometag {
  border: 1px solid #555;
  margin: 5px;
  padding: 0 5px;
  color: #555;
  border-radius: 5px;
  display: inline-block;
}

.tag {
  border-color: var(--color-tag);
  color: var(--color-tag);
}

/* post extension */

.opw {
  background-color: gold;
  font-weight: bold;
  color: black;
  padding: 10px 20px;
  border-radius: 5px;
}

.isso-thread-heading::before {
  content: "";
}

.image-caption {
  font-style: italic;
  text-align: center;
  font-size: 16px;
}

/* code block extension */
pre {
  font: 0.8em/1.0em "0xProto", "Courier New", Courier;
  color: var(--color-code-block);
}

code {
  font: 0.8em/1.0em "0xProto", "Courier New", Courier;
  color: var(--color-code-inline);
  background: var(--color-code-inline-background);
  border-radius: 5px;
  padding: 4px;
  font-size: 16px;
}

.highlight {
  border-color: var(--color-highlight-border);
  border-style: solid;
  border-width: var(--line-width);
  border-radius: 5px;
  overflow: auto;
  background: var(--color-highlight);
}

.highlight .gutter {
  border-right-color: var(--color-highlight-border);
  border-right-style: solid;
  border-right-width: var(--line-width);
  padding-left: 10px;
  padding-right: 10px;
  text-align: right;
}

.highlight .code {
  width: 100%;
  padding-left: 10px;
}

.highlight figcaption {
  border-bottom-color: var(--color-highlight-border);
  border-bottom-style: solid;
  border-bottom-width: var(--line-width);
}

.highlight figcaption span {
  margin: 5px;
}


@media not all and (min-resolution:.001dpcm) {
  @supports (-webkit-appearance:none) and (stroke-color:transparent) {
    .highlight figcaption {
      border-bottom-width: 0;
    }

    .highlight:has(> figcaption) table {
      border-top-color: #555;
      border-top-style: solid;
      border-top-width: 0.5px;
    }
  }
}

/* scrollbar extension */

::-webkit-scrollbar {
  width: 10px;
  height: 10px
}

::-webkit-scrollbar-button {
  width: 0;
  height: 0
}

::-webkit-scrollbar-button:end:decrement,
::-webkit-scrollbar-button:start:increment {
  display: none
}

::-webkit-scrollbar-corner {
  display: block
}

::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background-color: var(--color-scrollbar);
}

::-webkit-scrollbar-thumb:hover {
  border-radius: 8px;
  background-color: var(--color-scrollbar-hover);
}

::-webkit-scrollbar-track:hover {
  background-color: var(--color-scrollbar-track-hover);
}

::-webkit-scrollbar-thumb,
::-webkit-scrollbar-track {
  border-right: 1px solid transparent;
  border-left: 1px solid transparent;
}



::-webkit-scrollbar-button:end,
::-webkit-scrollbar-button:start {
  width: 10px;
  height: 10px
}

/* dynamic navigation support */
.row {
  display: flex;
}

.row .seperator {
  display: none;
  padding: 10px;
}

.column {
  text-align: center;
  flex: 50%;
}

.column img {
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: 90%;
}

@media screen and (max-width: 400px) {
  .row {
    display: block;
  }

  .column img {
    width: 90%;
  }
}


/* dark mode support */
.btn {
  background-color: transparent;
  background-repeat: no-repeat;
  border: none;
  cursor: pointer;
  overflow: hidden;
  outline: none;
}

.theme-switch {
  filter: var(--switch-filter);
}