:root {
  color-scheme: light dark;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #050b19;
  color: #f9fafb;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(120% 140% at 50% 0%, #1f2937 0%, #050b19 100%);
  color: #e2e8f0;
}

body.login {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
}

body.dashboard {
  display: flex;
  background: radial-gradient(140% 140% at 12% -8%, #0a1427 0%, #020617 70%, #010409 100%);
}

.hidden {
  display: none !important;
}

.login-panel {
  width: min(440px, 100%);
  padding: 48px;
  border-radius: 28px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  background: rgba(4, 10, 24, 0.85);
  backdrop-filter: blur(18px);
  box-shadow: 0 40px 80px rgba(15, 23, 42, 0.45);
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.85), rgba(99, 102, 241, 0.85));
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 20px;
  color: rgba(10, 21, 40, 0.95);
}

.login-brand h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.login-brand p {
  margin: 6px 0 0;
  color: rgba(148, 163, 184, 0.82);
  font-size: 14px;
}

.login-loader {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(148, 163, 184, 0.78);
  font-size: 13px;
}

.login-loader.hidden {
  display: none;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  color: rgba(203, 213, 225, 0.9);
}

.login-form input {
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 14px 16px;
  background: rgba(15, 23, 42, 0.75);
  color: #e2e8f0;
  font-size: 15px;
  transition: border 160ms ease, box-shadow 160ms ease;
}

.login-form input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.18);
}

.login-hint {
  font-size: 13px;
  color: rgba(148, 163, 184, 0.7);
}

.login-hint.hidden {
  display: none;
}

.login-footer {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(148, 163, 184, 0.6);
}

.dashboard .sidebar {
  width: 240px;
  display: flex;
  flex-direction: column;
  padding: 32px 24px;
  background: rgba(6, 13, 28, 0.92);
  border-right: 1px solid rgba(148, 163, 184, 0.1);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  font-size: 18px;
  font-weight: 600;
}

.brand-name {
  letter-spacing: 0.02em;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.sidebar-label {
  text-transform: uppercase;
  font-size: 11px;
  color: rgba(148, 163, 184, 0.6);
  letter-spacing: 0.12em;
  margin-bottom: 8px;
}

.client-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding-right: 4px;
}

.client-item {
  text-align: left;
  border: none;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.6);
  color: rgba(226, 232, 240, 0.78);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.client-item:hover {
  background: rgba(59, 130, 246, 0.16);
  color: rgba(248, 250, 252, 0.95);
}

.client-item.active {
  background: rgba(59, 130, 246, 0.26);
  color: rgba(248, 250, 252, 0.95);
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.35);
}

.client-label {
  font-weight: 600;
}

.client-sub {
  font-size: 12px;
  color: rgba(148, 163, 184, 0.75);
}

.client-placeholder {
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.55);
  color: rgba(148, 163, 184, 0.75);
  font-size: 13px;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.user-info {
  background: rgba(30, 41, 59, 0.6);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-name {
  font-weight: 600;
}

.user-role {
  font-size: 12px;
  color: rgba(148, 163, 184, 0.8);
}

.main {
  flex: 1;
  padding: 40px 48px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.main-header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
}

.main-header p {
  margin: 8px 0 0;
  color: rgba(148, 163, 184, 0.78);
  font-size: 14px;
}

.actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.actions.hidden {
  display: none;
}

.row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.row-actions .action-btn {
  border: none;
  background: rgba(59, 130, 246, 0.18);
  color: rgba(191, 219, 254, 0.95);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: background 140ms ease, transform 140ms ease;
}

.row-actions .action-btn:hover {
  background: rgba(59, 130, 246, 0.28);
  transform: translateY(-1px);
}

.row-actions .action-btn.danger {
  background: rgba(248, 113, 113, 0.22);
  color: rgba(254, 215, 215, 0.95);
}

.row-actions .action-btn.danger:hover {
  background: rgba(248, 113, 113, 0.32);
}

.muted,
.row-actions .muted {
  color: rgba(148, 163, 184, 0.6);
}

.upload-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 14px;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.72);
  color: rgba(226, 232, 240, 0.92);
  padding: 14px 18px;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.upload-trigger.dragover,
.upload-trigger:hover {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(30, 41, 59, 0.92);
  transform: translateY(-1px);
}

.upload-trigger.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.upload-trigger input {
  display: none;
}

.btn-secondary {
  background: rgba(148, 163, 184, 0.15);
  color: #e2e8f0;
}

.btn-secondary:hover {
  background: rgba(148, 163, 184, 0.25);
}

.btn-secondary.wide {
  width: 100%;
  justify-content: center;
}

.btn-outline {
  border: 1px solid rgba(94, 234, 212, 0.4);
  background: rgba(20, 33, 55, 0.7);
  color: rgba(190, 242, 242, 0.92);
}

.btn-outline:hover {
  border-color: rgba(45, 212, 191, 0.6);
  background: rgba(15, 23, 42, 0.9);
}

.btn-outline.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  color: #f8fafc;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(79, 70, 229, 0.35);
}

