/* ==========================================================================
   Companion / Chat (???? ? ??)
   Split from app.css for feature isolation.
   ========================================================================== */

/* ==================== ??????? / ??? ==================== */
.profile-menu-icon.is-companion {
  background: linear-gradient(135deg, rgba(254, 226, 226, 0.95) 0%, rgba(252, 165, 165, 0.45) 100%);
  color: #be123c;
}

.companion-preview-card {
  padding: 14px;
}

.companion-preview-layout {
  display: flex;
  gap: 14px;
  align-items: center;
}

.companion-preview-img-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  flex-shrink: 0;
}

.companion-preview-img {
  width: 100%;
  height: 100%;
  border-radius: 20px;
  background: #e2e8f0 center/cover no-repeat;
  border: 2px solid #fff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

.companion-preview-img-wrap.is-empty .companion-preview-img {
  background: linear-gradient(145deg, #fecdd3 0%, #e2e8f0 55%, #f1f5f9 100%);
}

.companion-preview-loading {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.42);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.companion-preview-spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: companion-spin 0.75s linear infinite;
}

@keyframes companion-spin {
  to { transform: rotate(360deg); }
}

.companion-preview-meta {
  flex: 1;
  min-width: 0;
}

.companion-preview-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.companion-preview-name-row strong {
  font-size: 16px;
  color: #0f172a;
}

.companion-preview-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(190, 18, 60, 0.1);
  color: #be123c;
}

.companion-preview-tip {
  margin: 0 0 10px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
}

.companion-preview-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.companion-gen-progress {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(241, 245, 249, 0.95);
}

.companion-gen-progress-bar {
  height: 6px;
  border-radius: 999px;
  background: #f1f5f9;
  overflow: hidden;
}

.companion-gen-progress-bar i {
  display: block;
  height: 100%;
  width: 35%;
  border-radius: 999px;
  background: linear-gradient(90deg, #fb7185, #be123c, #fb7185);
  background-size: 200% 100%;
  animation: companion-progress 1.4s ease-in-out infinite;
}

@keyframes companion-progress {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

.companion-gen-progress-text {
  margin: 8px 0 0;
  font-size: 12px;
  color: #64748b;
}

.companion-relation-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.companion-relation-btn {
  padding: 12px 10px;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #f8fafc;
  font-size: 14px;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  font-family: inherit;
}

.companion-relation-btn.active {
  background: #fff;
  border-color: rgba(190, 18, 60, 0.35);
  color: #be123c;
  box-shadow: 0 2px 10px rgba(190, 18, 60, 0.08);
}

.companion-vibe-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.companion-vibe-chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #f8fafc;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  font-family: inherit;
}

.companion-vibe-chip.active {
  background: var(--brand-tint-10);
  border-color: var(--brand-tint-22);
  color: var(--brand-deep);
}

#companion-appearance,
#companion-visual-prompt {
  width: 100%;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid rgba(203, 213, 225, 0.8);
  background: #f8fafc;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: #0f172a;
  resize: vertical;
  min-height: 88px;
}

.companion-prompt-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.companion-prompt-box label {
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
}

.companion-prompt-box.is-loading::after {
  content: '';
  position: absolute;
  inset: 28px 0 0;
  border-radius: 12px;
  pointer-events: none;
  background: linear-gradient(
    110deg,
    rgba(255, 241, 242, 0.15) 0%,
    rgba(251, 113, 133, 0.18) 45%,
    rgba(255, 241, 242, 0.15) 90%
  );
  background-size: 200% 100%;
  animation: companion-prompt-shimmer 1.2s ease-in-out infinite;
}

.companion-prompt-box.is-loading #companion-visual-prompt {
  color: #94a3b8;
  min-height: 96px;
}

#companion-visual-prompt.is-just-filled {
  animation: companion-prompt-reveal 0.55s ease;
}

#companion-diy-form.is-refining-prompt .companion-diy-actions,
#companion-diy-form.is-refining-prompt .companion-quick-tags,
#companion-diy-form.is-refining-prompt .companion-vibe-chips,
#companion-diy-form.is-refining-prompt .companion-relation-pick {
  pointer-events: none;
  opacity: 0.72;
}

.btn-companion-secondary.is-loading {
  gap: 8px;
  color: #be123c;
  border-color: rgba(225, 29, 72, 0.28);
  background: #fff1f2;
  cursor: wait;
}

.companion-btn-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(190, 18, 60, 0.22);
  border-top-color: #e11d48;
  animation: companion-spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes companion-prompt-shimmer {
  0% { background-position: 120% 0; }
  100% { background-position: -80% 0; }
}

@keyframes companion-prompt-reveal {
  from { opacity: 0.35; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.companion-diy-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.companion-face-lock {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 12px;
  font-size: 12.5px;
  color: #475569;
  cursor: pointer;
  user-select: none;
}

.companion-face-lock input {
  width: 16px;
  height: 16px;
  accent-color: #be123c;
}

.btn-companion-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #fff;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.btn-chat-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 16px;
  border-radius: 11px;
  border: 0;
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(190, 18, 60, 0.25);
}

.chat-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.chat-room {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  background: #ededed;
  border-radius: 0;
  overflow: hidden;
  border: 0;
}

.chat-room-header {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 0;
  padding: 4px 4px 6px;
  padding-top: calc(4px + env(safe-area-inset-top, 0px));
  min-height: calc(52px + env(safe-area-inset-top, 0px));
  height: auto;
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  flex-shrink: 0;
  z-index: 2;
}

.btn-chat-back,
.btn-chat-more {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #111827;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  align-self: flex-start;
  -webkit-tap-highlight-color: transparent;
}

.btn-chat-back:active,
.btn-chat-more:active {
  opacity: 0.55;
}

.chat-header-peer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
  padding: 2px 4px 0;
  gap: 2px;
}

.chat-header-name-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.chat-header-name-row strong {
  font-size: 16px;
  font-weight: 650;
  color: #111827;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-header-name-row .chat-peer-status-indicator {
  font-size: 11px;
  color: #9ca3af;
  line-height: 1.2;
  flex-shrink: 0;
}

.chat-header-name-row .chat-peer-status-indicator[hidden] {
  display: none !important;
}

