body {
  font-family: 'Noto Sans', sans-serif;
}

/* 自定义 HAODiff 艺术字字体 */
@font-face {
  font-family: 'HAODiffZapfino';
  src: url('../images/Zapfino.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* 顶部 Logo 区域（标题上方，与标题一起下移） */
.haodiff-topbar {
  margin-top: 0.5rem;
  margin-bottom: -2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.haodiff-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
}

.haodiff-logo-combined {
  max-width: min(40vw, 400px);
  height: auto;
  display: block;
}

.haodiff-logo-night {
  display: none;
}

body.dark-theme .haodiff-logo-day {
  display: none;
}

body.dark-theme .haodiff-logo-night {
  display: block;
}

/* Top hero particle canvas */
#hero-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.hero.has-particles {
  position: relative;
  overflow: hidden;
}

.hero.has-particles .hero-body,
.hero.has-particles .container {
  position: relative;
  z-index: 1;
}

/* 控制从页面顶部到 Logo+标题 的整体距离 */
.hero.has-particles .hero-body {
  padding-top: 0rem;  /* 想整体更靠下就调大这个值 */
}

/* 顶部 Logo+艺术字在移动端的适配，避免文字溢出 */
@media screen and (max-width: 768px) {
  .haodiff-topbar-inner {
    max-width: 95vw;
  }
}

/* 特别窄的手机上改为纵向布局，进一步防止溢出 */
@media screen and (max-width: 480px) {
  .haodiff-topbar-inner {
    flex-direction: column;
    align-items: center;
  }
}


.footer .icon-link {
  font-size: 25px;
  color: #000;
}

.link-block a {
  margin-top: 5px;
  margin-bottom: 5px;
}

.dnerf {
  font-variant: small-caps;
}


.teaser .hero-body {
  padding-top: 0;
  padding-bottom: 3rem;
}

.teaser {
  font-family: 'Google Sans', sans-serif;
}


.publication-title {}

.publication-banner {
  max-height: parent;

}

.publication-banner video {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  object-fit: fit;
}

.publication-header .hero-body {}

.publication-title {
  font-family: 'Google Sans', sans-serif;
}

.publication-authors {
  font-family: 'Google Sans', sans-serif;
}

.publication-venue {
  color: #555;
  width: fit-content;
  font-weight: bold;
}

.publication-awards {
  color: #ff3860;
  width: fit-content;
  font-weight: bolder;
}

.publication-authors {}

.publication-authors a {
  color: hsl(204, 86%, 53%) !important;
}

.publication-authors a:hover {
  text-decoration: underline;
}

.author-block {
  display: inline-block;
}

.publication-banner img {}

.publication-authors {
  /*color: #4286f4;*/
}

.publication-video {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;

  overflow: hidden;
  border-radius: 10px !important;
}

.publication-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.publication-body img {}

.results-carousel {
  overflow: hidden;
}

.results-carousel .item {
  margin: 5px;
  overflow: hidden;
  padding: 20px;
  font-size: 0;
}

.results-carousel video {
  margin: 0;
}

.slider-pagination .slider-page {
  background: #000000;
}

.eql-cntrb {
  font-size: smaller;
}

/* 添加平滑滚动 */
html {
  scroll-behavior: smooth;
}

/* 优化移动端显示 */
@media screen and (max-width: 768px) {
  .publication-title {
    font-size: 1.5rem !important;
  }
  
  .publication-authors {
    font-size: 0.9rem !important;
  }
}

/* Loading indicator样式 */
.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #3273dc;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  z-index: 9999;
}

/* 图片加载优化 */
img {
  loading: lazy;
}

#back-to-top {
  opacity: 0.7;
  transition: opacity 0.3s;
  cursor: pointer;
}

#back-to-top:hover {
  opacity: 1;
}

/* Abstract section 样式 */
.content p {
  line-height: 1.8;
  font-size: 1.1rem;
}

/* 在较小屏幕上调整 abstract 的宽度 */
@media screen and (max-width: 768px) {
  .section .column.is-four-fifths {
    padding: 0 1rem;
  }
  
  .content p {
    font-size: 1rem;
  }
}

/* 图片懒加载样式 */
img[data-src] {
  opacity: 0;
  transition: opacity 0.3s ease-in;
}

img.loaded {
  opacity: 1;
}

