/* =========================================================
   谢谢记账 — 卡通可爱风样式系统
   ========================================================= */
:root {
  --bg: #EEF6FF;
  --bg2: #E3F1FF;
  --card: #FFFFFF;
  --primary: #7EC8FF;
  --primary-d: #3E9BE0;
  --primary-bg: #EAF4FF;
  --mint: #7DD3C0;
  --sky: #8ED1FC;
  --sun: #FFD66B;
  --ink: #3C4A5A;
  --ink-soft: #8A9BB0;
  --line: #DCEBFB;
  --red: #FF6B6B;   /* 支出/涨 */
  --green: #2FBF71; /* 收入/结余 */
  --shadow: 0 10px 24px rgba(126, 200, 255, 0.25);
  --shadow-s: 0 4px 12px rgba(126, 200, 255, 0.18);
  --radius: 22px;
  --radius-s: 14px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Comic Sans MS", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, #D9ECFF 0, transparent 42%),
    radial-gradient(circle at 88% 4%, #E6F6FF 0, transparent 44%),
    radial-gradient(circle at 50% 100%, #E3F1FF 0, transparent 55%),
    var(--bg);
  overflow: hidden;
}

/* ---------- 全屏容器 ---------- */
.phone {
  position: relative;
  width: 100%; height: 100vh; height: 100dvh;
  background: var(--bg);
  overflow: hidden;
  display: flex; flex-direction: column;
}

/* ---------- 视图 ---------- */
.view {
  flex: 1 1 0%; overflow-y: auto; overflow-x: hidden;
  padding: 14px 16px 26px; display: none;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}
.view.active { display: flex; flex-direction: column; animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 顶部标题栏 ---------- */
.head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 4px 2px 14px;
}
.head h1 { font-size: 22px; margin: 0; font-weight: 800; letter-spacing: .5px; }
.head .sub { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.head .avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-s);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border-radius: 999px; padding: 7px 13px;
  font-size: 13px; font-weight: 700; color: var(--ink);
  box-shadow: var(--shadow-s); cursor: pointer; border: none;
}
.pill:active { transform: scale(.96); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow-s); margin-bottom: 14px;
}
.card.tint { background: linear-gradient(135deg, #FFF1F5, #FFFBF2); }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.center { justify-content: center; }

/* ---------- 首页余额卡 ---------- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--primary), var(--primary-d) 60%, var(--primary));
  color: #fff; border-radius: var(--radius); padding: 20px 18px 20px;
  box-shadow: var(--shadow); margin-bottom: 14px;
}
.hero .blob { position: absolute; border-radius: 50%; opacity: .35; }
.hero .b1 { width: 120px; height: 120px; background: #fff; top: -40px; right: -30px; }
.hero .b2 { width: 70px; height: 70px; background: #BFE6FF; bottom: -26px; left: 20px; }
.hero .label { font-size: 13px; opacity: .9; line-height: 1.4; }
.hero .balance { font-size: 38px; font-weight: 800; margin: 4px 0 10px; letter-spacing: 1px; line-height: 1.2; }
.hero .mini { display: flex; gap: 18px; }
.hero .mini div span { display: block; font-size: 12px; opacity: .9; }
.hero .mini div b { font-size: 18px; }

/* ---------- 统计三栏 ---------- */
.tri { display: flex; gap: 10px; }
.tri .c {
  flex: 1; background: #fff; border-radius: var(--radius-s); padding: 12px 10px;
  text-align: center; box-shadow: var(--shadow-s);
}
.tri .c .t { font-size: 12px; color: var(--ink-soft); }
.tri .c .v { font-size: 17px; font-weight: 800; margin-top: 4px; }
.tri .c.exp .v { color: var(--red); }
.tri .c.inc .v { color: var(--green); }
.tri .c.bal .v { color: var(--primary-d); }

/* ---------- 预算进度 ---------- */
.budget-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.budget-top .name { font-weight: 800; font-size: 15px; }
.bar { height: 14px; background: #FFE7EE; border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-d)); border-radius: 999px; transition: width .5s; }
.bar.over > i { background: linear-gradient(90deg, #FF7A85, #FF5252); }

/* ---------- 账本切换 / 分类 chips ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: thin; min-height: 44px; align-items: center; }
.chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border-radius: 999px; padding: 9px 14px; font-size: 13px; font-weight: 700;
  box-shadow: var(--shadow-s); cursor: pointer; border: 2px solid transparent; white-space: nowrap;
  height: 38px; line-height: 1.2;
}
.chip.on { border-color: var(--primary); color: var(--primary-d); }
.chip .ic { font-size: 16px; }

/* ---------- 列表 ---------- */
.list { margin: 0; padding: 0; list-style: none; }
.item {
  display: flex; align-items: center; gap: 12px; padding: 12px 4px;
  border-bottom: 1px dashed var(--line);
}
.item:last-child { border-bottom: none; }
.item .ic {
  width: 44px; height: 44px; border-radius: 14px; flex: 0 0 44px;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.item .meta { flex: 1; min-width: 0; }
.item .meta .nm { font-weight: 700; font-size: 15px; }
.item .meta .nt { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.item .amt { font-weight: 800; font-size: 16px; white-space: nowrap; }
.item .amt.exp { color: var(--red); }
.item .amt.inc { color: var(--green); }
.item .del {
  border: none; background: #FFF0F3; color: var(--red); width: 28px; height: 28px;
  border-radius: 9px; font-size: 14px; cursor: pointer; flex: 0 0 auto;
}

/* ---------- 分段控制 ---------- */
.seg { display: flex; background: #FFE7EE; border-radius: 999px; padding: 4px; gap: 4px; }
.seg button {
  flex: 1; border: none; background: transparent; padding: 9px 0; border-radius: 999px;
  font-weight: 800; font-size: 14px; color: var(--ink-soft); cursor: pointer; transition: .2s;
}
.seg button.on { background: #fff; color: var(--primary-d); box-shadow: var(--shadow-s); }

/* ---------- 记账主屏 ---------- */
.rec-type { margin-bottom: 4px; }
.rec-amount {
  text-align: right; font-size: 32px; font-weight: 800; color: var(--ink);
  padding: 6px 14px 2px; min-height: 46px; word-break: break-all; cursor: pointer;
}
.rec-amount:active { transform: scale(.98); }
.rec-amount .cur { font-size: 18px; color: var(--ink-soft); margin-right: 4px; }
/* 语音 / 一句话记账入口 */
.rec-voice { display: flex; margin: 0 0 4px; }
.btn-voice {
  flex: 1; border: 2px dashed var(--primary); border-radius: 12px; padding: 8px;
  font-size: 13px; font-weight: 700; background: var(--primary-bg); color: var(--primary-d);
  cursor: pointer; transition: .2s;
}
.btn-voice:active { transform: scale(.98); background: #DCEBFB; }
/* 订阅扣款标记 */
.badge-sub {
  display: inline-block; margin-left: 6px; font-size: 11px; line-height: 1;
  background: var(--primary-bg); color: var(--primary-d);
  padding: 2px 6px; border-radius: 8px; vertical-align: middle;
}

.cat-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin-top: 6px;
}
.cat {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 5px 2px; border-radius: 12px; cursor: pointer; border: 2px solid transparent;
}
.cat:active { transform: scale(.94); }
.cat.on { border-color: var(--primary); background: #EAF4FF; }
.cat .ic {
  width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 21px; box-shadow: var(--shadow-s);
}
.cat .nm { font-size: 11px; font-weight: 700; }

/* 数字键盘：底部悬浮面板（不顶开内容），选中分类或点金额后弹出 */
.kp-backdrop { position: fixed; inset: 0; background: rgba(20,18,24,.18); z-index: 90; animation: fade .2s ease; }
.keypad-float {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 0; width: 100%; max-width: 460px; z-index: 95;
  background: var(--card); border-radius: 20px 20px 0 0;
  box-shadow: 0 -10px 40px rgba(80,130,200,.28);
  padding: 8px 14px calc(12px + env(safe-area-inset-bottom));
  animation: kpUp .25s ease;
}
@keyframes kpUp { from { transform: translateX(-50%) translateY(100%); } to { transform: translateX(-50%) translateY(0); } }
.kp-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 8px; }
.kp-head .amt-view { font-size: 26px; font-weight: 800; color: var(--ink); }
.kp-head .cur { font-size: 15px; color: var(--ink-soft); margin-right: 4px; }
.kp-close { border: none; background: var(--primary-bg); color: var(--primary-d); border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 700; cursor: pointer; }
.kp-recents { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 4px 8px; }
.kp-ra { border: none; background: var(--primary-bg); color: var(--primary-d); border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 700; cursor: pointer; }
.kp-ra:active { transform: scale(.94); }
.keypad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.key {
  border: none; background: #fff; border-radius: 14px; height: 50px; font-size: 20px; font-weight: 800;
  color: var(--ink); cursor: pointer; box-shadow: var(--shadow-s); transition: .12s;
}
.key:active { transform: scale(.93); background: #FFF3F6; }
.key.ok { background: linear-gradient(135deg, #FF9AA2, #FF8FA3); color: #fff; font-size: 18px; }
.key.grey { background: #FFF0F3; font-size: 18px; }

/* 字段横向 chips（点击弹出对应选择器，替代逐行条状） */
.rec-fields-h { display: flex; gap: 8px; overflow-x: auto; margin-top: 8px; padding: 2px 0 4px; scrollbar-width: none; }
.rec-fields-h::-webkit-scrollbar { display: none; }
.fchip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px;
  background: var(--primary-bg); color: var(--ink); border: none; border-radius: 999px;
  padding: 7px 12px; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.fchip:active { transform: scale(.95); }

/* 键盘展开时的当前分类条（分类网格临时收起） */
.cat-cur {
  display: flex; align-items: center; gap: 8px; margin-top: 6px;
  padding: 7px 10px; background: #EAF4FF; border-radius: 12px; cursor: pointer;
}
.cat-cur .ic { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.cat-cur .nm { font-size: 13px; font-weight: 800; }
.cat-cur .hint { margin-left: auto; font-size: 11px; color: var(--ink-soft); }

/* ---------- 日历 ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-head .mo { font-weight: 800; font-size: 16px; }
.cal-head button { border: none; background: #fff; width: 34px; height: 34px; border-radius: 50%; box-shadow: var(--shadow-s); font-size: 16px; cursor: pointer; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-grid .wd { text-align: center; font-size: 11px; color: var(--ink-soft); padding: 4px 0; }
.cal-day {
  position: relative; aspect-ratio: 1 / 1; border-radius: 12px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; font-size: 13px; font-weight: 700; cursor: pointer;
  background: #FFF7F4;
}
.cal-day.muted { color: #D9C9C2; background: transparent; }
.cal-day.on { background: var(--primary); color: #fff; }
.cal-day .dot { position: absolute; bottom: 5px; width: 5px; height: 5px; border-radius: 50%; }
.cal-day .dot.e { background: var(--red); }
.cal-day .dot.i { background: var(--green); }

/* ---------- 统计 ---------- */
.chart-card { padding: 14px; }
.legend { display: flex; gap: 16px; justify-content: center; margin-top: 6px; font-size: 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
.rank { display: flex; align-items: center; gap: 10px; padding: 9px 2px; }
.rank .ic { width: 36px; height: 36px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 19px; flex: 0 0 36px; }
.rank .meta { flex: 1; min-width: 0; }
.rank .meta .top { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; }
.rank .meta .bar2 { height: 8px; background: #F2E4DC; border-radius: 999px; margin-top: 4px; overflow: hidden; }
.rank .meta .bar2 > i { display: block; height: 100%; border-radius: 999px; }

/* ---------- 我的 ---------- */
.profile-top {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, #DCECFF, #E9F6FF); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-s); margin-bottom: 14px;
}
.profile-top .ava { width: 60px; height: 60px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 32px; box-shadow: var(--shadow-s); }
.profile-top .nm { font-size: 19px; font-weight: 800; }
.profile-top .tip { font-size: 12px; color: var(--ink-soft); margin-top: 3px; }
.login-btns { display: flex; gap: 10px; margin-top: 10px; }
.btn-social {
  flex: 1; border: none; border-radius: 14px; padding: 11px; font-weight: 800; font-size: 14px; cursor: pointer; color: #fff;
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.btn-wechat { background: linear-gradient(135deg, #5ED36B, #2FBF71); }
.btn-qq { background: linear-gradient(135deg, #6FC3FF, #3B9CFF); }

.menu { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-s); overflow: hidden; }
.menu .mi {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer;
  border-bottom: 1px solid var(--line);
}
.menu .mi:last-child { border-bottom: none; }
.menu .mi .ic { width: 36px; height: 36px; border-radius: 11px; background: #EAF4FF; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.menu .mi .tx { flex: 1; font-weight: 700; font-size: 15px; }
.menu .mi .ar { color: var(--ink-soft); }
.switch { position: relative; width: 46px; height: 26px; flex: 0 0 46px; cursor: pointer; }
.switch .sl { position: absolute; inset: 0; background: #E7D8D1; border-radius: 999px; transition: .25s; }
.switch .sl::after { content: ''; position: absolute; width: 20px; height: 20px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: .25s; box-shadow: 0 2px 4px rgba(0,0,0,.2); }
.switch.on .sl { background: var(--mint); }
.switch.on .sl::after { transform: translateX(20px); }

/* ---------- 底部导航 ---------- */
.tabbar {
  flex: 0 0 auto; display: flex; background: rgba(255,255,255,.96);
  border-top: 1px solid var(--line); padding: 6px 6px 10px;
  box-shadow: 0 -6px 18px rgba(255,143,163,.1);
}
.tabbar button {
  flex: 1; border: none; background: transparent; display: flex; flex-direction: column;
  align-items: center; gap: 3px; font-size: 11px; font-weight: 700; color: var(--ink-soft); cursor: pointer; padding: 4px 0;
}
.tabbar button .em { font-size: 21px; filter: grayscale(.4); transition: .2s; }
.tabbar button.on { color: var(--primary-d); }
.tabbar button.on .em { filter: none; transform: translateY(-2px) scale(1.12); }
.tab-center {
  flex: 0 0 auto; width: 60px; margin-top: -22px;
}
.tab-center .plus {
  width: 54px; height: 54px; border-radius: 50%; margin: 0 auto;
  background: linear-gradient(135deg, var(--primary), var(--primary-d)); color: #fff; border: 4px solid #fff;
  font-size: 28px; font-weight: 800; box-shadow: var(--shadow); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.tab-center .plus:active { transform: scale(.92); }
.tab-center span { font-size: 11px; font-weight: 700; color: var(--primary-d); display: block; text-align: center; margin-top: 2px; }

/* ---------- 弹窗 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(74,59,69,.45); backdrop-filter: blur(2px);
  display: flex; align-items: flex-end; z-index: 9999; animation: fade .2s;
}
.sheet {
  width: 100%; background: var(--bg); border-radius: 28px 28px 0 0; padding: 18px 18px 26px;
  max-height: 75vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  animation: slideUp .28s cubic-bezier(.2,.9,.3,1);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }
.sheet h3 { margin: 0 0 14px; font-size: 18px; font-weight: 800; text-align: center; }
.sheet .grab { width: 40px; height: 5px; background: #E7D8D1; border-radius: 999px; margin: 0 auto 14px; }

.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-row label { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.form-row input, .form-row select, .form-row textarea {
  border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; font-size: 15px;
  font-family: var(--font); background: #fff; color: var(--ink); outline: none;
}
.form-row input:focus, .form-row select:focus { border-color: var(--primary); }

.icon-pick { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.icon-pick button { border: 2px solid var(--line); background: #fff; border-radius: 12px; height: 40px; font-size: 20px; cursor: pointer; }
.icon-pick button.on { border-color: var(--primary); background: #FFF3F6; }

.color-pick { display: flex; gap: 10px; flex-wrap: wrap; }
.color-pick button { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line); cursor: pointer; }
.color-pick button.on { box-shadow: 0 0 0 2px var(--primary); }

.btn-primary {
  width: 100%; border: none; border-radius: 16px; padding: 14px; font-size: 16px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-d)); cursor: pointer; box-shadow: var(--shadow); margin-top: 6px;
}
.btn-primary:active { transform: scale(.98); }
.btn-ghost { width: 100%; border: 2px solid var(--line); border-radius: 16px; padding: 13px; font-size: 15px; font-weight: 700; background: #fff; color: var(--ink-soft); cursor: pointer; margin-top: 10px; }
.btn-danger { color: var(--red); border-color: #FFD5DB; }

.cat-manage { display: flex; align-items: center; gap: 10px; padding: 12px 6px; border-bottom: 1px dashed var(--line); min-height: 56px; }
.cat-manage .ic { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.cat-manage .nm { flex: 1; font-weight: 700; min-width: 0; overflow: hidden; }
.cat-manage .nm .soft { font-size: 11px; color: var(--ink-soft); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-manage .act { display: flex; gap: 6px; }
.cat-manage .act button { border: none; border-radius: 10px; padding: 7px 11px; font-size: 12px; font-weight: 700; cursor: pointer; }
.act .edit { background: #EAF7F0; color: var(--green); }
.act .del { background: #FFF0F3; color: var(--red); }

/* ---------- Toast ---------- */
.toast {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  background: rgba(74,59,69,.92); color: #fff; padding: 12px 20px; border-radius: 14px;
  font-size: 14px; font-weight: 700; z-index: 99; opacity: 0; pointer-events: none; transition: .25s;
}
.toast.show { opacity: 1; }

/* 空状态 */
.empty { text-align: center; padding: 40px 10px; color: var(--ink-soft); }
.empty .em { font-size: 48px; }
.empty p { margin: 10px 0 0; font-size: 14px; }

/* 小工具类 */
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.fw { font-weight: 800; } .soft { color: var(--ink-soft); font-size: 12px; }
.tag { display: inline-block; background: #EAF4FF; color: var(--primary-d); border-radius: 999px; padding: 2px 9px; font-size: 11px; font-weight: 700; }
.float-emoji { position: absolute; font-size: 22px; opacity: .8; }

/* ---------- 预算超支推送横幅 ---------- */
.push {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%) translateY(-130%);
  width: 86%; background: rgba(255,255,255,.98); border-radius: 18px; padding: 12px 14px;
  box-shadow: 0 12px 30px rgba(62,155,224,.32); z-index: 80; display: flex; gap: 10px; align-items: center;
  transition: transform .42s cubic-bezier(.2,.9,.3,1); border: 1px solid #DCEBFB;
}
.push.show { transform: translateX(-50%) translateY(0); }
.push .pic { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg,#8FD3FF,#6FB7FF); display: flex; align-items: center; justify-content: center; flex: 0 0 38px; }
.push .tx { flex: 1; min-width: 0; }
.push .tx .t1 { font-size: 11px; color: var(--ink-soft); font-weight: 700; }
.push .tx .t2 { font-size: 13px; font-weight: 800; margin-top: 1px; color: var(--primary-d); }
.push .tx .t3 { font-size: 12px; color: var(--ink); margin-top: 2px; }
.push .x { color: #B9C6D6; font-size: 16px; cursor: pointer; flex: 0 0 auto; }

/* ---------- 月度对比 ---------- */
.cmp-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.cmp-row:last-child { border-bottom: none; }
.cmp-row .cl { width: 40px; font-weight: 700; font-size: 13px; }
.cmp-row .cv { flex: 1; font-weight: 800; font-size: 14px; white-space: nowrap; }
.cmp-row .cdelta { font-size: 11px; font-weight: 700; margin-left: 4px; }
.cmp-row .cbar { flex: 1.2; display: flex; flex-direction: column; gap: 3px; }
.cmp-row .cbar i { display: block; height: 6px; border-radius: 999px; }
.cmp-row .cbar .b1 { background: linear-gradient(90deg,#8FD3FF,#6FB7FF); }
.cmp-row .cbar .b2 { background: #DCEBFB; }

/* ---------- 备注图片 ---------- */
.note-img-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.note-img-wrap { position: relative; border-radius: 12px; overflow: hidden; border: 2px solid var(--line); background: #fff; aspect-ratio: 1; }
.note-img { width: 100%; height: 100%; object-fit: cover; }
.note-img-del { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: none; background: rgba(255,107,107,.9); color: #fff; font-size: 14px; font-weight: 800; cursor: pointer; display: flex; align-items: center; justify-content: center; line-height: 1; }
.note-img { cursor: zoom-in; }

/* 账单列表缩略图 */
.tx-thumb { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; margin-right: 10px; border: 2px solid var(--line); background: #fff; cursor: zoom-in; flex-shrink: 0; }

/* ---------- 图片查看器（灯箱） ---------- */
.img-viewer { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; }
.img-viewer .iv-backdrop { position: absolute; inset: 0; background: rgba(20,18,24,.92); backdrop-filter: blur(2px); }
.img-viewer .iv-stage { position: relative; z-index: 1; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; }
.img-viewer .iv-img { max-width: 92%; max-height: 82%; border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.5); transition: transform .08s ease-out; transform-origin: center center; will-change: transform; cursor: grab; user-select: none; -webkit-user-drag: none; }
.img-viewer .iv-img:active { cursor: grabbing; }
.img-viewer .iv-bar { position: absolute; z-index: 2; left: 50%; transform: translateX(-50%); bottom: 26px; display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.14); padding: 8px 14px; border-radius: 999px; backdrop-filter: blur(8px); }
.img-viewer .iv-btn { width: 40px; height: 40px; border-radius: 50%; border: none; background: rgba(255,255,255,.92); color: #2A2A35; font-size: 20px; font-weight: 800; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.img-viewer .iv-btn:active { transform: scale(.92); }
.img-viewer .iv-count { color: #fff; font-size: 14px; font-weight: 700; min-width: 48px; text-align: center; }
.img-viewer .iv-nav { position: absolute; z-index: 2; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: none; background: rgba(255,255,255,.18); color: #fff; font-size: 26px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.img-viewer .iv-nav:active { transform: translateY(-50%) scale(.92); }
.img-viewer .iv-prev { left: 14px; }
.img-viewer .iv-next { right: 14px; }

/* ---------- 常用备注 ---------- */
.note-history { margin: 10px 0; }
.note-history label { font-size: 12px; color: var(--ink-soft); font-weight: 700; display: block; margin-bottom: 6px; }
.note-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.note-tag { border: 2px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 700; background: #fff; color: var(--ink); cursor: pointer; }
.note-tag:active { transform: scale(.95); background: var(--primary-bg); border-color: var(--primary); color: var(--primary-d); }

/* 交易图片标记 */
.tx-img-badge { font-size: 11px; margin-left: 4px; }

/* ---------- 激活 / 授权 ---------- */
.lic-badge { border-radius: 12px; padding: 10px 12px; font-size: 13px; font-weight: 700; margin-bottom: 4px; background: #FFF4E6; color: #C77B2B; }
.lic-badge.ok { background: #E7FBF0; color: #2FA86A; }
.lic-tip { font-size: 12px; color: var(--ink-soft); line-height: 1.6; margin: 10px 2px 14px; }
.welcome { text-align: center; padding: 8px 4px 4px; }
.welcome .wm { display: flex; justify-content: center; margin-bottom: 10px; }
.welcome h3 { color: var(--ink); font-size: 19px; margin-bottom: 8px; }
.welcome-sub { font-size: 13px; color: var(--ink-soft); line-height: 1.8; margin-bottom: 16px; }
.welcome .btn-primary, .welcome .btn-ghost { margin-top: 8px; }

/* ---------- 关于页（信息卡） ---------- */
.about-hero { display: flex; justify-content: center; margin: 6px 0 8px; }
.about-ver { text-align: center; font-weight: 800; font-size: 15px; color: var(--primary-d); margin-bottom: 8px; }
.about-desc { font-size: 13px; color: var(--ink-soft); line-height: 1.7; margin: 0 2px 14px; }
.about-feats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.about-feats .af { background: var(--primary-bg); border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.about-feats .af span { font-size: 20px; }
.about-feats .af b { font-size: 13px; color: var(--ink); }
.about-feats .af i { font-size: 11px; color: var(--ink-soft); font-style: normal; }
.about-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 2px; border-top: 1px dashed var(--line); font-size: 13px; }
.about-row span { color: var(--ink-soft); }
.about-row b { color: var(--ink); font-weight: 700; }

/* =========================================================
   本次新增：极速记账 / 周期账 / 主题
   ========================================================= */
/* 首页常驻记账入口（悬浮按钮） */
.fab {
  position: fixed; right: 16px; bottom: 78px; z-index: 50;
  width: 54px; height: 54px; border-radius: 50%; border: 4px solid #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-d)); color: #fff;
  font-size: 30px; font-weight: 800; line-height: 1;
  box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.fab:active { transform: scale(.92); }

/* 最近金额快捷填充 */
.recent-amts { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 2px 2px; }
.amt-chip {
  border: 2px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 7px 13px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.amt-chip:active { transform: scale(.95); border-color: var(--primary); color: var(--primary-d); }

/* 日历每日金额 */
.cal-day .cal-amt { display: block; font-size: 8px; font-weight: 700; margin-top: 1px; line-height: 1; }
.cal-amt.e { color: var(--red); }
.cal-amt.i { color: var(--green); }

/* 月度对比：环比/同比切换 */
.cmp-seg { margin: 0 0 12px; }
.cmp-seg button { padding: 6px 0; font-size: 12px; }

/* 月度对比：增强块（近6月柱图 / 日均 / 分类环比） */
.cmp-sub { font-size: 12px; font-weight: 800; color: var(--ink-soft); margin: 12px 0 6px; }
.cmp-mini { display: flex; align-items: flex-end; gap: 6px; height: 84px; padding: 0 2px; }
.cmp-mini .mbar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.cmp-mini .mbar-fill { width: 100%; max-width: 22px; background: var(--line); border-radius: 7px 7px 0 0; transition: height .3s; }
.cmp-mini .mbar.cur .mbar-fill { background: linear-gradient(180deg, var(--primary), var(--primary-d)); }
.cmp-mini .mlbl { font-size: 9px; color: var(--ink-soft); margin-top: 4px; }
.cmp-daily { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 10px 0 2px; padding: 9px 12px; background: var(--primary-bg); border-radius: 14px; font-size: 12px; color: var(--ink-soft); }
.cmp-daily b { color: var(--ink); font-weight: 800; }
.cmp-cats { margin-top: 4px; }
.cmp-cat { display: flex; align-items: center; gap: 9px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.cmp-cat:last-child { border-bottom: none; }
.cmp-cat .ic { width: 26px; height: 26px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 13px; flex: 0 0 auto; }
.cmp-cat .cn { flex: 1; font-size: 13px; font-weight: 700; }
.cmp-cat .cv { font-size: 12px; font-weight: 800; white-space: nowrap; }

/* 主题控件 */
.form-row.between { flex-direction: row; align-items: center; }
.form-row.between label { margin: 0; }
.theme-dots { display: flex; gap: 12px; }
.theme-dot {
  width: 38px; height: 38px; border-radius: 50%; border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--line); cursor: pointer; padding: 0;
}
.theme-dot.on { box-shadow: 0 0 0 3px var(--primary); transform: scale(1.08); }

/* =========================================================
   多主题（主色）
   ========================================================= */
[data-accent="pink"]   { --primary:#FFB0D0; --primary-d:#E86FA6; --primary-bg:#FFEAF3; }
[data-accent="green"]  { --primary:#7DD3C0; --primary-d:#3FB58E; --primary-bg:#E6F7F1; }
[data-accent="purple"] { --primary:#B388FF; --primary-d:#8A5BE0; --primary-bg:#F1E9FF; }

/* =========================================================
   深色模式
   ========================================================= */
[data-mode="dark"] {
  --bg: #151A23; --bg2: #1E2531; --card: #232B39;
  --ink: #E8EEF7; --ink-soft: #93A1B8; --line: #313B4D;
  --red: #FF8A8A; --green: #56D08A;
  --primary-bg: #2A3346;
  --shadow: 0 10px 24px rgba(0,0,0,.45);
  --shadow-s: 0 4px 12px rgba(0,0,0,.35);
}
[data-mode="dark"] body {
  background: var(--bg);
  background-image: radial-gradient(circle at 12% 8%, #1d2636 0, transparent 42%),
    radial-gradient(circle at 88% 4%, #1f2b3a 0, transparent 44%),
    radial-gradient(circle at 50% 100%, #1c2533 0, transparent 55%);
}
[data-mode="dark"] .phone { background: var(--bg); }
[data-mode="dark"] .card,
[data-mode="dark"] .menu,
[data-mode="dark"] .sheet,
[data-mode="dark"] .chip,
[data-mode="dark"] .key,
[data-mode="dark"] .tabbar,
[data-mode="dark"] .note-tag,
[data-mode="dark"] .cat-manage .ic,
[data-mode="dark"] .rank .ic,
[data-mode="dark"] .sign,
[data-mode="dark"] .btn-ghost,
[data-mode="dark"] .cat-manage,
[data-mode="dark"] .icon-pick button,
[data-mode="dark"] .color-pick button { background: var(--card); }
[data-mode="dark"] .sheet { background: var(--bg2); }
[data-mode="dark"] .card.tint { background: #2A2433; }
[data-mode="dark"] .tabbar { background: rgba(35,43,57,.96); border-top-color: var(--line); box-shadow: 0 -6px 18px rgba(0,0,0,.4); }
[data-mode="dark"] .chip { box-shadow: var(--shadow-s); }
[data-mode="dark"] .item { border-bottom-color: var(--line); }
[data-mode="dark"] .field { border-bottom-color: var(--line); }
[data-mode="dark"] .key.grey { background: #2A3342; }

/* ---------- P2-10 新增：分隔线 / 安装引导步骤 / 桌面端布局 ---------- */
.divider { height: 1px; background: var(--line, #ececf2); margin: 14px 0; border: 0; }
.tips { margin: 8px 0 4px; padding-left: 20px; color: var(--ink); }
.tips li { margin: 6px 0; font-size: 14px; line-height: 1.5; }
.tips b { color: var(--primary-d); }

/* 桌面端（宽屏）：把全屏容器收拢为居中的「手机」列，两侧露出品牌渐变背景。
   仅在大视口生效，不影响移动端全屏体验，也不会触发此前「html,body 居中」的回归。 */
@media (min-width: 600px) {
  .phone {
    width: 100%; max-width: 460px;
    height: 100vh; height: 100dvh;
    margin: 0 auto;
    box-shadow: 0 20px 60px rgba(80, 130, 200, .25);
  }
}
[data-mode="dark"] .cal-day { background: #2A313F; color: var(--ink); }
[data-mode="dark"] .cal-day.muted { color: #59657A; background: transparent; }
[data-mode="dark"] .cal-day.on { background: var(--primary); color: #fff; }
[data-mode="dark"] .seg { background: #2A313F; }
[data-mode="dark"] .seg button { color: var(--ink-soft); }
[data-mode="dark"] .seg button.on { background: var(--card); color: var(--primary-d); }
[data-mode="dark"] .bar { background: #34323A; }
[data-mode="dark"] .rank .meta .bar2 { background: #34323A; }
[data-mode="dark"] .profile-top { background: #232B39; }
[data-mode="dark"] .profile-top .ava { background: var(--card); }
[data-mode="dark"] .switch .sl { background: #3A4256; }
[data-mode="dark"] .mask { background: rgba(0,0,0,.6); }
[data-mode="dark"] .push { background: rgba(35,43,57,.98); border-color: var(--line); }
[data-mode="dark"] .toast { background: rgba(0,0,0,.85); }
[data-mode="dark"] .about-feats .af { background: var(--primary-bg); border-color: var(--line); }
[data-mode="dark"] .note-img-wrap,
[data-mode="dark"] .tx-thumb { border-color: var(--line); background: var(--card); }
[data-mode="dark"] .form-row input,
[data-mode="dark"] .form-row select,
[data-mode="dark"] .form-row textarea { background: var(--card); border-color: var(--line); color: var(--ink); }
[data-mode="dark"] .btn-ghost { background: var(--card); border-color: var(--line); color: var(--ink-soft); }
[data-mode="dark"] .cat-manage { border-bottom-color: var(--line); }
[data-mode="dark"] .cmp-row { border-bottom-color: var(--line); }
[data-mode="dark"] .cmp-sub { color: var(--ink-soft); }
[data-mode="dark"] .cmp-mini .mbar-fill { background: #3A4256; }
[data-mode="dark"] .cmp-mini .mbar.cur .mbar-fill { background: linear-gradient(180deg, var(--primary), var(--primary-d)); }
[data-mode="dark"] .cmp-daily { background: #2A313F; }
[data-mode="dark"] .cmp-cat { border-bottom-color: var(--line); }
[data-mode="dark"] .empty .em { opacity: .8; }
[data-mode="dark"] .item .del { background: #3A2A30; }
[data-mode="dark"] .about-hero, [data-mode="dark"] .welcome .wm { filter: drop-shadow(0 4px 10px rgba(0,0,0,.4)); }

/* =========================================================
   AI 聊天记账（view-ai，ai- 前缀）
   布局：view 本身 flex column（见 .view.active），消息区 flex:1 自滚，
   输入栏作为 view 的最后一个 flex 子项，天然位于 tabbar 之上。
   ========================================================= */
.view#view-ai { padding: 0; overflow: hidden; }
.ai-head { margin: 0; padding: 14px 16px 10px; flex: 0 0 auto; }
.ai-back { padding: 7px 13px; font-size: 17px; line-height: 1; }
.ai-ava {
  border-radius: 50%; object-fit: cover; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; box-shadow: var(--shadow-s);
}
.ai-ava-def { background: linear-gradient(135deg, var(--primary-bg), #FFF1F5); }
.ai-msgs {
  flex: 1 1 0%; min-height: 0; overflow-y: auto; overflow-x: hidden;
  padding: 6px 16px 12px; -webkit-overflow-scrolling: touch;
}
.ai-row { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 12px; }
.ai-row.user { justify-content: flex-end; }
.ai-bub {
  max-width: 76%; padding: 10px 14px; font-size: 14px; line-height: 1.55;
  background: #fff; border-radius: 18px 18px 18px 6px; box-shadow: var(--shadow-s);
  word-break: break-word; white-space: pre-wrap;
}
.ai-row.user .ai-bub {
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  color: #fff; border-radius: 18px 18px 6px 18px;
}
.ai-bub-box { max-width: 76%; display: flex; flex-direction: column; gap: 6px; }
.ai-bub-box .ai-bub { max-width: 100%; }
.ai-typing { display: inline-flex; align-items: center; gap: 5px; padding: 15px 16px; }
.ai-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); animation: aiDot 1s infinite; }
.ai-typing i:nth-child(2) { animation-delay: .18s; }
.ai-typing i:nth-child(3) { animation-delay: .36s; }
@keyframes aiDot {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30% { transform: translateY(-4px); opacity: 1; }
}
.ai-txcard {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: #EAFBF1; border: 1px solid #C8F0D8; border-radius: 14px;
  padding: 9px 12px; font-size: 12.5px;
}
.ai-txcard .t { flex: 1; line-height: 1.45; }
.ai-undo {
  flex: 0 0 auto; border: none; background: #fff; color: var(--red);
  font-size: 12px; font-weight: 700; border-radius: 999px; padding: 5px 12px;
  box-shadow: var(--shadow-s); cursor: pointer;
}
.ai-undo:active { transform: scale(.94); }
.ai-revoked { font-size: 12px; color: var(--ink-soft); padding: 2px 6px; }
.ai-welcome { text-align: center; padding: 42px 20px 20px; }
.ai-welcome .em { font-size: 52px; }
.ai-welcome p { color: var(--ink-soft); font-size: 14px; line-height: 1.7; margin: 10px 0 0; }
.ai-chips { display: flex; flex-direction: column; gap: 8px; align-items: center; margin-top: 16px; }
.ai-chips .chip { min-width: 180px; justify-content: center; }
.ai-inputbar {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(255,255,255,.96); border-top: 1px solid var(--line);
}
.ai-text {
  flex: 1; min-width: 0; border: 2px solid var(--line); border-radius: 999px;
  padding: 11px 16px; font-size: 14px; font-family: var(--font);
  background: #fff; color: var(--ink); outline: none;
}
.ai-text:focus { border-color: var(--primary); }
.ai-send {
  flex: 0 0 auto; border: none; border-radius: 999px; padding: 11px 18px;
  font-size: 14px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  box-shadow: var(--shadow-s); cursor: pointer;
}
.ai-send:active { transform: scale(.96); }
.ai-mic, .ai-lang {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
  border: none; background: #eef4fb; color: #5ab0f5; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.ai-mic:active, .ai-lang:active { transform: scale(.94); }
.ai-mic.rec { background: #ff6b6b; color: #fff; animation: ai-rec-pulse 1.1s ease-in-out infinite; }
@keyframes ai-rec-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,107,107,.55); }
  50% { box-shadow: 0 0 0 9px rgba(255,107,107,0); }
}
.ai-newcat {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; margin: 6px 0;
  background: rgba(124,200,255,.14); border: 1px solid rgba(124,200,255,.4);
  border-radius: 10px; font-size: 15px;
}
  50% { box-shadow: 0 0 0 8px rgba(255,107,107,0); }
}
[data-mode="dark"] .ai-bub,
[data-mode="dark"] .ai-ava { background: var(--card); }
[data-mode="dark"] .ai-text { background: var(--card); border-color: var(--line); color: var(--ink); }
[data-mode="dark"] .ai-mic, [data-mode="dark"] .ai-lang { background: var(--card); border-color: var(--line); }
[data-mode="dark"] .ai-inputbar { background: rgba(35,43,57,.96); border-top-color: var(--line); }
[data-mode="dark"] .ai-txcard { background: #22352B; border-color: #2E4A3A; }
[data-mode="dark"] .ai-undo { background: var(--card); }

/* 网站备案号页脚 */
.site-footer { text-align:center; padding: 14px 12px 22px; font-size:12px; color:#8aa6c0; }
.site-footer a { color:#8aa6c0; text-decoration:none; }
.site-footer a:hover { color:#3a6ea5; text-decoration:underline; }

