/* =====================================================================
   interact.css — 互动 tab 视觉
   ===================================================================== */

/* ---------- room layout ---------- */
.interact-region { display: contents; }

.interact-room {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 1100px) { .interact-room { grid-template-columns: 1fr; } }

.interact-main {
  background: var(--tv-surface);
  border: 1px solid var(--tv-line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px -30px rgba(0,0,0,0.6);
  display: flex; flex-direction: column;
}

.interact-stage {
  position: relative;
  /* 5/18 v9.5 修: 老 aspect-ratio:9/16 + max-height:540px 在 iPhone Pro Max 上让 stage 宽 clamp 到 325 → 右侧 105px 黑空白.
     改 width:100% + height fixed, object-fit cover 让 video/img 居中裁切撑满. */
  width: 100%;
  height: 540px;
  max-height: 62dvh;
  min-height: 320px;
  background: #000;
  overflow: hidden;
}
@media (min-width: 1101px) {
  .interact-stage { height: 540px; max-height: 540px; }
}
.stage-video { position: absolute; inset: 0; }

/* 5/18 P3 unmute button — overlay on stage when LiveKit audio not unmuted yet */
.stage-unmute {
  position: absolute;
  bottom: 22px; left: 50%; transform: translateX(-50%);
  z-index: 5;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px;
  background: linear-gradient(180deg, #F9A05D 0%, #DD3C28 100%);
  color: #fff;
  border: 0;
  border-radius: 999px;
  font-weight: 600; font-size: 14px;
  box-shadow: 0 8px 24px rgba(220, 60, 40, 0.5);
  cursor: pointer;
  transition: transform 120ms ease;
}
.stage-unmute:hover { transform: translateX(-50%) translateY(-1px); }
.stage-unmute i { width: 18px; height: 18px; }
.stage-vignette {
  position: absolute; inset: 0;
  background: radial-gradient(80% 60% at 50% 40%, transparent 50%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
}
.stage-badges {
  position: absolute; top: 16px; left: 16px; right: 16px;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px;
  z-index: 2;
}
.stage-listening {
  display: inline-flex; align-items: center; gap: 8px;
  height: 28px;
  padding: 0 12px 0 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.10);
  font-size: 12px;
  color: #fff;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.ear-rings {
  position: relative;
  width: 16px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
}
.ear-rings span {
  position: absolute;
  width: 4px; height: 4px;
  border-radius: 999px;
  background: var(--mk-accent, #F69155);
  animation: ear-pulse 1.4s ease-out infinite;
}
.ear-rings span:nth-child(2) { animation-delay: 0.35s; }
.ear-rings span:nth-child(3) { animation-delay: 0.7s; }
@keyframes ear-pulse {
  0%   { transform: scale(1); opacity: 1; }
  100% { transform: scale(4); opacity: 0; }
}
.stage-bottom {
  position: absolute; bottom: 12px; right: 12px;
  z-index: 2;
}
.stage-bitrate {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255,255,255,0.85);
  background: rgba(0,0,0,0.40);
  border: 1px solid rgba(255,255,255,0.10);
  padding: 4px 9px;
  border-radius: 6px;
  backdrop-filter: blur(8px);
}
.stage-bitrate .dot {
  width: 6px; height: 6px; border-radius: 999px;
  background: #3BD671;
}

/* ---------- composer ---------- */
.interact-composer {
  padding: 14px 16px 16px;
  background: var(--tv-surface);
  border-top: 1px solid var(--tv-line);
  display: flex; flex-direction: column; gap: 12px;
}
.composer-tabs {
  display: flex; align-items: center; gap: 6px;
}
.composer-tab {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 8px 12px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--tv-fg-muted);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: all var(--dur-fast) var(--ease-organic);
}
.composer-tab svg { width: 14px; height: 14px; }
.composer-tab:hover { color: var(--tv-fg); background: rgba(255,255,255,0.04); }
.composer-tab.active {
  color: var(--tv-fg);
  background: rgba(246,145,85,0.10);
  border-color: rgba(246,145,85,0.30);
}
.composer-queue {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px;
  color: var(--tv-fg-faint);
  letter-spacing: 0.02em;
}
.composer-queue strong { color: var(--mk-accent, #F69155); font-weight: 500; font-family: var(--font-mono); }
.queue-dot {
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--mk-accent, #F69155);
  animation: ear-pulse 2s ease-out infinite;
}

/* ---- text composer ---- */
.composer-text {
  position: relative;
  display: flex; align-items: stretch; gap: 10px;
}
.composer-text textarea {
  flex: 1;
  resize: none;
  min-height: 52px;
  max-height: 120px;
  padding: 14px 60px 14px 16px;
  border-radius: 24px;
  background: var(--mk-bg-2, #1A1A1A);
  border: 1px solid var(--tv-line);
  color: var(--tv-fg);
  font-size: 14.5px;
  line-height: 1.45;
  font-family: inherit;
  outline: none;
  transition: border-color var(--dur-fast) var(--ease-organic);
}
.composer-text textarea:focus { border-color: var(--mk-accent, #F69155); }
.composer-text-counter {
  position: absolute;
  right: 78px;
  bottom: 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--tv-fg-faint);
  letter-spacing: 0.04em;
  pointer-events: none;
  display: flex; gap: 1px;
}
.composer-send {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--tv-line-strong);
  border: none;
  color: var(--tv-fg-faint);
  cursor: not-allowed;
  display: grid; place-items: center;
  transition: all var(--dur-fast) var(--ease-organic);
  align-self: center;
}
.composer-send.active {
  background: linear-gradient(180deg, #F9A05D 0%, #DD3C28 100%);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 16px -6px rgba(246,145,85,0.55);
}
.composer-send.active:hover { transform: scale(1.05); }
.composer-send svg { width: 18px; height: 18px; }

/* ---- voice composer ---- */
.composer-voice {
  display: grid; place-items: center;
  padding: 8px 0 4px;
}
.voice-big {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: var(--mk-bg-2, #1A1A1A);
  border: 2px solid var(--tv-line-strong);
  color: var(--tv-fg);
  cursor: pointer;
  display: grid; place-items: center;
  position: relative;
  font-family: inherit;
  transition: all 180ms var(--ease-organic);
  touch-action: none;
  user-select: none;
}
.voice-big svg { width: 32px; height: 32px; }
.voice-big.recording {
  width: 120px; height: 120px;
  background: linear-gradient(180deg, #F9A05D 0%, #DD3C28 100%);
  border-color: rgba(255,255,255,0.20);
  box-shadow: 0 0 0 8px rgba(246,145,85,0.18), 0 0 0 16px rgba(246,145,85,0.06);
  animation: vbig-pulse 1.4s var(--ease-organic) infinite;
}
.voice-big.cancel {
  background: linear-gradient(180deg, #6b7280 0%, #374151 100%);
  box-shadow: 0 0 0 8px rgba(107,114,128,0.20);
}
@keyframes vbig-pulse {
  0%, 100% { box-shadow: 0 0 0 8px rgba(246,145,85,0.18), 0 0 0 16px rgba(246,145,85,0.06); }
  50%      { box-shadow: 0 0 0 14px rgba(246,145,85,0.10), 0 0 0 28px rgba(246,145,85,0.02); }
}
.voice-hint {
  position: absolute;
  top: calc(100% + 12px);
  font-size: 12px;
  color: var(--tv-fg-muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.voice-waveform {
  display: flex; align-items: center; gap: 3px;
  height: 28px;
}
.voice-waveform span {
  width: 3px;
  background: #fff;
  border-radius: 2px;
  animation: wave 0.7s ease-in-out infinite alternate;
  transform-origin: center;
}
.voice-waveform span:nth-child(1) { height: 8px; }
.voice-waveform span:nth-child(2) { height: 14px; }
.voice-waveform span:nth-child(3) { height: 22px; }
.voice-waveform span:nth-child(4) { height: 16px; }
.voice-waveform span:nth-child(5) { height: 24px; }
.voice-waveform span:nth-child(6) { height: 18px; }
.voice-waveform span:nth-child(7) { height: 10px; }
.voice-waveform span:nth-child(8) { height: 6px; }
@keyframes wave { from { transform: scaleY(0.4); } to { transform: scaleY(1.0); } }

/* ---------- chat side panel ---------- */
.interact-chat-panel {
  background: var(--tv-surface);
  border: 1px solid var(--tv-line);
  border-radius: 18px;
  overflow: hidden;
  display: flex; flex-direction: column;
  height: 540px;
}
.chat-panel-head {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--tv-line);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--tv-fg);
  font-weight: 500;
}
.chat-panel-head svg { width: 15px; height: 15px; color: var(--mk-accent, #F69155); }
.chat-live-dot {
  margin-left: auto;
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 999px;
  background: #3BD671;
  box-shadow: 0 0 0 0 rgba(59,214,113,0.55);
  animation: pulse-live 2s var(--ease-organic) infinite;
}
.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 12px;
  display: flex; flex-direction: column; gap: 12px;
}
.chat-list::-webkit-scrollbar { width: 6px; }
.chat-list::-webkit-scrollbar-track { background: transparent; }
.chat-list::-webkit-scrollbar-thumb { background: var(--tv-line-strong); border-radius: 999px; }

.chat-panel-foot {
  padding: 10px 14px;
  border-top: 1px solid var(--tv-line);
  font-size: 11px;
  color: var(--tv-fg-faint);
  letter-spacing: 0.02em;
  display: flex; align-items: center; gap: 6px;
}
.chat-panel-foot svg { width: 12px; height: 12px; }

/* ---- danmu card ---- */
.danmu {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--tv-line);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.danmu.mine {
  background: rgba(246,145,85,0.06);
  border-color: rgba(246,145,85,0.30);
  align-self: stretch;
}
.danmu-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px;
}
.danmu-avatar {
  width: 22px; height: 22px;
  border-radius: 999px;
  display: grid; place-items: center;
  background: var(--tv-line-strong);
  color: var(--tv-fg-muted);
  font-size: 11px;
  font-weight: 500;
}
.danmu.mine .danmu-avatar {
  background: linear-gradient(180deg, #F9A05D 0%, #DD3C28 100%);
  color: #fff;
  font-weight: 600;
}
.danmu-user { color: var(--tv-fg); font-weight: 500; }
.danmu-time {
  margin-left: auto;
  color: var(--tv-fg-faint);
  font-family: var(--font-mono);
  font-size: 10px;
}
.danmu-q {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--tv-fg);
}
.danmu-a {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--tv-fg-muted);
  padding-left: 10px;
  border-left: 2px solid rgba(246,145,85,0.40);
  display: flex; flex-direction: column; gap: 2px;
}
.danmu-a-tag {
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  color: var(--mk-accent, #F69155);
  text-transform: uppercase;
}
.danmu-pending {
  border-left-color: rgba(255,255,255,0.10);
}
.danmu-pending .danmu-a-tag { color: var(--tv-fg-faint); }

/* streaming UI — blinking caret + TTFT badge */
.danmu.streaming { border-left-color: var(--mk-accent, #F69155); }
.danmu-caret {
  display: inline-block; width: 0.5em;
  animation: danmu-caret-blink 0.9s steps(2, end) infinite;
  color: var(--mk-accent, #F69155);
  margin-left: 1px;
}
@keyframes danmu-caret-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}
.danmu-ttft {
  margin-left: auto; display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-family: var(--font-mono);
  color: rgba(255,255,255,0.42); letter-spacing: 0.04em;
}
.danmu-ttft .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--mk-accent, #F69155);
}
.danmu-err {
  font-size: 11px;
  color: rgba(255, 130, 130, 0.92);
  margin-top: 6px;
}

/* ============================================================
   Video call permission dialog
   ============================================================ */
.vc-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(10px);
  z-index: 200;
  display: grid; place-items: center;
  padding: 24px;
}
.vc-perm {
  width: 100%; max-width: 380px;
  background: var(--tv-surface-2);
  border: 1px solid var(--tv-line-strong);
  border-radius: 20px;
  padding: 28px 24px 22px;
  text-align: center;
}
.vc-perm-icon {
  width: 64px; height: 64px;
  border-radius: 20px;
  margin: 0 auto 16px;
  background: linear-gradient(180deg, #F9A05D 0%, #DD3C28 100%);
  display: grid; place-items: center;
  color: #fff;
  box-shadow: 0 12px 24px -10px rgba(246,145,85,0.55);
}
.vc-perm-icon svg { width: 28px; height: 28px; }
.vc-perm h3 { margin: 0 0 8px; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.vc-perm p { margin: 0 0 22px; font-size: 13px; line-height: 1.6; color: var(--tv-fg-muted); }
.vc-perm-actions { display: flex; gap: 10px; }
.vc-perm-cancel, .vc-perm-accept {
  flex: 1; height: 44px;
  border-radius: 10px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.vc-perm-cancel { background: var(--tv-line); color: var(--tv-fg); }
.vc-perm-accept {
  background: linear-gradient(180deg, #F9A05D 0%, #DD3C28 100%);
  color: #fff;
}
.vc-perm-accept svg { width: 16px; height: 16px; }

/* ============================================================
   Full-screen video call
   ============================================================ */
.vc-fullscreen {
  position: fixed; inset: 0;
  z-index: 200;
  background: #000;
  display: flex; flex-direction: column;
}
.vc-anchor {
  position: absolute; inset: 0;
}
.vc-anchor img, .vc-anchor .mk-card-portrait { position: absolute; inset: 0; width: 100%; height: 100%; }
.vc-anchor-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.42) 0%, transparent 18%, transparent 72%, rgba(0,0,0,0.68) 100%);
  pointer-events: none;
}
.vc-pip {
  position: absolute;
  top: 24px;
  right: 20px;
  width: 120px; height: 160px;
  border-radius: 16px;
  background: #15110D;
  border: 2px solid rgba(255,255,255,0.18);
  overflow: hidden;
  z-index: 2;
  box-shadow: 0 12px 24px -8px rgba(0,0,0,0.6);
}
.vc-pip-self, .vc-pip-off {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  color: var(--tv-fg-muted);
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
}
.vc-pip-self svg, .vc-pip-off svg { width: 32px; height: 32px; }
.vc-pip-self {
  background:
    radial-gradient(120% 80% at 50% 30%, #2a2a2a 0%, #0a0a0a 100%);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
}
.vc-status {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 2;
  display: flex; flex-direction: column; gap: 6px;
  color: #fff;
}
.vc-name { font-size: 18px; font-weight: 600; letter-spacing: -0.005em; }
.vc-dur {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: rgba(255,255,255,0.85);
}
.vc-dur .dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: #3BD671;
  animation: pulse-live 2s var(--ease-organic) infinite;
}
.vc-controls {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 20px;
  z-index: 2;
  padding: 14px 20px;
  background: rgba(0,0,0,0.40);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
}
.vc-btn {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,0.10);
  border: none;
  color: #fff;
  cursor: pointer;
  display: grid; place-items: center;
  transition: background var(--dur-fast) var(--ease-organic);
}
.vc-btn svg { width: 22px; height: 22px; }
.vc-btn:hover { background: rgba(255,255,255,0.18); }
.vc-btn.active { background: rgba(255,255,255,0.92); color: #1a0e07; }
.vc-hangup {
  background: #DC2626 !important;
  color: #fff !important;
}
.vc-hangup:hover { background: #B91C1C !important; }

/* ============================================================
   Sales conversion entries
   ============================================================ */
.sales-entries {
  display: flex; flex-direction: column; gap: 10px;
}
.sales-card {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 14px;
  background: var(--tv-surface);
  border: 1px solid var(--tv-line);
  color: var(--tv-fg);
  text-decoration: none;
  transition: all var(--dur-base) var(--ease-organic);
}
.sales-card:hover {
  border-color: var(--tv-line-strong);
  background: var(--tv-surface-2);
  transform: translateY(-1px);
}
.sales-card-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(246,145,85,0.12);
  color: var(--mk-accent, #F69155);
  display: grid; place-items: center;
}
.sales-card-icon svg { width: 18px; height: 18px; }
.sales-card-text { min-width: 0; }
.sales-card-title { font-size: 18px; font-weight: 500; color: var(--tv-fg); margin-bottom: 2px; }
.sales-card-sub { font-size: 12px; color: var(--tv-fg-muted); }
.sales-card-arrow {
  width: 16px; height: 16px;
  color: var(--tv-fg-faint);
}
.sales-card-accent {
  background: linear-gradient(135deg, rgba(246,145,85,0.10) 0%, rgba(221,60,40,0.06) 100%);
  border-color: rgba(246,145,85,0.30);
}
.sales-card-accent .sales-card-icon {
  background: linear-gradient(180deg, #F9A05D 0%, #DD3C28 100%);
  color: #fff;
}

/* status banner above timeline in interact mode */
.interact-status-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(246,145,85,0.08);
  border: 1px solid rgba(246,145,85,0.20);
  font-size: 13px;
  color: var(--tv-fg);
}
.interact-status-banner .icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(180deg, #F9A05D 0%, #DD3C28 100%);
  display: grid; place-items: center;
  color: #fff;
  flex-shrink: 0;
}
.interact-status-banner .icon svg { width: 14px; height: 14px; }
.interact-status-banner .label { font-weight: 500; }
.interact-status-banner .arrow {
  margin-left: auto;
  font-size: 18px;
  color: var(--mk-accent, #F69155);
  animation: bounce-down 1.8s ease-in-out infinite;
}
@keyframes bounce-down {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(3px); }
}

/* ===========================================================
   v10.84 (5/28) — stage-subtitle overlay + stage-controls bar
   Subtitle 镜像到 video 底部, 用户视线不奔波到右侧弹幕
   Controls bar hover-show, hangup 走 setMode("text")
   =========================================================== */
.stage-subtitle {
  position: absolute;
  left: 24px; right: 24px;
  bottom: 72px;            /* 让出 stage-controls 50px + 22px gap */
  padding: 10px 18px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.65) 100%);
  color: #fff;
  font-size: 17px;
  line-height: 1.45;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  z-index: 4;
  pointer-events: none;
  text-align: center;
  animation: subtitle-in 0.22s ease-out;
  max-height: 4.2em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
@keyframes subtitle-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.stage-controls {
  position: absolute;
  left: 16px; right: 16px;
  bottom: 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 6;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.stage-video:hover .stage-controls,
.stage-video:focus-within .stage-controls,
.stage-controls:hover,
.stage-controls:focus-within { opacity: 1; }

.stage-ctl-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, transform 0.15s ease;
}
.stage-ctl-btn:hover { background: rgba(255, 255, 255, 0.22); transform: translateY(-1px); }
.stage-ctl-btn:active { transform: translateY(0); }
.stage-ctl-btn.stage-ctl-hangup {
  background: #e54040;
  border-color: rgba(255, 90, 90, 0.4);
}
.stage-ctl-btn.stage-ctl-hangup:hover { background: #ff5252; }

.stage-ctl-status {
  margin-left: auto;
  margin-right: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 500;
  letter-spacing: 0.5px;
}
