#chatPanelContainer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 460px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#chatPanelContainer.hidden {
    display: none;
}

#chatToggle {
    display: none;
}

.chat-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    background: #4a5568;
    color: white;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: bold;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px 15px;
    background: #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-input-area {
    border-top: 1px solid #e2e8f0;
    padding: 10px;
    background: white;
}

.chat-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-input-row input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    outline: none;
}

.send-btn {
    width: auto;
    padding: 8px 16px;
    border-radius: 20px;
    background: #667eea;
    color: white;
    border: none;
    cursor: pointer;
}

.image-upload-btn {
    color: #667eea;
    font-size: 1.3rem;
    cursor: pointer;
}

/* 消息气泡 */
.message-row {
    display: flex;
    margin-bottom: 8px;
}
.message-row.mine { justify-content: flex-end; }
.message-row.others { justify-content: flex-start; }

.bubble-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    max-width: 100%;
    position: relative;
}
.bubble-wrapper.mine { flex-direction: row-reverse; }
.bubble-wrapper.others { flex-direction: row; }

.avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: bold; font-size: 14px;
    flex-shrink: 0;
}

.bubble {
    background: white; padding: 8px 12px;
    border-radius: 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    word-break: break-word;
}
.bubble-wrapper.mine .bubble { background: #667eea; color: white; }

.chat-image {
    max-width: 200px;
    border-radius: 8px;
    cursor: pointer;
}

.message-time {
    font-size: 0.7rem;
    color: #888;
    white-space: nowrap;
    padding-bottom: 4px;
    display: block;
}
.bubble-wrapper.mine .bubble .message-time { color: #ccc; }
.bubble-wrapper.others .bubble .message-time { color: #888; }
