:root {
  --bg: #f7f7f5;
  --paper: #ffffff;
  --ink: #171717;
  --muted: #5f6468;
  --line: #dadde1;
  --accent: #2764a6;
  --accent-dark: #143d68;
  --accent-warm: #7c2a7a;
  --soft-blue: #eef5ff;
  --soft-purple: #f7edf7;
  --soft-gray: #f0f1f2;
  --shadow: 0 14px 36px rgba(20, 30, 45, 0.08);
  --shadow-strong: 0 22px 55px rgba(20, 30, 45, 0.13);
  --radius: 8px;
  --max-width: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  line-height: 1.62;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
video {
  display: block;
  max-width: 100%;
}

video {
  width: 100%;
  background: #111111;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247, 247, 245, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.nav-shell {
  width: min(100% - 32px, var(--max-width));
  min-height: 56px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 9px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.nav-toggle span:not(.sr-only) {
  display: block;
  width: 100%;
  height: 2px;
  margin: 4px 0;
  background: var(--ink);
}

.container {
  width: min(100% - 32px, var(--max-width));
  margin: 0 auto;
}

.narrow {
  max-width: 1040px;
}

.center {
  text-align: center;
}

.hero {
  padding: 58px 0 48px;
  background:
    radial-gradient(circle at 18% 18%, rgba(124, 42, 122, 0.12), transparent 34%),
    radial-gradient(circle at 84% 8%, rgba(39, 100, 166, 0.14), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f9fbff 72%, #f7f7f5 100%);
  border-bottom: 1px solid var(--line);
}

.logo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px 30px;
  margin: 0 auto 20px;
}

.hero-logo {
  height: auto;
}

.ace-logo {
  width: min(220px, 42vw);
}

.cuhk-logo {
  width: min(250px, 48vw);
}

.venue {
  margin: 0 0 16px;
  color: var(--accent);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.82rem;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0 auto;
  max-width: 1180px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-size: clamp(3rem, 6.5vw, 5.7rem);
  line-height: 0.96;
  font-weight: 850;
}

.project-name {
  display: block;
  color: var(--accent-dark);
  font-size: 1em;
}

.title-text {
  display: block;
  max-width: 1180px;
  margin: 14px auto 0;
  font-size: clamp(1.25rem, 1.95vw, 1.72rem);
  line-height: 1.16;
  font-weight: 760;
}

h2 {
  margin: 0 0 22px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 3.4vw, 3rem);
  line-height: 1.12;
  font-weight: 700;
}

h3 {
  margin: 0 0 10px;
  font-size: 1.08rem;
  line-height: 1.28;
}

p {
  margin: 0 0 18px;
}

.authors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 12px;
  max-width: 1080px;
  margin: 30px auto 0;
  color: var(--accent-dark);
  font-weight: 700;
  line-height: 1.35;
}

.authors span {
  white-space: nowrap;
}

sup {
  font-size: 0.68em;
  line-height: 0;
  vertical-align: super;
}

.affiliations {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px 16px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.note {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
  margin: 30px auto 40px;
}

.resource-card {
  display: flex;
  min-height: 76px;
  align-items: center;
  gap: 12px;
  padding: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(218, 221, 225, 0.9);
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(20, 30, 45, 0.07);
  text-align: left;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.resource-card:hover {
  transform: translateY(-2px);
  background: #ffffff;
  border-color: rgba(39, 100, 166, 0.32);
  box-shadow: var(--shadow-strong);
}

.resource-card-primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent-dark), var(--accent-warm));
  border-color: transparent;
}

