/* Unified style management */
:root {
  --main-content-width: 790px;
  --text-primary: #060101;
  --text-secondary: #82868c;
  --misc-background: #f6f6f6;
  --nav-background: rgba(246, 246, 246, 0.82);
  --misc-divider: rgba(0, 0, 0, 0.8);
  --spacing-unit: 1rem;
  --font-size-base: 1.25rem;
  --font-size-large: 2.25rem;
  --font-size-medium: 1.75rem;
  --font-size-small: 0.9375rem;
  --line-height-base: 2;
  --line-height-spacious: 2;
  --transition: all 0.3s ease;
  --heading-spacing: 2rem;
  --text-primary-dark: #e0e0e0;
  --text-secondary-dark: #a0a0a0;
  --misc-background-dark: #1a1a1a;
  --nav-background-dark: rgba(26, 26, 26, 0.88);
  --misc-divider-dark: rgba(255, 255, 255, 0.2);
  --code-background-dark: #333333;
  --link-hover-background-dark: #7979da;
  --blockquote-background: #e8ecef;
  --blockquote-background-dark: #242832;
  --code-background: #f2f2f2;

}

html {
  font-size: 100%;
  box-sizing: border-box;
  background: var(--misc-background);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  height: 100%;
}

html[data-theme="dark"] {
  --text-primary: var(--text-primary-dark);
  --text-secondary: var(--text-secondary-dark);
  --misc-background: var(--misc-background-dark);
  --nav-background: var(--nav-background-dark);
  --misc-divider: var(--misc-divider-dark);
  --code-background: var(--code-background-dark);
  --link-hover-background: var(--link-hover-background-dark);
  --blockquote-background: var(--blockquote-background-dark);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --text-primary: var(--text-primary-dark);
    --text-secondary: var(--text-secondary-dark);
    --misc-background: var(--misc-background-dark);
    --misc-divider: var(--misc-divider-dark);
    --code-background: var(--code-background-dark);
    --link-hover-background: var(--link-hover-background-dark);
    --blockquote-background: var(--blockquote-background-dark);
  }
}

.theme-toggle {
  color: var(--text-primary);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: none;
  transition: var(--transition);
  display: flex;
  /* Use flexbox for centering */
  justify-content: center;
  /* Center horizontally */
  align-items: center;
  /* Center vertically */

  height: 50px;
  /* Match the line-height of ul.sidebar (adjust if needed) */
  box-sizing: border-box;
  /* Include padding in width/height calculations */
}

.theme-toggle:hover {
  border-radius: 30px;
  background: var(--link-hover-background, lavender);
}

*,
*:before,
*:after {
  box-sizing: inherit;
}

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

body {
  font-family: 'Times New Roman', 'Georgia', 'Palatino', 'Noto Sans HK', -apple-system, sans-serif;
  font-weight: 300;
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--misc-background);
}

h1,
.track-title {
  font-family: 'Noto Serif SC', serif;
  font-weight: 700;
  font-size: clamp(1.2rem, 3vw, var(--font-size-medium));
  text-align: center;
  margin-bottom: var(--heading-spacing);
  color: var(--text-primary);
  letter-spacing: 0.05em;
}

h2 {
  font-family: 'Noto Serif SC', serif;
  font-weight: 700;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  text-align: center;
  margin-bottom: var(--heading-spacing);
  margin-top: calc(var(--spacing-unit) * 1.5);
  color: var(--text-secondary);
  margin: calc(var(--spacing-unit) * 3) 0 var(--heading-spacing);
  display: flex;
  align-items: center;
  text-align: center;
}
/* 使用伪元素在标题两侧画线 */
h2::before,
h2::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--misc-divider);
  opacity: 0.3; /* 线条不要太黑，隐约可见即可 */
}

h2:not(:empty)::before { margin-right: 1.5rem; }
h2:not(:empty)::after { margin-left: 1.5rem; }
h3,
h4,
h5,
h6 {
  font-family: 'Noto Serif SC', serif;
  font-weight: 700;
  font-size: clamp(1.125rem, 2.5vw, 1.25rem);
  color: var(--text-primary);
}

a {
  color: var(--text-primary);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--misc-divider);
  transition: var(--transition);
}

a:hover {
  border-radius: 30px;
  border-bottom: none;
  background: var(--link-hover-background, lavender);
}

div.paperlist a,
nav a,
h2 a {
  border-bottom: none;
}

nav {
  font-family: 'Noto Sans HK', sans-serif;
  font-weight: 300;
  position: fixed;
  top: 0;
  left: 0;
  width: 275px;
  height: 100vh;
  background: var(--nav-background); /* 使用半透明背景 */
  backdrop-filter: blur(10px); /* 模糊背景 */
  -webkit-backdrop-filter: blur(10px);
  border-right: 1px solid var(--misc-divider);
  text-align: center;
  z-index: 100;
}

