/* 回家灯 · 「布贴 + 暖釉」UI：奶油色布面卡片、虚线缝线、柿子橙主按钮 */
:root {
  --cream: #FFF7EA;
  --paper: #FFFCF5;
  --lip: #E8C79C;
  --lip-dark: #D2A877;
  --cocoa: #4A2E1F;
  --cocoa-2: #7A5038;
  --cocoa-3: #A07D63;
  --persimmon: #F07A3A;
  --persimmon-lip: #C2541C;
  --lantern: #E8513A;
  --gold: #F2C14E;
  --leaf: #6FAE58;
  --stitch: rgba(184, 122, 75, .42);
  --dad: #4E9C9A; --mom: #EC8597; --kid: #F0983B; --grand: #9483C4;
  --shadow: 0 10px 26px rgba(92, 52, 22, .18);
  --font: "PingFang SC", "HarmonyOS Sans SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-cute: "ZCOOL KuaiLe", "PingFang SC", "Noto Sans SC", sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #FBE3C6; color: var(--cocoa); font-family: var(--font); font-size: 18px; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
#app { position: fixed; inset: 0; overflow: hidden; overflow: clip; }
#stage, #stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.labels { position: absolute; inset: 0; pointer-events: none; }
.vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(120, 70, 30, .16) 100%); transition: background 1.2s; }
body.night .vignette { background: radial-gradient(120% 90% at 50% 45%, transparent 50%, rgba(10, 8, 40, .38) 100%); }

/* ---------- 布贴卡片 ---------- */
.card {
  position: relative; background: var(--paper); border-radius: 24px;
  box-shadow: 0 4px 0 var(--lip), var(--shadow);
  border: 2.5px solid #fff;
}
.card::after { content: ""; position: absolute; inset: 5px; border-radius: 19px; border: 2px dashed var(--stitch); pointer-events: none; }
.card:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--lip), var(--shadow); }

