:root {
  --bg: #f9f9f9;
  --paper: #ffffff;
  --paper-soft: #fdfdfd;
  --ink: #333333;
  --heading: #2c3e50;
  --muted: #6f7f86;
  --link: #2980b9;
  --link-hover: #1f6694;
  --border: #eeeeee;
  --shadow: 0 2px 15px rgba(0, 0, 0, 0.09);
  --accent-bg: #e0f7fa;
  --accent-ink: #01579b;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  margin: 0;
  overflow-x: hidden;
  padding: 24px 20px 36px;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

h1,
h2,
h3 {
  color: var(--heading);
  font-weight: 300;
  line-height: 1.22;
}

h1 {
  font-size: 2.55rem;
  margin: 0 0 0.55em;
  text-align: center;
}

h2 {
  font-size: 1.85rem;
  margin: 0 0 0.75em;
}

p {
  margin: 0 0 1.35em;
  text-align: justify;
}

hr {
  border: 0;
  border-top: 1px solid #dedede;
  margin: 1.4rem auto;
  max-width: 720px;
}

.page-shell {
  margin: 0 auto;
  max-width: 920px;
  width: 100%;
}

.paper-header {
  padding-top: 1.5rem;
}

.authors {
  color: #7f8c8d;
  font-size: 1.08rem;
  font-style: italic;
  margin-bottom: 0.55rem;
  text-align: center;
}

.authors span {
  display: inline-block;
  margin: 0 8px 0.25rem;
}

.author-break {
  display: block;
}

.affiliations {
  color: #59666b;
  font-size: 0.98rem;
  margin: 0.15rem auto 0.9rem;
  text-align: center;
}

.affiliations span {
  display: inline-block;
  margin: 0 9px 0.2rem;
}

.paper-info {
  color: var(--link);
  font-size: 1.08rem;
  font-weight: 500;
  margin-bottom: 1rem;
  text-align: center;
}

.links {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  justify-content: center;
  margin-bottom: 1rem;
}

.links a,
.link-placeholder {
  align-items: center;
  background: var(--paper);
  border: 1px solid #e6e6e6;
  border-radius: 5px;
  box-shadow: 0 1px 7px rgba(0, 0, 0, 0.05);
  display: inline-flex;
  font-size: 0.92rem;
  gap: 7px;
  min-height: 36px;
  padding: 7px 12px;
}

.link-placeholder {
  color: #7f8c8d;
}

.links a:hover {
  border-color: #d4e8f5;
  text-decoration: none;
}

.callout-stack {
  margin: 0 auto 2rem;
  max-width: 720px;
}

.callout {
  background: var(--accent-bg);
  border-left: 4px solid #1d9ab7;
  border-radius: 6px;
  color: var(--accent-ink);
  margin: 0 auto;
  padding: 0.85rem 1rem;
  text-align: center;
}

.callout-stack .callout {
  margin-bottom: 0.7rem;
  max-width: none;
}

.callout-stack .callout:last-child {
  margin-bottom: 0;
}

.content-section {
  background: var(--paper);
  border-radius: 6px;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
  overflow: hidden;
  padding: 1.15rem 1.35rem 1.35rem;
}

.content-section:first-of-type {
  padding-top: 1.35rem;
}

.figure-container {
  margin: 1.6rem 0;
  text-align: center;
}

.figure-container:first-child {
  margin-top: 0;
}

.figure-container:last-child {
  margin-bottom: 0;
}

.figure-container img {
  display: block;
  height: auto;
  margin: 0 auto;
  max-height: 520px;
  max-width: 100%;
}

.hero-media {
  background: #f4f7f8;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(32, 50, 59, 0.14);
  overflow: hidden;
  position: relative;
  width: 100%;
}

.teaser-video-stack {
  display: grid;
  gap: 1.25rem;
}

.teaser-video-item {
  margin: 0;
}

.hero-video,
.hero-video-fallback {
  display: block;
  height: auto;
  margin: 0 auto;
  max-height: none;
  width: 100%;
}

.hero-video {
  background: #f4f7f8;
  max-height: 75vh;
  object-fit: contain;
}

.hero-video[hidden],
.hero-video-fallback[hidden] {
  display: none;
}

.motivation-figure img {
  border-radius: 4px;
  max-height: none;
}

.wide-figure {
  margin-left: 0;
  max-width: none;
  transform: none;
  width: 100%;
}

.scene-mesh-grid,
.shape-grid,
.objectwise-grid,
.adaptive-grid,
.centroid-grid,
.runtime-grid,
.rmcc-case-grid,
.rmcc-chart-grid {
  margin: 0 auto;
}

.scene-mesh-grid {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.scene-mesh-grid div,
.adaptive-grid div,
.centroid-grid div,
.runtime-grid div,
.rmcc-case-grid div {
  background: #fbfbfb;
  border: 1px solid #eeeeee;
  border-radius: 5px;
  padding: 8px;
}

.scene-mesh-grid img,
.adaptive-grid img,
.centroid-grid img,
.runtime-grid img,
.rmcc-case-grid img,
.rmcc-chart-grid img {
  max-height: none;
  width: 100%;
}

.scene-mesh-grid span,
.grid-heading,
.row-label,
.shape-method h3,
.adaptive-grid span,
.centroid-grid span,
.runtime-grid span,
.rmcc-case-grid span {
  color: #59666b;
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
  margin-top: 0.45rem;
  text-align: center;
}

.claim-grid,
.method-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0.4rem;
}

.claim-grid article,
.method-grid article {
  background: #fbfbfb;
  border: 1px solid #eeeeee;
  border-radius: 6px;
  padding: 0.95rem 1rem;
}

.claim-grid h3,
.method-grid h3 {
  color: #2c3e50;
  font-size: 0.98rem;
  font-weight: 600;
  margin: 0 0 0.45rem;
}

.claim-grid p,
.method-grid p {
  font-size: 0.94rem;
  margin: 0;
  text-align: left;
}

.adaptive-grid,
.runtime-grid,
.rmcc-case-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.centroid-grid {
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.centroid-legend,
.rmcc-legend {
  display: block;
  height: auto;
  margin: 0.7rem auto 0;
  max-height: none;
  max-width: 100%;
}

.metric-dashboard {
  background: #fbfcfd;
  border: 1px solid #e6edf0;
  border-radius: 8px;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  margin: 1.25rem 0 0.45rem;
  padding: 1rem;
}

.metric-dashboard-header {
  align-items: start;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.8fr);
  margin-bottom: 1rem;
}

.chart-kicker {
  color: #687a82;
  display: block;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

.metric-dashboard h3 {
  color: #20323b;
  font-size: 1.18rem;
  font-weight: 800;
  margin: 0;
}

.metric-dashboard h3 span {
  color: #169a65;
}

.tau-note {
  background: #f2f7f8;
  border-left: 3px solid #9bcbd6;
  border-radius: 6px;
  color: #4f626b;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.45;
  margin: 0 0 1rem;
  padding: 0.7rem 0.85rem;
  text-align: left;
}

.threshold-panel {
  border-top: 1px solid #e7edf0;
  padding-top: 1rem;
}

.threshold-heading {
  align-items: baseline;
  display: flex;
  gap: 0.7rem;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.threshold-heading h4 {
  color: #20323b;
  font-size: 1.02rem;
  font-weight: 800;
  margin: 0;
}

.threshold-heading span {
  color: #6c7d85;
  flex: 0 0 auto;
  font-size: 0.76rem;
  font-weight: 800;
}

.chart-legend {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.7rem;
  justify-content: flex-end;
}

.chart-legend span {
  align-items: center;
  color: #52656e;
  display: inline-flex;
  font-size: 0.76rem;
  font-weight: 700;
  gap: 0.32rem;
  line-height: 1.1;
  white-space: nowrap;
}

.chart-legend i {
  background: var(--legend-color);
  border-radius: 999px;
  display: inline-block;
  height: 0.58rem;
  width: 0.58rem;
}

.metric-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-card {
  background: #ffffff;
  border: 1px solid #edf1f3;
  border-radius: 8px;
  padding: 0.9rem;
}

.metric-card-header {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.7rem;
}

.metric-card h4 {
  color: #24353d;
  font-size: 0.98rem;
  font-weight: 800;
  margin: 0;
}

.metric-card-header span {
  color: #72828a;
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 700;
}

.metric-bars {
  display: grid;
  gap: 0.5rem;
}

.metric-row {
  align-items: center;
  display: grid;
  gap: 0.55rem;
  grid-template-columns: 138px minmax(0, 1fr) 48px;
}

.metric-label {
  color: #52656e;
  font-size: 0.74rem;
  font-weight: 700;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  background: #eef3f5;
  border-radius: 999px;
  display: block;
  height: 10px;
  overflow: hidden;
  position: relative;
}

.bar-fill {
  background: var(--method-color);
  border-radius: inherit;
  display: block;
  height: 100%;
  transition: none;
  width: var(--bar-target);
}

.metric-row[style*="#d49a35"] .bar-fill,
.metric-row[style*="#169a65"] .bar-fill {
  transition: width 2.4s cubic-bezier(0.16, 1, 0.3, 1);
  width: 0;
}

.metric-dashboard.is-visible .metric-row[style*="#d49a35"] .bar-fill,
.metric-dashboard.is-visible .metric-row[style*="#169a65"] .bar-fill {
  width: var(--bar-target);
}

.metric-value {
  color: #2d3d44;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  text-align: right;
}

.metric-row.best .metric-label,
.metric-row.best .metric-value {
  color: #13784f;
}

.metric-row.best .metric-label::after {
  background: #e8f6ef;
  border-radius: 999px;
  color: #13784f;
  content: "best";
  display: inline-block;
  font-size: 0.58rem;
  font-weight: 800;
  margin-left: 0.35rem;
  padding: 0.08rem 0.28rem;
  text-transform: uppercase;
  vertical-align: middle;
}

.chart-notes {
  color: #687a82;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.76rem;
  font-weight: 600;
  gap: 0.45rem 1rem;
  justify-content: center;
  margin-top: 0.9rem;
  text-align: center;
}

.note {
  color: #687a82;
  font-size: 0.9rem;
  margin-top: 0.45rem;
  text-align: left;
}

.rmcc-chart-grid {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.shape-method {
  background: #fbfbfb;
  border: 1px solid #eeeeee;
  border-radius: 6px;
  padding: 8px;
}

.shape-method.ours {
  border-color: #cfe9dd;
  box-shadow: inset 0 0 0 1px #e4f4ed;
}

.shape-method h3 {
  color: #2c3e50;
  font-size: 0.9rem;
  margin: 0 0 8px;
}

.shape-row {
  align-items: center;
  display: grid;
  gap: 3px;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 4px;
}

.shape-row:last-child {
  margin-bottom: 0;
}

.shape-row img {
  background: #ffffff;
  border-radius: 3px;
  max-height: none;
  object-fit: contain;
  width: 100%;
}

.objectwise-grid {
  align-items: center;
  display: grid;
  gap: 9px;
  grid-template-columns: 44px repeat(3, minmax(0, 1fr));
}

.objectwise-grid img {
  background: #ffffff;
  border: 1px solid #eeeeee;
  border-radius: 5px;
  max-height: 260px;
  object-fit: contain;
  padding: 4px;
  width: 100%;
}

.grid-heading,
.row-label {
  margin: 0;
}

.row-label {
  align-items: center;
  align-self: stretch;
  background: #f5f8f9;
  border: 1px solid #edf1f3;
  border-radius: 5px;
  color: transparent;
  display: flex;
  font-size: 0.78rem;
  font-weight: 700;
  justify-content: center;
  min-height: 132px;
  overflow: hidden;
  position: relative;
  text-align: center;
}

.row-label::after {
  color: #2c3e50;
  content: attr(data-label);
  left: 50%;
  line-height: 1;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
  transform-origin: center;
  white-space: nowrap;
}

.heading-spacer {
  visibility: hidden;
}

.figure-container figcaption {
  color: #666666;
  font-size: 0.92rem;
  line-height: 1.45;
  margin: 0.65rem auto 0;
  max-width: 720px;
}

.teaser-video-item figcaption {
  color: #7a858a;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.5;
  max-width: 820px;
}

.code-container {
  background: #f4f4f4;
  border-radius: 8px;
  color: #333333;
  margin: 0.5rem 0 0;
  overflow-x: auto;
  padding: 12px;
}

.code-container pre {
  background: transparent;
  color: inherit;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0;
  overflow-x: auto;
  white-space: pre;
}

.site-footer {
  color: #727f86;
  font-size: 0.92rem;
  margin: 2.5rem auto 1.5rem;
  text-align: center;
}

.site-footer p {
  text-align: center;
}

.footer-links {
  margin-bottom: 0.7rem;
}

.footer-links a {
  color: #59666b;
  display: inline-block;
  font-size: 1.45rem;
  margin: 0 0.35rem;
}

.toc-nav {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  font-size: 0.88rem;
  left: 20px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 15px;
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 188px;
  z-index: 1000;
}

.toc-nav h3 {
  border-bottom: 1px solid var(--border);
  color: #333333;
  font-size: 1rem;
  font-weight: 500;
  margin: 0 0 10px;
  padding-bottom: 8px;
}

.toc-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc-nav li {
  border-left: 2px solid transparent;
  margin: 7px 0;
  padding-left: 8px;
  transition: border-color 0.2s ease;
}

.toc-nav a {
  border-radius: 4px;
  color: #666666;
  display: block;
  padding: 4px 7px;
}

.toc-nav a:hover {
  background: #f5f5f5;
  color: var(--link);
  text-decoration: none;
}

.toc-nav li.active {
  border-left-color: var(--link);
}

.toc-nav li.active a {
  color: var(--link);
  font-weight: 500;
}

@media (min-width: 1180px) and (max-width: 1449px) {
  .page-shell {
    margin-left: 248px;
    margin-right: auto;
    max-width: calc(100vw - 300px);
  }
}

@media (max-width: 1179px) {
  body {
    padding-top: 12px;
  }

  .toc-nav {
    left: auto;
    margin: 0 auto 1rem;
    max-height: none;
    max-width: 920px;
    overflow: visible;
    padding: 10px;
    position: sticky;
    right: auto;
    top: 0;
    transform: none;
    width: 100%;
  }

  .toc-nav h3 {
    display: none;
  }

  .toc-nav ul {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .toc-nav li {
    border-bottom: 2px solid transparent;
    border-left: 0;
    flex: 0 0 auto;
    margin: 0;
    padding-left: 0;
  }

  .toc-nav a {
    padding: 6px 9px;
    white-space: nowrap;
  }

  .toc-nav li.active {
    border-bottom-color: var(--link);
    border-left-color: transparent;
  }
}

@media (max-width: 880px) {
  .claim-grid,
  .method-grid,
  .shape-grid,
  .rmcc-chart-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-dashboard-header,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .chart-legend {
    justify-content: flex-start;
  }
}

@media (max-width: 700px) {
  body {
    padding: 12px;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.55rem;
  }

  p {
    text-align: left;
  }

  .authors span,
  .affiliations span {
    display: block;
    margin: 0.18rem 0;
  }

  .author-break {
    display: none;
  }

  .links {
    gap: 9px;
  }

  .links a,
  .link-placeholder {
    justify-content: center;
    min-width: 132px;
  }

  .content-section {
    padding: 1rem;
  }

  .metric-dashboard {
    padding: 0.85rem;
  }

  .metric-card {
    padding: 0.8rem;
  }

  .metric-card-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.2rem;
  }

  .threshold-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.2rem;
  }

  .tau-note {
    font-size: 0.8rem;
  }

  .metric-row {
    gap: 0.45rem;
    grid-template-columns: 124px minmax(0, 1fr) 44px;
  }

  .metric-label,
  .metric-value {
    font-size: 0.73rem;
  }

  .chart-notes {
    justify-content: flex-start;
    text-align: left;
  }

  .wide-figure {
    margin-left: 0;
    transform: none;
    width: 100%;
  }

  .scene-mesh-grid,
  .shape-grid,
  .objectwise-grid,
  .adaptive-grid,
  .centroid-grid,
  .runtime-grid,
  .rmcc-case-grid,
  .rmcc-chart-grid,
  .claim-grid,
  .method-grid {
    grid-template-columns: 1fr;
  }

  .objectwise-grid .grid-heading:first-child,
  .objectwise-grid .grid-heading {
    display: none;
  }

  .row-label {
    background: #f5f5f5;
    border-radius: 4px;
    color: #2c3e50;
    min-height: auto;
    padding: 0.35rem;
    position: static;
    text-align: center;
  }

  .row-label::after {
    content: none;
  }
}
