:root {
  --bg: #fbf5ee;
  --bg-glow: #ffe3d1;
  --card: #ffffff;
  --ink: #33261f;
  --ink-2: #8d7b6f;
  --ink-3: #c2b4a8;
  --line: #f1e7dc;
  --fill: #f6eee6;
  --primary: #f2643a;
  --primary-2: #ff9a6a;
  --primary-soft: #ffe8de;
  --grad: linear-gradient(135deg, #ffa071 0%, #f2643a 100%);
  --tea: #a8714a;
  --tea-2: #d2a885;
  --tea-soft: #f5e9de;
  --grad-tea: linear-gradient(135deg, #d6ad8a 0%, #9c6640 100%);
  --night: #6b5bd2;
  --night-soft: #ece9fb;
  --danger: #e0533d;
  --shadow: 0 8px 28px rgba(120, 70, 30, 0.08);
  --shadow-sm: 0 2px 10px rgba(120, 70, 30, 0.06);
  --r: 22px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #18130f;
    --bg-glow: #3a2216;
    --card: #241d18;
    --ink: #f4ece5;
    --ink-2: #b3a194;
    --ink-3: #6f6157;
    --line: #342a23;
    --fill: #2e251f;
    --primary: #ff7a4d;
    --primary-soft: #43271b;
    --tea: #d9a982;
    --tea-soft: #3b2d23;
    --night: #a99cf5;
    --night-soft: #2c2843;
    --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.25);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(120% 60% at 50% -10%, var(--bg-glow) 0%, var(--bg) 60%) no-repeat, var(--bg);
  background-color: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}
body.tea-mode { background: radial-gradient(120% 60% at 50% -10%, var(--tea-soft) 0%, var(--bg) 60%) no-repeat, var(--bg); background-color: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
.num { font-family: "DIN Alternate", "Bahnschrift", "SF Pro Rounded", -apple-system, sans-serif; font-variant-numeric: tabular-nums; }

/* ---------- 骨架 ---------- */
.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 18px 16px calc(104px + env(safe-area-inset-bottom));
}
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 2px 16px; }
.page-head h1 { font-size: 26px; margin: 0; font-weight: 800; letter-spacing: 1px; }
.page-head .sub { color: var(--ink-2); font-size: 13px; }
.back { width: 38px; height: 38px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow-sm); display: inline-flex; align-items: center; justify-content: center; font-size: 20px; color: var(--ink-2); }

