/* 上礼记 —— 手机竖屏优先，大字体大按钮，适合中老年人 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --red: #c62828;
  --red-dark: #a31f1f;
  --bg: #f7f3ec;
  --card: #ffffff;
  --text: #2b2b2b;
  --muted: #8a8578;
  --line: #e8e2d6;
}

html { font-size: 18px; }

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  max-width: 540px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
}

#app { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }

/* 顶栏 */
#topbar {
  background: var(--red);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}
#topbar h1 { font-size: 1.35rem; letter-spacing: 2px; }
#who { font-size: 0.9rem; opacity: .92; }

/* 主区域 */
#view { flex: 1; padding: 14px 14px 90px; }
.hidden { display: none !important; }

/* 底部标签栏 */
#tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 540px;
  display: flex;
  background: #fff;
  border-top: 1px solid var(--line);
  z-index: 10;
  padding-bottom: env(safe-area-inset-bottom);
}
#tabbar button {
  flex: 1;
  border: 0;
  background: none;
  padding: 8px 0 6px;
  font-size: 0.95rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
}
#tabbar button i { font-style: normal; font-size: 1.35rem; }
#tabbar button.active { color: var(--red); font-weight: 700; }

/* 卡片 */
.card {
  background: var(--card);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.card h2 { font-size: 1.15rem; margin-bottom: 12px; }

/* 表单 */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 0.95rem; color: var(--muted); margin-bottom: 6px; }
input[type="text"], input[type="password"], input[type="number"], select, textarea {
  width: 100%;
  font-size: 1.1rem;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); }

/* 大按钮 */
.btn {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: var(--red);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  padding: 15px;
  cursor: pointer;
  letter-spacing: 2px;
}
.btn:active { background: var(--red-dark); }
.btn.secondary { background: #fff; color: var(--red); border: 2px solid var(--red); }
.btn.gray { background: #efe9dd; color: var(--text); }

/* 方向切换（我随出 / 我收到） */
.seg { display: flex; gap: 10px; margin-bottom: 14px; }
.seg button {
  flex: 1;
  padding: 14px 0;
  font-size: 1.15rem;
  font-weight: 700;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}
.seg button.on { border-color: var(--red); background: var(--red); color: #fff; }

/* 事由 / 快捷金额 按钮组 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chips button {
  padding: 10px 16px;
  font-size: 1.05rem;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--text);
  cursor: pointer;
}
.chips button.on { border-color: var(--red); color: var(--red); font-weight: 700; background: #fdf0ee; }

/* 金额输入行 */
.amount-row { display: flex; align-items: center; gap: 8px; }
.amount-row input { font-size: 1.6rem; font-weight: 700; text-align: center; }
.amount-row .yuan { font-size: 1.2rem; color: var(--muted); }

/* 日期行 */
.date-row { display: flex; gap: 10px; }
.date-row select { flex: 1; }

/* 人员列表 */
.person-card { display: flex; justify-content: space-between; align-items: center; }
.person-card .name { font-size: 1.25rem; font-weight: 700; }
.person-card .sub { font-size: 0.9rem; color: var(--muted); margin-top: 4px; }
.person-card .nums { text-align: right; font-size: 0.95rem; line-height: 1.5; }
.out-num { color: var(--red); font-weight: 700; }
.in-num { color: #2e7d32; font-weight: 700; }

/* 记录条目 */
.rec {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.rec:last-child { border-bottom: 0; }
.rec .r-main { font-size: 1.05rem; }
.rec .r-sub { font-size: 0.85rem; color: var(--muted); margin-top: 2px; }
.rec .r-amt { font-size: 1.2rem; font-weight: 700; white-space: nowrap; margin-left: 10px; }
.rec .r-del {
  border: 0; background: none; color: var(--muted);
  font-size: 1.1rem; padding: 8px; cursor: pointer; margin-left: 4px;
}

/* 还礼建议大卡片 */
.suggest-hero { text-align: center; padding: 22px 16px; }
.suggest-hero .label { font-size: 1rem; color: var(--muted); }
.suggest-hero .big { font-size: 2.8rem; font-weight: 800; color: var(--red); margin: 8px 0; }
.suggest-hero .big small { font-size: 1.2rem; font-weight: 400; }
.suggest-hero .alt { font-size: 1rem; color: var(--text); }
.calc-note { font-size: 0.9rem; color: var(--muted); line-height: 1.7; }
.calc-note b { color: var(--text); }

/* 提示 */
.tip { font-size: 0.9rem; color: var(--muted); line-height: 1.6; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; font-size: 1.05rem; line-height: 2; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }

/* 搜索框 */
.search-row { display: flex; gap: 8px; margin-bottom: 14px; }
.search-row input { flex: 1; }
.search-row .btn { width: auto; padding: 12px 22px; letter-spacing: 0; }

/* Toast */
#toast {
  position: fixed;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.78);
  color: #fff;
  font-size: 1.05rem;
  padding: 12px 22px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  z-index: 99;
  max-width: 86%;
  text-align: center;
}
#toast.show { opacity: 1; }

/* 登录页 */
.auth-box { padding-top: 8vh; }
.auth-box .logo { text-align: center; font-size: 2.6rem; margin-bottom: 6px; }
.auth-box .slogan { text-align: center; color: var(--muted); margin-bottom: 26px; font-size: 1rem; }
.auth-tabs { display: flex; margin-bottom: 18px; border-bottom: 2px solid var(--line); }
.auth-tabs button {
  flex: 1; border: 0; background: none; font-size: 1.15rem;
  padding: 12px 0; color: var(--muted); cursor: pointer;
}
.auth-tabs button.on { color: var(--red); font-weight: 700; border-bottom: 3px solid var(--red); margin-bottom: -2px; }

/* 我的页 */
.me-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 1.1rem; }
.me-row:last-child { border-bottom: 0; }
.me-row .btn { width: auto; padding: 10px 20px; font-size: 1rem; letter-spacing: 0; }