/* Image Comparer Styles */
.image-comparer {
  position: relative;
  width: 300px;
  height: 300px;
  overflow: hidden;
  border: 1px solid #ddd;
  margin: 0 auto;
  cursor: col-resize;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.image-comparer img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  border-radius: 8px;
}

.image-before {
  clip: rect(0, 150px, 300px, 0);
  z-index: 2;
}

.image-after {
  z-index: 1;
}

.slider-line {
  position: absolute;
  top: 0;
  left: 150px;
  width: 2px;
  height: 100%;
  background: white;
  box-shadow: 0 0 5px rgba(0,0,0,0.7);
  z-index: 10;
  cursor: col-resize;
}

.slider-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  background: white;
  border: 2px solid #333;
  border-radius: 50%;
  cursor: col-resize;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.labels {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  z-index: 10;
}

.label {
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 5px 10px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 500;
}

/* Hover effects */
.image-comparer:hover .slider-line {
  background: #007bff;
}

.image-comparer:hover .slider-button {
  border-color: #007bff;
  box-shadow: 0 2px 8px rgba(0,123,255,0.4);
}

/* Mobile responsiveness */
@media screen and (max-width: 768px) {
  .image-comparer {
    width: 100%;
    max-width: 280px;           /* 稍微缩一点 */
    height: 280px;              /* 保持正方形 */
    margin: 0 auto 0.5rem auto; /* 下方仍然留空白区域 */
  }
}

/* Light/Dark theme */
:root {
  --bg-color: #ffffff;
  --text-color: #222222;
  --section-light-bg: #f5f5f5;
  --accent-color: #3273dc;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
}

body.dark-theme {
  --bg-color: #0b1120;
  --text-color: #e5e7eb;
  --section-light-bg: #111827;
  --accent-color: #38bdf8;
}

body.dark-theme .hero,
body.dark-theme .section {
  background-color: var(--bg-color);
  color: var(--text-color);
}

body.dark-theme .hero.is-light,
body.dark-theme .section.hero.is-light {
  background-color: var(--section-light-bg);
}

body.dark-theme .title,
body.dark-theme .subtitle,
body.dark-theme .content {
  color: var(--text-color);
}

/* Ensure specific section titles (e.g., Human Body Restoration, Method) are light in dark mode */
body.dark-theme h2.title,
body.dark-theme h3.title,
body.dark-theme h1.title {
  color: var(--text-color) !important;
}

body.dark-theme .footer {
  background-color: #020617;
  color: var(--text-color);
}

body.dark-theme .button.is-primary,
body.dark-theme .button.is-link {
  background-color: var(--accent-color);
}

/* Theme toggle button */
#theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 200;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Scroll progress bar */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, #38bdf8, #a855f7);
  z-index: 150;
  transition: width 0.1s ease-out;
}

/* Image lightbox */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 120;
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
}

.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

.lightbox-image-wrapper {
  transform-origin: center center;
  transition: transform 0.1s ease-out;
  cursor: grab;
}

.lightbox-zoom-hint {
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  color: #e5e7eb;
  opacity: 0.7;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15,23,42,0.85);
  color: #f9fafb;
  border: none;
  border-radius: 999px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lightbox-close {
  top: 16px;
  right: 16px;
  transform: none;
}

.lightbox-prev {
  left: -52px;
}

.lightbox-next {
  right: -52px;
}

@media screen and (max-width: 768px) {
  .lightbox-prev {
    left: 8px;
  }

  .lightbox-next {
    right: 8px;
  }

  /* Hide zoom hint under very small screens to avoid overflow */
  .lightbox-zoom-hint {
    font-size: 12px;
    bottom: -22px;
  }
}

/* Cursor trail - tech line */
#cursor-trail {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 300;
}

#cursor-trail path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Dark theme fixes for texts and BibTeX block */
body.dark-theme .content p,
body.dark-theme .content li,
body.dark-theme .publication-authors,
body.dark-theme .publication-institutions {
  color: var(--text-color);
}

/* Ensure figure captions are light in dark mode */
body.dark-theme figure figcaption {
  color: var(--text-color) !important;
}

body.dark-theme pre,
body.dark-theme code {
  background-color: #020617 !important;
  color: #e5e7eb !important;
}

body.dark-theme #bibtex-block pre {
  background-color: #020617 !important;
}