/* 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;
  }
}





/* ==========================================================================
   Project-specific styles (DT-R2S2R)
   템플릿 기본 스타일 아래에 추가됨. 색상은 상단 :root 변수를 따른다.
   ========================================================================== */

/* --- Hero --------------------------------------------------------------- */
.method-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary-color);
  background: var(--background-accent);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  margin-bottom: 1.25rem;
}

.publication-title.title.is-1 {
  font-size: 2.35rem !important;
}

.button.is-disabled,
.external-link.is-disabled {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}

/* --- Figures ------------------------------------------------------------ */
.figure-block {
  margin: 0 0 2.75rem 0;
  background: var(--background-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.25rem;
  transition: var(--transition);
}

.figure-block:hover {
  box-shadow: var(--shadow-lg);
}

.figure-block img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--border-radius);
}

.figure-block figcaption {
  margin-top: 1rem;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
  text-align: left;
}

/* --- Highlight stats ---------------------------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.stat-card {
  background: var(--background-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem 1.25rem;
  text-align: center;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.stat-value {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--primary-color);
  letter-spacing: -0.02em;
}

.stat-unit {
  font-size: 1.4rem;
  font-weight: 700;
}

.stat-label {
  margin-top: 0.6rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* --- Contributions ------------------------------------------------------ */
.contrib-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.contrib-card {
  background: var(--background-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem 1.5rem;
  transition: var(--transition);
}

.contrib-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.contrib-num {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.contrib-card h3 {
  color: var(--text-primary) !important;
  margin-bottom: 0.7rem !important;
  line-height: 1.35;
}

.contrib-card p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* --- Method ------------------------------------------------------------- */
/* Approach 의 (a)/(b) 단계 제목. .subsection-title 과 함께 쓰며
   여기서는 배지 정렬만 추가한다. */
.stage-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.stage-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  height: 2.1rem;
  border-radius: 8px;
  background: var(--primary-color);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
}

.stage-intro {
  font-size: 1.02rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.method-steps {
  list-style: none;
  counter-reset: step;
  margin: 0 0 1rem 0;
  padding: 0;
}

.method-steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.5rem 3rem;
  border-left: 2px solid var(--border-color);
  margin-left: 1rem;
}

.method-steps > li:last-child {
  border-left-color: transparent;
  padding-bottom: 0.5rem;
}

.method-steps > li::before {
  content: counter(step);
  position: absolute;
  left: -1.05rem;
  top: 0;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: var(--background-primary);
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.method-steps h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0.25rem 0 0.6rem;
}

.method-steps p,
.method-bullets li {
  font-size: 0.97rem;
  line-height: 1.78;
  color: var(--text-secondary);
  margin-bottom: 0.85rem;
}

.method-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
}

.method-bullets li {
  position: relative;
  padding-left: 1.35rem;
  margin-bottom: 1.1rem;
}

.method-bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary-color);
}

.method-bullets strong,
.method-steps strong {
  color: var(--text-primary);
}

.formula {
  background: var(--background-accent);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 0.9rem 1.25rem;
  margin: 0.9rem 0 1.1rem;
  color: var(--text-primary);
  overflow-x: auto;
  overflow-y: hidden;
}

/* KaTeX display 수식은 자체 여백을 갖는다 */
.formula .katex-display {
  margin: 0;
}

.formula .katex {
  font-size: 1.05em;
}

.note {
  font-size: 0.9rem !important;
  color: var(--text-light) !important;
  font-style: italic;
  border-left: 3px solid var(--border-color);
  padding-left: 0.9rem;
}

/* --- Result tables ------------------------------------------------------ */
/* 소제목(H3). 크기/굵기는 Bulma 의 .title.is-4 가 담당하고,
   여기서는 여백과 밑줄만 얹는다. */
.subsection-title {
  color: var(--text-primary) !important;
  margin: 3rem 0 0.9rem !important;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--border-color);
}

.subsection-title:first-of-type {
  margin-top: 0 !important;
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  background: var(--background-primary);
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}

.res-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  white-space: nowrap;
}

.res-table th,
.res-table td {
  padding: 0.7rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.res-table thead th {
  background: var(--background-accent);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-primary);
  text-align: center;
  border-bottom: 2px solid var(--border-color);
}

.res-table thead th:first-child {
  text-align: left;
}

