/* ChatGPT风格布局样式 */
.chatgpt-layout {
    height: calc(100vh - 65px);
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
}

/* 左侧边栏 */
.chatgpt-sidebar {
    height: 100%;
    overflow-y: auto;
    border-right: 1px solid rgba(166, 166, 166, 0.2);
    box-shadow: 2px 0 8px -5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.io-grey-mode .chatgpt-sidebar {
    background-color: #ffffff;
    color: #202123;
}

.io-black-mode .chatgpt-sidebar {
    background-color: #2c2e2f;
    color: #fff;
}

.sidebar-header {
    padding: 15px 12px;
    margin-top: 10px;
}

.btn-new-chat {
    background-color: rgba(45, 45, 45, 0.1);
    color: #555;
    border: none;
    padding: 10px 14px;
    border-radius: 8px;
    text-align: left;
    margin-bottom: 15px;
    font-weight: 400;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-new-chat:hover {
    background-color: rgba(45, 45, 45, 0.15);
    color: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.btn-new-chat:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.io-black-mode .btn-new-chat {
    background-color: rgba(255, 255, 255, 0.1);
    color: #e1e1e1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.io-black-mode .btn-new-chat:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
}

.sidebar-history {
    padding: 0 12px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 0 2px;
}

.btn-clear-all {
    background: none;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.8rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.io-grey-mode .btn-clear-all {
    color: #999;
}

.io-grey-mode .btn-clear-all:hover {
    background-color: rgba(0, 0, 0, 0.06);
    color: #666;
}

.io-black-mode .btn-clear-all {
    color: #8e8ea0;
}

.io-black-mode .btn-clear-all:hover {
    background-color: rgba(255, 255, 255, 0.12);
    color: #ccc;
}

.history-title {
    font-size: 0.8rem;
    padding: 8px 2px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-weight: 500;
}

.io-grey-mode .history-title {
    color: #8a8a8a;
}

.io-black-mode .history-title {
    color: #9e9e9e;
}

.history-item {
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    position: relative;
}

.history-item:before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 8px;
    opacity: 0.7;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.history-item .delete-item {
    position: absolute;
    right: 8px;
    opacity: 0;
    color: #999;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    padding: 4px 6px;
    border-radius: 4px;
}

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

.io-grey-mode .history-item .delete-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #ff4d4f;
}

.io-black-mode .history-item .delete-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ff7875;
}

.io-grey-mode .history-item {
    color: #333;
}

.io-grey-mode .history-item:before {
    background-color: #a1a1a1;
}

.io-grey-mode .history-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.io-grey-mode .history-item.active {
    background-color: rgba(0, 0, 0, 0.07);
    color: #202123;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.io-grey-mode .history-item.active:before {
    background-color: #606060;
    opacity: 1;
    transform: scale(1.2);
}

.io-black-mode .history-item {
    color: #d4d4d4;
}

.io-black-mode .history-item:before {
    background-color: #8e8ea0;
}

.io-black-mode .history-item:hover {
    background-color: rgba(255, 255, 255, 0.06);
}

.io-black-mode .history-item.active {
    background-color: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.io-black-mode .history-item.active:before {
    background-color: #a0a0a0;
    opacity: 1;
    transform: scale(1.2);
}

/* 主聊天区域 */
.chatgpt-main {
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    position: relative;
}

.io-grey-mode .chatgpt-main {
    background-color: #ffffff;
}

.io-black-mode .chatgpt-main {
    background-color: #2c2e2f;
}

.mobile-header {
    padding: 10px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.io-grey-mode .mobile-header {
    background-color: #ffffff;
}

.io-black-mode .mobile-header {
    background-color: #343541;
    border-bottom-color: #3e3f4b;
}

.drawer-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
}

.io-grey-mode .drawer-toggle {
    color: #202123;
}

.io-black-mode .drawer-toggle {
    color: #ececf1;
}

.current-chat-title {
    margin-left: 15px;
    font-size: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-grow: 1;
    text-align: center;
}

.io-grey-mode .current-chat-title {
    color: #202123;
}

.io-black-mode .current-chat-title {
    color: #ececf1;
}

/* 聊天消息区域优化 */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    align-items: center;
    max-width: 100%;
    transition: all 0.3s ease;
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px 10px;
    width: 100%;
    scroll-behavior: smooth;
}

/* 滚动条美化 */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.io-grey-mode .chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.03);
}

