* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { min-height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f2f4f1;
  color: #2b2b2b;
  padding-bottom: 96px;
}
button, input, select { font-family: inherit; }
.phone { max-width: 430px; margin: 0 auto; position: relative; min-height: 100vh; }
.view { display: none; }
.view.on { display: block; }
svg { display: block; }
.card {
  background: #fff;
  border-radius: 16px;
  margin: 0 14px 12px;
  padding: 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .05);
}
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
}
.header .left { display: flex; align-items: center; gap: 10px; }
.logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #8fc9a6, #6fae8b);
  position: relative;
}
.logo::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  width: 12px;
  height: 18px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .55);
}
.header h1 { font-size: 19px; font-weight: 700; }
.header .icons { display: flex; align-items: center; gap: 8px; color: #7d8a80; }
.icon-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  color: #7d8a80;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.icon-btn svg { width: 20px; height: 20px; }
.dots { display: flex; flex-direction: column; gap: 3px; }
.dots i { width: 4px; height: 4px; border-radius: 50%; background: #7d8a80; }
.stat-card {
  margin: 8px 14px 14px;
  padding: 18px;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #e4efe6, #d8e9dd 55%, #cfe3d6);
  box-shadow: 0 6px 18px rgba(120, 160, 135, .18);
}
.stat-card .row { display: flex; gap: 22px; position: relative; z-index: 2; }
.stat-card .k { font-size: 13px; color: #7d8f83; margin-bottom: 6px; }
.stat-card .v { font-size: 21px; font-weight: 800; color: #2f3a33; }
.stat-card .big { margin-top: 16px; position: relative; z-index: 2; }
.stat-card .big .v { font-size: 32px; color: #4f9a72; }
.plant { position: absolute; right: -8px; bottom: -6px; width: 180px; height: 120px; z-index: 1; }
.add-btn {
  margin: 0 14px 16px;
  height: 54px;
  width: calc(100% - 28px);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  background: linear-gradient(135deg, #7fbc98, #69a982);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 20px rgba(105, 169, 130, .35);
}
.add-btn:active { transform: scale(.985); }
.add-btn svg { width: 19px; height: 19px; }
.day-group { margin: 0 14px 16px; }
.day-head { display: flex; align-items: baseline; justify-content: space-between; padding: 6px 2px 10px; }
.day-head .date { font-size: 17px; font-weight: 800; }
.day-head .date span { font-size: 13.5px; font-weight: 500; color: #98a29a; margin-left: 8px; }
.day-head .sum { font-size: 13px; color: #98a29a; }
.day-head .sum b { font-weight: 600; margin-left: 2px; }
.in-c { color: #e0655f; }
.out-c { color: #4f9a72; }
.day-card { background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 4px 14px rgba(0, 0, 0, .05); }
.swipe { position: relative; overflow: hidden; }
.swipe .del-bg {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 72px;
  background: #e0655f;
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
}
.item {
  display: flex;
  align-items: center;
  padding: 13px;
  gap: 12px;
  background: #fff;
  position: relative;
  touch-action: pan-y;
  cursor: pointer;
  transition: transform .18s;
}
.item + .item { border-top: 1px solid #f0f2ef; }
.item .avatar {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  flex-shrink: 0;
  background: #eaf3ec;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #3d463f;
  font-weight: 600;
}
.item .mid { flex: 1; min-width: 0; }
.item .mid .t {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item .mid .time { font-size: 12.5px; color: #a8b0a9; }
.item .right { text-align: right; }
.item .right .amt { font-size: 16.5px; font-weight: 700; }
.empty { text-align: center; color: #a8b0a9; padding: 50px 0; font-size: 14px; }
.nav-top { display: flex; align-items: center; gap: 10px; padding: 14px; }
.back {
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  cursor: pointer;
  color: #2b2b2b;
  display: flex;
  align-items: center;
  justify-content: center;
}
.back svg { width: 22px; height: 22px; }
.seg {
  flex: 1;
  display: flex;
  background: #fff;
  border-radius: 12px;
  padding: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}
.seg button {
  flex: 1;
  border: none;
  background: none;
  padding: 9px 0;
  border-radius: 9px;
  font-size: 15px;
  color: #8a968c;
  cursor: pointer;
}
.seg button.on { background: #7fbc98; color: #fff; font-weight: 600; }
.book-tag, .msel {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  background: #fff;
  border-radius: 12px;
  padding: 0 12px;
  height: 40px;
  font-size: 14px;
  color: #3d463f;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}
.cat-wrap {
  margin: 0 14px;
  background: #fff;
  border-radius: 16px;
  padding: 18px 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .05);
}
.cats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px 2px; }
.cat {
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.cat .ic {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #f2f4f1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #3d463f;
}
.cat .nm { font-size: 11.5px; color: #5c6a60; }
.cat.on .ic { background: #a8cdb4; color: #fff; }
.cat.on .nm { color: #4f9a72; font-weight: 600; }
.input-card {
  margin: 14px;
  background: #fff;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .05);
}
.input-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f2ef;
}
.input-top input { flex: 1; border: none; outline: none; font-size: 15px; background: transparent; }
.input-top input::placeholder { color: #b8bfb9; }
#amtShow { font-size: 25px; font-weight: 800; color: #e0655f; min-width: 80px; text-align: right; }
#amtShow.in { color: #4f9a72; }
.keypad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; padding: 0 14px 18px; }
.key {
  border: none;
  border-radius: 13px;
  background: #fff;
  height: 58px;
  font-size: 21px;
  font-weight: 700;
  color: #2b2b2b;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}
.key:active { background: #eef1ee; }
.key.fn { background: #f0f2f0; font-size: 15px; font-weight: 500; color: #3d463f; }
.key.save { background: #7fbc98; color: #fff; font-size: 17px; }
.navbar { display: flex; align-items: center; padding: 14px 16px; gap: 12px; }
.navbar h2 { font-size: 19px; font-weight: 700; }
.d-main { display: flex; align-items: center; gap: 14px; }
.d-main .avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #eaf3ec;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: #3d463f;
}
.d-main .t { flex: 1; font-size: 17px; font-weight: 600; }
.d-main .amt { font-size: 26px; font-weight: 800; }
.d-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 0;
  border-bottom: 1px solid #f4f6f3;
  min-height: 48px;
}
.d-row:last-child { border: none; }
.d-row .l { font-size: 15px; color: #7d8a80; }
.d-row .r { font-size: 15px; color: #2b2b2b; }
.d-actions { display: flex; gap: 12px; padding: 8px 14px 24px; }
.d-actions button {
  flex: 1;
  height: 52px;
  border-radius: 14px;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.d-actions .refund, .d-actions .del { background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .06); }
.d-actions .refund { color: #2b2b2b; }
.d-actions .del { color: #e0655f; }
.d-actions .edit { background: #7fbc98; color: #fff; }
.top-tabs { display: flex; align-items: center; gap: 6px; padding: 14px 12px 8px; }
.top-tabs button {
  border: none;
  background: none;
  font-size: 15px;
  color: #8a968c;
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
}
.top-tabs button.on { background: #7fbc98; color: #fff; font-weight: 600; }
.sum-card {
  margin: 8px 14px 14px;
  border-radius: 16px;
  padding: 16px 10px;
  background: linear-gradient(135deg, #7fbc98, #6fae8b);
  color: #fff;
  display: flex;
  box-shadow: 0 8px 20px rgba(105, 169, 130, .3);
}
.sum-card .c { flex: 1; text-align: center; }
.sum-card .k { font-size: 13px; opacity: .9; margin-bottom: 7px; }
.sum-card .v { font-size: 19px; font-weight: 800; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-head h3 { font-size: 17px; font-weight: 800; }
.seg2 { display: flex; background: #eef4f0; border-radius: 10px; padding: 3px; }
.seg2 button {
  border: none;
  background: none;
  padding: 6px 13px;
  border-radius: 8px;
  font-size: 13.5px;
  color: #7d8a80;
  cursor: pointer;
}
.seg2 button.on { background: #7fbc98; color: #fff; font-weight: 600; }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; font-size: 13px; }
.bar-row .nm { width: 66px; color: #5c6a60; flex-shrink: 0; }
.bar-row .track { flex: 1; height: 15px; background: #f2f4f1; border-radius: 8px; overflow: hidden; }
.bar-row .fill { height: 100%; border-radius: 8px; }
.bar-row.in .fill { background: linear-gradient(90deg, #f0a8a3, #e0655f); }
.bar-row.out .fill { background: linear-gradient(90deg, #a8cdb4, #7fbc98); }
.bar-row .val { width: 80px; text-align: right; font-weight: 600; }
.tabbar-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  padding: 0 14px calc(12px + env(safe-area-inset-bottom));
  pointer-events: none;
}
.tabbar {
  pointer-events: auto;
  width: 100%;
  max-width: 400px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 9px 6px 7px;
  border-radius: 26px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(255, 255, 255, .85);
  box-shadow: 0 12px 32px rgba(80, 110, 90, .22);
}
.tab {
  flex: 1;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 0;
  color: #8d978f;
  font-size: 11.5px;
}
.tab svg { width: 21px; height: 21px; }
.tab.active { color: #4f9a72; font-weight: 600; }
.sheet { display: none; position: fixed; inset: 0; z-index: 200; }
.sheet.on { display: block; }
.sheet-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, .35); }
.sheet-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 16px 16px calc(18px + env(safe-area-inset-bottom));
  max-width: 430px;
  margin: 0 auto;
}
.sheet-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.sheet-item, .book-item {
  width: 100%;
  text-align: left;
  border: none;
  background: #f6f8f6;
  border-radius: 12px;
  padding: 14px;
  font-size: 15px;
  margin-bottom: 8px;
  cursor: pointer;
}
.book-item.on { background: #e7f3eb; color: #4f9a72; font-weight: 700; }
.sheet-add { display: flex; gap: 8px; margin-top: 8px; }
.sheet-add input {
  flex: 1;
  border: 1px solid #e4ebe6;
  border-radius: 12px;
  padding: 12px;
  font-size: 15px;
  outline: none;
}
.sheet-add button {
  border: none;
  background: #7fbc98;
  color: #fff;
  border-radius: 12px;
  padding: 0 16px;
  font-size: 15px;
  cursor: pointer;
}
#searchInput {
  width: 100%;
  border: 1px solid #e4ebe6;
  border-radius: 12px;
  padding: 12px;
  font-size: 15px;
  outline: none;
  margin-bottom: 12px;
}
.search-hit {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 2px;
  border-bottom: 1px solid #f0f2ef;
  cursor: pointer;
  font-size: 14px;
}
.toast {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, .75);
  color: #fff;
  padding: 12px 22px;
  border-radius: 12px;
  font-size: 14px;
  z-index: 999;
  opacity: 0;
  transition: .3s;
  pointer-events: none;
}
.toast.on { opacity: 1; }
.refunded { opacity: .55; }
.tag {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  color: #e0655f;
  border: 1px solid #f0c2bf;
  border-radius: 8px;
  padding: 0 5px;
  font-weight: 500;
}
