body.deepx-institution-runtime {
  background: #020607;
}

body.deepx-institution-runtime aside {
  border-color: rgba(125, 221, 255, 0.12);
  background:
    radial-gradient(circle at 24% 8%, rgba(65, 210, 241, 0.16), transparent 13rem),
    linear-gradient(180deg, #030707 0%, #020607 100%);
  color: rgba(236, 247, 252, 0.86);
}

body.deepx-institution-runtime aside h1,
body.deepx-institution-runtime aside .text-ink {
  color: #ffffff;
}

body.deepx-institution-runtime aside p,
body.deepx-institution-runtime aside .text-slate-500,
body.deepx-institution-runtime aside .text-slate-600 {
  color: rgba(218, 231, 238, 0.58);
}

body.deepx-institution-runtime aside a {
  color: rgba(231, 241, 247, 0.66);
}

body.deepx-institution-runtime aside a:hover,
body.deepx-institution-runtime aside a[aria-current="page"],
body.deepx-institution-runtime aside a[href="/institutions"],
body.deepx-institution-runtime aside a.deepx-current-nav {
  border: 1px solid rgba(83, 220, 245, 0.38);
  background: rgba(10, 105, 119, 0.34);
  color: #f4fdff;
}

body.deepx-institution-runtime header {
  background: rgba(3, 9, 13, 0.92);
  color: rgba(241, 248, 252, 0.88);
}

body.deepx-institution-runtime .deepx-scholar-grid {
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
}

@media (max-width: 700px) {
  body.deepx-institution-runtime .deepx-scholar-grid {
    grid-template-columns: 1fr;
  }
}

body.deepx-institution-runtime main {
  max-width: none;
  padding: 0;
}

.deepx-institution-map-section {
  margin-bottom: 18px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(174, 232, 255, 0.18);
  background: rgba(6, 16, 24, 0.78);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(14px);
}

.deepx-institution-map-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.deepx-institution-map-head h2 {
  margin: 0;
  color: #fff;
  font-size: 22px;
}

.deepx-institution-map-head p {
  margin: 6px 0 0;
  color: rgba(228, 241, 247, 0.72);
  font-size: 13px;
  max-width: 52rem;
}

.deepx-institution-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: rgba(216, 230, 238, 0.72);
}

.deepx-institution-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.deepx-institution-map-legend i {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: inline-block;
}

.deepx-institution-map-wrap {
  position: relative;
  height: min(52vh, 420px);
  min-height: 280px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(125, 221, 255, 0.2);
  background: #030a10;
}

#deepxInstitutionMap {
  width: 100%;
  height: 100%;
}

.deepx-institution-map-wrap .leaflet-container {
  background: #030a10;
  font-family: inherit;
}

.deepx-institution-map-panel {
  display: none;
}

.deepx-institution-map-hint {
  margin-top: 10px;
  font-size: 12px;
  color: rgba(216, 230, 238, 0.55);
}

.deepx-country-path--active {
  outline: 2px solid #67e8f9;
  outline-offset: 1px;
}

@media (max-width: 760px) {
  .deepx-institution-map-wrap {
    min-height: 240px;
  }
}

/* Detail page styles */
.deepx-detail-description {
  margin-top: 12px;
  max-width: none;
  color: rgba(228, 241, 247, 0.78);
  font-size: 15px;
  line-height: 1.7;
  text-align: justify;
}

.deepx-name-cn {
  color: rgba(103, 232, 249, 0.7);
  font-weight: 400;
}

.deepx-description-source {
  margin-top: 8px;
  color: rgba(103, 232, 249, 0.6);
  font-size: 12px;
  font-style: italic;
}

.deepx-detail-stats {
  margin-top: 18px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(174, 232, 255, 0.18);
  background: rgba(6, 16, 24, 0.78);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(14px);
}

.deepx-metrics-large {
  grid-template-columns: repeat(4, 1fr);
}

.deepx-detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.deepx-detail-links a {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid rgba(141, 224, 255, 0.22);
  background: rgba(255, 255, 255, 0.045);
  color: #67e8f9;
  font-size: 13px;
  text-decoration: none;
  transition: border-color 180ms ease, background 180ms ease;
}

.deepx-detail-links a:hover {
  border-color: rgba(91, 225, 255, 0.55);
  background: rgba(8, 30, 42, 0.85);
}

@media (max-width: 600px) {
  .deepx-metrics-large {
    grid-template-columns: repeat(2, 1fr);
  }
}

.deepx-detail-section {
  margin-top: 24px;
}

.deepx-org-structure {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.deepx-org-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(141, 224, 255, 0.14);
  background: rgba(255, 255, 255, 0.035);
}

.deepx-org-row strong {
  color: #dffbff;
  font-size: 15px;
}

.deepx-org-departments {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding-left: 20px;
  border-left: 2px solid rgba(103, 232, 249, 0.22);
}

.deepx-org-dept {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 14px;
  color: rgba(229, 240, 246, 0.78);
  flex-wrap: wrap;
  gap: 8px;
}

.deepx-org-dept em {
  color: rgba(103, 232, 249, 0.7);
  font-style: normal;
  font-size: 12px;
}

.deepx-scholar-mini-card {
  min-height: auto;
  display: flex;
  flex-direction: column;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.deepx-scholar-mini-card:hover {
  transform: translateY(-4px);
  border-color: rgba(91, 225, 255, 0.7);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.36), 0 0 26px rgba(55, 212, 255, 0.12);
}

.deepx-scholar-card-main {
  flex: 1;
  color: inherit;
  text-decoration: none;
}

.deepx-scholar-active {
  border-color: rgba(103, 232, 249, 0.7) !important;
  box-shadow: 0 0 18px rgba(55, 212, 255, 0.2);
}

.deepx-scholar-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(141, 224, 255, 0.12);
}