nav ul {
  list-style: none;
  padding: 0 calc(var(--spacing-unit) * 2);
  margin: 0;
}

ul.sidebar {
  font-size: var(--font-size-base);
  line-height: 50px;
}

.main {
  width: min(79%, var(--main-content-width));
  margin: calc(var(--spacing-unit) * 4) auto 0;
  padding: 0 calc(var(--spacing-unit) * 4);
  flex: 1 0 auto;
  text-align: justify;
  font-size: var(--font-size-base);
}

.main h1,
.main h2,
.main h3,
.main p,
.main h4,
.main h5,
.main h6 {
  opacity: 0;
  animation: fadeIn 0.45s ease-in forwards;
}

.main p {
  text-indent: 2em;
  line-height: var(--line-height-spacious);
  margin-bottom: calc(var(--spacing-unit) * 1.5);
}

.paperlist {
  list-style: none;
  padding: 0;
  margin-bottom: calc(var(--spacing-unit) * 0.25);
}

.paperlist li {
  margin-bottom: calc(var(--spacing-unit) * 0.25);
}

ul.sidebar li a {
  display: flex;
  justify-content: center;
  align-items: center;
}

.footer {
  font-family: 'Noto Sans HK', sans-serif;
  font-weight: 300;
  font-size: 0.8rem;
  width: 100%;
  margin: calc(var(--spacing-unit) * 3) auto calc(var(--spacing-unit) * 1);
  padding: calc(var(--spacing-unit) * 0.5) calc(var(--spacing-unit) * 2);
  border-top: none;
  color: var(--text-secondary);
  opacity: 0.72;
  text-align: center;
  flex-shrink: 0;
}

.footer-content {
  color: var(--text-secondary);
  opacity: 0.7;
  transition: var(--transition);
}

.footer-content:hover {
  opacity: 1;
  color: var(--text-primary);
}

.footer-language {
  display: flex;
  gap: calc(var(--spacing-unit) * 0.5);
  justify-content: center;
  align-items: center;
}

.footer-language .theme-toggle {
  cursor: pointer;
  padding: calc(var(--spacing-unit) * 0.5);
  font-size: var(--font-size-small);
  color: var(--text-secondary);
  background: none;
  border: none;
  transition: var(--transition);
}

.footer-language .theme-toggle:hover {
  color: var(--text-primary);
  opacity: 1;
}

blockquote {
  font-family: 'Times New Roman', 'Georgia', 'Palatino', 'Noto Sans HK', sans-serif;
  font-weight: 300;
  font-size: calc(var(--font-size-small) * 1.0667);
  line-height: var(--line-height-spacious);
  color: var(--text-secondary);
  margin: var(--spacing-unit) 0;
  padding: 0 calc(var(--spacing-unit) * 2);
  border-left: 3px solid var(--misc-divider);
  background: var(--blockquote-background);
}

pre,
code {
  font-family: Consolas, monospace;
  font-size: var(--font-size-small);
  background: var(--code-background, darkgray);
  padding: 2px 4px;
}

pre {
  padding: calc(var(--spacing-unit) * 0.5);
  overflow-x: auto;
}

sup a {
  font-size: 0.7em;
  vertical-align: super;
  line-height: 1;
  margin: 0 0.2em;
  padding: 0.1em 0.4em;
  color: var(--text-secondary);
  background: none;
  border-radius: 3px;
  transition: var(--transition);
  text-decoration: none;
}

sup a:hover {
  color: var(--text-primary);
  background: var(--link-hover-background, lavender);
  text-decoration: none;
}


aside {
  font-family: 'Noto Sans HK', sans-serif;
  font-weight: 300;
  font-size: var(--font-size-small);
  color: var(--text-secondary);
  padding: calc(var(--spacing-unit) * 0.5);
  margin: calc(var(--spacing-unit) * 0.5) 0;
  position: relative;
  max-width: 790px;
}

aside a {
  text-decoration: none;
  font-size: var(--font-size-small);
  color: var(--text-secondary);
  margin-right: 0.2em;
  padding: 0.1em 0.1em;
  border-radius: 0.75px;
  transition: var(--transition);
}

aside a:hover {
  color: var(--text-primary);
  background: var(--link-hover-background);
  text-decoration: none;
}

aside p {
  margin: 0;
}

.code {
  font-family: Consolas, monospace;
  font-size: var(--font-size-small);
  background: var(--code-background, darkgray);
  opacity: 0.5;
  padding: 2px 4px;
}

figure {
  text-align: center;
  margin: 0;
  display: inline-block;
  margin-right: calc(var(--spacing-unit) * 0.625);
}

