.ai-chat-container {
    max-width: 80%;
    margin: 20px auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 600px;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: #f5f5f5;
}

.ai-chat-message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.ai-chat-message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.ai-chat-message-name {
    font-weight: bold;
}

.ai-chat-message-time {
    color: #888;
}

.ai-chat-message-content {
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 80%;
    word-wrap: break-word;
}

.ai-chat-message.user {
    align-items: flex-start;
}

.ai-chat-message.ai {
    align-items: flex-start;
}

.ai-chat-message.user .ai-chat-message-content {
    background-color: #dcf8c6;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 18px;
}

.ai-chat-message.ai .ai-chat-message-content {
    background-color: #fff;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.ai-chat-input-container {
    padding: 15px;
    background-color: #fff;
    border-top: 1px solid #ddd;
}

.ai-chat-input-container textarea {
    width: 100%;
    min-height: 60px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    margin-bottom: 10px;
}

.ai-chat-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: nowrap;
}

.ai-chat-button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
    min-width: 60px;
}

#ai-chat-send {
    background-color: #007bff;
    color: white;
}

#ai-chat-send:hover {
    background-color: #0056b3;
}

#ai-chat-new {
    background-color: #6c757d;
    color: white;
}

#ai-chat-new:hover {
    background-color: #545b62;
}

#ai-chat-fullscreen {
    background-color: #28a745;
    color: white;
}

#ai-chat-fullscreen:hover {
    background-color: #218838;
}

.ai-chat-thinking {
    font-style: italic;
    color: #666;
    padding: 10px 0;
}

.ai-chat-timer {
    margin-left: 5px;
    font-size: 0.8em;
    color: #888;
}

/* 全屏模式样式 */
.ai-chat-fullscreen-mode {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    z-index: 9999 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border: none !important;
}

/* 预设模板下拉按钮样式 */
.ai-chat-template-dropdown {
    position: relative;
    display: inline-block;
    margin-right: 10px;
}

#ai-chat-template {
    background-color: #17a2b8;
    color: white;
}

#ai-chat-template:hover {
    background-color: #138496;
}

.ai-chat-template-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 100;
    border-radius: 4px;
    max-height: 300px;
    overflow-y: auto;
    bottom: 100%;
    left: 0;
    margin-bottom: 5px;
}

.ai-chat-template-content button {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background-color: transparent;
    cursor: pointer;
}

.ai-chat-template-content button:hover {
    background-color: #f1f1f1;
}

.ai-chat-template-content.show {
    display: block !important;
}

/* 添加滚动条样式 */
.ai-chat-template-content::-webkit-scrollbar {
    width: 6px;
}

.ai-chat-template-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.ai-chat-template-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.ai-chat-template-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .ai-chat-container {
        margin: 10px;
        height: calc(100vh - 20px);
    }
    
    .ai-chat-message-content {
        max-width: 90%;
    }
    
    .ai-chat-buttons {
        flex-direction: column;
    }
    
    .ai-chat-button {
        width: 100%;
    }
}

/* 代码块样式 */
.ai-chat-message-content pre {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
}

.ai-chat-message-content code {
    font-family: monospace;
    font-size: 0.9em;
}

.ai-chat-timer {
    margin-left: 5px;
    font-size: 0.8em;
    color: #ff0000;
    font-weight: bold;
}

.ai-chat-replied {
    margin-left: 5px;
    font-size: 0.8em;
    color: #28a745;
}
/* 历史记录按钮样式 */
#ai-chat-history {
    background-color: #6c757d;
    color: white;
}

#ai-chat-history:hover {
    background-color: #5a6268;
}

#ai-chat-history:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}
/* 加载提示样式 */
.ai-chat-loading {
    text-align: center;
    padding: 10px;
    margin: 10px 0;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.ai-chat-loading-text {
    color: #6c757d;
    font-style: italic;
}


/* 加载动画 */
.thinking-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80% { content: '...'; }
}