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

@font-face {
  font-family: "OPPOSans";
  src: url("./assets/fonts/OPPOSans-M.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "OPPOSans";
  src: url("./assets/fonts/OPPOSans-B.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ede1ce;
  --paper: rgba(255, 250, 242, 0.92);
  --paper-strong: rgba(255, 252, 247, 0.98);
  --paper-border: rgba(115, 89, 61, 0.14);
  --ink: #3f2f22;
  --muted: #8d7761;
  --accent: #8f5c2c;
  --accent-strong: #6f4219;
  --toggle-line: #5a3214;
  --line: rgba(206, 190, 170, 0.72);
  --shadow: 0 28px 60px rgba(95, 67, 38, 0.12);
  --reader-sidebar: rgb(251, 247, 237);
  --reader-sidebar-line: rgb(228, 218, 209);
  --reader-article-bg: #fefcf6;
  --reader-frame: rgba(237, 233, 225, 0.92);
  --reader-sheet-shadow: 0 24px 42px rgba(89, 65, 34, 0.12);
  --reader-corner-size: 5px;
  --reader-corner-x: 5px;
  --reader-corner-y: 5px;
  --reader-code-bg: rgba(102, 76, 49, 0.08);
  --topbar-height: 62px;
  --export-button-bg: linear-gradient(180deg, rgb(129, 111, 97) 0%, rgb(115, 99, 87) 100%);
  --export-button-hover-bg: linear-gradient(180deg, rgb(138, 119, 105) 0%, rgb(121, 104, 91) 100%);
  --export-button-border: rgba(82, 63, 47, 0.6);
  --export-button-text: #fbf6ef;
  --export-button-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 1px 0 rgba(58, 42, 29, 0.22);
  --theme-color: var(--accent);
  --base-font-family: "OPPOSans", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono-font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  background: url("./assets/bg.jpg") left top / 420px auto repeat;
  color: var(--ink);
  font-family: var(--base-font-family);
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}

a:hover {
  color: var(--accent-strong);
  text-decoration: none;
}

.markdown-section a {
  color: var(--accent-strong);
  font-weight: 600;
  text-decoration: none;
}

.markdown-section a:hover {
  color: var(--accent);
}

button,
input {
  font: inherit;
}

.app-name-link img,
.cover-main img {
  border-radius: 7px;
}

.sidebar {
  background: var(--reader-sidebar);
  border-right: 0;
  box-shadow: rgba(0, 0, 0, 0.1) 1px 0 3px 0;
  color: rgba(99, 87, 83, 0.84);
  padding-top: 10px;
  top: 0;
  height: 100vh;
  z-index: 90;
}

.sidebar,
.content,
.app-nav,
.sidebar-toggle {
  transition: none !important;
}

.sidebar h1 {
  margin: 0 12px 10px;
  padding: 6px 8px 14px;
  border-bottom: 1px solid var(--reader-sidebar-line);
  font-size: 18px;
  font-weight: 700;
}

.sidebar h1 a,
.sidebar .app-name-link {
  color: var(--accent-strong);
}

.sidebar-nav {
  padding: 0;
}

.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar ul li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar ul li::before,
.sidebar ul li::marker {
  content: none !important;
  display: none !important;
}

.sidebar ul li a {
  min-height: 46px;
  display: block;
  border-radius: 0;
  border-bottom: 1px solid var(--reader-sidebar-line);
  color: rgba(99, 87, 83, 0.82);
  font-size: 14px;
  line-height: 1.45;
  margin: 0;
  overflow: hidden;
  padding: 12px 18px 12px 26px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar ul li ul {
  background: rgba(255, 251, 245, 0.38);
}

.sidebar ul li ul li a {
  min-height: 42px;
  border-bottom-color: rgba(228, 218, 209, 0.78);
  color: rgba(99, 87, 83, 0.76);
  font-size: 13px;
  font-weight: 400;
  padding: 10px 16px 10px 38px;
}

.sidebar ul li ul li ul li a {
  color: rgba(99, 87, 83, 0.68);
  font-size: 12.5px;
  padding-left: 50px;
}

.sidebar ul li a:hover {
  background: rgb(241, 236, 225);
  color: rgb(99, 87, 83);
  box-shadow: rgba(0, 0, 0, 0.03) 0 1px 4px 0 inset;
}

.sidebar ul li.active > a {
  background: rgb(241, 236, 225);
  border-right: 0;
  color: var(--accent-strong);
  font-weight: 700;
  box-shadow: rgba(0, 0, 0, 0.03) 0 1px 4px 0 inset;
}

.sidebar ul li.active > a::before {
  display: none;
}

.sidebar-toggle {
  position: fixed;
  width: 40px;
  height: 40px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: rgb(255, 250, 243) !important;
  border: 1px solid rgba(82, 63, 47, 0.52) !important;
  border-radius: 0;
  bottom: auto;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 2px 10px rgba(42, 29, 19, 0.2);
  left: 18px;
  padding: 0;
  top: 11px;
  opacity: 1 !important;
  isolation: isolate;
  z-index: 10000 !important;
}

.sidebar-toggle-button {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgb(255, 250, 243) !important;
  border: 1px solid rgba(82, 63, 47, 0.52) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 2px 10px rgba(42, 29, 19, 0.2);
  opacity: 1 !important;
  pointer-events: none;
  z-index: 0;
}

.sidebar-toggle-button::before,
.sidebar-toggle-button::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 2px;
  display: none;
  background: var(--toggle-line) !important;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.sidebar-toggle::before,
.sidebar-toggle::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 2px;
  display: none;
  background: var(--toggle-line) !important;
  z-index: 3;
}

.sidebar-toggle span {
  width: 18px;
  height: 2px;
  margin: 0;
  background-color: var(--toggle-line) !important;
  opacity: 1;
  position: relative;
  transition:
    opacity 160ms ease,
    transform 180ms ease;
  z-index: 3;
}

.sidebar-toggle span + span {
  margin-top: 5px;
}

.sidebar .search {
  border-bottom: 1px solid var(--reader-sidebar-line);
  margin: 0;
  padding: 62px 12px 12px;
}

.search input {
  background: rgb(252, 252, 252);
  border: 1px solid var(--reader-sidebar-line);
  border-radius: 15px;
  box-shadow: rgba(0, 0, 0, 0.12) 0 1px 4px inset;
  color: var(--ink);
  height: 30px;
  padding: 0 12px;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.sidebar .search input:focus,
.sidebar .search input:focus-visible,
.search input:focus,
.search input:focus-visible {
  outline: 0 !important;
  border-color: rgb(218, 205, 193) !important;
  background: rgb(252, 252, 252) !important;
  box-shadow:
    rgba(0, 0, 0, 0.12) 0 1px 4px inset,
    0 0 0 2px rgba(145, 104, 71, 0.06) !important;
}

.search input::placeholder {
  color: rgba(177, 166, 153, 0.68);
}

.search .matching-post,
.search .matching-post a {
  color: rgba(99, 87, 83, 0.86);
}

.app-nav {
  position: fixed;
  z-index: 70;
  top: 0;
  right: auto;
  left: 300px;
  width: calc(100vw - 300px);
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin: 0;
  padding: 0 24px;
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 22px rgba(26, 18, 12, 0.16);
  pointer-events: none;
}

.app-nav::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(116, 103, 95, 0.96), rgba(90, 80, 74, 0.98));
  pointer-events: none;
  z-index: 0;
}

.app-nav ul {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: auto;
}

.app-nav li {
  display: flex;
  margin: 0;
  padding: 0;
}

.app-nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 18px;
  border: 1px solid var(--export-button-border);
  border-radius: 7px;
  background: var(--export-button-bg);
  box-shadow: var(--export-button-shadow);
  color: var(--export-button-text) !important;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  pointer-events: auto;
}

