/* 仪表盘页面样式 */

body {
    padding: 20px;
}

/* 欢迎区域 */
.welcome-box {
    padding: 20px 30px;
    text-align: center;
}

.welcome-box h2 {
    font-size: 22px;
    color: #333;
    margin-bottom: 8px;
}

.welcome-desc {
    color: #666;
    font-size: 14px;
}

/* 刷新指示器 */
.refresh-indicator {
    float: right;
    font-size: 12px;
    color: #999;
    display: flex;
    align-items: center;
    gap: 8px;
}

.refresh-indicator .refresh-icon {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #52c41a;
    animation: pulse 2s infinite;
}

.refresh-indicator.disconnected .refresh-icon {
    background: #ff4d4f;
    animation: none;
}

.refresh-indicator .divider {
    color: #ddd;
}

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

/* 统计卡片 - 5卡片布局 */
.stat-card {
    display: flex;
    align-items: center;
    padding: 20px 15px;
    border-radius: 8px;
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    min-height: 90px;
}

.stat-card-blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-card-purple {
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
}

.stat-card-cyan {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

.stat-card-green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.stat-card-orange {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.stat-card-gray {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}

.stat-icon {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}

.stat-icon .layui-icon {
    font-size: 24px;
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-content .stat-number {
    font-size: 24px;
    font-weight: bold;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-content .stat-label {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 4px;
}

/* 服务器实例监控区 */
.instance-count {
    float: right;
    font-size: 12px;
    color: #999;
    font-weight: normal;
}

.server-instances {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 15px;
}

.no-instance {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.no-instance i {
    font-size: 48px;
    margin-bottom: 10px;
    display: block;
}

.no-instance.error {
    color: #ff4d4f;
}

.no-instance.error i {
    color: #ff4d4f;
}

/* 服务器实例卡片 */
.server-instance-card {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
}

.instance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
}

.instance-id {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    font-family: 'Consolas', 'Monaco', monospace;
}

.instance-status {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-online {
    color: #52c41a;
}

.status-online .status-dot {
    background: #52c41a;
    box-shadow: 0 0 6px rgba(82, 196, 26, 0.6);
}

.instance-body {
    padding: 15px;
}

/* 指标项 */
.instance-metric {
    margin-bottom: 12px;
}

.metric-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.metric-value {
    font-weight: 500;
}

.metric-value.level-normal {
    color: #52c41a;
}

.metric-value.level-warn {
    color: #faad14;
}

.metric-value.level-danger {
    color: #ff4d4f;
}

/* 进度条 */
.progress-bar {
    height: 6px;
    background: #e8e8e8;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-fill.level-normal {
    background: linear-gradient(90deg, #52c41a, #73d13d);
}

.progress-fill.level-warn {
    background: linear-gradient(90deg, #faad14, #ffc53d);
}

.progress-fill.level-danger {
    background: linear-gradient(90deg, #ff4d4f, #ff7875);
}

/* 信息行 */
.instance-info-row {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e8e8e8;
}

.instance-info-row:first-of-type {
    margin-top: 12px;
}

.info-item {
    flex: 1;
    font-size: 12px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
}

.info-item i {
    font-size: 14px;
    color: #999;
}

/* 快捷入口 */
.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px;
    min-height: 80px;
}

.loading-quick-links,
.no-quick-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    color: #999;
    font-size: 14px;
}

.loading-quick-links i {
    font-size: 18px;
}

.quick-link-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 80px;
    background: #f6f6f6;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    position: relative;
}

/* 待审批数量徽章 */
.pending-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #ff4d4f;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(255, 77, 79, 0.4);
}

.quick-link-item:hover {
    background: #667eea;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.quick-link-item .layui-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.quick-link-item span {
    font-size: 12px;
}

/* 响应式 */
@media screen and (max-width: 1200px) {
    .stat-card {
        padding: 15px 12px;
    }

    .stat-icon {
        width: 45px;
        height: 45px;
        margin-right: 12px;
    }

    .stat-icon .layui-icon {
        font-size: 20px;
    }

    .stat-content .stat-number {
        font-size: 20px;
    }
}

@media screen and (max-width: 992px) {
    .refresh-indicator {
        display: none;
    }

    .server-instances {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media screen and (max-width: 768px) {
    .stat-card {
        padding: 12px 10px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        margin-right: 10px;
    }

    .stat-icon .layui-icon {
        font-size: 18px;
    }

    .stat-content .stat-number {
        font-size: 18px;
    }

    .stat-content .stat-label {
        font-size: 11px;
    }

    .quick-link-item {
        width: 80px;
        height: 70px;
    }

    .server-instances {
        grid-template-columns: 1fr;
    }
}
