* {
  box-sizing: border-box;
}

:root {
  --bg-soft: #f7f8fc;
  --bg-soft-2: #eef1f8;
  --text-main: #222;
  --text-strong: #111827;
  --text-muted: #8d93a6;
  --line-soft: rgba(227, 232, 242, 0.9);
  --pink-1: #f8bfd3;
  --pink-2: #f08db0;
  --pink-3: #ea729a;
  --pink-4: #fff1f6;
  --blue-1: #7aa8ff;
  --blue-2: #5a7af6;
  --purple-1: #756ef4;
  --green-1: #71c96a;
  --green-2: #34a853;
  --shadow-soft: 0 18px 40px rgba(17, 24, 39, 0.1);
  --shadow-card: 0 24px 50px rgba(17, 24, 39, 0.12);
  --shadow-chat: 0 10px 24px rgba(17, 24, 39, 0.08);
  --chat-scroll-bottom-space: 156px;
  --chat-scroll-bottom-space-mobile: 164px;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
}

body {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(248, 191, 211, 0.18), transparent 38%),
    radial-gradient(circle at bottom right, rgba(122, 168, 255, 0.08), transparent 30%),
    linear-gradient(180deg, var(--bg-soft) 0%, var(--bg-soft-2) 100%);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-main);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.12), transparent 44%),
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.32), transparent 18%);
  pointer-events: none;
}

.app {
  position: relative;
  width: 100%;
  max-width: 448px;
  height: 94vh;
  max-height: 940px;
  background: rgba(255, 255, 255, 0.86);
  border-radius: 30px;
  overflow: hidden;
  box-shadow:
    0 24px 54px rgba(17, 24, 39, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.74);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(22px);
}

body>.app[hidden] {
  display: none !important;
}

#guestShell,
#appShell {
  position: relative;
}

.app::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 18%),
    radial-gradient(circle at top right, rgba(248, 191, 211, 0.1), transparent 28%);
  pointer-events: none;
  z-index: 0;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

#guestShell {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  border-radius: 0;
  background: #191b22;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
}

#guestShell::before {
  display: none;
}

#guestShell .guest-room {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #191b22;
}

#guestShell .guest-room-bg,
#guestShell .guest-room-overlay,
#guestShell .guest-room-sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#guestShell .guest-room-bg {
  background:
    linear-gradient(180deg, rgba(14, 16, 22, 0.08), rgba(14, 16, 22, 0.36)),
    url("./images/fj.png") center center / cover no-repeat;
  transform: scale(1.02);
}

#guestShell .guest-room-overlay {
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 214, 229, 0.22), transparent 28%),
    radial-gradient(circle at 78% 22%, rgba(151, 177, 255, 0.12), transparent 26%),
    linear-gradient(180deg, rgba(19, 20, 29, 0.18) 0%, rgba(14, 15, 22, 0.42) 100%);
}

#guestShell .guest-room-sheen {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.09), transparent 28%, transparent 72%, rgba(255, 255, 255, 0.05)),
    radial-gradient(circle at bottom, rgba(255, 228, 239, 0.12), transparent 34%);
}

#guestShell .guest-room-content {
  position: relative;
  z-index: 1;
  height: 100%;
  padding: 34px 38px;
}

#guestShell .guest-info-card {
  position: absolute;
  top: 28px;
  right: 28px;
  z-index: 3;
  width: min(348px, calc(100% - 56px));
  padding: 20px 20px 18px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.46), rgba(255, 246, 250, 0.24));
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    0 14px 32px rgba(8, 12, 22, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(18px);
  pointer-events: auto;
}

#guestShell .guest-info-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 244, 249, 0.86);
  color: #c96f93;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

#guestShell .guest-info-head {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

#guestShell .guest-info-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: #f3bfd0;
  border: 1px solid rgba(255, 255, 255, 0.58);
  box-shadow:
    0 10px 22px rgba(240, 141, 176, 0.14),
    0 0 0 6px rgba(255, 255, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
  flex-shrink: 0;
}

#guestShell .guest-info-text {
  min-width: 0;
}

#guestShell .guest-info-name {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
  color: #1f2937;
  font-weight: 800;
}

#guestShell .guest-info-signature {
  margin-top: 8px;
  font-size: 14px;
  color: rgba(86, 63, 76, 0.88);
  line-height: 1.5;
}

#guestShell .guest-info-welcome {
  margin: 18px 0 0;
  font-size: 17px;
  line-height: 1.6;
  font-weight: 700;
  color: rgba(31, 41, 55, 0.92);
}

#guestShell .guest-info-intro {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.8;
  color: #5f6778;
}

#guestShell .guest-info-actions {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

#guestShell .guest-primary-btn,
#guestShell .guest-ghost-btn {
  min-height: 46px;
  border-radius: 16px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

#guestShell .guest-primary-btn {
  min-width: 132px;
  background: linear-gradient(135deg, #f7a5c4 0%, #ec7aa4 48%, #756ef4 100%);
  color: #fff;
  box-shadow: 0 14px 28px rgba(236, 122, 164, 0.22);
}

#guestShell .guest-ghost-btn {
  min-width: 0;
  min-height: auto;
  padding: 0;
  align-self: center;
  background: transparent;
  color: rgba(96, 67, 82, 0.76);
  border: none;
  box-shadow: none;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  opacity: 0.86;
}

#guestShell .guest-stage {
  position: absolute;
  left: 50%;
  bottom: 42px;
  transform: translateX(-50%);
  width: min(460px, calc(100% - 360px));
  min-width: 320px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

#guestShell .guest-stage-halo {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 360px;
  height: 100px;
  transform: translateX(-50%);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(248, 191, 211, 0.38) 0%, rgba(122, 168, 255, 0.14) 42%, rgba(122, 168, 255, 0) 72%);
  filter: blur(6px);
}

#guestShell .guest-stage-frame {
  position: relative;
  width: 100%;
  min-height: 470px;
  padding: 12px 6px 0;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  overflow: visible;
}

#guestShell .guest-stage-frame::after {
  content: none;
}

#guestShell .guest-stage-label {
  position: relative;
  z-index: 1;
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 241, 246, 0.92);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

#guestShell .guest-stage-live2d {
  position: relative;
  z-index: 1;
  min-height: 390px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 20px 18px 26px;
  text-align: center;
}

#guestShell .guest-stage-aura {
  position: absolute;
  left: 50%;
  bottom: 54px;
  width: 72%;
  height: 280px;
  transform: translateX(-50%);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 243, 247, 0.72) 0%, rgba(255, 217, 230, 0.34) 34%, rgba(121, 167, 255, 0.16) 62%, rgba(121, 167, 255, 0) 100%);
  filter: blur(18px);
  opacity: 0.88;
  animation: guestStageAuraPulse 6.8s ease-in-out infinite;
}

#guestShell .guest-live2d-stage-glow {
  position: absolute;
  left: 50%;
  bottom: 16px;
  width: min(310px, 74%);
  height: 62px;
  transform: translateX(-50%);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 225, 235, 0.78) 0%, rgba(255, 225, 235, 0.26) 42%, rgba(255, 225, 235, 0) 78%);
  filter: blur(10px);
  animation: guestStageGlowPulse 6s ease-in-out infinite;
}

#guestShell .guest-live2d-shadow {
  position: absolute;
  left: 50%;
  bottom: 12px;
  width: min(248px, 58%);
  height: 28px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(33, 28, 44, 0.2);
  filter: blur(9px);
  animation: guestStageShadowFloat 5.6s ease-in-out infinite;
}

#guestShell .guest-live2d-figure {
  position: relative;
  z-index: 1;
  width: min(100%, 360px);
  max-height: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  transform-origin: 50% 88%;
  animation: guestLive2DIdle 5.8s ease-in-out infinite;
}

