:root {
  --mario-red: #d44246;
  --mario-blue: #049cd8;
  --mario-yellow: #fbd000;
  --mario-green: #3fa142;
  --dark-bg: #0a0b0e;
  --darker-bg: #070809;
  --text-color: #e0e0e0;
  --table-border: #1a1b1f;
  --font-base: "Space Grotesk", sans-serif;
}

body {
  background: var(--dark-bg);
  color: var(--text-color);
  font-family: var(--font-base);
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.header {
  text-align: center;
  margin-bottom: 20px;
  position: relative;
  padding-right: 70px;
}

.header-title > .title {
  position: relative;
  font-family: var(--font-base);
  color: var(--mario-green);
  font-size: 24px;
  text-shadow: 2px 2px var(--mario-blue);
  margin-right: 20px;
}

.header-actions {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 8px;
}

.header > .header-title {
  display: flex;
  align-items: center;
  justify-content: center;
}

.table {
  background: var(--darker-bg);
  color: var(--text-color);
  border-color: var(--table-border);
}

.table thead th {
  background: var(--mario-blue);
  color: white;
  font-family: var(--font-base);
  font-size: 9px;
  border: 1px solid var(--mario-yellow);
  padding: 8px 4px;
}

.table tbody td {
  border-color: var(--table-border);
  font-size: 12px;
  padding: 6px 4px;
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(251, 208, 0, 0.1);
}

.positive {
  color: #4db352 !important;
}

.negative {
  color: inherit;
}

@keyframes spin-coin {
  0% {
    transform: rotateY(0deg);
  }
  100% {
    transform: rotateY(360deg);
  }
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_processing,
.dataTables_wrapper .dataTables_paginate {
  color: var(--text-color) !important;
  font-size: 12px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  color: var(--text-color) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--mario-red) !important;
  border: 2px solid var(--mario-yellow) !important;
  color: white !important;
  font-family: var(--font-base);
  font-size: 10px;
  box-shadow: 2px 2px var(--mario-blue);
}

.dataTables_filter input {
  background: var(--darker-bg) !important;
  color: var(--text-color) !important;
  border: 1px solid rgba(255, 255, 255, 0.6) !important;
  padding: 5px 10px;
}

/* 添加搜索框focus状态的样式 */
.dataTables_filter input:focus {
  outline: 2px solid var(--mario-green) !important;
  border-color: var(--mario-yellow) !important;
  box-shadow: 0 0 0 2px rgba(63, 161, 66, 0.2) !important;
}

/* 添加全局搜索高亮样式 */
::selection {
  background: var(--mario-green);
  color: white;
}

::-moz-selection {
  background: var(--mario-green);
  color: white;
}

.table tbody tr:hover {
  background-color: rgba(251, 208, 0, 0.1);
}

/* 添加数字列居中的样式 */
.table td:nth-child(3),
.table td:nth-child(4),
.table td:nth-child(5),
.table td:nth-child(6),
.table td:nth-child(7) {
  text-align: center;
}

/* 表头居中 */
.table th {
  text-align: center;
}

.mario-pixel {
  position: fixed;
  left: 100px;
  top: 80%;
  transform: translateY(-50%);
  width: 160px;
  height: 160px;
  animation: mario-jump 1s infinite;
}

.detail-mode .mario-pixel {
  display: none;
}

.mario-pixel img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@keyframes mario-jump {
  0%,
  100% {
    transform: translateY(-50%) scale(1);
  }
  50% {
    transform: translateY(-80%) scale(1.1);
  }
}

.form-check-label {
  color: var(--text-color);
  font-size: 12px;
}

.form-check-input {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  margin-top: 0;
  appearance: none;
  -webkit-appearance: none;
  display: inline-block;
  vertical-align: middle;
  border-radius: 0;
  border: 2px solid var(--mario-green);
  background-color: var(--darker-bg);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 10px;
  box-shadow: none;
  outline: none;
}

.form-check-input:focus {
  box-shadow: 0 0 0 2px rgba(4, 156, 216, 0.35);
}

.form-check-input:checked {
  background-color: var(--mario-green) !important;
  border-color: var(--mario-green) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M1 5l3 3 7-7'/%3E%3C/svg%3E");
}

/* 修改标签页样式 */
.nav-tabs {
  border-bottom: 1px solid var(--mario-green);
  flex-wrap: nowrap;
  overflow-x: auto;
  white-space: nowrap;
  overflow: hidden;
}

.nav-tabs .nav-link {
  color: var(--text-color);
  background: var(--darker-bg);
  border: 1px solid transparent;
  margin-right: 5px;
  font-family: var(--font-base);
  font-size: 10px;
  padding: 8px 15px;
  white-space: nowrap;
  min-width: max-content;
}

.nav-tabs .nav-link:hover {
  border-color: var(--mario-yellow);
  color: var(--mario-yellow);
}

.nav-tabs .nav-link.active {
  background: var(--mario-green);
  color: white;
  border: 2px solid var(--mario-yellow);
  box-shadow: 2px 2px var(--mario-blue);
}

/* 添加滚动条样式（可选） */
.nav-tabs::-webkit-scrollbar {
  height: 4px;
}

.nav-tabs::-webkit-scrollbar-track {
  background: var(--darker-bg);
}

.nav-tabs::-webkit-scrollbar-thumb {
  background: var(--mario-green);
  border-radius: 2px;
}

.header-tabs {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-tabs-left {
  display: flex;
  align-items: center;
}

.exchange-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px; /* 可选：调整多选框之间的间距 */
}

.header-tabs-right .exchange-filters .form-check-label {
  font-size: 10px;
}

.header-tabs-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 12px;
}

