:root {
  --md-text-font-size: 0.8rem;
  --md-text-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --md-code-font: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --md-primary-fg-color: #222725;
  --md-primary-fg-color--light: #343b38;
  --md-primary-fg-color--dark: #181b1a;
  --md-accent-fg-color: #087f73;
  --md-accent-fg-color--transparent: rgba(8, 127, 115, 0.12);
  --md-typeset-a-color: #087f73;
}

[data-md-color-scheme="default"] {
  --md-default-fg-color: #252a29;
  --md-default-bg-color: #ffffff;
}

[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #1f2422;
  --md-accent-fg-color: #5fc7b9;
  --md-accent-fg-color--transparent: rgba(95, 199, 185, 0.14);
  --md-typeset-a-color: #5fc7b9;
}

.md-typeset {
  line-height: 1.72;
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3 {
  font-weight: 650;
  letter-spacing: 0;
}

.md-typeset h1 {
  margin-bottom: 0.7rem;
  color: var(--md-default-fg-color);
  font-size: 1.9rem;
}

.md-typeset h2 {
  margin-top: 1.8rem;
  font-size: 1.35rem;
}

.md-main__inner {
  margin-top: 1rem;
}

.md-content__inner {
  padding-top: 1rem;
}

.md-nav {
  font-size: 0.72rem;
}

.md-nav__title {
  font-weight: 650;
}

@media screen and (min-width: 76.25em) {
  .md-sidebar--primary .md-nav__item--nested > .md-nav {
    display: block;
  }

  /* The first child is the section's directory page, linked by its heading. */
  .md-sidebar--primary
    .md-nav__item--nested:has(> .md-nav__link[for])
    > .md-nav
    > .md-nav__list
    > .md-nav__item:first-child {
    display: none;
  }

  .md-sidebar--primary
    .md-nav__item--nested:has(> .md-nav__link[for])
    > .md-nav__link[for] {
    cursor: pointer;
    pointer-events: auto;
  }

  /* Focus the open branch before JavaScript runs, avoiding a sidebar reflow. */
  .md-sidebar--primary
    .md-nav__list:has(> .md-nav__item--nested.md-nav__item--active)
    > .md-nav__item--nested:not(.md-nav__item--active) {
    display: none;
  }

  /* Keep article rows identical whether or not the article has an inline TOC. */
  .md-sidebar--primary
    .md-nav__item--active
    > .md-nav__link[for="__toc"],
  .md-sidebar--primary .md-nav__item--active > .md-nav--secondary {
    display: none;
  }

  .md-sidebar--primary .md-nav__item--nested > .md-nav__link .md-nav__icon {
    transform: rotate(90deg);
  }
}

.md-tabs__item--active > .md-tabs__link,
.md-nav__link--active,
.md-nav__link:is(:focus, :hover) {
  color: var(--md-accent-fg-color);
}

.md-tabs {
  position: relative;
}

@media screen and (min-width: 76.25em) {
  .md-tabs__inner {
    padding-left: 6.2rem;
  }
}

.md-tabs__link {
  margin-top: 0.35rem;
  padding: 0.32rem 0.55rem;
  border-radius: 4px;
  transition: background-color 140ms ease, color 140ms ease, opacity 140ms ease;
}

.md-tabs__item--active > .md-tabs__link {
  background: rgba(95, 199, 185, 0.16);
  color: #d9f3ef;
  opacity: 1;
}

.md-tabs__link:is(:focus, :hover) {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  opacity: 1;
}

.md-sidebar--primary .md-nav__link {
  padding: 0.3rem 0.45rem;
  border-radius: 4px;
}

/* Nested section containers otherwise apply the same horizontal padding twice. */
.md-sidebar--primary .md-nav__container {
  padding: 0;
}

.md-sidebar--primary
  .md-nav__item--section
  > .md-nav__container {
  margin-left: -0.9rem;
}

/* Nested directory links must remain indented beneath their parent section. */
.md-sidebar--primary
  .md-nav__item--section
  .md-nav__item--section
  > .md-nav__container {
  margin-left: 0;
}

.md-sidebar--primary .md-nav__link--active {
  background: #e8f2f0;
  font-weight: 650;
}

[data-md-color-scheme="slate"] .md-sidebar--primary .md-nav__link--active {
  background: rgba(95, 199, 185, 0.14);
}

.md-sidebar--primary .md-nav__link:is(:focus, :hover) {
  background: var(--md-default-fg-color--lightest);
}

.md-sidebar--primary .md-nav__item--nested > .md-nav__link {
  font-weight: 650;
}

.md-sidebar--primary
  .md-nav__item--nested
  .md-nav__item--nested
  > .md-nav__link {
  font-size: 0.68rem;
}

.md-sidebar--primary
  .md-nav__item--nested
  .md-nav__item--nested
  .md-nav__item:not(.md-nav__item--nested)
  > .md-nav__link {
  margin-left: 0.65rem;
  font-size: 0.63rem;
  font-weight: 450;
}

.md-typeset a {
  color: var(--md-accent-fg-color);
}

.md-typeset a:hover {
  color: var(--md-accent-fg-color);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.md-typeset h1.directory-title {
  margin-bottom: 0.55rem;
  font-size: 1.65rem;
}

.md-typeset h2.directory-heading {
  margin-top: 1.45rem;
  margin-bottom: 0.65rem;
  font-size: 1rem;
}

.md-typeset .grid.cards > ul > li,
.md-typeset .grid.cards > ol > li,
.md-typeset .grid.cards > .card {
  border-color: var(--md-default-fg-color--lightest);
  border-radius: 8px;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.md-typeset .grid.cards > ul > li:hover,
.md-typeset .grid.cards > ol > li:hover,
.md-typeset .grid.cards > .card:hover {
  border-color: var(--md-accent-fg-color);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.md-typeset img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.1rem auto;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 8px;
  background: var(--md-default-bg-color);
}

.md-typeset .arithmatex {
  overflow-x: auto;
}

.md-typeset div.arithmatex {
  margin: 1.1rem 0;
  padding: 0.65rem 0.85rem;
  border-left: 3px solid var(--md-accent-fg-color);
  background: var(--md-code-bg-color);
}

[data-md-color-scheme="slate"] .md-typeset .grid.cards > ul > li:hover,
[data-md-color-scheme="slate"] .md-typeset .grid.cards > ol > li:hover,
[data-md-color-scheme="slate"] .md-typeset .grid.cards > .card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

/* The repository shortcut is redundant with the in-article edit action. */
.md-header__source {
  display: none;
}

/* Management controls are owner-only enhancements rendered by JavaScript. */
a.md-content__button[rel~="edit"],
.editor-page-context {
  display: none !important;
}

.content-management-actions {
  display: flex;
  margin: -0.2rem 0 1.2rem;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.content-management-actions .md-button {
  margin: 0;
  padding: 0.35rem 0.65rem;
  font-size: 0.65rem;
}

.notes-editor {
  margin-top: 0.75rem;
}

.notes-editor[hidden],
.notes-editor-create[hidden],
.notes-editor-login[hidden],
#notes-editor-article-fields[hidden],
#notes-editor-directory-fields[hidden],
#notes-editor-rename-fields[hidden],
#notes-editor-error[hidden] {
  display: none !important;
}

.notes-editor-create {
  max-width: 34rem;
  margin-top: 0.75rem;
}

.notes-editor-create__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.notes-editor-create__heading h2 {
  margin: 0;
}

.notes-editor-create__heading p {
  margin: 0.25rem 0 1rem;
  color: var(--md-default-fg-color--light);
}

.notes-editor-create label {
  display: block;
  margin: 0.8rem 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 650;
}

.notes-editor-create select,
.notes-editor-create input {
  display: block;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 6px;
  outline: none;
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
  font: inherit;
}

.notes-editor-create select:focus,
.notes-editor-create input:focus {
  border-color: var(--md-accent-fg-color);
  box-shadow: 0 0 0 2px var(--md-accent-fg-color--transparent);
}

.notes-editor-create__hint {
  margin: 0.3rem 0 1rem;
  color: var(--md-default-fg-color--light);
  font-size: 0.65rem;
}

.notes-editor__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.notes-editor__actions {
  display: flex;
  flex-shrink: 0;
  gap: 0.5rem;
}

.notes-editor__actions .md-button,
.notes-editor-login .md-button {
  margin: 0;
}

#notes-editor-content {
  display: block;
  width: 100%;
  min-height: min(68vh, 48rem);
  resize: vertical;
  padding: 0.85rem 1rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 6px;
  outline: none;
  background: var(--md-code-bg-color);
  color: var(--md-code-fg-color);
  font: 0.72rem/1.65 var(--md-code-font);
}

#notes-editor-content:focus {
  border-color: var(--md-accent-fg-color);
  box-shadow: 0 0 0 2px var(--md-accent-fg-color--transparent);
}

.notes-editor__status {
  min-height: 1.4rem;
  margin: 0.5rem 0 0;
  color: var(--md-default-fg-color--light);
  font-size: 0.68rem;
}

.notes-editor-login {
  max-width: 30rem;
  padding-top: 1rem;
}

@media screen and (max-width: 44.984375em) {
  .notes-editor__toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .notes-editor__actions {
    width: 100%;
  }

  .notes-editor__actions .md-button {
    flex: 1;
  }
}

.cms-sync-status {
  position: absolute;
  top: 50%;
  left: 0.7rem;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 999px;
  background: var(--md-default-bg-color);
  box-shadow: var(--md-shadow-z2);
  color: var(--md-default-fg-color);
  font-size: 0.66rem;
  font-weight: 650;
  animation: cms-sync-status-in 160ms ease-out;
  transform: translateY(-50%);
}

.cms-sync-status__spinner {
  width: 0.7rem;
  height: 0.7rem;
  border: 2px solid var(--md-default-fg-color--lightest);
  border-top-color: var(--md-accent-fg-color);
  border-radius: 50%;
  animation: cms-sync-spin 700ms linear infinite;
}

.cms-sync-status--complete {
  border-color: var(--md-accent-fg-color--transparent);
  background: var(--md-accent-fg-color--transparent);
  color: var(--md-accent-fg-color);
}

@keyframes cms-sync-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes cms-sync-status-in {
  from {
    opacity: 0;
  }
}

@media screen and (max-width: 76.234375em) {
  .cms-sync-status {
    position: fixed;
    top: 3.2rem;
    left: 0.7rem;
    transform: none;
  }
}

.markmap {
  --markmap-text-color: var(--md-default-fg-color);

  position: relative;
  width: 100%;
  height: min(72vh, 46rem);
  min-height: 34rem;
  margin: 1.25rem 0 2rem;
  overflow: hidden;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 12px;
  background:
    radial-gradient(
      circle at 50% 50%,
      var(--md-accent-fg-color--transparent),
      transparent 58%
    ),
    var(--md-default-bg-color);
  box-shadow: var(--md-shadow-z1);
}

.markmap > svg {
  display: block;
  width: 100%;
  height: 100%;
}

.markmap .mm-toolbar {
  right: 0.75rem;
  bottom: 0.75rem;
}

.markmap-fullscreen {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 3;
  display: grid;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  place-items: center;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 50%;
  background: var(--md-default-bg-color);
  box-shadow: var(--md-shadow-z1);
  color: var(--md-default-fg-color--light);
  cursor: pointer;
}

.markmap-fullscreen:hover,
.markmap-fullscreen:focus-visible,
.markmap-fullscreen.is-active {
  border-color: var(--md-accent-fg-color);
  color: var(--md-accent-fg-color);
}

.markmap-fullscreen:focus-visible {
  outline: 2px solid var(--md-accent-fg-color);
  outline-offset: 2px;
}

.markmap-fullscreen svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.markmap:fullscreen {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  margin: 0;
  border: 0;
  border-radius: 0;
}

@media screen and (max-width: 44.984375em) {
  .markmap {
    height: 30rem;
    min-height: 30rem;
    margin-inline: -0.4rem;
    width: calc(100% + 0.8rem);
    border-radius: 8px;
  }
}

.technique-notes {
  max-width: 48rem;
  margin: 0 auto;
  line-height: 1.85;
}

.technique-notes > h2 {
  margin-top: 2.5rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
}

.technique-notes > h3 {
  margin-top: 2.4rem;
  padding: 0.2rem 0 0.2rem 0.8rem;
  border-left: 3px solid var(--md-accent-fg-color);
}

.technique-notes > h4 {
  margin-top: 1.5rem;
  color: var(--md-default-fg-color--light);
}

.technique-notes li + li {
  margin-top: 0.35rem;
}

.technique-notes table {
  margin: 1.25rem 0 2rem;
}

.technique-notes strong {
  color: var(--md-default-fg-color);
}

@media screen and (max-width: 44.984375em) {
  .technique-notes > h3 {
    margin-top: 2rem;
  }
}
