:root {
  --modern_mobile_app-color-1: #FFFFFF;
  --modern_mobile_app-color-2: #F5F5F5;
  --modern_mobile_app-color-3: #2563EB;
  --modern_mobile_app-color-4: #111827;

  --surface:  var(--modern_mobile_app-color-1);
  --bg:       var(--modern_mobile_app-color-2);
  --primary:  var(--modern_mobile_app-color-3);
  --text:     var(--modern_mobile_app-color-4);

  --text-2:   rgba(17, 24, 39, 0.55);
  --text-3:   rgba(17, 24, 39, 0.38);
  --border:   rgba(17, 24, 39, 0.10);
  --border-2: rgba(17, 24, 39, 0.16);
  --primary-soft: rgba(37, 99, 235, 0.10);
  --primary-line: rgba(37, 99, 235, 0.28);
  --shadow:    0 8px 24px rgba(17, 24, 39, 0.07);
  --shadow-lg: 0 18px 44px rgba(17, 24, 39, 0.16);
  --backdrop:  rgba(17, 24, 39, 0.42);

  --radius: 18px;
  --radius-sm: 12px;
  --nav-h: 66px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in: cubic-bezier(0.55, 0, 1, 0.45);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; color: var(--text); }
a { text-decoration: none; color: inherit; }

button:focus, button:focus-visible, a:focus,
.btn:focus, .nav-item:focus, .chip:focus, .cat-item:focus,
.menu-item:focus { outline: none; }

button:active, .btn:active, .nav-item:active, .chip:active, .cat-item:active,
.avatar-grid button:active, .month-picker button:active,
.fab:active, .save-btn:active,
.code-btn:active, .menu-item:active, .tx-item:active {
  transform: none;
  box-shadow: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: var(--surface); }
.btn-ghost { background: var(--surface); color: var(--text); border: 1.5px solid var(--border-2); }
.btn-block { width: 100%; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.input {
  width: 100%;
  padding: 13px 15px;
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.input::placeholder { color: var(--text-3); }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }

.field-error { min-height: 18px; font-size: 12px; color: var(--primary); margin-top: 5px; opacity: 0; transition: opacity 0.2s; }
.field-error.show { opacity: 1; }

.toast {
  position: fixed;
  top: 18px; left: 50%;
  transform: translate(-50%, -80px);
  background: var(--text); color: var(--surface);
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  opacity: 0;
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
  pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

.auth-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: var(--bg);
}

.auth-card {
  width: 100%; max-width: 400px;
  background: var(--surface);
  border-radius: 22px;
  padding: 36px 30px 30px;
  box-shadow: var(--shadow-lg);
  animation: authIn 0.55s var(--ease-in) both;
}

.auth-logo { display: flex; flex-direction: column; align-items: center; margin-bottom: 28px; }
.auth-logo .mark {
  width: 60px; height: 60px;
  border-radius: 18px;
  background: var(--primary-soft);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.auth-logo .mark svg { width: 32px; height: 32px; color: var(--primary); }
.auth-logo h1 { font-size: 22px; color: var(--text); font-weight: 800; }
.auth-logo p { font-size: 13px; color: var(--text-2); margin-top: 4px; }

.auth-card h2 { font-size: 18px; color: var(--text); margin-bottom: 20px; text-align: center; }
.auth-foot { text-align: center; font-size: 13px; color: var(--text-2); margin-top: 22px; }
.auth-foot a { color: var(--primary); font-weight: 600; }
.link-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-top: 6px; }
.link-row a { color: var(--primary); font-weight: 600; }
.pwd-hint { font-size: 12px; color: var(--text-3); margin-top: 6px; transition: color 0.2s; }
.pwd-hint.ok { color: var(--primary); font-weight: 600; }

.code-row { display: flex; gap: 10px; align-items: stretch; }
.code-row .input { flex: 1; min-width: 0; }
.code-btn {
  flex: none;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--surface);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.code-btn:disabled { background: var(--bg); color: var(--text-2); }

@keyframes authIn {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + 30px);
  background: var(--bg);
  position: relative;
  transform-origin: center top;
  transition: transform 0.35s var(--ease-in), border-radius 0.35s var(--ease-in);
}

