/* ============ 分账收款平台 公共样式 ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
:root {
  --primary: #1677ff;
  --green: #00b578;
  --blue: #1677ff;
  --orange: #ff8f1f;
  --red: #fa5151;
  --bg: #f5f6fa;
  --card: #ffffff;
  --text: #1f2329;
  --muted: #86909c;
  --border: #e5e6eb;
  --radius: 12px;
}
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.container { max-width: 960px; margin: 0 auto; padding: 16px 12px 60px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* 顶栏 */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; font-size: 17px; }
.brand small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.top-actions a { text-decoration: none; }

/* Tab 导航 */
.tabs {
  display: flex; gap: 6px; padding: 10px 12px; overflow-x: auto;
  background: #fff; border-bottom: 1px solid var(--border);
  position: sticky; top: 49px; z-index: 10;
}
.tabs button {
  border: none; background: #f2f3f5; color: var(--text);
  padding: 7px 14px; border-radius: 999px; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.tabs button.active { background: var(--primary); color: #fff; }

/* 卡片 */
.card {
  background: var(--card); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.card h3 { font-size: 16px; margin-bottom: 12px; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat {
  background: #fff; border-radius: var(--radius); padding: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 22px; font-weight: 700; margin-top: 4px; }

/* 提示条 */
.banner { background: #fff7e6; border: 1px solid #ffd591; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; font-size: 13px; color: #ad6800; }
.banner div + div { margin-top: 4px; }
.banner-info { background: #e8f3ff; border-color: #91caff; color: #0958d9; }

/* 按钮 */
.btn {
  display: inline-block; border: 1px solid var(--border); background: #fff; color: var(--text);
  border-radius: 8px; padding: 8px 16px; font-size: 14px; cursor: pointer; text-decoration: none;
  transition: opacity .15s; line-height: 1.5;
}
.btn:hover { opacity: .85; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 4px 10px; font-size: 13px; border-radius: 6px; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-col { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }

/* 表单 */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 12px; font-size: 15px; font-family: inherit; background: #fff; color: var(--text);
}
.field textarea { min-height: 90px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.5; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th, table.tbl td { padding: 9px 8px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
table.tbl th { color: var(--muted); font-weight: 500; font-size: 13px; }
table.tbl td.wrap, table.tbl th.wrap { white-space: normal; }

/* 徽标 */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: #f2f3f5; color: var(--muted); }
.badge.b-green { background: #e8f8f2; color: var(--green); }
.badge.b-blue { background: #e8f3ff; color: var(--blue); }
.badge.b-orange { background: #fff3e6; color: var(--orange); }
.badge.b-red { background: #ffeded; color: var(--red); }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip {
  border: 1px solid var(--border); background: #fff; border-radius: 8px;
  padding: 6px 12px; cursor: pointer; font-size: 14px;
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
}
.chip small { color: var(--muted); font-size: 12px; }
.chip.active { border-color: var(--primary); background: #e8f3ff; color: var(--primary); }

/* 弹窗 */
.modal-wrap {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal {
  background: #fff; border-radius: var(--radius); max-width: 720px; width: 100%;
  max-height: 85vh; overflow-y: auto; padding: 18px;
}
.modal h3 { margin-bottom: 12px; }
.modal .close-x { float: right; border: none; background: none; font-size: 20px; cursor: pointer; color: var(--muted); }

/* Toast */
.toast {
  position: fixed; left: 50%; top: 20px; transform: translateX(-50%) translateY(-80px);
  background: #333; color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 14px; z-index: 200; transition: transform .25s; max-width: 86vw;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.ok { background: rgba(0,181,120,.95); }
.toast.err { background: rgba(250,81,81,.95); }

/* 加载 */
.loading { text-align: center; color: var(--muted); padding: 40px 0; }

/* ============ 收款页 ============ */
.pay-container { max-width: 480px; }
.pay-card { padding: 24px 20px; }
.pay-shop { font-size: 16px; color: var(--muted); margin-bottom: 6px; }
.pay-amount { font-size: 40px; font-weight: 700; margin: 8px 0; text-align: center; }
.pay-status { text-align: center; margin-bottom: 8px; }
.qr-box { display: flex; justify-content: center; padding: 12px 0; }
.qr-box img { width: 240px; height: 240px; border-radius: 8px; border: 1px solid var(--border); }
.pay-tip { text-align: center; color: var(--orange); font-size: 13px; padding: 6px 0; }
.pay-ok {
  width: 64px; height: 64px; border-radius: 50%; background: var(--green); color: #fff;
  font-size: 34px; display: flex; align-items: center; justify-content: center;
  margin: 8px auto 12px;
}
.pay-split { background: #f7f8fa; border-radius: 8px; padding: 10px 14px; font-size: 14px; color: var(--muted); margin-top: 10px; text-align: center; }
.amount-chip { min-width: 96px; padding: 10px 14px; }
.amount-chip b { font-size: 18px; }

/* 二维码展示（管理端） */
.qr-result { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.qr-result img { width: 200px; height: 200px; border: 1px solid var(--border); border-radius: 8px; }
.link-list { flex: 1; min-width: 240px; }
.link-item { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.link-item .txt { flex: 1; word-break: break-all; color: var(--muted); background: #f7f8fa; padding: 6px 8px; border-radius: 6px; }

pre.code {
  background: #f7f8fa; border-radius: 8px; padding: 10px; font-size: 12px;
  overflow-x: auto; white-space: pre-wrap; word-break: break-all; max-height: 200px; overflow-y: auto;
  font-family: ui-monospace, Consolas, monospace;
}
