body {
    /* background: #000000; */
    background: #ffffff;
    font-family: 'Arial', sans-serif;
    font-size: 14px;
}

/*头部----------------------------*/
.navbar {
    position: fixed;
    overflow: hidden;
    top: 0;
    align-items: center;
    justify-content: space-around;
    width: 100%;
    background-color: #ffffff;
    font-size: 12px;
    color: #666;
    z-index: 10000;
    border: 0px solid #1db93f;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/*中部----------------------------*/
.container {
    width: 100%;
    margin: 0 auto;
    height: calc(100vh - 120px);
    /* 减去导航栏和底部高度 */
    padding-top: 60px;
    /* 为顶部导航留出空间 */
    border: 0px solid #bd6161;
}

.chat-container {
    max-width: 990px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    /* background: linear-gradient(to bottom, rgba(247, 248, 248, 0.8), rgba(5, 175, 241, 0.8)); */
}

.chat-messages {
    flex: 1;
    height: calc(100vh - 250px);
    /* 计算可用高度 */
    padding: 20px;
    /* background: #f0f2f5; */
    border-radius: 10px;
    margin-bottom: 20px;
    overflow-y: auto;
    margin-bottom: 500px;
    /* 为底部输入框留出空间 */
}

/* 历史记录列表样式 */
.history-sidebar {
    position: fixed;
    left: -280px; /* 初始位置在屏幕外 */
    top: 60px;
    bottom: 0; /* 修改为0，延伸到底部 */
    width: 280px;
    background: #fff;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
    padding: 15px;
    padding-bottom: 150px; /* 添加底部padding，避免被底部工具栏遮挡 */
    z-index: 1000;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
    transition: left 0.3s ease; /* 添加过渡动画 */
}

.history-sidebar.active {
    left: 0; /* 显示时的位置 */
}

.history-group {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    position: relative;
}

.history-group:hover {
    background-color: #f5f5f5;
    border-color: #e3e3e3;
    transform: translateX(2px);
}

.history-group.active {
    background-color: #e3f2fd;
    border-color: #90caf9;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.history-group .delete-btn {
    position: absolute;
    right: 8px;
    top: 8px;
    opacity: 0;
    transition: opacity 0.2s;
    color: #dc3545;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.9);
}

.history-group:hover .delete-btn {
    opacity: 1;
}

.history-group .delete-btn:hover {
    background: #dc3545;
    color: #fff;
}

.history-group-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.history-group-preview {
    font-size: 13px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 加载状态样式 */
.history-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.history-loading i {
    margin-right: 5px;
}

/* 移动端切换按钮 */
.history-toggle {
    display: block;
    position: fixed;
    left: 10px;
    top: 60px;
    z-index: 10001;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* 调整主聊天区域的位置 */
.chat-container {
    margin-bottom: 150px;
}

/* 响应式布局 */
@media (max-width: 768px) {
    .history-toggle {
        display: block;
    }

    .history-sidebar {
        transform: translateX(0);
        transition: left 0.3s ease;
    }

    .history-sidebar.active {
        left: 0;
    }

    .chat-container {
        margin-left: 0;
    }
}

/*底部---------------------------*/
.foot {
    position: fixed;
    bottom: 0px;
    width: 100%;
    height: auto;
    /* background-color: #f0f2f5; */
    text-align: center;
    font-size: 12px;
    color: #363636;
    border: 0px solid #1db93f;
    z-index: 10000;
}

.example-questions {
    max-width: 990px;
    margin: 0 auto;
    padding: 10px;
    background: #fff;
    border-radius: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding-bottom: 0px;
    gap: 5px;
}

.example-span {
    display: inline-flex;
    align-items: center;
    background: #f0f2f5;
    border-radius: 5px;
    padding: 2px 5px;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 12px;
    gap: 5px; 
    color:#707172;
}

.example-span:hover {
    background: #586475;
    color: #ffffff;
}

.divs {
    max-width: 990px;
    display: inline-flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 12px;
    background: #ffffff;
    gap: 40px;
    width: 100%;
}

/* 新话题*/
#new-topic {
    font-size: 12px;
    padding: 5px 20px;
    border: 1px solid #1a73e8;
    transition: all 0.3s;
    border-radius: 10px;
    margin-left: 10px;
}

#new-topic:hover {
    background-color: #1aaee8;
    color: white;
}

.input-container {
    max-width: 990px;
    margin: 0 auto;
    display: flex;
    background: white;
    padding: 10px;
    padding-top: 0px;
    gap: 10px;
}

#message-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #3190df;
    border-radius: 5px;
    resize: none;
}

