/* 方块生活网页版（lai.cash）。颜色和字体按 docs/视觉规范.md「臻选」，强调色按时段（app.js 设 --accent）。 */
:root {
  --bg: #FAF8F4; --surface: #FFFFFF; --fill: #EFEBE4; --hairline: #EFEBE4;
  --ink: #1A1714; --ink2: #8C857B; --ink3: #A39C91;
  --noir: #16130F; --champagne: #F3E6CC; --gold: #D6B478; --gold-muted: #B8A07A;
  --positive: #3E7D5A; --accent: #C8102E; --wechat: #07C160;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", serif;
  --shadow: 0 10px 26px rgba(40, 30, 20, .06);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F0D0B; --surface: #1C1915; --fill: #2A2621; --hairline: #2E2A25;
    --ink: #F3EEE6; --ink2: #A39C91; --ink3: #6B655C; --positive: #6FB08A;
    --shadow: none;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh; -webkit-text-size-adjust: 100%;
}
#app { max-width: 560px; margin: 0 auto; padding: 20px 20px calc(32px + env(safe-area-inset-bottom)); }
a { color: inherit; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
button:active, .card.tap:active { transform: scale(.97); transition: transform .2s; }
.serif { font-family: var(--serif); font-weight: 700; }
.num { font-family: var(--serif); font-variant-numeric: tabular-nums; }
.kicker { font-size: 11px; letter-spacing: 2.5px; color: var(--ink2); text-transform: uppercase; margin: 0 0 6px; }
h1 { font-family: var(--serif); font-size: 26px; margin: 4px 0 18px; }
h2 { font-family: var(--serif); font-size: 18px; margin: 26px 0 10px; }
.muted { color: var(--ink2); } .faint { color: var(--ink3); } .small { font-size: 12px; }
.center { text-align: center; }

.top { display: flex; align-items: center; gap: 8px; margin: -4px 0 8px; min-height: 36px; }
.top .back { font-size: 15px; color: var(--ink2); padding: 6px 8px 6px 0; }

.card { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.noir {
  background: var(--noir); color: var(--champagne); border-radius: 22px; padding: 22px;
  box-shadow: 0 20px 40px rgba(22, 19, 15, .28); margin-bottom: 14px; position: relative; overflow: hidden;
}
.noir .kicker { color: var(--gold); }
.noir .big { font-size: 40px; line-height: 1.1; color: var(--champagne); }
.noir .row { display: flex; gap: 24px; margin-top: 16px; color: var(--gold-muted); font-size: 12px; }
.noir .row b { display: block; color: var(--champagne); font-size: 18px; font-weight: 600; }

.me { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.me img, .me .ph { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: var(--fill); flex: none; }
.me .name { font-family: var(--serif); font-size: 20px; font-weight: 700; }
.tag { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 99px; background: var(--fill); color: var(--ink2); margin-left: 6px; vertical-align: 3px; }
.tag.pro { background: var(--noir); color: var(--gold); }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  height: 50px; border-radius: 99px; font-size: 16px; font-weight: 600; text-decoration: none;
}
.btn.primary { background: var(--noir); color: var(--champagne); }
.btn.gold { background: var(--gold); color: var(--noir); }
.btn.wechat { background: var(--wechat); color: #fff; }
.btn.ghost { background: var(--fill); color: var(--ink); }
.btn[disabled] { opacity: .5; }
.btn + .btn { margin-top: 12px; }

.list { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; margin-bottom: 14px; }
.list .item { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-top: 1px solid var(--hairline); text-decoration: none; width: 100%; text-align: left; }
.list .item:first-child { border-top: 0; }
.list .item .grow { flex: 1; min-width: 0; }
.list .item .chev { color: var(--ink3); }

.seg { display: flex; background: var(--fill); border-radius: 99px; padding: 4px; margin-bottom: 14px; }
.seg button { flex: 1; height: 34px; border-radius: 99px; font-size: 13px; color: var(--ink2); }
.seg button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }

.month { display: flex; justify-content: space-between; align-items: baseline; margin: 20px 4px 8px; }
.amount-pos { color: var(--accent); } .amount-neg { color: var(--positive); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.order { display: flex; gap: 12px; }
.order img, .order .ph { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: var(--fill); flex: none; }
.order .title { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.order .meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--ink2); gap: 10px; }
.order .status { flex: none; }
.order .status { color: var(--accent); }
.order .status.done { color: var(--positive); } .order .status.dead { color: var(--ink3); }

.field { display: flex; align-items: baseline; gap: 6px; border-bottom: 1px solid var(--hairline); padding: 6px 0 10px; }
.field span { font-family: var(--serif); font-size: 30px; color: var(--ink2); }
.field input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink);
  font: 700 40px/1.2 var(--serif); font-variant-numeric: tabular-nums;
}
.hint { display: flex; justify-content: space-between; font-size: 13px; margin-top: 10px; color: var(--ink2); }
.hint button { color: var(--accent); font-weight: 600; }

.notice { background: var(--fill); border-radius: 16px; padding: 14px 16px; font-size: 13px; color: var(--ink2); margin-bottom: 14px; }
.notice b { color: var(--ink); }
.agree { font-size: 12px; color: var(--ink3); text-align: center; margin-top: 14px; }
.agree a { color: var(--ink2); }

.hero { text-align: center; padding: 48px 0 28px; }
.hero img { width: 76px; height: 76px; border-radius: 18px; box-shadow: var(--shadow); }
.hero h1 { font-size: 30px; margin: 18px 0 6px; }
.points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 0 26px; }
.points div { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 14px 8px; text-align: center; font-size: 12px; color: var(--ink2); }
.points b { display: block; font-family: var(--serif); font-size: 15px; color: var(--ink); margin-bottom: 2px; }

.empty { text-align: center; color: var(--ink3); padding: 40px 0; font-size: 14px; }
.more { display: block; margin: 8px auto 0; color: var(--ink2); font-size: 13px; padding: 10px 20px; }
.spin { display: block; width: 26px; height: 26px; margin: 60px auto; border-radius: 50%; border: 2.5px solid var(--fill); border-top-color: var(--ink2); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

#toast {
  position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); max-width: 80vw;
  background: rgba(22, 19, 15, .9); color: var(--champagne); padding: 11px 18px; border-radius: 14px;
  font-size: 14px; text-align: center; z-index: 10; pointer-events: none;
}
.claim-tip { display: block; color: inherit; text-decoration: none; }
