:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #5b6472;
  --line: #e5e7eb;
  --accent: #1d4ed8;
  --accent-dark: #1e40af;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --placeholder-bg: #f8fafc;
  --placeholder-border: #cbd5e1;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top, rgba(29, 78, 216, 0.08), transparent 30%),
    var(--bg);
  color: var(--text);
  line-height: 1.7;
}

.container {
  width: min(1000px, calc(100% - 32px));
  margin: 40px auto 60px;
}

.hero,
.section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.hero {
  padding: 52px 40px 44px;
  text-align: center;
  margin-bottom: 28px;
}

.hero h1 {
  margin: 0 0 20px;
  font-size: 2.4rem;
  line-height: 1.2;
  font-weight: 700;
  text-wrap: balance;
}

.authors {
  font-size: 1.08rem;
  margin-bottom: 10px;
}

.authors span {
  white-space: nowrap;
}

.authors sup,
.institutions-inline sup {
  font-size: 0.72em;
  vertical-align: super;
}

.institutions-inline {
  color: var(--muted);
  margin-bottom: 18px;
  font-size: 0.98rem;
}

.inst-sep {
  margin: 0 10px;
  color: #9ca3af;
}

.site-note {
  margin: 0 auto 22px;
  max-width: 760px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 0.95rem;
  line-height: 1.5;
}

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.links a,
.link-disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
}

.links a {
  text-decoration: none;
  color: white;
  background: var(--accent);
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.links a:hover {
  transform: translateY(-1px);
  opacity: 0.96;
  background: var(--accent-dark);
}

.link-disabled {
  color: var(--muted);
  background: #eef2f7;
  border: 1px solid var(--line);
  cursor: default;
  user-select: none;
}

.section {
  padding: 34px 34px 30px;
  margin-bottom: 24px;
}

.section h2 {
  margin-top: 0;
  margin-bottom: 18px;
  font-size: 1.6rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.section h3 {
  margin: 0 0 14px;
  font-size: 1.18rem;
}

.section h4 {
  margin: 0 0 14px;
  font-size: 1.08rem;
}

.section h4 span {
  color: var(--muted);
  font-weight: 400;
}

.figure-block {
  margin: 20px 0 12px;
  text-align: center;
}

.figure-block img {
  width: 100%;
  max-width: 900px;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.plain-figure-block {
  margin: 20px 0 12px;
  text-align: center;
}

.plain-figure-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.figure-70 .plain-figure-image {
  width: 70%;
}

.figure-90 .plain-figure-image {
  width: 90%;
}

.motivation-layout {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 16px;
  margin: 20px 0 14px;
  align-items: stretch;
}

.motivation-card {
  min-height: 320px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfdff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.motivation-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: none;
  border-radius: 0;
  background: transparent;
}

.results-group + .results-group {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.cross-dataset-stack {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-top: 18px;
}

.carousel-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfdff 0%, #f8fbff 100%);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
  padding: 18px 18px 14px;
}

.gif-carousel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-frame {
  width: 100%;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 28px;
}

.carousel-image {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  display: block;
  border-radius: 12px;
  background: #ffffff;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent-dark);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.15);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.carousel-btn:hover {
  background: #ffffff;
  transform: translateY(-50%) scale(1.04);
}

.carousel-btn.prev {
  left: 0;
}

.carousel-btn.next {
  right: 0;
}

.caption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.98rem;
}

pre {
  margin: 0;
  overflow-x: auto;
  background: #0f172a;
  color: #e5e7eb;
  padding: 18px;
  border-radius: 14px;
  font-size: 0.95rem;
  line-height: 1.6;
}

code {
  font-family: "Courier New", Courier, monospace;
}

@media (max-width: 700px) {
  .container {
    width: min(1000px, calc(100% - 18px));
    margin-top: 18px;
  }

  .hero,
  .section {
    border-radius: 16px;
  }

  .hero {
    padding: 32px 20px;
  }

  .section {
    padding: 24px 18px 22px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .authors {
    font-size: 1rem;
    line-height: 1.8;
  }

  .institutions-inline {
    line-height: 1.7;
  }

  .inst-sep {
    display: none;
  }

  .institutions-inline span {
    display: block;
  }

  .motivation-layout {
    grid-template-columns: 1fr;
  }

  .motivation-card {
    min-height: 240px;
  }

  .figure-70 .plain-figure-image,
  .figure-90 .plain-figure-image {
    width: 100%;
  }

  .carousel-frame {
    min-height: 220px;
    padding: 0 22px;
  }

  .carousel-image {
    max-height: 260px;
  }

  .carousel-btn {
    width: 38px;
    height: 38px;
    font-size: 1.15rem;
  }

  .links a,
  .link-disabled {
    width: 100%;
  }
}
