:root {
  --paper: #f5f2ea;
  --paper-deep: #ebe6da;
  --ink: #202522;
  --muted: #6f756f;
  --line: #d6d0c3;
  --accent: #b43a2f;
  --accent-dark: #84291f;
  --sidebar-width: 280px;
}

html,
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", Georgia, serif;
  letter-spacing: 0;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(32, 37, 34, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 37, 34, 0.025) 1px, transparent 1px);
  background-size: 24px 24px;
}

.sidebar {
  background: var(--paper-deep);
  border-right: 1px solid var(--line);
}

.sidebar > h1 {
  margin: 32px 24px 22px;
  text-align: left;
}

.sidebar > h1 a {
  color: var(--ink);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
}

.sidebar-nav {
  padding: 0 14px 36px;
}

.sidebar ul li a {
  border-left: 2px solid transparent;
  color: #4b514d;
  font-size: 14px;
  font-weight: 500;
}

.sidebar ul li.active > a {
  border-left-color: var(--accent);
  color: var(--accent-dark);
  font-weight: 700;
}

.search {
  margin: 0 18px 20px;
  padding: 0 !important;
  border-bottom: 0 !important;
}

.search input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid var(--line) !important;
  border-radius: 4px;
  color: var(--ink);
  font-family: inherit;
  letter-spacing: 0;
}

.search input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px rgba(180, 58, 47, 0.12);
}

.markdown-section {
  max-width: 860px;
  padding: 52px 48px 96px;
}

.markdown-section h1,
.markdown-section h2,
.markdown-section h3 {
  color: var(--ink);
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", Georgia, serif;
  letter-spacing: 0;
}

.markdown-section h1 {
  margin-bottom: 34px;
  padding-bottom: 18px;
  border-bottom: 3px double var(--line);
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.18;
}

.markdown-section h2 {
  margin-top: 48px;
  font-size: 25px;
}

.markdown-section p,
.markdown-section li {
  color: #363c38;
  font-size: 16px;
  line-height: 1.9;
}

.markdown-section a {
  color: var(--accent-dark);
  text-decoration-color: rgba(132, 41, 31, 0.38);
  text-underline-offset: 3px;
}

.markdown-section blockquote {
  margin: 28px 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

.markdown-section code {
  border-radius: 3px;
  background: #e8e3d7;
  color: #8f2e25;
}

.markdown-section pre {
  border: 1px solid #353b37;
  border-radius: 4px;
  background: #252a27;
}

.markdown-section pre > code {
  background: transparent;
  color: #ece9e0;
}

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

.markdown-section tr:nth-child(2n) {
  background: rgba(235, 230, 218, 0.72);
}

.markdown-section th,
.markdown-section td {
  border-color: var(--line);
}

.app-nav a,
.pagination-item-title {
  color: var(--accent-dark);
}

@media (max-width: 768px) {
  .markdown-section {
    padding: 36px 22px 72px;
  }

  .markdown-section h1 {
    font-size: 34px;
  }

  .sidebar-toggle {
    width: 44px;
    height: 44px;
    border-radius: 0 0 4px 0;
    background: var(--paper-deep);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