.card {
  background: var(--card);
  border-radius: var(--r);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.card-title { font-weight: 700; font-size: 16px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.card-title small { font-weight: 400; color: var(--ink-3); font-size: 18px; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 13px; }
.center { text-align: center; }
.row { display: flex; align-items: center; }
.row.gap { gap: 10px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }

/* ---------- 按钮 ---------- */
.btn {
  border: 0; border-radius: 14px; padding: 11px 16px;
  background: var(--card); cursor: pointer; font-weight: 600;
  transition: transform .1s, opacity .2s, box-shadow .2s;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn.primary { background: var(--grad); color: #fff; box-shadow: 0 8px 20px rgba(242, 100, 58, .3); }
.btn.tea { background: var(--grad-tea); color: #fff; box-shadow: 0 8px 20px rgba(156, 102, 64, .3); }
.btn.ghost { background: var(--fill); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.block { display: block; width: 100%; }
.btn.big { padding: 15px; font-size: 17px; border-radius: 18px; letter-spacing: 2px; }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--fill);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink-2); flex: none;
}
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.danger { color: var(--danger); }

/* ---------- 切换条 ---------- */
.seg { display: flex; background: var(--fill); border-radius: 999px; padding: 4px; gap: 2px; }
.seg button {
  flex: 1; border: 0; background: none; padding: 8px 12px; border-radius: 999px;
  color: var(--ink-2); cursor: pointer; white-space: nowrap; font-weight: 500; transition: all .2s;
}
.seg button.on { background: var(--card); color: var(--ink); font-weight: 700; box-shadow: var(--shadow-sm); }
.seg.small button { padding: 5px 12px; font-size: 13px; }

/* ---------- 标签 ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 0; background: var(--fill); border-radius: 999px; padding: 7px 14px;
  font-size: 13px; cursor: pointer; color: var(--ink-2); white-space: nowrap; font-weight: 500; transition: all .15s;
  display: inline-flex; align-items: center; gap: 5px;
}
.chip svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chip.on { background: var(--primary-soft); color: var(--primary); }
.tea-mode .chip.on { background: var(--tea-soft); color: var(--tea); }
.chip.card-chip { background: var(--card); box-shadow: var(--shadow-sm); }
.tag { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--fill); color: var(--ink-2); margin-right: 4px; }

/* ---------- 头像 ---------- */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; overflow: hidden; flex: none;
  background: var(--grad); color: #fff; font-weight: 700;
  box-shadow: 0 0 0 3px var(--card);
}
.avatar.b { background: linear-gradient(135deg, #b6a8ff, #7a68e0); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* 名字首字小圆 */
.mono {
  width: 40px; height: 40px; border-radius: 14px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 17px;
}

/* ---------- 列表 ---------- */
.list { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; padding: 4px 0; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 16px; cursor: pointer; position: relative; }
.list-item + .list-item::before { content: ''; position: absolute; left: 68px; right: 16px; top: 0; height: 1px; background: var(--line); }
.list-item:active { background: var(--fill); }
.list-item .main { flex: 1; min-width: 0; }
.list-item .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .meta { font-size: 12px; color: var(--ink-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ago {
  font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--fill); color: var(--ink-2); white-space: nowrap; flex: none;
}
.ago.hot { background: var(--primary-soft); color: var(--primary); }
.ago.cold { background: var(--night-soft); color: var(--night); }
.ago.never { background: none; color: var(--ink-3); }
.empty { text-align: center; color: var(--ink-3); padding: 48px 16px; }
.empty .em { font-size: 52px; display: block; margin-bottom: 8px; filter: grayscale(.2); }
.empty a, .empty button { margin-top: 14px; }

/* ---------- 输入 ---------- */
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 7px; font-weight: 500; }
.input, .field input[type=text], .field input[type=number] {
  width: 100%; border: 2px solid transparent; background: var(--fill);
  border-radius: 14px; padding: 11px 14px; outline: none; transition: border-color .15s;
}
.input:focus, .field input:focus { border-color: var(--primary); background: var(--card); }
.tea-mode .input:focus, .tea-mode .field input:focus { border-color: var(--tea); }
.money-input { position: relative; }
.money-input i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--ink-2); font-size: 20px; font-weight: 600; }
.money-input input { padding: 14px 14px 14px 38px !important; font-size: 24px; font-weight: 700; }
.search-box { position: relative; margin-bottom: 14px; }
.search-box svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; }
.search { width: 100%; border: 0; background: var(--card); border-radius: 16px; padding: 13px 14px 13px 42px; box-shadow: var(--shadow-sm); outline: none; }

/* ---------- 底部导航（悬浮） ---------- */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(12px + env(safe-area-inset-bottom));
  width: min(calc(100% - 24px), 456px);
  display: flex; justify-content: space-around;
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6);
  border-radius: 26px; padding: 7px 6px;
  box-shadow: 0 10px 34px rgba(90, 50, 20, .16);
  z-index: 20;
}
@media (prefers-color-scheme: dark) { .tabbar { background: rgba(40, 32, 27, .82); } }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 10.5px; color: var(--ink-3); font-weight: 500; }
.tabbar .ic { width: 46px; height: 30px; border-radius: 15px; display: flex; align-items: center; justify-content: center; transition: background .2s; }
.tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tabbar svg .fill { fill: currentColor; }
.tabbar a.on { color: var(--primary); }
.tabbar a.on .ic { background: var(--primary-soft); }
.tea-mode .tabbar a.on { color: var(--tea); }
.tea-mode .tabbar a.on .ic { background: var(--tea-soft); }