.deepx-scholar-action-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid rgba(141, 224, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(210, 235, 250, 0.75);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.deepx-scholar-action-btn:hover {
  border-color: rgba(103, 232, 249, 0.6);
  color: #e7f7ff;
  background: rgba(10, 105, 119, 0.25);
}

.deepx-paper-row {
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid rgba(141, 224, 255, 0.14);
  background: rgba(255, 255, 255, 0.035);
  transition: border-color 180ms ease, background 180ms ease;
}

.deepx-paper-row:hover {
  border-color: rgba(91, 225, 255, 0.55);
  background: rgba(255, 255, 255, 0.06);
}

.deepx-paper-row + .deepx-paper-row {
  margin-top: 8px;
}

.deepx-paper-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.deepx-paper-header h4 {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
}

.deepx-paper-title-link {
  color: #fff;
  text-decoration: none;
  transition: color 180ms ease;
}

.deepx-paper-title-link:hover {
  color: #67e8f9;
  text-decoration: underline;
}

.deepx-oa-badge {
  flex-shrink: 0;
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(103, 232, 249, 0.18);
  color: #67e8f9;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.deepx-paper-authors {
  margin: 6px 0 0;
  color: rgba(210, 235, 250, 0.62);
  font-size: 13px;
  line-height: 1.4;
}

.deepx-paper-venue {
  margin: 4px 0 0;
  color: rgba(180, 215, 240, 0.5);
  font-size: 12px;
  font-style: italic;
}

.deepx-paper-meta {
  margin: 6px 0 0;
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.deepx-paper-citations {
  color: rgba(245, 215, 100, 0.85);
  font-weight: 600;
}

.deepx-paper-detail {
  color: rgba(216, 230, 238, 0.45);
}

.deepx-paper-abstract {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-left: 2px solid rgba(103, 232, 249, 0.25);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0 8px 8px 0;
  color: rgba(200, 218, 230, 0.6);
  font-size: 12px;
  line-height: 1.55;
}

.deepx-abstract-text {
  text-align: justify;
}

.deepx-abstract-toggle {
  display: block;
  margin-top: 6px;
  padding: 2px 0;
  border: none;
  background: none;
  color: rgba(103, 232, 249, 0.65);
  font-size: 11px;
  cursor: pointer;
  transition: color 180ms ease;
}

.deepx-abstract-toggle:hover {
  color: #67e8f9;
}

.deepx-paper-links {
  margin-top: 8px;
  display: flex;
  gap: 14px;
  font-size: 12px;
}

.deepx-paper-link {
  color: rgba(103, 232, 249, 0.55);
  text-decoration: none;
  transition: color 180ms ease;
}

.deepx-paper-link:hover {
  color: #67e8f9;
  text-decoration: underline;
}

/* Performance: lazy-render off-screen cards when expanded */
.deepx-scholar-grid .deepx-scholar-card {
  content-visibility: auto;
  contain-intrinsic-size: auto 320px;
}

.deepx-dashboard-back:hover {
  border-color: rgba(91, 225, 255, 0.55);
  color: #67e8f9;
  background: rgba(8, 30, 42, 0.85);
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.deepx-institution-detail {
  position: relative;
}

.deepx-detail-back {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 10;
  padding: 8px 18px;
  border: 1px solid rgba(174, 232, 255, 0.25);
  border-radius: 8px;
  background: rgba(6, 16, 24, 0.85);
  color: rgba(174, 232, 255, 0.8);
  font-size: 13px;
  text-decoration: none;
  backdrop-filter: blur(10px);
  transition: border-color 180ms ease, color 180ms ease;
}
.deepx-detail-back:hover {
  border-color: rgba(91, 225, 255, 0.55);
  color: #67e8f9;
}

.deepx-reset-btn {
  margin-left: 10px;
  padding: 8px 16px;
  border: 1px solid rgba(174, 232, 255, 0.25);
  border-radius: 8px;
  background: rgba(174, 232, 255, 0.08);
  color: rgba(174, 232, 255, 0.7);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.deepx-reset-btn:hover {
  border-color: rgba(255, 130, 90, 0.55);
  color: #ffaa7a;
  background: rgba(255, 100, 50, 0.1);
}

.deepx-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

.deepx-pagination button {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(170, 225, 255, 0.18);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(233, 244, 250, 0.72);
  cursor: pointer;
  font-size: 16px;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.deepx-pagination button:hover:not(:disabled) {
  border-color: rgba(80, 220, 255, 0.72);
  color: #fff;
  background: linear-gradient(135deg, rgba(8, 121, 158, 0.75), rgba(13, 75, 103, 0.62));
}

.deepx-pagination button:disabled {
  opacity: 0.3;
  cursor: default;
}

.deepx-pagination span {
  color: rgba(233, 244, 250, 0.72);
  font-size: 14px;
  min-width: 60px;
  text-align: center;
}

.deepx-sort-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.deepx-sort-label {
  color: rgba(216, 230, 238, 0.6);
  font-size: 12px;
  font-weight: 700;
  margin-right: 4px;
}

.deepx-sort-bar button {
  padding: 6px 14px;
  border: 1px solid rgba(144, 225, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: rgba(210, 235, 250, 0.72);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.deepx-sort-bar button:hover {
  border-color: rgba(91, 225, 255, 0.7);
  background: rgba(10, 105, 119, 0.2);
  color: #e7f7ff;
}

.deepx-sort-bar button.deepx-sort-active {
  border-color: rgba(103, 232, 249, 0.65);
  background: rgba(8, 121, 158, 0.4);
  color: #fff;
}

/* Scholar grid: auto-fit matching scholars page */
body.deepx-institution-runtime .deepx-scholar-grid {
  grid-template-columns: repeat(auto-fit, minmax(310px, 400px));
  gap: 16px;
}
body.deepx-institution-runtime .deepx-scholar-mini-card {
  min-height: auto;
  padding: 0;
}

body.deepx-institution-runtime .deepx-scholar-mini-card .deepx-scholar-card-main {
  padding: 14px;
}

body.deepx-institution-runtime .deepx-scholar-mini-card .deepx-metrics {
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-top: 8px;
}

body.deepx-institution-runtime .deepx-scholar-mini-card h3 {
  font-size: 14px;
}

body.deepx-institution-runtime .deepx-scholar-card-actions {
  padding: 8px 14px;
  gap: 4px;
}

body.deepx-institution-runtime .deepx-scholar-action-btn {
  padding: 4px 8px;
  font-size: 11px;
}

/* Topic tags on scholar cards */
.deepx-scholar-topics {
  display: block;
  margin-top: 6px;
}

.deepx-topic-tag {
  display: block;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(103, 232, 249, 0.15);
  background: rgba(103, 232, 249, 0.05);
  color: rgba(103, 232, 249, 0.6);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

/* CrossIndex data table below map */
.deepx-ci-sidebar {
  background: rgba(6, 16, 24, 0.6);
  border: 1px solid rgba(125, 221, 255, 0.12);
  border-radius: 12px;
  padding: 12px 16px;
  margin-top: 16px;
  max-height: 380px;
  overflow-y: auto;
}
.deepx-ci-sidebar::-webkit-scrollbar { width: 4px; }
.deepx-ci-sidebar::-webkit-scrollbar-thumb { background: rgba(103,232,249,0.2); border-radius: 2px; }

.deepx-ci-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 11px;
  color: rgba(220, 240, 255, 0.85);
}

.deepx-ci-table thead th {
  text-align: left;
  padding: 3px 4px 6px;
  color: rgba(103, 232, 249, 0.7);
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(125, 221, 255, 0.12);
}

.deepx-ci-table thead th:first-child,
.deepx-ci-table thead th:nth-child(4),
.deepx-ci-table thead th:nth-child(7),
.deepx-ci-table thead th:nth-child(10) {
  width: 28px;
}

.deepx-ci-table tbody td {
  padding: 2px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
}

.deepx-ci-table tbody td:nth-child(3n+1) {
  color: rgba(103, 232, 249, 0.45);
  font-size: 10px;
}

.deepx-ci-table tbody tr:hover td {
  background: rgba(103, 232, 249, 0.06);
}

.deepx-ci-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: rgba(163, 230, 53, 0.85);
}

.deepx-ci-col {
  border-left: 1px solid rgba(125, 221, 255, 0.08);
  padding-left: 10px;
}

/* ── CrossIndex table toggle ── */
.deepx-ci-toggle-wrap {
  margin-top: 14px;
}

.deepx-ci-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(125, 221, 255, 0.15);
  border-radius: 10px;
  background: rgba(6, 16, 24, 0.6);
  color: rgba(210, 235, 250, 0.7);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.deepx-ci-toggle:hover {
  border-color: rgba(91, 225, 255, 0.55);
  background: rgba(10, 105, 119, 0.2);
  color: #e7f7ff;
}

.deepx-ci-toggle-arrow {
  margin-left: auto;
  font-size: 12px;
  opacity: 0.6;
  transition: transform 180ms ease;
}

.deepx-ci-toggle[aria-expanded="true"] .deepx-ci-toggle-arrow {
  opacity: 1;
}

/* ── Raise controls above cards so dropdown menus are not obscured ── */
body.deepx-institution-runtime .deepx-scholar-controls {
  position: relative;
  z-index: 100;
}

/* ── Filter toolbar ── */
.deepx-filter-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* ── Custom dropdown ── */
.deepx-dropdown {
  position: relative;
}

.deepx-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(144, 225, 255, 0.22);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(210, 235, 250, 0.72);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
  font-family: inherit;
}

.deepx-dropdown-trigger:hover {
  border-color: rgba(91, 225, 255, 0.7);
  color: #e7f7ff;
}

.deepx-dropdown-trigger.active {
  border-color: rgba(103, 232, 249, 0.65);
  color: #fff;
}

.deepx-dropdown-trigger strong {
  color: #67e8f9;
  font-weight: 600;
}

.deepx-dropdown-arrow {
  font-size: 10px;
  transition: transform 180ms ease;
  opacity: 0.6;
}

.deepx-dropdown.open .deepx-dropdown-arrow {
  transform: rotate(180deg);
}

/* ── Dropdown menu ── */
.deepx-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 50;
  min-width: 200px;
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid rgba(125, 221, 255, 0.2);
  border-radius: 10px;
  background: rgba(6, 16, 24, 0.97);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55), 0 0 20px rgba(55, 212, 255, 0.06);
  backdrop-filter: blur(18px);
  display: none;
}

.deepx-dropdown-menu-right {
  left: auto;
  right: 0;
}

.deepx-dropdown.open .deepx-dropdown-menu {
  display: block;
}

.deepx-dropdown-menu::-webkit-scrollbar {
  width: 4px;
}

.deepx-dropdown-menu::-webkit-scrollbar-thumb {
  background: rgba(103, 232, 249, 0.2);
  border-radius: 2px;
}

/* ── Dropdown search input ── */
.deepx-dropdown-search {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(125, 221, 255, 0.1);
  position: sticky;
  top: 0;
  background: rgba(6, 16, 24, 0.97);
  backdrop-filter: blur(18px);
  z-index: 1;
}

.deepx-dropdown-search input {
  width: 100%;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(144, 225, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(210, 235, 250, 0.85);
  font-size: 12px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  transition: border-color 180ms ease;
}

.deepx-dropdown-search input:focus {
  border-color: rgba(103, 232, 249, 0.55);
}

.deepx-dropdown-search input::placeholder {
  color: rgba(210, 235, 250, 0.35);
}

/* ── Dropdown divider ── */
.deepx-dropdown-divider {
  height: 1px;
  margin: 4px 0;
  background: rgba(125, 221, 255, 0.08);
}

/* ── Dropdown items ── */
.deepx-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 14px;
  border: none;
  background: none;
  color: rgba(210, 235, 250, 0.7);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms ease, color 120ms ease;
}

.deepx-dropdown-item:hover {
  background: rgba(103, 232, 249, 0.1);
  color: #e7f7ff;
}

.deepx-dropdown-item.active {
  color: #67e8f9;
  font-weight: 600;
}

/* ── CD Rank Toggle Button ── */
.cd-rank-toggle {
  border-color: rgba(103, 232, 249, 0.45) !important;
  color: #67e8f9 !important;
  font-weight: 600;
}
.cd-rank-toggle:hover {
  border-color: rgba(103, 232, 249, 0.8) !important;
  background: rgba(10, 105, 119, 0.3) !important;
  color: #a7f3ff !important;
}
.deepx-hero-stats {
  display: flex;
  gap: 14px;
  align-items: stretch;
}
.deepx-stat-clickable {
  font-family: inherit;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease;
}
.deepx-stat-clickable:hover {
  border-color: rgba(103, 232, 249, 0.55) !important;
  background: rgba(10, 105, 119, 0.25) !important;
}

/* ── CD Rank Hero ── */
.cd-hero {
  position: relative;
  margin-bottom: 18px;
  padding: 30px;
  border-radius: 18px;
  border: 1px solid rgba(174, 232, 255, 0.18);
  background: rgba(6, 16, 24, 0.78);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(14px);
}

.cd-rank-toggle-top {
  position: absolute !important;
  top: 24px;
  right: 24px;
  z-index: 10;
  margin-left: 0 !important;
}

.cd-hero-content {
  margin-bottom: 20px;
}

.cd-hero-kicker {
  margin: 0;
  color: #67e8f9;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cd-hero h1 {
  margin: 6px 0 8px;
  color: #fff;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.02;
  font-weight: 800;
}

.cd-hero-desc {
  margin: 0;
  color: rgba(228, 241, 247, 0.72);
  font-size: 14px;
  max-width: 60rem;
  line-height: 1.6;
}

.cd-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
}

.cd-hero-stat {
  flex: 1;
  min-width: 140px;
  padding: 18px;
  border-radius: 12px;
  border: 1px solid rgba(141, 224, 255, 0.16);
  background: rgba(255, 255, 255, 0.035);
}

.cd-hero-stat-label {
  display: block;
  margin-bottom: 4px;
  color: rgba(216, 230, 238, 0.55);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cd-hero-stat strong {
  color: #fff;
  font-size: 28px;
  font-weight: 800;
}

.cd-hero-intro {
  padding: 14px 18px;
  border-radius: 10px;
  border: 1px solid rgba(103, 232, 249, 0.15);
  background: rgba(103, 232, 249, 0.04);
}

.cd-hero-intro strong {
  color: #67e8f9;
  font-size: 13px;
}

.cd-hero-intro p {
  margin: 4px 0 0;
  color: rgba(228, 241, 247, 0.62);
  font-size: 13px;
  line-height: 1.6;
}

.cd-hero-intro em {
  color: rgba(103, 232, 249, 0.8);
  font-style: normal;
  font-weight: 600;
}

@media (max-width: 700px) {
  .cd-hero { padding: 18px; }
  .cd-hero h1 { font-size: 22px; }
  .cd-hero-stats { flex-direction: column; }
  .cd-hero-stat strong { font-size: 18px; }
}

/* ── CD Filter Bar (horizontal, above table) ── */
.cd-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid rgba(125, 221, 255, 0.14);
  background: rgba(6, 16, 24, 0.5);
}
.cd-filter-bar-left,
.cd-filter-bar-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.cd-filter-bar-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cd-filter-bar-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(180, 215, 240, 0.55);
  white-space: nowrap;
}
.cd-filter-select {
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid rgba(103, 232, 249, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(200, 225, 240, 0.8);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color 150ms ease;
}
.cd-filter-select:hover,
.cd-filter-select:focus {
  border-color: rgba(103, 232, 249, 0.5);
}
.cd-filter-select option {
  background: #081828;
  color: #d8ecf5;
}
.cd-tier-btns {
  display: flex;
  gap: 4px;
}
.cd-tier-btn {
  padding: 4px 12px;
  border-radius: 5px;
  border: 1px solid rgba(103, 232, 249, 0.22);
  background: transparent;
  color: rgba(200, 225, 240, 0.55);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  transition: all 150ms ease;
}
.cd-tier-btn:hover {
  border-color: rgba(103, 232, 249, 0.5);
  color: #67e8f9;
}
.cd-tier-btn.active {
  background: rgba(103, 232, 249, 0.15);
  border-color: #67e8f9;
  color: #67e8f9;
  font-weight: 600;
}
.cd-filter-reset {
  padding: 4px 14px;
  border-radius: 5px;
  border: 1px solid rgba(103, 232, 249, 0.18);
  background: transparent;
  color: rgba(200, 225, 240, 0.45);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  transition: all 150ms ease;
  white-space: nowrap;
}
.cd-filter-reset:hover {
  border-color: rgba(103, 232, 249, 0.5);
  color: #67e8f9;
  background: rgba(103, 232, 249, 0.06);
}

/* ── CD Ranking Section ── */
.cd-ranking-section {
  margin-top: 0;
}

.cd-ranking-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.cd-ranking-header h2 {
  margin: 0;
  color: #fff;
  font-size: 22px;
}

.cd-percentile-info {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid rgba(103, 232, 249, 0.14);
  background: rgba(103, 232, 249, 0.04);
  font-size: 13px;
  color: rgba(210, 235, 250, 0.7);
}

.cd-percentile-info strong {
  color: #67e8f9;
  font-weight: 600;
}

/* ── Flag column ── */
.cd-th-flag {
  width: 52px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: rgba(180, 215, 240, 0.55);
}
.cd-td-flag {
  text-align: center;
  cursor: default;
  padding: 6px 2px !important;
}
.cd-flag-img {
  display: inline-block;
  width: 28px;
  height: 20px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  vertical-align: middle;
}
.cd-flag-fallback {
  font-size: 11px;
  font-weight: 600;
  color: rgba(200, 225, 240, 0.5);
}

/* ── CD Ranking Table ── */
.cd-table-wrap {
  overflow: auto;
  max-height: 65vh;
  border-radius: 14px;
  border: 1px solid rgba(125, 221, 255, 0.15);
  background: rgba(6, 16, 24, 0.6);
}

.cd-table-wrap::-webkit-scrollbar { width: 8px; height: 8px; }
.cd-table-wrap::-webkit-scrollbar-thumb { background: rgba(103, 232, 249, 0.18); border-radius: 4px; }
.cd-table-wrap::-webkit-scrollbar-thumb:hover { background: rgba(103, 232, 249, 0.35); }
.cd-table-wrap::-webkit-scrollbar-track { background: rgba(125, 221, 255, 0.04); border-radius: 4px; }
.cd-table-wrap::-webkit-scrollbar-corner { background: transparent; }

.cd-ranking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  color: rgba(220, 240, 255, 0.85);
  white-space: nowrap;
}

.cd-ranking-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(8, 20, 30, 0.96);
  padding: 12px 14px;
  text-align: left;
  font-weight: 700;
  font-size: 12px;
  color: rgba(103, 232, 249, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid rgba(125, 221, 255, 0.15);
  cursor: pointer;
  user-select: none;
  transition: color 120ms ease, background 120ms ease;
}

.cd-ranking-table thead th:hover {
  color: #a7f3ff;
  background: rgba(10, 105, 119, 0.2);
}

.cd-th-rank { width: 40px; text-align: center !important; }
.cd-th-name { min-width: 240px; }
.cd-th-country { min-width: 100px; }
.cd-th-metric { text-align: right !important; min-width: 80px; }
.cd-th-pp { min-width: 90px; }
.cd-th-stat { min-width: 90px; }
.cd-th-active { color: #fff !important; background: rgba(8, 121, 158, 0.4) !important; }

.cd-ranking-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(125, 221, 255, 0.06);
  vertical-align: middle;
}

.cd-ranking-table tbody tr:hover td {
  background: rgba(103, 232, 249, 0.05);
}

.cd-td-rank {
  text-align: center;
  font-weight: 700;
  color: rgba(103, 232, 249, 0.6);
  font-size: 12px;
}

.cd-td-name {
  font-weight: 600;
  color: #fff;
}

.cd-inst-link {
  color: #fff;
  text-decoration: none;
  transition: color 120ms ease;
}

.cd-inst-link:hover {
  color: #67e8f9;
  text-decoration: underline;
}

.cd-mean-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}