.chat-bond-row {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  max-width: 100%;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.chat-bond-hearts {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.chat-bond-heart {
  width: 12px;
  height: 12px;
  display: block;
}

.chat-bond-heart.is-on {
  color: #ef4444;
  fill: #ef4444;
}

.chat-bond-heart.is-off {
  color: #f87171;
  fill: transparent;
  stroke: #f87171;
  stroke-width: 1.6;
}

.chat-bond-title {
  font-family: "Segoe Script", "Brush Script MT", "Zapfino", "STXingkai", "华文行楷", cursive;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
  white-space: nowrap;
}

.chat-drawer-actions {
  display: flex;
  gap: 8px;
  padding: 8px 14px 4px;
}

.chat-drawer-action {
  flex: 1;
  height: 34px;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 650;
  font-family: inherit;
  cursor: pointer;
}

.chat-drawer-action.is-danger {
  color: #be123c;
  border-color: rgba(190, 18, 60, 0.22);
  background: rgba(254, 242, 242, 0.8);
}

/* 兼容旧居中结构，避免残留样式干扰 */
.chat-header-center {
  display: none;
}


.chat-empty {
  margin: 0;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #f7f7f7;
  border: 0;
  border-radius: 0;
}

.chat-empty-bar {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  padding-top: env(safe-area-inset-top, 0px);
  min-height: calc(44px + env(safe-area-inset-top, 0px));
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  flex-shrink: 0;
}

.chat-empty-bar-title {
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  color: #111827;
}

.chat-empty-bar-spacer {
  width: 44px;
  height: 44px;
}

.chat-empty-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 28px calc(28px + env(safe-area-inset-bottom, 0px));
}

.chat-empty-visual {
  margin-bottom: 18px;
}

.chat-empty-avatar-placeholder {
  width: 72px;
  height: 72px;
  margin: 0 auto;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #ffe4e6 0%, #fecdd3 100%);
  color: #e11d48;
  box-shadow: 0 10px 28px rgba(225, 29, 72, 0.12);
}

.chat-empty-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  letter-spacing: 0.01em;
}

.chat-empty-desc {
  margin: 0 0 22px;
  font-size: 13.5px;
  color: #94a3b8;
  line-height: 1.65;
  max-width: 260px;
}

.chat-empty .btn-chat-primary {
  min-width: 168px;
  height: 44px;
  border-radius: 12px;
  font-size: 15px;
}


.chat-room-peer {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.chat-peer-avatar {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: #d1d5db center/cover no-repeat;
  flex-shrink: 0;
}

.chat-peer-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-peer-name-row strong {
  font-size: 15px;
  color: #0f172a;
}

.chat-peer-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(190, 18, 60, 0.1);
  color: #be123c;
  white-space: nowrap;
}

.chat-peer-role {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #94a3b8;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.btn-chat-edit-face {
  border: 0;
  background: #f1f5f9;
  color: #475569;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}

.chat-persona-banner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 14px 10px;
  background: linear-gradient(135deg, rgba(254, 242, 242, 0.95), rgba(255, 255, 255, 0.98));
  border-bottom: 1px solid rgba(254, 226, 226, 0.8);
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
}

.chat-persona-banner-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #be123c;
}

.chat-persona-banner strong {
  font-size: 15px;
  color: #0f172a;
  line-height: 1.3;
}

.chat-persona-banner #chat-persona-banner-desc {
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
}

.chat-quota-hint {
  padding: 0 2px;
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.45;
  min-height: 0;
}

.chat-quota-hint:empty {
  display: none;
}

.chat-role-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 12px;
  background: #fff;
  border-bottom: 1px solid rgba(241, 245, 249, 0.95);
  -webkit-overflow-scrolling: touch;
}

.chat-role-chip {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #f8fafc;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  font-family: inherit;
}

.chat-role-chip.active {
  background: rgba(190, 18, 60, 0.1);
  border-color: rgba(190, 18, 60, 0.28);
  color: #be123c;
}

.chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 12px 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-padding-bottom: 16px;
  scrollbar-gutter: stable;
  background: transparent;
}

.chat-loading {
  text-align: center;
  color: #8a8a8a;
  font-size: 12px;
  padding: 20px 0;
}

.chat-bubble-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}

.chat-bubble-row.is-user {
  flex-direction: row-reverse;
}

.chat-bubble-row.is-assistant {
  flex-direction: row;
}

.chat-msg-avatar {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  background: #c4c4c4 center/cover no-repeat;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
}

.chat-bubble-main {
  display: flex;
  flex-direction: column;
  max-width: calc(100% - 56px);
  min-width: 0;
}

.chat-bubble-row.is-user .chat-bubble-main {
  align-items: flex-end;
}

.chat-bubble-row.is-assistant .chat-bubble-main {
  align-items: flex-start;
}

.chat-bubble {
  position: relative;
  max-width: 100%;
  padding: 9px 11px;
  border-radius: 6px;
  font-size: 15px;
  line-height: 1.45;
  word-break: break-word;
  overflow-wrap: anywhere;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.chat-bubble-row.is-user .chat-bubble {
  background: #95ec69;
  color: #111827;
  border: 0;
  border-radius: 6px;
}

.chat-bubble-row.is-assistant .chat-bubble {
  background: #fff;
  color: #111827;
  border: 0;
  border-radius: 6px;
}

/* 微信式小三角 */
.chat-bubble-row.is-assistant .chat-bubble::before,
.chat-bubble-row.is-user .chat-bubble::before {
  content: '';
  position: absolute;
  top: 12px;
  width: 0;
  height: 0;
  border-style: solid;
}

.chat-bubble-row.is-assistant .chat-bubble::before {
  left: -6px;
  border-width: 5px 6px 5px 0;
  border-color: transparent #fff transparent transparent;
}

.chat-bubble-row.is-user .chat-bubble::before {
  right: -6px;
  border-width: 5px 0 5px 6px;
  border-color: transparent transparent transparent #95ec69;
}

.chat-bubble-row.is-streaming .chat-bubble::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 0.95em;
  margin-left: 2px;
  vertical-align: -0.1em;
  background: #be123c;
  animation: chat-caret 0.9s steps(1) infinite;
}

@keyframes chat-caret {
  50% { opacity: 0; }
}

/* 微信式语音条容器 */
.wx-voice-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 100%;
}

.wx-voice-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}

.wx-voice-bubble {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 80px;
  max-width: 240px;
  height: 40px;
  padding: 0 12px 0 10px;
  border: 0;
  border-radius: 6px;
  background: #fff;
  color: #111827;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.wx-voice-bubble::before {
  content: '';
  position: absolute;
  top: 12px;
  left: -6px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 6px 5px 0;
  border-color: transparent #fff transparent transparent;
}

.wx-voice-bubble:active:not(:disabled) {
  filter: brightness(0.97);
}

