html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 7rem;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Navbar logo - 严格控制尺寸，避免头部失衡 */
.navbar-brand-logo {
  height: 26px !important;
  max-height: 26px !important;
  max-width: 70px !important;
  width: auto !important;
  object-fit: contain !important;
  flex-shrink: 0 !important;
}

.about-logo {
  max-width: 200px;
  height: auto;
}

.footer-logo {
  height: 24px;
  width: auto;
  opacity: 0.8;
}

mark.search-hit {
  padding: 0 0.05em;
  background-color: rgba(255, 220, 0, 0.45);
  color: inherit;
}

/* 学科列表 / 学科期刊列表：搜索框宽度为所在 card 宽度的约 1/3（容器查询） */
.category-list-card {
  container-type: inline-size;
  container-name: category-list;
}

.category-search-input {
  box-sizing: border-box;
  width: min(20rem, 100%);
  min-width: 10rem;
  min-height: calc(1.4285714286em + 1rem + 2px);
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
  font-size: 0.95rem;
}

.category-search-input::placeholder {
  font-size: 0.93rem;
}

.category-search-input + .btn,
.category-search-input + .btn + .btn {
  min-height: calc(1.4285714286em + 1rem + 2px);
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
  padding-left: 0.9rem;
  padding-right: 0.9rem;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@container category-list (min-width: 0px) {
  .category-search-input {
    width: 33.333333cqw;
    min-width: 10rem;
    max-width: 100%;
  }
}

/* 分类列表分页：紧凑页码 + 窄屏可换行 */
.category-pager-nav {
  max-width: 100%;
}

.category-pager {
  flex-wrap: wrap;
  justify-content: center;
  row-gap: 0.25rem;
}

.category-pager .page-item .page-link {
  min-width: 2.25rem;
  justify-content: center;
}

.category-pager .page-item:not(.disabled):not(.active) .page-link:hover {
  z-index: 1;
}

.category-pager-ellipsis .page-link {
  border: none;
  background: transparent;
  color: var(--tblr-secondary, var(--bs-secondary-color, #667382));
  pointer-events: none;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

/* 新锐分区配色：参考图从上到下依次为 1-4 区 */
.xr-tier-badge {
  font-weight: 600;
  border: 1px solid transparent;
}

.xr-tier-1 {
  color: #c95d44 !important;
  background-color: rgba(237, 104, 78, 0.16) !important;
  border-color: rgba(237, 104, 78, 0.28) !important;
}

.xr-tier-2 {
  color: #ad7b00 !important;
  background-color: rgba(254, 206, 1, 0.18) !important;
  border-color: rgba(254, 206, 1, 0.3) !important;
}

.xr-tier-top {
  color: #b46c1c !important;
  background-color: rgba(246, 155, 35, 0.17) !important;
  border-color: rgba(246, 155, 35, 0.3) !important;
}

.xr-tier-3 {
  color: #4f9a2d !important;
  background-color: rgba(108, 196, 76, 0.16) !important;
  border-color: rgba(108, 196, 76, 0.28) !important;
}

.xr-tier-4 {
  color: #326da8 !important;
  background-color: rgba(51, 116, 188, 0.16) !important;
  border-color: rgba(51, 116, 188, 0.28) !important;
}

.xr-tier-unknown {
  color: #667382 !important;
  background-color: rgba(102, 115, 130, 0.12) !important;
  border-color: rgba(102, 115, 130, 0.18) !important;
}

/* 期刊搜索 / Under Review 表头（与内联样式合并） */
.journal-card-table-thead th {
  font-size: 1rem;
  font-weight: 600;
  color: var(--tblr-heading-color, var(--bs-emphasis-color, #182433));
}

.journal-search-shell {
  z-index: 1060;
}

#searchForm .form-control,
#searchForm .form-select,
#searchForm .btn {
  min-height: calc(1.4285714286em + 1rem + 2px);
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
  font-size: 0.95rem;
}

.year-filter-select {
  min-height: calc(1.4285714286em + 1rem + 2px);
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
  font-weight: 500;
}

.journal-suggest-dropdown {
  top: 100%;
  left: 0;
  z-index: 1070;
  max-height: min(320px, 50vh);
  overflow-y: auto;
  overflow-x: hidden;
  display: none;
  background-color: var(--tblr-bg-surface, var(--bs-body-bg, #fff));
  border: 1px solid var(--tblr-border-color, rgba(4, 32, 69, 0.14));
  border-radius: var(--tblr-border-radius, 0.375rem);
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.12), 0 0.25rem 0.5rem rgba(0, 0, 0, 0.06);
}

.journal-suggest-dropdown .list-group-item {
  background-color: inherit;
  border-color: var(--tblr-border-color-translucent, rgba(4, 32, 69, 0.08));
}

.journal-suggest-dropdown .list-group-item:hover,
.journal-suggest-dropdown .list-group-item:focus {
  background-color: var(--tblr-bg-surface-secondary, rgba(4, 32, 69, 0.04));
}

.journal-suggest-dropdown .journal-suggest-title {
  font-weight: 600;
  line-height: 1.35;
}

.journal-suggest-dropdown .journal-suggest-meta {
  font-size: 0.8125rem;
  line-height: 1.35;
  margin-top: 0.2rem;
  color: var(--tblr-secondary, var(--bs-secondary-color, #667382));
}

.journal-tier-badge-wrap {
  overflow: visible;
}

.journal-tier-notification {
  top: -0.4rem;
  right: -0.4rem;
}

.journal-legend-dot {
  width: 0.35rem;
  height: 0.35rem;
}

/* 全站表格：统一放大表头与内容，提升信息密度观感 */
.table > :not(caption) > * > th {
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.45;
  padding-top: 0.72rem;
  padding-bottom: 0.72rem;
}

.table > :not(caption) > * > td {
  font-size: 1rem;
  line-height: 1.55;
  padding-top: 0.68rem;
  padding-bottom: 0.68rem;
}

.table td a {
  font-size: 1rem;
  font-weight: 500;
}

.table .badge {
  font-size: 0.9rem;
  font-weight: 600;
}

/* 期刊详情页：提升可读性（重点优化表格表头与正文字号） */
.journal-detail-page .journal-detail-section-title {
  font-size: clamp(1rem, 0.95rem + 0.28vw, 1.15rem);
  font-weight: 600;
}

.journal-detail-page .card-body dl dt {
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.6;
}

.journal-detail-page .card-body dl dd {
  font-size: 0.98rem;
  line-height: 1.6;
}

.journal-detail-page .journal-detail-db-link {
  font-size: 0.96rem;
  font-weight: 500;
  line-height: 1.5;
}

.journal-detail-page .journal-detail-db-meta {
  font-size: 0.9rem;
  line-height: 1.45;
}

.journal-detail-page .journal-detail-table > :not(caption) > * > th {
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding-top: 0.72rem;
  padding-bottom: 0.72rem;
  white-space: nowrap;
}

.journal-detail-page .journal-detail-table > :not(caption) > * > td {
  font-size: 1rem;
  line-height: 1.55;
  padding-top: 0.68rem;
  padding-bottom: 0.68rem;
}

.journal-detail-page .journal-detail-table td a {
  font-size: 1rem;
  font-weight: 500;
}

.journal-detail-page .journal-detail-table .badge {
  font-size: 0.9rem;
  font-weight: 600;
}

@media (max-width: 768px) {
  .table > :not(caption) > * > th {
    font-size: 0.9rem;
  }

  .table > :not(caption) > * > td {
    font-size: 0.95rem;
  }

  .table td a {
    font-size: 0.95rem;
  }

  .journal-detail-page .journal-detail-table > :not(caption) > * > th {
    font-size: 0.9rem;
    white-space: normal;
  }

  .journal-detail-page .journal-detail-table > :not(caption) > * > td {
    font-size: 0.95rem;
  }

  .journal-detail-page .journal-detail-table td a {
    font-size: 0.95rem;
  }
}

/* Cookie Consent Banner */
.cookie-consent-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1050;
  background-color: var(--tblr-bg-surface, #fff);
  border-top: 1px solid var(--tblr-border-color, rgba(4, 32, 69, 0.14));
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
}

.cookie-consent-text {
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--tblr-body-color, #182433);
}