:root {
  --bg: #f4f6fb; --card: #ffffff; --ink: #1c2333; --sub: #68718a;
  --brand: #3b6cf6; --brand-ink: #ffffff; --line: #e6e9f2;
  --ok: #16a34a; --warn: #d97706; --bad: #e11d48;
  --shadow: 0 1px 2px rgba(20,30,60,.05), 0 4px 14px rgba(20,30,60,.06);
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.65 -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
a { color: var(--brand); text-decoration: none; }
.wrap { max-width: 980px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow); overflow: hidden; }
h1 { font-size: 22px; letter-spacing: .3px; }
h2 { font-size: 16.5px; margin-bottom: 10px; }
h3 { font-size: 15px; }
.muted { color: var(--sub); font-size: 12.5px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

input, select, textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; background: #fff; color: var(--ink); min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid #c7d7fe; border-color: var(--brand); }
label { font-size: 12.5px; color: var(--sub); display: block; margin: 8px 0 4px; }

.btn { display: inline-block; padding: 9px 18px; border-radius: 9px; border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); font-size: 14px; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: #fff; color: var(--brand); }
.btn.danger { background: #fff; color: var(--bad); border-color: #f3b3c0; }
.btn.mini { padding: 4px 11px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* 表格：防溢出，长文本省略号 */
table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
th, td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow: hidden; text-overflow: ellipsis; }
td { word-break: break-all; }
td.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; word-break: normal; }
th { color: var(--sub); font-weight: 600; white-space: nowrap; }
@media (max-width: 760px) {
  .tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tbl-scroll table { min-width: 720px; }
}

.tag { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: 12px; white-space: nowrap; }
.tag.paid, .tag.ok { background: #e7f8ee; color: var(--ok); }
.tag.pending { background: #fdf3df; color: var(--warn); }
.tag.closed, .tag.unpaid, .tag.bad { background: #fdeaee; color: var(--bad); }
.tag.mock { background: #e8ecfd; color: #4053d6; }
.tag.wechat { background: #e7f8ee; color: #15803d; }
.tag.aliyun, .tag.alipay { background: #e5eefe; color: #1d4ed8; }
.tag.tencent { background: #efeafd; color: #6d28d9; }
.tag.hot { background: #fdeee2; color: #c2540a; }

.amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.price { font-size: 26px; font-weight: 800; }
.price small { font-size: 13px; font-weight: 400; color: var(--sub); }
.orig { text-decoration: line-through; color: var(--sub); font-size: 13px; }

.toast { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); background: #101827; color: #fff; padding: 10px 20px; border-radius: 10px; z-index: 99; display: none; box-shadow: 0 6px 22px rgba(0,0,0,.25); max-width: 92vw; }

/* 后台导航 */
.nav { background: #101827; color: #fff; padding: 0 14px; display: flex; align-items: center; gap: 2px; flex-wrap: wrap; position: sticky; top: 0; z-index: 20; }
.nav a { color: #b9c3d6; padding: 12px 11px; font-size: 13.5px; white-space: nowrap; }
.nav a.on, .nav a:hover { color: #fff; background: #232f47; }
.nav .brand { font-weight: 700; color: #fff; margin-right: 8px; white-space: nowrap; }
@media (max-width: 640px) { .nav a { padding: 10px 8px; font-size: 12.5px; } }

/* 统计卡 */
.stat { flex: 1; min-width: 150px; margin-bottom: 0; }
.stat .num { font-size: 23px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .lbl { color: var(--sub); font-size: 12.5px; }

/* 套餐卡 */
.plan-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: #fff; display: flex; flex-direction: column; gap: 7px; min-width: 170px; flex: 1; position: relative; box-shadow: var(--shadow); }
.plan-card .name { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 34px; }
.plan-card .hot-flag { position: absolute; top: 10px; right: 10px; }

/* 二维码区 */
.qrbox { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px; }
.qrbox canvas, .qrbox img { border: 1px solid var(--line); border-radius: 10px; max-width: 100%; }

/* 弹窗 */
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: none; align-items: center; justify-content: center; z-index: 50; padding: 12px; }
.modal-bg.show { display: flex; }
.modal { background: #fff; border-radius: 14px; padding: 22px; width: min(440px, 94vw); max-height: 90vh; overflow: auto; box-shadow: 0 20px 50px rgba(0,0,0,.25); }

/* 打赏金额快捷选 */
.tip-amt { display: flex; gap: 8px; flex-wrap: wrap; }
.tip-amt button { padding: 8px 16px; border-radius: 99px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 14px; }
.tip-amt button.on { border-color: var(--brand); color: var(--brand); background: #eef3ff; font-weight: 600; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.filters select, .filters input { width: auto; }
pre.log { background: #0f172a; color: #d1fae5; padding: 12px; border-radius: 10px; font-size: 12px; overflow: auto; max-height: 320px; }

/* 会员头像 */
.avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: #eef1f8; display: inline-block; vertical-align: middle; border: 1px solid var(--line); flex: none; }
.avatar.lg { width: 64px; height: 64px; }
.avatar-ph { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #6d8bfa, #3b6cf6); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; flex: none; }
.avatar-ph.lg { width: 64px; height: 64px; font-size: 24px; }

/* 个人卡片 */
.profile { display: flex; align-items: center; gap: 14px; }
.profile .pname { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 主页横幅 */
.hero { background: linear-gradient(120deg, #3b6cf6 0%, #6d5df6 60%, #8f4ff0 100%); color: #fff; border-radius: var(--radius); padding: 26px 22px; margin-bottom: 14px; box-shadow: var(--shadow); }
.hero h1 { color: #fff; font-size: 24px; }
.hero .muted { color: rgba(255,255,255,.85); font-size: 13px; }
.hero .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.hero .chip { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25); padding: 4px 12px; border-radius: 99px; font-size: 12.5px; }

/* 7 天柱状图 */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 110px; padding-top: 6px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.bars .b .col { width: 100%; max-width: 34px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #7c9bff, #3b6cf6); min-height: 3px; transition: height .4s; }
.bars .b .v { font-size: 11px; color: var(--sub); white-space: nowrap; }
.bars .b .d { font-size: 11px; color: var(--sub); }

/* 复制按钮组 */
.kv { display: grid; grid-template-columns: 130px 1fr auto; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--sub); }
.kv .v { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, Consolas, monospace; }
@media (max-width: 640px) { .kv { grid-template-columns: 100px 1fr auto; } }
