/* =====================================================================
   components.css — 按钮 / 卡片 / 表单 / 列表 / Toast / 弹窗 / 骨架 / 标签 / 头像 / 分页
   ===================================================================== */
/* ---------- 按钮 ---------- */
.btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 42px; padding: 0 18px; border-radius: 12px; background: #fff; color: var(--tx); font-size: 15px; font-weight: 600; border: 1px solid var(--line-2); transition: transform .15s var(--ease), box-shadow .2s, opacity .2s, background .2s; user-select: none; white-space: nowrap; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .55; pointer-events: none; }
.btn-primary { background: var(--grad); color: #fff; border: 0; box-shadow: var(--glow); }
.btn-primary::after { content: ""; position: absolute; top: 0; left: -80%; width: 50%; height: 100%; background: linear-gradient(100deg, transparent 0, rgba(255, 255, 255, .35) 50%, transparent 100%); transform: skewX(-20deg); animation: shine 2.8s ease-in-out infinite; pointer-events: none; }
.btn-accent { background: var(--grad-2); color: #fff; border: 0; box-shadow: var(--glow-2); }
.btn-gold { background: linear-gradient(135deg, #FFB547, #F5A623); color: #fff; border: 0; box-shadow: 0 8px 20px rgba(245, 166, 35, .35); }
.btn-ok { background: linear-gradient(135deg, #22C55E, #16A34A); color: #fff; border: 0; box-shadow: 0 8px 20px rgba(22, 163, 74, .3); }
.btn-danger { background: linear-gradient(135deg, #F87171, #EF4444); color: #fff; border: 0; box-shadow: 0 8px 20px rgba(239, 68, 68, .3); }
.btn-ghost { background: var(--p-soft); color: var(--p2); border: 0; }
.btn-ghost-a { background: var(--a-soft); color: var(--a1); border: 0; }
.btn-soft { background: #F3F4F8; border: 0; color: var(--tx); }
.btn-block { width: 100%; display: flex; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-lg { height: 48px; font-size: 16px; border-radius: 14px; }
.btn-pill { border-radius: 999px; }
.btn-row { display: flex; gap: 10px; margin-top: 14px; }
.btn-row .btn { flex: 1; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: spin .7s linear infinite; display: inline-block; }
.btn:not(.btn-primary):not(.btn-accent):not(.btn-gold):not(.btn-ok):not(.btn-danger) .spin { border-color: var(--line-2); border-top-color: var(--p2); }

/* ---------- 卡片 ---------- */
.card { display: block; background: var(--card); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); margin-bottom: 12px; position: relative; }
.card.tight { padding: 0; overflow: hidden; }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.card-grad { background: var(--grad); color: #fff; box-shadow: var(--glow); overflow: hidden; }
.card-grad-2 { background: var(--grad-2); color: #fff; box-shadow: var(--glow-2); overflow: hidden; }
.card-grad::before, .card-grad-2::before { content: ""; position: absolute; width: 180px; height: 180px; border-radius: 50%; background: rgba(255, 255, 255, .14); right: -50px; top: -70px; pointer-events: none; }
.card-grad::after, .card-grad-2::after { content: ""; position: absolute; width: 110px; height: 110px; border-radius: 50%; background: rgba(255, 255, 255, .1); left: -30px; bottom: -50px; pointer-events: none; }
.card-grad .tx2, .card-grad-2 .tx2 { color: rgba(255, 255, 255, .78); }
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-title .sub { font-size: 12px; font-weight: 400; color: var(--tx-2); }

/* ---------- 统计网格 ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats.c2 { grid-template-columns: repeat(2, 1fr); }
.stats.c4 { grid-template-columns: repeat(4, 1fr); }
.stat { background: #F8F9FC; border-radius: var(--r-sm); padding: 10px 8px; text-align: center; min-width: 0; }
.stat .v { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .l { font-size: 11px; color: var(--tx-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-grad .stat, .card-grad-2 .stat { background: rgba(255, 255, 255, .16); }
.card-grad .stat .l, .card-grad-2 .stat .l { color: rgba(255, 255, 255, .8); }
.big-money { font-size: 30px; font-weight: 800; letter-spacing: -.5px; font-variant-numeric: tabular-nums; line-height: 1.1; }
@media (max-width: 340px) { .big-money { font-size: 26px; } .stat .v { font-size: 14px; } }

/* ---------- 表单 ---------- */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--tx-2); margin-bottom: 6px; }
.inp { display: flex; align-items: center; gap: 8px; height: 46px; min-width: 0; padding: 0 14px; background: #F3F4F8; border-radius: 12px; border: 1.5px solid transparent; transition: border-color .2s, background .2s, box-shadow .2s; }
.inp:focus-within { border-color: var(--p1); background: #fff; box-shadow: 0 0 0 3px rgba(255, 107, 53, .12); }
.inp.err { border-color: var(--err); animation: shake .4s; }
.inp > svg { width: 20px; height: 20px; color: var(--tx-3); flex: none; }
.inp input, .inp select { flex: 1; min-width: 0; border: 0; background: transparent; height: 100%; font-size: 15px; }
.inp input::placeholder { color: var(--tx-3); }
.inp .suffix { font-size: 13px; color: var(--tx-2); flex: none; }
.inp .ib { color: var(--tx-2); width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; flex: none; }
.inp .ib svg { width: 20px; height: 20px; }
.inp.big input { font-size: 24px; font-weight: 700; }
.inp.big .prefix { font-size: 20px; font-weight: 700; color: var(--tx); }
textarea.ta { width: 100%; min-height: 90px; padding: 12px 14px; background: #F3F4F8; border-radius: 12px; border: 1.5px solid transparent; resize: vertical; font-size: 14px; transition: border-color .2s, background .2s; }
textarea.ta:focus { border-color: var(--p1); background: #fff; }
.cap-row { display: flex; gap: 8px; align-items: center; }
.cap-row .inp { flex: 1 1 0; min-width: 0; }
.cap-img { width: 104px; height: 46px; border-radius: 12px; background: #F3F4F8; overflow: hidden; flex: none; position: relative; display: grid; place-items: center; cursor: pointer; }
.cap-img svg { width: 100%; height: 100%; }
.cap-img .cap-ph { font-size: 11px; color: var(--tx-3); }
.hint { font-size: 12px; color: var(--tx-2); margin-top: 6px; line-height: 1.5; }
.hint.err { color: var(--err); }
.amount-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
.amount-grid button { height: 36px; border-radius: 10px; background: #F3F4F8; font-size: 13px; font-weight: 600; position: relative; overflow: hidden; transition: all .2s; border: 1.5px solid transparent; }
.amount-grid button.on { background: var(--p-soft); color: var(--p2); border-color: var(--p1); }
@media (max-width: 340px) { .amount-grid { grid-template-columns: repeat(3, 1fr); } }
.seg { display: flex; background: #F3F4F8; border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { flex: 1; height: 34px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--tx-2); position: relative; overflow: hidden; transition: all .25s var(--ease); }
.seg button.on { background: #fff; color: var(--p2); box-shadow: 0 2px 8px rgba(31, 35, 51, .08); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; margin-bottom: 10px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 30px; padding: 0 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line-2); font-size: 12px; font-weight: 600; color: var(--tx-2); position: relative; overflow: hidden; transition: all .2s; display: inline-flex; align-items: center; gap: 4px; }
.chip.on { background: var(--grad); color: #fff; border-color: transparent; box-shadow: var(--glow); }
.stepper { display: inline-flex; align-items: center; background: #F3F4F8; border-radius: 10px; overflow: hidden; }
.stepper button { width: 36px; height: 36px; display: grid; place-items: center; color: var(--tx); font-size: 18px; font-weight: 700; }
.stepper button:disabled { opacity: .35; }
.stepper input { width: 52px; height: 36px; text-align: center; border: 0; background: #fff; font-weight: 700; font-size: 15px; }
.switch { width: 44px; height: 24px; border-radius: 12px; background: var(--line-2); position: relative; transition: background .2s; flex: none; }
.switch::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; background: #fff; left: 2px; top: 2px; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); transition: left .2s var(--ease-b); }
.switch.on { background: var(--ok); } .switch.on::after { left: 22px; }
.upload-box { border: 1.5px dashed var(--line-2); border-radius: 12px; min-height: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--tx-2); font-size: 12px; background: #FAFBFD; position: relative; overflow: hidden; cursor: pointer; }
.upload-box svg { width: 26px; height: 26px; color: var(--tx-3); }
.upload-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.upload-box input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- 列表 ---------- */
.list-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #fff; position: relative; overflow: hidden; min-height: 52px; }
.list-row + .list-row { border-top: 1px solid var(--line); }
.list-row .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; color: #fff; background: var(--grad); }
.list-row .ic svg { width: 20px; height: 20px; }
.list-row .ic.a { background: var(--grad-2); } .list-row .ic.g { background: linear-gradient(135deg, #FFB547, #F5A623); } .list-row .ic.k { background: linear-gradient(135deg, #22C55E, #16A34A); } .list-row .ic.s { background: #F3F4F8; color: var(--tx-2); } .list-row .ic.r { background: linear-gradient(135deg, #F87171, #EF4444); }
.list-row .t { flex: 1; min-width: 0; }
.list-row .t b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .t small { display: block; font-size: 12px; color: var(--tx-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.list-row .r { text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.list-row .r b { display: block; font-size: 15px; font-weight: 700; }
.list-row .r small { display: block; font-size: 11px; color: var(--tx-2); }
.list-row .arr { width: 16px; height: 16px; color: var(--tx-3); flex: none; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 13px; }
.kv + .kv { border-top: 1px dashed var(--line); }
.kv .k { color: var(--tx-2); flex: none; }
.kv .v { text-align: right; font-weight: 600; word-break: break-all; }
.entries { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.entry { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 2px; border-radius: 12px; font-size: 12px; color: var(--tx); position: relative; overflow: hidden; transition: background .2s; }
.entry:active { background: #F3F4F8; }
.entry .eic { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; color: #fff; background: var(--grad); box-shadow: 0 4px 10px rgba(255, 92, 80, .25); }
.entry .eic svg { width: 21px; height: 21px; }
.entry .eic.a { background: var(--grad-2); box-shadow: 0 4px 10px rgba(98, 108, 255, .25); } .entry .eic.g { background: linear-gradient(135deg, #FFB547, #F5A623); box-shadow: 0 4px 10px rgba(245, 166, 35, .3); } .entry .eic.k { background: linear-gradient(135deg, #22C55E, #16A34A); box-shadow: 0 4px 10px rgba(22, 163, 74, .25); } .entry .eic.c { background: linear-gradient(135deg, #38BDF8, #0EA5E9); box-shadow: 0 4px 10px rgba(14, 165, 233, .25); } .entry .eic.s { background: linear-gradient(135deg, #94A3B8, #64748B); box-shadow: none; }

/* ---------- 标签 / 徽章 ---------- */
.pill { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: #F3F4F8; color: var(--tx-2); white-space: nowrap; }
.pill.active, .pill.ok, .pill.s1 { background: var(--ok-soft); color: var(--ok); }
.pill.done, .pill.info { background: var(--a-soft); color: var(--a1); }
.pill.pending, .pill.s0, .pill.warn { background: var(--gold-soft); color: #D97706; }
.pill.err, .pill.s2, .pill.cancelled, .pill.rejected { background: var(--err-soft); color: var(--err); }
.pill.hot { background: var(--p-soft); color: var(--p2); }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.2s infinite; }
.tag { display: inline-block; padding: 1px 6px; border-radius: 6px; font-size: 10px; font-weight: 700; background: var(--p-soft); color: var(--p2); line-height: 16px; vertical-align: middle; }
.tag.a { background: var(--a-soft); color: var(--a1); } .tag.g { background: var(--gold-soft); color: #D97706; }
.badge { position: absolute; top: -4px; right: -6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--err); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }

/* ---------- 头像 ---------- */
.avatar { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; display: inline-grid; place-items: center; background: var(--grad); color: #fff; font-weight: 700; font-size: 18px; flex: none; }
.avatar img, .avatar svg { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 64px; height: 64px; font-size: 26px; box-shadow: 0 0 0 3px #fff, 0 6px 16px rgba(31, 35, 51, .15); }
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }
.avatar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.avatar-grid .av { aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 3px solid transparent; position: relative; transition: transform .2s var(--ease-b), border-color .2s; cursor: pointer; }
.avatar-grid .av svg, .avatar-grid .av img { width: 100%; height: 100%; }
.avatar-grid .av.on { border-color: var(--p2); transform: scale(1.08); box-shadow: var(--glow); }

/* ---------- Toast ---------- */
.toasts { position: fixed; top: calc(var(--top-h) + var(--sa-t) + 10px); left: 0; right: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { display: flex; align-items: center; gap: 8px; max-width: 100%; padding: 10px 16px; border-radius: 12px; background: rgba(31, 35, 51, .92); color: #fff; font-size: 13px; box-shadow: var(--shadow-2); animation: toastIn .35s var(--ease-b); position: relative; overflow: hidden; backdrop-filter: blur(8px); }
.toast.leaving { animation: toastOut .25s ease-in forwards; }
.toast .t-ic { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: rgba(255, 255, 255, .22); flex: none; }
.toast.ok .t-ic { background: var(--ok); } .toast.err .t-ic { background: var(--err); } .toast.warn .t-ic { background: var(--warn); }
.toast .bar { position: absolute; left: 0; bottom: 0; height: 2px; background: rgba(255, 255, 255, .5); animation: toastBar linear forwards; }

/* ---------- 弹窗 ---------- */
.overlay { position: fixed; inset: 0; z-index: 80; background: rgba(20, 22, 35, .45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: flex-end; justify-content: center; animation: fadeIn .22s; }
.overlay.center { align-items: center; padding: 24px; }
.overlay.closing { animation: fadeOut .2s forwards; }
.sheet { width: 100%; max-width: 560px; background: #fff; border-radius: 22px 22px 0 0; padding: 10px 16px calc(16px + var(--sa-b)); max-height: 86vh; overflow-y: auto; animation: sheetUp .32s var(--ease); }
.overlay.center .sheet { border-radius: 20px; padding: 22px 18px 18px; max-width: 330px; animation: zoomIn .28s var(--ease-b); }
.overlay.closing .sheet { animation: sheetDown .2s ease-in forwards; }
.overlay.closing.center .sheet { animation: zoomOut .18s ease-in forwards; }
.sheet-handle { width: 36px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 0 auto 12px; }
.modal-ic { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center; background: var(--p-soft); color: var(--p2); }
.modal-ic svg { width: 28px; height: 28px; }
.modal-ic.danger { background: var(--err-soft); color: var(--err); } .modal-ic.gold { background: var(--gold-soft); color: var(--gold); } .modal-ic.ok { background: var(--ok-soft); color: var(--ok); } .modal-ic.a { background: var(--a-soft); color: var(--a1); }
.modal-title { font-size: 17px; font-weight: 700; text-align: center; }
.modal-sub { font-size: 13px; color: var(--tx-2); text-align: center; margin-top: 6px; line-height: 1.6; white-space: pre-line; }
.modal-foot { display: flex; gap: 10px; margin-top: 18px; }
.modal-foot .btn { flex: 1; }
.sheet-title { font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sheet-title .icon-btn { width: 32px; height: 32px; }

/* ---------- 骨架 / 空态 ---------- */
.sk { position: relative; overflow: hidden; background: #ECEEF3; border-radius: 12px; }
.sk::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent); animation: skim 1.3s infinite; }
.sk-banner { height: 180px; margin-bottom: 12px; }
.sk-card { margin-bottom: 12px; }
.sk-line { height: 14px; margin: 10px 0; border-radius: 6px; }
.sk-line:nth-child(2n) { width: 70%; }
.sk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sk-grid .sk { height: 220px; }
.empty { text-align: center; color: var(--tx-2); font-size: 13px; padding: 36px 12px; }
.empty .em-ic { width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 50%; background: #F3F4F8; display: grid; place-items: center; color: var(--tx-3); }
.empty .em-ic svg { width: 28px; height: 28px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px 0; font-size: 13px; color: var(--tx-2); }
.pager .num { font-variant-numeric: tabular-nums; }
.notice { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--gold-soft); color: #92400E; font-size: 12px; line-height: 1.6; }
.notice svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.notice.err { background: var(--err-soft); color: #B91C1C; } .notice.ok { background: var(--ok-soft); color: #166534; } .notice.a { background: var(--a-soft); color: #4C1D95; }
.divider { height: 1px; background: var(--line); margin: 12px 0; }
