/* 玩偶世界 · 组件样式（依赖 tokens.css） */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font-sans); font-size: var(--fs-md); line-height: var(--lh-md); color: var(--c-text); background: var(--c-bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
.muted { color: var(--c-text-2); }
.faint { color: var(--c-text-3); }
.small { font-size: var(--fs-sm); line-height: var(--lh-sm); }
.xs { font-size: var(--fs-xs); line-height: var(--lh-xs); }
.row { display: flex; align-items: center; gap: var(--sp-3); }
.col { display: flex; flex-direction: column; gap: var(--sp-3); }
.grow { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }
.hidden { display: none !important; }

/* ===== 布局：侧边栏 + 主内容 ===== */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; height: 100vh; }
.sidebar { background: var(--c-surface); border-right: 1px solid var(--c-border); padding: var(--sp-6) var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); }
.brand { display: flex; align-items: center; gap: var(--sp-2); font-weight: var(--fw-bold); font-size: var(--fs-xl); line-height: var(--lh-xl); padding: 0 var(--sp-3) var(--sp-6); }
.brand .logo { width: 36px; height: 36px; border-radius: var(--r-md); background: var(--c-primary); display: grid; place-items: center; color: #fff; font-size: 20px; }
.nav-item { position: relative; display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); color: var(--c-text-2); font-weight: var(--fw-medium); transition: background var(--dur-fast); }
.nav-item:hover { background: var(--c-surface-2); color: var(--c-text); }
.nav-item.active { background: var(--c-primary-50); color: var(--c-primary-600); }
.nav-item .ico { width: 22px; text-align: center; font-size: 18px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-danger); display: inline-block; }
.nav-item .dot { position: absolute; right: var(--sp-4); }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); background: var(--c-danger); color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-weight: var(--fw-bold); }
.sidebar .spacer { flex: 1; }
.sidebar .dev-link { font-size: var(--fs-xs); color: var(--c-text-3); padding: var(--sp-2) var(--sp-4); border: 1px dashed var(--c-border); border-radius: var(--r-md); text-align: center; }
.sidebar .dev-link:hover { color: var(--c-text-2); }

.main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.topbar { height: var(--header-h); flex: none; display: flex; align-items: center; gap: var(--sp-4); padding: 0 var(--sp-8); border-bottom: 1px solid var(--c-border); background: rgba(255,248,241,.9); backdrop-filter: blur(8px); }
.topbar h1 { font-size: var(--fs-xl); line-height: var(--lh-xl); font-weight: var(--fw-bold); }
.topbar .back { width: 36px; height: 36px; border-radius: var(--r-md); display: grid; place-items: center; font-size: 18px; }
.topbar .back:hover { background: var(--c-surface-2); }
.bell { position: relative; width: 40px; height: 40px; border-radius: var(--r-md); display: grid; place-items: center; font-size: 20px; background: var(--c-surface); border: 1px solid var(--c-border); }
.bell:hover { background: var(--c-surface-2); }
.bell .badge { position: absolute; top: -6px; right: -6px; }
.clock-chip { font-size: var(--fs-xs); color: var(--c-text-2); background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-pill); padding: 2px 10px; }
.page { flex: 1; overflow-y: auto; padding: var(--sp-8); }
.page.flush { padding: 0; } /* 桌面聊天页贴边；手机底边距由 mobile.css 覆盖 */
.page-inner { max-width: var(--content-max); margin: 0 auto; display: flex; flex-direction: column; gap: var(--sp-6); }
.section-title { font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: var(--fw-bold); display: flex; align-items: center; gap: var(--sp-2); }
.section-title .muted { font-weight: var(--fw-regular); font-size: var(--fs-sm); }