.app.behind {
  transform: scale(0.93) translateY(10px);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(17, 24, 39, 0.28);
  will-change: transform;
}
.bottom-nav.behind, .fab.behind {
  transform: translateX(-50%) scale(0.93) translateY(10px);
  opacity: 0.5;
  pointer-events: none;
}
.fab.behind { transform: scale(0.93) translateY(10px); }

.app-header { padding: 22px 20px 8px; display: flex; align-items: center; justify-content: space-between; }
.app-header .hi { font-size: 20px; font-weight: 800; color: var(--text); }
.app-header .hi small { display: block; font-size: 12px; font-weight: 500; color: var(--text-2); margin-top: 3px; }
.app-header .avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  box-shadow: var(--shadow);
}

.content { padding: 0 16px; }
.view { display: none; }
.view.active { display: block; animation: viewIn 0.4s var(--ease-in) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card-title {
  font-size: 15px; font-weight: 700; color: var(--text);
  margin-bottom: 14px;
  display: flex; align-items: center; justify-content: space-between;
}
.card-title .sub { font-size: 12px; font-weight: 500; color: var(--text-2); }

.fade-in-up { animation: fadeInUp 0.5s var(--ease-in) both; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.weather-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--primary);
  color: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  margin: 6px 0 16px;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.24);
  position: relative;
  overflow: hidden;
}
.weather-card .deco {
  position: absolute; right: -30px; top: -30px;
  width: 140px; height: 140px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}
.weather-card .info { position: relative; z-index: 1; flex: 1; min-width: 0; }
.weather-card .temp { font-size: 42px; font-weight: 800; line-height: 1; }
.weather-card .unit { font-size: 15px; font-weight: 600; margin-left: 2px; }
.weather-card .desc { font-size: 14px; font-weight: 600; margin-top: 7px; display: flex; align-items: center; gap: 5px; }
.weather-card .extra { font-size: 12px; color: rgba(255, 255, 255, 0.82); margin-top: 6px; }
.weather-card .wicon { position: relative; z-index: 1; flex: none; color: var(--surface); }
.weather-card .wicon svg { width: 62px; height: 62px; }

.summary-card .head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.summary-card .head .title { font-size: 15px; font-weight: 700; color: var(--text); }
.month-picker { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; color: var(--text); }
.month-picker button {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--bg); color: var(--text);
  display: flex; align-items: center; justify-content: center;
}
.month-picker button svg { width: 16px; height: 16px; }

.balance-banner {
  background: var(--bg);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 18px;
  margin-bottom: 14px;
}
.balance-banner .label { font-size: 12px; font-weight: 600; color: var(--primary); }
.balance-banner .amount { font-size: 34px; font-weight: 800; margin-top: 6px; color: var(--text); font-variant-numeric: tabular-nums; }

