.J-translate {
    min-height: 800px;
}

.ai-chat-container {
    width: 90vw;        /* 默认占视口宽度的90% */
    height: 80vh;       /* 默认占视口高度的80% */
    max-width: 800px;   /* 最大宽度保持600px */
    max-height: 600px;  /* 最大高度保持500px */
    min-width: 600px;   /* 最小宽度避免过小 */
    min-height: 500px;  /* 最小高度避免过小 */

    box-sizing: border-box; /* 确保padding和border包含在元素的宽度和高度内 */
    background-color: #fff;
    /*border-radius: 8px;*/
    /*box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);*/
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    resize: both;
}

.chat-box {
    flex: 1;
    padding: 20px 10px;
    overflow-y: auto;
    border-bottom: 1px solid #ddd;
    flex-direction: column-reverse;
}

.ai-chat-container .message {
    margin-bottom: 15px;
    display: flex;
}

.ai-chat-container .message.system {
    justify-content: flex-start;
}

.ai-chat-container .message.user {
    justify-content: flex-end;
}

/* 头像样式 */
.avatar {
    width: 30px;
    height: 30px;
    /*border-radius: 50%;*/
    /*background-color: #0094e7; !* 可以根据需要更改背景颜色或添加背景图片 *!*/
    /*background: url(../img/semiee-icon.png) no-repeat;*/
    margin-right: 10px;
}

.message-content {
    font-size: 14px;
    max-width: 70%;
    padding: 10px;
    border-radius: 8px;
    transform: translate3d(0,0,0);
    will-change: transform;
}

.message.system .message-content {
    background-color: #efefef;
}

.message-content .content {
    contain: content; /* 启用contain优化 */
    overflow-anchor: none; /* 禁用滚动锚定 */
}

.content {
    font-size: 14px !important; /* 强制固定字体大小 */
    line-height: 1.4 !important;
    min-height: 1em; /* 保持最小高度 */
    /*transition: all 0.3s ease; !* 平滑变化 *!*/
}

.reasoning-content {
    font-size: 13px !important; /* 强制固定字体大小 */
    line-height: 1.4 !important;
    min-height: 1em; /* 保持最小高度 */
    /*transition: all 0.3s ease; !* 平滑变化 *!*/
}

.content  p,
.content strong {
    font-size: 14px !important;
    font-weight: 700 !important;
}

.content li {
    min-height: 24px;  /* 根据字体大小调整，缓冲高度抖动 */
}

/*@font-face {*/
/*    src: url('bold.woff2') format('woff2');*/
/*    font-weight: 700;*/
/*    font-display: swap;*/
/*}*/

.content * {
    transition: none !important;
    animation: none !important;
}

.message-content pre {
    margin: 0;
    display: block;
    padding: 0;
    font-size: initial;
    line-height: initial;
    color: initial;
    word-break: normal;
    word-wrap: normal;
    background-color: transparent;
    border: none;
    border-radius: 0;

    max-width: calc(100% - 20px);
    transform: scale(0.98);
    transform-origin: left top;
    transition: transform 0.3s ease;
}

/* 精确控制p标签样式 */
.message-content p {
    margin: 0.5em 0 !important;
    padding: 0 !important;
    animation: font-lock 0.1s forwards; /* 字体尺寸锁定 */
}

@keyframes font-lock {
    to {
        font-size: 14px !important;
        line-height: 1.4 !important;
    }
}
.message-content pre .message-content code {
    padding: initial;
    font-size: initial;
    color: initial;
    white-space: initial;
    background-color: initial;
    border-radius: initial;
}

.message-content code {
    padding: initial;
    font-size: initial;
    color: initial;
    background-color: initial;
    border-radius: initial;
}

.message-content code, .message-content kbd, .message-content pre, .message-content samp {
    font-family: initial;
    font-size: initial;
}

.message-content pre .message-content code {
    white-space: pre-wrap;       /* 允许保留空白符并根据需要换行 */
    word-wrap: break-word;       /* 在必要时断开长单词或URL地址 */
    display: block;              /* 让code元素成为块级元素，方便设置样式 */
    max-width: 100%;             /* 确保内容不超过父容器的宽度 */
    font-size: 12px;
}

.message-content h3 {
    font-size: 14px;
}

.message-content p {
    margin-top: 1em;
}