/* CD rank indicator on institution cards */
.deepx-cd-rank {
  font-size: 11px;
  font-weight: 400;
  color: rgba(180, 215, 240, 0.5);
  margin-left: 2px;
}

.cd-td-country {
  color: rgba(210, 235, 250, 0.55);
  font-size: 12px;
}

.cd-td-metric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.cd-td-pp {
  font-weight: 600;
}

.cd-td-stat {
  color: rgba(163, 230, 53, 0.85);
}

.cd-td-active {
  color: #fff !important;
  background: rgba(8, 121, 158, 0.18);
}

.cd-empty {
  padding: 60px 30px;
  text-align: center;
  color: rgba(210, 235, 250, 0.5);
  font-size: 15px;
}

.cd-empty button {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 20px;
  border-radius: 8px;
  border: 1px solid rgba(103, 232, 249, 0.3);
  background: rgba(103, 232, 249, 0.08);
  color: #67e8f9;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease;
}

.cd-empty button:hover {
  border-color: rgba(103, 232, 249, 0.7);
  background: rgba(10, 105, 119, 0.25);
}

/* Hide map/hero in rank mode */
body.deepx-institution-runtime .deepx-cd-rank-page .deepx-scholar-hero {
  display: none;
}
body.deepx-institution-runtime .deepx-cd-rank-page .deepx-scholar-intro {
  display: none;
}
body.deepx-institution-runtime .deepx-cd-rank-page .deepx-institution-map-section {
  display: none;
}