.resource-card-primary:hover {
  background: linear-gradient(135deg, #0f355e, #681d66);
  border-color: transparent;
}

.resource-card-disabled,
.resource-card-disabled:hover {
  color: #757b82;
  background: #eef0f2;
  border-color: var(--line);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.resource-icon {
  display: inline-flex;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: var(--accent);
  border-radius: 12px;
}

.resource-card-primary .resource-icon {
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.9);
}

.resource-card-disabled .resource-icon {
  color: #7a8188;
  background: #d9dde1;
}

.resource-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.resource-icon-text {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.resource-text {
  display: grid;
  gap: 2px;
}

.resource-title {
  font-weight: 900;
  line-height: 1.16;
}

.resource-meta {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.1;
}

.resource-card-primary .resource-meta {
  color: rgba(255, 255, 255, 0.78);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 11px;
  margin: 28px 0 38px;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  color: #ffffff;
  background: #36393d;
  border-radius: 999px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.button:hover {
  background: var(--accent-dark);
}

.button-disabled,
.button-disabled:hover {
  background: #8b9198;
  box-shadow: none;
  cursor: not-allowed;
}

.teaser,
.figure,
.video-card {
  margin: 0;
}

.teaser {
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.teaser video {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

figcaption {
  padding: 13px 16px;
  color: var(--muted);
  background: var(--paper);
  border-top: 1px solid var(--line);
  font-size: 0.94rem;
}

.section {
  padding: 74px 0;
}

.section.compact {
  padding: 34px 0;
}

.overview-section .stat-grid {
  margin-top: 18px;
}

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

.section-heading {
  max-width: 820px;
  margin: 0 auto 32px;
}

.section-heading p {
  color: var(--muted);
  font-size: 1.06rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat-grid article {
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
}

.stat-grid strong {
  display: block;
  color: var(--accent-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
  line-height: 1;
}

.stat-grid span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.figure {
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 26px rgba(20, 30, 45, 0.05);
}

.method-figure {
  margin-top: 20px;
}

.figure img {
  width: 100%;
  background: #ffffff;
}

.feature-grid,
.video-grid,
.results-grid,
.figure-pair {
  display: grid;
  gap: 18px;
}

.feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 22px;
}

.feature-grid article,
.result-panel {
  padding: 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.feature-grid p {
  margin: 0;
  color: var(--muted);
}

.figure-pair {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.video-card {
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.video-card video {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.video-card figcaption {
  color: var(--ink);
  font-weight: 800;
}

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

.result-panel h3 {
  margin-bottom: 14px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
  background: var(--paper);
}

th,
td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  background: var(--soft-gray);
  font-size: 0.82rem;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.ours td {
  color: var(--accent-dark);
  background: var(--soft-blue);
  font-weight: 900;
}

.results-figures {
  max-width: 760px;
  margin: 24px auto 0;
}

.code-panel {
  position: relative;
  overflow: hidden;
  background: #181a1d;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

pre {
  margin: 0;
  padding: 26px;
  overflow-x: auto;
  color: #f3f7fb;
  font-size: 0.92rem;
  line-height: 1.55;
}

.copy-button {
  position: absolute;
  top: 14px;
  right: 14px;
  min-height: 34px;
  padding: 0 12px;
  color: #ffffff;
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
}

.site-footer {
  padding: 28px 0;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.footer-inner a {
  color: var(--accent-dark);
  font-weight: 800;
}

@media (max-width: 920px) {
  .nav-shell {
    gap: 14px;
  }

  .nav-links {
    gap: 12px;
    font-size: 0.88rem;
  }

  .stat-grid,
  .feature-grid,
  .video-grid,
  .results-grid,
  .figure-pair {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 720px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 12px 16px 16px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    width: 100%;
    padding: 10px 0;
  }

  .hero {
    padding-top: 52px;
  }

  .section {
    padding: 56px 0;
  }

  .button {
    flex: 1 1 130px;
  }

  .resource-grid {
    grid-template-columns: 1fr;
    margin-bottom: 32px;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .container {
    width: min(100% - 24px, var(--max-width));
  }

  h1 {
    font-size: clamp(2.45rem, 15vw, 3.3rem);
  }

  .title-text {
    font-size: clamp(1.18rem, 6vw, 1.55rem);
  }

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

  pre {
    padding: 62px 16px 18px;
  }
}
