
:root {
    --primary: #4361ee;
    --primary-light: #4895ef;
    --primary-dark: #3a56d4;
    --secondary: #3f37c9;
    --accent: #f72585;
    --light: #f8f9fa;
    --dark: #2c3e50;
    --gray: #7f8c8d;
    --gray-light: #e9ecef;
    --success: #4cc9f0;
    --warning: #f8961e;
    --error: #ef233c;
    --sidebar-primary: #4f46e5;
    --content-card-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.chat-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: rgba(255, 255, 255, 0.95);
    font-family: 'Segoe UI', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--dark);
}

.content-wrapper {
    padding: 30px;
    background: white;
    border-radius: 16px;
    box-shadow: var(--content-card-shadow);
    height: 100%;
    box-sizing: border-box;
}

.page-header {
    margin-bottom: 20px;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.chat-controls {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    width: auto;
}

.chat-controls button {
    background: var(--primary);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-controls button:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.chat-controls .menu-toggle-btn {
    background: var(--sidebar-primary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: auto;
    text-align: left;
    font-weight: 500;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--gray-light);
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--gray-light);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 10px;
}

.message {
    max-width: 85%;
    padding: 15px 20px;
    border-radius: 18px;
    line-height: 1.6;
    position: relative;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-message {
    align-self: flex-end;
    background-color: var(--primary);
    color: white;
    border-bottom-right-radius: 5px;
}

.ai-message {
    align-self: flex-start;
    background-color: white;
    color: var(--dark);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-bottom-left-radius: 5px;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-weight: 600;
}

.message-header i {
    font-size: 1.2rem;
}

.message-content {
    word-wrap: break-word;
    white-space: pre-wrap;
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 8px;
    text-align: right;
}

.input-container {
    padding: 20px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-light);
    display: flex;
    gap: 10px;
    max-width: 600px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    transition: all 0.3s ease;
    z-index: 100;
}

.input-container.centered {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin-top: 0;
}

.input-container.bottom {
    position: static;
    margin-top: 15px;
    margin-bottom: 15px;
}

.message-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    font-size: 1rem;
    resize: none;
    min-height: 40px;
    outline: none;
    transition: all 0.3s ease;
}

.message-input:focus {
    border-color: var(--primary); /* 高亮边框 */
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.3); /* 添加高亮阴影 */
    background-color: rgba(67, 97, 238, 0.05); /* 轻微高亮背景 */
}

.send-button {
    background-color: var(--primary);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.send-button:hover {
    background-color: var(--primary-dark);
    transform: scale(1.05);
}

.send-button:disabled {
    background-color: var(--gray);
    cursor: not-allowed;
    transform: none;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 15px;
    background-color: white;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    align-self: flex-start;
    margin-bottom: 10px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background-color: var(--gray);
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: 0s;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingAnimation {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

.code-container {
    position: relative;
    margin: 10px 0;
    border-radius: 8px;
    overflow: hidden;
}

.code-header {
    background-color: var(--dark);
    color: white;
    padding: 5px 10px;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.copy-button {
    background: var(--primary);
    border: none;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.3s ease;
}

.copy-button:hover {
    background: var(--primary-dark);
}

.copy-button.copied {
    background: var(--success);
}

.mermaid {
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 10px 0;
}

.example-content {
    margin-top: 0;
    padding: 0;
    background-color: transparent;
    border-radius: 0;
    line-height: 1.2;
    white-space: normal;
}

.example-content h6 {
    margin-bottom: 2px;
    font-weight: 600;
    color: var(--dark);
}

.example-content ul {
    padding-left: 15px;
    margin: 0;
}

.example-content li {
    margin-bottom: 0;
    color: var(--dark);
}