/* ============================================================
   日账 · 样式
   深色玻璃拟态 + 金色立体主色，靠渐变/内高光/多层投影做质感
   ============================================================ */

:root {
  --bg: #070A16;
  --panel: rgba(20, 27, 50, .66);
  --panel-2: rgba(28, 37, 66, .72);
  --line: rgba(255, 255, 255, .075);
  --line-2: rgba(255, 255, 255, .14);
  --text: #EAEFFB;
  --text-2: #98A4C2;
  --text-3: #5D6885;
  --gold: #F3C265;
  --gold-l: #FFE7B4;
  --gold-d: #C9871B;
  --gold-ink: #2A1A02;
  --green: #4ADE80;
  --red: #FF7A7A;
  --blue: #6D9CFF;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 11px;
  --tab-h: 56px;
  --shadow-card: 0 18px 38px -24px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .10), inset 0 -1px 0 rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* , *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { height: 100%; margin: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background:
    radial-gradient(1200px 760px at 8% -12%, rgba(88, 128, 255, .24), transparent 62%),
    radial-gradient(900px 620px at 104% 4%, rgba(243, 194, 101, .10), transparent 58%),
    radial-gradient(880px 780px at 46% 112%, rgba(54, 92, 196, .18), transparent 64%),
    linear-gradient(180deg, #0A1024 0%, #060913 58%, #05070E 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  overscroll-behavior: none;
}

/* 细微噪点，避免大面积渐变出现色带 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: .022;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3'/></filter><rect width='140' height='140' filter='url(%23n)'/></svg>");
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
input { border: 0; background: none; }
h1, h2, h3, p { margin: 0; }

::-webkit-scrollbar { width: 0; height: 0; }

/* ---------------------------- 布局骨架 ---------------------------- */

.app { position: fixed; inset: 0; }

.view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(.995);
  transition: opacity .26s ease, transform .26s ease, visibility .26s;
}
.view.is-active { opacity: 1; visibility: visible; transform: none; }

.scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: 14px;
}

/* ---------------------------- 卡片 ---------------------------- */

.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background:
    linear-gradient(158deg, rgba(255, 255, 255, .085) 0%, rgba(255, 255, 255, .022) 42%, rgba(0, 0, 0, .16) 100%),
    var(--panel);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}
.card::after {
  content: "";
  position: absolute;
  left: 16%;
  right: 16%;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .38), transparent);
}

/* ---------------------------- 顶部概览 ---------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 10px;
  padding: 10px 16px 0;
}

.hero__main {
  padding: 13px 15px 12px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
}
.hero__label { font-size: 11.5px; color: var(--text-2); letter-spacing: .06em; }
.hero__value {
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.hero__value i { font-style: normal; font-size: 14px; color: var(--gold); font-weight: 600; }
.hero__value b { font-size: 27px; font-weight: 700; line-height: 1.15; }
.hero__meta { font-size: 11.5px; color: var(--text-3); }
.hero__meta b { color: var(--text-2); font-weight: 600; }

.hero__side {
  padding: 13px 11px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}
.hero__side .mini { display: flex; flex-direction: column; gap: 1px; }
.hero__side .mini span { font-size: 10.5px; color: var(--text-3); }
.hero__side .mini b { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hero__side .mini b.is-gold { color: var(--gold); }
.hero__side .mini b em { font-style: normal; }

/* ---------------------------- 金额显示 ---------------------------- */

.amount {
  display: flex;
  align-items: baseline;
  padding: 20px 22px 6px;
  min-height: 84px;
}
.amount__cur {
  font-size: 25px;
  font-weight: 600;
  color: var(--gold);
  margin-right: 5px;
  transform: translateY(-10px);
  opacity: .9;
}
.amount__num {
  font-size: 54px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
  transition: color .2s;
}
.amount.is-empty .amount__num { color: var(--text-3); }
.amount.is-over .amount__num { color: var(--gold-l); }
.amount__caret {
  width: 2px;
  height: 34px;
  margin-left: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--gold-l), var(--gold-d));
  transform: translateY(-4px);
  animation: blink 1.15s steps(1) infinite;
}
@keyframes blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }

/* ---------------------------- 类别 ---------------------------- */

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 20px 7px 22px;
  font-size: 11.5px;
  letter-spacing: .08em;
  color: var(--text-3);
}
.link-btn {
  font-size: 12px;
  color: var(--gold);
  opacity: .9;
  padding: 2px 2px;
}

