/* 聊天区域样式 */
.chat-section {
    padding: 2rem;
    height: calc(100vh - 160px); /* 减去导航栏和页脚的高度 */
    display: flex;
    justify-content: center;
}

.chat-container {
    width: 100%;
    max-width: 800px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    padding: 1.5rem;
    background: var(--primary-blue);
    color: var(--white);
    text-align: center;
    position: relative;
}

.chat-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.chat-header p {
    margin: 0.5rem 0 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

.clear-button {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.clear-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--light-gray);
}

.message {
    display: flex;
    margin-bottom: 1rem;
}

.message.user {
    justify-content: flex-end;
}

.message.system {
    justify-content: flex-start;
}

.message-content {
    max-width: 70%;
    padding: 1rem;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message.user .message-content {
    background: var(--primary-blue);
    color: var(--white);
    border-radius: 12px 12px 0 12px;
}

.message.system .message-content {
    background: var(--white);
    color: var(--primary-blue);
    border-radius: 12px 12px 12px 0;
}

.chat-input-container {
    padding: 1.5rem;
    background: var(--white);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.input-wrapper {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

#messageInput {
    flex: 1;
    padding: 0.8rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 0.95rem;
    resize: none;
    max-height: 150px;
    min-height: 20px;
    line-height: 1.5;
    background: var(--light-gray);
}

#messageInput:focus {
    outline: none;
    border-color: var(--primary-blue);
    background: var(--white);
}

.send-button {
    padding: 0.8rem 1.5rem;
    background: var(--primary-blue);
    color: var(--white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.send-button:hover {
    background: var(--secondary-blue);
}

.send-button:disabled {
    background: var(--gray);
    cursor: not-allowed;
}

.typing-indicator {
    margin-top: 0.5rem;
    color: var(--gray);
    font-size: 0.9rem;
    text-align: center;
}

/* 滚动条样式 */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--light-gray);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--gray);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--primary-blue);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .chat-section {
        padding: 1rem;
        height: calc(100vh - 140px);
    }

    .message-content {
        max-width: 85%;
    }

    .chat-header h1 {
        font-size: 1.2rem;
    }

    .chat-header p {
        font-size: 0.8rem;
    }

    .clear-button {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
} 