/* Chat Page Specific Styles */
.chat-container {
    display: flex;
    height: calc(100vh - 90px); /* 只减去顶部导航栏的高度 */
    width: 100%;
    margin: 0;
    padding: 0;
    background-color: #f9fafb;
    overflow: hidden;
}

/* Sidebar Styles */
.chat-sidebar {
    width: 240px;
    background-color: #f9f9f9;
    border-right: 1px solid #eaeaea;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: fixed;
    left: 0;
    top: 90px; /* 导航栏高度 */
    bottom: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    z-index: 90;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid #eaeaea;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
}

.sidebar-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.new-chat-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.new-chat-btn:hover {
    background-color: var(--primary-hover);
}

.conversation-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.conversation-item {
    padding: 10px 16px;
    margin: 2px 0;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    color: #666;
    font-size: 14px;
    border-left: 3px solid transparent;
}

.conversation-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.conversation-item.active {
    background-color: rgba(99, 102, 241, 0.1);
    border-left: 3px solid var(--primary-color);
    color: var(--primary-color);
}

.conversation-item svg {
    margin-right: 10px;
    width: 18px;
    height: 18px;
}

.conversation-time {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
    margin-left: 28px;
}

/* Main Chat Area */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: white;
    margin-left: 240px; /* 与侧边栏宽度一致 */
    width: calc(100% - 240px);
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.welcome-message {
    text-align: center;
    margin: auto 0;
    padding: 40px 0;
}

.welcome-message h2 {
    font-size: 24px;
    color: var(--dark-color);
    margin-bottom: 10px;
}

.welcome-message p {
    font-size: 16px;
    color: var(--gray-color);
}

.message {
    max-width: 80%;
    margin-bottom: 20px;
    padding: 12px 16px;
    border-radius: 10px;
    line-height: 1.5;
}

.user-message {
    align-self: flex-end;
    background-color: var(--primary-color);
    color: white;
    border-bottom-right-radius: 0;
}

.ai-message {
    align-self: flex-start;
    background-color: #f0f0f0;
    color: var(--dark-color);
    border-bottom-left-radius: 0;
}

/* 添加加载中状态样式 */
.message.loading {
    display: flex;
    align-items: center;
    color: #666;
}

.message.loading:after {
    content: "";
    width: 12px;
    height: 12px;
    margin-left: 10px;
    border: 2px solid #ddd;
    border-radius: 50%;
    border-top-color: #666;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Input Area */
.chat-input-container {
    padding: 15px 20px;
    background-color: white;
    position: relative; /* 添加相对定位 */
    border-top: none; /* 删除输入框上面的横行 */
}

.chat-input-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 8px 12px;
    background-color: white;
    width: 50%; /* 保持输入框宽度不变 */
    margin: 0 auto; /* 居中显示 */
    position: relative; /* 添加相对定位 */
}

.model-selector {
    width: 200px; /* 固定宽度 */
    position: absolute; /* 使用绝对定位 */
    left: calc(50% - 25%); /* 与输入框的左边精确对齐 */
    top: -35px; /* 将按钮移到输入框上方，稍微向下移动一点 */
    z-index: 10;
}

.model-btn {
    width: 100%;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #6366F1; /* 紫色背景 */
    color: white; /* 白色文字 */
}

.model-btn:after {
    content: '▼';
    font-size: 10px;
    margin-left: 8px;
}

.model-btn:hover {
    background-color: #5254cc; /* 深一点的紫色 */
}

.model-btn.active {
    background-color: #6366F1;
    color: white;
    border-color: #6366F1;
}

.chat-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px;
    font-size: 16px;
    resize: none;
    max-height: 480px; /* 增加最大高度为原来的4倍 */
    min-height: 96px; /* 增加最小高度为原来的4倍 */
    font-family: inherit;
}

.upload-btn, .send-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-color);
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.upload-btn:hover, .send-btn:hover {
    background-color: #f0f0f0;
    color: var(--primary-color);
}

.send-btn {
    color: var(--primary-color);
}

/* 添加模型下拉菜单样式 */
.model-dropdown {
    position: absolute;
    bottom: 100%; /* 将下拉菜单放在按钮上方 */
    left: 0;
    right: 0;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 5px; /* 调整间距 */
    z-index: 100;
    overflow: hidden;
    max-height: 300px;
    overflow-y: auto;
}

.model-group-title {
    padding: 8px 15px;
    font-weight: bold;
    background-color: #f5f5f5;
    color: #333;
    font-size: 13px;
    border-bottom: 1px solid #eee;
    border-top: 1px solid #eee;
}

.model-option {
    padding: 10px 15px;
    cursor: pointer;
    transition: var(--transition);
}

.model-option:hover {
    background-color: #f5f5f5;
}

.model-option.active {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .chat-container {
        flex-direction: column;
    }
    
    .chat-sidebar {
        width: 100%;
        position: static;
        height: auto;
        max-height: 200px;
    }
    
    .chat-main {
        margin-left: 0;
        width: 100%;
    }
}

/* 添加侧边栏分类标题样式 */
.sidebar-category {
    padding: 10px 16px;
    color: #888;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 10px;
}

/* 添加促销卡片样式 */
.promo-card {
    margin: 10px 16px;
    padding: 15px;
    background: linear-gradient(45deg, #ff7e5f, #feb47b);
    border-radius: 8px;
    color: white;
    text-align: center;
}

.promo-card .discount {
    font-size: 24px;
    font-weight: bold;
    margin: 5px 0;
}

.promo-card .cta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 5px;
}

/* 添加底部状态栏样式 */
.sidebar-footer {
    padding: 10px;
    border-top: 1px solid #eaeaea;
    display: flex;
    justify-content: space-between;
    background-color: #fff;
}

.sidebar-footer .status {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #888;
}

.sidebar-footer .status-icon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10b981;
    margin-right: 5px;
}

.sidebar-footer .actions {
    display: flex;
    gap: 10px;
}

.sidebar-footer .action-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.sidebar-footer .action-btn:hover {
    background-color: #f0f0f0;
} 