.cats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0 16px;
}

.cat {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 9px 2px 8px;
  border-radius: 15px;
  color: #fff;
  overflow: hidden;
  background-image: var(--cat-bg);
  box-shadow:
    0 9px 20px -12px var(--cat-glow),
    inset 0 1px 0 rgba(255, 255, 255, .30),
    inset 0 -12px 20px -14px rgba(0, 0, 0, .75);
  transition: transform .13s cubic-bezier(.2, .8, .3, 1), box-shadow .18s;
  will-change: transform;
}
.cat::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, .26), rgba(255, 255, 255, 0) 46%);
  pointer-events: none;
}
.cat::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 0;
  height: 1px;
  background: rgba(0, 0, 0, .35);
}
.cat__ico { font-size: 20px; line-height: 1.1; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35)); }
.cat__name {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .01em;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .3);
}
.cat:active { transform: scale(.94); }
.cat.is-on {
  box-shadow:
    0 0 0 1.6px var(--gold-l),
    0 0 0 4px rgba(243, 194, 101, .16),
    0 12px 24px -10px var(--cat-glow),
    inset 0 1px 0 rgba(255, 255, 255, .35);
  transform: translateY(-1px);
}
.cat.is-on .cat__ico { transform: scale(1.06); }

/* ---------------------------- 备注 ---------------------------- */

.note-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 9px 16px 0;
  padding: 0 13px;
  height: 42px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .035);
}
.note-row__icon {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: var(--text-3);
  stroke-width: 1.8;
  stroke-linecap: round;
}
.note-row input {
  flex: 1;
  min-width: 0;
  height: 100%;
  font-size: 14px;
  outline: none;
}
.note-row input::placeholder { color: var(--text-3); }

/* ---------------------------- 数字键盘 ---------------------------- */

.bottom { flex: none; }

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 0 14px;
  margin-top: 8px;
}
.key {
  height: 46px;
  border-radius: 13px;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 20px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .018));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09), 0 4px 10px -8px #000;
  transition: background .12s, transform .1s;
}
.key:active { background: rgba(255, 255, 255, .15); transform: scale(.97); }
.key--fn { font-size: 17px; color: var(--text-2); }

.submit {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: calc(100% - 28px);
  margin: 9px 14px calc(env(safe-area-inset-bottom, 0px) + 6px);
  height: 50px;
  border-radius: 16px;
  color: var(--gold-ink);
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: .04em;
  background: linear-gradient(180deg, #FFEFC9 0%, #F7CE7C 26%, #F3C265 52%, #C9871B 100%);
  box-shadow:
    0 14px 28px -14px rgba(243, 194, 101, .75),
    inset 0 1px 0 rgba(255, 255, 255, .9),
    inset 0 -2px 6px rgba(122, 72, 0, .3);
  transition: transform .12s, filter .2s;
}
.submit:active { transform: scale(.985); filter: brightness(.96); }
.submit__hint {
  font-size: 11.5px;
  font-weight: 500;
  opacity: .62;
  letter-spacing: 0;
}
.submit[disabled] {
  filter: grayscale(.75) brightness(.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3);
  pointer-events: none;
}

/* ---------------------------- 页面标题 ---------------------------- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 10px;
}
.page-head__text h1 {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.page-head__text p {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-3);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.icon-btn svg {
  width: 18px; height: 18px;
  fill: none; stroke: var(--text-2);
  stroke-width: 1.9; stroke-linecap: round;
}
.icon-btn:active { background: rgba(255, 255, 255, .1); }

.pill-btn {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(243, 194, 101, .3);
  background: rgba(243, 194, 101, .1);
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  flex: none;
}

/* ---------------------------- 筛选 chips ---------------------------- */

.chips {
  display: flex;
  gap: 7px;
  padding: 2px 16px 12px;
  overflow-x: auto;
  flex: none;
}
.chip {
  flex: none;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .035);
  color: var(--text-2);
  font-size: 12.5px;
  white-space: nowrap;
  transition: all .16s;
}
.chip.is-on {
  color: var(--gold-ink);
  border-color: transparent;
  background: linear-gradient(180deg, #FFE7B4, #EAB04A);
  box-shadow: 0 6px 14px -8px rgba(243, 194, 101, .9);
  font-weight: 600;
}

/* ---------------------------- 明细列表 ---------------------------- */

.pending-card {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 16px 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(243, 194, 101, .34);
  background:
    linear-gradient(150deg, rgba(243, 194, 101, .18), rgba(243, 194, 101, .05) 60%, rgba(0, 0, 0, .1));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16);
  text-align: left;
  width: calc(100% - 32px);
}
.pending-card__badge {
  width: 34px; height: 34px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #FFE7B4, #DE9E33);
  color: var(--gold-ink);
  font-size: 15px; font-weight: 700;
  flex: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.pending-card__text { flex: 1; min-width: 0; }
.pending-card__text b { display: block; font-size: 13.5px; color: var(--gold-l); }
.pending-card__text span { font-size: 11.5px; color: rgba(255, 231, 180, .62); }
.pending-card__arrow { color: var(--gold); font-size: 15px; }

.day-group { margin-bottom: 6px; }
.day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 12px 22px 6px;
  font-size: 11.5px;
  color: var(--text-3);
}
.day-head b { color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }

