/* ==========================================================================
   萌系聊天动画模拟器 - Kawaii Chat Simulator (Vanilla CSS)
   风格：动漫萌系 (无人物角色，纯治愈萌宠、星芒、气泡与软糖质感)
   ========================================================================== */

:root {
  /* 萌系核心色彩体系 */
  --bg-gradient: linear-gradient(135deg, #fff0f5 0%, #fdf2f8 35%, #f0f7ff 70%, #fef3c7 100%);
  --phone-case-color: #ffd6e0;
  --phone-case-border: #ffaec0;
  --phone-screen-bg: #fffbfd;
  --phone-shadow: 0 25px 60px -15px rgba(255, 143, 171, 0.45), 0 12px 25px -8px rgba(186, 104, 200, 0.25);

  --primary-pink: #ff6584;
  --primary-pink-dark: #e84368;
  --primary-pink-light: #ffc2d1;

  --bubble-pink: linear-gradient(135deg, #ffe0e9 0%, #ffd1dc 100%);
  --bubble-pink-text: #4a2835;
  --bubble-green: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  --bubble-green-text: #164e32;
  --bubble-yellow: linear-gradient(135deg, #fef9c3 0%, #fef08a 100%);
  --bubble-yellow-text: #583c07;
  --bubble-purple: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
  --bubble-purple-text: #43215c;
  --bubble-blue: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  --bubble-blue-text: #163f5d;
  --bubble-white: linear-gradient(135deg, #ffffff 0%, #fdf4f7 100%);
  --bubble-white-text: #372b3a;

  --text-main: #372b3a;
  --text-muted: #8b7d90;
  --text-hint: #b0a3b5;

  --bounce-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --jelly-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body {
  min-height: 100vh;
  background: var(--bg-gradient);
  font-family: 'Fredoka', 'Quicksand', -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text-main);
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 60px;
  transition: background 0.3s ease;
}

/* 纯色色度抠图背景模式 (Chroma Key Modes) */
body.chroma-green { background: #00ff00 !important; }
body.chroma-blue { background: #0047bb !important; }
body.chroma-magenta { background: #ff00ff !important; }
body.chroma-black { background: #000000 !important; }
body.chroma-white { background: #ffffff !important; }

body.chroma-active .bg-decorations { display: none !important; }

body.no-shadow .phone-case { box-shadow: none !important; }

/* 沉浸全屏录制模式：隐藏周围所有控件，仅保留居中的手机 */
body.focus-mode .top-nav-bar,
body.focus-mode .app-header,
body.focus-mode .dashboard-controls {
  display: none !important;
}

/* 恢复控件面板的安全悬浮按钮 (固定在右上角安全区，绝不遮挡手机居中录制画面) */
.exit-focus-btn {
  display: none;
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 99999;
  background: rgba(255, 255, 255, 0.96);
  border: 2px solid #ff477e;
  color: #ff477e;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  font-family: inherit;
  transition: all 0.25s var(--bounce-spring);
}

.exit-focus-btn:hover {
  transform: scale(1.08) translateY(-2px);
  background: #ff477e;
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(255, 71, 126, 0.45);
}

body.focus-mode .exit-focus-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  animation: bounceIn 0.35s var(--bounce-spring);
}

@keyframes bounceIn {
  0% { transform: scale(0.3); opacity: 0; }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* 萌系背景动态漂浮物 (无人物) */
.bg-decorations {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floating-bubble {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
  animation: floatBubble 12s ease-in-out infinite alternate;
}
.bubble-1 { width: 380px; height: 380px; background: #ffb7b2; top: -80px; left: -80px; }
.bubble-2 { width: 320px; height: 320px; background: #b5e2fa; bottom: 8%; right: -60px; animation-duration: 16s; }
.bubble-3 { width: 260px; height: 260px; background: #e7c6ff; top: 40%; left: 60%; animation-duration: 14s; }

@keyframes floatBubble {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, 40px) scale(1.08); }
  100% { transform: translate(-20px, 25px) scale(0.95); }
}

.star-deco {
  position: absolute;
  color: #ffb703;
  opacity: 0.7;
  animation: twinkle 3s ease-in-out infinite alternate;
}
.s1 { top: 12%; left: 12%; font-size: 24px; animation-delay: 0.2s; color: #ff6584; }
.s2 { top: 28%; left: 85%; font-size: 28px; animation-delay: 1.1s; color: #ffb703; }
.s3 { top: 75%; left: 8%; font-size: 22px; animation-delay: 0.6s; color: #a78bfa; }
.s4 { top: 85%; left: 90%; font-size: 26px; animation-delay: 1.8s; }
.s5 { top: 48%; left: 6%; font-size: 20px; animation-delay: 2.2s; color: #34d399; }

.cloud-deco {
  position: absolute;
  font-size: 48px;
  color: rgba(255, 255, 255, 0.75);
  animation: cloudDrift 24s linear infinite;
}
.c1 { top: 18%; left: -60px; }
.c2 { top: 62%; left: -100px; animation-delay: 12s; font-size: 38px; }

@keyframes twinkle {
  0% { transform: scale(0.7) rotate(0deg); opacity: 0.4; }
  100% { transform: scale(1.25) rotate(15deg); opacity: 1; }
}

@keyframes cloudDrift {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(100vw + 150px)); }
}

/* 主容器 */
.main-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 980px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 顶部导航切换标签 */
.top-nav-bar {
  display: inline-flex;
  gap: 12px;
  background: rgba(255, 255, 255, 0.9);
  padding: 6px 10px;
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(255, 143, 171, 0.18);
  border: 1.5px solid #ffe2e8;
  margin-bottom: 16px;
}

.nav-tab-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  color: var(--text-muted);
  transition: all 0.2s var(--bounce-spring);
}

.nav-tab-link:hover {
  color: #ff477e;
  transform: translateY(-1px);
}

.nav-tab-link.active {
  background: linear-gradient(135deg, #ff477e, #ff8da1);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(255, 71, 126, 0.35);
}

/* 顶部标题区 */
.app-header {
  text-align: center;
  margin-bottom: 18px;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #ff5277;
  box-shadow: 0 4px 12px rgba(255, 101, 132, 0.15);
  border: 1.5px solid #ffe2e8;
  margin-bottom: 8px;
}

.app-title {
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(135deg, #ff477e 0%, #ff8da1 50%, #9061f9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.app-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

/* 录屏专属工具栏样式 */
.recording-toolbar {
  width: 100%;
  max-width: 860px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-radius: 24px;
  padding: 12px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 2px solid #ffffff;
  box-shadow: 0 8px 24px rgba(255, 143, 171, 0.15);
}

/* 放在播放按钮下方时的样式 */
.recording-toolbar.bottom-toolbar {
  margin-top: 22px;
  margin-bottom: 0;
  width: 100%;
  max-width: 100%;
  background: #fff8fb;
  border: 1.5px solid #ffd6e0;
}

@media (max-width: 768px) {
  .recording-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-badge {
  font-size: 12px;
  font-weight: 700;
  color: #ff477e;
  background: #ffe5ec;
  padding: 4px 10px;
  border-radius: 12px;
  white-space: nowrap;
}

.chroma-btn-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.chroma-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ffffff;
  border: 1.5px solid #ffe2e8;
  padding: 6px 11px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  color: #372b3a;
  cursor: pointer;
  transition: all 0.2s var(--bounce-spring);
  font-family: inherit;
}

.chroma-btn:hover {
  transform: translateY(-2px);
  border-color: #ff6584;
}

.chroma-btn.active {
  background: #ff5277;
  color: #ffffff;
  border-color: #ff5277;
  box-shadow: 0 4px 10px rgba(255, 82, 119, 0.35);
}

.chroma-color-circle {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.clean-edge-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #5d4d62;
  cursor: pointer;
  background: #fff5f8;
  padding: 6px 11px;
  border-radius: 12px;
  border: 1px dashed #ffaec0;
}

.clean-edge-toggle input {
  accent-color: #ff477e;
  cursor: pointer;
}

.focus-mode-btn {
  background: #ffffff;
  border: 1.5px solid #ffd6e0;
  padding: 6px 13px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  color: #ff477e;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.focus-mode-btn:hover {
  background: #ff5277;
  color: #ffffff;
  border-color: #ff5277;
}

/* ==========================================================================
   核心手机模型 (Phone Stage)
   ========================================================================== */
.phone-stage {
  display: flex;
  justify-content: center;
  margin-bottom: 34px;
}

.phone-case {
  position: relative;
  width: 375px;
  height: 720px;
  background: var(--phone-case-color);
  border-radius: 54px;
  padding: 14px;
  box-shadow: var(--phone-shadow),
              inset 0 2px 4px rgba(255, 255, 255, 0.8),
              inset 0 -3px 6px rgba(230, 140, 165, 0.5);
  border: 4px solid var(--phone-case-border);
  transition: transform 0.4s var(--bounce-spring);
}

.phone-ear {
  position: absolute;
  width: 50px;
  height: 38px;
  background: var(--phone-case-color);
  border: 3.5px solid var(--phone-case-border);
  top: -18px;
  border-radius: 50% 50% 15% 15%;
  z-index: -1;
  box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.6);
}
.phone-ear::after {
  content: '';
  position: absolute;
  width: 28px;
  height: 20px;
  background: #ffb4c6;
  border-radius: 50% 50% 15% 15%;
  bottom: 4px;
  left: 8px;
}
.ear-left { left: 45px; transform: rotate(-18deg); }
.ear-right { right: 45px; transform: rotate(18deg); }

.phone-btn { position: absolute; background: #ff9cb3; border-radius: 3px; }
.btn-vol-up { left: -8px; top: 130px; width: 5px; height: 44px; }
.btn-vol-down { left: -8px; top: 185px; width: 5px; height: 44px; }
.btn-power { right: -8px; top: 145px; width: 5px; height: 58px; }

.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  background: #fff8fb;
  border-radius: 42px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 12px 14px 18px 14px;
  box-shadow: inset 0 0 16px rgba(255, 182, 193, 0.2);
}

/* 屏幕反光玻璃微光 */
.phone-screen::before {
  content: '';
  position: absolute;
  top: 0;
  left: -80px;
  width: 180px;
  height: 100%;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0) 70%);
  transform: skewX(-20deg);
  pointer-events: none;
  z-index: 10;
}

/* 状态栏 & 灵动岛 */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 26px;
  padding: 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: #4a3e4e;
  z-index: 5;
}

.dynamic-island {
  width: 86px;
  height: 20px;
  background: #231b26;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
}

.island-camera {
  width: 7px;
  height: 7px;
  background: #111;
  border-radius: 50%;
  border: 1.5px solid #2e2633;
}

.status-icons { display: flex; align-items: center; gap: 5px; font-size: 11px; }

.status-battery {
  display: inline-block;
  width: 18px;
  height: 10px;
  border: 1.5px solid #4a3e4e;
  border-radius: 3px;
  padding: 1px;
  position: relative;
}
.status-battery::after {
  content: '';
  position: absolute;
  right: -3px;
  top: 2px;
  width: 2px;
  height: 3px;
  background: #4a3e4e;
  border-radius: 0 1px 1px 0;
}
.battery-level {
  display: block;
  width: 90%;
  height: 100%;
  background: #22c55e;
  border-radius: 1px;
}

/* 手机内页顶部聊天导航栏 */
.chat-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 8px 10px 8px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 1px solid #ffe2e8;
  margin-top: 6px;
  margin-bottom: 8px;
  box-shadow: 0 3px 10px rgba(255, 143, 171, 0.12);
  z-index: 5;
}

.chat-header-back-btn, .chat-header-more-btn {
  background: none;
  border: none;
  color: #ff5277;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 10px;
  transition: transform 0.2s var(--bounce-spring);
}

.chat-header-back-btn:hover, .chat-header-more-btn:hover {
  transform: scale(1.15);
  background: #fff0f5;
}

.header-icon-svg {
  width: 20px;
  height: 20px;
}

.chat-header-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

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

.chat-title-text {
  font-size: 14px;
  font-weight: 700;
  color: #2b1f2e;
  max-width: 170px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-title-badge {
  font-size: 9px;
  font-weight: 700;
  color: #ffffff;
  background: #ff5277;
  padding: 1px 6px;
  border-radius: 6px;
}

.chat-status-text {
  font-size: 10px;
  font-weight: 600;
  color: #ff8da1;
}

/* ==========================================================================
   聊天消息内容区域与灵动弹跳动画 (Chat Messages)
   ========================================================================== */
.chat-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.chat-messages-container::-webkit-scrollbar {
  width: 4px;
}
.chat-messages-container::-webkit-scrollbar-thumb {
  background: rgba(255, 182, 193, 0.4);
  border-radius: 4px;
}

.chat-time-divider {
  display: flex;
  justify-content: center;
  margin: 4px 0 6px 0;
}

.time-badge {
  font-size: 10px;
  font-weight: 600;
  color: #b0a3b5;
  background: rgba(255, 255, 255, 0.85);
  padding: 2px 10px;
  border-radius: 10px;
  border: 1px solid #ffe8ee;
}

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

/* 消息行基础结构 */
.chat-msg-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  animation: messagePopIn 0.55s var(--bounce-spring) forwards;
  transform-origin: bottom center;
}

@keyframes messagePopIn {
  0% {
    transform: scale(0.3) translateY(28px);
    opacity: 0;
  }
  65% {
    transform: scale(1.08) translateY(-4px);
    opacity: 1;
  }
  85% {
    transform: scale(0.96) translateY(2px);
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* 左侧消息 */
.chat-msg-row.left {
  flex-direction: row;
}

/* 右侧消息 (自己) */
.chat-msg-row.right {
  flex-direction: row-reverse;
}

/* 头像外框 */
.msg-avatar-wrap {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 4px 10px rgba(255, 101, 132, 0.2);
  border: 2px solid #ffffff;
  background: #ffffff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: avatarJump 0.5s var(--bounce-spring);
}

@keyframes avatarJump {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-8px) scale(1.1); }
}

.msg-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.msg-avatar-svg {
  width: 100%;
  height: 100%;
}

/* 气泡与名称组合 */
.msg-content-col {
  display: flex;
  flex-direction: column;
  max-width: 72%;
}

.chat-msg-row.left .msg-content-col {
  align-items: flex-start;
}

.chat-msg-row.right .msg-content-col {
  align-items: flex-end;
}

.msg-sender-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 3px;
  padding: 0 4px;
}

/* 气泡本体 */
.msg-bubble {
  position: relative;
  padding: 10px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  word-break: break-word;
  box-shadow: 0 4px 14px rgba(255, 143, 171, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.8);
  transition: transform 0.2s var(--bounce-spring);
}

.msg-bubble:hover {
  transform: scale(1.03);
}

/* 气泡角尖设计 */
.chat-msg-row.left .msg-bubble {
  border-top-left-radius: 6px;
}

.chat-msg-row.right .msg-bubble {
  border-top-right-radius: 6px;
}

/* 各色气泡风格绑定 */
.bubble-theme-pink { background: var(--bubble-pink); color: var(--bubble-pink-text); }
.bubble-theme-green { background: var(--bubble-green); color: var(--bubble-green-text); }
.bubble-theme-yellow { background: var(--bubble-yellow); color: var(--bubble-yellow-text); }
.bubble-theme-purple { background: var(--bubble-purple); color: var(--bubble-purple-text); }
.bubble-theme-blue { background: var(--bubble-blue); color: var(--bubble-blue-text); }
.bubble-theme-white { background: var(--bubble-white); color: var(--bubble-white-text); }

/* 表情包气泡样式 (纯萌宠/微表情，无边框高亮弹跳) */
.msg-bubble.is-sticker {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  padding: 2px !important;
}

.msg-sticker-img {
  width: 95px;
  height: 95px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 6px 12px rgba(255, 101, 132, 0.25));
  animation: stickerBounce 0.7s var(--bounce-spring);
}

@keyframes stickerBounce {
  0% { transform: scale(0.2) rotate(-15deg); }
  60% { transform: scale(1.18) rotate(6deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.msg-sticker-svg-wrap {
  width: 95px;
  height: 95px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 6px 14px rgba(255, 101, 132, 0.25));
  animation: stickerBounce 0.7s var(--bounce-spring);
}

.msg-sticker-svg-wrap svg {
  width: 100%;
  height: 100%;
}

/* 对方正在输入中气泡 */
.typing-bubble-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.typing-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff0f5;
  border: 1.5px solid #ffd1dc;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.typing-bubble {
  background: #ffffff;
  padding: 8px 14px;
  border-radius: 16px;
  border-top-left-radius: 4px;
  box-shadow: 0 4px 12px rgba(255, 143, 171, 0.15);
  display: flex;
  align-items: center;
  gap: 4px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff6584;
  animation: typingDotWave 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingDotWave {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1.2); opacity: 1; }
}

/* 手机底部模拟输入栏 */
.chat-bottom-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-radius: 24px;
  border: 1.5px solid #ffe2e8;
  box-shadow: 0 4px 14px rgba(255, 143, 171, 0.12);
  margin-top: 6px;
}

.input-tool-btn {
  background: none;
  border: none;
  font-size: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s var(--bounce-spring);
}

.input-tool-btn:hover {
  transform: scale(1.2);
}

.input-tool-btn.primary {
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, #ff6584, #ff8fa3);
  color: #fff;
  border-radius: 50%;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(255, 101, 132, 0.3);
}

.fake-input-box {
  flex: 1;
  background: #fff4f7;
  padding: 6px 12px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.fake-placeholder {
  font-size: 11px;
  font-weight: 600;
  color: #ffa4b6;
}

.fake-cursor {
  width: 2px;
  height: 14px;
  background: #ff5277;
  border-radius: 1px;
  animation: cursorBlink 1s infinite;
}

@keyframes cursorBlink {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

.phone-home-indicator {
  width: 120px;
  height: 4px;
  background: #d4c0ce;
  border-radius: 999px;
  margin: 10px auto 0 auto;
}

/* 录屏前倒计时遮罩样式 */
.countdown-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 42px;
  animation: fadeIn 0.2s ease-out;
}

.countdown-modal-box {
  background: #ffffff;
  padding: 24px 28px;
  border-radius: 30px;
  border: 3px solid #ffb4c6;
  box-shadow: 0 16px 40px rgba(255, 101, 132, 0.32);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: countBoxPop 0.4s var(--bounce-spring);
}

@keyframes countBoxPop {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.countdown-badge-icon { font-size: 32px; margin-bottom: 2px; }
.countdown-tip-text { font-size: 13px; font-weight: 700; color: var(--text-muted); }

.countdown-big-num {
  font-size: 58px;
  font-weight: 700;
  color: #ff477e;
  line-height: 1.1;
  margin: 6px 0;
  text-shadow: 0 4px 14px rgba(255, 71, 126, 0.4);
  animation: countNumZoom 0.85s ease-out infinite;
}

@keyframes countNumZoom {
  0% { transform: scale(0.7); opacity: 0.6; }
  50% { transform: scale(1.18); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.countdown-sub-text { font-size: 11px; font-weight: 700; color: #ffa4b6; }

/* ==========================================================================
   手机壳外底部：控件面板 (Dashboard Controls)
   ========================================================================== */
.dashboard-controls {
  width: 100%;
  max-width: 860px;
}

.panel-card {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  border-radius: 36px;
  padding: 28px 32px;
  box-shadow: 0 16px 45px rgba(255, 143, 171, 0.16);
  border: 2px solid #ffffff;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px dashed #ffe5ec;
}

.panel-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-icon {
  font-size: 32px;
  background: #fff0f5;
  padding: 8px;
  border-radius: 18px;
  border: 1.5px solid #ffd6e0;
}

.panel-title { font-size: 22px; font-weight: 700; color: #2e2133; }
.panel-desc { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.panel-quick-actions { display: flex; align-items: center; gap: 10px; }

.panel-icon-btn {
  background: #ffffff;
  border: 1.5px solid #ffe2e8;
  padding: 8px 14px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s var(--bounce-spring);
  box-shadow: 0 3px 8px rgba(255, 143, 171, 0.12);
  font-family: inherit;
}

.panel-icon-btn:hover {
  transform: translateY(-2px);
  border-color: #ff8da1;
  color: #ff477e;
  box-shadow: 0 6px 14px rgba(255, 101, 132, 0.2);
}

/* 聊天设置卡片行 */
.chat-config-row {
  display: grid;
  grid-template-columns: 1.3fr 1.1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 22px;
}

@media (max-width: 820px) {
  .chat-config-row { grid-template-columns: 1fr 1fr; }
}

.config-card {
  background: #fffafd;
  border-radius: 20px;
  padding: 12px 16px;
  border: 1.5px solid #ffedf2;
}

.field-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.label-hint { font-size: 10px; color: #ffa4b6; }

.cute-input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1.5px solid #ffd6e0;
  background: #ffffff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: #2b1f2e;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.cute-input:focus {
  border-color: #ff6584;
  box-shadow: 0 0 0 3px rgba(255, 101, 132, 0.15);
}

.cute-select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1.5px solid #ffd6e0;
  background: #ffffff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: #2b1f2e;
  outline: none;
  cursor: pointer;
}

/* ==========================================================================
   角色管理区 (Character Manager) - 头像自动绑定
   ========================================================================== */
.character-manager-wrap {
  background: linear-gradient(135deg, #fff7fa 0%, #f7f5ff 100%);
  border-radius: 24px;
  border: 1.5px solid #ffd6e4;
  padding: 18px 20px;
  margin-bottom: 24px;
}

.character-manager-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.character-header-left {
  display: flex;
  flex-direction: column;
}

.character-title {
  font-size: 16px;
  font-weight: 700;
  color: #2e1e33;
}

.character-tip {
  font-size: 12px;
  font-weight: 600;
  color: #ff6584;
  margin-top: 2px;
}

.cute-add-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
  transition: all 0.2s var(--bounce-spring);
  font-family: inherit;
}

.cute-add-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 14px rgba(16, 185, 129, 0.35);
}

.characters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.character-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 12px 14px;
  border: 2px solid #ffe2e8;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 12px rgba(255, 143, 171, 0.1);
  transition: all 0.2s var(--bounce-spring);
  position: relative;
}

.character-card:hover {
  transform: translateY(-2px);
  border-color: #ff8da1;
}

.char-avatar-slot {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  flex-shrink: 0;
  cursor: pointer;
  padding: 2px;
  background: linear-gradient(135deg, #ff758c, #ffb199);
  box-shadow: 0 4px 10px rgba(255, 101, 132, 0.25);
  transition: transform 0.2s var(--bounce-spring);
}

.char-avatar-slot:hover {
  transform: scale(1.1) rotate(5deg);
}

.char-avatar-slot .slot-img, .char-avatar-slot .slot-svg {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
}

.char-avatar-slot .slot-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 18px;
  height: 18px;
  background: #ff477e;
  border-radius: 50%;
  color: #fff;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #ffffff;
}

.char-meta-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.char-name-input {
  width: 100%;
  padding: 4px 8px;
  border-radius: 10px;
  border: 1.5px solid #ffd6e0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: #2e1e33;
  outline: none;
}

.char-name-input:focus {
  border-color: #ff477e;
}

.char-options-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.char-side-select, .char-color-select {
  padding: 3px 6px;
  border-radius: 8px;
  border: 1px solid #ffd1dc;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  color: #372b3a;
  background: #fff5f8;
  outline: none;
  cursor: pointer;
}

.char-del-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  border-radius: 6px;
  transition: transform 0.2s;
  color: #ff5277;
}

.char-del-btn:hover {
  transform: scale(1.2);
  background: #ffe5ec;
}

/* 预设剧本选择区 */
.presets-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  padding: 12px 16px;
  background: #fff0f5;
  border-radius: 20px;
  border: 1px dashed #ffb4c6;
}

.presets-title { font-size: 13px; font-weight: 700; color: #ff477e; }

.preset-btns { display: flex; flex-wrap: wrap; gap: 8px; }

.preset-chip {
  background: #ffffff;
  border: 1.5px solid #ffd6e0;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #4a3e4e;
  cursor: pointer;
  transition: all 0.2s var(--bounce-spring);
  font-family: inherit;
}

.preset-chip:hover {
  transform: translateY(-2px);
  border-color: #ff8da1;
  color: #ff477e;
  box-shadow: 0 4px 10px rgba(255, 101, 132, 0.2);
}

.preset-chip.active {
  background: #ff5277;
  color: #ffffff;
  border-color: #ff5277;
  box-shadow: 0 4px 12px rgba(255, 82, 119, 0.35);
}

/* 消息编辑列表区 */
.messages-editor-wrap {
  margin-bottom: 26px;
}

.messages-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.messages-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.messages-title { font-size: 16px; font-weight: 700; color: #2b1f2e; }

.messages-count {
  font-size: 12px;
  font-weight: 700;
  color: #ff6584;
  background: #ffe5ec;
  padding: 3px 10px;
  border-radius: 12px;
}

.message-add-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cute-btn-secondary {
  background: #ffffff;
  border: 1.5px solid #ffd6e0;
  padding: 7px 14px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 700;
  color: #372b3a;
  cursor: pointer;
  transition: all 0.2s var(--bounce-spring);
  font-family: inherit;
}

.cute-btn-secondary:hover {
  transform: translateY(-2px);
  border-color: #ff6584;
  color: #ff477e;
  box-shadow: 0 4px 10px rgba(255, 101, 132, 0.15);
}

.cute-btn-secondary.sticker-accent {
  background: #fff0f7;
  border-color: #ffa4c2;
  color: #e84368;
}

.messages-table-container {
  max-height: 290px;
  overflow-y: auto;
  border-radius: 20px;
  border: 1.5px solid #ffe2e8;
  background: #ffffff;
}

.messages-table-container::-webkit-scrollbar { width: 8px; }
.messages-table-container::-webkit-scrollbar-track { background: #fff5f8; border-radius: 10px; }
.messages-table-container::-webkit-scrollbar-thumb { background: #ffb7c5; border-radius: 10px; }

.cute-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.cute-table th {
  position: sticky;
  top: 0;
  background: #fff5f8;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 2px solid #ffd6e0;
  z-index: 2;
}

.cute-table td {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid #fff0f5;
  vertical-align: middle;
}

.cute-table tr:hover { background: #fffafc; }

.cute-table tr.active-playback-row {
  background: #ffe4ec !important;
  box-shadow: inset 3px 0 0 #ff4081;
}

.msg-index-badge {
  display: inline-block;
  width: 22px;
  height: 22px;
  line-height: 22px;
  text-align: center;
  background: #fff0f5;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  color: #ff6584;
  border: 1px solid #ffd1dc;
}

.table-char-select {
  padding: 6px 10px;
  border-radius: 12px;
  border: 1.5px solid #ffd6e0;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  outline: none;
  background: #ffffff;
  cursor: pointer;
  max-width: 140px;
}

.msg-type-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
  display: inline-block;
}
.msg-type-pill.text { background: #e0f2fe; color: #0284c7; }
.msg-type-pill.sticker { background: #fdf2f8; color: #db2777; }

.table-text-input {
  width: 100%;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1.5px solid #ffd6e0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  outline: none;
}
.table-text-input:focus { border-color: #ff6584; }

.table-sticker-btn {
  background: #fff5f8;
  border: 1.5px dashed #ff8da1;
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: #e84368;
}

.table-sticker-thumb {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.table-delay-input {
  width: 70px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1.5px solid #ffd6e0;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  outline: none;
}

.table-actions-cell {
  display: flex;
  align-items: center;
  gap: 4px;
}

.row-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 3px;
  border-radius: 6px;
  transition: transform 0.2s;
}
.row-action-btn:hover { transform: scale(1.2); background: #ffe5ec; }

/* 底部大播放控制器 */
.play-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 18px;
  border-top: 2px dashed #ffe5ec;
}

@media (max-width: 680px) {
  .play-action-bar { flex-direction: column; align-items: stretch; }
}

.play-status-indicator { display: flex; align-items: center; gap: 10px; }

.status-pulse {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseDotAnim 1.5s infinite;
}

.status-pulse.playing {
  background: #ff477e;
  box-shadow: 0 0 0 0 rgba(255, 71, 126, 0.7);
}

@keyframes pulseDotAnim {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(255, 71, 126, 0.6); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 7px rgba(255, 71, 126, 0); }
  100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(255, 71, 126, 0); }
}

.status-tip-text { font-size: 13px; font-weight: 700; color: var(--text-main); }

.play-buttons-group { display: flex; align-items: center; gap: 12px; }

.big-play-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #ff477e 0%, #ff8da1 100%);
  color: #ffffff;
  border: none;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(255, 71, 126, 0.4);
  transition: all 0.22s var(--bounce-spring);
  font-family: inherit;
}

.big-play-btn:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 12px 30px rgba(255, 71, 126, 0.55);
}

.big-play-btn:active { transform: translateY(1px) scale(0.96); }

.pause-step-btn {
  background: #ffffff;
  border: 2px solid #ffd6e0;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: #372b3a;
  cursor: pointer;
  transition: all 0.2s var(--bounce-spring);
  font-family: inherit;
  box-shadow: 0 3px 8px rgba(255, 143, 171, 0.12);
}

.pause-step-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: #ff6584;
  color: #ff477e;
}

.pause-step-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ==========================================================================
   模态弹窗 (Modal)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43, 31, 46, 0.45);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  width: 90%;
  max-width: 480px;
  background: #ffffff;
  border-radius: 32px;
  padding: 26px 24px;
  box-shadow: 0 20px 50px rgba(255, 101, 132, 0.35);
  border: 3px solid #ffe5ec;
  animation: scaleUp 0.3s var(--bounce-spring);
}

.sticker-modal-card {
  max-width: 520px;
}

@keyframes scaleUp {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.modal-title { font-size: 18px; font-weight: 700; color: #2b1f2e; }

.modal-close-btn {
  background: #fff0f5;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  color: #ff6584;
  cursor: pointer;
  transition: transform 0.2s;
}

.modal-close-btn:hover { transform: scale(1.15) rotate(90deg); }

.modal-subtitle { font-size: 12px; color: var(--text-muted); margin-bottom: 18px; }

.preset-avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}

.preset-avatar-item {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 20px;
  border: 2.5px solid #ffe2e8;
  background: #fff5f8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s var(--bounce-spring);
  padding: 8px;
}

.preset-avatar-item:hover {
  transform: scale(1.08) translateY(-4px);
  border-color: #ff6584;
  background: #ffffff;
  box-shadow: 0 8px 16px rgba(255, 101, 132, 0.25);
}

.preset-avatar-svg { width: 44px; height: 44px; }
.preset-avatar-name { font-size: 10px; font-weight: 700; color: #4a3e4e; margin-top: 4px; }

.upload-custom-btn {
  width: 100%;
  background: #fff0f5;
  border: 2px dashed #ff8da1;
  color: #ff477e;
  padding: 12px;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.upload-custom-btn:hover {
  background: #ffe5ec;
  border-color: #ff477e;
  transform: translateY(-2px);
}

/* 表情包网格 */
.stickers-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 20px;
  padding: 4px;
}

.sticker-item {
  width: 100%;
  aspect-ratio: 1;
  background: #fff7fa;
  border: 2px solid #ffe2e8;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 8px;
  transition: all 0.2s var(--bounce-spring);
}

.sticker-item:hover {
  transform: scale(1.1) translateY(-3px);
  border-color: #ff477e;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(255, 101, 132, 0.25);
}

.sticker-svg-preview {
  width: 54px;
  height: 54px;
}

.sticker-name {
  font-size: 10px;
  font-weight: 700;
  color: #5d4d62;
  margin-top: 4px;
}