/* ===== 基础组件 ===== */
.card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); padding: var(--sp-5); box-shadow: var(--sh-1); }
.card.clickable { cursor: pointer; transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast); }
.card.clickable:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); height: 40px; padding: 0 var(--sp-5); border-radius: var(--r-pill); font-weight: var(--fw-medium); transition: background var(--dur-fast), transform var(--dur-fast); white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-600); }
.btn-secondary { background: var(--c-surface); border: 1px solid var(--c-border); }
.btn-secondary:hover { background: var(--c-surface-2); }
.btn-ghost { color: var(--c-text-2); }
.btn-ghost:hover { background: var(--c-surface-2); color: var(--c-text); }
.btn-danger { background: var(--c-danger-50); color: var(--c-danger); }
.btn-sm { height: 32px; padding: 0 var(--sp-3); font-size: var(--fs-sm); }
.btn-lg { height: 48px; padding: 0 var(--sp-8); font-size: var(--fs-lg); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.input { height: 40px; padding: 0 var(--sp-3); border-radius: var(--r-md); border: 1px solid var(--c-border); background: var(--c-surface-2); outline: none; width: 100%; }
.input:focus { border-color: var(--c-primary); background: #fff; box-shadow: 0 0 0 3px var(--c-primary-50); }
.input.err { border-color: var(--c-danger); }
.field-err { color: var(--c-danger); font-size: var(--fs-xs); }

.tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: var(--fw-medium); background: var(--c-surface-2); color: var(--c-text-2); white-space: nowrap; }
.tag-home { background: var(--c-mint-50); color: #1F8F6F; }
.tag-out { background: var(--c-sky-50); color: #2B7BC4; }
.tag-sleep { background: var(--c-lilac-50); color: #6A5AD8; }
.tag-sick { background: var(--c-primary-50); color: #963F3E; }
.tag-recovering { background: var(--c-mint-50); color: #256D57; }
.tag-好友 { background: var(--c-mint-50); color: #1F8F6F; }
.tag-朋友 { background: var(--c-sky-50); color: #2B7BC4; }
.tag-恋人 { background: var(--c-rose-50); color: #D63F73; }
.tag-前任 { background: #EFEAE6; color: #7A6A60; }
.tag-闹别扭中 { background: var(--c-accent-50); color: #B07D00; }
.tag-断联 { background: #EEEEEE; color: #888; }
.tag-招呼中 { background: var(--c-primary-50); color: var(--c-primary-600); }
.tag-surface { background: var(--c-primary-50); color: var(--c-primary-600); }
.tag-contrast { background: var(--c-lilac-50); color: #6A5AD8; }
.tag-identity { background: var(--c-accent-50); color: #9A6B00; }
.tag-quirk { background: var(--c-surface-2); color: var(--c-text-2); }

.favor { display: flex; align-items: center; gap: var(--sp-2); min-width: 160px; }
.favor-track { flex: 1; height: 8px; border-radius: var(--r-pill); background: var(--c-surface-2); overflow: hidden; }
.favor-fill { height: 100%; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--c-accent), var(--c-primary)); transition: width var(--dur-slow) var(--ease); }
.favor-fill.love { background: linear-gradient(90deg, #FFA0BF, var(--c-rose)); }
.favor-num { font-size: var(--fs-xs); color: var(--c-text-2); width: 44px; text-align: right; font-variant-numeric: tabular-nums; }

/* ===== 玩偶头像（纯 CSS，开发可换成平台统一形象图） ===== */
.doll { --s: 48px; display: inline-block; vertical-align: middle; position: relative; width: var(--s); height: var(--s); flex: none; }
.doll svg { display: block; width: 100%; height: 100%; overflow: visible; }
/* Batch 3 印记：头像 ≤ var(--av-mark-sm-max)=32px 时换成简化加粗版（容器查询按头像实际尺寸判断，--s 写在哪都生效） */
.doll { container-type: size; }
.mk-sm { display: none; }
@container (max-width: 32px) { .mk { display: none; } .mk-sm { display: inline; } }
.doll.stranger { filter: saturate(.9); }
.doll .status-dot { position: absolute; right: 0; bottom: 2px; width: calc(var(--s) * .26); height: calc(var(--s) * .26); max-width: 14px; max-height: 14px; border-radius: 50%; border: 2px solid #fff; }
.doll.xs { --s: 22px; } .doll.sm { --s: 36px; } .doll.lg { --s: 76px; } .doll.xl { --s: 128px; } .doll.xxl { --s: 168px; }

/* ===== 首页 ===== */
.summary-card { background: linear-gradient(135deg, #FFE6D8 0%, #FFF3D6 100%); border: 0; padding: var(--sp-6); position: relative; overflow: hidden; }
.summary-card::after { content: "🧸"; position: absolute; right: 24px; top: 12px; font-size: 72px; opacity: .18; transform: rotate(12deg); }
.summary-card h2 { font-size: var(--fs-xl); line-height: var(--lh-xl); font-weight: var(--fw-bold); }
.summary-item { display: flex; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-3); border-radius: var(--r-md); background: rgba(255,255,255,.7); cursor: pointer; transition: background var(--dur-fast); }
.summary-item:hover { background: #fff; }
.summary-item .emo { font-size: 20px; line-height: 24px; }
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-4); }
.member-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--sp-2); padding: var(--sp-6) var(--sp-4); }
.member-card .name { font-size: var(--fs-lg); font-weight: var(--fw-bold); }
.member-card .say { font-size: var(--fs-xs); color: var(--c-text-2); background: var(--c-surface-2); border-radius: var(--r-md); padding: var(--sp-2) var(--sp-3); margin-top: var(--sp-1); }
.add-card { border: 2px dashed var(--c-border); background: transparent; box-shadow: none; justify-content: center; color: var(--c-text-2); min-height: 220px; }
.add-card .plus { width: 56px; height: 56px; border-radius: 50%; background: var(--c-primary-50); color: var(--c-primary); font-size: 28px; display: grid; place-items: center; }
.feed-item { display: flex; gap: var(--sp-3); padding: var(--sp-3) 0; border-bottom: 1px solid var(--c-border); cursor: pointer; }
.feed-item:last-child { border-bottom: 0; }
.feed-item:hover .feed-title { color: var(--c-primary-600); }
.banner { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: var(--c-accent-50); color: #8A6200; font-size: var(--fs-sm); }

/* ===== 聊天 ===== */
.chat-layout { display: grid; grid-template-columns: 300px 1fr; height: 100%; min-height: 0; }
.chat-list { border-right: 1px solid var(--c-border); background: var(--c-surface); overflow-y: auto; }
.chat-list-group { padding: var(--sp-4) var(--sp-4) var(--sp-1); font-size: var(--fs-xs); color: var(--c-text-3); font-weight: var(--fw-medium); }
.chat-row { display: flex; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); cursor: pointer; align-items: center; border-left: 3px solid transparent; }
.chat-row:hover { background: var(--c-surface-2); }
.chat-row.active { background: var(--c-primary-50); border-left-color: var(--c-primary); }
.chat-row .t { font-weight: var(--fw-medium); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row .p { font-size: var(--fs-xs); color: var(--c-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar-stack { position: relative; width: 44px; height: 44px; flex: none; }
.avatar-stack .doll { position: absolute; --s: 30px; }
.avatar-stack .doll:nth-child(1) { left: 0; top: 0; } .avatar-stack .doll:nth-child(2) { right: 0; bottom: 0; } .avatar-stack .doll:nth-child(3) { left: 8px; bottom: -2px; }
.chat-detail { display: flex; flex-direction: column; min-height: 0; background: var(--c-bg); }
.chat-head { flex: none; padding: var(--sp-4) var(--sp-6); border-bottom: 1px solid var(--c-border); background: var(--c-surface); display: flex; align-items: center; gap: var(--sp-3); }
.chat-scroll { flex: 1; overflow-y: auto; padding: var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-4); }
.watch-bar { flex: none; padding: var(--sp-3) var(--sp-6); border-top: 1px solid var(--c-border); background: var(--c-surface); color: var(--c-text-3); font-size: var(--fs-sm); text-align: center; }
.seg-divider { align-self: center; font-size: var(--fs-xs); color: var(--c-text-3); background: var(--c-surface-2); padding: 2px 12px; border-radius: var(--r-pill); }
.seg { display: flex; flex-direction: column; gap: var(--sp-3); border-radius: var(--r-lg); transition: background var(--dur-slow), box-shadow var(--dur-slow); padding: var(--sp-2); scroll-margin-top: 16px; }
.seg.flash { background: var(--c-accent-50); box-shadow: 0 0 0 2px var(--c-accent); }
.seg.quarrel { animation: shake var(--dur-shake) var(--ease-shake) 2; }
.seg.quarrel .bubble:not(.whisper):not(.shout) { font-size: 16px; line-height: 24px; font-weight: var(--fw-bold); }
.fold { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-4); border-radius: var(--r-lg); background: var(--c-surface); border: 1px dashed var(--c-border); }
.fold .ico { font-size: 22px; }
.fold .title { font-weight: var(--fw-medium); }
.fold.event-fight { border-color: #F5C77A; background: #FFFBF0; }
.fold.event-physical, .fold.event-breakup { border-color: #F3B0B2; background: #FFF6F6; }
.fold.event-love { border-color: #FFB3CB; background: #FFF5F8; }
.fold.event-reveal { border-color: #CBC2FF; background: #F8F6FF; }
.msg { display: flex; gap: var(--sp-3); align-items: flex-end; max-width: 74%; animation: msgIn var(--dur-msg) var(--ease-back) both; }
.msg .who { font-size: var(--fs-xs); color: var(--sig-ink); font-weight: var(--fw-bold); margin-bottom: 3px; display: flex; gap: 6px; align-items: center; }
.bubble { position: relative; padding: 9px 14px; background: var(--sig-50); border: 1.5px solid color-mix(in srgb, var(--sig) 30%, transparent); border-radius: var(--r-lg); }
.msg.other { align-self: flex-end; flex-direction: row-reverse; text-align: right; }
.msg.other .bubble { text-align: left; }
.msg.other .who { justify-content: flex-end; } .msg.other .reacts { justify-content: flex-end; }
.reveal-chip { display: inline-flex; margin-top: 4px; font-size: var(--fs-xs); color: #6A5AD8; background: var(--c-lilac-50); border-radius: var(--r-pill); padding: 0 8px; }
.typing { align-self: flex-start; display: flex; gap: 4px; padding: var(--sp-3); background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--c-text-3); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ===== 关系 ===== */
.filter-tabs { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.filter-tab { height: 32px; padding: 0 var(--sp-4); border-radius: var(--r-pill); background: var(--c-surface); border: 1px solid var(--c-border); font-size: var(--fs-sm); color: var(--c-text-2); }
.filter-tab.active { background: var(--c-text); color: #fff; border-color: var(--c-text); }
.rel-row { display: grid; grid-template-columns: auto 1fr 220px auto; gap: var(--sp-4); align-items: center; padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--c-border); cursor: pointer; }
.rel-row:last-child { border-bottom: 0; }
.rel-row:hover { background: var(--c-surface-2); }
.list-card { padding: 0; overflow: hidden; }
.pair { display: flex; align-items: center; }
.pair .doll + .doll { margin-left: -12px; }

/* ===== 提醒中心 ===== */
.alert-row { display: flex; gap: var(--sp-4); align-items: flex-start; padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--c-border); cursor: pointer; position: relative; }
.alert-row:last-child { border-bottom: 0; }
.alert-row:hover { background: var(--c-surface-2); }
.alert-row.unread::before { content: ""; position: absolute; left: 8px; top: 26px; width: 6px; height: 6px; border-radius: 50%; background: var(--c-danger); }
.alert-ico { width: 40px; height: 40px; border-radius: var(--r-md); display: grid; place-items: center; font-size: 20px; flex: none; background: var(--c-surface-2); }
.lv { font-size: 11px; padding: 0 6px; border-radius: 4px; height: 18px; line-height: 18px; display: inline-block; }
.lv-important { background: var(--c-primary); color: #fff; }
.lv-dot { background: var(--c-surface-2); color: var(--c-text-2); }
.lv-timeline { background: transparent; color: var(--c-text-3); border: 1px solid var(--c-border); }

/* ===== 档案 ===== */
.profile-hero { display: flex; gap: var(--sp-6); align-items: center; padding: var(--sp-8); }
.profile-hero h2 { font-size: var(--fs-2xl); line-height: var(--lh-2xl); }
.trait-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); }
.trait { padding: var(--sp-4); border-radius: var(--r-md); background: var(--c-surface-2); }
.trait .k { font-size: var(--fs-xs); color: var(--c-text-2); }
.trait .v { font-size: var(--fs-lg); font-weight: var(--fw-bold); margin-top: 2px; }
.trait.locked { background: repeating-linear-gradient(-45deg, var(--c-lilac-50), var(--c-lilac-50) 8px, #F6F4FF 8px, #F6F4FF 16px); }
.trait.locked .v { color: #8A7FE0; }
.trait.unlocked { background: var(--c-lilac-50); }
.trait.unlocked .v { color: #6A5AD8; }
.otherside { border: 1px solid #DCD6FF; background: linear-gradient(135deg, #F4F1FF, #FFF0F6); }
.progress-dots { display: flex; gap: 6px; }
.progress-dots i { width: 22px; height: 6px; border-radius: 3px; background: #DDD6FF; }
.progress-dots i.on { background: var(--c-lilac); }
.timeline { position: relative; padding-left: var(--sp-6); }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--c-border); }
.tl-item { position: relative; padding-bottom: var(--sp-4); }
.tl-item::before { content: ""; position: absolute; left: calc(-1 * var(--sp-6) + 2px); top: 6px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--c-primary); }

/* ===== 空状态 ===== */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--sp-3); padding: var(--sp-12) var(--sp-6); color: var(--c-text-2); }
.empty .art { font-size: 56px; line-height: 1; }
.empty h3 { color: var(--c-text); font-size: var(--fs-lg); }

/* ===== 领养流程 ===== */
.adopt-wrap { max-width: 720px; margin: 0 auto; }
.stepper { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-6); }
.step { flex: 1; display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-xs); color: var(--c-text-3); }
.step i { height: 4px; border-radius: 2px; background: var(--c-border); }
.step.done i, .step.cur i { background: var(--c-primary); }
.step.cur { color: var(--c-primary-600); font-weight: var(--fw-medium); }
.adopt-card { padding: var(--sp-10); text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--sp-5); }
.adopt-card h2 { font-size: var(--fs-2xl); line-height: var(--lh-2xl); }
.scan-box { width: 220px; height: 220px; border-radius: var(--r-xl); border: 3px dashed var(--c-primary); display: grid; place-items: center; position: relative; overflow: hidden; background: var(--c-primary-50); font-size: 64px; }
.scan-box::after { content: ""; position: absolute; left: 0; right: 0; height: 3px; background: var(--c-primary); box-shadow: 0 0 12px var(--c-primary); animation: scan 2s linear infinite; }
@keyframes scan { from { top: 0; } to { top: 100%; } }
.blindbox { width: 180px; height: 180px; position: relative; cursor: pointer; }
.blindbox .box { position: absolute; inset: 30px 10px 0; border-radius: var(--r-lg); background: linear-gradient(135deg, var(--c-accent), #FFB13B); box-shadow: var(--sh-2); }
.blindbox .lid { position: absolute; left: 0; right: 0; top: 12px; height: 40px; border-radius: var(--r-md); background: linear-gradient(135deg, #FFD978, var(--c-accent)); box-shadow: var(--sh-1); transition: transform var(--dur-slow) var(--ease); }
.blindbox .ribbon { position: absolute; left: 50%; top: 12px; bottom: 0; width: 22px; margin-left: -11px; background: var(--c-primary); border-radius: 4px; }
.blindbox .q { position: absolute; inset: 60px 0 0; display: grid; place-items: center; font-size: 48px; color: #fff; font-weight: var(--fw-bold); text-shadow: 0 2px 0 rgba(0,0,0,.1); }
.blindbox.shake { animation: shake .5s infinite; }
.blindbox.open .lid { transform: translate(90px, 10px) rotate(28deg); opacity: .9; }
.blindbox.open { animation: none; }
@keyframes shake { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
.reveal-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3); width: 100%; }
.reveal-card { perspective: 600px; height: 120px; }
.reveal-card .inner { position: relative; width: 100%; height: 100%; transition: transform .6s var(--ease); transform-style: preserve-3d; }
.reveal-card.flipped .inner { transform: rotateY(180deg); }
.reveal-card .face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: var(--r-md); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: var(--sp-2); }
.reveal-card .front { background: var(--c-accent-50); border: 2px solid var(--c-accent); font-size: 28px; }
.reveal-card .back { transform: rotateY(180deg); background: #fff; border: 2px solid var(--c-border); }
.reveal-card .back .k { font-size: var(--fs-xs); color: var(--c-text-2); }
.reveal-card .back .v { font-size: var(--fs-lg); font-weight: var(--fw-bold); }
.reveal-card.secret .back { background: var(--c-lilac-50); border-color: #CBC2FF; }
.name-slot { font-size: var(--fs-3xl); line-height: var(--lh-3xl); font-weight: var(--fw-bold); color: var(--c-primary-600); min-width: 200px; padding: var(--sp-4) var(--sp-8); border-radius: var(--r-xl); background: var(--c-primary-50); }
.name-slot.rolling { filter: blur(1px); }
.map { width: 100%; height: 240px; border-radius: var(--r-lg); position: relative; overflow: hidden; cursor: crosshair; background: linear-gradient(0deg, transparent 49%, #EDE2D3 49%, #EDE2D3 51%, transparent 51%) 0 0/60px 60px, linear-gradient(90deg, transparent 49%, #EDE2D3 49%, #EDE2D3 51%, transparent 51%) 0 0/60px 60px, #F7EFE4; border: 1px solid var(--c-border); }
.map .blk { position: absolute; border-radius: 6px; background: #E8F3E4; }
.map .pin { position: absolute; transform: translate(-50%, -100%); font-size: 32px; transition: left var(--dur), top var(--dur); }
.map .radius { position: absolute; transform: translate(-50%, -50%); width: 90px; height: 90px; border-radius: 50%; background: rgba(255,122,89,.12); border: 1px dashed var(--c-primary); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti i { position: absolute; top: -10px; width: 8px; height: 14px; border-radius: 2px; animation: fall 1.6s ease-in forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); opacity: .8; } }

/* ===== 弹窗 / Toast ===== */
.modal-mask { position: fixed; inset: 0; background: var(--c-overlay); display: grid; place-items: center; z-index: 50; animation: fade var(--dur); }
.modal { width: 440px; max-width: calc(100vw - 32px); background: #fff; border-radius: var(--r-xl); padding: var(--sp-6); box-shadow: var(--sh-3); display: flex; flex-direction: column; gap: var(--sp-4); }
.modal h3 { font-size: var(--fs-xl); line-height: var(--lh-xl); }
@keyframes fade { from { opacity: 0; } }
.toast-wrap { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--c-text); color: #fff; padding: var(--sp-2) var(--sp-4); border-radius: var(--r-pill); box-shadow: var(--sh-2); font-size: var(--fs-sm); animation: pop var(--dur) var(--ease); cursor: pointer; }

/* ===== 开关 ===== */
.switch { position: relative; width: 44px; height: 24px; border-radius: 12px; background: var(--c-border); transition: background var(--dur-fast); flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--sh-1); transition: transform var(--dur-fast) var(--ease); }
.switch.on { background: var(--c-mint); }
.switch.on::after { transform: translateX(20px); }
.setting-row { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-4) 0; border-bottom: 1px solid var(--c-border); }
.setting-row:last-child { border-bottom: 0; }

/* ===== 调试后台 ===== */
.admin { background: #F6F4F1; }
.admin [hidden] { display: none; }
.admin-top .btn-secondary { color: var(--c-text); }
#admin-login { width: min(380px, calc(100% - 32px)); margin: 32px auto; }
#admin-login label { margin-bottom: 6px; }
#admin-login .input { width: 100%; height: 40px; margin-bottom: 14px; }
#admin-login .field-err:not(:empty) { margin-top: 8px; }
.admin-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-3) var(--sp-6); background: #2E2522; color: #fff; }
.admin-top .brand { padding: 0; font-size: var(--fs-lg); }
.admin-top .clock { font-variant-numeric: tabular-nums; background: rgba(255,255,255,.1); padding: 4px 12px; border-radius: var(--r-pill); font-size: var(--fs-sm); }
.admin-top a { color: #FFD3C6; font-size: var(--fs-sm); }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: var(--sp-4); padding: var(--sp-6); align-items: start; }
body.admin { overflow-x: hidden; max-width: 100vw; }
.mark-list { display: flex; flex-direction: column; gap: 2px; }
.mark-item { display: grid; grid-template-columns: 48px minmax(0, 1fr) minmax(140px, 200px); gap: 8px 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--c-border); }
.mark-item .mark-sel { width: 100%; min-width: 0; }
@media (max-width: 820px) {
  .mark-item { grid-template-columns: 48px minmax(0, 1fr); }
  .mark-item .mark-sel { grid-column: 1 / -1; }
}

.admin-grid .card, .tbl-wrap { max-width: 100%; overflow-x: auto; }
@media (max-width: 820px) {
  body.admin { overflow-x: hidden; }
  .admin-top { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .admin-grid { grid-template-columns: 1fr; padding: 8px; }
  .admin-grid .span2 { grid-column: 1; }
  .tbl { display: block; overflow-x: auto; max-width: 100%; }
}
.admin-grid .card { box-shadow: none; }
.admin-grid .span2 { grid-column: 1 / -1; }
.admin h3 { font-size: var(--fs-md); font-weight: var(--fw-bold); margin-bottom: var(--sp-3); display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--sp-2); }
.admin h3 .muted { font-weight: var(--fw-regular); font-size: var(--fs-xs); flex-basis: 100%; }
.admin .btn { height: 32px; padding: 0 var(--sp-3); font-size: var(--fs-sm); border-radius: var(--r-sm); }
.admin .input, .admin select { height: 32px; font-size: var(--fs-sm); border-radius: var(--r-sm); border: 1px solid var(--c-border); background: #fff; padding: 0 8px; }
.admin label { font-size: var(--fs-xs); color: var(--c-text-2); display: flex; flex-direction: column; gap: 4px; }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.tbl th { text-align: left; font-weight: var(--fw-medium); color: var(--c-text-2); font-size: var(--fs-xs); padding: 6px 8px; border-bottom: 1px solid var(--c-border); }
.tbl td { padding: 8px; border-bottom: 1px solid var(--c-border); vertical-align: middle; }
.log { font-family: ui-monospace, Menlo, monospace; font-size: 12px; line-height: 18px; background: #2E2522; color: #F3E9E2; border-radius: var(--r-md); padding: var(--sp-3); height: 260px; overflow-y: auto; white-space: pre-wrap; }
.log .t { color: #FFB59E; }
.mem { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: var(--c-surface-2); border-radius: var(--r-md); padding: var(--sp-3); max-height: 260px; overflow: auto; white-space: pre-wrap; margin: 0; }

/* ================= Batch 1 ================= */
/* 性格徽章 */
.pbadge { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px 0 4px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: var(--fw-bold); background: var(--sig-50); color: var(--sig-ink); border: 1.5px solid color-mix(in srgb, var(--sig) 35%, transparent); white-space: nowrap; }
.pbadge i { font-style: normal; width: 18px; height: 18px; border-radius: 50%; background: var(--sig); color: #fff; display: grid; place-items: center; font-size: 11px; }
.pbadge.id { background: #fff; border-color: var(--c-border); color: var(--c-text-2); font-weight: var(--fw-medium); padding: 0 10px; }
.pbadge.contrast { background: repeating-linear-gradient(-45deg, #EFEAFF 0 6px, #F8F5FF 6px 12px); color: #6A5AD8; border-color: #D9D1FF; padding: 0 10px; }
.pbadge.contrast.on { background: linear-gradient(90deg, #6A5AD8, #9B8CFF); color: #fff; border-color: transparent; box-shadow: 0 0 0 3px rgba(155,140,255,.22); }
.badges { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }

/* 口头禅高亮 */
.catch { background: linear-gradient(transparent 58%, color-mix(in srgb, var(--sig) 32%, transparent) 58%); color: var(--sig-ink); font-weight: var(--fw-bold); padding: 0 2px; border-radius: 2px; }
.catch-tag { display: inline-block; font-size: 10px; line-height: 16px; padding: 0 5px; border-radius: 4px; background: var(--sig); color: #fff; margin-left: 4px; vertical-align: 2px; font-weight: var(--fw-bold); }

/* 气泡 6 组（按表面性格） */
.b-cold { border-radius: var(--bubble-cold-radius); border-left: 4px solid var(--sig); font-weight: var(--bubble-cold-weight); letter-spacing: .02em; }
.b-fire { border-radius: var(--bubble-fire-radius); font-weight: var(--bubble-fire-weight); border-width: 2px; }
.b-soft { border-radius: var(--bubble-soft-radius); font-weight: var(--bubble-soft-weight); background: linear-gradient(135deg, var(--sig-50), #fff); }
.b-chatty { border-radius: var(--bubble-chatty-radius); font-weight: var(--bubble-chatty-weight); line-height: 24px; }
.b-sharp { border-radius: var(--bubble-sharp-radius); font-weight: var(--bubble-sharp-weight); }
.b-old { border-radius: var(--bubble-old-radius); font-weight: var(--bubble-old-weight); border-style: double; border-width: 3px; }
.msg.other .b-cold { border-left-width: 1.5px; border-right: 4px solid var(--sig); border-radius: 14px 4px 4px 14px; }

/* 情绪标签 / 强度 / 贴纸 / 表态 */
.mood-tag { font-weight: var(--fw-medium); font-size: 11px; line-height: 18px; padding: 0 7px; border-radius: var(--r-pill); background: #fff; border: 1px solid var(--c-border); color: var(--c-text-2); }
.bubble.shout { font-size: 20px; line-height: 28px; font-weight: var(--fw-black); padding: 12px 18px; color: var(--sig-ink); background: #fff; border: 3px solid var(--sig); box-shadow: 4px 4px 0 var(--sig); animation: shake var(--dur-shake) var(--ease-shake) 2; }
.bubble.shout::after { content: "!!"; position: absolute; right: -14px; top: -16px; font-weight: var(--fw-black); font-size: 22px; color: var(--sig); transform: rotate(14deg); }
.bubble.whisper { font-size: var(--fs-xs); line-height: var(--lh-xs); font-style: italic; opacity: .8; font-weight: var(--fw-regular); }
.bubble-row { display: flex; align-items: center; }
.msg.other .bubble-row { flex-direction: row-reverse; }
.sticker { font-size: 34px; line-height: 1; margin: 0 6px; display: inline-block; animation: stick var(--dur-sticker) var(--ease-back) both; }
.reacts { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.react { display: inline-flex; align-items: center; gap: 3px; height: 24px; padding: 0 8px 0 2px; border-radius: var(--r-pill); background: #fff; border: 1px solid var(--c-border); font-size: 13px; box-shadow: 0 1px 2px rgba(0,0,0,.05); animation: pop var(--dur-react) var(--ease-back) both; }
.react .doll { --s: 20px; }

/* 旁白：电影字幕条 */
.narr { align-self: stretch; margin: 2px 48px; display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 10px; background: var(--narr-bg); color: var(--narr-fg); font-family: var(--font-narr); font-size: var(--fs-md); letter-spacing: .04em; animation: fadeIn .5s var(--ease) both; }
.narr::before { content: "旁白"; font-family: var(--font-sans); font-size: 10px; letter-spacing: .1em; padding: 1px 6px; border-radius: 4px; background: rgba(255,255,255,.14); color: var(--narr-label); flex: none; }
.narr .act { font-size: 20px; line-height: 1; flex: none; }

/* 事件卡（聊天内 + 首页） */
.ev { position: relative; overflow: hidden; border-radius: var(--ev-radius); color: #fff; padding: 18px 22px; display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; box-shadow: var(--ev-shadow); animation: evIn var(--dur-event) var(--ease-back) both; }
.ev::before { content: ""; position: absolute; inset: 0; background: var(--ev-stripes); pointer-events: none; }
.ev > * { position: relative; }
.ev-fight { background: var(--ev-fight); } .ev-physical { background: var(--ev-physical); } .ev-love { background: var(--ev-love); } .ev-breakup { background: var(--ev-breakup); } .ev-reveal { background: var(--ev-reveal); } .ev-quote { background: var(--ev-quote); }
.ev .kicker { font-size: 11px; letter-spacing: .16em; font-weight: var(--fw-bold); opacity: .9; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ev .kicker b { background: rgba(255,255,255,.22); padding: 1px 8px; border-radius: 4px; letter-spacing: .1em; }
.ev h3 { font-family: var(--font-display); font-weight: var(--fw-black); font-size: 22px; line-height: 30px; margin: 4px 0 6px; text-shadow: 0 2px 0 rgba(0,0,0,.15); }
.ev .quote { font-size: 15px; font-weight: var(--fw-bold); background: rgba(255,255,255,.16); border-left: 3px solid #fff; padding: 4px 10px; border-radius: 0 8px 8px 0; display: inline-block; }
.ev .quote small { font-weight: var(--fw-regular); opacity: .85; margin-left: 6px; font-size: 12px; }
.ev .cast { display: flex; align-items: center; }
.ev .cast .link { width: 40px; text-align: center; font-weight: var(--fw-black); font-size: 22px; font-style: italic; text-shadow: 0 2px 0 rgba(0,0,0,.2); }
.ev .cast .doll { filter: drop-shadow(0 6px 8px rgba(0,0,0,.25)); }
.ev .cta { background: #fff; color: var(--c-text); font-weight: var(--fw-bold); border-radius: var(--r-pill); padding: 8px 16px; font-size: 13px; white-space: nowrap; }
.ev .cta:hover { background: #FFF3EC; }
.ev .prop { position: absolute; left: 112px; top: 4px; animation: fly var(--dur-prop) var(--ease) infinite; }
.ev-reveal .spot { position: absolute; left: 20px; top: -40px; width: 160px; height: 240px; background: radial-gradient(ellipse at top, rgba(255,240,180,.5), transparent 70%); transform: rotate(-12deg); pointer-events: none; }
.seg.flash .ev { box-shadow: 0 0 0 4px var(--c-accent), var(--ev-shadow); }

/* 首页：今日大新闻 */
.home-grid { display: grid; grid-template-columns: 1fr 320px; gap: var(--sp-5); align-items: start; }
.hero { position: relative; overflow: hidden; border-radius: var(--ev-hero-radius); color: #fff; padding: 26px 30px; min-height: 340px; display: flex; flex-direction: column; box-shadow: var(--ev-shadow); cursor: pointer; }
.hero::before { content: ""; position: absolute; inset: 0; background: var(--ev-stripes); }
.hero > * { position: relative; }
.masthead { display: flex; align-items: center; gap: 10px; font-size: 12px; letter-spacing: .22em; font-weight: var(--fw-bold); opacity: .92; }
.masthead .live { background: #fff; color: #C2271F; padding: 2px 8px; border-radius: 4px; letter-spacing: .1em; animation: pulse 1.6s infinite; }
.hero h2 { font-family: var(--font-display); font-weight: var(--fw-black); font-size: var(--fs-hero); line-height: var(--lh-hero); margin-top: 14px; text-shadow: 0 3px 0 rgba(0,0,0,.2); max-width: 520px; }
.hero .deck { font-size: 15px; opacity: .92; margin-top: 8px; max-width: 480px; }
@media (min-width: 821px) {
  .hero.ev-quote {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto 1fr auto;
    gap: 0 var(--sp-4);
  }
  .hero.ev-quote .masthead, .hero.ev-quote h2 { grid-column: 1 / -1; }
  .hero.ev-quote h2 { max-width: 100%; overflow-wrap: anywhere; }
  .hero.ev-quote .deck, .hero.ev-quote .actions { grid-column: 1; max-width: 100%; }
  .hero.ev-quote .scene { position: static; grid-column: 2; grid-row: 3 / 5; align-self: end; }
  .hero.ev-quote .doll.xxl { --s: 112px; }
}
@media (min-width: 821px) and (max-width: 1120px) {
  .home-grid:has(> .ev-quote) { grid-template-columns: minmax(0, 1fr); }
}
.hero .hq { margin-top: auto; align-self: flex-start; background: #fff; color: var(--sig-ink); font-weight: var(--fw-black); font-size: 20px; line-height: 28px; padding: 12px 18px; border-radius: 18px 18px 18px 4px; box-shadow: 5px 5px 0 rgba(0,0,0,.22); max-width: min(440px, calc(100% - 360px)); position: relative; z-index: 2; }
.hero .hq small { display: block; font-size: 12px; color: var(--c-text-2); font-weight: var(--fw-medium); }
.hero .actions { display: flex; gap: 10px; margin-top: 16px; position: relative; z-index: 2; max-width: calc(100% - 360px); flex-wrap: wrap; }
.hero .scene { position: absolute; right: 22px; bottom: 16px; display: flex; align-items: flex-end; z-index: 0; }
.hero .scene .link { font-size: 34px; font-weight: var(--fw-black); font-style: italic; margin: 0 -6px 60px; z-index: 1; text-shadow: 0 2px 0 rgba(0,0,0,.25); }
.hero .flyprop { position: absolute; right: 190px; bottom: 170px; animation: pillowFly 2.2s var(--ease) infinite; }
.btn-white { background: #fff; color: var(--c-text); } .btn-white:hover { background: #FFF3EC; }
.btn-glass { background: rgba(255,255,255,.18); color: #fff; } .btn-glass:hover { background: rgba(255,255,255,.28); }
.side-news { display: flex; flex-direction: column; gap: var(--sp-3); }
.news { position: relative; overflow: hidden; border-radius: 18px; padding: 12px 14px; color: #fff; display: flex; gap: 12px; align-items: center; cursor: pointer; transition: transform var(--dur-fast) var(--ease); }
.news:hover { transform: translateY(-2px); }
.news::before { content: ""; position: absolute; inset: 0; background: var(--ev-stripes); }
.news > * { position: relative; }
.news .k { font-size: 10px; letter-spacing: .15em; opacity: .9; font-weight: var(--fw-bold); }
.news h4 { margin: 0; font-size: 15px; line-height: 21px; font-weight: var(--fw-black); }
.news p { font-size: 12px; line-height: 18px; opacity: .92; margin: 0; }
.news.plain { background: #fff; color: var(--c-text); border: 1px solid var(--c-border); }
.news.plain::before { display: none; }
.news.plain .k { color: var(--c-text-2); }
.news-pair { display: flex; flex: none; } .news-pair .doll + .doll { margin-left: -14px; }

/* 成员卡（签名色） */
.member-card.sig { padding: 0; align-items: stretch; text-align: left; overflow: hidden; gap: 0; }
.member-card.sig .mhead { display: flex; align-items: flex-end; gap: 10px; padding: 14px 14px 8px; background: linear-gradient(160deg, var(--sig-50), color-mix(in srgb, var(--sig) 26%, #fff)); }
.member-card.sig .mbody { padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.member-card.sig .name { color: var(--sig-ink); font-size: var(--fs-xl); font-weight: var(--fw-black); }
.member-card.sig .say { margin: 0; background: var(--c-surface-2); }
.profile-hero.sig { background: linear-gradient(135deg, var(--sig-50), #fff 70%); }
.profile-hero.sig h2 { color: var(--sig-ink); }
.trait.sigt { background: var(--sig-50); } .trait.sigt .v { color: var(--sig-ink); }

@keyframes msgIn { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes stick { 0% { opacity: 0; transform: scale(.2) rotate(-30deg); } 70% { transform: scale(1.15) rotate(8deg); } 100% { opacity: 1; transform: rotate(-6deg); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes shake { 10%, 90% { transform: translateX(-1px) rotate(-.5deg); } 20%, 80% { transform: translateX(3px) rotate(1deg); } 30%, 50%, 70% { transform: translateX(-5px) rotate(-1.5deg); } 40%, 60% { transform: translateX(5px) rotate(1.5deg); } }
@keyframes evIn { from { opacity: 0; transform: translateY(16px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes fly { 0%, 100% { transform: translate(0, 0) rotate(0); } 50% { transform: translate(-30px, -10px) rotate(-40deg); } }
@keyframes pillowFly { 0%, 100% { transform: translate(50px, 20px) rotate(20deg); } 60% { transform: translate(-40px, -20px) rotate(-200deg); } }
@keyframes pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) {
  .bubble.shout, .ev .prop, .hero .flyprop, .masthead .live, .sticker, .react, .msg, .ev, .seg.quarrel { animation: none !important; }
}
.still, .still * { animation: none !important; }
.typing.sig { align-items: center; gap: 8px; background: transparent; border: 0; padding: 0; color: var(--sig-ink); }
.typing.sig .dots { display: flex; gap: 4px; padding: 10px 12px; border-radius: 14px; background: var(--sig-50); border: 1.5px solid color-mix(in srgb, var(--sig) 30%, transparent); }
.typing.sig .dots i { background: var(--sig); animation: bounce 1s infinite; }
.typing.sig .dots i:nth-child(2) { animation-delay: .15s; } .typing.sig .dots i:nth-child(3) { animation-delay: .3s; }
.b-chatty + .sticker, .b-fire + .sticker { margin-left: 8px; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }
.member-card.sig .say { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero h2, .ev h3 { text-wrap: balance; }

/* ================= Batch 2 ================= */
/* 分层插画头像：viewBox 0 -8 256 268，容器保持正方形 */
.doll svg { overflow: visible; }
.doll.rvart { --s: var(--av-rv-size); }
.me-ava { width: 76px; height: 76px; border-radius: 50%; background: var(--c-accent-50); display: grid; place-items: center; font-size: 40px; flex: none; }

/* ---- 打字指示器：按性格 ---- */
.typing.sig .dots i { animation-duration: var(--type-speed, 1s); }
.typing.t-cold { --type-speed: var(--type-cold-speed); } .typing.t-cold .dots { background: #F4F6FA; border-color: #DDE3EE; } .typing.t-cold .dots i { width: 5px; height: 5px; background: #9AA3B2; animation-name: blink; }
.typing.t-fire { --type-speed: var(--type-fire-speed); } .typing.t-fire .dots { animation: shake var(--dur-shake) var(--ease-shake) infinite; } .typing.t-fire .dots i { width: 7px; height: 7px; }
.typing.t-soft { --type-speed: var(--type-soft-speed); } .typing.t-soft .dots { border-radius: 22px; } .typing.t-soft .dots i { animation-name: wave; }
.typing.t-chatty { --type-speed: var(--type-chatty-speed); } .typing.t-chatty .dots i:nth-child(4) { animation-delay: .45s; } .typing.t-chatty .dots i:nth-child(5) { animation-delay: .6s; }
.typing.t-sharp { --type-speed: var(--type-sharp-speed); } .typing.t-sharp .dots { border-radius: 14px 2px 14px 14px; } .typing.t-sharp .dots i { border-radius: 1px; transform: rotate(45deg); animation-name: blink; }
.typing.t-old { --type-speed: var(--type-old-speed); } .typing.t-old .dots { border-radius: 10px; } .typing.t-old .dots i { animation-name: blink; }
.typing.narr-typing { background: var(--narr-bg); color: var(--narr-fg); border: 0; gap: 8px; align-items: center; border-radius: 10px; }
@keyframes wave { 0%, 100% { transform: translateY(0); opacity: .45; } 50% { transform: translateY(-3px); opacity: 1; } }

/* ---- 表态：合并同 emoji、叠头像、依次弹出 ---- */
.react { padding: 0 8px 0 3px; gap: 4px; animation: reactIn var(--dur-react) var(--ease-back) both; animation-delay: calc(var(--dur-msg) + var(--react-delay) + var(--ri, 0) * var(--react-stagger)); }
.react .rav { display: inline-flex; } .react .rav .doll { --s: 20px; } .react .rav .doll + .doll { margin-left: -8px; }
.react .re { font-size: 14px; line-height: 1; }
.react b { font-size: 11px; color: var(--c-text-2); font-weight: var(--fw-bold); }
@keyframes reactIn { 0% { opacity: 0; transform: translateY(6px) scale(.4); } 70% { transform: translateY(-2px) scale(1.12); } 100% { opacity: 1; transform: none; } }

/* ---- 贴纸：签名色底 + 落地后轻晃 ---- */
.sticker { isolation: isolate; position: relative; width: calc(var(--sticker-size) + 12px); height: calc(var(--sticker-size) + 12px); margin: 0 6px; display: inline-grid; place-items: center; font-size: var(--sticker-size); animation: stick var(--dur-sticker) var(--ease-back) both; animation-delay: calc(var(--dur-msg) - 80ms); }
.sticker::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--sig-50); border: 2px dashed color-mix(in srgb, var(--sig) 45%, transparent); z-index: -1; }
.sticker span { display: block; line-height: 1; animation: wobble 1.6s ease-in-out calc(var(--dur-msg) + var(--dur-sticker)) 2; }
@keyframes wobble { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(8deg) scale(1.06); } }

/* ---- 盲盒揭晓舞台 ---- */
.rv { position: fixed; inset: 0; z-index: 50; overflow: hidden; background: var(--rv-bg); color: var(--rv-text); font-family: var(--font); }
.rv-top { position: absolute; top: 18px; left: 24px; right: 20px; z-index: 8; display: flex; align-items: center; gap: 8px; }
.rv-steps { display: flex; gap: 6px; flex: 1; font-size: 12px; color: var(--rv-text-2); }
.rv-steps span { padding: 2px 10px; border-radius: 999px; background: rgba(255,255,255,.08); }
.rv-steps .on { background: var(--rv-gold); color: #3A2A00; font-weight: 700; }
.rv-icon { width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: var(--rv-text); font-size: 16px; cursor: pointer; }
.rv-icon:hover { background: rgba(255,255,255,.16); }
.rv-rays { position: absolute; left: 50%; top: 50%; width: 1600px; height: 1600px; margin: -800px 0 0 -800px; border-radius: 50%; opacity: 0; background: repeating-conic-gradient(from 0deg, rgba(255,214,120,0) 0deg 8deg, rgba(255,214,120,.22) 8deg 12deg); -webkit-mask: radial-gradient(circle, #000 0 30%, transparent 62%); mask: radial-gradient(circle, #000 0 30%, transparent 62%); }
.rv-dim { position: absolute; inset: 0; background: rgba(0,0,0,0); pointer-events: none; }
.rv-flash { position: absolute; inset: 0; z-index: 6; background: radial-gradient(circle at 50% 50%, #fff 0%, #FFE9A8 30%, transparent 70%); opacity: 0; pointer-events: none; }
.rv-glow { position: absolute; left: 50%; top: 50%; width: 420px; height: 420px; margin: -230px 0 0 -210px; z-index: 1; border-radius: 50%; opacity: 0; background: radial-gradient(circle, rgba(255,214,120,.65), rgba(255,140,80,.15) 45%, transparent 70%); }
.rv-rarity { position: absolute; top: 64px; left: 0; right: 0; z-index: 4; text-align: center; color: #FFE08A; font-family: var(--font-display); font-weight: var(--fw-black); font-size: 22px; letter-spacing: .5em; opacity: 0; text-shadow: 0 0 18px rgba(255,200,80,.8); }
.rv-gwrap { position: absolute; left: 50%; top: 50%; width: 220px; height: 220px; margin: -130px 0 0 -110px; z-index: 2; cursor: pointer; }
.rv:not(.go) .rv-gwrap { animation: rvIdle 1.8s ease-in-out infinite; }
.rv-gbox { position: relative; width: 220px; height: 220px; }
.rv-gbox .body { position: absolute; left: 20px; right: 20px; bottom: 0; height: 160px; border-radius: 20px; background: linear-gradient(135deg, var(--rv-gold), var(--rv-gold-2)); box-shadow: inset 0 -10px 0 rgba(0,0,0,.08), 0 20px 50px rgba(255,170,60,.35); }
.rv-gbox .lid { position: absolute; left: 6px; right: 6px; top: 34px; height: 48px; border-radius: 14px; background: linear-gradient(135deg, #FFE7A3, #FFC24A); box-shadow: 0 6px 0 rgba(0,0,0,.08); transform-origin: 20% 100%; }
.rv-gbox .rib { position: absolute; left: 50%; width: 28px; margin-left: -14px; top: 34px; bottom: 0; background: var(--rv-ribbon); border-radius: 4px; }
.rv-gbox .bow { position: absolute; left: 50%; top: 6px; margin-left: -34px; font-size: 52px; line-height: 1; }
.rv-gbox .seam { position: absolute; left: 10px; right: 10px; top: 80px; height: 6px; border-radius: 3px; background: #FFF6C8; box-shadow: 0 0 24px 10px rgba(255,236,160,.9); opacity: 0; }
.rv-gbox .q { position: absolute; left: 0; right: 0; bottom: 46px; text-align: center; font-size: 56px; font-weight: 900; color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.12); }
.rv-spark { position: absolute; left: 50%; top: 50%; z-index: 3; width: 6px; height: 6px; border-radius: 50%; background: #FFE08A; box-shadow: 0 0 10px 3px rgba(255,220,130,.8); opacity: 0; }
.rv-hint { position: absolute; bottom: 64px; left: 0; right: 0; z-index: 3; text-align: center; font-size: 16px; letter-spacing: .1em; }
.rv-hint b { color: var(--rv-gold); } .rv-hint span { display: block; margin-top: 6px; font-size: 12px; color: var(--rv-text-2); letter-spacing: 0; }
.rv-card { position: absolute; z-index: 5; left: 50%; top: 50%; width: var(--rv-card-w); height: var(--rv-card-h); margin: calc(var(--rv-card-h) / -2 + 10px) 0 0 calc(var(--rv-card-w) / -2); border-radius: var(--rv-card-radius); padding: 3px; background: var(--rv-card-frame); opacity: 0; box-shadow: 0 30px 80px rgba(0,0,0,.5), 0 0 60px rgba(255,210,120,.35); color: var(--c-text); }
.rv-card .in { position: relative; height: 100%; border-radius: calc(var(--rv-card-radius) - 3px); overflow: hidden; background: linear-gradient(180deg, var(--sig-50) 0%, #fff 58%); display: flex; flex-direction: column; align-items: center; padding: 18px 22px; }
.rv-card .top { align-self: stretch; display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 700; color: var(--sig-ink); }
.rv-card .signame { display: inline-flex; align-items: center; gap: 4px; text-transform: uppercase; letter-spacing: .1em; } .rv-card .signame i { width: 10px; height: 10px; border-radius: 3px; background: var(--sig); }
.rv-card .art { position: relative; width: 210px; height: 210px; display: grid; place-items: center; }
.rv-card .art::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--sig) 30%, #fff), transparent 70%); }
.rv-card .name { font-family: var(--font-display); font-weight: var(--fw-black); font-size: 34px; line-height: 40px; color: var(--sig-ink); letter-spacing: .1em; text-align: center; }
.rv-card .name small { display: block; font-size: 11px; line-height: 14px; letter-spacing: 0; font-weight: 500; color: var(--c-text-3); }
.rv-card .title { font-size: 14px; color: var(--c-text-2); margin-top: 4px; } .rv-card .title b { color: var(--sig-ink); }
.rv-card .traits { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-self: stretch; margin-top: 12px; }
.rv-card .tr { border-radius: 12px; padding: 8px 10px; background: #fff; border: 1.5px solid var(--c-border); opacity: 0; }
.rv-card .tr .k { font-size: 11px; color: var(--c-text-3); } .rv-card .tr .v { font-weight: 900; font-size: 16px; color: var(--sig-ink); }
.rv-card .tr.wide { grid-column: 1 / -1; }
.rv-card .tr.secret { position: relative; overflow: hidden; background: var(--rv-secret-bg); border-color: #D9D1FF; }
.rv-card .tr.secret .v { color: #6A5AD8; filter: blur(4px); user-select: none; }
.rv-card .tr.secret .tease { font-size: 12px; color: #6A5AD8; margin-top: 2px; }
.rv-card .tr.secret .lock { position: absolute; right: 10px; top: 10px; font-size: 18px; }
.rv-card .holo { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light; transform: translateX(-120%); background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.75) 45%, rgba(180,220,255,.35) 50%, transparent 62%); }
.rv-teaser { position: absolute; z-index: 6; left: calc(50% + var(--rv-card-w) / 2 + 28px); top: calc(50% + 110px); width: 230px; font-size: 14px; opacity: 0; }
.rv-teaser b { color: var(--rv-gold); display: block; font-size: 12px; letter-spacing: .15em; margin-bottom: 4px; }
.rv-teaser .line { background: rgba(155,140,255,.18); border: 1px solid rgba(155,140,255,.4); border-radius: 12px 12px 12px 4px; padding: 10px 12px; }
.rv-after { position: absolute; bottom: 28px; left: 0; right: 0; z-index: 7; display: flex; justify-content: center; gap: 12px; opacity: 0; visibility: hidden; }
.rv-next { background: var(--rv-gold); color: #3A2A00; font-weight: 700; }
.mute-btn { position: absolute; right: 16px; top: 16px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--c-border); background: #fff; cursor: pointer; }
.adopt-card { position: relative; }

/* ---- 揭晓时间轴（所有动画都挂在 .rv.go 下，延迟取 --rv-*） ---- */
.rv.go .rv-gbox { animation: rvCharge calc(var(--rv-burst) - var(--rv-charge)) var(--ease-in) var(--rv-charge) both; }
.rv.go .rv-gbox .seam { animation: rvFadeIn 900ms ease-out calc(var(--rv-charge) + 200ms) both; }
.rv.go .rv-dim { animation: rvDim 1800ms ease-out var(--rv-charge) both; }
.rv.go .rv-hint { animation: rvFadeOut 300ms ease-out var(--rv-charge) both; }
.rv.go .rv-gbox .lid { animation: rvLid 600ms cubic-bezier(.2,.8,.2,1) var(--rv-burst) both; }
.rv.go .rv-gwrap { animation: rvBoxOut 260ms ease-out calc(var(--rv-burst) + 60ms) both; }
.rv.go .rv-glow { animation: rvGlow calc(var(--rv-burst) - var(--rv-charge) + 500ms) linear var(--rv-charge) both; }
.rv.go .rv-flash { animation: rvFlash 700ms ease-out calc(var(--rv-burst) - 60ms) both; }
.rv.go .rv-rays { animation: rvRays 8000ms linear var(--rv-burst) both; }
.rv.go .rv-rarity { animation: rvRarity 600ms var(--ease-back) calc(var(--rv-burst) + 150ms) both; }
.rv.go .rv-spark { animation: rvGather calc(1100ms - var(--i) * 20ms) var(--ease-in) calc(var(--rv-charge) + var(--i) * 30ms) both, rvScatter 900ms ease-out var(--rv-burst) forwards; }
.rv.go .rv-card { animation: rvCard 800ms var(--ease-back) var(--rv-card) both; }
.rv.go .rv-card .holo { animation: rvHolo 900ms ease-in-out calc(var(--rv-card) + 650ms) 3 both; }
.rv.go .rv-card .tr { animation: rvTrait 420ms var(--ease-back) both; }
.rv.go .rv-card .t1 { animation-delay: var(--rv-traits); }
.rv.go .rv-card .t2 { animation-delay: calc(var(--rv-traits) + var(--rv-trait-gap)); }
.rv.go .rv-card .t3 { animation-delay: calc(var(--rv-traits) + var(--rv-trait-gap) * 2); }
.rv.go .rv-card .t4 { animation-delay: calc(var(--rv-traits) + var(--rv-trait-gap) * 3); }
.rv.go .rv-card .t4 .lock { animation: rvLock 500ms ease-in-out var(--rv-lock) 2 both; }
.rv.go .rv-teaser { animation: rvTease 500ms ease-out var(--rv-tease) both; }
.rv.go .rv-after { animation: rvAfter 400ms ease-out var(--rv-end) both; }
@keyframes rvIdle { 50% { transform: translateY(-10px); } }
@keyframes rvCharge { 0% { transform: none; } 20% { transform: rotate(-4deg) scale(.96); } 40% { transform: rotate(5deg) scale(.94); } 60% { transform: rotate(-8deg) scale(.92); } 80% { transform: rotate(10deg) scale(.9); } 92% { transform: rotate(-12deg) scale(.88); } 100% { transform: scale(1.15); } }
@keyframes rvFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes rvFadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes rvDim { 0% { background: rgba(0,0,0,0); } 50% { background: rgba(0,0,0,.45); } 100% { background: rgba(0,0,0,0); } }
@keyframes rvLid { to { transform: translate(160px, -260px) rotate(70deg); opacity: 0; } }
@keyframes rvBoxOut { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(1.6); visibility: hidden; } }
@keyframes rvGlow { 0% { opacity: 0; transform: scale(.4); } 85% { opacity: 1; transform: scale(1.1); } 100% { opacity: 0; transform: scale(2.2); } }
@keyframes rvFlash { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }
@keyframes rvRays { 0% { opacity: 0; transform: rotate(0) scale(.6); } 15% { opacity: 1; transform: rotate(15deg) scale(1); } 100% { opacity: .75; transform: rotate(90deg) scale(1); } }
@keyframes rvRarity { from { opacity: 0; transform: scale(1.6); letter-spacing: 1em; } to { opacity: 1; transform: scale(1); letter-spacing: .5em; } }
@keyframes rvGather { from { opacity: 0; transform: translate(var(--x), var(--y)) scale(.5); } to { opacity: 1; transform: translate(calc(var(--x) * .2), calc(var(--y) * .2)) scale(1); } }
@keyframes rvScatter { from { opacity: 1; transform: translate(0, 0) scale(1.4); } to { opacity: 0; transform: translate(calc(var(--x) * 2), calc(var(--y) * 2)) scale(.3); } }
@keyframes rvCard { 0% { opacity: 0; transform: scale(.3) rotateY(90deg) translateY(60px); } 70% { opacity: 1; transform: scale(1.08) rotateY(-10deg); } 100% { opacity: 1; transform: none; } }
@keyframes rvHolo { from { transform: translateX(-120%); } to { transform: translateX(120%); } }
@keyframes rvTrait { from { opacity: 0; transform: translateY(12px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes rvLock { 25% { transform: rotate(-18deg); } 75% { transform: rotate(14deg); } }
@keyframes rvTease { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
@keyframes rvAfter { from { opacity: 0; transform: translateY(12px); visibility: visible; } to { opacity: 1; transform: none; visibility: visible; } }
@media (max-width: 1100px) { .rv-teaser { left: 50%; top: auto; bottom: 86px; margin-left: -115px; } }
@media (max-height: 760px) { .rv-card { transform-origin: center; scale: .82; } }
@media (prefers-reduced-motion: reduce) {
  .rv.go *, .rv.go { animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; }
  .react, .sticker, .sticker span, .typing.t-fire .dots { animation: none !important; }
}
.rv-card, .rv-teaser, .rv-rarity, .rv-glow, .rv-rays, .rv-sparks { pointer-events: none; }