/* ── CD Detail Page ── */
body.deepx-cd-detail-runtime main {
  max-width: none;
  padding: 0;
}

.cd-inst-desc {
  margin: 0;
  color: rgba(228, 241, 247, 0.7);
  font-size: 14px;
  line-height: 1.65;
  text-align: justify;
}

.cd-inst-link-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid rgba(141, 224, 255, 0.22);
  background: rgba(255, 255, 255, 0.045);
  color: #67e8f9;
  font-size: 13px;
  text-decoration: none;
  transition: border-color 180ms ease, background 180ms ease;
}
.cd-inst-link-btn:hover {
  border-color: rgba(91, 225, 255, 0.55);
  background: rgba(8, 30, 42, 0.85);
}

@media (max-width: 700px) {
  .cd-inst-info { padding: 16px; }
  .cd-inst-info h1 { font-size: 22px; }
}

.cd-detail-loading {
  padding: 80px 30px;
  text-align: center;
  color: rgba(210, 235, 250, 0.5);
  font-size: 16px;
}

.cd-detail-hero {
  margin-bottom: 24px;
  padding: 30px;
  border-radius: 18px;
  border: 1px solid rgba(174, 232, 255, 0.18);
  background: rgba(6, 16, 24, 0.78);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(14px);
  position: relative;
}

