/* 👛 钱包：沿用站点风格（白底圆角卡片、绿色强调、跟随外观配色 --ap-*），不依赖 Tailwind 裁剪。 */
:root {
    --wl-bg: var(--ap-bg, #f9fafb);
    --wl-card: var(--ap-card, #ffffff);
    --wl-text: var(--ap-text, #1f2937);
    --wl-muted: var(--ap-muted, #6b7280);
    --wl-accent: var(--ap-accent, #16a34a);
    --wl-border: #eef0f3;
    --wl-soft: #f5f7f9;
    --wl-income: #16a34a;
    --wl-expense: #e11d48;
    --wl-radius: 16px;
    --wl-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 14px rgba(15, 23, 42, .04);
}
html.dark {
    --wl-bg: var(--ap-bg, #030712);
    --wl-card: var(--ap-card, #111827);
    --wl-text: var(--ap-text, #e5e7eb);
    --wl-muted: var(--ap-muted, #9ca3af);
    --wl-border: #1f2937;
    --wl-soft: #111827;
    --wl-income: #4ade80;
    --wl-expense: #fb7185;
    --wl-shadow: none;
}
body.wl-body { background: var(--wl-bg); color: var(--wl-text); }

/* 顶栏 */
.wl-header { position: sticky; top: 0; z-index: 30; background: var(--wl-card); border-bottom: 1px solid var(--wl-border);
    display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; }
.wl-brand { display: flex; align-items: center; gap: 6px; font: 800 14px/1 'JetBrains Mono', ui-monospace, monospace; letter-spacing: .02em; color: inherit; text-decoration: none; }
.wl-brand svg { color: var(--wl-accent); }
.wl-brand-link { display: inline-flex; align-items: center; gap: 4px; margin-left: -4px; margin-right: auto; padding: 3px 8px; border: 1px solid var(--wl-border, #e5e7eb); border-radius: 8px; font: 600 calc(11px * var(--ap-scale, 1))/1 ui-sans-serif, system-ui, sans-serif; color: var(--wl-muted, #6b7280); text-decoration: none; }
.wl-brand-link:hover { color: var(--wl-accent); }
.wl-actions { display: flex; align-items: center; gap: 6px; }

/* 标签页 */
.wl-wrap { max-width: 72rem; margin: 0 auto; padding: 16px; box-sizing: border-box; }
@media (min-width: 768px) { .wl-wrap { padding: 24px; } }
.wl-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 4px; background: var(--wl-card);
    border: 1px solid var(--wl-border); border-radius: 14px; margin-bottom: 18px; }
.wl-tabs::-webkit-scrollbar { display: none; }
.wl-tab { flex: 0 0 auto; border: 0; background: transparent; color: var(--wl-muted); font-size: calc(13px * var(--ap-scale, 1)); font-weight: 600;
    padding: 8px 14px; border-radius: 10px; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.wl-tab:hover { color: var(--wl-text); }
.wl-tab.active { background: var(--wl-accent); color: #fff; }
.wl-panel { display: none; }
.wl-panel.active { display: block; }
.wl-stack > * + * { margin-top: 16px; }

/* 卡片 */
.wl-card { background: var(--wl-card); border: 1px solid var(--wl-border); border-radius: var(--wl-radius); box-shadow: var(--wl-shadow);
    padding: 18px; min-width: 0; box-sizing: border-box; }
.wl-card-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: calc(14px * var(--ap-scale, 1)); font-weight: 700; margin: 0 0 14px; }
.wl-card-title small { font-size: calc(11px * var(--ap-scale, 1)); font-weight: 400; color: var(--wl-muted); }
.wl-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.wl-grid-2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .wl-grid-2 { grid-template-columns: 1fr 1fr; } }
.wl-muted { color: var(--wl-muted); }
.wl-mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; }
.wl-in { color: var(--wl-income); }
.wl-out { color: var(--wl-expense); }

/* 总览大卡片 */
.wl-hero { background: linear-gradient(135deg, #065f46, #16a34a 60%, #22c55e); color: #fff; border: 0; }
html.dark .wl-hero { background: linear-gradient(135deg, #064e3b, #166534); }
.wl-hero .wl-muted { color: rgba(255, 255, 255, .75); }
.wl-hero-value { font-size: calc(30px * var(--ap-scale, 1)); font-weight: 800; letter-spacing: -.01em; margin: 4px 0 16px; word-break: break-all; }
@media (min-width: 768px) { .wl-hero-value { font-size: calc(36px * var(--ap-scale, 1)); } }
.wl-hero-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .wl-hero-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.wl-hero-cell { background: rgba(255, 255, 255, .12); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.wl-hero-cell b { display: block; font-size: calc(16px * var(--ap-scale, 1)); margin-top: 2px; overflow-wrap: anywhere; line-height: 1.3; }
@media (max-width: 480px) { .wl-hero-cell b { font-size: calc(14px * var(--ap-scale, 1)); } }
.wl-hero-cell span { font-size: calc(11px * var(--ap-scale, 1)); }

.wl-stat { background: var(--wl-soft); border-radius: 12px; padding: 12px; min-width: 0; }
.wl-stat .k { font-size: calc(11px * var(--ap-scale, 1)); color: var(--wl-muted); }
.wl-stat .v { font-size: calc(18px * var(--ap-scale, 1)); font-weight: 700; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-stat .s { font-size: calc(11px * var(--ap-scale, 1)); color: var(--wl-muted); margin-top: 2px; }
.wl-period-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .wl-period-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* 柱状图 */
.wl-bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 8px; }
.wl-bar-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.wl-bar-pair { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.wl-bar { width: 42%; max-width: 14px; border-radius: 4px 4px 1px 1px; min-height: 1px; }
.wl-bar.in { background: var(--wl-income); opacity: .85; }
.wl-bar.out { background: var(--wl-expense); opacity: .85; }
.wl-bar-label { font-size: calc(10px * var(--ap-scale, 1)); color: var(--wl-muted); white-space: nowrap; }
.wl-legend { display: flex; gap: 12px; font-size: calc(11px * var(--ap-scale, 1)); color: var(--wl-muted); }
.wl-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: 0; }

/* 进度条 / 行 */
.wl-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.wl-row + .wl-row { margin-top: 10px; }
.wl-row.wrap { flex-wrap: wrap; row-gap: 2px; }
.wl-progress { height: 6px; border-radius: 6px; background: var(--wl-soft); overflow: hidden; margin-top: 6px; }
.wl-progress > div { height: 100%; border-radius: 6px; background: var(--wl-accent); }
.wl-progress > div.warn { background: #f59e0b; }
.wl-progress > div.over { background: var(--wl-expense); }
.wl-avatar { width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
    font-size: calc(13px * var(--ap-scale, 1)); font-weight: 700; color: #fff; }

/* 账户卡片 */
.wl-group-title { font-size: calc(12px * var(--ap-scale, 1)); font-weight: 700; color: var(--wl-muted); margin: 20px 0 10px; display: flex; justify-content: space-between; }
.wl-group-title:first-child { margin-top: 0; }
.wl-acc { position: relative; display: flex; flex-direction: column; gap: 10px; }
.wl-acc-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wl-acc-name { font-weight: 700; font-size: calc(14px * var(--ap-scale, 1)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-acc-bal { font-size: calc(22px * var(--ap-scale, 1)); font-weight: 800; word-break: break-all; }
.wl-acc-foot { display: flex; flex-wrap: wrap; gap: 4px; border-top: 1px solid var(--wl-border); padding-top: 10px; margin-top: auto; }
.wl-chip { display: inline-flex; align-items: center; gap: 4px; font-size: calc(11px * var(--ap-scale, 1)); padding: 2px 8px; border-radius: 999px; background: var(--wl-soft); color: var(--wl-muted); white-space: nowrap; }
.wl-archived { opacity: .55; }

/* 按钮 / 表单 */
.wl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--wl-border); background: var(--wl-card);
    color: var(--wl-text); font-size: calc(12px * var(--ap-scale, 1)); font-weight: 600; padding: 7px 12px; border-radius: 10px; cursor: pointer; white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s; text-decoration: none; }
.wl-btn:hover { border-color: var(--wl-accent); color: var(--wl-accent); }
.wl-btn:disabled { opacity: .5; cursor: not-allowed; }
.wl-btn.primary { background: var(--wl-accent); border-color: var(--wl-accent); color: #fff; }
.wl-btn.primary:hover { filter: brightness(.95); color: #fff; }
.wl-btn.ghost { border-color: transparent; background: transparent; color: var(--wl-muted); padding: 5px 8px; }
.wl-btn.ghost:hover { color: var(--wl-accent); background: var(--wl-soft); }
.wl-btn.danger { color: var(--wl-expense); }
.wl-btn.danger:hover { border-color: var(--wl-expense); }
.wl-btn.sm { font-size: calc(11px * var(--ap-scale, 1)); padding: 4px 9px; border-radius: 8px; }
.wl-input { width: 100%; box-sizing: border-box; border: 1px solid var(--wl-border); background: var(--wl-card); color: var(--wl-text);
    border-radius: 10px; padding: 8px 11px; font-size: calc(13px * var(--ap-scale, 1)); outline: none; transition: border-color .15s; min-width: 0; }
.wl-input:focus { border-color: var(--wl-accent); }
html.dark .wl-input { background: #0b1220; }
.wl-label { display: block; font-size: calc(11px * var(--ap-scale, 1)); font-weight: 600; color: var(--wl-muted); margin-bottom: 4px; }
.wl-form { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wl-form .full { grid-column: 1 / -1; }
.wl-check { display: flex; align-items: center; gap: 8px; font-size: calc(13px * var(--ap-scale, 1)); cursor: pointer; }
.wl-check input { width: 16px; height: 16px; accent-color: var(--wl-accent); }
.wl-seg { display: inline-flex; background: var(--wl-soft); border-radius: 10px; padding: 3px; gap: 2px; }
.wl-seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 8px; font-size: calc(12px * var(--ap-scale, 1)); font-weight: 600; color: var(--wl-muted); cursor: pointer; }
.wl-seg button.on { background: var(--wl-card); color: var(--wl-text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.wl-seg button.on.in { color: var(--wl-income); }
.wl-seg button.on.out { color: var(--wl-expense); }
/* 交易类型按钮多了会换行（后台可以新增类型） */
.wl-seg.wl-seg-wrap { display: flex; flex-wrap: wrap; width: fit-content; max-width: 100%; }

/* 流水详情预览 */
.wl-tx[data-id] { cursor: pointer; }
.wl-detail-head { text-align: center; margin: -4px 0 16px; }
.wl-detail-amt { font-size: calc(28px * var(--ap-scale, 1)); font-weight: 800; margin-top: 2px; overflow-wrap: anywhere; }
.wl-detail-head .wl-tx-chips { justify-content: center; }
.wl-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.wl-toolbar .wl-input { width: auto; flex: 1 1 9rem; }
.wl-cat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wl-cat-chip { border: 1px solid var(--wl-border); background: var(--wl-card); border-radius: 999px; padding: 5px 11px; font-size: calc(12px * var(--ap-scale, 1)); cursor: pointer; color: var(--wl-text); }
.wl-cat-chip.on { border-color: var(--wl-accent); background: var(--wl-accent); color: #fff; }

/* 流水列表 */
.wl-day { font-size: calc(12px * var(--ap-scale, 1)); font-weight: 700; color: var(--wl-muted); display: flex; justify-content: space-between; padding: 14px 4px 6px; }
.wl-tx { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; min-width: 0; }
.wl-tx:hover { background: var(--wl-soft); }
.wl-tx-main { flex: 1; min-width: 0; }
.wl-tx-title { font-size: calc(13px * var(--ap-scale, 1)); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-tx-sub { font-size: calc(11px * var(--ap-scale, 1)); color: var(--wl-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.wl-tx-amt { font-size: calc(14px * var(--ap-scale, 1)); font-weight: 700; white-space: nowrap; text-align: right; }
.wl-tx-ops { display: flex; gap: 2px; opacity: .0; transition: opacity .15s; }
.wl-tx:hover .wl-tx-ops, .wl-tx:focus-within .wl-tx-ops { opacity: 1; }
@media (hover: none) { .wl-tx-ops { opacity: 1; } }
.wl-tx.excluded { opacity: .5; }
.wl-tx.excluded .wl-tx-amt { text-decoration: line-through; }

/* 分页 */
.wl-pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 14px; font-size: calc(12px * var(--ap-scale, 1)); }
.wl-pager-pages { display: flex; gap: 4px; flex-wrap: wrap; }
.wl-pager-pages button { min-width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--wl-border); background: var(--wl-card); color: var(--wl-text); cursor: pointer; font-size: calc(12px * var(--ap-scale, 1)); }
.wl-pager-pages button.on { background: var(--wl-accent); border-color: var(--wl-accent); color: #fff; font-weight: 700; }
.wl-pager-pages button:disabled { opacity: .4; cursor: default; }

/* 弹窗 */
.wl-modal { position: fixed; inset: 0; z-index: 60; background: rgba(15, 23, 42, .55); backdrop-filter: blur(2px); display: flex;
    align-items: flex-end; justify-content: center; }
@media (min-width: 640px) { .wl-modal { align-items: center; padding: 16px; } }
.wl-modal-box { background: var(--wl-card); color: var(--wl-text); width: 100%; max-width: 34rem; max-height: 92vh; display: flex; flex-direction: column;
    border-radius: 20px 20px 0 0; box-shadow: 0 25px 50px rgba(0, 0, 0, .25); }
@media (min-width: 640px) { .wl-modal-box { border-radius: 20px; } }
.wl-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--wl-border); font-weight: 700; font-size: calc(15px * var(--ap-scale, 1)); }
.wl-modal-body { padding: 18px 20px; overflow-y: auto; }
.wl-modal-foot { padding: 12px 20px; border-top: 1px solid var(--wl-border); display: flex; justify-content: flex-end; gap: 8px; }
.wl-x { border: 0; background: transparent; color: var(--wl-muted); cursor: pointer; padding: 4px; font-size: calc(18px * var(--ap-scale, 1)); line-height: 1; }

.wl-empty { text-align: center; padding: 36px 12px; color: var(--wl-muted); font-size: calc(13px * var(--ap-scale, 1)); }
.wl-toast { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 100; background: #111827; color: #fff; font-size: calc(13px * var(--ap-scale, 1));
    padding: 9px 16px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); transition: opacity .3s; }
.wl-toast.err { background: #be123c; }
.wl-hint { font-size: calc(11px * var(--ap-scale, 1)); color: var(--wl-muted); line-height: 1.6; }
.wl-kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: calc(13px * var(--ap-scale, 1)); }
.wl-kv > :nth-child(even) { text-align: right; min-width: 0; overflow-wrap: anywhere; }
/* 钱包 v2：分组小标题、银行卡打码行、借贷卡片、帐号多选 */
.wl-sec-title { font-weight: 700; font-size: calc(13px * var(--ap-scale, 1)); padding-top: 8px; border-top: 1px dashed var(--wl-border); }
.wl-sec-title small { font-weight: 400; color: var(--wl-muted); margin-left: 6px; }
.wl-card-info { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border-radius: 10px; background: var(--wl-soft, rgba(148, 163, 184, .08)); }
.wl-secret-row { display: flex; align-items: center; gap: 4px; min-width: 0; }
.wl-secret-row > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: calc(13px * var(--ap-scale, 1)); letter-spacing: .02em; }
.wl-secret-row .wl-btn { padding: 2px 8px; }
.wl-loan { padding: 12px 4px; border-bottom: 1px solid var(--wl-border); }
.wl-loan:last-child { border-bottom: 0; }
.wl-chips-select { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.wl-link { color: var(--wl-accent, #16a34a); text-decoration: underline; text-underline-offset: 2px; }
.wl-form .wl-form > div, .wl-form input[type="date"] { min-width: 0; }
.wl-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 8px !important; }
@media (max-width: 560px) { .wl-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }
@media (max-width: 560px) {
    .wl-actions { flex-wrap: wrap; justify-content: flex-end; row-gap: 4px; min-width: 0; }
    .wl-actions .wl-btn { padding: 6px 9px; }
}

/* 钱包 v3：批量操作 / 标记 */
.wl-tx-sel { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--wl-accent); cursor: pointer; }
.wl-tx.selected { background: var(--wl-soft); box-shadow: inset 3px 0 0 var(--wl-accent); }
.wl-tx-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 4px; vertical-align: middle; }
.wl-chip.warn { background: rgba(245, 158, 11, .14); color: #b45309; }
.wl-chip.ok { background: rgba(22, 163, 74, .12); color: var(--wl-income); }
.wl-chip.info { background: rgba(21, 128, 61, .1); color: var(--wl-accent); }
.wl-batchbar { position: sticky; bottom: 12px; z-index: 30; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 10px 14px; border-radius: 14px; background: var(--wl-card); border: 1px solid var(--wl-border);
    box-shadow: 0 10px 30px rgba(15, 23, 42, .18); font-size: calc(12px * var(--ap-scale, 1)); }
.wl-batchbar-ops { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
@media (max-width: 640px) {
    .wl-batchbar { bottom: 0; margin: 0 -16px; border-radius: 16px 16px 0 0; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
    .wl-batchbar-ops { width: 100%; margin-left: 0; }
    .wl-batchbar-ops .wl-btn { flex: 1; }
}
.wl-code { font-family: var(--wl-mono, ui-monospace, monospace); font-size: calc(26px * var(--ap-scale, 1)); font-weight: 800; letter-spacing: .35em;
    text-align: center; padding: 12px; border-radius: 12px; background: var(--wl-soft); user-select: none; -webkit-user-select: none; }
.wl-book-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px dashed var(--wl-border); }
.wl-book-row .wl-input { flex: 1; min-width: 8rem; }
.wl-batching .wl-tx-ops { display: none; }
.wl-batching .wl-tx { cursor: pointer; }

/* 钱包 v4：资产趋势 / 负债表 / 存钱计划 */
.wl-trend svg { width: 100%; height: 220px; display: block; }
.wl-trend .axis { font-size: calc(10px * var(--ap-scale, 1)); fill: var(--wl-muted); }
.wl-bs-sec { padding: 6px 0; border-bottom: 1px dashed var(--wl-border); }
.wl-bs-sec:last-child { border-bottom: 0; }
.wl-bs-item { display: flex; justify-content: space-between; gap: 8px; font-size: calc(12px * var(--ap-scale, 1)); color: var(--wl-muted); padding: 2px 0 2px 10px; }
.wl-bs-item span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-event { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--wl-border); }
.wl-event img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--wl-border); cursor: zoom-in; }
.wl-chip.danger { background: rgba(239, 68, 68, .12); color: var(--wl-expense); }
.wl-free { font-size: calc(11px * var(--ap-scale, 1)); color: var(--wl-muted); background: var(--wl-soft); border-radius: 10px; padding: 6px 10px; }

/* v5：流水凭证、金额 + 币种一行、自定义参数、可编辑的导入预览 */
.wl-files { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.wl-files:empty { display: none; }
.wl-file { position: relative; width: 84px; border: 1px solid var(--wl-border); border-radius: 12px; overflow: hidden; background: var(--wl-card); }
.wl-file img, .wl-file .wl-file-pdf { display: flex; align-items: center; justify-content: center; width: 100%; height: 64px; object-fit: cover; cursor: zoom-in; font-weight: 700; font-size: calc(12px * var(--ap-scale, 1)); color: var(--wl-muted); text-decoration: none; }
.wl-file.pending { border-style: dashed; }
.wl-file-name { font-size: calc(10px * var(--ap-scale, 1)); padding: 3px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--wl-muted); }
.wl-file button { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 999px; border: 0; background: rgba(0, 0, 0, .55); color: #fff; line-height: 20px; font-size: calc(13px * var(--ap-scale, 1)); cursor: pointer; }
.wl-amount-row { display: flex; gap: 10px; align-items: flex-end; min-width: 0; }
.wl-extra { gap: 6px; margin-top: 6px; }
.wl-extra > input { flex: 1; min-width: 0; }
button.wl-chip { border: 0; cursor: pointer; font: inherit; }
.wl-import-list { max-height: 55vh; overflow: auto; border: 1px solid var(--wl-border); border-radius: 12px; }
.wl-import-row { display: grid; grid-template-columns: 18px 5.5rem 7rem 11rem minmax(0, 1fr) 8rem auto; gap: 6px; align-items: center; padding: 8px; border-bottom: 1px solid var(--wl-border); }
.wl-import-row:last-child { border-bottom: 0; }
.wl-import-row.dup { opacity: .6; }
.wl-import-row .wl-input { font-size: calc(12px * var(--ap-scale, 1)); padding: 5px 8px; min-width: 0; }
.wl-import-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--wl-accent); }
@media (max-width: 760px) {
    .wl-import-row { grid-template-columns: 18px minmax(0, 1fr) minmax(0, 1fr); }
    .wl-import-row [data-e="occurred_at"], .wl-import-row [data-e="note"], .wl-import-row [data-e="category_id"] { grid-column: 2 / -1; }
}
@media (max-width: 480px) {
    .wl-amount-row { flex-wrap: wrap; }
    .wl-amount-row > div { width: 100% !important; max-width: none !important; }
}

/* 手机：外层表单单列；嵌套的小分组（到期月 / 年、申请 / 发卡时间等）占满整行后再两列，日期框不再被挤成「mm/」 */
@media (max-width: 480px) {
    .wl-form { grid-template-columns: minmax(0, 1fr) !important; }
    .wl-form .wl-form { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .wl-form .full, .wl-form > * { min-width: 0; }
}
/* 凭证显示名可以直接改（发票 / 支付截图 / 报销单……） */
.wl-file { width: 104px; }
.wl-file-name-input { display: block; width: 100%; border: 0; border-top: 1px solid var(--wl-border); background: transparent; color: var(--wl-text, inherit);
    font-size: calc(10px * var(--ap-scale, 1)); padding: 3px 5px; outline: none; }
.wl-file-name-input:focus { background: var(--wl-bg, rgba(0, 0, 0, .03)); }
/* 绑定帐号的搜索框 */
.wl-vp { position: relative; display: flex; flex-direction: column; gap: 6px; }
.wl-vp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wl-vp-chips:empty { display: none; }
.wl-vp-chips .wl-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; }
.wl-vp-chips .wl-chip button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: calc(14px * var(--ap-scale, 1)); line-height: 1; padding: 0 2px; }
.wl-vp-list { position: absolute; top: 100%; left: 0; right: 0; z-index: 30; max-height: 240px; overflow: auto; margin-top: 4px;
    background: var(--wl-card); border: 1px solid var(--wl-border); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .12); }
.wl-vp-list button { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: transparent; color: inherit; cursor: pointer;
    font-size: calc(13px * var(--ap-scale, 1)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-vp-list button:hover { background: var(--wl-bg, rgba(0, 0, 0, .04)); }
.wl-vp-list button span { color: var(--wl-muted); font-size: calc(12px * var(--ap-scale, 1)); }

/* 分类与预算：拖拽排序；手机上「名称 + 操作」一行、预算单独一行，不再挤成一团 */
.wl-cat-list { display: flex; flex-direction: column; }
.wl-cat-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--wl-border); background: var(--wl-card); }
.wl-cat-row:last-child { border-bottom: 0; }
.wl-cat-row.is-archived { opacity: .55; }
.wl-cat-row.sortable-ghost { opacity: .35; }
.wl-cat-row.sortable-chosen { box-shadow: 0 6px 18px rgba(0, 0, 0, .12); border-radius: 12px; }
.wl-drag { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 36px; flex: none; color: var(--wl-muted); cursor: grab; touch-action: none; border-radius: 8px; }
.wl-drag:hover { background: var(--wl-soft, rgba(127, 127, 127, .1)); color: var(--wl-text); }
.wl-drag:active { cursor: grabbing; }
.wl-drag .li { width: 18px; height: 18px; }
.wl-cat-name { flex: 1 1 8rem; min-width: 0; }
.wl-cat-budget { display: flex; gap: 6px; flex: 0 1 14rem; min-width: 0; }
.wl-cat-budget > * { flex: 1 1 0; min-width: 0; }
.wl-cat-ops { display: flex; gap: 4px; flex: none; margin-left: auto; }
@media (max-width: 640px) {
    .wl-cat-name { flex-basis: 5rem; }
    .wl-cat-budget { flex: 1 1 100%; order: 3; padding-left: 36px; }
}

/* 共享账本入口上的待处理邀请数 */
.wl-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
    background: var(--wl-expense); color: #fff; font-size: calc(10px * var(--ap-scale, 1)); font-weight: 700; line-height: 1; }
.wl-badge[hidden] { display: none; }
