/* ============================================================
   style.css —— 记账本网页版全局样式
   界面与微信小程序「记账本」完全一致：
   - 容器 375px（对应 rpx 基准 750，1rpx = 0.5px）
   - 顶部蓝色导航栏（模拟微信原生导航栏）
   - 底部纯文字 tabBar（模拟微信原生 tabBar）
   ============================================================ */
:root {
  --primary: #3d6ef7;
  --primary-soft: #e8eefc;
  --bg: #f1f4f9;
  --card: #ffffff;
  --text: #1c2733;
  --text-2: #4a5b70;
  --text-3: #7a8ba0;
  --text-4: #9aaabc;
  --line: #eef2f8;
  --income: #14b8a6;
  --danger: #e5504a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-size: 16px;           /* 28rpx */
  line-height: 1.5;
}

button { font-family: inherit; }

/* ============ 主容器：手机宽度居中（375px，与小程序 rpx 基准一致） ============ */
#app {
  max-width: 500px;          /* 放宽：手机上自然撑满全屏，电脑端保持手机栏式布局 */
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: 60px;      /* 给底部 tabBar 留空间 */
}

/* ============ 顶部导航栏 ============
   按小程序样图：蓝色渐变块横向撑满全屏、延伸到手机上缘（刘海/状态栏安全区），标题加大 */
.nav-top {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100vw;                            /* 横向撑满屏幕（不限于内容容器） */
  margin-left: calc(50% - 50vw);
  background: linear-gradient(135deg, #3d6ef7 0%, #6a8bff 100%);
  color: #fff;
  box-sizing: content-box;                 /* 内容高 44px，安全区内边距额外叠加在顶部 */
  min-height: 44px;
  padding-top: env(safe-area-inset-top, 0px);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(61, 110, 247, 0.22);
}
.nav-top .nav-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
}