#guestShell .guest-live2d-base,
#guestShell .guest-live2d-blink-layer,
#guestShell .guest-live2d-talk-layer {
  width: 100%;
  max-width: 360px;
}

#guestShell .guest-live2d-base {
  position: relative;
  z-index: 1;
  display: block;
  max-height: 360px;
  width: auto;
  max-width: min(100%, 320px);
  object-fit: contain;
  object-position: center bottom;
  filter:
    drop-shadow(0 24px 30px rgba(54, 44, 78, 0.18))
    drop-shadow(0 10px 18px rgba(255, 236, 242, 0.22));
  user-select: none;
  pointer-events: none;
}

#guestShell .guest-live2d-blink-layer,
#guestShell .guest-live2d-talk-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: contain;
  opacity: 0;
  pointer-events: none;
}

#guestShell .guest-stage-copy {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  max-width: 300px;
  font-size: 14px;
  line-height: 1.8;
  color: rgba(244, 247, 255, 0.82);
}

@keyframes guestLive2DIdle {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(-0.6deg) scale(1);
  }
  25% {
    transform: translate3d(-2px, -7px, 0) rotate(-1.1deg) scale(1.008);
  }
  50% {
    transform: translate3d(0, -12px, 0) rotate(0.7deg) scale(1.014);
  }
  75% {
    transform: translate3d(2px, -6px, 0) rotate(1.2deg) scale(1.008);
  }
}

@keyframes guestStageAuraPulse {
  0%,
  100% {
    opacity: 0.74;
    transform: translateX(-50%) scale(0.96);
  }
  50% {
    opacity: 0.96;
    transform: translateX(-50%) scale(1.04);
  }
}

@keyframes guestStageGlowPulse {
  0%,
  100% {
    opacity: 0.68;
    transform: translateX(-50%) scaleX(0.94);
  }
  50% {
    opacity: 0.98;
    transform: translateX(-50%) scaleX(1.06);
  }
}

@keyframes guestStageShadowFloat {
  0%,
  100% {
    opacity: 0.18;
    transform: translateX(-50%) scaleX(0.95);
  }
  50% {
    opacity: 0.28;
    transform: translateX(-50%) scaleX(1.04);
  }
}

#guestShell .guest-login-modal {
  position: absolute;
  inset: 0;
  z-index: 4;
}

#guestShell .guest-login-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 18, 0.42);
  backdrop-filter: blur(8px);
}

#guestShell .guest-login-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(420px, calc(100% - 32px));
  padding: 24px 22px 22px;
  border-radius: 28px;
  transform: translate(-50%, -50%);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 247, 251, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 28px 60px rgba(8, 12, 22, 0.24);
}

#guestShell .guest-login-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(245, 247, 252, 0.96);
  color: #6f7689;
  box-shadow: none;
}

#guestShell .guest-login-close:hover {
  background: #fff;
}

#guestShell .guest-login-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #d07b9d;
}

#guestShell .guest-login-title {
  margin: 10px 0 0;
  font-size: 24px;
  line-height: 1.25;
  color: #1f2937;
}

#guestShell .guest-login-desc {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.7;
  color: #667085;
}

#guestShell .auth-form {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#guestShell .auth-form label {
  font-size: 13px;
  color: #667085;
  font-weight: 600;
}

#guestShell .auth-form input {
  width: 100%;
  flex: none;
  height: 48px;
}

#guestShell .auth-submit-btn {
  width: 100%;
  min-height: 48px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

#guestShell .auth-submit-btn {
  margin-top: 6px;
  background: linear-gradient(135deg, #f7a5c4 0%, #ec7aa4 48%, #756ef4 100%);
  color: #fff;
  box-shadow: 0 14px 28px rgba(236, 122, 164, 0.24);
}

#guestShell .auth-submit-btn:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

#guestShell .auth-status {
  min-height: 24px;
  font-size: 13px;
  line-height: 1.5;
  color: #8b93a7;
}

#guestShell .auth-status.is-loading {
  color: #5f79c7;
}

#guestShell .auth-status.is-success {
  color: #2f8d52;
}

#guestShell .auth-status.is-error {
  color: #c45b68;
}

#appShell .page {
  display: none;
  flex: 1;
  min-height: 0;
  background: #f8f9fc;
}

#appShell .page.active {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

#appShell #page-chat {
  min-height: 0;
  background: transparent;
  overflow: hidden;
}

button {
  border: none;
  outline: none;
  transition:
    transform 0.18s ease,
    box-shadow 0.22s ease,
    background 0.22s ease,
    color 0.22s ease,
    opacity 0.22s ease;
}

button:active {
  transform: scale(0.97);
}

input {
  flex: 1;
  height: 46px;
  border: 1px solid #e5e7eb;
  border-radius: 15px;
  background: #fafafa;
  padding: 0 14px;
  font-size: 14px;
  outline: none;
  color: #222;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

input::placeholder {
  color: #a2a9b9;
}

input:focus {
  background: #fff;
  border-color: var(--pink-2);
  box-shadow: 0 0 0 4px rgba(240, 141, 176, 0.12);
}

.avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink-2), var(--pink-3));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  flex-shrink: 0;
}

.avatar-img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #f3bfd0;
  display: block;
}

/* 顶栏 */
#appShell .topbar {
  position: relative;
  z-index: 2;
  min-height: 76px;
  padding: 12px 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(239, 224, 230, 0.9);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 247, 250, 0.92));
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.04);
}

.topbar-glow {
  position: absolute;
  left: -42px;
  top: -58px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(248, 191, 211, 0.28) 0%, rgba(248, 191, 211, 0) 72%);
  pointer-events: none;
}

.top-left,
.topbar-meta-wrap {
  position: relative;
  z-index: 1;
}

.top-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.topbar-avatar-shell {
  position: relative;
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  border-radius: 17px;
  padding: 3px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(247, 200, 219, 0.9));
  box-shadow:
    0 10px 20px rgba(240, 141, 176, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.topbar-avatar-shell .avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.topbar-avatar-badge {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8af3aa, #33d17a);
  border: 2px solid #fff;
  box-shadow: 0 0 0 4px rgba(138, 243, 170, 0.18);
}

.topbar-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topbar-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #df8ca8;
  line-height: 1;
}

.name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-strong);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-mini-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink-2), #ffd4e2);
  box-shadow: 0 0 0 6px rgba(240, 141, 176, 0.12);
  flex-shrink: 0;
}

.status {
  margin: 0;
  font-size: 12px;
  color: #848c9f;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-meta-wrap {
  margin-left: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}

.meta-label {
  font-size: 11px;
  color: #a3abbc;
  line-height: 1;
}

.meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  font-size: 12px;
  font-weight: 700;
  color: var(--pink-3);
  background: linear-gradient(135deg, #fff7fb 0%, #fff0f6 100%);
  padding: 7px 11px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid rgba(240, 141, 176, 0.18);
  box-shadow: 0 8px 18px rgba(240, 141, 176, 0.1);
}

/* 聊天页头图 */
.hero {
  position: relative;
  z-index: 1;
  padding: 8px 12px 10px;
  background:
    radial-gradient(circle at top right, rgba(255, 182, 193, 0.2), transparent 34%),
    radial-gradient(circle at left bottom, rgba(255, 210, 220, 0.14), transparent 30%),
    linear-gradient(135deg, #23293a 0%, #151823 58%, #10121a 100%);
  flex-shrink: 0;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
}

.hero-ambient {
  position: absolute;
  border-radius: 50%;
  filter: blur(6px);
  pointer-events: none;
}

.hero-ambient-left {
  left: -30px;
  top: 22px;
  width: 110px;
  height: 110px;
  background: radial-gradient(circle, rgba(248, 191, 211, 0.12) 0%, rgba(248, 191, 211, 0) 72%);
}

.hero-ambient-right {
  right: -30px;
  top: -24px;
  width: 136px;
  height: 136px;
  background: radial-gradient(circle, rgba(122, 168, 255, 0.12) 0%, rgba(122, 168, 255, 0) 74%);
}

.hero-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 18px 36px rgba(8, 12, 22, 0.22);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 21px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02));
  opacity: 0.5;
  pointer-events: none;
}

