@media screen and (max-width: 600px) {
  #write {
    padding: 2rem;
    line-height: 1.5rem;
  }

  #write h1,
  #write h2 {
    font-size: 1.5rem;
    text-align: left;
  }

  #write h3,
  #write h4,
  #write h5,
  #write h6 {
    font-size: 1rem;
  }

  #write h1,
  #write h2,
  #write h3,
  #write h4,
  #write h5,
  #write h6 {
    margin: 1.5rem 0;
  }

  #write h1:before,
  #write h2:before,
  #write h3:before,
  #write h4:before,
  #write h5:before,
  #write h6:before {
    display: inline;
    border: none;
    top: 0;
    margin-right: 1rem;
    background: none;
    color: var(--theme-color);
  }

  #write h1::after,
  #write h2::after,
  #write h3::after,
  #write h4::after,
  #write h5::after,
  #write h6::after {
    border: none;
  }

  #write h1::before {
    content: "#";
  }

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

  #write p+p {
    margin: 1rem auto;
  }

  #write pre.md-fences {
    padding: 1rem;
    box-shadow: none;
  }

  #write blockquote {
    background: var(--bg-quote);
    padding: 1rem;
    border-radius: 0;
    box-shadow: none;
  }

  #write blockquote blockquote {
    padding-left: 1rem;
    margin: 1rem auto;
  }

  #write blockquote em,
  #write blockquote strong,
  #write blockquote mark {
    font-family: var(--font-quota);
  }

  #write blockquote h6:first-child:before {
    left: -1rem;
  }

  #write blockquote h6:first-child span:first-child:before {
    left: -30px;
  }
}

@media screen and (max-width: 800px) {
  .md-toc {
    padding: 0;
    margin: 0 !important;
    max-width: 100%;
  }

  .md-toc::before {
    display: block;
    position: relative;
    left: 0 !important;
    margin-top: 4rem;
    margin-bottom: 0;
    padding: 0;
    background: none;
  }

  .md-toc .md-toc-content {
    top: 0;
    left: 0;
  }

  .md-toc .md-toc-content .md-toc-h1 {
    margin-top: 2rem;
  }
}

@media screen and (max-width: 1000px) {
  #write {
    margin: 0;
  }

  footer.ty-footer {
    background: var(--color-bg);
    border-top: 1px solid var(--color-bg);
  }
}

@media screen and (min-width: 1300px) {
  #write {
    box-shadow: var(--base-shadow);
    border-radius: 5px;
    border: 1px solid rgba(0, 0, 0,0.2);
  }
}

@media print {
  html {
    margin: 0;
    padding: 1cm;
  }

  #write {
    margin: 0;
    padding: 0;
  }

  #write * {
    -webkit-text-stroke: 0px;
  }
}