/* ============================================================
   后台管理 · 样式
   ============================================================ */
:root {
  --bg: #060a12;
  --bg-soft: #0a0f1a;
  --panel: #0d1421;
  --panel-2: #111a2b;
  --line: rgba(148, 163, 184, 0.13);
  --line-strong: rgba(148, 163, 184, 0.26);
  --text: #e8eefb;
  --text-dim: #94a3b8;
  --text-mute: #5d6b82;
  --brand: #4f8cff;
  --brand-2: #6ee7ff;
  --green: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;
  --violet: #8b5cf6;
  --radius: 16px;
  --radius-sm: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
}

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

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
[hidden] { display: none !important; }

.mono { font-family: var(--mono); }
.ta-r { text-align: right !important; }
.ta-c { text-align: center !important; }

/* ============================================================
   登录
   ============================================================ */
.login-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(1200px 600px at 50% -20%, rgba(79, 140, 255, 0.18), transparent 60%), #060a12;
  z-index: 100;
  overflow: auto;
}
.login-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.lg-orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5; }
.lg-1 { width: 420px; height: 420px; background: rgba(79, 140, 255, 0.6); top: -140px; left: -80px; }
.lg-2 { width: 360px; height: 360px; background: rgba(34, 211, 238, 0.4); bottom: -120px; right: -60px; }

.login-card {
  position: relative;
  width: min(400px, 100%);
  padding: 34px 32px 26px;
  border-radius: 22px;
  background: rgba(13, 20, 33, 0.92);
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px -30px #000;
  backdrop-filter: blur(20px);
}

.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.login-mark {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #2f6fe0);
  box-shadow: 0 12px 26px -12px rgba(79, 140, 255, 0.9);
}
.login-mark svg { width: 24px; height: 24px; }
.login-brand h1 { margin: 0; font-size: 18px; }
.login-brand p { margin: 2px 0 0; font-size: 12px; color: var(--text-mute); }

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

.lg-field { display: flex; flex-direction: column; gap: 7px; }
.lg-field span { font-size: 12.5px; color: var(--text-dim); }
.lg-field input {
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text);
  background: rgba(148, 163, 184, 0.05);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.lg-field input:focus { border-color: rgba(79, 140, 255, 0.7); background: rgba(79, 140, 255, 0.07); }
.lg-field input::placeholder { color: var(--text-mute); }

.login-err {
  margin: 0;
  padding: 9px 12px;
  font-size: 12.5px;
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.28);
  border-radius: 9px;
}

.lg-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 4px;
  padding: 13px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 2px;
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(120deg, #2b6ef5, #4f8cff 60%, #22d3ee);
  background-size: 160% 100%;
  box-shadow: 0 16px 34px -16px rgba(79, 140, 255, 0.95);
  transition: all 0.24s ease;
}
.lg-btn:hover { background-position: 100% 0; transform: translateY(-1px); }
.lg-btn:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }

.lg-spinner {
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.login-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.login-foot a { color: var(--text-dim); }
.login-foot a:hover { color: var(--brand-2); }
.login-tip { font-size: 11px; color: var(--text-mute); }

/* ============================================================
   主框架
   ============================================================ */
.admin-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------------- 侧栏 ---------------- */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px 14px 16px;
  background: linear-gradient(180deg, #0a1120, #070c15);
  border-right: 1px solid var(--line);
  z-index: 60;
}

.sb-brand { display: flex; align-items: center; gap: 11px; padding: 0 6px 20px; }
.sb-mark {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  flex: 0 0 36px;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #2f6fe0);
  box-shadow: 0 8px 20px -10px rgba(79, 140, 255, 0.9);
}
.sb-mark svg { width: 19px; height: 19px; }
.sb-brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.sb-brand-text strong {
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-brand-text small { font-size: 9px; letter-spacing: 1.4px; color: var(--text-mute); }

.sb-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }

.sb-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  font-size: 13.5px;
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: all 0.16s ease;
  cursor: pointer;
}
.sb-item svg { width: 17px; height: 17px; flex: 0 0 17px; opacity: 0.8; }
.sb-item:hover { color: var(--text); background: rgba(148, 163, 184, 0.07); }
.sb-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(79, 140, 255, 0.18), rgba(79, 140, 255, 0.04));
  border-color: rgba(79, 140, 255, 0.25);
}
.sb-item.active svg { opacity: 1; color: var(--brand-2); }

