/* 生产级数据库优化平台样式 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-color: #f8fafc;
    color: #334155;
    line-height: 1.5;
    overflow-x: hidden;
}

/* 系统状态栏 */
.system-status-bar {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #cbd5e1;
    padding: 8px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    border-bottom: 1px solid #334155;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.status-left {
    display: flex;
    gap: 24px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-online {
    color: #10b981;
    font-weight: 600;
}

.status-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.status-time {
    color: #94a3b8;
    font-family: 'Monaco', 'Consolas', monospace;
}

.status-user {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 12px;
    border-radius: 4px;
}

/* 主容器 */
.main-container {
    display: flex;
    min-height: calc(100vh - 40px);
}

/* 侧边导航 */
.sidebar {
    width: 260px;
    background: white;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 40px;
    height: calc(100vh - 40px);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid #e2e8f0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.logo i {
    font-size: 28px;
    color: #3b82f6;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo h2 {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.project-info h3 {
    font-size: 16px;
    color: #334155;
    margin-bottom: 4px;
    font-weight: 600;
}

.project-info p {
    font-size: 13px;
    color: #64748b;
    font-family: 'Monaco', 'Consolas', monospace;
}

.sidebar-menu {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #64748b;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background: #f1f5f9;
    color: #334155;
    border-left-color: #cbd5e1;
}

.menu-item.active {
    background: #eff6ff;
    color: #1d4ed8;
    border-left-color: #3b82f6;
    font-weight: 600;
}

.menu-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.system-health {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.health-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
}

.health-progress {
    flex: 1;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    margin: 0 12px;
    overflow: hidden;
}

.health-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    border-radius: 3px;
}

.health-value {
    font-weight: 600;
    color: #334155;
    min-width: 32px;
    text-align: right;
}

/* 主内容区 */
.content-area {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: #f8fafc;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
}

.page-title h1 {
    font-size: 28px;
    color: #1e293b;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title h1 i {
    color: #3b82f6;
}

.page-subtitle {
    color: #64748b;
    font-size: 15px;
}