.header-tabs-controls .form-check-label {
  font-size: 10px;
}

.table-responsive {
  overflow: hidden;
}

.telegram-link:hover svg {
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.btn-twitter {
  background: #0f0f0f;
  border: 2px solid #ffffff;
  color: #ffffff;
}

.btn-twitter:hover {
  background: #ffffff;
  color: #0f0f0f;
}

.spinner-border {
  display: block;
  margin: 0 auto; /* Centers the spinner horizontally */
  width: 2rem; /* Smaller size */
  height: 2rem; /* Smaller size */
  border-width: 0.2em; /* Adjust border thickness */
  color: #fff; /* White color */
}

.diff-detail {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  color: #0a0b0e;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.diff-value {
  display: inline-block;
  font-weight: 700;
  color: #0a0b0e;
}

.diff-value.price-diff-value {
  font-size: 11px;
}

.direction-hint {
  cursor: help;
  font-family: inherit;
}

#dataTable_wrapper .dataTables_filter {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

#dataTable_wrapper .dataTables_filter label {
  margin: 0;
}

#opportunityTable_wrapper .dataTables_filter {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

#opportunityTable_wrapper .dataTables_filter label {
  margin: 0;
}

.symbol-exact-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 11px;
  color: var(--text-color);
  white-space: nowrap;
  cursor: pointer;
}

.symbol-exact-toggle .form-check-input {
  margin: 0;
}

.new-version-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid rgba(251, 208, 0, 0.45);
  background: rgba(251, 208, 0, 0.12);
  color: var(--mario-yellow);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 1;
  animation: newBadgePulse 1.6s ease-in-out infinite;
}

@keyframes newBadgePulse {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-1px) scale(1.05);
  }
}

.whats-new-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 12px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(251, 208, 0, 0.25);
  background: rgba(251, 208, 0, 0.06);
}

.whats-new-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.whats-new-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--mario-yellow);
}

.whats-new-desc {
  font-size: 11px;
  color: #aeb4bd;
}

.whats-new-actions {
  display: inline-flex;
  gap: 8px;
}

.whats-new-actions .btn {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 6px;
}

.whats-new-actions .btn-primary {
  background: var(--mario-green);
  border-color: rgba(251, 208, 0, 0.5);
  color: #fff;
}

.whats-new-actions .btn-primary:hover {
  background: #4bb24f;
  border-color: rgba(251, 208, 0, 0.7);
}

.whats-new-actions .btn-secondary {
  background: #1a1c22;
  border-color: rgba(251, 208, 0, 0.35);
  color: var(--text-color);
}