.row {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 12px;
  padding: 9px 10px;
  border-radius: 14px;
  width: calc(100% - 24px);
  text-align: left;
  transition: background .16s;
}
.row:active { background: rgba(255, 255, 255, .055); }

.row__ico {
  width: 36px; height: 36px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex: none;
  background-image: var(--cat-bg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .28),
    inset 0 -8px 12px -10px rgba(0, 0, 0, .8),
    0 6px 12px -8px var(--cat-glow);
}
.row__main { flex: 1; min-width: 0; }
.row__title {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row__sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row__sub .tag {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .07);
  color: var(--text-2);
  font-size: 10px;
  flex: none;
}
.row__sub .tag--gold { background: rgba(243, 194, 101, .16); color: var(--gold); }
.row__amt {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
  flex: none;
}
.row__amt i {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-3);
  margin-right: 1px;
}
.row--pending { background: rgba(243, 194, 101, .055); }
.row--pending .row__amt { color: var(--gold); }
.row--pending .row__amt i { color: rgba(243, 194, 101, .55); }

/* ---------------------------- 统计 ---------------------------- */

.stats-wrap { padding: 0 16px; }

.stat-hero {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.stat-hero__row { display: flex; align-items: flex-end; justify-content: space-between; }
.stat-hero__label { font-size: 11.5px; color: var(--text-2); letter-spacing: .06em; }
.stat-hero__value {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.stat-hero__value i { font-style: normal; font-size: 15px; color: var(--gold); margin-right: 3px; font-weight: 600; }
.stat-hero__pill {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  background: rgba(109, 156, 255, .14);
  color: #A9C2FF;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.stat-cell {
  padding: 10px 11px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .032);
}
.stat-cell span { display: block; font-size: 10.5px; color: var(--text-3); }
.stat-cell b {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.block {
  margin-top: 14px;
  padding: 15px 16px 16px;
}
.block__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 13px;
}
.block__head h2 { font-size: 14px; font-weight: 600; }
.block__head span { font-size: 11.5px; color: var(--text-3); }

/* 月度柱状 */
.bars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 116px;
  padding-top: 6px;
}
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; }
.bar {
  width: 100%;
  min-height: 3px;
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, rgba(109, 156, 255, .95), rgba(74, 108, 200, .45));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3);
  transition: height .5s cubic-bezier(.2, .8, .3, 1);
}
.bar.is-now {
  background: linear-gradient(180deg, #FFEFC9, #F3C265 45%, #C9871B);
  box-shadow: 0 0 14px -2px rgba(243, 194, 101, .5), inset 0 1px 0 rgba(255, 255, 255, .7);
}
.bar-col em { font-size: 9.5px; color: var(--text-3); font-style: normal; }
.bar-col.is-now em { color: var(--gold); }

/* 分类占比条 */
.catbars { display: flex; flex-direction: column; gap: 11px; }
.catbar { display: flex; align-items: center; gap: 10px; }
.catbar__ico {
  width: 26px; height: 26px; border-radius: 9px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  background-image: var(--cat-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
}
.catbar__body { flex: 1; min-width: 0; }
.catbar__top {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 12.5px; margin-bottom: 4px;
}
.catbar__top b { font-weight: 500; }
.catbar__top span { font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 12px; }
.catbar__top span i { font-style: normal; color: var(--text-3); font-size: 10.5px; margin-left: 5px; }
.catbar__track {
  display: block;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .06);
  overflow: hidden;
}
.catbar__fill {
  display: block;
  height: 100%;
  border-radius: 3px;
  background-image: var(--cat-bg);
  box-shadow: 0 0 10px -2px var(--cat-glow);
  transition: width .55s cubic-bezier(.2, .8, .3, 1);
}

/* 收入对比 */
.income-box { display: flex; flex-direction: column; gap: 10px; }
.income-line {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px;
}
.income-line span { color: var(--text-2); }
.income-line b { font-variant-numeric: tabular-nums; font-weight: 600; }
.income-track {
  height: 9px; border-radius: 5px; overflow: hidden;
  background: rgba(255, 255, 255, .06);
  display: flex;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .5);
}
.income-track div { height: 100%; }
.income-track .spent { background: linear-gradient(180deg, #FFE7B4, #E0A440); }
.income-track .left { background: linear-gradient(180deg, #6DEFAF, #22A866); }
.income-note { font-size: 11.5px; color: var(--text-3); }

/* ---------------------------- 我的 ---------------------------- */

.group { margin: 0 16px 14px; }
.group__title {
  padding: 0 6px 8px;
  font-size: 11.5px;
  letter-spacing: .08em;
  color: var(--text-3);
}
.group__body {
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .015) 45%, rgba(0, 0, 0, .12)),
    rgba(18, 24, 44, .6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07);
}

.srow {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 13px 14px;
  text-align: left;
  position: relative;
}
.srow + .srow::before {
  content: "";
  position: absolute;
  left: 14px; right: 0; top: 0; height: 1px;
  background: var(--line);
}
.srow:active { background: rgba(255, 255, 255, .045); }
.srow__ico {
  width: 30px; height: 30px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex: none;
  background-image: var(--cat-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .26), inset 0 -6px 10px -8px rgba(0, 0, 0, .8);
}
.srow__main { flex: 1; min-width: 0; }
.srow__main b { display: block; font-size: 14px; font-weight: 500; }
.srow__main span { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.srow__val {
  font-size: 13px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  flex: none;
  max-width: 46%;
  text-align: right;
}
.srow__val.is-gold { color: var(--gold); }
.srow__arrow { color: var(--text-3); font-size: 12px; flex: none; }

.hint-box {
  margin: 0 18px;
  padding: 11px 13px;
  border-radius: 13px;
  border: 1px dashed rgba(255, 255, 255, .13);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-3);
}
.hint-box b { color: var(--text-2); font-weight: 500; }

.foot-note {
  text-align: center;
  font-size: 10.5px;
  color: var(--text-3);
  padding: 6px 20px 20px;
  line-height: 1.7;
}

/* ---------------------------- 底部导航 ---------------------------- */

.tabbar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(7, 11, 22, .84);
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  border-top: 1px solid rgba(255, 255, 255, .07);
  z-index: 20;
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-3);
  transition: color .18s;
  position: relative;
}
.tab svg {
  width: 21px; height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .18s;
}
.tab em { font-style: normal; font-size: 10px; letter-spacing: .02em; }
.tab.is-active { color: var(--gold); }
.tab.is-active svg { transform: translateY(-1px); filter: drop-shadow(0 2px 6px rgba(243, 194, 101, .45)); }
.tab.is-active::before {
  content: "";
  position: absolute;
  top: 0;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* ---------------------------- 弹层 ---------------------------- */

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(2, 4, 10, .62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 40;
  opacity: 0;
  transition: opacity .24s;
}
.scrim.is-open { opacity: 1; }

.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  border-radius: 26px 26px 0 0;
  border-top: 1px solid rgba(255, 255, 255, .12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .01) 30%, rgba(0, 0, 0, .1)),
    #10162B;
  box-shadow: 0 -24px 60px -20px rgba(0, 0, 0, .9);
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.22, .9, .3, 1);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.sheet.is-open { transform: translateY(0); }

