:root {
  --oy-bg: #fbfaf7;
  --oy-bg-soft: #f6f3ed;
  --oy-surface: #fffefb;
  --oy-surface-muted: #f7f4ee;
  --oy-text: #34322e;
  --oy-heading: #24231f;
  --oy-muted: #746f66;
  --oy-faint: #938b7e;
  --oy-border: #ded8cc;
  --oy-border-soft: #ece6da;
  --oy-accent: #536b63;
  --oy-accent-hover: #304d46;
  --oy-code-bg: #f3f0e9;
  --oy-code-text: #28332e;
  --oy-content-width: 760px;
  --oy-site-width: 1140px;
  --oy-radius: 8px;
  --oy-serif: Georgia, "Source Serif 4", "Source Serif Pro", Charter,
    "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", SimSun, serif;
  --oy-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans CJK SC",
    "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --oy-mono: "JetBrains Mono", "SFMono-Regular", "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}

html {
  background: var(--oy-bg);
  color-scheme: light;
  scroll-padding-top: 5.25rem;
}

body {
  background: var(--oy-bg) !important;
  color: var(--oy-text);
  font-family: var(--oy-serif);
  font-size: 16px;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body *,
body *::before,
body *::after {
  letter-spacing: 0;
}

body a {
  color: inherit;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.16em;
}

#header-menu {
  height: 4.25rem;
  border-bottom: 1px solid rgba(222, 216, 204, 0.82);
  background: rgba(251, 250, 247, 0.9) !important;
  box-shadow: none !important;
  backdrop-filter: blur(18px);
}

#header-menu > div {
  max-width: var(--oy-site-width) !important;
}

#site-title {
  color: var(--oy-heading) !important;
  font-family: var(--oy-serif);
  font-size: 1.05rem !important;
  font-weight: 500 !important;
}

#header-menu a,
#header-menu button,
#header-menu [class*="text-gray"],
#header-menu [class*="text-slate"] {
  color: var(--oy-muted) !important;
  font-family: var(--oy-sans);
  font-weight: 500;
}

#header-menu a:hover,
#header-menu button:hover {
  color: var(--oy-heading) !important;
}

#header-menu .menu-dropdown,
#header-menu ul[x-show="show"],
#header-menu div[x-show="open"] {
  border: 1px solid var(--oy-border-soft);
  background: var(--oy-surface) !important;
  box-shadow: none !important;
}

body > section.mx-auto {
  max-width: var(--oy-site-width) !important;
}

body > section.mx-auto.mt-6 {
  margin-top: 3.25rem !important;
}

@media (min-width: 768px) {
  body > section.mx-auto.grid {
    grid-template-columns: minmax(0, 1fr) 16rem !important;
    gap: 3.5rem !important;
  }
}

body > section:first-of-type > div.bg-cover.bg-center.bg-no-repeat {
  height: 14rem !important;
  border-bottom: 1px solid var(--oy-border-soft);
  background: linear-gradient(180deg, #fffefb 0%, var(--oy-bg) 100%) !important;
}

body > section:first-of-type > div.bg-cover span.text-5xl {
  color: var(--oy-heading) !important;
  font-family: var(--oy-serif);
  font-size: 2.75rem !important;
  font-weight: 500;
}

body > section:first-of-type > div.bg-cover span.text-sm {
  color: var(--oy-muted) !important;
  font-family: var(--oy-serif);
  font-size: 1rem !important;
}

#filters {
  gap: 0.5rem !important;
}

#filters a,
#filters .group,
.inline-flex.rounded-full.border {
  border: 1px solid var(--oy-border-soft) !important;
  border-radius: 999px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--oy-muted) !important;
  font-family: var(--oy-sans);
  font-weight: 500 !important;
}

#filters a:hover,
#filters .group:hover,
.inline-flex.rounded-full.border:hover {
  border-color: var(--oy-border) !important;
  background: var(--oy-surface-muted) !important;
  color: var(--oy-heading) !important;
}

#post-list {
  gap: 1rem !important;
}

#post-list > .group,
.group.flex.flex-col.overflow-hidden.rounded-xl.bg-white {
  border: 1px solid var(--oy-border-soft) !important;
  border-radius: var(--oy-radius) !important;
  background: var(--oy-surface) !important;
  box-shadow: none !important;
  transform: none !important;
}

#post-list > .group:hover,
.group.flex.flex-col.overflow-hidden.rounded-xl.bg-white:hover {
  border-color: var(--oy-border) !important;
  box-shadow: none !important;
  transform: none !important;
}

#post-list img {
  filter: saturate(0.96) contrast(0.98);
}

#post-list h1,
#post-list h1 a {
  color: var(--oy-heading) !important;
  font-family: var(--oy-serif);
  font-size: 1.35rem !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
  text-decoration: none !important;
}

#post-list h1 a:hover {
  color: var(--oy-accent-hover) !important;
  text-decoration: underline !important;
}

#post-list p {
  color: var(--oy-muted) !important;
  font-family: var(--oy-serif);
  font-size: 0.98rem;
  font-weight: 400 !important;
  line-height: 1.68;
}

