:root {
  --md-text-font: "Segoe UI", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --md-code-font: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

@media screen and (min-width: 76.25em) {
  body.reader-page-active .md-sidebar--post {
    display: none;
  }

  body.reader-page-active .md-content--post {
    max-width: none;
    margin-inline: auto;
  }

  body.reader-page-active .md-sidebar--secondary {
    position: static;
    width: 0;
    min-width: 0;
    overflow: visible;
    z-index: 7;
  }

  body.reader-page-active .md-sidebar--secondary .md-sidebar__scrollwrap {
    position: fixed;
    top: 3rem;
    right: 0;
    z-index: 10;
    width: 15rem;
    max-height: calc(100vh - 3rem);
    padding: 0.75rem 0.9rem;
    overflow-y: auto;
    background: var(--md-default-bg-color);
    border-left: 1px solid var(--md-default-fg-color--lightest);
    box-shadow: -0.35rem 0 1rem rgba(0, 0, 0, 0.08);
    transform: translateX(calc(100% - 1.25rem));
    transition: transform 160ms ease, box-shadow 160ms ease;
  }

  body.reader-page-active .md-sidebar--secondary:hover .md-sidebar__scrollwrap,
  body.reader-page-active.reader-toc-open .md-sidebar--secondary .md-sidebar__scrollwrap,
  body.reader-page-active .md-sidebar--secondary:focus-within .md-sidebar__scrollwrap {
    box-shadow: -0.45rem 0 1.4rem rgba(0, 0, 0, 0.14);
    transform: translateX(0);
  }

  body.reader-page-active .md-sidebar--secondary::after {
    content: "\76EE\5F55";
    position: fixed;
    top: 4rem;
    right: 0;
    z-index: 11;
    width: 1.2rem;
    padding: 0.45rem 0;
    color: var(--md-default-fg-color--light);
    font-size: 0.58rem;
    line-height: 1;
    text-align: center;
    letter-spacing: 0;
    pointer-events: none;
    background: var(--md-default-bg-color);
    border: 1px solid var(--md-default-fg-color--lightest);
    border-right: 0;
    border-radius: 0.25rem 0 0 0.25rem;
    writing-mode: vertical-rl;
  }

  body.reader-page-active .md-sidebar--secondary:hover::after,
  body.reader-page-active.reader-toc-open .md-sidebar--secondary::after,
  body.reader-page-active .md-sidebar--secondary:focus-within::after {
    opacity: 0;
  }

  body.reader-page-active .reader-toc-toggle {
    display: none;
  }
}

@media screen and (max-width: 76.234em) {
  .reader-toolbar {
    top: 2.4rem;
    overflow-x: auto;
  }

  .reader-toolbar__meta {
    display: none;
  }

  .reader-toc-toggle {
    display: none;
  }
}

.md-typeset {
  font-size: 0.78rem;
  line-height: 1.85;
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3 {
  font-weight: 700;
}

.md-typeset .arithmatex {
  overflow-x: auto;
  overflow-y: hidden;
}

.md-typeset div.arithmatex {
  padding: 0.5rem 0;
}

.md-typeset mjx-container[jax="SVG"] > svg {
  max-width: none;
}

.md-typeset .md-table-scroll,
.md-typeset .md-typeset__table {
  display: block;
  width: 100%;
  margin: 1.15rem 0;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.35rem;
  background: var(--md-default-bg-color);
}

.md-typeset .md-table-scroll table,
.md-typeset .md-typeset__table table,
.md-typeset table:not([class]) {
  display: block;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  margin: 0;
  overflow-x: auto;
  overflow-y: hidden;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.35rem;
  font-size: 0.72rem;
  line-height: 1.65;
}

.md-typeset .md-table-scroll table,
.md-typeset .md-typeset__table table {
  display: table;
  width: max-content;
  max-width: none;
  overflow: visible;
  border: 0;
  border-radius: 0;
}

.md-typeset table:not([class]) th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--md-default-fg-color);
  font-weight: 700;
  background: var(--md-code-bg-color);
}

.md-typeset table:not([class]) th,
.md-typeset table:not([class]) td {
  min-width: 5.5rem;
  padding: 0.55rem 0.7rem;
  vertical-align: top;
  border-top: 0;
  border-left: 0;
  border-right: 1px solid var(--md-default-fg-color--lightest);
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
}

.md-typeset table:not([class]) th:last-child,
.md-typeset table:not([class]) td:last-child {
  border-right: 0;
}

.md-typeset table:not([class]) tr:last-child td {
  border-bottom: 0;
}

.md-typeset table:not([class]) tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--md-code-bg-color) 45%, transparent);
}

.md-typeset table:not([class]) tbody tr:hover {
  background: color-mix(in srgb, var(--md-accent-fg-color) 8%, transparent);
}

.md-typeset table:not([class]) code {
  white-space: nowrap;
}

.md-typeset img {
  display: block;
  max-width: min(100%, 980px);
  margin: 1rem auto;
}

.reader-page .md-content__inner {
  margin-top: 0;
}

.reader-toolbar {
  position: sticky;
  top: 2.4rem;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.35rem;
  margin: -0.2rem 0 1.1rem;
  padding: 0.35rem 0;
  background: color-mix(in srgb, var(--md-default-bg-color) 92%, transparent);
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
  backdrop-filter: blur(10px);
}

