:root {
  --theme-color: #0f766e;
  --base-background-color: #ffffff;
  --base-color: #334155;
  --base-font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --base-font-size: 16px;
  --base-line-height: 1.75;
  --heading-color: #0f172a;
  --heading-font-weight: 700;
  --link-color: #0f766e;
  --link-color--hover: #115e59;
  --sidebar-width: 16.2rem;
  --sidebar-background: #f8fafc;
  --sidebar-border-color: #dfe3e8;
  --sidebar-name-color: #0f172a;
  --sidebar-name-font-weight: 750;
  --sidebar-nav-link-color: #475569;
  --sidebar-nav-link-color--active: #0f766e;
  --sidebar-nav-link-font-weight--active: 650;
  --search-input-background-color: #ffffff;
  --search-input-border-color: transparent;
  --code-inline-background: #f1f5f9;
  --code-theme-background: #f8fafc;
  --blockquote-border-color: #14b8a6;
  --blockquote-color: #475569;
  --content-max-width: 54rem;
  --reader-font-size: 16px;
  --reader-font-weight: 400;
  --toolbar-height: 3.5rem;
  --toc-width: 17rem;
}

html {
  scroll-behavior: smooth;
}

body {
  background: #ffffff;
}

button {
  font: inherit;
}

/*--- Sidebar --------------------------------------------------------------*/

.sidebar {
  border-right: 0;
  box-shadow: none;
}

.sidebar .app-name {
  display: none;
}

.sidebar .search {
  background: #ffffff;
  border-bottom: 1px solid var(--sidebar-border-color);
  margin: 0 !important;
  padding: 0 !important;
  position: sticky;
  top: 0;
  z-index: 4;
}

.sidebar .search .input-wrap {
  border: 0 !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.sidebar .search input[type="search"] {
  background: #ffffff !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #334155;
  font-size: 0.9rem;
  height: var(--toolbar-height);
  outline: 0;
  padding: 0 1rem !important;
}

.sidebar .search input[type="search"]:focus {
  box-shadow: inset 3px 0 0 var(--theme-color) !important;
}

.sidebar .search .kbd-group {
  display: none;
}

.sidebar .search .clear-button {
  right: 0.75rem;
}

.sidebar-nav {
  padding-top: 0.65rem;
}

.sidebar-nav > ul > li > p,
.sidebar-nav > ul > li > strong {
  color: #0f172a;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sidebar-nav a {
  border-radius: 0.35rem;
  margin: 0.08rem 0.55rem;
  padding: 0.38rem 0.65rem;
  transition: background-color 120ms ease, color 120ms ease;
}

.sidebar-nav a:hover,
.sidebar-nav li.active > a {
  background: #ccfbf1;
  text-decoration: none;
}

/*--- Top controls ---------------------------------------------------------*/

.sidebar-toggle {
  background: transparent !important;
  border: 0 !important;
  bottom: auto !important;
  box-shadow: none !important;
  height: 2.2rem !important;
  left: 0.65rem !important;
  margin: 0 !important;
  padding: 0 !important;
  position: fixed !important;
  right: auto !important;
  top: 0.65rem !important;
  width: 2.2rem !important;
  z-index: 80;
}

.sidebar-toggle .sidebar-toggle-button {
  align-items: center;
  background: transparent;
  border-radius: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 3px;
  height: 100%;
  justify-content: center;
  padding: 0.55rem !important;
  position: static !important;
  transform: none !important;
  width: 100%;
}

.sidebar-toggle .sidebar-toggle-button:hover,
.sidebar-toggle .sidebar-toggle-button:focus-visible {
  background: #f1f5f9;
  outline: 0;
}

.sidebar-toggle span {
  background-color: #94a3b8 !important;
  display: block !important;
  height: 2px !important;
  margin: 0 !important;
  width: 1rem !important;
}

.font-tools {
  align-items: center;
  display: flex;
  height: 2.2rem;
  left: calc(var(--sidebar-width) + 3.05rem);
  position: fixed;
  top: 0.65rem;
  transition: left 180ms ease;
  z-index: 79;
}

body:not(.sidebar-is-open) .font-tools {
  left: 3.05rem;
}

.font-tools__toggle,
.share-tools__button,
.share-tools__link {
  align-items: center;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: #a3acb8;
  cursor: pointer;
  display: inline-flex;
  height: 2.2rem;
  justify-content: center;
  min-width: 2.2rem;
  padding: 0 0.45rem;
  text-decoration: none;
}

.font-tools__toggle {
  font-family: Georgia, serif;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1;
  margin: 0 !important;
  min-width: 1.65rem;
  padding: 0;
}

.font-tools__toggle:hover,
.font-tools__toggle:focus-visible,
.font-tools__toggle[aria-expanded="true"],
.share-tools__button:hover,
.share-tools__button:focus-visible,
.share-tools__link:hover,
.share-tools__link:focus-visible {
  background: transparent !important;
  color: #0f766e;
  outline: 0;
  text-decoration: none;
}

.font-tools__panel {
  background: #ffffff;
  border: 1px solid #dfe3e8;
  border-radius: 0.6rem;
  box-sizing: border-box;
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.14);
  left: 0;
  padding: 0.85rem;
  position: absolute;
  top: 2.6rem;
  width: 15.5rem;
}