.sb-foot { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.sb-link { padding: 9px 12px; }

.sb-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 10px;
  margin-top: 4px;
  border-radius: var(--radius-sm);
  background: rgba(148, 163, 184, 0.05);
}
.sb-avatar {
  width: 30px; height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #4f8cff, #8b5cf6);
}
.sb-user-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.sb-user-info strong { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-info small { font-size: 10.5px; color: var(--text-mute); }

.sb-logout {
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  color: var(--text-mute);
  background: transparent;
  border: 0;
  transition: all 0.16s ease;
}
.sb-logout svg { width: 16px; height: 16px; }
.sb-logout:hover { color: var(--red); background: rgba(239, 68, 68, 0.1); }

/* ---------------- 顶栏 ---------------- */
.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 26px;
  height: 64px;
  background: rgba(6, 10, 18, 0.85);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.menu-toggle {
  display: none;
  width: 34px; height: 34px;
  border-radius: 9px;
  color: var(--text-dim);
  background: rgba(148, 163, 184, 0.07);
  border: 1px solid var(--line);
}
.menu-toggle svg { width: 18px; height: 18px; }

.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { margin: 0; font-size: 16px; font-weight: 600; }
.topbar-title p { margin: 0; font-size: 11.5px; color: var(--text-mute); }

.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-time { font-family: var(--mono); font-size: 11.5px; color: var(--text-mute); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 9px;
  color: var(--text-dim);
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid var(--line);
  transition: all 0.16s ease;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { color: var(--brand-2); border-color: rgba(34, 211, 238, 0.35); }

.content { padding: 22px 26px 48px; }
.page { animation: fadein 0.25s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------------- 统计卡 ---------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  position: relative;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(17, 26, 43, 0.95), rgba(13, 20, 33, 0.9));
  border: 1px solid var(--line);
  overflow: hidden;
}
.stat-card::after {
  content: "";
  position: absolute;
  top: 0; left: 14%; right: 14%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(110, 231, 255, 0.5), transparent);
}
.stat-label { display: block; font-size: 12px; color: var(--text-dim); }
.stat-value {
  display: block;
  margin: 6px 0 4px;
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.stat-sub { font-size: 11.5px; color: var(--text-mute); }
.stat-sub b { color: var(--text-dim); font-family: var(--mono); font-weight: 600; }

/* ---------------- 面板 ---------------- */
.panel {
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  margin-bottom: 16px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.panel-head h2 { margin: 0; font-size: 14.5px; font-weight: 600; }
.panel-desc { margin: 5px 0 0; font-size: 12px; color: var(--text-mute); max-width: 720px; }
.panel-link { font-size: 12px; color: var(--text-dim); }
.panel-link:hover { color: var(--brand-2); }
.panel-badge {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.4px;
  color: var(--brand-2);
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(34, 211, 238, 0.09);
  border: 1px solid rgba(34, 211, 238, 0.25);
  white-space: nowrap;
}
.panel-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; }
.dash-grid-2 { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.dash-grid .panel { margin-bottom: 0; }
.dash-grid + .dash-grid { margin-top: 16px; }

/* 趋势图 */
.legend { display: flex; gap: 12px; }
.lg-tag { font-size: 11px; color: var(--text-mute); display: inline-flex; align-items: center; gap: 5px; }
.lg-tag::before { content: ""; width: 8px; height: 8px; border-radius: 2px; }
.lg-count::before { background: rgba(79, 140, 255, 0.75); }
.lg-paid::before { background: var(--green); }

.chart { height: 200px; display: flex; align-items: flex-end; gap: 8px; padding-top: 10px; }

.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; }
.chart-bars { display: flex; align-items: flex-end; gap: 3px; height: 100%; width: 100%; justify-content: center; }
.chart-bar {
  width: 12px;
  min-height: 2px;
  border-radius: 3px 3px 1px 1px;
  background: linear-gradient(180deg, rgba(79, 140, 255, 0.95), rgba(79, 140, 255, 0.3));
  transition: height 0.5s cubic-bezier(0.2, 0.9, 0.3, 1);
  position: relative;
}
.chart-bar.paid { background: linear-gradient(180deg, #34d399, rgba(16, 185, 129, 0.28)); }
.chart-bar:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 8px;
  font-size: 10.5px;
  white-space: nowrap;
  color: var(--text);
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  z-index: 3;
}
.chart-label { font-size: 10.5px; color: var(--text-mute); font-family: var(--mono); }

/* 通道分布 */
.channel-list { display: flex; flex-direction: column; gap: 12px; }
.channel-row { display: flex; flex-direction: column; gap: 5px; }
.channel-top { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; }
.channel-name { display: flex; align-items: center; gap: 7px; color: var(--text-dim); }
.channel-dot { width: 7px; height: 7px; border-radius: 50%; }
.channel-count { font-family: var(--mono); font-size: 12px; color: var(--text); }
.channel-track { height: 5px; border-radius: 3px; background: rgba(148, 163, 184, 0.1); overflow: hidden; }
.channel-fill { height: 100%; border-radius: 3px; transition: width 0.6s cubic-bezier(0.2, 0.9, 0.3, 1); }

/* 表格 */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 12.8px; min-width: 640px; }
.tbl th {
  padding: 9px 10px;
  text-align: left;
  font-weight: 500;
  font-size: 11.5px;
  color: var(--text-mute);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tbl td { padding: 11px 10px; border-bottom: 1px solid rgba(148, 163, 184, 0.07); vertical-align: middle; }
.tbl tbody tr:hover { background: rgba(148, 163, 184, 0.03); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl-compact { min-width: 520px; }
.tbl-compact td { padding: 9px 10px; }
.empty-cell { text-align: center; color: var(--text-mute); padding: 28px 0 !important; font-size: 12.5px; }

.cell-main { display: block; color: var(--text); }
.cell-sub { display: block; font-size: 11px; color: var(--text-mute); font-family: var(--mono); }
.cell-money { font-family: var(--mono); font-weight: 600; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 6px;
  white-space: nowrap;
}
.badge-wait { color: var(--amber); background: rgba(245, 158, 11, 0.12); }
.badge-paid { color: var(--green); background: rgba(16, 185, 129, 0.12); }
.badge-closed { color: var(--text-mute); background: rgba(148, 163, 184, 0.1); }
.badge-on { color: var(--green); background: rgba(16, 185, 129, 0.12); }
.badge-off { color: var(--text-mute); background: rgba(148, 163, 184, 0.1); }
.badge-default { color: var(--brand-2); background: rgba(34, 211, 238, 0.1); }

.ch-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-dim); }
.ch-dot { width: 6px; height: 6px; border-radius: 50%; }

/* 商户速览 */
.merchant-mini { display: flex; flex-direction: column; gap: 9px; }
.mini-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: rgba(148, 163, 184, 0.04);
  border: 1px solid var(--line);
}
.mini-thumb {
  width: 32px; height: 32px;
  flex: 0 0 32px;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
  padding: 2px;
}
.mini-info { flex: 1; min-width: 0; }
.mini-info strong { display: block; font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-info small { font-size: 10.5px; color: var(--text-mute); }

/* ============================================================
   上传解析
   ============================================================ */
.upload-zone {
  position: relative;
  border: 1.5px dashed rgba(148, 163, 184, 0.28);
  border-radius: var(--radius);
  background: rgba(148, 163, 184, 0.025);
  transition: all 0.2s ease;
  overflow: hidden;
}
.upload-zone.dragover {
  border-color: rgba(79, 140, 255, 0.75);
  background: rgba(79, 140, 255, 0.06);
}
.uz-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 30px 20px;
  text-align: center;
}
.uz-icon {
  width: 52px; height: 52px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  margin-bottom: 4px;
  color: var(--brand-2);
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.2);
}
.uz-icon svg { width: 26px; height: 26px; }
.uz-title { margin: 0; font-size: 13.5px; }
.uz-sub { margin: 0 0 8px; font-size: 11.5px; color: var(--text-mute); }
.uz-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 42px 20px;
  font-size: 12.5px;
  color: var(--text-dim);
}
.spinner {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2.5px solid rgba(148, 163, 184, 0.18);
  border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
}

