/* 全局样式 */
body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e9f2 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* 页面包装器 */
.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 主容器样式 */
.container.mt-5 {
    margin-top: 0.5rem !important;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 搜索和聊天区域调整 */
.row {
    margin-bottom: 0.3rem;
}

/* 搜索卡片样式 */
.search-card {
    margin-bottom: 0.5rem;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    width: 100%;
}

/* 导航栏样式 */
.navbar {
    background: #ffffff;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.04);
    padding: 0.8rem 0;
}

.navbar-brand {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2c3e50 !important;
    letter-spacing: 0.5px;
}

/* 搜索框样式 */
.input-group {
    max-width: 100%;
    margin: 0 auto;
    border-radius: 12px;
    background: #f8f9fa;
    padding: 4px;
}

.input-group input {
    border: none;
    padding: 0.9rem 1.5rem;
    font-size: 1.1rem;
    background: #ffffff;
    color: #4a5568;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.input-group input:focus {
    background: #ffffff;
    box-shadow: 0 0 0 2px #718096;
    outline: none;
}

.btn-search {
    background: #718096;
    color: white;
    padding: 0.9rem 2rem;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    margin-left: 4px;
    transition: all 0.3s ease;
}

.btn-search:hover {
    background: #4a5568;
    color: white;
    transform: translateX(2px);
}

/* 表格样式 */
.result-table {
    margin-top: 1rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    max-height: 500px;
    overflow-y: auto;
}

.table {
    margin-bottom: 0;
    background: white;
    font-size: 1.1rem;
}

.table th {
    background: #f8fafc;
    font-weight: 600;
    color: #2d3748;
    padding: 1rem;
    border-bottom: 2px solid #eef2f7;
    position: sticky;
    top: 0;
    z-index: 1;
}

.table td {
    padding: 0.8rem;
    color: #4a5568;
    border-bottom: 1px solid #eef2f7;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.table tr:hover td {
    background: #f8fafc;
}

/* 提示框样式 */
.alert-custom {
    background: #ebf8ff;
    color: #2b6cb0;
    border: none;
    border-radius: 12px;
    padding: 1rem;
    margin-top: 2rem;
}

/* 聊天窗口样式 */
.chat-container {
    width: 100%;
    height: 600px;
    display: flex;
    flex-direction: column;
    margin-top: -0.2rem;
}

.chat-box {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #f8fafc;
}

.message {
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.message.user {
    flex-direction: row-reverse;
}

.message-content {
    max-width: calc(100% - 50px);
    padding: 0.8rem 1rem;
    border-radius: 12px;
    font-size: 1rem;
    line-height: 1.5;
    word-break: break-word;
}

.message.user .message-content {
    background: #718096;
    color: white;
    border-top-right-radius: 4px;
}

.message.bot .message-content {
    background: #fff;
    color: #4a5568;
    border-top-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.chat-input {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
}

.chat-input input {
    flex: 1;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.9rem 1.2rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.chat-input input:focus {
    border-color: #718096;
    box-shadow: 0 0 0 2px rgba(113, 128, 150, 0.1);
    outline: none;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .navbar {
        padding: 0.6rem 0;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
        font-weight: 500;
    }
    
    .input-group {
        max-width: 100%;
    }
    
    .input-group input {
        font-size: 1rem;
        padding: 0.8rem 1.2rem;
    }
    
    .btn-search {
        padding: 0.8rem 1.5rem;
    }

    .container.mt-5 {
        margin-top: 0.3rem !important;
    }

    .chat-container {
        height: 500px;
        margin-top: -0.1rem;
    }

    .row {
        margin-bottom: 0.2rem;
    }

    .search-card {
        margin-bottom: 0.2rem;
    }

    .footer {
        padding: 0.3rem 0;
    }

    .result-table {
        margin-top: 0.5rem;
        max-height: 400px;
    }

    .table {
        font-size: 1rem;
    }

    .table th,
    .table td {
        padding: 0.7rem;
    }
}

/* 分页样式 */
.pagination-wrapper {
    margin-top: 2rem;
}

.pagination .page-link {
    color: #718096;
    border: none;
    padding: 0.5rem 1rem;
    margin: 0 0.2rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.pagination .page-item.active .page-link {
    background-color: #718096;
    color: white;
}

.pagination .page-link:hover {
    background-color: #e2e8f0;
    color: #4a5568;
    transform: translateY(-1px);
}

.text-muted {
    color: #718096 !important;
    font-size: 0.9rem;
}

/* 页脚样式 */
.footer {
    flex-shrink: 0;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    width: 100%;
    padding: 0.5rem 0;
}

.footer a {
    color: #6c757d;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #4a5568;
    text-decoration: underline !important;
}

/* 图片上传按钮样式 */
.btn-icon {
    min-width: 44px;
    height: 44px;
    padding: 0.7rem;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    background: #fff;
    color: #718096;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: #f8fafc;
    color: #4a5568;
    border-color: #718096;
}

#imageUpload {
    display: none;
}

/* 主容器样式 */
.flex-grow-1 {
    flex: 1 0 auto;
}

/* 上传按钮样式 */
.btn-upload {
    background: #718096;
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    border: none;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
}

.btn-upload:hover {
    background: #4a5568;
    color: white;
    transform: translateY(-2px);
}

/* 进度条样式 */
.progress {
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
    background-color: #e9ecef;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    position: relative;
}

.progress-bar {
    height: 100%;
    background-color: #0d6efd;
    transition: width 0.3s ease;
    text-align: center;
    color: white;
    font-size: 12px;
    line-height: 20px;
    position: relative;
    overflow: hidden;
}

.progress-bar:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 75%,
        transparent
    );
    background-size: 1rem 1rem;
    animation: progress-stripes 1s linear infinite;
}

.progress-bar-striped {
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 75%,
        transparent
    );
    background-size: 1rem 1rem;
}

.progress-bar-animated {
    animation: progress-stripes 1s linear infinite;
}

@keyframes progress-stripes {
    from {
        background-position: 1rem 0;
    }
    to {
        background-position: 0 0;
    }
}

.progress-bar.bg-success {
    background-color: #28a745;
}

.progress-bar.bg-success:after {
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 75%,
        transparent
    );
}