.btn-primary.loading {
  pointer-events: none;
  opacity: 0.72;
  position: relative;
}

.btn-primary.loading::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: rgba(255, 255, 255, 0.85);
  animation: spin 720ms linear infinite;
}

.card {
  background: rgba(10, 20, 36, 0.88);
  border-radius: 24px;
  border: 1px solid rgba(51, 65, 85, 0.45);
  box-shadow: 0 28px 60px rgba(2, 6, 23, 0.48);
  backdrop-filter: blur(14px);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 1px solid rgba(30, 41, 59, 0.78);
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: rgba(148, 163, 184, 0.75);
}

.filter-group select {
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.72);
  color: rgba(226, 232, 240, 0.92);
  padding: 8px 12px;
  font-size: 13px;
}

.card-title-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.card-subtitle {
  font-size: 13px;
  color: rgba(148, 163, 184, 0.65);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.2);
  color: rgba(224, 242, 254, 0.95);
  font-size: 12px;
  font-weight: 600;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
}

.table-wrapper table th:nth-child(2),
.table-wrapper table th:nth-child(3),
.table-wrapper table td:nth-child(2),
.table-wrapper table td:nth-child(3) {
  text-align: center;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(30, 41, 59, 0.75);
}

th {
  position: sticky;
  top: 0;
  background: rgba(15, 23, 42, 0.95);
  font-weight: 600;
}

tr:hover td {
  background: rgba(56, 189, 248, 0.06);
}

.table-wrapper td[data-label="钱包地址"],
.table-wrapper table td:nth-child(4) {
  font-family: "JetBrains Mono", SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  word-break: break-all;
}

.empty-row {
  text-align: center;
  padding: 28px 16px;
  color: rgba(148, 163, 184, 0.75);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.status-badge.success {
  background: rgba(34, 197, 94, 0.18);
  color: rgba(187, 247, 208, 0.92);
}

.status-badge.warning {
  background: rgba(250, 204, 21, 0.2);
  color: rgba(254, 240, 138, 0.88);
}

.status-badge.info {
  background: rgba(59, 130, 246, 0.18);
  color: rgba(191, 219, 254, 0.88);
}

.status-badge.danger {
  background: rgba(248, 113, 113, 0.24);
  color: rgba(254, 202, 202, 0.92);
}

.status-select {
  width: 160px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.72);
  color: rgba(226, 232, 240, 0.92);
  padding: 8px 12px;
  font-size: 13px;
}

.status-select:disabled {
  opacity: 0.6;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  padding: 18px 24px;
  border-radius: 16px;
  background: rgba(15, 118, 110, 0.95);
  color: #ecfeff;
  font-size: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.toast.active {
  opacity: 1;
  pointer-events: auto;
}

dialog {
  border: none;
  border-radius: 20px;
  max-width: min(720px, 92vw);
  width: 100%;
  padding: 0;
  background: rgba(17, 24, 39, 0.92);
  color: #f1f5f9;
  box-shadow: 0 32px 80px rgba(15, 23, 42, 0.6);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.66);
  backdrop-filter: blur(6px);
}

.dialog-header {
  padding: 28px 32px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.dialog-header h2 {
  margin: 0;
  font-size: 22px;
}

.dialog-header p {
  margin: 8px 0 0;
  font-size: 14px;
  color: rgba(148, 163, 184, 0.9);
}

.dialog-body {
  max-height: 420px;
  overflow-y: auto;
  padding: 0 32px 16px;
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  padding: 20px 32px 28px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

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

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: rgba(203, 213, 225, 0.9);
}

.form-grid input {
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.7);
  color: rgba(226, 232, 240, 0.92);
  font-size: 14px;
}

.form-grid input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.5);
}

.form-grid .full-width {
  grid-column: span 2;
}

.backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(6px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
}

.backdrop.active {
  pointer-events: auto;
  opacity: 1;
}

.loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border-radius: 16px;
  background: rgba(30, 41, 59, 0.92);
  color: rgba(226, 232, 240, 0.92);
  font-weight: 600;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.5);
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 3px solid rgba(125, 211, 252, 0.2);
  border-top-color: rgba(125, 211, 252, 0.9);
  animation: spin 720ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 960px) {
  .main {
    padding: 28px 24px;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  body.dashboard {
    flex-direction: column;
  }

  .dashboard .sidebar {
    width: auto;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 24px;
  }

  .sidebar-nav,
  .sidebar-footer {
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  .client-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    max-height: none;
  }

  .client-item,
  .client-placeholder {
    flex: 1 1 140px;
  }

  .card-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
  }

  .filter-group {
    width: 100%;
    justify-content: space-between;
  }

  .main-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .full-width {
    grid-column: span 1;
  }
}

.btn-secondary.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.btn-secondary.loading::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border-radius: 999px;
  border: 2px solid rgba(226, 232, 240, 0.35);
  border-top-color: rgba(226, 232, 240, 0.85);
  animation: spin 720ms linear infinite;
}

