/* 自定义样式 */

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

section {
    animation: fadeIn 0.5s ease-out;
}

/* 表格样式优化 */
table th {
    font-weight: 600;
}

/* 斑马纹表格 */
table tbody tr:nth-child(even) {
    background-color: #f9fafb;
}

table tbody tr:hover {
    background-color: #f3f4f6;
}

/* 表格单元格样式 */
table td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: #6b7280;
}

table td:first-child {
    font-weight: normal;
}

table td:nth-child(2) {
    font-weight: 500;
    color: #1f2937;
}

/* 卡片样式 */
.bg-white {
    border-radius: 0.375rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

/* 卡片悬停效果 */
.bg-blue-50, .bg-green-50, .bg-purple-50, .bg-orange-50 {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bg-blue-50:hover, .bg-green-50:hover, .bg-purple-50:hover, .bg-orange-50:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .grid-cols-1.lg\:grid-cols-2 {
        gap: 2rem;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* 确保section在移动设备上正确显示 */
    section {
        margin-bottom: 2rem;
    }
    
    /* 调整chart容器确保在小屏幕上显示正常 */
    .bg-white.rounded-lg.shadow-lg.p-6 {
        padding: 1.5rem;
    }
    
    /* 为移动端图表容器设置更高的最小高度 */
    canvas {
        height: 300px !important;
        min-height: 300px;
    }
    
    /* 确保图表容器在移动设备上有足够空间 */
    .bg-white.rounded-lg.shadow-lg.p-6 .w-full {
        min-height: 300px;
    }
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

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

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

/* 导航栏滚动效果 */
nav {
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

nav.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

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

/* 加载状态 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    color: #6b7280;
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 链接样式 */
a {
    transition: all 0.2s ease;
}

/* 按钮样式 */
button {
    transition: all 0.2s ease;
}

button:active {
    transform: scale(0.98);
}