:root {
  color: #102033;
  background: #f5f9ff;
  font-family: "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f5f9ff;
}

.page {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 14px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

h1 {
  margin: 0 0 6px;
  color: #0b5cad;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0;
}

.title-pinyin {
  display: inline-block;
  margin-left: 96px;
  color: #00838f;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

p {
  margin: 0;
  color: #5d6d80;
  font-size: 13px;
  line-height: 1.5;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

input,
button {
  height: 38px;
  border: 1px solid #bfd3ea;
  border-radius: 6px;
  background: #fff;
  color: #102033;
  font-size: 14px;
}

input {
  min-width: 240px;
  padding: 0 10px;
}

button {
  cursor: pointer;
  padding: 0 12px;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.segments {
  display: inline-flex;
  gap: 4px;
  overflow: hidden;
  border: 1px solid #bfd3ea;
  border-radius: 6px;
  background: #fff;
}

.segments button {
  min-width: 72px;
  border: 0;
  border-radius: 0;
}

.segments button.active {
  background: #0b5cad;
  color: #fff;
  font-weight: 600;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid #d8e6f5;
  border-radius: 8px;
  background: #fff;
}

table {
  width: 100%;
  min-width: 1160px;
  border-collapse: collapse;
}

th,
td {
  padding: 2px 4px;
  border-bottom: 1px solid #e7eef8;
  text-align: left;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.15;
}

th {
  position: sticky;
  top: 0;
  background: #eaf4ff;
  color: #17456f;
  font-weight: 600;
}

tbody tr:hover {
  background: #f6fbff;
}

.mono {
  font-family: Consolas, "Courier New", monospace;
}

.main-row .contract-code {
  color: #c62828;
  font-weight: 700;
}

.cell-link {
  height: auto;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  cursor: pointer;
}

.cell-link:hover {
  color: #0b5cad;
  text-decoration: underline;
}

.fee-cell {
  max-width: 118px;
  white-space: normal;
  line-height: 1.25;
}

.fee-rule {
  color: #51657a;
  font-size: 11px;
  margin-top: 2px;
}

.product-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0 0 8px;
  padding: 7px 9px;
  border: 1px solid #d8e6f5;
  border-radius: 6px;
  background: #fff;
}

.product-line {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  align-items: start;
  gap: 5px;
  min-height: 40px;
  padding: 4px;
  border-radius: 6px;
}

.all-exchange-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  background: #f1f7ff;
}

.all-exchange-line .toolbar {
  flex: 0 1 auto;
  margin-bottom: 0;
}

.all-exchange-line .all-exchange-chip {
  margin-right: 12px;
}

.all-exchange-line .toolbar input {
  min-width: 220px;
}

.search-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.search-control input {
  min-width: 220px;
}

.search-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  min-width: 36px;
  padding: 0;
  border-color: #8fb9df;
  color: #0a4775;
  font-size: 13px;
  font-weight: 700;
}

.search-action:hover {
  border-color: #0b5cad;
  background: #0b5cad;
  color: #fff;
}

.virtual-keyboard {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  max-width: 380px;
}

.keyboard-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.keyboard-row-1 {
  margin-left: 16px;
}

.keyboard-row-2 {
  margin-left: 32px;
}

.keyboard-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0;
  border: 1px solid #8fb9df;
  border-radius: 4px;
  background: #ffffff;
  color: #0a4775;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.keyboard-key:hover {
  border-color: #0b5cad;
  background: #0b5cad;
  color: #fff;
}

.keyboard-delete {
  width: 40px;
  min-width: 40px;
}

.keyboard-clear {
  width: 40px;
  min-width: 40px;
}

.nav-hint {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 5px;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.search-hint {
  border: 1px solid #9cc8ee;
  background: #e8f5ff;
  color: #075985;
}

.product-line.exchange-row:nth-child(even) {
  background: #edf6ff;
}

.product-line.exchange-row:nth-child(odd) {
  background: #f7fbff;
}

.product-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.exchange-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  height: 38px;
  min-width: 70px;
  padding: 0 7px;
  border: 1px solid #8fb9df;
  border-radius: 5px;
  background: #ffffff;
  color: #0a4775;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.all-exchange-chip {
  min-width: 88px;
}

.exchange-chip:hover,
.exchange-chip.active {
  border-color: #0b5cad;
  background: #0b5cad;
  color: #fff;
}

.product-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  height: 38px;
  min-width: 0;
  padding: 0 7px;
  border: 1px solid #a8c8e6;
  border-radius: 4px;
  background: #ffffff;
  color: #133f63;
  font-size: 14px;
  line-height: 1;
}

.label-code {
  display: block;
  font-weight: 700;
}

.label-name {
  display: block;
  font-size: 12px;
  font-weight: 500;
}

.product-chip:hover,
.product-chip.active {
  border-color: #0b5cad;
  background: #0b5cad;
  color: #fff;
}

.emphasis-value {
  color: #c62828;
  font-weight: 600;
}

.emphasis-value .fee-rule {
  color: #b94848;
  font-weight: 500;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e8edf5;
  color: #4c5f73;
  font-size: 12px;
  line-height: 1;
}

.badge.main,
.badge.latest {
  background: #d9ecff;
  color: #0b5cad;
}

.badge.cache {
  background: #fff3cf;
  color: #8a6200;
}

.badge.partial_failed,
.badge.failed {
  background: #ffe2e2;
  color: #a52828;
}

.min-volume-warn {
  color: #c62828;
  font-weight: 700;
}

.page-footer {
  margin-top: 20px;
  padding: 16px 0;
  text-align: center;
}

.page-footer a {
  color: #9aa9b8;
  font-size: 12px;
  text-decoration: none;
}

.page-footer a:hover {
  color: #5d6d80;
}

.empty {
  height: 120px;
  color: #6a7c90;
  text-align: center;
}

@media (max-width: 640px) {
  .page {
    padding: 10px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  input,
  .search-control,
  .segments {
    width: 100%;
  }

  .search-control input {
    flex: 1;
    min-width: 0;
  }

  .virtual-keyboard {
    width: 100%;
    max-width: none;
  }

  .segments button {
    flex: 1;
  }
}
