/* ============ 云账通 · 移动端 H5 ============ */
:root {
    --primary: #2b6cff;
    --primary2: #5a48ff;
    --bg: #f4f6fb;
    --text: #1f2533;
    --text2: #8a93a6;
    --danger: #fa5151;
    --ok: #00b578;
    --radius: 14px;
    --shadow: 0 4px 18px rgba(31, 45, 80, .08);
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    background: var(--bg); color: var(--text); font-size: 15px;
}
.hide { display: none !important; }
input, button, select { font-family: inherit; font-size: 15px; outline: none; border: none; background: none; }
button { cursor: pointer; }

.m-app { max-width: 480px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(70px + env(safe-area-inset-bottom)); }

/* ---------- 顶部 ---------- */
.m-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 16px 6px;
}
.m-head h2 { font-size: 22px; font-weight: 700; }
.m-sub { color: var(--text2); font-size: 12px; margin-top: 4px; }
.m-sub b { color: var(--primary); }
.m-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary2));
    color: #fff; font-size: 17px; font-weight: 600;
    display: flex; align-items: center; justify-content: center;
}

/* ---------- 卡片 ---------- */
.card {
    background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
    margin: 12px 12px 0; padding: 16px;
}
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text2); margin-bottom: 6px; }
.field .req { color: var(--danger); font-style: normal; }
.field input, .field select {
    width: 100%; height: 46px; border-radius: 10px; padding: 0 12px;
    background: #f5f7fb; border: 1px solid transparent;
    transition: border .2s;
}
.field input:focus, .field select:focus { border-color: var(--primary); background: #fff; }
.field-row { display: flex; gap: 12px; }
.field-row .half { flex: 1; min-width: 0; }
.field select { appearance: none; -webkit-appearance: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    padding: 8px 14px; border-radius: 999px; background: #f5f7fb;
    color: var(--text2); font-size: 13px; border: 1px solid transparent; transition: all .15s;
}
.chip.on { background: rgba(43, 108, 255, .1); color: var(--primary); border-color: var(--primary); font-weight: 600; }
.chip.sm { padding: 11px 13px; }

.amount-bar {
    display: flex; justify-content: space-between; align-items: center;
    background: linear-gradient(135deg, rgba(43, 108, 255, .08), rgba(90, 72, 255, .08));
    border-radius: 10px; padding: 12px 14px; margin: 4px 0 16px;
}
.amount-bar span { color: var(--text2); font-size: 13px; }
.amount-bar b { color: var(--primary); font-size: 22px; font-weight: 700; }

/* ---------- 按钮 ---------- */
.btn-main {
    width: 100%; height: 48px; border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary2));
    color: #fff; font-size: 16px; font-weight: 600; letter-spacing: 2px;
    box-shadow: 0 6px 16px rgba(43, 108, 255, .3); transition: opacity .2s;
}
.btn-main:active { opacity: .85; }
.btn-main[disabled] { opacity: .5; }
.btn-main.sm { width: auto; padding: 0 22px; letter-spacing: 1px; height: 42px; font-size: 14px; }
.btn-ghost {
    padding: 10px 18px; border-radius: 10px; background: #f0f2f7; color: var(--text2); font-size: 14px;
}
.btn-code {
    flex-shrink: 0; padding: 0 12px; height: 46px; border-radius: 10px;
    background: rgba(43, 108, 255, .1); color: var(--primary); font-size: 13px; font-weight: 600;
}
.btn-code.disabled { opacity: .5; }

/* ---------- 登录页 ---------- */
.login-hero {
    background: linear-gradient(135deg, var(--primary), var(--primary2));
    padding: 52px 0 68px; text-align: center; color: #fff;
    border-radius: 0 0 32px 32px;
}
.login-logo {
    width: 68px; height: 68px; margin: 0 auto 14px; border-radius: 20px;
    background: rgba(255, 255, 255, .18); font-size: 34px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255, 255, 255, .35);
}
.login-hero h1 { font-size: 26px; letter-spacing: 4px; }
.login-hero p { margin-top: 6px; font-size: 13px; opacity: .8; letter-spacing: 1px; }
.login-card {
    background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
    margin: -40px 16px 0; padding: 6px 18px 20px; position: relative;
}
.login-tabs { display: flex; border-bottom: 1px solid #eef0f5; }
.lt {
    flex: 1; text-align: center; padding: 14px 0; font-size: 15px;
    color: var(--text2); position: relative;
}
.lt.on { color: var(--primary); font-weight: 700; }
.lt.on::after {
    content: ''; position: absolute; left: 50%; transform: translateX(-50%);
    bottom: 0; width: 32px; height: 3px; border-radius: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary2));
}
#loginForm { padding-top: 18px; }
.sms-tip {
    background: rgba(0, 181, 120, .08); color: var(--ok); font-size: 13px;
    border-radius: 8px; padding: 8px 10px; margin-bottom: 12px; text-align: center;
}
.login-foot { text-align: center; color: var(--text2); font-size: 11px; margin-top: 22px; }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; min-width: 0; height: 46px; border-radius: 10px; padding: 0 12px; background: #f5f7fb; }

