.markdown-body {
  --base-size-16: 1rem;
  --base-size-24: 1.5rem;
  --base-size-4: 0.25rem;
  --base-size-8: 0.5rem;
  --base-text-weight-medium: 500;
  --base-text-weight-normal: 400;
  --base-text-weight-semibold: 600;
  --fontStack-monospace: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
  --fontStack-sansSerif: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";

  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  margin: 0;
  font-weight: var(--base-text-weight-normal, 400);
  color: var(--fgColor-default);
  background-color: var(--bgColor-default);
  font-family: var(--fontStack-sansSerif);
  font-size: 16px;
  line-height: 1.5;
  word-wrap: break-word;
}

@media (prefers-color-scheme: dark) {
  .markdown-body, [data-theme="dark"] {
    color-scheme: dark;
    --fgColor-accent: #4493f8;
    --bgColor-attention-muted: #bb800926;
    --bgColor-default: #0d1117;
    --bgColor-muted: #151b23;
    --bgColor-neutral-muted: #656c7633;
    --borderColor-accent-emphasis: #1f6feb;
    --borderColor-attention-emphasis: #9e6a03;
    --borderColor-danger-emphasis: #da3633;
    --borderColor-default: #3d444d;
    --borderColor-done-emphasis: #8957e5;
    --borderColor-success-emphasis: #238636;
    --fgColor-attention: #d29922;
    --fgColor-danger: #f85149;
    --fgColor-default: #f0f6fc;
    --fgColor-done: #ab7df8;
    --fgColor-muted: #9198a1;
    --fgColor-success: #3fb950;
    --borderColor-muted: #3d444db3;
    --focus-outlineColor: var(--borderColor-accent-emphasis);
  }
}

@media (prefers-color-scheme: light) {
  .markdown-body, [data-theme="light"] {
    color-scheme: light;
    --fgColor-accent: #0969da;
    --fgColor-attention: #9a6700;
    --fgColor-danger: #d1242f;
    --fgColor-default: #1f2328;
    --fgColor-done: #8250df;
    --fgColor-muted: #59636e;
    --fgColor-success: #1a7f37;
    --bgColor-attention-muted: #fff8c5;
    --bgColor-default: #ffffff;
    --bgColor-muted: #f6f8fa;
    --bgColor-neutral-muted: #818b981f;
    --borderColor-accent-emphasis: #0969da;
    --borderColor-attention-emphasis: #9a6700;
    --borderColor-danger-emphasis: #cf222e;
    --borderColor-default: #d1d9e0;
    --borderColor-done-emphasis: #8250df;
    --borderColor-success-emphasis: #1a7f37;
    --borderColor-muted: #d1d9e0b3;
    --focus-outlineColor: var(--borderColor-accent-emphasis);
  }
}

.markdown-body a {
  color: var(--fgColor-accent);
  text-decoration: none;
}
.markdown-body a:hover {
  text-decoration: underline;
  text-underline-offset: .2rem;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  margin-top: var(--base-size-24);
  margin-bottom: var(--base-size-16);
  font-weight: var(--base-text-weight-semibold);
  line-height: 1.25;
}
.markdown-body h1 {
  font-size: 2em;
  padding-bottom: .3em;
  border-bottom: 1px solid var(--borderColor-muted);
}
.markdown-body h2 {
  font-size: 1.5em;
  padding-bottom: .3em;
  border-bottom: 1px solid var(--borderColor-muted);
}
.markdown-body h3 { font-size: 1.25em; }
.markdown-body h4 { font-size: 1em; }
.markdown-body h5 { font-size: .875em; }
.markdown-body h6 {
  font-size: .85em;
  color: var(--fgColor-muted);
}

.markdown-body p {
  margin-top: 0;
  margin-bottom: var(--base-size-16);
}

.markdown-body blockquote {
  margin: 0;
  padding: 0 1em;
  color: var(--fgColor-muted);
  border-left: .25em solid var(--borderColor-default);
}

.markdown-body ul,
.markdown-body ol {
  margin-top: 0;
  margin-bottom: var(--base-size-16);
  padding-left: 2em;
}
.markdown-body li + li {
  margin-top: .25em;
}

.markdown-body hr {
  height: .25em;
  margin: var(--base-size-24) 0;
  border: 0;
  background-color: var(--borderColor-default);
}

