/* 通用样式 - 用于所有页面 */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --bg-color: #f4f7fa;
    --card-bg: #ffffff;
    --text-color: #212529;
    --text-muted-color: #6c757d;
    --border-color: #dee2e6;
    --user-msg-bg: #e3f2fd;
    --assistant-msg-bg: #f8f9fa;
    --shadow-sm: 0 .125rem .25rem rgba(0,0,0,.075);
    --shadow: 0 .5rem 1rem rgba(0,0,0,.1);
    --shadow-lg: 0 1rem 2rem rgba(0,0,0,.15);
    --transition: all 0.3s ease;
    --container-width: 1320px; /* 确保所有页面宽度一致 */
    --content-min-height: 600px; /* 确保所有页面最小高度一致 */
}

body {
    background-color: var(--bg-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-color);
    line-height: 1.4;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.main-content {
    flex: 1;
    min-height: calc(90vh - 80px); /* 占用90%屏幕高度，减去导航栏高度 */
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

.container {
    max-width: var(--container-width);
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

.container-fluid {
    max-height: 100%;
    overflow-y: auto;
}

/* 导航栏 */
.navbar {
    box-shadow: var(--shadow);
}

.navbar-brand {
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* 页面标题 */
.page-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.page-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    margin-bottom: 0;
}

.page-title i {
    font-size: 1.4rem;
    margin-right: 0.75rem;
}

/* 卡片 */
.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
    background-color: var(--card-bg);
    transition: var(--transition);
    margin-bottom: 1rem;
}

.card:hover {
    box-shadow: var(--shadow);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
}

.card-header.bg-primary {
    background: linear-gradient(135deg, var(--primary-color), #0b5ed7) !important;
    color: white;
    border-radius: 0.75rem 0.75rem 0 0 !important;
}

.card-title {
    font-weight: 600;
    margin-bottom: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.card-title i {
    margin-right: 0.75rem;
    font-size: 1.25rem;
}

.card-body {
    padding: 1rem 1.25rem;
}

/* 表单控件 */
.form-label {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-control, .form-select {
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    font-size: 0.9rem;
}

.form-control-sm, .form-select-sm {
    padding: 0.375rem 0.5rem;
    font-size: 0.85rem;
}

/* 按钮 */
.btn {
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #0b5ed7);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0b5ed7, #094bac);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #157347);
    border: none;
}

.btn-success:hover {
    background: linear-gradient(135deg, #157347, #125c3b);
    transform: translateY(-2px);
}

.btn-outline-primary {
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.btn-outline-secondary {
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
}

.btn-outline-secondary:hover {
    background-color: var(--secondary-color);
    color: white;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.85rem;
}

/* 导航标签 */
.nav-tabs {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.nav-tabs .nav-link {
    border: none;
    color: var(--text-muted-color);
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem 0.375rem 0 0;
    transition: var(--transition);
    font-size: 0.9rem;
}

.nav-tabs .nav-link:hover {
    color: var(--primary-color);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    background-color: transparent;
}

/* 进度条 */
.progress {
    height: 0.75rem;
    border-radius: 0.375rem;
    background-color: #e9ecef;
    margin-top: 0.5rem;
}

.progress-bar {
    background: linear-gradient(135deg, var(--primary-color), #0b5ed7);
}

/* 复选框 */
.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-switch .form-check-input {
    width: 2.5em;
    height: 1.25em;
}

.form-check-label {
    margin-left: 0.25rem;
}

/* 表格 */
.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    background-color: rgba(248, 249, 250, 0.7);
    font-weight: 600;
    color: var(--text-muted-color);
    padding: 0.75rem 1rem;
}

.table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* 提示框 */
.alert {
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    border: none;
    box-shadow: var(--shadow-sm);
    font-size: 0.9rem;
}

.alert-success {
    background-color: rgba(25, 135, 84, 0.1);
    color: #155724;
}

.alert-info {
    background-color: rgba(13, 202, 240, 0.1);
    color: #0c5460;
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: #856404;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: #721c24;
}

/* 代码 */
code {
    background-color: rgba(108, 117, 125, 0.1);
    color: var(--secondary-color);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
}

/* 页脚 */
footer {
    background: linear-gradient(135deg, #212529, #343a40);
    margin-top: 3rem;
    padding: 2rem 0;
}

/* 图标 */
.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(13, 110, 253, 0.1);
    color: var(--primary-color);
    font-size: 1.25rem;
    margin-right: 1rem;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    margin-right: 0.75rem;
}

/* 信息卡片 */
.info-card {
    background-color: rgba(248, 249, 250, 0.5);
    border-radius: 0.5rem;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
}

/* 响应式调整 */
@media (max-width: 992px) {
    .page-title {
        font-size: 1.5rem;
    }
    
    .container {
        width: 100%;
        padding-right: 10px;
        padding-left: 10px;
    }
}

/* 聊天相关样式 */
.chat-container {
    height: 500px;
    overflow-y: auto;
    padding: 1rem;
    border-radius: 0.75rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.message {
    margin-bottom: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    position: relative;
    max-width: 85%;
    box-shadow: var(--shadow-sm);
    line-height: 1.5;
}

.user-message {
    background-color: var(--user-msg-bg);
    margin-left: auto;
    margin-right: 1rem;
    border-bottom-right-radius: 0;
    color: #0a58ca;
}

.assistant-message {
    background-color: var(--assistant-msg-bg);
    margin-right: auto;
    margin-left: 1rem;
    border-bottom-left-radius: 0;
}

.user-message::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: -10px;
    width: 0;
    height: 0;
    border-left: 10px solid var(--user-msg-bg);
    border-top: 10px solid transparent;
}

.assistant-message::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: -10px;
    width: 0;
    height: 0;
    border-right: 10px solid var(--assistant-msg-bg);
    border-top: 10px solid transparent;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    bottom: 0;
    font-size: 1.25rem;
}

.user-avatar {
    background-color: rgba(13, 110, 253, 0.1);
    color: var(--primary-color);
    right: -50px;
}

.assistant-avatar {
    background-color: rgba(108, 117, 125, 0.1);
    color: var(--secondary-color);
    left: -50px;
}

.typing-indicator {
    display: inline-block;
    margin-left: 4px;
}

.typing-indicator span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: #666;
    border-radius: 50%;
    margin: 0 2px;
    animation: typing 1s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.rag-options {
    background-color: rgba(248, 249, 250, 0.5);
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.rag-options-title {
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.rag-options-title i {
    margin-right: 0.5rem;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.input-group {
    box-shadow: var(--shadow);
    border-radius: 0.5rem;
    overflow: hidden;
}

.input-group .form-control {
    border-right: none;
}

.input-group .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* EasyMDE 编辑器自定义样式 */
.EasyMDEContainer {
    border-radius: 0.5rem;
    overflow: hidden;
}

.editor-toolbar {
    border-radius: 0.5rem 0.5rem 0 0;
    border-color: var(--border-color);
    background-color: #f8f9fa;
}

.CodeMirror {
    border-radius: 0 0 0.5rem 0.5rem;
    border-color: var(--border-color);
}

.editor-statusbar {
    padding: 0.5rem;
    color: var(--text-muted-color);
}

@media (max-width: 992px) {
    .message {
        max-width: 90%;
    }
    
    .user-message {
        margin-right: 0.5rem;
    }
    
    .assistant-message {
        margin-left: 0.5rem;
    }
    
    .message-avatar {
        display: none;
    }
}

/* 参考信息样式 */
.references-section {
    background-color: rgba(13, 110, 253, 0.05);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
    border-left: 3px solid var(--primary-color);
    cursor: pointer;
    transition: var(--transition);
}

.references-header {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.references-header::after {
    content: "\F282"; /* Bootstrap 图标的箭头代码 */
    font-family: "bootstrap-icons";
    transition: transform 0.3s ease;
}

.references-section.expanded .references-header::after {
    transform: rotate(180deg);
}

.references-list {
    display: none;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.75rem;
    overflow: hidden;
}

.references-section.expanded .references-list {
    display: flex;
}

.reference-item {
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 0.5rem;
    padding: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.reference-title {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.reference-content {
    color: var(--text-muted-color);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* 表格压缩 */
.table-sm th, .table-sm td {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
} 