.income-expense { display: flex; gap: 12px; }
.ie-box {
  flex: 1;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 14px;
  border-left: 3px solid transparent;
}
.ie-box.inc { border-left-color: var(--primary); }
.ie-box.exp { border-left-color: var(--modern_mobile_app-color-4); }
.ie-box .label { font-size: 12px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.ie-box .label svg { width: 15px; height: 15px; }
.ie-box .num { font-size: 21px; font-weight: 800; margin-top: 8px; font-variant-numeric: tabular-nums; }
.ie-box.inc .num { color: var(--primary); }
.ie-box.exp .num { color: var(--text); }

.rate-wrap { margin-top: 14px; }
.rate-head { display: flex; justify-content: space-between; font-size: 12px; font-weight: 500; color: var(--text-2); margin-bottom: 7px; }
.rate-track { height: 10px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.rate-fill { height: 100%; border-radius: 999px; background: var(--primary); width: 0; transition: width 0.9s var(--ease); }

.tx-list { list-style: none; }
.tx-day { padding-top: 2px; }
.tx-day + .tx-day { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 8px; }
.tx-day-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 4px 8px;
  font-size: 12px; font-weight: 600; color: var(--text-2);
}
.tx-day-head .day-left { display: flex; align-items: center; gap: 6px; }
.tx-day-head .day-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.tx-day-head .day-sum { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

.tx-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  cursor: pointer;
}
/* 仅新增条目播放入场动画，避免整表重绘时几十条同时动画造成掉帧 */
.tx-item.anim { animation: fadeInUp 0.4s var(--ease-in) both; animation-delay: var(--d, 0ms); }
.tx-item:last-child { border-bottom: none; }
.tx-item:active { background: var(--bg); }

.tx-icon {
  width: 44px; height: 44px; flex: none;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.tx-icon.income { background: var(--primary-soft); color: var(--primary); }
.tx-icon.expense { background: var(--bg); color: var(--text); }
.tx-icon svg { width: 22px; height: 22px; }

.tx-meta { flex: 1; min-width: 0; }
.tx-meta .cat { font-size: 15px; font-weight: 600; color: var(--text); }
.tx-meta .info { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.tx-amount { font-size: 16px; font-weight: 700; flex: none; font-variant-numeric: tabular-nums; }
.tx-amount.income { color: var(--primary); }
.tx-amount.expense { color: var(--text); }

.empty { text-align: center; padding: 40px 20px; color: var(--text-3); }
.empty svg { width: 60px; height: 60px; opacity: 0.5; margin-bottom: 12px; }
.empty p { font-size: 14px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 7px 15px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border-2);
  transition: all 0.2s var(--ease);
}
.chip.active { background: var(--primary); color: var(--surface); border-color: var(--primary); }

.filter-bar { display: flex; gap: 8px; align-items: center; padding: 2px 0 10px; flex-wrap: wrap; }
.filter-toggle { white-space: nowrap; }
.filter-panel { margin-bottom: 12px; }
.filter-row { display: flex; gap: 10px; margin-bottom: 10px; }
.filter-field { flex: 1; min-width: 0; }
.filter-field label { display: block; font-size: 11px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.filter-field .input { padding: 9px 11px; font-size: 13px; }

.bottom-nav {
  position: fixed; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: 520px; height: var(--nav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  box-shadow: 0 -6px 20px rgba(17, 24, 39, 0.05);
  z-index: 50;
  transform-origin: center bottom;
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--text-3); font-size: 11px; font-weight: 600;
  transition: color 0.2s, transform 0.15s;
}
.nav-item svg { width: 23px; height: 23px; }
.nav-item.active { color: var(--primary); }
.nav-item.active svg { transform: scale(1.08); }
.nav-item:active { transform: scale(0.94); }

.fab {
  position: fixed;
  right: max(20px, calc((100vw - 520px) / 2 + 20px));
  bottom: calc(var(--nav-h) + 20px);
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--primary); color: var(--surface);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.34);
  z-index: 60;
}
.fab svg { width: 26px; height: 26px; }
.fab:active { transform: scale(0.9) rotate(90deg); }

.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(17, 24, 39, 0.24);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;          /* 关闭时不参与绘制，撤销全屏模糊的合成开销 */
  pointer-events: none;
  transition: opacity 0.3s var(--ease-in), visibility 0.3s var(--ease-in);
  z-index: 90;
}
.drawer-backdrop.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  left: 50%; bottom: 0;
  width: 100%; max-width: 520px;
  height: 88vh;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -18px 48px rgba(17, 24, 39, 0.20);
  z-index: 91;
  display: flex; flex-direction: column;
  transform: translate(-50%, 100%);
  transition: transform 0.34s var(--ease-in), opacity 0.22s var(--ease-in);
  touch-action: pan-y;
}
.drawer.dragging { transition: none; will-change: transform; }
.drawer.open { transform: translate(-50%, 0); }

