/**
 * 专家角色管理系统样式表
 */

/* 全局样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* 登录页面样式 */
.login-page {
    display: flex;
    align-items: center;
    min-height: 100vh;
    background-color: #f5f5f5;
}

.login-card {
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-top: -100px;
}

/* 主界面样式 */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
    background-color: #f8f9fa;
    overflow-y: auto;
    height: 100vh;
}

.sidebar-header {
    border-bottom: 1px solid #e9ecef;
}

#mainContent {
    padding-top: 20px;
}

/* 响应式调整 */
@media (max-width: 767.98px) {
    .sidebar {
        position: static;
        height: auto;
        padding-bottom: 20px;
    }
}

/* 文本区域样式 */
textarea {
    font-family: 'Consolas', 'Courier New', monospace;
    resize: vertical;
}

/* 自动扩展文本区域 */
.auto-expand {
    overflow: hidden; /* 隐藏滚动条 */
    resize: none; /* 禁止手动调整大小 */
    min-height: 100px; /* 最小高度 */
}

/* 复制按钮容器 */
.copyable-response-wrapper {
    position: relative;
}

#copyResponseBtn {
    transition: all 0.2s ease;
}

#copyResponseBtn:hover {
    background-color: #f0f0f0;
}

#copyResponseBtn:active {
    transform: scale(0.95);
}

/* 预格式化文本 */
pre {
    background-color: #f8f9fa;
    border: 1px solid #eaecef;
    border-radius: 3px;
    padding: 10px;
    font-size: 14px;
    overflow-x: auto;
}

/* LLM响应样式 */
#llmResponse {
    font-size: 16px;
    line-height: 1.6;
    white-space: pre-wrap;
    max-width: 100%;
    overflow-x: auto;
}

/* 角色头像预览 */
.avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #ddd;
}

/* GitHub风格的Markdown样式 */
.markdown-body {
    box-sizing: border-box;
    min-width: 200px;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    color: #333;
    line-height: 1.6;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3,
.markdown-body h4, .markdown-body h5, .markdown-body h6 {
    color: #5d4037;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 16px;
}

.markdown-body h1 {
    font-size: 2em;
}

.markdown-body h2 {
    font-size: 1.6em;
    border-bottom: 1px solid #eaecef;
    padding-bottom: 0.3em;
}

/* 列表样式 */
.markdown-body ul {
    padding-left: 2em;
}

.markdown-body ul li {
    position: relative;
    list-style-type: none;
    margin-bottom: 8px;
}

.markdown-body ul li:before {
    content: "•";
    color: #e0e0e0;
    font-size: 1.2em;
    position: absolute;
    left: -1.2em;
}

/* 表格样式 */
.markdown-body table {
    display: table;
    width: auto;
    margin-left: 0;
    margin-right: auto;
    border-spacing: 0;
    border-collapse: separate;
    table-layout: auto;
}

.markdown-body table th,
.markdown-body table td {
    padding: 6px 13px;
    border: 1px solid #dfe2e5;
    white-space: nowrap;
}

.markdown-body table th {
    background-color: #f0f0f0;
}

.markdown-body table td {
    background-color: #ffffff;
}

.markdown-body table tr {
    background-color: #ffffff;
}

/* 图片样式 */
.markdown-body img {
    max-width: 100%;
    display: block;
    border-style: none;
    box-sizing: content-box;
    margin: 24px 0;
}

/* 代码块样式 */
.markdown-body pre {
    background-color: #f6f8fa;
    border-radius: 3px;
    padding: 16px;
    overflow: auto;
    line-height: 1.45;
    margin-bottom: 16px;
}

.markdown-body code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    background-color: rgba(27, 31, 35, 0.05);
    border-radius: 3px;
    padding: 0.2em 0.4em;
    font-size: 85%;
}

.markdown-body pre > code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    font-size: 100%;
}

/* XML内容展示样式 */
.xml-content {
    font-family: monospace;
    max-width: 100%;
    overflow-x: auto;
    margin-bottom: 20px;
}

