.app {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: #111827;
  margin: 0;
}

body {
  margin: 0;
  background: #f3f4f6;
}

/* 全局 Loading 样式 */
.global-loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  transition: opacity 0.3s ease;
}

.global-loading.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  margin-top: 16px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}

.header {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: #111827;
  color: #fff;
}

.title {
  font-size: 16px;
  font-weight: 700;
}

.header-right {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.field {
  display: flex;
  gap: 8px;
  align-items: center;
}

.field label {
  font-size: 12px;
  opacity: 0.9;
}

.field input {
  width: 260px;
  padding: 8px 10px;
  border: 1px solid #374151;
  border-radius: 8px;
  background: #0b1220;
  color: #fff;
}

.wallet {
  display: flex;
  gap: 10px;
  align-items: center;
}

.muted {
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
}

.wallet-connected {
  color: #10b981;
  font-size: 13px;
  font-weight: 600;
}

.wallet-section {
  display: flex;
  gap: 12px;
  align-items: center;
}

.wallet-section .btn {
  background: #2563eb !important;
  border: 1px solid #1d4ed8 !important;
  color: #fff !important;
  font-size: 12px;
  padding: 8px 14px;
  cursor: pointer;
  border-radius: 8px;
  white-space: nowrap;
}

.wallet-section .btn:hover {
  background: #1d4ed8 !important;
}

.wallet-section .btn-connected {
  background: #10b981 !important;
  border: 1px solid #059669 !important;
}

.wallet-section .btn-connected:hover {
  background: #059669 !important;
}

.nav {
  display: flex;
  gap: 8px;
  padding: 10px 16px 0 16px;
}

.tab {
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-bottom: 0;
  background: #e5e7eb;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  cursor: pointer;
}

.tab.active {
  background: #ffffff;
}

.main {
  padding: 0 16px 16px 16px;
}

.panel {
  display: none;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 0 10px 10px 10px;
  padding: 12px;
}

.panel.active {
  display: block;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.panel-title {
  font-size: 14px;
  font-weight: 700;
}

.panel-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  min-width: 220px;
}

select.input {
  min-width: 180px;
}

.btn {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #fff;
  cursor: pointer;
}

.btn.primary {
  background: #2563eb;
  border-color: #1d4ed8;
  color: #fff;
}

.btn.danger {
  background: #dc2626;
  border-color: #b91c1c;
  color: #fff;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn.transfer-ready {
  background: #16a34a;
  border-color: #15803d;
  color: #fff;
}

.table-wrap {
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.table th,
.table td {
  padding: 10px 10px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
}

.table th {
  background: #f9fafb;
  text-align: left;
  font-weight: 700;
  white-space: nowrap;
}

.table td {
  white-space: nowrap;
}

.addr {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.pager {
  display: flex;
  justify-content: center;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

.modal.hidden {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 9999;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.modal-card {
  position: relative;
  width: min(860px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 12px 0 12px;
  gap: 10px;
}

.modal-title {
  font-weight: 700;
}

.modal-body {
  padding: 12px;
}

.kv {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px 12px;
  font-size: 12px;
}

.kv .k {
  color: #6b7280;
}

.kv .v {
  color: #111827;
  word-break: break-all;
}

.form-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 10px;
  font-size: 12px;
}

.form-row input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
}