.cd-hero-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.cd-detail-back {
  display: inline-block;
  padding: 8px 18px;
  border: 1px solid rgba(174, 232, 255, 0.25);
  border-radius: 8px;
  background: rgba(6, 16, 24, 0.85);
  color: rgba(174, 232, 255, 0.8);
  font-size: 13px;
  text-decoration: none;
  backdrop-filter: blur(10px);
  transition: border-color 180ms ease, color 180ms ease;
  white-space: nowrap;
}
.cd-detail-back:hover {
  border-color: rgba(91, 225, 255, 0.55);
  color: #67e8f9;
  text-decoration: none;
}
.cd-detail-back-link {
  display: inline-block;
  margin-top: 16px;
  padding: 8px 20px;
  border-radius: 8px;
  border: 1px solid rgba(103, 232, 249, 0.3);
  color: #67e8f9;
  text-decoration: none;
  transition: border-color 180ms ease, background 180ms ease;
}
.cd-detail-back-link:hover {
  border-color: rgba(103, 232, 249, 0.7);
  background: rgba(10, 105, 119, 0.25);
}

.cd-detail-hero-content {
  margin-bottom: 20px;
}

.cd-detail-hero-kicker {
  margin: 0;
  color: #67e8f9;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cd-detail-hero h1 {
  margin: 6px 0 4px;
  color: #fff;
  font-size: clamp(26px, 4vw, 40px);
  max-width: 80%;
  font-weight: 800;
}

.cd-detail-hero-acronym {
  margin: 2px 0 0;
  font-size: 13px;
  color: rgba(103, 232, 249, 0.6);
  font-weight: 500;
}
.cd-detail-hero-roles {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px;
}
.cd-role-badge {
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(103, 232, 249, 0.08);
  border: 1px solid rgba(103, 232, 249, 0.18);
  color: rgba(200, 240, 255, 0.6);
  font-size: 10px;
  text-transform: capitalize;
}
.cd-detail-hero-country {
  margin: 0;
  color: rgba(228, 241, 247, 0.6);
  font-size: 15px;
}

.cd-detail-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.cd-detail-hero-stat {
  flex: 1;
  min-width: 120px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(141, 224, 255, 0.16);
  background: rgba(255, 255, 255, 0.035);
}

