:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --line: #e5e7eb;
  --text: #111827;
  --muted: #64748b;
  --blue: #2563eb;
  --green: #059669;
  --orange: #d97706;
  --red: #dc2626;
  --violet: #5b4ee5;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}
button, input, select { font: inherit; }
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(360px, 1fr);
  background: #153f75;
}
.auth-side {
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8vw;
}
.auth-side h1 { font-size: clamp(32px, 5vw, 56px); margin: 0 0 14px; }
.auth-side p { max-width: 540px; line-height: 1.7; opacity: .9; }
.auth-card {
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.form {
  width: min(460px, 100%);
}
.form h2 { font-size: 32px; text-align: center; margin: 0 0 28px; }
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label { font-weight: 600; color: #334155; }
.field small { color: var(--muted); line-height: 1.5; }
input, select {
  width: 100%;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  min-height: 44px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
}
input:focus, select:focus { outline: 2px solid rgba(37, 99, 235, .18); border-color: var(--blue); }
.btn {
  border: 0;
  border-radius: 8px;
  min-height: 44px;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 700;
  background: #eef2f7;
  color: #334155;
}
.btn.primary { background: var(--blue); color: #fff; }
.btn.green { background: var(--green); color: #fff; }
.btn.red { background: var(--red); color: #fff; }
.btn.ghost { background: transparent; color: var(--blue); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.switch { text-align: center; margin-top: 20px; color: var(--blue); cursor: pointer; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 240px 1fr; }
.sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 18px; padding: 8px 10px 28px; }
.bolt { width: 28px; height: 28px; border-radius: 50%; background: #1d4ed8; color: #fff; display: grid; place-items: center; }
.nav { display: grid; gap: 8px; }
.nav button {
  text-align: left;
  border: 0;
  background: transparent;
  padding: 12px 14px;
  border-radius: 8px;
  color: #334155;
  cursor: pointer;
}
.nav button.active { background: #dbeafe; color: #2563eb; font-weight: 800; }
.main { min-width: 0; }
.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.pill { background: #f1f5f9; padding: 7px 12px; border-radius: 999px; color: #475569; font-weight: 700; }
.pill.blue { background: #dbeafe; color: #1d4ed8; }
.page { padding: 32px; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.head h1 { margin: 0; font-size: 28px; }
.head p { margin: 8px 0 0; color: var(--muted); }
.grid { display: grid; gap: 16px; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 20px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}
.stat { padding: 20px; min-height: 108px; }
.stat label { color: var(--muted); display: block; margin-bottom: 10px; }
.stat strong { font-size: 30px; }
.green-text { color: var(--green); }
.orange-text { color: var(--orange); }
.blue-text { color: var(--blue); }
.content-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.panel { padding: 22px; }
.panel h2 { margin: 0 0 18px; font-size: 20px; }
.notice { padding: 14px 16px; border-radius: 8px; background: #eff6ff; color: #1d4ed8; margin: 14px 0; line-height: 1.6; }
.notice.green { background: #ecfdf5; color: #047857; }
.notice.yellow { background: #fffbeb; color: #92400e; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 16px; }
.toolbar .field { margin: 0; min-width: 220px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 13px 16px; border-top: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: #64748b; background: #f8fafc; font-size: 13px; }
td.empty { text-align: center; color: #94a3b8; padding: 28px; }
.copy-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.msg { min-height: 22px; color: var(--red); margin: 12px 0; }
.msg.ok { color: var(--green); }
.tabs { display: flex; gap: 8px; margin: 0 0 18px; flex-wrap: wrap; }
.tabs button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  min-height: 40px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 700;
}
.tabs button.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.thumb {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.qr-button {
  border: 0;
  background: transparent;
  display: inline-grid;
  justify-items: center;
  gap: 4px;
  color: var(--blue);
  cursor: pointer;
  padding: 0;
  min-width: 64px;
}
.qr-button span { font-size: 12px; font-weight: 700; }
.qr-button.broken .thumb { display: none; }
.qr-button.broken::before {
  content: "图片异常";
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
}
.qr-preview {
  min-height: 96px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  margin: 0 0 16px;
  padding: 12px;
}
.qr-preview.tall { min-height: 280px; }
.qr-large {
  width: 240px;
  max-width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}
.withdraw-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.summary-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fafc;
  min-height: 86px;
}
.summary-card label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}
.summary-card strong {
  display: block;
  font-size: 20px;
}
.withdraw-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
}
.withdraw-detail-grid h3,
.withdraw-modal h3 {
  margin: 0 0 12px;
  font-size: 18px;
}
.detail-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.detail-line span { color: var(--muted); }
.detail-line b { text-align: right; overflow-wrap: anywhere; }
.timeline {
  display: grid;
  gap: 10px;
}
.timeline-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff;
}
.timeline-item b { display: block; margin-bottom: 4px; }
.timeline-item span { color: var(--muted); font-size: 13px; }
.timeline-item p { margin: 8px 0 0; color: #334155; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(15, 23, 42, .42);
  display: grid;
  place-items: center;
  padding: 24px;
}
.modal {
  width: min(760px, 100%);
  max-height: min(90vh, 860px);
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .24);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { margin: 0; font-size: 20px; }
.modal-body { padding: 22px; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}
.generated {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.invite-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.invite-code {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 8px;
  min-height: 36px;
  padding: 0 12px;
  font-weight: 800;
  cursor: pointer;
}
.icon-btn {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 8px;
  font-size: 24px;
  line-height: 1;
}
.qr-view {
  display: grid;
  place-items: center;
  min-height: 280px;
}
.qr-view img {
  max-width: min(520px, 100%);
  max-height: 70vh;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
small { color: var(--muted); }
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav button { text-align: center; padding: 10px 8px; }
  .topbar { height: auto; padding: 12px 18px; flex-wrap: wrap; justify-content: flex-start; }
  .stats, .content-grid, .two { grid-template-columns: 1fr; }
  .page { padding: 18px; }
  .copy-row { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 12px; }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .btn { flex: 1; }
  .withdraw-summary { grid-template-columns: 1fr 1fr; }
  .withdraw-detail-grid { grid-template-columns: 1fr; }
}
