body {
    background-color: #FFF5F9;
    color: #5A3D5C;
}

.dashboard-container {
    max-width: 100%;
    padding: 15px;
    overflow-x: hidden;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #FFD6E7;
    flex-wrap: wrap;
}

.title {
    font-size: 22px;
    text-align: center;
    font-weight: 700;
    color: #FF6B9D;
    text-shadow: 0 0 10px rgba(255, 107, 157, 0.3);
    margin-bottom: 10px;
    width: 100%;
}

.time-display {
    font-size: 14px;
    color: #FF6B9D;
    background: #FFE5EE;
    padding: 6px 12px;
    border-radius: 20px;
    margin: 0 auto;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #FFFFFF 0%, #FFF0F5 100%);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 5px 15px -3px rgba(255, 107, 157, 0.2);
    border-left: 3px solid;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -5px rgba(255, 107, 157, 0.3);
}

.stat-card.blue {
    border-color: #9D7AFF;
}

.stat-card.purple {
    border-color: #C86BFF;
}

.stat-card.green {
    border-color: #4BD37B;
}

.stat-card.orange {
    border-color: #FF9E3D;
}

.stat-card.red {
    border-color: #FF6B9D;
}

.stat-card.pink {
    border-color: #FF8EAC;
}

.stat-icon {
    font-size: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.stats-provider {
    font-size: 12px;
    color: #FF6B9D;
    background: rgba(255, 107, 157, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    margin-left: 10px;
}
.dashboard-stat {
    color: #FF6B9D;
    font-weight: bold;
}

@media (max-width: 576px) {
    .stats-provider {
        margin-top: 8px;
        width: 100%;
        text-align: right;
    }
}
.blue .stat-icon {
    background: rgba(157, 122, 255, 0.2);
    color: #9D7AFF;
}

.purple .stat-icon {
    background: rgba(200, 107, 255, 0.2);
    color: #C86BFF;
}

.green .stat-icon {
    background: rgba(75, 211, 123, 0.2);
    color: #4BD37B;
}

.orange .stat-icon {
    background: rgba(255, 158, 61, 0.2);
    color: #FF9E3D;
}

.red .stat-icon {
    background: rgba(255, 107, 157, 0.2);
    color: #FF6B9D;
}

.pink .stat-icon {
    background: rgba(255, 142, 172, 0.2);
    color: #FF8EAC;
}

.stat-title {
    font-size: 12px;
    color: #9D7AFF;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #FF6B9D;
    margin-bottom: 5px;
}

.stat-change {
    font-size: 10px;
    display: flex;
    align-items: center;
}

.positive {
    color: #4BD37B;
}

.negative {
    color: #FF6B9D;
}

.charts-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

@media (min-width: 992px) {
    .charts-container {
        grid-template-columns: 1fr 1fr;
    }
}

.chart-panel {
    background: #FFFFFF;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 5px 15px -3px rgba(255, 107, 157, 0.2);
    min-width: 0; /* 修复flexbox溢出问题 */
    border: 1px solid #FFE5EE;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.chart-title {
    font-size: 16px;
    font-weight: 600;
    color: #FF6B9D;
    margin-bottom: 10px;
}

.chart-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chart-btn {
    background: #FFE5EE;
    color: #FF6B9D;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 5px;
}

.chart-btn:hover {
    background: #FF6B9D;
    color: #FFFFFF;
}

.chart-btn.active {
    background: #FF6B9D;
    color: #FFFFFF;
}

.chart-container {
    height: 380px;
    width: 100%;
    min-height: 250px;
}

/* 修复备案状态分布图在移动端的显示问题 */
#status-chart {
    min-height: 250px;
}

/* 修改底部区域布局 */
.bottom-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 768px) {
    .bottom-stats {
        grid-template-columns: 1fr 1fr;
    }
}

/* 调整实时访问统计面板 */
.recent-activity, .chart-panel {
    min-width: 0; /* 防止flexbox溢出 */
}

/* 调整活动项在小屏幕上的显示 */
.activity-item {
    flex-wrap: wrap;
    padding: 8px 0;
}

.activity-icon {
    margin-right: 8px;
    margin-bottom: 5px;
}

.activity-content {
    flex: 1 1 calc(100% - 44px); /* 图标宽度36px + 边距8px */
    min-width: 0;
}

.activity-text {
    white-space: normal; /* 允许换行 */
    overflow: visible;
    text-overflow: clip;
    margin-bottom: 5px;
    line-height: 1.4;
}

/* 调整统计卡片在小屏幕上的布局 */
.n3v-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    padding: 10px;
    background: #FFE5EE;
    border-radius: 8px;
}

.n3v-stats div {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #FF6B9D;
}

/* 调整图表容器在小屏幕上的高度 */
@media (max-width: 576px) {
    .chart-container {
        height: 200px;
    }
    
    .recent-activity {
        padding: 10px;
    }
    
    .activity-title {
        font-size: 15px;
        margin-bottom: 10px;
    }
}

/* 调整活动切换按钮在小屏幕上的布局 */
.recent-activity .chart-actions {
    justify-content: flex-start;
    margin-bottom: 5px;
}

.recent-activity .chart-btn {
    margin-right: 5px;
    margin-bottom: 5px;
}

/* 调整统计服务提供者文本在小屏幕上的显示 */
@media (max-width: 576px) {
    .stats-provider {
        margin-top: 5px;
        margin-left: 0;
        width: 100%;
        text-align: left;
    }
}

.recent-activity {
    background: #FFFFFF;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 5px 15px -3px rgba(255, 107, 157, 0.2);
    border: 1px solid #FFE5EE;
}

.activity-title {
    font-size: 16px;
    font-weight: 600;
    color: #FF6B9D;
    margin-bottom: 15px;
}

.activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
    height: 430px; /* 固定高度 */
    overflow: hidden; /* 隐藏超出部分 */
    position: relative;
}

.activity-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #FFE5EE;
    transition: transform 0.5s ease;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    min-width: 36px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.activity-content {
    flex: 1;
    min-width: 0; /* 防止文本溢出 */
}

.activity-text {
    font-size: 13px;
    color: #5A3D5C;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-time {
    font-size: 12px;
    color: #FF6B9D;
}

.n3v-stats {
    background-color: #FFE5EE;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    color: #FF6B9D;
    font-size: 13px;
}

#n3v_value_today_pv, #n3v_value_site_pv, #n3v_value_site_uv {
    color: #FF6B9D;
}

/* 动画效果 */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* 响应式调整 */
@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .stat-value {
        font-size: 18px;
    }
    
    .chart-container {
        height: 220px;
    }
}

@media (max-width: 400px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}