/* 聊天窗口样式 - 简约白色版本 */
.zsc-chat-window {
    position: fixed;
    z-index: 999998;
    bottom: 100px;
    left: 20px;
    width: 400px;
    height: 600px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
    display: none;
    border: 1px solid #e0e0e0;
}

.zsc-chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.zsc-chat-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.zsc-chat-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.zsc-close-button {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.zsc-close-button:hover {
    background-color: #e0e0e0;
}

/* 主要内容区域 - 固定布局 */
.zsc-chat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    min-height: 0; /* 关键：允许flex子元素收缩 */
}

.zsc-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #fff;
}

/* 自定义滚动条 */
.zsc-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.zsc-chat-messages::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 3px;
}

.zsc-chat-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.zsc-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Firefox滚动条 */
.zsc-chat-messages {
    scrollbar-width: thin;
    scrollbar-color: #ccc #f5f5f5;
}

.zsc-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
    font-size: 14px;
    animation: zsc-fadeIn 0.3s ease;
    word-break: break-word;
    overflow-wrap: break-word;
    position: relative;
}

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

.zsc-user-message {
    align-self: flex-end;
    background: #007bff;
    color: white;
    border-bottom-right-radius: 4px;
}

.zsc-ai-message {
    align-self: flex-start;
    background: #f0f2f5;
    color: #333;
    border-bottom-left-radius: 4px;
}

.zsc-message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 5px;
    text-align: right;
    display: block;
}

.zsc-ai-message .zsc-message-time {
    color: #666;
}

.zsc-user-message .zsc-message-time {
    color: rgba(255, 255, 255, 0.8);
}

/* 固定底部输入区域 */
.zsc-chat-input-area {
    padding: 15px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.zsc-chat-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    outline: none;
    font-size: 14px;
    background: white;
    transition: border-color 0.2s;
}

.zsc-chat-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.zsc-send-button {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
 
    height: 38px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.zsc-send-button:hover:not(:disabled) {
    background: #0056b3;
    transform: translateY(-1px);
}

.zsc-send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.zsc-typing-indicator {
    display: none;
    align-self: flex-start;
    background: #f0f2f5;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    color: #666;
    font-style: italic;
    margin: 0 20px 15px 20px;
    flex-shrink: 0;
}

.zsc-typing-dots {
    display: inline-block;
}

.zsc-typing-dots span {
    animation: zsc-typing 1.4s infinite;
    display: inline-block;
}

.zsc-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.zsc-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes zsc-typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-3px);
    }
}

/* 错误消息 */
.zsc-error-message {
    align-self: center;
    background: #f8d7da;
    color: #721c24;
    padding: 10px 15px;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
    font-size: 13px;
    text-align: center;
    margin: 10px 20px;
    flex-shrink: 0;
}

/* 空状态提示 */
.zsc-empty-message {
    text-align: center;
    color: #999;
    font-size: 14px;
    padding: 40px 20px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .zsc-chat-window {
        width: calc(100% - 40px) !important;
        height: 70vh !important;
        left: 20px !important;
        right: 20px !important;
        bottom: 80px !important;
        max-height: 70vh;
    }
    
    .zsc-chat-messages {
        padding: 15px;
    }
    
    .zsc-message {
        max-width: 90%;
    }
}

@media (max-height: 700px) {
    .zsc-chat-window {
        height: 500px !important;
    }
}