/* ============ AnalogRetriever project page ============ */

:root {
  --ar-primary: #2b5dd1;
  --ar-primary-dark: #1d3f91;
  --ar-accent: #e8491d;
  --ar-text: #363636;
  --ar-muted: #6b7280;
  --ar-bg-soft: #f6f8fc;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans', 'Google Sans', 'Helvetica Neue', Arial, sans-serif;
  color: var(--ar-text);
}

/* ---------- Hero ---------- */
.hero.is-light.ar-hero {
  background: linear-gradient(180deg, #ffffff 0%, var(--ar-bg-soft) 100%);
  padding-top: 3rem;
  padding-bottom: 1rem;
}

.publication-title {
  font-weight: 700;
  line-height: 1.18;
}

.ar-gradient-text {
  background: linear-gradient(90deg, var(--ar-primary) 0%, #6a8bf0 60%, var(--ar-accent) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.publication-subtitle {
  color: var(--ar-muted);
  font-size: 1.25rem;
  font-weight: 400;
  margin-top: 0.5rem;
}

.ar-venue {
  display: inline-block;
  margin-top: 0.9rem;
  padding: 0.3rem 1rem;
  border-radius: 999px;
  background: #eef2fe;
  color: var(--ar-primary-dark);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.publication-authors {
  margin-top: 1.4rem;
  font-size: 1.15rem;
}
.author-block { display: inline-block; margin: 0 0.55rem; }
.publication-authors a { color: var(--ar-primary); text-decoration: none; }

/* ---- per-institution colours (name = gradient, matches affiliation) ---- */
.publication-authors a.aff-thu,
.publication-authors a.aff-hku,
.publication-authors a.aff-cam,
.publication-authors a.aff-njupt {
  font-weight: 700;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.publication-authors a.aff-thu   { background-image: linear-gradient(90deg, #7c3aed, #c026d3); }
.publication-authors a.aff-hku   { background-image: linear-gradient(90deg, #0a8f5f, #2dd4a7); }
.publication-authors a.aff-cam   { background-image: linear-gradient(90deg, #1d6fe0, #5fb6f5); }
.publication-authors a.aff-njupt { background-image: linear-gradient(90deg, #e8730c, #f7b733); }
.publication-authors a:hover { opacity: 0.78; }

sup.sup-thu   { color: #9b2fd6; }
sup.sup-hku   { color: #0a9f6a; }
sup.sup-cam   { color: #1d6fe0; }
sup.sup-njupt { color: #e8730c; }

/* affiliation chips */
.author-affiliations { margin-top: 0.9rem; display:flex; flex-wrap:wrap; justify-content:center; gap:0.5rem; }
.aff-chip {
  display:inline-flex; align-items:center; gap:0.4rem;
  padding:0.22rem 0.8rem; border-radius:999px; font-size:0.9rem; font-weight:600;
}
.aff-chip .dot { width:9px; height:9px; border-radius:50%; display:inline-block; }
.aff-chip sup { font-weight:700; }
.chip-thu   { background:#f4e9fd; color:#8b2fc9; }
.chip-thu .dot   { background:#9b2fd6; }
.chip-hku   { background:#e3faf2; color:#0a8f5f; }
.chip-hku .dot   { background:#0a9f6a; }
.chip-cam   { background:#e7f1fd; color:#1d6fe0; }
.chip-cam .dot   { background:#1d6fe0; }
.chip-njupt { background:#fdf0e0; color:#c4640b; }
.chip-njupt .dot { background:#e8730c; }

/* ============ colourful data tables ============ */
.ar-table-wrap { overflow-x:auto; margin:0.5rem 0 0.4rem; border-radius:14px;
  box-shadow:0 6px 24px rgba(20,40,90,0.10); border:1px solid #e7ecf5; }
table.ar-table {
  width:100%; border-collapse:collapse; background:#fff;
  font-size:0.92rem; min-width:560px;
}
table.ar-table thead th {
  background:linear-gradient(100deg, #2b5dd1 0%, #4a5ed6 48%, #7c3aed 100%);
  color:#fff; font-weight:700; padding:0.7rem 0.7rem; text-align:center;
  white-space:nowrap; border:none;
}
table.ar-table thead tr.grp th {
  background:linear-gradient(100deg, #1d3f91 0%, #4434a8 60%, #6a2fce 100%);
  font-size:0.82rem; letter-spacing:0.03em; padding:0.45rem 0.5rem;
}
table.ar-table th.rowhead, table.ar-table td.rowhead {
  text-align:left; white-space:nowrap; font-weight:600;
}
table.ar-table tbody td {
  padding:0.5rem 0.6rem; text-align:center; border-top:1px solid #eef1f7;
  color:#374151; transition:background 0.2s;
}
table.ar-table tbody tr:hover td { filter:brightness(0.98); }
/* per-column best value: filled brand-gradient chip cell, others stay white */
table.ar-table td.best {
  background:linear-gradient(135deg, #2b5dd1 0%, #6d3ae6 100%);
  color:#fff; font-weight:800;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
}
table.ar-table tr.blk-sep td { border-top:2px solid #cdd6e8; }
/* hero row: keep a subtle row-label accent; data cells follow the best/white rule */
table.ar-table tr.hero-row td { font-weight:700; }
table.ar-table tr.hero-row td.rowhead {
  border-left:4px solid var(--ar-accent);
  background:linear-gradient(90deg, rgba(232,73,29,0.12), rgba(124,58,237,0.06));
  color:#1d3f91;
}
/* delta badges (table 3) */
.delta-pos { display:inline-block; min-width:54px; padding:0.12rem 0.5rem; border-radius:999px;
  background:linear-gradient(90deg,#0a8f5f,#2dd4a7); color:#fff; font-weight:700; font-size:0.85rem; }
.delta-pos.big { background:linear-gradient(90deg,#e8730c,#f7b733); }
.tbl-caption { margin-top:0.7rem; font-size:0.92rem; color:var(--ar-muted); }
.tbl-caption b { color:var(--ar-text); }

/* wider container so the 20-column Table 2 fits without horizontal scroll */
.container.ar-wide { max-width: 1280px; }

/* small tables (e.g. Table 1) shrink to fit their column instead of scrolling */
table.ar-table.ar-fit { min-width: 0; font-size: 0.86rem; }
table.ar-table.ar-fit td.rowhead, table.ar-table.ar-fit th.rowhead {
  white-space: normal; line-height: 1.2;   /* long stage labels may wrap */
}
table.ar-table.ar-fit thead th, table.ar-table.ar-fit tbody td { padding: 0.5rem 0.45rem; }

/* compact variant for the wide Table 2 — shrink to fit the viewport */
table.ar-table.ar-compact { min-width: 0; font-size: 0.74rem; }
table.ar-table.ar-compact thead th { padding: 0.42rem 0.2rem; font-size: 0.7rem; }
table.ar-table.ar-compact thead tr.grp th { font-size: 0.74rem; padding: 0.38rem 0.2rem; }
table.ar-table.ar-compact tbody td { padding: 0.36rem 0.22rem; white-space: nowrap; }
table.ar-table.ar-compact td.rowhead, table.ar-table.ar-compact th.rowhead { font-size: 0.78rem; }
table.ar-table.ar-compact td.rowhead sup { font-weight: 400; color: var(--ar-muted); }

/* on narrow viewports the compact table may still need to scroll — that's fine */
@media (max-width: 900px) {
  table.ar-table.ar-compact { min-width: 760px; }
}
.author-affiliations {
  margin-top: 0.7rem;
  color: var(--ar-muted);
  font-size: 1rem;
}
.eql-cntrb {
  margin-top: 0.6rem;
  color: var(--ar-muted);
  font-size: 0.9rem;
}

/* ---------- Buttons ---------- */
.publication-links { margin-top: 1.6rem; }
.publication-links .button {
  margin: 0.3rem;
  border-radius: 999px;
  font-weight: 600;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.publication-links .button:hover { transform: translateY(-2px); }
.button.is-ar-dark {
  background: #1f2733; color: #fff; border: none;
}
.button.is-ar-dark:hover { background: #2c3848; color:#fff; }
.button.is-ar-soon {
  background: #e7eaf0; color: #8a909b; border: none; cursor: default;
}
.button.is-ar-soon:hover { transform: none; }
.soon-badge {
  font-size: 0.62rem; font-weight: 700; margin-left: 0.4rem;
  background: var(--ar-accent); color: #fff; border-radius: 4px;
  padding: 0.05rem 0.35rem; letter-spacing: 0.04em;
}

/* ---------- Sections ---------- */
.section { padding: 2.6rem 1.5rem; }
.ar-section-alt { background: var(--ar-bg-soft); }
.title.ar-h2 {
  font-weight: 700;
  margin-bottom: 1.4rem;
  position: relative;
  display: inline-block;
}
.title.ar-h2::after {
  content: "";
  position: absolute;
  left: 0; bottom: -8px;
  width: 54px; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--ar-primary), var(--ar-accent));
}

.content.has-text-justified p { line-height: 1.7; }

/* ---------- Figures ---------- */
.ar-figure { margin: 1.2rem auto; text-align: center; }
.ar-figure img {
  max-width: 100%;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(20,40,90,0.10);
  border: 1px solid #eceff5;
  background: #fff;
}
.ar-figure.no-shadow img { box-shadow: none; border: none; }
.ar-caption {
  margin-top: 0.8rem;
  font-size: 0.95rem;
  color: var(--ar-muted);
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}
.ar-caption b { color: var(--ar-text); }

/* ---------- Highlight stat cards ---------- */
.ar-stats { margin: 1.5rem 0 0.5rem; }
.ar-stat-card {
  background: #fff;
  border: 1px solid #e7ecf5;
  border-radius: 14px;
  padding: 1.3rem 0.8rem;
  text-align: center;
  height: 100%;
  box-shadow: 0 4px 14px rgba(20,40,90,0.05);
}
.ar-stat-num {
  font-size: 2.1rem; font-weight: 800; color: var(--ar-primary);
  line-height: 1;
}
.ar-stat-label { margin-top: 0.5rem; color: var(--ar-muted); font-size: 0.92rem; }

/* ---------- BibTeX ---------- */
pre.ar-bibtex {
  background: #1f2733;
  color: #e6edf3;
  border-radius: 10px;
  padding: 1.2rem 1.4rem;
  overflow-x: auto;
  font-size: 0.85rem;
  text-align: left;
}

/* ---------- Demo ---------- */
.ar-demo-frame {
  width: 100%;
  height: 720px;
  border: 1px solid #e7ecf5;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(20,40,90,0.10);
}

footer.footer { background: #fff; border-top: 1px solid #eef1f6; }
footer .ar-footnote { color: var(--ar-muted); font-size: 0.9rem; }