.markdown-body table {
  border-spacing: 0;
  border-collapse: collapse;
  display: block;
  width: max-content;
  max-width: 100%;
  overflow: auto;
}
.markdown-body th,
.markdown-body td {
  padding: 6px 13px;
  border: 1px solid var(--borderColor-default);
}
.markdown-body tr {
  background: var(--bgColor-default);
  border-top: 1px solid var(--borderColor-muted);
}
.markdown-body tr:nth-child(2n) {
  background: var(--bgColor-muted);
}

.markdown-body code,
.markdown-body tt {
  padding: .2em .4em;
  border-radius: 6px;
  background-color: var(--bgColor-neutral-muted);
  font-family: var(--fontStack-monospace);
  font-size: 85%;
}

.markdown-body pre {
  padding: var(--base-size-16);
  overflow: auto;
  border-radius: 6px;
  background-color: var(--bgColor-muted);
  font-family: var(--fontStack-monospace);
  font-size: 85%;
  line-height: 1.45;
}
.markdown-body pre > code {
  padding: 0;
  background: transparent;
}

.markdown-body img {
  max-width: 100%;
  box-sizing: content-box;
}

.markdown-body strong,
.markdown-body b {
  font-weight: var(--base-text-weight-semibold);
}

.markdown-body mark {
  background-color: var(--bgColor-attention-muted);
  color: var(--fgColor-default);
}

.markdown-body details summary {
  cursor: pointer;
}

.markdown-body *:first-child {
  margin-top: 0 !important;
}
.markdown-body *:last-child {
  margin-bottom: 0 !important;
}

.markdown-body a:focus-visible,
.markdown-body summary:focus-visible {
  outline: 2px solid var(--focus-outlineColor);
  outline-offset: -2px;
}

/* ========== Alert Blocks > [!NOTE] etc ========== */
.markdown-body .markdown-alert {
  padding: var(--base-size-8) var(--base-size-16);
  margin-bottom: var(--base-size-16);
  border-left: .25em solid var(--borderColor-default);
}
.markdown-body .markdown-alert>:first-child { margin-top:0; }
.markdown-body .markdown-alert>:last-child { margin-bottom:0; }
.markdown-body .markdown-alert-title {
  display: flex;
  font-weight: var(--base-text-weight-medium);
  align-items: center;
  line-height:1;
}
.markdown-body .markdown-alert.markdown-alert-note { border-left-color: var(--borderColor-accent-emphasis); }
.markdown-body .markdown-alert.markdown-alert-note .markdown-alert-title { color: var(--fgColor-accent); }
.markdown-body .markdown-alert.markdown-alert-important { border-left-color: var(--borderColor-done-emphasis); }
.markdown-body .markdown-alert.markdown-alert-important .markdown-alert-title { color: var(--fgColor-done); }
.markdown-body .markdown-alert.markdown-alert-warning { border-left-color: var(--borderColor-attention-emphasis); }
.markdown-body .markdown-alert.markdown-alert-warning .markdown-alert-title { color: var(--fgColor-attention); }
.markdown-body .markdown-alert.markdown-alert-tip { border-left-color: var(--borderColor-success-emphasis); }
.markdown-body .markdown-alert.markdown-alert-tip .markdown-alert-title { color: var(--fgColor-success); }
.markdown-body .markdown-alert.markdown-alert-caution { border-left-color: var(--borderColor-danger-emphasis); }
.markdown-body .markdown-alert.markdown-alert-caution .markdown-alert-title { color: var(--fgColor-danger); }

/* ========== Task List - [ ] Checkbox ========== */
.markdown-body .task-list-item {
  list-style-type: none;
}
.markdown-body .task-list-item-checkbox {
  margin: 0 .2em .25em -1.4em;
  vertical-align: middle;
}
.markdown-body .task-list-item + .task-list-item {
  margin-top: var(--base-size-4);
}

/* 新加代码块对比度兜底修复 */
.markdown-body pre {
  color: var(--fgColor-default);
}
.markdown-body code,
.markdown-body tt {
  color: var(--fgColor-default);
}

/* 如果将来接入高亮库，下面类会生效；现在仅做预留 */
.markdown-body pre[class*="language-"] {
  color: var(--fgColor-default);
}
.markdown-body pre[class*="language-"] code {
  color: inherit;
}