figcaption {
  font-family: 'Noto Sans HK', sans-serif;
  font-weight: 300;
  font-size: var(--font-size-small);
  color: var(--text-secondary);
  margin-top: calc(var(--spacing-unit) * 0.00625);
}

.scroll-container {
  width: 100%;
  overflow-x: auto;
  white-space: nowrap;
  margin-bottom: calc(var(--spacing-unit) * 1);
}

.video-container {
  position: relative;
  width: 86%;
  height: 260px;
  margin: calc(var(--spacing-unit) * 0.00625) auto;
  border: 2px solid var(--misc-divider);
  padding: calc(var(--spacing-unit) * 0.00625);
  box-shadow: 0 0 1px var(--misc-divider);
}

iframe {
  width: 100%;
  height: 100%;
}

.main img {
  max-width: 100%;
  height: auto;
}

.main img[width],
.main img[height] {
  height: auto;
}

.highlight {
  color: #102b6a;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* Responsive */
@media screen and (max-width: 1100px) {
  header {
    display: flex;
    padding: env(safe-area-inset-top) calc(var(--spacing-unit) * 1) 0;
  }

  header li {
    list-style-type: none;
    margin: 0 15px;
  }

  nav {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    background: var(--nav-background);
    border-bottom: 1px solid var(--misc-divider);
    border-right: none;
    z-index: 1000;
    padding: calc(var(--spacing-unit) * 0.5) 0;
  }

  nav h2 {
    display: none;
  }

  nav ul.sidebar {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: calc(var(--spacing-unit) * 0.75);
    width: 100%;
    padding: calc(var(--spacing-unit) * 0.5) calc(var(--spacing-unit) * 1);
    margin: 0;
    flex-wrap: wrap;
  }

  nav ul.sidebar li {
    line-height: 1;
  }

  nav ul.sidebar li a {
    font-size: var(--font-size-small);
    padding: calc(var(--spacing-unit) * 0.45);
    white-space: nowrap;
  }

  .main {
    width: 90%;
    margin: calc(var(--spacing-unit) * 5) auto calc(var(--spacing-unit) * 2);
    padding: 0 calc(var(--spacing-unit) * 1);
  }
}

@media screen and (max-width: 600px) {
  :root {
    --font-size-base: 1.125rem;
    --font-size-medium: 1.5rem;
    --font-size-small: 0.875rem;
    --spacing-unit: 0.75rem;
  }

  html {
    font-size: 90%;
  }

  body {
    font-family: 'Times New Roman', 'Georgia', 'Palatino', 'Noto Sans HK', sans-serif;
    font-size: var(--font-size-base);
  }

  h1,
  .track-title {
    font-size: clamp(1rem, 5vw, var(--font-size-medium));
    margin-bottom: calc(var(--spacing-unit) * 1.5);
  }

  h2 {
    font-size: clamp(0.875rem, 4vw, 1.125rem);
    margin-top: calc(var(--spacing-unit) * 2);
    margin-bottom: calc(var(--spacing-unit) * 1.5);
  }

  h3,
  h4,
  h5,
  h6 {
    font-size: clamp(0.875rem, 3.5vw, 1rem);
  }

  header,
  .header-links {
    display: none;
  }

  .header-menu {
    display: block;
  }

  .header-logo {
    font-size: clamp(1rem, 4vw, 1.5rem);
  }

  .theme-toggle {
    font-size: var(--font-size-small);
    padding: calc(var(--spacing-unit) * 0.5);
    height: 40px;
  }

  nav ul.sidebar {
    gap: calc(var(--spacing-unit) * 0.35);
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
  }

  nav ul.sidebar li a {
    font-size: var(--font-size-small);
    padding: calc(var(--spacing-unit) * 0.45);
  }

  .main {
    width: 90%;
    margin: calc(var(--spacing-unit) * 4) auto calc(var(--spacing-unit) * 2);
    padding: 0 calc(var(--spacing-unit) * 1);
    font-size: var(--font-size-base);
  }

  .main p {
    line-height: var(--line-height-base);
    margin-bottom: calc(var(--spacing-unit) * 1.2);
  }

  .paperlist li {
    margin-bottom: calc(var(--spacing-unit) * 0.5);
  }

  .footer {
    font-size: var(--font-size-small);
    margin: calc(var(--spacing-unit) * 2) auto calc(var(--spacing-unit) * 1);
    padding: calc(var(--spacing-unit) * 0.75) calc(var(--spacing-unit) * 1) env(safe-area-inset-bottom);
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .footer-language {
    gap: calc(var(--spacing-unit) * 0.5);
  }

  .footer-language .theme-toggle {
    padding: calc(var(--spacing-unit) * 0.25);
  }

  .video-container {
    width: 100%;
    height: 200px;
    margin: calc(var(--spacing-unit) * 1) auto;
  }

  figure {
    margin-right: calc(var(--spacing-unit) * 0.5);
    max-width: 100%;
  }

  figcaption {
    font-size: var(--font-size-small);
    margin-top: calc(var(--spacing-unit) * 0.25);
  }

  blockquote {
    font-family: 'Times New Roman', 'Georgia', 'Palatino', 'Noto Sans HK', sans-serif;
    font-size: var(--font-size-small);
    padding: 0 calc(var(--spacing-unit) * 1);
    margin: calc(var(--spacing-unit) * 0.75) 0;
  }

  aside {
    font-size: var(--font-size-small);
    padding: calc(var(--spacing-unit) * 0.5);
    margin: calc(var(--spacing-unit) * 0.75) 0;
  }

  aside a {
    text-decoration: none;
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-right: 0.5em;
  }

  aside a:hover {
    color: var(--text-primary);
    background: var(--link-hover-background);
    border-radius: 2px;
  }

  .code {
    font-size: var(--font-size-small);
    padding: 2px 6px;
  }
}
/* Table Styling  */
table {
  width: 79%;
  max-width: 97%;
  border-collapse: collapse;
  margin: var(--spacing-unit) 0;
  background-color: var(--misc-background);
  font-size: var(--font-size-base);
  color: var(--text-primary);
  transition: var(--transition);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  table-layout: auto;
  margin-left: auto;
  margin-right: auto;
}

table thead {
  background-color: #e0e0e0;
  color: var(--text-primary);
  font-weight: 700;
  font-family: 'Noto Serif SC', serif;
  text-align: center;
}

html[data-theme="dark"] table thead {
  background-color: #2a2a2a;
  color: var(--text-primary-dark);
}

table th {
  padding: 0.5rem 0.75rem;
  /* 控制上下空间 */
  line-height: 0.75;
  /* 控制行内文本的行高 */
  vertical-align: middle;
  /* 垂直居中 */
}

table td {
  border: 1px solid var(--misc-divider);
  padding: 0.2rem 0.5rem;
  text-align: center;
  vertical-align: middle;
  line-height: var(--line-height-base);
}

table tbody tr:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.025);
}