/* ---------- 搜索 ---------- */
.search-card {
    background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
    margin: 12px 12px 0; padding: 14px 16px;
}
.search-card input[type="text"], .search-card input[type="date"] {
    width: 100%; height: 40px; border-radius: 10px; background: #f5f7fb; padding: 0 12px;
}
.date-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.date-row i { color: var(--text2); font-style: normal; font-size: 13px; }
.date-row input { flex: 1; min-width: 0; }
.search-btns { display: flex; gap: 10px; margin-top: 12px; }
.search-btns .btn-main { flex: 1; }

/* ---------- 历史列表 ---------- */
.h-item {
    background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
    margin: 12px 12px 0; padding: 14px 16px;
}
.h-top { display: flex; justify-content: space-between; align-items: center; }
.h-top b { font-size: 16px; }
.h-tag {
    font-size: 11px; padding: 3px 8px; border-radius: 6px;
    background: rgba(43, 108, 255, .1); color: var(--primary);
}
.h-mid { display: flex; justify-content: space-between; align-items: baseline; margin-top: 10px; }
.h-mid span { color: var(--text2); font-size: 13px; }
.h-mid b { color: var(--text); font-size: 18px; }
.h-mid b em { font-style: normal; color: var(--primary); font-size: 13px; margin-left: 2px; }
.h-meta {
    display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px;
    color: var(--text2); font-size: 11px; border-top: 1px dashed #eef0f5; padding-top: 10px;
}
.h-btns { display: flex; gap: 8px; margin-top: 10px; justify-content: flex-end; }
.h-btns button {
    padding: 6px 14px; border-radius: 8px; font-size: 12px;
    background: #f0f2f7; color: var(--text2);
}
.h-btns .del { color: var(--danger); background: rgba(250, 81, 81, .08); }
.load-more { text-align: center; color: var(--primary); font-size: 13px; padding: 16px; }

/* ---------- 统计 ---------- */
.seg-tabs {
    display: flex; background: #fff; border-radius: 999px; box-shadow: var(--shadow);
    margin: 12px; padding: 4px;
}
.seg {
    flex: 1; text-align: center; padding: 10px 0; font-size: 14px;
    color: var(--text2); border-radius: 999px; transition: all .2s;
}
.seg.on { background: linear-gradient(135deg, var(--primary), var(--primary2)); color: #fff; font-weight: 600; }
.stat-cards { display: flex; gap: 10px; margin: 0 12px; }
.scard {
    flex: 1; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 14px; text-align: center;
}
.scard span { font-size: 11px; color: var(--text2); display: block; }
.scard b { display: block; font-size: 20px; margin-top: 6px; color: var(--primary); font-weight: 700; }
.chart-box { height: 220px; position: relative; }
.chart-box.tall { height: 300px; }
.chart-box canvas { width: 100%; height: 100%; display: block; }
.pie-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 4px 2px 2px; }
.pie-legend .lg-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text2); }
.pie-legend .lg-dot { width: 10px; height: 10px; border-radius: 3px; }
.month-bar {
    display: flex; align-items: center; justify-content: space-between;
    background: #fff; border-radius: 999px; box-shadow: var(--shadow);
    margin: 12px; padding: 6px 10px;
}
.month-bar button {
    width: 36px; height: 36px; border-radius: 50%; background: #f5f7fb;
    color: var(--text); font-size: 20px; line-height: 1;
}
.month-name { font-size: 18px; font-weight: 700; letter-spacing: 1px; }
.month-hint { text-align: center; color: var(--text2); font-size: 11px; margin: 2px 0 8px; }
.rank-list { list-style: none; }
.rank-list li { display: flex; align-items: center; padding: 10px 0; border-bottom: 1px dashed #eef0f5; }
.rank-list li:last-child { border-bottom: none; }
.rank-no {
    width: 22px; height: 22px; border-radius: 6px; background: #f0f2f7;
    color: var(--text2); font-size: 12px; display: flex; align-items: center; justify-content: center;
    margin-right: 10px; font-weight: 600;
}
.rank-list li:nth-child(1) .rank-no { background: rgba(255, 143, 31, .15); color: #ff8f1f; }
.rank-list li:nth-child(2) .rank-no { background: rgba(43, 108, 255, .12); color: var(--primary); }
.rank-list li:nth-child(3) .rank-no { background: rgba(0, 181, 120, .12); color: var(--ok); }
.rank-list .rk-name { flex: 1; font-size: 14px; }
.rank-list .rk-amt { color: var(--primary); font-weight: 600; }

/* ---------- 我的 ---------- */
.profile-hero {
    background: linear-gradient(135deg, var(--primary), var(--primary2));
    border-radius: 0 0 28px 28px; text-align: center; color: #fff; padding: 30px 0 24px;
}
.p-avatar {
    width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 50%;
    background: rgba(255, 255, 255, .2); border: 2px solid rgba(255, 255, 255, .5);
    font-size: 28px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.profile-hero h3 { font-size: 19px; }
.profile-hero p { font-size: 13px; opacity: .85; margin-top: 4px; }
.p-role {
    display: inline-block; margin-top: 10px; font-size: 11px; padding: 4px 12px;
    background: rgba(255, 255, 255, .18); border-radius: 999px;
}
.perm-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.ptag {
    font-size: 12px; padding: 6px 12px; border-radius: 8px;
    background: rgba(43, 108, 255, .08); color: var(--primary);
}
.ptag.all { background: rgba(0, 181, 120, .1); color: var(--ok); }
.ptag.none { background: #f0f2f7; color: var(--text2); }
.menu-card {
    background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
    margin: 12px; overflow: hidden;
}
.menu-item {
    display: flex; align-items: center; gap: 12px; padding: 15px 16px;
    border-bottom: 1px solid #f2f4f8; font-size: 15px; cursor: pointer;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: #f8f9fc; }
.menu-item svg { width: 21px; height: 21px; fill: var(--primary); }
.menu-item .danger { color: var(--danger); }
.menu-item .danger ~ svg { fill: var(--danger); }
.menu-item .arrow {
    margin-left: auto; width: 8px; height: 8px;
    border-top: 2px solid #c6cdd9; border-right: 2px solid #c6cdd9;
    transform: rotate(45deg);
}
.m-foot-meta { text-align: center; color: var(--text2); font-size: 11px; padding: 18px 0; }
.empty-tip { text-align: center; color: var(--text2); font-size: 13px; padding: 30px 0; }

/* ---------- 弹层 ---------- */
.m-mask, .m-mask-on {
    position: fixed; inset: 0; background: rgba(20, 28, 46, .5);
    opacity: 0; visibility: hidden; transition: opacity .25s; z-index: 90;
}
.m-mask.show { opacity: 1; visibility: visible; }
.m-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
    transform: translateY(105%); transition: transform .28s ease;
}
.m-sheet.show { transform: translateY(0); }
.sheet-box {
    max-width: 480px; margin: 0 auto; background: #fff;
    border-radius: 20px 20px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
}
.sheet-box h3 { text-align: center; font-size: 17px; margin-bottom: 16px; }
.sheet-btns { display: flex; gap: 10px; margin-top: 6px; }
.sheet-btns .btn-ghost { flex: 1; text-align: center; }
.sheet-btns .btn-main { flex: 1; }

/* ---------- 底部导航 ---------- */
.m-tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
    max-width: 480px; margin: 0 auto; display: flex;
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px);
    border-top: 1px solid #edf0f5; padding-bottom: env(safe-area-inset-bottom);
}
.m-tabbar a {
    flex: 1; text-align: center; padding: 8px 0 6px; color: var(--text2);
    text-decoration: none; font-size: 11px; position: relative;
}
.m-tabbar a svg { width: 23px; height: 23px; fill: currentColor; display: block; margin: 0 auto 2px; }
.m-tabbar a.on { color: var(--primary); font-weight: 600; }
.m-tabbar a.on::before {
    content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 24px; height: 3px; border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary2));
}

/* ---------- Toast ---------- */
.m-toast {
    position: fixed; left: 50%; top: 45%; transform: translate(-50%, -50%) scale(.9);
    background: rgba(20, 28, 46, .85); color: #fff; font-size: 14px;
    padding: 12px 22px; border-radius: 10px; z-index: 999;
    opacity: 0; visibility: hidden; transition: all .25s; max-width: 78%; text-align: center;
}
.m-toast.show { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }

/* ---------- 无权限 ---------- */
.deny-box { text-align: center; padding-top: 26vh; }
.deny-box svg { width: 62px; height: 62px; fill: #c6cdd9; }
.deny-box h3 { margin: 14px 0 8px; font-size: 18px; }
.deny-box p { color: var(--text2); font-size: 13px; line-height: 1.8; margin-bottom: 20px; }
.deny-box .btn-main { display: inline-block; width: auto; padding: 0 28px; letter-spacing: 1px; }
