:root {
  --ink: #17202a;
  --muted: #5d6877;
  --line: #dfe6ee;
  --paper: #ffffff;
  --soft: #f6f8fb;
  --blue: #155ca8;
  --blue-dark: #0f3f76;
  --green: #17735d;
  --gold: #b7791f;
  --violet: #6b46c1;
  --shadow: 0 14px 34px rgba(23, 32, 42, 0.10);
}

html {
  scroll-behavior: smooth;
}

body {
  color: var(--ink);
  background: var(--paper);
  font-family: "Noto Sans", "Google Sans", Arial, sans-serif;
  line-height: 1.62;
}

.page-nav {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.nav-brand {
  color: var(--blue-dark);
  font-weight: 800;
  letter-spacing: 0;
}

.navbar-item {
  color: var(--muted);
  font-weight: 600;
}

.navbar-item:hover,
.navbar-item:focus {
  color: var(--blue);
}

.publication-hero {
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fbff 58%, #ffffff 100%);
}

.publication-hero .container.is-max-desktop {
  max-width: 1120px;
}

.publication-hero .hero-body {
  padding: 4.75rem 1.5rem 3.2rem;
}

.venue-label {
  display: inline-flex;
  align-items: center;
  border: 1px solid #b9cde4;
  border-radius: 8px;
  color: var(--blue-dark);
  background: #edf5ff;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  padding: 0.28rem 0.68rem;
  margin-bottom: 1rem;
}

.publication-title {
  color: var(--ink);
  font-family: "Google Sans", "Noto Sans", Arial, sans-serif;
  font-size: clamp(2.05rem, 4.3vw, 3.25rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: 0;
  margin: 0 auto 1.4rem;
  max-width: 1120px;
}

.publication-title .title-line {
  display: block;
}

.publication-authors {
  color: #263241;
  font-size: 1.06rem;
  font-weight: 600;
  line-height: 1.85;
  margin: 0 auto 0.7rem;
  max-width: 960px;
}

.author-block {
  display: inline-block;
  margin: 0 0.36rem;
}

.author-block a {
  color: var(--blue-dark);
  text-decoration: none;
}

.author-block a:hover,
.author-block a:focus {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.publication-affiliations {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  justify-content: center;
  margin: 0 auto;
  max-width: 900px;
}

.equal-note {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 0.45rem;
}

.publication-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  margin: 1.7rem 0 2rem;
}

.project-button {
  border-radius: 8px;
  font-weight: 700;
  min-width: 116px;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.hf-logo-icon {
  display: block;
  height: 1.15rem;
  width: auto;
}

.project-button:hover,
.project-button:focus {
  background: var(--blue) !important;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.teaser-figure,
.method-figure {
  margin: 0 auto;
}

.teaser-figure img,
.method-figure img {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: block;
  height: auto;
  margin: 0 auto;
  max-width: 100%;
}

.teaser-figure img {
  width: min(700px, 100%);
}

.method-figure img {
  width: min(960px, 100%);
}

figcaption {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 0.9rem;
  text-align: center;
}

.paper-section {
  padding: 4.2rem 1.5rem;
}

.section-tint {
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
}

.section-title {
  color: var(--ink);
  font-family: "Google Sans", "Noto Sans", Arial, sans-serif;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: 1.6rem;
}

.section-lead {
  color: var(--muted);
  font-size: 1.04rem;
  margin: 0 auto 1.8rem;
  max-width: 760px;
  text-align: center;
}

.paper-copy {
  color: #263241;
  font-size: 1.02rem;
}

.paper-copy p {
  margin-bottom: 1rem;
}

.paper-copy strong,
.tldr strong {
  color: inherit;
  font-weight: 800;
}

.tldr {
  background: #edf7f2;
  border: 1px solid #cbe8dc;
  border-left: 5px solid var(--green);
  border-radius: 8px;
  color: #17382f;
  margin: 0 0 1.35rem;
  padding: 1rem 1.15rem;
}

.motivation-grid,
.method-steps,
.result-highlights {
  display: grid;
  gap: 1rem;
}

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

.method-steps,
.result-highlights {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.info-card,
.metric-card,
.method-steps article {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 7px 20px rgba(23, 32, 42, 0.06);
  min-width: 0;
  padding: 1.25rem;
}

.info-card h3,
.method-steps h3 {
  color: var(--ink);
  font-family: "Google Sans", "Noto Sans", Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.25;
  margin-bottom: 0.55rem;
}

.info-card p,
.method-steps p,
.metric-card span {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
}

.card-icon {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  height: 40px;
  justify-content: center;
  margin-bottom: 0.9rem;
  width: 40px;
}

.card-icon.sft {
  background: #fff3d9;
  color: var(--gold);
}

.card-icon.rl {
  background: #e8f2ff;
  color: var(--blue);
}

.card-icon.hint {
  background: #f0ebff;
  color: var(--violet);
}

.method-intro {
  margin: 0 auto 1.4rem;
  max-width: 840px;
  text-align: center;
}

.method-steps {
  margin-top: 1.6rem;
}

.step-number {
  align-items: center;
  background: var(--blue);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  font-weight: 800;
  height: 32px;
  justify-content: center;
  margin-bottom: 0.75rem;
  width: 32px;
}

.result-highlights {
  margin-bottom: 1.3rem;
}

.metric-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.metric-label {
  color: var(--blue-dark) !important;
  font-size: 0.78rem !important;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-card strong {
  color: var(--ink);
  font-family: "Google Sans", "Noto Sans", Arial, sans-serif;
  font-size: 2rem;
  line-height: 1.1;
}

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 7px 20px rgba(23, 32, 42, 0.06);
  overflow-x: auto;
}

.results-table {
  background: #fff;
  border-collapse: collapse;
  min-width: 1180px;
  text-align: center !important;
  width: 100%;
}

.results-table th,
.results-table td {
  border-bottom: 1px solid var(--line);
  color: #263241;
  font-size: 0.94rem;
  padding: 0.78rem 0.9rem;
  text-align: center !important;
  white-space: nowrap;
}

.results-table th {
  background: #eef4fb;
  color: var(--blue-dark);
  font-weight: 800;
  text-align: center !important;
}

.results-table tbody tr:last-child td {
  border-bottom: 0;
}

.ours-row td {
  background: #edf7f2;
  color: #143d32;
  font-weight: 800;
}

.model-row td {
  background: #f3f6fa;
  color: #314154;
  font-weight: 800;
  text-align: center;
}

.table-note {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.75rem;
  text-align: center;
}

.citation-box {
  background: #111827;
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: #e9eef7;
  overflow: hidden;
  position: relative;
}

.citation-box pre {
  background: transparent;
  color: #e9eef7;
  font-family: "Roboto Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.86rem;
  line-height: 1.55;
  margin: 0;
  overflow-x: auto;
  padding: 1.35rem;
  white-space: pre;
}

.copy-button {
  align-items: center;
  background: #273449;
  border: 1px solid #3e4c63;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  gap: 0.35rem;
  padding: 0.42rem 0.72rem;
  position: absolute;
  right: 0.9rem;
  top: 0.9rem;
  transition: background-color 160ms ease;
  z-index: 1;
}

.copy-button:hover,
.copy-button:focus,
.copy-button.copied {
  background: var(--green);
}

.project-footer {
  background: #f2f5f8;
  color: var(--muted);
  padding: 2.1rem 1.5rem;
}

.project-footer p {
  margin: 0;
}

@media (max-width: 960px) {
  .motivation-grid,
  .method-steps,
  .result-highlights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .publication-hero .hero-body {
    padding-top: 3.3rem;
  }
}

@media (max-width: 640px) {
  .paper-section {
    padding: 3.1rem 1rem;
  }

  .publication-hero .hero-body {
    padding: 2.8rem 1rem 2.5rem;
  }

  .publication-title {
    font-size: 2.05rem;
  }

  .publication-authors {
    font-size: 0.98rem;
  }

  .publication-affiliations {
    align-items: center;
    flex-direction: column;
    gap: 0.16rem;
  }

  .motivation-grid,
  .method-steps,
  .result-highlights {
    grid-template-columns: 1fr;
  }

  .project-button {
    flex: 1 1 140px;
  }

  .citation-box pre {
    font-size: 0.76rem;
    padding-top: 3.3rem;
  }
}
