/*
 * 服务器状态监控和网速显示样式
 */

/* 服务器监控容器 - 适配原有统计栏样式 */
.server-monitor {
    margin-top: 20px;
    padding: 20px;
    border-radius: 12px;
    background: var(--card-bg, #f8fafc);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: 1px solid var(--border-color, #e2e8f0);
    position: relative;
    transition: all 0.3s ease;
}

.server-monitor:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    transform: translateY(-1px);
}

.server-monitor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.server-monitor-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.server-monitor-title i {
    font-style: normal;
    color: #2563eb;
    font-size: 18px;
}

/* 实时网速显示 - 右上角 */
.net-speed-display {
    text-align: right;
    font-size: 13px;
    background: rgba(255,255,255,0.8);
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color, #e2e8f0);
    backdrop-filter: blur(4px);
}

.net-speed-item {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin: 2px 0;
    gap: 6px;
    line-height: 1.4;
}

.net-speed-arrow {
    font-size: 16px;
    font-weight: bold;
    width: 18px;
    text-align: center;
    transition: transform 0.2s ease;
}

.net-speed-arrow.up {
    color: #f56c6c;
}

.net-speed-arrow.down {
    color: #2563eb;
}

.net-speed-value {
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    min-width: 90px;
    text-align: right;
    font-family: 'Courier New', monospace;
}

/* 进度条样式 - 适配页面风格 */
.monitor-item {
    margin: 16px 0;
    padding: 12px;
    background: rgba(255,255,255,0.6);
    border-radius: 8px;
    border: 1px solid var(--border-color, #e2e8f0);
    transition: all 0.3s ease;
}

.monitor-item:hover {
    background: rgba(255,255,255,0.8);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.monitor-label {
    font-size: 14px;
    color: var(--text-secondary, #64748b);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.monitor-label .value-text {
    color: #2563eb;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.progress-container {
    width: 100%;
    height: 10px;
    background: var(--progress-bg, #e2e8f0);
    border-radius: 5px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.progress-bar {
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s ease, background-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 不同占用率颜色 - 适配页面主色调 */
.progress-low { background: linear-gradient(90deg, #67c23a, #85ce61); }
.progress-mid { background: linear-gradient(90deg, #e6a23c, #ebb563); }
.progress-high { background: linear-gradient(90deg, #f56c6c, #f78989); }
.progress-unknown { background: linear-gradient(90deg, #909399, #b3b6bb); }

/* 错误提示 */
.monitor-error {
    font-size: 13px;
    color: #f56c6c;
    margin-top: 12px;
    text-align: center;
    padding: 8px;
    background: rgba(245,108,108,0.1);
    border-radius: 6px;
    border: 1px solid rgba(245,108,108,0.2);
}

/* 磁盘IO样式 */
.disk-io-row {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary, #64748b);
    font-family: 'Courier New', monospace;
}

/* 网速曲线图容器 */
.net-speed-chart-container {
    margin-top: 20px;
    padding: 16px;
    border-top: 1px solid var(--border-color, #e2e8f0);
    background: rgba(255,255,255,0.6);
    border-radius: 8px;
}

.net-speed-chart-title {
    font-size: 13px;
    color: var(--text-secondary, #64748b);
    margin-bottom: 12px;
    text-align: center;
    font-weight: 500;
}

.net-speed-chart {
    width: 100%;
    height: 120px;
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(255,255,255,0.8);
    border: 1px solid var(--border-color, #e2e8f0);
}

.net-speed-chart canvas {
    width: 100%;
    height: 100%;
}

/* 图例 */
.net-chart-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 12px;
    font-size: 12px;
    font-weight: 500;
}

.net-chart-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(255,255,255,0.8);
    border-radius: 12px;
    border: 1px solid var(--border-color, #e2e8f0);
    transition: all 0.2s ease;
}

.net-chart-legend-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.net-chart-legend-color {
    width: 16px;
    height: 4px;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.net-chart-legend-color.upload {
    background: #f56c6c;
}

.net-chart-legend-color.download {
    background: #2563eb;
}

/* 暗黑模式适配 */
[data-theme="dark"] .server-monitor {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .server-monitor:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

[data-theme="dark"] .server-monitor-title {
    color: #f8fafc;
}

[data-theme="dark"] .net-speed-display {
    background: rgba(30,41,59,0.8);
    border-color: #334155;
}

[data-theme="dark"] .net-speed-value {
    color: #f8fafc;
}

[data-theme="dark"] .monitor-item {
    background: rgba(30,41,59,0.6);
    border-color: #334155;
}

[data-theme="dark"] .monitor-item:hover {
    background: rgba(30,41,59,0.8);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

[data-theme="dark"] .monitor-label {
    color: #94a3b8;
}

[data-theme="dark"] .progress-container {
    background: #334155;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}

[data-theme="dark"] .monitor-error {
    background: rgba(245,108,108,0.15);
    border-color: rgba(245,108,108,0.3);
}

[data-theme="dark"] .net-speed-chart-container {
    background: rgba(30,41,59,0.6);
    border-top-color: #334155;
}

[data-theme="dark"] .net-speed-chart {
    background: rgba(30,41,59,0.8);
    border-color: #334155;
}

[data-theme="dark"] .net-chart-legend-item {
    background: rgba(30,41,59,0.8);
    border-color: #334155;
}

[data-theme="dark"] .net-chart-legend-item:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .server-monitor {
        padding: 16px;
        margin-top: 16px;
    }

    .server-monitor-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .net-speed-display {
        width: 100%;
        text-align: left;
        order: 1;
    }

    .server-monitor-title {
        order: 2;
    }

    .net-speed-item {
        justify-content: flex-start;
    }

    .monitor-item {
        margin: 12px 0;
        padding: 10px;
    }

    .net-speed-chart {
        height: 100px;
    }

    .net-chart-legend {
        gap: 12px;
        flex-wrap: wrap;
    }

    .net-chart-legend-item {
        padding: 4px 8px;
        font-size: 11px;
    }
}

/* 平板适配 */
@media (min-width: 769px) and (max-width: 1024px) {
    .server-monitor {
        padding: 18px;
    }

    .net-speed-chart {
        height: 110px;
    }
}

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

.server-monitor {
    animation: fadeIn 0.5s ease-out;
}

.monitor-item {
    animation: fadeIn 0.3s ease-out;
}

.monitor-item:nth-child(2) { animation-delay: 0.1s; }
.monitor-item:nth-child(3) { animation-delay: 0.2s; }
.monitor-item:nth-child(4) { animation-delay: 0.3s; }
.net-speed-chart-container { animation-delay: 0.4s; }