/* ============ 底部 tabBar（纯文字，模拟微信原生 tabBar） ============ */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 500px;          /* 与 #app 一致放宽 */
  height: 54px;
  background: #fff;
  border-top: 1px solid #e5e5e5;
  display: flex;
  z-index: 60;
}
.tabbar .tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8a9bb0;
  text-decoration: none;
  font-size: 15px;
  user-select: none;
}
.tabbar .tab.active { color: #3d6ef7; font-weight: 600; }
.tabbar .tab:active { background: #e8eefc; }

/* ============ 卡片 / 文案 ============ */
.card {
  background: #ffffff;
  border-radius: 14px;           /* 24rpx */
  padding: 16px;                 /* 28rpx */
  margin: 12px 12px 0;           /* 24rpx */
  box-shadow: 0 1px 6px rgba(31, 60, 120, 0.06);
}
.card-title {
  font-size: 17px;               /* 30rpx */
  font-weight: 600;
  margin-bottom: 8px;            /* 16rpx */
}
.card-hint {
  font-size: 14px;               /* 24rpx */
  color: #7a8ba0;
}
.loading {
  padding: 60px 0;               /* 120rpx */
  text-align: center;
  color: #7a8ba0;
}

/* ============ 进度条 ============ */
.progress-track {
  height: 7px;                   /* 14rpx */
  background: #e5ecf5;
  border-radius: 3.5px;          /* 7rpx */
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 3.5px;          /* 7rpx */
  background: #3d6ef7;
  transition: width 0.3s;
}

/* ============ 按钮 ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 20px;           /* 40rpx */
  font-size: 16px;               /* 28rpx */
  padding: 9px 18px;             /* 18rpx 36rpx */
  line-height: 1;
  cursor: pointer;
  user-select: none;
  text-align: center;
}
.btn:active { opacity: 0.75; }
.btn-primary { background: #3d6ef7; color: #fff; }
.btn-ghost { background: #e8eefc; color: #3d6ef7; }
.btn-danger { background: #fbeae9; color: #e5504a; }
.btn-danger-ghost { background: transparent; color: #e5504a; border: 1px solid #e5504a; }
.btn-block { width: 100%; box-sizing: border-box; }
.btn-sm { padding: 5px 12px; font-size: 14px; border-radius: 14px; }

/* ============ 表单 ============ */
.form-row { display: flex; gap: 10px; }               /* 20rpx */
.field { margin-bottom: 11px; flex: 1; }              /* 22rpx */
.field-label { font-size: 15px; color: #4a5b70; margin-bottom: 5px; display: block; }
.form-label { font-size: 15px; color: #4a5b70; margin: 7px 0 9px; font-weight: 600; }
.input, .picker, select.input {
  width: 100%;
  box-sizing: border-box;
  background: #f1f4f9;
  border: 1px solid transparent;
  border-radius: 7px;            /* 14rpx */
  padding: 9px 11px;             /* 18rpx 22rpx */
  font-size: 16px;
  min-height: 38px;              /* 76rpx */
  outline: none;
  font-family: inherit;
  color: #1c2733;
}
.input:focus { border-color: #3d6ef7; background: #fff; }

/* ============ Toast / Modal / Loading（网页通用组件） ============ */
#toast {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(20, 26, 36, 0.9);
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 16px;
  max-width: 70%;
  z-index: 999;
  display: none;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
#toast.show { display: block; animation: fadeInUp 0.2s; }
@keyframes fadeInUp { from { opacity: 0; transform: translate(-50%, -45%); } to { opacity: 1; transform: translate(-50%, -50%); } }

.mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 20, 30, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.mask .dialog {
  background: #fff;
  border-radius: 16px;
  width: 320px;
  max-width: 88%;
  padding: 20px;
  text-align: center;
}
.mask .dialog .dialog-title { font-size: 18px; font-weight: 600; margin-bottom: 10px; }
.mask .dialog .dialog-content { font-size: 16px; color: #4a5b70; margin-bottom: 16px; word-break: break-all; }
.mask .dialog .dialog-btns { display: flex; gap: 10px; }
.mask .dialog .dialog-btns .btn { flex: 1; }

#loading {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 20, 30, 0.35);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
#loading.show { display: flex; }
#loading .ld-spin {
  width: 34px; height: 34px;
  border: 3px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ldspin 0.8s linear infinite;
}
@keyframes ldspin { to { transform: rotate(360deg); } }
#loading .loading-text {
  margin-top: 12px;
  font-size: 16px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* ============ 冷启动缓冲层（云托管缩容后首次打开等待） ============ */
#boot-view {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(160deg, #3d6ef7 0%, #6a8bff 100%);
  display: flex;                 /* 默认可见（HTML 内联样式保证 CSS 加载前也显示），防冷启动黑/白屏 */
  align-items: center;
  justify-content: center;
  z-index: 300;
}
#boot-view .boot-inner { display: flex; flex-direction: column; align-items: center; }
/* 漏斗（沙漏）缓冲标识：白描边上下斗 + 中间沙流，整组每 2s 翻转一次，模拟计时 */
#boot-view .boot-hourglass {
  position: relative;
  width: 40px; height: 52px;
  margin-bottom: 18px;
  transform-origin: 50% 50%;
  animation: boot-flip 2s ease-in-out infinite;
}
#boot-view .boot-hourglass::before,
#boot-view .boot-hourglass::after {
  content: '';
  position: absolute; left: 50%;
  width: 36px; height: 20px;
  border: 3px solid #fff;
  transform: translateX(-50%);
  box-sizing: border-box;
}
#boot-view .boot-hourglass::before { top: 0; border-bottom: none; border-radius: 18px 18px 6px 6px; }
#boot-view .boot-hourglass::after  { bottom: 0; border-top: none; border-radius: 6px 6px 18px 18px; }
#boot-view .boot-hourglass i {
  position: absolute; left: 50%; top: 50%;
  width: 4px; height: 10px; margin: -5px 0 0 -2px;
  border-radius: 2px;
  background: #fff;
  animation: boot-sand 2s ease-in-out infinite;
}
@keyframes boot-flip {
  0%, 100% { transform: rotate(0deg); }
  50%      { transform: rotate(180deg); }
}
@keyframes boot-sand {
  0%, 20%        { height: 3px;  margin-top: -1px; opacity: 0.45; }
  40%, 70%       { height: 10px; margin-top: -5px; opacity: 0.95; }
  85%, 100%      { height: 3px;  margin-top: -1px; opacity: 0.45; }
}
#boot-view .boot-text { font-size: 17px; font-weight: 600; color: #fff; letter-spacing: 1px; }
#boot-view .boot-sub { font-size: 13px; color: rgba(255,255,255,0.85); margin-top: 8px; }

/* ============ 登录页（网页版特有；图标封面 + 顶部品牌大色块，按小程序样图） ============ */
.login-wrap {
  min-height: 100vh;
  min-height: 100dvh;                       /* 手机浏览器动态视口，避免地址栏遮挡 */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: max(56px, env(safe-area-inset-top)) 22px max(28px, env(safe-area-inset-bottom));
  /* 顶部品牌大色块：从手机上缘开始、横向撑满全屏，向下延伸到约 56% 高度 */
  background: linear-gradient(180deg, #3d6ef7 0%, #6a8bff 56%, #f1f4f9 56.2%, #f1f4f9 100%);
}
/* 图标封面：应用图标大图，白边圆角 + 阴影（小程序样图同款主视觉） */
.login-logo {
  width: 150px; height: 150px;
  max-width: 42vw;
  border-radius: 34px;
  border: 4px solid #fff;
  background: #fff;
  box-shadow: 0 16px 40px rgba(20, 50, 150, 0.38);
  margin-bottom: 24px;
  display: block;
  object-fit: cover;
}
.login-title { font-size: 32px; font-weight: 700; color: #fff; margin-bottom: 8px; text-shadow: 0 2px 8px rgba(0, 0, 40, 0.18); }
.login-sub { font-size: 15px; color: rgba(255, 255, 255, 0.92); margin-bottom: 26px; }
/* 登录卡内的表单增强：登录/注册/找回通用 */
.login-tip {
  font-size: 14px;
  color: #ffe08a;
  margin: -18px 0 20px;
  text-align: center;
  word-break: break-all;
}
.login-card {
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px 26px;
  width: 100%;
  max-width: 560px;                          /* 手机满宽，电脑上限 560（不再偏窄） */
  box-shadow: 0 12px 34px rgba(20, 50, 140, 0.16);
}
.login-card .field-label { text-align: left; font-size: 14px; font-weight: 600; color: #23303f; }
.login-card .input {
  background: #FBFDFF;
  border: 1px solid #CFE3F0;
  border-radius: 12px;
  min-height: 52px;
  padding: 12px 14px;
  font-size: 17px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.login-card .input::placeholder { color: #a9bccb; }
.login-card .input:focus { border-color: #3d6ef7; background: #fff; box-shadow: 0 0 0 3px rgba(61, 110, 247, 0.14); }
/* 找回页：密保问题只读展示框，与放大后的输入框同款外观 */
.fg-question {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  background: #FBFDFF;
  border: 1px solid #CFE3F0;
  border-radius: 12px;
  padding: 12px 14px;
  min-height: 52px;
  font-size: 16px;
  color: #23303f;
}
.login-card .btn-block {
  height: 52px;
  border-radius: 13px;
  font-size: 17px;
  font-weight: 700;
  margin-top: 10px;
  background: linear-gradient(135deg, #5b84ff, #3d6ef7);
  box-shadow: 0 5px 16px rgba(61, 110, 247, 0.32);
}
.login-links {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  font-size: 15px;
}
.login-links a { color: #3d6ef7; text-decoration: none; }
.login-links a:active { opacity: 0.7; }
.field-tip { font-size: 15px; color: #7B93A8; margin-top: 6px; line-height: 1.5; }
.code-row { display: flex; gap: 8px; }
.code-row .input { flex: 1; }
.code-row .code-btn { flex-shrink: 0; white-space: nowrap; }
.code-row .code-btn:disabled { opacity: 0.6; }

/* ============ 首页（对应 pages/index/index.wxss） ============ */
.remind-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 10px 12px 0;
  padding: 11px 13px;
  background: #fff8e6;
  border: 1px solid #ffd98a;
  border-radius: 8px;
  cursor: pointer;
}
.remind-icon { font-size: 18px; }
.remind-text { flex: 1; font-size: 15px; color: #8a5b00; }
.remind-arrow { font-size: 19px; color: #c9973a; }

.hero { background: linear-gradient(135deg, #3d6ef7, #2f5cd9); color: #fff; }
.hero-label { font-size: 15px; opacity: 0.9; }
.hero-amount { font-size: 40px; font-weight: 700; margin: 4px 0 6px; }   /* 72rpx */
.hero-meta { display: flex; align-items: center; gap: 10px; font-size: 14px; opacity: 0.95; flex-wrap: wrap; }
.hero-chip {
  background: rgba(255, 255, 255, 0.22);
  padding: 3px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.hero-meta-item { font-size: 14px; }

.title-num { color: #3d6ef7; }
.acc-item { padding: 10px 0; border-bottom: 1px solid #eef2f8; }
.acc-item:last-child { border-bottom: none; padding-bottom: 2px; }
.acc-head { display: flex; justify-content: space-between; align-items: center; }
.acc-left { display: flex; align-items: center; gap: 6px; }
.acc-icon { font-size: 19px; }
.acc-name { font-size: 17px; font-weight: 600; }
.acc-balance { font-size: 19px; font-weight: 700; }
.acc-detail { font-size: 14px; color: #7a8ba0; margin: 3px 0 0 23px; }
.acc-progress { margin: 6px 0 0 23px; }
.progress-label { font-size: 13px; color: #7a8ba0; margin-top: 4px; }

.budget-warn {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 14px;
}
.budget-warn-icon { font-size: 17px; }
.budget-over { background: #feecec; color: #d14343; border: 1px solid #f6b6b6; }
.budget-warn { background: #fff7e6; color: #b37400; border: 1px solid #f2d088; }

.formula-btn {
  margin: 6px 12px 0;
  padding: 7px;
  background: #f4f8ff;
  border: 1px solid #d8e4fb;
  border-radius: 7px;
  text-align: center;
  font-size: 14px;
  color: #3d6ef7;
  font-weight: 600;
  cursor: pointer;
}

.week-text { font-size: 15px; color: #4a5b70; margin-bottom: 10px; }
.quick { display: flex; gap: 8px; }
.quick-btn {
  flex: 1;
  text-align: center;
  background: #f1f4f9;
  border-radius: 8px;
  padding: 11px 0;
  font-size: 15px;
  color: #3a4a5f;
  cursor: pointer;
  user-select: none;
}
.quick-primary { background: #3d6ef7; color: #fff; font-weight: 600; }

.suggest-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 0;
  border-bottom: 1px solid #eef2f8;
}
.suggest-item:last-of-type { border-bottom: none; }
.suggest-mid { flex: 1; min-width: 0; }
.suggest-name { font-size: 16px; font-weight: 600; }
.suggest-desc { font-size: 12px; color: #7a8ba0; margin-top: 2px; }
.suggest-amount { font-size: 17px; font-weight: 700; color: #3d6ef7; }

.pending-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid #eef2f8;
  cursor: pointer;
}
.pending-item:last-child { border-bottom: none; }
.pending-left { display: flex; align-items: center; gap: 7px; }
.pending-icon { font-size: 19px; }
.pending-mid { min-width: 0; }
.pending-name { font-size: 16px; font-weight: 600; }
.pending-date { font-size: 13px; color: #7a8ba0; }
.pending-right { display: flex; align-items: center; gap: 7px; }
.pending-amount { font-size: 16px; font-weight: 600; }
.pending-btn {
  background: #e8eefc;
  color: #3d6ef7;
  font-size: 14px;
  padding: 4px 10px;
  border-radius: 10px;
}

.foot-tip {
  text-align: center;
  color: #9aaabc;
  font-size: 13px;
  padding: 15px 0 5px;
  line-height: 1.8;
}

/* 公式解释弹窗 */
.formula-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.formula-dialog {
  width: 100%;
  max-width: 300px;
  background: #fff;
  border-radius: 12px;
  padding: 18px 16px;
}
.formula-title { font-size: 18px; font-weight: 700; text-align: center; margin-bottom: 12px; }
.f-item { padding: 7px 0; border-bottom: 1px solid #eef2f8; }
.f-item:last-of-type { border-bottom: none; }
.f-name { font-size: 15px; font-weight: 600; color: #22303f; }
.f-desc { font-size: 14px; color: #5a6b80; margin-top: 3px; line-height: 1.6; }
.formula-source { font-size: 12px; color: #9aaabc; text-align: center; margin: 10px 0; }
.formula-btn-dialog { margin-top: 4px; }

/* ============ 记账页（对应 pages/record/record.wxss） ============ */
/* 日期导航 */
.day-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 0;
}
.day-nav-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #3d6ef7;
  box-shadow: 0 1px 4px rgba(31, 60, 120, 0.08);
  border: none;
  cursor: pointer;
}
.day-nav-btn:active { background: #e8eefc; }
.day-nav-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 17px;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
}
.day-tag {
  font-size: 13px;
  color: #3d6ef7;
  background: #e8eefc;
  padding: 2px 7px;
  border-radius: 10px;
}
/* 日期选择器按钮（📅 点击唤出原生日期） */
.day-date {
  position: relative;
  overflow: hidden;
  width: 34px;
  height: 34px;
}
.day-date input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.day-nav-hint {
  text-align: center;
  font-size: 12px;
  color: #9aaabc;
  margin-top: 3px;
}
.batch-entry {
  margin: 6px 12px 0;
  padding: 10px;
  background: #e8f6f4;
  border: 1px solid #b8e6df;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #0d9488;
  text-align: center;
  cursor: pointer;
}

/* 批量补记底部弹窗 */
.batch-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 999;
  display: flex;
  align-items: flex-end;
}
.batch-sheet {
  width: 100%;
  background: #fff;
  border-radius: 14px 14px 0 0;
  padding: 14px;
  box-sizing: border-box;
}
.batch-head { display: flex; align-items: center; justify-content: space-between; }
.batch-title { font-size: 18px; font-weight: 700; }
.batch-close { font-size: 18px; color: #7a8ba0; padding: 2px 4px; cursor: pointer; }
.batch-desc { font-size: 14px; color: #7a8ba0; margin: 6px 0 10px; line-height: 1.6; }
.batch-mode { display: flex; gap: 8px; margin-bottom: 10px; }
.batch-mode-item {
  flex: 1; text-align: center; padding: 9px 0;
  background: #f1f4f9; border-radius: 8px;
  font-size: 16px; color: #3a4a5f; cursor: pointer;
}
.batch-mode-item.active { background: #3d6ef7; color: #fff; font-weight: 600; }
.batch-picker {
  font-size: 16px; padding: 9px 10px;
  background: #f8fafc; border-radius: 6px;
  margin-bottom: 6px;
  position: relative;
}
.batch-picker-readonly { color: #3d6ef7; font-weight: 600; }

/* 支出/收入切换 */
.type-switch {
  display: flex;
  background: #edf1f7;
  border-radius: 20px;
  padding: 3px;
  margin-bottom: 12px;
}
.type-btn {
  flex: 1;
  text-align: center;
  padding: 7px 0;
  border-radius: 18px;
  font-size: 16px;
  color: #4a5b70;
  cursor: pointer;
  user-select: none;
}
.type-btn.active { background: #fff; font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.type-btn.expense.active { color: #e5504a; }
.type-btn.income.active { color: #14b8a6; }

/* AI 输入 */
.ai-box { position: relative; }
.input-text {
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  font-size: 17px;
  padding: 8px;
  background: #f1f4f9;
  border: 1px solid transparent;
  border-radius: 8px;
  outline: none;
  font-family: inherit;
}
.input-text:focus { border-color: #3d6ef7; background: #fff; }
.ai-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ai-btn {
  flex: 1;
  min-width: 75px;
  text-align: center;
  background: #3d6ef7;
  color: #fff;
  padding: 11px 0;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.ai-btn:active { opacity: 0.8; }
.help-hint-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin-top: 7px;
  padding: 5px;
  cursor: pointer;
}
.help-hint-text { font-size: 13px; color: #3d6ef7; }
.help-hint-arrow { font-size: 15px; color: #3d6ef7; }
.ai-status { font-size: 14px; color: #7a8ba0; margin-top: 6px; }
.ai-status.loading { color: #3d6ef7; font-weight: 600; }
.ai-spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(61, 110, 247, 0.25);
  border-top-color: #3d6ef7;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 5px;
  animation: aiSpin .8s linear infinite;
}
@keyframes aiSpin { to { transform: rotate(360deg); } }

/* 帮助弹窗 */
.help-mask {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 999;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.help-dialog {
  width: 100%; max-width: 310px;
  background: #fff;
  border-radius: 12px;
  padding: 18px 16px;
}
.help-title { font-size: 18px; font-weight: 700; text-align: center; margin-bottom: 12px; }
.help-item { padding: 7px 0; border-bottom: 1px solid #eef2f8; }
.help-item:last-of-type { border-bottom: none; }
.help-name { font-size: 15px; font-weight: 600; color: #22303f; }
.help-desc { font-size: 13px; color: #5a6b80; margin-top: 3px; line-height: 1.6; }
.help-time { font-size: 12px; color: #9aaabc; margin-top: 3px; line-height: 1.6; }
.help-btn { margin-top: 10px; }

/* AI 识别结果 */
.ai-result { border: 1.5px solid #b8cbf9; }
.rec-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 0;
  border-bottom: 1px solid #eef2f8;
}
.rec-item:last-child { border-bottom: none; }
.rec-icon { font-size: 19px; }
.rec-mid { flex: 1; min-width: 0; }
.rec-cat-wrap, .rec-date-wrap {
  position: relative;
  display: inline-block;
  max-width: 150px;
  vertical-align: top;
  cursor: pointer;
}
.rec-cat-wrap .rec-cat,
.rec-date-wrap .rec-date {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: none;
  outline: none;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.rec-cat-text {
  display: inline-block;
  max-width: 100%;
  background: #e8eefc;
  color: #3d6ef7;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 14px;
  line-height: 1.2;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  box-sizing: border-box;
}
.rec-date-text {
  display: inline-block;
  background: #fff3e0;
  color: #b37400;
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 13px;
  line-height: 1.2;
  margin-top: 4px;
}
.rec-sub {
  font-size: 12px;
  color: #7a8ba0;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rec-amt { width: 80px; text-align: right; font-size: 15px; padding: 5px 7px; background: transparent; border: none; min-height: auto; }
.rec-del { color: #e5504a; font-size: 17px; padding: 5px; flex-shrink: 0; cursor: pointer; }
.save-area { margin: 12px 0 0; }
.clear-btn { margin-top: 7px; }

/* 分类选择：大类 chips 横向滚动 */
.cat-scroll { white-space: nowrap; overflow-x: auto; margin-bottom: 10px; }
.cat-chips { display: inline-flex; gap: 7px; }
.cat-chip {
  display: inline-block;
  padding: 7px 14px;
  background: #f1f4f9;
  border-radius: 15px;
  font-size: 15px;
  color: #3a4a5f;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.cat-chip.active { background: #3d6ef7; color: #fff; font-weight: 600; }

.sub-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.sub-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 9px 0;
  background: #f1f4f9;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
}
.sub-item.selected { border-color: #3d6ef7; background: #e8eefc; }
.sub-icon { font-size: 20px; }
.sub-name { font-size: 13px; color: #4a5b70; }
.sub-item.selected .sub-name { color: #3d6ef7; font-weight: 600; }

/* 当天分类金额 */
.day-cat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #eef2f8;
}
.day-cat-row:last-child { border-bottom: none; }
.day-cat-icon { font-size: 18px; width: 22px; text-align: center; }
.day-cat-name { flex: 1; font-size: 16px; }
.day-cat-amount { font-size: 16px; font-weight: 700; }
.day-cat-amount.income { color: #14b8a6; }
.day-cat-amount.expense { color: #3a4a5f; }
.day-cat-total {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #dbe3ee;
  font-size: 14px;
  color: #4a5b70;
}
.total-num { font-size: 17px; font-weight: 700; color: #3a4a5f; }
.total-num.income { color: #14b8a6; }

/* 当日明细 */
.day-rec-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 0;
  border-bottom: 1px solid #eef2f8;
}
.day-rec-item:last-child { border-bottom: none; }
.day-rec-icon { font-size: 18px; }
.day-rec-mid { flex: 1; min-width: 0; }
.day-rec-name { font-size: 15px; font-weight: 600; }
.day-rec-sub { font-size: 12px; color: #7a8ba0; }
.day-rec-cat-wrap {
  position: relative;
  flex-shrink: 0;
  max-width: 80px;
  cursor: pointer;
}
.day-rec-cat-wrap .day-rec-cat {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: none;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  font-family: inherit;
}
.day-rec-cat-text {
  display: inline-block;
  max-width: 100%;
  background: #e8eefc;
  color: #3d6ef7;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 13px;
  line-height: 1.2;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  box-sizing: border-box;
}
.day-rec-amt { font-size: 15px; font-weight: 700; flex-shrink: 0; }
.day-rec-amt.income { color: #14b8a6; }
.day-rec-del { color: #e5504a; font-size: 16px; padding: 4px; flex-shrink: 0; cursor: pointer; }
.day-empty { text-align: center; color: #9aaabc; font-size: 15px; padding: 10px 0; }

/* 记账完成鼓励 */
.done-card { text-align: center; padding-top: 4px; }
.done-btn {
  background: linear-gradient(135deg, #3d6ef7, #2f5cd9);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  padding: 12px 0;
  border-radius: 9px;
  cursor: pointer;
  user-select: none;
}
.done-tip { font-size: 12px; color: #9aaabc; margin-top: 6px; }

/* 鼓励动效（金币雨：深色夜景） */
.enc-mask {
  position: fixed; inset: 0;
  background: rgba(5, 8, 20, 0.72);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}
.enc-emoji {
  font-size: 72px;
  animation: enc-zoom 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.55)) drop-shadow(0 3px 10px rgba(0,0,0,0.4));
}
@keyframes enc-zoom {
  0% { transform: scale(0) rotate(-60deg); opacity: 0; }
  60% { transform: scale(1.15) rotate(10deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); }
}
.enc-title {
  font-size: 23px;
  font-weight: 700;
  color: #ffd86b;
  margin-top: 14px;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5), 0 1px 6px rgba(0,0,0,0.6);
  animation: enc-heart 1.2s ease-in-out infinite;
}
@keyframes enc-heart {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.08); }
  45% { transform: scale(1); }
  60% { transform: scale(1.06); }
}
.enc-text {
  font-size: 15px;
  color: #fff;
  line-height: 1.7;
  margin: 10px 30px 0;
  text-align: center;
  text-shadow: 0 1px 5px rgba(0,0,0,0.6);
}
.enc-particle {
  position: absolute;
  top: -30px;
  font-size: 24px;
  text-shadow: 0 0 9px rgba(255, 215, 0, 0.6);
  animation: enc-rain 3s linear infinite;
  opacity: 0;
}
.enc-p1 { left: 8%;   animation-delay: 0s; }
.enc-p2 { left: 24%;  animation-delay: 0.6s; }
.enc-p3 { left: 40%;  animation-delay: 1.1s; }
.enc-p4 { left: 60%;  animation-delay: 0.3s; }
.enc-p5 { left: 76%;  animation-delay: 0.9s; }
.enc-p6 { left: 90%;  animation-delay: 1.4s; }
@keyframes enc-rain {
  0%   { transform: translateY(0) rotate(0deg);   opacity: 0; }
  10%  { opacity: 1; }
  50%  { transform: translateY(48vh) rotate(180deg); opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(95vh) rotate(360deg); opacity: 0; }
}
.enc-hint {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  margin-top: 24px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* 备注：填空 + 右侧下拉选 */
.note-row { display: flex; gap: 7px; align-items: center; }
.note-input { flex: 1; }
.note-drop {
  position: relative;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f4f9;
  border: 1px solid #dde3ec;
  border-radius: 7px;
  cursor: pointer;
}
.note-drop-text { font-size: 17px; color: #4a5b70; line-height: 1; }
.note-drop-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: none;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  text-align: center;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
.note-drop:active { background: #e4e9f2; }

/* ============ 统计页（对应 pages/stats/stats.wxss） ============ */
.range-bar { padding: 12px 12px 4px; display: flex; justify-content: center; }
.range-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.range-chip {
  padding: 6px 13px;
  border-radius: 15px;
  background: #fff;
  font-size: 16px;
  font-weight: 700;
  color: #1f2937;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
  transition: all .2s;
  cursor: pointer;
  user-select: none;
}
.range-chip.active { background: #3d6ef7; color: #fff; }

.overview-row { display: flex; flex-wrap: wrap; text-align: center; }
.ov-item { flex: 0 0 50%; padding: 6px 0; box-sizing: border-box; }
.ov-num { font-size: 17px; font-weight: 700; white-space: nowrap; }
.ov-num.income { color: #3d6ef7; }
.ov-num.green { color: #3d6ef7; }
.ov-num.strong { font-weight: 700; }
.ov-num.danger { color: #e5504a; }
.ov-label { font-size: 13px; color: #7a8ba0; margin-top: 2px; }
.ov-hint { font-size: 13px; color: #9aaabc; text-align: center; margin-top: 8px; }

/* 花销分布：饼图（图例左 + 饼图右） */
.pie-layout { display: flex; align-items: center; gap: 12px; padding: 5px 0 8px; }
.pie-legend { flex: 1; min-width: 0; }
.legend-row { display: flex; align-items: center; gap: 4px; padding: 4px 0; }
.legend-dot { width: 7px; height: 7px; border-radius: 2px; flex: 0 0 7px; }
.legend-name { flex: 1; font-size: 14px; font-weight: 600; color: #22303f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend-amt { font-size: 14px; font-weight: 600; color: #22303f; }
.pie-canvas-wrap { flex: 0 0 200px; }
.pie-canvas { width: 200px; height: 200px; }
.chart-empty { text-align: center; color: #9aaabc; font-size: 14px; padding: 15px 0; }

/* 与上期对比柱状图 */
.bar-chart { display: flex; justify-content: space-around; align-items: flex-end; height: 180px; padding: 5px 0; }
.bar-group { display: flex; flex-direction: column; align-items: center; flex: 1; }
.bar-pair { display: flex; align-items: flex-end; gap: 10px; height: 150px; }
.bar-col { display: flex; flex-direction: column; align-items: center; height: 150px; justify-content: flex-end; }
.bar {
  width: 22px;
  border-radius: 4px 4px 0 0;
  transition: height .4s;
}
.bar-prev { background: #cbd5e1; }
.bar-cur { background: #3d6ef7; }
.bar-val { font-size: 11px; color: #7a8ba0; margin-bottom: 2px; }
.bar-val-cur { color: #3d6ef7; font-weight: 700; }
.bar-label { font-size: 11px; color: #9aaabc; margin-top: 3px; }
.bar-name { font-size: 14px; color: #22303f; font-weight: 600; margin-top: 5px; }

/* 日常消费主要去向 */
.cat-bar, .sub-bar { margin-bottom: 10px; }
.cat-bar:last-child, .sub-bar:last-child { margin-bottom: 2px; }
.cat-bar-head { display: flex; justify-content: space-between; font-size: 15px; margin-bottom: 4px; }
.cat-name { font-weight: 500; }
.cat-amount { color: #7a8ba0; }
.progress-fill.sub-fill { background: #14b8a6; }

/* 账户流水 */
.acc-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #eef2f8; }
.acc-row:last-child { border-bottom: none; }
.acc-mid { flex: 1; min-width: 0; }
.acc-name { font-size: 16px; font-weight: 600; }
.acc-detail { font-size: 13px; color: #7a8ba0; }

/* AI 改善建议 */
.ai-summary-text {
  font-size: 15px;
  color: #22303f;
  line-height: 1.8;
  background: #f4f8ff;
  border: 1px solid #d8e4fb;
  border-radius: 8px;
  padding: 11px 12px;
  margin-bottom: 8px;
}
.ai-regenerate {
  text-align: center;
  color: #3d6ef7;
  font-size: 15px;
  padding: 6px 0;
  cursor: pointer;
}
.ai-summary-empty { font-size: 15px; color: #9aaabc; text-align: center; padding: 4px 0 10px; }

/* 明细入口 + 底部弹窗 */
.detail-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.detail-arrow { font-size: 18px; color: #3d6ef7; }
.detail-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 999;
  display: flex;
  align-items: flex-end;
}
.detail-sheet {
  width: 100%;
  max-height: 75vh;
  background: #fff;
  border-radius: 14px 14px 0 0;
  padding: 12px 14px 15px;
  box-sizing: border-box;
}
.detail-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid #eef2f8;
}
.detail-sheet-title { font-size: 17px; font-weight: 700; }
.detail-sheet-close { font-size: 18px; color: #7a8ba0; padding: 2px 4px; cursor: pointer; }
.detail-sheet-body { max-height: 56vh; overflow-y: auto; }
.detail-sheet-hint { text-align: center; color: #9aaabc; font-size: 13px; padding-top: 8px; }
.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid #eef2f8;
  cursor: pointer;
}
.list-item:last-child { border-bottom: none; }
.list-left { display: flex; align-items: center; gap: 7px; min-width: 0; }
.list-icon { font-size: 18px; }
.list-mid { min-width: 0; }
.list-name { font-size: 16px; }
.list-sub { font-size: 13px; color: #7a8ba0; }
.list-amount { font-size: 16px; font-weight: 600; flex-shrink: 0; }
.list-empty { text-align: center; color: #9aaabc; font-size: 15px; padding: 15px 0; }

/* ============ 我的页（对应 pages/me/me.wxss） ============ */
.save-btn { flex-shrink: 0; align-self: flex-end; margin-bottom: 11px; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.switch-left { flex: 1; min-width: 0; }
.switch-title { font-size: 16px; font-weight: 600; margin-bottom: 3px; }

.bal-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.bal-name { font-size: 16px; flex-shrink: 0; }
.bal-input-wrap { display: flex; align-items: center; gap: 5px; flex: 1; max-width: 160px; }
.bal-input { text-align: right; }
.bal-unit { font-size: 14px; color: #7a8ba0; }

.tpl-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid #eef2f8;
}
.tpl-item:last-child { border-bottom: none; }
.tpl-mid { flex: 1; }
.tpl-name { font-size: 16px; font-weight: 600; }
.tpl-sub { font-size: 13px; color: #7a8ba0; }
.tpl-amount { font-size: 16px; font-weight: 600; }
.tpl-amount.income-amt { color: #14b8a6; }
.tpl-del { font-size: 14px; color: #e5504a; cursor: pointer; }
.tpl-form { margin-top: 10px; padding-top: 10px; border-top: 1px solid #eef2f8; }

.kw-list { margin-top: 10px; }
.kw-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 0;
  border-bottom: 1px solid #eef2f8;
}
.kw-item:last-child { border-bottom: none; }
.kw-sub {
  background: #e8eefc;
  color: #3d6ef7;
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 13px;
  flex-shrink: 0;
  max-width: 150px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.kw-word { flex: 1; font-size: 15px; }
.kw-del { color: #e5504a; font-size: 16px; padding: 4px; cursor: pointer; }

/* 自定义开关（对应小程序 switch） */
.switch {
  position: relative;
  width: 46px; height: 26px;
  background: #cfd6e1;
  border-radius: 13px;
  transition: 0.2s;
  cursor: pointer;
  flex-shrink: 0;
}
.switch.on { background: #3d6ef7; }
.switch-knob {
  position: absolute; left: 3px; top: 3px;
  width: 20px; height: 20px;
  background: #fff; border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: 0.2s;
}
.switch.on .switch-knob { transform: translateX(20px); }

/* ============ 网页版小工具 / 通用补充 ============ */
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.text-gray { color: #7a8ba0; }
.link { color: #3d6ef7; cursor: pointer; }
.ai-status-ok { color: #3d6ef7; }

/* 退出登录按钮间距 */
#page-body { padding-bottom: 20px; }
.btn-block + .btn-block { margin-top: 10px; }