.whats-new-actions .btn-secondary:hover {
  background: #22242b;
  color: #fff;
}

.opportunity-spotlight {
  border-radius: 8px;
  box-shadow: 0 0 0 0 rgba(251, 208, 0, 0.25);
  animation: opportunitySpotlight 1.2s ease-out 2;
}

@keyframes opportunitySpotlight {
  0% {
    box-shadow: 0 0 0 0 rgba(251, 208, 0, 0.25);
  }
  100% {
    box-shadow: 0 0 0 12px rgba(251, 208, 0, 0);
  }
}

.whats-new-callout + .opportunity-detail {
  margin-top: 0;
}

@media (max-width: 768px) {
  .whats-new-callout {
    flex-direction: column;
    align-items: flex-start;
  }

  .whats-new-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

.opportunity-controls {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.opportunity-controls .form-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.opportunity-controls .opportunity-lock {
  gap: 8px;
}

.opportunity-controls .form-select {
  min-width: 140px;
  padding: 2px 6px;
  font-size: 11px;
}

.opportunity-link {
  color: var(--mario-green);
  text-decoration: underline;
}

.opportunity-link:hover {
  color: #fff;
}

.opportunity-detail {
  margin-top: 12px;
  margin-bottom: 16px;
  padding: 16px;
  background: var(--darker-bg);
  border-radius: 6px;
  border: 1px solid var(--table-border);
}

.opportunity-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.opportunity-detail-title {
  font-family: var(--font-base);
  font-size: 18px;
  font-weight: 600;
  color: var(--mario-green);
  margin-bottom: 4px;
}

.opportunity-detail-title-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.opportunity-detail-direction {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(251, 208, 0, 0.35);
  color: var(--mario-yellow);
  background: rgba(251, 208, 0, 0.08);
}

.opportunity-detail-direction.direction-consistent {
  color: #4db352;
  border-color: rgba(77, 179, 82, 0.5);
  background: rgba(77, 179, 82, 0.12);
}

.opportunity-detail-direction.direction-inconsistent {
  color: #f08c8c;
  border-color: rgba(240, 140, 140, 0.5);
  background: rgba(240, 140, 140, 0.12);
}

.opportunity-detail-countdown {
  display: none;
  font-size: 11px;
  color: rgba(224, 224, 224, 0.7);
}

.opportunity-detail-updated {
  font-size: 11px;
  color: rgba(224, 224, 224, 0.7);
}

.direction-change-modal .modal-content {
  background: #101216;
  color: var(--text-color);
  border: 1px solid rgba(251, 208, 0, 0.2);
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
}

.direction-change-modal .modal-header,
.direction-change-modal .modal-footer {
  border-color: rgba(251, 208, 0, 0.2);
}

.direction-change-modal .modal-title {
  color: var(--mario-yellow);
  font-size: 13px;
  font-weight: 600;
}

.direction-change-modal .btn-close {
  filter: invert(1);
  opacity: 0.7;
}

.direction-change-modal .btn-close:hover {
  opacity: 1;
}

.direction-change-modal .btn-secondary {
  background: #1a1c22;
  border-color: rgba(251, 208, 0, 0.35);
  color: var(--text-color);
  font-size: 11px;
}

.direction-change-modal .btn-secondary:hover {
  background: #22242b;
  color: #fff;
}

.direction-change-head {
  margin-bottom: 10px;
}

.direction-change-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--mario-green);
}

.direction-change-subtitle {
  font-size: 11px;
  color: #a6adb6;
}

.direction-change-list {
  display: grid;
  gap: 8px;
}

.direction-change-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  align-items: baseline;
}

.direction-change-label {
  font-size: 11px;
  color: var(--mario-yellow);
  font-weight: 600;
}

.direction-change-value {
  font-size: 12px;
  color: var(--text-color);
}

.direction-change-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 10px;
  font-weight: 600;
}

.direction-change-ok {
  color: #4db352;
  border-color: rgba(77, 179, 82, 0.45);
  background: rgba(77, 179, 82, 0.12);
}