html[data-theme="dark"] table tbody tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.025);
}

table tbody tr:hover {
  background-color: rgba(127, 127, 127, 0.1);
  transition: var(--transition);
}

html[data-theme="dark"] table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.scroll-container {
  overflow-x: auto;
  width: 100%;
}


/* site-enhancements:start */
html[data-theme="dark"] {
  --blockquote-background: #242832;
  --blockquote-text: #d8dee9;
  --blockquote-border: rgba(148, 163, 184, 0.46);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --nav-background: var(--nav-background-dark);
    --blockquote-background: #242832;
    --blockquote-text: #d8dee9;
    --blockquote-border: rgba(148, 163, 184, 0.46);
  }
}

html[data-theme="dark"] blockquote {
  color: var(--blockquote-text);
  border-left-color: var(--blockquote-border);
}

html[data-theme="dark"] blockquote span,
html[data-theme="dark"] blockquote a {
  color: var(--blockquote-text) !important;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) blockquote {
    color: var(--blockquote-text);
    border-left-color: var(--blockquote-border);
  }

  html:not([data-theme="light"]) blockquote span,
  html:not([data-theme="light"]) blockquote a {
    color: var(--blockquote-text) !important;
  }
}

.theme-toggle-item {
  display: flex;
  justify-content: center;
  line-height: 1;
}

.nav-tools {
  list-style: none;
  padding: 0;
  margin: calc(var(--spacing-unit) * 0.9) auto 0;
  width: min(9.8rem, 78%);
  border-top: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: calc(var(--spacing-unit) * 0.42) calc(var(--spacing-unit) * 0.52);
}

.nav-tools li {
  display: flex;
  justify-content: center;
}

.nav-tools a,
ul.nav-tools li.theme-toggle-item a.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--spacing-unit) * 0.28);
  height: auto;
  line-height: 1;
  padding: 0.14rem 0.18rem;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans HK', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.nav-tool-label-short {
  display: none;
}

.nav-tool-symbol {
  display: inline-block;
  font-size: 0.95rem;
  line-height: 0.75;
  opacity: 0.82;
  transform: translateY(-0.02rem);
}

.nav-tool-search-icon {
  position: relative;
  width: 0.72rem;
  height: 0.72rem;
  border: 1.35px solid currentColor;
  border-radius: 999px;
  opacity: 0.78;
}

.nav-tool-search-icon::after {
  content: '';
  position: absolute;
  right: -0.27rem;
  bottom: -0.13rem;
  width: 0.35rem;
  height: 1.35px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(45deg);
  transform-origin: left center;
}

