* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-y: scroll;
}

:root {
    --bg-base: #fafbfc;
    --bg-card: rgba(255, 255, 255, 0.7);
    --bg-card-hover: rgba(255, 255, 255, 0.9);
    --text-primary: #1a1a2e;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border: rgba(0, 0, 0, 0.06);
    --border-strong: rgba(0, 0, 0, 0.1);
    --accent: #6366f1;
    --accent-light: rgba(99, 102, 241, 0.1);
    --accent-medium: rgba(99, 102, 241, 0.15);
    --success: #10b981;
    --gradient-1: #667eea;
    --gradient-2: #764ba2;
    --gradient-3: #f093fb;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}


body::-webkit-scrollbar {
    width: 10px;
}

body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    margin-top: 56px;
}

body::-webkit-scrollbar-thumb {
    background: rgba(102, 108, 255, 0.6);
    border-radius: 5px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background-clip: padding-box;
    transition: all 0.3s ease;
}

body::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 108, 255, 0.9);
}

body::-webkit-scrollbar-thumb:active {
    background: rgba(102, 108, 255, 1);
}

body::-webkit-scrollbar-button {
    display: none;
}


.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(at 20% 20%, rgba(99, 102, 241, 0.15) 0, transparent 50%),
        radial-gradient(at 80% 10%, rgba(236, 72, 153, 0.1) 0, transparent 40%),
        radial-gradient(at 60% 60%, rgba(16, 185, 129, 0.08) 0, transparent 50%),
        radial-gradient(at 10% 80%, rgba(99, 102, 241, 0.1) 0, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}


.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 4px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #E5E7EB;
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 19px;
    font-weight: 700;
    color: #1F2937;
    letter-spacing: -0.3px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 28px;
    align-items: center;
}

.nav-links a {
    color: #6B7280;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: #666CFF;
}

.nav-links a.active {
    color: #666CFF;
    font-weight: 600;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-login {
    background: #666CFF;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn-login:hover {
    background: #5558E3;
    box-shadow: 0 0 0 3px rgba(102, 108, 255, 0.15);
}


.main {
    padding: 48px 0 80px;
}


.page-header {
    text-align: center;
    margin-bottom: 48px;
}

.page-title {
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.page-desc {
    font-size: 1.05rem;
    color: var(--text-secondary);
}


.map-section {
    margin-bottom: 56px;
}

.map-card {
    background: #030712;
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 24px;
    padding: 0;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.map-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    position: relative;
    z-index: 10;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.map-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
}

.map-legend {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.legend-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 10px #22c55e;
    animation: legendPulse 2s ease-in-out infinite;
}

@keyframes legendPulse {
    0%, 100% { box-shadow: 0 0 10px #22c55e; }
    50% { box-shadow: 0 0 20px #22c55e, 0 0 30px rgba(34, 197, 94, 0.5); }
}

.globe-section {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 620px;
    padding: 20px;
}

#globe-container {
    width: 100%;
    height: 600px;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
}

#globe-container canvas {
    max-width: 100%;
}

#globe-container:active {
    cursor: grabbing;
}

.globe-stats {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 28px;
    z-index: 20;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    padding: 24px 28px;
    border-radius: 16px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.globe-stat {
    text-align: right;
}

.globe-stat-value {
    font-size: 2.25rem;
    font-weight: 800;
    color: white;
    line-height: 1;
    letter-spacing: -0.02em;
}

.globe-stat-value.green {
    color: #22c55e;
    text-shadow: 0 0 30px rgba(34, 197, 94, 0.5);
}

.globe-stat-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 6px;
    font-weight: 500;
}

@media (max-width: 900px) {
    .globe-section {
        flex-direction: column;
        min-height: auto;
    }

    #globe-container {
        height: 400px;
        width: 100%;
    }

    .globe-stats {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        flex-direction: row;
        justify-content: center;
        gap: 24px;
        margin: 0 20px 20px;
        padding: 20px;
    }

    .globe-stat {
        text-align: center;
    }

    .globe-stat-value {
        font-size: 1.75rem;
    }
}


.nodes-section {
    margin-bottom: 48px;
}