#post-list .text-sm,
#post-list .text-xs,
#post-list a.text-sm,
#post-list span.text-sm {
  color: var(--oy-muted) !important;
  font-family: var(--oy-sans);
}

aside {
  color: var(--oy-muted);
  font-family: var(--oy-sans);
}

aside > div > div,
.toc-container {
  border: 1px solid var(--oy-border-soft) !important;
  border-radius: var(--oy-radius) !important;
  background: transparent !important;
  box-shadow: none !important;
}

aside h2,
.toc-container h2 {
  color: var(--oy-heading) !important;
  font-family: var(--oy-sans);
  font-size: 0.9rem !important;
  font-weight: 600 !important;
}

aside a,
.toc a {
  color: var(--oy-muted) !important;
}

aside a:hover,
.toc a:hover,
.is-active-link {
  color: var(--oy-heading) !important;
  background: var(--oy-surface-muted) !important;
}

body > section.mx-auto.grid > .z-0 > .rounded-xl.bg-white {
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}

div[x-data^="upvote("] {
  padding: 0 !important;
}

div[x-data^="upvote("] > div:first-child,
div[x-data^="upvote("] > h1,
div[x-data^="upvote("] > .my-3,
body > section.mx-auto.grid > .z-0 > .rounded-xl.bg-white > .flex.items-center.justify-between,
body > section.mx-auto.grid > .z-0 > .rounded-xl.bg-white > h1,
#content,
#content ~ .mt-10,
#content ~ hr,
#comment,
article.markdown-body,
article.tailwind-typography {
  max-width: var(--oy-content-width) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

div[x-data^="upvote("] > div:first-child {
  color: var(--oy-muted) !important;
  font-family: var(--oy-sans);
}

div[x-data^="upvote("] > h1,
body > section.mx-auto.grid > .z-0 > .rounded-xl.bg-white > h1 {
  margin-top: 1.35rem !important;
  margin-bottom: 0.85rem !important;
  color: var(--oy-heading) !important;
  font-family: var(--oy-serif);
  font-size: 2.7rem !important;
  font-weight: 500 !important;
  line-height: 1.15 !important;
}

div[x-data^="upvote("] > .my-3 a {
  color: var(--oy-muted) !important;
  font-family: var(--oy-sans);
  font-style: normal !important;
}

article.markdown-body,
article.tailwind-typography {
  margin-top: 2.25rem !important;
  color: var(--oy-text) !important;
  background: transparent !important;
  font-family: var(--oy-serif) !important;
  font-size: 18px !important;
  line-height: 1.86 !important;
  overflow-wrap: break-word;
  word-break: normal;
}

article.markdown-body :where(p, ul, ol, blockquote, table, pre, shiki-code, .katex-display),
article.tailwind-typography :where(p, ul, ol, blockquote, table, pre, shiki-code, .katex-display) {
  margin-top: 1.1rem;
  margin-bottom: 1.1rem;
}

article.markdown-body p,
article.tailwind-typography p {
  color: var(--oy-text) !important;
}

article.markdown-body :where(h1, h2, h3, h4, h5, h6),
article.tailwind-typography :where(h1, h2, h3, h4, h5, h6) {
  color: var(--oy-heading) !important;
  font-family: var(--oy-serif) !important;
  font-weight: 500 !important;
  line-height: 1.28 !important;
}

article.markdown-body h1,
article.tailwind-typography h1 {
  margin: 2.8rem 0 1rem !important;
  border-bottom: 0 !important;
  font-size: 2rem !important;
}

article.markdown-body h2,
article.tailwind-typography h2 {
  margin: 2.65rem 0 0.95rem !important;
  padding-bottom: 0.28rem !important;
  border-bottom: 1px solid var(--oy-border-soft) !important;
  font-size: 1.55rem !important;
}

article.markdown-body h3,
article.tailwind-typography h3 {
  margin: 2.15rem 0 0.75rem !important;
  font-size: 1.28rem !important;
}

article.markdown-body h4,
article.tailwind-typography h4 {
  margin: 1.9rem 0 0.65rem !important;
  font-size: 1.08rem !important;
}

article.markdown-body h5,
article.markdown-body h6,
article.tailwind-typography h5,
article.tailwind-typography h6 {
  margin: 1.55rem 0 0.55rem !important;
  color: var(--oy-muted) !important;
  font-family: var(--oy-sans) !important;
  font-size: 0.92rem !important;
  font-weight: 600 !important;
}

article.markdown-body a,
article.tailwind-typography a {
  color: var(--oy-accent) !important;
  text-decoration-line: underline;
  text-decoration-color: rgba(83, 107, 99, 0.28);
}

article.markdown-body a:hover,
article.tailwind-typography a:hover {
  color: var(--oy-accent-hover) !important;
  text-decoration-color: rgba(48, 77, 70, 0.65);
}

article.markdown-body strong,
article.tailwind-typography strong {
  color: var(--oy-heading) !important;
  font-weight: 600 !important;
}

article.markdown-body :where(ul, ol),
article.tailwind-typography :where(ul, ol) {
  padding-left: 1.45rem !important;
}

article.markdown-body li,
article.tailwind-typography li {
  margin: 0.28rem 0;
  padding-left: 0.1rem;
}

article.markdown-body blockquote,
article.tailwind-typography blockquote {
  border-left: 2px solid #bbb2a4 !important;
  background: transparent !important;
  color: #555049 !important;
  padding: 0.1rem 0 0.1rem 1.15rem !important;
  font-style: normal !important;
}

article.markdown-body blockquote p,
article.tailwind-typography blockquote p {
  color: #555049 !important;
}

article.markdown-body hr,
article.tailwind-typography hr {
  height: 1px !important;
  margin: 2.6rem 0 !important;
  border: 0 !important;
  background: var(--oy-border-soft) !important;
}

article.markdown-body :not(pre) > code,
article.tailwind-typography :not(pre) > code {
  border: 1px solid var(--oy-border-soft) !important;
  border-radius: 5px !important;
  background: var(--oy-code-bg) !important;
  color: var(--oy-code-text) !important;
  font-family: var(--oy-mono) !important;
  font-size: 0.86em !important;
  padding: 0.12em 0.32em !important;
}

article.markdown-body pre,
article.tailwind-typography pre,
article.markdown-body shiki-code,
article.tailwind-typography shiki-code {
  display: block;
  max-width: 100%;
  border: 1px solid var(--oy-border-soft) !important;
  border-radius: var(--oy-radius) !important;
  background: var(--oy-code-bg) !important;
  box-shadow: none !important;
  overflow: hidden;
}

article.markdown-body pre,
article.tailwind-typography pre {
  padding: 1rem 1.1rem !important;
  overflow-x: auto !important;
  color: var(--oy-code-text) !important;
  font-family: var(--oy-mono) !important;
  font-size: 0.9rem !important;
  line-height: 1.7 !important;
}

article.markdown-body shiki-code pre,
article.tailwind-typography shiki-code pre {
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

article.markdown-body pre code,
article.tailwind-typography pre code {
  border: 0 !important;
  background: transparent !important;
  color: inherit !important;
  padding: 0 !important;
  white-space: pre;
}

article.markdown-body img,
article.tailwind-typography img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.7rem auto;
  border-radius: 6px;
}

article.markdown-body p > img:only-child,
article.tailwind-typography p > img:only-child {
  margin-top: 1.85rem;
  margin-bottom: 1.85rem;
}

article.markdown-body table,
article.tailwind-typography table {
  display: block;
  width: max-content;
  max-width: 100%;
  border-collapse: collapse;
  overflow-x: auto;
  font-family: var(--oy-sans);
  font-size: 0.92em;
  line-height: 1.55;
}

article.markdown-body th,
article.markdown-body td,
article.tailwind-typography th,
article.tailwind-typography td {
  border: 1px solid var(--oy-border-soft) !important;
  padding: 0.55rem 0.7rem !important;
}

article.markdown-body th,
article.tailwind-typography th {
  background: var(--oy-surface-muted) !important;
  color: var(--oy-heading) !important;
  font-weight: 600 !important;
}

.katex {
  color: var(--oy-text);
  display: inline-block;
  font-size: 1em;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  vertical-align: -0.12em;
}

.katex-html {
  max-width: 100%;
}

.katex svg {
  max-width: 100%;
  overflow: hidden;
}

.katex-display {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.25rem 0 0.45rem;
}

.katex-display > .katex {
  display: block;
  white-space: nowrap;
}

#comment,
#content ~ .mt-10 {
  font-family: var(--oy-sans);
}

