:root {
  --bg: #0e1116; --panel: #161b22; --panel2: #1c232d; --line: #2a3340;
  --txt: #e6edf3; --muted: #8b97a7; --accent: #d9a066; --accent2: #6fa8dc;
  --danger: #e06c75; --ok: #7ec699; --radius: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg); color: var(--txt); line-height: 1.5;
}
.view { min-height: 100vh; }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select {
  font-family: inherit; font-size: 15px; background: var(--panel2); color: var(--txt);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
button {
  background: var(--accent); color: #1a1208; border: none; border-radius: 10px;
  padding: 11px 16px; font-size: 15px; font-weight: 600;
}
button:active { transform: translateY(1px); }
.link { background: none; color: var(--accent2); padding: 0; font-weight: 400; }
.muted { color: var(--muted); font-size: 13px; }
.err { color: var(--danger); font-size: 13px; min-height: 16px; }
h2 { font-size: 18px; margin: 0; }
h3 { font-size: 16px; margin: 0 0 8px; }

/* ---------- 虚拟人：真实照片半动画 ---------- */
.avatar-frame { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.avatar-stage { position: relative; width: 240px; height: 300px; display: flex; align-items: center; justify-content: center; }
/* 旋转光环 */
.avatar-ring {
  position: absolute; width: 268px; height: 268px; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(255,180,120,.0), rgba(255,180,120,.35), rgba(255,210,150,.05), rgba(255,180,120,.35), rgba(255,180,120,.0));
  animation: ring-spin 14s linear infinite; pointer-events: none; filter: blur(2px);
}
@keyframes ring-spin { to { transform: rotate(360deg); } }
/* 照片本体：持续呼吸 + 微浮动 = “活着的照片” */
.avatar-photo {
  position: relative; width: 220px; height: 280px; border-radius: 18px; overflow: hidden;
  background: #0e1116; border: 1px solid var(--line); box-shadow: 0 10px 36px rgba(0,0,0,.5);
  animation: breathe 4.5s ease-in-out infinite; will-change: transform;
}
@keyframes breathe {
  0%,100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.025); }
}
.avatar-photo-img { width: 100%; height: 100%; object-fit: cover; display: block; transition: filter .5s ease; }
/* 扫光（动画感来源之一） */
.avatar-light-sweep {
  position: absolute; top: 0; left: -60%; width: 60%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.28), transparent);
  transform: skewX(-18deg); pointer-events: none; animation: sweep 6s ease-in-out infinite;
}
@keyframes sweep { 0% { left: -60%; } 55%,100% { left: 120%; } }
.avatar-glow { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; opacity: .9; transition: background .5s ease; }
/* 说话时的“嘴”提示：照片下半部柔光开合 */
.avatar-mouth {
  position: absolute; left: 50%; bottom: 22%; width: 46px; height: 14px; transform: translateX(-50%) scaleY(.15);
  background: radial-gradient(ellipse at center, rgba(255,200,150,.0), rgba(255,170,110,.0));
  border-radius: 50%; pointer-events: none; opacity: 0; transition: opacity .2s;
}
/* 漂浮粒子 */
.avatar-particles { position: absolute; inset: 0; pointer-events: none; }
.avatar-particles i {
  position: absolute; width: 5px; height: 5px; border-radius: 50%; background: rgba(255,200,150,.7);
  box-shadow: 0 0 8px rgba(255,190,130,.8); animation: float-up 7s ease-in-out infinite;
}
.avatar-particles i:nth-child(1) { left: 18%; bottom: 8%; animation-delay: 0s; }
.avatar-particles i:nth-child(2) { left: 72%; bottom: 14%; animation-delay: 1.4s; background: rgba(255,170,110,.6); }
.avatar-particles i:nth-child(3) { left: 38%; bottom: 4%; animation-delay: 2.6s; }
.avatar-particles i:nth-child(4) { left: 88%; bottom: 26%; animation-delay: 3.8s; background: rgba(255,210,150,.55); }
.avatar-particles i:nth-child(5) { left: 8%; bottom: 30%; animation-delay: 5.1s; }
@keyframes float-up {
  0% { transform: translateY(0); opacity: 0; }
  20% { opacity: .9; }
  100% { transform: translateY(-46px); opacity: 0; }
}
/* 语音条：说话时跳动 */
.voice-bars { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; height: 22px; align-items: flex-end; opacity: 0; transition: opacity .25s; }
.voice-bars i { width: 4px; height: 6px; border-radius: 2px; background: linear-gradient(#ffd2a0,#ff9d5c); }
.avatar-photo.speaking ~ .voice-bars, .avatar-stage.speaking .voice-bars { opacity: 1; }
.avatar-stage.speaking .voice-bars i { animation: vb 0.5s ease-in-out infinite; }
.avatar-stage.speaking .voice-bars i:nth-child(2){animation-delay:.1s}
.avatar-stage.speaking .voice-bars i:nth-child(3){animation-delay:.2s}
.avatar-stage.speaking .voice-bars i:nth-child(4){animation-delay:.05s}
.avatar-stage.speaking .voice-bars i:nth-child(5){animation-delay:.25s}
.avatar-stage.speaking .voice-bars i:nth-child(6){animation-delay:.15s}
.avatar-stage.speaking .voice-bars i:nth-child(7){animation-delay:.3s}
@keyframes vb { 0%,100%{ height:6px } 50%{ height:20px } }
/* 说话态：呼吸加快 + 嘴开合 + 光晕增强 */
.avatar-photo.speaking { animation: breathe-talk .9s ease-in-out infinite; }
@keyframes breathe-talk { 0%,100%{ transform: translateY(0) scale(1); } 50%{ transform: translateY(-3px) scale(1.02); } }
.avatar-stage.speaking .avatar-mouth { opacity: 1; animation: mouth-talk .42s ease-in-out infinite; }
@keyframes mouth-talk { 0%,100%{ transform: translateX(-50%) scaleY(.18); } 50%{ transform: translateX(-50%) scaleY(1); } }
.avatar-stage.speaking .avatar-light-sweep { animation-duration: 2.4s; }
.avatar-select { max-width: 240px; font-size: 13px; }
/* 表情 = 滤镜氛围 + 呼吸节奏（脸始终是父亲本人） */
.avatar-photo.exp-happy .avatar-photo-img { filter: brightness(1.07) saturate(1.12) contrast(1.02); }
.avatar-photo.exp-happy { animation-duration: 3.2s; }
.avatar-photo.exp-warm .avatar-photo-img,
.avatar-photo.exp-smile .avatar-photo-img,
.avatar-photo.exp-soft .avatar-photo-img { filter: brightness(1.04) saturate(1.08); }
.avatar-photo.exp-sad .avatar-photo-img,
.avatar-photo.exp-worried .avatar-photo-img,
.avatar-photo.exp-concerned .avatar-photo-img { filter: brightness(.82) saturate(.7) contrast(.98); }
.avatar-photo.exp-sad { animation-duration: 6.5s; }
.avatar-photo.exp-thinking .avatar-photo-img { filter: brightness(.95) saturate(.85) contrast(1.02); }
.avatar-photo.exp-thinking { animation-duration: 5s; }
.avatar-photo.exp-calm .avatar-photo-img { filter: brightness(1.02) saturate(1.02); }
/* 小按钮 */
.mini-btn { font-size: 12px; padding: 4px 10px; border-radius: 8px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); cursor: pointer; }
.mini-btn:hover { color: var(--accent); border-color: var(--accent); }

/* 登录 */
.login { display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card {
  width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 28px 22px; text-align: center;
}
.brand { font-size: 26px; font-weight: 700; letter-spacing: 2px; }
.brand span { color: var(--accent); font-size: 14px; letter-spacing: 1px; }
.brand.small { font-size: 18px; }
.brand.small span { display: none; }
.tag { color: var(--muted); font-size: 13px; margin: 8px 0 20px; }
.login-card input { margin-bottom: 12px; text-align: center; }
.login-card button { width: 100%; margin-top: 6px; letter-spacing: 4px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 14px; }

/* 顶栏 + tab */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.who { font-size: 13px; color: var(--muted); }
main { padding: 16px 16px 90px; max-width: 980px; margin: 0 auto; }
.section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--panel);
  border-top: 1px solid var(--line); z-index: 20;
}
.tabbar button {
  flex: 1; background: none; color: var(--muted); border-radius: 0; padding: 12px 4px;
  font-size: 13px; font-weight: 400;
}
.tabbar button.active { color: var(--accent); }