.tabs-container {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.tab-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.tab-count {
    font-size: 0.75rem;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 20px;
}

.tab-btn.active .tab-count {
    background: rgba(255, 255, 255, 0.2);
}


.tab-btn[data-filter="premium"] {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.1), rgba(234, 179, 8, 0.1));
    border-color: rgba(249, 115, 22, 0.3);
    color: #f97316;
}

.tab-btn[data-filter="premium"]:hover {
    border-color: #f97316;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.15), rgba(234, 179, 8, 0.15));
}

.tab-btn[data-filter="premium"].active {
    background: linear-gradient(135deg, #f97316, #eab308);
    border-color: #f97316;
    color: white;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}


.tab-btn[data-filter="functional"] {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(59, 130, 246, 0.1));
    border-color: rgba(6, 182, 212, 0.3);
    color: #06b6d4;
}

.tab-btn[data-filter="functional"]:hover {
    border-color: #06b6d4;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(59, 130, 246, 0.15));
}

.tab-btn[data-filter="functional"].active {
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    border-color: #06b6d4;
    color: white;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4);
}

.region-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.03);
}

.region-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.03) 0%, rgba(16, 185, 129, 0.02) 100%);
    border-bottom: 1px solid var(--border);
}

.region-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.region-name::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, var(--accent), var(--success));
    border-radius: 2px;
}

.region-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-light);
    padding: 6px 14px;
    border-radius: 20px;
    letter-spacing: 0.02em;
}

.nodes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1px;
    background: var(--border);
    padding: 1px;
}

.node-cell {
    padding: 18px 22px;
    background: white;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.25s ease;
    position: relative;
}

.node-cell:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.04) 0%, rgba(16, 185, 129, 0.02) 100%);
    z-index: 1;
}

.node-status {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(34, 197, 94, 0.5); }
    50% { opacity: 0.7; box-shadow: 0 0 12px rgba(34, 197, 94, 0.8); }
}

.node-info {
    flex: 1;
    min-width: 0;
}

.node-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.node-loc {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.node-loc::before {
    content: '';
    width: 10px;
    height: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
    background-size: contain;
    opacity: 0.6;
}


.region-card.premium .region-top {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.06) 0%, rgba(234, 179, 8, 0.04) 100%);
}

.region-card.premium .region-name::before {
    background: linear-gradient(180deg, #f97316, #eab308);
}

.region-card.premium .region-badge {
    color: #f97316;
    background: rgba(249, 115, 22, 0.1);
}

.region-card.premium .node-status {
    background: #f97316;
    box-shadow: 0 0 8px rgba(249, 115, 22, 0.5);
}

.region-card.premium .node-cell:hover {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.04) 0%, rgba(234, 179, 8, 0.02) 100%);
}


.region-card.functional .region-top {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.06) 0%, rgba(59, 130, 246, 0.04) 100%);
}

.region-card.functional .region-name::before {
    background: linear-gradient(180deg, #06b6d4, #3b82f6);
}

.region-card.functional .region-badge {
    color: #06b6d4;
    background: rgba(6, 182, 212, 0.1);
}

.region-card.functional .node-status {
    background: #06b6d4;
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.5);
}

.region-card.functional .node-cell:hover {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.04) 0%, rgba(59, 130, 246, 0.02) 100%);
}


.footer {
    background: #1F2937;
    color: #9CA3AF;
    padding: 30px 0;
}

.footer-simple {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-brand-simple {
    display: flex;
    align-items: center;
    gap: 20px;
}

.footer-brand-simple .logo {
    color: white;
}

.footer-slogan {
    font-size: 14px;
    color: #9CA3AF;
}

.footer-simple .copyright {
    font-size: 14px;
}


@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .map-card {
        padding: 20px;
    }

    .tabs-container {
        gap: 6px;
        overflow-x: auto;
        padding-bottom: 8px;
        flex-wrap: nowrap;
    }

    .tab-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .region-top {
        padding: 16px 20px;
    }

    .region-name {
        font-size: 0.95rem;
    }

    .nodes-list {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .node-cell {
        padding: 14px 16px;
        gap: 10px;
    }

    .node-status {
        width: 6px;
        height: 6px;
    }

    .node-name {
        font-size: 0.85rem;
    }

    .node-loc {
        font-size: 0.72rem;
    }

    .node-loc::before {
        width: 8px;
        height: 8px;
    }

    .footer-simple {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .footer-brand-simple {
        flex-direction: column;
        gap: 12px;
    }
}