/* ---------- 弹出面板 ---------- */
.sheet-mask {
  position: fixed; inset: 0; background: rgba(30, 18, 10, 0); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center; transition: background .25s;
}
.sheet-mask.show { background: rgba(30, 18, 10, .45); }
.sheet {
  width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto;
  background: var(--card); border-radius: 28px 28px 0 0;
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .28s cubic-bezier(.2, .9, .3, 1);
}
.sheet-mask.show .sheet { transform: none; }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 2px auto 16px; }
.sheet-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.sheet-head .mono { width: 48px; height: 48px; border-radius: 16px; font-size: 22px; }
.sheet-title { font-size: 20px; font-weight: 800; }
.sheet-sub { color: var(--ink-2); font-size: 13px; }
.confirm-text { font-size: 17px; font-weight: 600; margin: 10px 0 22px; text-align: center; }

/* ---------- 提示 ---------- */
.toast {
  position: fixed; left: 50%; top: 20px; transform: translate(-50%, -24px);
  background: rgba(40, 28, 22, .92); color: #fff; padding: 10px 20px; border-radius: 999px;
  font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: all .25s; z-index: 100; white-space: nowrap;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.fab {
  position: fixed; right: max(20px, calc(50% - 220px));
  bottom: calc(96px + env(safe-area-inset-bottom));
  width: 56px; height: 56px; border-radius: 20px; border: 0;
  background: var(--grad); color: #fff; cursor: pointer; z-index: 15;
  box-shadow: 0 10px 24px rgba(242, 100, 58, .4);
  display: flex; align-items: center; justify-content: center;
}
.fab svg { width: 26px; height: 26px; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; fill: none; }
.tea-mode .fab { background: var(--grad-tea); box-shadow: 0 10px 24px rgba(156, 102, 64, .4); }

@keyframes pop { 0% { transform: scale(.85); opacity: 0; } 60% { transform: scale(1.03); opacity: 1; } 100% { transform: scale(1); } }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.rise { animation: rise .35s ease-out both; }

/* ================= 首页 ================= */
.hero { display: flex; align-items: center; justify-content: space-between; margin: 6px 2px 20px; }
.hero-date b { display: block; font-size: 30px; font-weight: 800; line-height: 1.1; letter-spacing: .5px; }
.hero-date span { color: var(--ink-2); font-size: 14px; }
.duo { display: flex; align-items: center; }
.duo .avatar + .avatar { margin-left: -12px; }
.duo-heart { width: 22px; height: 22px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow-sm); display: flex; align-items: center; justify-content: center; font-size: 11px; margin-left: -8px; z-index: 1; align-self: flex-end; }

.big-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.big-action {
  position: relative; overflow: hidden; border-radius: 26px; padding: 18px; color: #fff; min-height: 150px;
  display: flex; flex-direction: column; justify-content: space-between;
  transition: transform .12s;
}
.big-action:active { transform: scale(.97); }
.big-action.food { background: var(--grad); box-shadow: 0 12px 28px rgba(242, 100, 58, .32); }
.big-action.tea { background: var(--grad-tea); box-shadow: 0 12px 28px rgba(156, 102, 64, .32); }
.big-action::before, .big-action::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.big-action::before { width: 130px; height: 130px; right: -40px; top: -40px; }
.big-action::after { width: 70px; height: 70px; right: 30px; bottom: -30px; }
.big-action .em {
  width: 52px; height: 52px; border-radius: 18px; background: rgba(255, 255, 255, .22);
  display: flex; align-items: center; justify-content: center; font-size: 28px; position: relative; z-index: 1;
}
.big-action b { font-size: 20px; font-weight: 800; letter-spacing: 1px; position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; }
.big-action b i { font-style: normal; width: 28px; height: 28px; border-radius: 50%; background: rgba(255, 255, 255, .25); display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }

.today-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.today-tile {
  background: var(--card); border-radius: 20px; padding: 13px 12px 12px; box-shadow: var(--shadow);
  min-height: 108px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.today-tile .tl { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); font-weight: 500; }