.font-tools__panel[hidden] {
  display: none;
}

.font-tools__label {
  color: #64748b;
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0.25rem 0 0.45rem;
  text-transform: uppercase;
}

.font-tools__group {
  display: grid;
  gap: 0.35rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 0.75rem;
  width: 100%;
}

.font-tools__group--weight {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 0;
}

.font-tools__option {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.4rem;
  box-sizing: border-box;
  color: #475569;
  cursor: pointer;
  display: flex;
  font-size: 0.76rem;
  height: 2rem;
  justify-content: center;
  line-height: 1;
  margin: 0 !important;
  min-width: 0;
  padding: 0 0.25rem;
  text-align: center;
  white-space: nowrap;
  width: 100%;
  writing-mode: horizontal-tb;
}

.font-tools__option:hover,
.font-tools__option:focus-visible,
.font-tools__option[aria-pressed="true"] {
  background: #ccfbf1;
  border-color: #5eead4;
  color: #0f766e;
  outline: 0;
}

.share-tools {
  align-items: center;
  display: flex;
  gap: 0.05rem;
  position: fixed;
  right: 1rem;
  top: 0.65rem;
  z-index: 75;
}

.share-tools__button,
.share-tools__link {
  font-size: 0.95rem;
  font-weight: 700;
  min-width: 2rem;
  padding: 0 0.35rem;
}

.share-tools__status {
  background: #0f172a;
  border-radius: 0.35rem;
  color: #ffffff;
  font-size: 0.75rem;
  opacity: 0;
  padding: 0.35rem 0.55rem;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: 2.5rem;
  transform: translateY(-0.25rem);
  transition: opacity 120ms ease, transform 120ms ease;
  white-space: nowrap;
}

.share-tools__status.show {
  opacity: 1;
  transform: translateY(0);
}

.github-corner {
  display: none;
}

/*--- Resizable divider ----------------------------------------------------*/

.sidebar-splitter {
  align-items: center;
  bottom: 0;
  cursor: col-resize;
  display: flex;
  justify-content: center;
  left: calc(var(--sidebar-width) - 0.22rem);
  position: fixed;
  top: 0;
  touch-action: none;
  width: 0.44rem;
  z-index: 70;
}

.sidebar-splitter::before {
  background: var(--sidebar-border-color);
  bottom: 0;
  content: "";
  left: 50%;
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  transition: background-color 120ms ease, width 120ms ease;
  width: 1px;
}

.sidebar-splitter:hover::before,
.sidebar-splitter:focus-visible::before,
body.sidebar-resizing .sidebar-splitter::before {
  background: #14b8a6;
  width: 2px;
}

.sidebar-splitter:focus-visible {
  outline: 0;
}

.sidebar-splitter__grip {
  background: #ffffff;
  border: 1px solid #dfe3e8;
  border-radius: 999px;
  color: #a3acb8;
  font-size: 0.55rem;
  letter-spacing: 0.05rem;
  line-height: 1;
  padding: 0.45rem 0.12rem;
  position: relative;
  writing-mode: vertical-rl;
}

body:not(.sidebar-is-open) .sidebar-splitter {
  display: none;
}

body.sidebar-resizing,
body.sidebar-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

/*--- Article --------------------------------------------------------------*/

.content {
  padding-right: 0;
  padding-top: var(--toolbar-height);
}

.markdown-section {
  font-size: var(--reader-font-size);
  max-width: var(--content-max-width);
  padding: 2.25rem 2.5rem 6rem;
}

.markdown-section p,
.markdown-section li,
.markdown-section table,
.markdown-section blockquote {
  font-weight: var(--reader-font-weight);
}

.markdown-section h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  letter-spacing: -0.04em;
  margin-bottom: 1.2rem;
}