.nav-tools a:hover,
ul.nav-tools li.theme-toggle-item a.theme-toggle:hover {
  background: transparent;
  color: var(--text-primary);
}

html[data-theme="dark"] .nav-tools {
  border-top-color: transparent;
}

html[data-theme="dark"] .nav-tools a,
html[data-theme="dark"] ul.nav-tools li.theme-toggle-item a.theme-toggle {
  color: rgba(255, 255, 255, 0.92);
}

html[data-theme="dark"] .nav-tools a:hover,
html[data-theme="dark"] ul.nav-tools li.theme-toggle-item a.theme-toggle:hover {
  background: transparent;
  color: #ffffff;
}

.theme-toggle-mark {
  position: relative;
  flex: 0 0 auto;
  width: 1.28rem;
  height: 0.68rem;
  border-radius: 999px;
  border: none;
  background: rgba(127, 127, 127, 0.22);
  opacity: 1;
  transition: var(--transition);
}

.theme-toggle-mark::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 0.11rem;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.16);
  transform: translateY(-50%);
  transition: var(--transition);
}

html[data-theme="dark"] .theme-toggle-mark {
  background: rgba(255, 255, 255, 0.22);
}

html[data-theme="dark"] .theme-toggle-mark::after {
  background: #ffffff;
  transform: translate(0.63rem, -50%);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .nav-tools {
    border-top-color: transparent;
  }

  html:not([data-theme="light"]) .nav-tools a,
  html:not([data-theme="light"]) ul.nav-tools li.theme-toggle-item a.theme-toggle {
    color: rgba(255, 255, 255, 0.92);
  }

  html:not([data-theme="light"]) .nav-tools a:hover,
  html:not([data-theme="light"]) ul.nav-tools li.theme-toggle-item a.theme-toggle:hover {
    background: transparent;
    color: #ffffff;
  }

  html:not([data-theme="light"]) .theme-toggle-mark {
    background: rgba(255, 255, 255, 0.22);
  }

  html:not([data-theme="light"]) .theme-toggle-mark::after {
    background: #ffffff;
    transform: translate(0.63rem, -50%);
  }
}

.theme-toggle-label {
  line-height: 1;
  transform: translateY(-0.01rem);
}

nav ul.sidebar {
  line-height: 1.6;
  text-align: center;
}

ul.sidebar li:not(.theme-toggle-item) {
  display: flex;
  justify-content: center;
  margin: 0.48rem 0;
}

ul.sidebar li:not(.theme-toggle-item) a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: auto;
  max-width: 100%;
  min-height: auto;
  line-height: 1.55;
  padding: 0.08rem 0.12rem 0.14rem;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Noto Sans HK', sans-serif;
  font-size: 1.08rem;
  font-weight: 400;
  letter-spacing: 0.08em;
}

@media screen and (min-width: 1101px) {
  body > nav:not(.post-nav) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  body > nav:not(.post-nav) h2 {
    position: absolute;
    top: calc(var(--spacing-unit) * 2.35);
    left: 0;
    right: 0;
    width: 100%;
    margin: 0;
    display: block;
    color: var(--text-secondary);
    font-family: Georgia, 'Times New Roman', 'Noto Serif SC', serif;
    font-size: 0.88rem;
    font-style: italic;
    font-weight: 400;
    letter-spacing: 0.035em;
    opacity: 0.68;
  }

  body > nav:not(.post-nav) h2::before,
  body > nav:not(.post-nav) h2::after {
    display: none;
  }

  body > nav:not(.post-nav) ul.sidebar {
    width: 100%;
    margin: 0;
    padding: 0;
    transform: translateY(-2vh);
  }

  body > nav:not(.post-nav) .nav-tools {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(var(--spacing-unit) * 3.2);
    margin: 0 auto;
  }
}

ul.sidebar li:not(.theme-toggle-item) a::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -0.02rem;
  width: 1.35rem;
  height: 1px;
  border-radius: 0;
  background: currentColor;
  opacity: 0;
  transform: translateX(-50%);
  transition: var(--transition);
}

