/* Modern CSS Variables for consistent theming */
:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary-color: #64748b;
  --accent-color: #0ea5e9;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --background-primary: #ffffff;
  --background-secondary: #f8fafc;
  --background-accent: #f1f5f9;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-accent: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-subtle: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  --border-radius: 12px;
  --border-radius-lg: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Smooth scrolling for better UX */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px;
  background-color: var(--background-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


/* Modern Button Styles */
.button {
  border-radius: var(--border-radius) !important;
  font-weight: 600 !important;
  transition: var(--transition) !important;
  border: 2px solid transparent !important;
  position: relative;
  overflow: hidden;
}

.button.is-dark {
  background: var(--text-primary) !important;
  border: none !important;
  color: white !important;
  box-shadow: var(--shadow-md);
}

.button.is-dark:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: var(--primary-color) !important;
}

.button.is-dark:active {
  transform: translateY(0);
  box-shadow: var(--shadow-md);
}

.footer .icon-link {
    font-size: 25px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.footer .icon-link:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.link-block a {
    margin: 8px 4px;
}

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


/* Hero Section Modernization */
.hero {
  position: relative;
  overflow: hidden;
}

.hero.is-light {
  background: var(--background-secondary);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.hero-body {
  padding: 4rem 1.5rem;
}

.teaser .hero-body {
  padding-top: 2rem;
  padding-bottom: 4rem;
}

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


/* Publication Content Styling */
.publication-title {
    font-family: 'Inter', sans-serif !important;
    font-weight: 800 !important;
    color: var(--text-primary) !important;
    margin-bottom: 2rem !important;
    line-height: 1.1 !important;
}

.publication-banner {
  max-height: 70vh;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  margin: 2rem 0;
}

.publication-banner video {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  object-fit: cover;
  width: 100%;
  height: 100%;
  border-radius: var(--border-radius-lg);
}

.publication-header .hero-body {
  padding: 6rem 1.5rem 4rem;
}

.publication-authors {
    font-family: 'Inter', sans-serif !important;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.publication-venue {
    color: var(--text-secondary);
    width: fit-content;
    font-weight: 600;
    background: var(--background-accent);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
    display: inline-block;
}

.publication-awards {
    color: #ef4444;
    width: fit-content;
    font-weight: 700;
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    border-left: 4px solid #ef4444;
    margin-top: 1rem;
}

.publication-authors a {
   color: var(--primary-color) !important;
   text-decoration: none;
   font-weight: 600;
   transition: var(--transition);
   position: relative;
}

.publication-authors a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background: var(--gradient-accent);
    transition: var(--transition);
}

.publication-authors a:hover::after {
    width: 100%;
}

.publication-authors a:hover {
    color: var(--primary-hover) !important;
}

.author-block {
  display: inline-block;
  margin-right: 0.5rem;
}

.publication-banner img {
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}

.publication-banner img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-xl);
}

/* Modern Video and Carousel Styling */
.publication-video {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
    overflow: hidden;
    border-radius: var(--border-radius-lg) !important;
    box-shadow: var(--shadow-xl);
    transition: var(--transition);
}

.publication-video:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.publication-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--border-radius-lg);
}

.publication-body img {
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.publication-body img:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.results-carousel {
  overflow: hidden;
  padding: 1rem 0;
}

.results-carousel .item {
  margin: 1rem;
  overflow: hidden;
  padding: 1.5rem;
  font-size: 0;
  background: var(--background-primary);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.results-carousel .item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.results-carousel .item img,
.results-carousel video {
  margin: 0;
  border-radius: var(--border-radius);
  width: 100%;
  height: auto;
}

.results-carousel .subtitle {
  font-size: 1rem !important;
  color: var(--text-secondary);
  margin-top: 1rem;
  font-weight: 500;
}

/* Pagination and Misc Improvements */
.slider-pagination .slider-page {
  background: var(--primary-color);
  border-radius: 50%;
  transition: var(--transition);
}

.slider-pagination .slider-page.is-active {
  background: var(--primary-hover);
  transform: scale(1.2);
}

.eql-cntrb { 
  font-size: 0.875rem;
  color: var(--text-light);
  font-style: italic;
}

/* Section Titles */
.title.is-3 {
  font-family: 'Inter', sans-serif !important;
  font-weight: 700 !important;
  color: var(--text-primary);
  margin-bottom: 2rem !important;
  position: relative;
  padding-bottom: 1rem;
}

.title.is-3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--gradient-accent);
  border-radius: 2px;
}