.reader-toolbar__spacer {
  flex: 1 1 auto;
}

.reader-toolbar__link,
.reader-toolbar__button,
.reader-toolbar__meta {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  min-height: 1.7rem;
  padding: 0 0.38rem;
  color: var(--md-default-fg-color--light);
  font-size: 0.66rem;
  line-height: 1;
  white-space: nowrap;
}

.reader-toolbar__link:hover,
.reader-toolbar__button:hover {
  color: var(--md-accent-fg-color);
}

.reader-toolbar__button {
  font: inherit;
  cursor: pointer;
  background: transparent;
  border: 0;
}

.reader-toolbar svg {
  width: 0.82rem;
  height: 0.82rem;
  fill: currentcolor;
}

.reader-zoomable-image {
  cursor: zoom-in;
}

.reader-lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  cursor: zoom-out;
  background: rgba(0, 0, 0, 0.78);
  border: 0;
}

.reader-lightbox--open {
  display: flex;
}

.reader-lightbox img {
  max-width: min(96vw, 1280px);
  max-height: 92vh;
  object-fit: contain;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.35);
}

.selection-toolbar {
  position: fixed;
  z-index: 30;
  display: flex;
  gap: 0.18rem;
  align-items: center;
  padding: 0.28rem;
  background: color-mix(in srgb, var(--md-default-bg-color) 96%, var(--md-default-fg-color) 4%);
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.35rem;
  box-shadow: 0 0.55rem 1.6rem rgba(0, 0, 0, 0.18);
}

.selection-toolbar[hidden] {
  display: none;
}

.selection-toolbar button {
  min-height: 1.55rem;
  padding: 0 0.42rem;
  color: var(--md-default-fg-color);
  font: inherit;
  font-size: 0.64rem;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 0.25rem;
}

.selection-toolbar button:hover {
  color: var(--md-accent-fg-color);
  background: color-mix(in srgb, var(--md-accent-fg-color) 10%, transparent);
}

.ai-handoff {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 0.55rem;
  margin: 1rem 0;
}

.ai-handoff a,
.ai-handoff button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0 0.7rem;
  color: var(--md-default-fg-color);
  font: inherit;
  font-size: 0.72rem;
  text-align: center;
  cursor: pointer;
  background: var(--md-default-bg-color);
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.35rem;
}

.ai-handoff a:hover,
.ai-handoff button:hover {
  color: var(--md-accent-fg-color);
  border-color: var(--md-accent-fg-color);
}

.ai-prompt-box {
  width: 100%;
  min-height: 12rem;
  padding: 0.7rem;
  color: var(--md-code-fg-color);
  font: 0.68rem/1.65 var(--md-code-font);
  resize: vertical;
  background: var(--md-code-bg-color);
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.35rem;
}

.blog-card {
  padding: 1rem 0 1.1rem;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
}

.blog-card__title {
  margin: 0 0 0.35rem !important;
  font-size: 1.05rem !important;
  line-height: 1.45 !important;
}

.blog-card__title a {
  color: var(--md-default-fg-color);
}

.blog-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.45rem;
  color: var(--md-default-fg-color--light);
  font-size: 0.66rem;
}

.blog-card__summary {
  display: -webkit-box;
  margin: 0.55rem 0 0;
  overflow: hidden;
  color: var(--md-default-fg-color--light);
  font-size: 0.74rem;
  line-height: 1.7;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.blog-card__action {
  margin-top: 0.55rem;
  font-size: 0.7rem;
}

.md-typeset small {
  color: var(--md-default-fg-color--light);
}

@media screen and (min-width: 76.25em) {
  .md-sidebar--primary {
    position: sticky;
    top: 2.4rem;
    align-self: flex-start;
    width: 1.2rem;
    min-width: 1.2rem;
    overflow: visible;
    z-index: 6;
  }

  .md-sidebar--primary .md-sidebar__scrollwrap {
    width: 16rem;
    max-height: calc(100vh - 3rem);
    padding: 0.75rem 0.6rem 0.75rem 0.9rem;
    overflow-y: auto;
    background: var(--md-default-bg-color);
    border-right: 1px solid var(--md-default-fg-color--lightest);
    box-shadow: 0.35rem 0 1rem rgba(0, 0, 0, 0.08);
    transform: translateX(-15rem);
    transition: transform 160ms ease, box-shadow 160ms ease;
  }

  .md-sidebar--primary:hover .md-sidebar__scrollwrap,
  .md-sidebar--primary:focus-within .md-sidebar__scrollwrap {
    box-shadow: 0.45rem 0 1.4rem rgba(0, 0, 0, 0.14);
    transform: translateX(0);
  }

  .md-sidebar--primary::after {
    content: "\5BFC\822A";
    position: absolute;
    top: 1rem;
    left: 0;
    width: 1.2rem;
    padding: 0.45rem 0;
    color: var(--md-default-fg-color--light);
    font-size: 0.58rem;
    line-height: 1;
    text-align: center;
    letter-spacing: 0;
    background: var(--md-default-bg-color);
    border: 1px solid var(--md-default-fg-color--lightest);
    border-left: 0;
    border-radius: 0 0.25rem 0.25rem 0;
    writing-mode: vertical-rl;
  }
}
