:root {
  --text: #1f2328;
  --muted: #59636e;
  --line: #d8dee4;
  --bg-soft: #f6f8fa;
  --accent: #2557d6;
  --accent-soft: #e8efff;
  --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial,
               "Noto Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  line-height: 1.6;
}

* { box-sizing: border-box; }
body { margin: 0; background: #fff; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 900px; }

/* ---------- paper information ---------- */
.hero { padding: 64px 0 32px; text-align: center; border-bottom: 1px solid var(--line); }
.title { font-size: clamp(1.6rem, 3.2vw, 2.5rem); line-height: 1.25; margin: 0 0 24px; font-weight: 700; }
.brand { color: var(--accent); }
.authors { font-size: calc(1.15rem + 2px); margin: 0 0 6px; }
.authors span { display: inline-block; margin: 0 4px; }
.authors a { color: var(--accent); }
.affiliations { color: var(--muted); margin: 0; font-size: calc(1rem + 2px); }
.affiliations span { display: inline-block; margin: 0 10px; }
.affiliation-block { display: inline-flex; flex-direction: column; max-width: 100%; }
/* logo row centred under the affiliations; the gap shrinks on narrow screens */
.logos { display: flex; justify-content: center; align-items: center; gap: clamp(24px, 12vw, 90px); margin: 18px 0 10px; }
.logos img { height: 80px; width: auto; }
.note { color: var(--muted); font-size: .95rem; margin: 6px 0 24px; }
.note span { display: inline-block; margin: 0 22px; }
sup { font-size: .7em; }

.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 20px; border-radius: 999px;
  background: var(--text); color: #fff; font-weight: 600;
}
.btn:hover { text-decoration: none; background: #3a424b; }
.btn svg { width: 18px; height: 18px; }
.btn.disabled { background: #8c959f; cursor: default; }
.btn small { font-weight: 400; opacity: .85; }
.emoji { font-size: 1.1em; line-height: 1; }

/* ---------- sections ---------- */
/* Space above each section title (Video Results / Comparison / Citation): 36px from the end
   of the previous section. .container's padding would otherwise override the vertical padding. */
main section.container { padding-top: 36px; padding-bottom: 0; }
main section > :last-child { margin-bottom: 0; }
h2 { font-size: 1.7rem; text-align: center; margin: 0 0 16px; }
.abstract { text-align: justify; }
.section-intro { text-align: center; color: var(--muted); max-width: 820px; margin: 0 auto 20px; }
.empty {
  text-align: center; color: var(--muted); background: var(--bg-soft);
  border: 1px dashed var(--line); border-radius: var(--radius); padding: 28px; margin: 0;
}

.tabs { display: flex; justify-content: center; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.tab {
  font: inherit; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--text);
  padding: 8px 20px; border-radius: 999px;
}
.tab:hover { background: var(--bg-soft); }
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- video cases ---------- */
h3 { font-size: 1.3rem; text-align: center; margin: 36px 0 4px; }
/* directly after a section intro (e.g. Comparison -> Object Removal) the gap is halved */
#comparison .section-intro { margin-bottom: 0; }
.section-intro + h3 { margin-top: 18px; }
.sub-intro { text-align: center; color: var(--muted); font-size: .92rem; margin: 0 0 14px; }
.case { background: var(--bg-soft); border-radius: var(--radius); padding: 14px; }
.prompt { margin: 0 0 10px; font-size: .95rem; }
.prompt-label {
  display: inline-block; margin-right: 8px; padding: 0 8px;
  font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  color: var(--accent); background: var(--accent-soft); border-radius: 4px;
}
.prompt-label.tag { color: #c2410c; background: #ffedd5; }
.panels { display: grid; grid-template-columns: repeat(var(--cols, 2), 1fr); gap: 8px; }
.panel { margin: 0; }
.panel video {
  display: block; width: 100%; aspect-ratio: 832 / 480; object-fit: cover;
  background: #000; border-radius: 6px;
}
/* method names under the videos (demos and comparisons) */
.panel figcaption {
  text-align: center; margin-top: 4px; color: var(--text);
  font-family: "Times New Roman", Times, serif; font-size: calc(.85rem + 5px);
}
.panel.ours video { outline: 3px solid var(--accent); outline-offset: -3px; }
.panel.ours figcaption { color: var(--accent); font-weight: 700; }

/* video results: 2 rotating rows */
.demo-rows { display: flex; flex-direction: column; gap: 22px; max-width: 960px; margin: 0 auto; }
.prompt-slot { min-height: 3.1em; }
.demo-stage { position: relative; }
.stage-arrow {
  position: absolute; top: calc(50% - 12px); transform: translateY(-50%); z-index: 2;
  width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(0, 0, 0, .35); color: #fff; font-size: 1.8rem; line-height: 1;
  display: flex; align-items: center; justify-content: center; padding-bottom: 4px;
  opacity: .7; transition: opacity .15s, background .15s;
}
.stage-arrow.prev { left: 8px; }
.stage-arrow.next { right: 8px; }
.demo-stage:hover .stage-arrow { opacity: 1; }
.stage-arrow:hover { background: rgba(0, 0, 0, .6); }

/* comparison viewer */

/* removal shows 3 tiles per row, injection 4: narrow the removal card so tiles are the same size
   (card padding 2x14px, column gap 8px) */
.comparison[data-task="removal"] .comparison-card { width: calc((100% - 52px) * .75 + 44px); margin: 0 auto; }
.placeholder {
  width: 100%; aspect-ratio: 832 / 480; background: #000; border-radius: 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; font-family: "Times New Roman", Times, serif; font-size: clamp(1rem, 2vw, 1.5rem);
  line-height: 1.25; text-align: center;
}
.comparison-head { display: flex; align-items: flex-start; gap: 10px; }
.comparison-head .prompt-slot { flex: 1; min-height: 2em; }
.arrow {
  flex: none; width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line); background: #fff; font-size: 1.3rem; line-height: 1;
}
.arrow:hover { background: var(--accent-soft); }
.case-numbers { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.case-number {
  min-width: 32px; height: 32px; border-radius: 6px; cursor: pointer; font: inherit; font-size: .9rem;
  border: 1px solid var(--line); background: #fff; color: var(--text);
}
.case-number.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- citation ---------- */
.bibtex { position: relative; }
.bibtex pre {
  margin: 0; padding: 18px 20px; overflow-x: auto;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius);
  font-size: .85rem; line-height: 1.5;
}
.copy {
  position: absolute; top: 10px; right: 10px;
  font: inherit; font-size: .8rem; cursor: pointer;
  border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 3px 10px;
}

footer { padding: 40px 24px 48px; text-align: center; color: var(--muted); font-size: .85rem; }

@media (max-width: 640px) {
  .panels { grid-template-columns: repeat(2, 1fr) !important; }
}