/* Content Improvements */
.content.has-text-justified {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.content.has-text-justified p {
  margin-bottom: 1.5rem;
}

/* Footer Improvements */
.footer {
  background: var(--background-secondary);
  border-top: 1px solid var(--border-color);
  padding: 3rem 1.5rem;
}

.footer .content {
  color: var(--text-secondary);
  line-height: 1.7;
}

.footer a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

.footer a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* BibTeX Styling */
pre {
  background: var(--background-accent) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--border-radius) !important;
  padding: 1.5rem !important;
  font-size: 0.9rem !important;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

code {
  background: var(--background-accent) !important;
  color: var(--text-primary) !important;
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace !important;
}

/* BibTeX Section Improvements */
.bibtex-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.copy-bibtex-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

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

.copy-bibtex-btn.copied {
  background: #10b981;
}

.copy-bibtex-btn.copied .copy-text::after {
  content: "ied!";
}

/* Scroll to Top Button */
.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-lg);
}

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

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


/* More Works Dropdown */
.more-works-container {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 1000;
}

.more-works-btn {
  background: var(--background-primary);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Inter', sans-serif;
}

.more-works-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: var(--background-secondary);
  border-color: var(--primary-color);
}

.more-works-btn .dropdown-arrow {
  transition: var(--transition);
  font-size: 0.8rem;
}

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

.more-works-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 400px;
  max-width: 90vw;
  background: var(--background-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: var(--transition);
  max-height: 70vh;
  overflow-y: auto;
}

.more-works-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.dropdown-header h4 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

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

.close-btn:hover {
  background: var(--background-accent);
  color: var(--text-primary);
}

.works-list {
  padding: 1rem;
}

.work-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1rem;
  border-radius: var(--border-radius);
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
  margin-bottom: 0.5rem;
}

.work-item:hover {
  background: var(--background-accent);
  transform: translateX(4px);
}

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

.work-info p {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.work-venue {
  font-size: 0.8rem;
  color: var(--text-light);
  font-style: italic;
}

.work-item .fas {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-top: 0.2rem;
  flex-shrink: 0;
}


/* Mobile Responsive Improvements */
@media screen and (max-width: 768px) {
  .hero-body {
    padding: 2rem 1rem;
  }
  
  .publication-header .hero-body {
    padding: 3rem 1rem 2rem;
  }
  
  .publication-title {
    font-size: 2.5rem !important;
    line-height: 1.2 !important;
    margin-bottom: 1.5rem !important;
  }
  
  .publication-authors {
    font-size: 1rem !important;
  }
  
  .button {
    margin: 0.25rem !important;
    font-size: 0.875rem !important;
    padding: 0.75rem 1rem !important;
  }
  
  .more-works-container {
    bottom: 2rem;
    right: 1rem;
    top: auto;
  }
  
  .more-works-btn {
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
  }
  
  .more-works-dropdown {
    width: calc(100vw - 2rem);
    right: -1rem;
    bottom: calc(100% + 0.5rem);
    top: auto;
  }
  
  .results-carousel .item {
    margin: 0.5rem;
    padding: 1rem;
  }
  
  .teaser .hero-body {
    padding: 1rem;
  }
  
  .content.has-text-justified {
    font-size: 1rem;
  }
}

@media screen and (max-width: 480px) {
  .publication-title {
    font-size: 2rem !important;
  }
  
  .hero-body {
    padding: 1.5rem 0.75rem;
  }
  
  .more-works-container {
    position: fixed;
    bottom: 2rem;
    right: 1rem;
    z-index: 1000;
  }
  
  .more-works-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
  }
  
  .more-works-dropdown {
    position: absolute;
    bottom: calc(100% + 0.5rem);
    right: 0;
    width: calc(100vw - 2rem);
    max-width: 90vw;
  }
  
  .link-block {
    display: block;
    margin-bottom: 0.5rem;
  }
  
  .button {
    width: 100%;
    justify-content: center;
  }
}