.drawer--sm {
  height: auto;
  max-height: 80vh;
  transform: translate(-50%, 100%);
}
.drawer--sm.open { transform: translate(-50%, 0); }

.drawer-handle {
  flex: none;
  padding: 12px 0 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: grab;
  touch-action: none;
}
.drawer-handle:active { cursor: grabbing; }
.drawer-handle span {
  width: 42px; height: 5px; border-radius: 3px;
  background: var(--border-2);
  transition: width 0.2s;
}
.drawer-handle:active span { width: 56px; }

.drawer-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px 32px;
  -webkit-overflow-scrolling: touch;
}
.drawer-scroll h3 { font-size: 17px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.drawer-sub { font-size: 12px; color: var(--text-2); margin-bottom: 16px; line-height: 1.6; }

.type-toggle { display: flex; background: var(--bg); border-radius: var(--radius-sm); padding: 4px; margin-bottom: 16px; }
.type-toggle button {
  flex: 1; padding: 10px; border-radius: 9px;
  font-size: 14px; font-weight: 600; color: var(--text-2);
  transition: all 0.2s var(--ease);
}
.type-toggle button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.amount-input {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border-radius: var(--radius-sm);
  padding: 4px 16px; margin-bottom: 16px;
}
.amount-input .cur { font-size: 22px; font-weight: 800; color: var(--text); }
.amount-input input {
  flex: 1; border: none; background: none; outline: none;
  font-size: 30px; font-weight: 800; color: var(--text);
  padding: 10px 0; width: 100%;
}
.amount-input input::placeholder { color: var(--text-3); }

.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.cat-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 4px; border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text-2);
  font-size: 12px; font-weight: 600;
}
.cat-item svg { width: 24px; height: 24px; }
.cat-item.active { background: var(--primary); color: var(--surface); }
.cat-item.more-item { background: var(--surface); border: 1.5px solid var(--border-2); color: var(--text); }

textarea.input { resize: none; height: 70px; }

.date-input,
.date-input .input,
input[type="date"] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.date-input .input {
  display: block;
  color-scheme: light;
  -webkit-appearance: none;
  appearance: none;
  line-height: 1.4;
}
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
input[type="date"]::-webkit-calendar-picker-indicator { opacity: 0.55; }

.save-stage { position: relative; display: flex; justify-content: center; margin-top: 4px; min-height: 52px; }

