/* ============================================================
   抖音支付拉单系统 - 全局样式（UI 对齐「抖音自动续火」体系）
   1. 设计令牌与基础
   2. 后台外壳：白色侧边栏 + 顶栏（桌面可折叠 / 移动抽屉）
   3. 通用组件：卡片/表单/按钮/徽章/表格/提示
   4. 登录注册（毛玻璃 guest）
   5. 聚合收银台 H5
   6. 支付页 /pay/{no}
   ============================================================ */

:root {
  --bg-main: #f1f5f9;
  --bg-sidebar: #ffffff;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: #eff6ff;
  --ai-purple: #8b5cf6;
  --purple-dark: #6d28d9;
  --purple-grad: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-faint: #94a3b8;
  --border-light: rgba(226, 232, 240, 0.6);
  --border-solid: #e2e8f0;
  --sidebar-width: 220px;
  --sidebar-collapsed: 72px;
  --header-height: 70px;
  --radius: 16px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, .02), 0 1px 3px rgba(0, 0, 0, .04);
  --shadow-lg: 0 25px 50px -12px rgba(15, 23, 42, .18);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; }
.spacer { flex: 1; }

/* ============ 2. 后台外壳 ============ */
.admin-body { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: width .25s cubic-bezier(.4, 0, .2, 1), transform .3s cubic-bezier(.4, 0, .2, 1);
}
.logo-area {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-light);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-main);
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
}
.logo-area i { color: var(--primary); font-size: 20px; }

