/* ============================================
   Enhanced Academic Project Page Styles
   ============================================ */

/* Root Variables for Easy Theming */
:root {
  --primary-color: #2563eb;
  --primary-dark: #1e40af;
  --primary-light: #3b82f6;
  --secondary-color: #8b5cf6;
  --accent-color: #06b6d4;
  --text-dark: #1f2937;
  --text-light: #6b7280;
  --bg-light: #f9fafb;
  --bg-white: #ffffff;
  --border-color: #e5e7eb;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius: 12px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --text-dark: #f9fafb;
    --text-light: #d1d5db;
    --bg-light: #1f2937;
    --bg-white: #111827;
    --border-color: #374151;
  }
}

/* Global Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* ============================================
   Typography Enhancements
   ============================================ */

.title {
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.publication-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: -0.02em;
  animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.subtitle {
  color: var(--text-light);
  font-size: 1.1rem;
  line-height: 1.8;
  margin-top: 1rem;
}

/* ============================================
   Hero Section Enhancements
   ============================================ */

.hero {
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(37, 99, 235, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.hero-body {
  position: relative;
  z-index: 1;
  padding: 3rem 1.5rem;
}

/* ============================================
   Author Block Improvements
   ============================================ */

.publication-authors {
  margin-top: 1.5rem;
  animation: fadeIn 1s ease-out 0.2s both;
}

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

.author-block {
  display: inline-block;
  margin: 0.3rem 0.5rem;
  transition: var(--transition-base);
}

.author-block a {
  color: var(--text-dark);
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: var(--transition-base);
  position: relative;
}

.author-block a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  transition: var(--transition-base);
  transform: translateX(-50%);
}

.author-block a:hover {
  color: var(--primary-color);
  background: rgba(37, 99, 235, 0.05);
}

.author-block a:hover::after {
  width: 80%;
}

.eql-cntrb {
  display: block;
  margin-top: 0.5rem;
  color: var(--text-light);
  font-style: italic;
}

/* ============================================
   Button Enhancements
   ============================================ */

.publication-links {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  animation: fadeIn 1s ease-out 0.4s both;
}

.link-block .button {
  background: var(--bg-white);
  color: var(--text-dark);
  border: 2px solid var(--border-color);
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  transition: var(--transition-base);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.link-block .button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
  z-index: 0;
}

.link-block .button:hover::before {
  width: 300px;
  height: 300px;
}

.link-block .button:hover {
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.link-block .button .icon,
.link-block .button span {
  position: relative;
  z-index: 1;
}

.link-block .button .icon {
  margin-right: 0.5rem;
  transition: transform 0.3s ease;
}

.link-block .button:hover .icon {
  transform: scale(1.1);
}

/* ============================================
   Image and Figure Enhancements
   ============================================ */

figure {
  margin: 2rem auto;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  transition: var(--transition-base);
  background: var(--bg-white);
}

figure:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

figure img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.6s ease;
}

figure:hover img {
  transform: scale(1.02);
}

/* ============================================
   Carousel Enhancements
   ============================================ */

.carousel {
  margin: 2rem 0;
  position: relative;
}

.carousel .item {
  background: var(--bg-white);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  transition: var(--transition-base);
}

.carousel .item:hover {
  box-shadow: var(--shadow-xl);
}

.carousel .item img {
  border-radius: var(--border-radius);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
}

/* ============================================
   Section Styling
   ============================================ */

.section {
  padding: 4rem 1.5rem;
  position: relative;
}

.section.is-light {
  background: linear-gradient(180deg, var(--bg-light) 0%, rgba(249, 250, 251, 0.5) 100%);
}

.section .title {
  margin-bottom: 2rem;
  position: relative;
  display: inline-block;
}

.section .title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 2px;
}

.has-text-centered .title::after {
  left: 50%;
  transform: translateX(-50%);
}

/* ============================================
   Content Enhancements
   ============================================ */

.content.has-text-justified {
  text-align: justify;
  hyphens: auto;
}

.content p {
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-dark);
}

.content p:first-letter {
  font-size: 1.5em;
  font-weight: 700;
  color: var(--primary-color);
}

/* ============================================
   Scroll to Top Button
   ============================================ */

.scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-base);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.scroll-to-top i {
  font-size: 1.2rem;
}

/* ============================================
   More Works Dropdown Enhancement
   ============================================ */

.more-works-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 999;
}

.more-works-btn {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  transition: var(--transition-base);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.more-works-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.more-works-btn .dropdown-arrow {
  transition: transform 0.3s ease;
}

.more-works-btn.active .dropdown-arrow {
  transform: rotate(180deg);
}

.more-works-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--bg-white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-xl);
  min-width: 400px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: var(--transition-base);
}

.more-works-dropdown.active {
  max-height: 600px;
  opacity: 1;
}

.dropdown-header {
  padding: 1.5rem;
  border-bottom: 2px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(139, 92, 246, 0.05));
}

.dropdown-header h4 {
  margin: 0;
  font-weight: 700;
  color: var(--text-dark);
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 0.5rem;
  transition: var(--transition-base);
  border-radius: 6px;
}

.close-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-dark);
}

.works-list {
  padding: 1rem;
  max-height: 400px;
  overflow-y: auto;
}

.work-item {
  display: flex;
  justify-content: space-between;
  align-items: start;
  padding: 1.25rem;
  margin-bottom: 0.75rem;
  border-radius: var(--border-radius);
  border: 2px solid var(--border-color);
  text-decoration: none;
  color: var(--text-dark);
  transition: var(--transition-base);
  background: var(--bg-white);
}

