:root {
  --text: #222222;
  --muted: #555555;
  --link: #1772d0;
  --link-hover: #f09228;
  --panel: #f2f2f2;
  --line: #d8d8d8;
  --soft-line: #ececec;
  --code: #f7f7f7;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: #ffffff;
  font-family: Lato, Verdana, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

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

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

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

.container {
  width: min(100%, 1000px);
  margin: 0 auto;
  padding: 24px 15px;
}

.title-block {
  text-align: center;
}

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

h1 {
  margin: 0 auto 18px;
  max-width: 960px;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.18;
}

h2 {
  margin: 0 0 12px;
  font-size: 28px;
  line-height: 1.2;
}

h3 {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.25;
}

p {
  margin: 0 0 14px;
}

.author-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.author-list li {
  display: inline-block;
  font-size: 16px;
}

.affiliation {
  margin-top: 10px;
  color: var(--muted);
  text-align: center;
}

.resource-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  width: min(520px, 100%);
  margin: 24px auto 0;
}

.resource-nav.two-links {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(260px, 100%);
}

.resource-nav a {
  display: grid;
  justify-items: center;
  gap: 7px;
  color: var(--text);
}

.resource-nav a:hover strong {
  color: var(--link-hover);
}

.paper-thumb,
.github-icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.paper-thumb {
  align-content: start;
  justify-items: start;
  gap: 5px;
  padding: 8px;
  color: #222222;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.paper-thumb span:first-child {
  width: 100%;
  padding-bottom: 4px;
  border-bottom: 2px solid #24597a;
  color: #24597a;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.paper-thumb span:not(:first-child) {
  display: block;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: #d5dce2;
}

.paper-thumb span:last-child {
  width: 70%;
}

.github-icon {
  border-radius: 999px;
  color: #ffffff;
  background: #333333;
}

.github-icon svg {
  width: 34px;
  height: 34px;
  fill: currentColor;
}

.caption,
figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
  text-align: left;
}

.paper-panel {
  width: min(820px, calc(100% - 30px));
  margin: 0 auto 28px;
  padding: 22px 24px;
  background: var(--panel);
}

.paper-panel p,
.section p {
  text-align: justify;
}

figure {
  margin: 18px 0;
}

figure img {
  margin: 0 auto;
}

.figure-surface {
  padding: 14px;
  background: #ffffff;
}

.section {
  width: min(820px, calc(100% - 30px));
  margin: 0 auto;
  padding: 18px 0 12px;
}

.key-idea {
  width: min(1040px, calc(100% - 30px));
}

.key-sentence {
  padding: 12px 14px;
  border-left: 4px solid var(--link);
  background: var(--panel);
  font-weight: 700;
}

.result-block {
  margin: 24px 0 34px;
}

.result-block figure img {
  width: min(100%, 720px);
}

.rollout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 24px;
}

.rollout-grid figure {
  width: min(100%, 755px);
  margin: 0;
  border: 1px solid var(--soft-line);
  background: #ffffff;
}

.gif-control {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #111111;
  cursor: pointer;
}

.rollout-grid img,
.rollout-grid canvas {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  background: #111111;
}

.gif-control img[hidden],
.gif-control canvas[hidden] {
  display: none;
}

.gif-state {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.66);
}

.gif-state::before,
.gif-state::after {
  position: absolute;
  top: 10px;
  bottom: 10px;
  width: 5px;
  border-radius: 2px;
  background: #ffffff;
  content: "";
}

.gif-state::before {
  left: 11px;
}

.gif-state::after {
  right: 11px;
}

.gif-control.is-paused .gif-state::before {
  top: 8px;
  bottom: auto;
  left: 12px;
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 14px solid #ffffff;
  border-radius: 0;
  background: transparent;
}

.gif-control.is-paused .gif-state::after {
  display: none;
}

.rollout-grid figcaption {
  min-height: 48px;
  margin: 0;
  padding: 10px 12px;
  color: var(--text);
  font-weight: 700;
}

[data-zoomable] {
  cursor: zoom-in;
}

.zoom-open {
  overflow: hidden;
}

.zoom-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: block;
  overflow: auto;
  padding: 36px;
  text-align: center;
  background: rgba(255, 255, 255, 0.96);
  cursor: zoom-out;
}

.zoom-overlay[hidden] {
  display: none;
}

.zoom-overlay img {
  display: block;
  width: auto;
  max-width: none;
  height: calc(100vh - 72px);
  max-height: none;
  margin: 0 auto;
  object-fit: contain;
  background: #ffffff;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
}

.zoom-close {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 101;
  padding: 7px 12px;
  border: 1px solid #222222;
  border-radius: 8px;
  color: #222222;
  background: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  font: inherit;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  margin: 14px 0 20px;
  border-collapse: collapse;
  font-size: 15px;
}

.result-note {
  margin: -4px 0 18px;
  color: var(--muted);
  font-size: 14px;
}

th,
td {
  padding: 8px 10px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--panel);
  font-weight: 700;
}

td:not(:first-child),
th:not(:first-child) {
  text-align: right;
}

.key-table td,
.key-table th {
  text-align: left;
}

.key-table th:not(:first-child),
.key-table td:not(:first-child) {
  min-width: 210px;
}

.key-table td:first-child {
  min-width: 220px;
  font-weight: 700;
}

pre {
  position: relative;
  overflow-x: auto;
  margin: 0;
  padding: 15px;
  border: 1px solid #cccccc;
  background: var(--code);
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  white-space: pre;
}

.bibtex-box {
  position: relative;
}

#copyButton {
  position: absolute;
  top: 10px;
  right: 15px;
  z-index: 1;
  padding: 5px 10px;
  border: 1px solid #000000;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  font: inherit;
}

hr {
  margin-top: 24px;
  border: 0;
  border-top: 1px solid var(--line);
}

@media (max-width: 760px) {
  .container {
    padding: 20px 12px;
  }

  h1 {
    font-size: 26px;
  }

  h2 {
    font-size: 24px;
  }

  .resource-nav,
  .rollout-grid {
    grid-template-columns: 1fr;
  }

  .resource-nav {
    width: min(340px, 100%);
  }

  .resource-nav.two-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(240px, 100%);
  }

  .paper-panel,
  .section {
    width: calc(100% - 20px);
  }

  .paper-panel {
    padding: 18px;
  }

  .zoom-overlay {
    padding: 18px;
  }
}