ul.sidebar li:not(.theme-toggle-item) a:hover {
  color: var(--text-primary);
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

ul.sidebar li:not(.theme-toggle-item) a:hover::before,
ul.sidebar li:not(.theme-toggle-item) a[aria-current="page"]::before {
  opacity: 0.62;
}

ul.sidebar li:not(.theme-toggle-item) a[aria-current="page"] {
  color: var(--text-primary);
  background: transparent;
  border-color: transparent;
  font-weight: 400;
}

html[data-theme="dark"] ul.sidebar li:not(.theme-toggle-item) a {
  background: transparent;
}

html[data-theme="dark"] ul.sidebar li:not(.theme-toggle-item) a:hover {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

html[data-theme="dark"] ul.sidebar li:not(.theme-toggle-item) a[aria-current="page"] {
  background: transparent;
  border-color: transparent;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) ul.sidebar li:not(.theme-toggle-item) a {
    background: transparent;
  }

  html:not([data-theme="light"]) ul.sidebar li:not(.theme-toggle-item) a:hover {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
  }

  html:not([data-theme="light"]) ul.sidebar li:not(.theme-toggle-item) a[aria-current="page"] {
    background: transparent;
    border-color: transparent;
  }
}

@media screen and (max-width: 1100px) {
  body > nav:not(.post-nav) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: calc(var(--spacing-unit) * 0.8);
    overflow-x: hidden;
    overflow-y: hidden;
    padding: calc(var(--spacing-unit) * 0.55) calc(var(--spacing-unit) * 0.8);
    scrollbar-width: none;
  }

  body > nav:not(.post-nav)::-webkit-scrollbar {
    display: none;
  }

  body > nav:not(.post-nav) ul.sidebar {
    width: 100%;
    min-width: 0;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: calc(var(--spacing-unit) * 0.55);
    padding: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  body > nav:not(.post-nav) ul.sidebar::-webkit-scrollbar {
    display: none;
  }

  body > nav:not(.post-nav) ul.sidebar li:not(.theme-toggle-item) {
    flex: 0 0 auto;
    margin: 0;
  }

  body > nav:not(.post-nav) ul.sidebar li:not(.theme-toggle-item) a {
    width: auto;
    min-height: auto;
    padding: 0.18rem 0.14rem;
    background: transparent;
    box-shadow: none;
    font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans HK', sans-serif;
    font-size: var(--font-size-small);
    font-weight: 500;
    letter-spacing: 0.04em;
  }

  body > nav:not(.post-nav) .nav-tools a,
  body > nav:not(.post-nav) ul.nav-tools li.theme-toggle-item a.theme-toggle {
    font-size: var(--font-size-small);
  }

  body > nav:not(.post-nav) ul.sidebar li:not(.theme-toggle-item) a:hover {
    background: transparent;
    box-shadow: none;
  }

  body > nav:not(.post-nav) ul.sidebar li:not(.theme-toggle-item) a::before {
    display: none;
  }

  .nav-tools {
    border-top: none;
    margin: 0;
    padding: 0 0 0 calc(var(--spacing-unit) * 0.65);
    width: auto;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: calc(var(--spacing-unit) * 0.36);
    border-left: 1px solid rgba(127, 127, 127, 0.18);
  }

  body > nav:not(.post-nav) .nav-tool-symbol {
    font-size: var(--font-size-small);
    line-height: 1;
  }

  body > nav:not(.post-nav) .nav-tool-search-icon {
    width: 0.66rem;
    height: 0.66rem;
  }

  html[data-theme="dark"] .nav-tools {
    border-left-color: rgba(255, 255, 255, 0.16);
  }

  @media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) .nav-tools {
      border-left-color: rgba(255, 255, 255, 0.16);
    }
  }

  .nav-tool-label-full {
    display: none;
  }

  .nav-tool-label-short {
    display: inline;
  }

  .post-archive-head,
  .post-archive-next {
    width: 90%;
  }

  .post-archive-head {
    margin-bottom: calc(var(--spacing-unit) * 1.55);
  }

  .post-archive-head .post-summary {
    max-width: 100%;
    text-align: left;
  }
}

.recent-updates ul,
.tag-list,
.tag-posts,
.search-results {
  list-style: none;
  padding-left: 0;
}

.main .paperlist {
  margin-top: calc(var(--spacing-unit) * 0.45);
}

.main .paperlist li {
  line-height: 1.9;
  margin-bottom: calc(var(--spacing-unit) * 0.62);
}

.main .paperlist a {
  line-height: inherit;
}

.index-sections {
  position: static;
  display: grid;
  grid-template-columns: 1fr;
  gap: calc(var(--spacing-unit) * 0.15);
  width: 100%;
  height: auto;
  margin: calc(var(--spacing-unit) * 0.25) auto calc(var(--spacing-unit) * 2.2);
  padding: 0;
  border: none;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: auto;
  font-family: 'Noto Sans HK', sans-serif;
}

.index-section-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: calc(var(--spacing-unit) * 0.45);
  margin-bottom: calc(var(--spacing-unit) * 0.5);
}

.index-section-row a {
  border-bottom: none;
  color: var(--text-secondary);
  font-size: var(--font-size-small);
  padding: 0.08rem 0.48rem;
  border-radius: 999px;
}

.index-section-row a:hover,
.index-section-row a[aria-current="page"] {
  color: var(--text-primary);
  background: rgba(127, 127, 127, 0.08);
}

