/* 配色、字体沿用市场通，两个应用看着是一家的 */
:root {
  --red: #A8231C; --red-dark: #7E1A15; --red-soft: #F6E4E1;
  --ink: #1F1A17; --muted: #5C534C; --line: #E8E1D9; --line-soft: #F0EAE3;
  --bg: #F7F4EF; --card: #FFFFFF;
  --blue: #1D4F8C; --blue-soft: #E3EDF8;
  --amber: #8A4508; --amber-soft: #FBEBDD;
  --gray: #5E5750; --gray-soft: #ECE8E3;
  --green: #2C6B45; --green-soft: #E8F3EC;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font-family: system-ui, -apple-system, "PingFang SC", "Noto Sans SC", sans-serif; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font-family: inherit; }
a { color: var(--red); text-decoration: none; }
.center { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; gap: 6px; }
.logo-lg { width: 88px; height: 88px; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.6; }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.page { min-height: 100vh; display: flex; flex-direction: column; padding-bottom: 76px; }
.page.no-tab { padding-bottom: 96px; }

/* 首页抬头 */
.hero { background: linear-gradient(160deg, #B8261E 0%, var(--red) 55%, var(--red-dark) 100%); color: #fff; padding: 16px 16px 20px; padding-top: max(16px, env(safe-area-inset-top)); }
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.badge { width: 44px; height: 44px; border-radius: 50%; background: #fff; flex-shrink: 0; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.badge img { width: 38px; height: 38px; margin-top: 2px; }
.brand b { font-size: 16px; letter-spacing: 1px; display: block; white-space: nowrap; }
.brand .motto { display: block; font-size: 12px; letter-spacing: 3px; opacity: .9; margin-top: 2px; white-space: nowrap; }
.pill-w { font-size: 12px; background: rgba(255,255,255,.18); padding: 4px 10px; border-radius: 999px; white-space: nowrap; color: #fff; }
.hero h1 { font-size: 21px; margin: 16px 0 2px; }
.hero p { margin: 0; font-size: 13px; opacity: .9; }

/* 顶栏 */
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 6px; padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top));
  background: var(--card); border-bottom: 1px solid var(--line); }
.bar .back { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--ink); }
.bar .title { font-size: 16px; font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .act { font-size: 14px; padding: 0 8px; }

.wrap { padding: 12px 16px; display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--card); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card h3 { margin: 0; font-size: 15px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card h3 small { font-size: 13px; font-weight: 400; color: var(--muted); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.row > :first-child { min-width: 0; }
.sec { font-size: 13px; color: var(--muted); letter-spacing: 1px; padding: 4px 2px 0; }
.sec.red { color: var(--red); font-weight: 600; }

/* 一件事 / 一笔费用：一行 */
.item { display: flex; gap: 12px; align-items: center; background: var(--card); border-radius: 14px; padding: 13px 14px; color: var(--ink); }
.item .mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.item .name { font-size: 15px; font-weight: 600; }
.item .meta { font-size: 13px; color: var(--muted); }
.item .right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; text-align: right; }
.item.late { box-shadow: inset 3px 0 0 var(--red); }
.item .thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--gray-soft); flex-shrink: 0; }
.item .tick { width: 26px; height: 26px; border-radius: 13px; border: 2px solid #CFC5BA; flex-shrink: 0; }

.tag { font-size: 12px; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.t-red { background: var(--red-soft); color: var(--red); }
.t-amb { background: var(--amber-soft); color: var(--amber); }
.t-blu { background: var(--blue-soft); color: var(--blue); }
.t-grn { background: var(--green-soft); color: var(--green); }
.t-gry { background: var(--gray-soft); color: var(--gray); }
.amt { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.cell { background: var(--bg); border-radius: 10px; padding: 10px 4px; color: var(--ink); }
.cell b { font-size: 18px; display: block; font-variant-numeric: tabular-nums; }
.cell span { font-size: 12px; color: var(--muted); }
.cell.hot b { color: var(--red); }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.kv:first-child { border-top: 0; padding-top: 0; }
.kv span:first-child { color: var(--muted); flex-shrink: 0; }
.kv span:last-child { text-align: right; min-width: 0; word-break: break-all; }
.prow { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line-soft); color: var(--ink); }
.prow:first-of-type { border-top: 0; }
.prow b { font-size: 15px; }
.prow .mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.prow .meta { font-size: 13px; color: var(--muted); }
.pre { white-space: pre-wrap; line-height: 1.7; font-size: 14px; }

/* 表单 */
.frow { display: flex; flex-direction: column; gap: 6px; }
.frow > label { font-size: 13px; color: var(--muted); }
input.txt, select.txt, textarea.txt { min-height: 44px; border: 1px solid #E0D8CF; border-radius: 10px; padding: 0 12px; font-size: 16px; width: 100%; background: #fff; color: var(--ink); }
textarea.txt { padding: 10px 12px; min-height: 76px; line-height: 1.6; resize: vertical; }
select.txt { -webkit-appearance: none; appearance: none; padding-right: 34px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236B625B' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center; }
input.txt:focus, select.txt:focus, textarea.txt:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.seg { display: grid; gap: 8px; }
.seg button { min-height: 44px; border-radius: 10px; font-size: 14px; border: 1px solid #E0D8CF; background: #fff; color: var(--ink); }
.seg button.on { background: var(--red); color: #fff; border-color: var(--red); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0; }
.chip { flex-shrink: 0; min-height: 34px; padding: 0 13px; border-radius: 999px; font-size: 13px; border: 1px solid #E0D8CF; background: #fff; color: var(--ink); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--red); }

.foot { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line);
  padding: 10px 16px; padding-bottom: max(10px, env(safe-area-inset-bottom)); display: flex; gap: 10px; align-items: center; z-index: 6; }
.foot .btn { flex: 1; }
.btn { min-height: 46px; border: 0; border-radius: 12px; background: var(--red); color: #fff; font-size: 16px; font-weight: 500; padding: 0 18px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn.soft { background: var(--red-soft); color: var(--red); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid #E0D8CF; }
.btn.sm { min-height: 36px; font-size: 14px; padding: 0 14px; border-radius: 10px; }
.btn.full { width: 100%; }
.btn:disabled { opacity: .5; }
.btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: grid; background: var(--card); z-index: 6;
  border-top: 1px solid var(--line); padding: 4px 0; padding-bottom: max(6px, env(safe-area-inset-bottom)); }
.tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); min-height: 44px; justify-content: center; }
.tabbar a.on { color: var(--red); }
.tabbar svg { width: 22px; height: 22px; }
.tabbar i { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 16px; height: 16px; border-radius: 8px; background: var(--red); color: #fff; font-size: 10px; font-style: normal; line-height: 16px; padding: 0 4px; }

.done { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 32px; text-align: center; }
.done .ok { width: 64px; height: 64px; border-radius: 32px; background: var(--blue-soft); color: var(--blue); display: flex; align-items: center; justify-content: center; font-size: 32px; }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: rgba(31,26,23,.9); color: #fff; padding: 10px 16px;
  border-radius: 10px; font-size: 14px; max-width: 86vw; z-index: 20; }
.empty { text-align: center; color: var(--muted); font-size: 14px; padding: 20px 0; }
.note-box { background: var(--amber-soft); color: var(--amber); border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.6; }
.note-box.red { background: var(--red-soft); color: var(--red); }
.note-box.blue { background: var(--blue-soft); color: var(--blue); }
.loading { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 14px; }
.spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--red); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.cheer { font-size: 14px; color: var(--red); letter-spacing: 1px; }

/* 照片 */
.phs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ph { position: relative; aspect-ratio: 1; border-radius: 10px; border: 1px dashed #CFC5BA; background: var(--bg); color: var(--muted); font-size: 13px;
  display: flex; align-items: center; justify-content: center; overflow: hidden; text-align: center; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph .x { position: absolute; right: 4px; top: 4px; width: 24px; height: 24px; border-radius: 12px; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 16px; line-height: 1; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 8px; scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 86%; scroll-snap-align: center; height: 260px; border-radius: 10px; overflow: hidden; background: #2a2522; }
.slide:only-child { flex-basis: 100%; }
.slide img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pv { position: fixed; inset: 0; z-index: 1000; background: #000; display: flex; align-items: center; justify-content: center; }
.pv img { max-width: 100%; max-height: 100%; }
.pv button { position: absolute; right: 14px; top: max(14px, env(safe-area-inset-top)); width: 44px; height: 44px; border: 0; border-radius: 22px; background: rgba(255,255,255,.2); color: #fff; font-size: 28px; line-height: 1; }

/* 费用每一步 */
.steps { display: flex; flex-direction: column; }
.stp { display: grid; grid-template-columns: 14px 1fr; gap: 10px; padding: 6px 0; font-size: 14px; }
.stp::before { content: ""; width: 10px; height: 10px; border-radius: 5px; background: var(--blue); margin-top: 6px; }
.stp.next::before { background: #fff; border: 2px solid var(--amber); width: 6px; height: 6px; }
.stp .meta { font-size: 12px; color: var(--muted); }

/* 一句 */
.note-card { display: flex; flex-direction: column; gap: 6px; }
.note-card .q { font-size: 12px; color: var(--muted); }
.note-card .a { font-size: 14px; line-height: 1.7; white-space: pre-wrap; }
.reply { background: var(--red-soft); border-radius: 10px; padding: 8px 10px; font-size: 14px; color: var(--red-dark); }
