:root {
  --bg: #f3f5f2;
  --surface: #ffffff;
  --surface-alt: #f8faf7;
  --ink: #1f2a1f;
  --ink-soft: #4f5d4f;
  --line: #d8dfd1;
  --accent: #2a6f4e;
  --accent-soft: #e7f4ed;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% -20%, #d9e8dd 0%, transparent 45%),
    radial-gradient(circle at 100% 0, #dfe8ef 0%, transparent 35%),
    var(--bg);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: #1e553c;
}

.topbar a {
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
}

.topbar nav {
  display: flex;
  gap: 1rem;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.page {
  width: min(1150px, 95vw);
  margin: 1.2rem auto 3rem;
}

.site-footer {
  margin: 0 auto 1.2rem;
  width: min(1150px, 95vw);
  color: var(--ink-soft);
  font-size: 0.92rem;
  border-top: 1px solid var(--line);
  padding-top: 0.8rem;
}

.hero {
  padding: 1rem 0 0.6rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.4rem, 3.5vw, 2rem);
}

.hero p {
  color: var(--ink-soft);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8rem;
  margin: 1rem 0;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem;
}

.stat-card h2 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.stat-card p {
  margin: 0.35rem 0 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  margin: 1rem 0;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

h1,
h2 {
  margin: 0 0 0.75rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: flex-end;
  margin-bottom: 0.7rem;
}

.filters label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

input,
select,
button {
  font: inherit;
}

input,
select {
  min-width: 220px;
  padding: 0.42rem 0.52rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-alt);
}

button {
  padding: 0.5rem 0.78rem;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
}

.muted-link {
  color: var(--ink-soft);
}

.subtle {
  color: var(--ink-soft);
  margin: 0.1rem 0 0.7rem;
  font-size: 0.92rem;
}

.paper-summary {
  margin: 0.3rem 0 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.paper-summary-note {
  color: #6c776c;
}

.table-wrap {
  overflow-x: auto;
}

.chart-panel {
  padding-bottom: 1.25rem;
}

.chart-wrap {
  position: relative;
  width: 100%;
  height: 360px;
}

.paper-top-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1rem 0;
}

.paper-top-layout .panel {
  margin: 0;
}

.paper-chart-wrap {
  height: 300px;
}

.link-icon {
  margin-left: 0.22rem;
  font-size: 0.76em;
  color: var(--ink-soft);
  vertical-align: text-top;
}

a:hover .link-icon {
  color: #1e553c;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

th,
td {
  text-align: left;
  padding: 0.56rem 0.42rem;
  border-bottom: 1px solid var(--line);
}

thead th {
  color: var(--ink-soft);
  font-weight: 600;
  background: var(--surface-alt);
}

tr.selected {
  background: var(--accent-soft);
}

.pager {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.8rem;
}

.pager .disabled {
  color: #98a298;
}

.meta-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.35rem 0.85rem;
}

.meta-grid dt {
  font-weight: 600;
  color: var(--ink-soft);
}

.meta-grid dd {
  margin: 0;
}

.inline-list {
  list-style: none;
  padding: 0;
  margin: 0.2rem 0 0;
  display: grid;
  gap: 0.25rem;
}

.affiliation-bullets {
  list-style: disc;
  margin: 0.2rem 0 0;
  padding-left: 1.25rem;
}

.affiliation-bullets li {
  margin: 0.35rem 0;
}

.affiliation-name {
  font-weight: 600;
}

.affiliation-bullets li.most-frequent .affiliation-name {
  font-weight: 800;
}

.affiliation-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: #12402c;
  padding: 0.08rem 0.42rem;
  border: 1px solid #8fc8ac;
  border-radius: 999px;
  background: #d9f0e2;
}

.affiliation-meta {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.author-link-list {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-right: 0.45rem;
}

.author-link-list a {
  color: var(--accent);
  font-size: 1.05rem;
}

.author-link-note {
  color: var(--ink-soft);
  font-size: 0.88rem;
}

@media (max-width: 700px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
  }

  .filters label {
    width: 100%;
  }

  .chart-wrap {
    height: 300px;
  }

  .paper-chart-wrap {
    height: 260px;
  }

  input,
  select {
    width: 100%;
    min-width: 0;
  }
}

@media (min-width: 1024px) {
  .paper-top-layout {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    align-items: start;
  }
}