.hero-avatar-shell,
.hero-right {
  position: relative;
  z-index: 1;
}

.hero-avatar-shell {
  width: 74px;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-avatar-halo {
  position: absolute;
  inset: -6px;
  border-radius: 26px;
  background: radial-gradient(circle, rgba(248, 191, 211, 0.42) 0%, rgba(248, 191, 211, 0) 72%);
}

.girl-avatar-img {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  object-fit: cover;
  flex-shrink: 0;
  background: #f3bfd0;
  border: 2px solid rgba(255, 255, 255, 0.24);
  box-shadow:
    0 12px 22px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.hero-right {
  flex: 1;
  min-width: 0;
}

.hero-overline {
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 228, 237, 0.68);
}

.hero-name-line {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hero-name {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.01em;
}

.hero-state-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff4f8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.hero-status-line {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.hero-online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7bf7a8;
  box-shadow: 0 0 0 4px rgba(123, 247, 168, 0.12);
  flex-shrink: 0;
}

.hero-status-text {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.4;
}

.hero-greeting-wrap {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-greeting-label {
  font-size: 9px;
  font-weight: 700;
  color: rgba(255, 226, 235, 0.68);
  letter-spacing: 0.08em;
}

.hero-greeting {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-info {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.hero-chip {
  font-size: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.desktop-live2d-stage {
  display: none;
}

.desktop-nav {
  display: none;
}

.desktop-sidebar {
  display: none;
}

/* 聊天区 */
.chat {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(180deg, #fbfcff 0%, #f4f6fc 100%);
}

.chat::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(248, 191, 211, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 20%);
  pointer-events: none;
}

#messages {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 14px calc(20px + var(--chat-scroll-bottom-space));
  background:
    radial-gradient(circle at top, rgba(255, 209, 220, 0.1), transparent 36%),
    linear-gradient(180deg, #f8faff 0%, #f4f6fc 100%);
  scroll-behavior: smooth;
  scroll-padding-bottom: var(--chat-scroll-bottom-space);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  pointer-events: auto;
}

.time-divider {
  display: flex;
  justify-content: center;
  margin: 16px 0 14px;
}

.time-divider span {
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #8e95a8;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(232, 236, 244, 0.9);
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.05);
  backdrop-filter: blur(8px);
}

@keyframes messageRise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin: 12px 0;
  animation: messageRise 0.26s ease both;
}

.message-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: min(84%, 380px);
  min-width: 0;
}

.ai-content {
  align-items: flex-start;
}

.me-content {
  align-items: flex-end;
}

.ai-row {
  justify-content: flex-start;
}

.me-row {
  justify-content: flex-end;
}

.msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 15px;
  object-fit: cover;
  flex-shrink: 0;
  background: #eaeaea;
  border: 2px solid rgba(255, 255, 255, 0.76);
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.08);
}

.msg {
  max-width: 100%;
  position: relative;
  padding: 12px 14px;
  line-height: 1.62;
  font-size: 14px;
  border-radius: 20px;
  word-break: break-word;
  white-space: pre-wrap;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.06);
}

.message-meta {
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  color: #9ba3b6;
}

.me-content .message-meta {
  text-align: right;
}

.ai {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 251, 255, 0.96));
  color: #2f3343;
  border: 1px solid rgba(228, 232, 241, 0.95);
  border-bottom-left-radius: 12px;
}

.me {
  background: linear-gradient(135deg, var(--blue-1) 0%, var(--blue-2) 56%, var(--purple-1) 100%);
  color: #fff;
  border-bottom-right-radius: 12px;
  box-shadow: 0 12px 24px rgba(90, 122, 246, 0.24);
}

.active-message-row .msg-avatar {
  box-shadow: 0 10px 24px rgba(240, 108, 155, 0.18);
}

.active-message {
  background: linear-gradient(135deg, #fff8fc 0%, #fff0f7 100%);
  color: #7c3553;
  border: 1px dashed rgba(240, 108, 155, 0.42);
  box-shadow: 0 12px 24px rgba(240, 108, 155, 0.12);
}

/* 输入区 */
.input-box {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 10px 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 249, 252, 0.98));
  border-top: 1px solid rgba(234, 238, 246, 0.94);
  box-shadow: 0 -12px 22px rgba(17, 24, 39, 0.05);
  flex-shrink: 0;
  overflow: hidden;
  pointer-events: auto;
}

.input-box-glow {
  position: absolute;
  left: 24px;
  right: 24px;
  top: -34px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 141, 176, 0.16) 0%, rgba(240, 141, 176, 0) 70%);
  pointer-events: none;
}

.input-tools,
.composer-row {
  position: relative;
  z-index: 11;
  pointer-events: auto;
}

.voice-status-bar {
  position: relative;
  z-index: 11;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 244, 248, 0.96));
  border: 1px solid rgba(240, 141, 176, 0.14);
  color: #7d6c79;
  font-size: 12px;
  line-height: 1.45;
  box-shadow: 0 10px 18px rgba(17, 24, 39, 0.04);
  transition:
    background 0.22s ease,
    color 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.22s ease;
}

.voice-status-bar::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(240, 141, 176, 0.5);
  box-shadow: 0 0 0 6px rgba(240, 141, 176, 0.12);
  transition:
    background 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.22s ease;
}

.voice-status-bar[data-tone="recording"] {
  background: linear-gradient(135deg, rgba(255, 242, 247, 0.98), rgba(255, 229, 239, 0.98));
  border-color: rgba(234, 114, 154, 0.28);
  color: #c24a79;
  box-shadow: 0 12px 24px rgba(234, 114, 154, 0.12);
}

.voice-status-bar[data-tone="recording"]::before {
  background: #ea729a;
  box-shadow: 0 0 0 6px rgba(234, 114, 154, 0.16);
  animation: pulse 0.9s infinite;
}

.voice-status-bar[data-tone="loading"] {
  background: linear-gradient(135deg, rgba(244, 247, 255, 0.98), rgba(237, 242, 255, 0.98));
  border-color: rgba(122, 168, 255, 0.22);
  color: #5874c8;
}

.voice-status-bar[data-tone="loading"]::before {
  background: #7aa8ff;
  box-shadow: 0 0 0 6px rgba(122, 168, 255, 0.14);
}

.voice-status-bar[data-tone="success"] {
  background: linear-gradient(135deg, rgba(244, 255, 247, 0.98), rgba(236, 251, 240, 0.98));
  border-color: rgba(52, 168, 83, 0.2);
  color: #2f8d52;
}

.voice-status-bar[data-tone="success"]::before {
  background: #34a853;
  box-shadow: 0 0 0 6px rgba(52, 168, 83, 0.12);
}

.voice-status-bar[data-tone="error"] {
  background: linear-gradient(135deg, rgba(255, 245, 247, 0.98), rgba(255, 237, 241, 0.98));
  border-color: rgba(229, 57, 53, 0.18);
  color: #c45b68;
}

.voice-status-bar[data-tone="error"]::before {
  background: #ef5350;
  box-shadow: 0 0 0 6px rgba(239, 83, 80, 0.12);
}

.voice-status-bar[data-tone="call"] {
  background: linear-gradient(135deg, rgba(247, 244, 255, 0.98), rgba(241, 236, 255, 0.98));
  border-color: rgba(117, 110, 244, 0.18);
  color: #6a61d2;
}

