:root {
  color-scheme: light;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #1d2939;
  background: #f3f6fa;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
}

.page {
  width: min(1440px, calc(100% - 40px));
  margin: 0 auto;
  padding: 38px 0 24px;
}

.page-header {
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #176b87;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 38px);
}

.subtitle {
  margin: 9px 0 0;
  color: #667085;
}

.search-panel,
.results-panel {
  border: 1px solid #e4e9f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 14px rgb(16 24 40 / 4%);
}

.search-panel {
  padding: 20px;
}

#search-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 14px;
}

#search-form > label,
.keyword-row .keyword-field {
  display: flex;
  flex-direction: column;
}

#search-form [hidden] {
  display: none !important;
}

.keyword-row {
  display: flex;
  flex: 1 1 420px;
  min-width: 0;
  gap: 10px;
  align-items: end;
}

.keyword-row .keyword-field {
  flex: 1 1 auto;
  min-width: 0;
}

.keyword-row #search-mode-filter {
  flex: 0 0 auto;
}

.source-field {
  flex: 0 0 auto;
  width: auto;
}

.source-field select {
  width: auto;
  max-width: 100%;
}

#search-form > label:not(.source-field) {
  flex: 0 1 auto;
  min-width: 110px;
}

.submit-row {
  flex: 0 0 100%;
  display: flex;
  justify-content: center;
  margin-top: 4px;
}

.submit-row button {
  width: 140px;
  max-width: 100%;
}

label span {
  display: block;
  margin-bottom: 7px;
  color: #475467;
  font-size: 13px;
  font-weight: 600;
}

input,
select,
button {
  min-height: 42px;
  border: 1px solid #d0d5dd;
  border-radius: 7px;
  background: #fff;
  color: inherit;
  font: inherit;
}

input,
select {
  width: 100%;
  padding: 0 11px;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgb(23 107 135 / 18%);
  border-color: #176b87;
}

button {
  padding: 0 20px;
  border-color: #176b87;
  background: #176b87;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}

button:hover:not(:disabled) {
  background: #12566d;
}

button:disabled {
  border-color: #d0d5dd;
  background: #eef1f5;
  color: #98a2b3;
  cursor: not-allowed;
}

.results-panel {
  margin-top: 20px;
  padding: 18px 20px 14px;
}

.results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.results-toolbar {
  min-height: 34px;
  margin-bottom: 14px;
}

#toggle-columns {
  min-height: 34px;
  margin-left: auto;
  padding: 0 12px;
  white-space: nowrap;
}

#toggle-columns[hidden] {
  display: none;
}

.column-hidden {
  display: none;
}

#result-summary {
  margin: 0;
  color: #475467;
  font-size: 14px;
}

.page-size {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #667085;
  font-size: 13px;
}

.page-size span {
  display: inline;
  margin: 0;
  font-weight: 400;
}

