    .agent-tabs { display: flex; gap: 0.8rem; padding: 1.2rem 1.5rem 0.5rem; text-shadow: 0 1px 4px rgba(0,0,0,0.9), 0 0 8px rgba(0,0,0,0.5); }
    .agent-tab { flex: 1; background: rgba(0,0,0,0.35); border-radius: 16px; padding: 0.8rem 0.5rem; text-align: center; cursor: pointer; border: 1px solid rgba(255,255,255,0.15); transition: all 0.3s ease; font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
    .agent-tab:hover { background: rgba(0,0,0,0.5); color: var(--text-primary); transform: translateY(-2px); }
    .agent-tab.active { background: rgba(10,10,20,0.6); border-color: var(--accent-color); color: #fff; box-shadow: 0 4px 16px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.1); }

    /* 1. 确保聊天面板是标准的弹性盒，不使用绝对定位包裹输入框 */
    .chat-panel {
      display: flex;
      flex-direction: column;
      flex: 1;
      overflow: visible;
      position: relative;
      height: 100%;
    }

    /* 2. 消息区域取消底部的 120px 暴力硬垫高，改用弹性撑满，让其自然滚动 */
    .messages-area {
      flex: 1;
      overflow-y: auto;
      padding: 1rem 1rem 10px;
      display: flex;
      flex-direction: column;
      gap: 1.5rem;
      overflow-anchor: none;
    }

    
    .message { display: flex; gap: 12px; max-width: 88%; opacity: 1; transform: none; }
    .message.msg-animate { animation: fadeSlide 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
    .message.user { align-self: flex-end; flex-direction: row-reverse; }
    .chat-time-separator { text-align: center; padding: 10px 0 6px; font-size: 0.78rem; color: var(--text-secondary); opacity: 0.7; user-select: none; }
    .msg-time { font-size: 0.72rem; color: var(--text-secondary); opacity: 0.6; margin-bottom: 4px; user-select: none; }
    .message-avatar { width: 44px; height: 44px; min-width: 44px; border-radius: 50%; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,0.3); flex-shrink: 0; border: 1px solid rgba(255,255,255,0.1); }
    .message-avatar img { width: 100%; height: 100%; object-fit: cover; }
    
    .message-bubble {
      padding: 1rem 1.4rem; border-radius: 1.4rem; line-height: 1.7; word-break: break-word; font-size: 1em;
      box-shadow: 0 1px 4px rgba(0,0,0,0.12); white-space: pre-wrap;
      -webkit-backdrop-filter: blur(var(--bubble-blur));
      backdrop-filter: blur(var(--bubble-blur));
    }
    .message.user .message-bubble { background: var(--user-bubble) !important; border-top-right-radius: 0.4rem; border-bottom-right-radius: 0.4rem; }
    .message.agent .message-bubble, .message.assistant .message-bubble {
      background: var(--agent-bubble) !important; border-left: 3px solid var(--accent-color) !important; border-top-left-radius: 0.4rem; border-bottom-left-radius: 0.4rem;
    }

    .rp-thought { color: var(--text-monologue); font-style: italic; opacity: 0.9; font-size: 0.95em; }
    .rp-dialogue { color: var(--text-primary); font-weight: 500; }
    /* 群聊发送者名称 */
    .sender-name { font-size: 0.72rem; color: var(--accent-color); margin-bottom: 3px; opacity: 0.85; font-weight: 500; letter-spacing: 0.3px; user-select: none; }
    .message-bubble-wrap { display: flex; flex-direction: column; min-width: 0; }
    .message.user .sender-name { text-align: right; color: var(--text-secondary); }
    /* 连续消息合并：隐藏头像和名字，缩小间距 */
    .message.consecutive .message-avatar { visibility: hidden; width: 44px; min-width: 44px; }
    .message.consecutive .sender-name { display: none; }
    .message.consecutive { margin-top: -10px; }
    .message.consecutive.agent .message-bubble { border-top-left-radius: 0.4rem; }
    .message.consecutive.user .message-bubble { border-top-right-radius: 0.4rem; }

    /* 3. 核心修改：输入框不再悬浮在 absolute 容器上，而是作为 Flex 流的底部固定环 */
    /* 找到第 141 行左右的 .input-wrapper-outer，替换为以下样式 */
    .input-wrapper-outer {
      position: relative;
      padding: 6px 1rem;
      margin-bottom: 12px;
      /* 移除背景色块，让输入框悬浮在聊天界面上 */
      background: transparent;
      border: none;
      pointer-events: auto;
      z-index: 10;
    }
    .image-preview-bar { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: rgba(20,20,30,0.9); border: 1px solid rgba(255,255,255,0.08); border-radius: 16px 16px 0 0; border-bottom: none; margin: 0 1rem; }
    .image-preview-list { display: flex; gap: 6px; overflow-x: auto; flex: 1; }
    .image-preview-item { position: relative; width: 56px; height: 56px; border-radius: 8px; overflow: hidden; flex-shrink: 0; border: 1px solid rgba(255,255,255,0.1); }
    .image-preview-item img { width: 100%; height: 100%; object-fit: cover; }
    .image-preview-item .remove-img { position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; border-radius: 50%; background: rgba(0,0,0,0.7); color: #fff; font-size: 10px; display: flex; align-items: center; justify-content: center; cursor: pointer; border: none; }
    .clear-images-btn { background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 1rem; padding: 4px; }
    .clear-images-btn:hover { color: #ff6b6b; }
    .attach-btn { background: none; border: none; font-size: 1.2rem; cursor: pointer; padding: 4px; opacity: 0.7; transition: all 0.2s; }
    .attach-btn:hover { opacity: 1; transform: scale(1.1); }
    .message-image { max-width: 300px; max-height: 300px; border-radius: 12px; margin-top: 8px; cursor: pointer; transition: transform 0.2s; }
    .message-image:hover { transform: scale(1.02); }
    /* 语音消息 */
    .voice-message { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: rgba(255,255,255,0.06); border-radius: 16px; margin-top: 6px; min-width: 200px; max-width: 280px; }
    .voice-play-btn { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-color); border: none; color: #fff; font-size: 0.9rem; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.2s; }
    .voice-play-btn:hover { transform: scale(1.1); box-shadow: 0 0 12px var(--accent-glow); }
    .voice-play-btn.playing { animation: voicePulse 1s infinite; }
    @keyframes voicePulse { 0%,100% { box-shadow: 0 0 0 0 var(--accent-glow); } 50% { box-shadow: 0 0 0 8px transparent; } }
    .voice-waveform-wrap { flex: 1; min-width: 0; position: relative; }
    .voice-waveform { height: 24px; display: flex; align-items: center; gap: 2px; }
    .voice-waveform span { display: block; width: 3px; background: var(--accent-color); border-radius: 2px; animation: voiceWave 0.8s ease-in-out infinite alternate; opacity: 0.6; }
    .voice-waveform span:nth-child(1) { height: 8px; animation-delay: 0s; }
    .voice-waveform span:nth-child(2) { height: 16px; animation-delay: 0.1s; }
    .voice-waveform span:nth-child(3) { height: 10px; animation-delay: 0.2s; }
    .voice-waveform span:nth-child(4) { height: 18px; animation-delay: 0.3s; }
    .voice-waveform span:nth-child(5) { height: 6px; animation-delay: 0.4s; }
    .voice-waveform span:nth-child(6) { height: 14px; animation-delay: 0.5s; }
    .voice-waveform span:nth-child(7) { height: 8px; animation-delay: 0.6s; }
    .voice-waveform span:nth-child(8) { height: 12px; animation-delay: 0.7s; }
    .voice-progress { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; }
    .voice-progress-bar { height: 100%; width: 0%; background: var(--accent-color); border-radius: 2px; transition: width 0.3s linear; }
    .voice-duration { font-size: 0.72rem; color: var(--text-secondary); flex-shrink: 0; min-width: 50px; text-align: right; }
    @keyframes voiceWave { from { height: 4px; } to { height: 20px; } }
    .voice-text { font-size: 0.78rem; color: var(--text-secondary); margin-top: 4px; font-style: italic; }
    /* 自主消息标记 */
    .autonomous-badge { font-size: 0.65rem; color: var(--accent-color); opacity: 0.6; margin-top: 4px; display: flex; align-items: center; gap: 4px; }
    .autonomous-badge::before { content: '💫'; font-size: 0.7rem; }
    .recording-indicator { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: rgba(255,60,60,0.15); border: 1px solid rgba(255,60,60,0.3); border-radius: 16px; margin: 0 1rem; }
    .recording-dot { width: 10px; height: 10px; border-radius: 50%; background: #ff4444; animation: recPulse 1s infinite; }
    @keyframes recPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
    .recording-text { font-size: 0.85rem; color: #ff8888; flex: 1; }
    .recording-cancel { background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 0.85rem; }
    .input-area { pointer-events: auto; background: rgba(20,20,30,0.95); border: 1px solid rgba(255,255,255,0.08); display: flex; gap: 10px; align-items: flex-end; border-radius: 24px; padding: 10px 14px; box-shadow: 0 2px 8px rgba(0,0,0,0.2); transition: all 0.3s ease; }
    .input-area:focus-within { border-color: rgba(162,155,254,0.4); }
    textarea.message-input { flex: 1; background: transparent; border: none; padding: 6px 4px; resize: none; min-height: 24px; max-height: 120px; line-height: 1.5; outline: none; color: #fff; font-size: 0.95rem; text-shadow: none; overflow-y: auto; word-wrap: break-word; }
    
    .mic-btn, .call-btn { border-radius: 50%; width: 40px; height: 40px; min-width: 40px; display: flex; align-items: center; justify-content: center; padding: 0; font-size: 1.1rem; background: rgba(255,255,255,0.1); color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.25); transition: all 0.2s; border: 1px solid rgba(255,255,255,0.1); cursor:pointer; }
    .mic-btn:hover, .call-btn:hover { background: rgba(255,255,255,0.2); transform: scale(1.05); }
    .mic-btn.recording { background: #ff6b6b; color: white; border-color: #ff6b6b; animation: micPulse 1.5s infinite; box-shadow: 0 0 15px rgba(255,107,107,0.6); }
    .call-btn.active { background: #4caf50; color: white; border-color: #4caf50; animation: callPulse 2s infinite; box-shadow: 0 0 15px rgba(76,175,80,0.6); }
    
    @keyframes micPulse { 0% { transform: scale(1); } 50% { transform: scale(1.1); } 100% { transform: scale(1); } }
    @keyframes callPulse { 0% { box-shadow: 0 0 0 0 rgba(76,175,80,0.7); } 70% { box-shadow: 0 0 0 10px rgba(76,175,80,0); } 100% { box-shadow: 0 0 0 0 rgba(76,175,80,0); } }

    .send-btn { border-radius: 50%; width: 40px; height: 40px; min-width: 40px; display: flex; align-items: center; justify-content: center; padding: 0; font-size: 1.1rem; background: var(--accent-color); color: #0a0a1a; box-shadow: 0 2px 8px rgba(162,155,254,0.3); transition: all 0.2s; border: none; cursor:pointer; }
    .send-btn:hover { transform: scale(1.1); background: var(--accent-hover); }
    .send-btn:disabled { opacity: 0.5; cursor: not-allowed; filter: grayscale(0.8); transform: scale(1); background: var(--accent-color); box-shadow: none; }
    .send-btn:disabled:hover { transform: scale(1); background: var(--accent-color); }
    .send-btn.stop { background: rgba(255, 255, 255, 0.1); color: var(--text-primary); border: 1px solid rgba(255, 255, 255, 0.2); }
    .send-btn.stop:hover { background: rgba(255, 255, 255, 0.15); transform: scale(1.05); }

    /* ====== 气泡内播报指示器 ====== */
    .tts-bubble-indicator { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 6px 10px; background: rgba(162,155,254,0.08); border: 1px solid rgba(162,155,254,0.15); border-radius: 10px; animation: fadeUp 0.3s ease; }
    .tts-mini-waves { display: flex; gap: 3px; align-items: center; height: 14px; }
    .tts-mini-waves span { display: block; width: 2px; height: 4px; background: var(--accent-color); border-radius: 2px; animation: wave 1s infinite ease-in-out; }
    .tts-mini-waves span:nth-child(2) { animation-delay: 0.2s; }
    .tts-mini-waves span:nth-child(3) { animation-delay: 0.4s; }
    .tts-mini-text { font-size: 0.7rem; color: var(--accent-color); opacity: 0.7; letter-spacing: 1px; }
    .tts-mini-stop { background: rgba(255,100,100,0.12); border: 1px solid rgba(255,100,100,0.3); color: #ffb2b2; border-radius: 8px; padding: 2px 8px; font-size: 0.65rem; cursor: pointer; transition: 0.2s; margin-left: auto; }
    .tts-mini-stop:hover { background: rgba(255,100,100,0.8); color: #fff; }
    @keyframes wave { 0%, 100% { height: 4px; } 50% { height: 14px; } }
    /* 隐藏旧全局指示器 */
    .tts-indicator-wrapper { display: none !important; }

    /* 新增：移动端触摸优化 */

    .flex-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
    .font-preset { background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.08); padding: 6px 14px; border-radius: 20px; font-size: 0.75rem; cursor: pointer; transition: 0.2s;}
    .font-preset:hover { background: rgba(255,255,255,0.15); }
    .font-preset.active, .font-preset:active { background: var(--accent-color); color: #0a0a1a; border-color: var(--accent-color); font-weight: 600;}

    @keyframes fadeSlide { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: none; } }
    .typing-indicator { display: flex; gap: 5px; align-items: center; padding: 0.6rem 1rem; }
    .typing-dot { width: 6px; height: 6px; background: var(--accent-color); border-radius: 50%; animation: bounce 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 bounce { 0%, 80%, 100% { transform: scale(0); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }

