:root {
  --bg: #f3f5f9;
  --card: #ffffff;
  --line: #e6e9f0;
  --line-soft: #f0f2f6;
  --txt: #131822;
  --txt-2: #495064;
  --muted: #868da0;
  --pri: #2b6cf6;
  --pri-2: #4a80f7;
  --pri-soft: #eaf1ff;
  --ok: #0d8a5f;
  --ok-soft: #e6f6ef;
  --warn: #b26b00;
  --warn-soft: #fdf3e2;
  --red: #c8362f;
  --red-soft: #fdecea;
  --purple: #6b4fbf;
  --radius: 16px;
  --hair: 1px solid rgba(16, 24, 40, .055);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow: 0 1px 2px rgba(16, 24, 40, .03), 0 10px 26px -18px rgba(16, 24, 40, .3);
  --shadow-lift: 0 2px 6px rgba(16, 24, 40, .05), 0 16px 30px -20px rgba(16, 24, 40, .42);
  --blue-grad: linear-gradient(140deg, #2f6df6 0%, #4a80f7 52%, #6d99ff 100%);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }

.only-mobile { display: none; }
.only-pc { display: inline-flex; }
.tabbar { display: none; }
.fab { display: none; }
.topbar-txt { min-width: 0; }
.topbar-sub { display: block; font-size: 11.5px; color: #9aa1b2; letter-spacing: .4px; margin-bottom: 1px; }
.nav-ico svg { width: 18px; height: 18px; display: block; }
.topbar .topbar-avatar { display: none; }

/* ---------- login ---------- */
.login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: radial-gradient(120% 90% at 50% 0%, #e7efff 0%, #f3f5f9 58%);
}
.login-card {
  width: 100%; max-width: 366px; background: var(--card); border: var(--hair);
  border-radius: 22px; padding: 32px 26px 24px; box-shadow: 0 22px 50px -22px rgba(16, 24, 40, .28);
}
.brand-mark {
  width: 46px; height: 46px; border-radius: 14px; background: var(--blue-grad); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 21px; font-weight: 500;
  letter-spacing: 1px; margin-bottom: 16px; box-shadow: 0 8px 18px -6px rgba(43, 108, 246, .55);
}
.brand-mark.sm { width: 36px; height: 36px; border-radius: 11px; font-size: 16px; margin: 0; flex: none; }
.login-card h1 { font-size: 23px; font-weight: 600; letter-spacing: -.3px; }
.brand-name { margin: 0 0 22px; }
.login-sub { color: var(--muted); font-size: 13px; margin: 5px 0 22px; }
.login-err { color: var(--red); font-size: 12.5px; min-height: 18px; margin: 2px 0 6px; }
.login-hint { color: var(--muted); font-size: 11.5px; margin-top: 16px; text-align: center; line-height: 1.6; }

.login-links { text-align: right; margin-top: 8px; }
.link-btn { border: 0; background: none; color: var(--pri); font-size: 12.5px; padding: 4px 0; }
.link-btn:hover { text-decoration: underline; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12.5px; color: var(--txt-2); margin-bottom: 6px; }
.field > span .req { font-style: normal; font-size: 11.5px; color: var(--red); margin-left: 3px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px;
  background: #f8f9fc; outline: none; transition: border-color .15s, background .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--pri); background: #fff; box-shadow: 0 0 0 3px rgba(43, 108, 246, .1);
}
.field textarea { min-height: 76px; resize: vertical; }
.field select:invalid { color: #9aa1ae; }
.field select.need { border-color: var(--red); background: #fff; box-shadow: 0 0 0 3px rgba(200, 54, 47, .1); }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }

.side {
  width: 228px; flex: none; background: #fff; border-right: 1px solid rgba(16, 24, 40, .055);
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 20px 14px 14px;
}
.side-brand { display: flex; align-items: center; gap: 11px; padding: 0 5px 22px; }
.side-title { font-size: 15.5px; font-weight: 600; letter-spacing: -.2px; }
.side-sub { font-size: 11.5px; color: var(--muted); }
.side-nav { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 11px;
  color: var(--txt-2); background: none; border: none; text-align: left; width: 100%; font-size: 13.5px;
  position: relative; transition: background .15s ease, color .15s ease;
}
.nav-item:hover { background: #f5f7fa; }
.nav-item.on { background: linear-gradient(90deg, #eaf1ff, #f4f8ff); color: var(--pri); font-weight: 600; }
.nav-item.on::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 16px; border-radius: 0 3px 3px 0; background: var(--pri);
}
.nav-ico { width: 18px; text-align: center; font-size: 13px; opacity: .8; flex: none; }
.nav-item.on .nav-ico { opacity: 1; }
.nav-badge {
  margin-left: auto; background: var(--red); color: #fff; font-size: 11px; line-height: 1;
  padding: 3px 6px; border-radius: 20px; min-width: 18px; text-align: center;
  box-shadow: 0 2px 6px -1px rgba(200, 54, 47, .5);
}
.side-foot {
  display: flex; align-items: center; gap: 9px; background: #f6f7fa;
  border-radius: 13px; padding: 9px 10px; margin-top: 12px;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--pri-soft); color: var(--pri);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex: none;
}
.side-user { min-width: 0; }
.side-user > div:first-child { font-size: 13px; font-weight: 500; }
.side-role { font-size: 11px; color: var(--muted); }
.icon-btn {
  border: var(--hair); background: #fff; border-radius: 9px; width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center; color: var(--txt-2);
}
.icon-btn:hover { background: #f5f7fa; }
.side-foot .icon-btn { margin-left: auto; border: 0; background: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 20px 28px 15px;
  position: sticky; top: 0; z-index: 20; background: rgba(243, 245, 249, .86);
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(16, 24, 40, .04);
}
.topbar h1 { font-size: 21px; font-weight: 600; letter-spacing: -.45px; line-height: 1.25; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.wrap { padding: 14px 28px 48px; max-width: 1160px; width: 100%; margin: 0 auto; }

/* ---------- generic ---------- */
.card { background: var(--card); border: var(--hair); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--line-soft); }
.card-head h2 { font-size: 14px; font-weight: 600; }
.card-head .more { margin-left: auto; font-size: 12.5px; color: var(--pri); background: none; border: none; }
.card-body { padding: 15px 18px; }

.grid { display: grid; gap: 14px; }
.grid.acc { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid.kpi { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }

.section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--txt-2);
  margin: 24px 0 10px; letter-spacing: 0;
}
.section-title::before {
  content: ''; width: 3px; height: 12px; border-radius: 2px;
  background: linear-gradient(180deg, var(--pri-2), var(--pri)); flex: none;
}

.btn {
  border: var(--hair); background: #fff; border-radius: 10px; padding: 8px 14px;
  font-size: 13px; color: var(--txt-2); transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: rgba(16, 24, 40, .14); background: #fafbfc; }
.btn-primary {
  background: var(--blue-grad); border-color: transparent; color: #fff;
  box-shadow: 0 6px 14px -6px rgba(43, 108, 246, .65);
}
.btn-primary:hover { background: linear-gradient(140deg, #2a66ee, #4379f2); border-color: transparent; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: #0b7a54; }
.btn-danger { color: var(--red); border-color: #f3d3d0; background: #fff; }
.btn-danger:hover { background: var(--red-soft); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn:disabled, .btn[disabled] { opacity: .42; cursor: not-allowed; background: #f7f8fa; }
.btn-block { width: 100%; padding: 11px; font-size: 14px; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--txt-2); }

.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; line-height: 1;
  padding: 4px 7px; border-radius: 6px; background: var(--line-soft); color: var(--txt-2); white-space: nowrap;
  font-weight: 400;
}
.badge.pending { background: var(--warn-soft); color: var(--warn); }
.badge.approved { background: var(--ok-soft); color: var(--ok); }
.badge.rejected { background: var(--red-soft); color: var(--red); }
.badge.in { background: var(--pri-soft); color: var(--pri); }
.badge.out { background: #f3f0fa; color: var(--purple); }

.amt { font-variant-numeric: tabular-nums; letter-spacing: -.2px; }
.amt.in { color: var(--ok); }
.amt.out { color: var(--txt); }
.amt.big { font-size: 24px; font-weight: 500; letter-spacing: -.6px; }
.mono { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11.5px; }

/* ---------- 账户卡 ---------- */
.acc-card {
  position: relative; overflow: hidden; padding: 18px 20px 16px;
  background: var(--blue-grad); border: 0; color: #fff;
  box-shadow: 0 16px 30px -18px rgba(43, 108, 246, .7), 0 2px 6px rgba(43, 108, 246, .14);
}
.acc-card::after {
  content: ''; position: absolute; right: -46px; top: -62px; width: 150px; height: 150px;
  border-radius: 50%; background: rgba(255, 255, 255, .13); pointer-events: none;
}
.acc-card::before {
  content: ''; position: absolute; right: 30px; bottom: -52px; width: 104px; height: 104px;
  border-radius: 50%; background: rgba(255, 255, 255, .07); pointer-events: none;
}
.acc-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.acc-name {
  font-size: 12.5px; color: rgba(255, 255, 255, .88); letter-spacing: .3px;
  display: flex; align-items: center; gap: 6px;
}
.acc-name::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .6); flex: none; }
.acc-tag { margin-left: auto; }
.acc-bal { font-size: 27px; font-weight: 600; letter-spacing: -1px; font-variant-numeric: tabular-nums; text-shadow: 0 1px 3px rgba(12, 40, 100, .14); }
.acc-meta { font-size: 11.5px; color: rgba(255, 255, 255, .74); margin-top: 9px; display: flex; gap: 12px; flex-wrap: wrap; }

.acc-empty { background: #fff; color: var(--txt); border: 1px dashed #d7dce6; box-shadow: none; }
.acc-empty::after, .acc-empty::before { display: none; }
.acc-empty .acc-name { color: var(--txt-2); font-size: 13.5px; font-weight: 500; }
.acc-empty .acc-name::before { background: #c9cfda; }

.kpi-card { padding: 15px 16px 14px 18px; position: relative; overflow: hidden; }
.kpi-card::before {
  content: ''; position: absolute; left: 0; top: 15px; bottom: 15px; width: 3px;
  border-radius: 0 3px 3px 0; background: #dfe3ea;
}
.kpi-card:nth-child(1)::before { background: #f2a93b; }
.kpi-card:nth-child(2)::before { background: var(--pri); }
.kpi-card:nth-child(3)::before { background: #12a06d; }
.kpi-card:nth-child(4)::before { background: #7a6ee0; }
.kpi-label { font-size: 12px; color: var(--muted); }
.kpi-val { font-size: 20px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.kpi-sub { font-size: 11px; color: #a3a9b6; margin-top: 3px; }

/* ---------- 卡片化列表 ---------- */
.list-card {
  background: none; border: 0; box-shadow: none; border-radius: 0;
  display: flex; flex-direction: column; gap: 8px; overflow: visible;
}
.row {
  display: flex; align-items: center; gap: 12px; padding: 13px 18px; width: 100%; text-align: left;
  background: #fff; border: var(--hair); border-radius: 14px; box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.row:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); border-color: rgba(43, 108, 246, .2); }
.row:last-child { border-bottom: var(--hair); }

/* 待审核：蓝色描边提醒 */
.row.is-pending {
  border-color: rgba(43, 108, 246, .5);
  box-shadow: 0 0 0 .5px rgba(43, 108, 246, .32), var(--shadow-sm);
  background: linear-gradient(180deg, #f8fbff 0%, #fff 52%);
}
.row.is-pending:hover {
  border-color: rgba(43, 108, 246, .68);
  box-shadow: 0 0 0 .5px rgba(43, 108, 246, .32), var(--shadow-lift);
}
.row-main { flex: 1; min-width: 0; }
.row-t1 { font-size: 13.5px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-weight: 500; }
.row-t2 { font-size: 11.5px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-t2 > span + span::before { content: '·'; margin: 0 5px; color: #ccd0d8; }
.row-desc { color: #b0b5c0; }
.row-amt { text-align: right; flex: none; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.row-amt .small { display: block; margin-top: 3px; font-size: 10.5px; font-weight: 400; }

.list-card > .empty { background: #fff; border: var(--hair); border-radius: 14px; }

/* 设置/往来：桌面保持整体卡片容器 */
.list-panel { overflow: hidden; }
.list-panel > .payable-row { border-bottom: 1px solid var(--line-soft); }
.list-panel > .card-body { border-top: 0; }
.list-panel > .card-body.card-hint { border-top: 0; }

.payable-row { display: flex; align-items: center; gap: 12px; padding: 13px 18px; }
.payable-row .avatar { width: 34px; height: 34px; font-size: 13px; }

.thumb {
  width: 38px; height: 38px; border-radius: 12px; flex: none; display: flex; align-items: center;
  justify-content: center; font-size: 12.5px; font-weight: 500; background: var(--line-soft); color: var(--txt-2);
}
.thumb.in { background: #e8f1ff; color: var(--pri); }
.thumb.out { background: #f2eefc; color: var(--purple); }
.thumb.move { background: #eaf7f1; color: #10855f; }

.empty { padding: 44px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.empty-ico { font-size: 26px; opacity: .35; display: block; margin-bottom: 8px; }

/* ---------- filters ---------- */
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip {
  border: var(--hair); background: #fff; border-radius: 20px; padding: 6px 14px;
  font-size: 12.5px; color: var(--txt-2); white-space: nowrap; flex: none;
  box-shadow: var(--shadow-sm); transition: .15s;
}
.chip.on { background: var(--pri); border-color: var(--pri); color: #fff; box-shadow: 0 6px 14px -6px rgba(43, 108, 246, .7); }
.chip:hover:not(.on) { border-color: rgba(43, 108, 246, .28); }

/* ---------- 时间区间 ---------- */
.range-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.rg-presets { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; order: 1; }
.rg-presets::-webkit-scrollbar { display: none; }
.rg-chip {
  border: var(--hair); background: #fff; border-radius: 20px; padding: 6px 13px;
  font-size: 12.5px; color: var(--txt-2); white-space: nowrap; flex: none; transition: .15s;
}
.rg-chip:hover { border-color: rgba(43, 108, 246, .28); }
.rg-chip.on {
  background: var(--pri-soft); border-color: rgba(43, 108, 246, .34);
  color: var(--pri); font-weight: 500;
}
.rg-dates {
  order: 2; display: flex; align-items: center; gap: 7px; flex: none;
  background: #fff; border: var(--hair); border-radius: 11px; padding: 6px 12px;
  box-shadow: var(--shadow-sm);
}
.rg-date {
  border: 0; background: transparent; outline: none; padding: 3px 0;
  font-size: 12.5px; color: var(--txt); font-variant-numeric: tabular-nums;
  width: 112px; min-width: 0; color-scheme: light; cursor: pointer;
}
.rg-date:hover { color: var(--pri); }
.rg-date::-webkit-calendar-picker-indicator { opacity: .4; cursor: pointer; }
.rg-date:hover::-webkit-calendar-picker-indicator { opacity: .85; }
.rg-sep { font-size: 12px; color: #b3b9c5; flex: none; }
.rg-sum { order: 3; margin-left: auto; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rg-x {
  flex: none; border: 0; background: transparent; cursor: pointer;
  width: 20px; height: 20px; border-radius: 50%; padding: 0;
  font-size: 11px; line-height: 20px; color: #a8afbb; transition: .15s;
}
.rg-x:hover { background: #f0f2f6; color: var(--txt); }

/* ---------- 加载中 / 加载更多 / 翻页 ---------- */
.spin {
  display: inline-block; width: 13px; height: 13px; border-radius: 50%;
  border: 1.6px solid rgba(43, 108, 246, .22); border-top-color: var(--pri);
  animation: spin .7s linear infinite; flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.load-first {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 40px 20px; font-size: 13px; color: var(--muted);
}
.load-more {
  margin: 12px 0 4px; padding: 13px; text-align: center; cursor: pointer;
  font-size: 12.5px; color: var(--pri); background: #fff;
  border: var(--hair); border-radius: 14px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.load-more:active { background: #f6f9ff; }
.load-end { margin: 13px 0 4px; text-align: center; font-size: 12px; color: #a2a9b7; }
.list-more-tip {
  padding: 12px; text-align: center; font-size: 12.5px; color: var(--pri);
  cursor: pointer; border-top: var(--hair);
}
.list-more-tip:hover { background: #f7faff; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 15px 0 4px; }
.pager-info { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pager-info b { color: var(--txt); font-weight: 600; }

/* ---------- modal ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .4); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0; } }
.sheet {
  background: #fff; border-radius: 20px; width: 100%; max-width: 540px; max-height: 90vh;
  display: flex; flex-direction: column; box-shadow: 0 28px 70px -20px rgba(16, 24, 40, .4);
}
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.sheet-head h3 { font-size: 15.5px; font-weight: 600; }
.sheet-head .icon-btn { margin-left: auto; border: 0; background: #f4f6f9; border-radius: 50%; }
.sheet-body { padding: 18px 20px; overflow-y: auto; }
.sheet-foot { padding: 14px 20px; border-top: 1px solid var(--line-soft); display: flex; gap: 8px; }
.sheet-foot .btn { flex: 1; padding: 11px; font-size: 14px; }
.sheet-foot .btn-primary { flex: 2; }

.type-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-bottom: 18px; }
.type-btn {
  border: var(--hair); background: #f8f9fc; border-radius: 11px; padding: 10px 4px;
  font-size: 12.5px; color: var(--txt-2); text-align: center; transition: .15s;
}
.type-btn.on { background: var(--pri); border-color: var(--pri); color: #fff; font-weight: 500; box-shadow: 0 6px 14px -6px rgba(43, 108, 246, .7); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- 币种与折算 ---------- */
.cur-seg { display: flex; gap: 8px; }
.cur-btn {
  flex: 1; border: var(--hair); background: #f8f9fc; border-radius: 11px;
  padding: 10px 8px; font-size: 13.5px; color: var(--txt-2); transition: .15s;
}
.cur-btn:hover { border-color: rgba(43, 108, 246, .3); }
.cur-btn.on {
  background: var(--pri); border-color: var(--pri); color: #fff; font-weight: 500;
  box-shadow: 0 6px 14px -6px rgba(43, 108, 246, .7);
}
.fx-box {
  margin-top: 9px; padding: 10px 13px; border-radius: 11px;
  background: linear-gradient(140deg, #eef5ff, #f7faff); border: 1px solid #dce9ff;
  display: flex; flex-direction: column; gap: 3px;
}
.fx-box b { font-size: 15.5px; font-weight: 600; color: var(--pri); font-variant-numeric: tabular-nums; }
.fx-meta { font-size: 11px; color: #7488aa; }
.fx-wait { font-size: 12px; color: #8a91a0; }
.form-tip {
  background: #f2f6ff; border: 1px solid rgba(43, 108, 246, .16); color: #3c5c99;
  border-radius: 10px; padding: 9px 11px; font-size: 12px; line-height: 1.6; margin-bottom: 12px;
}
.cur-tag {
  font-size: 9.5px; line-height: 1; padding: 3px 5px; border-radius: 4px;
  background: #eef4ff; color: #3a6fd0; font-weight: 600; letter-spacing: .3px;
}
.fx-sub { color: #8f96a5 !important; }

.rate-row { display: flex; align-items: center; gap: 10px; }
.rate-val { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }
.rate-edit { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.rate-edit .inp-num { width: 120px; }
.fx-toggle { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--txt-2); margin: -4px 0 12px; }
.fx-toggle input { width: auto; }

.detail-line { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.detail-line:last-child { border-bottom: 0; }
.detail-line .k { color: var(--muted); flex: none; min-width: 76px; padding-right: 6px; }
.detail-line .v { flex: 1; word-break: break-all; }

.toast {
  position: fixed; left: 50%; bottom: 60px; transform: translateX(-50%) translateY(12px);
  background: #1d2430; color: #fff; padding: 10px 18px; border-radius: 11px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: .22s; z-index: 200; max-width: 80vw; text-align: center;
  box-shadow: 0 12px 28px -10px rgba(16, 24, 40, .5);
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

.inp-name {
  width: 100%; border: 0; background: transparent; padding: 4px 8px; font-size: 14px; font-weight: 500;
  color: var(--txt); border-radius: 8px; margin-left: -8px; transition: background .15s, box-shadow .15s;
}
.inp-name:hover { background: #f4f6f9; }
.inp-name:focus { outline: none; background: #fff; box-shadow: inset 0 0 0 1.5px var(--pri); }
.inp-num {
  width: 110px; text-align: right; border: 1px solid var(--line); border-radius: 9px;
  padding: 7px 9px; font-size: 13px; background: #f8f9fc; font-variant-numeric: tabular-nums;
}
.inp-num:focus { outline: none; border-color: var(--pri); background: #fff; }

.seg { display: flex; background: var(--line-soft); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font-size: 12.5px; color: var(--txt-2); }
.seg button.on { background: #fff; color: var(--txt); box-shadow: var(--shadow-sm); }

.month-bar { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.month-bar .mono { font-size: 15px; font-weight: 600; }
.month-bar .btn { margin-left: auto; }

/* ---------- 类目 chips / 凭证图片 ---------- */
.chips-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-wrap .chip { flex: none; }
.clip { font-size: 10.5px; color: var(--muted); }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb-item {
  position: relative; width: 76px; height: 76px; border-radius: 11px; overflow: hidden;
  border: var(--hair); background: #f7f8fa; flex: none;
}
.thumb-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-item img[data-act] { cursor: zoom-in; }
.thumb-del {
  position: absolute; top: 3px; right: 3px; width: 19px; height: 19px; border-radius: 50%;
  border: 0; background: rgba(16, 24, 40, .62); color: #fff; font-size: 10px; line-height: 1; padding: 0;
}
.thumb-add {
  width: 76px; height: 76px; border: 1px dashed #d5d9e0; border-radius: 11px; background: #fafbfd;
  display: flex; align-items: center; justify-content: center; color: var(--muted);
  font-size: 20px; flex: none; cursor: pointer; transition: .15s;
}
.thumb-add:hover { border-color: var(--pri); color: var(--pri); background: #fff; }
.img-sheet { max-width: 680px; }

.loading { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .72); font-size: 13px; color: var(--muted); }

/* ================= 宽屏：单据卡片两列 ================= */
@media (min-width: 1180px) {
  .list-card { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: stretch; }
  .list-card > .row { align-self: stretch; }
  .list-card > .empty { grid-column: 1 / -1; }
}

/* ================= 手机端 ================= */
@media (max-width: 880px) {

  body { background: #f4f6fa; }
  .only-mobile { display: inline-flex; }
  .only-pc { display: none !important; }

  /* 顶部 */
  .side { display: none; }
  .topbar {
    padding: calc(8px + env(safe-area-inset-top)) 18px 12px;
    background: linear-gradient(180deg, rgba(247, 249, 252, .96) 0%, rgba(244, 246, 250, .9) 100%);
    align-items: flex-end;
  }
  .topbar-txt { flex: 1; min-width: 0; }
  .topbar-sub { margin-bottom: 2px; }
  .topbar h1 { font-size: 25px; letter-spacing: -.6px; }
  .topbar-actions { margin-left: auto; padding-bottom: 3px; }
  .topbar .topbar-avatar {
    display: flex; width: 38px; height: 38px; font-size: 13px; font-weight: 600;
    background: linear-gradient(140deg, #dce8ff, #eef3ff); color: var(--pri);
    border: 1px solid rgba(43, 108, 246, .18); box-shadow: 0 3px 10px -2px rgba(43, 108, 246, .22);
    padding: 0;
  }

  .wrap { padding: 14px 14px calc(142px + env(safe-area-inset-bottom)); max-width: none; }

  /* 账户卡横向滑动，一行两张 */
  .grid.acc {
    display: flex; gap: 10px; overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
    margin: 0 -14px; padding: 2px 14px 5px; scrollbar-width: none;
  }
  .grid.acc::-webkit-scrollbar { display: none; }
  .grid.acc > .acc-card {
    flex: 0 0 calc(50% - 5px); scroll-snap-align: start;
    border-radius: 16px; padding: 13px 14px 12px;
  }
  .grid.acc > .acc-card.acc-empty { flex-basis: 100%; }
  .grid.acc .acc-top { margin-bottom: 7px; gap: 5px; }
  .grid.acc .acc-name { font-size: 11.5px; gap: 5px; }
  .grid.acc .acc-name::before { width: 5px; height: 5px; }
  .grid.acc .acc-bal {
    font-size: clamp(16px, 4.7vw, 20px); letter-spacing: -.5px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .grid.acc .acc-meta { font-size: 10px; margin-top: 6px; gap: 6px; }
  .grid.acc .acc-card::after { right: -52px; top: -70px; width: 130px; height: 130px; }

  .section-title { margin: 24px 2px 10px; }

  /* KPI */
  .grid.kpi { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-card { padding: 13px 14px 12px 16px; border-radius: 16px; }
  .kpi-card::before { top: 14px; bottom: 14px; }
  .kpi-val { font-size: 20px; }

  /* 列表卡片化 */
  .list-card, .list-panel {
    background: none; border: 0; box-shadow: none; border-radius: 0;
    display: flex; flex-direction: column; gap: 9px; overflow: visible;
  }
  .list-card > .row, .list-panel > .payable-row {
    background: #fff; border: var(--hair); border-radius: 16px;
    box-shadow: var(--shadow-sm); padding: 13px 14px; margin: 0;
  }
  .list-card > .row:active, .list-panel > .payable-row:active { transform: scale(.983); }
  .list-card > .row:hover, .list-panel > .payable-row:hover { transform: none; box-shadow: var(--shadow-sm); border-color: rgba(16, 24, 40, .055); }
  /* 待审核卡：蓝色描边提醒（覆盖上面的通用边框） */
  .list-card > .row.is-pending {
    border-color: rgba(43, 108, 246, .55);
    box-shadow: 0 0 0 .5px rgba(43, 108, 246, .3), var(--shadow-sm);
    background: linear-gradient(180deg, #f7faff 0%, #fff 52%);
  }
  .list-card > .empty { border-radius: 16px; padding: 34px 16px; }
  .list-card > .card-head, .list-panel > .card-head {
    border: 0; background: none; padding: 0 4px 3px; min-height: 0;
  }
  .list-card > .card-head h2, .list-panel > .card-head h2 { font-size: 13px; font-weight: 600; color: var(--txt-2); }
  .list-card > .card-head .more, .list-panel > .card-head .more { font-size: 12.5px; color: #8a91a0; }
  .list-card > .card-body.card-hint, .list-panel > .card-body.card-hint {
    border: 0; background: none; padding: 5px 6px 0;
  }
  .list-panel > .card-body { border-top: 0; }

  .row { gap: 11px; }
  .thumb { width: 40px; height: 40px; border-radius: 13px; font-size: 13px; }
  .row-t1 { font-size: 14px; font-weight: 500; gap: 6px; }
  .row-t2 { font-size: 11.5px; margin-top: 3px; color: #9aa1ae; }
  .row-t2 .m-acc { display: none; }
  .row-amt { font-size: 16px; letter-spacing: -.3px; }
  .row-amt .amt.in { color: var(--ok); }
  .row-amt .small { font-size: 10.5px; color: #a8aebb; }
  .badge { font-size: 10.5px; padding: 3px 6px; border-radius: 5px; }
  .clip { font-size: 10px; }

  .filters { margin: 0 -14px 12px; padding: 0 14px 3px; gap: 8px; }
  .chip { padding: 7px 15px; font-size: 13px; border-radius: 22px; }

  /* 时间区间 */
  .range-bar { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 9px; margin-bottom: 12px; }
  .rg-presets { order: 1; gap: 7px; flex-wrap: wrap; overflow: visible; }
  .rg-chip { padding: 6px 12px; font-size: 12.5px; }
  .rg-dates {
    order: 2; padding: 9px 10px 9px 13px; border-radius: 13px; min-width: 0;
    display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) 22px;
    align-items: center; gap: 6px;
  }
  .rg-date { width: 100%; min-width: 0; text-align: center; font-size: 13px; padding: 2px 0; }
  .rg-sep { font-size: 12px; }
  .rg-x { width: 22px; height: 22px; line-height: 22px; }
  .rg-sum { order: 3; margin: 0 3px; font-size: 11.5px; }

  .card { border-radius: 16px; }
  .card-head { padding: 13px 15px; }
  .card-body { padding: 13px 15px; }
  .grid.two { grid-template-columns: 1fr; gap: 12px; }
  .form-row { grid-template-columns: 1fr; }
  .month-bar { padding: 12px 15px; }

  /* 底部导航 */
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: rgba(255, 255, 255, .93);
    backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
    border-top: 1px solid rgba(16, 24, 40, .055);
    padding: 8px 6px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 24px -12px rgba(16, 24, 40, .18);
  }
  .tab {
    flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center;
    gap: 3px; padding: 3px 0 1px; font-size: 10.5px; color: #a0a6b3; position: relative;
    transition: color .16s ease;
  }
  .tab .nav-ico {
    width: 42px; height: 26px; opacity: 1; display: flex; align-items: center; justify-content: center;
    border-radius: 9px; transition: background .18s ease;
  }
  .tab .nav-ico svg { width: 23px; height: 23px; transition: transform .18s cubic-bezier(.22, .8, .3, 1); }
  .tab.on { color: var(--pri); font-weight: 500; }
  .tab.on .nav-ico { background: #e4edff; }
  .tab.on .nav-ico svg { transform: translateY(-.5px); }
  .tab .nav-badge {
    position: absolute; top: -3px; left: 50%; margin-left: 4px;
    font-size: 9.5px; padding: 2px 5px; box-shadow: 0 0 0 2px #fff;
  }

  /* 悬浮记账按钮 */
  .fab {
    display: flex; position: fixed; right: 18px;
    bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 60;
    width: 54px; height: 54px; border-radius: 50%; border: 0; padding: 0;
    align-items: center; justify-content: center;
    background: linear-gradient(140deg, #3a76f9, #2b6cf6 55%, #1f5be0);
    color: #fff;
    box-shadow: 0 12px 26px -6px rgba(43, 108, 246, .62), 0 3px 10px rgba(43, 108, 246, .28);
    transition: transform .15s ease, box-shadow .15s ease;
  }
  .fab svg { width: 24px; height: 24px; }
  .fab:active { transform: scale(.92); box-shadow: 0 6px 14px -4px rgba(43, 108, 246, .55); }

  /* 弹窗 */
  .mask { padding: 0; align-items: flex-end; background: rgba(16, 24, 40, .44); }
  .sheet {
    max-width: none; width: 100%; border-radius: 22px 22px 0 0; max-height: 92vh;
    animation: sheetUp .28s cubic-bezier(.22, .8, .3, 1);
    box-shadow: 0 -12px 40px rgba(16, 24, 40, .18);
  }
  @keyframes sheetUp { from { transform: translateY(100%); } }
  .sheet::before {
    content: ''; display: block; width: 36px; height: 4px; border-radius: 4px;
    background: #e2e5eb; margin: 9px auto 0; flex: none;
  }
  .sheet-head { padding: 10px 18px 13px; }
  .sheet-head h3 { font-size: 16px; }
  .sheet-head h3 .badge { font-size: 10.5px; padding: 3px 6px; margin-left: 3px; vertical-align: 2px; }
  .sheet-head .icon-btn { width: 30px; height: 30px; font-size: 13px; }
  .sheet-body { padding: 16px 18px calc(18px + env(safe-area-inset-bottom)); }
  .sheet-foot { padding: 10px 18px calc(12px + env(safe-area-inset-bottom)); gap: 10px; background: #fff; }
  .sheet-foot .btn { padding: 13px; border-radius: 13px; font-size: 15px; font-weight: 500; }
  .sheet-foot .btn-primary { box-shadow: 0 8px 18px -6px rgba(43, 108, 246, .6); }
  .img-sheet .sheet-body { padding-bottom: 18px; }

  /* 表单 */
  .field { margin-bottom: 15px; }
  .field > span { font-size: 12px; color: #8a91a0; margin-bottom: 7px; }
  .field input, .field select, .field textarea {
    padding: 12px 13px; border-radius: 12px; font-size: 15px; background: #f7f8fb; border-color: #ecedf2;
  }
  .field textarea { min-height: 84px; }
  .type-grid { grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 18px; }
  .type-btn { padding: 12px 6px; border-radius: 12px; font-size: 14px; }
  .chips-wrap { gap: 8px; }
  .chips-wrap .chip { padding: 8px 15px; font-size: 13px; }
  .detail-line { padding: 11px 0; font-size: 14px; }
  .detail-line .k { min-width: 82px; color: #9aa1ae; }
  .detail-line .v { min-width: 0; overflow-wrap: anywhere; }
  .thumb-item, .thumb-add { width: 78px; height: 78px; border-radius: 12px; }
  .inp-num { width: 96px; padding: 8px 10px; font-size: 14px; }
  .inp-name {
    font-size: 14.5px; border-bottom: 0; background: #f5f7fa; border-radius: 9px;
    padding: 7px 10px; width: 100%; transition: box-shadow .15s, background .15s;
  }
  .inp-name:hover { background: #f0f2f7; border-bottom: 0; }
  .inp-name:focus { background: #fff; box-shadow: inset 0 0 0 1.5px var(--pri); border-bottom: 0; }

  /* 登录 */
  .login { padding: 20px; }
  .login-card { border-radius: 22px; padding: 30px 22px 22px; }
  .login-card h1 { font-size: 24px; }
  .login-card .btn-block { padding: 13px; border-radius: 13px; }

  .toast { bottom: calc(150px + env(safe-area-inset-bottom)); border-radius: 12px; }
}

@media (max-width: 420px) {
  .grid.acc > .acc-card { flex-basis: calc(50% - 5px); }
  .grid.acc .acc-bal { font-size: clamp(15px, 4.6vw, 18px); }
}