.today-tile .dot { width: 24px; height: 24px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.today-tile .tv { font-weight: 700; font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 8px; }
.today-tile .tp { font-size: 12px; color: var(--ink-2); }
.today-tile.none .tv { color: var(--ink-3); font-weight: 500; font-size: 22px; }
.today-tile.lunch .dot { background: var(--primary-soft); }
.today-tile.dinner .dot { background: var(--night-soft); }
.today-tile.tea .dot { background: var(--tea-soft); }

.month-card { display: flex; align-items: stretch; }
.month-card > div { flex: 1; text-align: center; }
.month-card > div + div { border-left: 1px solid var(--line); }
.month-card b { display: block; font-size: 24px; font-weight: 800; line-height: 1.2; }
.month-card span { font-size: 12px; color: var(--ink-2); }
.month-label { font-size: 13px; color: var(--ink-2); font-weight: 600; margin: 0 4px 8px; }
.setup-card { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 18px; padding: 12px 14px; box-shadow: var(--shadow-sm); margin-bottom: 14px; font-weight: 600; }
.setup-card .em { font-size: 22px; }
.setup-card .go { margin-left: auto; color: var(--ink-3); font-size: 20px; }

/* ================= 转盘 ================= */
.spin-top { margin-bottom: 12px; }
.spin-tools { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.spin-tools .seg { flex: none; }
.spin-tools .tools-right { display: flex; gap: 8px; margin-left: auto; min-width: 0; }
.spin-tools .chip { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }

.wheel-stage { position: relative; width: min(82vw, 320px, 40vh); aspect-ratio: 1; margin: 22px auto 18px; }
.wheel-stage canvas { width: 100%; height: 100%; display: block; filter: drop-shadow(0 14px 26px rgba(150, 70, 30, .22)); }
.tea-mode .wheel-stage canvas { filter: drop-shadow(0 14px 26px rgba(110, 70, 40, .24)); }
.wheel-pointer { position: absolute; left: 50%; top: -14px; transform: translateX(-50%); z-index: 3; width: 34px; height: 44px; }
.wheel-pointer svg { width: 100%; height: 100%; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .25)); }
.wheel-go {
  position: absolute; left: 50%; top: 50%; width: 27%; height: 27%; transform: translate(-50%, -50%);
  border-radius: 50%; border: 0; cursor: pointer; z-index: 2;
  background: var(--card); color: var(--primary); font-size: 22px; font-weight: 900; letter-spacing: 1px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .18), inset 0 0 0 5px var(--primary-soft);
  transition: transform .12s;
}
.wheel-go:active { transform: translate(-50%, -50%) scale(.92); }
.tea-mode .wheel-go { color: var(--tea); box-shadow: 0 6px 18px rgba(0, 0, 0, .18), inset 0 0 0 5px var(--tea-soft); }
.wheel-go:disabled { color: var(--ink-3); }

