/* AI书灵平台自定义样式 */

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

/* 导航栏样式 */
.navbar-brand {
    font-weight: bold;
    color: #007bff !important;
}

/* 卡片样式 */
.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

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

/* 聊天消息样式 */
#chat-messages {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.alert {
    border: none;
    border-radius: 8px;
}

/* 进度条样式 */
.progress {
    height: 20px;
    border-radius: 10px;
}

.progress-bar {
    border-radius: 10px;
}

/* 角色卡片样式 */
.character-card {
    transition: transform 0.2s ease;
}

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

/* 测试题目样式 */
.form-check-input:checked {
    background-color: #007bff;
    border-color: #007bff;
}

/* 加载动画 */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    #chat-messages {
        height: 300px !important;
    }
}

/* 自定义图标颜色 */
.text-ai {
    color: #28a745;
}

.text-user {
    color: #007bff;
}

.text-system {
    color: #6c757d;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* 特殊提示样式 */
.alert-ai {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

/* 书籍卡片样式 */
.book-card {
    border-left: 4px solid #007bff;
}

.book-card:hover {
    border-left-color: #0056b3;
}

/* 角色选择下拉菜单 */
.dropdown-menu {
    border: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

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

/* 测试结果样式 */
#test-result {
    border-left: 4px solid #28a745;
    background-color: #d4edda;
}

/* 字体图标增强 */
.bi {
    vertical-align: -0.125em;
} 
/* ===== 聊天页面布局优化样式 (2025-06-26) ===== */

/* 聊天页面特殊布局 */
.chat-container {
    min-height: calc(100vh - 200px);
}

.chat-main {
    padding-right: 0.75rem;
}

.chat-sidebar {
    padding-left: 0.75rem;
}

/* 角色选择区域优化 */
.character-select-area {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #dee2e6;
}

.character-search {
    position: relative;
}

.character-search .form-control {
    padding-left: 2.5rem;
    border-radius: 6px;
}

.character-search .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    z-index: 5;
}

.character-dropdown {
    max-height: 300px;
    overflow-y: auto;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.character-dropdown .dropdown-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s ease;
}

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

.character-dropdown .dropdown-item:hover {
    background-color: #f8f9fa;
    transform: translateX(2px);
}

/* 当前选中角色信息 */
.current-character-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 4px solid #2196f3;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    animation: fadeIn 0.3s ease-out;
}

/* 聊天消息区域优化 */
.chat-messages-container {
    height: 450px;
    min-height: 450px;
    border-radius: 8px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    transition: box-shadow 0.3s ease;
}

.chat-messages-container:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 侧边面板优化 */
.chat-sidebar .card {
    margin-bottom: 1rem;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.chat-sidebar .card:last-child {
    margin-bottom: 0;
}

.sidebar-section {
    max-height: 300px;
    overflow-y: auto;
}

.character-list-compact {
    max-height: 200px;
    overflow-y: auto;
    padding: 0;
}

.character-list-compact .list-group-item {
    padding: 0.5rem 0.75rem;
    border-left: none;
    border-right: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.character-list-compact .list-group-item:hover {
    background-color: #f8f9fa;
    transform: translateX(2px);
    border-left: 3px solid #007bff;
}

.character-list-compact .list-group-item:first-child {
    border-top: none;
}

.character-list-compact .list-group-item:last-child {
    border-bottom: none;
}

.character-quick-select {
    border-radius: 0 !important;
}

/* 折叠面板优化 */
.accordion-button {
    font-size: 0.9rem;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border: none;
}

.accordion-button:not(.collapsed) {
    background-color: #e3f2fd;
    color: #1976d2;
}

.accordion-body {
    padding: 0.75rem;
    font-size: 0.85rem;
}

.accordion-item {
    border: none;
    margin-bottom: 0.5rem;
    border-radius: 6px !important;
    overflow: hidden;
}

/* 响应式优化 */
@media (min-width: 1200px) {
    .chat-main {
        flex: 0 0 auto;
        width: 83.33333333%;
    }
    
    .chat-sidebar {
        flex: 0 0 auto;
        width: 16.66666667%;
    }
    
    .chat-messages-container {
        height: 500px;
        min-height: 500px;
    }
    
    .character-select-area {
        padding: 1.25rem;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .chat-main {
        flex: 0 0 auto;
        width: 75%;
    }
    
    .chat-sidebar {
        flex: 0 0 auto;
        width: 25%;
    }
}

@media (max-width: 991px) {
    .chat-main,
    .chat-sidebar {
        width: 100%;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .chat-sidebar {
        margin-top: 1rem;
        order: 1;
    }
    
    .chat-main {
        order: 0;
    }
    
    .chat-messages-container {
        height: 400px;
        min-height: 400px;
    }
    
    .character-select-area {
        padding: 0.75rem;
    }
}

@media (max-width: 576px) {
    .chat-messages-container {
        height: 350px;
        min-height: 350px;
    }
    
    .character-select-area {
        padding: 0.5rem;
    }
    
    .current-character-info {
        padding: 0.5rem;
    }
    
    .chat-container {
        min-height: auto;
    }
}

/* 滚动条美化 */
.character-dropdown::-webkit-scrollbar,
.character-list-compact::-webkit-scrollbar,
.sidebar-section::-webkit-scrollbar,
.chat-messages-container::-webkit-scrollbar {
    width: 6px;
}

.character-dropdown::-webkit-scrollbar-track,
.character-list-compact::-webkit-scrollbar-track,
.sidebar-section::-webkit-scrollbar-track,
.chat-messages-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.character-dropdown::-webkit-scrollbar-thumb,
.character-list-compact::-webkit-scrollbar-thumb,
.sidebar-section::-webkit-scrollbar-thumb,
.chat-messages-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.character-dropdown::-webkit-scrollbar-thumb:hover,
.character-list-compact::-webkit-scrollbar-thumb:hover,
.sidebar-section::-webkit-scrollbar-thumb:hover,
.chat-messages-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 特殊效果增强 */
.character-option:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.btn-outline-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,123,255,0.3);
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

.alert {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { 
        opacity: 0; 
        transform: translateY(-10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* 消息气泡样式优化 */
.alert-primary {
    background: linear-gradient(135deg, #cfe2ff 0%, #b6d7ff 100%);
    border-left: 4px solid #0d6efd;
}

.alert-light {
    background: linear-gradient(135deg, #fefefe 0%, #f8f9fa 100%);
    border-left: 4px solid #6c757d;
}

.alert-success {
    background: linear-gradient(135deg, #d1e7dd 0%, #badbcc 100%);
    border-left: 4px solid #198754;
}
