:root {
  --theme-color: #b45309;
  --content-max-width: 920px;
}

body {
  color: #292524;
}

.markdown-section {
  max-width: var(--content-max-width);
}

.markdown-section h1,
.markdown-section h2,
.markdown-section h3 {
  color: #1c1917;
  letter-spacing: -0.015em;
}

.markdown-section blockquote {
  border-left-color: var(--theme-color);
  color: #57534e;
}

.markdown-section table {
  display: table;
  width: 100%;
}

.markdown-section code {
  border-radius: 4px;
}

.sidebar-nav > ul > li > strong {
  color: #78350f;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

#theme-toggle {
  position: fixed;
  top: 14px;
  right: 72px;
  z-index: 1001;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid rgba(120, 53, 15, 0.2);
  border-radius: 999px;
  color: #44403c;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 18px rgba(41, 37, 36, 0.1);
  cursor: pointer;
  font: 600 12px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

section.cover {
  background: linear-gradient(145deg, #fffbeb 0%, #fff7ed 52%, #f5f5f4 100%) !important;
  color: #292524 !important;
}

section.cover h1,
section.cover blockquote {
  color: #292524 !important;
}

section.cover a {
  border-color: var(--theme-color) !important;
  border-radius: 999px !important;
}

section.cover a:first-of-type {
  color: #fff !important;
  background: var(--theme-color) !important;
}

.mermaid {
  display: flex;
  justify-content: center;
  overflow-x: auto;
  margin: 1.5rem 0;
  padding: 1.25rem;
  border: 1px solid rgba(120, 113, 108, 0.2);
  border-radius: 10px;
  background: rgba(250, 250, 249, 0.7);
}

body.dark-mode-active {
  color: #e7e5e4;
}

body.dark-mode-active .markdown-section h1,
body.dark-mode-active .markdown-section h2,
body.dark-mode-active .markdown-section h3,
body.dark-mode-active .markdown-section h4 {
  color: #fafaf9;
}

body.dark-mode-active .markdown-section blockquote {
  color: #d6d3d1;
}

body.dark-mode-active .markdown-section tr,
body.dark-mode-active .markdown-section tr:nth-child(2n) {
  background-color: #292524 !important;
}

body.dark-mode-active .markdown-section th,
body.dark-mode-active .markdown-section td {
  border-color: #57534e;
}

body.dark-mode-active #theme-toggle {
  color: #fafaf9;
  border-color: rgba(251, 191, 36, 0.25);
  background: rgba(28, 25, 23, 0.92);
}

body.dark-mode-active section.cover {
  background: linear-gradient(145deg, #292524 0%, #1c1917 55%, #0c0a09 100%) !important;
  color: #fafaf9 !important;
}

body.dark-mode-active section.cover h1,
body.dark-mode-active section.cover blockquote {
  color: #fafaf9 !important;
}

body.dark-mode-active .mermaid {
  border-color: rgba(231, 229, 228, 0.15);
  background: rgba(28, 25, 23, 0.5);
}

@media screen and (max-width: 767px) {
  #theme-toggle {
    top: auto;
    right: 16px;
    bottom: 18px;
  }

  .markdown-section table {
    display: block;
  }
}
