* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #f9f5ea;
    display: flex;
    justify-content: center;
    padding: 0;
    margin: 0;
    height: 100vh;
    background-image: linear-gradient(to bottom, #f9f5ea, #f5ecd8);
}

/* 应用容器 */
.app-container {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* 侧边栏样式 */
.sidebar {
    width: 250px;
    background-color: #8e3e1f;
    color: #fff;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #7a331a;
    transition: width 0.3s;
}

.sidebar-header {
    padding: 15px;
    border-bottom: 1px solid #7a331a;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-header h2 {
    font-size: 1.2rem;
    margin-bottom: 5px;
    font-family: 'SimSun', serif;
}

.new-chat-btn {
    background-color: #f7eed9;
    color: #8e3e1f;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: background-color 0.2s;
}

.new-chat-btn:hover {
    background-color: #e7d7c6;
}

.conversation-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.conversation-item {
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
}

.conversation-item:hover {
    background-color: #70301a;
}

.conversation-item.active {
    background-color: #70301a;
    border-left: 3px solid #f7eed9;
}

.conversation-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    font-size: 0.9rem;
}

.conversation-delete {
    opacity: 0;
    transition: opacity 0.2s;
    color: #ffcdd2;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 5px;
}

.conversation-item:hover .conversation-delete {
    opacity: 1;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.container {
    max-width: 1200px;
    width: 100%;
}

.header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.logo {
    height: 60px;
    margin-right: 15px;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #8e3e1f;
    font-family: 'SimSun', serif;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.chat-container {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(142, 62, 31, 0.1);
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid #e7d7c6;
}

.chat-messages {
    padding: 20px;
    height: 70vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background-color: #fffdf7;
}

.message {
    margin-bottom: 15px;
    padding: 12px 18px;
    border-radius: 18px;
    max-width: 85%;
    line-height: 1.6;
}

.user-message {
    background-color: #e7f0e4;
    align-self: flex-end;
    margin-left: auto;
    border: 1px solid #c3dab9;
}

.ai-message {
    background-color: #8e3e1f;
    align-self: flex-start;
    border: 1px solid #7a331a;
    color: #fff;
}

.thinking-message {
    background-color: #ffebeb;
    border-left: 3px solid #d32f2f;
    font-style: italic;
    color: #c62828;
    border: 1px solid #ffcdd2;
    font-size: 0.9em;
}

.thinking-content {
    display: none;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(214, 48, 49, 0.3);
    font-size: 0.9em;
}

.thinking-message.expanded .thinking-content {
    display: block;
}

.toggle-thinking {
    margin-left: 8px;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(214, 48, 49, 0.5);
    color: #c62828;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    transition: all 0.2s;
}

.toggle-thinking:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

.thinking-message.expanded .toggle-thinking .fa-chevron-down {
    transform: rotate(180deg);
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(-5px);
    }
    50% {
        transform: translateY(0);
    }
    75% {
        transform: translateY(5px);
    }
}

.thinking-prefix {
    color: #ff0000;
    font-weight: bold;
    font-style: normal;
    display: inline-block;
    padding: 2px 8px;
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    animation: bounce 1.5s ease-in-out infinite;
    margin-right: 6px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

/* Markdown 样式 */
.message h1, 
.message h2, 
.message h3 {
    margin-top: 10px;
    margin-bottom: 8px;
    font-weight: bold;
    color: inherit;
}

.message h1 {
    font-size: 1.5em;
}

.message h2 {
    font-size: 1.3em;
}

.message h3 {
    font-size: 1.1em;
}

.message ul, 
.message ol {
    margin-left: 20px;
    margin-bottom: 10px;
}

.message li {
    margin-bottom: 5px;
}

.message code {
    font-family: monospace;
    background-color: rgba(0, 0, 0, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 0.9em;
}

.message pre {
    background-color: rgba(0, 0, 0, 0.1);
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 10px 0;
}

.message pre code {
    background-color: transparent;
    padding: 0;
}

.message a {
    color: #1e88e5;
    text-decoration: underline;
}

.message a:hover {
    text-decoration: none;
}

.message strong {
    font-weight: bold;
}

.message em {
    font-style: italic;
}

.thinking-message code,
.thinking-message pre,
.thinking-message pre code {
    background-color: rgba(255, 255, 255, 0.3);
}

.thinking-message a {
    color: #d32f2f;
}

.input-area {
    display: flex;
    padding: 15px;
    border-top: 1px solid #e7d7c6;
    background-color: #fffdf7;
}

#user-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #e7d7c6;
    border-radius: 5px;
    resize: none;
    height: 65px;
    outline: none;
    background-color: #fffdfa;
    font-size: 14px;
}

#send-btn {
    margin-left: 10px;
    padding: 0 25px;
    background-color: #8e3e1f;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-family: 'SimSun', serif;
    font-size: 16px;
}

#send-btn:hover {
    background-color: #70301a;
}

.info {
    background-color: #f7eed9;
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
    font-size: 14px;
    color: #5d4b35;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border: 1px solid #e7d7c6;
}

.info p {
    margin-bottom: 8px;
}