.sheet__grip {
  width: 38px; height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .18);
  margin: 9px auto 4px;
  flex: none;
}
.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 18px 12px;
  flex: none;
}
.sheet__head h2 { font-size: 16px; font-weight: 600; }
.sheet__body {
  overflow-y: auto;
  padding: 0 16px 18px;
  -webkit-overflow-scrolling: touch;
}
.sheet__actions {
  display: flex;
  gap: 9px;
  padding: 0 16px 14px;
  flex: none;
}
.btn {
  flex: 1;
  height: 47px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  transition: transform .12s, background .16s;
}
.btn:active { transform: scale(.985); }
.btn--gold {
  color: var(--gold-ink);
  border-color: transparent;
  background: linear-gradient(180deg, #FFEFC9 0%, #F7CE7C 30%, #F3C265 58%, #C9871B 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85), 0 10px 22px -14px rgba(243, 194, 101, .8);
}
.btn--danger { color: var(--red); border-color: rgba(255, 122, 122, .28); background: rgba(255, 122, 122, .08); }
.btn--ghost { flex: .62; }

.field { margin-bottom: 12px; }
.field__label { display: block; font-size: 11.5px; color: var(--text-3); margin-bottom: 6px; letter-spacing: .04em; }
.input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .045);
  font-size: 15px;
  outline: none;
  transition: border-color .18s, background .18s;
}
.input:focus { border-color: rgba(243, 194, 101, .55); background: rgba(243, 194, 101, .06); }
.input--amount {
  font-size: 27px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  color: var(--gold-l);
}
.input--num { font-variant-numeric: tabular-nums; }