.index-years a {
  font-size: 0.82rem;
  opacity: 0.9;
}

.recent-updates li {
  margin: 0 0 calc(var(--spacing-unit) * 1.2);
}

.recent-updates li span {
  display: block;
  color: var(--text-secondary);
  font-family: 'Noto Sans HK', sans-serif;
  font-size: var(--font-size-small);
  line-height: 1.7;
  margin-top: calc(var(--spacing-unit) * 0.15);
}

.post-archive-head {
  width: min(79%, var(--main-content-width));
  margin: calc(var(--spacing-unit) * 0.65) auto calc(var(--spacing-unit) * 1.9);
  padding: calc(var(--spacing-unit) * 0.8) 0 calc(var(--spacing-unit) * 1.05);
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(to right, transparent, var(--misc-divider), transparent) 1;
  color: var(--text-secondary);
  text-align: center;
}

.post-kicker {
  color: var(--text-secondary);
  font-family: Georgia, 'Times New Roman', 'Noto Serif SC', serif;
  font-size: 0.76rem;
  font-style: italic;
  letter-spacing: 0.05em;
  line-height: 1.5;
  opacity: 0.78;
}

.post-info {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--spacing-unit) * 0.38) calc(var(--spacing-unit) * 0.58);
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-family: 'Noto Sans HK', sans-serif;
  font-size: var(--font-size-small);
  line-height: 1.7;
  margin-top: calc(var(--spacing-unit) * 0.35);
}

.post-info time {
  font-variant-numeric: tabular-nums;
}

.post-info-divider {
  color: var(--misc-divider);
}

.main .name + .post-archive-head {
  margin-top: calc(var(--spacing-unit) * 0.45);
}

.recent-updates li p,
.post-summary,
.search-results p {
  color: var(--text-secondary);
  font-family: 'Noto Sans HK', sans-serif;
  font-size: var(--font-size-small);
  line-height: 1.8;
  text-indent: 0;
  margin-top: calc(var(--spacing-unit) * 0.25);
}

.post-archive-head .post-summary {
  max-width: 34rem;
  margin: calc(var(--spacing-unit) * 0.7) auto 0;
  line-height: 1.9;
  text-align: left;
}

.search-box {
  display: grid;
  gap: calc(var(--spacing-unit) * 0.45);
  margin: 0 auto calc(var(--spacing-unit) * 1.5);
  max-width: 34rem;
  color: var(--text-secondary);
  font-family: 'Noto Sans HK', sans-serif;
  font-size: var(--font-size-small);
}

.search-box input {
  width: 100%;
  border: 1px solid rgba(127, 127, 127, 0.24);
  border-radius: 999px;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  padding: 0.62rem 0.9rem;
  outline: none;
}

.search-box input:focus {
  border-color: rgba(127, 127, 127, 0.52);
}

.search-results {
  max-width: 42rem;
  margin: 0 auto;
}

.search-results li {
  margin-bottom: calc(var(--spacing-unit) * 1.1);
}

.search-results span {
  display: block;
  color: var(--text-secondary);
  font-family: 'Noto Sans HK', sans-serif;
  font-size: var(--font-size-small);
  margin-top: calc(var(--spacing-unit) * 0.2);
}

.search-empty {
  color: var(--text-secondary);
  font-family: 'Noto Sans HK', sans-serif;
  text-align: center;
}

.post-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: calc(var(--spacing-unit) * 0.25);
  align-items: center;
  justify-content: center;
  margin-left: calc(var(--spacing-unit) * -0.2);
}

.post-tags a {
  border-bottom: 1px solid transparent;
  color: var(--text-secondary);
  padding: 0.02rem 0.08rem;
}

.post-tags a::before {
  content: '#';
  color: var(--misc-divider);
  margin-right: 0.05rem;
}

.post-tags a:hover {
  border-bottom-color: currentColor;
  color: var(--text-primary);
  background: transparent;
}

.tag-chip {
  border-bottom: none;
  border: 1px solid var(--misc-divider);
  border-radius: 999px;
  padding: 0.05rem 0.55rem;
}

.post-archive-next {
  width: min(79%, var(--main-content-width));
  margin: calc(var(--spacing-unit) * 4) auto calc(var(--spacing-unit) * 0.75);
  padding-top: calc(var(--spacing-unit) * 1.15);
  border-top: 1px solid transparent;
  border-image: linear-gradient(to right, transparent, var(--misc-divider), transparent) 1;
  text-align: center;
}

.post-archive-next-title {
  color: var(--text-secondary);
  font-family: Georgia, 'Times New Roman', 'Noto Serif SC', serif;
  font-size: 0.78rem;
  font-style: italic;
  letter-spacing: 0.05em;
  line-height: 1.5;
  opacity: 0.78;
}