.reasoning-content {
    background-color: #f5f5f5;
    color: #666;
    padding: 10px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.reasoning-header {
    display: flex;
    align-items: center;
    padding: 5px 0;
    background-color: #f0f0f0;
    border-radius: 5px;
    margin-bottom: 5px;
    cursor: pointer;
}

.reasoning-header span {
    font-weight: bold;
}

.arrow-icon {
    width: 8px;
    height: 8px;
    border-right: 2px solid #333; /* 箭头右侧边 */
    border-bottom: 2px solid #333; /* 箭头底部边 */
    transform: rotate(-45deg); /* 初始状态为向右的箭头 */
    transform-origin: center; /* 确保旋转中心是箭头的中心 */
    transition: transform 0.2s ease; /* 添加过渡动画 */
    cursor: pointer;
    margin-left: 5px;
    position: relative; /* 相对定位，方便调整 */
    top: -1.1px; /* 初始位置 */
}

.arrow-icon.expanded {
    transform: rotate(45deg); /* 展开状态为向下的箭头 */
    top: -3px; /* 微调位置，确保垂直居中 */
}

.message.user .message-content {
    background-color: #0094E7;
    color: #fff;
}

.input-container {
    display: flex;
    padding: 10px;
    background-color: #f9f9f9;
    align-items: center;
}

#user-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 10px;
    outline: none;
    resize: none;
    height: 40px;
    min-height: 40px;
    max-height: 96px;
    overflow-y: hidden;
}
#char-count {
    margin-left: auto; /* 将计数器推到最右边 */
    margin-right: 10px; /* 根据需要调整与按钮的距离 */
    background-color: #fff;
}
#translate-btn {
    padding: 10px 20px;
    background-color: #0094e7;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    z-index: 999;
}

#translate-btn:hover {
    background-color: #0081C8FF;
}

/* 禁用状态下的样式 */
#translate-btn:disabled {
    background-color: #9bcdea; /* 或者其他你希望的颜色 */
    cursor: not-allowed;
}

.keyword-options {
    display: flex;
    flex-direction: column;
}

/* 关键词选项样式 */
.keyword-option {
    font-size: 14px;
    margin: 5px 0;
    padding: 5px 10px;
    /*background-color: #e1f5fe;*/
    border: 1px solid #0094e7;
    color: #0094e7;
    border-radius: 30px;
    cursor: pointer;
    transition: background-color 0.3s;
    text-align: left;
    display: inline-block;
}

.keyword-option:hover {
    background-color: #0094e7;
    color: #FFFFFF;
}

/* 欢迎语样式 */
.welcome-message {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 10px;
}

/* 提示信息样式 */
.prompt-message {
    font-size: 14px;
    line-height: 1.6 !important;
    color: #666;
    margin-bottom: 10px;
}

.prompt-message .remark {
    font-size: 13px;
    font-family: 仿宋, serif;
}

.J-translate table {
    width: 100%;
    border-collapse: collapse;
}

.J-translate th, .J-translate td {
    border: 1px solid #ddd;
    padding: 8px;
}

.J-translate th {
    background-color: #f2f2f2;
    text-align: left;
}

/* 小屏幕（笔记本） */
@media (max-width: 1199.98px) {
    /*搜索结果*/
    .ai-chat-container {
        width: 90%; /* 占用 80% 的屏幕宽度 */
        max-width: 800px;
        min-height: 350px; /* 根据需要调整 */
    }

}

/*!* 中等屏幕（桌面） *!*/
@media (min-width: 1200px) and (max-width: 1399.98px) {
    /*搜索结果*/
    .ai-chat-container {
        width: 100%; /* 占用 70% 的屏幕宽度 */
        max-width: 800px;
        min-height: 400px; /* 保持原始高度或根据需要调整 */
    }

}

/*!* 大屏幕（大桌面） *!*/
@media (min-width: 1400px) and (max-width: 1919.98px) {
    /*搜索结果*/
    .ai-chat-container {
        width: 100%; /* 占用 60% 的屏幕宽度 */
        max-width: 800px;
        min-height: 400px; /* 根据需要调整 */
    }

}

/*!* 超大屏幕（非常大的桌面） *!*/
@media (min-width: 1920px) {
    /*搜索结果*/
    .ai-chat-container {
        width: 100%; /* 占用 50% 的屏幕宽度 */
        max-width: 800px;
        min-height: 400px; /* 根据需要调整 */
    }
}