/* Tablet Responsive */
@media screen and (min-width: 769px) and (max-width: 1024px) {
  .hero-body {
    padding: 3rem 2rem;
  }
  
  .publication-header .hero-body {
    padding: 4rem 2rem 3rem;
  }
}

/* Animation for page load */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero, .section {
  animation: fadeInUp 0.6s ease-out;
}

/* Improved focus states for accessibility */
.button:focus,
.related-works-btn:focus,
a:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}


/* Print styles */
@media print {
  .more-works-container {
    display: none;
  }
  
  .hero, .section {
    animation: none;
  }
  
  .button {
    background: transparent !important;
    color: var(--text-primary) !important;
    box-shadow: none !important;
  }
}

/* TerraScope project-page customisation */
:root {
  --primary-color: #0b4f9c;
  --primary-hover: #073b77;
  --secondary-color: #5f6d7a;
  --accent-color: #c91f2c;
  --text-primary: #172334;
  --text-secondary: #586779;
  --text-light: #8491a0;
  --background-primary: #ffffff;
  --background-secondary: #f6f8fb;
  --background-accent: #edf3fa;
  --border-color: #dce3eb;
  --shadow-sm: 0 1px 2px rgb(23 35 52 / 0.06);
  --shadow-md: 0 8px 24px rgb(23 35 52 / 0.08);
  --shadow-lg: 0 16px 38px rgb(23 35 52 / 0.11);
  --shadow-xl: 0 24px 60px rgb(23 35 52 / 0.14);
  --gradient-primary: none;
  --gradient-accent: none;
  --gradient-subtle: none;
  --border-radius: 10px;
  --border-radius-lg: 16px;
}

body {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif;
  letter-spacing: -0.005em;
}

.publication-header {
  background:
    linear-gradient(180deg, rgb(237 243 250 / 0.72), rgb(255 255 255 / 0) 72%),
    var(--background-primary);
  border-top: 4px solid var(--primary-color);
}

.publication-header .hero-body {
  padding: 4.5rem 1.5rem 2.8rem;
}

.brand-lockup {
  align-items: center;
  display: inline-flex;
  gap: 1.2rem;
  justify-content: center;
  margin-bottom: 1.7rem;
}

.brand-mark {
  background: transparent;
  display: block;
  height: 82px;
  object-fit: contain;
}

.brand-mark-terrascope {
  width: 112px;
}

.brand-mark-sjtu {
  width: 82px;
}

.brand-divider {
  background: var(--border-color);
  display: block;
  height: 54px;
  width: 1px;
}

.project-kicker {
  color: var(--primary-color);
  font-size: 0.9rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  margin: 0 0 0.9rem;
  text-transform: uppercase;
}

.publication-title {
  font-size: clamp(2.35rem, 4.1vw, 3.25rem) !important;
  letter-spacing: -0.045em !important;
  line-height: 1.08 !important;
  margin: 0 auto 1.7rem !important;
  max-width: 100%;
  white-space: nowrap;
}

.publication-authors {
  margin-bottom: 0.45rem;
}

.publication-authors a,
.publication-authors a:hover {
  color: var(--primary-color) !important;
}

.publication-authors a::after {
  background: var(--accent-color);
}

.publication-affiliation {
  color: var(--text-secondary);
  font-size: 1rem !important;
  font-weight: 500;
  margin: 0.25rem 0 1.45rem;
}

.publication-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: center;
}

.link-block a {
  margin: 0;
}

.button {
  border-radius: 999px !important;
  font-size: 0.92rem;
  letter-spacing: 0;
}

.button.is-dark {
  background: var(--text-primary) !important;
}

