:root {
    /* 主色调 - 清新科技蓝 */
    --primary: #4a89dc;  /* 明亮但不刺眼的蓝色 */
    --primary-dark: #3a70c2;
    
    /* 背景色 - 浅灰渐变 */
    --bg-dark: #f5f7fa;  /* 极浅灰 */
    --bg-darker: #e6e9ef; /* 稍深一点的浅灰 */
    --bg-light: #ffffff;  /* 纯白 */
    
    /* 文字色 - 高可读性深色 */
    --text-primary: #2d3748; /* 深灰蓝 */
    --text-secondary: #718096; /* 中灰 */
    
    /* 辅助色 - 清新活泼 */
    --accent: #8a63e6;  /* 柔和的紫色 */
    --success: #48bb78; /* 清新的绿色 */
    --warning: #ed8936; /* 温暖的橙色 */
    --error: #f56565;   /* 柔和的红色 */
    
    /* 代码块 - 浅色主题 */
    --code-bg: #f8fafc; /* 非常浅的灰 */
    
    /* 消息气泡 */
    --user-bubble: #ebf8ff; /* 浅蓝色气泡 */
    --assistant-bubble: #f7fafc; /* 浅灰色气泡 */
    
    /* 设计元素 */
    --border-radius: 12px;
    --shadow: 0 4px 6px -1px rgba(72, 137, 220, 0.1), 
              0 2px 4px -1px rgba(72, 137, 220, 0.06);
    
    /* 新增前卫元素 */
    --highlight: rgba(74, 137, 220, 0.15); /* 高亮效果 */
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); /* 流畅动画 */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-darker);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 0;
}

.app-container {
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    height: 100vh;
    padding: 0;
}

header {
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
    padding: 1rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.logo-icon {
    width: 28px;
    height: 28px;
    background: var(--primary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon svg {
    width: 16px;
    height: 16px;
    fill: white;
}

nav {
    display: flex;
    gap: 1rem;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-btn.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 280px;
    background: var(--bg-dark);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.chat-item {
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.chat-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.new-chat-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 6px;
    background: var(--primary);
    color: white;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.5rem;
}

.new-chat-btn:hover {
    background: var(--primary-dark);
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    scroll-behavior: smooth;
}

.message {
    display: flex;
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 600;
}

.user-message .message-avatar {
    background: var(--primary);
    color: white;
}

.message-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.message-name {
    font-weight: 600;
    font-size: 0.875rem;
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.message-text {
    line-height: 1.7;
    font-size: 0.9375rem;
}

.message-text p {
    margin-bottom: 1rem;
}

.message-text p:last-child {
    margin-bottom: 0;
}

.message-text a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.message-text a:hover {
    text-decoration: underline;
}

.message-text ul,
.message-text ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.message-text li {
    margin-bottom: 0.5rem;
}

.message-text blockquote {
    border-left: 3px solid var(--primary);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-secondary);
    font-style: italic;
}

.message-text pre {
    background: var(--code-bg);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    overflow-x: auto;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.message-text code {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.875rem;
}

.message-text pre code {
    background: none;
    padding: 0;
}

.token-usage {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.token-usage span {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

pre:hover .copy-btn {
    opacity: 1;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.5rem;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite both;
}

.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); opacity: 0.6; }
    30% { transform: translateY(-3px); opacity: 1; }
}

.input-container {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--bg-dark);
}

.input-area {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    position: relative;
}

#user-input {
    width: 100%;
    min-height: 60px;
    max-height: 200px;
    padding: 1rem 4.5rem 1rem 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--bg-light);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9375rem;
    line-height: 1.5;
    resize: none;
    outline: none;
    transition: all 0.2s;
    box-shadow: var(--shadow);
}

#user-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

#send-button {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#send-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

#send-button:disabled {
    background: var(--bg-light);
    color: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
}

.scroll-indicator {
    position: absolute;
    bottom: 100px;
    right: 2rem;
    width: 40px;
    height: 40px;
    background: var(--bg-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    box-shadow: var(--shadow);
    z-index: 10;
}

.scroll-indicator.visible {
    opacity: 1;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 240px;
        padding: 1rem;
    }

    .message {
        gap: 0.75rem;
    }

    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }
}

@media (max-width: 640px) {
    .sidebar {
        position: absolute;
        left: -100%;
        top: 0;
        bottom: 0;
        z-index: 20;
        transition: transform 0.3s;
    }

    .sidebar.open {
        transform: translateX(100%);
    }

    .mobile-menu-btn {
        display: flex;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message {
    animation: fadeIn 0.3s ease-out;
}

 /* 底部样式 */
 footer { 
    padding: 20px;
    text-align: center;
    margin-top: 50px;
  }