/**
 * AI 问答系统 - 自定义样式
 */

/* 全局样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 卡片样式优化 */
.card {
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-weight: 500;
}

/* 按钮样式 */
.btn {
    border-radius: 6px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-primary:hover {
    opacity: 0.9;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 表单样式 */
.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: #667eea;
}

/* 表格样式 */
.table th {
    font-weight: 600;
    color: #495057;
}

.table-hover tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

/* 徽章样式 */
.badge {
    font-weight: 500;
    padding: 0.4em 0.6em;
}

/* 模态框样式 */
.modal-content {
    border: none;
    border-radius: 12px;
}

.modal-header {
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.modal-footer {
    border-top: 1px solid rgba(0,0,0,0.05);
}

/* 导航栏样式 */
.navbar-brand {
    font-weight: 600;
}

/* 侧边栏样式 */
.sidebar .nav-link i {
    width: 24px;
    text-align: center;
    margin-right: 8px;
}

/* 统计卡片 */
.stat-card {
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

/* 对话历史项 */
.history-item {
    border-left: 3px solid transparent;
}

.history-item.active {
    border-left-color: #fff;
}

/* 消息样式 */
.message-content {
    word-wrap: break-word;
    max-width: 100%;
}

/* 加载动画 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.typing-indicator i {
    animation: pulse 1.5s infinite;
}

/* 代码块样式 */
pre {
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
}

code {
    color: #e83e8c;
    background-color: #f8f9fa;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .chat-container {
        height: calc(100vh - 56px);
    }
    
    .message {
        max-width: 95% !important;
    }
}

/* 打印样式 */
@media print {
    .sidebar,
    .navbar,
    .chat-input-area {
        display: none !important;
    }
    
    .chat-messages {
        height: auto !important;
        overflow: visible !important;
    }
}