.cd-detail-hero-stat span {
  display: block;
  margin-bottom: 4px;
  color: rgba(216, 230, 238, 0.5);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.cd-detail-hero-stat strong {
  color: #fff;
  font-size: 26px;
  font-weight: 800;
}

@media (max-width: 700px) {
  .cd-detail-hero { padding: 18px; }
  .cd-detail-hero h1 { font-size: 20px; max-width: 100%; }
  .cd-detail-hero-stat strong { font-size: 18px; }
}

/* ── Hero row: description left + map right ── */
.cd-hero-row {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.cd-hero-desc {
  flex: 2;
  min-width: 0;
}
.cd-desc-media {
  flex: 1;
  min-width: 220px;
  display: flex;
  flex-direction: column;
}

.cd-inst-map-wrap {
  flex: 1;
}
.cd-inst-desc-wrap {
  overflow: hidden;
  transition: max-height 400ms ease;
}
.cd-desc-toggle {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 0;
  border: none;
  background: none;
  color: #67e8f9;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: color 150ms ease;
}
.cd-desc-toggle:hover {
  color: #a7f3ff;
  text-decoration: underline;
}
.cd-mini-map {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  border: 1px solid rgba(125, 221, 255, 0.18);
  background: #030a10;
}
.cd-inst-map-label {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: rgba(180, 215, 240, 0.5);
  text-align: center;
}

/* ── Mini-map Leaflet overrides ── */
/* Prevent white flash before tiles load — force all panes dark */
.cd-mini-map,
.cd-mini-map .leaflet-container,
.cd-mini-map .leaflet-tile-pane,
.cd-mini-map .leaflet-map-pane,
.cd-mini-map .leaflet-pane {
  background: #030a10 !important;
}
/* Invert light ArcGIS tiles to dark — same reliable tiles, dark appearance */
.cd-mini-map .leaflet-tile-pane {
  filter: invert(0.92) hue-rotate(180deg) brightness(0.75) saturate(0.3);
  /* Force the pane onto its own GPU layer so filter doesn't lag on repaint */
  transform: translateZ(0);
}
/* Let tiles transition in smoothly */
.cd-mini-map .leaflet-tile {
  transition: opacity 0.25s ease;
}
.cd-mini-map .leaflet-tile-loaded {
  opacity: 1;
}
/* Tile filter — ensures the container shows our dark bg through any transparent areas */
.cd-mini-map .leaflet-container {
  background-color: #030a10 !important;
}

.cd-mini-map .leaflet-control-zoom {
  border: 1px solid rgba(125, 221, 255, 0.15) !important;
  border-radius: 6px !important;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.cd-mini-map .leaflet-control-zoom a {
  width: 28px;
  height: 28px;
  line-height: 28px;
  background: rgba(6, 20, 30, 0.92) !important;
  color: rgba(200, 225, 240, 0.75) !important;
  font-size: 16px;
  border-bottom: 1px solid rgba(125, 221, 255, 0.06) !important;
  transition: all 150ms ease;
}
.cd-mini-map .leaflet-control-zoom a:last-child {
  border-bottom: none !important;
}
.cd-mini-map .leaflet-control-zoom a:hover {
  background: rgba(10, 105, 119, 0.35) !important;
  color: #67e8f9 !important;
}
.cd-mini-map .leaflet-control-attribution {
  display: none;
}

/* Permanent tooltip — institution name label */
.cd-mini-map-tooltip {
  background: rgba(6, 20, 30, 0.94) !important;
  border: 1px solid rgba(103, 232, 249, 0.35) !important;
  border-radius: 6px !important;
  color: rgba(220, 240, 255, 0.92) !important;
  font-family: inherit !important;
  font-size: 12px !important;
  font-weight: 500;
  padding: 5px 10px !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.55), 0 0 10px rgba(55, 212, 255, 0.08) !important;
  white-space: nowrap;
  pointer-events: none;
}
.cd-mini-map-tooltip.leaflet-tooltip-top::before {
  border-top-color: rgba(6, 20, 30, 0.94) !important;
}
.cd-mini-map-tooltip.leaflet-tooltip-bottom::before {
  border-bottom-color: rgba(6, 20, 30, 0.94) !important;
}

/* Static glow ring around institution marker */
.cd-map-pulse {
  filter: drop-shadow(0 0 4px rgba(103, 232, 249, 0.5));
}

@media (max-width: 700px) {
  .cd-hero-row { flex-direction: column; }
  .cd-desc-media { width: 100%; }
  .cd-mini-map { aspect-ratio: 2/1; }
}

/* ── CD Detail Sections ── */
.cd-detail-section {
  margin-bottom: 24px;
  padding: 24px;
  border-radius: 16px;
  border: 1px solid rgba(174, 232, 255, 0.14);
  background: rgba(6, 16, 24, 0.55);
  backdrop-filter: blur(10px);
}

.cd-detail-section h2 {
  margin: 0 0 6px;
  color: #fff;
  font-size: 20px;
}

.cd-detail-section .deepx-scholar-muted {
  margin: 0 0 16px;
  color: rgba(228, 241, 247, 0.55);
  font-size: 13px;
}

/* ── Chart reset button ── */
.cd-chart-reset-btn {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(144, 225, 255, 0.22);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(210, 235, 250, 0.65);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: all 150ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
}
.cd-chart-reset-btn:hover {
  border-color: rgba(103, 232, 249, 0.55);
  color: #67e8f9;
  background: rgba(10, 105, 119, 0.2);
}

/* ── Radar values table ── */
.cd-radar-col {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.cd-radar-values {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px 12px;
  margin-top: 8px;
  padding: 0 4px;
  width: 100%;
}
.cd-radar-val {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 11px;
  border-bottom: 1px solid rgba(125,221,255,0.06);
}
.cd-radar-val span {
  color: rgba(180,215,240,0.5);
}
.cd-radar-val strong {
  color: rgba(220,240,255,0.8);
  font-weight: 600;
}

/* ── Overview Layout ── */
.cd-ov-layout {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
@media (max-width: 800px) {
  .cd-ov-layout { flex-direction: column; align-items: stretch; }
  .cd-radar-col { align-items: center; }
  #cdRadarChart { width: 100% !important; max-width: 400px; }
}

/* ── Overview Table ── */
.cd-ov-table-wrap {
  overflow-x: auto;
}

.cd-ov-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  color: rgba(220, 240, 255, 0.85);
}

.cd-ov-table thead th {
  padding: 8px 14px;
  text-align: left;
  font-weight: 700;
  font-size: 12px;
  color: rgba(103, 232, 249, 0.65);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid rgba(125, 221, 255, 0.12);
}

.cd-ov-th-group {
  text-align: center;
  padding: 8px 14px;
}

.cd-ov-th-spacer {
  width: 30px;
}

.cd-ov-table tbody td {
  padding: 8px 14px;
  border-bottom: 1px solid rgba(125, 221, 255, 0.06);
  vertical-align: middle;
}

.cd-ov-table tbody tr:hover td {
  background: rgba(103, 232, 249, 0.04);
}

.cd-ov-td-label {
  font-weight: 600;
  color: #fff;
  font-size: 14px;
}

.cd-ov-td-value {
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 15px;
  color: rgba(163, 230, 53, 0.9);
  min-width: 80px;
}

.cd-ov-td-spacer {
  width: 40px;
  border-left: 1px solid rgba(125, 221, 255, 0.08);
}

/* ── Chart tooltip ── */
.cd-chart-tooltip {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(103, 232, 249, 0.35);
  background: rgba(6, 20, 30, 0.96);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  font-size: 12px;
  line-height: 1.5;
  color: rgba(220, 240, 255, 0.9);
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, -100%);
  z-index: 20;
}

/* ── Histogram ── */
.cd-histogram {
  margin-top: 8px;
}

.cd-hist-legend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 12px;
  font-size: 11px;
}
.cd-hist-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.cd-hist-bars {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  border-bottom: 1px solid rgba(125, 221, 255, 0.15);
}

.cd-hist-bar {
  flex: 1;
  min-width: 4px;
  border-radius: 2px 2px 0 0;
  position: relative;
  cursor: crosshair;
  transition: opacity 120ms ease;
}

.cd-hist-bar:hover {
  opacity: 0.75;
  filter: brightness(1.3);
}

.cd-hist-xaxis {
  display: flex;
  justify-content: space-between;
  padding: 4px 0 0;
  font-size: 10px;
  color: rgba(210, 235, 250, 0.4);
}

/* ── Yearly Chart ── */
.cd-yearly-svg {
  width: 100%;
  display: block;
}

.cd-yearly-svg text {
  transition: fill 120ms ease;
  cursor: pointer;
}
.cd-yearly-svg text:hover {
  fill: #a7f3ff;
}

.cd-yearly-xaxis {
  display: flex;
  justify-content: space-between;
  padding: 4px 0 0;
  font-size: 10px;
  color: rgba(210, 235, 250, 0.4);
}

/* ── CD Rank lazy-load bar ── */
.cd-load-more-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px 0 10px;
  flex-wrap: wrap;
}

