/* ============================================================
   极简记账 · 全局样式
   设计原则：大量留白、卡片化、低饱和配色、无边框感
   ============================================================ */

:root {
  --mint: #3ecfa6;           /* 主题色：薄荷绿（收入 / 积极） */
  --mint-soft: #e7f9f2;
  --coral: #ff8a73;          /* 主题色：珊瑚粉（支出） */
  --coral-soft: #ffeeea;
  --bg: #f6f7f9;             /* 页面浅灰背景 */
  --card: #ffffff;           /* 卡片纯白 */
  --text: #2f3542;           /* 深灰主文字 */
  --text-2: #8b93a1;         /* 次级文字 */
  --line: #eef0f3;           /* 分割线 */
  --radius: 18px;
  --shadow: 0 6px 20px rgba(47, 53, 66, 0.06);
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }

/* ---------- 应用外壳：限制最大宽度，模拟手机屏幕 ---------- */
.app-shell {
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
}

/* 页面主体：底部留出导航栏空间 */
.page {
  flex: 1;
  padding: 22px 18px 96px;
  animation: fade-in 0.25s ease;
}
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-title { font-size: 24px; font-weight: 700; margin: 4px 0 18px; letter-spacing: 0.5px; }
.section-label { font-size: 13px; color: var(--text-2); margin: 18px 0 10px; }