/* ---------- 顶栏 ---------- */
.top { position: absolute; left: 0; right: 0; top: calc(12px + var(--safe-t)); padding: 0 14px; display: flex; gap: 10px; justify-content: space-between; align-items: stretch; pointer-events: none; max-width: 520px; margin: 0 auto; }
.top > * { pointer-events: auto; }
.family { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 9px 16px 9px 10px; min-height: 64px; text-align: left; }
.fam-lamp { width: 46px; height: 46px; border-radius: 50%; background: #FFF0DA; display: grid; place-items: center; box-shadow: inset 0 -3px 0 rgba(226, 180, 120, .45); }
.fam-lamp svg { width: 36px; height: 36px; filter: drop-shadow(0 0 0 rgba(255, 170, 80, 0)); transition: filter .6s; }
body.night .fam-lamp svg, .fam-lamp.pulse svg { filter: drop-shadow(0 0 7px rgba(255, 150, 60, .9)); }
.fam-txt { min-width: 0; }
.fam-txt b { display: block; font-family: var(--font-cute); font-weight: 400; font-size: 24px; line-height: 1.1; letter-spacing: 1px; }
.fam-txt small { display: flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 700; color: var(--cocoa-2); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #7CC860; box-shadow: 0 0 0 3px rgba(124, 200, 96, .25); }

.clock { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 9px; min-height: 64px; }
.dial { width: 46px; height: 46px; border-radius: 50%; overflow: hidden; position: relative; background: linear-gradient(#8FD0F0, #FFE7C2); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .08); transition: background 1s; }
body.night .dial { background: linear-gradient(#1D2554, #5A4A86); }
.disc { position: absolute; inset: 0; transition: transform 1.2s cubic-bezier(.6, -0.3, .3, 1.3); }
body.night .disc { transform: rotate(180deg); }
.disc i { position: absolute; left: 50%; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%; }
.disc .sun { top: 7px; background: radial-gradient(circle at 40% 40%, #FFE48A, #FFB13B); box-shadow: 0 0 10px #FFC85A; }
.disc .moon { bottom: 7px; transform: rotate(180deg); background: #FFF1C2; box-shadow: inset -6px -2px 0 #E8D38D, 0 0 10px rgba(255, 240, 190, .8); }
.clock-txt { text-align: left; line-height: 1.1; }
.clock-txt small { display: block; font-size: 15px; font-weight: 800; color: var(--cocoa-2); }
.clock-txt b { font-size: 25px; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: .5px; }

.hint { position: absolute; top: calc(92px + var(--safe-t)); left: 50%; transform: translateX(-50%); padding: 8px 16px; border-radius: 99px; background: rgba(74, 46, 31, .62); color: #fff; font-size: 16px; font-weight: 700; white-space: nowrap; pointer-events: none; transition: opacity .8s, transform .8s; backdrop-filter: blur(6px); }
.hint.hide { opacity: 0; transform: translate(-50%, -8px); }

/* ---------- 底部操作栏 ---------- */
.dock { position: absolute; left: 12px; right: 12px; bottom: calc(14px + var(--safe-b)); display: grid; grid-template-columns: 1.55fr 1fr 1fr 1fr; gap: 8px; max-width: 520px; margin: 0 auto; padding: 9px; border-radius: 30px; background: rgba(255, 249, 238, .9); box-shadow: 0 4px 0 var(--lip), var(--shadow); border: 2.5px solid #fff; backdrop-filter: blur(8px); transition: transform .45s cubic-bezier(.3, 1.4, .5, 1), opacity .3s; }
.dock::after { content: ""; position: absolute; inset: 5px; border-radius: 25px; border: 2px dashed var(--stitch); pointer-events: none; }
.dock.away { transform: translateY(140%); opacity: 0; }
.dock-btn, .dock-main { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 74px; border-radius: 22px; font-weight: 800; font-size: 17px; transition: transform .15s; }
.dock-btn .ico { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 16px; background: #FFF0DC; box-shadow: inset 0 -3px 0 rgba(222, 180, 125, .45); }
.dock-btn .ico svg { width: 34px; height: 34px; }
.dock-btn:active, .dock-main:active { transform: scale(.94); }
.dock-main { flex-direction: row; gap: 8px; background: linear-gradient(#FF9A5C, var(--persimmon)); color: #fff; box-shadow: 0 5px 0 var(--persimmon-lip), inset 0 2px 0 rgba(255, 255, 255, .35); font-size: 21px; letter-spacing: 1px; text-shadow: 0 2px 0 rgba(160, 60, 10, .35); margin-bottom: 5px; }
.dock-main .ico svg { width: 36px; height: 36px; filter: drop-shadow(0 2px 0 rgba(160, 60, 10, .3)); animation: beat 2.4s ease-in-out infinite; }
@keyframes beat { 0%, 70%, 100% { transform: scale(1); } 78% { transform: scale(1.16); } 86% { transform: scale(.96); } }
.badge { position: absolute; top: 2px; right: 10%; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; background: var(--lantern); color: #fff; font-size: 15px; font-weight: 900; display: grid; place-items: center; border: 2px solid #fff; }
.badge:empty { display: none; }
#stealthBtn[aria-pressed="true"] { background: #EEE7FB; box-shadow: inset 0 0 0 2.5px #B49ADB; }
#stealthBtn[aria-pressed="true"] .lbl { color: #6E59A8; }

/* ---------- 3D 标签：门牌芯片 & 气泡 ---------- */
/* 名字标签：小一号，挂在门边状态牌上方；镜头拉近时（--k）淡出、缩小 */
.chip-wrap { pointer-events: none; padding-bottom: 4px; }
.chip-wrap.faded .chip { pointer-events: none; }
.chip { pointer-events: auto; cursor: pointer; position: relative; display: flex; align-items: center; gap: 5px; padding: 2px 9px 2px 2px; border-radius: 99px; background: rgba(255, 252, 245, .9); box-shadow: 0 2px 0 var(--lip), 0 3px 8px rgba(80, 40, 10, .14); border: 1.5px solid #fff; white-space: nowrap; transform-origin: 50% 100%; transform: translateY(var(--dy, 0px)) scale(var(--s, 1)); opacity: var(--k, 1); transition: opacity .3s; }
body.sheet-open .chip, body.perform .chip { opacity: 0 !important; pointer-events: none; }
.chip:active { transform: translateY(var(--dy, 0px)) scale(calc(var(--s, 1) * .95)); }
.chip img { width: 24px; height: 24px; border-radius: 50%; background: var(--c, #eee); border: 1.5px solid #fff; object-fit: cover; }
.chip b { font-weight: 900; font-size: 14px; line-height: 1; }
.chip small { display: flex; align-items: center; gap: 3px; font-size: 13.5px; font-weight: 800; color: var(--cocoa-2); line-height: 1; }
.chip small::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #C9BBAA; flex: none; }
.chip.home small::before { background: #FFB03B; box-shadow: 0 0 6px #FFB03B; }
.chip.nap small::before { background: #B49ADB; }
.chip.online::before { content: ""; position: absolute; left: 18px; top: -1px; width: 8px; height: 8px; border-radius: 50%; background: #7CC860; border: 1.5px solid #fff; }
.chip.me::after { content: "我"; position: absolute; top: -9px; right: -6px; background: var(--persimmon); color: #fff; font-size: 11px; font-weight: 900; border-radius: 7px; padding: 0 5px; border: 1.5px solid #fff; }

.bubble { pointer-events: none; position: relative; padding: 8px 14px; border-radius: 18px; background: #fff; color: var(--cocoa); font-weight: 800; font-size: 17px; white-space: nowrap; box-shadow: 0 4px 12px rgba(80, 40, 10, .22); transform-origin: 50% 100%; animation: pop .35s cubic-bezier(.3, 1.6, .5, 1); }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -8px; margin-left: -8px; border: 8px solid transparent; border-top-color: #fff; border-bottom: 0; }
.bubble.out { animation: popout .25s forwards; }
@keyframes pop { from { transform: scale(.2); opacity: 0; } }
@keyframes popout { to { transform: scale(.5); opacity: 0; } }
.tag { pointer-events: none; padding: 3px 10px; border-radius: 10px; background: rgba(255, 245, 225, .95); border: 2px solid #F2C14E; font-size: 14px; font-weight: 800; color: var(--cocoa-2); white-space: nowrap; animation: pop .4s, bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-4px); } }

/* ---------- 底部面板 ---------- */
.scrim { position: absolute; inset: 0; background: rgba(60, 30, 10, .12); opacity: 0; pointer-events: none; transition: opacity .35s; }
.scrim.on { opacity: 1; pointer-events: auto; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; max-height: 66vh; display: flex; flex-direction: column; background: var(--cream); border-radius: 30px 30px 0 0; box-shadow: 0 -10px 30px rgba(80, 40, 10, .22); border: 3px solid #fff; border-bottom: 0; transform: translateY(calc(100% + 40px)); transition: transform .5s cubic-bezier(.25, 1.25, .45, 1); padding-bottom: var(--safe-b); }
.sheet::before { content: ""; position: absolute; inset: 6px 6px 0; border-radius: 25px 25px 0 0; border: 2px dashed var(--stitch); border-bottom: 0; pointer-events: none; }
.sheet.on { transform: translateY(0); }
.grab { width: 54px; height: 6px; border-radius: 3px; background: #E3C9A6; margin: 12px auto 4px; flex: none; }
.sheet-body { overflow-y: auto; padding: 6px 18px 22px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }

.sh-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; }
.sh-title { flex: 1; min-width: 0; }
.sh-title h2 { margin: 0; font-size: 25px; font-weight: 900; line-height: 1.2; }
.sh-title h2 em { font-style: normal; color: var(--persimmon); }
.sh-title p .pill { margin-right: 4px; }
.sh-title p { margin: 4px 0 0; font-size: 17px; font-weight: 600; color: var(--cocoa-2); line-height: 1.4; }
.x { flex: none; width: 48px; height: 48px; border-radius: 50%; background: #F6E6CF; font-size: 22px; font-weight: 900; color: var(--cocoa-2); box-shadow: inset 0 -3px 0 rgba(200, 160, 110, .4); }
.ava { width: 52px; height: 52px; border-radius: 50%; background: var(--c, #F3E3CC); border: 3px solid #fff; box-shadow: 0 3px 0 var(--lip); object-fit: cover; flex: none; }
.ava.lg { width: 60px; height: 60px; }
.big-emo { width: 62px; height: 62px; flex: none; display: grid; place-items: center; font-size: 36px; border-radius: 50%; background: #FFEBD2; box-shadow: 0 3px 0 var(--lip); border: 3px solid #fff; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 99px; font-size: 15px; font-weight: 800; background: #F1E3CF; color: var(--cocoa-2); vertical-align: 1px; }
.pill.home { background: #FFF0C7; color: #9A6200; }
.pill.home::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #FFB03B; box-shadow: 0 0 6px #FFB03B; }
.pill.nap { background: #ECE5FA; color: #6E59A8; }

.targets { display: flex; gap: 10px; margin: 0 -18px 14px; padding: 2px 18px 6px; overflow-x: auto; scrollbar-width: none; }
.tgt { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 8px 4px; border-radius: 18px; font-size: 16px; font-weight: 800; min-width: 72px; color: var(--cocoa-2); }
.tgt img { width: 46px; height: 46px; border-radius: 50%; background: var(--c); border: 3px solid #fff; box-shadow: 0 3px 0 var(--lip); }
.tgt.on { background: #FFE9D3; color: var(--cocoa); box-shadow: inset 0 0 0 2.5px var(--persimmon); }
.tgt.away img { filter: saturate(.7) brightness(.97); }
.tgt { position: relative; }
.tgt.online::after { content: ""; position: absolute; top: 6px; right: 14px; width: 12px; height: 12px; border-radius: 50%; background: #7CC860; border: 2px solid #fff; }

.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; background: #F3E2C9; border-radius: 22px; padding: 6px; margin-bottom: 14px; }
.tier { border-radius: 17px; padding: 8px 4px; min-height: 62px; line-height: 1.2; transition: background .2s, transform .2s; }
.tier b { display: block; font-size: 20px; font-weight: 900; }
.tier small { font-size: 14.5px; font-weight: 700; color: var(--cocoa-2); }
.tier.on { background: #fff; box-shadow: 0 3px 0 var(--lip); transform: translateY(-1px); }
.tier.on b { color: var(--persimmon); }

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.act-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 2px; padding: 12px 14px 12px; border-radius: 22px; background: #fff; box-shadow: 0 4px 0 var(--lip); border: 2px solid #fff; min-height: 104px; transition: transform .12s; }
.act-card:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--lip); }
.act-card .emo { font-size: 34px; line-height: 1; margin-bottom: 4px; filter: drop-shadow(0 3px 0 rgba(200, 150, 90, .25)); }
.act-card b { font-size: 19px; font-weight: 900; }
.act-card small { display: block; font-size: 16px; font-weight: 600; color: var(--cocoa-2); line-height: 1.35; }
.act-card.wide { grid-column: span 2; flex-direction: row; align-items: center; gap: 12px; min-height: 84px; }
.act-card.wide .emo { margin: 0; }

.note-edit { position: relative; background: #FFE27A; border-radius: 6px 6px 22px 6px; padding: 18px 18px 14px; box-shadow: 0 6px 0 rgba(210, 170, 60, .5), 0 10px 20px rgba(120, 80, 0, .12); transform: rotate(-1.2deg); margin: 4px 4px 14px; }
.note-edit::before { content: ""; position: absolute; top: -9px; left: 50%; width: 90px; height: 22px; margin-left: -45px; background: rgba(255, 255, 255, .65); transform: rotate(2deg); border-radius: 3px; }
.note-edit textarea { width: 100%; border: 0; background: transparent; resize: none; font: 900 26px/1.35 var(--font); color: var(--cocoa); outline: none; height: 74px; }
.note-edit .meta { display: flex; justify-content: space-between; font-size: 15px; font-weight: 700; color: #8A6A1E; }
.note-edit.voice textarea { display: none; }
.voice-wave { display: none; align-items: center; gap: 5px; height: 74px; font-weight: 900; font-size: 20px; }
.note-edit.voice .voice-wave { display: flex; }
.voice-wave i { width: 6px; border-radius: 3px; background: var(--cocoa-2); animation: wave .9s ease-in-out infinite; }
@keyframes wave { 50% { transform: scaleY(.35); } }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.q { min-height: 48px; padding: 10px 15px; border-radius: 99px; background: #fff; box-shadow: 0 3px 0 var(--lip); font-size: 17px; font-weight: 800; }
.q:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip); }
.row { display: flex; gap: 10px; }
.btn { flex: 1; min-height: 60px; border-radius: 20px; font-size: 19px; font-weight: 900; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 16px; }
.btn.primary { background: linear-gradient(#FF9A5C, var(--persimmon)); color: #fff; box-shadow: 0 5px 0 var(--persimmon-lip); text-shadow: 0 2px 0 rgba(160, 60, 10, .3); }
.btn.ghost { background: #fff; box-shadow: 0 4px 0 var(--lip); }
.btn.rec { background: #FFE4E0; box-shadow: inset 0 0 0 3px var(--lantern); color: var(--lantern); }
.btn:active { transform: translateY(3px); }
.btn.sm { flex: none; min-height: 56px; font-size: 17px; border-radius: 16px; padding: 0 14px; }

.proxy { margin-top: 18px; padding: 14px; border-radius: 24px; background: #FBEBD5; border: 2px dashed var(--stitch); }
.proxy h3 { margin: 0 0 10px; font-size: 20px; font-weight: 900; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.proxy h3 small { font-size: 15px; font-weight: 700; color: var(--cocoa-2); }
.proxy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.proxy-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 84px; padding: 10px 2px 9px; border-radius: 18px; background: #fff; box-shadow: 0 4px 0 var(--lip); font-size: 18px; font-weight: 900; }
.proxy-btn .emo { font-size: 30px; line-height: 1.1; }
.proxy-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--lip); }

h3.sec { font-size: 19px; font-weight: 900; margin: 18px 2px 10px; color: var(--cocoa-2); }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 22px; background: #fff; box-shadow: 0 4px 0 var(--lip); }
.li .txt { flex: 1; min-width: 0; }
.li .txt p { margin: 0; font-size: 18px; line-height: 1.4; }
.li .txt .sub { font-size: 16px; font-weight: 700; color: var(--cocoa-3); }
.li .txt b { font-weight: 900; }
.li.done { opacity: .7; }
.lamp-ind { width: 30px; height: 30px; border-radius: 50%; background: #E6DED3; flex: none; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .06); }
.lamp-ind.on { background: radial-gradient(circle at 40% 35%, #FFF2B8, #FFB03B); box-shadow: 0 0 14px rgba(255, 176, 59, .9); }
.check { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #E3C9A6; flex: none; display: grid; place-items: center; font-weight: 900; color: #fff; }
.check.on { background: var(--leaf); border-color: var(--leaf); }

.tree-card { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 24px; background: linear-gradient(135deg, #EAF6D8, #FFF3DC); box-shadow: 0 4px 0 #CFE0B0; }
.tree-card .lv { font-family: var(--font-cute); font-size: 40px; line-height: 1; color: #4F8A3A; }
.tree-card p { margin: 0; font-size: 16.5px; font-weight: 700; color: var(--cocoa-2); line-height: 1.45; }
.bar { height: 14px; border-radius: 7px; background: rgba(79, 138, 58, .15); overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; border-radius: 7px; background: linear-gradient(90deg, #F5A65B, #F5822F); transition: width .8s cubic-bezier(.3, 1.4, .5, 1); }

.switch-row { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 24px; background: #fff; box-shadow: 0 4px 0 var(--lip); }
.switch-row .txt { flex: 1; }
.switch-row .txt b { font-size: 20px; font-weight: 900; }
.switch-row .txt p { margin: 4px 0 0; font-size: 16px; font-weight: 600; color: var(--cocoa-2); line-height: 1.45; }
.switch { flex: none; width: 76px; height: 44px; border-radius: 22px; background: #E3D6C6; position: relative; transition: background .25s; }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 36px; height: 36px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); transition: transform .3s cubic-bezier(.3, 1.5, .5, 1); }
.switch.on { background: #A58FD8; }
.switch.on::after { transform: translateX(32px); }
.note-tip { margin: 14px 4px 0; font-size: 16px; font-weight: 600; color: var(--cocoa-3); line-height: 1.5; }

/* ---------- Toast ---------- */
.toast { position: absolute; left: 50%; top: calc(92px + var(--safe-t)); transform: translate(-50%, -20px) scale(.9); opacity: 0; width: min(92vw, 470px); display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 12px; border-radius: 22px; background: var(--paper); box-shadow: 0 4px 0 var(--lip), var(--shadow); border: 2.5px solid #fff; pointer-events: none; transition: transform .45s cubic-bezier(.3, 1.5, .5, 1), opacity .3s; z-index: 5; }
.toast.on { opacity: 1; transform: translate(-50%, 0) scale(1); }
.toast img, .toast .temo { width: 48px; height: 48px; border-radius: 50%; flex: none; background: var(--c, #FFEBD2); border: 2px solid #fff; display: grid; place-items: center; font-size: 28px; }
.toast p { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.4; }
.toast p small { display: block; font-size: 15px; font-weight: 600; color: var(--cocoa-2); }

/* ---------- 加载 ---------- */
#loader { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 42%, #FFF8EA 0%, #FBE7CB 70%, #F4D6B0 100%); transition: opacity .9s, visibility .9s; }
#loader.done { opacity: 0; visibility: hidden; }
.ld-lantern { position: relative; width: 120px; height: 96px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #FF8A5C, #E8513A 60%, #B8301F); display: grid; place-items: center; box-shadow: 0 0 0 rgba(255, 140, 60, 0); animation: glow 2.2s ease-in-out infinite; margin-bottom: 34px; }
.ld-lantern::before { content: ""; position: absolute; inset: 0 32px; border-left: 2px solid rgba(120, 20, 10, .35); border-right: 2px solid rgba(120, 20, 10, .35); border-radius: 50%; }
.ld-lantern span { font-family: var(--font-cute); font-size: 50px; color: #FFD86A; text-shadow: 0 0 12px rgba(255, 220, 120, .8); position: relative; }
.ld-lantern .cap { position: absolute; top: -10px; left: 34px; right: 34px; height: 16px; border-radius: 6px; background: var(--gold); }
.ld-lantern .cap.b { top: auto; bottom: -10px; }
.ld-lantern .tassel { position: absolute; bottom: -38px; left: 50%; width: 8px; height: 28px; margin-left: -4px; border-radius: 4px; background: #D93A2B; }
.ld-lantern::after { content: ""; position: absolute; top: -34px; left: 50%; width: 4px; height: 24px; margin-left: -2px; background: #7E5236; border-radius: 2px; }
@keyframes glow { 50% { box-shadow: 0 0 60px 14px rgba(255, 150, 70, .55); transform: rotate(2deg); } 0%, 100% { transform: rotate(-2deg); } }
#loader h1 { margin: 0; font-family: var(--font-cute); font-weight: 400; font-size: 54px; letter-spacing: 6px; color: var(--cocoa); }
.slogan { margin: 10px 0 30px; font-size: 18px; font-weight: 700; color: var(--cocoa-2); }
.ld-houses { display: flex; gap: 16px; margin-bottom: 18px; }
.ld-houses i { position: relative; width: 34px; height: 28px; background: #F1DFC4; border-radius: 6px 6px 8px 8px; margin-top: 12px; }
.ld-houses i::before { content: ""; position: absolute; left: -5px; right: -5px; top: -14px; height: 16px; background: #D9B48E; border-radius: 10px 10px 3px 3px; }
.ld-houses i::after { content: ""; position: absolute; left: 50%; top: 8px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: #CDBBA3; transition: background .4s, box-shadow .4s; }
.ld-houses i.on::after { background: #FFC24F; box-shadow: 0 0 12px 3px rgba(255, 180, 70, .85); }
.ld-houses i:nth-child(1)::before { background: #5BAAA4; } .ld-houses i:nth-child(2)::before { background: #F29AA9; } .ld-houses i:nth-child(3)::before { background: #F5A957; } .ld-houses i:nth-child(4)::before { background: #A592D2; }
.ld-txt { margin: 0; font-size: 17px; font-weight: 800; color: var(--cocoa-2); }

@media (min-width: 700px) {
  .sheet { bottom: 18px; border-radius: 30px; border-bottom: 3px solid #fff; }
  .sheet::before { border-radius: 25px; border-bottom: 2px dashed var(--stitch); bottom: 6px; }
}

/* ================================================================== */
/* V1 新增                                                              */
/* ================================================================== */
.inp { width: 100%; min-height: 56px; padding: 0 16px; border-radius: 18px; border: 2.5px solid #EBD3B2; background: #fff; font: 700 19px var(--font); color: var(--cocoa); outline: none; box-shadow: inset 0 2px 0 rgba(200, 160, 110, .15); }
.inp:focus { border-color: var(--persimmon); }
.inp.code { text-transform: uppercase; letter-spacing: 6px; font-size: 24px; font-weight: 900; text-align: center; }
.btn[disabled] { opacity: .6; }
.btn.big { width: 100%; min-height: 60px; font-size: 20px; flex: none; }
h3.sec .sec-sub { font-size: 15px; font-weight: 700; color: var(--cocoa-3); margin-left: 6px; }

.status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.st-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 76px; border-radius: 18px; background: #fff; box-shadow: 0 4px 0 var(--lip); font-size: 18px; font-weight: 900; }
.st-btn .emo { font-size: 26px; line-height: 1.1; }
.st-btn.on { background: #FFF0C7; box-shadow: 0 4px 0 #E8B860, inset 0 0 0 2.5px #F2C14E; }
.st-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--lip); }
.custom-row { margin-top: 10px; }
.switch-row + .switch-row, .status-grid + .switch-row, .custom-row + .switch-row { margin-top: 12px; }
.places { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.place { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 20px; background: #fff; box-shadow: 0 3px 0 var(--lip); }
.place .emo { font-size: 26px; width: 40px; text-align: center; }
.place .txt { flex: 1; min-width: 0; }
.place .txt b { display: block; font-size: 18px; }
.place .txt small { font-size: 15px; font-weight: 700; color: var(--cocoa-3); }
.seg-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding: 12px 14px; border-radius: 24px; background: #fff; box-shadow: 0 4px 0 var(--lip); }
.seg-row b { font-size: 19px; }
.seg { display: inline-flex; background: #F3E2C9; border-radius: 16px; padding: 4px; gap: 4px; }
.seg button { min-height: 48px; padding: 0 14px; border-radius: 13px; font-size: 17px; font-weight: 800; color: var(--cocoa-2); }
.seg button.on { background: #fff; color: var(--persimmon); box-shadow: 0 2px 0 var(--lip); }
.seg.big { display: flex; margin-bottom: 14px; }
.seg.big button { flex: 1; min-height: 52px; font-size: 18px; }

.invite-card { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 24px; background: #fff; box-shadow: 0 4px 0 var(--lip); margin-bottom: 10px; }
.invite-card .qr { width: 140px; height: 140px; border-radius: 12px; flex: none; background: #FFFCF5; }
.code-box { flex: 1; text-align: center; }
.code-box small { display: block; font-size: 16px; font-weight: 800; color: var(--cocoa-2); }
.code-box b { display: block; font-size: 32px; font-weight: 900; letter-spacing: 4px; color: var(--persimmon); margin-top: 4px; word-break: break-all; }
.link-line { margin: 0 4px 12px; font-size: 15px; font-weight: 700; color: var(--cocoa-3); word-break: break-all; }

.levels { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.levels span { padding: 4px 10px; border-radius: 99px; background: #F1E3CF; font-size: 15px; font-weight: 800; color: var(--cocoa-3); }
.levels span.on { background: #E3F2CF; color: #4F8A3A; }
.coop-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.coop-btn { display: flex; align-items: center; gap: 8px; min-height: 64px; padding: 8px 12px; border-radius: 20px; background: #EAF6FB; box-shadow: 0 4px 0 #B9DCE8; font-size: 18px; font-weight: 900; color: #2E6F86; text-align: left; }
.coop-btn img { width: 42px; height: 42px; border-radius: 50%; background: #fff; border: 2px solid #fff; flex: none; }
.coop-btn[disabled] { opacity: .65; }
.li.new { box-shadow: 0 4px 0 var(--lip), inset 0 0 0 2.5px #F7B27A; }
.new-dot { display: inline-block; margin-right: 6px; padding: 0 7px; border-radius: 8px; background: var(--lantern); color: #fff; font-size: 14px; font-weight: 900; vertical-align: 2px; }
.sheet[data-kind="coop"] .sheet-body { padding-bottom: 28px; }

/* ---------- 进门（登录 / 建家庭） ---------- */
#gate { position: absolute; inset: 0; z-index: 30; overflow-y: auto; background: radial-gradient(circle at 50% 20%, #FFF8EA 0%, #FBE7CB 70%, #F4D6B0 100%); -webkit-overflow-scrolling: touch; }
#gate[hidden] { display: none; }
body.gating #loader { visibility: hidden; }
.gate-inner { max-width: 460px; margin: 0 auto; padding: calc(22px + var(--safe-t)) 18px calc(30px + var(--safe-b)); }
.gate-head { text-align: center; margin-bottom: 18px; }
.gate-head h1 { margin: 6px 0 0; font-family: var(--font-cute); font-weight: 400; font-size: 40px; letter-spacing: 4px; }
.gate-head .slogan { margin: 6px 0 0; }
.ld-lantern.sm { width: 84px; height: 68px; margin: 30px auto 26px; }
.ld-lantern.sm span { font-size: 36px; }
.ld-lantern.sm .cap { left: 24px; right: 24px; height: 12px; top: -8px; }
.ld-lantern.sm .cap.b { top: auto; bottom: -8px; }
.ld-lantern.sm .tassel { bottom: -30px; height: 22px; }
.gate-card { position: relative; background: var(--paper); border-radius: 28px; padding: 20px 18px; box-shadow: 0 5px 0 var(--lip), var(--shadow); border: 3px solid #fff; display: flex; flex-direction: column; gap: 14px; }
.gate-card::after { content: ""; position: absolute; inset: 6px; border-radius: 22px; border: 2px dashed var(--stitch); pointer-events: none; }
.gate-card > * { position: relative; z-index: 1; }
.fld { display: flex; flex-direction: column; gap: 8px; }
.fld > span { font-size: 18px; font-weight: 900; }
.gate-err { margin: 0; padding: 10px 14px; border-radius: 14px; background: #FFE4E0; color: #B8301F; font-weight: 800; font-size: 17px; }
.gate-banner { margin-bottom: 14px; padding: 14px 16px; border-radius: 20px; background: #FFF0C7; box-shadow: 0 4px 0 #E8C67A; font-size: 18px; font-weight: 800; }
.gate-banner small { display: block; font-size: 16px; color: var(--cocoa-2); margin-top: 2px; }
.choice { display: flex; align-items: center; gap: 14px; min-height: 84px; padding: 12px 16px; border-radius: 22px; background: #fff; box-shadow: 0 4px 0 var(--lip); text-align: left; }
.choice .emo { font-size: 38px; }
.choice b { display: block; font-size: 20px; font-weight: 900; }
.choice small { font-size: 16px; font-weight: 700; color: var(--cocoa-2); }
.choice:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--lip); }
.code-form { display: flex; flex-direction: column; gap: 12px; }
.pick4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pick { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 84px; border-radius: 18px; background: #fff; box-shadow: 0 4px 0 var(--lip); font-size: 17px; font-weight: 900; }
.pick .emo { font-size: 32px; line-height: 1.15; }
.pick.on { background: #FFE9D3; box-shadow: 0 4px 0 var(--persimmon-lip), inset 0 0 0 3px var(--persimmon); color: var(--persimmon-lip); }
.link-btn { min-height: 48px; font-size: 17px; font-weight: 800; color: var(--cocoa-2); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- 长辈模式：字更大、按钮更大 ---------- */
body.elder .sheet-body, body.elder .toast, body.elder .gate-inner { zoom: 1.16; }
body.elder .dock-btn, body.elder .dock-main { min-height: 82px; font-size: 19px; }
body.elder .dock-main { font-size: 23px; }
body.elder .chip b { font-size: 16px; } body.elder .chip small { font-size: 15px; }
body.elder .bubble { font-size: 20px; }
body.elder .fam-txt small, body.elder .clock-txt small { font-size: 17px; }
