/* ===== Base ===== */
:root {
  --vita-green: #2c8a4a;
  --vita-green-dark: #1f5e34;
  --vita-green-light: #eaf6ee;
  --vita-amber: #e0a500;
  --vita-blue: #3273dc;
  --text-dark: #1f2937;
  --text-mid: #4a5568;
  --bg-alt: #f7faf8;
  --border-light: #e4e8eb;
  --placeholder-bg: #f5f7f6;
  --placeholder-fg: #94a0ad;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans', 'Google Sans', 'Helvetica Neue', Helvetica, Arial,
               'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  color: var(--text-dark);
  font-size: 16px;
  line-height: 1.65;
  background: #fff;
}

a { color: var(--vita-green-dark); }
a:hover { color: var(--vita-green); }

code {
  font-family: 'JetBrains Mono', 'Menlo', 'Monaco', 'Courier New', monospace;
  background: #f1f3f5;
  color: var(--vita-green-dark);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* ===== Section heading ===== */
.section-heading {
  position: relative;
  margin-bottom: 1.5rem !important;
  font-weight: 700 !important;
}
.section-heading::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  background: linear-gradient(90deg, var(--vita-green), var(--vita-amber));
  border-radius: 2px;
  margin: 0.55rem auto 0;
}

.section-alt { background: var(--bg-alt); }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, #f4faf6 0%, #eef4f9 100%);
  padding: 3.5rem 0 2.5rem;
  border-bottom: 1px solid var(--border-light);
}

.publication-title {
  font-weight: 800 !important;
  letter-spacing: -0.015em;
  margin-bottom: 1.4rem !important;
  font-size: clamp(1.5rem, 3.1vw, 2.05rem) !important;
  line-height: 1.25 !important;
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}

.vita-emoji {
  display: inline-block;
  transform: translateY(-3px);
  margin-right: 0.3rem;
  filter: drop-shadow(0 2px 4px rgba(44, 138, 74, 0.25));
}

.publication-subtitle {
  font-weight: 400 !important;
  color: var(--text-mid) !important;
  margin-bottom: 1.8rem !important;
  font-size: 1.4rem !important;
  line-height: 1.4;
}

.publication-authors {
  font-size: 1rem !important;   /* override Bulma .is-size-5 (1.25rem) so 14 names fit on 2 lines */
  margin: 1rem 0 0.5rem;
  line-height: 1.65;
}
.publication-authors .author-block {
  display: inline-block;
  margin: 0 0.08rem;
  white-space: nowrap;          /* keep "Yuxin Chen¹,²," from breaking mid-name */
}
.publication-authors a {
  color: var(--text-dark);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: border-color 0.15s, color 0.15s;
}
.publication-authors a:hover {
  color: var(--vita-green-dark);
  border-bottom-color: var(--vita-green);
}

.publication-affiliations {
  color: var(--text-mid);
  margin-bottom: 0.4rem;
  line-height: 1.7;
}

.publication-correspondence {
  color: var(--text-mid);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.publication-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  margin-top: 1.4rem;
}
.publication-links .button {
  background: #1f2937;
  border-color: #1f2937;
  color: #fff;
  font-weight: 500;
  transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
}
.publication-links .button:hover {
  background: var(--vita-green-dark);
  border-color: var(--vita-green-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(31, 94, 52, 0.2);
}

/* ===== Section base ===== */
.section { padding: 3rem 1.5rem; }
.section h2.title.is-3 { margin-bottom: 1.2rem !important; }

/* ===== Stat row ===== */
.stat-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1rem;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 0.9rem 1.4rem;
  min-width: 120px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--vita-green);
  box-shadow: 0 8px 18px rgba(44, 138, 74, 0.12);
}
.stat-num {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--vita-green-dark);
  line-height: 1.1;
}
.stat-label {
  font-size: 0.78rem;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 3px;
}

/* ===== Capability list ===== */
.cap-list {
  margin-top: 0.6rem;
  padding-left: 1.5rem;
  line-height: 1.75;
}
.cap-list li { margin-bottom: 0.55rem; }
.cap-list strong { color: var(--vita-green-dark); }

/* ===== Overview ===== */
.overview-intro {
  text-align: justify;
  hyphens: auto;
  font-size: 1.05rem;
  color: var(--text-mid);
  margin-bottom: 1.2rem;
  line-height: 1.75;
}
.overview-intro + .overview-intro { margin-bottom: 2rem; }

.overview-block {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 1.6rem 1.8rem;
  margin-bottom: 1.2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.overview-subhead {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--vita-green-dark);
  margin: 0 0 0.7rem;
}

.overview-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--vita-green);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  flex-shrink: 0;
}

.overview-block p {
  margin: 0;
  line-height: 1.7;
  color: var(--text-dark);
  text-align: justify;
  hyphens: auto;
}
.overview-block p + .cap-list,
.overview-block p + figure { margin-top: 1rem; }
.overview-block figure + figure { margin-top: 1.5rem; }

/* ===== Finding figure row (2-col) ===== */
.finding-figure-row { margin-bottom: 1rem; }
.finding-figure-row .paper-figure { margin-top: 0; }
.finding-figure-row + .paper-figure { margin-top: 1.5rem; }

/* ===== Figures ===== */
.section-figure { padding-top: 2rem; padding-bottom: 2rem; }

.paper-figure {
  margin: 1rem 0 0;
  text-align: center;
}
.paper-figure + .paper-figure { margin-top: 2.5rem; }

