 /* light theme */
 :root {
    --width-max: 720px;
    --font-primary: Verdana, sans-serif;
    --font-secondary: monospace;
    --font-size-primary: 1em;
    --font-size-secondary: 0.8em;
    --body-bg-color: #fcfcfc;
    --bold-text-color: #222;
    --body-text-color: #444;
    --link-color: #3273dc;
    --link-visited-color: #8b6fcb;
    --table-border-color: #f2f2f2;
    --table-th-bg-color: #f2f2f2;
    --img-border-color: #f2f2f2;
    --code-bg-color: #f2f2f2;
    --code-text-color: #222;
    --blockquote-border-color: #666;
    --blockquote-text-color: #666;
    --upvoted-color: #FA8072;
    --search-result-highlight-color: #ff0;
  }

  @media (prefers-color-scheme: dark) {
    /* dark theme */
    :root {
      --body-bg-color: #1c1c1c;
      --bold-text-color: #eee;
      --body-text-color: #ddd;
      --link-color: #8cc2dd;
      --link-visited-color: #c3b1ee;
      --table-border-color: #999;
      --table-th-bg-color: #999;
      --img-border-color: #999;
      --code-bg-color: #444;
      --code-text-color: #ddd;
      --blockquote-border-color: #ccc;
      --blockquote-text-color: #ccc;
    }
  }

  body {
    font-family: var(--font-primary);
    font-size: var(--font-size-primary);
    margin: auto;
    padding: 20px;
    max-width: var(--width-max);
    text-align: left;
    background-color: var(--body-bg-color);
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.5;
    color: var(--body-text-color);
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  strong,
  b {
    color: var(--bold-text-color);
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    margin: 16px 0;
  }

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

  a:hover {
    text-decoration: underline;
  }

  .title {
    text-decoration: none;
    border: 0;
  }

  .title:hover {
    text-decoration: none;
  }

  .title span {
    font-weight: 400;
  }

  nav a {
    margin-right: 8px;
  }

  textarea {
    width: 100%;
    font-size: 16px;
  }

  input {
    font-size: 14px;
  }

  content {
    line-height: 1.6;
  }

  table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--table-border-color);
    border-radius: 4px;
  }

  th,
  td {
    border: 1px solid var(--table-border-color);
    padding: 4px;
  }

  th {
    background-color: var(--table-th-bg-color);
  }

  hr {
    border: 0;
    border-top: 1px dashed;
  }

  img {
    max-width: 100%;
    display: block;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid var(--img-border-color);
    border-radius: 4px;
    content-visibility: auto;
    loading: lazy;
  }

  img[src*="#minipic"] {
    max-width: 50%;
    margin-left: 0;
    margin-right: auto;
  }

  i {
    font-style: normal;
  }

  time {
    font-family: var(--font-secondary);
    font-size: 15px;
  }

  code {
    font-family: var(--font-secondary);
    background-color: var(--code-bg-color);
    color: var(--code-text-color);
    padding: 2px;
    border-radius: 4px;
  }

  pre code {
    display: block;
    padding: 16px;
    white-space: pre-wrap;
    overflow-x: auto;
  }

  div.highlight pre {
    border-radius: 4px;
  }

  div.highlight code {
    background-color: var(--code-bg-color);
    color: var(--code-text-color);
  }

  blockquote {
    border-left: 2px solid var(--blockquote-border-color);
    color: var(--blockquote-text-color);
    margin: 0;
    padding-left: 16px;
    font-style: normal;
  }

  blockquote p {
    margin: 0;
  }

  footer {
    padding: 25px 0;
    text-align: center;
    font-size: var(--font-size-secondary);
  }

  ul li:has(input) {
    list-style-type: none;
    margin-left: -25.5px;
  }

  /* blog post list */
  ul.blog-posts {
    list-style-type: none;
    padding: unset;
  }

  ul.blog-posts li {
    display: flex;
  }

  ul.blog-posts li span {
    flex: 0 0 130px;
  }

  ul.blog-posts li span.grouped {
    flex: 0 0 80px;
  }

  ul.blog-posts li a:visited {
    color: var(--link-visited-color);
  }

  /* 外层容器，用于固定位置 */
  div.toc {
    position: fixed;
    top: 50%;
    left: calc((100vw + var(--width-max)) / 2);
    transform: translateY(-50%);
    width: calc((90vw - var(--width-max)) / 2);
    max-height: 80vh;
    overflow-y: auto;
    padding: 20px 8px;
    z-index: 99;

    /* 隐藏滚动条 */
    &::-webkit-scrollbar {
        display: none; /* 对于 Webkit 浏览器（Chrome, Safari） */
    }
    -ms-overflow-style: none; /* IE 和 Edge */
    scrollbar-width: none; /* Firefox */
  }

  div.toc ul {
    list-style-type: none;
    padding-left: 0;
  }

  div.toc ul li {
    margin: 8px 0;
  }

  div.toc ul li a {
    text-decoration: none;
    color: var(--blockquote-text-color);
  }

  div.toc ul li a:hover {
    color: var(--link-color);
  }

  /* upvote button style */
  button.upvote-btn {
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--body-text-color);
  }

  button.upvoted {
    color: var(--upvoted-color);
  }

  span.upvote-count {
    margin-top: -4px;
    font-size: smaller;
  }

  @media (max-width: 500px) {
    img[src*="#minipic"] {
      max-width: 100%;
      margin-left: auto;
      margin-right: auto;
    }

    div.toc {
      display: none;
    }
  }

/* Audio control */
audio {
  width: 100%;
}