.wx-voice-bubble.is-disabled,
.wx-voice-bubble:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.wx-voice-line.is-loading .wx-voice-bubble {
  pointer-events: none;
  cursor: wait;
}

/* 气泡右侧：加载圈 / 未读红点 */
.wx-voice-aside {
  position: relative;
  width: 16px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wx-voice-loading {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(148, 163, 184, 0.35);
  border-top-color: #64748b;
  border-radius: 50%;
  box-sizing: border-box;
}

.wx-voice-line.is-loading .wx-voice-loading {
  display: block;
  animation: wx-voice-spin 0.7s linear infinite;
}

.wx-voice-line.is-loading .wx-voice-dot {
  opacity: 0;
}

@keyframes wx-voice-spin {
  to { transform: rotate(360deg); }
}

/* 未读小红点（气泡右侧） */
.wx-voice-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fa5151;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.wx-voice-dot.is-read {
  opacity: 0;
  transform: scale(0.5);
  pointer-events: none;
}

.wx-voice-wave {
  position: relative;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.wx-voice-wave i {
  position: absolute;
  left: 1px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border: 2px solid transparent;
  border-right-color: #111827;
  border-radius: 50%;
  box-sizing: border-box;
  opacity: 0.22;
  transform-origin: 2px center;
  transform: scale(0.32);
}

.wx-voice-wave i:nth-child(2) {
  opacity: 0.5;
  transform: scale(0.58);
}

.wx-voice-wave i:nth-child(3) {
  opacity: 1;
  transform: scale(0.88);
}

/* 微信同款：声浪由内向外依次亮起 */
.wx-voice-bubble.is-playing .wx-voice-wave i {
  animation: wx-voice-arc 0.9s steps(1, end) infinite;
}

.wx-voice-bubble.is-playing .wx-voice-wave i:nth-child(1) {
  animation-delay: 0s;
}

.wx-voice-bubble.is-playing .wx-voice-wave i:nth-child(2) {
  animation-delay: 0.3s;
}

.wx-voice-bubble.is-playing .wx-voice-wave i:nth-child(3) {
  animation-delay: 0.6s;
}

@keyframes wx-voice-arc {
  0%, 32% { opacity: 1; }
  33%, 100% { opacity: 0.18; }
}

.wx-voice-bubble.is-sec-pending .wx-voice-sec {
  min-width: 0;
  opacity: 0;
}

.wx-voice-sec {
  margin-left: auto;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  min-width: 2.2em;
  text-align: right;
}

.wx-voice-bubble.is-playing .wx-voice-sec {
  color: #0f172a;
}

/* 转文字展开条目 */
.wx-voice-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding-left: 2px;
}

.wx-voice-toggle-text {
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.15s;
  font-family: inherit;
}

.wx-voice-toggle-text:hover,
.wx-voice-toggle-text:active {
  color: #0369a1;
}

.wx-voice-transcript {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(241, 245, 249, 0.95);
  color: #475569;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
  max-width: 100%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  animation: wx-slide-down 0.18s ease-out;
}

@keyframes wx-slide-down {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-room.wallpaper-dim .wx-voice-bubble {
  background: rgba(255, 255, 255, 0.95);
}

.chat-room.wallpaper-dim .wx-voice-bubble::before {
  border-color: transparent rgba(255, 255, 255, 0.95) transparent transparent;
}

.chat-composer {
  display: flex;
  gap: 8px;
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.78);
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  align-items: flex-end;
  flex-shrink: 0;
  z-index: 2;
}

.chat-composer input {
  flex: 1;
  min-width: 0;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(203, 213, 225, 0.85);
  background: #f8fafc;
  padding: 0 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.chat-composer input:focus {
  border-color: rgba(190, 18, 60, 0.4);
  background: #fff;
}

.chat-composer textarea {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  max-height: 120px;
  border-radius: 6px;
  border: 0;
  background: #fff;
  padding: 10px 12px;
  font-size: 15px;
  line-height: 1.4;
  font-family: inherit;
  outline: none;
  resize: none;
}

.chat-composer textarea:focus {
  border: 0;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(7, 193, 96, 0.35);
}

.chat-intimacy-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 2px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(190, 18, 60, 0.1);
  color: #be123c;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
}

.chat-intimacy-heart {
  font-size: 10px;
}

.chat-intimacy-panel {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(254, 242, 242, 0.95), #fff);
  border: 1px solid rgba(254, 226, 226, 0.9);
  width: 100%;
  box-sizing: border-box;
}

.chat-intimacy-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #64748b;
}

.chat-intimacy-row strong {
  color: #be123c;
  font-size: 13px;
}

.chat-intimacy-bar {
  margin-top: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(190, 18, 60, 0.12);
  overflow: hidden;
}

.chat-intimacy-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #fb7185, #e11d48);
  transition: width 0.35s ease;
}

.chat-intimacy-hint {
  margin: 6px 0 0;
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.4;
}

.chat-drawer-section {
  width: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-sizing: border-box;
}

.chat-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 12px;
  background: #fff;
  color: #334155;
  font-size: 13px;
  font-weight: 650;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.chat-section-toggle:active {
  background: #f8fafc;
}

.chat-section-toggle.is-open {
  border-color: rgba(190, 18, 60, 0.22);
  background: rgba(254, 242, 242, 0.55);
  color: #be123c;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.chat-section-toggle-label {
  min-width: 0;
  flex: 1;
}

.chat-section-chevron {
  flex-shrink: 0;
  font-size: 12px;
  color: #94a3b8;
  transition: transform 0.18s ease;
}

.chat-section-toggle.is-open .chat-section-chevron {
  color: #be123c;
  transform: rotate(180deg);
}

/* 兼容旧 class，避免残留引用失效 */
.chat-memory-bar,
.chat-persona-edit {
  padding: 0;
  background: transparent;
  border: 0;
}

.chat-memory-toggle {
  display: none;
}

.chat-persona-edit-panel,
.chat-memory-panel {
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: #f8fafc;
  box-sizing: border-box;
}

.chat-persona-edit-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-persona-edit-panel label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
}

.chat-persona-edit-panel input,
.chat-persona-edit-panel textarea {
  width: 100%;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.4;
  font-family: inherit;
  color: #0f172a;
  background: #fff;
  outline: none;
  resize: vertical;
  box-sizing: border-box;
}

.chat-persona-edit-panel input:focus,
.chat-persona-edit-panel textarea:focus {
  border-color: rgba(190, 18, 60, 0.35);
  box-shadow: 0 0 0 3px rgba(190, 18, 60, 0.08);
}

.chat-persona-edit-panel .btn-chat-primary {
  margin-top: 2px;
  height: 40px;
  width: 100%;
}