/* 相册：大图卡 + 点击跳出全尺寸 + 时间/地点/人物/场景描述 */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.pcard { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.pcard-media { position: relative; background: #000; aspect-ratio: 4 / 3; overflow: hidden; }
.pcard-img, .pcard-vid { width: 100%; height: 100%; object-fit: cover; display: block; cursor: pointer; transition: transform .4s ease; }
.pcard:hover .pcard-img, .pcard:hover .pcard-vid { transform: scale(1.04); }
.pc-badge { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; padding: 3px 8px; border-radius: 8px; pointer-events: none; }
.pc-edit { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.55); color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 8px; font-size: 12px; padding: 4px 9px; cursor: pointer; backdrop-filter: blur(4px); }
.pc-edit:hover { background: var(--accent); color: #1a1208; }
.pcard-cap { padding: 11px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.pc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pc-chip { font-size: 12px; color: var(--muted); background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 3px 9px; }
.pc-chip b { color: var(--accent); font-weight: 600; margin-right: 5px; }
.pc-desc { font-size: 14.5px; color: var(--txt); margin: 2px 0 0; line-height: 1.55; }

/* 虚拟人 */
.stage { text-align: center; margin-bottom: 14px; }
.avatar-frame {
  width: 200px; height: 216px; margin: 0 auto; border-radius: 18px; overflow: hidden;
  border: 1px solid var(--line); background: var(--panel);
}
.avatar-svg { width: 100%; height: 100%; }
.status-row { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.emotion-tag { background: var(--panel2); padding: 1px 8px; border-radius: 8px; font-size: 12px; }
.ctx-hint { font-size: 12px; color: var(--accent); margin-top: 6px; }
.speech {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin-top: 10px; min-height: 44px; font-size: 15px; text-align: left;
}
.chat { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.msg { max-width: 82%; padding: 10px 13px; border-radius: 14px; font-size: 15px; line-height: 1.5; }
.msg.me { align-self: flex-end; background: var(--accent); color: #1a1208; border-bottom-right-radius: 4px; }
.msg.dad { align-self: flex-start; background: var(--panel2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.composer { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { resize: none; max-height: 120px; }
.composer button { flex: 0 0 auto; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.quick button {
  background: var(--panel2); color: var(--txt); border: 1px solid var(--line);
  font-weight: 400; font-size: 13px; padding: 7px 12px;
}
.voice-sel { width: auto; flex: 0 0 auto; max-width: 220px; font-size: 12px; padding: 6px 8px; color: var(--muted); }

/* 留言墙 */
.wall-compose { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 16px; }
.wall-compose textarea { margin-bottom: 10px; }
.train-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.train-row input { width: auto; }
.wall { display: flex; flex-direction: column; gap: 10px; }
.wall-item { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.wall-item .who2 { font-size: 12px; color: var(--accent); margin-bottom: 4px; }
.wall-item .txt { font-size: 15px; }
.wall-item .tag2 { display: inline-block; margin-top: 6px; font-size: 11px; color: var(--ok); border: 1px solid var(--ok); border-radius: 6px; padding: 0 6px; }

/* 设置 */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 14px; }
.card label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.card label.row { display: flex; align-items: center; justify-content: space-between; }
.card label.row input { width: auto; }
.card input, .card textarea, .card select { color: var(--txt); }
.card button { margin-top: 12px; width: 100%; }
.card h3 { border-bottom: 1px solid var(--line); padding-bottom: 8px; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal-box { position: relative; max-width: 94vw; max-height: 90vh; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.modal-box img, .modal-box video { max-width: 94vw; max-height: 64vh; border-radius: 12px; display: block; background: #000; }
.modal-close { position: absolute; top: -38px; right: 0; background: none; color: #fff; font-size: 22px; }
.modal-chat { display: block; margin: 0 auto; background: var(--accent); width: auto; }
.modal-info { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; max-width: 560px; width: 100%; }
.modal-info .mi-time { font-size: 14px; color: var(--accent); margin-bottom: 10px; font-weight: 600; }
.modal-info .mi-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.modal-info .mi-row > span { flex: 0 0 64px; color: var(--muted); font-size: 13px; padding-top: 10px; }
.modal-info .mi-row input, .modal-info .mi-row textarea { flex: 1; }
.modal-info .mi-desc textarea { min-height: 64px; }
.modal-info .mini-btn { margin-top: 4px; }

@media (min-width: 720px) {
  .avatar-frame { width: 240px; height: 260px; }
}

.build-ver { font-size:11px; color:#8b7355; text-align:right; padding:8px 14px; opacity:.7; }

/* === v3 美化：LOGO 光晕 / 菜单 SVG / 鼠标星光 / 大图弹窗 === */

body { background: linear-gradient(180deg, #0a0e2a 0%, #1a1f4a 40%, #2a2550 100%); color: #f0e9d8; min-height: 100vh; }
#app { background: transparent; }

/* 顶部 LOGO */
.brand-group { display: flex; align-items: center; gap: 12px; }
.brand-text { display: flex; flex-direction: column; }
.logo-wrap { position: relative; width: 48px; height: 48px; cursor: pointer; flex-shrink: 0; }
.brand-logo { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; display: block; position: relative; z-index: 2; transition: transform .35s cubic-bezier(.34,1.56,.64,1); box-shadow: 0 2px 12px rgba(0,0,0,.4); }
.logo-wrap:hover .brand-logo { transform: scale(1.08) rotate(-4deg); }
.logo-glow { position: absolute; inset: -6px; border-radius: 50%; background: radial-gradient(circle, rgba(255,220,150,.7) 0%, rgba(255,180,90,.3) 40%, transparent 70%); filter: blur(8px); z-index: 1; animation: logoGlow 3.2s ease-in-out infinite; pointer-events: none; }
@keyframes logoGlow {
  0%, 100% { opacity: .55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.18); }
}

.topbar { padding: 12px 18px; border-bottom: 1px solid rgba(255,220,150,.12); background: rgba(10,14,42,.65); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.topbar .brand.small { font-size: 18px; color: #f5e6c8; }
.topbar .brand.small span { color: #b8a888; font-weight: 400; font-size: 13px; margin-left: 6px; letter-spacing: 1px; }
.topbar .tag { color: #9d9078; font-size: 11px; margin-top: 2px; }
.topbar .who { color: #c8b890; }

/* tabbar SVG */
.tabbar { display: flex; justify-content: space-around; padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); background: rgba(10,14,42,.85); border-top: 1px solid rgba(255,220,150,.15); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.tabbar button { background: none; color: #9d9078; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 10px; font-size: 11px; border-radius: 10px; transition: all .2s; }
.tabbar button .tab-ic { width: 22px; height: 22px; transition: transform .25s; }
.tabbar button.active { color: #f5d488; }
.tabbar button.active .tab-ic { transform: translateY(-2px); filter: drop-shadow(0 0 6px rgba(255,200,120,.6)); }
.tabbar button:hover { color: #f5d488; background: rgba(255,220,150,.06); }

/* 鼠标星光 */
.star-layer { position: fixed; inset: 0; pointer-events: none; z-index: 9999; overflow: hidden; }
.star { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: radial-gradient(circle, #fff 0%, #ffe9b3 40%, transparent 70%); pointer-events: none; transform: translate(-50%, -50%); animation: starFade .9s ease-out forwards; box-shadow: 0 0 6px rgba(255,235,180,.9); }
.star.s2 { width: 4px; height: 4px; background: radial-gradient(circle, #fff 0%, #b8d4ff 40%, transparent 70%); box-shadow: 0 0 5px rgba(180,210,255,.8); }
.star.s3 { width: 3px; height: 3px; background: #fff; }
@keyframes starFade {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(.2); }
  20%  { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, 0px))) scale(.4); }
}

/* LOGO 大图 modal */
#logoModal { position: fixed; inset: 0; background: rgba(5,8,25,.92); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: modalIn .35s ease-out; }
@keyframes modalIn { from { opacity: 0; } to { opacity: 1; } }
.logo-modal-box { display: flex; flex-direction: column; align-items: center; gap: 18px; max-width: 90vw; }
.logo-big { width: min(72vw, 420px); height: min(72vw, 420px); border-radius: 24px; object-fit: cover; box-shadow: 0 20px 80px rgba(0,0,0,.7), 0 0 60px rgba(255,220,150,.35); animation: logoZoom .5s cubic-bezier(.34,1.56,.64,1); }
@keyframes logoZoom { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.logo-modal-cap { text-align: center; }
.logo-modal-title { color: #f5e6c8; font-size: 28px; font-weight: 500; letter-spacing: 2px; }
.logo-modal-title span { color: #b8a888; font-size: 14px; font-weight: 400; margin-left: 8px; letter-spacing: 1px; }
.logo-modal-sub { color: #9d9078; font-size: 13px; margin-top: 6px; }
#logoModalClose { position: fixed; top: 24px; right: 24px; background: rgba(255,255,255,.08); color: #f5e6c8; border: 1px solid rgba(255,220,150,.2); width: 40px; height: 40px; border-radius: 50%; font-size: 22px; cursor: pointer; transition: all .2s; }
#logoModalClose:hover { background: rgba(255,220,150,.15); transform: rotate(90deg); }

/* 适配：保留原卡片/聊天等元素在深色背景上的可读性 */
.card, .gallery .pcard, .wall-item, .modal-box { background: rgba(20,25,55,.78); border: 1px solid rgba(255,220,150,.12); }
input, textarea, select { background: rgba(255,255,255,.05); color: #f0e9d8; border-color: rgba(255,220,150,.18); }
input::placeholder, textarea::placeholder { color: #6a6478; }
button { background: linear-gradient(135deg, #c08a4d, #8a5a2e); color: #fff; }
button:hover { filter: brightness(1.1); }
.muted, .pc-k { color: #9d9078 !important; }