.voice-status-bar[data-tone="call"]::before {
  background: #756ef4;
  box-shadow: 0 0 0 6px rgba(117, 110, 244, 0.12);
}

.input-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.tools-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #9aa2b4;
  line-height: 1;
}

.tools-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tool-btn,
.voice-btn,
.voice-toggle-btn,
.call-btn {
  position: relative;
  z-index: 12;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
  font-size: 18px;
  box-shadow: 0 8px 16px rgba(17, 24, 39, 0.08);
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.tool-btn,
.voice-btn,
.voice-toggle-btn {
  background: linear-gradient(180deg, #ffffff 0%, #f3f6fc 100%);
  color: #5f6577;
  border: 1px solid rgba(228, 233, 243, 0.92);
}

.tool-btn:hover,
.voice-btn:hover,
.voice-toggle-btn:hover,
.call-btn:hover,
.send-btn:hover {
  transform: translateY(-1px);
}

.tool-btn:active,
.voice-btn:active,
.voice-toggle-btn:active,
.call-btn:active,
.send-btn:active {
  transform: scale(0.96);
}

.emoji-btn {
  font-size: 19px;
  padding-right: 1px;
  padding-bottom: 1px;
}

.voice-btn {
  padding-left: 1px;
  padding-bottom: 1px;
}

.voice-toggle-btn {
  padding-right: 1px;
}

.call-btn {
  background: linear-gradient(135deg, var(--green-1), var(--green-2));
  color: #fff;
  border: none;
  box-shadow: 0 10px 20px rgba(52, 168, 83, 0.22);
}

#startCallBtn {
  min-width: 42px;
  min-height: 42px;
  padding-left: 2px;
}

.voice-btn.recording {
  background: linear-gradient(135deg, #ff94bf, var(--pink-3));
  color: #fff;
  border: none;
  animation: pulse 0.7s infinite;
  box-shadow: 0 12px 24px rgba(234, 114, 154, 0.26);
}

.voice-toggle-btn.muted {
  color: #97a0b6;
  background: linear-gradient(180deg, #f5f7fb 0%, #edf1f7 100%);
  box-shadow: none;
}

.composer-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-shell {
  position: relative;
  z-index: 12;
  flex: 1;
  min-width: 0;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(226, 231, 241, 0.98);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 16px rgba(17, 24, 39, 0.05);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
  pointer-events: auto;
}

.input-shell:focus-within {
  background: #fff;
  border-color: rgba(240, 141, 176, 0.54);
  box-shadow:
    0 0 0 4px rgba(240, 141, 176, 0.12),
    0 10px 18px rgba(17, 24, 39, 0.06);
}

.input-prefix {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--pink-2);
  background: rgba(255, 241, 246, 0.92);
  border: 1px solid rgba(240, 141, 176, 0.22);
  border-radius: 999px;
  padding: 5px 8px;
  line-height: 1;
}

.input-shell input {
  position: relative;
  z-index: 12;
  flex: 1;
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  padding: 0;
  font-size: 14px;
  box-shadow: none;
  pointer-events: auto;
}

.input-shell input:focus {
  background: transparent;
  border: none;
  box-shadow: none;
}

.send-btn {
  position: relative;
  z-index: 12;
  width: auto;
  min-width: 72px;
  height: 46px;
  padding: 0 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, #f7a5c4 0%, #ec7aa4 48%, #756ef4 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 12px 24px rgba(236, 122, 164, 0.24);
  pointer-events: auto;
}

.send-btn::after {
  content: "↗";
  font-size: 14px;
  line-height: 1;
  opacity: 0.96;
  transform: translateY(-1px);
}

.send-btn-text {
  white-space: nowrap;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }
}

.voice-message {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #fff;
  border-radius: 18px;
  cursor: pointer;
  user-select: none;
  min-width: 120px;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.06);
}

.ai .voice-message {
  border-bottom-left-radius: 8px;
  background: #fff;
}

.me .voice-message {
  border-bottom-right-radius: 8px;
  background: linear-gradient(135deg, #68a4ff, #4f7ff0);
  color: #fff;
}

.voice-wave {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  height: 24px;
}

.voice-bar {
  width: 3px;
  background: #f06c9b;
  border-radius: 2px;
  animation: none;
}

.me .voice-bar {
  background: #fff;
}

.voice-message.playing .voice-bar:nth-child(1) {
  animation: wave1 0.5s infinite;
}

.voice-message.playing .voice-bar:nth-child(2) {
  animation: wave2 0.5s infinite 0.1s;
}

.voice-message.playing .voice-bar:nth-child(3) {
  animation: wave3 0.5s infinite 0.2s;
}

.voice-message.playing .voice-bar:nth-child(4) {
  animation: wave2 0.5s infinite 0.3s;
}

.voice-message.playing .voice-bar:nth-child(5) {
  animation: wave1 0.5s infinite 0.4s;
}

@keyframes wave1 {

  0%,
  100% {
    height: 8px;
  }

  50% {
    height: 20px;
  }
}

@keyframes wave2 {

  0%,
  100% {
    height: 12px;
  }

  50% {
    height: 24px;
  }
}

@keyframes wave3 {

  0%,
  100% {
    height: 6px;
  }

  50% {
    height: 16px;
  }
}

.voice-duration {
  font-size: 12px;
  color: #666;
  margin-left: auto;
}

.me .voice-duration {
  color: #fff;
  opacity: 0.9;
}

/* 通用面板页 */
.panel {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 16px 24px;
}

.panel-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--text-strong);
}

.contact-card,
.me-card,
.moment-card {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 14px 32px rgba(17, 24, 39, 0.06);
  margin-bottom: 14px;
  border: 1px solid rgba(236, 239, 246, 0.9);
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 14px;
}

.contact-avatar,
.moment-avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  object-fit: cover;
  background: #f2b3c7;
  flex-shrink: 0;
}

.contact-name,
.moment-name {
  font-size: 16px;
  font-weight: 700;
}

.contact-sub,
.moment-time {
  font-size: 12px;
  color: #8b8b99;
  margin-top: 4px;
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.05);
  font-size: 15px;
  border: 1px solid rgba(236, 239, 246, 0.9);
}

.info-item strong {
  font-size: 18px;
  color: var(--text-strong);
}

.moment-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.moment-header-info {
  flex: 1;
}

.moment-body {
  margin-bottom: 16px;
}

.moment-content {
  font-size: 15px;
  line-height: 1.7;
  color: #2d3748;
  margin-bottom: 12px;
}

.moment-image-container {
  margin-top: 12px;
  border-radius: 12px;
  overflow: hidden;
  background: #f5f5f5;
}

.moment-image {
  width: 100%;
  max-width: 240px;
  height: auto;
  display: block;
  border-radius: 14px;
  margin-top: 12px;
}

.moment-footer {
  border-top: 1px solid #f0f0f0;
  padding-top: 12px;
}

.moment-actions {
  display: flex;
  gap: 20px;
  margin-bottom: 12px;
}

.moment-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: auto;
  height: auto;
  padding: 6px 0;
  background: none;
  border: none;
  color: #666;
  font-size: 14px;
  cursor: pointer;
}

.moment-action-btn:hover {
  color: #f06c9b;
  box-shadow: none;
}

.action-icon {
  font-size: 16px;
}

.action-text {
  font-weight: 500;
}

.action-count {
  font-size: 13px;
  color: #999;
}

.moment-comments {
  background: #f7f8fb;
  border-radius: 12px;
  padding: 12px;
  margin-top: 10px;
}

.moment-comment-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.6;
}

.comment-user {
  font-weight: 600;
  color: #333;
  flex-shrink: 0;
}

.comment-content {
  flex: 1;
  color: #555;
}