.chat-memory-text {
  margin: 0 0 8px;
  font-size: 12px;
  color: #475569;
  line-height: 1.55;
  white-space: pre-wrap;
  max-height: 120px;
  overflow-y: auto;
}

.chat-memory-label {
  margin: 8px 0 4px;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.02em;
}

.chat-memory-label:first-child {
  margin-top: 0;
}

.chat-persona-bible {
  max-height: 160px;
}

.chat-memory-clear {
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: #be123c;
  font-size: 11px;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.chat-llm-gate {
  padding: 8px 14px;
  font-size: 12px;
  color: #b45309;
  background: #fffbeb;
  border-bottom: 1px solid rgba(253, 230, 138, 0.8);
}

.companion-generating-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
}

/* ==================== ?????????????? ==================== */

/* ??????? (???) */
.companion-stage-card {
  padding: 16px;
  background: #fff;
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.companion-stage-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.companion-stage-figure-wrap {
  position: relative;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 3 / 4;
  margin: 0 auto;
  border-radius: 22px;
  overflow: hidden;
  background: #f1f5f9;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
}

.companion-stage-figure-wrap.is-empty .companion-stage-figure {
  background: linear-gradient(145deg, #fecdd3 0%, #e2e8f0 55%, #f1f5f9 100%);
}

.companion-stage-figure {
  width: 100%;
  height: 100%;
  background: #e2e8f0 center top / cover no-repeat;
  transform-origin: center center;
  animation: companion-breathe 7s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes companion-breathe {
  0% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.022) translateY(-3px); }
  100% { transform: scale(1.01) translateY(-1px); }
}

.companion-stage-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02) 0%, rgba(0, 0, 0, 0.08) 55%, rgba(15, 23, 42, 0.52) 100%);
}

/* ???????? */
.companion-stage-whisper {
  position: absolute;
  bottom: 14px;
  left: 12px;
  right: 12px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.85);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s;
  user-select: none;
}

.companion-stage-whisper:active {
  transform: scale(0.97);
  background: rgba(255, 255, 255, 0.98);
}

.whisper-heart {
  font-size: 14px;
  animation: heart-pulse 2s infinite ease-in-out;
  flex-shrink: 0;
}

@keyframes heart-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.22); }
}

.whisper-text {
  font-size: 12.5px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.42;
  flex: 1;
}

.companion-stage-loading {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 5;
  text-align: center;
  padding: 20px;
}

.companion-stage-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  animation: companion-spin 0.85s linear infinite;
  margin-bottom: 4px;
}

.companion-stage-spinner-title {
  font-size: 14px;
  font-weight: 700;
}

.companion-stage-spinner-desc {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.75);
}

.companion-stage-meta {
  padding: 2px 4px;
}

.companion-stage-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.companion-stage-name {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
}

.companion-stage-role-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
}

.companion-stage-bio {
  margin: 0 0 14px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
}

.companion-stage-actions {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 10px;
}

.btn-stage-chat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  border: 0;
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 16px rgba(190, 18, 60, 0.28);
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-stage-chat:active {
  transform: scale(0.98);
}

.btn-stage-remake {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(203, 213, 225, 0.85);
  background: #fff;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.btn-stage-remake:active {
  background: #f8fafc;
}

/* ???? ? ??????? */
.companion-scenes-card {
  margin-top: 14px;
  padding: 16px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.companion-scenes-desc {
  margin: 0 0 12px;
  font-size: 12px;
  color: #64748b;
}

.companion-scenes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.companion-scene-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  background: #f8fafc;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.companion-scene-item:active {
  transform: scale(0.98);
}

.companion-scene-item.active {
  background: #fff5f7;
  border-color: #be123c;
  box-shadow: 0 4px 14px rgba(190, 18, 60, 0.12);
}