/* 解析结果 */
.parse-result {
  margin-top: 16px;
  padding: 18px;
  border-radius: var(--radius);
  background: rgba(16, 185, 129, 0.03);
  border: 1px solid rgba(16, 185, 129, 0.22);
  animation: fadein 0.3s ease;
}

.pr-head { display: flex; align-items: center; gap: 13px; padding-bottom: 14px; border-bottom: 1px dashed var(--line); }
.pr-thumb {
  width: 64px; height: 64px;
  flex: 0 0 64px;
  border-radius: 11px;
  background: #fff;
  padding: 3px;
  display: grid;
  place-items: center;
}
.pr-thumb img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }
.pr-meta { flex: 1; min-width: 0; }
.pr-channel {
  display: inline-block;
  padding: 2px 8px;
  font-size: 10.5px;
  border-radius: 5px;
  color: var(--brand-2);
  background: rgba(34, 211, 238, 0.1);
  margin-bottom: 4px;
}
.pr-meta h3 { margin: 0; font-size: 15px; font-weight: 600; }
.pr-mask { margin: 2px 0 0; font-size: 11px; color: var(--text-mute); word-break: break-all; }

.pr-notice {
  margin-top: 12px;
  padding: 9px 12px;
  font-size: 12px;
  border-radius: 9px;
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.09);
  border: 1px solid rgba(245, 158, 11, 0.25);
}
.pr-notice.info { color: var(--brand-2); background: rgba(34, 211, 238, 0.07); border-color: rgba(34, 211, 238, 0.22); }

