/* 统计报表仪表盘样式 */

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background-color: #f8f9fa;
    padding-bottom: 20px;
    margin: 0;
}

.container {
    margin: 0 auto;
    padding: 20px;
    max-width: 1200px;
}

.card {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card-body {
    padding: 15px;
}

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

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    padding: 15px 20px;
}

/* 筛选器样式 */
.filters {
    background-color: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

/* 概览卡片样式 */
.card.bg-primary, .card.bg-success, .card.bg-danger, .card.bg-info {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    color: white;
    text-align: center;
}

.card.bg-primary:hover, .card.bg-success:hover, .card.bg-danger:hover, .card.bg-info:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.card-title {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 8px;
    opacity: 0.9;
}

.card-text {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0;
    word-break: break-all;
}

/* 图表容器样式 */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

canvas {
    max-height: 300px;
    width: 100% !important;
}

/* 表格样式 */
table {
    font-size: 0.9rem;
    width: 100%;
}

table th {
    font-weight: 600;
    background-color: #f8f9fa;
    padding: 12px;
}

table td {
    padding: 12px;
    vertical-align: middle;
}

.table-container {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 页面标题和按钮 */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 0 10px;
    gap: 10px;
}

.page-header h1 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
    color: #333;
    flex: 1;
    text-align: center;
}

.page-header button {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
}

/* 概览卡片容器 */
.overview-cards {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.overview-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    margin-bottom: 12px;
}

.overview-card {
    flex: 1;
    min-width: 150px;
    max-width: calc(50% - 6px);
}

/* 图表区域 */
.chart-section {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.chart-item {
    flex: 1;
    min-width: 300px;
}

/* 排行榜区域 */
.rankings-section {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.ranking-item {
    flex: 1;
    min-width: 300px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .page-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap;
    }
    
    .page-header h1 {
        font-size: 1rem;
        flex: 1;
        text-align: center;
        margin: 0;
    }
    
    .page-header button {
        padding: 4px 8px;
        font-size: 0.7rem;
        min-width: 60px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .overview-row {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .overview-card {
        flex: 1 1 45%;
        min-width: 140px;
        max-width: calc(50% - 4px);
        box-sizing: border-box;
    }
    
    .card-body {
        padding: 12px;
    }
    
    .card-title {
        font-size: 0.75rem;
        margin-bottom: 6px;
    }
    
    .card-text {
        font-size: 1rem;
    }
    
    .chart-item, .ranking-item {
        flex: 1;
        min-width: 100%;
    }
    
    .card-title {
        font-size: 0.75rem;
    }
    
    .card-text {
        font-size: 1rem;
    }
    
    .chart-container {
        height: 200px;
        position: relative;
    }
    
    canvas {
        max-height: 200px;
        width: 100% !important;
        height: auto !important;
    }
    
    /* 图表图例样式调整 */
    .chart-container .chartjs-legend {
        font-size: 0.7rem !important;
    }
    
    .chart-container .chartjs-legend li {
        margin-bottom: 2px !important;
    }
    
    .chart-container .chartjs-legend li span {
        width: 10px !important;
        height: 10px !important;
        margin-right: 5px !important;
    }
    
    table {
        font-size: 0.75rem;
    }
    
    table th, table td {
        padding: 6px;
    }
    
    .card-header {
        padding: 10px 14px;
        font-size: 0.8rem;
    }
    
    .card-body {
        padding: 10px;
    }
    
    /* 筛选器样式 */
    .filters {
        padding: 15px;
    }
    
    .filters button {
        padding: 5px 8px;
        font-size: 0.7rem;
        height: 28px;
    }
    
    .filters select, .filters input {
        padding: 5px;
        font-size: 0.75rem;
        height: 28px;
    }
    
    /* 确保表单元素响应式 */
    .filters .form-control {
        font-size: 0.75rem !important;
    }
    
    /* 确保按钮响应式 */
    .filters .btn {
        font-size: 0.75rem !important;
        padding: 5px 8px !important;
    }
}

/* 加载动画 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    font-size: 1.1rem;
    color: #666;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #ccc;
}

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

.card {
    animation: fadeIn 0.5s ease;
}

/* 确保表格在移动端可滚动 */
@media (max-width: 576px) {
    .table-container {
        border: 1px solid #dee2e6;
    }
    
    table {
        margin-bottom: 0;
    }
    
    table thead th {
        white-space: nowrap;
    }
    
    table tbody td {
        white-space: nowrap;
    }
}

/* 优化触摸体验 */
button, select, input {
    -webkit-tap-highlight-color: transparent;
    border-radius: 6px;
}

/* 确保图表在小屏幕上显示完整 */
@media (max-width: 480px) {
    .chart-container {
        height: 220px;
    }
    
    canvas {
        max-height: 220px;
    }
}