body {
    background-color: #f8f9fa;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #333;
    overflow-x: hidden;
}

/* 登录页面样式 */
.login-body {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-form-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.main-container {
    width: 100%;
}

/* 侧边栏样式 */
.sidebar {
    width: 250px;
    min-height: 100vh;
    background-color: #0984e3; /* 与登录背景一致 */
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
    padding: 20px 15px;
}

.sidebar h4 {
    font-size: 1.2rem;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar .btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 主内容区样式 */
.main-content {
    margin-left: 250px;
    padding: 0;
    background-color: white;
    min-height: 100vh;
}

.main-content .p-3 {
    padding: 20px;
}

/* 卡片样式 */
.card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.card-header {
    background-color: #74b9ff; /* 与登录按钮颜色一致 */
    color: white;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 12px 15px;
    border-radius: 8px 8px 0 0 !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

/* 移除结果计数显示 */
.card-header .badge {
    display: none;
}

/* 表単控件样式 */
.form-control {
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    border-color: #74b9ff;
    box-shadow: 0 0 0 0.2rem rgba(116, 185, 255, 0.25);
    outline: 0;
}

.form-label {
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

/* 按钮样式 */
.btn {
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #74b9ff; /* 与登录按钮颜色一致 */
    border-color: #74b9ff;
}

.btn-primary:hover {
    background-color: #0984e3; /* 深蓝色悬停效果 */
    border-color: #0984e3;
}

.btn-success {
    background-color: #00b894; /* 绿色 */
    border-color: #00b894;
}

.btn-success:hover {
    background-color: #00a085;
    border-color: #00a085;
}

.btn-warning {
    background-color: #fdcb6e; /* 橙色 */
    border-color: #fdcb6e;
    color: #2d3436;
}

.btn-warning:hover {
    background-color: #fdbe4c;
    border-color: #fdbe4c;
    color: #2d3436;
}

.btn-outline-secondary {
    color: #6c757d;
    border-color: #6c757d;
}

.btn-outline-secondary:hover {
    background-color: #6c757d;
    color: white;
}

/* 表格样式 */
.table {
    margin-bottom: 0;
    font-size: 14px;
}

.table th {
    background-color: #d6eaf8; /* 浅蓝背景 */
    color: #0984e3; /* 深蓝色文字 */
    font-weight: 600;
    border: 1px solid #bfe2ec;
    padding: 10px;
}

.table td {
    border: 1px solid #e0e0e0;
    padding: 10px;
    color: #333;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: #f8f9ff; /* 浅蓝色条纹 */
}

.table-hover tbody tr:hover {
    background-color: #e3f2fd; /* 悬停效果 */
}

/* 分页样式 - 修复数字显示问题 */
.pagination .page-link {
    color: #74b9ff;
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 4px !important;
    margin: 0 2px;
    text-decoration: none;
    background-color: #fff;
    display: inline-block;
}

.pagination .page-item.active .page-link {
    background-color: #74b9ff;
    border-color: #74b9ff;
    color: white;
    z-index: 1; /* 确保活动页码显示在最上层 */
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
    background-color: #f8f9fa;
}

/* 侧边栏链接样式 */
.nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    border-radius: 4px;
    margin: 2px 0;
    transition: all 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: white !important;
}

/* 标签样式 */
.badge {
    font-size: 100%;
}

/* 楠果项样式 */
.result-item {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    transition: all 0.2s ease-in-out;
}

.result-item:hover {
    box-shadow: 0 0.5rem 1rem rgba(9, 132, 227, 0.15); /* 与主题色一致的阴影 */
    transform: translateY(-2px);
}

.result-item .hospital-name {
    color: #0984e3; /* 主题蓝色 */
    font-weight: 600;
}

.result-item .generic-name {
    color: #00b894; /* 绿色 */
    font-weight: 500;
}

.result-item .price {
    color: #e17055; /* 橙红色 */
    font-weight: 600;
}

.result-item .time {
    color: #6c757d; /* 灰色 */
    font-style: italic;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #74b9ff; /* 与主题色一致 */
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

pre {
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 400px;
    overflow: auto;
}

/* 框架高度 */
.vh-100 {
    height: 100vh;
}

/* 医疗数据特殊样式 */
.medical-data-card {
    border-left: 4px solid #74b9ff; /* 蓝色边框 */
}

.medical-data-header {
    background-color: #74b9ff;
    color: white;
    padding: 10px 15px;
    font-weight: bold;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.admin-section {
    border: 2px dashed #00b894; /* 绿色虚线边框 */
    background-color: #f8fff9;
}

.admin-section .card-header {
    background-color: #00b894;
}

.admin-only {
    display: none;
}

/* 数据详情模态框样式 */
.data-details-table {
    width: 100%;
    border-collapse: collapse;
}

.data-details-table td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    vertical-align: top;
}

.data-details-table td:first-child {
    width: 30%;
    background-color: #f8f9fa;
    font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 12px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .form-control {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}

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

/* 进度条样式 */
.progress {
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
    background-color: #e9ecef;
    margin-top: 10px;
}

.progress-bar {
    background-color: #74b9ff;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
    color: white;
}

/* 查询结果容器样式 */
#resultsContainer {
    max-height: 500px;
    overflow-y: auto;
    overflow-x: auto; /* 允许水平滚动 */
}

/* 确保表格可以水平和垂直滚动 */
.table-responsive {
    max-height: 450px;
    overflow-y: auto;
    overflow-x: auto; /* 允许水平滚动 */
    position: relative;
}

/* 为查询筛选表单添加最小高度，确保表单元素正常显示 */
.card-body .row {
    min-height: 60px; /* 确保每行表单元素有足够的空间 */
}

/* 调整表单控件的样式，使其更紧凑 */
.col-md-2 .form-control,
.col-md-3 .form-control,
.col-md-1 .form-control {
    font-size: 13px;
    padding: 6px 10px;
}

/* 卡片主体内的结果容器 */
.card-body #resultsContainer {
    max-height: 400px;
}

/* 调整表格样式，使数据更紧凑 */
.table {
    font-size: 11px; /* 进一步减小字体 */
    margin-bottom: 0;
    white-space: nowrap; /* 防止文本换行 */
    table-layout: auto; /* 允许表格自动调整列宽 */
}

.table th, .table td {
    padding: 4px 6px; /* 减小单元格内边距 */
    white-space: nowrap; /* 防止文本换行 */
    vertical-align: middle; /* 垂直居中 */
    text-align: center; /* 默认居中对齐 */
}

/* 特定列左对齐 */
.table th.text-left, .table td.text-left {
    text-align: left;
}

/* 特定列居中对齐（时间、医院名称、通用名等） */
.table th.center-col, .table td.center-col,
.table .time-col, .table .hospital-col, .table .generic-name-col {
    text-align: center;
}

/* 表头样式 */
.table th {
    background-color: #d6eaf8; /* 浅蓝背景 */
    color: #0984e3; /* 深蓝色文字 */
    font-weight: 600;
    border: 1px solid #bfe2ec;
    position: sticky;
    top: 0;
    z-index: 10;
    font-size: 11px;
    text-align: center; /* 表头也居中 */
}

/* 表格数据样式 */
.table td {
    border: 1px solid #e0e0e0;
    padding: 4px 6px;
    color: #333;
    font-size: 11px;
    text-align: center; /* 数据默认居中 */
}

/* 特定重要列样式 */
.table .time-col {
    background-color: #f0f8ff; /* 时间列特殊背景 */
    font-weight: 500;
}

.table .hospital-col {
    background-color: #f5fffa; /* 医院列特殊背景 */
    font-weight: 500;
}

.table .generic-name-col {
    background-color: #fff8f0; /* 通用名列特殊背景 */
    font-weight: 500;
}

/* 斑马纹表格 */
.table-striped tbody tr:nth-of-type(odd) {
    background-color: #f8f9ff; /* 浅蓝色条纹 */
}

/* 悬停效果 */
.table-hover tbody tr:hover {
    background-color: #e3f2fd; /* 悬停效果 */
}

/* 分页控件样式 */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 10px 0;
    border-top: 1px solid #e0e0e0;
}

.pagination-info {
    font-size: 12px;
    color: #6c757d;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.pagination-size-selector {
    display: flex;
    align-items: center;
    gap: 5px;
}

.pagination-size-selector label {
    font-size: 12px;
    color: #6c757d;
    margin: 0;
    white-space: nowrap;
}

.pagination-size-selector select {
    width: auto;
    font-size: 12px;
    padding: 2px 5px;
    border-radius: 3px;
    min-width: 60px; /* 设置最小宽度避免过窄 */
}

.pagination-nav {
    display: flex;
    gap: 5px;
}

.pagination .page-link {
    color: #74b9ff;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 4px 8px;
    font-size: 12px;
    margin: 0 2px;
    text-decoration: none;
    background-color: #fff;
    display: inline-block;
    position: relative; /* 确保层级正确 */
    z-index: 1;
    height: 30px; /* 固定高度 */
    line-height: 22px; /* 垂直居中 */
}

.pagination .page-item.active .page-link {
    background-color: #74b9ff;
    border-color: #74b9ff;
    color: white;
    z-index: 2; /* 确保活动页码显示在最上层 */
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
    background-color: #f8f9fa;
}

/* 修复可能的圆点遮挡问题 */
.pagination .page-item {
    position: relative;
    list-style: none; /* 移除可能的列表样式点 */
}

/* 搜索、清空、导出按钮样式 - 美化调整，与排序方式下拉框对齐 */
#searchBtn, #clearBtn, #exportBtn {
    padding: 6px 12px; /* 减小内边距使按钮更窄 */
    min-width: 80px; /* 设置最小宽度 */
    max-width: 120px; /* 设置最大宽度 */
    height: 40px; /* 与排序方式下拉框高度一致 */
    font-size: 13px; /* 调整字体大小 */
    display: flex;
    align-items: center;
    justify-content: center;
}

#searchBtn {
    background-color: #74b9ff;
    border-color: #74b9ff;
    color: white;
}