#send-button {
    font-size: 0.86rem;
    padding: 12px 30px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#send-button:hover {
    background: #0056b3;
}

.model-selector {
    padding: 10px;
    border-top: 0px solid #eee;
}

.model-selector select {
    max-width: 300px;
    font-size: 12px;
    border-color: #f0f2f5;
    float: right;
}

.model-selector select:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 0.2rem rgba(26, 115, 232, 0.25);
}

.model-selector select option {
    height: 50px;
    line-height: 50px;
}

/* -------------------- */
.message {
    margin-bottom: 25px;
    display: flex;
    align-items: flex-start;
    animation: fadeIn 0.3s ease-in;
}

.message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    margin-right: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.message-content {
    background: #ffffff;
    padding: 15px;
    border-radius: 15px;
    max-width: 85%;
    color: #2c2c2c;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    word-wrap: break-word;
    line-height: 2.0;
    position: relative;
    padding-right: 35px;
    font-size: 16px;
    border: 1px solid #f0f0f0;
}

/* AI消息特殊样式 */
.ai-message .message-content {
    background: #f8f9fa;
    border-top-left-radius: 2px;
    border-left: 3px solid #1a73e8;
}

/* 用户消息样式 */
.user-message .message-content {
    background: #1a73e8;
    color: #ffffff;
    border-top-right-radius: 2px;
    border: none;
}

/* 添加消息出现动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 代码块样式优化 */
.message-content pre {
    background: #282c34;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 10px 0;
}

.message-content code {
    font-family: 'Consolas', monospace;
    color: #abb2bf;
}

/* 复制按钮样式优化 */
.message-content .copy-message {
    position: absolute;
    right: 10px;
    top: 10px;
    opacity: 0;
    transition: all 0.3s ease;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.message-content:hover .copy-message {
    opacity: 0.7;
}

.message-content .copy-message:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.05);
}

.loading-dots {
    display: inline-block;
    position: relative;
    width: 30px;
    /* 为动画预留空间 */
    height: 20px;
    margin-left: 5px;
}

.loading-dots::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 4px;
    width: 4px;
    background-color: #666;
    border-radius: 50%;
    animation: dotMove 1.5s infinite ease-in-out;
}

@keyframes dotMove {

    0%,
    100% {
        box-shadow: 0 0 0 #666, 0 0 0 #666;
        left: 0;
    }

    35% {
        box-shadow: 8px 0 0 #666, 16px 0 0 #666;
        left: 4px;
    }

    70% {
        box-shadow: 8px 0 0 #666, 16px 0 0 #666;
        left: 8px;
    }
}

.loading-message .message-content {
    background: #1c1c1c;
    /* 更改为深色背景 */
    color: #999;
}

.copy-icon {
    margin-left: 5px;
    color: #666;
    cursor: pointer;
}

.copy-icon:hover {
    color: #1a73e8;
}

/* 添加提示框样式 */
.copy-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.copy-tooltip.show {
    opacity: 1;
}

/* 添加日期分隔线样式 */
.date-separator {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.date-separator::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: #e0e0e0;
}

.date-text {
    background: #f0f2f5;
    padding: 0 15px;
    color: #666;
    font-size: 12px;
    position: relative;
    display: inline-block;
}

.welcome-message {
    padding: 20px;
    text-align: center;
}

.suggested-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.topic {
    background: #f0f2f5;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    color: #1a73e8;
    transition: all 0.3s ease;
}

.topic:hover {
    background: #e4e6e9;
    transform: translateY(-1px);
}

/* 滚动按钮的通用样式 */
.scroll-btn {
    color: #1a73e8;
    opacity: 0.7;
    transition: all 0.3s;
}

.scroll-btn:hover {
    opacity: 1;
    transform: translateY(-2px);
}

/* 导航栏中的滚动到底部按钮 */
#scroll-bottom {
    font-size: 16px;
    color: #1a73e8;
}

/* 修改右下角回到顶部按钮样式 */
.scroll-top-btn {
    position: fixed;
    right: 20px;
    bottom: 20px;
    padding: 8px 16px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 10000;
    font-size: 14px;
    color: #1a73e8;
}

.scroll-top-btn.show {
    opacity: 1;
    visibility: visible;
}

.scroll-top-btn i {
    font-size: 14px;
}

.scroll-top-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    background: #1a73e8;
    color: white;
}

.scroll-top-btn:hover i {
    color: white;
}