/* ============================================================
   节点状态页面 - subscribe.css
   原创设计：卡片网格布局 + 视觉化状态指示器
   与moban3的表格列表布局完全不同
   ============================================================ */

/* Twemoji 国旗支持 */
.node-flag {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-right: 6px;
}

.node-flag img.emoji,
.subscribe-page img.emoji {
    height: 18px !important;
    width: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    display: block !important;
}

.node-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 20px;
}

/* ====== 页面头部统计栏 ====== */
.node-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    animation: fadeUp .35s var(--ease-out) both;
}

.stat-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.stat-chip span:not(.dot),
.stat-chip strong {
    line-height: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
}

.stat-chip strong {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-chip .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.stat-chip .dot.green { background: #22C55E; box-shadow: 0 0 6px rgba(34,197,94,.45); }
.stat-chip .dot.gray  { background: #9CA3AF; }
.stat-chip .dot.all    { background: linear-gradient(135deg, var(--accent), var(--accent-light)); }

/* ====== 筛选栏 ====== */
.node-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    animation: fadeUp .35s var(--ease-out) .05s both;
}

.filter-btn {
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--divider);
    background: var(--card-bg);
    color: var(--text-secondary);
    border-radius: 20px;
    cursor: pointer;
    transition: all .18s var(--ease-out);
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.filter-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ====== 节点卡片网格 ====== */
.node-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
    animation: fadeUp .35s var(--ease-out) .1s both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ====== 单个节点卡片 ====== */
.node-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    border: 1px solid transparent;
    transition: all .2s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.node-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    border-color: rgba(108,92,231,.15);
    transform: translateY(-2px);
}

/* 在线状态指示条 - 卡片左侧竖条 */
.node-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: #D1D5DB;
    transition: background .2s;
}

.node-card.online::before {
    background: #22C55E;
    box-shadow: 0 0 8px rgba(34,197,94,.3);
}

/* 卡片头部：名称 + 状态 */
.node-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.node-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

.node-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    flex-shrink: 0;
    padding: 3px 10px;
    border-radius: 12px;
}

.node-status.online {
    color: #16A34A;
    background: rgba(34,197,94,.1);
}

.node-status.offline {
    color: #9CA3AF;
    background: rgba(156,163,175,.1);
}

.node-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.node-status.online .node-status-dot {
    background: #22C55E;
    box-shadow: 0 0 5px rgba(34,197,94,.5);
}

.node-status.offline .node-status-dot {
    background: #9CA3AF;
}

/* 卡片底部：倍率 + 标签 */
.node-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.node-rate {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    background: rgba(108,92,231,.08);
    color: var(--accent);
}

.node-rate.high {
    background: rgba(239,68,68,.08);
    color: #EF4444;
}

.node-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 10px;
    background: var(--surface-alt);
    color: var(--text-secondary);
}

/* ====== 空状态 ====== */
.node-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: var(--text-muted);
    animation: fadeUp .35s var(--ease-out) both;
}

.node-empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--surface-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.node-empty-icon svg {
    width: 28px;
    height: 28px;
    stroke: var(--text-muted);
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.node-empty-text {
    font-size: 14px;
    margin: 0;
}

/* ====== 响应式 ====== */

/* 平板 */
@media (max-width: 768px) {
    .node-stats {
        flex-wrap: wrap;
    }

    .stat-chip {
        padding: 8px 14px;
        font-size: 12px;
    }

    .stat-chip strong {
        font-size: 16px;
    }

    .node-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .node-card {
        padding: 14px 16px;
    }
}

/* 小屏手机 */
@media (max-width: 380px) {
    .stat-chip {
        padding: 6px 10px;
        font-size: 11px;
        gap: 6px;
    }

    .stat-chip strong {
        font-size: 14px;
    }

    .node-name {
        font-size: 13px;
    }

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