.app-nav a:hover {
  background: var(--export-button-hover-bg);
  color: var(--export-button-text) !important;
  border-color: var(--export-button-border);
  box-shadow: var(--export-button-shadow);
}

.app-nav a:active,
.app-nav a:focus,
.app-nav a:link,
.app-nav a:visited,
.app-nav a.active {
  color: var(--export-button-text) !important;
}

@media (min-width: 769px) {
  .sidebar-toggle {
    display: none !important;
  }

  .sidebar,
  body.close .sidebar {
    left: 0 !important;
    transform: none !important;
  }

  body.close .app-nav {
    left: 300px;
    width: calc(100vw - 300px);
    padding-left: 24px;
  }

  body.close .app-nav::before {
    inset: 0 !important;
  }

  body.close .content {
    left: 300px !important;
    transform: none !important;
  }
}

.content {
  min-height: 100vh;
  padding: calc(var(--topbar-height) + 20px) 20px 128px;
  background: transparent;
  box-shadow: none;
}

.markdown-section {
  position: relative;
  display: block;
  background: var(--reader-article-bg);
  border: 0;
  box-shadow: var(--reader-sheet-shadow);
  width: min(920px, 100%);
  max-width: none;
  min-height: max-content;
  margin: 0 auto 24px;
  padding: 72px 64px 68px;
  color: var(--ink);
  overflow: hidden;
  scroll-margin-top: 24px;
}

