/* ===========================================================
   沐晨收款平台 · 共享设计底座
   客户端(client.css) 与 管理后台(admin.css) 都基于这里的变量和组件
   =========================================================== */

:root {
  --bg: #070B18;
  --bg-glow-1: rgba(99, 102, 241, .22);
  --bg-glow-2: rgba(6, 182, 212, .14);

  --surface: rgba(255, 255, 255, .035);
  --surface-2: rgba(255, 255, 255, .06);
  --surface-3: rgba(255, 255, 255, .09);
  --border: rgba(255, 255, 255, .085);
  --border-strong: rgba(255, 255, 255, .16);

  --text: #E9EDFB;
  --text-dim: #8D97BC;
  --text-mute: #5B6690;

  --brand-1: #6366F1;
  --brand-2: #8B5CF6;
  --brand-3: #3B82F6;
  --accent: #06B6D4;

  --ok: #22C55E;
  --warn: #F59E0B;
  --danger: #F43F5E;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;

  --shadow: 0 18px 40px -18px rgba(0, 0, 0, .85);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.55;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 480px at 12% -8%, var(--bg-glow-1), transparent 62%),
    radial-gradient(760px 420px at 92% 4%, var(--bg-glow-2), transparent 60%),
    radial-gradient(700px 500px at 50% 108%, rgba(139, 92, 246, .10), transparent 65%);
  z-index: 0;
}

/* ---------- 文字 ---------- */
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }

.dim { color: var(--text-dim); }
.mute { color: var(--text-mute); }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grad-text {
  background: linear-gradient(100deg, #A5B4FC, #C4B5FD 45%, #7DD3FC);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.t-xs { font-size: 12px; }
.t-sm { font-size: 13px; }
.t-lg { font-size: 16px; }
.t-xl { font-size: 20px; }
.fw6 { font-weight: 600; }
.fw7 { font-weight: 700; }
.hint { font-size: 12px; color: var(--text-mute); line-height: 1.6; }
.err { font-size: 12.5px; color: #FDA4AF; }

/* ---------- 布局 ---------- */
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.spacer { flex: 1; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  backdrop-filter: blur(12px);
}
.card.tight { padding: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title { font-size: 14px; font-weight: 600; }
.card-sub { font-size: 12px; color: var(--text-mute); margin-top: 2px; }

.hero {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  background: linear-gradient(118deg, var(--brand-1) 0%, var(--brand-2) 46%, var(--brand-3) 100%);
  overflow: hidden;
  box-shadow: 0 24px 55px -24px rgba(99, 102, 241, .8);
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(420px 200px at 88% -20%, rgba(255, 255, 255, .30), transparent 70%),
    radial-gradient(300px 200px at 8% 118%, rgba(6, 182, 212, .35), transparent 70%);
}
.hero > * { position: relative; z-index: 1; }
.hero-label { font-size: 12.5px; color: rgba(255, 255, 255, .82); letter-spacing: .3px; }
.hero-amount { font-size: 38px; font-weight: 700; letter-spacing: -1px; margin: 2px 0; color: #fff; }
.hero-unit { font-size: 17px; font-weight: 600; opacity: .85; margin-left: 6px; }
.hero-foot { display: flex; gap: 26px; margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .22); }
.hero-foot .k { font-size: 11.5px; color: rgba(255, 255, 255, .76); }
.hero-foot .v { font-size: 15px; font-weight: 600; color: #fff; }

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 17px;
}
.stat .k { font-size: 12px; color: var(--text-mute); display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 24px; font-weight: 650; margin-top: 6px; letter-spacing: -.4px; }
.stat .d { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text);
  font-size: 13.5px; font-family: var(--font); font-weight: 500;
  transition: .16s ease; white-space: nowrap; line-height: 1.2;
}
.btn:hover:not(:disabled) { background: var(--surface-3); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(100deg, var(--brand-1), var(--brand-2) 60%, var(--brand-3));
  border-color: transparent; color: #fff; font-weight: 600;
  box-shadow: 0 12px 26px -12px rgba(99, 102, 241, .95);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-danger { background: rgba(244, 63, 94, .16); border-color: rgba(244, 63, 94, .42); color: #FDA4AF; }
.btn-ok { background: rgba(34, 197, 94, .14); border-color: rgba(34, 197, 94, .4); color: #86EFAC; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 12.5px; color: var(--text-dim); }
.input, .select, .textarea {
  width: 100%; padding: 10px 13px;
  background: rgba(6, 10, 24, .6);
  border: 1px solid var(--border);
  border-radius: 10px; color: var(--text);
  font-size: 13.5px; font-family: var(--font);
  transition: .16s ease;
}
.textarea { resize: vertical; min-height: 76px; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: rgba(129, 140, 248, .7);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .16);
  background: rgba(6, 10, 24, .85);
}
.input::placeholder { color: var(--text-mute); }
.input.mono { font-family: var(--mono); font-size: 12.5px; }
select.input { appearance: none; }

/* 分段选择 */
.seg {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px;
}
.seg button {
  padding: 7px 15px; border-radius: 9px; border: none; cursor: pointer;
  background: transparent; color: var(--text-dim);
  font-size: 12.5px; font-family: var(--font); font-weight: 500;
  transition: .16s ease;
}
.seg button:hover:not(:disabled):not(.on) { color: var(--text); background: var(--surface-2); }
.seg button.on {
  background: linear-gradient(100deg, rgba(99, 102, 241, .9), rgba(139, 92, 246, .8));
  color: #fff; box-shadow: 0 8px 18px -10px rgba(99, 102, 241, 1);
}
.seg button:disabled { opacity: .35; cursor: not-allowed; }
.seg.wide { display: flex; width: 100%; }
.seg.wide button { flex: 1; }

/* ---------- 徽标 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 500;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-dim);
}
.badge.ok { background: rgba(34, 197, 94, .13); color: #86EFAC; border-color: rgba(34, 197, 94, .3); }
.badge.warn { background: rgba(245, 158, 11, .13); color: #FDE68A; border-color: rgba(245, 158, 11, .3); }
.badge.danger { background: rgba(244, 63, 94, .13); color: #FDA4AF; border-color: rgba(244, 63, 94, .3); }
.badge.info { background: rgba(59, 130, 246, .14); color: #93C5FD; border-color: rgba(59, 130, 246, .3); }
.badge.mute { background: var(--surface-2); color: var(--text-dim); border-color: var(--border); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; font-size: 12px; color: var(--text-dim);
}

/* ---------- 地址 / 二维码 ---------- */
.addr-box {
  display: flex; align-items: center; gap: 12px;
  background: rgba(6, 10, 24, .55);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px;
}
.addr-val { font-family: var(--mono); font-size: 13px; word-break: break-all; flex: 1; }
.qr-wrap {
  background: #fff; padding: 12px; border-radius: 14px;
  display: inline-flex; box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .8);
}
.qr-wrap svg { display: block; width: 100%; height: 100%; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 11.5px; font-weight: 500; color: var(--text-mute);
  padding: 0 12px 10px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
td { padding: 12px; border-bottom: 1px solid rgba(255, 255, 255, .045); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(255, 255, 255, .02); }

/* ---------- 弹窗 / 提示 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(4, 6, 15, .74);
  backdrop-filter: blur(6px); display: grid; place-items: center;
  z-index: 60; padding: 20px;
}
.modal {
  width: 100%; max-width: 460px; max-height: 88vh; overflow-y: auto;
  background: #0C1226; border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow);
}
.modal.wide { max-width: 680px; }

.toasts { position: fixed; top: 18px; right: 18px; z-index: 80; display: flex; flex-direction: column; gap: 9px; }
.toast {
  min-width: 220px; max-width: 340px;
  padding: 12px 15px; border-radius: 12px;
  background: rgba(12, 18, 38, .96); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow); font-size: 13px;
  display: flex; gap: 10px; align-items: flex-start;
  animation: slideIn .22s ease;
}
.toast.ok { border-color: rgba(34, 197, 94, .45); }
.toast.err { border-color: rgba(244, 63, 94, .5); }
.toast.warn { border-color: rgba(245, 158, 11, .5); }
@keyframes slideIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* ---------- 其它 ---------- */
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.empty { padding: 34px 16px; text-align: center; color: var(--text-mute); font-size: 13px; }
.empty .big { font-size: 26px; opacity: .5; margin-bottom: 6px; }
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-3) 37%, var(--surface) 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease infinite;
  border-radius: 8px; height: 14px;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.page-enter { animation: fadeUp .26s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.notice {
  border-radius: 12px; padding: 12px 14px; font-size: 12.5px; line-height: 1.7;
  border: 1px solid rgba(245, 158, 11, .3); background: rgba(245, 158, 11, .08); color: #FDE68A;
}
.notice.info { border-color: rgba(59, 130, 246, .3); background: rgba(59, 130, 246, .08); color: #BFDBFE; }
.notice.danger { border-color: rgba(244, 63, 94, .32); background: rgba(244, 63, 94, .08); color: #FECDD3; }
.notice.ok { border-color: rgba(34, 197, 94, .3); background: rgba(34, 197, 94, .08); color: #BBF7D0; }

/* 分页 */
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 14px; }

/* ---------- 后台页面头 ---------- */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.page-head h1 { font-size: 21px; }
.page-head .sub { color: var(--text-dim); font-size: 12.5px; margin-top: 4px; }
.status { font-size: 12.5px; }