.cd-load-more-info {
  font-size: 13px;
  color: rgba(210, 235, 250, 0.55);
}

.cd-load-more-btn {
  padding: 8px 20px;
  border-radius: 8px;
  border: 1px solid rgba(103, 232, 249, 0.3);
  background: rgba(103, 232, 249, 0.08);
  color: #67e8f9;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease;
}

.cd-load-more-btn:hover {
  background: rgba(103, 232, 249, 0.18);
  border-color: rgba(103, 232, 249, 0.55);
}

/* ── P3: Top Disruptive Papers ── */
.cd-top-papers-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cd-top-paper-card {
  display: flex;
  align-items: stretch;
  border-radius: 10px;
  border: 1px solid rgba(141, 224, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
  transition: border-color 150ms ease, background 150ms ease;
}
.cd-top-paper-card:hover {
  border-color: rgba(103, 232, 249, 0.35);
  background: rgba(255, 255, 255, 0.055);
}

.cd-top-paper-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-width: 42px;
  font-size: 13px;
  font-weight: 700;
  color: #000;
}

.cd-top-paper-body {
  padding: 12px 16px;
  flex: 1;
}

.cd-top-paper-cd {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.cd-top-paper-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: rgba(200, 225, 240, 0.5);
}

.cd-top-paper-link {
  color: rgba(103, 232, 249, 0.65);
  text-decoration: none;
  font-weight: 500;
}
.cd-top-paper-link:hover {
  color: #67e8f9;
  text-decoration: underline;
}

.cd-top-paper-year {
  color: rgba(210, 235, 250, 0.4);
}

.cd-top-paper-pid {
  color: rgba(180, 215, 240, 0.35);
  font-family: monospace;
  font-size: 11px;
}

/* ── P0: Paper Cards ── */
.cd-papers-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cd-paper-card {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid rgba(141, 224, 255, 0.12);
  background: rgba(255, 255, 255, 0.025);
  transition: border-color 150ms ease, background 150ms ease;
}
.cd-paper-card:hover {
  border-color: rgba(103, 232, 249, 0.3);
  background: rgba(255, 255, 255, 0.045);
}

.cd-paper-card-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 50px;
  padding-top: 2px;
}

.cd-paper-card-rank {
  font-size: 13px;
  font-weight: 700;
  color: rgba(200, 225, 240, 0.55);
}
.cd-paper-card-rank-overall {
  font-size: 10px;
  color: rgba(180, 215, 240, 0.3);
}

.cd-paper-card-body {
  flex: 1;
  min-width: 0;
}

.cd-paper-card-title-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.cd-paper-card-title {
  color: rgba(220, 240, 255, 0.88);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}
.cd-paper-card-title:hover {
  color: #67e8f9;
  text-decoration: underline;
}

.cd-paper-card-authors {
  margin: 4px 0 0;
  font-size: 12px;
  color: rgba(200, 225, 240, 0.5);
  line-height: 1.4;
}

.cd-paper-card-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 6px 0 0;
  font-size: 12px;
  color: rgba(180, 215, 240, 0.45);
}
.cd-paper-card-cd {
  font-weight: 700;
  font-size: 13px;
}

.cd-paper-card-links {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-size: 12px;
}
.cd-paper-card-links a {
  color: rgba(103, 232, 249, 0.5);
  text-decoration: none;
}
.cd-paper-card-links a:hover {
  color: #67e8f9;
  text-decoration: underline;
}