.nav-menu { padding: 15px 0; flex: 1; overflow-y: auto; overflow-x: hidden; }
.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  margin: 2px 16px;
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: all .2s;
}
.nav-item i { width: 22px; font-size: 16px; margin-right: 12px; text-align: center; flex-shrink: 0; }
.nav-item:hover { color: var(--text-main); background: #f1f5f9; }
.nav-item.active { color: var(--primary); background: var(--primary-light); font-weight: 600; }

/* 侧边栏分组（店铺绑定等） */
.nav-group { margin-top: 4px; }
.nav-group-header {
  display: flex; align-items: center;
  padding: 10px 20px; margin: 2px 16px;
  border-radius: 12px;
  color: var(--text-muted); font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: all .2s;
}
.nav-group-header i { width: 22px; font-size: 16px; margin-right: 12px; text-align: center; flex-shrink: 0; }
.nav-group-header:hover { color: var(--text-main); background: #f1f5f9; }
.nav-group-arrow { margin-left: auto; font-size: 11px; transition: transform .2s; }
.nav-group-items {
  max-height: 0; overflow: hidden; transition: max-height .25s ease;
}
.nav-group.expanded .nav-group-items { max-height: 200px; }
.nav-group.expanded .nav-group-arrow { transform: rotate(180deg); }
.nav-sub-item { padding-left: 32px !important; font-size: 13px !important; }
.admin-body.sb-collapsed .nav-group-header { justify-content: center; }
.admin-body.sb-collapsed .nav-group-header .nav-label,
.admin-body.sb-collapsed .nav-group-header .nav-group-arrow { display: none; }
.admin-body.sb-collapsed .nav-group-items { display: none; }

.main-wrapper { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.top-header {
  height: var(--header-height);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 900;
}
.header-left { display: flex; align-items: center; gap: 10px; }
.mobile-menu-btn, .collapse-btn {
  display: none;
  width: 38px; height: 38px;
  border: none;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-main);
  font-size: 18px;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.collapse-btn { display: inline-flex; color: var(--text-muted); font-size: 15px; }
.mobile-menu-btn:hover, .collapse-btn:hover { background: #f1f5f9; }

.breadcrumb { color: var(--text-muted); font-size: 13px; font-weight: 500; }
.breadcrumb > span:last-child { color: var(--text-main); font-weight: 600; }
.bc-sep { margin: 0 5px; opacity: .3; }

.user-profile { display: flex; align-items: center; gap: 15px; }
.sys-status {
  font-size: 12px;
  color: #10b981;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.sys-status::before {
  content: '';
  width: 7px; height: 7px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .12);
}
.admin-info { display: flex; align-items: center; gap: 10px; border-left: 1px solid var(--border-light); padding-left: 15px; }
.admin-avatar {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--purple-grad);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}
.admin-name { color: var(--text-main); font-weight: 600; font-size: 14px; }
.btn-logout {
  color: var(--text-muted);
  font-size: 13px;
  border: 1px solid var(--border-light);
  padding: 7px 16px;
  border-radius: 20px;
  background: #f8fafc;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: .2s;
}
.btn-logout:hover { color: #ef4444; border-color: #fecaca; background: #fef2f2; }

.content-area { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 20px; }
.content-inner { width: 100%; max-width: 1200px; margin: 0 auto; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .4);
  backdrop-filter: blur(2px);
  z-index: 995;
  opacity: 0;
  transition: opacity .3s;
}

/* 桌面端折叠态：只留图标 */
.admin-body.sb-collapsed .sidebar { width: var(--sidebar-collapsed); }
.admin-body.sb-collapsed .logo-area { justify-content: center; gap: 0; }
.admin-body.sb-collapsed .logo-text,
.admin-body.sb-collapsed .nav-label { display: none; }
.admin-body.sb-collapsed .nav-item { justify-content: center; padding: 12px 0; margin: 2px 12px; }
.admin-body.sb-collapsed .nav-item i { margin-right: 0; }
.admin-body.sb-collapsed #collapseIcon::before { content: "\f101"; }

/* ============ 3. 通用组件 ============ */
.card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 25px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.card h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card h1 i { color: var(--primary); }
.card h2 { font-size: 16px; font-weight: 700; margin: 4px 0 12px; color: var(--text-main); }

label { display: block; font-size: 14px; color: #475569; margin: 14px 0 8px; font-weight: 600; }
input[type=text], input[type=password], input[type=number], input[type=email], select, textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  outline: none;
  background: #f8fafc;
  color: var(--text-main);
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
textarea { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 12.5px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, .1);
}
input:disabled { background: #f1f5f9; color: var(--text-faint); cursor: not-allowed; }

.btn {
  display: inline-block;
  padding: 11px 22px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 4px 12px rgba(59, 130, 246, .22);
  transition: background .2s, transform .12s, box-shadow .2s, opacity .12s;
}
.btn:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 6px 15px rgba(59, 130, 246, .32); color: #fff; }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-ghost {
  background: var(--primary-light);
  color: var(--primary);
  box-shadow: none;
}
.btn-ghost:hover { background: #dbeafe; color: var(--primary-hover); }
.btn-block { width: 100%; }
.btn-purple { background: var(--ai-purple); box-shadow: 0 4px 12px rgba(139, 92, 246, .25); }
.btn-purple:hover { background: var(--purple-dark); box-shadow: 0 6px 15px rgba(139, 92, 246, .35); }
form .btn { margin-top: 18px; width: 100%; }
.actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.actions .btn { width: auto; margin-top: 0; }

.quick { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.quick button {
  padding: 7px 16px;
  border: 1px solid var(--border-solid);
  background: #fff;
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-main);
  cursor: pointer;
  transition: all .15s;
}
.quick button:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.radio-group { margin-bottom: 8px; }
.radio {
  display: inline-flex;
  align-items: center;
  margin-right: 18px;
  font-size: 14px;
  color: var(--text-main);
  cursor: pointer;
  font-weight: 400;
}
.radio input { margin-right: 6px; accent-color: var(--primary); width: auto; }

.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid transparent;
}
.flash i { font-size: 15px; }
.flash-success { background: #f0fdf4; color: #0f9d58; border-color: #bbf7d0; }
.flash-error   { background: #fef2f2; color: #ef4444; border-color: #fecaca; }
.flash-info    { background: var(--primary-light); color: var(--primary-hover); border-color: #bfdbfe; }

.empty { text-align: center; padding: 44px 16px; color: var(--text-faint); }
.empty p { margin-bottom: 14px; font-size: 14px; }
.empty .btn { margin-top: 4px; }

.hint, .tip { font-size: 12.5px; color: var(--text-muted); margin-top: 8px; line-height: 1.7; }
.hint a, .tip a { color: var(--primary); font-weight: 600; }

.alert-info {
  background: var(--primary-light);
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
  font-size: 13.5px;
  color: #334155;
}
.alert-info a { color: var(--primary); font-weight: 600; }

.account-info {
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid var(--border-solid);
  border-radius: 12px;
  margin: 14px 0;
  font-size: 13.5px;
}
.account-info p { margin: 4px 0; font-size: 13px; }
.avatar { width: 48px; height: 48px; border-radius: 50%; margin: 8px 0; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table th, table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--border-solid); }
table th { color: var(--text-muted); font-weight: 600; font-size: 12.5px; background: #f8fafc; white-space: nowrap; }
table tbody tr:last-child td { border-bottom: none; }
table tbody tr:hover td { background: #fafbff; }
table.info { border: 1px solid var(--border-solid); border-radius: 12px; overflow: hidden; }
table.info th { width: 120px; color: var(--text-muted); font-weight: 500; }
.mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 12px; word-break: break-all; }
.table-scroll { overflow-x: auto; border: 1px solid var(--border-solid); border-radius: 12px; background: #fff; }
.table-scroll table th:first-child { border-top-left-radius: 12px; }
.table-scroll table th:last-child { border-top-right-radius: 12px; }

.badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.6;
  background: #f1f5f9;
  color: var(--text-muted);
  white-space: nowrap;
}
.badge-pending { background: #fffbeb; color: #b45309; }
.badge-paid, .badge-success { background: #f0fdf4; color: #15803d; }
.badge-failed { background: #fef2f2; color: #dc2626; }
.badge-closed, .badge-canceled, .badge-cancel { background: #f1f5f9; color: #64748b; }

.qr-section { text-align: center; margin-top: 24px; padding: 18px 0 0; border-top: 1px solid var(--border-solid); }
.qr-box {
  display: inline-block;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--border-solid);
  border-radius: 12px;
}
.qr-box img, .qr-box canvas { display: block; }

/* 收款码页 */
.receive-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.receive-card { text-align: center; }
.receive-qr {
  display: inline-flex;
  padding: 16px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--border-solid);
  box-shadow: var(--shadow);
}
.receive-qr canvas, .receive-qr img { display: block; }
.receive-qr-img {
  width: 260px;
  max-width: 80vw;
  height: auto;
  padding: 14px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--border-solid);
  box-shadow: var(--shadow);
}
.receive-qr-loading {
  width: 260px;
  max-width: 80vw;
  padding: 40px 14px;
  color: var(--text-muted);
  font-size: 13px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--border-solid);
}
.receive-url {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
  word-break: break-all;
  background: #f8fafc;
  border: 1px solid var(--border-solid);
  border-radius: 8px;
  padding: 8px 10px;
}

/* 工作台 KPI / 欢迎面板（对齐源项目 dashboard） */
.welcome-panel {
  background: #fff;
  padding: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}
.welcome-panel::after {
  content: '';
  position: absolute;
  right: 0; top: 0;
  height: 100%; width: 280px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, .05));
  pointer-events: none;
}
.welcome-panel .w-title { font-size: 21px; font-weight: 800; color: #0f172a; margin-bottom: 6px; }
.welcome-panel .w-desc { color: var(--text-muted); font-size: 13.5px; }
.welcome-panel .w-icon {
  width: 54px; height: 54px;
  border-radius: 16px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-bottom: 20px; }
.kpi-card {
  background: #fff;
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: transform .25s, box-shadow .25s;
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: 0 12px 25px rgba(15, 23, 42, .07); }
.kpi-info h3 { font-size: 13px; color: var(--text-muted); font-weight: 600; margin-bottom: 8px; }
.kpi-info .val { font-size: 28px; font-weight: 800; color: #0f172a; line-height: 1.1; }
.kpi-icon {
  width: 54px; height: 54px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.icon-blue { background: #eff6ff; color: #3b82f6; }
.icon-green { background: #f0fdf4; color: #10b981; }
.icon-amber { background: #fffbeb; color: #f59e0b; }
.icon-purple { background: #faf5ff; color: #a855f7; }

/* ============ 4. 登录 / 注册（毛玻璃） ============ */
.guest-body {
  background: #1e1b4b url(https://tu.ltyuanfang.cn/api/fengjing.php) no-repeat center center fixed;
  background-size: cover;
  min-height: 100vh;
}
.guest-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  width: 100%;
}
.glass-panel {
  width: 100%;
  max-width: 380px;
  background: rgba(255, 255, 255, .15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 20px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, .18);
  overflow: hidden;
}
.glass-head {
  text-align: center;
  padding: 32px 30px 0;
}
.glass-head .logo {
  width: 60px; height: 60px;
  margin: 0 auto 14px;
  border-radius: 18px;
  background: var(--purple-grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  box-shadow: 0 8px 22px rgba(109, 40, 217, .45);
}
.glass-head h1 { color: #fff; font-size: 23px; font-weight: 800; letter-spacing: 1px; }
.glass-head .slogan { color: rgba(255, 255, 255, .75); font-size: 13px; margin-top: 5px; }
.glass-body { padding: 24px 30px 30px; }
.glass-panel label { color: rgba(255, 255, 255, .85); font-size: 13px; font-weight: 500; margin: 14px 0 7px; }
.glass-panel input[type=text], .glass-panel input[type=password] {
  background: rgba(0, 0, 0, .25);
  border: 1px solid rgba(255, 255, 255, .12);
  color: #fff;
  border-radius: 12px;
}
.glass-panel input::placeholder { color: rgba(255, 255, 255, .55); }
.glass-panel input:focus {
  background: rgba(0, 0, 0, .4);
  border-color: var(--ai-purple);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, .25);
}
.glass-panel .btn {
  width: 100%;
  margin-top: 22px;
  padding: 14px;
  background: var(--purple-grad);
  border-radius: 12px;
  font-size: 15px;
  letter-spacing: 2px;
  box-shadow: 0 4px 15px rgba(139, 92, 246, .4);
}
.glass-panel .btn:hover { background: var(--purple-grad); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(139, 92, 246, .55); }
.glass-panel .hint { text-align: center; color: rgba(255, 255, 255, .8); margin-top: 18px; }
.glass-panel .hint a { color: #fff; font-weight: 700; text-decoration: underline; }
.guest-wrap > .flash { max-width: 380px; width: 100%; margin-bottom: 14px; }

/* ============ 5. 聚合收银台（星益云风格 · 卡片式） ============ */
.public-full { background: #f4f5f9; }
.public-full .guest-wrap { padding: 0; }
.xy-cashier-page {
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: #f4f5f9;
  position: relative;
}
.xy-cashier-card {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(15, 23, 42, .12);
  padding: 28px 26px 30px;
  animation: xy-popIn .45s cubic-bezier(.22, 1, .36, 1);
}
@keyframes xy-popIn {
  0% { opacity: 0; transform: scale(.92) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* 商户头部 */
.xy-merchant-head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.xy-merchant-avatar {
  width: 52px; height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 24px;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(109, 40, 217, .3);
}
.xy-merchant-info { min-width: 0; }
.xy-merchant-name {
  font-size: 19px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.xy-merchant-sub {
  font-size: 12.5px;
  color: #94a3b8;
  margin-top: 3px;
}
.xy-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 20px 0;
}

/* 表单组 */
.xy-form-group { margin-bottom: 18px; }
.xy-form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 10px;
}

/* 大金额输入 */
.xy-amount-input {
  display: flex;
  align-items: center;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 0 16px;
  height: 64px;
  background: #f8fafc;
  transition: all .2s;
}
.xy-amount-input.focus {
  border-color: #8b5cf6;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, .1);
}
.xy-currency {
  font-size: 26px;
  font-weight: 700;
  color: #1e293b;
  margin-right: 6px;
}
.xy-amount-input input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 32px;
  font-weight: 700;
  color: #1e293b;
  width: 100%;
  padding: 0;
  box-shadow: none !important;
  font-family: inherit;
}
.xy-amount-input input::placeholder { color: #cbd5e1; font-weight: 500; }

/* 快捷金额 */
.xy-quick-amounts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.xy-quick-amounts button {
  padding: 11px 0;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all .15s;
}
.xy-quick-amounts button:hover {
  border-color: #8b5cf6;
  color: #6d28d9;
  background: #faf5ff;
}

/* 支付方式 */
.xy-pay-methods {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.xy-pay-method {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: all .15s;
}
.xy-pay-method.active {
  border-color: #8b5cf6;
  background: #faf5ff;
}
.xy-pay-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.xy-pay-alipay {
  background: #1677ff;
  color: #fff;
}
.xy-pay-name {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
}
.xy-pay-check {
  color: #8b5cf6;
  font-size: 16px;
}

/* 备注输入 */
.xy-remark-input {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  font-size: 14px;
  color: #1e293b;
  outline: none;
  transition: all .2s;
  box-sizing: border-box;
}
.xy-remark-input:focus {
  border-color: #8b5cf6;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, .1);
}

/* 错误提示 */
.xy-err {
  display: none;
  margin: 4px 0 14px;
  padding: 10px 14px;
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 10px;
  font-size: 13px;
  text-align: center;
}

/* 提交按钮 */
.xy-submit-btn {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(109, 40, 217, .3);
  transition: all .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.xy-submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(109, 40, 217, .4);
}
.xy-submit-btn:active:not(:disabled) { transform: translateY(0); }
.xy-submit-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  box-shadow: none;
}

.xy-note {
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
  margin-top: 12px;
}

/* 空状态 */
.xy-empty-state {
  text-align: center;
  padding: 30px 10px;
}
.xy-empty-icon {
  width: 72px; height: 72px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #f8fafc;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  color: #94a3b8;
}
.xy-empty-title {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
}
.xy-empty-desc {
  font-size: 13.5px;
  color: #64748b;
  line-height: 1.7;
}

/* 加载遮罩 */
.xy-loading {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .5);
  z-index: 999;
  align-items: center;
  justify-content: center;
}
.xy-loading.show { display: flex; }
.xy-loading-box {
  background: #fff;
  border-radius: 16px;
  padding: 28px 36px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .2);
}
.xy-spinner {
  width: 40px; height: 40px;
  border: 3.5px solid #e2e8f0;
  border-top-color: #8b5cf6;
  border-radius: 50%;
  animation: xy-spin .8s linear infinite;
  margin: 0 auto 14px;
}
@keyframes xy-spin { to { transform: rotate(360deg); } }
.xy-loading-text {
  font-size: 14px;
  color: #475569;
}

/* ============ 6. 支付页 /pay/{no}（紫蓝体系） ============ */
.pay-wrap {
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(160deg, #4f46e5 0%, #6d28d9 58%, #5b21b6 100%);
  position: relative;
  overflow: hidden;
}
.pay-wrap::after {
  content: '';
  position: absolute;
  bottom: -140px; left: -80px;
  width: 340px; height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .16), transparent 70%);
  pointer-events: none;
}
.pay-card {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 22px;
  padding: 30px 24px 26px;
  text-align: center;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(46, 16, 101, .4);
}
.pay-merchant {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f5f3ff;
  color: var(--purple-dark);
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 20px;
  margin-bottom: 14px;
}
.pay-card h1 { font-size: 15px; color: var(--text-muted); margin-bottom: 10px; font-weight: 500; }
.pay-amount { font-size: 42px; font-weight: 800; color: var(--text-main); margin: 4px 0 2px; letter-spacing: -1px; }
.pay-subject { font-size: 13px; color: var(--text-faint); margin-bottom: 22px; }

.btn-alipay {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--purple-grad);
  color: #fff;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(109, 40, 217, .35);
  border: none;
  cursor: pointer;
  transition: transform .12s, opacity .12s, box-shadow .12s;
}
.btn-alipay:hover { transform: translateY(-1px); opacity: .96; color: #fff; }
.btn-alipay .alipay-ico {
  display: inline-block;
  width: 20px; height: 20px;
  border-radius: 5px;
  background: #fff;
  color: var(--purple-dark);
  font-weight: 900;
  font-size: 13px;
  line-height: 20px;
  text-align: center;
  margin-right: 8px;
  vertical-align: -2px;
}
.pay-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 16px;
  color: var(--text-faint);
  font-size: 12px;
}
.pay-divider::before, .pay-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-solid);
}
#qrBox {
  display: inline-block;
  padding: 14px;
  border: 1px solid var(--border-solid);
  border-radius: 16px;
  background: #fff;
}
#qrBox canvas, #qrBox img { display: block; }
.pay-status { font-size: 13.5px; color: var(--text-muted); margin-top: 14px; padding: 8px; min-height: 22px; }
.pay-status.success { color: #15803d; font-weight: 700; font-size: 15px; }
.pay-order { font-size: 11px; color: var(--text-faint); margin-top: 16px; word-break: break-all; }

.pay-success-icon {
  width: 72px; height: 72px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: #f0fdf4;
  display: flex; align-items: center; justify-content: center;
}
.pay-success-icon svg { width: 40px; height: 40px; color: #15803d; }

/* 桌面端显示扫码区，手机端只留支付按钮 */
.pay-qr-desktop { display: none; }
@media (min-width: 720px) { .pay-qr-desktop { display: block; } }

/* ============ 响应式：≤1024px 侧边栏抽屉化 ============ */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    top: 0; bottom: 0; left: calc(var(--sidebar-width) * -1);
    width: var(--sidebar-width);
    box-shadow: 4px 0 24px rgba(0, 0, 0, .12);
  }
  .sidebar.active { left: 0; }
  .sidebar-overlay.active { display: block; opacity: 1; }

  .mobile-menu-btn { display: inline-flex; }
  .collapse-btn { display: none; }
  .breadcrumb { display: none; }
  .sys-status { display: none; }
  .admin-name { display: none; }
  .btn-logout span { display: none; }
  .admin-info { border-left: none; padding-left: 0; }
  .btn-logout { padding: 8px 12px; }
  .top-header { padding: 0 15px; }

  /* 移动端取消折叠态样式影响 */
  .admin-body.sb-collapsed .sidebar { width: var(--sidebar-width); }
  .admin-body.sb-collapsed .logo-text,
  .admin-body.sb-collapsed .nav-label { display: inline; }
  .admin-body.sb-collapsed .nav-item { justify-content: flex-start; padding: 12px 20px; margin: 2px 16px; }
  .admin-body.sb-collapsed .nav-item i { margin-right: 12px; }
  .admin-body.sb-collapsed .logo-area { justify-content: center; gap: 10px; }

  .content-area { padding: 15px; }
}

@media (max-width: 760px) {
  .receive-grid { grid-template-columns: 1fr; }
  .card { padding: 20px 16px; }
  .welcome-panel { padding: 22px 18px; }
  table th, table td { padding: 11px 12px; }
}

/* ============ VIP 授权（充值页 + 工作台状态条） ============ */
.vip-card {
  display: flex; align-items: center; gap: 18px;
  padding: 22px 24px; border-radius: 16px; margin-top: 18px;
  border: 1px solid transparent;
}
.vip-card.is-active {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #fcd34d;
}
.vip-card.is-expired {
  background: #f8fafc; border-color: #e2e8f0;
}
.vip-card-icon {
  width: 54px; height: 54px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.is-active .vip-card-icon { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; box-shadow: 0 6px 16px rgba(245,158,11,.35); }
.is-expired .vip-card-icon { background: #e2e8f0; color: #94a3b8; }
.vip-card-label { font-size: 15px; font-weight: 700; color: #0f172a; }
.vip-card-date { font-size: 18px; font-weight: 700; margin: 4px 0; font-family: ui-monospace, Menlo, Consolas, monospace; }
.is-active .vip-card-date { color: #b45309; }
.is-expired .vip-card-date { color: #94a3b8; font-weight: 600; }
.vip-card-desc { font-size: 13px; color: #64748b; }

.vip-strip {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 10px; padding: 7px 14px; border-radius: 999px;
  background: #fffbeb; border: 1px solid #fcd34d; color: #b45309;
  font-size: 13px; font-weight: 500;
}
.vip-strip.is-off { background: #fef2f2; border-color: #fecaca; color: #dc2626; }
.vip-strip-link {
  display: inline-flex; align-items: center; gap: 5px;
  margin-left: 4px; font-weight: 700; color: inherit; text-decoration: none;
}
.vip-strip-link:hover { text-decoration: underline; }

.badge-vip {
  display: inline-flex; align-items: center; gap: 4px;
  background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff;
  border: none; font-weight: 700; padding: 4px 10px; border-radius: 6px;
}
.badge-expired { background: #f1f5f9; color: #94a3b8; }

/* ============ 仪表盘三列 KPI ============ */
@media (min-width: 900px) {
  .kpi-grid-3 { grid-template-columns: repeat(3, 1fr); }
}
.kpi-sub { font-size: 12px; color: var(--text-muted, #94a3b8); margin-top: 6px; }

/* ============ 专属收款码 ============ */
.receive-single {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 24px 16px 8px;
}
.receive-single .receive-qr { margin: 0 auto; }

/* ============ 系统设置：开关 ============ */
.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 18px 4px; border-bottom: 1px solid #f1f5f9; cursor: pointer;
}
.switch-row:last-child { border-bottom: none; }
.switch-name { font-size: 15px; font-weight: 700; color: #0f172a; display: flex; align-items: center; gap: 10px; }
.switch-desc { font-size: 13px; color: #94a3b8; margin-top: 5px; line-height: 1.5; }
.switch-wrap { position: relative; flex-shrink: 0; }
.switch-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 2; margin: 0; }
.switch-track {
  display: inline-block; width: 48px; height: 26px; border-radius: 999px;
  background: #cbd5e1; position: relative; transition: background .2s;
}
.switch-thumb {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  background: #fff; border-radius: 50%; transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch-input:checked + .switch-track { background: #10b981; }
.switch-input:checked + .switch-track .switch-thumb { transform: translateX(22px); }
@media (max-width: 600px) {
  .vip-card { padding: 18px; gap: 14px; }
  .switch-row { flex-direction: row; align-items: flex-start; }
}

/* ============ 管理端通用：容器 / 表格 / 表单 / 弹窗 ============ */
.layout-container { display: flex; flex-direction: column; gap: 20px; padding-bottom: 30px; }
.page-header-actions {
  display: flex; justify-content: space-between; align-items: center; gap: 15px;
  background: #fff; padding: 20px 25px; border-radius: 16px;
  border: 1px solid #e2e8f0; box-shadow: 0 4px 6px -1px rgba(0,0,0,.02);
}
.card-title { font-size: 18px; font-weight: 700; color: #0f172a; display: flex; align-items: center; gap: 10px; margin: 0; }
.table-card {
  background: #fff; border-radius: 16px; border: 1px solid #e2e8f0;
  overflow: hidden; box-shadow: 0 4px 6px -1px rgba(0,0,0,.02);
}
.table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; }
.data-table th { padding: 16px 20px; background: #f8fafc; color: #475569; font-weight: 600; border-bottom: 2px solid #e2e8f0; white-space: nowrap; }
.data-table td { padding: 16px 20px; border-bottom: 1px solid #f1f5f9; color: #1e293b; vertical-align: middle; white-space: nowrap; }
.data-table tr:hover td { background: #f8fafc; }
.data-table .mono, .mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.btn-quick-day {
  background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe;
  padding: 6px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.btn-quick-day:hover { background: #dbeafe; }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; color: #475569; }
.form-control {
  width: 100%; padding: 12px 14px; box-sizing: border-box;
  border: 1px solid #cbd5e1; border-radius: 10px; font-size: 14px;
  color: #1e293b; outline: none; background: #f8fafc;
}
.form-control:focus { border-color: #3b82f6; background: #fff; box-shadow: 0 0 0 3px rgba(59,130,246,.1); }
.btn-submit {
  border: none; padding: 12px 22px; border-radius: 10px; font-weight: 600;
  cursor: pointer; font-size: 15px; display: inline-flex; align-items: center; gap: 8px;
  background: #3b82f6; color: #fff;
}
.btn-submit:hover { filter: brightness(.93); }

.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(15,23,42,.4); backdrop-filter: blur(4px);
  align-items: center; justify-content: center; opacity: 0; transition: opacity .3s;
}
.modal-overlay.show { display: flex; opacity: 1; }
.modal-box {
  background: #fff; width: 100%; max-width: 520px; margin: 20px;
  border-radius: 20px; box-shadow: 0 25px 50px -12px rgba(0,0,0,.25);
  transform: translateY(20px) scale(.95); transition: all .3s; overflow: hidden;
}
.modal-overlay.show .modal-box { transform: translateY(0) scale(1); }
.modal-header {
  padding: 22px 25px; border-bottom: 1px solid #e2e8f0;
  display: flex; justify-content: space-between; align-items: center; background: #f8fafc;
}
.modal-title { font-size: 17px; font-weight: 700; color: #1e293b; display: flex; align-items: center; gap: 8px; }
.close-btn { background: none; border: none; font-size: 20px; color: #94a3b8; cursor: pointer; }
.close-btn:hover { color: #ef4444; }
.modal-body { padding: 25px; max-height: 60vh; overflow-y: auto; }
@media (max-width: 768px) {
  .page-header-actions { flex-direction: column; align-items: flex-start; padding: 18px 16px; }
  .data-table th, .data-table td { padding: 12px 12px; }
  .hide-on-mobile { display: none; }
}

/* ===== 支付确认闭环（待确认到账） ===== */
.badge-unconfirmed { background: #fff7ed; color: #c2410c; }
.row-need-confirm { background: #fffaf2; }
.row-need-confirm:hover { background: #fff4e6 !important; }
.row-actions { white-space: nowrap; }
.inline-form { display: inline; margin-left: 8px; }
.btn-mini-purple {
  display: inline-flex; align-items: center; gap: 4px;
  border: none; cursor: pointer;
  padding: 5px 10px; border-radius: 8px;
  background: #7c3aed; color: #fff; font-size: 12.5px; font-weight: 600;
  transition: background .15s;
}
.btn-mini-purple:hover { background: #6d28d9; }
.confirm-box {
  margin-top: 18px; padding: 20px;
  background: #fffaf2; border: 1px solid #fed7aa; border-radius: 14px;
  text-align: center;
}
/* 付款页「我已完成支付」按钮 */
.btn-claim {
  display: block; width: 100%;
  margin-top: 12px; padding: 12px;
  background: #fff; color: #7c3aed;
  border: 1.5px solid #c4b5fd; border-radius: 14px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: all .15s;
}
.btn-claim:hover { background: #f5f3ff; border-color: #7c3aed; }
.btn-claim:disabled { opacity: .65; cursor: default; }

/* ============ 7. 聚合收款码卡片（receive.php） ============ */
.rcode-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0 8px;
}
.rcode-card {
  width: 360px;
  max-width: 100%;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(124, 58, 237, 0.18), 0 2px 8px rgba(0,0,0,0.06);
  background: #fff;
}
.rcode-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 22px 16px;
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  color: #fff;
}
.rcode-logo {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
}
.rcode-name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.2;
}
.rcode-sub {
  font-size: 11px;
  opacity: 0.8;
  margin-top: 2px;
  letter-spacing: 0.3px;
}
.rcode-body {
  padding: 22px 22px 18px;
  text-align: center;
}
.rcode-qr-area {
  width: 280px;
  height: 280px;
  margin: 0 auto;
  padding: 16px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid #f1f5f9;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}
#qrMine {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#qrMine canvas {
  max-width: 100% !important;
  max-height: 100% !important;
  width: 100% !important;
  height: 100% !important;
  display: block;
}
.rcode-qr-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.rcode-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 13px;
  gap: 12px;
}
.rcode-spinner {
  width: 34px; height: 34px;
  border: 3px solid #ede9fe;
  border-top-color: #7c3aed;
  border-radius: 50%;
  animation: rcode-spin 0.8s linear infinite;
}
@keyframes rcode-spin { to { transform: rotate(360deg); } }
.rcode-amount-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 14px;
  color: #475569;
  font-weight: 600;
}
.rcode-pay-tags {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}
.rcode-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.rcode-tag.alipay {
  background: #e6f4ff;
  color: #1677ff;
}
.rcode-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 22px 20px;
  background: #fafafa;
  border-top: 1px solid #f1f5f9;
}
.rcode-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
}
.rcode-step-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  display: flex; align-items: center; justify-content: center;
  color: #7c3aed;
}
.rcode-arrow {
  color: #cbd5e1;
  flex-shrink: 0;
}
.rcode-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
  justify-content: center;
}
.rcode-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
@media (max-width: 420px) {
  .rcode-card { width: 100%; border-radius: 16px; }
  .rcode-qr-area { width: 220px; height: 220px; }
}