.pr-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin: 14px 0;
}
.pr-field { padding: 9px 12px; background: rgba(10, 15, 26, 0.85); }
.pr-field span { display: block; font-size: 10.5px; color: var(--text-mute); }
.pr-field b { display: block; font-size: 12.5px; font-weight: 500; word-break: break-all; }

.pr-edit { padding-top: 4px; }
.pr-actions { display: flex; gap: 9px; margin-top: 16px; flex-wrap: wrap; }
.pr-switches { display: flex; gap: 22px; margin-top: 14px; flex-wrap: wrap; }

/* 表单 */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fm-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.fm-field span { font-size: 12px; color: var(--text-dim); }
.fm-field span i { color: var(--red); font-style: normal; }
.fm-field input,
.fm-field select,
.fm-field textarea {
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text);
  background: rgba(148, 163, 184, 0.05);
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  transition: border-color 0.18s, background 0.18s;
}
.fm-field textarea { resize: vertical; line-height: 1.6; }
.fm-field input:focus, .fm-field select:focus, .fm-field textarea:focus {
  border-color: rgba(79, 140, 255, 0.65);
  background: rgba(79, 140, 255, 0.06);
}
.fm-field input::placeholder, .fm-field textarea::placeholder { color: var(--text-mute); }

.fm-search {
  padding: 7px 12px;
  font-size: 12.5px;
  color: var(--text);
  background: rgba(148, 163, 184, 0.05);
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  min-width: 170px;
}
.fm-search:focus { border-color: rgba(79, 140, 255, 0.6); }
.fm-select { min-width: 108px; cursor: pointer; }

/* 开关 */
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-dim); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.sw-track {
  position: relative;
  width: 36px; height: 20px;
  flex: 0 0 36px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  transition: background 0.2s ease;
}
.sw-track::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.switch input:checked + .sw-track { background: var(--brand); }
.switch input:checked + .sw-track::after { transform: translateX(16px); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  font-size: 13px;
  border-radius: 9px;
  border: 1px solid transparent;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-sm { padding: 7px 13px; font-size: 12.5px; }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #3b7bf0, #4f8cff);
  box-shadow: 0 10px 24px -12px rgba(79, 140, 255, 0.95);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); }