.direction-change-bad {
  color: #f08c8c;
  border-color: rgba(240, 140, 140, 0.45);
  background: rgba(240, 140, 140, 0.12);
}

.direction-change-neutral {
  color: #aeb4bd;
  border-color: rgba(174, 180, 189, 0.35);
  background: rgba(174, 180, 189, 0.08);
}

.direction-change-arrow {
  color: #aeb4bd;
  font-size: 11px;
  margin: 0 4px;
}

.opportunity-detail-subtitle {
  font-size: 13px;
  color: #a6adb6;
}

.opportunity-detail-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 12px;
}

.opportunity-detail-card {
  background: #14151a;
  border-radius: 6px;
  border: 1px solid var(--table-border);
  padding: 12px;
}

.opportunity-detail-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--mario-yellow);
  text-transform: none;
  letter-spacing: normal;
  font-family: var(--font-base);
  margin-bottom: 8px;
}

.detail-list {
  display: grid;
  gap: 8px;
}

.detail-row {
  display: grid;
  grid-template-columns: minmax(88px, 120px) 1fr;
  gap: 10px;
  align-items: start;
  font-size: 12px;
}

.detail-row-label {
  color: var(--mario-yellow);
  font-weight: 600;
  white-space: nowrap;
}

.detail-row-value {
  color: var(--text-color);
  font-weight: 500;
}

.detail-row-value .detail-line {
  display: block;
}

.detail-value-number {
  display: inline-block;
  padding: 0 1px;
  border-radius: 3px;
}

.detail-value-number-updated {
  background-color: rgba(251, 208, 0, 0.06);
  animation: detailNumberFade 0.6s ease;
}

@keyframes detailNumberFade {
  0% {
    background-color: rgba(251, 208, 0, 0.1);
  }
  100% {
    background-color: rgba(251, 208, 0, 0);
  }
}

.detail-actions {
  line-height: 1.45;
}

.detail-action-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-action-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.detail-action-main {
  font-weight: 600;
  min-width: 120px;
}

.detail-action-sub {
  color: #aeb4bd;
  font-size: 11px;
}

.opportunity-detail-section {
  margin-top: 12px;
}

.opportunity-detail-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--mario-yellow);
  text-transform: none;
  letter-spacing: normal;
  font-family: var(--font-base);
  margin-bottom: 8px;
}

.opportunity-detail-summary {
  margin-top: 14px;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid rgba(251, 208, 0, 0.25);
  background: rgba(251, 208, 0, 0.08);
  font-size: 12px;
  line-height: 1.5;
}

.opportunity-detail-summary-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--mario-yellow);
  margin-bottom: 6px;
}

.detail-summary-list {
  margin: 0;
  padding-left: 16px;
  color: #d5d7db;
}

.detail-summary-list li {
  margin-bottom: 4px;
}

.detail-table thead th {
  background: var(--mario-blue);
  border-color: var(--mario-yellow);
  font-size: 11px;
  padding: 6px;
}

.detail-table tbody td {
  padding: 6px;
}

.action-lines {
  display: inline-block;
  white-space: normal;
  line-height: 1.25;
}

.orderbook-detail-list {
  display: grid;
  gap: 12px;
}

.orderbook-detail-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 11px;
}

.orderbook-detail-control {
  display: flex;
  align-items: center;
  gap: 6px;
}

.orderbook-detail-controls label {
  color: var(--mario-yellow);
  font-weight: 600;
}

.orderbook-detail-controls input {
  width: 140px;
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid var(--table-border);
  background: #0f1115;
  color: var(--text-color);
  font-size: 12px;
}

.orderbook-detail-controls select {
  width: 110px;
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid var(--table-border);
  background: #0f1115;
  color: var(--text-color);
  font-size: 12px;
}

.orderbook-detail-hint {
  color: #aeb4bd;
}

.orderbook-detail-card {
  background: #14151a;
  border: 1px solid var(--table-border);
  border-radius: 6px;
  padding: 12px;
}

.orderbook-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.orderbook-detail-exchange {
  font-weight: 600;
  color: var(--mario-green);
}