.io-grey-mode .chat-messages::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.io-grey-mode .chat-messages::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.2);
}

.io-black-mode .chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
}

.io-black-mode .chat-messages::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.io-black-mode .chat-messages::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.message-row {
    display: flex;
    margin-bottom: 0;
    justify-content: center;
    position: relative;
    transition: background-color 0.3s ease;
}

/* PC端消息居中显示 */
@media (min-width: 768px) {
    .message-row {
        padding-left: 0;
        padding-right: 0;
    }

    .message-content {
        max-width: 900px !important;
    }
}

.message-avatar {
    width: 32px;
    height: 32px;
    margin-right: 16px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 3px;
    transition: transform 0.3s ease;
}

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

.message-content {
    flex: 1;
    max-width: calc(100% - 50px);
    position: relative;
}

.message-bubble {
    padding: 12px 0;
    line-height: 1.5;
    transition: opacity 0.3s ease;
}

.io-grey-mode .message-row.bot-message {
    background-color: #f7f7f8;
    padding: 15px 20px;
    margin: 0 -10px 0 -10px;
    border-radius: 0;
}

.io-grey-mode .message-row.user-message {
    background-color: #ffffff;
    padding: 15px 20px;
    margin: 0 -10px 0 -10px;
}

.io-black-mode .message-row.bot-message {
    background-color: #3e3f42;
    padding: 15px 20px;
    margin: 0 -10px 0 -10px;
}

.io-black-mode .message-row.user-message {
    padding: 15px 20px;
    margin: 0 -10px 0 -10px;
}

/* 消息加载动画 */
@keyframes thinking {
    0% {
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.3;
    }
}

.thinking-animation {
    animation: thinking 1.5s infinite ease-in-out;
    display: inline-block;
}

.message-actions {
    display: flex;
    gap: 15px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.message-content:hover .message-actions {
    opacity: 1;
}

.message-action {
    font-size: 0.75rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.io-grey-mode .message-action {
    color: #6b6c7b;
}

.io-black-mode .message-action {
    color: #8e8ea0;
}

.io-grey-mode .message-action:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #19c37d;
}

.io-black-mode .message-action:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #19c37d;
}

/* 输入区域 */
.chat-input-container {
    padding: 18px 15px;
    margin-top: auto;
    width: 100%;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    background-color: transparent;
    position: relative;
}

.io-grey-mode .chat-input-container {
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 -4px 6px -6px rgba(0, 0, 0, 0.05);
}

.io-black-mode .chat-input-container {
    border-top: 1px solid rgba(166, 166, 166, 0.15);
    box-shadow: 0 -4px 6px -6px rgba(0, 0, 0, 0.2);
}

.chat-input-area {
    width: 100%;
    max-width: 1100px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chat-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    border-radius: 40px;
    padding: 7px 20px;
    width: 100%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
    transition: all 0.3s ease;
}

.chat-input-wrapper:focus-within {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}


.io-grey-mode .chat-input-wrapper:focus-within {
    border-color: rgba(74, 122, 110, 0.4);
}

.io-black-mode .chat-input-wrapper {
    background-color: #3e3f42;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.io-black-mode .chat-input-wrapper:focus-within {
    border-color: rgba(58, 77, 71, 0.8);
}

.chat-input {
    flex: 1;
    background: transparent;
    border: none;
    font-size: 1rem;
    resize: none;
    padding: 6px 0;
    max-height: 200px;
    outline: none;
    line-height: 1.5;
    transition: all 0.2s ease;
}

.io-grey-mode .chat-input {
    color: #2c2c2e;
}

.io-black-mode .chat-input {
    color: #ececf1;
}

.io-grey-mode .chat-input::placeholder {
    color: #6b6c7b;
}

.io-black-mode .chat-input::placeholder {
    color: #8e8ea0;
}

