html,
body {
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    Helvetica Neue,
    PingFang SC,
    Microsoft YaHei,
    Source Han Sans SC,
    Noto Sans CJK SC,
    WenQuanYi Micro Hei,
    sans-serif;
  font-size: 16px;
  width: 100%;
  height: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: bold;
  margin-bottom: 0.5em;
}

h1 {
  font-size: 2em;
}
h2 {
  font-size: 1.5em;
}
h3 {
  font-size: 1.2em;
}
h4 {
  font-size: 1em;
}
h5 {
  font-size: 0.8em;
}
h6 {
  font-size: 0.6em;
}

ol,
ul,
li,
.markdown-content p,
.markdown-content code,
.markdown-content pre {
  font-size: 1em;
}

div object {
  display: none;
}

.markdown-content {
  width: 100%;
}

.markdown-content canvas {
  width: 100%;
  box-sizing: border-box;
}

.markdown-content.entry {
  padding: 50px 1em;
}
.markdown-content.viewer {
  padding: 1em;
}

.entry li,
.viewer li {
  margin: 0.5em auto;
  line-height: 1.6;
}

details {
  margin: 1em 0;
}

details summary {
  font-size: 18px;
  font-weight: 500;
}

.markdown-content img {
  max-width: 100%;
}

pre {
  height: fit-content;
  max-height: 300px;
  border-radius: 6px;
}

code {
  background-color: #e9ecef;
  padding: 2px 6px;
  border-radius: 6px;
}

blockquote {
  height: fit-content;
  max-height: 200px;
  background: #e9ecef;
  border-left: 6px solid #e83e8c;
  border-radius: 6px;
  padding: 0.5em 0.8em;
  overflow: auto;
}

blockquote p {
  margin: 0;
  text-align: justify;
  line-height: 1.8;
}

.header {
  width: 100%;
  height: 50px;
  box-sizing: border-box;
  background: #e9ecef;
  display: flex;
  align-items: center;
  position: fixed;
  top: 0;
  padding: 0 0.5em;
}

.header .title {
  font-size: 1.5em;
  font-weight: 600;
}

li.fold-panel > ul,
li.fold-panel > ol {
  display: none;
}

li.fold-panel:hover > ul,
li.fold-panel:hover > ol {
  display: block;
}

a:link {
  text-decoration: none;
  border-radius: 3px;
}

a:hover {
  background-color: #e9ecef;
  color: #bd4147;
}

.opacity {
  opacity: 0;
}

.arrow-icon {
  background-image: url(../../images/top.png);
  width: 30px;
  height: 30px;
  display: block;
  background-size: contain;
}

.scroll-top {
  cursor: pointer;
  position: fixed;
  right: 20px;
  bottom: 60px;
  width: 40px;
  height: 40px;
  padding: 5px;
  background-color: #007bff;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow:
    0 0 3px 0 rgba(0, 0, 0, 0.12),
    0 3px 3px 0 rgba(0, 0, 0, 0.24);
}

.scroll-top:hover {
  background-color: #0569d3;
}

.footer {
  position: fixed;
  width: 100%;
  height: 50px;
  bottom: 0px;
  background: #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  overflow: auto;
}

.footer::-webkit-scrollbar,
pre::-webkit-scrollbar,
blockquote::-webkit-scrollbar {
  display: none;
}

.markdown-content table {
  width: 100%;
  overflow: auto;
  border-spacing: 0;
  border-collapse: collapse;
  margin: 1em 0;
}

.markdown-content table th {
  font-weight: 600;
  background-color: #f6f8fa;
}

.markdown-content table th,
.markdown-content table td {
  padding: 6px 13px;
  border: 1px solid #d0d7de;
}

.markdown-content table tr {
  background-color: #ffffff;
  border-top: 1px solid #d0d7de;
}

.markdown-content table tr:nth-child(2n) {
  background-color: #f6f8fa;
}

.markdown-content table img {
  background-color: transparent;
}

.layout-container {
  display: flex;
  width: 100%;
  min-height: calc(100vh - 50px);
  box-sizing: border-box;
}

.content-area {
  flex: 1;
  box-sizing: border-box;
  overflow: auto;
}

.sidebar-area {
  width: 240px;
  max-width: 20%;
  height: 100vh;
  box-sizing: border-box;
  border-left: 1px solid #e9ecef;
  overflow: auto;
  position: sticky;
  top: 0;
}

.sidebar-area .sidebar-title {
  font-size: 1.2em;
  font-weight: bold;
  border-bottom: 1px solid #e9ecef;
  padding: 0.5em 0.8em;
}

.entry ~ .sidebar-area {
  height: calc(100vh - 100px);
  max-height: 100%;
  top: 50px;
  box-sizing: border-box;
  overflow: auto;
}

.toc-nav {
  font-size: 1em;
}

.toc-nav p {
  color: #666;
  padding-left: 1em;
}

.toc-nav ul {
  list-style: none;
  padding: 0 0.5em 0 1em;
}

.toc-nav li {
  margin: 0.6em auto;
  line-height: 1.5;
}

.toc-nav a {
  color: #333;
  text-decoration: none;
  transition: color 0.2s;
}

.toc-nav a:hover {
  color: #007bff;
  background-color: transparent;
}

@media screen and (max-width: 768px) {
  .row .col-md-2,
  .row .col-md-3 {
    border-right: none;
  }

  .scroll-top {
    right: 20px;
    bottom: 60px;
    z-index: 9;
  }

  .markdown-content table {
    display: block;
    overflow: auto;
    white-space: nowrap;
  }

  .sidebar-area {
    display: none;
  }

  .entry li,
  .viewer li {
    margin: 0.5em auto;
    line-height: 1.6;
  }
}
