/* ==================== 节点管理UI样式 ==================== */

/* 节点推荐区域 */
.proxy-recommendation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.proxy-recommendation span {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

.proxy-recommendation button {
    padding: 8px 16px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.proxy-recommendation button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.proxy-recommendation button:active {
    transform: translateY(0);
}

.proxy-recommendation button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 节点状态显示 */
.proxy-node-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    margin-top: 8px;
    font-size: 0.85rem;
}

.proxy-node-status span {
    color: var(--text-secondary);
}

.proxy-node-status strong {
    color: var(--text-primary);
    font-weight: 600;
    margin-left: 4px;
}

.proxy-node-status button {
    padding: 6px 12px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.proxy-node-status button:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary-color);
}

/* 节点管理模态窗口 */
.node-management-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.node-management-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.node-modal-content {
    background: var(--bg-primary);
    border-radius: 16px;
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.node-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 2px solid var(--border-color);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
}

.node-modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--text-primary);
}

.node-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.node-modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.node-modal-body {
    padding: 20px 24px;
    max-height: calc(80vh - 180px);
    overflow-y: auto;
}

/* 节点列表 */
.node-list {
    display: grid;
    gap: 12px;
}

.node-item {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.node-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.node-item.failed {
    opacity: 0.6;
    background: rgba(239, 68, 68, 0.05);
}

.node-item.deleted {
    opacity: 0.4;
    background: rgba(107, 114, 128, 0.05);
}

.node-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.node-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.node-url {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
}

.node-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    font-size: 0.8rem;
}

.node-response-time {
    color: var(--text-secondary);
    font-weight: 600;
}

.node-response-time.fast {
    color: #10b981;
}

.node-response-time.medium {
    color: #f59e0b;
}

.node-response-time.slow {
    color: #ef4444;
}

.node-success-rate {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* 节点健康度评分 */
.node-health-score {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 2px;
}

.node-health-score.score-high {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.node-health-score.score-medium {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.node-health-score.score-low {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.node-status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.node-status-badge.active {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.node-status-badge.testing {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.node-status-badge.failed {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.node-status-badge.deleted {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

.node-actions {
    display: flex;
    gap: 6px;
}

.node-action-btn {
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.node-action-btn.test {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.node-action-btn.test:hover {
    background: var(--primary-color);
    color: white;
}

.node-action-btn.restore {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.node-action-btn.restore:hover {
    background: #10b981;
    color: white;
}

/* 节点管理操作栏 */
.node-modal-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px 24px;
    border-top: 2px solid var(--border-color);
    background: var(--bg-secondary);
}

.node-modal-actions button {
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-align: center;
    min-height: 44px;
}

.node-modal-actions .btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
}

.node-modal-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.node-modal-actions .btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.node-modal-actions .btn-secondary:hover {
    background: var(--bg-primary);
    border-color: var(--primary-color);
}

/* 测速进度条 */
.speed-test-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(99, 102, 241, 0.1);
    z-index: 10001;
    display: none;
}

.speed-test-progress.active {
    display: block;
}

.speed-test-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

/* 测速状态提示 */
.speed-test-status {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 20px;
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    border: 2px solid var(--primary-color);
    z-index: 10001;
    display: none;
    animation: slideInRight 0.3s ease;
}

.speed-test-status.active {
    display: block;
}

.speed-test-status-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.speed-test-status-progress {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .node-modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .node-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .node-stats,
    .node-actions {
        align-items: flex-start;
    }

    .node-modal-actions {
        grid-template-columns: 1fr;
    }

    .proxy-recommendation {
        flex-direction: column;
        align-items: stretch;
    }

    .proxy-recommendation button {
        width: 100%;
    }
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}