.info p:last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        max-height: 200px;
        overflow-y: auto;
    }

    .main-content {
        padding: 10px;
    }

    .chat-messages {
        height: 55vh;
    }
    
    .message {
        max-width: 90%;
    }
    
    .logo {
        height: 40px;
        margin-bottom: 10px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .chat-container-wrapper {
        flex-direction: column;
    }
    
    .common-questions-sidebar {
        width: 100%;
        order: -1; /* 在移动设备上将推荐问题放在上方 */
    }
    
    .common-questions-sidebar .question-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .common-questions-sidebar .question-btn {
        font-size: 13px;
        padding: 6px 8px;
        padding-right: 20px;
    }
}

/* 删除旧的常用问题区域样式，保留新的侧边栏样式 */

/* 聊天区域包装器 */
.chat-container-wrapper {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.chat-main {
    flex: 1;
    min-width: 0; /* 确保flex项目可以收缩到小于其内容大小 */
}

/* 常用问题侧边栏样式 */
.common-questions-sidebar {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(142, 62, 31, 0.1);
    padding: 15px;
    border: 1px solid #e7d7c6;
}

.common-questions-sidebar h3 {
    margin: 0 0 15px 0;
    color: #8e3e1f;
    font-size: 16px;
    text-align: center;
    font-weight: bold;
    border-bottom: 1px dashed #d3c0a8;
    padding-bottom: 8px;
}

.common-questions-sidebar .question-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.common-questions-sidebar .question-btn {
    background-color: #f0e6d2;
    color: #6b4226;
    border: 1px solid #d3c0a8;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
    padding-right: 25px;
}

.common-questions-sidebar .question-btn:hover {
    background-color: #e6d7ba;
    transform: translateX(3px);
    box-shadow: 0 2px 5px rgba(107, 66, 38, 0.2);
}

.common-questions-sidebar .question-btn::after {
    content: '\f105';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #8e3e1f;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.common-questions-sidebar .question-btn:hover::after {
    right: 8px;
    opacity: 1;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .chat-container-wrapper {
        flex-direction: column;
    }
    
    .common-questions-sidebar {
        width: 100%;
        order: -1; /* 在移动设备上将推荐问题放在上方 */
    }
    
    .common-questions-sidebar .question-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
}

/* 定制智能体按钮 */
.customize-btn, .my-agents-btn {
    background-color: #f7eed9;
    color: #8e3e1f;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 10px;
    text-decoration: none;
    transition: background-color 0.2s;
}

.customize-btn:hover, .my-agents-btn:hover {
    background-color: #e7d7c6;
}

/* 查看全部智能体链接 */
.view-all-agents {
    font-size: 0.8em;
    color: #8e3e1f;
    margin-left: 8px;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.view-all-agents:hover {
    opacity: 1;
}

/* 右侧边栏容器 */
.right-sidebar {
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 定制智能体侧边栏 */
.custom-agents-sidebar {
    background-color: #fcf7ee;
    border-radius: 10px;
    padding: 15px;
    border: 1px solid #e7d7c6;
    box-shadow: 0 2px 8px rgba(142, 62, 31, 0.1);
    margin-bottom: 20px;
}

.custom-agents-sidebar h3 {
    color: #6b4226;
    font-size: 1.1rem;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.custom-agents-sidebar .add-agent-link {
    color: #8e3e1f;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.custom-agents-sidebar .add-agent-link:hover {
    transform: scale(1.1);
}

.agents-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.empty-agents-msg {
    color: #6b4226;
    font-size: 0.9rem;
    opacity: 0.8;
    text-align: center;
    padding: 15px 0;
}

/* 智能体引导消息 */
.guidance-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    text-align: center;
    color: #6b4226;
}

.guidance-message p {
    margin: 5px 0;
    font-size: 0.9rem;
}

.view-agents-btn {
    margin-top: 12px;
    background-color: #8e3e1f;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.view-agents-btn:hover {
    background-color: #6b2d16;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(142, 62, 31, 0.25);
}

/* 智能体卡片 */
.agent-card {
    background-color: #f9f5ea;
    border: 1px solid #e7d7c6;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.agent-card:hover {
    background-color: #f0e9d9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(142, 62, 31, 0.1);
}

.agent-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.agent-card-name {
    font-weight: bold;
    color: #8e3e1f;
}

.agent-card-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.agent-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.agent-card-tag {
    background-color: #8e3e1f;
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 10px;
}

/* 智能体对话模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: #fff;
    border-radius: 10px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 15px;
    background-color: #8e3e1f;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: white;
}

.close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    max-height: 60vh;
}

.preview-chat {
    flex: 1;
    overflow-y: auto;
    background-color: #fffdf7;
    border: 1px solid #e7d7c6;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    min-height: 300px;
}

.preview-input {
    display: flex;
    gap: 10px;
}

.preview-input input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.preview-input button {
    padding: 10px 15px;
    background-color: #8e3e1f;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* 媒体查询更新 */
@media (max-width: 768px) {
    .right-sidebar {
        width: 100%;
    }
    
    .chat-container-wrapper {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
        height: 90vh;
        max-height: 90vh;
    }
} 