/* 发送按钮修改为实体按钮 */
.chat-send-btn {
    background-color: #4a7a6e; /* 更换为更柔和的灰绿色 */
    border: none;
    color: white;
    width: auto;
    min-width: 64px;
    height: 40px;
    border-radius: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-left: 12px;
    padding: 0 16px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.chat-send-btn:hover {
    background-color: #396055; /* 较深的悬停颜色 */
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 暗色模式下的按钮颜色调整 */
.io-black-mode .chat-send-btn {
    background-color: #3a4d47; /* 暗色模式下的按钮颜色 */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.io-black-mode .chat-send-btn:hover {
    background-color: #2c3c38; /* 暗色模式下的悬停颜色 */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.chat-send-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chat-send-btn i {
    font-size: 1.1rem;
    margin-right: 4px; /* 图标和文字之间的间隔 */
}

.send-text {
    font-weight: 500; /* 略微加粗 */
    letter-spacing: 0.5px; /* 字间距 */
}

/* 在移动设备上只显示图标 */
@media (max-width: 576px) {
    .chat-send-btn {
        border-radius: 30px;
    }
}

.input-footer-text {
    font-size: 0.75rem;
    opacity: 0.8;
    padding: 4px 10px;
    border-radius: 12px;
    background-color: rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.io-black-mode .input-footer-text {
    background-color: rgba(255, 255, 255, 0.06);
}

/* 移动设备抽屉 */
.mobile-drawer {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100%;
    z-index: 1050;
    box-shadow: 3px 0 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 18px;
    overflow-y: auto;
}

.io-grey-mode .mobile-drawer {
    background-color: #f7f7f8;
}

.io-black-mode .mobile-drawer {
    background-color: #202123;
}

.mobile-drawer.open {
    left: 0;
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    margin-bottom: 18px;
}

.io-grey-mode .drawer-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    color: #2c2e2f;
}

.io-black-mode .drawer-header {
    border-bottom: 1px solid rgba(48, 55, 61, 0.8);
    color: #ececf1;
}

.close-drawer-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0 5px;
    transition: all 0.2s ease;
    border-radius: 6px;
}

.io-grey-mode .close-drawer-btn {
    color: #202123;
}

.io-grey-mode .close-drawer-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.io-black-mode .close-drawer-btn {
    color: #ececf1;
}

.io-black-mode .close-drawer-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    z-index: 1040;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.drawer-overlay.open {
    display: block;
    opacity: 1;
}

/* 移动端顶部栏 */
.mobile-header {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.io-grey-mode .mobile-header {
    background-color: rgba(255, 255, 255, 0.85);
}

.io-black-mode .mobile-header {
    background-color: rgba(52, 53, 65, 0.85);
    border-bottom-color: rgba(62, 63, 75, 0.5);
}

.drawer-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.drawer-toggle:active {
    transform: scale(0.95);
}

.io-grey-mode .drawer-toggle {
    color: #202123;
}

.io-grey-mode .drawer-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.io-black-mode .drawer-toggle {
    color: #ececf1;
}

.io-black-mode .drawer-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 响应式调整 */
@media (max-width: 767px) {
    .chatgpt-layout {
        height: calc(100vh);
    }

    .message-row {
        padding: 18px 12px;
    }

    .message-avatar {
        width: 28px;
        height: 28px;
        margin-right: 12px;
    }

    .chat-input-container {
        padding: 12px 10px;
    }

    .chat-input-wrapper {
        padding: 10px 16px;
    }

    .message-bubble {
        padding: 8px 0;
        font-size: 0.95rem;
    }

    pre.hljs {
        margin: 12px 0;
        padding: 12px;
        font-size: 0.8rem;
    }

    pre.hljs .js-copy-btn {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
}

/* 添加打字机效果动画 */
@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

.typing::after {
    content: "|";
    animation: blink 1s infinite;
    font-weight: normal;
    display: inline-block;
    margin-left: 2px;
}

/* 添加淡入动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-row {
    animation: fadeIn 0.3s ease-out forwards;
}

/* 思考动画 */
.thinking-dots::after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%, 100% {
        content: '...';
    }
}

/* 代码高亮样式 */
pre.hljs {
    border-radius: 10px;
    margin: 15px 0;
    padding: 16px;
    position: relative;
    overflow: auto;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

pre.hljs:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.io-grey-mode pre.hljs {
    background-color: #f3f3f3;
}

.io-grey-mode pre.hljs code {
    background-color: #f3f3f3;
}

.io-grey-mode pre.hljs code span {
    color: #000;
}

.io-black-mode pre.hljs {
    background-color: #000;
}

.io-black-mode pre.hljs code {
    background-color: #000;
    color: #f3f3f3
}

.io-black-mode pre.hljs code span {
    color: #f3f3f3;
}

.io-black-mode pre.hljs:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

pre.hljs code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* 复制按钮 */
pre.hljs .js-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0.7;
}

pre.hljs:hover .js-copy-btn {
    opacity: 1;
}


.io-grey-mode pre.hljs .js-copy-btn {
    background-color: rgba(229, 229, 229, 0.8);
    color: #000;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.io-black-mode pre.hljs .js-copy-btn {
    background-color: rgba(52, 53, 65, 0.8);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.io-grey-mode pre.hljs .js-copy-btn:hover {
    background-color: #e0e0e0;
    color: #19c37d;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.io-black-mode pre.hljs .js-copy-btn:hover {
    background-color: #40414f;
    color: #19c37d;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

.js-copy-btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

/* Markdown 渲染样式优化 */
.message-bubble .markdown-content {
    /* 基础样式 */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-size: 0.95rem;
    padding-left: 0;
}

/* 段落和列表样式调整 */
.message-bubble p {
    margin-top: 0;
    margin-bottom: 5px;
    line-height: 1.35;
}

/* 段落之间的间隔 */
.message-bubble p + p {
    margin-top: 10px;
}

/* 调整列表样式 */
.message-bubble ul,
.message-bubble ol {
    padding-left: 1.5em;
    margin-top: 8px;
    margin-bottom: 8px;
}

.message-bubble li {
    margin-bottom: 4px;
}

.message-bubble li > ul,
.message-bubble li > ol {
    margin-top: 4px;
    margin-bottom: 0;
}

/* 标题样式 - 更紧凑 */
.message-bubble h1,
.message-bubble h2,
.message-bubble h3,
.message-bubble h4,
.message-bubble h5,
.message-bubble h6 {
    font-weight: 600;
    line-height: 1.3;
    border: none;
    background: none;
    padding: 0;
    font-size: 1.20rem;
}

.message-bubble h1 {
    font-size: 1.6em;
    margin-top: 1em;
    margin-bottom: 0.6em;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 0.3em;
}

.message-bubble h2 {
    font-size: 1.4em;
    margin-top: 0.8em;
    margin-bottom: 0.6em;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 0.3em;
}

/* 表格样式 - 更美观 */
.message-bubble table {
    border-collapse: separate;
    width: 100%;
    margin: 1em 0;
    overflow-x: auto;
    display: block;
    font-size: 0.9em;
    border-radius: 8px;
    border-spacing: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.io-black-mode .message-bubble table {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.message-bubble table th {
    background-color: rgba(0, 0, 0, 0.03);
    font-weight: 600;
}

.io-black-mode .message-bubble table th {
    background-color: rgba(255, 255, 255, 0.08);
}

.message-bubble table th,
.message-bubble table td {
    border: 1px solid #e0e0e0;
    padding: 8px 12px;
    text-align: left;
}

.io-black-mode .message-bubble table th,
.io-black-mode .message-bubble table td {
    border-color: #444;
}

.message-bubble table tr:first-child th:first-child {
    border-top-left-radius: 8px;
}

.message-bubble table tr:first-child th:last-child {
    border-top-right-radius: 8px;
}

.message-bubble table tr:last-child td:first-child {
    border-bottom-left-radius: 8px;
}

.message-bubble table tr:last-child td:last-child {
    border-bottom-right-radius: 8px;
}

/* 引用块样式 - 更美观 */
.message-bubble blockquote {
    margin: 10px 0;
    padding: 10px 15px;
    color: #6a737d;
    border-left: 4px solid #dfe2e5;
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 0 8px 8px 0;
}

.io-black-mode .message-bubble blockquote {
    border-left-color: #4b5563;
    background-color: rgba(255, 255, 255, 0.05);
    color: #a0aec0;
}

/* 水平线 */
.message-bubble hr {
    height: 1px;
    padding: 0;
    margin: 20px 0;
    background-color: #e1e4e8;
    border: 0;
    border-radius: 1px;
}

.io-black-mode .message-bubble hr {
    background-color: #4b5563;
}

/* 图片 */
.message-bubble img {
    max-width: 100%;
    box-sizing: content-box;
    background-color: #fff;
    border-radius: 8px;
    margin: 8px 0;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.message-bubble img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.io-black-mode .message-bubble img {
    background-color: #2d333b;
    border-color: rgba(255, 255, 255, 0.1);
}

.io-black-mode .message-bubble img:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.chat-header {
    padding: 10px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    position: relative;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: 0 4px 6px -6px rgba(0, 0, 0, 0.05);
}

.io-black-mode .chat-header {
    border-bottom-color: rgba(255, 255, 255, 0.03);
    box-shadow: 0 4px 6px -6px rgba(0, 0, 0, 0.2);
}

.chat-header-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70%;
    transition: all 0.3s ease;
}

.io-black-mode .chat-header-title {
    color: #e1e1e1;
}

.btn-clear-chat {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 20px;
}

.io-grey-mode .btn-clear-chat {
    color: #888;
}

.io-grey-mode .btn-clear-chat:hover {
    background-color: rgba(0, 0, 0, 0.06);
    color: #555;
    transform: translateY(-1px);
}

.io-black-mode .btn-clear-chat {
    color: #8e8ea0;
}

.io-black-mode .btn-clear-chat:hover {
    background-color: rgba(255, 255, 255, 0.12);
    color: #ccc;
    transform: translateY(-1px);
}

.btn-clear-chat:active {
    transform: translateY(0);
}

.btn-clear-chat i {
    font-size: 1rem;
}

#mobileClearChatBtn {
    font-size: 1rem;
    padding: 6px;
    border-radius: 8px;
}

/* 用户消息重试按钮 */
.user-message-actions {
    display: block;
    position: absolute;
    right: 15px;
    top: 15px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.message-row.user-message {
    position: relative;
}

.message-row.user-message:hover .user-message-actions {
    opacity: 1;
}

.retry-btn {
    background: none;
    border: none;
    font-size: 0.8rem;
    color: #999;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 6px;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.retry-btn:hover {
    background-color: rgba(0, 0, 0, 0.06);
    color: #555;
    transform: translateY(-1px);
}

.retry-btn:active {
    transform: translateY(0);
}

.io-black-mode .retry-btn {
    color: #8e8ea0;
}

.io-black-mode .retry-btn:hover {
    background-color: rgba(255, 255, 255, 0.12);
    color: #ccc;
}

/* 机器人回答切换按钮 */
.bot-nav-buttons {
    display: flex;
    justify-content: center;
    margin-top: 10px;
    gap: 8px;
}

.bot-nav-btn {
    background: none;
    border: 1px solid #ddd;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.io-grey-mode .bot-nav-btn {
    color: #6b6c7b;
}

.io-grey-mode .bot-nav-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.io-black-mode .bot-nav-btn {
    color: #8e8ea0;
    border-color: #444;
}

.io-black-mode .bot-nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.bot-nav-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.bot-nav-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.response-counter {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    background-color: rgba(0, 0, 0, 0.04);
}

.io-black-mode .response-counter {
    background-color: rgba(255, 255, 255, 0.08);
}

/* 隐藏的历史回答 */
.hidden-response {
    display: none;
}


/* 侧边栏切换样式 */
.sidebar-toggle-btn {
    position: absolute;
    z-index: 100;
    left: 0;
    top: 5px;
}

.sidebar-toggle-btn .btn {
    background-color: #f9f9f9;
    width: 24px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.08);
    border: none;
    border-radius: 0 24px 24px 0;
    transition: all 0.3s ease;
    padding-right: 3px;
}

.io-grey-mode .sidebar-toggle-btn .btn {
    background-color: #f9f9f9;
    color: #555;
}

.io-black-mode .sidebar-toggle-btn .btn {
    background-color: #343541;
    color: #e1e1e1;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
}

.sidebar-toggle-btn .btn:hover {
    background-color: #4a7a6e;
    color: white;
    transform: translateX(2px);
}

.io-black-mode .sidebar-toggle-btn .btn:hover {
    background-color: #3a4d47;
}

.sidebar-toggle-btn .btn:active {
    transform: translateX(0);
}

/* 侧边栏收起状态 */
.sidebar-collapsed .chatgpt-sidebar {
    display: none !important;
}

.sidebar-collapsed .chatgpt-main {
    flex: 0 0 100%;
    max-width: 100%;
}

/* 侧边栏切换按钮旋转 */
.sidebar-toggle-btn .btn i {
    transition: transform 0.3s ease;
    font-size: 0.9rem;
}

.sidebar-collapsed .sidebar-toggle-btn .btn i {
    transform: rotate(180deg);
}

 .current-model {
    background: linear-gradient(135deg, #007bff, #00c6ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
}

.current-model::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #007bff, #00c6ff);
    transform: scaleX(0);
    transition: transform 0.3s ease;
    transform-origin: left;
}

.model-display:hover .current-model::after {
    transform: scaleX(1);
}

.model-dropdown {
    position: absolute;
    bottom: 100%; /* 修改为底部对齐，使下拉框向上展开 */
    left: 0;
    width: auto;
    min-width: 180px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.15); /* 修改阴影方向 */
    margin-bottom: 8px; /* 修改为底部外边距 */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px); /* 修改变换方向 */
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 1000;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(0, 123, 255, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform-origin: bottom center; /* 设置变换原点 */
}

@keyframes slideUpIn {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    70% {
        opacity: 1;
        transform: translateY(-2px) scale(1.01);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.model-dropdown-header {
    border-radius: 12px;
    background: #0d8aee;
}
.model-dropdown-header:hover{
    cursor: pointer;
}

/* 停止按钮样式 */
.chat-stop-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #ff4d4f;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.3s;
}

.chat-stop-btn:hover {
    background-color: #ff7875;
}

.chat-stop-btn i {
    font-size: 16px;
    margin-right: 4px;
}

.chat-stop-btn .stop-text {
    display: inline-block;
}

@media (max-width: 576px) {
    .chat-stop-btn .stop-text {
        display: none;
    }

    .chat-stop-btn {
        padding: 6px;
    }

    .chat-stop-btn i {
        margin-right: 0;
    }
}

/* 输入区域底部样式 */
.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    margin-bottom: 10px;
}

.input-footer-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-footer-right {
    font-size: 12px;
}

.current-model-container {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #666;
}

.io-black-mode .current-model-container {
    color: #aaa;
}

.model-dropdown-header {
    border-radius: 12px;
    background: #0d8aee;
    padding: 4px 10px;
    color: white;
    font-size: 13px;
    transition: all 0.2s ease;
}

.model-dropdown-header:hover {
    cursor: pointer;
    background: #0a6fc7;
    transform: translateY(-1px);
}

@media (max-width: 767px) {
    .input-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .input-footer-left {
        width: 100%;
        justify-content: space-between;
    }
    
    .input-footer-right {
        width: 100%;
        text-align: center;
    }
    
    .current-model-container {
        font-size: 12px;
    }
}

/* 移动端样式 */
.mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 767px) {
    .custom-model-selector {
        font-size: 12px;
    }

    .model-display {
        padding: 4px 8px;
    }

    .model-display i {
        font-size: 14px;
    }

    .mic-btn {
        width: 32px;
        height: 32px;
    }

    .mic-btn i {
        font-size: 16px;
    }
}

/* 麦克风按钮样式 */
.mic-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.3s;
    margin-right: 8px;
}

.mic-btn:hover {
    background-color: #f0f0f0;
}

.mic-btn:active {
    transform: scale(0.95);
    background-color: #e8e8e8;
}

.mic-btn i {
    font-size: 18px;
    color: #666;
}

.mic-btn.recording {
    background-color: #ff4d4f;
    border-color: #ff4d4f;
}

.mic-btn.recording i {
    color: white;
}

.mic-btn .ripple:nth-child(2) {
    animation-delay: 0.5s;
}

.mic-btn .ripple:nth-child(3) {
    animation-delay: 1s;
}

/* 声波动画 */
.mic-btn .wave-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s;
}

.mic-btn.recording .wave-container {
    opacity: 1;
}

.mic-btn .sound-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(255, 77, 79, 0.8), rgba(255, 77, 79, 0));
    transform-origin: bottom;
    animation: sound-wave 0.5s infinite ease-in-out alternate;
}