.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg__item {
  padding: 8px 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .035);
  font-size: 12.5px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 5px;
}
.seg__item.is-on {
  color: var(--gold-ink);
  border-color: transparent;
  background: linear-gradient(180deg, #FFE7B4, #EAB04A);
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}

.pick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 9px 2px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .035);
  font-size: 10.5px;
  color: var(--text-2);
  overflow: hidden;
}
.pick span:first-child { font-size: 16px; }
.pick.is-on {
  border-color: rgba(243, 194, 101, .6);
  background: rgba(243, 194, 101, .12);
  color: var(--gold-l);
}

/* 全屏搜索层 */
.search-wrap { padding: 0 16px 10px; }
.search-row {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 44px;
  padding: 0 13px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .05);
}
.search-row input { flex: 1; min-width: 0; outline: none; font-size: 14.5px; }
.search-row svg { width: 17px; height: 17px; fill: none; stroke: var(--text-3); stroke-width: 2; }

/* ---------------------------- 提示 ---------------------------- */

.toast {
  position: fixed;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  transform: translate(-50%, -14px);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  background: rgba(30, 40, 70, .96);
  border: 1px solid rgba(255, 255, 255, .13);
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .14);
  backdrop-filter: blur(14px);
  opacity: 0;
  transition: opacity .22s, transform .22s;
  max-width: 86vw;
  text-align: center;
}
.toast.is-open { opacity: 1; transform: translate(-50%, 0); }
.toast.is-ok { border-color: rgba(74, 222, 128, .36); color: #CFF8DE; }
.toast.is-warn { border-color: rgba(243, 194, 101, .42); color: var(--gold-l); }
.toast.is-err { border-color: rgba(255, 122, 122, .4); color: #FFD2D2; }

/* ---------------------------- 空状态 ---------------------------- */

.empty {
  padding: 54px 34px;
  text-align: center;
  color: var(--text-3);
}
.empty__ico { font-size: 34px; opacity: .5; margin-bottom: 10px; }
.empty b { display: block; font-size: 14px; color: var(--text-2); font-weight: 500; margin-bottom: 5px; }
.empty p { font-size: 12px; line-height: 1.7; }

/* ---------------------------- 导入结果 ---------------------------- */

.import-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.import-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  font-size: 12.5px;
}
.import-item__ico { font-size: 14px; flex: none; }
.import-item__main { flex: 1; min-width: 0; }
.import-item__main b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.import-item__main span { font-size: 10.5px; color: var(--text-3); }
.import-item__amt { font-variant-numeric: tabular-nums; font-weight: 600; flex: none; }
.import-item.is-warn { border-color: rgba(243, 194, 101, .3); background: rgba(243, 194, 101, .07); }

.kv { display: flex; justify-content: space-between; font-size: 12.5px; padding: 5px 0; color: var(--text-2); }
.kv b { color: var(--text); font-variant-numeric: tabular-nums; }
.kv b.is-gold { color: var(--gold); }
.kv b.is-green { color: var(--green); }

.tag-lite {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 10px;
  background: rgba(255, 255, 255, .08);
  color: var(--text-2);
}

/* 小屏适配 */
@media (max-width: 360px) {
  .amount__num { font-size: 46px; }
  .key { height: 43px; }
  .cat { padding: 7px 2px 6px; }
  .cat__ico { font-size: 16px; }
}
@media (max-height: 700px) {
  .amount { padding: 12px 22px 2px; min-height: 68px; }
  .amount__num { font-size: 44px; }
  .hero { padding-top: 4px; }
  .keypad { gap: 5px; margin-top: 6px; }
  .key { height: 42px; }
  .submit { height: 46px; margin-top: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
