/* 底部输入框 - 精致优化版 */
.input-bar {
    position: fixed;
    bottom: 12px;
    left: 0;
    right: 0;
    max-width: 100%; /* 改为100%自适应 */
    margin: 0 auto;
    padding: 0 12px;
    background: transparent;
    z-index: 90;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 普通模式输入栏 */
.input-bar-normal {
    display: flex;
    align-items: center;
    gap: 7px;
}

/* AI回答中模式输入栏 */
.input-bar-answering {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 键盘按钮 */
.keyboard-btn {
    background: rgba(255, 255, 255, 0.98);
    border: 0.5px solid rgba(0, 0, 0, 0.08);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.keyboard-btn svg {
    width: 22px;
    height: 22px;
    color: #2c3e50;
}

.keyboard-btn:active {
    transform: scale(0.92);
}

/* 按住说话按钮（AI回答中） */
.voice-record-btn-answering {
    flex: 1;
    background: rgba(255, 255, 255, 0.98);
    border: 0.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 22px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

.voice-record-btn-answering span {
    font-size: 15px;
    color: #2c3e50;
    font-weight: 500;
    letter-spacing: 2px;
}

.voice-record-btn-answering:active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scale(0.98);
}

.voice-record-btn-answering:active span {
    color: white;
}

/* 停止按钮 */
.stop-btn {
    background: rgba(255, 255, 255, 0.98);
    border: 0.5px solid rgba(0, 0, 0, 0.08);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.stop-btn svg {
    width: 24px;
    height: 24px;
    color: #764ba2;
}

.stop-btn circle {
    stroke: #764ba2;
}

.stop-btn rect {
    fill: #764ba2;
}

.stop-btn:hover {
    background: rgba(118, 75, 162, 0.1);
    border-color: rgba(118, 75, 162, 0.3);
}

.stop-btn:active {
    transform: scale(0.92);
    background: rgba(118, 75, 162, 0.2);
}

.input-bar.menu-open {
    transform: translateY(-95px);
}

/* 底部输入栏按钮 */
.voice-btn, .add-btn, .camera-btn, .send-btn {
    background: rgba(255, 255, 255, 0.98);
    border: 0.5px solid rgba(0, 0, 0, 0.08);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08),
                0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
}

.voice-btn svg, .add-btn svg, .camera-btn svg, .send-btn svg {
    width: 22px;
    height: 22px;
    color: #2c3e50;
}

/* 语音按钮特殊样式 */
.voice-btn svg {
    color: #2c3e50;
}

/* 加号按钮特殊样式 */
.add-btn svg {
    color: #2c3e50;
}

/* 相机按钮蓝色小点 */
.camera-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: #4A90E2;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 1px rgba(74, 144, 226, 0.2);
}

/* 发送按钮特殊样式 */
.send-btn {
    background: linear-gradient(135deg, #7B6BD6 0%, #9B8BE6 100%);
    border: none;
    box-shadow: 0 4px 16px rgba(123, 107, 214, 0.35);
}

.send-btn svg {
    color: #FFFFFF;
}

.send-btn:hover {
    background: linear-gradient(135deg, #8B7BE6 0%, #AB9BF6 100%);
    box-shadow: 0 6px 20px rgba(123, 107, 214, 0.45);
    transform: translateY(-2px) scale(1.05);
}

.send-btn:active {
    transform: scale(0.92) translateY(0);
    box-shadow: 0 2px 8px rgba(123, 107, 214, 0.3);
}

.voice-btn:hover, .add-btn:hover, .camera-btn:hover {
    background: rgba(250, 250, 252, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12),
                0 2px 4px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
    border-color: rgba(123, 107, 214, 0.15);
}

.voice-btn:active, .add-btn:active, .camera-btn:active {
    transform: scale(0.92) translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* 输入框容器 */
.input-wrapper {
    flex: 1;
    position: relative;
}

.message-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    border: 0.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 22px;
    padding: 12px 18px;
    font-size: 15px;
    outline: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08),
                0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1.45;
    color: #1a1a1a;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-weight: 400;
}

.message-input:hover {
    border-color: rgba(123, 107, 214, 0.2);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1),
                0 2px 4px rgba(0, 0, 0, 0.05);
}

.message-input:focus {
    border-color: rgba(123, 107, 214, 0.5);
    box-shadow: 0 4px 16px rgba(123, 107, 214, 0.2),
                0 2px 6px rgba(123, 107, 214, 0.1);
    background: rgba(255, 255, 255, 1);
}

.message-input::placeholder {
    color: #B0B0B0;
    font-weight: 400;
    letter-spacing: 0;
}

/* 语音录制按钮（按住说话）- 旧版保留兼容 */
.voice-record-btn {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    border: 0.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08),
                0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

/* ═══════════════════════════════════════════════
   语音待机模式（② inputBarVoiceIdle）
═══════════════════════════════════════════════ */
.input-bar-voice-idle {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 键盘图标按钮（语音模式左侧） */
.voice-keyboard-btn {
    background: rgba(255, 255, 255, 0.98);
    border: 0.5px solid rgba(0, 0, 0, 0.08);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    color: #2c3e50;
}

.voice-keyboard-btn:active {
    transform: scale(0.92);
}

/* 按住说话大按钮（白色圆角） */
.voice-hold-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.98);
    border: 0.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 22px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.15s ease;
    touch-action: none;
}

.voice-hold-btn:active,
.voice-hold-btn.pressing {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.voice-hold-text {
    font-size: 15px;
    color: #2c3e50;
    font-weight: 500;
    letter-spacing: 3px;
    pointer-events: none;
}

.voice-hold-btn:active .voice-hold-text,
.voice-hold-btn.pressing .voice-hold-text {
    color: white;
}

/* ═══════════════════════════════════════════════
   录音进行中（③ inputBarRecording）
═══════════════════════════════════════════════ */
.input-bar-recording {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

/* 提示文字 */
.recording-hint {
    text-align: center;
    font-size: 12px;
    color: #888;
    font-weight: 400;
    letter-spacing: 1px;
    transition: color 0.2s ease;
}

.recording-hint.cancel-mode {
    color: #e74c3c;
    font-weight: 500;
}

.recording-hint.countdown-mode {
    color: #e67e22;
    font-weight: 500;
}

/* 全宽深色录音按钮 */
.recording-btn {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    border-radius: 22px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    transition: background 0.2s ease;
}

.recording-btn.cancel-mode {
    background: linear-gradient(135deg, #c0392b 0%, #922b21 100%);
}

/* 声音波点动效 */
.recording-dots {
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 2;
    position: relative;
}

.recording-dots i {
    display: block;
    width: 4px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 2px;
    animation: voiceBar 0.8s ease-in-out infinite;
}

.recording-dots i:nth-child(1) { height: 8px;  animation-delay: 0s; }
.recording-dots i:nth-child(2) { height: 16px; animation-delay: 0.1s; }
.recording-dots i:nth-child(3) { height: 24px; animation-delay: 0.2s; }
.recording-dots i:nth-child(4) { height: 16px; animation-delay: 0.3s; }
.recording-dots i:nth-child(5) { height: 8px;  animation-delay: 0.4s; }

@keyframes voiceBar {
    0%, 100% { transform: scaleY(0.5); opacity: 0.6; }
    50%       { transform: scaleY(1.4); opacity: 1; }
}

/* 背景扩散波纹 */
.recording-ripples {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    animation: rippleOut 2s ease-out infinite;
}

.ripple.r1 { width: 60px;  height: 60px;  animation-delay: 0s; }
.ripple.r2 { width: 100px; height: 100px; animation-delay: 0.6s; }
.ripple.r3 { width: 140px; height: 140px; animation-delay: 1.2s; }

@keyframes rippleOut {
    0%   { transform: scale(0.4); opacity: 0.6; }
    100% { transform: scale(1);   opacity: 0; }
}

/* ═══════════════════════════════════════════════
   55寸触摸屏适配补充
═══════════════════════════════════════════════ */
@media (min-width: 1080px) and (orientation: portrait) {
    .input-bar {
        max-width: 100%;
        padding: 0 80px; /* 增大内边距 - 从60px到80px */
        bottom: 24px; /* 增大底部距离 - 从18px到24px */
    }
    
    .input-bar-normal,
    .input-bar-answering {
        max-width: 100%;
        margin: 0 auto;
        gap: 16px; /* 增大间距 - 从10px到16px */
    }
    
    /* 放大按钮尺寸 - 触摸友好 */
    .voice-btn, .add-btn, .camera-btn, .send-btn,
    .keyboard-btn, .stop-btn {
        width: 88px; /* 从44px到88px (2倍) */
        height: 88px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    }
    
    .voice-btn svg, .add-btn svg, .camera-btn svg, .send-btn svg,
    .keyboard-btn svg, .stop-btn svg {
        width: 48px; /* 从24px到48px (2倍) */
        height: 48px;
    }
    
    .voice-btn:active, .add-btn:active, .camera-btn:active, .send-btn:active,
    .keyboard-btn:active, .stop-btn:active {
        transform: scale(0.92);
    }
    
    /* 放大输入框 */
    .message-input {
        padding: 28px 40px; /* 从14px 20px放大 */
        font-size: 32px; /* 从16px到32px (2倍) */
        border-radius: 48px; /* 从24px到48px (2倍) */
        min-height: 88px; /* 与按钮高度一致 */
    }
    
    .message-input::placeholder {
        font-size: 30px;
        opacity: 0.6;
    }
    
    /* 按住说话按钮 */
    .voice-record-btn {
        border-radius: 48px;
        padding: 28px 40px;
        min-height: 88px;
    }
    
    .voice-record-btn span,
    .voice-record-btn-answering span {
        font-size: 32px; /* 从16px到32px (2倍) */
        font-weight: 600;
        letter-spacing: 3px;
    }
    
    .voice-record-btn-answering {
        border-radius: 48px;
        padding: 28px 40px;
        min-height: 88px;
    }
    
    .voice-record-btn:active,
    .voice-record-btn-answering:active {
        transform: scale(0.96);
    }

    /* 语音待机模式放大 */
    .input-bar-voice-idle {
        gap: 16px;
    }

    .voice-keyboard-btn {
        width: 88px;
        height: 88px;
    }

    .voice-keyboard-btn svg {
        width: 48px;
        height: 48px;
    }

    .voice-hold-btn {
        height: 88px;
        border-radius: 48px;
    }

    .voice-hold-text {
        font-size: 32px;
        letter-spacing: 6px;
    }

    /* 录音中放大 */
    .recording-hint {
        font-size: 24px;
    }

    .recording-btn {
        height: 100px;
        border-radius: 48px;
    }

    .recording-dots i {
        width: 8px;
    }

    .recording-dots i:nth-child(1) { height: 16px; }
    .recording-dots i:nth-child(2) { height: 32px; }
    .recording-dots i:nth-child(3) { height: 48px; }
    .recording-dots i:nth-child(4) { height: 32px; }
    .recording-dots i:nth-child(5) { height: 16px; }
}

/* 横屏大屏幕更大尺寸 */
@media screen and (min-width: 1920px) {
    .input-bar {
        padding: 0 80px;
        bottom: 20px;
    }
    
    .input-bar-normal,
    .input-bar-answering {
        max-width: 100%; /* 改为100%自适应 */
        gap: 12px;
    }
    
    .voice-btn, .add-btn, .camera-btn, .send-btn,
    .keyboard-btn, .stop-btn {
        width: 56px;
        height: 56px;
    }
    
    .voice-btn svg, .add-btn svg, .camera-btn svg, .send-btn svg,
    .keyboard-btn svg, .stop-btn svg {
        width: 28px;
        height: 28px;
    }
    
    .message-input {
        padding: 16px 24px;
        font-size: 18px;
        border-radius: 28px;
    }
    
    .voice-record-btn {
        border-radius: 28px;
        padding: 16px 24px;
    }
    
    .voice-record-btn span,
    .voice-record-btn-answering span {
        font-size: 18px;
    }
    
    .voice-record-btn-answering {
        border-radius: 28px;
        padding: 16px 24px;
    }
}