.orderbook-detail-action {
  font-size: 11px;
  color: #aeb4bd;
  margin-top: 2px;
}

.orderbook-detail-sim {
  font-size: 11px;
  color: #c9cbd0;
  margin-top: 6px;
}

.consistency-flow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.consistency-arrow {
  color: #aeb4bd;
  font-size: 11px;
}

.consistency-note {
  color: #aeb4bd;
  font-size: 10px;
}

.consistency-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  border: 1px solid transparent;
}

.consistency-icon {
  font-size: 11px;
  line-height: 1;
}

.consistency-ok {
  color: #4db352;
  border-color: rgba(77, 179, 82, 0.45);
  background: rgba(77, 179, 82, 0.12);
}

.consistency-bad {
  color: #f08c8c;
  border-color: rgba(240, 140, 140, 0.45);
  background: rgba(240, 140, 140, 0.12);
}

.consistency-warn {
  color: var(--mario-yellow);
  border-color: rgba(251, 208, 0, 0.4);
  background: rgba(251, 208, 0, 0.12);
}

.consistency-neutral {
  color: #aeb4bd;
  border-color: rgba(174, 180, 189, 0.35);
  background: rgba(174, 180, 189, 0.08);
}

.orderbook-detail-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #aeb4bd;
}

.orderbook-detail-status {
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
}

.orderbook-status-ok {
  color: var(--mario-green);
  border: 1px solid rgba(63, 161, 66, 0.4);
  background: rgba(63, 161, 66, 0.15);
}

.orderbook-status-warn {
  color: var(--mario-yellow);
  border: 1px solid rgba(251, 208, 0, 0.4);
  background: rgba(251, 208, 0, 0.12);
}

.orderbook-status-error {
  color: var(--mario-red);
  border: 1px solid rgba(212, 66, 70, 0.45);
  background: rgba(212, 66, 70, 0.12);
}

.orderbook-detail-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.orderbook-detail-side {
  border: 1px solid var(--table-border);
  border-radius: 6px;
  padding: 10px;
  background: #0f1115;
}

.orderbook-detail-side-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.orderbook-detail-side-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--mario-yellow);
}

.orderbook-detail-oi {
  font-size: 11px;
  color: #c9cbd0;
  font-weight: 600;
}

.orderbook-detail-side-meta {
  font-size: 10px;
  color: #aeb4bd;
  margin-bottom: 6px;
}

.orderbook-detail-funding {
  font-size: 10px;
  color: #aeb4bd;
  margin-bottom: 6px;
  line-height: 1.4;
}

.orderbook-detail-funding div {
  margin-bottom: 2px;
}

.orderbook-detail-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  padding: 3px 0;
}

.orderbook-detail-line span:first-child {
  color: #aeb4bd;
  font-weight: 600;
}

.orderbook-detail-avg {
  color: var(--mario-yellow);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.2px;
}

.fr-history-list {
  border: 1px solid var(--table-border);
  border-radius: 6px;
  padding: 4px 12px;
}

.fr-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fr-history-range {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #aeb4bd;
}

.fr-history-range select {
  background: #0f1115;
  border: 1px solid var(--table-border);
  border-radius: 4px;
  color: #e7e7e7;
  font-size: 11px;
  padding: 2px 6px;
}

.fr-history-row {
  display: grid;
  grid-template-columns: minmax(80px, 140px) 1fr;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--table-border);
}

.fr-history-row:last-child {
  border-bottom: none;
}

.fr-history-exchange {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fr-history-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--mario-yellow);
}

.fr-history-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: #aeb4bd;
}

.fr-history-toggle {
  background: transparent;
  border: 1px solid var(--table-border);
  border-radius: 4px;
  color: #e7e7e7;
  font-size: 11px;
  padding: 2px 8px;
  cursor: pointer;
}

.fr-history-toggle:hover {
  border-color: var(--mario-yellow);
  color: var(--mario-yellow);
}

.fr-history-points {
  display: grid;
  gap: 4px;
  font-size: 11px;
  color: #aeb4bd;
}

