/* Accommodate the shared sticky header without moving the existing content down. */
:root {
  --f-display: "Newsreader", "Songti SC", "Noto Serif SC", Georgia, serif;
  --f-body: "IBM Plex Sans", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --site-header-height: 65px;
  --site-anchor-offset: 89px;
}
html:has(.hf-unified) { scroll-padding-top: 89px; }
body.hf-unified { margin: 0; }
.hf-unified .hf-shell .hf-tag { font-family:var(--f-display) !important; font-weight:400; }
.hf-unified .hf-shell :is(.hf-copy,.hf-mono) { font-family:var(--f-mono) !important; font-weight:400 !important; }
.hf-unified > .homepage { padding-top: 87px; min-height: calc(100svh - 65px); }
.hf-unified.research-page .research-masthead { padding-top: 81px; }
@media(max-width:1100px) {
  .hf-unified.research-page .research-masthead { padding-top:67px; }
}
@media(max-width:820px) { .hf-unified > .homepage { padding-top:75px; } }
@media(max-width:700px) {
  .hf-unified.research-page .research-masthead { padding-top:51px; }
}
@media(max-width:600px) { .hf-unified > .homepage { padding-top:59px; } }
@media(min-width:1200px) {
  .hf-unified.research-page .research-masthead::before { top:91px; }
  .hf-unified.research-page .research-masthead::after { top:115px; }
}

/* Existing dark artwork stays intact when the shared theme preference is light. */
html[data-theme="light"]:has(.hf-home),
html[data-theme="light"]:has(.hf-careers) { color-scheme:light; background:#f2f4f7; }
:root[data-theme="light"] :is(body.hf-home,body.hf-careers) {
  --black:#f2f4f7; --white:#0e1116; --text-body:#4a5261;
  --blue:#1f51c6; --blue-light:#1f51c6; --line:#dce0e7;
  --careers-type:#0e1116; --careers-rule:#dce0e7;
  background:var(--black); color:var(--white);
}
:root[data-theme="light"] .hf-home .scene {
  background:#000; border-radius:14px;
}
:root[data-theme="light"] .hf-careers .careers-art {
  background:#000; border-radius:14px;
}
:root[data-theme="light"] .hf-careers .role-group h3 { color:#596375; }
:root[data-theme="light"] .hf-careers .role-arrow { color:#1f51c6; }
:root[data-theme="light"] :is(.hf-home,.hf-careers) :is(.copy-lead span,.intro .copy-block) {
  background:none; -webkit-text-fill-color:currentColor;
}
:root[data-theme="dark"]:has(.hf-home),
:root[data-theme="dark"]:has(.hf-careers) { color-scheme:dark; background:#000; }

/* Dark reading surfaces follow the Blog list's palette; original figures stay white. */
:root[data-theme="dark"] body.hf-unified.research-page {
  color-scheme:dark;
  --page:#0b0d11; --ink:#eef0f4; --body:#c5cbd5; --muted:#a8afbc;
  --blue:#7ea2ff; --line:#2d3440; --panel:#13161c;
  --blue-soft:#16213d; --red-soft:#302020; --accent:#ff958d; --accent-bright:#ff746c;
  background:var(--page); color:var(--body);
}
:root[data-theme="dark"] .hf-unified.research-page :is(
  .benchmark-highlights,.result-comparison,.result-pair,.editorial-results,
  .editorial-note,.figure-dialog,.research-details,.comparison-panel,
  .editorial-insight,.paper-references
) { background:#13161c; border-color:var(--line); color:var(--body); }
:root[data-theme="dark"] .hf-unified.research-page :is(
  .masthead-subtitle,.masthead-category,.article-return a,.benchmark-scope,
  .benchmark-comparison,.benchmark-source,.benchmark-gain,.benchmark-scores dt,
  .caption-title,table caption,.reading-note,.chart-scale,.comparison-row dt,
  .result-pair div>span,.result-comparison-heading,.comparison-panel h4,
  .paper-keywords a,.masthead-byline,.toc-label,.toc a,.paper-section code
) { color:var(--muted); }
:root[data-theme="dark"] .hf-unified.research-page :is(
  .benchmark-highlights h2,.benchmark-scores dd,#article strong,
  #article .comparison-row strong,.comparison-row.ours dt,.citation,.citation a
) { color:var(--blue); }
:root[data-theme="dark"] .hf-unified.research-page #article :is(.reading-note,.chart-scale) { color:var(--muted); }
:root[data-theme="dark"] .hf-unified.research-page #article .paper-key-claim {
  background:var(--panel); color:var(--body);
}
:root[data-theme="dark"] .hf-unified.research-page :is(.mobile-contents,.finding-list,.table-scroll,table,th,td) {
  border-color:var(--line);
}
:root[data-theme="dark"] .hf-unified.research-page th { background:var(--panel); color:var(--ink); }
:root[data-theme="dark"] .hf-unified.research-page .comparison-track { background:#2b3442; }
:root[data-theme="dark"] .hf-unified.research-page .paper-download { background:#eceef2; border-color:#eceef2; color:#0e1116; }
:root[data-theme="dark"] .hf-unified.research-page .paper-download:hover { background:#fff; }
:root[data-theme="dark"] .hf-unified.research-page .figure-dialog .viewer-toolbar { background:var(--panel); border-color:var(--line); }
:root[data-theme="dark"] .hf-unified.research-page .figure-dialog button { color:var(--ink); }
:root[data-theme="dark"] .hf-unified.research-page .original-figure .figure-link { background:#fff; border-color:var(--line); }
:root[data-theme="dark"] .hf-unified.research-page :is(.editorial-insight p,.editorial-results em,.research-details>summary,.mobile-contents summary,.toc-note) { color:var(--body); }
:root[data-theme="dark"] .hf-unified.research-page tbody tr:nth-child(even) { background:var(--panel); }
:root[data-theme="dark"] .hf-unified.research-page .viewer-toolbar button { background:#202632; border-color:var(--line); color:var(--ink); }
:root[data-theme="dark"] .hf-unified.research-page .viewer-toolbar button:hover { background:#303b4b; }
:root[data-theme="dark"] .hf-unified.research-page .research-details>summary:hover { background:var(--panel); }
@media print {
  .hf-unified > :is(.hf-site-head,.hf-site-foot) { display:none; }
}