/* ---------- 顶部类型切换（支出 / 收入） ---------- */
.type-switch {
  display: flex;
  background: #eceef2;
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 22px;
}
.type-switch button {
  flex: 1;
  padding: 10px 0;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-2);
  transition: all 0.2s ease;
}
.type-switch button.active-expense { background: var(--coral); color: #fff; box-shadow: 0 4px 12px rgba(255, 138, 115, 0.35); }
.type-switch button.active-income  { background: var(--mint);  color: #fff; box-shadow: 0 4px 12px rgba(62, 207, 166, 0.35); }

/* ---------- 分类宫格 ---------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.category-item {
  background: var(--card);
  border-radius: 14px;
  padding: 14px 6px;
  text-align: center;
  transition: all 0.18s ease;
  border: 1.5px solid transparent;
}
.category-item .chip {
  width: 38px; height: 38px;
  line-height: 38px;
  margin: 0 auto 8px;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 700;
  background: #f0f2f5;
  color: var(--text-2);
  transition: all 0.18s ease;
}
.category-item .name { font-size: 13px; color: var(--text-2); }
.category-item.selected .name { color: var(--text); font-weight: 600; }
.category-item.selected .chip { color: #fff; }
.category-item.expense-selected { border-color: var(--coral); background: var(--coral-soft); }
.category-item.expense-selected .chip { background: var(--coral); }
.category-item.income-selected { border-color: var(--mint); background: var(--mint-soft); }
.category-item.income-selected .chip  { background: var(--mint); }

/* ---------- 金额输入 ---------- */
.amount-box {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-top: 22px;
  box-shadow: var(--shadow);
}
.amount-box .label { font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.amount-input { display: flex; align-items: baseline; }
.amount-input .symbol { font-size: 28px; font-weight: 700; margin-right: 6px; }
.amount-input input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 42px;
  font-weight: 700;
  letter-spacing: 0.5px;
  width: 100%;
}
.amount-input input::placeholder { color: #d5d9e0; }

/* ---------- 表单行（日期 / 备注） ---------- */
.field {
  background: var(--card);
  border-radius: 14px;
  padding: 14px 16px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.field label { font-size: 14px; color: var(--text-2); white-space: nowrap; }
.field input, .field textarea {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  text-align: right;
  resize: none;
}
.field textarea { text-align: left; }

/* ---------- 主按钮 ---------- */
.btn-primary {
  width: 100%;
  padding: 16px;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-top: 24px;
  transition: transform 0.12s ease, opacity 0.2s ease;
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.45; }
.btn-expense { background: var(--coral); box-shadow: 0 8px 18px rgba(255, 138, 115, 0.35); }
.btn-income  { background: var(--mint);  box-shadow: 0 8px 18px rgba(62, 207, 166, 0.35); }

/* ---------- 底部导航栏 ---------- */
.tab-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 480px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display: flex;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 50;
}
.tab-bar button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 0;
  color: var(--text-2);
  font-size: 11px;
  transition: color 0.18s ease;
}
.tab-bar button .dot {
  width: 22px; height: 22px;
  border-radius: 8px;
  background: #e7e9ee;
  transition: all 0.2s ease;
}
.tab-bar button.active { color: var(--text); font-weight: 700; }
.tab-bar button.active .dot { background: linear-gradient(135deg, var(--mint), var(--coral)); }

/* ---------- 统计页 ---------- */
.segment {
  display: inline-flex;
  background: #eceef2;
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 16px;
}
.segment button {
  padding: 8px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  transition: all 0.18s ease;
}
.segment button.active { background: #fff; color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

/* 时间跨度筛选条：左侧切换按钮，右侧显示具体区间 */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}
.filter-bar .segment { margin-bottom: 0; }
.range-label { font-size: 12px; color: var(--text-2); }

/* 一行两端对齐的通用布局 */
.row-between { display: flex; align-items: center; justify-content: space-between; }

.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
.card h3 { margin: 0 0 10px; font-size: 15px; font-weight: 700; }
.card .sub { font-size: 12px; color: var(--text-2); font-weight: 400; margin-left: 6px; }

.chart { width: 100%; height: 220px; }

.summary-row { display: flex; gap: 10px; margin-bottom: 14px; }
.summary-box { flex: 1; background: var(--card); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); }
.summary-box .k { font-size: 12px; color: var(--text-2); }
.summary-box .v { font-size: 20px; font-weight: 700; margin-top: 4px; }
.text-mint { color: var(--mint); }
.text-coral { color: var(--coral); }
.text-blue { color: #5b8def; }

/* 流水列表 */
.bill-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--line);
}
.bill-item:last-child { border-bottom: none; }
.bill-item .icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; flex-shrink: 0;
}
.bill-item .icon.income { background: var(--mint-soft); color: var(--mint); }
.bill-item .icon.expense { background: var(--coral-soft); color: var(--coral); }
.bill-item .mid { flex: 1; min-width: 0; }
.bill-item .mid .t { font-size: 14px; font-weight: 600; }
.bill-item .mid .d { font-size: 12px; color: var(--text-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bill-item .amt { font-size: 16px; font-weight: 700; white-space: nowrap; }

.empty { text-align: center; color: var(--text-2); font-size: 13px; padding: 26px 0; }

/* ---------- 互动圈 ---------- */
.social-hero { text-align: center; padding: 30px 0 10px; }
.social-hero .big { font-size: 44px; font-weight: 800; letter-spacing: 4px; color: var(--text); }
.social-hero p { color: var(--text-2); font-size: 13px; }

.big-actions { display: flex; flex-direction: column; gap: 14px; margin-top: 26px; }
.big-btn {
  padding: 22px;
  border-radius: 20px;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  transition: transform 0.12s ease;
}
.big-btn:active { transform: scale(0.98); }
.big-btn.create { background: linear-gradient(135deg, #3ecfa6, #2fb894); box-shadow: 0 10px 24px rgba(62,207,166,0.32); }
.big-btn.join { background: linear-gradient(135deg, #ff9d82, #ff8a73); box-shadow: 0 10px 24px rgba(255,138,115,0.32); }
.big-btn .hint { display: block; font-size: 12px; font-weight: 400; opacity: 0.85; margin-top: 4px; }

/* 圈子基金看板 */
.fund-card {
  border-radius: 22px;
  padding: 22px;
  color: #fff;
  background: linear-gradient(135deg, #3ecfa6 0%, #2fb894 55%, #f5a48c 140%);
  box-shadow: 0 12px 26px rgba(62, 207, 166, 0.3);
  position: relative;
  overflow: hidden;
}
.fund-card::after {
  content: ""; position: absolute; right: -30px; top: -30px;
  width: 130px; height: 130px; border-radius: 50%;
  background: rgba(255,255,255,0.12);
}
.fund-card .cap { font-size: 13px; opacity: 0.9; }
.fund-card .fund-value { font-size: 40px; font-weight: 800; margin: 6px 0 4px; letter-spacing: 0.5px; }
.fund-card .fund-value.clickable { cursor: pointer; }
.fund-card .meta { font-size: 12px; opacity: 0.85; }
.fund-card .edit-btn {
  position: absolute; right: 18px; top: 18px;
  background: rgba(255,255,255,0.22);
  color: #fff; padding: 7px 14px; border-radius: 999px; font-size: 12px;
  backdrop-filter: blur(4px);
}

.code-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--card); border-radius: 999px;
  padding: 8px 16px; font-size: 13px; color: var(--text-2);
  box-shadow: var(--shadow); margin-bottom: 14px;
}
.code-pill b { color: var(--text); letter-spacing: 2px; font-size: 15px; }
.icon-btn {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--mint-soft); color: var(--mint);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.icon-btn.danger { background: var(--coral-soft); color: var(--coral); }

.feed-head { display: flex; align-items: center; justify-content: space-between; margin: 20px 2px 10px; }
.feed-head h3 { margin: 0; font-size: 16px; }
.add-fab {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--text); color: #fff; font-size: 22px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(47,53,66,0.28);
}

/* 动态卡片 */
.feed-card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.feed-card .top { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.feed-card .who { flex: 1; min-width: 0; }
.feed-card .who .n { font-size: 14px; font-weight: 600; }
.feed-card .who .t { font-size: 11px; color: var(--text-2); }
.feed-card .reason { margin: 12px 0 4px; font-size: 15px; font-weight: 600; }
.feed-card .tag { display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 999px; background: #f0f2f5; color: var(--text-2); margin-bottom: 6px; }
.feed-card .money { font-size: 22px; font-weight: 800; }
.feed-card .status { font-size: 12px; padding: 3px 10px; border-radius: 999px; font-weight: 600; }
.status-pending { background: #fff6e6; color: #d99413; }
.status-agreed  { background: var(--mint-soft); color: var(--mint); }
.status-disagreed { background: #ffe9e4; color: #e5604a; }
.status-ignored { background: #f1f2f4; color: #9aa1ad; }

/* 投票统计汇总 */
.vote-total { font-size: 12px; color: var(--text-2); }
.vote-row { display: flex; gap: 8px; margin-top: 12px; }
.vote-chip {
  flex: 1;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 4px;
  border-radius: 10px;
}
.vote-chip.agree { background: var(--mint-soft); color: var(--mint); }
.vote-chip.disagree { background: #ffe9e4; color: #e5604a; }
.vote-chip.ignore { background: #f1f2f4; color: #8b93a1; }

/* 反馈详情列表 */
.feedback { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
.feedback-toggle {
  font-size: 12px;
  font-weight: 600;
  color: #5b8def;
  padding: 2px 0;
}
.feedback-list { margin-top: 8px; }
.feedback-item { padding: 8px 0; border-bottom: 1px solid var(--line); }
.feedback-item:last-child { border-bottom: none; }
.fb-head { display: flex; align-items: center; gap: 8px; }
.fb-name { font-size: 13px; font-weight: 600; flex: 1; min-width: 0; }
.fb-reason { font-size: 13px; color: var(--text-2); margin: 6px 0 0 0; line-height: 1.5; }

.feed-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.chip-btn {
  flex: 1;
  min-width: 64px;
  padding: 9px 4px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  background: #f3f4f7;
  color: var(--text);
  transition: all 0.15s ease;
}
.chip-btn:active { transform: scale(0.96); }
.chip-btn.agree { background: var(--mint-soft); color: var(--mint); }
.chip-btn.disagree { background: #ffe9e4; color: #e5604a; }
.chip-btn.ignore { background: #f1f2f4; color: #8b93a1; }
/* 当前用户已选择的按钮 */
.chip-btn.chosen { box-shadow: inset 0 0 0 1.5px currentColor; }

/* ---------- 弹窗 / 遮罩 ---------- */
.mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(30, 34, 42, 0.4);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fade-in 0.18s ease;
}
.modal {
  width: 100%;
  max-width: 340px;
  background: #fff;
  border-radius: 22px;
  padding: 22px;
  animation: pop 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes pop { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal h3 { margin: 0 0 6px; font-size: 18px; }
.modal p { margin: 0 0 16px; font-size: 13px; color: var(--text-2); }
.modal input, .modal textarea, .modal select {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  margin-bottom: 12px;
  background: #fafbfc;
}
.modal input:focus, .modal textarea:focus { border-color: var(--mint); background: #fff; }
.code-input {
  text-align: center !important;
  font-size: 26px !important;
  font-weight: 800;
  letter-spacing: 10px;
  text-transform: uppercase;
}
.modal-actions { display: flex; gap: 10px; margin-top: 6px; }
.modal-actions button { flex: 1; padding: 13px; border-radius: 14px; font-weight: 700; font-size: 15px; }
.modal-actions .ghost { background: #f1f2f4; color: var(--text-2); }
.modal-actions .solid { background: var(--text); color: #fff; }
.modal-actions .solid.mint { background: var(--mint); }
.modal-actions .solid.coral { background: var(--coral); }

/* ---------- 轻提示 Toast ---------- */
.toast-wrap { position: fixed; top: 22px; left: 0; right: 0; display: flex; justify-content: center; z-index: 200; pointer-events: none; }
.toast {
  background: rgba(47, 53, 66, 0.92);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.18);
  animation: pop 0.2s ease;
}
.fade-enter-active, .fade-leave-active { transition: opacity 0.2s ease; }
.fade-enter-from, .fade-leave-to { opacity: 0; }
