/* 嘟嘟陪陪 · 暖奶油 + 珊瑚色，安静、温暖、可依赖 */
:root {
  --cream: #f6efe5;
  --cream-deep: #efe4d5;
  --paper: #fffaf3;
  --paper-2: #fdf4ea;
  --ink: #241f1c;
  --ink-2: #4f443d;
  --muted: #8f8174;
  --coral: #e97862;
  --coral-deep: #cf5f4a;
  --peach: #f3b49c;
  --butter: #f3d59a;
  --plum: #774a48;
  --line: rgba(36, 31, 28, .1);
  --shadow: 0 18px 45px rgba(88, 52, 38, .14);
  --shadow-soft: 0 8px 24px rgba(88, 52, 38, .09);
  --radius: 22px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { height: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { 
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background:
    radial-gradient(110% 72% at 84% -4%, rgba(243, 181, 156, .52), transparent 58%),
    radial-gradient(80% 55% at -8% 28%, rgba(243, 213, 154, .35), transparent 60%),
    linear-gradient(180deg, #f9f2e8 0%, #f5ece0 42%, #f2e6d7 100%);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}
h1, h2, h3, p, strong, small, span, button, input { overflow-wrap: break-word; }
body.modal-open, body.chat-open, body.album-open { overflow: hidden; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; }
[hidden] { display: none !important; }

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.icon.solid { fill: currentColor; stroke: none; }

.app { width: 100%; max-width: 680px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; }
.view { width: 100%; }

/* ===== 首页 ===== */
.home-view { padding: calc(18px + var(--safe-top)) 20px 34px; }
.home-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand-mark { display: inline-flex; align-items: flex-end; gap: 2px; height: 18px; margin-right: 2px; }
.brand-mark i { display: block; width: 3px; border-radius: 3px; background: var(--coral); }
.brand-mark i:nth-child(1) { height: 9px; opacity: .55; }
.brand-mark i:nth-child(2) { height: 16px; }
.brand-mark i:nth-child(3) { height: 11px; opacity: .75; }
.brand-name { font-family: "Songti SC", "STSong", "SimSun", serif; font-size: 21px; font-weight: 700; letter-spacing: .04em; }
.brand-en { font-size: 9px; letter-spacing: .26em; color: var(--muted); transform: translateY(-2px); }
.ghost-pill {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--line); background: rgba(255, 250, 243, .45);
  color: var(--ink-2); border-radius: 999px; padding: 7px 12px; font-size: 12px;
}
.ghost-pill .icon { width: 15px; height: 15px; }

.hero { position: relative; padding: 34px 0 0; }
.eyebrow { display: flex; align-items: center; gap: 9px; margin: 0 0 16px; font-size: 9px; letter-spacing: .22em; color: var(--coral-deep); font-weight: 700; }
.eyebrow > span { display: inline-block; width: 22px; height: 1px; background: var(--coral); }
.hero h1 {
  margin: 0;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-weight: 600;
  font-size: clamp(38px, 10.8vw, 56px);
  line-height: 1.1;
  letter-spacing: -.035em;
}
.hero h1 em { font-style: normal; color: var(--coral-deep); position: relative; white-space: nowrap; }
.hero h1 em::after {
  content: ""; position: absolute; left: 1px; right: 2px; bottom: .04em; height: .16em;
  background: rgba(233, 120, 98, .2); border-radius: 2px; z-index: -1;
}
.hero-lede { margin: 18px 0 0; color: var(--ink-2); font-size: 14px; line-height: 1.75; max-width: 330px; }
.hero-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 19px; border-radius: 999px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; letter-spacing: .01em; transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn:active { transform: scale(.97); }
.btn .icon { width: 17px; height: 17px; }
.btn-primary { background: var(--coral); color: #fff9f2; box-shadow: 0 10px 24px rgba(207, 95, 74, .22); }
.btn-primary:hover { background: var(--coral-deep); }
.btn-soft { background: rgba(255, 250, 243, .74); color: var(--plum); border-color: rgba(119, 74, 72, .16); }
.btn-soft:hover { background: var(--paper); }

.hero-orb {
  position: relative; margin-top: 28px; height: 138px; border-radius: 28px; overflow: hidden;
  background:
    radial-gradient(80% 120% at 82% 20%, rgba(255, 250, 243, .82), transparent 48%),
    linear-gradient(118deg, #f0b29a 0%, #e88f74 46%, #d97462 100%);
  box-shadow: 0 16px 38px rgba(173, 88, 68, .2);
  display: flex; align-items: center; justify-content: center;
}
.hero-orb::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 100% at 20% 100%, rgba(255, 214, 165, .55), transparent 65%); }
.orb-halo {
  position: absolute; width: 190px; height: 190px; border-radius: 50%;
  border: 1px solid rgba(255, 250, 243, .45); top: 50%; left: 50%; transform: translate(-50%, -54%);
  box-shadow: 0 0 0 24px rgba(255, 250, 243, .07), 0 0 0 52px rgba(255, 250, 243, .05);
}
.orb-core { position: relative; display: flex; align-items: center; gap: 5px; height: 54px; z-index: 2; }
.orb-core span { display: block; width: 5px; border-radius: 5px; background: #fff7ee; opacity: .9; animation: breathe 2.4s ease-in-out infinite; }
.orb-core span:nth-child(1) { height: 16px; animation-delay: -.2s; }
.orb-core span:nth-child(2) { height: 34px; animation-delay: -.5s; }
.orb-core span:nth-child(3) { height: 48px; animation-delay: -.9s; }
.orb-core span:nth-child(4) { height: 40px; animation-delay: -.3s; }
.orb-core span:nth-child(5) { height: 26px; animation-delay: -.7s; }
.orb-core span:nth-child(6) { height: 12px; animation-delay: -1.1s; }
.hero-orb p { position: absolute; left: 18px; bottom: 13px; margin: 0; color: rgba(255, 250, 243, .92); font-size: 11px; letter-spacing: .04em; z-index: 2; }

.roster { padding-top: 34px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { margin: 0; font-family: "Songti SC", "STSong", "SimSun", serif; font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.section-count { font-size: 11px; color: var(--muted); letter-spacing: .12em; }
.character-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.skeleton-card { aspect-ratio: 3 / 4; border-radius: var(--radius); background: linear-gradient(110deg, #efe3d4 8%, #f8efe3 18%, #efe3d4 33%); background-size: 200% 100%; animation: shimmer 1.5s linear infinite; }
.load-error { grid-column: 1 / -1; padding: 30px 18px; border-radius: var(--radius); background: rgba(255, 250, 243, .7); text-align: center; color: var(--ink-2); font-size: 13px; line-height: 1.8; }
.load-error small { color: var(--muted); font-size: 10px; }

.character-card {
  position: relative; display: block; width: 100%; aspect-ratio: 3 / 4; padding: 0; overflow: hidden;
  border: 0; border-radius: var(--radius); background: #d9c6b3; text-align: left; color: #fff;
  box-shadow: var(--shadow-soft); isolation: isolate;
  transition: transform .25s ease, box-shadow .25s ease;
}
.character-card:active { transform: scale(.982); }
.character-card img { width: 100%; height: 100%; object-fit: cover; object-position: center 28%; filter: saturate(.92) contrast(.98); transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.character-card:hover img { transform: scale(1.035); }
.card-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(28, 19, 16, .1) 0%, rgba(28, 19, 16, 0) 34%, rgba(28, 19, 16, .22) 67%, rgba(28, 19, 16, .78) 100%);
  z-index: 1;
}
.card-top { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; align-items: center; gap: 6px; z-index: 2; }
.card-meta { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; }
.card-mood { font-size: 10px; letter-spacing: .08em; padding: 5px 8px; border-radius: 999px; background: rgba(255, 250, 243, .24); border: 1px solid rgba(255, 250, 243, .34); backdrop-filter: blur(4px); }
.card-badge {
  font-size: 9px; line-height: 1; letter-spacing: .12em; padding: 5px 7px; border-radius: 6px;
  color: #ffe6bd; background: rgba(28, 19, 16, .58); border: 1px solid rgba(255, 214, 153, .62);
  box-shadow: 0 4px 12px rgba(28, 19, 16, .16); backdrop-filter: blur(5px);
}
.card-age { font-size: 10px; color: rgba(255, 250, 243, .9); white-space: nowrap; }
.card-bottom { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 2; }
.card-bottom strong { display: block; font-family: "Songti SC", "STSong", "SimSun", serif; font-size: 21px; line-height: 1.1; letter-spacing: .02em; }
.card-bottom span { display: block; margin-top: 4px; font-size: 11px; color: rgba(255, 250, 243, .78); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-bottom .card-line { margin-top: 6px; font-size: 10px; line-height: 1.45; color: rgba(255, 250, 243, .6); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; }

.home-foot { margin-top: 30px; padding: 0 4px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.home-foot p { margin: 0; }

/* ===== 聊天 ===== */
.chat-view {
  position: fixed; inset: 0; z-index: 30; width: 100%; max-width: 680px; margin: 0 auto;
  display: flex; flex-direction: column; background: #f7efe4; overflow: hidden;
  padding-top: var(--safe-top);
  box-shadow: 0 0 0 1px rgba(119, 74, 72, .04), 0 30px 80px rgba(56, 32, 23, .18);
}
.chat-view::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(80% 42% at 100% 0%, rgba(243, 180, 156, .3), transparent 65%),
    radial-gradient(70% 40% at 0% 30%, rgba(243, 213, 154, .22), transparent 70%);
}
.chat-top {
  position: relative; z-index: 3; display: flex; align-items: center; gap: 4px;
  padding: 8px 8px 8px 5px; background: rgba(250, 243, 233, .92); border-bottom: 1px solid rgba(119, 74, 72, .08);
}
.icon-btn {
  width: 42px; height: 42px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: transparent; color: var(--ink-2);
}
.icon-btn:active { background: rgba(119, 74, 72, .08); }
.icon-btn .icon { width: 22px; height: 22px; }
.chat-identity { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 4px 0; text-align: left; }
.avatar-wrap { position: relative; width: 38px; height: 38px; flex: 0 0 auto; }
.avatar-wrap img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; box-shadow: 0 2px 8px rgba(63, 38, 28, .16); }
.online-dot { position: absolute; right: 0; bottom: 1px; width: 9px; height: 9px; border-radius: 50%; background: #78a16b; box-shadow: 0 0 0 2px #fbf4ea; }
.chat-name-wrap { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.chat-name-wrap strong { font-family: "Songti SC", "STSong", "SimSun", serif; font-size: 17px; line-height: 1.3; letter-spacing: .02em; }
.chat-name-wrap small { display: flex; align-items: center; gap: 4px; font-size: 10px; color: var(--muted); }
.chat-name-wrap small i { width: 5px; height: 5px; border-radius: 50%; background: #8bab7d; }
#chatProfile .icon { transform: rotate(0); opacity: .7; }

.chat-scroll {
  position: relative; z-index: 1; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
  padding: 12px 16px 8px; scroll-behavior: smooth; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.chat-scroll::-webkit-scrollbar { width: 0; height: 0; }
.chat-date { display: flex; align-items: center; gap: 10px; margin: 8px 0 18px; color: var(--muted); font-size: 10px; }
.chat-date::before, .chat-date::after { content: ""; flex: 1; height: 1px; background: rgba(119, 74, 72, .09); }
.message-list { display: flex; flex-direction: column; gap: 14px; padding-bottom: 10px; }

.msg-row { display: flex; align-items: flex-end; gap: 8px; animation: msgIn .32s cubic-bezier(.2,.8,.2,1) both; }
.msg-row.user { justify-content: flex-end; }
.msg-avatar { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 50%; object-fit: cover; margin-bottom: 2px; box-shadow: 0 2px 7px rgba(63, 38, 28, .12); }
.msg-stack { max-width: min(78%, 430px); display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.msg-row.user .msg-stack { align-items: flex-end; }
.bubble {
  position: relative; max-width: 100%; padding: 10px 13px; border-radius: 6px 17px 17px 17px;
  background: rgba(255, 251, 246, .92); border: 1px solid rgba(119, 74, 72, .09);
  box-shadow: 0 4px 14px rgba(88, 52, 38, .06); font-size: 14px; line-height: 1.62; word-break: break-word;
  white-space: pre-wrap;
}
.bubble.user { background: var(--coral); color: #fffaf4; border-color: transparent; border-radius: 17px 6px 17px 17px; box-shadow: 0 7px 18px rgba(207, 95, 74, .18); }
.bubble .msg-time { display: block; margin-top: 5px; font-size: 9px; color: var(--muted); text-align: right; letter-spacing: .04em; }
.bubble.user .msg-time { color: rgba(255, 250, 244, .7); }
.bubble.voice { padding: 8px 11px 8px 8px; min-width: 172px; }
.bubble.voice.user { background: var(--coral); }
.voice-line { display: flex; align-items: center; gap: 9px; }
.voice-play {
  width: 34px; height: 34px; flex: 0 0 auto; border: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--coral); color: #fff; box-shadow: 0 4px 10px rgba(207, 95, 74, .22);
}
.bubble.voice.user .voice-play { background: rgba(255, 250, 244, .22); color: #fff; box-shadow: none; }
.voice-play .icon { width: 16px; height: 16px; }
.voice-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.voice-bars { display: flex; align-items: center; gap: 2px; height: 17px; }
.voice-bars i { display: block; width: 2px; border-radius: 2px; background: var(--plum); opacity: .45; }
.bubble.voice.user .voice-bars i { background: #fffaf4; opacity: .72; }
.bubble.voice .voice-bars.is-playing i { opacity: .9; animation: voicePulse .55s ease-in-out infinite alternate; }
.voice-duration { font-size: 10px; color: var(--muted); letter-spacing: .06em; }
.bubble.voice.user .voice-duration { color: rgba(255, 250, 244, .74); }
.voice-caption { margin-top: 5px; font-size: 10px; line-height: 1.5; color: var(--muted); max-width: 240px; }
.bubble.voice.user .voice-caption { color: rgba(255, 250, 244, .8); }
.voice-caption.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.bubble.media { padding: 0; background: transparent; border: 0; box-shadow: none; }
.media-card {
  display: block; width: min(62vw, 236px); padding: 0; overflow: hidden;
  border: 1px solid rgba(119, 74, 72, .1); border-radius: 16px;
  background: rgba(255, 251, 246, .9); color: var(--ink); text-align: left;
  box-shadow: 0 8px 22px rgba(88, 52, 38, .1);
}
.media-card img, .media-card video {
  display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: #e8ddd0;
}
.media-card video { background: #1e1b18; }
.media-card .media-label {
  position: absolute; margin: 9px; padding: 3px 8px; border-radius: 999px;
  background: rgba(31, 24, 20, .52); color: #fff; font-size: 9px; letter-spacing: .08em;
}
.media-wrap { position: relative; }
.media-caption {
  padding: 8px 11px 9px; font-size: 11px; line-height: 1.55; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.media-processing {
  width: min(62vw, 236px); aspect-ratio: 3 / 4; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 9px; padding: 16px; text-align: center;
  border-radius: 16px; border: 1px solid rgba(119, 74, 72, .1);
  background: linear-gradient(140deg, rgba(255, 251, 246, .98), rgba(242, 220, 199, .9));
  color: var(--muted); font-size: 11px; line-height: 1.6;
}
.media-spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid rgba(207, 95, 74, .2); border-top-color: var(--coral);
  animation: mediaSpin .9s linear infinite;
}
.media-processing strong { color: var(--ink); font-size: 12px; font-weight: 600; }
.media-time { display: block; margin-top: 4px; font-size: 9px; color: var(--muted); letter-spacing: .04em; }

.media-viewer {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  background: rgba(18, 14, 12, .94); padding: 62px 16px 54px;
}
.media-viewer[hidden] { display: none; }
body.media-open { overflow: hidden; }
.media-viewer img, .media-viewer video { max-width: 100%; max-height: calc(100dvh - 130px); border-radius: 12px; object-fit: contain; }
.media-viewer video { width: 100%; max-width: 520px; }
.media-viewer-tools {
  position: absolute; top: calc(12px + var(--safe-top)); right: 14px; z-index: 2;
  display: flex; align-items: center; gap: 7px;
}
.media-viewer-action {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 12px; border: 1px solid rgba(255, 255, 255, .24); border-radius: 999px;
  background: rgba(255, 255, 255, .12); color: #fff; font-size: 11px; line-height: 1;
  backdrop-filter: blur(6px);
}
.media-viewer-action .icon { width: 14px; height: 14px; }
.media-viewer-caption {
  position: absolute; left: 20px; right: 20px; bottom: calc(18px + var(--safe-bottom)); margin: 0;
  color: rgba(255, 250, 244, .78); font-size: 11px; line-height: 1.5; text-align: center;
}
@keyframes mediaSpin { to { transform: rotate(360deg); } }


.typing { display: inline-flex; align-items: center; gap: 4px; min-height: 42px; padding: 12px 15px; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--coral); opacity: .45; animation: typing 1.1s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
.msg-error { font-size: 10px; color: #b1533e; padding-left: 2px; }

.chat-note { display: flex; align-items: flex-start; gap: 6px; padding: 18px 22px 14px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.chat-note .icon { width: 13px; height: 13px; margin-top: 1px; opacity: .65; }

.chat-bottom {
  position: relative; z-index: 4; flex: 0 0 auto; padding: 0 12px calc(8px + var(--safe-bottom));
  background: linear-gradient(180deg, rgba(247, 239, 228, 0), rgba(247, 239, 228, .92) 22%, #f7efe4 38%);
}
.voice-mode-row { display: flex; align-items: center; gap: 8px; padding: 3px 4px 9px; font-size: 10px; color: var(--muted); }
.voice-mode-hint { color: #a29487; }
.switch { width: 34px; height: 20px; border: 0; border-radius: 999px; background: #d9ccc0; padding: 2px; transition: background .2s ease; }
.switch span { display: block; width: 16px; height: 16px; border-radius: 50%; background: #fffaf3; box-shadow: 0 1px 4px rgba(63, 38, 28, .2); transition: transform .2s ease; }
.switch.is-on { background: var(--coral); }
.switch.is-on span { transform: translateX(14px); }
.quick-row { display: flex; gap: 7px; overflow-x: auto; padding: 0 4px 9px; scrollbar-width: none; }
.quick-row::-webkit-scrollbar { display: none; }
.quick-chip {
  flex: 0 0 auto; border: 1px solid rgba(119, 74, 72, .12); border-radius: 999px; padding: 7px 11px;
  background: rgba(255, 251, 246, .7); color: var(--ink-2); font-size: 11px; white-space: nowrap;
}
.quick-chip:active { background: #f3e3d4; }
.quick-chip.is-media { color: var(--coral-deep); border-color: rgba(207, 95, 74, .2); background: rgba(255, 245, 238, .9); }
.quick-row.is-hidden { display: none; }

.composer {
  display: flex; align-items: center; gap: 4px; padding: 5px 6px; border-radius: 24px;
  background: rgba(255, 251, 246, .92); border: 1px solid rgba(119, 74, 72, .12); box-shadow: 0 8px 24px rgba(88, 52, 38, .1);
}
.composer-mode, .composer-send {
  width: 40px; height: 40px; flex: 0 0 auto; border: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
}
.composer-mode { background: transparent; color: var(--plum); }
.composer-mode .icon { width: 21px; height: 21px; }
.composer.is-voice .composer-mode { background: #f3e7d8; color: var(--coral-deep); }
.composer-field { flex: 1; min-width: 0; display: flex; align-items: center; }
.composer-send { background: var(--coral); color: #fffaf4; box-shadow: 0 5px 12px rgba(207, 95, 74, .2); }
.composer-send .icon { width: 18px; height: 18px; transform: rotate(7deg); }
.composer-send:disabled { opacity: .4; box-shadow: none; }
.message-input {
  width: 100%; min-width: 0; height: 40px; border: 0; outline: 0; background: transparent; padding: 0 5px;
  font-size: 14px; color: var(--ink);
}
.message-input::placeholder { color: #b0a297; }
.composer-talk {
  width: 100%; height: 44px; border: 0; border-radius: 999px; padding: 0 14px;
  background: #f3e7d8; color: var(--plum); font-size: 15px; font-weight: 600; letter-spacing: .02em;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.composer-talk.is-recording {
  background: var(--coral); color: #fffaf4; box-shadow: 0 0 0 6px rgba(233, 120, 98, .14);
}
.composer-talk.is-arming {
  background: #efddc9; transform: scale(.992); opacity: .82;
}
.composer-talk.is-locked {
  background: var(--coral); color: #fffaf4; box-shadow: 0 0 0 8px rgba(233, 120, 98, .2);
}
.chat-disclaimer { margin: 7px 0 0; text-align: center; font-size: 9px; color: #a59789; letter-spacing: .03em; }

/* 按住说话 */
.record-layer {
  position: fixed; inset: 0; z-index: 190; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(36, 26, 23, .26); padding: 0 16px calc(90px + var(--safe-bottom));
}
.record-panel {
  width: 100%; max-width: 380px; text-align: center; padding: 22px 20px 16px; border-radius: 28px;
  background: #fffaf3; box-shadow: 0 24px 60px rgba(36, 26, 23, .26); animation: panelIn .22s ease both;
}
.record-wave { display: flex; align-items: center; justify-content: center; gap: 5px; height: 38px; }
.record-wave i { display: block; width: 4px; border-radius: 4px; background: var(--coral); height: 10px; animation: recordPulse .7s ease-in-out infinite alternate; }
.record-wave i:nth-child(2) { animation-delay: .08s; }
.record-wave i:nth-child(3) { animation-delay: .16s; }
.record-wave i:nth-child(4) { animation-delay: .24s; }
.record-wave i:nth-child(5) { animation-delay: .32s; }
.record-wave i:nth-child(6) { animation-delay: .4s; }
.record-wave i:nth-child(7) { animation-delay: .48s; }
.record-timer { margin: 8px 0 0; font-family: "SF Mono", "Menlo", monospace; font-size: 21px; letter-spacing: .05em; color: var(--ink); }
.record-hint { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.record-hint.is-cancel { color: var(--coral-deep); font-weight: 600; }
.record-cancel { margin-top: 12px; border: 0; background: transparent; color: var(--muted); font-size: 11px; padding: 8px 18px; }

/* ===== 底部角色卡 ===== */
.sheet-backdrop { position: fixed; inset: 0; z-index: 95; background: rgba(36, 26, 23, .3); animation: fadeIn .18s ease both; }
.sheet {
  position: fixed; z-index: 100; left: 50%; bottom: 0; transform: translate(-50%, 104%);
  width: 100%; max-width: 620px; max-height: 92vh; max-height: 92dvh; overflow: hidden; overscroll-behavior: contain;
  display: flex; flex-direction: column;
  border-radius: 28px 28px 0 0; background: var(--paper);
  box-shadow: 0 -20px 60px rgba(36, 26, 23, .24); transition: transform .32s cubic-bezier(.2,.8,.2,1);
  visibility: hidden; pointer-events: none;
}
.sheet.is-open { transform: translate(-50%, 0); visibility: visible; pointer-events: auto; }
.sheet-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.sheet-scroll::-webkit-scrollbar { width: 0; height: 0; }
.sheet-grab { position: relative; flex: 0 0 auto; z-index: 10; height: 18px; background: linear-gradient(180deg, rgba(255,250,243,.96), rgba(255,250,243,0)); pointer-events: none; }
.sheet-grab::after { content: ""; position: absolute; top: 7px; left: 50%; width: 36px; height: 4px; border-radius: 4px; background: #d8c8ba; transform: translateX(-50%); }
.sheet-close { position: absolute; top: 10px; right: 10px; z-index: 12; width: 36px; height: 36px; background: rgba(255, 250, 243, .8); color: var(--ink-2); }
.sheet-close .icon { width: 18px; height: 18px; }
.sheet-hero { position: relative; height: 300px; overflow: hidden; margin: 0 14px; border-radius: 22px; background: #d9c6b3; }
.sheet-hero img { width: 100%; height: 100%; object-fit: cover; object-position: center 24%; }
.sheet-hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(30,20,17,.05) 0%, rgba(30,20,17,0) 35%, rgba(30,20,17,.7) 100%); }
.sheet-hero-text { position: absolute; left: 16px; right: 16px; bottom: 14px; color: #fffaf4; }
.sheet-kicker { margin: 0 0 3px; font-size: 9px; letter-spacing: .18em; text-transform: uppercase; color: rgba(255,250,244,.75); }
.sheet-hero-text h2 { margin: 0; font-family: "Songti SC", "STSong", "SimSun", serif; font-size: 30px; line-height: 1.15; font-weight: 600; }
.sheet-hero-text h2 small { font-family: -apple-system, sans-serif; font-size: 11px; font-weight: 400; margin-left: 8px; color: rgba(255,250,244,.8); }
.sheet-tagline { margin: 2px 0 0; font-size: 12px; color: rgba(255,250,244,.82); }
.sheet-body { padding: 18px 20px 12px; }
.sheet-quote { margin: 0 0 16px; padding-left: 12px; border-left: 2px solid var(--peach); font-family: "Songti SC", "STSong", serif; font-size: 18px; line-height: 1.55; color: var(--plum); }
.sheet-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sheet-facts > div { padding: 10px 10px 9px; border-radius: 13px; background: #f8efe3; min-width: 0; }
.sheet-facts span { display: block; font-size: 9px; color: var(--muted); letter-spacing: .08em; }
.sheet-facts strong { display: block; margin-top: 4px; font-size: 11px; font-weight: 600; color: var(--ink-2); line-height: 1.45; }
.sheet-section { margin-top: 18px; }
.sheet-section h3 { margin: 0 0 6px; font-size: 11px; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.sheet-section p { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.75; }
.sheet-prompts { display: flex; flex-wrap: wrap; gap: 7px; }
.sheet-prompts span, .sheet-prompts button {
  padding: 7px 10px; border: 0; border-radius: 999px; background: #f8efe3; color: var(--ink-2); font-size: 11px;
  text-align: left;
}
.sheet-prompts button:active { background: #f1e1d2; }
.sheet-actions {
  display: flex; flex: 0 0 auto; gap: 9px; margin: 0;
  padding: 12px 20px calc(14px + var(--safe-bottom));
  background: linear-gradient(180deg, rgba(255,250,243,.55), var(--paper) 30%);
  border-top: 1px solid rgba(119, 74, 72, .08);
}
.sheet-actions .btn { flex: 1; }
.sheet-actions .btn-primary { flex: 1.15; }
.sheet-actions .btn .icon { width: 16px; height: 16px; }
.about-sheet { display: block; overflow-y: auto; }
.about-sheet::-webkit-scrollbar { width: 0; height: 0; }

.about-head { padding: 10px 22px 4px; }
.about-head h2 { margin: 0 0 8px; font-family: "Songti SC", "STSong", serif; font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
.about-head p:not(.eyebrow) { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.75; }
.about-list { padding: 12px 22px 8px; }
.about-list > div { padding: 13px 0; border-top: 1px solid rgba(119, 74, 72, .09); display: grid; grid-template-columns: 58px 1fr; gap: 12px; }
.about-list b { font-size: 12px; color: var(--plum); }
.about-list span { font-size: 12px; color: var(--ink-2); line-height: 1.7; }
.about-sign { padding: 12px 22px calc(26px + var(--safe-bottom)); color: var(--muted); font-size: 9px; letter-spacing: .22em; }

.home-top-actions { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; }
.home-top-actions .ghost-pill { padding: 7px 10px; }
.home-top-actions .ghost-pill#accountBtn { max-width: 112px; }
.home-top-actions .ghost-pill#accountBtn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.voice-secure-hint {
  margin: 0 2px 6px; padding: 7px 10px; border-radius: 10px;
  background: rgba(233, 120, 98, .08); color: var(--coral-deep);
  font-size: 10px; line-height: 1.6;
}
.voice-secure-hint a { color: var(--coral-deep); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.voice-file-btn {
  display: block; margin: 7px auto 0; border: 0; background: transparent;
  color: var(--coral-deep); font-size: 10px; text-decoration: underline; text-underline-offset: 3px;
}

/* ===== 角色主页 ===== */
.profile-hero { position: relative; height: 360px; overflow: hidden; margin: 0 14px; border-radius: 22px; background: #d9c6b3; }
.profile-hero img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; }
.profile-hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(30,20,17,.04) 0%, rgba(30,20,17,0) 32%, rgba(30,20,17,.74) 100%); }
.profile-hero-top { position: absolute; top: 46px; left: 11px; right: 11px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.profile-badge { padding: 5px 9px; border-radius: 999px; background: rgba(233,120,98,.9); color: #fffaf4; font-size: 9px; letter-spacing: .12em; }
.profile-fav {
  display: inline-flex; align-items: center; gap: 5px; border: 1px solid rgba(255,250,244,.35);
  border-radius: 999px; padding: 7px 11px; background: rgba(36,26,23,.38); color: #fffaf4;
  font-size: 11px; backdrop-filter: blur(8px);
}
.profile-fav .icon { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.profile-fav.is-on { background: rgba(233,120,98,.92); border-color: rgba(233,120,98,.92); }
.profile-fav.is-on .icon { fill: currentColor; }
.profile-hero-text { position: absolute; left: 16px; right: 16px; bottom: 15px; color: #fffaf4; }
.profile-hero-text h2 { margin: 0; font-family: "Songti SC", "STSong", "SimSun", serif; font-size: 32px; line-height: 1.15; font-weight: 600; }
.profile-hero-text h2 small { font-family: -apple-system, sans-serif; font-size: 11px; font-weight: 400; margin-left: 8px; color: rgba(255,250,244,.8); }
.profile-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.profile-facts > div { padding: 10px 10px 9px; border-radius: 13px; background: #f8efe3; min-width: 0; }
.profile-facts span { display: block; font-size: 9px; color: var(--muted); letter-spacing: .08em; }
.profile-facts strong { display: block; margin-top: 4px; font-size: 11px; font-weight: 600; color: var(--ink-2); line-height: 1.45; }
.profile-album-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(119,74,72,.1); }
.profile-album-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.profile-eyebrow { display: flex; align-items: center; gap: 5px; margin: 0 0 5px; font-size: 8px; letter-spacing: .2em; color: var(--coral-deep); font-weight: 700; }
.profile-eyebrow .icon { width: 12px; height: 12px; }
.profile-album-head h3 { margin: 0; font-family: "Songti SC", "STSong", serif; font-size: 20px; font-weight: 600; }
.profile-album-desc { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.profile-album-count { flex: 0 0 auto; padding: 4px 8px; border-radius: 999px; background: #f2e3d5; color: var(--coral-deep); font-size: 9px; }
.profile-album-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 10px; padding-bottom: 2px; scrollbar-width: none; }
.profile-album-tabs[hidden] { display: none; }
.profile-album-tabs::-webkit-scrollbar { display: none; }
.profile-album-tab { flex: 0 0 auto; border: 1px solid rgba(119,74,72,.14); border-radius: 999px; background: #fffaf4; color: var(--ink-2); padding: 7px 11px; font-size: 10px; line-height: 1; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-album-tab.is-active { border-color: rgba(233,120,98,.5); background: #f8e3d7; color: var(--coral-deep); font-weight: 600; }
.profile-album-grid { display: block; }
.profile-album-cover {
  position: relative; display: block; width: 100%; padding: 0; border: 0; overflow: hidden;
  border-radius: 18px; background: #e8d8c7; aspect-ratio: 4 / 5; text-align: left;
  box-shadow: 0 10px 26px rgba(88, 52, 38, .12);
}
.profile-album-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.profile-album-cover:active img { transform: scale(1.025); }
.profile-album-cover.is-locked img { filter: saturate(.72) brightness(.82); }
.profile-album-cover-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(25,16,13,.05) 35%, rgba(25,16,13,.68) 100%);
}
.profile-album-cover-badge {
  position: absolute; top: 11px; right: 11px; display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 9px; border-radius: 999px; background: rgba(28,19,16,.58); color: #ffe6bd;
  font-size: 9px; letter-spacing: .04em; backdrop-filter: blur(6px);
}
.profile-album-cover-badge .icon { width: 12px; height: 12px; }
.profile-album-cover-copy {
  position: absolute; left: 14px; right: 14px; bottom: 13px; display: flex; align-items: flex-end;
  justify-content: space-between; gap: 10px; color: #fffaf4;
}
.profile-album-cover-copy strong { display: block; font-family: "Songti SC", "STSong", serif; font-size: 21px; line-height: 1.25; }
.profile-album-cover-copy small { display: block; margin-top: 3px; color: rgba(255,250,244,.82); font-size: 10px; line-height: 1.45; }
.profile-album-cover-cta {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 3px; padding: 8px 11px;
  border-radius: 999px; background: rgba(255,250,244,.92); color: var(--coral-deep);
  font-size: 10px; font-weight: 700; white-space: nowrap;
}
.profile-album-cover-cta .icon { width: 12px; height: 12px; }
.profile-album-note { margin: 10px 0 0; color: var(--muted); font-size: 9px; }
.profile-empty { padding: 24px 6px; text-align: center; color: var(--muted); font-size: 12px; }

/* ===== 写真集详情 / 购买 ===== */
.album-view {
  position: fixed; inset: 0; z-index: 80; width: 100%; max-width: 680px; margin: 0 auto;
  display: flex; flex-direction: column; background:
    radial-gradient(90% 52% at 88% -6%, rgba(243,181,156,.42), transparent 60%),
    linear-gradient(180deg, #f9f2e8, #f3e8da 62%, #efe2d2);
}
.album-view-top {
  display: flex; align-items: center; gap: 10px; flex: 0 0 auto;
  padding: calc(12px + var(--safe-top)) 14px 12px; border-bottom: 1px solid rgba(119,74,72,.08);
  background: rgba(249,242,232,.88); backdrop-filter: blur(14px);
}
.album-view-icon {
  width: 40px; height: 40px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(119,74,72,.12); border-radius: 50%; background: rgba(255,250,243,.75); color: var(--ink-2);
}
.album-view-icon .icon { width: 19px; height: 19px; }
.album-view-head { flex: 1; min-width: 0; }
.album-view-head p { margin: 0 0 2px; font-size: 8px; letter-spacing: .2em; color: var(--coral-deep); font-weight: 700; }
.album-view-head h2 { margin: 0; font-family: "Songti SC", "STSong", serif; font-size: 23px; line-height: 1.25; font-weight: 600; }
.album-view-head small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.album-view-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px calc(24px + var(--safe-bottom)); }
.album-view-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.album-view-grid .profile-photo {
  position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 14px;
  overflow: hidden; background: #e8d8c7; aspect-ratio: 3 / 4;
}
.album-view-grid .profile-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.album-view-grid .profile-photo:active img { transform: scale(1.03); }
.album-view-grid .profile-photo span {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 8px 7px;
  background: linear-gradient(180deg, transparent, rgba(20,14,12,.6)); color: #fffaf4; font-size: 9px; line-height: 1.4; text-align: left;
}
.album-view-note { margin: 14px 2px 0; color: var(--muted); font-size: 9px; line-height: 1.55; text-align: center; }
.album-view-empty {
  grid-column: 1 / -1; padding: 54px 18px; border-radius: 18px; background: rgba(255,250,243,.72);
  color: var(--muted); font-size: 12px; line-height: 1.7; text-align: center;
}

.album-purchase { display: grid; gap: 16px; }
.album-purchase-visual {
  position: relative; overflow: hidden; border-radius: 22px; background: #e8d8c7; aspect-ratio: 4 / 5;
  box-shadow: 0 14px 30px rgba(88,52,38,.14);
}
.album-purchase-visual img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.7) brightness(.82); }
.album-purchase-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(28,19,16,.04), rgba(28,19,16,.66)); }
.album-purchase-badge {
  position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 10px; border-radius: 999px; background: rgba(28,19,16,.6); color: #ffe6bd;
  font-size: 10px; letter-spacing: .04em; backdrop-filter: blur(6px);
}
.album-purchase-badge .icon { width: 13px; height: 13px; }
.album-purchase-copy { padding: 2px 2px 0; }
.album-purchase-copy h3 { margin: 0; font-family: "Songti SC", "STSong", serif; font-size: 24px; font-weight: 600; }
.album-purchase-copy p { margin: 6px 0 0; color: var(--ink-2); font-size: 12px; line-height: 1.7; }
.album-purchase-stats { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.album-purchase-stats span {
  display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px;
  background: rgba(255,250,243,.8); color: var(--ink-2); font-size: 10px; font-weight: 600;
}
.album-purchase-balance { margin: 10px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.album-buy-btn {
  width: 100%; min-height: 50px; margin-top: 13px; border: 0; border-radius: 999px;
  background: var(--coral); color: #fffaf4; font-size: 14px; font-weight: 700;
  box-shadow: 0 10px 24px rgba(207,95,74,.22);
}
.album-buy-btn:active { transform: scale(.98); }
.album-buy-btn:disabled { opacity: .55; box-shadow: none; }
.album-purchase-note { margin: 9px 0 0; color: #a29487; font-size: 9px; line-height: 1.55; text-align: center; }

/* ===== 登录 / 账号 ===== */
.auth-sheet { max-width: 520px; max-height: 88vh; max-height: 88dvh; }
.auth-wrap { overflow-y: auto; padding: 8px 22px calc(24px + var(--safe-bottom)); }
.auth-head h2 { margin: 0 0 7px; font-family: "Songti SC", "STSong", serif; font-size: 28px; font-weight: 600; }
.auth-head p:not(.eyebrow) { margin: 0; color: var(--ink-2); font-size: 12px; line-height: 1.7; }
.auth-tabs { display: flex; gap: 4px; margin-top: 16px; padding: 4px; border-radius: 14px; background: #f6eadc; }
.auth-tab { flex: 1; height: 38px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; }
.auth-tab.is-active { background: #fffdf9; color: var(--ink); box-shadow: 0 3px 10px rgba(99, 57, 47, .09); }
.auth-form { margin-top: 18px; }
.auth-field { display: block; margin-bottom: 11px; }
.auth-field > span:first-child { display: block; margin: 0 0 6px 2px; font-size: 10px; color: var(--muted); }
.auth-field input {
  width: 100%; box-sizing: border-box; height: 46px; border: 1px solid rgba(119,74,72,.16);
  border-radius: 13px; background: #fffdf9; padding: 0 13px; font-size: 16px; color: var(--ink); outline: none;
}
.auth-field input:focus { border-color: rgba(233,120,98,.55); box-shadow: 0 0 0 3px rgba(233,120,98,.09); }
.auth-code-row { display: flex; gap: 8px; align-items: center; }
.auth-code-row input { flex: 1; min-width: 0; }
.auth-send { flex: 0 0 auto; height: 46px; padding: 0 12px; border: 1px solid rgba(233,120,98,.24); border-radius: 12px; background: #fff4e9; color: var(--coral-deep); font-size: 11px; }
.auth-send:disabled { opacity: .48; }
.auth-status { min-height: 18px; margin: 5px 0 8px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.auth-status.is-error { color: #b0473a; }
.auth-status.is-ok { color: #587a54; }
.auth-hint { margin: 2px 0 0; color: var(--coral-deep); font-size: 10px; line-height: 1.55; }
.auth-submit { width: 100%; }
.auth-foot { margin: 12px 0 0; color: var(--muted); font-size: 9px; line-height: 1.65; }
.auth-signed-in { margin-top: 18px; }
.auth-account-card { display: flex; align-items: center; gap: 11px; padding: 14px; border-radius: 16px; background: #f8efe3; }
.auth-avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--coral); color: #fffaf4; }
.auth-avatar .icon { width: 20px; height: 20px; }
.auth-account-card strong { display: block; font-size: 15px; color: var(--ink); }
.auth-account-card span:not(.auth-avatar) { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.auth-stat { display: flex; align-items: center; justify-content: space-between; margin: 11px 0 16px; padding: 12px 14px; border-radius: 13px; background: #fffdf9; border: 1px solid rgba(119,74,72,.1); }
.auth-stat span { color: var(--muted); font-size: 11px; }
.auth-stat strong { color: var(--ink-2); font-size: 12px; }

.toast {
  position: fixed; left: 50%; bottom: calc(104px + var(--safe-bottom)); z-index: 120; transform: translate(-50%, 8px);
  max-width: min(86vw, 420px); padding: 10px 15px; border-radius: 999px; background: rgba(36, 26, 23, .88);
  color: #fffaf4; font-size: 12px; line-height: 1.5; text-align: center; opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease; box-shadow: 0 10px 30px rgba(36, 26, 23, .22);
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

.chat-realtime {
  height: 42px; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px;
  padding: 0 9px; border: 0; border-radius: 999px;
  background: rgba(233, 120, 98, .12); color: var(--coral-deep); font-size: 10px; font-weight: 700;
}
.chat-realtime .icon { width: 15px; height: 15px; }
.chat-realtime:active { background: rgba(233, 120, 98, .22); }

/* ===== 实时语音通话 ===== */
body.rt-open { overflow: hidden; }
.realtime-layer {
  position: fixed; inset: 0; z-index: 210; display: flex; flex-direction: column;
  padding: calc(18px + var(--safe-top)) 20px calc(24px + var(--safe-bottom));
  overflow: hidden; color: #fff6eb; isolation: isolate;
  background:
    radial-gradient(85% 55% at 80% 6%, rgba(243, 181, 156, .34), transparent 62%),
    radial-gradient(80% 60% at 8% 92%, rgba(243, 213, 154, .18), transparent 64%),
    linear-gradient(164deg, #2c211d 0%, #3b2a25 40%, #563630 72%, #6d4036 100%);
}
.realtime-layer::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .16;
  background-image: radial-gradient(rgba(255, 246, 235, .5) .7px, transparent .7px);
  background-size: 18px 18px;
}
.rt-glow { position: absolute; z-index: -1; border-radius: 50%; filter: blur(10px); pointer-events: none; }
.rt-glow-a {
  width: 260px; height: 260px; top: 12%; right: -110px;
  background: radial-gradient(circle, rgba(233, 120, 98, .32), transparent 68%);
}
.rt-glow-b {
  width: 220px; height: 220px; bottom: 8%; left: -110px;
  background: radial-gradient(circle, rgba(243, 213, 154, .18), transparent 68%);
}
.rt-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: 0 0 auto; }
.rt-kicker { font-size: 8px; letter-spacing: .22em; color: rgba(255, 246, 235, .62); font-weight: 700; }
.rt-timer {
  padding: 5px 10px; border: 1px solid rgba(255, 246, 235, .18); border-radius: 999px;
  background: rgba(255, 246, 235, .08); color: rgba(255, 246, 235, .9);
  font-family: "SF Mono", "Menlo", monospace; font-size: 11px; letter-spacing: .08em;
}
.rt-stage {
  flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 10px 0 0; text-align: center;
}
.rt-avatar-wrap { position: relative; width: 132px; height: 132px; flex: 0 0 auto; margin-bottom: 15px; }
.rt-avatar-wrap img {
  width: 132px; height: 132px; border-radius: 50%; object-fit: cover; object-position: center 22%;
  border: 1px solid rgba(255, 246, 235, .38); box-shadow: 0 18px 46px rgba(18, 12, 10, .4);
}
.rt-ring {
  position: absolute; inset: -11px; border-radius: 50%; border: 1px solid rgba(243, 181, 156, .38);
  box-shadow: 0 0 0 9px rgba(243, 181, 156, .07), 0 0 0 22px rgba(243, 181, 156, .04);
}
.realtime-layer.is-live .rt-ring { animation: rtRing 2.4s ease-in-out infinite; }
.rt-status {
  margin: 0 0 4px; padding: 5px 11px; border-radius: 999px;
  background: rgba(255, 246, 235, .1); color: #ffe4b4; font-size: 10px; letter-spacing: .04em;
}
#rtName {
  margin: 0; font-family: "Songti SC", "STSong", "SimSun", serif; font-size: 31px;
  font-weight: 600; line-height: 1.2; letter-spacing: .02em;
}
.rt-wave {
  display: flex; align-items: center; justify-content: center; gap: 4px; height: 28px;
  margin: 10px 0 4px; opacity: .5;
}
.rt-wave i { display: block; width: 3px; height: 8px; border-radius: 4px; background: #f3b49c; }
.realtime-layer.is-live .rt-wave { opacity: .9; }
.realtime-layer.is-live .rt-wave i { animation: rtWave 1.1s ease-in-out infinite alternate; }
.realtime-layer.is-speaking .rt-wave i { animation-duration: .52s; background: #ffd9a8; }
.rt-wave i:nth-child(1) { animation-delay: -.9s; }
.rt-wave i:nth-child(2) { animation-delay: -.75s; }
.rt-wave i:nth-child(3) { animation-delay: -.6s; }
.rt-wave i:nth-child(4) { animation-delay: -.45s; }
.rt-wave i:nth-child(5) { animation-delay: -.3s; }
.rt-wave i:nth-child(6) { animation-delay: -.15s; }
.rt-wave i:nth-child(7) { animation-delay: -.5s; }
.rt-wave i:nth-child(8) { animation-delay: -.7s; }
.rt-wave i:nth-child(9) { animation-delay: -.85s; }
.rt-hint { margin: 0; min-height: 18px; color: rgba(255, 246, 235, .6); font-size: 11px; }
.rt-transcript {
  width: 100%; max-width: 430px; max-height: 24vh; min-height: 42px; margin: 13px 0 0;
  padding: 2px 2px 4px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
  display: flex; flex-direction: column; gap: 6px;
}
.rt-transcript::-webkit-scrollbar { display: none; }
.rt-bubble {
  max-width: 86%; padding: 7px 11px; border-radius: 13px; font-size: 12px; line-height: 1.6;
  text-align: left; animation: msgIn .18s ease both;
}
.rt-bubble.assistant {
  align-self: flex-start; background: rgba(255, 246, 235, .12); color: rgba(255, 246, 235, .9);
  border: 1px solid rgba(255, 246, 235, .1);
}
.rt-bubble.user {
  align-self: flex-end; background: rgba(233, 120, 98, .3); color: #fff6eb;
  border: 1px solid rgba(243, 181, 156, .2);
}
.rt-bubble .rt-bubble-label { display: block; margin-bottom: 2px; font-size: 8px; letter-spacing: .1em; opacity: .5; }
.rt-cost {
  margin: 10px 0 0; color: rgba(255, 246, 235, .5); font-size: 9px; line-height: 1.55;
  max-width: 320px;
}
.rt-actions { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; padding-top: 10px; }
.rt-hangup {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  width: 68px; height: 68px; border: 1px solid rgba(255, 246, 235, .24); border-radius: 50%;
  background: rgba(233, 120, 98, .24); color: #fff6eb; box-shadow: 0 10px 28px rgba(18, 12, 10, .3);
}
.rt-hangup:active { transform: scale(.96); background: rgba(233, 120, 98, .38); }
.rt-hangup .icon { width: 21px; height: 21px; opacity: .9; }
.rt-hangup span { font-size: 9px; letter-spacing: .04em; opacity: .8; }


/* ===== 动效 ===== */
@keyframes breathe { 0%, 100% { transform: scaleY(.72); opacity: .72; } 50% { transform: scaleY(1.18); opacity: 1; } }
@keyframes rtRing { 0%, 100% { transform: scale(.94); opacity: .48; } 50% { transform: scale(1.04); opacity: .9; } }
@keyframes rtWave { from { height: 6px; opacity: .42; } to { height: 22px; opacity: 1; } }
@keyframes shimmer { 0% { background-position: 120% 0; } 100% { background-position: -80% 0; } }
@keyframes msgIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes typing { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: .9; transform: translateY(-3px); } }
@keyframes voicePulse { from { transform: scaleY(.55); } to { transform: scaleY(1.25); } }
@keyframes recordPulse { from { height: 8px; opacity: .5; } to { height: 32px; opacity: 1; } }
@keyframes panelIn { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@media (min-width: 720px) {
  .home-view { padding-left: 26px; padding-right: 26px; }
  .character-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .character-card .card-bottom strong { font-size: 23px; }
  .chat-view { top: 12px; bottom: 12px; border-radius: 24px; height: auto; }
  .chat-top { border-radius: 24px 24px 0 0; }
  .chat-bottom { border-radius: 0 0 24px 24px; }
}
@media (max-width: 480px) {
  .brand-en { display: none; }
  .home-top-actions { gap: 5px; }
  .home-top-actions .ghost-pill { padding: 7px 9px; }
  .home-top-actions .ghost-pill span { font-size: 11px; }
}
@media (max-width: 360px) {
  .hero h1 { font-size: 34px; }
  .hero-lede { font-size: 13px; }
  .sheet-hero { height: 250px; }
  .profile-hero { height: 300px; }
  .sheet-facts, .profile-facts { grid-template-columns: 1fr 1fr; }
  .sheet-facts > div:last-child, .profile-facts > div:last-child { grid-column: span 2; }
  .home-top-actions .ghost-pill { padding: 7px 8px; }
  .home-top-actions .ghost-pill .icon { width: 13px; height: 13px; }
  .home-top-actions .ghost-pill span { font-size: 10px; }
  .character-sheet .sheet-actions { flex-wrap: wrap; }
  .character-sheet .sheet-actions .btn { min-width: 46%; }
  .character-sheet .sheet-actions .btn-primary { flex-basis: 100%; }
}
@media (max-width: 480px) {
  .hero h1 { font-size: clamp(32px, 9.9vw, 43px); line-height: 1.12; }
  .section-head h2 { font-size: 22px; }
  .sheet-hero-text h2, .profile-hero-text h2 { font-size: 27px; }
  .auth-head h2, .about-head h2, .wallet-head h2 { font-size: 24px; }
  .sheet-facts, .profile-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sheet-facts > div:last-child, .profile-facts > div:last-child { grid-column: span 2; }
  .profile-album-head { align-items: flex-start; }
  .profile-album-head > div { min-width: 0; }
  .profile-album-head h3 { font-size: 18px; }
  .profile-album-desc { font-size: 10px; line-height: 1.55; }
  .profile-album-cover-copy strong { font-size: 19px; }
  .album-purchase-copy h3 { font-size: 22px; }
}
@media (min-width: 720px) {
  .album-view { top: 12px; bottom: 12px; border-radius: 24px; overflow: hidden; }
  .album-purchase { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: center; gap: 24px; }
  .album-purchase-copy { padding-right: 8px; }
  .album-view-grid { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ===== 积分 / VIP / 锁定 ===== */
.wallet-pill { background: rgba(255, 250, 243, .72); border-color: rgba(207, 95, 74, .18); color: var(--coral-deep); font-weight: 600; }
.wallet-pill small { margin-left: -1px; color: var(--muted); font-size: 9px; font-weight: 400; }
.vip-chip {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 2px 6px; border-radius: 5px; font-size: 8px; font-weight: 700; letter-spacing: .08em;
  color: #6b4420; background: linear-gradient(135deg, #f8e5b8, #e9ba68);
  box-shadow: 0 1px 3px rgba(120, 78, 28, .18); vertical-align: middle;
}
.chat-wallet {
  display: inline-flex; align-items: center; gap: 3px; height: 42px; padding: 0 9px;
  border: 0; border-radius: 999px; background: rgba(255, 250, 243, .72);
  color: var(--coral-deep); font-size: 11px; font-weight: 600;
}
.chat-wallet .icon { width: 15px; height: 15px; }
.chat-cost-hint { margin: 0 5px 5px; color: #a29487; font-size: 9px; letter-spacing: .02em; text-align: center; }
.composer-image {
  width: 40px; height: 40px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: transparent; color: var(--plum);
}
.composer-image .icon { width: 19px; height: 19px; }
.composer-image:active { background: rgba(119, 74, 72, .07); }

.character-card.is-locked img { filter: saturate(.68) brightness(.8); }
.card-lock {
  position: absolute; top: 46px; right: 10px; z-index: 2; display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 8px; border-radius: 7px; border: 1px solid rgba(255, 214, 153, .5);
  background: rgba(28, 19, 16, .62); color: #ffe6bd; font-size: 9px; letter-spacing: .04em;
  backdrop-filter: blur(5px);
}
.card-lock .icon { width: 12px; height: 12px; }

.profile-lock-banner {
  display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 11px 12px;
  border-radius: 16px; border: 1px solid rgba(207, 95, 74, .2);
  background: linear-gradient(135deg, #fff2e1, #f8e2cc);
}
.profile-lock-icon {
  width: 34px; height: 34px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 11px; background: rgba(207, 95, 74, .12); color: var(--coral-deep);
}
.profile-lock-icon .icon { width: 17px; height: 17px; }
.profile-lock-copy { flex: 1; min-width: 0; }
.profile-lock-copy strong { display: block; color: var(--ink); font-size: 12px; }
.profile-lock-copy small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.profile-unlock-btn {
  flex: 0 0 auto; border: 0; border-radius: 999px; padding: 8px 11px;
  background: var(--coral); color: #fffaf4; font-size: 11px; font-weight: 600;
}
.profile-album-locked {
  position: relative; grid-column: 1 / -1; aspect-ratio: 3 / 4; overflow: hidden;
  border-radius: 16px; background: #e8ddd0;
}
.profile-album-locked img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.55) brightness(.78) blur(1px); transform: scale(1.03); }
.profile-album-lock-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(30,20,17,.16), rgba(30,20,17,.6)); }
.profile-album-lock-copy {
  position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 0 20px;
  color: #fffaf4; text-align: center; pointer-events: none;
}
.profile-album-lock-copy .icon { width: 28px; height: 28px; opacity: .9; }
.profile-album-lock-copy strong { font-family: "Songti SC", "STSong", serif; font-size: 20px; }
.profile-album-lock-copy small { color: rgba(255,250,244,.82); font-size: 10px; }
.profile-album-unlock {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 2;
  border: 0; border-radius: 999px; padding: 9px 18px; background: var(--coral);
  color: #fffaf4; font-size: 11px; font-weight: 600; box-shadow: 0 5px 14px rgba(60, 28, 18, .22);
  white-space: nowrap;
}

.auth-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 2px; }
.auth-actions .auth-submit { margin-top: 0; }
.auth-sheet .auth-stat { margin: 8px 0; padding: 10px 14px; }
.auth-sheet .auth-stat:last-of-type { margin-bottom: 13px; }

.wallet-sheet .sheet-scroll { overscroll-behavior: contain; }
.wallet-wrap { padding: 12px 20px calc(28px + var(--safe-bottom)); }
.wallet-head h2 { margin: 0; font-family: "Songti SC", "STSong", serif; font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
.wallet-lede { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.wallet-balance {
  display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 16px;
}
.wallet-balance > div { padding: 13px 14px; border-radius: 16px; background: #f8efe3; }
.wallet-balance span { display: block; color: var(--muted); font-size: 10px; }
.wallet-balance strong { display: block; margin-top: 3px; color: var(--ink); font-size: 20px; font-weight: 600; line-height: 1.25; }
.wallet-balance > div:last-child strong { font-size: 13px; line-height: 1.45; }
.wallet-section { margin-top: 20px; }
.wallet-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.wallet-section-head h3 { margin: 0; font-family: "Songti SC", "STSong", serif; font-size: 18px; font-weight: 600; }
.wallet-section-head span { color: var(--muted); font-size: 9px; }
.wallet-note { margin: 0 0 9px; color: var(--muted); font-size: 10px; line-height: 1.65; }
.wallet-packages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.wallet-package {
  border: 1px solid rgba(119, 74, 72, .11); border-radius: 14px; padding: 12px 8px 11px;
  background: #fffdf9; color: var(--ink); text-align: center;
}
.wallet-package span { display: block; font-size: 17px; font-weight: 600; line-height: 1.2; }
.wallet-package small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.wallet-package:active { background: #f8efe3; border-color: rgba(207, 95, 74, .24); }

.wallet-pay {
  margin-top: 12px; padding: 13px; border-radius: 17px; border: 1px solid rgba(207, 95, 74, .18);
  background: linear-gradient(145deg, #fffdf9, #fff4ea);
}
.wallet-pay-head { display: flex; align-items: center; gap: 9px; }
.alipay-mark {
  width: 34px; height: 34px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; background: #1677ff; color: #fff; font-size: 16px; font-weight: 700;
}
.wallet-pay-head strong { display: block; font-size: 12px; }
.wallet-pay-head small { display: block; color: var(--muted); font-size: 9px; }
.wallet-pay-head b { margin-left: auto; color: var(--coral-deep); font-size: 18px; }
.wallet-pay-title { margin: 9px 0 11px; color: var(--ink-2); font-size: 11px; line-height: 1.6; }
.wallet-pay-btn { width: 100%; padding: 11px; font-size: 12px; }
.wallet-pay-btn:disabled { opacity: .55; }
.wallet-pay-cancel { display: block; width: 100%; margin-top: 8px; border: 0; background: transparent; color: var(--muted); font-size: 10px; padding: 4px; }

.vip-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.vip-plan {
  position: relative; overflow: hidden; border: 1px solid rgba(196, 150, 75, .26); border-radius: 15px;
  padding: 11px 9px 10px; background: linear-gradient(160deg, #fffaf0, #f8e9c9); color: #5b3e1d; text-align: left;
}
.vip-plan-tag { display: inline-block; padding: 2px 5px; border-radius: 4px; background: rgba(196, 150, 75, .15); font-size: 8px; letter-spacing: .06em; }
.vip-plan strong { display: block; margin-top: 7px; font-family: "Songti SC", "STSong", serif; font-size: 18px; line-height: 1.15; }
.vip-plan-price { display: block; margin-top: 3px; color: #9a6a2e; font-size: 15px; font-weight: 700; }
.vip-plan small { display: block; margin-top: 4px; color: #8b6b47; font-size: 8px; line-height: 1.5; }
.vip-plan:active { transform: scale(.985); }

.wallet-history { border-top: 1px solid rgba(119, 74, 72, .08); }
.wallet-history-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 2px; border-bottom: 1px solid rgba(119, 74, 72, .07); }
.wallet-history-row span b { display: block; font-size: 11px; font-weight: 600; color: var(--ink-2); }
.wallet-history-row span small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.wallet-history-row strong { color: var(--ink-2); font-size: 13px; white-space: nowrap; }
.wallet-history-row strong.is-plus { color: #5f8858; }
.wallet-empty { margin: 0; padding: 16px 2px; color: var(--muted); font-size: 11px; text-align: center; line-height: 1.6; }

@media (max-width: 480px) {
  .chat-realtime span { display: none; }
  .chat-realtime { padding: 0 10px; }
  .rt-avatar-wrap, .rt-avatar-wrap img { width: 118px; height: 118px; }
  #rtName { font-size: 27px; }
  .rt-transcript { max-height: 21vh; }
  .wallet-pill small { display: none; }
  .home-top-actions .ghost-pill#walletBtn { padding: 7px 9px; }
  .wallet-wrap { padding-left: 16px; padding-right: 16px; }
  .wallet-packages, .vip-plans { gap: 6px; }
  .wallet-package { padding: 11px 5px 9px; }
  .wallet-package span { font-size: 16px; }
  .vip-plan { padding: 10px 7px 9px; }
  .vip-plan strong { font-size: 16px; }
  .chat-cost-hint { font-size: 8px; }
  .composer { gap: 4px; }
  .composer-image, .composer-mic { width: 38px; height: 38px; }
}
@media (max-height: 700px) {
  .rt-avatar-wrap, .rt-avatar-wrap img { width: 100px; height: 100px; }
  .rt-avatar-wrap { margin-bottom: 11px; }
  #rtName { font-size: 25px; }
  .rt-transcript { max-height: 17vh; }
  .rt-wave { margin: 7px 0 2px; }
}