.fr-history-aggregate {
  display: grid;
  gap: 4px;
}

.fr-history-point {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.fr-history-group {
  display: grid;
  gap: 6px;
}

.fr-history-group-header {
  align-items: center;
}

.fr-history-time-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fr-history-subpoints {
  display: none;
  gap: 4px;
  padding-left: 12px;
}

.fr-history-subpoints.expanded {
  display: grid;
}

.fr-history-time {
  color: #aeb4bd;
}

.fr-history-rate {
  color: #e7e7e7;
  font-weight: 600;
}

.fr-history-error {
  color: #f08c8c;
  font-size: 11px;
}

.fr-history-placeholder {
  color: #aeb4bd;
  font-size: 12px;
}

.orderbook-detail-empty {
  padding: 12px;
  border-radius: 6px;
  border: 1px dashed var(--table-border);
  color: #aeb4bd;
}

@media (max-width: 768px) {
  .orderbook-detail-columns {
    grid-template-columns: 1fr;
  }

  .orderbook-detail-controls {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Orderbook */
.orderbook-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  padding: 16px;
  background: var(--darker-bg);
  border-radius: 6px;
  border: 1px solid var(--table-border);
  margin-bottom: 16px;
}

.orderbook-control {
  display: grid;
  gap: 8px;
}

.orderbook-control label {
  font-size: 10px;
  font-weight: 600;
  color: var(--mario-yellow);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-base);
}

.orderbook-control input {
  padding: 8px 10px;
  border: 1px solid var(--table-border);
  border-radius: 6px;
  font-size: 12px;
  background: var(--darker-bg);
  color: var(--text-color);
  font-family: inherit;
  text-transform: uppercase;
}

.orderbook-control input::placeholder {
  color: #8c9096;
}

.orderbook-control input:focus {
  outline: 2px solid rgba(63, 161, 66, 0.4);
  border-color: var(--mario-yellow);
  box-shadow: 0 0 0 2px rgba(63, 161, 66, 0.2);
}

.orderbook-actions {
  display: flex;
  align-items: flex-end;
}

#orderbookRefresh {
  background: var(--mario-blue);
  border: 2px solid var(--mario-yellow);
  color: white;
  font-family: var(--font-base);
  font-size: 10px;
  padding: 8px 14px;
  text-transform: uppercase;
  box-shadow: 2px 2px var(--mario-red);
  transition: all 0.2s ease;
}

#orderbookRefresh:hover {
  transform: translateY(-1px);
  box-shadow: 3px 3px var(--mario-red);
}

#orderbookRefresh:active {
  transform: translateY(1px);
  box-shadow: 1px 1px var(--mario-red);
}

.orderbook-meta {
  display: grid;
  align-content: end;
  gap: 6px;
}

.orderbook-meta-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--mario-yellow);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-base);
}

.orderbook-errors {
  border: 1px solid var(--mario-red);
  background: rgba(212, 66, 70, 0.15);
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 11px;
}

.orderbook-errors span {
  display: inline-block;
  margin-right: 12px;
}

#opportunityTable {
  table-layout: fixed;
}

#opportunityTable th,
#opportunityTable td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.cex-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--mario-yellow);
  font-family: var(--font-base);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  text-decoration: none;
}

.cex-link.cex-ok {
  background: var(--mario-green);
}

.cex-link.cex-alert {
  background: var(--mario-red);
}

/* CEX Monitor Styles */
.cex-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  padding: 16px;
  background: var(--darker-bg);
  border-radius: 6px;
  border: 1px solid var(--table-border);
  margin-bottom: 20px;
}

.cex-control {
  display: grid;
  gap: 8px;
}

.cex-control label {
  font-size: 10px;
  font-weight: 600;
  color: var(--mario-yellow);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-base);
}

.cex-control input,
.cex-control select {
  padding: 8px 10px;
  border: 1px solid var(--table-border);
  border-radius: 6px;
  font-size: 12px;
  background: var(--darker-bg);
  color: var(--text-color);
  font-family: inherit;
}

.cex-control input::placeholder {
  color: #8c9096;
}

