/* ============================================================
   随手记账 - 现代化手机端 UI（V1.1.0）
   设计语言：渐变主色 / 毛玻璃 / 大圆角卡片 / 柔和阴影
   ============================================================ */
:root {
  --primary: #3b82f6;
  --primary-2: #6366f1;
  --primary-grad: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  --primary-soft: #eaf1fe;
  --primary-ring: rgba(59, 130, 246, .16);
  --danger: #f43f5e;
  --danger-soft: #fff1f2;
  --success: #10b981;
  --success-soft: #ecfdf5;
  --warning: #f59e0b;
  --warning-soft: #fffbeb;
  --text: #0f172a;
  --text-2: #64748b;
  --text-3: #94a3b8;
  --bg: #f2f4f8;
  --card: #ffffff;
  --border: #eef1f6;
  --input-bg: #f8fafc;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 28px rgba(15, 23, 42, .06);
  --shadow-soft: 0 4px 14px rgba(15, 23, 42, .05);
  --shadow-btn: 0 6px 16px rgba(59, 130, 246, .28);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --topbar-h: 56px;
  --tabbar-h: 60px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  overscroll-behavior-y: contain;
  -webkit-font-smoothing: antialiased;
}
input, select, button, textarea { font-family: inherit; font-size: 1rem; color: inherit; }
button { border: none; background: none; cursor: pointer; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.hidden { display: none !important; }

/* ============================================================
   认证页（登录 / 注册）
   ============================================================ */
.auth-page {
  background:
    radial-gradient(620px 420px at 12% -6%, rgba(99, 102, 241, .38), transparent 62%),
    radial-gradient(520px 400px at 102% -4%, rgba(56, 189, 248, .32), transparent 56%),
    linear-gradient(165deg, #0b1530 0%, #1d4ed8 52%, #f2f4f8 52.6%);
  min-height: 100vh;
}
.auth-hero { text-align: center; padding: 64px 20px 26px; color: #fff; }
.auth-logo {
  width: 76px; height: 76px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem; line-height: 1;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 24px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
}
.auth-hero h1 { font-size: 1.55rem; font-weight: 700; letter-spacing: 3px; text-shadow: 0 2px 12px rgba(0,0,0,.15); }
.auth-hero p { font-size: 0.85rem; opacity: .85; margin-top: 6px; letter-spacing: 1px; }
.auth-card {
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  margin: 6px 20px 0;
  border-radius: 24px;
  padding: 24px 22px 28px;
  box-shadow: 0 24px 60px rgba(11, 21, 48, .22), inset 0 1px 0 rgba(255,255,255,.9);
  border: 1px solid rgba(255, 255, 255, .65);
}
.auth-tabs {
  display: flex; background: #eef1f6; border-radius: 14px; padding: 4px; margin-bottom: 24px;
}
.auth-tab {
  flex: 1; padding: 10px 0; font-size: 1rem; color: var(--text-2);
  border-radius: 11px; transition: all .22s ease;
}
.auth-tab.active {
  background: #fff; color: var(--primary); font-weight: 600;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .09);
}
.auth-form .field { display: block; margin-bottom: 18px; }
.auth-form .field span { display: block; font-size: 0.8rem; color: var(--text-2); margin-bottom: 7px; font-weight: 500; }
.auth-form input {
  width: 100%; padding: 13px 16px; border: 1.5px solid var(--border); border-radius: 13px;
  background: var(--input-bg); outline: none; transition: all .2s;
}
.auth-form input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px var(--primary-ring); }
.auth-footer { text-align: center; font-size: 0.76rem; color: rgba(255,255,255,.8); padding: 16px 20px 4px; }
.auth-footer.copyright { color: rgba(255,255,255,.65); font-size: 0.7rem; padding-top: 2px; }

/* ============================================================
   主应用布局
   ============================================================ */
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  background: rgba(255, 255, 255, .8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(238, 241, 246, .9);
}
.book-btn {
  font-size: 1.03rem; font-weight: 700; color: var(--text);
  padding: 8px 10px 8px 0; max-width: 62%; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
  display: flex; align-items: center; gap: 4px;
}
.topbar-right { display: flex; align-items: center; gap: 8px; }
.user-name {
  font-size: 0.83rem; color: var(--text-2);
  background: var(--primary-soft); color: var(--primary);
  padding: 4px 12px; border-radius: 20px; font-weight: 500;
  max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

#viewArea { padding: 14px 14px 10px; min-height: calc(100vh - var(--topbar-h)); }

.app-footer {
  text-align: center; font-size: 0.7rem; color: var(--text-3);
  padding: 8px 16px calc(8px + var(--safe-bottom));
  letter-spacing: .4px;
}

.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(238, 241, 246, .95);
  box-shadow: 0 -6px 24px rgba(15, 23, 42, .05);
  display: flex; z-index: 30;
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 0.7rem; color: var(--text-3); gap: 3px;
  transition: color .2s;
}
.tab .tab-icon { width: 23px; height: 23px; transition: transform .2s ease, color .2s; }
.tab.active { color: var(--primary); font-weight: 600; }
.tab.active .tab-icon { transform: translateY(-1.5px); }

/* ============================================================
   通用组件
   ============================================================ */
.card {
  background: var(--card); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, .7);
}
.card-title {
  font-size: 0.88rem; font-weight: 600; color: var(--text-2);
  margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 18px; border-radius: 13px; font-size: 0.95rem; font-weight: 500;
  transition: opacity .15s, transform .12s, box-shadow .2s;
}
.btn:active { opacity: .9; transform: scale(.97); }
.btn-primary { background: var(--primary-grad); color: #fff; box-shadow: var(--shadow-btn); }
.btn-ghost { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.btn-danger { background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.btn-block { width: 100%; padding: 13px; font-size: 1.02rem; border-radius: 14px; }
.btn-sm { padding: 7px 13px; font-size: 0.8rem; border-radius: 10px; }
.btn:disabled { opacity: .5; pointer-events: none; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; padding: 8px 15px; border-radius: 22px; background: var(--card);
  font-size: 0.83rem; color: var(--text-2); border: 1px solid var(--border);
  white-space: nowrap; transition: all .2s; box-shadow: var(--shadow-soft);
}
.chip.active {
  background: var(--primary-grad); color: #fff; border-color: transparent;
  font-weight: 600; box-shadow: var(--shadow-btn);
}

.empty { text-align: center; color: var(--text-3); font-size: 0.85rem; padding: 44px 0; }
.empty-icon { font-size: 2.8rem; display: block; margin-bottom: 10px; filter: grayscale(.2); }

/* 弹层 */
.overlay { position: fixed; inset: 0; background: rgba(11, 21, 48, .5); z-index: 100; backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.modal {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 0; width: 100%; max-width: 480px; max-height: 82vh; overflow-y: auto;
  background: var(--card); border-radius: 24px 24px 0 0; z-index: 101;
  padding: 10px 18px calc(20px + var(--safe-bottom));
  animation: slideUp .26s cubic-bezier(.22, 1, .36, 1);
  box-shadow: 0 -16px 48px rgba(11, 21, 48, .18);
}
.modal::before {
  content: ''; display: block; width: 38px; height: 4px; border-radius: 2px;
  background: #e2e8f0; margin: 0 auto 14px;
}
@keyframes slideUp { from { transform: translateX(-50%) translateY(40px); opacity: .5; } to { transform: translateX(-50%) translateY(0); opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-title { font-size: 1.06rem; font-weight: 700; }
.modal-close {
  width: 30px; height: 30px; border-radius: 50%; background: var(--bg);
  font-size: 0.9rem; color: var(--text-3); display: flex; align-items: center; justify-content: center;
}

/* Toast */
.toast {
  position: fixed; left: 50%; top: 44%; transform: translate(-50%, -50%);
  background: rgba(15, 23, 42, .86); color: #fff; font-size: 0.9rem;
  padding: 13px 24px; border-radius: 14px; z-index: 200; max-width: 82%;
  text-align: center; transition: opacity .2s;
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 32px rgba(11, 21, 48, .3);
  letter-spacing: .3px;
}

/* ============================================================
   记账页
   ============================================================ */
.type-switch {
  display: flex; background: #e9edf4; border-radius: 15px; padding: 5px;
  margin-bottom: 14px; box-shadow: inset 0 1px 3px rgba(15, 23, 42, .05);
}
.type-btn {
  flex: 1; padding: 11px 0; border-radius: 11px; font-size: 0.95rem;
  color: var(--text-2); transition: all .2s ease; font-weight: 500;
}
.type-btn.active { background: #fff; color: var(--text); font-weight: 700; box-shadow: 0 3px 12px rgba(15, 23, 42, .1); }
.type-btn.active.t-income { color: var(--success); }
.type-btn.active.t-expense { color: var(--danger); }
.type-btn.active.t-transfer { color: var(--primary); }

.amount-box {
  background: var(--card); border-radius: var(--radius);
  padding: 20px 18px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow); border: 1px solid rgba(255, 255, 255, .7);
}
.amount-box .rmb { font-size: 1.7rem; font-weight: 800; color: var(--primary); }
.amount-box input {
  flex: 1; border: none; outline: none; font-size: 2rem; font-weight: 700;
  background: transparent; min-width: 0; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.amount-box input::placeholder { color: #cbd5e1; font-weight: 400; }

.form-row { display: flex; gap: 10px; margin-bottom: 12px; }
.form-row .field { flex: 1; }
.field-label { font-size: 0.8rem; color: var(--text-3); margin-bottom: 7px; display: block; font-weight: 500; }
.select-box, .text-input {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 13px;
  background: var(--card); font-size: 0.95rem; outline: none; transition: all .2s;
}
.select-box:focus, .text-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.select-box {
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' stroke='%2364748b' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}

.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.cat-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 4px 10px; border-radius: 16px; background: #f8fafc;
  transition: all .18s ease; border: 1.5px solid transparent;
}
.cat-item .cat-icon {
  width: 46px; height: 46px; border-radius: 50%;
  background: #eef2ff; display: flex; align-items: center; justify-content: center;
  font-size: 1.45rem; line-height: 1; transition: all .18s;
}
.cat-item .cat-name { font-size: 0.73rem; color: var(--text-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-item.active { background: var(--primary-soft); border-color: var(--primary); }
.cat-item.active .cat-icon { background: #fff; box-shadow: 0 3px 10px var(--primary-ring); transform: scale(1.06); }
.cat-item.active .cat-name { color: var(--primary); font-weight: 600; }

/* ============================================================
   流水页
   ============================================================ */
.month-bar { display: flex; align-items: center; justify-content: space-between; padding: 2px 0 12px; }
.month-bar .month { font-size: 1.08rem; font-weight: 800; letter-spacing: 1px; }
.month-nav { display: flex; gap: 8px; align-items: center; }
.month-nav button {
  width: 34px; height: 34px; border-radius: 50%; background: var(--card);
  font-size: 1.05rem; color: var(--text-2); display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-soft); border: 1px solid var(--border); transition: all .18s;
}
.month-nav button:active { transform: scale(.92); background: var(--primary-soft); color: var(--primary); }

.summary-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.summary-card {
  background: var(--card); border-radius: 16px; padding: 14px 12px;
  box-shadow: var(--shadow-soft); border: 1px solid rgba(255, 255, 255, .7);
  position: relative; overflow: hidden;
}
.summary-card::after {
  content: ''; position: absolute; right: -14px; top: -14px;
  width: 44px; height: 44px; border-radius: 50%; opacity: .1;
}
.summary-card:nth-child(1)::after { background: var(--success); }
.summary-card:nth-child(2)::after { background: var(--danger); }
.summary-card:nth-child(3)::after { background: var(--primary); }
.summary-card .s-label { font-size: 0.72rem; color: var(--text-3); margin-bottom: 4px; }
.summary-card .s-value { font-size: 1.02rem; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.summary-card .s-value.income { color: var(--success); }
.summary-card .s-value.expense { color: var(--danger); }

.tx-group { margin-bottom: 6px; }
.tx-date { font-size: 0.76rem; color: var(--text-3); padding: 12px 6px 7px; font-weight: 500; }
.tx-item {
  display: flex; align-items: center; gap: 11px; background: var(--card);
  padding: 13px 14px; border-radius: 16px; margin-bottom: 9px;
  box-shadow: var(--shadow-soft); border: 1px solid rgba(255, 255, 255, .7);
  transition: transform .12s;
}
.tx-item:active { transform: scale(.985); }
.tx-icon {
  width: 42px; height: 42px; border-radius: 14px; background: #eef2ff;
  display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0;
}
.tx-main { flex: 1; min-width: 0; }
.tx-title { font-size: 0.93rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-sub { font-size: 0.75rem; color: var(--text-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-amount { font-size: 0.95rem; font-weight: 700; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.tx-amount.income { color: var(--success); }
.tx-amount.expense { color: var(--danger); }
.tx-amount.transfer { color: var(--primary); }
.tx-del {
  width: 28px; height: 28px; border-radius: 50%; color: var(--text-3);
  font-size: 0.85rem; display: flex; align-items: center; justify-content: center;
  background: var(--bg); transition: all .18s; flex-shrink: 0;
}
.tx-del:active { background: var(--danger-soft); color: var(--danger); }

/* ============================================================
   统计页
   ============================================================ */
.stat-hero {
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 55%, #8b5cf6 100%);
  border-radius: 22px; padding: 22px 20px; color: #fff;
  margin-bottom: 12px; position: relative; overflow: hidden;
  box-shadow: 0 14px 34px rgba(99, 102, 241, .32);
}
.stat-hero::before, .stat-hero::after {
  content: ''; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .1);
}
.stat-hero::before { width: 150px; height: 150px; right: -46px; top: -52px; }
.stat-hero::after { width: 90px; height: 90px; right: 46px; bottom: -38px; background: rgba(255, 255, 255, .08); }
.stat-hero .sh-label { font-size: 0.78rem; opacity: .82; }
.stat-hero .sh-balance { font-size: 1.85rem; font-weight: 800; margin: 6px 0 14px; letter-spacing: .5px; font-variant-numeric: tabular-nums; text-shadow: 0 2px 14px rgba(0,0,0,.12); }
.stat-hero .sh-row { display: flex; gap: 26px; position: relative; z-index: 1; }
.stat-hero .sh-item .si-label { font-size: 0.72rem; opacity: .8; }
.stat-hero .sh-item .si-value { font-size: 1.02rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.warn-banner {
  display: flex; align-items: center; gap: 9px; background: var(--warning-soft);
  color: #b45309; border: 1px solid #fde68a; border-radius: 13px;
  padding: 12px 14px; font-size: 0.84rem; margin-bottom: 12px;
}
.budget-bar { height: 9px; background: #e9edf4; border-radius: 6px; overflow: hidden; margin-top: 9px; }
.budget-bar .bar {
  height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, #3b82f6, #6366f1);
  transition: width .5s cubic-bezier(.22, 1, .36, 1);
}
.budget-bar .bar.over { background: linear-gradient(90deg, #f43f5e, #fb7185); }
.chart-box { width: 100%; height: 230px; }

/* ============================================================
   我的页
   ============================================================ */
.me-section {
  background: var(--card); border-radius: var(--radius); margin-bottom: 12px;
  overflow: hidden; box-shadow: var(--shadow); border: 1px solid rgba(255, 255, 255, .7);
}
.me-section .ms-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 16px; font-size: 0.95rem; font-weight: 600; cursor: pointer; user-select: none;
  transition: background .15s;
}
.me-section .ms-head:active { background: #f8fafc; }
.me-section .ms-head .arrow { color: var(--text-3); font-size: 0.78rem; transition: transform .25s; }
.me-section.open .ms-head .arrow { transform: rotate(180deg); }
.me-section .ms-body { padding: 2px 16px 16px; display: none; }
.me-section.open .ms-body { display: block; }

.acct-item { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.acct-item:last-child { border-bottom: none; }
.acct-item .ai-icon {
  width: 38px; height: 38px; border-radius: 13px; background: var(--primary-soft);
  display: flex; align-items: center; justify-content: center; font-size: 1.05rem; flex-shrink: 0;
}
.acct-item .ai-main { flex: 1; min-width: 0; }
.acct-item .ai-name { font-size: 0.92rem; font-weight: 600; }
.acct-item .ai-type { font-size: 0.74rem; color: var(--text-3); }
.acct-item .ai-bal { font-weight: 700; font-size: 0.95rem; font-variant-numeric: tabular-nums; }

.budget-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.84rem; }
.budget-item:last-child { border-bottom: none; }
.budget-item .bi-name { width: 92px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.budget-item .bi-bar { flex: 1; height: 7px; background: #e9edf4; border-radius: 5px; overflow: hidden; }
.budget-item .bi-bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #3b82f6, #6366f1); transition: width .4s; }
.budget-item .bi-bar i.over { background: linear-gradient(90deg, #f43f5e, #fb7185); }
.budget-item .bi-val { width: 84px; text-align: right; flex-shrink: 0; color: var(--text-2); font-size: 0.76rem; font-variant-numeric: tabular-nums; }
.budget-item .bi-edit { color: var(--primary); padding: 2px 8px; flex-shrink: 0; font-size: 0.84rem; font-weight: 600; background: var(--primary-soft); border-radius: 8px; }

.form-actions { display: flex; gap: 10px; margin-top: 12px; }
.form-actions .btn { flex: 1; }

.over-flag { color: var(--danger); font-size: 0.7rem; font-weight: 700; background: var(--danger-soft); padding: 1px 7px; border-radius: 8px; }

/* ============================================================
   记事本
   ============================================================ */
.notes-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 4px 12px;
}
.notes-title { font-size: 1.1rem; font-weight: 700; }
.note-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow);
  padding: 13px 14px; margin-bottom: 10px; cursor: pointer;
}
.note-item:active { transform: scale(.99); }
.note-main { flex: 1; min-width: 0; }
.note-title { font-size: 0.95rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-preview {
  font-size: 0.78rem; color: var(--text-3); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.note-time { font-size: 0.7rem; color: var(--text-4, #b0b7c4); margin-top: 4px; }
.note-ops { display: flex; flex-direction: column; gap: 6px; }
.note-op {
  width: 30px; height: 30px; border-radius: 9px; border: none;
  background: var(--bg); color: var(--text-2); font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
}
.note-op.del { color: var(--danger); background: var(--danger-soft, #fdecec); }
.note-area { min-height: 130px; resize: vertical; line-height: 1.6; }

/* ============================================================
   流水搜索
   ============================================================ */
.search-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.search-bar .text-input { flex: 1; min-width: 0; }

/* ============================================================
   应收应付
   ============================================================ */
.debt-sum {
  display: flex; gap: 10px; margin-bottom: 10px;
}
.debt-sum .ds-item {
  flex: 1; background: var(--bg); border-radius: 12px; padding: 10px 12px;
}
.debt-sum .ds-label { font-size: 0.72rem; color: var(--text-3); }
.debt-sum .ds-val { font-size: 1rem; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.debt-sum .ds-val.recv { color: var(--success); }
.debt-sum .ds-val.pay { color: var(--danger); }

.debt-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 0.85rem;
}
.debt-item:last-child { border-bottom: none; }
.debt-tag {
  flex-shrink: 0; font-size: 0.72rem; font-weight: 600; padding: 3px 9px; border-radius: 8px;
}
.debt-tag.recv { color: var(--success); background: var(--success-soft); }
.debt-tag.pay { color: var(--danger); background: var(--danger-soft); }
.debt-main { flex: 1; min-width: 0; }
.debt-party { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.debt-due { color: var(--warning); font-size: 0.7rem; font-weight: 500; }
.debt-note { font-size: 0.72rem; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.debt-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.debt-amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.debt-amount.recv { color: var(--success); }
.debt-amount.pay { color: var(--danger); }
.debt-ops { display: flex; align-items: center; gap: 6px; }

/* ============================================================
   周期收支
   ============================================================ */
.rec-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 0.85rem;
}
.rec-item:last-child { border-bottom: none; }
.rec-left { flex: 1; min-width: 0; }
.rec-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-sub { font-size: 0.72rem; color: var(--text-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.rec-amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.rec-amount.recv { color: var(--success); }
.rec-amount.pay { color: var(--danger); }