.page-size select {
  width: auto;
  min-height: 34px;
  padding: 0 7px;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.pagination button {
  min-width: 34px;
  min-height: 34px;
  padding: 0 10px;
  border-color: #d0d5dd;
  background: #fff;
  color: #344054;
  font-weight: 500;
}

.pagination button:hover:not(:disabled) {
  border-color: #176b87;
  background: #f0f7fa;
  color: #176b87;
}

.pagination button:disabled {
  background: #f8fafc;
  color: #c0c7d0;
}

.page-numbers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.pagination .page-number.is-current {
  border-color: #176b87;
  background: #176b87;
  color: #fff;
  cursor: default;
}

.page-ellipsis {
  min-width: 20px;
  color: #667085;
  font-size: 13px;
  text-align: center;
}

.table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  border: 1px solid #eaecf0;
  border-radius: 7px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

th,
td {
  max-width: 340px;
  padding: 10px 12px;
  border-bottom: 1px solid #eaecf0;
  border-right: 1px solid #f0f2f5;
  text-align: left;
  vertical-align: top;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.journal-name-column {
  min-width: 260px;
  width: 300px;
}

.index-column {
  width: 8ch;
  min-width: 8ch;
  white-space: nowrap;
}

.sequence-column {
  width: 6ch;
  min-width: 6ch;
  max-width: 6ch;
  white-space: nowrap;
}

td.journal-name-column {
  max-width: 420px;
}

td.journal-name-column a {
  color: #176b87;
  font-weight: 600;
  text-decoration: none;
}

td.journal-name-column a:hover {
  color: #0e4f68;
}

.value-tag {
  display: inline-block;
  margin: 2px;
  padding: 2px 8px;
  border: 1px solid #c7e4ea;
  border-radius: 999px;
  background: #eaf6f8;
  color: #155e75;
  font-size: 0.92em;
  font-weight: 700;
  line-height: 1.45;
  white-space: nowrap;
}

.boolean-check-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  color: #16803c;
  vertical-align: middle;
}

.detail-no {
  color: #98a2b3;
  font-weight: 600;
}

.detail-dash {
  color: #98a2b3;
  font-weight: 600;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #344054;
  font-weight: 700;
  white-space: nowrap;
}

tbody tr:hover {
  background: #f8fbfc;
}

.empty-state {
  padding: 32px;
  color: #667085;
  text-align: center;
}

.error-message {
  padding: 12px;
  border-radius: 7px;
  background: #fef3f2;
  color: #b42318;
}

footer {
  padding: 16px 2px 0;
  color: #667085;
  font-size: 12px;
}

.journal-detail-page {
  width: min(1120px, calc(100% - 40px));
}

.journal-detail-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.journal-detail-header h1 {
  max-width: 820px;
  overflow-wrap: anywhere;
}

.journal-detail-retrieval {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.journal-detail-header .eyebrow span {
  color: #98a2b3;
}

.detail-back-link {
  flex: 0 0 auto;
  margin-bottom: 4px;
  padding: 9px 14px;
  border: 1px solid #d0e3e8;
  border-radius: 8px;
  background: #fff;
  color: #176b87;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 140ms ease, border-color 140ms ease,
    color 140ms ease;
}

.detail-back-link:hover {
  border-color: #9dc8d2;
  background: #12566d;
  color: #fff;
}

.journal-detail-panel {
  overflow: hidden;
  border: 1px solid #e4e9f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgb(16 24 40 / 5%);
}

.journal-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 8px 22px;
}

.journal-detail-item {
  min-width: 0;
  padding: 14px 12px;
  border-bottom: 1px solid #eef1f4;
}

.journal-detail-item dt {
  margin-bottom: 5px;
  color: #667085;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.journal-detail-item dd {
  margin: 0;
  color: #263445;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: normal;
}

.journal-detail-item dd a {
  color: #176b87;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.journal-detail-item dd a:hover {
  color: #0e4f68;
  text-decoration-thickness: 2px;
}

.journal-category-list {
  display: grid;
  gap: 8px;
}

.journal-category-line {
  display: grid;
  grid-template-columns: minmax(3em, auto) 1fr;
  align-items: center;
  gap: 0 9px;
  min-height: 28px;
}

.journal-category-type {
  color: #667085;
  font-size: 12px;
  font-weight: 600;
}

.journal-category-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.journal-category-name {
  color: #263445;
}

.journal-partition-tag {
  border-color: #b8d9ef;
  background: #edf7fd;
  color: #175c85;
}

.journal-rank-tag {
  border-color: #d7dced;
  background: #f3f5fa;
  color: #475467;
  font-weight: 600;
}

.journal-top-tag {
  border-color: #f2b8b5;
  background: #fdecea;
  color: #b3261e;
  font-weight: 700;
}

.journal-detail-item-primary {
  grid-column: 1 / -1;
  padding-top: 18px;
}

.journal-detail-item-primary dt {
  color: #176b87;
}

.journal-detail-item-primary dd {
  color: #172b3a;
  font-size: 18px;
}

.journal-detail-item-homepage {
  grid-column: 1 / -1;
}

.journal-detail-item:last-child,
.journal-detail-item:nth-last-child(2):nth-child(odd) {
  border-bottom: 0;
}

@media (max-width: 1080px) {
  .keyword-row {
    flex: 1 1 100%;
  }
}

@media (max-width: 760px) {
  .page {
    width: min(100% - 24px, 1440px);
    padding-top: 24px;
  }

  .keyword-row {
    flex: 1 1 100%;
  }

  #search-form > label:not(.source-field) {
    flex: 1 1 calc(50% - 7px);
  }

  .search-panel,
  .results-panel {
    padding: 14px;
  }

  .journal-name-column {
    width: 180px;
    min-width: 180px;
  }

  td.journal-name-column {
    max-width: 180px;
  }

  .journal-detail-page {
    width: min(100% - 24px, 1120px);
  }

  .journal-detail-header {
    align-items: flex-start;
  }

  .detail-back-link {
    padding: 8px 10px;
    font-size: 13px;
  }

  .journal-detail-grid {
    grid-template-columns: 1fr 1fr;
    padding: 4px 10px;
  }

  .journal-detail-item {
    padding: 11px 8px;
  }

  th,
  td {
    padding: 8px;
  }
}

@media (max-width: 480px) {
  .journal-detail-header {
    display: block;
  }

  .detail-back-link {
    display: inline-block;
    margin-top: 12px;
  }

  .journal-detail-grid {
    grid-template-columns: 1fr;
  }

  .journal-detail-item,
  .journal-detail-item-primary,
  .journal-detail-item-homepage {
    grid-column: 1;
    border-bottom: 1px solid #eef1f4;
  }

  .journal-detail-item:last-child {
    border-bottom: 0;
  }
}
