body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #000000;
    height: 100vh;
    overflow: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('./image/back.png');
    background-size: cover;
    z-index: -1; /* 确保背景图片在底层 */
}

.container {
    display: flex;
    height: 100%;
    width: 100%;
    z-index: 1; /* 确保容器在背景图片上层 */
}


.avatar-touxiang {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.avatar-touxiang:hover {
    transform: scale(1.05);
}

.avatar-div{
    display: flex;
    align-items: center;
    border-bottom: 1px solid #2f3236;
    padding: 16px;
}
.avatar {
    border-radius: 50%;
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
}

.sidebar {
    max-width: 230px;
    background-color: #19191D 70%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-right: 1px solid #2f3236;
    padding-left: 12px;
    padding-right: 12px;
    max-height: 100vh; /* 添加最大高度 */
    overflow: hidden; /* 防止整体溢出 */
}

.sidebar h2 {
    color: #888;
    display: flex;
    align-items: center;
    font-family :Arial,sans-serif;
    font-size: 16px;
}

.sidebar h2 img {
    border-radius: 50%;
    margin-right: 10px;
}

.sidebar ul {
    list-style: none;
    width: 200px;
    padding-inline-start: 0px;
    align-items: center;
    margin: 0;
    padding: 10px 0;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(37, 40, 55, 0.8) rgba(32, 33, 35, 0.3);
}

.sidebar ul::-webkit-scrollbar {
    width: 6px;
}

.sidebar ul::-webkit-scrollbar-track {
    background: linear-gradient(180deg, 
        rgba(32, 33, 35, 0.3) 0%, 
        rgba(25, 25, 27, 0.3) 100%
    );
    border-radius: 3px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.sidebar ul::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, 
        rgba(37, 40, 55, 0.8) 0%, 
        rgba(79, 83, 102, 0.8) 100%
    );
    border-radius: 3px;
    border: 1px solid rgba(52, 54, 64, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.sidebar ul::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, 
        rgba(47, 50, 65, 0.9) 0%, 
        rgba(89, 93, 112, 0.9) 100%
    );
}

.sidebar ul li {
    margin: 8px 0;
}

.sidebar ul li a {
    color: #aaa;
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: 5px;
    transition: background 0.3s;
}