.post-nav {
  position: static;
  width: 100%;
  height: auto;
  margin: calc(var(--spacing-unit) * 0.85) auto 0;
  padding: 0;
  border-top: none;
  border-image: none;
  border-right: none;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: calc(var(--spacing-unit) * 1);
  align-items: center;
  text-align: initial;
  z-index: auto;
  font-family: 'Noto Sans HK', sans-serif;
}

.post-nav-link,
.post-nav-index {
  border-bottom: none;
  color: var(--text-primary);
}

.post-nav-index {
  justify-self: center;
  color: var(--text-secondary);
  font-size: var(--font-size-small);
  padding: 0.15rem 0.85rem;
  border: 1px solid rgba(127, 127, 127, 0.22);
  border-radius: 999px;
}

.post-nav-index:hover {
  color: var(--text-primary);
  background: var(--link-hover-background, lavender);
}

.post-nav-link {
  display: inline-flex;
  flex-direction: column;
  gap: 0.1rem;
  width: fit-content;
  max-width: 100%;
  min-height: auto;
}

.post-nav-empty {
  visibility: hidden;
}

.post-nav-label {
  color: var(--text-secondary);
  font-size: var(--font-size-small);
}

.post-nav-title {
  width: fit-content;
  border-bottom: none;
  border-radius: 0.35rem;
  color: var(--text-primary);
  font-size: var(--font-size-small);
  font-weight: 400;
  line-height: 1.5;
  padding: 0.03rem 0.16rem;
  margin: 0 -0.16rem;
}

.post-nav-title:hover {
  background: var(--link-hover-background, lavender);
  color: var(--text-primary);
}

.post-nav-prev {
  justify-self: start;
}

.post-nav-next {
  justify-self: end;
  text-align: right;
}

.post-nav-next .post-nav-title {
  align-self: flex-end;
}

.tag-section {
  margin-bottom: calc(var(--spacing-unit) * 2);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--spacing-unit) * 0.5);
  justify-content: center;
}

.tag-posts li {
  margin-bottom: calc(var(--spacing-unit) * 0.35);
}

.not-found-actions {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--spacing-unit) * 0.75);
  justify-content: center;
}

@media screen and (max-width: 600px) {
  .nav-tools {
    border-top: none;
    margin: 0;
    padding: 0 0 0 calc(var(--spacing-unit) * 0.55);
    width: auto;
    flex: 0 0 auto;
    justify-content: flex-end;
    gap: calc(var(--spacing-unit) * 0.3);
  }

  .nav-tools a,
  ul.nav-tools li.theme-toggle-item a.theme-toggle {
    padding: 0.18rem 0.14rem;
    font-size: var(--font-size-small);
  }

  .theme-toggle-item {
    flex: 0 0 auto;
    margin-top: 0;
  }

  ul.sidebar li.theme-toggle-item a.theme-toggle {
    min-width: auto;
    padding: 0.28rem 0.62rem;
  }

  .index-sections {
    display: grid;
    grid-template-columns: 1fr;
    gap: calc(var(--spacing-unit) * 0.18);
  }

  .index-section-row {
    justify-content: center;
    margin-bottom: 0;
  }

  .index-years {
    margin-top: calc(var(--spacing-unit) * 0.08);
  }

  .post-nav {
    width: 96%;
    grid-template-columns: minmax(5.4em, 1fr) auto minmax(5.4em, 1fr);
    grid-template-areas: "prev index next";
    column-gap: calc(var(--spacing-unit) * 0.35);
    row-gap: 0;
    text-align: center;
    align-items: center;
  }

  .post-archive-next .post-nav {
    width: 100%;
  }

  .post-nav-prev {
    grid-area: prev;
    justify-self: start;
    text-align: left;
    min-width: 0;
  }

  .post-nav-index {
    grid-area: index;
    white-space: nowrap;
    padding: 0.08rem 0.42rem;
    font-size: 0.76rem;
  }

  .post-nav-next {
    grid-area: next;
    justify-self: end;
    text-align: right;
    min-width: 0;
  }

  .post-nav-title {
    display: block;
    width: 100%;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.78rem;
    line-height: 1.35;
  }

  .post-nav-label {
    font-size: 0.76rem;
    line-height: 1.4;
  }

  .post-nav-link {
    width: 5.4em;
  }
}

@media screen and (max-width: 360px) {
  .post-nav {
    column-gap: calc(var(--spacing-unit) * 0.2);
    grid-template-columns: minmax(4.8em, 1fr) auto minmax(4.8em, 1fr);
  }

  .post-nav-link {
    width: 4.8em;
  }

  .post-nav-index {
    padding-left: 0.32rem;
    padding-right: 0.32rem;
  }
}
/* site-enhancements:end */