.res-table td.c,
.res-table th.c {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.res-table tbody tr:last-child td {
  border-bottom: none;
}

.res-table tbody tr:hover {
  background: var(--background-secondary);
}

.res-table .th-sub {
  font-weight: 500;
  color: var(--text-light);
  font-size: 0.78rem;
}

.row-oracle    { background: #e8f1fa; }
.row-baseline  { background: #fdf2f2; }
.row-ours      { background: #eef6ee; }
.row-oracle:hover   { background: #dfeaf7; }
.row-baseline:hover { background: #faeaea; }
.row-ours:hover     { background: #e5f1e5; }

.row-group td {
  background: var(--background-secondary);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
}

.row-delta td {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-light);
  background: var(--background-secondary);
}

.res-table .up   { color: #0e7c3a; }
.res-table .down { color: #dc143c; }

.res-table .yes { color: #0e7c3a; font-weight: 700; }
.res-table .no  { color: var(--text-light); }

.res-table .pct {
  color: var(--text-light);
  font-size: 0.8rem;
  font-weight: 500;
}

/* 표기 열은 행 식별자 역할이므로 본문보다 살짝 크게 */
.res-table .notation .katex {
  font-size: 1.15em;
  color: var(--text-primary);
}

/* 결과표의 행 라벨은 논문 표기 그 자체다. 왼쪽 정렬로 둔다. */
.res-table td.notation {
  text-align: left;
}

.tag-inline {
  display: inline-block;
  margin-left: 0.45rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--background-accent);
  color: var(--text-light);
  border: 1px solid var(--border-color);
  vertical-align: middle;
}

.tag-ours {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

.table-note {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text-light);
  margin-top: 0.85rem;
}

/* --- Protocol ----------------------------------------------------------- */
.protocol-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.protocol-list li {
  background: var(--background-secondary);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--primary-color);
  border-radius: var(--border-radius);
  padding: 1.1rem 1.35rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

.protocol-list strong {
  color: var(--text-primary);
}

/* --- Responsive --------------------------------------------------------- */
@media screen and (max-width: 1023px) {
  .stat-grid    { grid-template-columns: repeat(2, 1fr); }
  .contrib-grid { grid-template-columns: 1fr; }
}

@media screen and (max-width: 768px) {
  .publication-title.title.is-1 { font-size: 1.7rem !important; }
  .stat-grid     { grid-template-columns: 1fr; }
  .stat-value    { font-size: 2rem; }
  .figure-block  { padding: 0.85rem; }
  .res-table     { font-size: 0.82rem; }
  .res-table th,
  .res-table td  { padding: 0.55rem 0.7rem; }
  .method-steps > li { padding-left: 2.4rem; }
  .stage-title   { font-size: 1.15rem; }
}

/* 넓은 표가 페이지를 가로로 밀어내지 않게 하는 규칙.
   Bulma의 .hero 는 display:flex 이고 .columns 도 태블릿 이상에서 flex 라서,
   그 자식들은 min-width:auto 를 갖는다. 그 상태에서는 안쪽의 overflow-x:auto
   컨테이너가 자기 콘텐츠(넓은 표)보다 작게 줄어들지 못하고 부모를 밀어낸다.
   flex 체인 전체에 min-width:0 을 주어야 .table-wrap 이 실제로 스크롤된다. */
.hero > .container,
.hero > .hero-body,
.hero-body > .container,
.section > .container,
.columns > .column {
  min-width: 0;
}

/* .hero 는 flex-direction:column 컨테이너다. 그 안의 .container 는 폭이 auto 라
   내용(넓은 표)의 max-content 크기로 부풀어 부모를 넘어선다. 폭을 100%로 못박아
   .table-wrap 이 실제로 좁아지고 자기 안에서 가로 스크롤되게 한다. */
.hero > .container,
.hero-body > .container {
  width: 100%;
}

.table-wrap,
.formula,
#bibtex-code {
  min-width: 0;
  max-width: 100%;
}

/* --- Appendix (접이식) ---------------------------------------------------- */
.appendix-item {
  background: var(--background-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
  transition: var(--transition);
}

.appendix-item[open] {
  box-shadow: var(--shadow-md);
}

.appendix-item > summary {
  cursor: pointer;
  padding: 1.05rem 1.35rem;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border-radius: var(--border-radius);
  list-style: none;
  transition: var(--transition);
}

/* 브라우저 기본 삼각형 제거 */
.appendix-item > summary::-webkit-details-marker { display: none; }
.appendix-item > summary::marker { content: ''; }

/* 직접 그린 삼각형 — 펼치면 90도 회전 */
.appendix-item > summary::before {
  content: '';
  flex: none;
  width: 0;
  height: 0;
  border-left: 7px solid var(--primary-color);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  transition: transform 0.2s ease;
}

.appendix-item[open] > summary::before {
  transform: rotate(90deg);
}

.appendix-item > summary:hover {
  background: var(--background-secondary);
}

.appendix-item > summary:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.appendix-body {
  padding: 0.25rem 1.35rem 1.35rem;
}

/* Appendix 안에서는 표가 촘촘하므로 조금 작게 */
.appendix-body .minor-title {
  font-size: 1.05rem;
}

/* key/value 형태의 표는 줄바꿈을 허용한다 (숫자표와 달리 문장이 들어간다) */
.res-table.kv {
  white-space: normal;
}

.res-table.kv td {
  vertical-align: top;
  line-height: 1.6;
}

/* 짧은 라벨이 불필요하게 두 줄로 접히지 않도록 첫 열에 최소 폭을 준다 */
.res-table.kv td:first-child,
.res-table.kv th:first-child {
  min-width: 11rem;
}

.res-table.kv thead th {
  text-align: left;
}

.res-table.kv code {
  font-size: 0.85em;
  padding: 0.1rem 0.35rem;
  border-radius: 5px;
  /* break-all 은 항상 아무데서나 끊는다. anywhere 는 넘칠 때만 끊는다. */
  overflow-wrap: anywhere;
}

/* 체크포인트 링크가 링크로 보이게 */
.res-table a code {
  color: var(--primary-color);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.res-table a:hover code {
  background: var(--primary-color);
  color: #fff;
}

/* 3열 비교표: 열 폭을 고정해 균등하게 */
.res-table.cmp {
  table-layout: fixed;
}

.res-table.cmp th:first-child,
.res-table.cmp td:first-child {
  width: 19%;
  min-width: 0;
}

.res-table.cmp thead th:not(:first-child) {
  width: 27%;
}

.res-table .frozen {
  color: var(--text-light);
  font-weight: 600;
}

.res-table .trainable {
  color: var(--primary-color);
  font-weight: 600;
}

@media screen and (max-width: 768px) {
  .appendix-item > summary { font-size: 0.92rem; padding: 0.9rem 1rem; }
  .appendix-body { padding: 0.25rem 1rem 1rem; }
}

/* Appendix 상호참조 마커 (표 심볼 옆의 위첨자 링크) */
.apx-ref {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0 0.28rem;
  border-radius: 4px;
  background: var(--primary-color);
  color: #fff !important;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.5;
  vertical-align: super;
  text-decoration: none;
  transition: var(--transition);
}

.apx-ref:hover {
  background: var(--primary-hover);
}

/* --- 그림/비디오 placeholder ---------------------------------------------- */
.media-placeholder {
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius-lg);
  background: var(--background-secondary);
  padding: 3.75rem 1.5rem;
  margin-bottom: 2.25rem;
  text-align: center;
  color: var(--text-light);
}

.media-placeholder i {
  display: block;
  font-size: 2.1rem;
  opacity: 0.45;
  margin-bottom: 0.85rem;
}

.media-placeholder p {
  margin: 0;
  font-size: 0.95rem;
}

.media-placeholder .ph-hint {
  margin-top: 0.3rem;
  font-size: 0.87rem;
  opacity: 0.8;
}

/* 비디오를 넣을 때도 그림과 동일한 프레임을 쓴다 */
.figure-block video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--border-radius);
}

/* Appendix 안으로 옮겨온 해석 노트 목록 */
.appendix-body .protocol-list li {
  font-size: 0.93rem;
}

/* --- 클립 슬라이더 ------------------------------------------------------- */
.clip-slider {
  background: var(--background-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.25rem;
  margin-bottom: 2.75rem;
  outline: none;
}

.clip-slider:focus-visible {
  box-shadow: var(--shadow-md), 0 0 0 3px rgba(37, 99, 235, 0.35);
}

.clip-item {
  display: none;
  margin: 0;
}

.clip-item.is-active {
  display: block;
}

.clip-item video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  background: #000;
}

.clip-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

.clip-btn {
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--background-primary);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.clip-btn:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

.clip-meta {
  flex: 1;
  text-align: center;
  line-height: 1.4;
}

.clip-name {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.98rem;
}

.clip-count {
  display: block;
  font-size: 0.82rem;
  color: var(--text-light);
  font-variant-numeric: tabular-nums;
}

.clip-dots {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.9rem;
}

.clip-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--border-color);
  cursor: pointer;
  transition: var(--transition);
}

.clip-dot:hover {
  background: var(--text-light);
}

.clip-dot.is-active {
  background: var(--primary-color);
  transform: scale(1.3);
}

@media screen and (max-width: 768px) {
  .clip-slider { padding: 0.85rem; }
  .clip-btn    { width: 2.1rem; height: 2.1rem; }
  .clip-name   { font-size: 0.88rem; }
}

/* --- 데이터셋 크레딧 ------------------------------------------------------ */
.dataset-credit-section {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.credit-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 0.6rem;
}

.dataset-credit {
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--text-secondary);
  border-left: 3px solid var(--border-color);
  padding-left: 1rem;
  margin: 0;
}

/* --- Approach 하위 라벨 --------------------------------------------------- */
/* 하위 제목(H4). 크기/굵기는 Bulma 의 .title.is-5 가 담당한다. */
.minor-title {
  color: var(--text-primary) !important;
  margin: 1.6rem 0 0.7rem !important;
}

.minor-title:first-child {
  margin-top: 0.5rem !important;
}

/* --- 인터랙티브 경로 지도 -------------------------------------------------- */
.map-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--border-radius);
  overflow: hidden;
  background: var(--background-secondary);
}

.map-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media screen and (max-width: 768px) {
  .map-frame { aspect-ratio: 1 / 1; }
}

/* Appendix 로 유도하는 인라인 링크 (본문에서 눈에 띄게) */
.apx-link {
  display: inline-block;
  margin: 0 0.15rem;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  background: var(--background-accent);
  border: 1px solid var(--primary-color);
  color: var(--primary-color) !important;
  font-size: 0.85em;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: var(--transition);
}

.apx-link:hover {
  background: var(--primary-color);
  color: #fff !important;
}

/* Appendix 본문 문단 */
.appendix-text {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.appendix-text:last-child {
  margin-bottom: 0;
}

/* --- 본문 링크 -----------------------------------------------------------
   템플릿은 버튼과 footer 링크만 스타일링해서, 산문 속 링크가 일반 텍스트와
   구분되지 않았다. 아래에서 색과 밑줄을 준다 (.apx-link 는 자체 스타일 유지). */
.stage-intro a:not(.apx-link),
.appendix-text a,
.figure-block figcaption a,
.table-note a,
.dataset-credit a,
.protocol-list a,
.contrib-card a {
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: var(--transition);
}

.stage-intro a:not(.apx-link):hover,
.appendix-text a:hover,
.figure-block figcaption a:hover,
.table-note a:hover,
.dataset-credit a:hover,
.protocol-list a:hover,
.contrib-card a:hover {
  color: var(--primary-hover);
  text-decoration-thickness: 2px;
}

/* 새 탭으로 열리는 외부 링크임을 표시 */
.stage-intro a[target="_blank"]:not(.apx-link)::after,
.appendix-text a[target="_blank"]::after,
.dataset-credit a[target="_blank"]::after {
  content: '\2197';
  font-size: 0.8em;
  margin-left: 0.15em;
  vertical-align: baseline;
}



.nested-details > summary {
  cursor: pointer;
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border-radius: var(--border-radius);
}

.nested-details > summary::-webkit-details-marker { display: none; }
.nested-details > summary::marker { content: ''; }

.nested-details > summary::before {
  content: '';
  flex: none;
  width: 0;
  height: 0;
  border-left: 6px solid var(--text-light);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.2s ease;
}

.nested-details[open] > summary::before {
  transform: rotate(90deg);
}

.nested-details > summary:hover {
  color: var(--primary-color);
}

.nested-body {
  padding: 0 1rem 1rem;
}

/* 168행짜리 표는 안에서 세로 스크롤시킨다 */
.table-scroll {
  max-height: 30rem;
  overflow-y: auto;
}

/* 헤더 고정 */
.table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.res-table.clips {
  font-size: 0.85rem;
}

.res-table.clips td {
  padding: 0.4rem 0.9rem;
}



/* 슬라이더 클립 캡션 */
.clip-item figcaption {
  margin-top: 0.85rem;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-secondary);
  text-align: left;
}