.button.is-dark:hover {
  background: var(--primary-color) !important;
}

.resource-button {
  background: #fff !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
}

.resource-button:hover {
  border-color: var(--primary-color) !important;
  color: var(--primary-color) !important;
  transform: translateY(-2px);
}

.teaser .hero-body {
  padding-top: 1.2rem;
}

.teaser-figure {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  margin: 0 auto 1.6rem;
  max-width: 780px;
  overflow: hidden;
}

.teaser-figure img {
  display: block;
  width: 100%;
}

.teaser-figure img:hover {
  transform: none;
}

.teaser-caption {
  color: var(--text-secondary) !important;
  font-size: 1.1rem !important;
  line-height: 1.65;
  margin: 0 auto;
  max-width: 780px;
}

.section .title.is-3 {
  color: var(--text-primary);
  font-size: 2rem;
  letter-spacing: -0.035em;
  margin-bottom: 1.25rem;
}

.abstract-copy {
  color: #344255;
  font-size: 1.06rem;
  line-height: 1.82;
}

.section-lead {
  color: var(--text-secondary);
  line-height: 1.65;
  margin: -0.45rem auto 2rem;
  max-width: 760px;
}

.contribution-list {
  border-top: 1px solid var(--border-color);
  list-style: none;
  margin: 2rem auto 0;
  max-width: 920px;
  padding: 0;
}

.contribution-list li {
  align-items: flex-start;
  border-bottom: 1px solid var(--border-color);
  color: #344255;
  display: grid;
  font-size: 1.02rem;
  gap: 1.4rem;
  grid-template-columns: 48px 1fr;
  line-height: 1.68;
  padding: 1.25rem 0;
}

.contribution-number {
  color: var(--accent-color);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding-top: 0.25rem;
}

.system-figure {
  margin: 0 auto;
  max-width: 1050px;
}

.top-nav {
  backdrop-filter: blur(14px);
  background: rgb(255 255 255 / 0.92);
  border-bottom: 1px solid rgb(210 221 234 / 0.88);
  position: sticky;
  top: 0;
  z-index: 40;
}

.top-nav-inner {
  align-items: center;
  display: flex;
  height: 56px;
  justify-content: flex-end;
  margin: 0 auto;
  max-width: 1280px;
  padding: 0 1.5rem;
}

.top-nav-links {
  align-items: center;
  display: flex;
  gap: 0.2rem;
}

.top-nav-links a {
  border-radius: 7px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 0.52rem 0.72rem;
  transition: background-color 160ms ease, color 160ms ease;
  white-space: nowrap;
}

.top-nav-links a:hover,
.top-nav-links a:focus-visible {
  background: var(--background-accent);
  color: var(--primary-color);
  outline: none;
}

main section[id] {
  scroll-margin-top: 72px;
}

.system-figure a {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  display: block;
  overflow: hidden;
}

.system-figure img {
  display: block;
  width: 100%;
}

.system-figure figcaption {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0.9rem auto 0;
  max-width: 920px;
  text-align: center;
}

.result-grid {
  display: grid;
  gap: 1rem;
  margin: 1.7rem auto 0;
  max-width: 1120px;
}

.result-grid-grounding {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.result-grid-reasoning,
.change-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.result-grid-reasoning,
.change-grid {
  display: grid;
  gap: 1rem;
  margin: 1rem auto 0;
  max-width: 1120px;
}

.result-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  overflow: hidden;
  padding: 0.78rem;
}

.result-card-header {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin-bottom: 0.62rem;
}

.result-task {
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 750;
}