.scene-item-thumb {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.theme-thumb-warm-room {
  background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 50%, #fecdd3 100%);
}

.theme-thumb-night-study {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #334155 100%);
}

.theme-thumb-sunset-window {
  background: linear-gradient(135deg, #fb7185 0%, #f472b6 40%, #fdba74 100%);
}

.theme-thumb-minimal-glass {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.scene-item-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.scene-item-name {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.scene-item-sub {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ???????? */
.companion-candidates-card {
  margin-top: 14px;
  padding: 16px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.companion-candidates-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.candidate-pick-item {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  background: #e2e8f0 center top / cover no-repeat;
  cursor: default;
  overflow: hidden;
  border: 2px solid transparent;
  transition: transform 0.2s, border-color 0.2s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.candidate-pick-item:active {
  transform: none;
}

.candidate-pick-item.active {
  border-color: #be123c;
  box-shadow: 0 4px 16px rgba(190, 18, 60, 0.25);
}

.candidate-pick-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.65);
  color: #fff;
  backdrop-filter: blur(4px);
}

.candidate-pick-btn {
  position: absolute;
  bottom: 6px;
  left: 6px;
  right: 6px;
  padding: 4px 0;
  font-size: 11px;
  font-weight: 700;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: #be123c;
  text-align: center;
  backdrop-filter: blur(6px);
}

/* DIY ???????? */
.companion-ratio-pick,
.companion-count-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.companion-ratio-btn,
.companion-count-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #f8fafc;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: all 0.15s;
}

.companion-ratio-btn.active,
.companion-count-btn.active {
  background: #fff;
  border-color: rgba(190, 18, 60, 0.35);
  box-shadow: 0 2px 10px rgba(190, 18, 60, 0.08);
}

.ratio-btn-title,
.count-btn-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.companion-ratio-btn.active .ratio-btn-title,
.companion-count-btn.active .count-btn-title {
  color: #be123c;
}

.ratio-btn-desc,
.count-btn-desc {
  font-size: 10.5px;
  color: #94a3b8;
  margin-top: 3px;
  line-height: 1.35;
}

/* ???????? */
.companion-tags-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid rgba(241, 245, 249, 0.9);
}

.companion-tag-cat {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.cat-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  flex-shrink: 0;
}

.companion-quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.companion-quick-tag {
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: #fff;
  color: #475569;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.companion-quick-tag:active {
  transform: scale(0.95);
  background: rgba(190, 18, 60, 0.08);
  border-color: rgba(190, 18, 60, 0.25);
  color: #be123c;
}

.companion-quick-tag.is-picked {
  background: rgba(190, 18, 60, 0.1);
  border-color: rgba(190, 18, 60, 0.3);
  color: #be123c;
}

.companion-diy-gen-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(254, 242, 242, 0.95), rgba(255, 251, 235, 0.95));
  border: 1px solid rgba(254, 226, 226, 0.9);
}

.companion-diy-gen-banner strong {
  display: block;
  font-size: 13px;
  color: #9f1239;
}

.companion-diy-gen-banner p {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.4;
}

#companion-stage-panel,
#companion-diy-panel {
  animation: companion-panel-in 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes companion-panel-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================== ??????????????? ==================== */

/* ?????????? */
.chat-room {
  transition: background 0.4s ease, color 0.3s ease;
}

.chat-room.theme-warm-room {
  background: radial-gradient(circle at 85% 15%, rgba(254, 215, 170, 0.45) 0%, transparent 55%),
              radial-gradient(circle at 10% 85%, rgba(254, 205, 211, 0.38) 0%, transparent 60%),
              #fff9f6;
}

.chat-room.theme-night-study {
  background: radial-gradient(circle at 80% 12%, rgba(251, 191, 36, 0.15) 0%, transparent 50%),
              radial-gradient(circle at 15% 85%, rgba(30, 41, 59, 0.95) 0%, transparent 60%),
              #0b1120;
}

.chat-room.theme-sunset-window {
  background: radial-gradient(circle at 85% 25%, rgba(244, 114, 182, 0.32) 0%, transparent 55%),
              radial-gradient(circle at 15% 75%, rgba(251, 146, 60, 0.28) 0%, transparent 50%),
              #fff5f5;
}

.chat-room.theme-minimal-glass {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

/* ???????????????? */
.chat-room.theme-night-study .chat-room-header,
.chat-room.theme-night-study .chat-persona-drawer-inner,
.chat-room.theme-night-study .chat-composer {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(51, 65, 85, 0.7);
  color: #f1f5f9;
}

.chat-room.theme-night-study .chat-peer-name-row strong {
  color: #f8fafc;
}

.chat-room.theme-night-study .chat-peer-status-indicator {
  color: #94a3b8;
}

.chat-room.theme-night-study .btn-chat-toggle-panel {
  background: rgba(30, 41, 59, 0.9);
  color: #e2e8f0;
  border-color: rgba(71, 85, 105, 0.6);
}

.chat-room.theme-night-study .btn-chat-icon-action {
  background: rgba(30, 41, 59, 0.9);
  color: #94a3b8;
}

.chat-room.theme-night-study .chat-bubble-row.is-assistant .chat-bubble {
  background: rgba(30, 41, 59, 0.88);
  color: #f8fafc;
  border-color: rgba(71, 85, 105, 0.55);
}

.chat-room.theme-night-study .chat-composer textarea {
  background: rgba(30, 41, 59, 0.9);
  color: #f8fafc;
  border-color: rgba(71, 85, 105, 0.6);
}

/* ?????? */
.chat-peer-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.chat-peer-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #fff;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
  animation: online-pulse 2.5s infinite;
}

@keyframes online-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.85; }
}

.chat-peer-status-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 1px;
}

.chat-peer-status-indicator {
  font-size: 11px;
  color: #94a3b8;
  transition: color 0.25s;
}

.chat-peer-status-indicator.is-thinking,
.chat-peer-status-indicator.is-typing {
  color: #be123c;
  font-weight: 600;
}

/* ?????? */
.btn-chat-toggle-panel {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.btn-chat-toggle-panel:active {
  background: #f1f5f9;
}

.btn-chat-icon-action {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: #f1f5f9;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-chat-icon-action:active {
  background: #e2e8f0;
  color: #be123c;
}

/* 聊天页顶部设置抽屉：纵向分区，避免挤成一行 */
.chat-persona-drawer {
  background: #fff;
  border-bottom: 1px solid rgba(241, 245, 249, 0.95);
  flex-shrink: 0;
  max-height: min(68vh, 78%);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  animation: drawer-down 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 3;
}

.chat-persona-drawer-inner {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

@keyframes drawer-down {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-drawer-footer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 10px;
  padding: 8px 14px 14px;
  width: 100%;
  box-sizing: border-box;
}

.chat-drawer-actions {
  padding: 10px 14px 2px;
}

.chat-drawer-action {
  height: 38px;
  border-radius: 10px;
  font-size: 13px;
}

/* 微信气泡不使用毛玻璃 */
.chat-bubble {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

/* ???????? (3???????) */
.chat-thinking-bubble {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  min-height: 40px;
}

.chat-thinking-dots {
  display: flex;
  align-items: center;
  gap: 5px;
}

.chat-thinking-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #be123c;
  display: inline-block;
  animation: chat-bounce 1.4s infinite ease-in-out both;
}

.chat-thinking-dots span:nth-child(1) { animation-delay: -0.32s; }
.chat-thinking-dots span:nth-child(2) { animation-delay: -0.16s; }
.chat-thinking-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes chat-bounce {
  0%, 80%, 100% {
    transform: scale(0.65);
    opacity: 0.45;
  }
  40% {
    transform: scale(1.15);
    opacity: 1;
  }
}

/* ????????? */
.chat-bubble-row.is-withdrawing {
  animation: bubble-withdraw 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes bubble-withdraw {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.85); opacity: 0; max-height: 0; margin: 0; padding: 0; }
}

.chat-system-notice {
  text-align: center;
  margin: 2px 0;
  flex-shrink: 0;
  user-select: none;
}

.chat-system-notice span {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  color: #64748b;
  font-size: 11px;
  backdrop-filter: blur(4px);
}

.chat-time-sep {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 6px 0 2px;
  flex-shrink: 0;
  user-select: none;
  pointer-events: none;
}

.chat-time-sep span {
  display: inline-block;
  max-width: 90%;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.08);
  color: #888;
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}

.btn-chat-send {
  height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: #07c160;
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}

.btn-chat-send:disabled {
  opacity: 0.55;
}