.cd-pl-oa {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(34, 197, 94, 0.18);
  color: #22c55e;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Paper card abstract */
.cd-paper-abstract-wrap {
  margin-top: 6px;
}
.cd-paper-abstract {
  margin: 0;
  font-size: 12px;
  color: rgba(180, 215, 240, 0.5);
  line-height: 1.5;
  max-height: 5.4em;  /* ~3 lines */
  overflow: hidden;
  text-align: justify;
  transition: max-height 0.3s ease;
}
.cd-paper-abstract.expanded {
  max-height: none;
}
.cd-paper-abstract-toggle {
  display: inline-block;
  margin-top: 2px;
  padding: 2px 8px;
  background: rgba(103, 232, 249, 0.08);
  border: 1px solid rgba(103, 232, 249, 0.2);
  border-radius: 4px;
  color: rgba(103, 232, 249, 0.7);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  transition: all 150ms ease;
}
.cd-paper-abstract-toggle:hover {
  color: #67e8f9;
  border-color: rgba(103, 232, 249, 0.45);
  background: rgba(103, 232, 249, 0.14);
}

/* Yearly chart color legend */
.cd-yearly-legend {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  margin-top: 8px;
}
.cd-yearly-legend-row {
  display: flex;
  gap: 2px;
}
.cd-yearly-swatch {
  width: 64px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.cd-yearly-swatch:hover {
  transform: scaleY(1.6);
  opacity: 0.85;
}
.cd-yearly-swatch.active {
  transform: scaleY(2);
  outline: 1px solid rgba(255,255,255,0.7);
  outline-offset: 1px;
}
.cd-yearly-legend-labels {
  font-size: 10px;
  color: rgba(180, 215, 240, 0.45);
  white-space: nowrap;
}
.cd-yearly-legend-labels span {
  width: 64px;
  text-align: center;
  display: inline-block;
}

/* Pagination */
.cd-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.cd-page-numbers {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cd-page-btn {
  min-width: 34px; height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid rgba(144, 225, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(210, 235, 250, 0.65);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 150ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cd-page-btn:hover:not(:disabled):not(.active) {
  border-color: rgba(103, 232, 249, 0.45);
  background: rgba(10, 105, 119, 0.15);
  color: #67e8f9;
}
.cd-page-btn.active {
  border-color: rgba(103, 232, 249, 0.7);
  background: rgba(10, 105, 119, 0.3);
  color: #67e8f9;
  font-weight: 600;
}
.cd-page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.cd-page-btn.cd-page-nav {
  min-width: auto;
  padding: 0 14px;
}
.cd-page-ellipsis {
  width: 34px;
  text-align: center;
  color: rgba(180, 215, 240, 0.35);
  font-size: 14px;
}

/* Paper list loading */
.cd-papers-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px;
  color: rgba(180, 215, 240, 0.55);
  font-size: 14px;
}
.cd-papers-spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid rgba(103, 232, 249, 0.15);
  border-top-color: #67e8f9;
  border-radius: 50%;
  animation: cdPapersSpin 0.7s linear infinite;
}
@keyframes cdPapersSpin {
  to { transform: rotate(360deg); }
}

/* ── Institution Group Rows (机构群组) ──────────────────────────────────── */

/* Group toggle button */
.cd-group-toggle-btn {
  margin-left: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 215, 0, 0.25);
  background: rgba(255, 215, 0, 0.06);
  color: #b8a040;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.cd-group-toggle-btn:hover {
  background: rgba(255, 215, 0, 0.14);
  border-color: rgba(255, 215, 0, 0.45);
  color: #e8d070;
}
.cd-group-toggle-btn.active {
  background: rgba(255, 215, 0, 0.18);
  border-color: rgba(255, 215, 0, 0.5);
  color: #f0d860;
  box-shadow: 0 0 6px rgba(255, 200, 40, 0.25);
}

/* Group row */
.cd-group-row {
  background: linear-gradient(90deg, rgba(255, 200, 60, 0.09), rgba(255, 200, 60, 0.03));
  border-bottom: 2px solid rgba(255, 200, 60, 0.25) !important;
  cursor: pointer;
  transition: background 0.15s;
}
.cd-group-row:hover {
  background: linear-gradient(90deg, rgba(255, 200, 60, 0.16), rgba(255, 200, 60, 0.07));
}
.cd-group-rank {
  font-size: 18px;
  text-align: center;
}
.cd-group-chevron {
  display: inline-block;
  width: 16px;
  font-size: 14px;
  color: #e8d070;
  margin-right: 4px;
}
.cd-group-name {
  font-weight: 700;
  font-size: 14px;
  color: #f4e4a0;
}
.cd-group-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 10px;
  background: rgba(255, 200, 60, 0.18);
  color: #d4b840;
  font-size: 11px;
  font-weight: 500;
}
.cd-group-metric {
  font-weight: 600 !important;
  color: #f4e4a0 !important;
}

/* Child rows */
.cd-child-row {
  background: rgba(255, 200, 60, 0.03);
  border-bottom: 1px solid rgba(255, 200, 60, 0.08);
  transition: background 0.15s;
}
.cd-child-row:hover {
  background: rgba(255, 200, 60, 0.07);
}
.cd-child-rank {
  font-size: 11px;
  color: rgba(180, 180, 160, 0.55);
  text-align: center;
}
.cd-child-name {
  padding-left: 24px !important;
}
.cd-child-indent {
  display: inline-block;
  width: 12px;
}
.cd-child-label {
  display: inline-block;
  margin-right: 6px;
  padding: 0px 5px;
  border-radius: 3px;
  background: rgba(255, 200, 60, 0.1);
  color: rgba(200, 170, 70, 0.7);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
}
.cd-child-metric {
  color: rgba(200, 210, 220, 0.65) !important;
  font-size: 12px !important;
}
.cd-child-city {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  color: rgba(180, 190, 200, 0.55);
}
.cd-child-rank {
  font-size: 12px;
  color: rgba(200, 210, 220, 0.55);
  text-align: center;
}
/* Make child links dimmer but clickable */
.cd-child-name .cd-inst-link {
  color: rgba(180, 200, 220, 0.75);
  font-size: 12px;
}
.cd-child-name .cd-inst-link:hover {
  color: #67e8f9;
  text-decoration: underline;
}