.cex-control input:focus,
.cex-control select:focus {
  outline: 2px solid rgba(63, 161, 66, 0.4);
  border-color: var(--mario-yellow);
  box-shadow: 0 0 0 2px rgba(63, 161, 66, 0.2);
}

#cex-asset,
#cex-chain {
  text-transform: uppercase;
}

.cex-toggles {
  grid-template-columns: repeat(3, minmax(64px, 1fr));
  align-content: start;
  gap: 8px;
}

.cex-toggles label {
  grid-column: 1 / -1;
}

.cex-toggle {
  border: 1px solid var(--table-border);
  background: var(--darker-bg);
  color: var(--text-color);
  border-radius: 6px;
  padding: 7px 6px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.2s ease;
  font-family: var(--font-base);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  box-shadow: 2px 2px 0 var(--mario-blue);
}

.cex-toggle.active {
  color: #fff;
  border-color: var(--mario-yellow);
  box-shadow: 2px 2px 0 var(--mario-blue);
}

.cex-toggle.active[data-value='true'] {
  background: var(--mario-green);
}

.cex-toggle.active[data-value='false'] {
  background: var(--mario-red);
}

.cex-toggle.active[data-value='any'] {
  background: var(--mario-blue);
}

.cex-toggle:hover {
  border-color: var(--mario-yellow);
  transform: translateY(-1px);
}

.cex-actions {
  align-content: end;
}

#cex-refresh {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--mario-yellow);
  border-radius: 6px;
  background: var(--mario-green);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--mario-blue);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  font-family: var(--font-base);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#cex-refresh:hover {
  transform: translateY(-2px);
  box-shadow: 4px 4px 0 var(--mario-blue);
}

#cex-refresh:active {
  transform: translateY(1px);
  box-shadow: 2px 2px 0 var(--mario-blue);
}

.cex-status {
  display: grid;
  gap: 16px;
}

.cex-status-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  color: var(--text-color);
  font-size: 12px;
  padding: 0 4px;
}

.cex-meta-label {
  font-weight: 600;
  color: var(--mario-yellow);
  margin-right: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-base);
  font-size: 9px;
}

#cex-exchangeMeta {
  margin-left: auto;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(212, 66, 70, 0.15);
  border: 1px solid rgba(212, 66, 70, 0.5);
  color: #f2c8c9;
  font-weight: 600;
  font-size: 11px;
}

#cex-exchangeMeta:empty {
  display: none;
}

.cex-table {
  background: var(--darker-bg);
  border-radius: 6px;
  border: 1px solid var(--table-border);
  overflow: hidden;
}

.cex-table-head,
.cex-table-row {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 1fr 0.8fr 0.8fr;
  gap: 12px;
  padding: 12px 16px;
  align-items: center;
}

.cex-table-head {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  background: var(--mario-blue);
  border-bottom: 1px solid var(--mario-yellow);
  font-family: var(--font-base);
}

.cex-table-row {
  font-size: 12px;
  border-bottom: 1px solid var(--table-border);
  background: rgba(251, 208, 0, 0.08);
  animation: cexRowIn 0.35s ease forwards;
}

.cex-table-row:hover {
  background: rgba(251, 208, 0, 0.12);
}

.cex-table-row:last-child {
  border-bottom: none;
}

.cex-exchange-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.cex-exchange-icon {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid var(--table-border);
  background: var(--darker-bg);
  position: relative;
}

.cex-exchange-icon::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 1px;
  background: currentColor;
  opacity: 0.75;
}

.cex-exchange-icon-binance,
.cex-exchange-icon-kucoin {
  color: var(--mario-yellow);
  border-color: rgba(224, 193, 118, 0.45);
}

.cex-exchange-icon-okx,
.cex-exchange-icon-huobi {
  color: var(--mario-blue);
  border-color: rgba(59, 143, 177, 0.45);
}

.cex-exchange-icon-bybit,
.cex-exchange-icon-bitget {
  color: var(--mario-green);
  border-color: rgba(111, 166, 122, 0.45);
}

.cex-exchange-icon-gateio,
.cex-exchange-icon-kraken {
  color: var(--mario-red);
  border-color: rgba(198, 109, 112, 0.45);
}