/* companion photo wallpaper + gen skeletons */
.chat-room { position: relative; isolation: isolate; }
.chat-room-photo-bg,
.chat-room-photo-mask {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.chat-room-photo-bg {
  background: center center / cover no-repeat;
  transform: none;
  filter: none;
  opacity: 1;
}
.chat-room-photo-mask {
  background: rgba(237, 237, 237, 0.28);
}
.chat-room.has-photo-wallpaper > *:not(.chat-room-photo-bg):not(.chat-room-photo-mask) {
  position: relative;
  z-index: 1;
}
/* 微信默认：清晰聊天背景图 */
.chat-room.wallpaper-wechat .chat-room-photo-bg {
  filter: none;
  opacity: 1;
  transform: none;
  background-position: center center;
  background-size: cover;
}
.chat-room.wallpaper-wechat .chat-room-photo-mask {
  background: linear-gradient(180deg, rgba(237,237,237,.22), rgba(237,237,237,.12) 40%, rgba(237,237,237,.3));
}
.chat-room.wallpaper-soft .chat-room-photo-bg { filter: blur(34px) saturate(1.2); opacity: .7; transform: scale(1.15); }
.chat-room.wallpaper-soft .chat-room-photo-mask {
  background: linear-gradient(180deg, rgba(255,248,245,.78), rgba(255,251,250,.88) 55%, rgba(255,255,255,.92));
}
.chat-room.wallpaper-clear .chat-room-photo-bg { filter: blur(8px) saturate(1.05); opacity: .55; transform: scale(1.04); }
.chat-room.wallpaper-clear .chat-room-photo-mask {
  background: linear-gradient(180deg, rgba(255,255,255,.45), rgba(255,251,250,.7));
}
.chat-room.wallpaper-dim .chat-room-photo-bg { filter: blur(26px) saturate(.9) brightness(.55); opacity: .9; transform: scale(1.1); }
.chat-room.wallpaper-dim .chat-room-photo-mask {
  background: linear-gradient(180deg, rgba(15,23,42,.55), rgba(15,23,42,.72));
}
.chat-room.wallpaper-dim .chat-room-header,
.chat-room.wallpaper-dim .chat-persona-drawer,
.chat-room.wallpaper-dim .chat-composer {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
}
.chat-room.wallpaper-dim .chat-header-name-row strong,
.chat-room.wallpaper-dim .chat-peer-status-indicator,
.chat-room.wallpaper-dim .btn-chat-back,
.chat-room.wallpaper-dim .btn-chat-more {
  color: #f1f5f9;
}
.chat-room.wallpaper-dim .btn-chat-toggle-panel,
.chat-room.wallpaper-dim .btn-chat-icon-action {
  background: rgba(30,41,59,.9);
  color: #cbd5e1;
}
.chat-room.wallpaper-dim .chat-bubble-row.is-assistant .chat-bubble {
  background: rgba(30,41,59,.88);
  color: #f8fafc;
  border-color: rgba(71,85,105,.5);
}
.chat-room.wallpaper-dim .chat-bubble-row.is-assistant .chat-bubble::before {
  border-color: transparent rgba(30,41,59,.88) transparent transparent;
}
.chat-room.wallpaper-dim .chat-composer textarea {
  background: rgba(30,41,59,.9);
  color: #f8fafc;
  border-color: rgba(71,85,105,.55);
}

@media (max-width: 420px) {
  .btn-chat-toggle-panel span {
    max-width: 3.5em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
.chat-peer-avatar { background-position: center top !important; }

.companion-asset-set-card {
  margin-top: 14px;
  padding: 16px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid rgba(226,232,240,.9);
}
.companion-asset-set-desc { margin: 0 0 12px; font-size: 12px; color: #64748b; line-height: 1.5; }
.companion-asset-set-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.companion-asset-item { text-align: center; }
.companion-asset-thumb {
  width: 100%;
  border-radius: 14px;
  background: #e2e8f0 center top / cover no-repeat;
  box-shadow: 0 4px 12px rgba(15,23,42,.08);
  margin-bottom: 8px;
}
.companion-asset-thumb.is-avatar {
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  max-width: 72px;
  margin-left: auto;
  margin-right: auto;
  background-position: center 18%;
}
.companion-asset-thumb.is-portrait { aspect-ratio: 3 / 4; }
.companion-asset-thumb.is-wallpaper {
  aspect-ratio: 3 / 4;
  filter: blur(1.2px) saturate(1.1);
  position: relative;
}
.companion-asset-thumb.is-wallpaper::after {
  content: " \;
 position: absolute;
 inset: 0;
 border-radius: 14px;
 background: rgba(255,248,245,.35);
}
.companion-asset-item strong { display: block; font-size: 12px; color: #0f172a; }
.companion-asset-item span { display: block; margin-top: 2px; font-size: 10px; color: #94a3b8; }
.companion-wallpaper-style {
 display: flex;
 flex-wrap: wrap;
 align-items: center;
 gap: 8px;
 margin-top: 14px;
 padding-top: 12px;
 border-top: 1px solid rgba(241,245,249,.95);
}
.companion-wallpaper-style-label { font-size: 11px; font-weight: 700; color: #64748b; }
.companion-wallpaper-style-btn {
 border: 1px solid rgba(226,232,240,.95);
 background: #f8fafc;
 color: #475569;
 border-radius: 999px;
 padding: 5px 10px;
 font-size: 11px;
 font-weight: 600;
 cursor: pointer;
 font-family: inherit;
}
.companion-wallpaper-style-btn.active {
 background: rgba(190,18,60,.1);
 border-color: rgba(190,18,60,.3);
 color: #be123c;
}

.companion-gen-plan-tip {
 display: flex;
 flex-direction: column;
 gap: 4px;
 padding: 12px 14px;
 border-radius: 14px;
 background: linear-gradient(135deg, rgba(254,242,242,.95), rgba(255,251,235,.95));
 border: 1px solid rgba(254,226,226,.9);
 margin-bottom: 4px;
}
.companion-gen-plan-tip strong { font-size: 13px; color: #9f1239; }
.companion-gen-plan-tip span { font-size: 11.5px; color: #64748b; line-height: 1.45; }

.candidate-pick-item.is-skeleton {
  background: linear-gradient(145deg, #f8fafc 0%, #e2e8f0 45%, #f1f5f9 100%);
  background-size: 200% 200%;
  animation: companion-skel-move 2.2s ease-in-out infinite;
  border: 0;
  box-shadow: none;
}
.candidate-skeleton-shimmer {
  display: none;
}
.candidate-loading-center {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  text-align: center;
  background: rgba(248, 250, 252, 0.35);
}
.candidate-loading-center span {
  font-size: 11px;
  font-weight: 800;
  color: #475569;
}
.candidate-loading-center em {
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  color: #94a3b8;
}
.candidate-pick-badge.is-ready {
  background: rgba(190, 18, 60, 0.82);
}
.companion-mini-spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(190, 18, 60, 0.18);
  border-top-color: #e11d48;
  animation: companion-spin 0.75s linear infinite;
  flex-shrink: 0;
}
.companion-sync-thumb {
  position: relative;
  overflow: hidden;
}
.companion-sync-thumb.is-loading {
  background-image: none !important;
  background: linear-gradient(145deg, #f1f5f9, #e2e8f0);
}
.companion-sync-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 250, 252, 0.45);
}
.companion-sync-loader[hidden] {
  display: none !important;
}
.companion-hero.is-generating .companion-stage-figure:not([style*="url"]) {
  background: linear-gradient(145deg, #f8fafc, #e2e8f0, #fce7f3);
  background-size: 200% 200%;
  animation: companion-skel-move 2.2s ease-in-out infinite;
}
@keyframes companion-skel-move {
  0% { background-position: 0% 40%; }
  50% { background-position: 100% 60%; }
  100% { background-position: 0% 40%; }
}
@keyframes companion-skel {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
@keyframes companion-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}


/* ===== companion trio layout ===== */
.companion-stage-shell {
  padding: 14px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid rgba(226,232,240,.9);
  box-shadow: 0 10px 28px rgba(15,23,42,.05);
}
.companion-stage-topbar { margin-bottom: 12px; }
.companion-stage-bio { margin: 4px 0 0; font-size: 12px; color: #64748b; line-height: 1.45; }
.companion-trio {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
  min-height: 360px;
}
.companion-trio-main {
  grid-row: 1 / 3;
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: #e2e8f0;
  box-shadow: 0 10px 24px rgba(15,23,42,.12);
}
.companion-trio-main .companion-stage-figure {
  width: 100%;
  height: 100%;
  min-height: 360px;
  background: #e2e8f0 center top / cover no-repeat;
  animation: companion-breathe 7s ease-in-out infinite alternate;
}
.companion-trio-side {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #e2e8f0;
  box-shadow: 0 6px 16px rgba(15,23,42,.08);
}
.companion-trio-side-img {
  width: 100%;
  height: 100%;
  min-height: 170px;
  background: #e2e8f0 center top / cover no-repeat;
}
.companion-trio-side-img.is-avatar { background-position: center 18%; }
.companion-trio-side-img.is-wallpaper {
  filter: blur(1.5px) saturate(1.1) brightness(.96);
  transform: scale(1.08);
  transform-origin: center top;
}
.companion-trio-label {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 2;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(15,23,42,.55);
  color: #fff;
  backdrop-filter: blur(6px);
}
.companion-trio-main .companion-stage-whisper { z-index: 3; }
.companion-trio-main .companion-stage-loading { z-index: 4; }
.companion-stage-shell .companion-stage-actions {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.companion-stage-shell .companion-wallpaper-style {
  margin-top: 12px;
  padding-top: 0;
  border-top: 0;
}
.companion-candidates-grid-lg {
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  align-items: end;
}
.companion-candidates-grid-lg .candidate-pick-item {
  width: 100%;
  min-height: 0;
  background-position: center top;
  background-size: cover;
}
.companion-set-progress-grid .companion-set-piece {
  margin: 0 auto;
}
.companion-set-progress-grid .companion-set-piece:nth-child(1) {
  aspect-ratio: 1 / 1;
  width: 86%;
  border-radius: 50%;
}
.companion-set-progress-grid .companion-set-piece:nth-child(2) {
  aspect-ratio: 3 / 4;
  width: 100%;
  border-radius: 14px;
}
.companion-set-progress-grid .companion-set-piece:nth-child(3) {
  aspect-ratio: 9 / 16;
  width: 72%;
  border-radius: 14px;
}
.companion-set-piece.is-ready-slot {
  box-shadow: 0 0 0 2px rgba(232, 93, 74, 0.45);
  animation: companion-set-pop 0.45s ease;
}
@keyframes companion-set-pop {
  0% { transform: scale(0.94); opacity: 0.55; }
  100% { transform: scale(1); opacity: 1; }
}
.companion-hero.is-generating .companion-sync-thumb,
.companion-hero.is-generating .companion-stage-figure,
.companion-trio.is-generating .companion-trio-side-img,
.companion-trio.is-generating .companion-stage-figure {
  animation: companion-set-breathe 1.6s ease-in-out infinite;
}
@keyframes companion-set-breathe {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.06); }
}
/* ===== exclusive companion stage ===== */
.companion-stage-shell.is-exclusive {
  padding: 16px 14px 18px;
  border-radius: 24px;
  background:
    radial-gradient(120% 80% at 12% -10%, rgba(254, 226, 226, 0.55) 0%, transparent 55%),
    radial-gradient(90% 70% at 100% 0%, rgba(255, 241, 242, 0.7) 0%, transparent 48%),
    #fff;
  border: 1px solid rgba(254, 202, 202, 0.45);
  box-shadow: 0 14px 36px rgba(190, 18, 60, 0.06), 0 4px 14px rgba(15, 23, 42, 0.04);
}
.companion-exclusive-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #be123c;
  background: rgba(190, 18, 60, 0.08);
}
.companion-exclusive-kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e11d48;
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.16);
}
.companion-stage-shell.is-exclusive .companion-stage-topbar {
  margin-bottom: 14px;
}
.companion-stage-shell.is-exclusive .companion-stage-name {
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: 0.01em;
  color: #0f172a;
}
.companion-stage-role-line {
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
}
.companion-stage-shell.is-exclusive .companion-stage-bio {
  margin-top: 6px;
  font-size: 13px;
  color: #64748b;
}

.companion-hero {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}
.companion-hero-portrait {
  position: relative;
  width: min(100%, 320px);
  margin: 0 auto;
  aspect-ratio: 3 / 4;
  height: auto;
  max-height: none;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(160deg, #fecdd3 0%, #e2e8f0 55%, #f8fafc 100%);
  box-shadow:
    0 18px 40px rgba(15, 23, 42, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.55) inset;
}
.companion-hero-portrait .companion-stage-figure {
  width: 100%;
  height: 100%;
  min-height: 0;
  background-color: transparent;
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
  animation: companion-breathe 8s ease-in-out infinite alternate;
}
.companion-hero-video {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  background: #0f172a;
}
.companion-video-sound-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
}
.companion-video-sound-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.companion-hero-portrait.has-video .companion-stage-figure {
  opacity: 0;
  animation: none;
}
.companion-hero-portrait .companion-stage-vignette {
  z-index: 2;
}
.companion-hero-portrait .companion-stage-whisper {
  z-index: 3;
}
.companion-hero-portrait .companion-stage-loading {
  z-index: 4;
}
.companion-hero-video {
  cursor: pointer;
}
.companion-video-shooting {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.48);
  color: #fff;
  font-size: 13px;
  text-align: center;
}
.companion-hero-portrait.is-shooting .companion-stage-whisper {
  opacity: 0.35;
  pointer-events: none;
}
.companion-hero-portrait .companion-stage-whisper {
  left: 14px;
  right: 14px;
  bottom: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
}
.whisper-heart {
  color: #e11d48;
  font-size: 13px;
}

.companion-sync-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: stretch;
}
.companion-sync-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 72px;
  padding: 8px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}
.companion-sync-thumb {
  flex-shrink: 0;
  background-color: #e2e8f0;
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}
.companion-sync-thumb.is-avatar {
  width: 48px;
  height: 48px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background-position: center center;
}
.companion-sync-thumb.is-wallpaper {
  width: 34px;
  height: 60px;
  aspect-ratio: 9 / 16;
  border-radius: 10px;
  background-position: center top;
  filter: none;
  transform: none;
}
.companion-sync-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.companion-sync-meta strong {
  font-size: 12px;
  color: #0f172a;
}
.companion-sync-meta span {
  font-size: 11px;
  color: #94a3b8;
}

.companion-stage-shell.is-exclusive .companion-wallpaper-style {
  margin-top: 12px;
  justify-content: flex-start;
}
.companion-stage-shell.is-exclusive .companion-stage-actions {
  margin-top: 14px;
}
.companion-stage-shell.is-exclusive .btn-stage-chat {
  width: 100%;
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
  box-shadow: 0 10px 22px rgba(190, 18, 60, 0.28);
}
.companion-stage-shell.is-exclusive .btn-stage-remake {
  background: rgba(255, 255, 255, 0.9);
}

.companion-hero.is-generating .companion-sync-thumb,
.companion-hero.is-generating .companion-stage-figure {
  animation: companion-set-breathe 1.6s ease-in-out infinite;
}

@media (max-width: 420px) {
  .companion-hero-portrait {
    width: min(100%, 300px);
  }
  .companion-stage-shell.is-exclusive .companion-stage-name {
    font-size: 22px;
  }
}

/* ===== companion short video ===== */
.companion-stage-shell.is-exclusive .companion-stage-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.companion-stage-secondary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: stretch;
}
.companion-stage-secondary > button {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
}
.btn-stage-video {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid rgba(190, 24, 93, 0.18);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff7f9 0%, #ffe4e8 100%);
  color: #9f1239;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.btn-stage-video:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-stage-video:active:not(:disabled) {
  transform: scale(0.98);
}
.btn-stage-video-cost {
  margin-left: 2px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(190, 18, 60, 0.12);
  color: #be123c;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.btn-stage-video-cost::after {
  content: ' 积分';
  font-weight: 700;
}

.btn-stage-remake {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 12px;
  background: #fff;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.companion-voice-card {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(240, 249, 255, 0.96), #fff);
  border: 1px solid rgba(186, 230, 253, 0.95);
  box-sizing: border-box;
}
.companion-voice-card-main {
  display: flex;
  align-items: center;
  gap: 12px;
}
.companion-voice-card-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.companion-voice-card-copy strong {
  font-size: 13px;
  color: #0c4a6e;
}
.companion-voice-card-copy span {
  font-size: 11px;
  color: #64748b;
  line-height: 1.45;
}
.companion-voice-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.btn-companion-voice-play,
.btn-companion-voice-redo {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.9);
  background: #fff;
  color: #0369a1;
  font-size: 12px;
  font-weight: 650;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.btn-companion-voice-play {
  background: #0ea5e9;
  border-color: #0ea5e9;
  color: #fff;
}
.btn-companion-voice-play:disabled,
.btn-companion-voice-redo:disabled {
  opacity: 0.6;
  cursor: wait;
}

.companion-video-card {
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: transparent;
}
.companion-video-scene-pick {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.companion-video-scene-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
}
.companion-video-scene-chips {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.companion-video-scene-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.companion-video-scene-group-label {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.04em;
}
.companion-video-scene-group-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.companion-video-scene-btn {
  min-height: 58px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(255, 255, 255, 0.92);
  color: #475569;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.companion-video-scene-btn-name {
  display: block;
  font-size: 12px;
  font-weight: 700;
}
.companion-video-scene-btn-hint {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.35;
}
.companion-video-scene-btn.active {
  border-color: rgba(225, 29, 72, 0.35);
  background: #fff1f2;
  color: #be123c;
}
.companion-video-scene-dialog {
  width: min(420px, calc(100vw - 32px));
  max-height: min(82vh, 640px);
  display: flex;
  flex-direction: column;
  padding-bottom: 18px;
}
.companion-video-scene-dialog .confirm-title {
  margin-bottom: 4px;
}
.companion-video-scene-dialog .confirm-msg {
  margin-bottom: 12px;
}
.companion-video-scene-modal-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 2px 2px 8px;
  margin: 0 -2px;
  max-height: min(46vh, 360px);
}
.companion-video-scene-modal-picked {
  font-size: 12px;
  color: #64748b;
  margin: 4px 0 12px;
  min-height: 18px;
}
.companion-video-custom-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 4px 0 8px;
}
.companion-video-custom-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
}
.companion-video-custom-theme {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(255, 255, 255, 0.96);
  color: #334155;
  font-size: 13px;
  line-height: 1.45;
  font-family: inherit;
  box-sizing: border-box;
}
.companion-video-custom-theme:focus {
  outline: none;
  border-color: rgba(225, 29, 72, 0.35);
  box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.12);
}
.companion-video-custom-hint {
  font-size: 11px;
  color: #94a3b8;
}
.companion-video-scene-dialog .confirm-btn-row {
  margin-top: 0;
}
.companion-video-scene-dialog .btn-confirm-ok {
  background: linear-gradient(135deg, #fb7185, #e11d48);
  border-color: transparent;
  color: #fff;
}
.companion-video-card.is-generating .companion-video-invite {
  opacity: 0.55;
  pointer-events: none;
}
.companion-video-invite {
  width: 100%;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(251, 113, 133, 0.22);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 241, 242, 0.95), rgba(255, 255, 255, 0.92));
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 6px 18px rgba(190, 18, 60, 0.06);
}
.companion-video-invite:active {
  transform: scale(0.99);
}
.companion-video-invite-thumb {
  width: 44px;
  height: 58px;
  border-radius: 10px;
  background: #e2e8f0 center/cover no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}
.companion-video-invite-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.companion-video-invite-copy strong {
  font-size: 13px;
  color: #9f1239;
  font-weight: 800;
}
.companion-video-invite-copy span {
  font-size: 11px;
  color: #94a3b8;
}
.companion-video-invite-cta {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
@media (max-width: 420px) {
  .companion-stage-secondary {
    grid-template-columns: 1fr 1fr;
  }
}