footer {
  border-top: 1px solid var(--oy-border-soft);
  background: var(--oy-bg) !important;
  box-shadow: none !important;
}

footer a,
footer span,
footer p {
  color: var(--oy-muted) !important;
  font-family: var(--oy-sans);
}

#btn-scroll-to-top {
  border: 1px solid var(--oy-border-soft);
  background: var(--oy-surface) !important;
  box-shadow: none !important;
}

@media (max-width: 767px) {
  body > section.mx-auto.mt-6 {
    margin-top: 2.15rem !important;
    padding-left: 1.15rem !important;
    padding-right: 1.15rem !important;
  }

  body > section:first-of-type > div.bg-cover.bg-center.bg-no-repeat {
    height: 10.5rem !important;
  }

  body > section:first-of-type > div.bg-cover span.text-5xl {
    font-size: 2.05rem !important;
  }

  div[x-data^="upvote("] > h1,
  body > section.mx-auto.grid > .z-0 > .rounded-xl.bg-white > h1 {
    font-size: 2rem !important;
    line-height: 1.18 !important;
  }

  article.markdown-body,
  article.tailwind-typography {
    font-size: 16.5px !important;
    line-height: 1.78 !important;
  }

  article.markdown-body h1,
  article.tailwind-typography h1 {
    font-size: 1.65rem !important;
  }

  article.markdown-body h2,
  article.tailwind-typography h2 {
    font-size: 1.35rem !important;
  }

  article.markdown-body pre,
  article.tailwind-typography pre {
    font-size: 0.82rem !important;
    padding: 0.85rem !important;
  }
}
