/* 数据概览页面样式 */
.dashboard-container {
    padding: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stats-card {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(102, 126, 234, 0.05));
    border-radius: 0 12px 0 60px;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.stats-card:nth-child(2) {
    border-left-color: var(--success-color);
}

.stats-card:nth-child(2)::before {
    background: linear-gradient(135deg, rgba(82, 196, 26, 0.1), rgba(82, 196, 26, 0.05));
}

.stats-card:nth-child(3) {
    border-left-color: var(--warning-color);
}

.stats-card:nth-child(3)::before {
    background: linear-gradient(135deg, rgba(250, 173, 20, 0.1), rgba(250, 173, 20, 0.05));
}

.stats-card:nth-child(4) {
    border-left-color: var(--info-color);
}

.stats-card:nth-child(4)::before {
    background: linear-gradient(135deg, rgba(24, 144, 255, 0.1), rgba(24, 144, 255, 0.05));
}

.stats-value {
    font-size: 32px;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-family: 'Arial', sans-serif;
    line-height: 1;
}

.stats-label {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 12px;
    font-weight: 500;
}

.stats-change {
    font-size: 12px;
    color: var(--success-color);
    display: flex;
    align-items: center;
    gap: 4px;
}

.stats-change::before {
    content: '↗';
    font-size: 14px;
}

.stats-change.negative {
    color: var(--error-color);
}

.stats-change.negative::before {
    content: '↘';
}

.stats-change.neutral {
    color: var(--text-secondary);
}

.stats-change.neutral::before {
    content: '→';
}

/* 图表容器 */
.chart-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.chart-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.chart-title {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 2px;
}

#userTrendChart {
    width: 100%;
    height: 300px;
}

/* 等级分布 */
.level-distribution {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.level-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #fafafa;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.level-item:hover {
    background: #f0f2ff;
    transform: translateX(4px);
}

.level-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.level-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
}

.level-icon.普通用户 {
    background: #d9d9d9;
}

.level-icon.区域代理 {
    background: #52c41a;
}

.level-icon.市级代理 {
    background: #faad14;
}

.level-icon.省级代理 {
    background: #f5222d;
}

.level-name {
    font-weight: 500;
    color: var(--text-primary);
}

.level-count {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 16px;
}

/* 最新数据网格 */
.recent-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.recent-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.recent-title {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.recent-more {
    font-size: 12px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: normal;
}

.recent-more:hover {
    color: var(--primary-dark);
}

/* 用户列表 */
.user-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.user-item:last-child {
    border-bottom: none;
}

.user-item:hover {
    background: #fafafa;
    margin: 0 -16px;
    padding: 12px 16px;
    border-radius: 8px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    margin-right: 12px;
    font-size: 16px;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.user-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.user-value {
    text-align: right;
    font-size: 12px;
    color: var(--text-secondary);
}

.user-amount {
    font-weight: bold;
    color: var(--text-primary);
    font-size: 14px;
}

/* 提现列表 */
.withdraw-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.withdraw-item:last-child {
    border-bottom: none;
}

.withdraw-item:hover {
    background: #fafafa;
    margin: 0 -16px;
    padding: 12px 16px;
    border-radius: 8px;
}

.withdraw-info {
    flex: 1;
}

.withdraw-user {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.withdraw-time {
    font-size: 12px;
    color: var(--text-secondary);
}

.withdraw-amount {
    text-align: right;
}

.withdraw-main {
    font-weight: bold;
    color: var(--warning-color);
    font-size: 16px;
    margin-bottom: 4px;
}

.withdraw-real {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 刷新按钮 */
.refresh-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    border: none;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
}

.refresh-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.refresh-btn:active {
    transform: scale(0.95);
}

/* 数据更新指示器 */
.update-indicator {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 4px 8px;
    background: rgba(82, 196, 26, 0.1);
    color: var(--success-color);
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.update-indicator.updating {
    background: rgba(250, 173, 20, 0.1);
    color: var(--warning-color);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .chart-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .recent-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-card {
        padding: 20px;
    }
    
    .chart-card {
        padding: 16px;
    }
    
    .recent-card {
        padding: 16px;
    }
    
    .refresh-btn {
        bottom: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 480px) {
    .stats-value {
        font-size: 24px;
    }
    
    .user-item,
    .withdraw-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .user-value,
    .withdraw-amount {
        align-self: flex-end;
    }
}