/* 紧凑输入模式样式 - 1:7:2 比例布局 */
.input-mode-toggle-btn {
    flex: 1;
    min-width: 40px;
    border: none;
    border-radius: 8px;
    background: var(--secondary-color);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.5rem;
    box-shadow: var(--soft-shadow);
}

.input-mode-toggle-btn:hover {
    background: var(--pearl-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.chat-input {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
    width: 100%;
}

.chat-input > div {
    flex: 7;
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.chat-input .input-field {
    flex: 7;
    min-height: 48px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.chat-input .input-field:focus {
    border-color: var(--primary-color);
    outline: none;
}

.chat-input .btn {
    flex: 2;
    min-width: 60px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.voice-record-btn {
    flex: 2;
    min-width: 30px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(145deg, #10b981, #059669);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--soft-shadow);
}

.voice-record-btn:hover {
    background: linear-gradient(145deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.voice-record-btn.recording {
    background: linear-gradient(145deg, #ef4444, #dc2626);
    animation: voice-recording-pulse 1.5s ease-in-out infinite;
}

.voice-record-btn.hidden {
    display: none;
}

/* 语音设置面板 */
.voice-settings-panel {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
}

.voice-settings-panel.hidden {
    display: none;
}

.voice-setting-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-color);
}

.voice-setting-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
}

/* 语音状态指示器 */
.voice-status {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 12px;
    border: 2px solid var(--primary-color);
    animation: voice-status-enter 0.3s ease-out;
}

.voice-status.hidden {
    display: none;
}

.voice-indicator {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

/* 动画效果 */
@keyframes voice-recording-pulse {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: var(--soft-shadow);
    }
    50% { 
        transform: scale(1.02); 
        box-shadow: var(--shadow);
    }
}

@keyframes voice-status-enter {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 响应式优化 */
@media (max-width: 768px) {
    .chat-input {
        gap: 0.5rem;
    }
    
    .chat-input .input-field {
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    .voice-settings-panel {
        flex-direction: column;
        gap: 1rem;
        padding: 0.75rem;
    }
    
    .voice-setting-toggle {
        justify-content: space-between;
        width: 100%;
        padding: 0.5rem 0;
    }
}

/* 语音模式容器 */
.voice-mode-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.voice-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

.voice-record-btn {
    min-width: 120px;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 25px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.voice-record-btn:hover {
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.voice-record-btn.recording {
    background: linear-gradient(145deg, #ef4444, #dc2626);
    color: white;
    animation: voice-pulse 1.5s ease-in-out infinite;
    box-shadow: 
        0 6px 20px rgba(239, 68, 68, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.voice-icon {
    font-size: 1.5rem;
}

.voice-text {
    font-size: 0.8rem;
}

.voice-interrupt-btn {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 20px;
    background: #ef4444;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.voice-interrupt-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.voice-status-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 20px;
    border: 2px solid var(--border-color);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    animation: voice-status-enter 0.3s ease-out;
}

.voice-status-display.hidden {
    display: none;
}

.voice-settings {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.voice-setting-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-color);
}

.voice-setting-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
}

/* 语音输出控制 */
.voice-output-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-left: auto;
}

.voice-output-btn {
    border: none;
    border-radius: 50%;
    background: var(--secondary-color);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    position: relative;
}

.voice-output-btn:hover {
    background: var(--pearl-color);
    transform: scale(1.1);
}

.voice-output-btn.active {
    background: #10b981;
    color: white;
}

.voice-output-btn.playing {
    animation: voice-playing 1s ease-in-out infinite;
}

@keyframes voice-playing {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* 语音输出设置模态框 */
.voice-settings-modal {
    max-width: 500px;
}

.voice-setting-group {
    margin-bottom: 1.5rem;
}

.voice-setting-group h4 {
    margin-bottom: 0.75rem;
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 600;
}

.voice-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.voice-setting-label {
    font-size: 0.9rem;
    color: var(--text-color);
    font-weight: 500;
}

.voice-range-input {
    width: 150px;
}

.voice-select {
    width: 200px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    font-size: 0.9rem;
}

.voice-test-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.voice-test-btn:hover {
    background: var(--primary-hover);
}


/* 响应式设计 */
@media (max-width: 768px) {
    .input-mode-toggle {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .mode-btn {
        padding: 1rem;
        font-size: 1rem;
    }
    
    .voice-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .voice-record-btn {
        min-width: 150px;
        padding: 1.5rem;
    }
    
    .voice-icon {
        font-size: 2rem;
    }
    
    .voice-text {
        font-size: 0.9rem;
    }
    
    .voice-settings {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .voice-setting-item {
        justify-content: space-between;
        padding: 0.5rem 0;
    }
    
    .voice-output-controls {
        justify-content: center;
        margin: 0;
        padding: 0.5rem 0;
    }
    
}

@media (max-width: 480px) {
    .voice-record-btn {
        min-width: 130px;
        padding: 1.25rem;
    }
    
    .voice-icon {
        font-size: 1.8rem;
    }
    
    .voice-text {
        font-size: 0.8rem;
    }
    
    .voice-settings {
        padding: 1rem;
    }
    
    .voice-setting-item {
        font-size: 0.85rem;
    }
}

/* 模式特定的聊天输入样式 */
.chat-input.text-mode {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.chat-input.voice-mode {
    display: block;
}

.chat-input.voice-mode .input-field,
.chat-input.voice-mode .btn:not(.mode-btn) {
    display: none;
}

/* 语音波形动画 */
@keyframes voice-wave-animate {
    0%, 100% { 
        height: 8px; 
        opacity: 0.7;
    }
    50% { 
        height: 24px; 
        opacity: 1;
    }
}

.voice-wave {
    width: 4px;
    height: 8px;
    background: linear-gradient(to top, var(--dark-color), #6b7280);
    border-radius: 2px;
    animation: voice-wave-animate 1.4s ease-in-out infinite;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.voice-wave:nth-child(2) {
    animation-delay: 0.2s;
}

.voice-wave:nth-child(3) {
    animation-delay: 0.4s;
}

/* 语音脉冲动画 */
@keyframes voice-pulse {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 
            0 6px 20px rgba(239, 68, 68, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
    50% { 
        transform: scale(1.05); 
        box-shadow: 
            0 8px 25px rgba(239, 68, 68, 0.6),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
}

/* 语音状态进入动画 */
@keyframes voice-status-enter {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}