/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f5;
}

/* 主面板布局 */
.main-panel {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

.left-panel {
    display: flex;
    flex-direction: column;
    width: 40%;
    height: 100%;
    border-right: 1px solid #ddd;
    background-color: #fff;
}

.right-panel {
    width: 60%;
    height: 100%;
    background-color: #fff;
    display: flex;
    flex-direction: column;
}

/* 代码面板样式 */
.code-panel {
    display: flex;
    flex-direction: column;
    height: 33%;
    border-bottom: 1px solid #ddd;
    overflow: hidden;
    position: relative;
}

.text-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.message-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    border-bottom: 1px solid #ddd;
    overflow: hidden;
}

/* 面板通用样式 */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: #f8f8f8;
    border-bottom: 1px solid #ddd;
    font-weight: bold;
}

.panel-content {
    flex: 1;
    overflow: auto;
    padding: 10px;
}

/* 右侧预览面板特有样式 */
#rightPanel_Content {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    margin: 1rem;
    text-align: center;
}

/* 工具按钮样式 */
.tools {
    display: flex;
    align-items: center;
}

.tool-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    font-size: 16px;
    color: #666;
}

.tool-btn:hover {
    color: #1890ff;
    background-color: rgba(24, 144, 255, 0.1);
}

.separator {
    width: 1px;
    height: 18px;
    background-color: #ddd;
    margin: 0 8px;
}

/* 表单样式 */
.input-form {
    padding: 10px;
    border-top: 1px solid #ddd;
}

textarea {
    width: 100%;
    height: 80px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    resize: vertical;
    font-family: inherit;
    margin-bottom: 10px;
}

.toolbar {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.btn {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f5f5f5;
    cursor: pointer;
    font-size: 14px;
}

.btn:hover {
    background-color: #e6e6e6;
}

.btn.primary {
    background-color: #1890ff;
    color: white;
    border-color: #1890ff;
}

.btn.primary:hover {
    background-color: #40a9ff;
}

/* 复制按钮样式 */
.btn.clipboard {
    background-color: #546de5;
    color: white;
    margin-right: 10px;
}

.btn.clipboard:hover {
    background-color: #3742a7;
}

.btn.clipboard i {
    margin-right: 5px;
}

/* 图标样式 */
[class^="icon-"] {
    font-style: normal;
    margin-right: 5px;
}

.icon-edit::before { content: "✎"; }
.icon-copy::before { content: "📋"; }
.icon-refresh::before { content: "⟳"; }
.icon-send::before { content: "↑"; }
.icon-left::before { content: "←"; }
.icon-right::before { content: "→"; }
.icon-back::before { content: "↩"; }
.icon-file::before { content: "⛶"; }
.icon-image::before { content: "🖼"; }
.icon-check::before { content: "✓"; }
.icon-close::before { content: "✕"; }
.icon-eye::before { content: "👁"; }
.icon-expand::before { content: "⤢"; }
.icon-collapse::before { content: "⤡"; }
.icon-settings::before { content: "⚙"; }
.icon-edit-alt::before { content: "✏"; }
.icon-delete::before { content: "🗑"; }

/* 隐藏发送按钮右侧的方向选择器 */
.toolbar .direction-selector {
    display: none; /* 默认隐藏所有方向选择器 */
}

/* 只在选择flowchart类型且渲染类型为mermaid时显示方向选择器 */
.toolbar.mermaid-mode.flowchart-selected .direction-selector:not(.duplicate) {
    display: flex; /* 显示非重复的方向选择器 */
}

/* 确保重复的方向选择器始终隐藏 */
.toolbar .direction-selector.duplicate {
    display: none !important;
}

/* 历史消息样式 */
.history {
    margin: 1rem;
    border: 1px solid #ccc;
    padding: 0.5rem;
    border-radius: 5px;
    background: #eee;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history.active {
    border-width: 2px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1), 0 6px 10px rgba(0, 0, 0, 0.1);
}

/* 历史消息内容 */
.history-content {
    word-break: break-word;
    line-height: 1.5;
}

