:root {
  --primary: #2e5497;
  --primary-strong: #1f417e;
  --primary-soft: #eaf0fa;
  --accent: #e8a602;
  --bg: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --card: #f7f9fc;
  --card2: #f5f7fa;
  --border: #e5e7eb;
  --surface: #ffffff;
  --shadow: 0 12px 32px rgba(30, 64, 120, 0.08);
}

[data-theme="dark"] {
  --bg: #0c1220;
  --text: #e5e7eb;
  --muted: #9aa8bd;
  --card: #141b2e;
  --card2: #1a2340;
  --border: #24314b;
  --surface: #11192b;
  --primary-soft: #192947;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  font-family: "Segoe UI", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 8%, color-mix(in srgb, var(--primary) 8%, transparent), transparent 30rem),
    var(--bg);
  line-height: 1.6;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding: 15px;
  color: #fff;
  background: rgba(46, 84, 151, 0.96);
  border-bottom: 2px solid rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.05rem;
  line-height: 1.3;
}

.brand small {
  margin-top: 1px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  opacity: 0.72;
}

.logo-mark {
  display: block;
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 50%;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.data-year {
  font-size: 0.9rem;
  opacity: 0.86;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: #fff;
}

.page {
  width: min(1480px, 92vw);
  margin: 0 auto;
  padding: 52px 0 48px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 30px;
  align-items: end;
  margin-bottom: 30px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 10px;
  color: var(--primary);
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.16;
  letter-spacing: -0.035em;
}

.intro p:last-child {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.intro-stat {
  display: flex;
  min-width: 150px;
  padding: 18px 22px;
  flex-direction: column;
  border-left: 3px solid var(--accent);
  background: var(--card);
  border-radius: 0 12px 12px 0;
}

.intro-stat span {
  color: var(--primary);
  font-size: 1.65rem;
  font-weight: 750;
  line-height: 1.2;
}

.intro-stat small {
  margin-top: 5px;
  color: var(--muted);
}

.search-card,
.results-section {
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.section-heading,
.results-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

h2 {
  margin-bottom: 0;
  color: var(--primary);
  font-size: 1.45rem;
}

.text-button {
  padding: 4px 0;
  color: var(--primary);
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
}

.text-button:hover {
  color: var(--accent);
  border-color: currentColor;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
  margin-top: 20px;
}

.field-keyword {
  grid-column: 1 / -1;
}

.field-if,
.field-edition,
.field-jcr-quartile,
.field-xinrui-partition {
  grid-column: span 3;
}

.field-category {
  grid-column: span 9;
}

.filter-grid > .primary-button {
  grid-column: span 3;
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field > span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
}

input,
select {
  width: 100%;
  min-height: 45px;
  padding: 10px 12px;
  color: var(--text);
  outline: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
}

.input-with-icon {
  position: relative;
}

.input-with-icon > span {
  position: absolute;
  top: 50%;
  left: 13px;
  color: var(--muted);
  font-size: 1.2rem;
  transform: translateY(-52%);
  pointer-events: none;
}

.input-with-icon input {
  padding-right: 78px;
  padding-left: 38px;
}

.input-with-icon input::-webkit-search-cancel-button {
  display: none;
}

.input-action {
  position: absolute;
  top: 50%;
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  transform: translateY(-50%);
}

.input-action:focus-visible {
  background: var(--primary-soft);
  outline: none;
}

.action-icon {
  position: absolute;
  width: 21px;
  height: 21px;
  object-fit: contain;
  transition: opacity 0.16s ease, transform 0.16s ease;
  pointer-events: none;
}

.action-icon-active {
  opacity: 0;
}

.input-action:hover .action-icon-default,
.input-action:focus-visible .action-icon-default {
  opacity: 0;
}

.input-action:hover .action-icon-active,
.input-action:focus-visible .action-icon-active {
  opacity: 1;
  transform: scale(1.04);
}

.input-search {
  right: 38px;
}

.input-clear {
  right: 5px;
}

.primary-button {
  display: inline-flex;
  min-height: 45px;
  padding: 10px 18px;
  align-items: center;
  justify-content: center;
  gap: 15px;
  color: #fff;
  white-space: nowrap;
  background: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 9px;
  font-weight: 700;
  transition: transform 0.2s, background 0.2s;
}

.primary-button:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.form-error {
  margin: 14px 0 0;
  color: #b42318;
  font-size: 0.9rem;
}

.results-section {
  margin-top: 24px;
  background: var(--surface);
}

.result-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.mobile-sort-control {
  display: none;
}

.results-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.results-view-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 5px;
  color: var(--primary);
  background: transparent;
  border: 0;
  border-radius: 6px;
  transform: translateY(1.5px);
  transition: color 0.2s ease;
}

.results-view-toggle:active {
  color: var(--accent);
}

@media (hover: hover) {
  .results-view-toggle:hover {
    color: var(--accent);
  }
}

.results-view-toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.results-section.is-results-fullscreen .results-title {
  display: none;
}

.export-button {
  min-height: 32px;
  padding: 5px 9px;
  color: var(--primary);
  white-space: nowrap;
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: 7px;
  font-size: 0.76rem;
  font-weight: 700;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.export-button:hover {
  color: #fff;
  background: var(--primary);
  transform: translateY(-1px);
}

.export-button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.result-summary {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.page-size-control {
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-select {
  position: relative;
  min-width: 0;
}

.custom-select-category,
.custom-select-filter,
.custom-select-filter .custom-select-menu {
  width: 100%;
}

.filter-multiselect-actions {
  position: sticky;
  top: -8px;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin: -8px -8px 6px;
  padding: 9px 12px;
  background: var(--primary-strong);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.filter-multiselect-action {
  padding: 2px 0;
  color: #fff;
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
  font-size: 0.78rem;
  font-weight: 700;
}

.filter-multiselect-action:hover:not(:disabled),
.filter-multiselect-action:focus-visible {
  color: var(--accent);
  border-color: currentColor;
  outline: none;
}

.filter-multiselect-action:disabled {
  cursor: default;
  opacity: 0.45;
}

.custom-select-page-size {
  min-width: 70px;
}

.custom-select-toggle {
  display: flex;
  width: 100%;
  min-height: 45px;
  padding: 8px 12px;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: var(--text);
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.custom-select-page-size .custom-select-toggle {
  min-height: 0;
  padding: 8px;
  justify-content: center;
  color: #fff;
  background: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.custom-select-page-size .custom-select-toggle:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: none;
}

.custom-select-toggle:hover,
.custom-select-toggle[aria-expanded="true"],
.custom-select-toggle:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
  outline: none;
}

.custom-select-toggle > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-arrow {
  flex: 0 0 auto;
  transition: transform 0.2s ease;
}

.custom-select-toggle[aria-expanded="true"] .custom-select-arrow {
  transform: rotate(180deg);
}

.custom-select-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 1200;
  width: max-content;
  min-width: 100%;
  max-width: min(560px, calc(100vw - 24px));
  max-height: min(55vh, 420px);
  padding: 8px;
  overflow-y: auto;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  background: var(--primary);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.24);
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.custom-select-page-size .custom-select-menu {
  right: auto;
  left: 0;
  min-width: 104px;
  padding: 6px;
  border-radius: 8px;
}

.custom-select-page-size .custom-select-option {
  padding: 7px 9px;
  font-size: 0.92rem;
  text-align: center;
}

.custom-select-menu.show {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.custom-select-option {
  display: block;
  width: 100%;
  padding: 8px 10px;
  color: #fff;
  text-align: left;
  white-space: nowrap;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.custom-select-option:hover,
.custom-select-option:focus-visible,
.custom-select-option.active {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.custom-select-option.active {
  font-weight: 700;
}

.category-multiselect-menu {
  right: 0;
  left: auto;
  width: min(640px, calc(100vw - 24px));
  max-height: none;
  padding: 0;
  overflow: hidden;
}

.category-menu-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  gap: 8px;
  padding: 10px;
  background: var(--primary-strong);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.category-search-wrap {
  position: relative;
  display: block;
}

.category-search-wrap > span {
  position: absolute;
  top: 50%;
  left: 12px;
  z-index: 1;
  color: var(--primary);
  transform: translateY(-50%);
  pointer-events: none;
}

.category-search-wrap input {
  min-height: 38px;
  padding: 7px 10px 7px 35px;
  color: #0f172a;
  background: #fff;
  border: 0;
}

.category-menu-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.76rem;
}

.category-menu-summary button {
  padding: 2px 0;
  color: #fff;
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
  font-size: inherit;
}

.category-menu-summary button:hover:not(:disabled) {
  color: var(--accent);
  border-color: currentColor;
}

.category-menu-summary button:disabled {
  cursor: default;
  opacity: 0.45;
}

.category-options {
  max-height: min(48vh, 390px);
  padding: 7px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.category-option {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  white-space: normal;
  line-height: 1.35;
}

.category-option-check {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 900;
}

.category-option.active .category-option-check {
  color: var(--primary);
  background: var(--accent);
  border-color: var(--accent);
}

.category-option:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.category-no-results {
  margin: 0;
  padding: 18px;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
  font-size: 0.82rem;
}

.category-selection-panel {
  display: flex;
  width: 100%;
  min-width: 0;
  grid-column: 1 / -1;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--primary-soft) 72%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 16%, var(--border));
  border-radius: 10px;
}

.selected-category-summary {
  min-width: 0;
  flex: 1;
}

.selected-category-list {
  --category-list-collapsed-height: 96px;
  display: flex;
  min-width: 0;
  flex: 1;
  flex-wrap: wrap;
  gap: 6px;
}

.selected-category-list.is-collapsed {
  max-height: var(--category-list-collapsed-height);
  overflow: hidden;
}

.category-selection-toggle {
  margin-top: 7px;
  padding: 2px 0;
  color: var(--primary);
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
  font-size: 0.76rem;
  font-weight: 700;
}

.category-selection-toggle:hover,
.category-selection-toggle:focus-visible {
  color: var(--accent);
  border-color: currentColor;
  outline: none;
}

.selected-category-tag {
  display: inline-flex;
  min-width: 0;
  max-width: min(100%, 380px);
  min-height: 28px;
  padding: 4px 8px;
  align-items: center;
  gap: 7px;
  color: var(--primary);
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
  border-radius: 999px;
  font-size: 0.72rem;
}

.selected-category-tag > span {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-category-tag button {
  display: inline-grid;
  position: relative;
  width: 17px;
  height: 17px;
  padding: 0;
  flex: 0 0 auto;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 50%;
  line-height: 1;
}

.selected-category-tag button:hover {
  background: var(--primary-soft);
}

.category-remove-icon {
  position: absolute;
  width: 12px;
  height: 12px;
  object-fit: contain;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.category-remove-icon-active {
  opacity: 0;
}

.selected-category-tag button:hover .category-remove-icon-default,
.selected-category-tag button:focus-visible .category-remove-icon-default {
  opacity: 0;
}

.selected-category-tag button:hover .category-remove-icon-active,
.selected-category-tag button:focus-visible .category-remove-icon-active {
  opacity: 1;
  transform: scale(1.04);
}

.category-match-control {
  display: inline-flex;
  margin: 0;
  padding: 2px;
  flex: 0 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
}

.category-match-control legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.category-match-control label {
  position: relative;
  cursor: pointer;
}

.category-match-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
  opacity: 0;
  pointer-events: none;
}

.category-match-control span {
  display: block;
  padding: 5px 9px;
  color: var(--muted);
  border-radius: 7px;
  font-size: 0.7rem;
  white-space: nowrap;
}

.category-match-control input:checked + span {
  color: #fff;
  background: var(--primary);
}

.category-match-control input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.loading-state,
.empty-state {
  display: flex;
  min-height: 240px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.results-section.is-loading .table-wrap,
.results-section.is-loading .empty-state,
.results-section.is-loading .pagination {
  display: none !important;
}

.results-section.is-loading #resultSummary,
.results-section.is-loading .result-actions {
  visibility: hidden;
}

.loading-state {
  min-height: clamp(280px, 42vh, 480px);
  flex-direction: column;
  gap: 12px;
  text-align: center;
}

.loading-content {
  display: grid;
  width: min(420px, calc(100% - 72px));
  gap: 10px;
  justify-items: center;
}

.download-progress {
  display: grid;
  width: 100%;
  gap: 7px;
  justify-items: center;
}

.download-progress-track {
  width: 100%;
  height: 8px;
  overflow: hidden;
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  border-radius: 999px;
}

.download-progress-bar {
  display: block;
  width: 0;
  height: 100%;
  background: var(--primary);
  border-radius: inherit;
  transition: width 0.15s ease;
}

.download-progress.indeterminate .download-progress-bar {
  width: 38%;
  animation: download-indeterminate 1.1s ease-in-out infinite;
}

.download-progress small {
  width: 100%;
  color: var(--muted);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

@keyframes download-indeterminate {
  from { transform: translateX(-110%); }
  to { transform: translateX(280%); }
}

.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  flex-direction: column;
  text-align: center;
}

.empty-state > span {
  color: var(--primary);
  font-size: 3rem;
}

.empty-state h3 {
  margin: 8px 0 3px;
  color: var(--text);
}

.empty-state p {
  margin: 0;
}

.table-wrap {
  margin-top: 22px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

table {
  width: 100%;
  min-width: 1280px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  padding: 13px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: var(--card2);
  font-size: 0.86rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

@media (min-width: 721px) {
  .table-wrap th,
  .table-wrap td {
    vertical-align: middle;
  }

  .table-wrap .xinrui-header,
  .table-wrap .xinrui-cell {
    min-width: 150px;
  }

  .table-wrap .xinrui-partition {
    flex-wrap: nowrap;
  }

  .table-wrap .xinrui-subject {
    overflow-wrap: normal;
    white-space: nowrap;
  }
}

.sort-button {
  display: inline-flex;
  width: 100%;
  padding: 0;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  color: inherit;
  background: transparent;
  border: 0;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

.number-cell .sort-button {
  justify-content: flex-end;
}

.sort-button:hover,
.sort-button:focus-visible,
.sort-button.sort-active {
  color: var(--primary);
}

.sort-button:focus-visible {
  outline: 1.5px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

.sort-icons {
  display: inline-grid;
  flex: 0 0 auto;
  row-gap: 2px;
  color: color-mix(in srgb, var(--muted) 48%, transparent);
  font-size: 0.5rem;
  line-height: 0.75;
}

.sort-arrow-up,
.sort-arrow-down {
  transition: color 0.18s ease, opacity 0.18s ease;
}

.sort-button[data-direction="asc"] .sort-arrow-up,
.sort-button[data-direction="desc"] .sort-arrow-down {
  color: var(--accent);
  opacity: 1;
}

.sort-button[data-direction="asc"] .sort-arrow-down,
.sort-button[data-direction="desc"] .sort-arrow-up {
  opacity: 0.28;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: color-mix(in srgb, var(--primary) 4%, transparent);
}

.journal-name {
  display: block;
  max-width: 280px;
  color: var(--primary);
  font-weight: 700;
  line-height: 1.4;
}

.journal-abbr {
  display: block;
  max-width: 280px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
}

.journal-meta {
  display: flex;
  max-width: 280px;
  margin-top: 4px;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.journal-meta .journal-abbr {
  margin-top: 0;
}

.journal-header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.journal-identifiers-toggle {
  display: inline-flex;
  min-height: 20px;
  padding: 1px 5px;
  align-items: center;
  gap: 3px;
  color: #fff;
  background: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 5px;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.journal-identifiers-toggle:hover,
.journal-identifiers-toggle:active,
.journal-identifiers-toggle[aria-pressed="true"] {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.journal-identifiers-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.journal-identifiers {
  display: block;
  max-width: 280px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.74rem;
}

.journal-identifiers[hidden] {
  display: none;
}

.publisher-cell {
  max-width: 190px;
}

.category-list {
  display: flex;
  max-width: 300px;
  flex-wrap: wrap;
  gap: 5px;
}

.chip {
  display: inline-flex;
  padding: 3px 7px;
  align-items: center;
  gap: 4px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 5px;
  font-size: 0.72rem;
  line-height: 1.4;
}

.category-label,
.category-name-rank {
  min-width: 0;
  overflow-wrap: anywhere;
}

.category-quartile {
  min-width: 26px;
  padding: 0.5px 5px 1.5px;
  flex: 0 0 auto;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  background: var(--primary);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
}

.xinrui-partition {
  display: inline-flex;
  padding: 3px 7px;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  background: var(--primary-soft);
  border-radius: 5px;
}

.xinrui-subject {
  min-width: 0;
  color: var(--primary);
  font-size: 0.72rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.xinrui-partition-badge {
  min-width: 34px;
}

.category-rank {
  flex: 0 0 auto;
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.category-quartile-q1 {
  background: #c98b00;
}

.category-quartile-q2 {
  background: #3564a8;
}

.category-quartile-q3 {
  background: #3f7f86;
}

.category-quartile-q4 {
  background: #7c3aed;
}

[data-theme="dark"] .category-quartile-q1 {
  color: #fff2bd;
  background: #8b6200;
}

[data-theme="dark"] .category-quartile-q2 {
  color: #dbeafe;
  background: #294f87;
}

[data-theme="dark"] .category-quartile-q3 {
  color: #d4f2f2;
  background: #2f6268;
}

[data-theme="dark"] .category-quartile-q4 {
  color: #f3e8ff;
  background: #6d28d9;
}

.index-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.index-badge {
  padding: 3px 6px;
  color: var(--primary);
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 700;
}

.index-badge-scie {
  color: #1d4ed8;
  background: #dbeafe;
  border-color: #93c5fd;
}

.index-badge-medline {
  color: #155e75;
  background: #cffafe;
  border-color: #67e8f9;
}

[data-theme="dark"] .index-badge-medline {
  color: #a5f3fc;
  background: rgba(14, 116, 144, 0.22);
  border-color: #0e7490;
}

.index-badge-ssci {
  color: #7e22ce;
  background: #f3e8ff;
  border-color: #d8b4fe;
}

.index-badge-ahci {
  color: #a16207;
  background: #fef3c7;
  border-color: #fcd34d;
}

.index-badge-esci {
  color: #047857;
  background: #d1fae5;
  border-color: #6ee7b7;
}

[data-theme="dark"] .index-badge-scie {
  color: #bfdbfe;
  background: rgba(37, 99, 235, 0.22);
  border-color: rgba(96, 165, 250, 0.5);
}

[data-theme="dark"] .index-badge-ssci {
  color: #e9d5ff;
  background: rgba(147, 51, 234, 0.22);
  border-color: rgba(192, 132, 252, 0.5);
}

[data-theme="dark"] .index-badge-ahci {
  color: #fde68a;
  background: rgba(202, 138, 4, 0.22);
  border-color: rgba(250, 204, 21, 0.5);
}

[data-theme="dark"] .index-badge-esci {
  color: #a7f3d0;
  background: rgba(5, 150, 105, 0.22);
  border-color: rgba(52, 211, 153, 0.5);
}

.number-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.similarity-header,
.similarity-cell {
  color: var(--primary);
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.similarity-header .sort-button {
  justify-content: flex-end;
}

.similarity-cell {
  font-weight: 700;
}

.if-value {
  color: var(--primary);
  font-size: 1rem;
  font-weight: 600;
}

.medsci-link,
.bing-link,
.shengxin-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.medsci-link:hover,
.bing-link:hover,
.shengxin-link:hover {
  color: var(--accent);
}

.pagination {
  display: flex;
  flex-direction: column;
  margin-top: 18px;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.pagination-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.page-jump {
  display: flex;
  margin-top: 4px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.8rem;
}

.page-jump input {
  width: 82px;
  min-height: 34px;
  padding: 5px 8px;
  color: var(--muted);
  text-align: center;
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
  font-size: 0.82rem;
  font-weight: 400;
}

.page-jump input::placeholder {
  color: color-mix(in srgb, var(--muted) 78%, transparent);
  font-weight: 400;
  opacity: 1;
}

.page-jump input:focus {
  border: 1.5px solid var(--accent);
  box-shadow: none;
  outline: none;
}

.page-jump button {
  min-height: 34px;
  padding: 5px 13px;
  color: #fff;
  background: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.page-jump button:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.page-buttons {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.page-button,
.page-ellipsis {
  min-width: 38px;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  line-height: 1;
}

.page-button {
  color: var(--primary);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.page-button:hover:not(:disabled):not(.active) {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.page-button.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  cursor: default;
}

.page-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

@media (min-width: 721px) {
  .custom-select-page-size {
    min-width: 63px;
  }

  .custom-select-page-size .custom-select-toggle {
    padding: 7px 7px 7px 9px;
    gap: 5px;
    border-radius: 7px;
    font-size: 0.99rem;
  }

  .page-button,
  .page-ellipsis {
    min-width: 31px;
    height: 29px;
    padding-inline: 10px;
    border-radius: 8px;
    font-size: 0.82rem;
  }

  .page-jump {
    gap: 6px;
    font-size: 0.72rem;
  }

  .page-jump input {
    width: 74px;
    min-height: 28px;
    padding: 3px 7px;
    border-radius: 8px;
    font-size: 0.74rem;
  }

  .page-jump button {
    min-height: 28px;
    padding: 3px 11px;
    border-radius: 6px;
    font-size: 0.68rem;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

footer {
  display: flex;
  width: min(1480px, 92vw);
  margin: 0 auto;
  padding: 12px 0 34px;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
}

footer p {
  margin: 0;
}

footer p:first-child {
  text-align: center;
}

.visit-counts {
  text-align: right;
  white-space: nowrap;
}

.visit-count-value {
  color: var(--primary);
}

.cache-refresh-link {
  padding: 0;
  color: var(--primary);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  background: transparent;
  border: 0;
}

.cache-refresh-link:hover,
.cache-refresh-link:focus-visible {
  color: var(--accent);
}

.cache-refresh-link:disabled {
  cursor: wait;
  opacity: 0.65;
}

@media (max-width: 980px) {
  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-keyword,
  .field-category,
  .filter-grid > .primary-button {
    grid-column: 1 / -1;
  }

  .field-if,
  .field-edition,
  .field-jcr-quartile,
  .field-xinrui-partition {
    grid-column: span 1;
  }
}

@media (max-width: 720px) {
  .custom-select-page-size .custom-select-toggle {
    min-height: 30px;
    padding: 6px 9px 6px 11px;
    font-size: 0.84rem;
  }

  .custom-select-page-size .custom-select-menu {
    min-width: 96px;
  }

  .custom-select-page-size .custom-select-option {
    padding: 6px 8px;
    font-size: 0.83rem;
  }

  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-x: clip;
  }

  body {
    min-width: 0;
  }

  .topbar {
    padding-inline: 14px;
  }

  .data-year,
  #themeToggle {
    display: none;
  }

  .page {
    width: min(100% - 22px, 1480px);
    padding-top: 30px;
  }

  .intro {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .intro-stat {
    min-width: 0;
    width: 100%;
  }

  .search-card,
  .results-section {
    padding: 17px;
  }

  .results-heading {
    position: relative;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .results-heading > div:first-child {
    width: 100%;
    min-width: 0;
  }

  .result-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .result-actions > .export-button {
    font-size: 0.84rem;
  }

  .category-selection-panel {
    order: 1;
    max-width: 100%;
    flex-direction: column;
    overflow: hidden;
  }

  .filter-grid .primary-button {
    order: 2;
  }

  .selected-category-summary,
  .selected-category-list {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .selected-category-tag {
    max-width: 100%;
    flex: 0 1 auto;
  }

  .category-match-control {
    width: 100%;
    max-width: 100%;
  }

  .category-match-control label {
    min-width: 0;
    flex: 1;
  }

  .category-match-control span {
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
  }

  .category-multiselect-menu {
    right: auto;
    left: 0;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .pagination-controls,
  .page-buttons {
    gap: 4px;
  }

  .page-jump {
    gap: 5px;
    font-size: 0.74rem;
  }

  .page-jump input {
    width: 70px;
    min-height: 28px;
    padding-block: 3px;
    font-size: 0.76rem;
  }

  .page-jump button {
    min-height: 28px;
    padding-block: 3px;
    padding-inline: 10px;
    font-size: 0.74rem;
  }

  .page-button,
  .page-ellipsis {
    min-width: 28px;
    height: 30px;
    padding-inline: 7px;
    border-radius: 8px;
    font-size: 0.74rem;
  }

  .page-direction {
    padding-inline: 9px;
  }
}

@media (max-width: 460px) {
  .brand strong {
    font-size: 0.94rem;
  }

  .logo-mark {
    width: 36px;
    height: 36px;
  }

  .results-heading {
    gap: 12px;
  }
}

#scroll-float-buttons {
  position: fixed;
  right: 15px;
  bottom: 20px;
  z-index: 9999;
  width: 44px;
  height: 44px;
  pointer-events: none;
}

.scroll-float-btn {
  position: absolute;
  inset: 0;
  display: flex;
  padding: 0;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  transform: translateY(12px) scale(0.88);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scroll-float-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.scroll-float-btn img {
  display: block;
  width: 40px;
  height: 40px;
}

.scroll-float-icon-bottom {
  transform: rotate(180deg);
}

@media (max-width: 640px) {
  #scroll-float-buttons {
    right: 10px;
    bottom: 18px;
    width: 40px;
    height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