.btn-ghost {
  color: var(--text-dim);
  background: rgba(148, 163, 184, 0.06);
  border-color: var(--line-strong);
}
.btn-ghost:hover:not(:disabled) { color: var(--text); border-color: rgba(148, 163, 184, 0.42); }
.btn-danger { color: #fca5a5; background: rgba(239, 68, 68, 0.09); border-color: rgba(239, 68, 68, 0.28); }
.btn-danger:hover:not(:disabled) { background: rgba(239, 68, 68, 0.16); }
.btn-xs { padding: 4px 9px; font-size: 11.5px; border-radius: 6px; }

.row-actions { display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; }

/* 分页 */
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pager button {
  min-width: 32px;
  padding: 5px 10px;
  font-size: 12.5px;
  font-family: var(--mono);
  color: var(--text-dim);
  background: rgba(148, 163, 184, 0.05);
  border: 1px solid var(--line);
  border-radius: 7px;
  transition: all 0.15s ease;
}
.pager button:hover:not(:disabled) { color: var(--text); border-color: var(--line-strong); }
.pager button.active { color: #fff; background: rgba(79, 140, 255, 0.2); border-color: rgba(79, 140, 255, 0.5); }
.pager button:disabled { opacity: 0.4; cursor: not-allowed; }
.pager .pager-info { font-size: 12px; color: var(--text-mute); margin-left: 8px; }

/* 订单统计 */
.order-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 16px;
}
.order-stats > div { padding: 11px 14px; background: rgba(10, 15, 26, 0.8); }
.order-stats span { display: block; font-size: 11px; color: var(--text-mute); }
.order-stats b { display: block; font-family: var(--mono); font-size: 17px; font-weight: 600; margin-top: 2px; }

/* 设置页 */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.settings-grid .panel { margin-bottom: 0; }
.settings-side { display: flex; flex-direction: column; gap: 16px; }
.settings-form { display: flex; flex-direction: column; }

.env-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.env-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; background: rgba(10, 15, 26, 0.85); font-size: 12px; }
.env-list li span { color: var(--text-mute); }
.env-list li b { font-weight: 500; font-family: var(--mono); font-size: 11.5px; }

/* 弹窗 */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; }
.modal-mask { position: absolute; inset: 0; background: rgba(2, 5, 10, 0.72); backdrop-filter: blur(4px); }
.modal-box {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  box-shadow: 0 40px 100px -40px #000;
  animation: pop 0.24s cubic-bezier(0.2, 0.9, 0.3, 1);
  overflow: hidden;
}
@keyframes pop { from { opacity: 0; transform: scale(0.96) translateY(10px); } to { opacity: 1; transform: none; } }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { padding: 13px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

.detail-list { display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.detail-list > div { display: flex; justify-content: space-between; gap: 14px; padding: 9px 13px; background: rgba(10, 15, 26, 0.9); font-size: 12.5px; }
.detail-list span { color: var(--text-mute); flex: 0 0 auto; }
.detail-list b { font-weight: 500; word-break: break-all; text-align: right; }

.modal-qr { display: block; width: 168px; height: 168px; margin: 0 auto 14px; border-radius: 12px; background: #fff; padding: 6px; object-fit: contain; }

/* 快捷金额（弹窗内） */
.amount-presets { display: flex; gap: 7px; flex-wrap: wrap; }
.amount-presets button {
  flex: 1;
  min-width: 52px;
  padding: 6px 0;
  font-size: 12px;
  font-family: var(--mono);
  color: var(--text-dim);
  background: rgba(148, 163, 184, 0.05);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: all 0.16s ease;
}
.amount-presets button:hover {
  color: var(--brand-2);
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.08);
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translate(-50%, 22px);
  padding: 11px 20px;
  font-size: 13px;
  border-radius: 11px;
  color: var(--text);
  background: rgba(15, 23, 42, 0.97);
  border: 1px solid var(--line-strong);
  box-shadow: 0 22px 46px -20px #000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.26s cubic-bezier(0.2, 0.9, 0.3, 1);
  z-index: 300;
  max-width: min(520px, calc(100% - 40px));
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: rgba(239, 68, 68, 0.5); }
.toast.success { border-color: rgba(16, 185, 129, 0.5); }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid, .dash-grid-2, .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 240px;
    transform: translateX(-100%);
    transition: transform 0.26s cubic-bezier(0.2, 0.9, 0.3, 1);
    box-shadow: 20px 0 60px -30px #000;
  }
  .sidebar.open { transform: none; }
  .menu-toggle { display: grid; place-items: center; }
  .content { padding: 16px 14px 40px; }
  .topbar { padding: 0 14px; height: 58px; }
  .topbar-time { display: none; }
}

@media (max-width: 620px) {
  .stat-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .order-stats { grid-template-columns: repeat(2, 1fr); }
  .panel { padding: 15px 14px; }
  .panel-head { flex-direction: column; align-items: stretch; }
  .panel-tools { width: 100%; }
  .fm-search { flex: 1; min-width: 0; }
  .stat-value { font-size: 22px; }
}