.result-source {
  color: var(--text-secondary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.64rem;
  white-space: nowrap;
}

.annotated-image {
  background: #eef2f6;
  border-radius: 7px;
  overflow: hidden;
  position: relative;
}

.annotated-image img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.annotated-image-landscape {
  aspect-ratio: 3 / 2;
}

.annotated-image-square {
  aspect-ratio: 1;
  margin-left: auto;
  margin-right: auto;
  max-width: 430px;
}

.annotated-image-square img {
  object-fit: contain;
}

.annotated-image svg {
  inset: 0;
  position: absolute;
  width: 100%;
  height: 100%;
}

.annotated-image rect {
  fill: none;
  vector-effect: non-scaling-stroke;
}

.bbox-prediction {
  stroke: #1686f2;
  stroke-width: 3px;
}

.bbox-reference {
  stroke: #30b96f;
  stroke-dasharray: 8 6;
  stroke-width: 3px;
}

.bbox-reference-exact {
  stroke-width: 5px;
}

.bbox-prediction-exact {
  stroke-width: 2px;
}

.bbox-legend {
  align-items: center;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.68rem;
  gap: 0.55rem;
  margin: 0.55rem 0;
}

.bbox-legend > span {
  align-items: center;
  display: inline-flex;
  gap: 0.35rem;
}

.legend-line {
  display: inline-block;
  height: 0;
  width: 17px;
}

.legend-prediction {
  border-top: 3px solid #1686f2;
}

.legend-reference {
  border-top: 3px dashed #30b96f;
}

.metric-chip {
  background: var(--background-accent);
  border-radius: 999px;
  color: var(--primary-color);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  margin-left: auto;
  padding: 0.2rem 0.44rem;
}

.result-prompt {
  color: #3d4c5f;
  font-size: 0.82rem;
  line-height: 1.48;
  margin: 0.52rem 0 0;
}

.result-image {
  aspect-ratio: 16 / 10;
  background: #eef2f6;
  border-radius: 7px;
  display: block;
  object-fit: cover;
  width: 100%;
}

.result-image-wide {
  object-position: center;
}

.result-answer {
  border-left: 3px solid var(--primary-color);
  margin-top: 0.68rem;
  padding: 0.05rem 0 0.05rem 0.7rem;
}

.result-answer p {
  color: #344255;
  font-size: 0.82rem;
  line-height: 1.48;
  margin: 0.18rem 0 0;
}

.result-answer-compact p {
  font-size: 0.94rem;
}

.answer-label {
  color: var(--primary-color);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

@media screen and (min-width: 769px) and (max-width: 1024px) {
  .result-grid-grounding,
  .demo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.result-card-route {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.45fr) minmax(290px, 0.9fr);
  margin: 1rem auto 0;
  max-width: 1120px;
  padding: 0.78rem;
}

.route-visual {
  border-radius: 7px;
  max-height: 330px;
  overflow: hidden;
}

.route-visual img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.route-copy {
  align-self: center;
  padding: 0.5rem 0.5rem 0.5rem 0;
}

.result-card-quantity {
  display: block;
  margin: 0;
  max-width: none;
  padding: 0.78rem;
}

.quantity-visual {
  background: #eef2f6;
  border-radius: 7px;
  overflow: hidden;
}

.quantity-visual img {
  aspect-ratio: 3 / 2;
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.quantity-copy {
  padding: 0.68rem 0 0;
}

.quantity-copy h3 {
  color: var(--text-primary);
  font-size: 1.08rem;
  font-weight: 760;
  line-height: 1.25;
  margin: 0.1rem 0 0.38rem;
}

.quantity-metrics {
  border-bottom: 1px solid var(--border-color);
  border-top: 1px solid var(--border-color);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0.68rem 0 0;
}

.quantity-metrics > div {
  padding: 0.62rem 0;
}

.quantity-metrics > div + div {
  border-left: 1px solid var(--border-color);
  padding-left: 1.2rem;
}

.quantity-metrics dt {
  color: var(--text-secondary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.quantity-metrics dd {
  color: var(--primary-color);
  font-size: 2rem;
  font-weight: 780;
  letter-spacing: -0.05em;
  line-height: 1;
  margin: 0.28rem 0 0;
}

.quantity-verdict {
  align-items: center;
  color: var(--text-secondary);
  display: flex;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.73rem;
  justify-content: flex-start;
  margin-top: 0.58rem;
}

.quantity-verdict span:first-child {
  color: #177a4c;
  font-weight: 750;
}

.quantity-verdict i {
  margin-right: 0.35rem;
}

.change-pair {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.change-pair figure {
  margin: 0;
  position: relative;
}

.change-pair img {
  aspect-ratio: 1;
  border-radius: 7px;
  display: block;
  image-rendering: auto;
  width: 100%;
}

.change-pair figcaption {
  background: rgb(17 28 43 / 0.78);
  border-radius: 5px;
  bottom: 0.45rem;
  color: #fff;
  font-size: 0.7rem;
  left: 0.45rem;
  padding: 0.18rem 0.42rem;
  position: absolute;
}

.demo-grid {
  display: grid;
  gap: 1.35rem 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 1.7rem auto 0;
  max-width: 1160px;
}

.demo-item {
  margin: 0;
  min-width: 0;
}

.demo-item img {
  aspect-ratio: 2940 / 1672;
  background: #f6f8fb;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  display: block;
  object-fit: cover;
  width: 100%;
}

.demo-item > a {
  display: block;
}

.demo-item figcaption {
  display: grid;
  gap: 0.28rem;
  padding: 0.62rem 0.1rem 0;
}

.demo-item figcaption strong {
  color: var(--text-primary);
  font-size: 0.92rem;
}

.demo-item figcaption span {
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.45;
}

body.modal-open {
  overflow: hidden;
}

.release-modal {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 1.25rem;
  position: fixed;
  z-index: 80;
}

.release-modal[hidden] {
  display: none;
}

.release-modal-backdrop {
  background: rgb(20 35 54 / 0.34);
  inset: 0;
  position: absolute;
}

.release-modal-card {
  background: #fff;
  border: 1px solid #d5e2f0;
  border-radius: 14px;
  box-shadow: 0 24px 70px rgb(29 62 101 / 0.2);
  max-width: 430px;
  padding: 1.6rem;
  position: relative;
  width: 100%;
}

.release-modal-close {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  height: 34px;
  justify-content: center;
  position: absolute;
  right: 0.9rem;
  top: 0.9rem;
  width: 34px;
}

.release-modal-close:hover {
  background: var(--background-accent);
  color: var(--primary-color);
}

.release-modal-label {
  color: var(--primary-color);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.release-modal-card h2 {
  color: var(--text-primary);
  font-size: 1.35rem;
  font-weight: 760;
  margin: 0.55rem 0 0.45rem;
}

.release-modal-card > p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0;
}

.release-code-row {
  align-items: center;
  background: var(--background-accent);
  border: 1px solid #d5e2f0;
  border-radius: 9px;
  display: flex;
  justify-content: space-between;
  margin-top: 1.15rem;
  padding: 0.72rem 0.8rem;
}

.release-code-row code {
  background: transparent !important;
  color: var(--primary-color) !important;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.release-code-row button {
  background: transparent;
  border: 0;
  color: var(--primary-color);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 750;
  padding: 0.25rem;
}

.release-modal-actions {
  display: flex;
  gap: 0.65rem;
  justify-content: flex-end;
  margin-top: 1.2rem;
}

.model-stage-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 1.7rem auto 0;
}

/* Precision method figures inherit the existing project-page palette. */
.precision-figure {
  margin: 1.8rem 0 0;
}

.precision-figure > a {
  display: block;
  border-radius: var(--border-radius);
}

.precision-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.model-stage-grid figcaption {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.7;
  margin-top: 0.8rem;
}

.precision-figure > a:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 4px;
}




.model-stage-grid figure {
  margin: 0;
  min-width: 0;
}

.model-stage-grid a {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  display: block;
  overflow: hidden;
  transition: border-color 160ms ease, transform 160ms ease;
}

.model-stage-grid a:hover,
.model-stage-grid a:focus-visible {
  border-color: #9dbadd;
  outline: none;
  transform: translateY(-2px);
}

.model-stage-grid img {
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: contain;
  width: 100%;
}

.model-list {
  border-top: 1px solid var(--border-color);
  margin-top: 2.2rem;
}

.model-row {
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(230px, 0.8fr) minmax(300px, 1.4fr) auto;
  padding: 1.4rem 0;
}

.model-row p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.model-row > a {
  color: var(--primary-color);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.model-name {
  align-items: center;
  display: flex;
  gap: 0.9rem;
}

.model-name div {
  display: grid;
  gap: 0.14rem;
}

.model-name span:not(.model-index) {
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.model-index {
  align-items: center;
  background: var(--background-accent);
  border: 1px solid #d5e2f0;
  border-radius: 8px;
  color: var(--primary-color);
  display: inline-flex;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.74rem;
  font-weight: 800;
  height: 38px;
  justify-content: center;
  width: 38px;
}

#BibTeX pre {
  background: #f5f7fa;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: #253247;
}

.copy-bibtex-btn {
  background: #fff;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.copy-bibtex-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.footer {
  background: #f6f8fb;
  border-top: 1px solid var(--border-color);
  padding: 2.7rem 1.5rem;
}

.footer-copy > p:first-child {
  color: var(--text-primary);
  font-weight: 700;
}

.template-credit {
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.6;
}

.scroll-to-top {
  background: var(--text-primary);
}

@media screen and (max-width: 768px) {
  .top-nav-inner {
    height: 50px;
    overflow-x: auto;
    padding: 0 0.65rem;
    scrollbar-width: none;
  }

  .top-nav-inner::-webkit-scrollbar {
    display: none;
  }

  .top-nav-links {
    margin-left: auto;
  }

  .top-nav-links a {
    font-size: 0.73rem;
    padding: 0.46rem 0.55rem;
  }

  .publication-header .hero-body {
    padding: 3rem 1rem 2rem;
  }

  .brand-mark {
    height: 68px;
  }

  .brand-mark-terrascope {
    width: 92px;
  }

  .brand-mark-sjtu {
    width: 68px;
  }

  .brand-divider {
    height: 42px;
  }

  .publication-title {
    font-size: clamp(2rem, 10vw, 3rem) !important;
    white-space: normal;
  }

  .publication-links {
    align-items: stretch;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 1.2rem auto 0;
    max-width: 420px;
  }

  .publication-links .link-block {
    display: block;
    margin: 0;
  }

  .publication-links .button {
    height: 100%;
    margin: 0 !important;
    width: 100%;
  }

  .demo-grid {
    grid-template-columns: 1fr;
  }

  .model-stage-grid {
    grid-template-columns: 1fr;
  }

  .result-grid-grounding,
  .result-grid-reasoning,
  .change-grid,
  .result-card-route,
  .result-card-quantity {
    grid-template-columns: 1fr;
  }

  .route-copy {
    padding: 0.25rem 0;
  }

  .quantity-copy {
    padding: 0.25rem 0;
  }

  .model-row {
    align-items: start;
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }

  .contribution-list li {
    gap: 0.8rem;
    grid-template-columns: 38px 1fr;
  }
}

@media screen and (max-width: 480px) {
  .publication-links {
    grid-template-columns: 1fr;
  }
}

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

  .hero,
  .section {
    animation: none;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

.hero,
.section {
  animation: none;
}

/* Main stage diagrams lead; implementation details stay secondary. */
#models > .container {
  max-width: 1040px;
}

#models .model-stage-grid figcaption {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 650;
}

#models .precision-section {
  border-top: 1px solid var(--border-color);
  max-width: 880px;
  margin: 2rem auto 0;
  padding-top: 1.25rem;
  scroll-margin-top: 5rem;
}

#precision-title {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.precision-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.75rem;
}

#models .precision-figure {
  min-width: 0;
  margin: 0;
}

.precision-figure figcaption {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 0.6rem;
}

.model-resources-title {
  margin-top: 2.5rem;
}

.model-resources-title + .model-list {
  margin-top: 1rem;
}

.publication-author-note {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 0.65rem;
}

.author-mark {
  font-size: 0.7em;
  margin-left: 0.12em;
}

.publication-author-note .advisor-note {
  margin-left: 1rem;
}
