:root {
  --text: #202124;
  --muted: #5f6368;
  --line: #e5e7eb;
  --soft: #f7f8fa;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --yellow-soft: #fff9db;
  --max: 980px;
  --prose: 900px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

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

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

.hero { padding: 74px 0 52px; }
.hero-inner { text-align: center; }
.hero h1 {
  margin: 0;
  font-size: clamp(3rem, 8vw, 5.7rem);
  line-height: 0.98;
  font-weight: 780;
  letter-spacing: -0.055em;
}
.subtitle {
  max-width: 920px;
  margin: 20px auto 18px;
  font-size: clamp(1.25rem, 2.6vw, 1.85rem);
  line-height: 1.35;
  font-weight: 500;
}
.authors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 5px 18px;
  margin-top: 18px;
  font-size: 1.05rem;
}
.authors a { line-height: 1.35; }
.authors sup {
  vertical-align: baseline;
  position: relative;
  top: -0.48em;
  line-height: 0;
  font-size: 0.68em;
}
.affiliations {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 16px;
  margin-top: 8px;
  font-size: 0.92rem;
}
.links { display: flex; justify-content: center; gap: 9px; margin-top: 23px; flex-wrap: wrap; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  padding: 7px 15px;
  border: 1px solid #dadce0;
  border-radius: 7px;
  background: #fff;
  color: #222;
  font-weight: 600;
  font-size: 0.92rem;
}
.button:hover { text-decoration: none; border-color: #9aa0a6; background: #fafafa; }
.intro {
  max-width: 820px;
  margin: 34px auto 0;
  text-align: left;
  font-size: 1.08rem;
  line-height: 1.72;
}

.section { padding: 52px 0 58px; border-top: 1px solid #f1f3f4; }
.section.alt { background: #fafafa; }
.section h2 {
  margin: 0 0 17px;
  font-size: clamp(1.85rem, 3.3vw, 2.35rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
  font-weight: 720;
}
.section h3 {
  margin: 22px 0 7px;
  font-size: 1.25rem;
  line-height: 1.3;
  font-weight: 680;
}
p { margin: 0 0 16px; }
.small-note { color: var(--muted); font-size: 0.93rem; }

.math-center { overflow-x: auto; padding: 4px 0 6px; }
mjx-container[display="true"] { margin: 0.9em 0 !important; overflow-x: auto; overflow-y: hidden; }

.latex-block {
  margin: 26px 0 4px;
  border: 1px solid #dfe3e8;
  border-radius: 8px;
  background: #fff;
  padding: 15px 22px 12px;
  overflow-x: auto;
}
.latex-title {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: 1.02rem;
  padding-bottom: 9px;
  border-bottom: 1px solid #e5e7eb;
}
.algorithm-block mjx-container { font-size: 103% !important; }
.framework-block mjx-container { font-size: 99% !important; }

.figure { margin: 26px 0 16px; text-align: center; }
.figure img { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.figure figcaption {
  margin: 8px auto 0;
  max-width: 790px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--muted);
}
.wide-figure img { width: min(820px, 100%); }
.two-col {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 34px;
  align-items: start;
  margin-top: 24px;
}
.two-col .figure { margin: 0; }

.table-scroll { overflow-x: auto; margin: 26px 0 8px; }
.table-narrow { max-width: 650px; margin: 25px auto 0; }
.mini-table-wrap { overflow-x: auto; margin-top: 20px; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.91rem;
  line-height: 1.42;
  background: #fff;
}
.data-table caption {
  caption-side: top;
  text-align: left;
  font-weight: 650;
  color: #333;
  margin-bottom: 8px;
}
.data-table th,
.data-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #e5e7eb;
  text-align: center;
  white-space: nowrap;
}
.data-table th { border-top: 1.5px solid #222; border-bottom: 1px solid #222; font-weight: 650; background: #fff; }
.data-table td:first-child, .data-table th:first-child { text-align: left; }
.data-table .best td { background: var(--yellow-soft); }
.data-table .group-start td { border-top: 1.5px solid #b8bcc2; }
.data-table .model-cell { font-weight: 650; vertical-align: middle; }
.data-table.compact { font-size: 0.82rem; }
.data-table.compact th, .data-table.compact td { padding: 7px 8px; }
.fp4-table { min-width: 850px; }
.fp4-table .method-col,
.fp4-table .method-cell {
  text-align: left !important;
  min-width: 112px;
  padding-left: 14px;
}
.tricks-table { min-width: 760px; }
.tricks-table td:not(:first-child), .tricks-table th:not(:first-child) { text-align: center; }

.theorem {
  margin: 28px 0;
  padding: 18px 22px 16px;
  border-left: 3px solid #222;
  background: #fff;
  box-shadow: 0 0 0 1px #e5e7eb inset;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.02rem;
}
.theorem-name { font-weight: 700; margin-bottom: 8px; }
.theorem p { margin-bottom: 10px; }
.theorem-note { color: #444; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 0.91rem; line-height: 1.58; }
.theory-figure { max-width: 650px; margin-left: auto; margin-right: auto; }

.bibtex-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.copy-button {
  border: 1px solid #dadce0;
  background: #fff;
  border-radius: 6px;
  padding: 6px 12px;
  font-weight: 600;
  cursor: pointer;
}
.copy-button:hover { background: #f8f9fa; }
.bibtex {
  margin: 0;
  padding: 17px 19px;
  overflow-x: auto;
  background: #f6f8fa;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  font-size: 0.86rem;
  line-height: 1.55;
}

footer { border-top: 1px solid #e5e7eb; padding: 27px 0 38px; color: var(--muted); font-size: 0.85rem; }
.footer-inner { text-align: center; }
.footer-inner p { margin: 0; }

@media (max-width: 760px) {
  .hero { padding-top: 52px; }
  .container, .prose { width: min(100% - 28px, var(--max)); }
  .section { padding: 42px 0 46px; }
  .two-col { grid-template-columns: 1fr; gap: 12px; }
  .latex-block { padding: 13px 12px 10px; }
  .algorithm-block mjx-container { font-size: 88% !important; }
  .framework-block mjx-container { font-size: 86% !important; }
  .theorem { padding: 16px 15px 14px; }
}