.comment-time {
  font-size: 12px;
  color: #999;
  flex-shrink: 0;
  margin-left: 8px;
}

/* 评论模态框 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(8, 11, 18, 0.54);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.modal-header {
  padding: 16px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #333;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: none;
}

.modal-close:hover {
  background: #f5f5f5;
  color: #333;
  transform: none;
}

.modal-body {
  padding: 16px;
}

#commentInput {
  width: 100%;
  height: 48px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 0 16px;
  font-size: 14px;
}

.modal-footer {
  padding: 12px 16px 16px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.modal-cancel,
.modal-submit {
  width: auto;
  height: 40px;
  padding: 0 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.modal-cancel {
  background: #f5f7fb;
  color: #444;
  border: 1px solid #e8ecf3;
  box-shadow: none;
}

.modal-cancel:hover {
  background: #e8ecf3;
}

.modal-submit {
  background: linear-gradient(135deg, #f39ab8, #ea729a);
  color: #fff;
}

.modal-submit:hover {
  opacity: 0.92;
}

.me-card {
  text-align: center;
}

.me-avatar-large {
  width: 92px;
  height: 92px;
  border-radius: 26px;
  object-fit: cover;
  display: block;
  margin: 2px auto 12px;
}

.me-name {
  font-size: 18px;
  font-weight: 700;
}

.me-tip {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.7;
  color: #777;
}

/* 底部导航 */
#appShell .tabbar {
  position: relative;
  z-index: 2;
  height: 64px;
  padding: 6px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex;
  gap: 6px;
  border-top: 1px solid rgba(236, 239, 246, 0.94);
  background: rgba(255, 255, 255, 0.94);
  flex-shrink: 0;
  backdrop-filter: blur(16px);
}

#appShell .tab {
  flex: 1;
  width: auto;
  height: 100%;
  min-height: 44px;
  border: none;
  border-radius: 16px;
  background: transparent;
  color: #8b8b99;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
}

#appShell .tab.active {
  color: #f06c9b;
  background: linear-gradient(135deg, rgba(255, 241, 246, 0.95), rgba(245, 240, 255, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

#appShell .tab:hover {
  transform: none;
}

/* 滚动条 */
#messages::-webkit-scrollbar,
.panel::-webkit-scrollbar {
  width: 6px;
}

#messages::-webkit-scrollbar-thumb,
.panel::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(240, 141, 176, 0.5), rgba(122, 168, 255, 0.4));
  border-radius: 999px;
}

#messages::-webkit-scrollbar-track,
.panel::-webkit-scrollbar-track {
  background: transparent;
}

.settings-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 14px;
}

.settings-card {
  border: 1px solid rgba(233, 237, 244, 0.96);
  border-radius: 24px;
  padding: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(252, 248, 251, 0.98) 100%);
  box-shadow: 0 18px 40px rgba(31, 41, 55, 0.06);
}

.settings-card-security {
  background: linear-gradient(180deg, rgba(255, 248, 251, 0.99) 0%, rgba(255, 243, 247, 0.98) 100%);
}

.settings-card-system {
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.99) 0%, rgba(244, 247, 255, 0.98) 100%);
}

.settings-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.settings-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #1f2937;
}

.settings-card-desc {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: #7b8190;
}

.settings-security-badge {
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(240, 108, 155, 0.12);
  color: #d85a8c;
  font-size: 12px;
  font-weight: 700;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-form label {
  font-size: 13px;
  color: #666;
  margin-top: 4px;
}

.settings-form input {
  width: 100%;
  height: 44px;
}

.settings-form input[readonly] {
  background: rgba(246, 248, 252, 0.95);
  color: #6b7280;
}

.settings-status {
  min-height: 20px;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.5;
  color: #7b8190;
}

.settings-status.is-success {
  color: #1f9d63;
}

.settings-status.is-error {
  color: #d94c67;
}

.settings-status.is-loading {
  color: #5f78c9;
}

.save-btn {
  width: 100%;
  margin-top: 8px;
  background: linear-gradient(135deg, #f39ab8, #ea729a);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 14px 28px rgba(234, 114, 154, 0.22);
}

.settings-security-btn {
  background: linear-gradient(135deg, #ef6f97, #dc5d88);
}

.settings-system-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.settings-system-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(227, 232, 242, 0.92);
}

.settings-system-item span {
  font-size: 12px;
  color: #93a0b3;
}

.settings-system-item strong {
  font-size: 14px;
  line-height: 1.55;
  color: #2d3446;
  word-break: break-word;
}

.settings-system-note {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.75;
  color: #7b8190;
}

.settings-actions-row {
  display: flex;
  justify-content: flex-end;
}

.logout-btn {
  margin-top: 0;
  background: linear-gradient(180deg, #fff8fb 0%, #fff1f6 100%);
  color: #d25c88;
  border: 1px solid rgba(240, 108, 155, 0.22);
  box-shadow: 0 12px 24px rgba(240, 108, 155, 0.08);
}

.moments-cover {
  position: relative;
  height: 200px;
  flex-shrink: 0;
  overflow: hidden;
}

.moments-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.moments-cover-info {
  position: absolute;
  right: 16px;
  bottom: 14px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  z-index: 2;
}

.moments-cover-name {
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
}

.moments-header-avatar {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.9);
  background: #fff;
}

.moments-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 3;
}

.moments-top-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.moments-top-left .avatar-img {
  width: 44px;
  height: 44px;
  margin-right: 0;
  border: 2px solid rgba(255, 255, 255, 0.8);
}

.moments-topbar-text {
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.moments-topbar-name {
  font-size: 17px;
  font-weight: 700;
}

.moments-topbar-status {
  font-size: 12px;
  margin-top: 4px;
  opacity: 0.9;
}

.moments-topbar-meta {
  font-size: 13px;
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  padding: 6px 12px;
  border-radius: 999px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.moments-cover-signature {
  position: absolute;
  left: 16px;
  bottom: 14px;
  color: #fff;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.15);
  padding: 6px 12px;
  border-radius: 999px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

.moments-panel {
  padding-top: 14px;
}

.moment-btn {
  width: auto;
  height: auto;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: #f5f7fb;
  color: #444;
  border: 1px solid #e8ecf3;
  box-shadow: none;
}

.moments-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-top: 22px;
  padding-bottom: 22px;
  text-align: center;
}

.moments-status .moment-content {
  margin-bottom: 0;
  color: #667085;
}

.moments-status-loading .moment-content {
  color: #6b7280;
}

.moments-status-empty .moment-content {
  color: #8b8b99;
}

.moments-status-error {
  border-color: rgba(240, 108, 155, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 246, 249, 0.96));
}

.moments-status-error .moment-content {
  color: #c25b82;
}

.moments-retry-btn {
  min-width: 88px;
  background: #fff6fa;
  color: #d25c88;
  border-color: rgba(240, 108, 155, 0.24);
}

.moments-retry-btn:hover {
  background: #ffeef5;
}

/* 电话模式模态框 */
.call-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.28s ease,
    visibility 0.28s ease;
}

.call-modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.call-content {
  opacity: 0.92;
  transform: scale(0.985) translateY(8px);
  transition:
    opacity 0.28s ease,
    transform 0.28s ease;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 40px 20px;
  position: relative;
  isolation: isolate;
}

.call-header {
  width: 100%;
  text-align: center;
}

.call-modal.active .call-content {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.call-status {
  color: #aaa;
  font-size: 14px;
  letter-spacing: 2px;
  animation: fadeInOut 2s infinite;
}

@keyframes fadeInOut {

  0%,
  100% {
    opacity: 0.6;
  }

  50% {
    opacity: 1;
  }
}

.call-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.call-avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 40px rgba(243, 154, 184, 0.3);
  animation: avatarPulse 2s infinite;
}

@keyframes avatarPulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 40px rgba(243, 154, 184, 0.3);
  }

  50% {
    transform: scale(1.05);
    box-shadow: 0 0 60px rgba(243, 154, 184, 0.5);
  }
}

