
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f4f6f8;
  color: #1f2937;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Microsoft YaHei",
    sans-serif;
}

.container {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 30px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 25px;
}

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

.header p {
  margin-top: 8px;
  color: #6b7280;
}

.header-actions {
  display: flex;
  gap: 10px;
}

.card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background: #f8fafc;
  color: #6b7280;
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid #edf0f2;
}

td {
  font-size: 14px;
}

tr:hover td {
  background: #fafafa;
}

.address {
  font-family: monospace;
  white-space: nowrap;
}

.txid {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: monospace;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 9px 14px;

  border: none;
  border-radius: 7px;

  background: #e5e7eb;
  color: #374151;

  text-decoration: none;

  cursor: pointer;

  font-size: 14px;
}

.btn:hover {
  opacity: 0.85;
}

.btn-primary {
  background: #2563eb;
  color: white;
}

.btn-light {
  background: white;
  border: 1px solid #d1d5db;
}

.btn-small {
  padding: 6px 10px;
  font-size: 13px;
}

.actions {
  display: flex;
  gap: 7px;
  white-space: nowrap;
  flex-wrap: wrap;
}

.actions form {
  margin: 0;
}

.badge {
  display: inline-block;

  padding: 4px 9px;

  border-radius: 20px;

  font-size: 12px;
}

.badge.success {
  background: #dcfce7;
  color: #15803d;
}

.badge.disabled {
  background: #fee2e2;
  color: #dc2626;
}

.badge.pending {
  background: #fef3c7;
  color: #b45309;
}

.badge.failed {
  background: #fee2e2;
  color: #dc2626;
}

.badge.processing {
  background: #dbeafe;
  color: #2563eb;
}

.empty {
  padding: 50px;
  text-align: center;
  color: #9ca3af;
}

.modal {
  display: none;

  position: fixed;

  left: 0;
  top: 0;

  width: 100%;
  height: 100%;

  background: rgba(0, 0, 0, 0.45);

  align-items: center;
  justify-content: center;

  z-index: 1000;
}

.modal.show {
  display: flex;
}

.modal-content {
  width: 100%;
  max-width: 460px;

  background: white;

  border-radius: 12px;

  padding: 24px;
}

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

  margin-bottom: 20px;
}

.modal-header h2 {
  margin: 0;
}

.close {
  border: none;
  background: transparent;

  font-size: 28px;

  cursor: pointer;
}

label {
  display: block;

  margin-bottom: 8px;
  margin-top: 18px;

  font-size: 14px;
}

input {
  width: 100%;

  padding: 11px 12px;

  border: 1px solid #d1d5db;

  border-radius: 7px;

  outline: none;

  font-size: 15px;
}

select {
  width: 100%;

  padding: 11px 12px;

  border: 1px solid #d1d5db;

  border-radius: 7px;

  outline: none;

  background: #fff;

  color: #1f2937;

  font-size: 15px;
}

input:focus {
  border-color: #2563eb;
}

select:focus {
  border-color: #2563eb;
}

.modal-actions {
  display: flex;

  justify-content: flex-end;

  gap: 10px;

  margin-top: 25px;
}

.stats {
  display: grid;

  grid-template-columns: repeat(4, 1fr);

  gap: 18px;

  margin-bottom: 25px;
}