.sidebar ul li a:hover {
    background: linear-gradient(226deg, #252837 0%, rgba(79, 83, 102, 0) 100%);
    border: 1px solid #2f3236;
}

.sidebar ul li a img {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

.chat-container {
    width: calc(100% - 250px); /* 减去侧边栏宽度 */
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.sidebar ul li a.active {
    background: linear-gradient(226deg, #252837 0%, rgba(79, 83, 102, 0) 100%);
    border: 1px solid #2f3236;
}
.chat-header {
    color: #FFFFFF;
    padding: 20px;
    font-size: 20px;
    text-align: center;
}

.chat-title {
    font-size: 16px;
    line-height: 2;
    letter-spacing: 0.2em;
}

.chat-header img {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.chat-body {
    padding: 10px 25% 10px 25%;
    border-radius: 12px 12px 0 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    flex-grow: 1;
}

.input-field-container-bg .image-wrapper > span { 
    position: absolute;
    top: 5px;
    right: 5px;
    cursor: pointer;
    font-size: 16px;
    color: red;
}
  
.preview-container.show {
    display: block;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    gap: 5px;
    margin-bottom: 10px;
    overflow-x: auto;
    min-width: 500px;
}

.preview-container {
    display: none;
}

.preview-container img {
    max-width: 100px;
    height: auto;
    border-radius: 5px;
    margin: 5px;
}

.input-field-container {
    display: flex;
    align-items: center;
    width: 100%;
}

.input-field {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 10px;
    margin-right: 10px;
}

.input-field-container-bg {
    display: flex;
    flex-direction: column; 
    align-items: flex-start;
    background-color: #252837;
    background: linear-gradient(226deg, #252837 0%, rgba(79,83,102,0) 100%);
    padding: 12px 16px;
    border: 1px solid #4E5969;
    border-radius: 12px 12px 12px 12px;
    margin: 2% 25%;
    backdrop-filter: blur(8px);
}

.uploaded-image {
    max-width: 100px;
    max-height: 100px;
    margin: 5px;
    position: relative;
}

.upload-button span, button span {
    display: none;
}

.icon-wrapper {
    display: inline-block;
    position: relative;
    width: 30px;
    height: 30px;
}

.icon-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
}

.sub-icon-hover, .upload-icon-hover {
    opacity: 0;
}

#submitBtn:hover .sub-icon, #uploadBtn:hover .upload-icon {
    opacity: 0;
}

#submitBtn:hover .sub-icon-hover, #uploadBtn:hover .upload-icon-hover {
    opacity: 1;
}

.upload-button {
    background: none;
    border: none;
    padding: 0;
    border-radius: 5px;
    cursor: pointer;
    margin-right: 10px;
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

button {
    width: 30px;
    background: none;
    border: none;
    padding: 0;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-field {
    color: #FFFFFF;
    background: transparent;
    flex-grow: 1;
    padding: 0px;
    margin-right: 10px;
    border: none;
    outline: none;
    border-radius: 5px;
    resize: none;
    overflow-y: auto;
    height: auto;
    font-size: 16px;
    line-height: 2;
    word-break: break-all;
}

.input-field-container {
    min-width: 375px;
    display: flex;
    align-items: center;
    width: calc(100% - 6px);
    height: auto;
    position: relative;
    gap: 12px;
}

.file-name-display {
    color: #FFFFFF;
    font-size: 14px;
    margin-right: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    vertical-align: middle;
}

.preview-image {
    max-width: 36px;
    max-height: 36px;
    position: absolute;
    right: 120px;
    bottom: 0;
    border-radius: 5px;
    box-shadow: 0px 4px 10px 0px rgba(0,0,0,0.1);
    cursor: pointer;
}

.message a {
    color: #3A3FA6;
    text-decoration: none;
}

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

.message {
    display: flex;
    flex-direction: row;
    align-items: start;
    margin-bottom: 20px;
    line-height: 1.5;
}

.audio-player {
    display: flex;
    align-items: center;
    margin-top: 8px;
}

.audio-player audio {
    max-width: 100%;
}

.user-message {
    flex-direction: row-reverse;
}

.list-item {
    margin-bottom: 14px;
    font-weight: bold;
}

.message p {
    margin-top: 8px;
    margin-bottom: 8px;
}

.message h3 {
    font-size: 16px;
    font-weight: bold;
    margin-top: 16px;
    margin-bottom: 12px;
}

.copy-button {
    background: none;
    border: none;
    cursor: pointer;
    color: white;
    font-size: 16px;
    margin-bottom: 10px;
}

.copy-button:hover {
    color: #ccc;
}

.toast {
    visibility: hidden;
    min-width: 250px;
    margin-left: -125px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    text-align: center;
    border-radius: 16px;
    padding: 16px;
    position: fixed;
    z-index: 1;
    left: 50%;
    top: 30px;
    font-size: 17px;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
}

.toast.show {
    visibility: visible;
    opacity: 1;
}

.user-message .message-content {
    background: #3A3FA6;
    border-radius: 12px 12px 12px 12px;
    box-shadow: 0px 4px 10px 0px rgba(0,0,0,0.1);
    color: #FFFFFF;
    padding-top: 4px;
    padding-right: 12px;
    padding-bottom: 4px;
    padding-left: 12px;
    max-width: 70%;
    backdrop-filter: blur(8px);
}

.user-message .avatar {
    margin-left: 16px;
}

.ai-message .message-content {
    background: #252837;
    color: #FFFFFF;
    box-shadow: 0px 4px 10px 0px rgba(0,0,0,0.1);
    backdrop-filter: blur(30px);
    padding-top: 4px;
    padding-right: 12px;
    padding-bottom: 4px;
    padding-left: 12px;
    border: 1px solid #4E5969;
    border-radius: 12px 12px 12px 12px;
    max-width: 70%;
    backdrop-filter: blur(8px);
}

.message.ai.error {
    background-color: #ffebee;
    color: #c62828;
    border-left: 3px solid #c62828;
}

.system-message {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.system-message .message-content {
    background-color: #4E5969;
    color: #FFFFFF;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 14px;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3A3FA6;
    border-radius: 50%;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.avatar {
    width: 40px;
    height: 40px;
    margin-right: 20px;
    margin-left: 20px;
    flex-shrink: 0;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
}

.user-message .avatar {
    background-image: url("https://gd-hbimg.huaban.com/1db061094406442f0a8bbebf2188e3c6a4914c6ba8aea-tcfAqr");
}

.ai-message .avatar {
    background-image: url("https://gd-hbimg.huaban.com/db429286ceec2808bf361f96eaef3d83a6cef6ed1dbd7-Fl3j9X_fw658webp");
}

.message-content img {
    max-width: 10%;
    height: auto;
}

.file-icon {
    width: 24px;
    height: 24px;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    vertical-align: middle;
    margin-right: 4px;
}

.file-icon.doc, .file-icon.docx {
    background-image: url('data:image/svg+xml,%3Csvg viewBox="0 0 24 24" fill="white" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z"/%3E%3C/svg%3E');
}

.file-icon.pdf {
    background-image: url('data:image/svg+xml,%3Csvg viewBox="0 0 24 24" fill="white" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7h2.5c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5v3zm4-3H19v1h1.5V11H19v2h-1.5V7h3v1.5z"/%3E%3C/svg%3E');
}

.file-icon.zip {
    background-image: url('data:image/svg+xml,%3Csvg viewBox="0 0 24 24" fill="white" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="M18.5 9H16V3.5L18.5 9zm-13-5.5V19c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2H8.5l-3 3zm4 11v-2h2v2h-2zm0-4v-2h2v2h-2zm0-4v-2h2v2h-2z"/%3E%3C/svg%3E');
}

.file-icon.unknown {
    background-image: url('data:image/svg+xml,%3Csvg viewBox="0 0 24 24" fill="white" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="M14.4 6L14 4H5v17h2v-7h5.6l.4 2h7V6z"/%3E%3C/svg%3E');
}

@media (max-width: 767px) {
    .chat-container {
        width: 100%;
        height: 100%;
    }

    .chat-header {
        font-size: 16px;
        padding: 12px;
    }

    .chat-body {
        padding: 12px 8px;
    }

    .chat-footer {
        margin: 2% 4%;
    }

    .input-field-container {
        min-width: auto;
        width: calc(100% - 4%);
    }

    .input-field {
        font-size: 14px;
        line-height: 1.5;
    }

    .file-name-display {
        max-width: 100px;
    }

    .preview-image {
        max-width: 30px;
        max-height: 30px;
        right: 80px;
    }

    .message {
        padding: 10px;
        margin: 10px 0;
        border-radius: 8px;
        background-color: #f1f1f1;
        max-width: 80%;
        word-wrap: break-word;
    }

    .user-message {
        text-align: right;
        background-color: #d1e7dd;
    }

    .bot-message {
        text-align: left;
        background-color: #e2e3e5;
    }

    .user-message .message-content, .ai-message .message-content {
        max-width: 80%;
    }

    .avatar {
        width: 32px;
        height: 32px;
        margin-right: 12px;
        margin-left: 12px;
    }
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #252837;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #343640;
    width: 300px;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(2, 4, 13, 0.5);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

.qr-code {
    display: block;
    width: 100%;
    height: auto;
    margin-top: 20px;
}

.avatar-touxiang {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.avatar-touxiang:hover {
    transform: scale(1.05);
}

/* 添加以下 CSS */
.menu-toggle {
    display: none;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1000;
    background: none;
    border: none;
    font-size: 24px;
    color: #FFFFFF;
    cursor: pointer;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
        z-index: 1001; /* 增加z-index确保在最上层 */
    }

    .sidebar {
        position: fixed;
        left: -250px;
        top: 0;
        height: 100%;
        width: 250px;
        transition: left 0.3s ease;
        z-index: 1000; /* 增加z-index确保在大多数元素之上 */
        background-color: rgba(27, 27, 41, 0.95); /* 增加不透明度 */
    }

    .sidebar.active {
        left: 0;
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.3); /* 添加阴影效果 */
    }

    .chat-container {
        width: 100%;
    }

    .chat-body {
        padding: 10px 5%;
    }

    .input-field-container-bg {
        margin: 2% 5%;
    }

    /* 添加遮罩层 */
    .overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .overlay.active {
        display: block;
    }
}

/* 确保背景图片不会遮挡其他元素 */
.background-image {
    z-index: -1;
}

/* 调整容器的z-index */
.container {
    z-index: 1;
}

.cola-icon {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(226deg, #252837 0%, rgba(79, 83, 102, 0) 100%);
    border: 1px solid #2f3236;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(2, 4, 13, 0.5);
    z-index: 1000;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cola-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(2, 4, 13, 0.6);
}

.cola-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .cola-icon {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
    }
    
    .cola-icon img {
        width: 32px;
        height: 32px;
    }
}

/* 如果还没有modal相关的样式,请确保添加以下内容 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(226deg, #252837 0%, rgba(79, 83, 102, 0.8) 100%);
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #343640;
    width: 300px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(2, 4, 13, 0.5);
    backdrop-filter: blur(8px);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

.qr-code {
    display: block;
    width: 100%;
    height: auto;
    margin-top: 20px;
}
