* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #0f1420;
  color: #e6e9f0;
  min-height: 100vh;
}

.hidden { display: none !important; }

#topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: #161c2c;
  border-bottom: 1px solid #232c42;
}
.logo { font-size: 18px; font-weight: 700; }
#user-box { display: flex; align-items: center; gap: 12px; font-size: 14px; }
#user-balance { color: #4ade80; font-weight: 600; }

.center-box { display: flex; justify-content: center; padding-top: 10vh; }

.card {
  background: #161c2c;
  border: 1px solid #232c42;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}
#auth-view .card { width: 360px; }

.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab {
  flex: 1; padding: 10px; border: none; border-radius: 8px;
  background: #1d2537; color: #9aa4bd; cursor: pointer;
}
.tab.active { background: #2563eb; color: #fff; }

input, select {
  width: 100%; padding: 10px 12px; margin: 6px 0;
  background: #0f1420; border: 1px solid #2a3550;
  border-radius: 8px; color: #e6e9f0; font-size: 14px;
}
input:focus, select:focus { outline: none; border-color: #2563eb; }

.btn {
  padding: 10px 16px; border: none; border-radius: 8px;
  cursor: pointer; font-size: 14px;
}
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4fd7; }
.btn-ghost { background: #1d2537; color: #9aa4bd; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-success { background: #16a34a; color: #fff; }
.btn-block { width: 100%; margin-top: 10px; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

.msg { margin-top: 10px; font-size: 13px; color: #f87171; word-break: break-all; }
.msg.ok { color: #4ade80; }
.hint { color: #9aa4bd; font-size: 13px; margin: 8px 0; }

.nav { display: flex; gap: 8px; padding: 16px 24px; max-width: 1100px; margin: 0 auto; }
.nav-btn {
  padding: 10px 18px; border: none; border-radius: 8px;
  background: #161c2c; color: #9aa4bd; cursor: pointer;
}
.nav-btn.active { background: #2563eb; color: #fff; }

.view { max-width: 1100px; margin: 0 auto; padding: 0 24px 40px; }

.toolbar { display: flex; gap: 10px; margin-bottom: 12px; }
.toolbar input, .toolbar select { margin: 0; }

.table-wrap { overflow-x: auto; background: #161c2c; border: 1px solid #232c42; border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #1f2740; }
th { color: #9aa4bd; font-weight: 600; background: #131927; }
tr:hover td { background: #1a2236; }
td a { color: #60a5fa; text-decoration: none; }

.status { padding: 3px 8px; border-radius: 6px; font-size: 12px; }
.status-pending { background: #78350f; color: #fbbf24; }
.status-processing { background: #1e3a8a; color: #93c5fd; }
.status-completed, .status-Completed { background: #14532d; color: #86efac; }
.status-failed, .status-Canceled { background: #7f1d1d; color: #fca5a5; }

.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal-box {
  background: #161c2c; border: 1px solid #2a3550;
  border-radius: 12px; padding: 24px; width: 420px; max-width: 92vw;
}
.modal-actions { display: flex; gap: 10px; margin-top: 14px; justify-content: flex-end; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #2563eb; color: #fff; padding: 10px 20px;
  border-radius: 8px; font-size: 14px; z-index: 200;
}
.toast.error { background: #dc2626; }

.deposit-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid #1f2740; font-size: 13px;
}

.tier-row { display: flex; gap: 8px; margin: 6px 0; align-items: center; }
.cost { color: #64748b; font-size: 11px; }
.tier-row input, .tier-row select { margin: 0; flex: 1; min-width: 0; }
.tier-row .btn { flex-shrink: 0; }
.tier-label { flex-shrink: 0; width: 70px; color: #9aa4bd; font-size: 13px; }
#pricing-editor label { display: block; margin: 10px 0 4px; color: #9aa4bd; font-size: 13px; }
