/* 基础变量定义 */
:root {
    --theme-primary: #27C6D9;  /* 主题蓝色 */
    --theme-white: #FFFFFF;
    --theme-border-radius: 15px;
    --theme-font-size: 14px;
    --theme-shadow: 0 2px 10px rgba(39, 198, 217, 0.1);
}
@keyframes rotate {
    0% {transform: rotateZ(30deg);}
    16% {transform: rotateZ(60deg);}
    24% {transform: rotateZ(90deg);}
    32% {transform: rotateZ(120deg);}
    40% {transform: rotateZ(150deg);}
    48% {transform: rotateZ(180deg);}
    56% {transform: rotateZ(210deg);}
    64% {transform: rotateZ(240deg);}
    72% {transform: rotateZ(270deg);}
    80% {transform: rotateZ(300deg);}
    88% {transform: rotateZ(330deg);}
    100% {transform: rotateZ(360deg);}
  }

  .am-rotate,[am-rotate] {
    animation: rotate 0.9s infinite;
  }
/* AI 对话 */
.ai-chat-container {
    max-width: calc(100% - 2*var(--mole-box-width));
    margin: 30px auto;
    position: absolute;
    bottom: 1%;
    left: 50%;
    transform: translate(-50%);
    /* width: 50%; */
    z-index: 1001;
    transition: all 0.5s ease-in-out;
    #ai-position{
        display: none;
        height: 40vh;
        position: absolute;
        top: -40vh;
        right: 0;
        z-index: 10000;
    }
    #ai-chat {
        width: 100%;
    }
}

.chat-container {
    padding: 10px 15px;
    border-radius: 8px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 输入区域整体样式 */
.input-area {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    /* 输入容器样式 */
    .input-container {
        flex: 1;
        position: relative;
        background: var(--theme-white);
        border-radius: 100px;
        padding: 0 40px 0 15px;
        border: 1px solid rgba(39, 198, 217, 0.2);
        box-shadow: 0 2px 8px rgba(39, 198, 217, 0.1);
        display: flex;
        align-items: center;
        min-height: 52px;
    }
    
    /* 输入框样式 */
    .chat-input {
        width: 90%;
        min-height: 36px;
        max-height: 155px; /* 5行文本的最大高度 + padding */
        font-size: 16px;
        background-color: transparent;
        border: none;
        resize: none;
        outline: none;
        line-height: 20px;
        padding: 16px 5px;
        margin-left: 8%;
        overflow-y: hidden; /* 默认隐藏滚动条 */
        transition: height 0.2s ease; /* 添加平滑过渡效果 */
    }
    
    /* 输入框占位符样式 */
    .chat-input::placeholder {
        line-height: 20px;
        color: #999;
    }
}


/* 在 CSS 中添加以下样式 */
#userInput {
    overflow-y: hidden;
    box-sizing: border-box;
    /* line-height: 1.5;
    padding: 8px; */
    transition: height 0.2s ease;
}

/* 语音按钮样式 */
.voice-button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    padding: 0 4px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;  /* 添加过渡效果 */
}

.voice-button:hover {
    transform: translateY(-50%) scale(1.1);  /* 保持垂直居中的同时添加放大效果 */
}

.voice-button:active {
    transform: translateY(-50%) scale(0.95);  /* 点击时稍微缩小 */
}



/* 上传按钮和发送按钮共同样式 */
.upload-button,
.send-button {
    width: 36px;
    height: 36px;
    padding: 10px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--theme-primary);
    transition: all 0.2s ease;
    position: absolute;
    bottom: 10px;
}
/* 
.upload-button,
.send-button {
    width: 32px; 
    height: 32px;
    padding: 6px;
} */


.upload-button:hover,
.send-button:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

.upload-button:active,
.send-button:active {
    transform: scale(0.95);
}

.upload-button img,
.send-button img,
.voice-button img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 隐藏文件输入 */
#imageInput {
    display: none;
}

.image-container {
    position: relative;
    width: 100%;
    background-color: rgb(249, 248, 248);
}

/* 图片预览容器 */
.image-preview-container {
    position: relative;
    width: 100%;
    background-color: rgb(249, 248, 248);  /* 更浅的灰色 */
    transition: all 0.3s ease;
    padding: 10px;
}

.image-preview-wrapper {
    position: relative;
    display: inline-block;
    
    img {
        max-width: 120px;
        max-height: 120px;
        border-radius: 6px;
        object-fit: contain;
    }
}

/* 按钮组样式 */
.button-group {
    position: absolute;
    right: 0;
    bottom: 15px;
    display: flex;
    gap: 8px;
    align-items: center;
}

/* 发送按钮特定样式 */
.send-button {
    background-color: var(--theme-primary);
    right: 10px;
}