.call-name {
  color: #fff;
  font-size: 28px;
  font-weight: 600;
  margin-top: 10px;
}

.call-state {
  color: #f39ab8;
  font-size: 16px;
  margin-top: 5px;
}

.call-duration {
  color: #888;
  font-size: 20px;
  font-family: monospace;
  margin-top: 15px;
  letter-spacing: 3px;
}

.call-footer {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 30px;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 92px;
  padding-bottom: 4px;
  pointer-events: auto;
}

.call-mute-btn,
.call-voice-btn {
  position: relative;
  z-index: 3;
  width: 60px;
  height: 60px;
  min-width: 60px;
  min-height: 60px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.call-mute-btn:hover,
.call-voice-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.call-mute-btn.recording,
.call-voice-btn.recording {
  background: linear-gradient(135deg, #f39ab8, #ea729a);
  animation: btnPulse 0.5s infinite;
}

@keyframes btnPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

.call-end-btn {
  position: relative;
  z-index: 3;
  width: 76px;
  height: 76px;
  min-width: 76px;
  min-height: 76px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #ef5350, #e53935);
  color: #fff;
  font-size: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
  box-shadow: 0 14px 28px rgba(229, 57, 53, 0.28);
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.call-end-btn span {
  display: block;
  line-height: 1;
  transform: rotate(135deg);
}

.call-end-btn:hover {
  background: linear-gradient(135deg, #e53935, #c62828);
  transform: scale(1.05);
}

.call-end-btn:active {
  transform: scale(0.95);
}

/* 电脑版布局 */
@media (min-width: 768px) {
  .app {
    width: min(calc(100vw - 64px), 1120px);
    max-width: 1120px;
    height: min(92vh, 960px);
    max-height: 960px;
    border-radius: 32px;
  }

  #appShell {
    width: min(calc(100vw - 64px), 1120px);
    max-width: 1120px;
    height: min(92vh, 960px);
    max-height: 960px;
    border-radius: 32px;
  }

  #guestShell {
    width: 100vw;
    max-width: none;
    height: 100vh;
    max-height: none;
    border-radius: 0;
  }

  #guestShell .guest-room-content {
    padding: 36px 42px;
  }

  #guestShell .guest-info-card {
    top: 32px;
    right: 32px;
  }

  #guestShell .guest-stage {
    width: min(520px, calc(100% - 420px));
    bottom: 32px;
  }

  #guestShell .guest-stage-frame {
    min-height: 540px;
  }

  #guestShell .guest-stage-live2d {
    min-height: 454px;
  }

  #appShell .topbar {
    min-height: 90px;
    padding: 18px 22px 14px;
  }

  .hero {
    padding: 14px 20px 12px;
  }

  .hero-card {
    padding: 18px;
    gap: 16px;
  }

  .hero-avatar-shell {
    width: 98px;
    height: 98px;
  }

  .girl-avatar-img {
    width: 90px;
    height: 90px;
  }

  .hero-name {
    font-size: 28px;
  }

  .hero-greeting {
    font-size: 15px;
  }

  #messages {
    padding: 18px 24px calc(24px + var(--chat-scroll-bottom-space));
    scroll-padding-bottom: var(--chat-scroll-bottom-space);
  }

  .message-content {
    max-width: min(72%, 680px);
  }

  .message-row {
    margin: 12px 0;
  }

  .msg {
    padding: 14px 16px;
    font-size: 14px;
  }

  .msg-avatar {
    width: 38px;
    height: 38px;
  }

  .input-box {
    padding: 12px 18px 14px;
    gap: 9px;
  }

  .composer-row {
    gap: 10px;
  }

  .tool-btn,
  .voice-btn,
  .voice-toggle-btn,
  .call-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 14px;
    font-size: 17px;
  }

  #startCallBtn {
    padding-left: 1px;
  }

  .input-shell,
  .send-btn {
    height: 50px;
  }

  .send-btn {
    min-width: 82px;
    padding: 0 18px;
  }

  .panel {
    padding: 24px 20px 30px;
  }

  .panel-title {
    font-size: 24px;
    margin-bottom: 20px;
  }

  .contact-card,
  .me-card,
  .moment-card {
    padding: 20px;
    margin-bottom: 16px;
  }

  .contact-avatar,
  .moment-avatar {
    width: 64px;
    height: 64px;
  }

  .contact-name,
  .moment-name {
    font-size: 18px;
  }

  .info-item {
    padding: 18px;
    font-size: 16px;
  }

  .info-item strong {
    font-size: 20px;
  }

  .moment-content {
    font-size: 16px;
  }

  .moment-actions {
    gap: 24px;
  }

  .moment-action-btn {
    font-size: 15px;
  }

  #appShell .tabbar {
    height: 62px;
    padding: 6px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  }

  #appShell .tab {
    font-size: 15px;
  }
}