.paper-figure img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  background: var(--placeholder-bg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}
.paper-figure img:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* Placeholder when image fails to load */
.paper-figure img.placeholder {
  display: flex;
  width: 100%;
  min-height: 220px;
  border: 2px dashed #cfd6dd;
  background:
    repeating-linear-gradient(
      45deg,
      #f5f7f6 0,
      #f5f7f6 10px,
      #fafbfc 10px,
      #fafbfc 20px
    );
  color: var(--placeholder-fg);
  font-family: 'JetBrains Mono', Menlo, monospace;
  font-size: 0.95rem;
  font-weight: 500;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.2rem;
  box-shadow: none;
}
.paper-figure img.placeholder:hover { transform: none; }

.paper-figure figcaption {
  margin-top: 0.8rem;
  font-size: 0.95rem;
  color: var(--text-mid);
  line-height: 1.6;
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
  text-align: justify;
}
.paper-figure figcaption strong { color: var(--vita-green-dark); }

/* ===== Leaderboard ===== */
.lb-controls {
  display: flex;
  justify-content: center;
  margin: 1.2rem 0 1rem;
}
.lb-tabs {
  display: inline-flex;
  background: #f1f3f5;
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}
.lb-tab {
  border: none;
  background: transparent;
  padding: 8px 22px;
  border-radius: 999px;
  font-weight: 600;
  color: var(--text-mid);
  cursor: pointer;
  font-size: 0.94rem;
  transition: background 0.15s, color 0.15s;
}
.lb-tab:hover { color: var(--vita-green-dark); }
.lb-tab.is-active {
  background: var(--vita-green);
  color: #fff;
  box-shadow: 0 2px 6px rgba(44, 138, 74, 0.25);
}

.lb-panel { display: none; }
.lb-panel.is-active { display: block; }

.lb-table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.88rem;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05);
}
.lb-table thead th {
  background: #f5f7f6 !important;
  color: var(--text-dark) !important;
  font-weight: 700 !important;
  text-align: center !important;
  vertical-align: middle !important;
  border-bottom: 2px solid var(--border-light) !important;
  font-size: 0.85rem;
}
.lb-table thead th.rank-col { width: 40px; }
.lb-table thead th.group-fc {
  background: #eaf6ee !important;
  color: var(--vita-green-dark) !important;
}
.lb-table thead th.group-am {
  background: #fff8e6 !important;
  color: #7a5a00 !important;
}
.lb-table thead th.group-rag {
  background: #eaf2fb !important;
  color: #1d4a8a !important;
}

.lb-table tbody td {
  text-align: center;
  vertical-align: middle;
  padding: 0.55rem 0.5rem !important;
  border-color: #f0f2f4 !important;
}
.lb-table tbody td:nth-child(2) {
  text-align: left;
  font-weight: 500;
}
.lb-table tbody tr:hover { background: #fafbfc !important; }
.lb-table tbody b { color: var(--vita-green-dark); }

.lb-note {
  text-align: center;
  color: var(--text-mid);
  font-size: 0.88rem;
  margin-top: 1rem;
}
.last-update {
  display: inline-block;
  margin-left: 1rem;
  color: #94a0ad;
  font-style: italic;
}

/* ===== Findings ===== */
.finding-card {
  display: flex;
  gap: 1.2rem;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
  margin-bottom: 0.9rem;
  align-items: flex-start;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.finding-card:hover {
  border-color: var(--vita-green);
  transform: translateX(4px);
  box-shadow: 0 6px 16px rgba(44, 138, 74, 0.08);
}
.finding-num {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--vita-green);
  opacity: 0.45;
  line-height: 1;
  flex-shrink: 0;
  width: 50px;
}
.finding-body h4 {
  font-weight: 700;
  font-size: 1.08rem;
  margin-bottom: 0.3rem;
  color: var(--text-dark);
}
.finding-body p {
  color: var(--text-mid);
  margin: 0;
  line-height: 1.6;
}

/* ===== BibTeX ===== */
.bibtex-wrapper {
  position: relative;
  margin-top: 1rem;
}
.bibtex-wrapper pre {
  background: #1f2937;
  color: #e6edf3;
  padding: 1.4rem;
  border-radius: 10px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', Menlo, Monaco, monospace;
  font-size: 0.88rem;
  line-height: 1.6;
}
.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e6edf3;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s;
}
.copy-btn:hover { background: rgba(255, 255, 255, 0.18); }
.copy-btn i { margin-right: 5px; }
.copy-btn.copied { background: var(--vita-green); border-color: var(--vita-green); }

/* ===== Footer ===== */
.footer {
  background: #f5f7f6;
  border-top: 1px solid var(--border-light);
  padding: 2rem 1.5rem;
  color: var(--text-mid);
  font-size: 0.9rem;
}
.footer-small {
  font-size: 0.82rem;
  color: #94a0ad;
  margin-top: 0.4rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .publication-title { font-size: 1.55rem !important; line-height: 1.3 !important; }
  .publication-subtitle { font-size: 1.15rem !important; }
  .stat-card { min-width: 95px; padding: 0.7rem 1rem; }
  .stat-num { font-size: 1.4rem; }
  .lb-table { font-size: 0.76rem; }
  .lb-table tbody td { padding: 0.4rem 0.25rem !important; }
  .finding-card { flex-direction: column; gap: 0.5rem; }
  .finding-num { width: auto; }
}