/* 上传按钮特定样式 */
.upload-button {
    background-color: var(--theme-primary);
    left: 10px;
}

/* 关闭按钮 */
.close-button {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(30, 36, 49, 0.8);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    padding: 0;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    
    &:hover {
        background: #1e2431;
        transform: scale(1.05);
    }
    
    &:active {
        transform: scale(0.95);
    }
}

/* 保留原有的其他样式 */
.action-buttons {
    display: flex;
    gap: 10px;
}

.action-button {
    padding: 6px 12px;
    border-radius: 15px;
    border: 1px solid #E0E0E0;
    color: #666;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 历史对话按钮 */
.history-button {
    position: fixed;
    right: 20px;
    bottom: 100px;
    background-color: var(--theme-primary);
    color: var(--theme-white);
    padding: 8px 16px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 代码块样式 */
.markdown-content pre {
    background-color: #282C3C;
    border-radius: 6px;
    padding: 16px;
    overflow-x: auto;
    margin: 8px 0;
}

.markdown-content code {
    color: #d4d4d4;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    background-color: #282C3C;
}

.markdown-content p code {
    background-color: #282C3C;
    padding: 2px 4px;
    border-radius: 4px;
    color:#d4d4d4;
}

/* 分子图片样式 */
.molecule-image {
    max-width: 50%;
    height: 300px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.molecule-image.loading {
    filter: blur(2px);
    opacity: 0.7;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .message-content {
        max-width: 90%;
    }
    
    .history-button {
        right: 10px;
        bottom: 80px;
    }
}

/* 分子显示图片的样式 */
.molecule-display {
    display: none; /* 默认隐藏 */
    height: 40vh;
    position: absolute;
    top: -40vh;
    right: 0;
    z-index: 10000;
}

/* 当有分子图片时显示 */
.molecule-display.active {
    display: block;
}

#show-arrow{
    display: block;
    position: absolute;
    top: -20px;
    left: 47%;
    transform: rotate(180deg); /* 添加180度旋转 */
    transition: all 0.3s ease-in-out;
    pointer-events: auto;
    z-index: 1002;
}

#hide-arrow{
    position: sticky;
    top: 0;
    width: 106%;
    height:50px;
    /* border: 1px solid red; */
    background-color: #F4FEFF;
    display: none;
    opacity: 0;
    transition: all 0.3s ease-in-out;
    z-index: 1003;
    transform: translateX(-3%);
}

#hide-arrow-img{
    position: absolute;
    top: 0;
    left: 45%;
}

#toggle-icon{
    position: absolute;
    top: 20%;
    left: 1%;
}

.show-AI-content {
    position: absolute;
    bottom: 75%;
    left: 8%;
    width: 83%;
    height: 0px;
    border-radius: 10px;
    background-color: #F4FEFF;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transform-origin: bottom center;
    transition: all 0.4s ease-in-out;
    overflow-x: hidden;
    overflow-y: auto;  /* 添加滚动条 */
    padding: 0 20px;   /* 添加内边距 */
    z-index: 1001;
}

/* 添加聊天消息样式 */
.chat-message {
    display: flex;
    margin: 15px 0;
    align-items: flex-start;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
}

.chat-bubble {
    background: #fff;
    padding: 12px 15px;
    border-radius: 12px;
    max-width: 80%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.user-message {
    flex-direction: row-reverse;
}

.user-message .chat-bubble {
    background: #27C6D9;
    color: white;
    margin-left: auto;
}
.show-AI-content.expanded{
    bottom: 75%;
    height:500px;
}

/* 自定义滚动条样式 */
.show-AI-content::-webkit-scrollbar {
    width: 6px;  /* 滚动条宽度 */
}

/* 滚动条轨道 */
.show-AI-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);  /* 浅灰色轨道 */
    border-radius: 3px;
}

/* 滚动条滑块 */
.show-AI-content::-webkit-scrollbar-thumb {
    background: rgba(39, 198, 217, 0.3);  /* 使用主题色，添加透明度 */
    border-radius: 3px;
    transition: all 0.2s ease;
}

/* 滚动条滑块悬停效果 */
.show-AI-content::-webkit-scrollbar-thumb:hover {
    background: rgba(39, 198, 217, 0.5);  /* 悬停时加深颜色 */
}

/* 滚动条角落 */
.show-AI-content::-webkit-scrollbar-corner {
    background: transparent;
}

/* 自定义滚动条样式 */
.chat-input::-webkit-scrollbar {
    width: 4px;
}

.chat-input::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 2px;
}

.chat-input::-webkit-scrollbar-thumb {
    background: rgba(39, 198, 217, 0.3);
    border-radius: 2px;
}

.chat-input::-webkit-scrollbar-thumb:hover {
    background: rgba(39, 198, 217, 0.5);
}