.result-card { text-align: center; padding: 20px 18px 16px; animation: pop .4s ease-out both; position: relative; overflow: hidden; }
.result-card::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--grad); }
.tea-mode .result-card::before { background: var(--grad-tea); }
.result-card .rname { font-size: 30px; font-weight: 900; margin: 0 0 6px; letter-spacing: 1px; }
.result-card .rmeta { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.result-card .rmeta .tag, .result-card .rmeta .ago { font-size: 12px; padding: 3px 10px; margin: 0; }
.veto-row { display: flex; gap: 10px; margin-top: 10px; }
.veto {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; background: var(--fill); border-radius: 14px; padding: 8px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink-2);
}
.veto .x { width: 18px; height: 18px; border-radius: 50%; background: var(--ink-3); color: var(--card); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; }
.veto:disabled { opacity: .35; }
.vetoed { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.vetoed .tag { text-decoration: line-through; color: var(--ink-3); }

/* ================= 记一笔 ================= */
.rec-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 0 14px; }
.date-chips { display: flex; gap: 6px; align-items: center; }
.date-pick { position: relative; }
.date-pick input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.cur-card {
  display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 18px;
  padding: 12px 14px; box-shadow: var(--shadow-sm); margin-bottom: 10px; animation: rise .3s ease-out both;
}
.cur-card .main { flex: 1; min-width: 0; }
.cur-card .name { font-weight: 700; }
.cur-card .meta { font-size: 12px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.cur-card .check { width: 22px; height: 22px; border-radius: 50%; background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; flex: none; }
.tea-mode .cur-card .check { background: var(--grad-tea); }
.add-new .mono { background: var(--primary-soft); color: var(--primary); }
.tea-mode .add-new .mono { background: var(--tea-soft); color: var(--tea); }
.add-new .name { color: var(--primary); }
.tea-mode .add-new .name { color: var(--tea); }

/* ================= 看板 ================= */
.board-tabs { margin-bottom: 16px; }
.month-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.month-nav b { font-size: 20px; font-weight: 800; }
.month-nav button { border: 0; background: var(--card); width: 36px; height: 36px; border-radius: 50%; box-shadow: var(--shadow-sm); cursor: pointer; font-size: 18px; color: var(--ink-2); }
.cal-card { padding: 14px 10px 12px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal .wk { text-align: center; font-size: 11px; color: var(--ink-3); padding-bottom: 6px; font-weight: 600; }
.cal .day { min-height: 66px; padding: 4px 2px 3px; border-radius: 12px; cursor: pointer; display: flex; flex-direction: column; align-items: stretch; gap: 2px; }
.cal .day:active { background: var(--fill); }
.cal .day.blank { cursor: default; }
.cal .day .dn { font-size: 12px; font-weight: 700; color: var(--ink-2); text-align: center; width: 22px; height: 22px; line-height: 22px; border-radius: 50%; margin: 0 auto 1px; }
.cal .day.today .dn { background: var(--grad); color: #fff; }
.cal .day.future .dn { color: var(--ink-3); font-weight: 500; }
.cal .pill { font-size: 9.5px; line-height: 1.5; padding: 0 3px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: clip; font-weight: 600; }
.cal .pill.l { background: var(--primary-soft); color: var(--primary); }
.cal .pill.d { background: var(--night-soft); color: var(--night); }
.cal .pill.t { background: var(--tea-soft); color: var(--tea); }
.legend { display: flex; gap: 14px; justify-content: center; font-size: 12px; color: var(--ink-2); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.stat-hero { background: var(--grad); color: #fff; border-radius: 24px; padding: 18px 20px; margin-bottom: 12px; box-shadow: 0 12px 28px rgba(242, 100, 58, .3); position: relative; overflow: hidden; }
.stat-hero::after { content: ''; position: absolute; width: 160px; height: 160px; border-radius: 50%; background: rgba(255, 255, 255, .12); right: -50px; top: -60px; }
.stat-hero span { font-size: 13px; opacity: .85; }
.stat-hero b { display: block; font-size: 38px; font-weight: 800; line-height: 1.15; }
.stat-hero .split { display: flex; gap: 18px; margin-top: 8px; font-size: 13px; opacity: .92; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--card); border-radius: 18px; padding: 12px; box-shadow: var(--shadow-sm); }
.stat span { font-size: 12px; color: var(--ink-2); }
.stat b { display: block; font-size: 19px; font-weight: 800; margin-top: 2px; white-space: nowrap; }
.stat small { font-size: 11px; color: var(--ink-3); }
.bar-row { display: flex; align-items: center; gap: 10px; margin: 10px 0; font-size: 13px; }
.bar-row .bl { width: 64px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.bar-row .bt { flex: 1; height: 12px; background: var(--fill); border-radius: 6px; overflow: hidden; }
.bar-row .bt i { display: block; height: 100%; background: var(--grad); border-radius: 6px; }
.bar-row .bv { width: 56px; text-align: right; flex: none; font-weight: 600; }
.vbars { display: flex; align-items: flex-end; gap: 10px; height: 130px; padding-top: 18px; }
.vbars .vb { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.vbars .vb i { width: 100%; max-width: 34px; border-radius: 10px 10px 4px 4px; background: var(--primary-soft); position: relative; }
.vbars .vb.on i { background: var(--grad); }
.vbars .vb i em { position: absolute; top: -17px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 10px; color: var(--ink-2); white-space: nowrap; }
.vbars .vb span { font-size: 11px; color: var(--ink-2); }

.podium { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr); gap: 8px; align-items: end; margin-bottom: 14px; }
.podium .pd { background: var(--card); border-radius: 20px; padding: 12px 8px; text-align: center; box-shadow: var(--shadow-sm); }
.podium .pd.p1 { padding: 18px 8px; box-shadow: var(--shadow); }
.podium .medal { font-size: 26px; line-height: 1; }
.podium .p1 .medal { font-size: 34px; }
.podium .pn { font-weight: 700; margin-top: 6px; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .pc { font-size: 12px; color: var(--ink-2); }
.rank-n { width: 26px; text-align: center; font-weight: 800; color: var(--ink-3); flex: none; }
.sec-title { font-size: 15px; font-weight: 700; margin: 6px 4px 10px; }
.day-rec { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.day-rec + .day-rec { border-top: 1px solid var(--line); }
.day-rec .main { flex: 1; min-width: 0; }
.day-rec .name { font-weight: 600; }
.day-rec .meta { font-size: 12px; color: var(--ink-2); }
.day-add { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.day-add a { text-align: center; padding: 10px 4px; border-radius: 14px; background: var(--fill); font-size: 13px; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.day-add a span { font-size: 18px; }

/* ================= 菜单池 ================= */
.pool-groups { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; margin: 12px -2px 8px; scrollbar-width: none; }
.pool-groups::-webkit-scrollbar { display: none; }
.meal-pick { display: flex; gap: 8px; }
.meal-pick .chip { flex: 1; justify-content: center; padding: 10px; }
.group-edit-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }

/* ================= 我们 ================= */
.duo-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.p-card { background: var(--card); border-radius: 24px; padding: 20px 14px 14px; box-shadow: var(--shadow); text-align: center; position: relative; }
.p-card .avatar-pick { display: inline-block; position: relative; cursor: pointer; }
.p-card .avatar-pick .cam {
  position: absolute; right: 0; bottom: 2px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--ink); color: var(--card); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 3px var(--card);
}
.p-card .cam svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.p-card input { text-align: center; font-weight: 700; font-size: 16px; margin-top: 12px; }
.p-card .mine { margin-top: 10px; width: 100%; justify-content: center; }
.p-card.is-me { box-shadow: 0 0 0 2px var(--primary), var(--shadow); }
.set-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; }
.set-row + .set-row { border-top: 1px solid var(--line); }
.set-row .lab { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.set-row .lab .dot { width: 30px; height: 30px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.stepper { display: flex; align-items: center; gap: 4px; background: var(--fill); border-radius: 999px; padding: 3px; }
.stepper button { width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--card); cursor: pointer; font-size: 16px; box-shadow: var(--shadow-sm); }
.stepper b { min-width: 42px; text-align: center; font-size: 14px; }

/* ================= 谁吃 / 两人几天前 / 挑选 / 分开付 ================= */
.eaters { display: flex; gap: 6px; }
.eater {
  display: flex; align-items: center; gap: 6px; border: 0; cursor: pointer;
  background: var(--fill); border-radius: 999px; padding: 3px 12px 3px 3px;
  font-size: 13px; font-weight: 600; color: var(--ink-3); transition: all .15s;
}
.eater .avatar { box-shadow: none; filter: grayscale(1); opacity: .45; transition: all .15s; }
.eater.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
.eater.on .avatar { filter: none; opacity: 1; }

.mini-duo { display: inline-flex; align-items: center; flex: none; }
.mini-duo .avatar { box-shadow: 0 0 0 2px var(--card); }
.mini-duo .avatar + .avatar { margin-left: -6px; }

.ago-duo { display: inline-flex; flex-direction: column; gap: 3px; align-items: flex-end; flex: none; }
.ago-duo .ad { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.ago-duo .ad .avatar { box-shadow: none; }
.ago-duo .ad.hot { color: var(--primary); font-weight: 600; }
.ago-duo .ad.cold { color: var(--night); }
.ago-duo .ad.never { color: var(--ink-3); }
.ago-duo.compact { align-items: flex-start; gap: 2px; }
.ago-duo.compact .ad { font-size: 11px; gap: 4px; }
.result-card .ago-duo { flex-direction: row; gap: 14px; }
.result-card .ago-duo .ad { font-size: 13px; }

.stage-seg { margin: 12px 0 14px; }
.stage-seg button { font-size: 15px; padding: 9px 12px; }

.pick-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.picker { display: flex; gap: 6px; background: var(--fill); border-radius: 999px; padding: 3px; }
.picker button {
  display: flex; align-items: center; gap: 6px; border: 0; background: none; border-radius: 999px;
  padding: 2px 10px 2px 2px; cursor: pointer; color: var(--ink-3); font-weight: 700; font-size: 13px;
}
.picker button .avatar { box-shadow: none; opacity: .5; }
.picker button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
.picker button.on .avatar { opacity: 1; }

.pick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; padding-bottom: 76px; }
.pick {
  position: relative; text-align: left; border: 2px solid transparent; cursor: pointer;
  background: var(--card); border-radius: 18px; padding: 11px 10px 10px; min-height: 96px;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; justify-content: space-between; gap: 8px;
  transition: transform .1s, border-color .15s, background .15s;
}
.pick:active { transform: scale(.96); }
.pick-name { font-weight: 700; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; padding-right: 18px; }
.pick.faded { opacity: .5; }
.pick.on { border-color: var(--primary); background: var(--primary-soft); opacity: 1; }
.tea-mode .pick.on { border-color: var(--tea); background: var(--tea-soft); }
.pick.both { box-shadow: 0 0 0 2px var(--primary), 0 8px 20px rgba(242, 100, 58, .25); }
.tea-mode .pick.both { box-shadow: 0 0 0 2px var(--tea), 0 8px 20px rgba(156, 102, 64, .25); }
.pick-who { position: absolute; top: -7px; right: -5px; display: flex; }
.pick-who .avatar { box-shadow: 0 0 0 2px var(--card); }
.pick-who .avatar + .avatar { margin-left: -7px; }
.pick-go-wrap {
  position: fixed; left: 0; right: 0; bottom: calc(92px + env(safe-area-inset-bottom));
  display: flex; justify-content: center; pointer-events: none; z-index: 14;
}
.pick-go { pointer-events: auto; padding: 13px 34px; border-radius: 999px; letter-spacing: 1px; }

.r-who { display: flex; justify-content: center; margin-bottom: 6px; }
.r-who .avatar + .avatar { margin-left: -6px; }
.result-card .rmeta + .rmeta { margin-top: -8px; }

.aa-line { display: flex; align-items: center; gap: 6px; justify-content: flex-end; margin-top: 8px; font-size: 13px; color: var(--ink-2); min-height: 18px; }
.aa-line .avatar { box-shadow: none; }
.aa-line .num + .avatar { margin-left: 8px; }
.split-grid { display: grid; gap: 10px; margin-bottom: 16px; }
.split-cell { display: flex; align-items: center; gap: 10px; }
.split-cell .avatar { box-shadow: none; }
.money-input.grow { flex: 1; }

.list-item .ago-duo { margin-left: 4px; }
.cur-card .mini-duo { margin-left: 2px; }
.day-rec .mini-duo { margin-left: 4px; }
.stat-hero .who-spend { display: inline-flex; align-items: center; gap: 7px; }
.stat-hero .who-spend b { display: inline; font-size: 17px; }
.stat-hero .who-spend .avatar { box-shadow: 0 0 0 2px rgba(255,255,255,.6); }
.stat-hero .split { position: relative; z-index: 1; gap: 22px; margin-top: 12px; }
.today-tile .tp { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-top: 4px; }
.money-input input { width: 100%; border: 2px solid transparent; background: var(--fill); border-radius: 14px; outline: none; }
.money-input input:focus { border-color: var(--primary); background: var(--card); }
.tea-mode .money-input input:focus { border-color: var(--tea); }
.split-cell .money-input input { font-size: 20px; padding: 11px 12px 11px 34px !important; }
.split-cell .money-input i { font-size: 17px; left: 13px; }
.stat-hero .hero-who { display: inline-flex; align-items: center; gap: 7px; position: relative; z-index: 1; }
.stat-hero .hero-who .avatar { box-shadow: 0 0 0 2px rgba(255,255,255,.6); }
.month-card b { font-size: 21px; }

/* ================= 口令页 ================= */
.gate {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(120% 70% at 50% 0%, var(--bg-glow) 0%, var(--bg) 65%), var(--bg);
}
.gate-card { width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 14px; text-align: center; }
.gate-em {
  width: 96px; height: 96px; margin: 0 auto 10px; border-radius: 32px; background: var(--grad);
  display: flex; align-items: center; justify-content: center; font-size: 50px;
  box-shadow: 0 16px 34px rgba(242, 100, 58, .35);
}
.gate-card .input { text-align: center; font-size: 18px; padding: 14px; background: var(--card); box-shadow: var(--shadow-sm); letter-spacing: 2px; }
@keyframes shake { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.shake { animation: shake .4s; }

/* ---------- 只能看（没输口令的手机） ---------- */
.ro .fab, .ro #manage, .ro [data-edit], .ro [data-del] { display: none !important; }
.ro .list-item { cursor: default; }
.ro .p-card .avatar-pick { cursor: default; pointer-events: none; }
.ro .p-card .cam { display: none; }
.p-name { font-weight: 700; font-size: 16px; margin-top: 12px; padding: 10px 0 4px; }
.lock-btn { color: var(--ink-3); }
.lock-btn.open { color: var(--primary); background: var(--primary-soft); }
.gate .btn.ghost { margin-top: -4px; }

/* ---------- 菜和奶茶的图片 / 图标 ---------- */
.mono.pic { overflow: hidden; }
.mono.pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mono.emo { font-size: 22px; line-height: 1; }
.sheet-head .mono.emo { font-size: 28px; }

.cover-row { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.cover { position: relative; flex: none; }
.cover .mono { width: 76px; height: 76px; border-radius: 24px; font-size: 32px; box-shadow: var(--shadow-sm); }
.cover .mono.emo { font-size: 42px; }
.cover-x {
  position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%;
  border: 0; background: var(--ink); color: var(--card); font-size: 11px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 3px var(--card);
}
.cover-busy { position: absolute; inset: 0; border-radius: 24px; background: rgba(255, 255, 255, .55); }
.cover-busy::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px;
  border-radius: 50%; border: 3px solid var(--primary); border-right-color: transparent; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.icon-strip {
  flex: 1; min-width: 0; display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, 38px);
  grid-auto-columns: 38px; gap: 6px; overflow-x: auto; padding: 2px; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
          mask-image: linear-gradient(90deg, #000 85%, transparent);
}
.icon-strip::-webkit-scrollbar { display: none; }
.ic-opt {
  width: 38px; height: 38px; border-radius: 12px; border: 0; background: var(--fill); cursor: pointer;
  font-size: 20px; line-height: 1; display: flex; align-items: center; justify-content: center; transition: transform .1s;
}
.ic-opt:active { transform: scale(.9); }
.ic-opt.on { box-shadow: 0 0 0 2px var(--primary); background: var(--primary-soft); }
.tea-mode .ic-opt.on { box-shadow: 0 0 0 2px var(--tea); background: var(--tea-soft); }
.ic-opt.cam { grid-row: span 2; height: auto; color: var(--ink-2); }
.ic-opt.cam svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.pick-top { display: flex; flex-direction: column; gap: 7px; align-items: flex-start; }
.pick .mono { border-radius: 11px; font-size: 15px; }
.pick .mono.emo { font-size: 19px; }
.r-pic { display: flex; justify-content: center; margin: 4px 0 10px; }
.r-pic .mono { border-radius: 28px; box-shadow: var(--shadow); }
.r-pic .mono.emo { font-size: 52px; }
.podium .pd .mono { margin-top: 6px; border-radius: 14px; }
.podium .pd .mono.emo { font-size: 24px; }

/* 转盘挑选页的搜索 */
.pick-search { margin: 4px 0 12px; }
.pick-search .search { padding-right: 40px; }
.search-x {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 50%;
  border: 0; background: var(--fill); color: var(--ink-2); font-size: 11px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