.stat-card {
  background: white;

  padding: 22px;

  border-radius: 12px;

  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.stat-label {
  color: #6b7280;

  font-size: 14px;
}

.stat-value {
  margin-top: 10px;

  font-size: 28px;

  font-weight: bold;
}

.stat-value small {
  font-size: 14px;

  font-weight: normal;

  color: #6b7280;
}

.card-title {
  display: flex;

  justify-content: space-between;

  padding: 20px;

  font-size: 17px;

  font-weight: bold;

  border-bottom: 1px solid #edf0f2;
}

.card-title span {
  font-size: 13px;

  color: #9ca3af;

  font-weight: normal;
}

.back {
  display: inline-block;

  margin-bottom: 15px;

  color: #2563eb;

  text-decoration: none;
}

.address-big {
  font-family: monospace;

  font-size: 15px !important;
}

.login-body {
  min-height: 100vh;

  display: flex;

  align-items: center;
  justify-content: center;

  background: linear-gradient(
    135deg,
    #eff6ff,
    #f8fafc
  );
}

.login-box {
  width: 100%;

  max-width: 400px;

  padding: 35px;

  background: white;

  border-radius: 16px;

  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.login-box h1 {
  text-align: center;

  margin-bottom: 5px;
}

.subtitle {
  text-align: center;

  color: #9ca3af;

  margin-bottom: 30px;
}

.login-box button {
  width: 100%;

  margin-top: 20px;

  background: #2563eb;

  color: white;
}

.error-box {
  padding: 10px;

  background: #fee2e2;

  color: #dc2626;

  border-radius: 7px;

  margin-bottom: 15px;
}


/* =========================
   用户余额
========================= */

.balance {
  font-size: 16px;
}


/* =========================
   地址列表
========================= */

.address-list {
  min-width: 330px;
  max-width: 500px;
}

.address-item {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 15px;

  padding: 6px 0;

  border-bottom: 1px solid #f1f3f5;
}

.address-item:last-child {
  border-bottom: none;
}

.address-item .address {
  overflow: hidden;
  text-overflow: ellipsis;
}

.address-item .price {
  flex-shrink: 0;

  color: #2563eb;

  font-size: 13px;

  font-weight: 600;
}

.text-muted {
  color: #9ca3af;
}


/* =========================
   用户信息
========================= */

.user-info-box {
  margin-bottom: 18px;

  padding: 13px;

  background: #f7f8fa;

  border-radius: 8px;
}

.user-info-label {
  margin-bottom: 5px;

  color: #888;

  font-size: 13px;
}

.user-info-name {
  font-size: 16px;

  font-weight: 600;
}


/* =========================
   当前余额
========================= */

.current-balance {
  margin-top: 6px;

  margin-bottom: 18px;

  font-size: 28px;

  font-weight: bold;

  color: #111827;
}


/* =========================
   结算统计
========================= */

.settlement-stats {
  margin-bottom: 18px;
}

.settlement-filter {
  margin-bottom: 18px;
  padding: 20px;
}

.usdt-income-stats {
  grid-template-columns: repeat(4, 1fr);
}

.monthly-profit-stats {
  grid-template-columns: repeat(4, 1fr);
}

.profit-range {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.profit-range div {
  padding: 18px 22px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.profit-range span,
.profit-grid span {
  display: block;
  color: #6b7280;
  font-size: 14px;
}

.profit-range strong {
  display: block;
  margin-top: 8px;
  color: #111827;
  font-size: 18px;
}

.profit-sections {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.profit-section {
  overflow: hidden;
}

.profit-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 20px;
}

.profit-grid strong {
  display: block;
  margin-top: 6px;
  color: #111827;
  font-size: 22px;
}

.sortable {
  cursor: pointer;
  user-select: none;
}

.sortable::after {
  content: "↕";
  margin-left: 6px;
  color: #9ca3af;
  font-size: 12px;
}

.sortable.active[data-direction="desc"]::after {
  content: "↓";
  color: #2563eb;
}

.sortable.active[data-direction="asc"]::after {
  content: "↑";
  color: #2563eb;
}

.address-copy {
  padding: 0;
  border: none;
  background: transparent;
  color: #2563eb;
  cursor: pointer;
  font-size: 14px;
  text-align: left;
}

.address-copy.copied {
  color: #15803d;
}

.form-grid {
  display: grid;
  grid-template-columns: 160px minmax(260px, 1fr) 220px 220px;
  gap: 16px;
  align-items: end;
}

.form-grid label {
  margin-top: 0;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.form-message {
  min-height: 20px;
  margin-top: 12px;
  color: #6b7280;
  font-size: 14px;
}

.form-message.error {
  color: #dc2626;
}


@media (max-width: 900px) {

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .profit-range,
  .profit-sections {
    grid-template-columns: 1fr;
  }

}


@media (max-width: 600px) {

  .container {
    padding: 15px;
  }

  .header {
    align-items: flex-start;
    flex-direction: column;
    gap: 15px;
  }

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

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

  .form-actions {
    justify-content: stretch;
  }

  .form-actions .btn {
    width: 100%;
  }

}
/* =========================
   删除按钮
========================= */

.btn-danger {
  background: #dc2626;
  color: #fff;
  border: 1px solid #dc2626;
}

.btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}