@keyframes sound-wave {
    0% {
        transform: scaleY(0.2);
    }
    100% {
        transform: scaleY(0.8);
    }
}

/* 录音波形动画 */
.recording-waves {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 40px;
    transform: translateY(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
}

.recording-wave {
    width: 4px;
    height: 100%;
    margin: 0 3px;
    border-radius: 2px;
    background: linear-gradient(to top, #ff4d4f, #ff7875);
    animation: equalizer 0.8s infinite ease-in-out alternate;
    transform-origin: bottom;
}

.recording-wave:nth-child(1) {
    animation-delay: 0s;
}

.recording-wave:nth-child(2) {
    animation-delay: 0.2s;
}

.recording-wave:nth-child(3) {
    animation-delay: 0.4s;
}

.recording-wave:nth-child(4) {
    animation-delay: 0.6s;
}

.recording-wave:nth-child(5) {
    animation-delay: 0.8s;
}

.recording-wave:nth-child(6) {
    animation-delay: 1.0s;
}

.recording-wave:nth-child(7) {
    animation-delay: 1.2s;
}

@keyframes equalizer {
    0% {
        transform: scaleY(0.3);
    }
    100% {
        transform: scaleY(1);
    }
}

/* 警告消息样式 */
.warning-message {
    color: #faad14;
    font-style: italic;
    padding: 8px;
    background-color: rgba(250, 173, 20, 0.1);
    border-radius: 4px;
    margin: 5px 0;
}

/* 消息操作样式 */
.message-actions {
    display: flex;
    gap: 8px;
    margin-top: 5px;
    opacity: 1; /* 始终显示操作按钮 */
}

.message-action {
    cursor: pointer;
    color: #999;
    font-size: 12px;
    padding: 2px 5px;
    border-radius: 3px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.message-action:hover {
    background-color: #f0f0f0;
    color: #333;
}

.delete-message:hover {
    color: #ff4d4f;
}

.delete-message i {
    font-size: 14px;
    margin-right: 2px;
}

/* 录音提示 */
.recording-tip {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 25px;
    border-radius: 20px;
    text-align: center;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    max-width: 90%;
    width: auto;
}

.recording-tip.show {
    display: block;
    animation: fadeInUp 0.3s forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.recording-tip-text {
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recording-tip-text:before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: #ff4d4f;
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse-dot 1.5s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;
}

@keyframes pulse-dot {
    0% {
        transform: scale(0.8);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(0.8);
    }
}

/* 为不同模型设置不同颜色 */
.model-item[data-model-id="moonshot-v1-128k"] .model-item-name {
    color: #6200ea;
}

.model-item[data-model-id="gpt-3.5-turbo"] .model-item-name {
    color: #00c853;
}

.model-item[data-model-id="gpt-4"] .model-item-name {
    color: #2962ff;
}

.model-item[data-model-id="claude-3-opus"] .model-item-name {
    color: #d50000;
}

.model-item[data-model-id="claude-3-sonnet"] .model-item-name {
    color: #ff6d00;
}

/* 语音模式相关样式 */
.speech-mode-btn {
    display: none;
    width: 75%;
    height: 40px;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 22px;
    padding: 0 15px;
    line-height: 40px;
    text-align: center;
    cursor: pointer;
    color: #666;
    font-size: 14px;
    transition: all 0.3s;
    position: relative;
}

.speech-mode-btn:hover {
    background-color: #f0f0f0;
}

.speech-mode-btn:active {
    transform: scale(0.98);
    background-color: #e8e8e8;
}

.speech-mode-btn.recording {
    background-color: #ff4d4f;
    color: white;
    border-color: #ff4d4f;
}

.mic-btn.voice-mode-active {
    background-color: #1890ff;
    border-color: #1890ff;
}

.mic-btn.voice-mode-active i {
    color: white;
}

/* 麦克风图标转换动画 */
@keyframes micIconSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.mic-btn.switching i {
    animation: micIconSpin 0.5s ease-in-out;
}