/* 历史消息元数据 */
.history-metadata {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
    border-top: 1px dashed #ddd;
    padding-top: 5px;
}

.history-timestamp {
    color: #888;
}

.history-type {
    font-weight: bold;
    color: #1890ff;
}

/* 历史消息操作按钮样式 */
.history-actions {
    position: absolute;
    top: 5px;
    right: 5px;
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.history:hover .history-actions {
    opacity: 1;
}

.history-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 5px;
    color: #666;
    border-radius: 3px;
    display: flex;
    align-items: center;
    font-size: 12px;
}

.history-action-btn:hover {
    background-color: rgba(24, 144, 255, 0.1);
    color: #1890ff;
}

.history-action-btn.copy {
    color: #52c41a;
}

.history-action-btn.edit {
    color: #1890ff;
}

.history-action-btn.delete {
    color: #ff4d4f;
}

.history-action-btn.copy:hover {
    background-color: rgba(82, 196, 26, 0.1);
}

.history-action-btn.edit:hover {
    background-color: rgba(24, 144, 255, 0.1);
}

.history-action-btn.delete:hover {
    background-color: rgba(255, 77, 79, 0.1);
}

/* 渲染类型选择器样式 */
.render-type-selector {
    display: flex;
    align-items: center;
    margin-right: 5px;
}

.render-type-selector select {
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    font-size: 14px;
    cursor: pointer;
    min-width: 150px;
}

/* 图表类型选择器样式 */
.chart-type-selector {
    display: flex;
    align-items: center;
    margin-right: 5px;
}

.chart-type-selector select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    font-size: 14px;
    cursor: pointer;
    min-width: 120px;
}

/* 代码和Mermaid样式 */
pre {
    margin: 0px;
    text-align: left;
    overflow: auto;
    position: relative;
}

.hljs {
    background-color: unset;
}

.hljs-ln {
    padding-bottom: 1.2rem;
    margin: 0rem !important;
}

.hljs-ln td {
    border: none !important;
    padding: 2px 6px !important;
    line-height: 1.2rem;
    font-size: 1rem;
}

.hljs-ln tr td:first-child {
    color: cadetblue;
    border-right: 1px solid !important;
}

.hljs-ln tr {
    border: none !important;
}

/* Mermaid 相关样式 */
#mermaidSvg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-width: 100% !important;
}

/* 下拉菜单 */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 4px;
}

.dropdown-content button {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
    width: 100%;
    border: none;
    background: none;
    cursor: pointer;
}

.dropdown-content button:hover {
    background-color: #f1f1f1;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* 错误信息样式 */
.errordiv {
    text-align: left;
    font-size: 1.1rem;
    line-height: 1.5rem;
    position: absolute;
    z-index: 999;
    padding: 5px;
    background: rgba(221, 221, 221, 0.8);
    border-radius: 4px;
    top: 1rem;
}

/* 加载中遮罩 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 2s linear infinite;
}

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

.loading-text {
    color: white;
    margin-top: 10px;
    font-size: 16px;
}

.hidden {
    display: none;
}

/* 响应式布局 */
@media (max-width: 768px) {
    .main-panel {
        flex-direction: column;
    }
    
    .left-panel, .right-panel {
        width: 100%;
        height: 50%;
    }
    
    .left-panel {
        border-right: none;
        border-bottom: 1px solid #ddd;
    }
}

/* 代码编辑器样式 */
.edit-code-btn {
    margin-bottom: 10px;
    padding: 6px 12px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.edit-code-btn:hover {
    background-color: #e0e0e0;
}

.code-editor-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0;
    margin: 0;
}

.code-editor {
    flex: 1;
    width: 100%;
    min-height: 150px;
    padding: 10px;
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
    font-size: 14px;
    line-height: 1.4;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f8f8f8;
    resize: none;
    white-space: pre;
    tab-size: 4;
    overflow: auto;
}

.editor-toolbar {
    display: flex;
    gap: 8px;
    padding: 8px 0;
    justify-content: flex-end;
}

/* 扩展/缩放代码区域 */
.pre-controls {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 10;
}

.pre-control-btn {
    background-color: rgba(240, 240, 240, 0.7);
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 3px 6px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 5px;
}

.pre-control-btn:hover {
    background-color: rgba(220, 220, 220, 0.9);
}

/* 展开状态的代码块 */
.pre-expanded {
    position: fixed;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    background: white;
    z-index: 1000;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    overflow: auto;
    padding: 15px;
    max-height: none;
    max-width: none;
    width: auto;
    height: auto;
}

/* 代码块悬停效果 */
pre:hover .pre-controls {
    display: flex;
}

/* 默认情况下隐藏控制按钮 */
.pre-controls {
    display: none;
}

/* API类型切换按钮 */
.api-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
}

.api-toggle-btn {
    padding: 8px 16px;
    background-color: #1890ff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.api-toggle-btn:hover {
    background-color: #40a9ff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 模型选择器样式 */
.model-selector {
    display: flex;
    align-items: center;
    margin-right: 10px;
}

.model-selector select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f5f5f5;
    cursor: pointer;
    font-size: 14px;
    min-width: 150px;
}

.navigation-buttons {
    display: flex;
    align-items: center;
}

/* 模型配置面板 */
.model-config-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.model-config-panel.visible {
    opacity: 1;
    visibility: visible;
}

.model-config-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.model-config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background-color: #f8f8f8;
    border-bottom: 1px solid #ddd;
}

.model-config-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
    font-weight: 600;
}

.model-config-header .close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
}

.model-config-header .close-btn:hover {
    color: #333;
}

.model-config-body {
    display: flex;
    padding: 0;
    overflow: auto;
    flex: 1;
}

.model-list {
    width: 280px;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: #f5f5f5;
}

.model-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #ddd;
    background-color: #f0f0f0;
}

.model-list-header h4 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.add-model-btn {
    padding: 4px 10px;
    background-color: #1890ff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.add-model-btn:hover {
    background-color: #40a9ff;
}

.model-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.model-item {
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    background-color: white;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.model-item:hover {
    background-color: #f9f9f9;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.model-item.active {
    border-color: #1890ff;
    background-color: #e6f7ff;
    box-shadow: 0 2px 8px rgba(24,144,255,0.2);
}

.model-item-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
}

.model-item-type {
    font-size: 12px;
    color: #888;
}

.model-item-actions {
    display: flex;
    gap: 5px;
}

.model-item-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #888;
    padding: 4px;
    border-radius: 3px;
    transition: all 0.2s;
}

.model-item-actions button:hover {
    color: #333;
    background-color: #f0f0f0;
}

.model-edit {
    flex: 1;
    padding: 20px;
    overflow: auto;
}

.model-edit h4 {
    margin: 0 0 20px 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #1890ff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.form-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* 流程图方向选择器 */
.direction-selector {
    display: flex;
    align-items: center;
}

.direction-selector select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f5f5f5;
    font-size: 14px;
    min-width: 150px;
}

/* 提示词选择器 */
.prompt-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.prompt-selector select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f5f5f5;
    font-size: 14px;
    min-width: 150px;
}

.prompt-manage-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    color: #666;
}

.prompt-manage-btn:hover {
    color: #1890ff;
}

/* 提示词配置面板 */
.prompt-config-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.prompt-config-panel.visible {
    opacity: 1;
    visibility: visible;
}

.prompt-config-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.prompt-config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background-color: #f8f8f8;
    border-bottom: 1px solid #ddd;
}

.prompt-config-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
    font-weight: 600;
}

.prompt-config-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.prompt-config-header .reset-btn {
    background-color: #ff9800;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.prompt-config-header .reset-btn:hover {
    background-color: #f57c00;
}

.prompt-config-header .close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
}

.prompt-config-header .close-btn:hover {
    color: #333;
}

.prompt-config-body {
    display: flex;
    overflow: hidden;
    flex: 1;
}

.prompt-list {
    width: 280px;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: #f5f5f5;
}

.prompt-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #ddd;
    background-color: #f0f0f0;
}

