/* ============================================================
   wallet.css · 钱包 / 卡包
   两张卡叠放，点后面那张换到前面；下面是当前卡的收支
   ============================================================ */

#page-wallet { display: none; }
#page-wallet.active { display: flex; }
#page-wallet {
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    background: var(--bg-deep, #0A0610);
    color: var(--text);
}
html[data-mode="day"] #page-wallet {
    background: linear-gradient(180deg, var(--day-bg) 0%, var(--day-bg-2) 100%);
    color: var(--day-ink);
}

/* ---------- 顶栏 ---------- */
.wl-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 18px 8px;
}
.wl-back {
    width: 30px; height: 30px;
    border: 0; background: none; padding: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-dim);
    cursor: pointer;
}
.wl-back .icon-back { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wl-title { flex: 1; font-size: 17px; letter-spacing: .06em; }
.wl-edit {
    border: 0; background: none; padding: 4px 2px;
    font-size: 12px; letter-spacing: .04em;
    color: var(--primary);
    cursor: pointer;
    font-family: inherit;
}
html[data-mode="day"] .wl-edit { color: var(--day-accent); }

/* ---------- 内容 ---------- */
.wl-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0 18px calc(14px + env(safe-area-inset-bottom, 0px));
}

/* ---------- 卡叠 ---------- */
.wl-stack {
    position: relative;
    flex: 0 0 auto;
    height: 244px;
    margin-top: 8px;
}
.wl-card {
    position: absolute;
    left: 0; right: 0;
    top: 0;
    height: 196px;
    border: 0;
    border-radius: 20px;
    padding: 16px 18px;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    transition: transform .32s cubic-bezier(.22,.7,.3,1), box-shadow .3s, opacity .3s;
    will-change: transform;
}
/* 当前卡往下挪，后面那张露出「头」（顶边 + 品牌行） */
.wl-card.is-front {
    transform: translateY(46px) scale(1);
    z-index: 3;
    box-shadow: 0 26px 48px -26px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.wl-card.is-back {
    transform: translateY(0) scale(.94);
    z-index: 1;
    box-shadow: 0 14px 30px -24px rgba(0, 0, 0, .95);
}
/* 后面那张只露头：品牌行留着，其余数据藏起来 */
.wl-card.is-back .wl-mid,
.wl-card.is-back .wl-bal,
.wl-card.is-back .wl-ft {
    opacity: 0;
}
.wl-card.is-back .wl-top { opacity: .55; }
.wl-card.is-back .wl-sheen { opacity: .30; }

/* 主卡：洋红 */
.wl-df {
    background:
        radial-gradient(90% 120% at 12% 0%, rgba(255, 214, 232, .35), rgba(255, 214, 232, 0) 55%),
        linear-gradient(135deg, #4A1230 0%, #8E2350 46%, #D46A93 100%);
    color: #FFF6FA;
}
/* 副卡：深墨 + 金 */
.wl-save {
    background:
        radial-gradient(90% 120% at 12% 0%, rgba(201, 166, 107, .28), rgba(201, 166, 107, 0) 55%),
        linear-gradient(135deg, #16121C 0%, #262030 52%, #3C3446 100%);
    color: #F6EFE3;
}
.wl-sheen {
    position: absolute;
    inset: -40% -20% auto -20%;
    height: 150%;
    background: linear-gradient(102deg, rgba(255,255,255,.18) 0%, rgba(255,255,255,0) 38%, rgba(255,255,255,.06) 60%, rgba(255,255,255,0) 100%);
    transform: rotate(-8deg);
    pointer-events: none;
}
.wl-top { display: flex; align-items: baseline; justify-content: space-between; }
.wl-brand {
    font-family: 'Cormorant Garamond', 'Noto Serif SC', serif;
    font-size: 19px; letter-spacing: .04em;
    font-style: italic;
}
.wl-tag { font-size: 8.5px; letter-spacing: .18em; opacity: .62; }
.wl-mid { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.wl-chip {
    width: 30px; height: 22px; border-radius: 5px;
    background: linear-gradient(140deg, #E9D6A8, #B89457 60%, #D9C083);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18);
    position: relative;
}
.wl-chip::after {
    content: ""; position: absolute; inset: 6px 8px;
    border-left: 1px solid rgba(0, 0, 0, .22);
    border-right: 1px solid rgba(0, 0, 0, .22);
}
.wl-num { font-size: 11.5px; letter-spacing: .18em; opacity: .78; }
.wl-bal {
    margin-top: auto;
    font-size: 27px; letter-spacing: .02em;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 0 rgba(0, 0, 0, .18);
}
.wl-ft { display: flex; align-items: baseline; justify-content: space-between; margin-top: 6px; }
.wl-holder { font-size: 11px; letter-spacing: .14em; opacity: .85; }
.wl-cname { font-size: 10px; letter-spacing: .14em; opacity: .6; }

/* ---------- 流水 ---------- */
.wl-ledger-head {
    display: flex; align-items: baseline; justify-content: space-between;
    margin: 14px 2px 6px;
    font-size: 11px; letter-spacing: .14em;
    color: var(--text-dim);
}
.wl-ledger-count { font-size: 10px; opacity: .6; }
.wl-ledger {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(180deg, #000 92%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 92%, transparent 100%);
}
.wl-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 2px;
    border-bottom: 1px solid rgba(246, 240, 244, .06);
}
html[data-mode="day"] .wl-row { border-bottom-color: rgba(36, 26, 34, .07); }
.wl-row-main { flex: 1; min-width: 0; }
.wl-row-r { font-size: 13px; color: var(--text); }
html[data-mode="day"] .wl-row-r { color: var(--day-ink); }
.wl-row-t { display: block; margin-top: 3px; font-size: 10.5px; color: var(--text-dim); opacity: .6; }
.wl-row-side { text-align: right; }
.wl-row-amt { display: block; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--text); }
.wl-row-amt.plus { color: #7FD3A3; }
html[data-mode="day"] .wl-row-amt.plus { color: #2E8B57; }
.wl-row-bal { display: block; margin-top: 3px; font-size: 10px; color: var(--text-dim); opacity: .55; }

.wl-empty {
    padding: 28px 0;
    text-align: center;
    font-size: 12px; line-height: 1.9;
    color: var(--text-dim);
    opacity: .6;
}

/* ---------- 改余额 ---------- */
.wl-edit-wrap {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: none;
}
.wl-edit-wrap.active { display: block; }
.wl-edit-mask {
    position: absolute; inset: 0;
    background: rgba(6, 4, 10, .6);
    backdrop-filter: blur(6px);
}
.wl-edit-box {
    position: absolute;
    left: 16px; right: 16px; top: 50%;
    transform: translateY(-50%);
    padding: 20px 18px 16px;
    border-radius: 18px;
    background: linear-gradient(180deg, #171020, #100A17);
    box-shadow: inset 0 0 0 1px rgba(246, 240, 244, .08), 0 30px 60px -30px rgba(0, 0, 0, .9);
}
html[data-mode="day"] .wl-edit-box {
    background: #FFFFFF;
    box-shadow: inset 0 0 0 1px rgba(36, 26, 34, .10), 0 30px 50px -30px rgba(36, 26, 34, .5);
}
.wl-edit-t { font-size: 15px; letter-spacing: .04em; }
.wl-edit-d { margin-top: 6px; font-size: 11px; line-height: 1.7; color: var(--text-dim); opacity: .7; }
.wl-edit-input {
    width: 100%; margin-top: 14px;
    height: 44px; padding: 0 14px;
    border-radius: 12px;
    border: 1px solid rgba(246, 240, 244, .14);
    background: rgba(246, 240, 244, .04);
    color: var(--text);
    font-size: 16px;
    font-family: inherit;
    outline: none;
}
html[data-mode="day"] .wl-edit-input {
    border-color: rgba(36, 26, 34, .12);
    background: #FFF;
    color: var(--day-ink);
}
.wl-edit-quick { display: flex; gap: 8px; margin-top: 10px; }
.wl-edit-quick button {
    flex: 1; height: 34px;
    border: 1px solid rgba(246, 240, 244, .12);
    background: rgba(246, 240, 244, .04);
    color: var(--text-dim);
    border-radius: 10px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
}
html[data-mode="day"] .wl-edit-quick button {
    border-color: rgba(36, 26, 34, .12);
    background: #FFF;
    color: var(--day-dim);
}
.wl-edit-actions { display: flex; gap: 10px; margin-top: 16px; }
.wl-btn {
    flex: 1; height: 44px;
    border: 0; border-radius: 22px;
    font-size: 14px; letter-spacing: .06em;
    color: #1B0C14;
    background: linear-gradient(180deg, #E07BA2, #C4577F);
    box-shadow: 0 10px 24px -14px rgba(212, 106, 147, .8);
    cursor: pointer;
    font-family: inherit;
}
.wl-btn.ghost {
    background: transparent;
    color: var(--text-dim);
    box-shadow: inset 0 0 0 1px rgba(246, 240, 244, .12);
}
html[data-mode="day"] .wl-btn { color: #FFF7F9; background: linear-gradient(180deg, #C24A76, #A8335B); }
html[data-mode="day"] .wl-btn.ghost { background: #FFF; color: var(--day-dim); box-shadow: inset 0 0 0 1px rgba(36, 26, 34, .12); }

/* ---------- 我 tab 里的入口 ---------- */
.me-wallet-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(246, 240, 244, .10);
    background: linear-gradient(180deg, rgba(246, 240, 244, .05), rgba(246, 240, 244, .02));
    color: var(--text);
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}
html[data-mode="day"] .me-wallet-btn {
    border-color: rgba(36, 26, 34, .10);
    background: #FFFFFF;
    color: var(--day-ink);
}
.me-wallet-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.me-wallet-t { font-size: 14px; letter-spacing: .04em; }
.me-wallet-d { font-size: 11px; color: var(--text-dim); opacity: .65; }
.me-wallet-amt { font-size: 14px; font-variant-numeric: tabular-nums; color: var(--primary); }
html[data-mode="day"] .me-wallet-amt { color: var(--day-accent); }
