/* RethinkOPD page components & interactive visualization polish */
.opd-page .resource-link[aria-disabled="true"],
.opd-page .resource-link[aria-disabled="true"]:hover {
  color: #5f6368;
  background: #f8f9fa;
  border-color: #e8eaed;
  cursor: default;
  transform: none;
}
.opd-page .resource-link .icon-arxiv { color: #b31b1b; }
.opd-page .resource-link .icon-github { color: #202124; }
.opd-page .resource-link .icon-hf { width: 16px; height: 16px; }

.opd-page .paper-figure { margin: 22px 0 28px; }
.opd-page .paper-figure img { display: block; width: 100%; height: auto; border-radius: 6px; }
.opd-page .figure-zoom-btn {
  display: block;
  width: 100%;
  padding: 6px;
  border: 1px solid #e8eaed;
  border-radius: 10px;
  background: #fff;
  cursor: zoom-in;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.opd-page .figure-zoom-btn:hover { border-color: #c2d7fb; box-shadow: 0 4px 16px rgba(26, 115, 232, 0.08); }
.opd-page .paper-figure figcaption { font: 12.5px/1.65 var(--sans); color: var(--muted); margin-top: 10px; text-wrap: pretty; }
.opd-page .paper-figure figcaption strong { color: var(--ink); }

.opd-page .figure-dialog { width: min(1280px, calc(100% - 28px)); max-width: none; max-height: 92vh; border: 1px solid #dadce0; padding: 18px; background: #fff; border-radius: 12px; box-shadow: 0 20px 56px rgba(0, 0, 0, 0.22); }
.opd-page .figure-dialog::backdrop { background: rgba(32, 33, 36, 0.6); backdrop-filter: blur(2px); }
.opd-page .figure-dialog img { display: block; width: 100%; height: auto; }
.opd-page .figure-dialog-body { overflow: auto; max-height: calc(92vh - 96px); }
.opd-page .figure-zoom-controls { display: flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 12px; }
.opd-page .figure-dialog-head { display: flex; justify-content: space-between; gap: 15px; align-items: center; margin-bottom: 14px; font: 13px var(--sans); }
.opd-page .figure-dialog-head > span { flex: 1; min-width: 0; font-weight: 600; color: var(--ink); }
.opd-page .figure-dialog-head button { padding: 5px 10px; border: 1px solid #dadce0; border-radius: 6px; background: #fff; font-weight: 500; }
.opd-page .figure-dialog-head button:hover { background: #f1f3f4; }

.opd-page .headline-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 20px 0 30px; }
.opd-page .stat-card {
  min-width: 0;
  padding: 14px 15px;
  border: 1px solid #e8eaed;
  border-radius: 10px;
  background: #f8f9fa;
  border-top: 2.5px solid var(--green);
}
.opd-page .stat-card:last-child { border-top-color: var(--accent); }
.opd-page .stat-card b { display: block; font: 700 24px/1.15 var(--serif); font-variant-numeric: tabular-nums; color: var(--green); letter-spacing: -.3px; }
.opd-page .stat-card:last-child b { color: #0b57d0; }
.opd-page .stat-card span { display: block; margin-top: 5px; font: 11.5px/1.48 var(--sans); color: var(--ink-2); }

.opd-page .affiliations-list {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  font: 11px/1.65 var(--sans);
  color: var(--muted);
  margin: 0 0 12px;
}
.opd-page .affiliations-list span { white-space: nowrap; }
.opd-page .institution-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  border: 1px solid #e2e6ec;
  border-radius: 6px;
  background: #fff;
  font: 600 10.5px/1.25 var(--sans);
  color: #3c4043;
  text-decoration: none;
  white-space: nowrap;
}
.opd-page .institution-badge sup { color: #7a7a7a; font-weight: 400; }

.opd-page .routing-diagram { margin: 12px 0 6px; }
.opd-page .routing-diagram svg { display: block; width: 100%; height: auto; }
.opd-page .shift-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #f8f9fa;
  border: 1px solid #e8eaed;
  font: 12px/1.4 var(--sans);
}
.opd-page .shift-slider-wrap { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 220px; }
.opd-page .shift-slider-wrap input[type="range"] { flex: 1; max-width: 210px; }
.opd-page .shift-pills { display: flex; flex-wrap: wrap; gap: 8px; font-variant-numeric: tabular-nums; }
.opd-page .shift-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #dadce0;
  font-size: 11.5px;
  color: var(--ink-2);
}
.opd-page .shift-pill b { color: var(--green); }
.opd-page .shift-pill.blue b { color: var(--tint-ink); }

.opd-page .winner-summary { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-bottom: 12px; font: 12px var(--sans); color: var(--muted); }
.opd-page .winner-metric {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 8px;
  background: #f8f9fa;
  border: 1px solid #eef0f3;
}
.opd-page .winner-metric b { font: 700 20px/1 var(--serif); font-variant-numeric: tabular-nums; }

.opd-page .method-legend button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid #e8eaed;
  background: #fff;
  transition: opacity .15s, background .15s;
}
.opd-page .method-legend button:hover { background: #f8f9fa; }
.opd-page .method-legend button[aria-pressed="false"] { opacity: .38; text-decoration: line-through; }

.opd-page .heatmap-scroll { overflow-x: auto; padding-bottom: 4px; }
.opd-page .heatmap-scroll .chart { min-width: 660px; }

.opd-page .target-transform {
  margin-top: 18px;
  padding: 16px 18px;
  background: #f8f9fa;
  border: 1px solid #e8eaed;
  border-radius: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: center;
}
.opd-page .target-schematic svg { display: block; width: 100%; height: auto; margin: 3px 0; }
.opd-page .target-formula { font: 20px var(--serif); margin-bottom: 6px; color: var(--ink); }
.opd-page .target-explanation { font: 11.5px/1.6 var(--sans); color: var(--muted); }
.opd-page .slider-label { display: flex; justify-content: space-between; gap: 10px; font: 600 11.5px var(--sans); color: var(--ink-2); }
.opd-page input[type="range"] { accent-color: var(--green); width: 100%; cursor: ew-resize; }

.opd-page .pillars-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 18px 0 24px; }
.opd-page .pillar-card {
  padding: 16px 17px;
  border: 1px solid #e2ece8;
  border-radius: 10px;
  background: linear-gradient(180deg, #f7fbf9 0%, #ffffff 100%);
}
.opd-page .pillar-card small { display: block; font: 700 10px/1.4 var(--sans); letter-spacing: .6px; color: var(--green); margin-bottom: 6px; }
.opd-page .pillar-card h3 { font: 600 14.5px/1.35 var(--sans); margin: 0 0 7px; color: var(--ink); }
.opd-page .pillar-card p { font: 12.5px/1.6 var(--sans); color: var(--ink-2); margin: 0; }

.opd-page .rules-box {
  margin: 22px 0;
  padding: 16px 20px;
  border: 1px solid #dce6f7;
  border-left: 3.5px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: #f5f9ff;
}
.opd-page .rules-box h3 { font: 600 14.5px/1.4 var(--sans); color: var(--tint-ink); margin: 0 0 10px; }
.opd-page .rules-box ol { margin: 0; padding-left: 18px; font: 13.5px/1.65 var(--sans); color: var(--ink-2); }
.opd-page .rules-box li + li { margin-top: 6px; }
.opd-page .rules-box strong { color: var(--ink); }

.opd-page .audit-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 16px 0 6px; }
.opd-page .audit-item { padding: 13px 15px; border: 1px solid #e8eaed; border-radius: 10px; background: #f8f9fa; }
.opd-page .audit-item b { display: block; font: 700 21px/1.2 var(--serif); font-variant-numeric: tabular-nums; color: var(--tint-ink); }
.opd-page .audit-item span { display: block; margin-top: 4px; font: 11.5px/1.48 var(--sans); color: var(--ink-2); }

.opd-page .viz-subhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font: 600 12px/1.3 var(--sans);
  color: var(--ink-2);
}
.opd-page .viz-subhead small { font-weight: 500; color: var(--muted); font-size: 11px; }

.opd-page .gallery-prompt {
  display: flex;
  gap: 14px;
  align-items: center;
  margin: 14px 0 16px;
  padding: 10px 14px;
  border-radius: 9px;
  background: #f8f9fa;
  border: 1px solid #eef0f3;
}
.opd-page .gallery-input { width: 64px; height: 64px; object-fit: cover; background: #fff; border: 1px solid #e2e6ec; border-radius: 6px; flex-shrink: 0; transition: opacity .15s ease; }
.opd-page .gallery-input[hidden] { display: none; }
.opd-page .gallery-prompt small { font: 600 10.5px var(--sans); letter-spacing: .3px; color: var(--muted); display: block; margin-bottom: 2px; }
.opd-page .gallery-prompt p { font: 16px/1.45 var(--serif); margin: 0; color: var(--ink); }

.opd-page .comparison-wrap { max-width: 560px; margin: 0 auto; }
.opd-page .comparison-wrap.wide { max-width: 720px; }
.opd-page .comparison-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.opd-page .comparison-head label { display: flex; gap: 7px; align-items: center; min-width: 0; font: 12px var(--sans); }
.opd-page .side-label { width: 22px; height: 22px; background: var(--ink); color: #fff; text-align: center; line-height: 22px; font-weight: 600; font-size: 11px; border-radius: 5px; flex-shrink: 0; }
.opd-page .comparison-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f8f9fa;
  border: 1px solid #e2e6ec;
  border-radius: 10px;
}
.opd-page .comparison-wrap.wide .comparison-stage { aspect-ratio: 16 / 11; }
.opd-page .comparison-stage img { width: 100%; height: 100%; object-fit: contain; position: absolute; inset: 0; transition: opacity .15s ease; }
.opd-page .comparison-stage img.is-loading, .opd-page .gallery-input.is-loading { opacity: 0.16; }
.opd-page .comparison-right { clip-path: inset(0 0 0 var(--split, 50%)); background: #f8f9fa; }
.opd-page .comparison-line { position: absolute; left: var(--split, 50%); top: 0; bottom: 0; width: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(32, 33, 36, 0.35); pointer-events: none; }
.opd-page .comparison-handle { position: absolute; left: var(--split, 50%); top: 50%; transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25); text-align: center; line-height: 34px; font: 600 14px/34px var(--sans); color: var(--ink); pointer-events: none; }
.opd-page .comparison-badge { position: absolute; bottom: 10px; background: rgba(32, 33, 36, 0.86); backdrop-filter: blur(4px); color: #fff; font: 600 11px var(--sans); padding: 5px 10px; border-radius: 6px; z-index: 2; }
.opd-page .comparison-badge.left { left: 10px; }
.opd-page .comparison-badge.right { right: 10px; }
.opd-page .comparison-stage input { position: absolute; inset: 0; z-index: 3; opacity: 0; height: 100%; margin: 0; cursor: ew-resize; }
.opd-page .comparison-stage:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.opd-page .comparison-slider { display: flex; align-items: center; gap: 10px; font: 600 11px var(--sans); color: var(--muted); margin-top: 12px; }
.opd-page .gallery-index { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.opd-page .gallery-index button { width: 30px; height: 30px; border: 1px solid #dadce0; border-radius: 6px; font-size: 12px; font-weight: 500; background: #fff; }
.opd-page .gallery-index button:hover { background: #f1f3f4; }
.opd-page .gallery-index button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

.opd-page .no-js { font: 13px var(--sans); padding: 12px; background: #f8f9fa; border-radius: 8px; }
.opd-page .header-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.opd-page .header-actions .language-toggle { margin-left: 0; }
.opd-page .more-research { position: relative; font-family: var(--sans); }
.opd-page .more-research-toggle { display: flex; align-items: center; gap: 6px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 12px; font-weight: 500; line-height: 1.2; white-space: nowrap; }
.opd-page .more-research-toggle:hover, .opd-page .more-research-toggle[aria-expanded="true"] { background: var(--surface-3); }
.opd-page .more-research-toggle svg { width: 10px; height: 10px; flex: none; transition: transform .15s; }
.opd-page .more-research-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.opd-page .more-research-links { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; display: flex; flex-direction: column; min-width: 190px; padding: 5px; background: #fff; border: 1px solid var(--line-soft); border-radius: 8px; box-shadow: 0 8px 24px rgba(32, 33, 36, 0.12); }
.opd-page .more-research-links[hidden] { display: none; }
.opd-page .more-research-links a { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 9px 12px; border-radius: 6px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.opd-page .more-research-links a:hover { background: var(--surface-3); color: var(--ink); }

@media (max-width: 760px) {
  .opd-page .headline-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .opd-page .pillars-grid, .opd-page .audit-strip { grid-template-columns: 1fr; }
  .opd-page .paper-figure { margin: 18px 0 24px; }
  .opd-page .paper-figure figcaption { font-size: 11.5px; }
  .opd-page .target-transform { grid-template-columns: 1fr; gap: 14px; padding: 14px; }
  .opd-page .comparison-head { gap: 8px; flex-wrap: wrap; }
  .opd-page .comparison-head select { font-size: 11px; padding: 5px; }
  .opd-page .gallery-prompt p { font-size: 14.5px; }
  .opd-page .comparison-badge { font-size: 10px; }
  .opd-page .figure-dialog { padding: 12px; }
  .opd-page .figure-dialog-head { font-size: 12px; }
  .opd-page .header-actions { gap: 8px; }
  .opd-page .more-research-toggle { font-size: 11.5px; padding: 5px 8px; }
}
@media (max-width: 370px) {
  .opd-page .brand { font-size: 17px; }
  .opd-page .language-toggle button { font-size: 10px; padding: 5px 7px; }
  .opd-page .more-research-toggle { font-size: 10.5px; gap: 4px; padding: 5px 7px; }
}