.markdown-section h2 {
  border-bottom: 1px solid #e2e8f0;
  font-size: 1.55em;
  letter-spacing: -0.025em;
  margin-top: 2.8rem;
  padding-bottom: 0.45rem;
}

.markdown-section h3 {
  font-size: 1.2em;
  margin-top: 2rem;
}

.markdown-section p,
.markdown-section li {
  color: #334155;
}

.markdown-section code {
  border: 1px solid #e2e8f0;
  border-radius: 0.32rem;
  color: #0f766e;
  padding: 0.12rem 0.34rem;
}

.markdown-section pre {
  border: 1px solid #e2e8f0;
  border-radius: 0.7rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.04);
}

.markdown-section pre code {
  border: 0;
  color: inherit;
  padding: 0;
}

.markdown-section blockquote {
  background: #f0fdfa;
  border-radius: 0 0.55rem 0.55rem 0;
  padding: 0.8rem 1rem;
}

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

/*--- Hidden page navigation ----------------------------------------------*/

.page-toc-toggle {
  align-items: center;
  background: #475569;
  border: 0;
  border-radius: 50%;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  height: 3.1rem;
  justify-content: center;
  padding: 0;
  position: fixed;
  right: 1.5rem;
  top: 4.55rem;
  transition: background-color 120ms ease, transform 120ms ease;
  width: 3.1rem;
  z-index: 78;
}

.page-toc-toggle:hover,
.page-toc-toggle:focus-visible,
.page-toc-toggle[aria-expanded="true"] {
  background: #0f766e;
  outline: 0;
  transform: translateY(-1px);
}

.page-toc-toggle[hidden] {
  display: none;
}

.page-toc-toggle__icon::before,
.page-toc-toggle__icon::after {
  background: currentColor;
  border-radius: 999px;
  content: "";
  height: 2px;
  left: 0;
  position: absolute;
  width: 1.15rem;
}

.page-toc-toggle__icon {
  background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat;
  display: block;
  height: 0.875rem;
  position: relative;
  width: 1.15rem;
}

.page-toc-toggle__icon::before {
  top: 0;
}

.page-toc-toggle__icon::after {
  bottom: 0;
}

.page-toc {
  background: #ffffff;
  border: 1px solid #dfe3e8;
  border-radius: 0.65rem;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.16);
  max-height: calc(100vh - 9rem);
  opacity: 0;
  overflow: auto;
  padding: 1rem 0.75rem 1rem 1.15rem;
  pointer-events: none;
  position: fixed;
  right: 1.5rem;
  top: 8.25rem;
  transform: translateX(calc(100% + 2rem));
  transition: opacity 160ms ease, transform 160ms ease;
  width: var(--toc-width);
  z-index: 77;
}

.page-toc.page-toc--open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.page-toc[hidden] {
  display: none;
}

.page-toc__title {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  margin-bottom: 0.65rem;
  text-transform: uppercase;
}

.page-toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.page-toc__item {
  margin: 0;
}

.page-toc__item a {
  border-left: 2px solid transparent;
  color: #64748b;
  display: block;
  font-size: 0.84rem;
  line-height: 1.4;
  margin-left: -1.2rem;
  overflow: hidden;
  padding: 0.32rem 0 0.32rem 1.1rem;
  text-overflow: ellipsis;
  transition: border-color 120ms ease, color 120ms ease;
  white-space: nowrap;
}

.page-toc__item a:hover,
.page-toc__item a.active {
  border-left-color: #14b8a6;
  color: #0f766e;
  text-decoration: none;
}

.page-toc__item--h3 a {
  padding-left: 1.85rem;
}

.page-toc__item--h4 a {
  padding-left: 2.6rem;
}

@media (max-width: 900px) {
  .share-tools__button[data-share="weibo"],
  .share-tools__button[data-share="facebook"],
  .share-tools__button[data-share="linkedin"] {
    display: none;
  }
}

@media (max-width: 768px) {
  .sidebar-splitter {
    display: none;
  }

  .font-tools {
    left: 3.05rem;
  }

  .share-tools {
    right: 0.5rem;
  }

  .markdown-section {
    padding: 2rem 1.25rem 5rem;
  }

  .markdown-section h1 {
    font-size: 2rem;
  }

  .markdown-section table {
    display: block;
    overflow-x: auto;
  }

  .page-toc-toggle {
    right: 1rem;
  }

  .page-toc {
    max-width: calc(100vw - 2rem);
    right: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

