@font-face {
  font-family: "Overpass";
  src: url("../../assets/overpass.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Overpass Mono";
  src: url("../../assets/overpass-mono.ttf") format("truetype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root,
html.light,
html.rust,
html.coal,
html.navy,
html.ayu {
  --bg: #eef0ea;
  --fg: #16181a;
  --sidebar-bg: #e5e7e0;
  --sidebar-fg: #16181a;
  --sidebar-non-existant: #62676a;
  --sidebar-active: #1f4e9c;
  --sidebar-spacer: #d4d1c7;
  --scrollbar: #b8b5ab;
  --icons: #16181a;
  --icons-hover: #1f4e9c;
  --links: #1f4e9c;
  --inline-code-color: #a3362c;
  --theme-popup-bg: #fafbf7;
  --theme-popup-border: #d4d1c7;
  --theme-hover: #e5e7e0;
  --quote-bg: #fafbf7;
  --quote-border: #e9b949;
  --table-border-color: #d4d1c7;
  --table-header-bg: #e5e7e0;
  --table-alternate-bg: #e9ece5;
  --searchbar-border-color: #d4d1c7;
  --searchbar-bg: #fafbf7;
  --searchbar-fg: #16181a;
  --searchbar-shadow-color: #d4d1c7;
  --searchresults-header-fg: #16181a;
  --searchresults-border-color: #d4d1c7;
  --searchresults-li-bg: #fafbf7;
  --search-mark-bg: #e9b949;
  --warning-border: #e9b949;
  --content-max-width: 48rem;
  --sidebar-width: 18rem;
  --page-padding: 2rem;
  --sans: "Overpass", "Noto Sans CJK SC", "Noto Sans SC", "Source Han Sans SC", "PingFang SC", sans-serif;
  --mono: "Overpass Mono", ui-monospace, "SFMono-Regular", "Cascadia Code", "Liberation Mono", monospace;
  font-size: 16px;
  color-scheme: light;
}

html,
body {
  background: #eef0ea;
  color: #16181a;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

body {
  text-rendering: optimizeLegibility;
}

::selection {
  background: #e9b949;
  color: #16181a;
}

.page-wrapper {
  background: #eef0ea;
}

/* Header */

#mdbook-menu-bar {
  background: #eef0ea;
  border-bottom: 2px solid #16181a;
  box-shadow: none;
  color: #16181a;
}

#mdbook-menu-bar .menu-title {
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #16181a;
}

#mdbook-menu-bar .icon-button {
  color: #16181a;
}

#mdbook-menu-bar .icon-button:hover {
  color: #1f4e9c;
}

.antex-nav-link {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: #16181a;
  text-decoration: none;
  padding: 0.2rem 0.45rem;
  border: 1px solid transparent;
}

.antex-nav-link:hover {
  color: #1f4e9c;
  border-color: #d4d1c7;
}

#mdbook-theme-toggle,
#mdbook-theme-list,
.theme-popup,
#mdbook-print-button,
#mdbook-menu-bar .right-buttons a[href$="print.html"] {
  display: none !important;
}

/* Sidebar */

#mdbook-sidebar {
  background: #e5e7e0;
  border-right: 1px solid #d4d1c7;
  color: #16181a;
}

#mdbook-sidebar .sidebar-scrollbox {
  padding: 1.2rem 1rem 2rem;
}

#mdbook-sidebar .sidebar-scrollbox::before {
  content: "文档线路";
  display: block;
  margin: 0 0 1rem 1rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: #b23a2b;
}

#mdbook-sidebar .chapter {
  margin: 0;
  padding: 0;
}

#mdbook-sidebar .chapter li {
  position: relative;
  margin: 0;
  padding: 0.28rem 0 0.28rem 1.15rem;
  list-style: none;
}

#mdbook-sidebar .chapter li::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 0.72rem;
  width: 0.5rem;
  height: 0.5rem;
  border: 2px solid #16181a;
  border-radius: 50%;
  background: #eef0ea;
  z-index: 1;
}

#mdbook-sidebar .chapter li::after {
  content: "";
  position: absolute;
  left: 0.38rem;
  top: 1.15rem;
  bottom: -0.5rem;
  width: 1px;
  background: #c8c5ba;
}

#mdbook-sidebar .chapter li:last-child::after {
  display: none;
}

#mdbook-sidebar .chapter li a {
  color: #16181a;
  font-family: var(--sans);
  font-size: 0.92rem;
  text-decoration: none;
}