.markdown-content {
    margin: 15px 0;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

/* XML渲染器样式 */
.xml-renderer {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #333;
    padding: 15px;
}

.xml-renderer .agent-output-data {
    display: block;
}

.xml-renderer .section {
    margin-bottom: 20px;
    border-bottom: 1px solid #eaecef;
    padding-bottom: 15px;
}

.xml-renderer .section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.xml-renderer .section-title {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 1.1rem;
    color: #0366d6;
}

.xml-renderer .section-content {
    line-height: 1.6;
    margin-left: 10px;
}

.xml-renderer .xml-tag {
    font-family: monospace;
    background-color: #f6f8fa;
    padding: 2px 4px;
    border-radius: 3px;
    color: #d73a49;
}

.xml-renderer .highlight {
    background-color: #fffacd;
    padding: 2px;
    border-radius: 2px;
}

.xml-renderer code {
    background-color: #f5f5f5;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
    font-size: 0.9em;
}

.xml-renderer pre {
    background-color: #f5f5f5;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 10px 0;
}

.xml-renderer table {
    border-collapse: collapse;
    width: 100%;
    margin: 10px 0;
}

.xml-renderer th, 
.xml-renderer td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.xml-renderer th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.xml-renderer tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* 表格样式 */
.xml-renderer .xml-table {
    border-collapse: collapse;
    width: 100%;
    margin: 15px 0;
    font-size: 0.95em;
}

.xml-renderer .xml-table th,
.xml-renderer .xml-table td {
    border: 1px solid #dfe2e5;
    padding: 8px 12px;
}

.xml-renderer .xml-table th {
    background-color: #f8f8f8;
    font-weight: 600;
    text-align: left;
}

.xml-renderer .xml-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

/* 批量管理页面样式 */
.filter-container {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.filter-container .input-group-text {
    font-size: 0.875rem;
    font-weight: 500;
    background-color: #e9ecef;
    border-color: #ced4da;
    white-space: nowrap;
    min-width: auto;
}

.filter-container .form-control,
.filter-container .form-select {
    font-size: 0.875rem;
}

/* 表格样式优化 */
.roles-table {
    font-size: 0.875rem;
}

.roles-table th {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    font-weight: 600;
    white-space: nowrap;
    vertical-align: middle;
}

.roles-table td {
    vertical-align: middle;
    border-color: #dee2e6;
}

.roles-table .btn-link {
    padding: 0.125rem 0.25rem;
    font-size: 0.75rem;
}

/* 角色描述列样式 */
.roles-table td:nth-child(3) {
    word-wrap: break-word;
    word-break: break-word;
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.roles-table td:nth-child(3):hover {
    white-space: normal;
    overflow: visible;
    position: relative;
    z-index: 10;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border-radius: 4px;
    padding: 8px;
}

/* 响应式优化 */
@media (max-width: 1199.98px) {
    .filter-container .col-lg-1 {
        flex: 0 0 auto;
        width: 16.66666667%;
    }

    .filter-container .col-lg-2 {
        flex: 0 0 auto;
        width: 16.66666667%;
    }

    .filter-container .col-lg-3 {
        flex: 0 0 auto;
        width: 25%;
    }
}

@media (max-width: 767.98px) {
    .filter-container .row {
        --bs-gutter-x: 0.5rem;
    }

    .filter-container .input-group-text {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    .filter-container .form-control,
    .filter-container .form-select {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    .roles-table {
        font-size: 0.75rem;
    }

    .roles-table th,
    .roles-table td {
        padding: 0.5rem 0.25rem;
    }
}

/* 状态图标 */
.xml-renderer .status-icon {
    display: flex;
    align-items: center;
    font-weight: 500;
}

.xml-renderer .status-icon i {
    margin-right: 8px;
    font-size: 1.2em;
}

/* 结论块 */
.xml-renderer .conclusion-block {
    background-color: #f8f9fa;
    border-left: 4px solid #0366d6;
    padding: 12px 15px;
    margin: 15px 0;
}

.xml-renderer .conclusion-label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #0366d6;
}

.xml-renderer .conclusion-text {
    color: #333;
}

/* 渲染模式切换选项卡 */
.render-mode-tabs {
    margin: 15px 0;
    border-bottom: 1px solid #dee2e6;
}

.render-mode-tabs .nav-link {
    font-weight: 500;
    color: #495057;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    margin-right: 5px;
    transition: all 0.2s ease;
}

.render-mode-tabs .nav-link:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6 #dee2e6 #fff;
}

.render-mode-tabs .nav-link.active {
    color: #007bff;
    background-color: #fff;
    border-color: #dee2e6 #dee2e6 #fff;
}

/* 增加XML和Markdown渲染区域的边距 */
#markdown-content, #xml-content {
    padding-top: 10px;
}

/* 自动联想下拉框样式 */
.suggestion-dropdown {
    position: absolute;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background-color: white;
    border: 1px solid #ced4da;
    border-radius: 0 0 0.25rem 0.25rem;
    z-index: 1050;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background-color: #f8f9fa;
}

.suggestion-item.selected {
    background-color: #e9ecef;
}

.suggestion-item .agent-id {
    font-weight: bold;
    margin-right: 8px;
    color: #495057;
}

.suggestion-item .agent-name {
    color: #6c757d;
}

.suggestion-item .agent-desc {
    display: block;
    font-size: 0.85em;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 添加输入框加载状态的样式 */
.loading-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%23aaa' d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z'/%3E%3Cpath fill='%23aaa' d='M12 4v2' transform='rotate(0, 12, 12)'%3E%3CanimateTransform attributeName='transform' attributeType='XML' type='rotate' from='0 12 12' to='360 12 12' dur='1s' repeatCount='indefinite'/%3E%3C/path%3E%3C/svg%3E");
    background-position: right 10px center;
    background-repeat: no-repeat;
    background-size: 16px;
    opacity: 0.7;
}

/* 优化请求和优化后的系统提示词文本框样式 */
#optimizationRequest, #optimizedPrompt, #expectedResponse {
    font-family: 'Consolas', 'Courier New', monospace;
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 150px;
}

/* 优化后的系统提示词区域样式 */
#optimizedPromptSection {
    border-top: 1px solid #e9ecef;
    padding-top: 15px;
    margin-top: 15px;
}