.save-btn {
  width: 100%; height: 52px;
  border-radius: 14px;
  background: var(--primary);
  color: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
  position: relative;
  overflow: hidden;
  transition: width 0.3s var(--ease), height 0.3s var(--ease),
    border-radius 0.3s var(--ease), transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.save-btn .save-label { transition: opacity 0.16s; }
.save-btn .save-check {
  position: absolute;
  width: 28px; height: 28px;
  opacity: 0;
  transition: opacity 0.2s;
}
.save-btn .save-check path {
  fill: none;
  stroke: var(--surface);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 26;
  stroke-dashoffset: 26;
}
.save-btn.collapsing { width: 54px; height: 54px; border-radius: 50%; }
.save-btn.collapsing .save-label { opacity: 0; }
.save-btn.drawing .save-check { opacity: 1; }
.save-btn.drawing .save-check path { animation: drawCheck 0.48s var(--ease-in) forwards; }
@keyframes drawCheck { to { stroke-dashoffset: 0; } }
.save-btn.bursting { transform: scale(0.2); opacity: 0; }

.receipt {
  position: absolute;
  top: 0; left: 50%;
  width: 168px;
  padding: 14px 14px 12px;
  background: var(--surface);
  border: 1.5px solid var(--border-2);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, 0) scale(0.35);
  opacity: 0;
  pointer-events: none;
  z-index: 5;
  transform-origin: center top;
  transition: transform 0.45s var(--ease), opacity 0.3s var(--ease);
}
.receipt.show { transform: translate(-50%, 0) scale(1); opacity: 1; }
.receipt.fly {
  transform: translate(-50%, 0) scale(0);
  opacity: 0;
  transition: transform 0.5s var(--ease-in), opacity 0.5s var(--ease-in);
}
.receipt .r-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.receipt .r-icon { width: 28px; height: 28px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.receipt .r-icon svg { width: 16px; height: 16px; }
.receipt .r-cat { font-size: 12px; font-weight: 700; color: var(--text); }
.receipt .r-amt { font-size: 20px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.receipt .r-line { margin: 8px 0; border-top: 1.5px dashed var(--border-2); }
.receipt .r-tip { font-size: 11px; color: var(--text-2); display: flex; justify-content: space-between; }

.del-btn {
  width: 100%; margin-top: 12px;
  padding: 12px; border-radius: 12px;
  background: var(--surface);
  border: 1.5px solid var(--border-2);
  font-size: 14px; font-weight: 600; color: var(--text);
  display: none;
}

.seg-toggle { display: flex; background: var(--surface); border-radius: 999px; padding: 4px; margin-bottom: 16px; box-shadow: var(--shadow); }
.seg-toggle button {
  flex: 1; padding: 10px; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--text-2);
  transition: all 0.2s var(--ease);
}
.seg-toggle button.active { background: var(--primary); color: var(--surface); }

.profile-head { text-align: center; padding: 12px 0 20px; }
.profile-head .avatar-lg {
  width: 84px; height: 84px; border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
  margin: 0 auto 12px;
  box-shadow: var(--shadow);
  position: relative;
}
.avatar-edit-badge {
  position: absolute; right: -4px; bottom: -2px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary); color: var(--surface);
  border: 2px solid var(--surface);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.avatar-edit-badge svg { width: 14px; height: 14px; }
.profile-head .name { font-size: 19px; font-weight: 800; color: var(--text); }
.profile-head .email { font-size: 13px; color: var(--text-2); margin-top: 4px; }

.menu-item {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 15px; font-weight: 600; color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: var(--bg); }
.menu-item .ico { width: 40px; height: 40px; border-radius: 12px; background: var(--bg); color: var(--text); display: flex; align-items: center; justify-content: center; }
.menu-item .ico svg { width: 20px; height: 20px; }
.menu-item .arrow { margin-left: auto; color: var(--text-3); display: flex; }
.menu-item .arrow svg { width: 18px; height: 18px; }
.menu-item .val { margin-left: auto; font-size: 13px; color: var(--primary); font-weight: 600; }

.avatar-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 16px; }
.avatar-grid button {
  aspect-ratio: 1; border-radius: 14px; font-size: 26px;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s var(--ease);
  border: 1.5px solid transparent;
}
.avatar-grid button.active { background: var(--primary-soft); border-color: var(--primary); }
.avatar-grid button:active { transform: scale(0.92); }