@media (min-width: 1180px) {
  #appShell {
    width: min(calc(100vw - 72px), 1360px);
    max-width: 1360px;
    height: min(92vh, 980px);
    max-height: 980px;
  }

  #appShell .topbar {
    display: none !important;
  }

  #appShell .tabbar {
    display: none;
  }

  #appShell .desktop-nav {
    position: absolute;
    left: 18px;
    top: 18px;
    bottom: 18px;
    z-index: 8;
    width: 84px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 10px;
    border-radius: 28px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 255, 0.92));
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 20px 36px rgba(17, 24, 39, 0.08);
  }

  .desktop-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 72px;
    padding: 10px 6px;
    border-radius: 20px;
    background: transparent;
    color: #8e95a8;
    font-size: 12px;
    font-weight: 700;
    box-shadow: none;
  }

  .desktop-nav-btn:hover {
    background: rgba(255, 255, 255, 0.72);
    color: #6a7388;
    transform: none;
  }

  .desktop-nav-btn.active {
    background: linear-gradient(135deg, rgba(255, 241, 246, 0.98), rgba(245, 240, 255, 0.94));
    color: #e26b96;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.8),
      0 10px 20px rgba(240, 141, 176, 0.12);
  }

  .desktop-nav-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(244, 247, 255, 0.92);
    border: 1px solid rgba(227, 232, 242, 0.92);
    font-size: 15px;
    line-height: 1;
  }

  .desktop-nav-btn.active .desktop-nav-icon {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 244, 248, 0.95));
    border-color: rgba(240, 141, 176, 0.18);
  }

  .desktop-nav-text {
    line-height: 1.1;
  }

  #appShell .page.active {
    margin-left: 118px;
  }

  #appShell #page-chat.page.active {
    display: grid;
    grid-template-columns: minmax(340px, 400px) minmax(0, 1fr);
    gap: 18px;
    padding: 18px;
    background:
      radial-gradient(circle at top left, rgba(248, 191, 211, 0.08), transparent 24%),
      linear-gradient(180deg, #f8f9fd 0%, #f2f5fb 100%);
  }

  #appShell #page-chat .hero {
    min-height: 0;
    height: 100%;
    border-radius: 30px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 20px 40px rgba(17, 24, 39, 0.08);
  }

  #appShell #page-chat .hero::after {
    display: none;
  }

  #appShell #page-chat .hero-card {
    align-items: flex-start;
    gap: 14px;
    padding: 18px;
    border-radius: 26px;
    flex-shrink: 0;
  }

  #appShell #page-chat .hero-avatar-shell {
    width: 112px;
    height: 112px;
  }

  #appShell #page-chat .girl-avatar-img {
    width: 104px;
    height: 104px;
    border-radius: 28px;
  }

  #appShell #page-chat .hero-name {
    font-size: 30px;
  }

  #appShell #page-chat .hero-status-text,
  #appShell #page-chat .hero-greeting {
    font-size: 14px;
  }

  #appShell #page-chat .hero-chip {
    font-size: 11px;
  }

  #appShell #page-chat .desktop-live2d-stage {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    flex: 1;
  }

  .desktop-live2d-stage-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 230, 238, 0.68);
  }

  .desktop-live2d-status-row {
    display: flex;
    align-items: center;
  }

  .desktop-live2d-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 244, 248, 0.88);
    font-size: 12px;
    line-height: 1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }

  .desktop-live2d-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #7bf7a8;
    box-shadow: 0 0 0 6px rgba(123, 247, 168, 0.14);
  }

  .desktop-live2d-frame {
    position: relative;
    flex: 1;
    min-height: 320px;
    border-radius: 28px;
    overflow: hidden;
    background:
      radial-gradient(circle at 50% 18%, rgba(248, 191, 211, 0.22), transparent 28%),
      radial-gradient(circle at 50% 100%, rgba(122, 168, 255, 0.12), transparent 36%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 18px 18px 24px;
  }

  .desktop-live2d-backdrop {
    position: absolute;
    inset: 18px 18px 58px;
    border-radius: 24px;
    background:
      radial-gradient(circle at 50% 18%, rgba(248, 191, 211, 0.18), transparent 28%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.08);
    pointer-events: none;
  }

  .desktop-live2d-orbit {
    position: absolute;
    border-radius: 50%;
    filter: blur(4px);
    pointer-events: none;
    opacity: 0.7;
  }

  .desktop-live2d-orbit-left {
    left: 18px;
    top: 46px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(248, 191, 211, 0.2) 0%, rgba(248, 191, 211, 0) 72%);
  }

  .desktop-live2d-orbit-right {
    right: 10px;
    top: 86px;
    width: 138px;
    height: 138px;
    background: radial-gradient(circle, rgba(122, 168, 255, 0.18) 0%, rgba(122, 168, 255, 0) 74%);
  }

  .desktop-live2d-glow {
    position: absolute;
    inset: auto 50% 18px;
    width: 220px;
    height: 60px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(248, 191, 211, 0.26) 0%, rgba(248, 191, 211, 0) 72%);
    pointer-events: none;
  }

  .desktop-live2d-base {
    position: relative;
    z-index: 2;
    width: min(100%, 328px);
    max-height: 392px;
    object-fit: contain;
    filter:
      drop-shadow(0 24px 36px rgba(0, 0, 0, 0.24))
      drop-shadow(0 0 22px rgba(248, 191, 211, 0.12));
  }

  .desktop-live2d-copy {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 14px;
    z-index: 3;
    font-size: 12px;
    line-height: 1.55;
    color: rgba(255, 243, 247, 0.76);
    text-align: center;
  }

  #appShell #page-chat .chat {
    min-width: 0;
    min-height: 0;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(17, 24, 39, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.58);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 255, 0.94));
  }

  #appShell #page-chat #messages {
    padding: 20px 24px calc(28px + var(--chat-scroll-bottom-space));
  }

  #appShell #page-chat .message-content {
    max-width: min(76%, 780px);
  }
}

@media (min-width: 1600px) {
  #appShell {
    width: min(calc(100vw - 88px), 1720px);
    max-width: 1720px;
    height: min(94vh, 1040px);
    max-height: 1040px;
  }

  #appShell #page-chat.page.active {
    grid-template-columns: minmax(360px, 430px) minmax(0, 1fr) minmax(280px, 320px);
    gap: 20px;
    padding: 20px;
  }

  #appShell #page-chat .desktop-sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
  }

  .desktop-side-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border-radius: 24px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 255, 0.92));
    border: 1px solid rgba(255, 255, 255, 0.68);
    box-shadow: 0 18px 34px rgba(17, 24, 39, 0.06);
  }

  .desktop-side-profile {
    background:
      radial-gradient(circle at top right, rgba(248, 191, 211, 0.2), transparent 38%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(253, 248, 252, 0.96));
  }

  .desktop-side-card-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #d78ba7;
  }

  .desktop-side-profile-head {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .desktop-side-avatar {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.82);
    box-shadow: 0 12px 24px rgba(240, 141, 176, 0.14);
    background: #f3bfd0;
  }

  .desktop-side-profile-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .desktop-side-name {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-strong);
    line-height: 1.1;
  }

  .desktop-side-relation {
    font-size: 13px;
    font-weight: 700;
    color: #e26b96;
  }

  .desktop-side-signature {
    font-size: 13px;
    line-height: 1.65;
    color: #7c8497;
  }

  .desktop-side-kpi {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(244, 247, 255, 0.92);
    border: 1px solid rgba(227, 232, 242, 0.92);
  }

  .desktop-side-kpi-label {
    font-size: 11px;
    color: #98a0b2;
    letter-spacing: 0.06em;
  }

  .desktop-side-kpi strong {
    font-size: 15px;
    font-weight: 700;
    color: #2d3446;
    line-height: 1.45;
  }

  .desktop-side-note {
    font-size: 12px;
    line-height: 1.65;
    color: #8c93a5;
  }

  #appShell .tabbar {
    display: none;
  }

  #appShell #page-chat #messages {
    padding-bottom: calc(22px + var(--chat-scroll-bottom-space));
  }
}