#mdbook-sidebar .chapter li a:hover {
  color: #1f4e9c;
}

#mdbook-sidebar .chapter li.active::before,
#mdbook-sidebar .chapter li a.active::before {
  background: #b23a2b;
  border-color: #b23a2b;
}

#mdbook-sidebar .chapter li a.active {
  color: #1f4e9c;
  font-weight: 700;
}

/* Content */

#mdbook-content {
  background: #eef0ea;
}

.content main {
  max-width: 48rem;
  margin: 0 auto;
  padding: 2.4rem 1.4rem 5rem;
  color: #16181a;
  font-size: 1rem;
  line-height: 1.8;
}

.content h1,
.content h2,
.content h3,
.content h4 {
  font-family: var(--sans);
  color: #16181a;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.content p,
.content li {
  text-wrap: pretty;
}

.content h1 {
  margin: 0 0 1.2rem;
  padding-bottom: 0.55rem;
  border-bottom: 2px solid #16181a;
  font-size: 2rem;
  font-weight: 800;
}

.content h2 {
  margin: 2.2em 0 0.7em;
  font-size: 1.5rem;
  font-weight: 750;
}

.content h3 {
  margin: 1.7em 0 0.5em;
  font-size: 1.25rem;
  font-weight: 700;
}

.content h4 {
  margin: 1.4em 0 0.4em;
  font-size: 1rem;
  font-weight: 700;
}

.content p {
  margin: 0 0 1rem;
}

.content a {
  color: #1f4e9c;
  text-underline-offset: 0.18em;
}

.content a:hover {
  color: #163a75;
}

.content strong {
  color: #16181a;
}

.content code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: #e5e7e0;
  color: #a3362c;
  padding: 0.1em 0.3em;
  border-radius: 0;
}

.content pre {
  scrollbar-width: thin;
  scrollbar-color: #8e978a transparent;
  margin: 1.2rem 0;
  padding: 1rem 1.1rem;
  background: #16181a;
  color: #e5e7e0;
  border: 0;
  border-left: 4px solid #1f4e9c;
  overflow-x: auto;
  line-height: 1.6;
}

.content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: 0.82rem;
}

.content blockquote {
  margin: 1.4rem 0;
  padding: 0.8rem 1rem;
  background: #fafbf7;
  border-left: 4px solid #e9b949;
  color: #3a3d3f;
}

.content blockquote p:last-child {
  margin-bottom: 0;
}

.content table {
  width: 100%;
  margin: 1.2rem 0;
  border-collapse: collapse;
  font-size: 0.88rem;
  line-height: 1.55;
}

.content table th,
.content table td {
  border: 1px solid #d4d1c7;
  padding: 0.5rem 0.6rem;
  vertical-align: top;
}

.content table th {
  background: #e5e7e0;
  font-weight: 700;
  text-align: left;
}

.content table tr:nth-child(2n) {
  background: #e9ece5;
}

.content hr {
  height: 0;
  margin: 2rem 0;
  border: 0;
  border-top: 1px solid #d4d1c7;
}

.content img {
  max-width: 100%;
  border: 1px solid #d4d1c7;
}

/* Search */

#mdbook-searchbar {
  background: #fafbf7;
  border: 1px solid #d4d1c7;
  border-radius: 0;
  color: #16181a;
  font-family: var(--mono);
  font-size: 0.8rem;
}

#mdbook-searchbar::placeholder {
  color: #62676a;
}

#mdbook-searchresults-outer {
  background: #fafbf7;
  border-bottom: 1px solid #d4d1c7;
}

/* Docs index route */

.docs-route {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.6rem 0 2rem;
}

.docs-stop {
  display: block;
  border-top: 2px solid #16181a;
  padding-top: 0.7rem;
  color: #16181a;
  text-decoration: none;
}

.docs-stop:hover {
  color: #1f4e9c;
}

.docs-num {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: #b23a2b;
}

.docs-stop strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1rem;
}

.docs-stop span:last-child {
  display: block;
  margin-top: 0.3rem;
  color: #3a3d3f;
  font-size: 0.82rem;
  line-height: 1.55;
}

/* Mobile */

@media (max-width: 800px) {
  .docs-route {
    grid-template-columns: 1fr;
  }

  .content main {
    padding: 1.6rem 1rem 4rem;
  }

  .content h1 {
    font-size: 1.7rem;
  }
}