.ai-overview {
  display: flex; gap: 16px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.ai-overview-main { flex: 1; min-width: 0; }
.ov-label { font-size: 12px; font-weight: 600; color: var(--primary); }
.ov-value { font-size: 34px; font-weight: 800; color: var(--text); margin: 6px 0; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.ov-rate { font-size: 12px; color: var(--text-2); }
.ov-rate #aiRate { color: var(--primary); font-weight: 700; }
.ov-rate-txt { margin-left: 4px; }
.ai-overview-side {
  flex: none; width: 132px;
  display: flex; flex-direction: column; justify-content: center; gap: 10px;
  padding-left: 16px;
  border-left: 1px solid var(--border);
}
.ov-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.ov-item b { margin-left: auto; font-size: 13px; color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.ov-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.ov-dot.inc { background: var(--primary); }
.ov-dot.exp { background: var(--modern_mobile_app-color-4); }

.mini-seg { display: inline-flex; background: var(--bg); border-radius: 999px; padding: 3px; }
.mini-seg button { padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--text-2); transition: all .18s var(--ease); }
.mini-seg button.active { background: var(--primary); color: var(--surface); }

.daily-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 140px;
  padding: 4px 2px 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  transition: height 0.25s var(--ease);
}
.daily-chart::-webkit-scrollbar { display: none; }
/* 一周只有 7 根柱，不需要给竖排标签预留那么高 */
.daily-chart:not(.dense) { height: 118px; }
.daily-chart.dense { gap: 1px; }
.dc-col {
  flex: 1;
  min-width: 5px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
}
/* 柱子上方的当日金额标签 */
.dc-amt {
  flex: none;
  font-size: 10px;
  line-height: 11px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
/* 整月 28~31 天时横排数字会互相压住，改为竖排（自下而上） */
.daily-chart.dense .dc-amt {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  line-height: 1;
  color: var(--text-2);
}
.dc-bar {
  width: 100%;
  max-width: 34px;
  border-radius: 5px 5px 2px 2px;
  background: var(--primary);
  transition: height 0.55s var(--ease);
  min-height: 3px;
}
.dc-bar.zero {
  background: var(--border-2);
  border-radius: 2px;
}
.dc-lbl {
  flex: none;
  font-size: 9px;
  line-height: 12px;
  height: 12px;
  color: var(--text-3);
}

.pie-wrap { display: flex; align-items: center; gap: 18px; }
.pie-left { position: relative; width: 112px; height: 112px; flex: none; }
.pie { width: 100%; height: 100%; transform: rotate(-90deg); }
.pie path { transition: opacity .2s; }
.pie-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none;
}
.pie-center b { font-size: 15px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.pie-center span { font-size: 10px; color: var(--text-2); margin-top: 2px; }
.pie-legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend-name { color: var(--text); font-weight: 600; }
.legend-pct { margin-left: auto; color: var(--text-2); font-weight: 600; }

.insights { display: flex; flex-direction: column; gap: 15px; }
.insight { animation: fadeInUp 0.4s var(--ease-in) both; }
.insight-title { font-size: 12px; font-weight: 700; color: var(--primary); margin-bottom: 5px; display: flex; align-items: center; gap: 6px; }
.insight-title::before { content: ""; width: 3px; height: 12px; border-radius: 2px; background: var(--primary); }
.insight-text { font-size: 13.5px; line-height: 1.75; color: var(--text); }
.insight-text .hl { color: var(--primary); font-weight: 700; background: var(--primary-soft); padding: 0 3px; border-radius: 4px; }

.modal-backdrop {
  position: fixed; inset: 0;
  background: var(--backdrop);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .3s var(--ease), visibility .3s var(--ease);
  z-index: 100;
}
.modal-backdrop.show { opacity: 1; visibility: visible; pointer-events: auto; }
.modal {
  position: fixed; left: 50%; top: 50%;
  transform: translate(-50%, -46%) scale(.94);
  width: calc(100% - 48px); max-width: 340px;
  background: var(--surface);
  border-radius: 20px;
  padding: 24px 22px 20px;
  box-shadow: var(--shadow-lg);
  z-index: 101;
  opacity: 0; pointer-events: none;
  transition: transform .32s var(--ease), opacity .32s var(--ease);
  text-align: center;
}
.modal.show { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: auto; }
.modal-icon {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}
.modal-icon svg { width: 26px; height: 26px; }
.modal h3 { font-size: 17px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.modal p { font-size: 13px; color: var(--text-2); line-height: 1.6; margin-bottom: 20px; }
.modal .save-stage { margin-top: 0; }

@media (min-width: 600px) {
  .app { box-shadow: 0 0 0 1px var(--border), var(--shadow-lg); min-height: 100vh; }
}

/* 系统开启「减少动态效果」时关闭装饰性动画，仅保留状态变化 */
@media (prefers-reduced-motion: reduce) {
  .view.active,
  .fade-in-up,
  .tx-item.anim,
  .insight,
  .auth-card { animation: none; }
  .rate-fill,
  .dc-bar { transition: none; }
}