.markdown-section::before,
.markdown-section::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border: 1px solid var(--reader-frame);
}

.markdown-section::before {
  inset: 8px;
}

.markdown-section::after {
  inset: 13px;
}

.markdown-section > .reader-sheet-corner {
  position: absolute;
  width: var(--reader-corner-size);
  height: var(--reader-corner-size);
  border: 1px solid rgba(237, 233, 225, 0.76);
  background: transparent;
  pointer-events: none;
  z-index: 0;
}

.reader-sheet-corner-top-left {
  left: var(--reader-corner-x);
  top: var(--reader-corner-y);
}

.reader-sheet-corner-top-right {
  right: var(--reader-corner-x);
  top: var(--reader-corner-y);
}

.reader-sheet-corner-bottom-left {
  left: var(--reader-corner-x);
  bottom: var(--reader-corner-y);
}

.reader-sheet-corner-bottom-right {
  right: var(--reader-corner-x);
  bottom: var(--reader-corner-y);
}

.markdown-section > * {
  position: relative;
  z-index: 1;
}

.markdown-section h1,
.markdown-section h2,
.markdown-section h3,
.markdown-section h4 {
  color: #6e5b49;
  font-weight: 600;
  letter-spacing: 0;
}

.markdown-section h1 a,
.markdown-section h2 a,
.markdown-section h3 a,
.markdown-section h4 a {
  color: inherit;
}

.markdown-section h1 {
  border-bottom: 0;
  font-size: clamp(2.1rem, 3vw, 2.8rem);
  line-height: 1.26;
  margin: 0 0 28px;
  padding-bottom: 0;
}

.markdown-section h2 {
  border-bottom: 0;
  font-size: clamp(1.72rem, 2.2vw, 2.2rem);
  line-height: 1.36;
  margin: 34px 0 16px;
  padding-bottom: 0;
}

.markdown-section h3 {
  font-size: clamp(1.5rem, 1.9vw, 1.9rem);
  line-height: 1.42;
  margin: 34px 0 16px;
}

.markdown-section h4 {
  font-size: 1.24rem;
  line-height: 1.42;
  margin: 32px 0 14px;
}

.markdown-section > h1:first-child,
.markdown-section > h2:first-child,
.markdown-section > h3:first-child {
  margin-top: 0;
  margin-bottom: 28px;
  font-size: clamp(2.1rem, 3vw, 2.8rem);
  line-height: 1.26;
}

