:root {
  --bg: #ffffff;
  --text: #111827;
  --muted: #4b5563;
  --line: #e5e7eb;
  --soft: #f9fafb;
  --soft2: #f3f4f6;
  --blue: #2563eb;
  --green: #059669;
  --amber: #d97706;
  --red: #dc2626;
  --radius: 12px;
  --max: 1040px;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  --serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }

.hero {
  padding: 54px 0 24px;
  text-align: center;
}
.title {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 1080px;
  margin: 0 auto 24px;
  font-size: 42px;
  line-height: 1.12;
  letter-spacing: -0.4px;
  font-weight: 850;
}
.title span {
  display: block;
  white-space: nowrap;
}
.subtitle {
  max-width: 860px;
  margin: 0 auto 18px;
  color: var(--muted);
  font-size: 17px;
}
.authorline {
  max-width: 1120px;
  margin: 0 auto 14px;
  font-size: 20px;
}
.authorrow {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 8px 0;
}
.author { font-weight: 750; }
sup { color: #6b7280; font-size: 12px; }
.affils {
  margin: 10px auto 18px;
  color: #374151;
  font-size: 16px;
}
.note {
  margin-top: 8px;
  color: #6b7280;
  font-size: 13px;
}
.emails { font-family: var(--mono); }

.corner-badge {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 20;
}
.corner-badge img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, .08);
  background: #fff;
  box-shadow: 0 5px 16px rgba(0, 0, 0, .12);
}

.btnrow, .badge-row, .mininav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.pbtn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 17px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  border: 1px solid #111827;
  font-size: 15px;
  font-weight: 750;
}
.pbtn:hover { background: #0b1220; color: #fff; text-decoration: none; }
.pbtn .ico { width: 18px; height: 18px; }
.pbtn .btn-emoji {
  font-size: 18px;
  line-height: 1;
}
.resource-row {
  margin-top: 12px;
}
.badge-row { margin: 18px 0 10px; }
.mininav {
  margin-top: 16px;
  color: #6b7280;
  font-size: 14px;
}
.mininav a { color: #6b7280; }
.mininav a:hover { color: var(--text); text-decoration: none; }

.section { padding: 26px 0; }
h2 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 26px;
}
h3 {
  margin: 22px 0 10px;
  font-family: var(--serif);
  font-size: 19px;
}
p { margin: 10px 0; }
.muted { color: var(--muted); }
.small { color: var(--muted); font-size: 13px; }
ul { margin: 8px 0 0; padding-left: 20px; }
li { margin: 6px 0; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.metric-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
  padding: 14px;
}
.metric-card b {
  display: block;
  font-size: 24px;
  line-height: 1.1;
}
.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 5px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.figure {
  padding: 12px;
  margin: 18px auto;
  max-width: 920px;
}
.figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
}
figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}
.figure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  max-width: 980px;
  margin: 0 auto 32px;
  align-items: start;
}
.figure-grid .figure {
  display: flex;
  flex-direction: column;
  max-width: none;
}
.figure-grid .figure img {
  height: 310px;
  object-fit: contain;
}

.tablewrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
table {
  width: 100%;
  min-width: 900px;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  text-align: center;
}
th {
  background: var(--soft);
  font-weight: 800;
  vertical-align: middle;
}
td:first-child, th:first-child {
  text-align: left;
}
thead th:not(:first-child) {
  text-align: center;
}
.leaderboard-wrap table col:first-child,
.leaderboard-wrap th[rowspan],
.leaderboard-wrap td:first-child {
  width: 34%;
}
.leaderboard-wrap thead tr:first-child th:not(:first-child) {
  position: relative;
  border-bottom: 0;
  text-align: center;
}
.leaderboard-wrap thead tr:first-child th:not(:first-child)::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 0;
  border-bottom: 1px solid var(--line);
}
.leaderboard-wrap thead tr:first-child th[colspan="5"]::after {
  left: 6%;
  right: 6%;
}
.leaderboard-wrap thead tr:nth-child(2) th {
  border-top: 0;
  text-align: center;
}
.group td {
  background: #f1f5f9;
  color: #334155;
  font-weight: 850;
}
.ours td {
  background: #ecfdf5;
  font-weight: 850;
}
mark.best {
  background: rgba(5, 150, 105, .17);
  color: #064e3b;
  border-radius: 7px;
  padding: 1px 5px;
}

.sample-block, .case-block {
  margin: 20px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.sample-block h3, .case-block h3 { margin-top: 0; }
.sample-block video, .case-block video {
  display: block;
  width: 100%;
  max-height: 560px;
  margin: 12px 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #000;
}
.tag {
  display: inline-flex;
  margin-left: 6px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--soft);
  font-family: var(--sans);
  font-size: 12px;
}
.prompt-box {
  margin: 12px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
}
.prompt-box b {
  display: block;
  color: var(--blue);
  margin-bottom: 6px;
}
.details {
  margin: 10px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.details summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
  background: var(--soft);
  font-weight: 800;
}
.details summary::-webkit-details-marker { display: none; }
.details summary:after {
  content: "+";
  float: right;
  color: var(--muted);
}
.details[open] summary:after { content: "-"; }
.details-body {
  padding: 14px;
  color: #1f2937;
  font-size: 14px;
}
.details-body pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
}
.error-list {
  margin: 0;
}
.output-panel {
  margin: 12px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.output-panel h4 {
  margin: 0 0 8px;
  color: #374151;
  font-size: 14px;
}
.output-panel pre {
  max-height: none;
  white-space: pre-wrap;
}
.analysis-panel {
  background: #fffbeb;
  border-color: #fde68a;
}
.ours-panel {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.codebox {
  padding: 12px;
}
.sample-json {
  margin-top: 14px;
}
.sample-json summary {
  color: #111827;
}
pre {
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
  font-family: var(--mono);
  font-size: 12.5px;
}
pre.language-json {
  border-color: #1f2937;
  background: #0f172a;
  color: #d1d5db;
}
.json-key { color: #93c5fd; }
.json-string { color: #86efac; }
.json-number { color: #fbbf24; }
.json-literal { color: #f0abfc; }
.copybtn {
  cursor: pointer;
  margin-bottom: 10px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-weight: 750;
}
footer {
  margin-top: 20px;
  padding: 24px 0 38px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1250px) {
  .title {
    font-size: 38px;
  }
  .authorline {
    font-size: 18px;
  }
}

@media (max-width: 720px) {
  .container { width: min(100% - 28px, var(--max)); }
  .title {
    width: auto;
    margin: 0 auto 22px;
    font-size: 34px;
  }
  .title span { white-space: normal; }
  .figure-grid .figure img {
    height: auto;
  }
  .subtitle { font-size: 15px; }
  .authorline { font-size: 15px; }
  .affils { font-size: 14px; }
  .corner-badge { display: none; }
  .pbtn { font-size: 14px; padding: 9px 14px; }
}