/* 响应式布局 */
@media (max-width: 480px) {

  html,
  body {
    height: 100%;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
  }

  body {
    align-items: stretch;
    justify-content: flex-start;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    overflow: hidden;
  }

  body::before {
    display: none;
  }

  .app {
    max-width: 100%;
    height: 100vh;
    min-height: 100vh;
    height: 100svh;
    min-height: 100svh;
    height: 100dvh;
    min-height: 100dvh;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
    border: none;
  }

  #guestShell {
    width: 100%;
    max-width: 100%;
    height: 100vh;
    min-height: 100vh;
    height: 100svh;
    min-height: 100svh;
    height: 100dvh;
    min-height: 100dvh;
    background: #151821;
  }

  #guestShell .guest-room-content {
    padding: 18px 14px 22px;
  }

  #guestShell .guest-info-card {
    position: relative;
    top: auto;
    right: auto;
    width: 100%;
    padding: 18px 16px;
    border-radius: 24px;
  }

  #guestShell .guest-info-head {
    gap: 12px;
  }

  #guestShell .guest-info-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
  }

  #guestShell .guest-info-name {
    font-size: 24px;
  }

  #guestShell .guest-info-signature {
    font-size: 13px;
  }

  #guestShell .guest-info-welcome {
    margin-top: 14px;
    font-size: 16px;
  }

  #guestShell .guest-info-intro {
    font-size: 13px;
    line-height: 1.7;
  }

  #guestShell .guest-info-actions {
    margin-top: 16px;
    flex-direction: column;
  }

  #guestShell .guest-primary-btn,
  #guestShell .guest-ghost-btn {
    width: 100%;
    min-height: 46px;
    border-radius: 15px;
  }

  #guestShell .guest-ghost-btn {
    justify-content: center;
    min-height: 42px;
    padding: 0 12px;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.42);
    border: 1px solid rgba(236, 188, 210, 0.24);
    color: rgba(96, 67, 82, 0.84);
  }

  #guestShell .guest-stage {
    position: relative;
    left: auto;
    bottom: auto;
    transform: none;
    width: 100%;
    min-width: 0;
    margin-top: 18px;
  }

  #guestShell .guest-stage-halo {
    width: 240px;
    height: 68px;
    bottom: 2px;
  }

  #guestShell .guest-stage-frame {
    min-height: 320px;
    padding: 10px 0 0;
    border-radius: 0;
  }

  #guestShell .guest-stage-live2d {
    min-height: 248px;
    padding: 12px 10px 18px;
  }

  #guestShell .guest-stage-aura {
    bottom: 40px;
    height: 180px;
  }

  #guestShell .guest-live2d-base {
    max-height: 236px;
    max-width: min(100%, 236px);
  }

  #guestShell .guest-stage-copy {
    max-width: 220px;
    font-size: 13px;
    line-height: 1.7;
  }

  #guestShell .guest-login-panel {
    width: min(420px, calc(100% - 24px));
    padding: 22px 16px 18px;
    border-radius: 24px;
  }

  #guestShell .guest-login-title {
    font-size: 22px;
  }

  #guestShell .guest-login-desc {
    font-size: 13px;
  }

  #guestShell .auth-submit-btn {
    min-height: 46px;
    border-radius: 15px;
  }

  #appShell .page.active {
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  #appShell .topbar {
    min-height: 72px;
    padding: 12px 12px 10px;
  }

  .top-left {
    gap: 10px;
  }

  .topbar-avatar-shell {
    width: 48px;
    height: 48px;
  }

  .topbar-meta-wrap {
    gap: 3px;
    margin-left: 8px;
  }

  .meta-label {
    display: none;
  }

  .meta {
    min-height: 28px;
    font-size: 11px;
    padding: 6px 9px;
  }

  .name {
    font-size: 15px;
  }

  .status {
    font-size: 11px;
  }

  .hero {
    padding: 8px 10px 8px;
  }

  .hero-card {
    padding: 12px;
    gap: 10px;
    align-items: flex-start;
    border-radius: 20px;
  }

  .hero-avatar-shell {
    width: 72px;
    height: 72px;
  }

  .girl-avatar-img {
    width: 66px;
    height: 66px;
    border-radius: 20px;
  }

  .hero-name {
    font-size: 19px;
  }

  .hero-status-line {
    margin-top: 6px;
  }

  .hero-greeting-wrap {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 14px;
  }

  .hero-greeting {
    font-size: 12px;
    line-height: 1.48;
  }

  .hero-info {
    margin-top: 8px;
    gap: 6px;
  }

  .hero-chip {
    font-size: 10px;
    padding: 5px 8px;
  }

  #messages {
    padding: 10px 10px calc(12px + var(--chat-scroll-bottom-space-mobile));
    scroll-padding-bottom: var(--chat-scroll-bottom-space-mobile);
  }

  .message-row {
    margin: 10px 0;
    gap: 8px;
  }

  .message-content {
    max-width: min(84%, 100%);
  }

  .msg {
    padding: 11px 13px;
    font-size: 13px;
  }

  .msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 12px;
  }

  .input-box {
    padding: 8px 10px 12px;
    gap: 6px;
  }

  .input-tools {
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    flex-wrap: nowrap;
  }

  .voice-status-bar {
    min-height: 34px;
    padding: 8px 10px;
    border-radius: 14px;
    font-size: 11px;
  }

  .voice-status-bar::before {
    width: 7px;
    height: 7px;
  }

  .tools-label {
    width: auto;
    margin-bottom: 0;
    white-space: nowrap;
  }

  .tools-actions {
    width: auto;
    flex: 1;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: nowrap;
  }

  .tool-btn,
  .voice-btn,
  .voice-toggle-btn,
  .call-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 12px;
    font-size: 16px;
  }

  #startCallBtn {
    padding-left: 1px;
  }

  .composer-row {
    gap: 6px;
  }

  .input-shell {
    height: 44px;
    padding: 0 10px;
    border-radius: 16px;
  }

  .input-prefix {
    padding: 4px 7px;
    font-size: 10px;
  }

  .send-btn {
    min-width: 66px;
    height: 44px;
    padding: 0 13px;
    border-radius: 16px;
  }

  .send-btn::after {
    font-size: 13px;
  }

  .panel {
    padding: 14px 12px 20px;
  }

  .panel-title {
    font-size: 20px;
    margin-bottom: 14px;
  }

  .contact-card,
  .me-card,
  .moment-card {
    padding: 14px;
    margin-bottom: 12px;
  }

  .contact-avatar,
  .moment-avatar {
    width: 48px;
    height: 48px;
  }

  .contact-name,
  .moment-name {
    font-size: 15px;
  }

  .info-item {
    padding: 14px;
    font-size: 14px;
  }

  .info-item strong {
    font-size: 16px;
  }

  .moment-content {
    font-size: 14px;
  }

  .moment-actions {
    gap: 16px;
  }

  .moment-action-btn {
    font-size: 13px;
  }

  #appShell .tabbar {
    height: auto;
    min-height: 60px;
    padding: 4px 6px calc(8px + env(safe-area-inset-bottom, 0px));
  }

  #appShell .tab {
    min-height: 46px;
    font-size: 13px;
    border-radius: 14px;
  }

  .call-content {
    padding: 34px 18px;
  }

  .call-avatar {
    width: 124px;
    height: 124px;
  }

  .call-footer {
    gap: 22px;
    min-height: 88px;
    padding-bottom: 2px;
  }

  .call-end-btn {
    width: 74px;
    height: 74px;
    min-width: 74px;
    min-height: 74px;
  }
}

@media (max-width: 480px) and (max-height: 760px) {
  #appShell .topbar {
    min-height: 68px;
    padding: 10px 10px 8px;
  }

  #guestShell .guest-room-content {
    padding: 14px 12px 18px;
  }

  #guestShell .guest-info-card {
    padding: 16px 14px;
    border-radius: 22px;
  }

  #guestShell .guest-stage-frame {
    min-height: 280px;
    padding: 8px 0 0;
  }

  #guestShell .guest-stage-live2d {
    min-height: 218px;
    padding: 10px 8px 14px;
  }

  #guestShell .guest-login-panel {
    padding: 20px 14px 16px;
  }

  .topbar-avatar-shell {
    width: 44px;
    height: 44px;
  }

  .hero {
    padding: 6px 8px;
  }

  .hero-card {
    padding: 10px;
    gap: 8px;
    border-radius: 18px;
  }

  .hero-avatar-shell {
    width: 62px;
    height: 62px;
  }

  .girl-avatar-img {
    width: 56px;
    height: 56px;
    border-radius: 18px;
  }

  .hero-overline {
    font-size: 9px;
  }

  .hero-name {
    font-size: 18px;
  }

  .hero-state-badge {
    font-size: 10px;
    padding: 4px 8px;
  }

  .hero-status-line {
    margin-top: 5px;
  }

  .hero-greeting-wrap {
    margin-top: 6px;
    padding: 6px 8px;
  }

  .hero-greeting-label {
    font-size: 9px;
  }

  .hero-greeting {
    font-size: 11px;
    line-height: 1.42;
  }

  .hero-info {
    margin-top: 6px;
    gap: 5px;
  }

  .hero-chip {
    font-size: 9px;
    padding: 4px 7px;
  }

  #messages {
    padding: 8px 10px calc(10px + var(--chat-scroll-bottom-space-mobile));
    scroll-padding-bottom: var(--chat-scroll-bottom-space-mobile);
  }

  .message-row {
    margin: 8px 0;
  }

  .input-box {
    padding: 6px 8px 10px;
    gap: 5px;
  }

  .tools-label {
    display: none;
  }

  .tool-btn,
  .voice-btn,
  .voice-toggle-btn,
  .call-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 11px;
    font-size: 15px;
  }

  #startCallBtn {
    padding-left: 1px;
  }

  .input-shell {
    height: 42px;
    padding: 0 9px;
  }

  .send-btn {
    min-width: 62px;
    height: 42px;
    padding: 0 12px;
  }

  #appShell .tabbar {
    min-height: 58px;
    padding: 4px 6px calc(7px + env(safe-area-inset-bottom, 0px));
  }
}