.cex-table.asset-mode .cex-table-head,
.cex-table.asset-mode .cex-exchange-row {
  grid-template-columns: 1.4fr 0.8fr 0.8fr;
}

.cex-table.asset-mode .cex-table-body {
  display: grid;
  gap: 14px;
  padding: 16px 20px 20px;
}

.cex-table.asset-mode .cex-table-head span:nth-child(2),
.cex-table.asset-mode .cex-table-head span:nth-child(3) {
  text-align: center;
}

.cex-table.asset-mode .cex-exchange-row span:nth-child(2),
.cex-table.asset-mode .cex-exchange-row span:nth-child(3) {
  justify-self: center;
}

.cex-asset-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--mario-yellow);
  border-radius: 8px;
  background: rgba(4, 156, 216, 0.12);
}

.cex-asset-summary .cex-asset-label {
  font-family: var(--font-base);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mario-yellow);
}

.cex-asset-summary .cex-asset-name {
  font-family: var(--font-base);
  font-size: 14px;
  color: #fff;
  text-shadow: 2px 2px 0 var(--mario-blue);
}

.cex-asset-summary .cex-asset-meta {
  font-size: 13px;
  color: var(--text-color);
}

.cex-exchange-group {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--table-border);
  border-radius: 8px;
  background: var(--darker-bg);
}

.cex-exchange-title {
  display: flex;
  align-items: center;
}

.cex-exchange-title .cex-exchange-label {
  font-family: var(--font-base);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mario-yellow);
}

.cex-exchange-rows {
  display: grid;
  gap: 8px;
}

.cex-exchange-row {
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--table-border);
  border-radius: 6px;
  background: rgba(251, 208, 0, 0.08);
}

.cex-chain-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(4, 156, 216, 0.5);
  background: rgba(4, 156, 216, 0.18);
  color: #d9ecf3;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  max-width: 100%;
  word-break: break-word;
}

.cex-table-row span:nth-child(3) {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #f2f2f2;
}

.cex-table-head span:nth-child(4),
.cex-table-head span:nth-child(5),
.cex-table-row span:nth-child(4),
.cex-table-row span:nth-child(5) {
  text-align: center;
}

.cex-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 9px;
  font-family: var(--font-base);
  letter-spacing: 0.08em;
  border: 1px solid var(--mario-yellow);
  text-transform: uppercase;
}

.cex-badge.on {
  background: var(--mario-green);
  color: #fff;
}

.cex-badge.off {
  background: var(--mario-red);
  color: #fff;
}

.cex-empty {
  text-align: center;
  color: var(--text-color);
  padding: 24px;
  display: none;
  font-size: 14px;
  border: 1px dashed var(--table-border);
  border-radius: 6px;
  background: transparent;
}

@keyframes cexRowIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .cex-controls {
    grid-template-columns: 1fr;
  }

  .cex-status-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  #cex-exchangeMeta {
    margin-left: 0;
    width: 100%;
  }

  .cex-table-head,
  .cex-table-row {
    grid-template-columns: 1fr 1fr;
    row-gap: 6px;
  }

  .cex-table-head span:nth-child(3),
  .cex-table-head span:nth-child(4),
  .cex-table-head span:nth-child(5) {
    display: none;
  }

  .cex-table-row span:nth-child(3),
  .cex-table-row span:nth-child(4),
  .cex-table-row span:nth-child(5) {
    grid-column: 1 / -1;
  }

  .cex-table.asset-mode .cex-table-head {
    grid-template-columns: 1fr 0.8fr 0.8fr;
  }

  .cex-table.asset-mode .cex-table-head span:nth-child(3) {
    display: inline;
  }

  .cex-table.asset-mode .cex-table-body {
    padding: 12px 14px 16px;
  }

  .cex-table.asset-mode .cex-exchange-row {
    grid-template-columns: 1fr 1fr;
    row-gap: 6px;
  }

  .cex-table.asset-mode .cex-exchange-row span:nth-child(1) {
    grid-column: 1 / -1;
  }
}