.page-actions {
    display: flex;
    gap: 12px;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: #64748b;
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-outline {
    background: white;
    color: #64748b;
    border: 1px solid #cbd5e1;
}

.btn-outline:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* 关键指标行 */
.metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.metric-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    transition: all 0.3s;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

.metric-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.metric-header i {
    font-size: 24px;
    color: #3b82f6;
    width: 40px;
    height: 40px;
    background: #eff6ff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.metric-header h3 {
    font-size: 16px;
    color: #64748b;
    font-weight: 500;
}

.metric-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.metric-value {
    font-size: 32px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
}

.metric-trend {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.trend-up {
    color: #10b981;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.metric-desc {
    color: #94a3b8;
    font-size: 13px;
}

.progress-container {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* 图表行 */
.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.chart-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

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

.chart-header h3 {
    font-size: 18px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.time-select {
    padding: 6px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: white;
    color: #334155;
    font-size: 13px;
    cursor: pointer;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-badge.online {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.chart-body {
    height: 300px;
    position: relative;
}

.chart-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.chart-stats {
    display: flex;
    justify-content: space-between;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-label {
    font-size: 13px;
    color: #64748b;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

/* 资源网格 */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.resource-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.resource-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #334155;
}

.resource-header i {
    color: #64748b;
}

.resource-progress {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.resource-value {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    text-align: right;
}

/* 内容行 */
.content-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.content-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

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

.card-header h3 {
    font-size: 18px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge {
    background: #ef4444;
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

/* 时间线 */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.timeline-item {
    display: flex;
    gap: 16px;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 32px;
    bottom: -28px;
    width: 2px;
    background: #e2e8f0;
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-marker {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: white;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.timeline-item.completed .timeline-marker {
    border-color: #10b981;
    background: #10b981;
    color: white;
}

.timeline-item.active .timeline-marker {
    border-color: #3b82f6;
    background: #3b82f6;
    color: white;
}

.timeline-item.upcoming .timeline-marker {
    border-color: #cbd5e1;
    color: #94a3b8;
}

.timeline-content {
    flex: 1;
}

.timeline-content h4 {
    font-size: 16px;
    color: #1e293b;
    margin-bottom: 4px;
}

.timeline-date {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
}

.timeline-desc {
    font-size: 14px;
    color: #475569;
    margin-bottom: 12px;
}

.timeline-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.completed {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.status-badge.in-progress {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.status-badge.pending {
    background: rgba(148, 163, 184, 0.1);
    color: #64748b;
}

.status-date {
    font-size: 12px;
    color: #94a3b8;
}

/* 任务列表 */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.task-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.task-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid #cbd5e1;
    cursor: pointer;
}

.task-content {
    flex: 1;
}

.task-title {
    font-size: 15px;
    color: #334155;
    font-weight: 500;
    cursor: pointer;
    display: block;
    margin-bottom: 6px;
}

.task-title.completed {
    text-decoration: line-through;
    color: #94a3b8;
}

.task-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}

.task-assignee, .task-deadline {
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.task-priority, .task-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.task-priority {
    background: #fef3c7;
    color: #92400e;
}

.task-priority.priority-high {
    background: #fee2e2;
    color: #991b1b;
}

.task-priority.priority-medium {
    background: #fef3c7;
    color: #92400e;
}

.task-priority.priority-low {
    background: #d1fae5;
    color: #065f46;
}

.task-status.completed {
    background: #d1fae5;
    color: #065f46;
}

/* 通知列表 */
.notification-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.notification-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.notification-item.unread {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.notification-item:hover {
    background: #f1f5f9;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #eff6ff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-icon i {
    color: #3b82f6;
    font-size: 18px;
}

.notification-content {
    flex: 1;
}

.notification-content h4 {
    font-size: 15px;
    color: #1e293b;
    margin-bottom: 4px;
}

.notification-content p {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 8px;
    line-height: 1.4;
}

.notification-time {
    font-size: 12px;
    color: #94a3b8;
}

/* 资源分布 */
.resource-distribution {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.distribution-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.distribution-label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    font-size: 14px;
    color: #334155;
}

.distribution-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.distribution-value {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    min-width: 40px;
    text-align: right;
}

.distribution-bar {
    flex: 2;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.resource-summary {
    display: flex;
    justify-content: space-between;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.summary-label {
    font-size: 13px;
    color: #64748b;
}

.summary-value {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
    
    .content-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
    }
    
    .sidebar-menu {
        display: flex;
        overflow-x: auto;
        padding: 12px;
    }
    
    .menu-item {
        flex-direction: column;
        padding: 8px 12px;
        border-left: none;
        border-bottom: 3px solid transparent;
        min-width: 80px;
    }
    
    .menu-item.active {
        border-left: none;
        border-bottom-color: #3b82f6;
    }
    
    .menu-item:hover {
        border-left: none;
        border-bottom-color: #cbd5e1;
    }
    
    .page-header {
        flex-direction: column;
        gap: 16px;
    }
    
    .page-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .metrics-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .resource-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .metrics-row {
        grid-template-columns: 1fr;
    }
    
    .chart-card {
        padding: 16px;
    }
    
    .content-card {
        padding: 16px;
    }
    
    .system-status-bar {
        flex-direction: column;
        gap: 8px;
        padding: 12px;
    }
    
    .status-left, .status-right {
        width: 100%;
        justify-content: space-between;
    }
}

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

.metric-card, .chart-card, .content-card {
    animation: fadeIn 0.3s ease-out;
}

.metric-card:nth-child(2) {
    animation-delay: 0.1s;
}

.metric-card:nth-child(3) {
    animation-delay: 0.2s;
}

.metric-card:nth-child(4) {
    animation-delay: 0.3s;
}

/* 加载动画 */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 实时更新指示器 */
.realtime-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #10b981;
    margin-left: 8px;
}

.realtime-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* 数据更新高亮 */
.data-updated {
    animation: highlight 1s ease-out;
}

@keyframes highlight {
    0% {
        background-color: rgba(59, 130, 246, 0.1);
    }
    100% {
        background-color: transparent;
    }
}
