/* 窗口模式样式 */
body {
    background-color: #e5e7eb;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 800px;
    height: 100%;
    max-height: 600px;
}

/* 聊天窗口样式 */
#chat-container {
    width: 100%;
    height: 100%;
    min-height: 400px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid #d1d5db;
}

/* 确保消息容器占据足够空间 */
#message-container {
    flex: 1;
    overflow-y: auto;
}

/* 输入区域样式 */
#user-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
}

#send-btn {
    padding: 12px 24px;
    font-size: 16px;
}

/* 聊天消息样式 */
.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    word-break: break-word;
}

.user-message {
    background-color: #3b82f6;
    color: white;
    margin-left: auto;
    border-top-right-radius: 4px;
}

.ai-message {
    background-color: #f3f4f6;
    color: #1f2937;
    margin-right: auto;
    border-top-left-radius: 4px;
}

/* 消息容器滚动条样式 */
#message-container::-webkit-scrollbar {
    width: 8px;
}

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

#message-container::-webkit-scrollbar-thumb {
    background: #c5c5c5;
    border-radius: 4px;
}

#message-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 加载动画 */
.loading-indicator {
    display: flex;
    gap: 5px;
    padding: 10px 15px;
}

.loading-indicator span {
    width: 8px;
    height: 8px;
    background-color: #3b82f6;
    border-radius: 50%;
    animation: pulse 1.4s infinite ease-in-out both;
}

.loading-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes pulse {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* 响应式调整 */
/* 大屏幕 (桌面) */
@media (min-width: 768px) {
    .container {
        max-width: 800px;
        max-height: 700px;
    }
}

/* 中等屏幕 (平板) */
@media (max-width: 767px) and (min-width: 481px) {
    .container {
        max-width: 90%;
        max-height: 600px;
    }
    .message {
        max-width: 85%;
    }
}

/* 小屏幕 (手机) */
@media (max-width: 480px) {
    body {
        padding: 10px;
        align-items: flex-start;
    }
    .container {
        width: 100%;
        max-height: calc(100vh - 20px);
    }
    .message {
        max-width: 90%;
        padding: 8px 12px;
    }
    #user-input {
        padding: 10px;
    }
    #send-btn {
        padding: 10px 16px;
    }
    h1 {
        font-size: 1.5rem;
    }
}

/* 错误提示样式 */
.error-message {
    color: #ef4444;
    text-align: center;
    padding: 10px;
    background-color: #fee2e2;
    border-radius: 8px;
    margin: 10px auto;
    max-width: 80%;
}

/* 系统消息样式 */
.system-message {
    color: #6b7280;
    text-align: center;
    padding: 5px;
    font-size: 0.875rem;
    margin: 5px auto;
    max-width: 60%;
}