.prompt-list-header h4 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.add-prompt-btn {
    padding: 4px 10px;
    background-color: #1890ff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.add-prompt-btn:hover {
    background-color: #40a9ff;
}

.prompt-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.prompt-item {
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    background-color: white;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.prompt-item:hover {
    background-color: #f9f9f9;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.prompt-item.active {
    border-color: #1890ff;
    background-color: #e6f7ff;
    box-shadow: 0 2px 8px rgba(24,144,255,0.2);
}

.prompt-item-info {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
    color: #333;
}

.prompt-item-actions {
    display: flex;
    align-items: center;
}

.prompt-item-actions button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #888;
    font-size: 14px;
    opacity: 0.7;
    border-radius: 3px;
    transition: all 0.2s;
}

.prompt-item-actions button:hover {
    opacity: 1;
    background-color: #f0f0f0;
}

.prompt-edit {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.prompt-edit h4 {
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.prompt-edit .form-group {
    margin-bottom: 20px;
}

.prompt-content-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.prompt-edit textarea {
    flex: 1;
    min-height: 200px;
    resize: none;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.6;
    transition: border-color 0.3s;
}

#promptEditForm {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 图表配置面板 */
.chart-config-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.chart-config-panel.visible {
    opacity: 1;
    visibility: visible;
}

.chart-config-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chart-config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background-color: #f8f8f8;
    border-bottom: 1px solid #ddd;
}

.chart-config-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
    font-weight: 600;
}

.chart-config-header .close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
}

.chart-config-header .close-btn:hover {
    color: #333;
}

.chart-config-body {
    display: flex;
    overflow: hidden;
    flex: 1;
}

.chart-list {
    width: 280px;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: #f5f5f5;
}

.chart-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #ddd;
    background-color: #f0f0f0;
}

.chart-list-header h4 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.add-chart-btn {
    padding: 4px 10px;
    background-color: #1890ff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.add-chart-btn:hover {
    background-color: #40a9ff;
}

.chart-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.chart-item {
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    background-color: white;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.chart-item:hover {
    background-color: #f9f9f9;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.chart-item.active {
    border-color: #1890ff;
    background-color: #e6f7ff;
    box-shadow: 0 2px 8px rgba(24,144,255,0.2);
}

.chart-item-info {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
    color: #333;
}

.chart-item-actions {
    display: flex;
    align-items: center;
}

.chart-item-actions button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #888;
    font-size: 14px;
    opacity: 0.7;
    border-radius: 3px;
    transition: all 0.2s;
}

.chart-item-actions button:hover {
    opacity: 1;
    background-color: #f0f0f0;
}

.chart-edit {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chart-edit h4 {
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.chart-edit .form-group {
    margin-bottom: 20px;
}

.chart-description-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.chart-edit textarea {
    flex: 1;
    min-height: 120px;
    resize: none;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    transition: border-color 0.3s;
}

#chartEditForm {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* SVG 包装器样式 */
.svg-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.svg-wrapper svg {
    max-width: 100%;
    max-height: 100%;
}

/* 拖拽调整大小样式 */
.resizable {
    position: relative;
}

.resizer {
    position: absolute;
    background-color: rgba(200, 200, 200, 0.5);
    z-index: 10;
    transition: background-color 0.3s;
}

.resizer:hover, .resizer.active {
    background-color: rgba(100, 150, 220, 0.7);
}

.horizontal-resizer {
    height: 5px;
    left: 0;
    right: 0;
    bottom: 0;
    cursor: ns-resize;
}

.vertical-resizer {
    width: 5px;
    top: 0;
    right: 0;
    bottom: 0;
    cursor: ew-resize;
}

/* 确保文本区域可调整大小 */
textarea {
    width: 100%;
    height: 80px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    resize: vertical;
    font-family: inherit;
    margin-bottom: 10px;
}

/* 导出图片侧边栏样式 */
.export-side-panel {
    position: fixed;
    top: 0;
    right: -350px; /* 初始位置在屏幕外 */
    width: 350px;
    height: 100%;
    background-color: #fff;
    box-shadow: -3px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: right 0.3s ease-in-out;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.export-side-panel.open {
    right: 0; /* 打开状态 */
}

.export-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    background-color: #f8f8f8;
}

.export-panel-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.export-panel-header .close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.export-panel-header .close-btn:hover {
    color: #1890ff;
    background-color: rgba(24, 144, 255, 0.1);
}

.export-panel-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.export-form-group {
    margin-bottom: 20px;
}

.export-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.export-select,
.export-form-group input[type="number"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
}

.export-form-group input[type="color"] {
    width: 100%;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 2px;
    cursor: pointer;
}

.export-preview {
    margin-bottom: 25px;
}

.export-preview label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #333;
}

.preview-box {
    width: 100%;
    height: 150px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
    overflow: hidden;
}

.export-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .export-side-panel {
        width: 300px;
    }
}

