/**
 * 总览页面优化样式
 * 包含：动画优化、响应式优化、交互优化
 */

/* ===========================
   统计卡片优化
   =========================== */
.stat-card {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 骨架屏优化 */
.skeleton-loader {
    position: relative;
    overflow: hidden;
}

.skeleton-loader::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: skeleton-wave 1.5s ease-in-out infinite;
}

@keyframes skeleton-wave {
    0% { left: -100%; }
    100% { left: 100%; }
}

.skeleton-icon {
    width: 60px;
    height: 60px;
    background: #e9ecef;
    border-radius: 12px;
    margin-bottom: 15px;
}

.skeleton-number {
    width: 80px;
    height: 32px;
    background: #e9ecef;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-label {
    width: 60px;
    height: 16px;
    background: #e9ecef;
    border-radius: 4px;
}

/* 实时更新动画 */
.stat-card.pulse {
    animation: pulse-effect 1s ease;
}

@keyframes pulse-effect {
    0% {
        box-shadow: 0 0.75rem 1.5rem rgba(18,38,63,.03);
    }
    50% {
        box-shadow: 0 0.75rem 1.5rem rgba(102, 126, 234, 0.2);
        transform: scale(1.02);
    }
    100% {
        box-shadow: 0 0.75rem 1.5rem rgba(18,38,63,.03);
    }
}

/* 高亮效果 */
.stat-card.highlight {
    background: linear-gradient(135deg, #f5f7fa 0%, #f0f3ff 100%);
}

/* 统计变化指示器 */
.stat-change {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 20px;
}

.stat-change.positive {
    color: #2dce89;
    background: rgba(45, 206, 137, 0.1);
}

.stat-change.negative {
    color: #f5365c;
    background: rgba(245, 54, 92, 0.1);
}

/* ===========================
   活动列表优化
   =========================== */
.activity-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.activity-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 18px;
    color: white;
}

.activity-icon.news {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.activity-icon.appointment {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.activity-icon.user {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.activity-icon.system {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-size: 14px;
    font-weight: 500;
    color: #32325d;
    margin-bottom: 4px;
}

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

/* ===========================
   快速操作优化
   =========================== */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.quick-action-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.quick-action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.quick-action-card:hover {
    transform: translateY(-5px);
    border-color: #667eea;
}

.quick-action-card:hover::before {
    opacity: 0.05;
}

.quick-action-icon {
    font-size: 32px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.quick-action-title {
    font-size: 14px;
    font-weight: 600;
    color: #32325d;
}

/* ===========================
   图表容器优化
   =========================== */
.chart-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 0.75rem 1.5rem rgba(18,38,63,.03);
    height: 350px;
    position: relative;
}

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

.chart-title {
    font-size: 16px;
    font-weight: 600;
    color: #32325d;
}

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

.chart-action-btn {
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    background: white;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-action-btn:hover {
    background: #f8f9fa;
    color: #32325d;
}

.chart-action-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* ===========================
   响应式优化
   =========================== */
@media (max-width: 1200px) {
    .quick-actions {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-number {
        font-size: 28px;
    }
}

@media (max-width: 768px) {
    .stat-change {
        position: static;
        margin-top: 10px;
        display: inline-flex;
    }
    
    .activity-item {
        padding: 12px;
    }
    
    .activity-icon {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .chart-container {
        height: 250px;
        padding: 15px;
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (max-width: 576px) {
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quick-action-card {
        padding: 15px;
    }
    
    .quick-action-icon {
        font-size: 24px;
    }
    
    .stat-card {
        margin-bottom: 15px;
    }
}

/* ===========================
   暗色主题支持（预留）
   =========================== */
@media (prefers-color-scheme: dark) {
    /* 暗色主题样式 */
}

/* ===========================
   打印样式
   =========================== */
@media print {
    .sidebar,
    .top-bar,
    .quick-actions,
    .chart-actions {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .stat-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}