.work-item:hover {
  border-color: var(--primary-color);
  background: rgba(37, 99, 235, 0.02);
  transform: translateX(5px);
  box-shadow: var(--shadow-md);
}

.work-item:last-child {
  margin-bottom: 0;
}

.work-info h5 {
  margin: 0 0 0.5rem 0;
  font-weight: 700;
  color: var(--primary-color);
  font-size: 1.1rem;
}

.work-info p {
  margin: 0 0 0.5rem 0;
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.5;
}

.work-venue {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.work-item i {
  color: var(--primary-color);
  transition: var(--transition-base);
}

.work-item:hover i {
  transform: translateX(5px);
}

/* ============================================
   BibTeX Section Enhancement
   ============================================ */

#BibTeX {
  background: linear-gradient(180deg, var(--bg-light) 0%, var(--bg-white) 100%);
}

.bibtex-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.copy-bibtex-btn {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition-base);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-md);
}

.copy-bibtex-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.copy-bibtex-btn.copied {
  background: linear-gradient(135deg, #10b981, #059669);
}

#bibtex-code {
  background: var(--text-dark);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow-x: auto;
}

#bibtex-code code {
  color: #e5e7eb;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ============================================
   Responsive Design
   ============================================ */

@media screen and (max-width: 1024px) {
  .more-works-dropdown {
    min-width: 350px;
  }
  
  .publication-title {
    font-size: 2.5rem;
  }
}

@media screen and (max-width: 768px) {
  .hero-body {
    padding: 2rem 1rem;
  }
  
  .publication-title {
    font-size: 2rem;
  }
  
  .more-works-container {
    top: 10px;
    right: 10px;
  }
  
  .more-works-dropdown {
    min-width: calc(100vw - 40px);
    right: -10px;
  }
  
  .scroll-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
  }
  
  .publication-links {
    flex-direction: column;
    align-items: stretch;
  }
  
  .link-block {
    width: 100%;
  }
  
  .link-block .button {
    width: 100%;
    justify-content: center;
  }
  
  .section {
    padding: 3rem 1rem;
  }
  
  .carousel .item {
    padding: 1.5rem;
  }
}

/* ============================================
   Loading Animation
   ============================================ */

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.loading {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ============================================
   Accessibility Improvements
   ============================================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

*:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
  .scroll-to-top,
  .more-works-container,
  .publication-links {
    display: none;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .hero::before {
    display: none;
  }
}
/* ============================================
   Academic Figure Layout (Matplotlib-style)
   ============================================ */

.result-group {
  background: var(--bg-white);
  border-radius: var(--border-radius);
  padding: 2.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-lg);
  transition: var(--transition-base);
}

.result-group:hover {
  box-shadow: var(--shadow-xl);
}

/* 双子图布局 (类似 plt.subplot(1, 2)) */
.dual-figures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.figure-column {
  display: flex;
  flex-direction: column;
}

.figure-column figure {
  background: var(--bg-light);
  border-radius: 8px;
  padding: 1rem;
  margin: 0;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-base);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.figure-column figure:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.figure-column figure img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  flex-grow: 1;
  object-fit: contain;
}

/* 图注样式 (类似学术论文) */
figcaption {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-light);
  margin-top: 0.75rem;
  font-weight: 600;
  font-style: italic;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}

/* 单图布局 */
.single-figure {
  margin-bottom: 1.5rem;
}

.single-figure figure {
  background: var(--bg-light);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 0 auto;
  max-width: 90%;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-base);
}

.single-figure figure:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.single-figure figure img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

/* 图表描述 (类似论文 caption) */
.figure-description {
  padding: 1.5rem;
  background: linear-gradient(to bottom, rgba(249, 250, 251, 0.5), transparent);
  border-left: 4px solid var(--primary-color);
  border-radius: 4px;
}

.figure-description .subtitle {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-dark);
  margin: 0;
}

.figure-description .subtitle strong {
  color: var(--primary-color);
  font-weight: 700;
  display: block;
  margin-bottom: 0.5rem;
}

/* 响应式设计 */
@media screen and (max-width: 1024px) {
  .dual-figures {
    gap: 1.5rem;
  }
  
  .result-group {
    padding: 2rem;
  }
}

@media screen and (max-width: 768px) {
  /* 在移动端堆叠显示 */
  .dual-figures {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .result-group {
    padding: 1.5rem;
  }
  
  .single-figure figure {
    max-width: 100%;
    padding: 1rem;
  }
  
  .figure-description {
    padding: 1rem;
  }
  
  .figure-description .subtitle {
    font-size: 0.9rem;
  }
}

/* 图片缩放效果（可选） */
.figure-column figure img,
.single-figure figure img {
  cursor: zoom-in;
  transition: transform 0.3s ease;
}

/* 添加图片点击放大功能 */
.image-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  cursor: zoom-out;
}

.image-modal img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

.image-modal.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

/* 图片编号样式 */
.dual-figures .figure-column:first-child figcaption::before {
  content: "(a) ";
  font-weight: 700;
  color: var(--primary-color);
}

.dual-figures .figure-column:last-child figcaption::before {
  content: "(b) ";
  font-weight: 700;
  color: var(--primary-color);
}

/* 确保图片等高 */
.dual-figures {
  align-items: stretch;
}

.figure-column figure {
  display: flex;
  flex-direction: column;
}

.figure-column figure img {
  flex: 1;
  object-fit: contain;
}