#searchBtn:hover {
    background-color: #0984e3;
    border-color: #0984e3;
}

#clearBtn {
    background-color: #f8f9fa;
    border-color: #ced4da;
    color: #495057;
}

#clearBtn:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
}

#exportBtn {
    background-color: #fdcb6e;
    border-color: #fdcb6e;
    color: #2d3436;
}

#exportBtn:hover {
    background-color: #fdbe4c;
    border-color: #fdbe4c;
}

/* 用户活动日志标签页样式 */
.nav-tabs {
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 20px;
}

.nav-tabs .nav-link {
    background-color: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    color: #495057 !important;
    margin-right: 2px;
    border-radius: 4px 4px 0 0 !important;
    padding: 8px 16px;
    font-weight: 500;
}

.nav-tabs .nav-link:hover {
    background-color: #e9ecef !important;
    border-color: #dee2e6 !important;
}

.nav-tabs .nav-link.active {
    background-color: #007bff !important;
    border-color: #007bff !important;
    color: white !important;
    border-bottom-color: transparent !important;
    font-weight: 600;
}

.nav-tabs .nav-link.active:hover {
    background-color: #0056b3 !important;
    border-color: #004085 !important;
    color: white !important;
}

/* 活动日志表格样式 */
#activityLogSection {
    background-color: white;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #dee2e6;
}

#activityLogSection .card {
    margin-bottom: 15px;
}

#activityLogSection .form-control {
    font-size: 13px;
    padding: 6px 10px;
}

#activityLogSection .table th {
    background-color: #e9ecef;
    color: #495057;
    font-weight: 600;
}

#activityLogSection .table td {
    vertical-align: middle;
}

/* 活动日志分页样式 */
#activityLogPaginationContainer {
    margin-top: 20px;
}

#activityLogPaginationList .page-link {
    padding: 5px 10px;
    font-size: 13px;
}

#activityLogPaginationInfo {
    font-size: 13px;
    color: #6c757d;
}