.markdown-section p,
.markdown-section ul,
.markdown-section ol,
.markdown-section blockquote,
.markdown-section pre,
.markdown-section table {
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 400;
  line-height: 1.95;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.markdown-section p,
.markdown-section ul,
.markdown-section ol,
.markdown-section blockquote,
.markdown-section pre,
.markdown-section table {
  margin: 0 0 18px;
}

.markdown-section li {
  margin: 0.28rem 0;
}

.markdown-section strong {
  color: var(--ink);
  font-weight: 700;
}

.markdown-section blockquote {
  position: relative;
  background: transparent;
  border-left: 3px solid rgba(143, 92, 44, 0.22);
  border-radius: 0;
  color: #7f6d5d;
  padding: 8px 0 8px 18px;
}

.markdown-section blockquote p {
  color: inherit;
  margin: 0;
}

.markdown-section code {
  background: var(--reader-code-bg);
  border-radius: 0;
  color: var(--ink);
  font-family: var(--mono-font-family);
  font-size: 0.9em;
  margin: 0 2px;
  padding: 1px 4px;
}

.markdown-section pre {
  background: var(--reader-code-bg);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: var(--ink);
  line-height: 1.65;
  padding: 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.markdown-section pre > code {
  background: transparent;
  color: inherit;
  margin: 0;
  padding: 0;
}

.markdown-section table {
  background: transparent;
  border-collapse: collapse;
  border-radius: 0;
  border-spacing: 0;
  box-shadow: none;
  display: table;
  table-layout: fixed;
  overflow: hidden;
  width: 100%;
}

.markdown-section tr {
  background-color: rgba(255, 252, 247, 0.82);
}

.markdown-section tr:nth-child(2n) {
  background-color: rgba(250, 242, 229, 0.82);
}

.markdown-section thead tr {
  background-color: rgba(246, 236, 221, 0.86);
}

.markdown-section th,
.markdown-section td {
  border: 1px solid rgba(177, 152, 122, 0.18);
  overflow-wrap: anywhere;
  padding: 10px 12px;
  text-align: left;
  word-break: break-word;
  vertical-align: top;
}

.markdown-section th {
  background: rgba(102, 76, 49, 0.05);
  color: var(--ink);
  font-weight: 700;
}

.markdown-section img {
  border-radius: 18px;
  box-shadow: 0 16px 28px rgba(71, 48, 24, 0.12);
  display: block;
  height: auto;
  margin: 22px auto;
  max-width: 100%;
}

.anchor span {
  color: inherit;
}

.markdown-section hr {
  border-bottom: 1px solid rgba(177, 152, 122, 0.18);
}

.pagination-item-title,
.pagination-item-label {
  color: var(--accent);
}

.docsify-copy-code-button,
.markdown-section button {
  background: rgba(255, 251, 246, 0.94);
  border: 1px solid rgb(228, 218, 209);
  border-radius: 0;
  box-shadow: 0 6px 12px rgba(88, 60, 31, 0.06);
  color: rgba(99, 87, 83, 0.78);
  font-weight: 500;
}

.docsify-copy-code-button:hover,
.markdown-section button:hover {
  background: rgb(241, 236, 225);
}

@media (max-width: 768px) {
  .app-nav {
    left: 0;
    right: auto;
    width: 100vw;
    min-height: var(--topbar-height);
    justify-content: flex-end;
    gap: 8px;
    margin: 0;
    padding: 0 12px 0 60px;
    overflow-x: auto;
    overflow-y: hidden;
    text-align: left;
  }

  .app-nav ul {
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
  }

  .app-nav::before {
    inset: 0 0 0 60px !important;
    z-index: 0;
  }

  body > main::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 60px;
    height: var(--topbar-height);
    background:
      linear-gradient(180deg, rgba(116, 103, 95, 0.96), rgba(90, 80, 74, 0.98));
    pointer-events: none;
    z-index: 9990;
  }

  body.close > main::before {
    display: none;
  }

  .app-nav a {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 14px;
    margin: 0;
  }

  body.close .sidebar-toggle {
    background: rgb(255, 250, 243) !important;
    border-color: rgba(82, 63, 47, 0.52) !important;
    left: min(244px, calc(100vw - 64px));
    top: 12px;
    width: 40px;
    height: 40px;
    padding: 0;
    z-index: 120;
  }

  body.close .app-nav {
    display: none;
  }

  body.close .sidebar .search {
    padding: 62px 12px 12px;
  }

  .sidebar-toggle {
    top: 11px;
    bottom: auto;
    left: 12px;
    width: 40px;
    height: 40px;
    z-index: 10000 !important;
    background: rgb(255, 250, 243) !important;
    border-color: rgba(82, 63, 47, 0.52) !important;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.26),
      0 2px 8px rgba(42, 29, 19, 0.22);
  }

  .sidebar-toggle span {
    background-color: var(--accent-strong);
  }

  body.close .sidebar-toggle span:nth-child(1) {
    opacity: 0;
    transform: none;
  }

  body.close .sidebar-toggle span:nth-child(2) {
    opacity: 0;
  }

  body.close .sidebar-toggle span:nth-child(3) {
    opacity: 0;
    transform: none;
  }

  body.close .sidebar-toggle-button::before,
  body.close .sidebar-toggle-button::after {
    display: block;
    background: var(--accent-strong);
  }

  body.close .sidebar-toggle-button::before {
    transform: translate(-50%, -50%) rotate(45deg);
  }

  body.close .sidebar-toggle-button::after {
    transform: translate(-50%, -50%) rotate(-45deg);
  }

  .content {
    display: block;
    min-height: 100vh;
    padding: calc(var(--topbar-height) + 12px) 12px 28px;
  }

  .markdown-section {
    border-radius: 0;
    min-height: auto;
    margin-bottom: 24px;
    padding: 54px 24px 58px;
    width: 100%;
  }

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

  .markdown-section h2 {
    font-size: 1.72rem;
  }

  .markdown-section h3 {
    font-size: 1.46rem;
  }

  .markdown-section p,
  .markdown-section ul,
  .markdown-section ol,
  .markdown-section blockquote,
  .markdown-section pre,
  .markdown-section table {
    font-size: 1.12rem;
  }

  .markdown-section table {
    font-size: 0.88rem;
  }
}