/* 快捷文本块样式 */
.text-block-item {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    cursor: pointer;
    border-radius: 0.25rem;
    transition: all 0.2s ease-in-out;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative; /* 添加相对定位以支持删除按钮的绝对定位 */
}

.text-block-item:hover {
    background-color: #f0f0f0;
    border-color: #6c757d;
}

.text-block-delete {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 0 3px rgba(0,0,0,0.3);
}

.text-block-item:hover .text-block-delete {
    opacity: 1;
}

.text-block-delete:hover {
    background-color: #bd2130;
    transform: scale(1.2);
    box-shadow: 0 0 5px rgba(0,0,0,0.4);
}

/* 确保删除按钮不受父元素的pointer-events影响 */
.text-block-delete, 
.text-block-delete * {
    pointer-events: auto;
}

.suggestion-dropdown {
    position: absolute;
    z-index: 1000;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 0.25rem;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    width: 100%;
}

.text-content {
    margin-top: 0.5rem;
    white-space: pre-line;
    font-size: 0.875rem;
    color: #555;
    max-height: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    border-left: 3px solid #f0f0f0;
    padding-left: 0.5rem;
}

/* 系统提示词批量核查系统链接样式 */
#verifySystemLink {
    color: #6c757d;
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    transition: all 0.3s;
}

#verifySystemLink:hover {
    color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.05);
}

#verifySystemLink i {
    margin-right: 10px;
}

.mt-auto {
    margin-top: auto !important;
}

.border-top {
    border-top: 1px solid #dee2e6 !important;
} 