:root {
  --primary: #FF6B4A;
  --on-primary: #fff;
  --bg: #FFF7F2;
  --surface: #fff;
  --surface-2: #F6EEE9;
  --text: #2D2A32;
  --text-2: #6F6670;
  --line: rgba(45, 42, 50, .08);
  --shadow: 0 6px 18px rgba(255, 107, 74, .10);
  --hero: linear-gradient(120deg, #FFB547, #FF6B6B);
  --nav-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: #FF9A7A; --on-primary: #3A1206;
    --bg: #16141A; --surface: #1F1D24; --surface-2: #2A2730;
    --text: #F1ECF3; --text-2: #C9C3CF; --line: rgba(255, 255, 255, .08);
    --shadow: 0 6px 18px rgba(0, 0, 0, .35);
    --hero: linear-gradient(120deg, #D98A2B, #D14F55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --primary: #FF9A7A; --on-primary: #3A1206;
  --bg: #16141A; --surface: #1F1D24; --surface-2: #2A2730;
  --text: #F1ECF3; --text-2: #C9C3CF; --line: rgba(255, 255, 255, .08);
  --shadow: 0 6px 18px rgba(0, 0, 0, .35);
  --hero: linear-gradient(120deg, #D98A2B, #D14F55);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 15px; line-height: 1.4;
  -webkit-user-select: none; user-select: none;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
input { font: inherit; color: inherit; }
img { -webkit-user-drag: none; user-select: none; }
[hidden] { display: none !important; }

.page { max-width: 720px; margin: 0 auto; padding: 0 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); }
.page-title { font-size: 28px; font-weight: 900; margin: 18px 0 12px; }

/* ---------- 成员切换条 ---------- */
.members {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding: calc(10px + env(safe-area-inset-top)) 0 8px;
}
.members-row { max-width: 720px; margin: 0 auto; padding: 0 16px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.members-row::-webkit-scrollbar { display: none; }
.mchip {
  flex: none; display: flex; align-items: center; gap: 6px;
  padding: 4px 14px 4px 4px; border-radius: 999px;
  background: var(--surface); box-shadow: 0 1px 0 var(--line), 0 2px 8px rgba(0,0,0,.04);
  font-weight: 600; font-size: 14px; transition: background .2s, color .2s, transform .2s;
}
.mchip img { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); }
.mchip.on { background: var(--primary); color: var(--on-primary); }
.mchip.on img { background: rgba(255,255,255,.35); }
.mchip:active { transform: scale(.95); }
.mchip.add { padding: 4px 14px; color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); box-shadow: none; }
.mchip .badge { font-size: 11px; font-weight: 700; opacity: .8; }

/* ---------- 头部卡片 ---------- */
.hero {
  display: flex; align-items: center; gap: 12px;
  margin: 6px 0 14px; padding: 20px; border-radius: 28px;
  background: var(--hero); color: #fff; box-shadow: 0 10px 24px rgba(255, 107, 74, .25);
}
.hero-main { flex: 1; min-width: 0; }
.hero-who { display: flex; align-items: center; gap: 8px; }
.hero-face { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.35); display: grid; place-items: center; }
.hero-face img { width: 40px; height: 40px; }
.hero-greet { font-size: 15px; opacity: .92; }
.hero-date { font-size: 22px; font-weight: 800; margin-top: 4px; }
.hero-tip { font-size: 14px; margin-top: 10px; }
.hero-sub { font-size: 13px; opacity: .85; }
.ring { position: relative; width: 92px; height: 92px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring .track { stroke: rgba(255,255,255,.3); }
.ring .bar { stroke: #fff; stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.34, 1.4, .64, 1); }
.ring-txt { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-txt b { font-size: 22px; font-weight: 900; line-height: 1.1; }
.ring-txt span { font-size: 12px; opacity: .85; }

/* ---------- 打卡卡片 ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.cwrap { position: relative; aspect-ratio: .74; }
.card {
  --c: #F08A24;
  position: absolute; inset: 0; overflow: hidden; border-radius: 26px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 18%, transparent), 0 6px 16px color-mix(in srgb, var(--c) 16%, transparent);
  display: flex; flex-direction: column; align-items: center; padding: 14px;
  cursor: pointer; transition: transform .35s cubic-bezier(.34, 1.8, .64, 1), box-shadow .3s;
  touch-action: manipulation;
}
.card.pressed { transform: scale(.96); transition-duration: .12s; }
.card.done { box-shadow: 0 10px 22px color-mix(in srgb, var(--c) 38%, transparent); }
.card .fill {
  position: absolute; inset: 0; background: var(--c); pointer-events: none;
  clip-path: circle(0px at var(--cx, 50%) var(--cy, 45%));
}
.card.done .fill { clip-path: circle(150% at var(--cx, 50%) var(--cy, 45%)); }
.card.reveal .fill { transition: clip-path .45s cubic-bezier(.2, .7, .3, 1); }
.card > :not(.fill) { position: relative; }
.card-top { width: 100%; display: flex; align-items: center; gap: 4px; min-height: 26px; }
.streak { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--c) 12%, transparent); }
.card-top .sp { flex: 1; }
.more { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); font-size: 16px; letter-spacing: -1px; }
.tick { width: 26px; height: 26px; border-radius: 50%; background: #fff; color: var(--c); display: grid; place-items: center; font-weight: 900; transform: scale(0); transition: transform .4s cubic-bezier(.34, 1.8, .64, 1); }
.card.done .tick { transform: scale(1); }
.card-icon { flex: 1; width: 100%; min-height: 0; position: relative; }
.card-icon .disc { position: absolute; left: 50%; top: 50%; translate: -50% -50%; height: calc(100% - 8px); max-height: 118px; }
.disc {
  aspect-ratio: 1; border-radius: 50%;
  background: color-mix(in srgb, var(--c) 10%, transparent); display: grid; place-items: center;
  transition: background .3s;
}
.card.done .disc { background: rgba(255,255,255,.95); }
.disc img {
  width: 98%; height: 98%; object-fit: contain; transform-origin: 50% 95%;
  transform: scale(1.15); transition: transform .5s cubic-bezier(.3, 2.2, .5, 1);
}
.disc img.still { transform: none; transform-origin: 50% 60%; }
.card.pressed .disc img { transform: scale(1.38, .85); transition: transform .12s ease-out; }
.card.pressed .disc img.still { transform: scale(1.12, .82); }
.disc img.pop { animation: jelly .55s cubic-bezier(.3, 1.6, .5, 1); }
.disc img.pop2 { animation: jelly2 .55s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes jelly { 0% { transform: scale(1.32, .9); } 40% { transform: scale(1.04, 1.28); } 70% { transform: scale(1.2, 1.1); } 100% { transform: scale(1.15); } }
@keyframes jelly2 { 0% { transform: scale(1.32, .9); } 40% { transform: scale(1.04, 1.28); } 70% { transform: scale(1.2, 1.1); } 100% { transform: scale(1.15); } }
.disc img.still.pop, .disc img.still.pop2 { animation: jellyStill .7s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes jellyStill { 0% { transform: scale(1.2, .8); } 35% { transform: scale(.9, 1.2) rotate(-6deg); } 65% { transform: scale(1.06, .96) rotate(4deg); } 100% { transform: none; } }

.card-name { font-size: 16px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .2s; }
.card-total { font-size: 13px; color: var(--text-2); margin-top: 2px; transition: color .2s; }
.chip {
  margin-top: 6px; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 999px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
  color: var(--c); background: color-mix(in srgb, var(--c) 10%, transparent);
}
.chip.cheer { animation: chipIn .35s cubic-bezier(.34, 1.6, .64, 1); font-weight: 700; }
@keyframes chipIn { from { transform: translateY(80%); opacity: 0; } to { transform: none; opacity: 1; } }
.prog { width: 100%; margin-top: 6px; }
.prog-bar { height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--c) 15%, transparent); overflow: hidden; }
.prog-bar i { display: block; height: 100%; width: 0; background: var(--c); border-radius: 3px; transition: width .5s cubic-bezier(.34, 1.4, .64, 1); }
.prog-txt { font-size: 11px; color: var(--text-2); text-align: center; margin-top: 2px; white-space: nowrap; overflow: hidden; }
.prog-txt.cheer { font-weight: 700; color: var(--text); }

.card.filled .card-name, .card.filled .prog-txt.cheer { color: #fff; }
.card.filled .card-total, .card.filled .prog-txt { color: rgba(255,255,255,.85); }
.card.filled .streak { background: rgba(255,255,255,.22); color: #fff; }
.card.filled .more { color: rgba(255,255,255,.85); }
.card.filled .chip { color: #fff; background: rgba(255,255,255,.22); }
.card.filled .prog-bar { background: rgba(255,255,255,.3); }
.card.filled .prog-bar i { background: #fff; }

.cwrap.shake .card { animation: shake .4s; }
@keyframes shake { 12% { translate: -9px; } 30% { translate: 8px; } 47% { translate: -6px; } 65% { translate: 4px; } 82% { translate: -2px; } 100% { translate: 0; } }
.cwrap.boing .card { animation: boing .45s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes boing { 0% { scale: .94; } 100% { scale: 1; } }

.fx { position: absolute; inset: 0; pointer-events: none; z-index: 5; overflow: visible; }
.fx .p { position: absolute; left: 0; top: 0; font-size: 18px; line-height: 1; will-change: transform, opacity; font-weight: 900; }
.plus1 {
  position: absolute; left: 50%; top: 6px; z-index: 6; font-size: 28px; font-weight: 900; color: var(--c); pointer-events: none;
  animation: plus1 1.5s linear forwards;
}
.plus1.light { color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.15); }
@keyframes plus1 { 0% { transform: translate(-50%, 0) scale(.5); opacity: 0; } 12% { transform: translate(-50%, -6px) scale(1); opacity: 1; } 60% { opacity: 1; } 100% { transform: translate(-50%, -46px) scale(1); opacity: 0; } }

.addcard {
  aspect-ratio: .74; border-radius: 26px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: color-mix(in srgb, var(--primary) 6%, transparent); border: 2px dashed color-mix(in srgb, var(--primary) 40%, transparent);
  text-align: center; padding: 14px;
}
.addcard .plus { width: 64px; height: 64px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 38px; line-height: 64px; margin-bottom: 8px; font-weight: 300; }
.addcard b { color: var(--primary); font-size: 16px; }
.addcard span { color: var(--text-2); font-size: 12px; }
.hint { text-align: center; color: var(--text-2); font-size: 12px; margin: 18px 0 0; }

/* ---------- 底部导航 ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--surface); box-shadow: 0 -1px 0 var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-row { max-width: 720px; margin: 0 auto; display: flex; height: var(--nav-h); }
.nav button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--text-2); font-size: 12px; }
.nav .ico { width: 56px; height: 30px; border-radius: 15px; display: grid; place-items: center; transition: background .2s; }
.nav svg { width: 22px; height: 22px; fill: currentColor; }
.nav button.on { color: var(--text); font-weight: 600; }
.nav button.on .ico { background: color-mix(in srgb, var(--primary) 16%, transparent); color: var(--primary); }

/* ---------- 通用卡片 ---------- */
.box { background: var(--surface); border-radius: 24px; padding: 16px; margin-bottom: 14px; }
.row { display: flex; align-items: center; gap: 12px; }
.muted { color: var(--text-2); font-size: 12px; }
.grow { flex: 1; min-width: 0; }
.btn { padding: 11px 18px; border-radius: 14px; background: var(--primary); color: var(--on-primary); font-weight: 700; }
.btn.ghost { background: var(--surface-2); color: var(--text); }
.btn.danger { background: #FDECEC; color: #D63A3A; }
:root[data-theme="dark"] .btn.danger { background: #3A2226; color: #FF8C8C; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.danger { background: #3A2226; color: #FF8C8C; } }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; }
.pill { padding: 4px 12px; border-radius: 999px; font-size: 13px; background: var(--surface-2); color: var(--text-2); }
.pill.on { background: var(--primary); color: #fff; }

/* ---------- 日历 ---------- */
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.fchip { flex: none; display: flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 500; }
.fchip img { width: 22px; height: 22px; }
.fchip.on { background: var(--fc, var(--primary)); color: #fff; }
.cal-head { display: flex; align-items: center; }
.cal-head b { flex: 1; text-align: center; font-size: 18px; cursor: pointer; }
.arrow { width: 40px; height: 40px; border-radius: 50%; font-size: 22px; display: grid; place-items: center; }
.arrow:disabled { opacity: .25; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 12px; color: var(--text-2); margin: 4px 0 6px; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day {
  aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center; position: relative; font-size: 14px;
  max-height: 60px; width: 100%; justify-self: center;
}
.day.today { box-shadow: inset 0 0 0 2px var(--ac); font-weight: 700; }
.day.sel { box-shadow: inset 0 0 0 2px var(--text); }
.day.full { color: #fff; font-weight: 700; }
.day.future { color: color-mix(in srgb, var(--text-2) 40%, transparent); cursor: default; }
.day .star { position: absolute; top: 1px; right: 5px; font-size: 8px; }
.legend { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 11px; color: var(--text-2); }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.detail-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.ico-sq { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.ico-sq img { width: 36px; height: 36px; }
.toggle { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 2px var(--tc); color: #fff; font-weight: 900; flex: none; }
.toggle.on { background: var(--tc); }
.stepper { display: flex; align-items: center; gap: 2px; }
.stepper button { width: 36px; height: 36px; border-radius: 50%; font-size: 20px; color: var(--text-2); }
.stepper button:disabled { opacity: .3; }
.stepper b { width: 24px; text-align: center; }

/* ---------- 统计 ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { border-radius: 22px; padding: 16px; background: color-mix(in srgb, var(--tc) 12%, transparent); }
.tile .lab { font-size: 13px; color: var(--text-2); }
.tile .val { font-size: 30px; font-weight: 900; color: var(--tc); }
.tile .val small { font-size: 14px; font-weight: 500; }
.bars { display: flex; align-items: flex-end; height: 140px; gap: 4px; margin-top: 12px; }
.bars .b { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.bars .b i { display: block; background: var(--primary); opacity: .75; border-radius: 6px; transition: height .6s cubic-bezier(.34, 1.3, .64, 1); }
.bars .b.last i { opacity: 1; }
.bars.n7 { gap: 14px; padding: 0 6px; }
.bar-labels { display: flex; gap: 4px; margin-top: 4px; font-size: 10px; line-height: 12px; color: var(--text-2); text-align: center; }
.bars.n7 + .bar-labels { gap: 14px; padding: 0 6px; }
.bar-labels span { flex: 1; white-space: pre; overflow: visible; }
.mini { display: flex; margin-top: 12px; }
.mini > div { flex: 1; }
.mini b { display: block; font-size: 16px; }
.mini span { font-size: 11px; color: var(--text-2); }
.rate { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; font-weight: 700; color: var(--tc); }
.rate .prog-bar { flex: 1; height: 8px; --c: var(--tc); }
.heat { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; margin-top: 12px; }
.heat i { aspect-ratio: 1; border-radius: 3px; background: var(--surface-2); max-height: 14px; }
.heat i.half { background: color-mix(in srgb, var(--tc) 40%, transparent); }
.heat i.full { background: var(--tc); }
.heat i.none { background: transparent; }

/* ---------- 家庭 ---------- */
.fam { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.fam + .fam { border-top: 1px solid var(--line); }
.fam-face { width: 52px; height: 52px; border-radius: 50%; background: var(--surface-2); flex: none; }
.fam-name { font-weight: 700; font-size: 16px; }
.mini-ring { width: 44px; height: 44px; position: relative; flex: none; }
.mini-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.mini-ring circle { fill: none; stroke-width: 5; }
.mini-ring .track { stroke: var(--surface-2); }
.mini-ring .bar { stroke: var(--primary); stroke-linecap: round; }
.mini-ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.fam-acts { display: flex; gap: 4px; }
.iconbtn { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); background: var(--surface-2); font-size: 14px; }
.iconbtn:disabled { opacity: .3; }
.section-title { font-weight: 700; font-size: 18px; margin: 18px 0 10px; }

/* ---------- 弹窗 ---------- */
.sheet-bg {
  position: fixed; inset: 0; z-index: 50; background: rgba(20, 16, 24, .42);
  display: flex; align-items: flex-end; justify-content: center; animation: fadeIn .2s;
}
@media (min-width: 600px) { .sheet-bg { align-items: center; } .sheet { border-radius: 28px !important; } }
.sheet {
  width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; background: var(--surface);
  border-radius: 28px 28px 0 0; padding: 22px 20px calc(20px + env(safe-area-inset-bottom));
  animation: slideUp .32s cubic-bezier(.2, .9, .3, 1.1);
}
.sheet h2 { margin: 0 0 4px; font-size: 22px; }
.sheet .sub { color: var(--text-2); font-size: 13px; margin-bottom: 14px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes slideUp { from { transform: translateY(60%); opacity: .4; } }
.chars { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.char { border-radius: 24px; padding: 12px; background: var(--surface-2); text-align: center; font-weight: 700; transform: scale(.94); transition: transform .3s cubic-bezier(.34, 1.8, .64, 1); }
.char img { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; }
.char.on { background: #FFE7DC; box-shadow: inset 0 0 0 2.5px var(--primary); transform: scale(1); color: #2D2A32; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.input { width: 100%; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface-2); outline: none; font-size: 16px; -webkit-user-select: text; user-select: text; }
.input:focus { border-color: var(--primary); }
.tpls { display: flex; flex-wrap: wrap; gap: 8px; }
.tpl { display: flex; align-items: center; gap: 4px; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--surface-2); font-size: 13px; }
.tpl img { width: 26px; height: 26px; }
.icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; }
.icons button { aspect-ratio: 1; border-radius: 16px; background: var(--surface-2); display: grid; place-items: center; }
.icons button img { width: 86%; }
.icons button.on { box-shadow: inset 0 0 0 2.5px var(--ec); background: color-mix(in srgb, var(--ec) 14%, transparent); }
.colors { display: flex; flex-wrap: wrap; gap: 10px; }
.colors button { width: 34px; height: 34px; border-radius: 50%; background: var(--sc); }
.colors button.on { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5.5px var(--sc); }
.preview { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.preview .disc { width: 72px; height: 72px; background: color-mix(in srgb, var(--ec) 14%, transparent); margin: 0; }
.preview .disc img { transform: none; }
.actions { display: flex; gap: 10px; margin-top: 18px; }
.actions .btn { flex: 1; }
.menu-list button { display: flex; width: 100%; padding: 14px 6px; gap: 12px; font-size: 16px; border-top: 1px solid var(--line); text-align: left; }
.menu-list button:first-child { border-top: 0; }
.menu-list button.red { color: #E04848; }
.menu-list button:disabled { opacity: .35; }

/* ---------- 登录 / 欢迎 ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 380px; text-align: center; }
.login-card .logo { width: 88px; height: 88px; border-radius: 24px; box-shadow: 0 10px 30px rgba(255, 107, 74, .3); }
.login-card h1 { margin: 16px 0 4px; font-size: 26px; }
.login-card p { color: var(--text-2); margin: 0 0 22px; font-size: 14px; }
.login-card form { text-align: left; }
.login-card .btn { width: 100%; padding: 14px; font-size: 16px; margin-top: 4px; }
.err { color: #E04848; font-size: 13px; min-height: 20px; margin-top: 8px; text-align: center; }
.welcome-faces { display: flex; justify-content: center; margin: 4px 0 8px; }
.welcome-faces img { width: 64px; height: 64px; border-radius: 50%; background: var(--surface); margin: 0 -6px; box-shadow: 0 0 0 3px var(--bg); }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

/* ---------- 提示 / 彩带 ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 60;
  transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px);
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 16px;
  background: #322F37; color: #F4EFF4; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.25);
  animation: toastIn .3s cubic-bezier(.34, 1.5, .64, 1);
}
@keyframes toastIn { from { transform: translate(-50%, 30px); opacity: 0; } }
.toast-act { color: #FFB59E; font-weight: 700; flex: none; }
#confetti { position: fixed; inset: 0; z-index: 70; pointer-events: none; width: 100vw; height: 100vh; }
.celebrate {
  position: fixed; left: 50%; top: 50%; z-index: 71; pointer-events: none; transform: translate(-50%, -50%);
  background: #fff; color: #2D3142; border-radius: 28px; padding: 20px 28px; text-align: center;
  width: max-content; animation: celeb 2.2s linear forwards; box-shadow: 0 20px 50px rgba(0,0,0,.2);
}
.celebrate img { width: 110px; height: 110px; display: block; margin: 0 auto; }
.celebrate b { display: block; font-size: 22px; font-weight: 900; }
.celebrate span { font-size: 14px; color: #6F6670; }
@keyframes celeb { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.8); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(.95); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- AI 专属形象 ---------- */
.disc { position: relative; }
.disc.gen img { opacity: .35; filter: grayscale(.5); }
.disc.gen-busy::after {
  content: "✨"; position: absolute; inset: 8%; border-radius: 50%; display: grid; place-items: center; font-size: 26px;
  border: 3px dashed color-mix(in srgb, var(--c) 55%, transparent); animation: genSpin 3s linear infinite;
}
@keyframes genSpin { to { rotate: 360deg; } }
.icons button { position: relative; }
.icons .ai-pick { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; background: linear-gradient(135deg, #FFE7C2, #FFD3E0); color: #8A3B2B; }
.icons .ai-pick span { font-size: 22px; line-height: 1; }
.icons .ai-pick small { font-size: 10px; font-weight: 700; }
.icons .ai-pick.on { box-shadow: inset 0 0 0 2.5px var(--ec); }
.ai-tag { position: absolute; right: 3px; top: 3px; font-style: normal; font-size: 9px; font-weight: 800; color: #fff; background: #F06BA8; border-radius: 6px; padding: 0 4px; }
.ai-box { margin-top: 10px; padding: 12px; border-radius: 16px; background: color-mix(in srgb, var(--ec) 10%, transparent); display: grid; gap: 6px; }
.ai-box b { font-size: 14px; }
.ai-big { font-size: 34px; }
textarea.input { resize: vertical; font-size: 15px; line-height: 1.4; }
