/* 为整个对话框添加样式重置和隔离 */
#ai-assistant-dialog {
    all: initial !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: #333 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    border-radius: 16px !important;
    overflow: hidden !important;
}

/* 重置对话框内所有元素的样式 */
#ai-assistant-dialog * {
    all: unset !important;
    box-sizing: border-box !important;
}

/* 恢复必要的默认样式 */
#ai-assistant-dialog .container {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    width: 100% !important;
    background-color: #f5f5f5 !important;
}

/* 输入框样式重置和设置 */
#ai-assistant-dialog textarea {
    display: block !important;
    width: 100% !important;
    padding: 8px 12px !important;
    border: 1px solid #E5E7EB !important;
    border-radius: 18px !important;
    resize: none !important;
    font-family: inherit !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    background: #F9FAFB !important;
    color: #333 !important;
    transition: border-color 0.2s ease !important;
}

#ai-assistant-dialog textarea:focus {
    border-color: #007AFF !important;
    outline: none !important;
    background: white !important;
}

/* 发送按钮完全重置和重新设置样式 */
#ai-assistant-dialog #askButton {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #007AFF !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 6px rgba(0, 122, 255, 0.2) !important;
    position: relative !important;
    flex-shrink: 0 !important;
    transform: translateZ(0) !important;
}

/* 发送按钮图标样式 */
#ai-assistant-dialog #askButton::before {
    content: "↑" !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    font-size: 20px !important;
    color: white !important;
    font-family: system-ui, -apple-system, sans-serif !important;
}

/* 发送按钮悬停效果 */
#ai-assistant-dialog #askButton:hover {
    background: #0056b3 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0, 122, 255, 0.3) !important;
}

/* 发送按钮按下效果 */
#ai-assistant-dialog #askButton:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 4px rgba(0, 122, 255, 0.2) !important;
}

/* 发送按钮禁用状态 */
#ai-assistant-dialog #askButton:disabled {
    background: #E0E0E0 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* 消息容器样式 */
#ai-assistant-dialog .messages {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    padding: 0 !important;
    overflow-y: auto !important;
    font-family: inherit !important;
}

/* 消息气泡样式 */
#ai-assistant-dialog .message {
    max-width: 85% !important;
    padding: 10px 14px !important;
    border-radius: 12px !important;
    font-family: inherit !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
}

/* 输入容器样式 */
#ai-assistant-dialog .input-container {
    display: flex !important;
    gap: 8px !important;
    padding: 12px !important;
    background-color: white !important;
    border-top: 1px solid #F3F4F6 !important;
    align-items: flex-end !important;
}

/* 自定义滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.header {
    display: none !important;
}

.toggle-ball {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-label {
    font-size: 14px;
    color: #666;
}

/* 开关样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

.switch .slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.switch input:checked+.slider {
    background-color: #007AFF;
}

.switch input:checked+.slider:before {
    transform: translateX(20px);
}