:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --bg: #f6f7fb;
  --card: #fff;
  --border: #e8eaf0;
  --text: #1f2430;
  --text-2: #5b6475;
  --text-3: #98a2b3;
  --green: #138a4b;
  --red: #d13a3a;
  --amber: #b8860b;
  --shadow: 0 2px 12px rgba(20, 30, 60, .05);
  --radius: 14px;
}

* { box-sizing: border-box; }
[hidden], .hidden { display: none !important; }
body {
  margin: 0;
  font-family: -apple-system, "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
button { font-family: inherit; cursor: pointer; }

/* ---------- 登录 ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #eef2ff 0%, #f6f7fb 50%, #fdf2f8 100%);
}
.login-box {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px;
  box-shadow: 0 20px 60px rgba(49, 46, 129, .12);
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.brand-mark {
  width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0;
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: #fff; font-weight: 800; font-size: 24px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(99, 102, 241, .35);
}
.brand-title { font-size: 19px; font-weight: 700; }
.brand-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.login-box h1 { font-size: 26px; margin: 0 0 6px; }
.login-desc { color: var(--text-2); font-size: 13px; margin: 0 0 26px; line-height: 1.6; }
.field-label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin: 16px 0 7px; }
.field-error { color: var(--red); font-size: 12px; min-height: 18px; margin-top: 8px; }
.req { color: var(--red); }
.field-note { font-size: 11px; color: var(--text-3); margin-top: 6px; line-height: 1.5; }
.captcha-row { display: flex; align-items: center; gap: 10px; }
.captcha-input { flex: 1; min-width: 0; letter-spacing: 2px; text-transform: uppercase; }
.captcha-img {
  width: 132px; height: 46px; flex-shrink: 0; cursor: pointer;
  border: 1px solid #d7dbe5; border-radius: 10px; background: #f5f7fc;
  transition: border-color .2s, box-shadow .2s;
}
.captcha-img:hover { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .10); }
.login-foot { text-align: center; color: var(--text-3); font-size: 11px; margin-top: 20px; line-height: 1.6; }
code { background: #f1f3f9; padding: 1px 5px; border-radius: 4px; font-size: 11px; }

.input {
  width: 100%; padding: 12px 14px; border: 1px solid #d7dbe5; border-radius: 10px;
  font-size: 14px; outline: none; transition: border .2s, box-shadow .2s; background: #fff; color: var(--text);
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); }
textarea.input { resize: vertical; min-height: 72px; line-height: 1.6; }
select.input { cursor: pointer; }

.btn {
  border: 0; border-radius: 10px; padding: 11px 18px; font-size: 14px; font-weight: 600;
  transition: transform .12s, opacity .2s, background .2s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 13px; font-size: 12px; border-radius: 8px; }
.btn-outline { background: #fff; color: var(--text-2); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-soft { background: #eef2ff; color: var(--primary); }
.btn-danger-soft { background: #fdeaea; color: var(--red); }
.btn-green-soft { background: #e7f8ef; color: var(--green); }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex-shrink: 0;
  background: linear-gradient(180deg, #ffffff 0%, #fdfdff 58%, #f8f9ff 100%);
  border-right: 1px solid var(--border);
  box-shadow: 2px 0 18px rgba(30, 41, 90, .035);
  display: flex; flex-direction: column; padding: 18px 12px 14px;
  position: sticky; top: 0; height: 100vh; overflow: hidden;
}
/* 导航区独立滚动：品牌与底部用户信息始终固定可见 */
.side-nav {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: #d9dcea transparent;
}
.side-nav::-webkit-scrollbar { width: 6px; }
.side-nav::-webkit-scrollbar-track { background: transparent; }
.side-nav::-webkit-scrollbar-thumb { background: #d9dcea; border-radius: 6px; }
.side-nav::-webkit-scrollbar-thumb:hover { background: #b9c0d8; }

/* 品牌区 */
.side-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 6px 10px 18px; margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.side-brand .brand-mark {
  width: 40px; height: 40px; border-radius: 12px; font-size: 19px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 6px 16px rgba(99, 102, 241, .32);
}
.side-brand .brand-title { font-size: 15px; letter-spacing: .3px; }
.side-brand .brand-sub { font-size: 11px; }

/* 分组标题：文字 + 渐隐细线 */
.side-group-title {
  display: flex; align-items: center; gap: 9px;
  font-size: 10px; font-weight: 700; color: var(--text-3);
  letter-spacing: 1.4px; padding: 9px 12px 5px; text-transform: uppercase;
}
.side-group-title::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}

/* 导航项 */
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 6px 11px; border: 0; border-radius: 10px; background: transparent;
  color: var(--text-2); font-size: 13px; font-weight: 500; text-align: left;
  transition: background .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.nav-item > span:last-child { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item::before {
  content: ''; position: absolute; left: 0; top: 50%;
  width: 3px; height: 0; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #6366f1, #8b5cf6);
  transform: translateY(-50%); transition: height .22s ease;
}
.nav-icon {
  width: 28px; height: 28px; flex-shrink: 0; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #f3f4f9; color: #8b93a7;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.nav-icon svg { width: 16px; height: 16px; }
.nav-item:hover { background: #f5f6ff; color: var(--primary); transform: translateX(2px); }
.nav-item:hover .nav-icon { background: #e8ebff; color: var(--primary); }
.nav-item.active {
  background: linear-gradient(90deg, #eef0ff 0%, #f7f5ff 100%);
  color: var(--primary); font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, .08);
}
.nav-item.active::before { height: 20px; }
.nav-item.active .nav-icon {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff; box-shadow: 0 4px 10px rgba(99, 102, 241, .35);
}
.nav-item:active { transform: scale(.985); }

/* 底部用户区 */
.side-footer { flex-shrink: 0; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.admin-badge {
  display: flex; align-items: center; gap: 10px; padding: 10px;
  background: #f7f8fd; border: 1px solid #eef0f7; border-radius: 12px;
}
.avatar {
  position: relative;
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; box-shadow: 0 4px 10px rgba(99, 102, 241, .28);
}
.avatar::after {
  content: ''; position: absolute; right: -1px; bottom: -1px;
  width: 10px; height: 10px; border-radius: 50%;
  background: #22c55e; border: 2px solid #f7f8fd;
}
.admin-name { font-size: 13px; font-weight: 600; }
.admin-role { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.side-footer-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 2px 0; }
.side-link {
  border: 1px solid transparent; background: transparent; color: var(--text-3);
  font-size: 11px; padding: 4px 8px; border-radius: 7px; text-decoration: none;
  transition: background .18s, color .18s, border-color .18s;
}
.side-link:hover { background: #eef0ff; color: var(--primary); border-color: #e3e6ff; }

.main { flex: 1; min-width: 0; }
.topbar {
  background: #fff; border-bottom: 1px solid var(--border); padding: 20px 30px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  position: sticky; top: 0; z-index: 10;
}
.page-title { font-size: 20px; font-weight: 700; }
.page-desc { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.topbar-actions { display: flex; gap: 8px; }
.content { padding: 24px 30px 60px; }

/* ---------- 通用组件 ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-pad { padding: 20px; }
.mt16 { margin-top: 16px; }
.mt20 { margin-top: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) {
  .sidebar { width: 100%; height: auto; position: static; padding: 14px; }
  .side-nav { overflow: visible; }
  .app { flex-direction: column; }
  .nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .nav-item { padding: 8px 10px; font-size: 12px; }
  .nav-item:hover { transform: none; }
  .side-group-title { padding-top: 14px; }
  .side-footer { margin-top: 14px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
}

.stat-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow);
}
.stat-label { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 7px; }
.stat-label svg { width: 15px; height: 15px; color: var(--primary); }
.stat-value { font-size: 26px; font-weight: 700; margin: 10px 0 5px; letter-spacing: -.5px; }
.stat-sub { font-size: 11px; color: var(--text-3); }
.stat-accent { height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--primary), #a78bfa); margin-top: 12px; opacity: .7; }

.section-title { font-size: 15px; font-weight: 700; }
.section-sub { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.filter-bar .input { width: auto; min-width: 180px; }
.search-input { flex: 1; min-width: 200px; max-width: 340px; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; padding: 12px 16px; background: #fafbfc; color: var(--text-2);
  font-size: 11px; font-weight: 700; white-space: nowrap; border-bottom: 1px solid var(--border);
}
td { padding: 12px 16px; border-bottom: 1px solid #f1f2f6; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #fafbff; }
.td-main { font-weight: 600; color: var(--text); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: var(--text-2); }
.amount { font-weight: 600; white-space: nowrap; }
.amount.income { color: var(--green); }
.amount.expense { color: var(--text); }

.pill { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.pill.green { background: #e7f8ef; color: var(--green); }
.pill.amber { background: #fff5e0; color: var(--amber); }
.pill.red { background: #fdeaea; color: var(--red); }
.pill.primary { background: #eef2ff; color: var(--primary); }
.pill.gray { background: #f1f3f7; color: var(--text-2); }

.empty { padding: 48px 20px; text-align: center; color: var(--text-3); font-size: 13px; }
.loading { padding: 40px; text-align: center; color: var(--text-3); }

.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.pagination button {
  border: 1px solid var(--border); background: #fff; border-radius: 7px; padding: 5px 11px;
  font-size: 12px; color: var(--text-2);
}
.pagination button:disabled { opacity: .4; cursor: not-allowed; }
.pagination button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }

/* 图表 */
.chart-card { padding: 20px; }
.chart-bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 20px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart-bar { width: 100%; max-width: 44px; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, #818cf8, #4f46e5); min-height: 3px; transition: height .4s; }
.chart-label { font-size: 10px; color: var(--text-3); white-space: nowrap; }
.chart-value { font-size: 10px; color: var(--text-2); font-weight: 600; }
.legend { display: flex; gap: 14px; font-size: 11px; color: var(--text-2); margin-top: 12px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }

.list-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.list-row:last-child { border-bottom: 0; }

.level-card { border: 1px solid var(--border); border-radius: 12px; padding: 16px; background: #fff; }
.level-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 12px; }
.level-name { font-size: 16px; font-weight: 700; }
.level-threshold { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.info-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 12px; }
.info-label { color: var(--text-3); }
.info-value { font-weight: 600; }
.benefit-list { display: flex; flex-direction: column; gap: 5px; }
.benefit { font-size: 11px; color: var(--text-2); display: flex; align-items: center; gap: 5px; }
.benefit svg { width: 12px; height: 12px; color: var(--green); }

/* ---------- 弹窗 / 提示 ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 20, 40, .45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: #fff; border-radius: 16px; padding: 26px; width: 100%; max-width: 480px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .2); max-height: 90vh; overflow-y: auto;
}
.modal h2 { font-size: 18px; margin: 0 0 6px; }
.modal-sub { color: var(--text-3); font-size: 12px; margin: 0 0 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }

#toast-root { position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #1f2430; color: #fff; padding: 11px 16px; border-radius: 10px;
  font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: toastIn .2s ease;
}
.toast.error { background: #b91c1c; }
.toast.success { background: #138a4b; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.spinner {
  display: inline-block; width: 12px; height: 12px; border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 用户列表：注册主体类型标签 */
.subject-tag {
  display: inline-block; margin-top: 4px; font-size: 11px; line-height: 1.5;
  padding: 1px 8px; border-radius: 20px; border: 1px solid var(--border);
  color: var(--text-2); background: #fafbfd;
}
.subject-tag.company { background: #eef2ff; color: var(--primary); border-color: transparent; }
.subject-tag.person { background: #e7f8ef; color: var(--green); border-color: transparent; }

/* 列表勾选 */
.sel-col { width: 32px; text-align: center; padding-left: 6px !important; padding-right: 6px !important; }
.sel-col input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; accent-color: var(--primary); vertical-align: middle; }
#clear-selection.has-selection { border-color: var(--primary); color: var(--primary); }
.sel-badge {
  display: inline-block; min-width: 17px; padding: 0 5px; margin-left: 3px; border-radius: 9px;
  background: var(--primary); color: #fff; font-size: 10px; line-height: 17px; text-align: center;
}

/* 用户管理：紧凑列表（粘性表头 / 首列，分组单元格，浮动操作菜单） */
.users-table { table-layout: fixed; min-width: 970px; }
.users-table th { position: sticky; top: 0; z-index: 3; padding: 10px 8px; }
.users-table td { padding: 9px 8px; line-height: 1.4; }
.users-table thead th:nth-child(2),
.users-table tbody td:nth-child(2) { position: sticky; left: 32px; background: #fff; box-shadow: 1px 0 0 var(--border); }
.users-table thead th:nth-child(2) { z-index: 5; background: #fafbfc; }
.users-table thead th.sel-col,
.users-table tbody td.sel-col { position: sticky; left: 0; z-index: 4; background: #fff; }
.users-table thead th.sel-col { z-index: 6; background: #fafbfc; }
.users-table thead th:last-child,
.users-table tbody td:last-child { position: sticky; right: 0; background: #fff; box-shadow: -1px 0 0 var(--border); }
.users-table thead th:last-child { z-index: 5; background: #fafbfc; }
.users-table tbody tr:hover td.sel-col,
.users-table tbody tr:hover td:nth-child(2),
.users-table tbody tr:hover td:last-child { background: #fafbff; }
.user-cell { display: flex; align-items: center; gap: 9px; min-width: 0; }
.user-avatar {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px; display: flex;
  align-items: center; justify-content: center; font-size: 14px; font-weight: 700;
  color: var(--primary); background: #eef2ff;
}
.user-avatar.company { background: #ede9fe; color: #6d28d9; }
.user-meta { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta .uid { display: block; margin-top: 1px; font-size: 10px; }
.subject-tag.compact { display: block; max-width: 100%; margin-top: 3px; padding: 0 6px; line-height: 18px; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.cell-main { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; }
.cell-sub { display: block; max-width: 100%; font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-stack .pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.agent-name { max-width: 90px; }
.date-cell { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--text); white-space: nowrap; }
.date-cell .mono { font-size: 10px; }
.row-actions { display: flex; align-items: center; gap: 4px; position: relative; }
.row-actions .btn { flex: 0 0 auto; white-space: nowrap; padding: 5px 8px; font-size: 11px; }
.btn.btn-icon { min-width: 26px; padding: 5px 5px; font-weight: 700; letter-spacing: 1px; line-height: 1; }
.row-menu { display: none; }
.row-menu-float {
  position: fixed; z-index: 150; min-width: 148px; padding: 5px; background: #fff;
  border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 14px 36px rgba(15,20,40,.18);
}
.row-menu-float button {
  display: block; width: 100%; text-align: left; border: 0; background: none;
  border-radius: 6px; padding: 8px 10px; font-size: 12px; color: var(--text); white-space: nowrap;
}
.row-menu-float button:hover { background: #f4f6ff; color: var(--primary); }
.row-menu-float button.danger { color: var(--red); }
.row-menu-float button.danger:hover { background: #fdeaea; }
@media (max-width: 900px) { .users-table { min-width: 970px; } }

/* 离线授权：工作流程卡片 */
.offline-flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 6px; }
.flow-step {
  background: #fafbfd; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; min-width: 0;
}
.flow-step b { display: block; font-size: 12px; color: var(--primary); margin-bottom: 6px; }
.flow-step span { display: block; font-size: 11px; line-height: 1.7; color: var(--text-3); }
@media (max-width: 1100px) { .offline-flow { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .offline-flow { grid-template-columns: 1fr; } }

/* 表格操作列：按钮换行、避免撑破 */
.td-actions { white-space: nowrap; }
.td-actions .btn { margin: 2px 0; }
textarea.input { resize: vertical; line-height: 1.5; }

/* ==================== 支付接口 ==================== */
/* 回调地址 */
.pay-url-grid { display: flex; flex-direction: column; gap: 8px; }
.pay-url-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: #fafbfd; border: 1px solid var(--border); border-radius: 10px;
}
.pay-url-label { flex: 0 0 150px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.pay-url-val {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 6px 9px;
  font-size: 11px; color: var(--text);
}
.pay-url-row .btn { flex: 0 0 auto; }
.pay-hint-line {
  margin-top: 12px; font-size: 11px; line-height: 1.7; color: var(--text-3);
  background: #f7f8ff; border-left: 3px solid var(--primary); padding: 8px 12px; border-radius: 0 8px 8px 0;
}
@media (max-width: 700px) {
  .pay-url-row { flex-wrap: wrap; }
  .pay-url-label { flex-basis: 100%; }
}

/* 全局设置 */
.pay-global-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.pay-field { min-width: 0; }
.pay-field-wide { grid-column: 1 / -1; }
.pay-field-label { display: block; font-size: 12px; font-weight: 600; color: #374151; margin: 0 0 6px; }
.pay-field-hint { font-size: 10px; color: var(--amber); line-height: 1.6; margin-top: 5px; }
@media (max-width: 760px) { .pay-global-grid { grid-template-columns: 1fr; } }

/* 开关 */
.pay-switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.pay-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.pay-switch-track {
  position: relative; flex: 0 0 auto; width: 38px; height: 21px; border-radius: 20px;
  background: #cfd4e0; transition: background .2s;
}
.pay-switch-track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s;
}
.pay-switch input:checked + .pay-switch-track { background: var(--primary); }
.pay-switch input:checked + .pay-switch-track::after { transform: translateX(17px); }
.pay-switch input:focus-visible + .pay-switch-track { box-shadow: 0 0 0 3px rgba(79,70,229,.25); }
.pay-switch-txt { font-size: 12px; font-weight: 600; color: var(--text-2); }
.pay-switch-lg { padding: 9px 12px; background: #fafbfd; border: 1px solid var(--border); border-radius: 10px; }

/* 渠道卡片 */
.pay-ch-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pay-ch-card {
  background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 18px;
  box-shadow: var(--shadow); opacity: .72; transition: opacity .2s, border-color .2s; min-width: 0;
}
.pay-ch-card.on { opacity: 1; border-color: #c9c5f5; }
.pay-ch-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pay-ch-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.pay-ch-name { font-size: 15px; font-weight: 700; }
.pay-ch-code { color: var(--text-3); }
.pay-ch-desc { font-size: 12px; color: var(--text-2); line-height: 1.7; margin: 10px 0 14px; }
.pay-ch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 14px; }
.pay-ch-grid .pay-field-full { grid-column: 1 / -1; }
.pay-tips {
  margin: 14px 0 0; padding: 10px 12px 10px 28px; border-radius: 8px;
  background: #f7f8ff; font-size: 11px; line-height: 1.8; color: var(--text-2);
}
.pay-tips li { margin: 2px 0; }
.pay-ch-foot {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border);
}
.pay-ch-foot-note { font-size: 10px; color: var(--text-3); line-height: 1.5; flex: 1; min-width: 140px; }
.pay-check { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.pay-check input { accent-color: var(--primary); width: 15px; height: 15px; }
.pay-save-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 16px; padding: 14px 18px; background: #eef2ff; border: 1px solid #dcd9fb; border-radius: 12px;
  font-size: 12px; color: var(--text-2);
}
@media (max-width: 1100px) { .pay-ch-list { grid-template-columns: 1fr; } }
@media (max-width: 620px) { .pay-ch-grid { grid-template-columns: 1fr; } }

/* 连接测试 / 订单详情弹窗 */
.pay-test-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.pay-test-sub { font-size: 11px; color: var(--text-3); }
.pay-test-list { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.pay-test-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; font-size: 12px;
  border-bottom: 1px solid #f1f2f6;
}
.pay-test-row:last-child { border-bottom: 0; }
.pay-test-dot {
  flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%; font-size: 11px;
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700;
}
.pay-test-dot.ok { background: var(--green); }
.pay-test-dot.bad { background: var(--amber); }
.pay-test-label { flex: 0 0 42%; font-weight: 600; }
.pay-test-detail { flex: 1; color: var(--text-3); word-break: break-all; }
.pay-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.pay-detail-grid .info-row { border-bottom: 1px solid #f4f5f9; }
.pay-detail-val { max-width: 62%; word-break: break-all; text-align: right; font-weight: 600; }
.pay-raw {
  max-height: 150px; overflow: auto; background: #1f2430; color: #d7dbea; border-radius: 8px;
  padding: 12px; font-size: 10px; line-height: 1.6; white-space: pre-wrap; word-break: break-all;
}
@media (max-width: 520px) { .pay-detail-grid { grid-template-columns: 1fr; } }

/* ---------- 支付接口：充值订单入口引导 ---------- */
.pay-entry {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; margin-bottom: 16px;
  background: linear-gradient(100deg, #f1f0ff 0%, #f8f9ff 58%, #fff 100%);
  border: 1px solid #e0def8; border-radius: 12px;
}
.pay-entry-icon {
  flex: 0 0 42px; width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: #e7e5ff; color: var(--primary);
}
.pay-entry-icon svg { width: 22px; height: 22px; }
.pay-entry-txt { flex: 1; min-width: 0; }
.pay-entry-title { font-size: 14px; font-weight: 700; color: var(--text); }
.pay-entry-sub { font-size: 12px; color: var(--text-2); line-height: 1.6; margin-top: 4px; }
.pay-entry .btn { flex: 0 0 auto; }
@media (max-width: 720px) {
  .pay-entry { flex-wrap: wrap; }
  .pay-entry .btn { width: 100%; }
}

/* ---------- 充值订单（营销与财务 · 独立页面） ---------- */
.rch-filter {
  background: #fafbfe; border: 1px solid var(--border);
  border-radius: 12px; padding: 12px; margin-bottom: 16px;
}
/* 收紧控件宽度，让「筛选 / 重置」与所有条件保持在同一行 */
.rch-filter .input { min-width: 140px; }
.rch-filter .search-input { max-width: 240px; }
.rch-filter input[type="date"] { min-width: 150px; }
.rch-filter .btn { flex: 0 0 auto; }
.rch-stats .stat-card { border-color: #eceafc; }
.rch-stats .stat-label svg { color: var(--primary); }

/* 固定列宽：内容不再参与宽度计算，彻底杜绝中文逐字竖排 */
.recharge-table { table-layout: fixed; min-width: 1040px; }
.recharge-table th {
  padding: 11px 12px; font-size: 11px; letter-spacing: .2px;
  white-space: nowrap; background: #f8f9fc;
}
.recharge-table td { padding: 12px; vertical-align: middle; white-space: nowrap; }
.recharge-table th:first-child, .recharge-table td:first-child { padding-left: 16px; }
.recharge-table th:last-child,  .recharge-table td:last-child  { padding-right: 16px; }
.recharge-table tbody tr:nth-child(even) td { background: #fcfcfe; }
.recharge-table tbody tr:hover td { background: #f6f5ff; }

/* 双行单元格：主信息加粗，副信息淡色，全部单行省略 + title 看全称 */
.rch-no, .rch-name, .rch-trade, .rch-oid, .rch-amount {
  display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rch-no { font-size: 11px; font-weight: 600; color: var(--text); }
.rch-name { font-size: 13px; font-weight: 700; color: var(--text); }
.rch-trade { font-size: 11px; color: var(--text-2); }
.rch-amount { font-size: 14px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.rch-sub {
  font-size: 11px; color: var(--text-3); margin-top: 4px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rch-account-sub { display: flex; align-items: center; gap: 6px; margin-top: 5px; min-width: 0; }
.rch-oid { flex: 1; min-width: 0; font-size: 10px; }
.rch-account-sub .pill { flex: 0 0 auto; padding: 2px 7px; font-size: 10px; }
.rch-muted { font-size: 12px; color: var(--text-3); }
.rch-time { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 渠道：彩色小标签代替长名称，避免「测试通道（即时到账）」被折成竖排 */
.rch-ch {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 4px 9px; border-radius: 7px; font-size: 11px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: #f1f3f7; color: var(--text-2);
}
.rch-ch i { flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.rch-ch-epay    { background: #eef2ff; color: #4f46e5; }
.rch-ch-alipay  { background: #e8f4ff; color: #1677cc; }
.rch-ch-wxpay   { background: #e7f8ef; color: #138a4b; }
.rch-ch-offline { background: #fff5e0; color: #b8860b; }
.rch-ch-test    { background: #f3eaff; color: #7c3aed; }

.rch-actions { gap: 4px; }
.rch-actions .btn { padding: 4px 7px; font-size: 10px; white-space: nowrap; }
@media (max-width: 900px) { .rch-filter .search-input { max-width: none; } }