/* 自定义确认对话框样式 */
.custom-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fade-in 0.2s ease-out;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.custom-dialog {
    background-color: white;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 400px;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: scale-in 0.2s ease-out;
}

@keyframes scale-in {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.custom-dialog-title {
    padding: 16px;
    font-size: 16px;
    font-weight: bold;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f8f8;
}

.custom-dialog-close {
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
}

.custom-dialog-close:hover {
    color: #999;
}

.custom-dialog-content {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
    line-height: 1.5;
}

.custom-dialog-buttons {
    padding: 10px 16px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px solid #eee;
    background-color: #f8f8f8;
}

.custom-dialog-button {
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid #ddd;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    background-color: white;
}

.custom-dialog-button:hover {
    background-color: #f5f5f5;
}

.custom-dialog-button.confirm-button {
    background-color: #1890ff;
    color: white;
    border-color: #1890ff;
}

.custom-dialog-button.confirm-button:hover {
    background-color: #40a9ff;
    border-color: #40a9ff;
}

.custom-dialog-button.cancel-button:hover {
    border-color: #ccc;
}

/* 自定义消息提示样式 */
.custom-message {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 250px;
    max-width: 450px;
    background-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    z-index: 10000;
    overflow: hidden;
    animation: slide-in 0.3s ease-out;
}

@keyframes slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.custom-message-title {
    padding: 10px 15px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.custom-message-content {
    padding: 15px;
    word-break: break-word;
}

.custom-message-close {
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
}

.custom-message-close:hover {
    color: #999;
}

.custom-message-info {
    border-top: 3px solid #1890ff;
}

.custom-message-info .custom-message-title {
    background-color: #e6f7ff;
    color: #1890ff;
}

.custom-message-success {
    border-top: 3px solid #52c41a;
}

.custom-message-success .custom-message-title {
    background-color: #f6ffed;
    color: #52c41a;
}

.custom-message-warning {
    border-top: 3px solid #faad14;
}

.custom-message-warning .custom-message-title {
    background-color: #fffbe6;
    color: #faad14;
}

.custom-message-error {
    border-top: 3px solid #f5222d;
}

.custom-message-error .custom-message-title {
    background-color: #fff1f0;
    color: #f5222d;
}

/* 确保datalist下拉列表可见 */
input[list] {
    position: relative;
}

datalist {
    position: absolute;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
}

/* 模型ID输入框样式 */
#modelId {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

#modelId:focus {
    border-color: #1890ff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

/* 模型编辑表单 */
#modelEditForm {
    /* 现有样式 */
}

/* 滑动条容器 */
.slider-container {
    width: 100%;
    position: relative;
    margin-top: 5px;
}

/* 滑动条样式 */
.slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #d3d3d3;
    outline: none;
    opacity: 0.7;
    -webkit-transition: .2s;
    transition: opacity .2s;
}

.slider:hover {
    opacity: 1;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1890ff;
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1890ff;
    cursor: pointer;
}

/* 滑动条下方的标签 */
.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 12px;
    color: #888;
}

/* 当前值显示 */
#maxTokensValue,
#temperatureValue {
    display: inline-block;
    margin-left: 8px;
    font-weight: normal;
    color: #1890ff;
} 