:root {
  color-scheme: light;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #20262e;
  background: #f3f5f7;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background: #f3f5f7;
}

button, input, select { font: inherit; }

.topbar {
  background: #fff;
  border-bottom: 1px solid #dce1e6;
}

.topbar-inner {
  max-width: 1500px;
  min-height: 88px;
  margin: 0 auto;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

h1, h2, p { margin: 0; }

h1 {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: 0;
}

.topbar p, .results-head p {
  margin-top: 5px;
  color: #68717c;
  font-size: 13px;
}

.source-tag {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid #cfd7df;
  border-radius: 4px;
  color: #53606e;
  font-size: 12px;
  background: #fff;
  cursor: pointer;
}

.source-tag:hover { background: #f3f5f7; }

main {
  max-width: 1500px;
  margin: 0 auto;
  padding: 20px 28px 40px;
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1.6fr) repeat(4, minmax(150px, 0.8fr)) auto;
  align-items: end;
  gap: 14px;
  padding: 18px;
  background: #fff;
  border: 1px solid #dce1e6;
  border-radius: 6px;
}

.field { min-width: 0; }

.field label {
  display: block;
  margin-bottom: 7px;
  color: #4d5864;
  font-size: 13px;
  font-weight: 600;
}

input, select {
  width: 100%;
  height: 38px;
  border: 1px solid #c8d0d8;
  border-radius: 4px;
  padding: 0 11px;
  background: #fff;
  color: #20262e;
  outline: none;
}

input:focus, select:focus {
  border-color: #1769aa;
  box-shadow: 0 0 0 2px rgba(23, 105, 170, 0.13);
}

select:disabled { background: #f1f3f5; color: #9aa2aa; }

.actions { display: flex; gap: 8px; }

.button {
  height: 38px;
  min-width: 74px;
  border-radius: 4px;
  padding: 0 15px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
}

.button:disabled { cursor: not-allowed; opacity: 0.45; }
.button.primary { background: #1769aa; color: #fff; }
.button.primary:hover:not(:disabled) { background: #12598f; }
.button.secondary { background: #fff; border-color: #c8d0d8; color: #475360; }
.button.secondary:hover:not(:disabled) { background: #f3f5f7; }

.results {
  margin-top: 18px;
  background: #fff;
  border: 1px solid #dce1e6;
  border-radius: 6px;
  overflow: hidden;
}

.results-head {
  min-height: 70px;
  padding: 15px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid #e2e6ea;
}

.results-head h2 { font-size: 17px; font-weight: 650; }

.page-size {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  color: #596572;
  font-size: 13px;
}

.page-size select { width: 88px; height: 34px; }

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

table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  table-layout: fixed;
}

th, td {
  padding: 11px 12px;
  border-bottom: 1px solid #e7eaed;
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

th {
  background: #f5f6f8;
  color: #4c5661;
  font-weight: 650;
  white-space: nowrap;
}

th:nth-child(1) { width: 240px; }
th:nth-child(2) { width: 190px; }
th:nth-child(3) { width: 90px; }
th:nth-child(4) { width: 130px; }
th:nth-child(5) { width: 150px; }
th:nth-child(6) { width: 90px; }
th:nth-child(7) { width: 300px; }

tbody tr[data-row] { cursor: pointer; }
tbody tr[data-row]:hover { background: #eef6fb; }

.truncate {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.name-cell { color: #145f99; font-weight: 600; }

.status {
  display: inline-block;
  min-width: 42px;
  padding: 2px 6px;
  border-radius: 3px;
  text-align: center;
  background: #eaf5ed;
  color: #24713c;
}

.status.invalid { background: #f4eeee; color: #915151; }

.empty {
  height: 180px;
  text-align: center;
  color: #8a939d;
}

.pagination {
  min-height: 62px;
  padding: 12px 18px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
}

#pageLabel { min-width: 64px; text-align: center; color: #596572; font-size: 13px; }

dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  border: 0;
  border-radius: 6px;
  padding: 0;
  box-shadow: 0 20px 60px rgba(23, 33, 43, 0.25);
}

dialog::backdrop { background: rgba(25, 31, 38, 0.45); }

.access-dialog {
  width: min(420px, calc(100vw - 32px));
  overflow: visible;
}

.access-dialog form {
  padding: 30px 30px 24px;
  text-align: center;
}

.access-mark {
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8f2f9;
  color: #1769aa;
  font-size: 18px;
  font-weight: 700;
}

.access-dialog h2 { font-size: 20px; }

.access-dialog form > p {
  margin-top: 7px;
  color: #68717c;
  font-size: 13px;
}

.access-dialog label {
  display: block;
  margin: 22px 0 7px;
  text-align: left;
  color: #4d5864;
  font-size: 13px;
  font-weight: 600;
}

.access-dialog .button {
  width: 100%;
  margin-top: 12px;
}

.access-dialog .access-error {
  min-height: 20px;
  margin-top: 6px;
  color: #a63d3d;
  text-align: left;
}

.access-dialog .access-contact {
  margin-top: 16px;
  color: #596572;
}

.settings-dialog { width: min(500px, calc(100vw - 32px)); }

.settings-content { padding: 20px 22px 24px; }

.settings-content p {
  color: #596572;
  font-size: 13px;
  line-height: 1.65;
}

.button.danger {
  margin-top: 18px;
  border-color: #d7b4b4;
  background: #fff;
  color: #9b3f3f;
}

.button.danger:hover { background: #fbf2f2; }

.dialog-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px 16px;
  background: #fff;
  border-bottom: 1px solid #e2e6ea;
}

.dialog-head h2 { margin-top: 4px; font-size: 19px; line-height: 1.45; }
.dialog-eyebrow { color: #1769aa; font-size: 12px; font-weight: 650; }

.close-button {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 0;
  border-radius: 4px;
  background: #f0f2f4;
  color: #596572;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

dl {
  margin: 0;
  padding: 18px 22px 24px;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 0;
}

dt, dd {
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid #edf0f2;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

dt { color: #6a7480; }
dd { color: #242b33; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: 4px;
  background: #26323d;
  color: #fff;
  font-size: 13px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

@media (max-width: 1100px) {
  .search-panel { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
  .field-keyword { grid-column: span 2; }
  .actions { justify-content: flex-end; }
}

@media (max-width: 680px) {
  .topbar-inner { min-height: 76px; padding: 14px 16px; }
  h1 { font-size: 18px; }
  main { padding: 14px 12px 28px; }
  .search-panel { grid-template-columns: 1fr 1fr; padding: 14px; gap: 12px; }
  .field-keyword, .actions { grid-column: 1 / -1; }
  .actions .button { flex: 1; }
  .results { margin-top: 14px; }
  .results-head { align-items: flex-start; padding: 14px; }
  .pagination { justify-content: center; }
  dl { grid-template-columns: 104px minmax(0, 1fr); padding: 12px 16px 20px; }
  .dialog-head { padding: 16px; }
}
