:root {
  --theme-color: #63e6d3;
  --page-background: #0b1219;
  --sidebar-background: #0e1822;
  --surface: #121f2b;
  --surface-strong: #172735;
  --border: #263746;
  --text: #ced9e3;
  --text-muted: #91a4b5;
  --warning: #f3c969;
}

html,
body {
  background: var(--page-background);
}

body {
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
}

::selection {
  background: rgba(99, 230, 211, 0.25);
}

a,
.markdown-section a,
.sidebar ul li a:hover,
.sidebar ul li.active > a {
  color: var(--theme-color);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--theme-color);
  outline-offset: 3px;
}

.sidebar {
  background: linear-gradient(180deg, #101c27 0%, var(--sidebar-background) 100%);
  border-right: 1px solid var(--border);
}

.sidebar > h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sidebar > h1 a {
  color: #effffc;
}

.sidebar-nav > ul > li > a {
  font-weight: 600;
}

.sidebar ul li a {
  color: #afbfcc;
  font-size: 0.95rem;
}

.sidebar ul li.active > a {
  border-right: 3px solid var(--theme-color);
  font-weight: 650;
}

.search {
  border-bottom: 1px solid var(--border) !important;
  padding: 0.75rem 1rem !important;
}

.search input {
  background: #0a131b !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px;
  color: var(--text) !important;
  padding: 0.7rem 0.8rem !important;
}

.search input::placeholder {
  color: #718596;
}

.search .results-panel {
  border-top: 0 !important;
}

.markdown-section {
  max-width: 920px;
  padding: 3rem 2.5rem 5rem;
}

.markdown-section h1,
.markdown-section h2,
.markdown-section h3,
.markdown-section h4 {
  color: #f1f7fb;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.markdown-section h1 {
  font-size: 2.35rem;
  margin-bottom: 1.4rem;
}

.markdown-section h2 {
  border-bottom: 1px solid var(--border);
  font-size: 1.55rem;
  margin-top: 2.6rem;
  padding-bottom: 0.45rem;
}

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

.markdown-section p,
.markdown-section li {
  line-height: 1.72;
}

.markdown-section strong {
  color: #edf7fa;
}

.markdown-section code {
  background: #101d27;
  border: 1px solid #223746;
  border-radius: 5px;
  color: #9ff4e7;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.88em;
  padding: 0.12rem 0.34rem;
}

.markdown-section pre {
  background: #081017 !important;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  padding: 1.1rem 1.25rem;
}

.markdown-section pre > code {
  background: transparent;
  border: 0;
  color: #d7e4ec;
  padding: 0;
}

.markdown-section table {
  border-collapse: separate;
  border-spacing: 0;
  display: table;
  margin: 1.25rem 0;
  overflow: hidden;
  width: 100%;
}

.markdown-section th,
.markdown-section td {
  border-color: var(--border);
  padding: 0.75rem 0.85rem;
}

.markdown-section th {
  background: var(--surface-strong);
  color: #eff8fb;
}

.markdown-section tr:nth-child(2n) {
  background: rgba(18, 31, 43, 0.7);
}

.markdown-section p.tip,
.markdown-section p.warn {
  border-radius: 8px;
  padding: 0.9rem 1rem 0.9rem 1.15rem;
}

.markdown-section p.tip {
  background: rgba(99, 230, 211, 0.08);
  border-left: 4px solid var(--theme-color);
}

.markdown-section p.warn {
  background: rgba(243, 201, 105, 0.09);
  border-left: 4px solid var(--warning);
  color: #eadfca;
}

section.cover.show {
  background:
    radial-gradient(circle at 50% 35%, rgba(99, 230, 211, 0.18), transparent 28%),
    linear-gradient(145deg, #091017 0%, #102333 52%, #0a141d 100%) !important;
  color: var(--text);
  justify-content: center;
}

section.cover .cover-main {
  flex: 0 1 760px;
  margin: 0 1rem;
  max-width: 760px;
  min-width: 0;
  position: relative;
  z-index: 1;
}

section.cover h1 {
  color: #f3fffd;
  font-size: clamp(2.7rem, 8vw, 5rem);
  font-weight: 750;
  letter-spacing: -0.055em;
  margin-bottom: 1rem;
}

section.cover h1 small {
  bottom: auto;
  color: var(--theme-color);
  display: block;
  font-size: 0.24em;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin-top: 0.8rem;
  position: static;
  text-transform: uppercase;
}

section.cover blockquote {
  color: #b9cbd7;
  font-size: clamp(1.05rem, 2.5vw, 1.3rem);
  margin: 1.5rem auto 2rem;
  max-width: 650px;
}

section.cover .cover-main > p:last-child a {
  border: 1px solid var(--theme-color);
  border-radius: 8px;
  font-weight: 650;
  margin: 0;
  padding: 0.72rem 1.35rem;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

section.cover .cover-main > p:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
}

section.cover .cover-main > p:last-child a:first-child {
  background: var(--theme-color);
  color: #07120f;
}

section.cover .cover-main > p:last-child a:last-child {
  background: transparent;
  color: var(--theme-color);
}

section.cover .cover-main > p:last-child a:hover {
  transform: translateY(-2px);
}

.github-corner svg {
  color: #0d1821;
  fill: var(--theme-color);
}

.pagination-item-label {
  color: var(--text-muted) !important;
}

.pagination-item-title {
  color: var(--theme-color) !important;
}

@media screen and (max-width: 768px) {
  .markdown-section {
    padding: 2.2rem 1.25rem 4rem;
  }

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

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

  section.cover .cover-main {
    padding: 0 1.2rem;
  }

  section.cover h1 {
    font-size: clamp(1.75rem, 8.5vw, 3rem);
    overflow-wrap: anywhere;
  }
}
