        *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

        :root {
            --primary: #f472b6;
            --primary-glow: rgba(244, 114, 182, 0.5);
            --bg: #000000;
            --text: #ffffff;
            --text-secondary: #94a3b8;
            --text-muted: #64748b;
            --glass: rgba(255, 255, 255, 0.03);
            --glass-border: rgba(255, 255, 255, 0.06);
            --glass-hover: rgba(255, 255, 255, 0.08);
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            background: var(--bg);
            color: var(--text);
            line-height: 1.6;
            overflow: hidden;
            height: 100vh;
            display: flex;
            flex-direction: column;
        }

        /* ===== Top Bar ===== */
        .top-bar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 24px;
            background: rgba(0, 0, 0, 0.8);
            backdrop-filter: blur(12px);
            border-bottom: 1px solid var(--glass-border);
            z-index: 100;
            flex-shrink: 0;
        }

        .top-bar-left {
            display: flex;
            align-items: center;
            gap: 16px;
        }

        .back-link {
            color: var(--text-secondary);
            text-decoration: none;
            font-size: 14px;
            transition: color 0.2s;
        }
        .back-link:hover { color: var(--text); }

        .page-title {
            font-size: 18px;
            font-weight: 700;
            background: linear-gradient(135deg, #f472b6, #e879f9);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .top-bar-right {
            display: flex;
            align-items: center;
            gap: 16px;
        }

        .lang-toggle {
            display: flex;
            background: var(--glass);
            border: 1px solid var(--glass-border);
            border-radius: 8px;
            overflow: hidden;
        }

        .lang-btn {
            padding: 6px 14px;
            border: none;
            background: transparent;
            color: var(--text-muted);
            font-family: inherit;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }
        .lang-btn.active {
            background: rgba(244, 114, 182, 0.15);
            color: var(--primary);
        }

        .zoom-hint {
            font-size: 12px;
            color: var(--text-muted);
            white-space: nowrap;
        }

        /* ===== Canvas Container ===== */
        .canvas-container {
            flex: 1;
            position: relative;
            overflow: hidden;
            cursor: grab;
        }
        .canvas-container:active { cursor: grabbing; }

        #explorer-canvas {
            display: block;
            width: 100%;
            height: 100%;
        }

        /* ===== Legend ===== */
        .legend {
            position: absolute;
            bottom: 20px;
            left: 20px;
            background: rgba(0, 0, 0, 0.85);
            backdrop-filter: blur(12px);
            border: 1px solid var(--glass-border);
            border-radius: 12px;
            padding: 16px;
            z-index: 50;
            max-height: 60vh;
            overflow-y: auto;
            transition: transform 0.3s ease, opacity 0.3s ease;
        }

        .legend.collapsed {
            transform: translateY(calc(100% - 44px));
        }

        .legend-toggle {
            display: flex;
            align-items: center;
            justify-content: space-between;
            cursor: pointer;
            margin-bottom: 10px;
            user-select: none;
        }

        .legend-title {
            font-size: 12px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: var(--text-secondary);
        }

        .legend-arrow {
            font-size: 14px;
            color: var(--text-muted);
            transition: transform 0.3s;
        }
        .legend.collapsed .legend-arrow { transform: rotate(180deg); }

        .legend-items {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 6px 16px;
        }

        .legend-item {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 12px;
            color: var(--text-secondary);
            cursor: pointer;
            padding: 3px 6px;
            border-radius: 6px;
            transition: background 0.2s;
        }
        .legend-item:hover { background: var(--glass-hover); }
        .legend-item.dimmed { opacity: 0.3; }

        .legend-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            flex-shrink: 0;
        }

        /* ===== Detail Panel ===== */
        .detail-panel {
            position: absolute;
            top: 0;
            right: 0;
            width: 420px;
            height: 100%;
            background: rgba(0, 0, 0, 0.92);
            backdrop-filter: blur(20px);
            border-left: 1px solid var(--glass-border);
            z-index: 80;
            transform: translateX(100%);
            transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
            overflow-y: auto;
            padding: 0;
        }
        .detail-panel.open { transform: translateX(0); }

        .detail-header {
            position: sticky;
            top: 0;
            background: rgba(0, 0, 0, 0.95);
            backdrop-filter: blur(12px);
            padding: 20px 24px 16px;
            border-bottom: 1px solid var(--glass-border);
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            z-index: 1;
        }

        .detail-close {
            background: var(--glass);
            border: 1px solid var(--glass-border);
            color: var(--text-secondary);
            width: 32px;
            height: 32px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 18px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            transition: all 0.2s;
        }
        .detail-close:hover { background: var(--glass-hover); color: var(--text); }

        .detail-subject-badge {
            display: inline-block;
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 8px;
        }

        .detail-course-name {
            font-size: 20px;
            font-weight: 800;
            line-height: 1.3;
        }

        .detail-body {
            padding: 24px;
        }

        .detail-section {
            margin-bottom: 24px;
        }

        .detail-section-title {
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: var(--text-muted);
            margin-bottom: 10px;
        }

        .detail-summary {
            font-size: 14px;
            color: var(--text-secondary);
            line-height: 1.7;
        }

        .detail-expectations {
            list-style: none;
            padding: 0;
        }

        .detail-expectations li {
            font-size: 13px;
            color: var(--text-secondary);
            padding: 6px 0;
            padding-left: 20px;
            position: relative;
            line-height: 1.5;
        }

        .detail-expectations li::before {
            content: '';
            position: absolute;
            left: 0;
            top: 12px;
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: var(--bullet-color, var(--primary));
            opacity: 0.6;
        }

        .detail-topics {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }

        .detail-topic-pill {
            padding: 5px 14px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 500;
            border: 1px solid;
            opacity: 0.85;
        }

        .detail-cta {
            display: block;
            width: 100%;
            padding: 14px 20px;
            background: linear-gradient(135deg, #f472b6, #e879f9);
            border: none;
            border-radius: 12px;
            color: #000;
            font-family: inherit;
            font-size: 14px;
            font-weight: 700;
            cursor: pointer;
            text-align: center;
            text-decoration: none;
            transition: opacity 0.2s, transform 0.2s;
        }
        .detail-cta:hover { opacity: 0.9; transform: translateY(-1px); }

        /* ===== Loading ===== */
        .loading-overlay {
            position: absolute;
            inset: 0;
            background: var(--bg);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            z-index: 200;
            transition: opacity 0.6s ease;
        }
        .loading-overlay.hidden { opacity: 0; pointer-events: none; }

        .loading-spinner {
            width: 48px;
            height: 48px;
            border: 3px solid var(--glass-border);
            border-top-color: var(--primary);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }
        @keyframes spin { to { transform: rotate(360deg); } }

        .loading-text {
            margin-top: 16px;
            font-size: 14px;
            color: var(--text-muted);
        }

        /* ===== Breadcrumbs ===== */
        .breadcrumbs {
            position: absolute;
            top: 12px;
            left: 20px;
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 12px;
            z-index: 60;
            overflow-x: auto;
            max-width: calc(100% - 40px);
            white-space: nowrap;
        }

        .crumb {
            color: var(--text-muted);
            cursor: pointer;
            padding: 4px 8px;
            border-radius: 6px;
            transition: all 0.2s;
        }
        .crumb:hover { color: var(--text); background: var(--glass-hover); }
        .crumb.active { color: var(--text-secondary); cursor: default; }
        .crumb.active:hover { background: transparent; }
        .crumb-sep { color: var(--text-muted); opacity: 0.4; }

        /* ===== Tooltip ===== */
        .graph-tooltip {
            position: fixed;
            pointer-events: none;
            background: rgba(0, 0, 0, 0.92);
            backdrop-filter: blur(12px);
            border: 1px solid var(--glass-border);
            border-radius: 8px;
            padding: 10px 14px;
            z-index: 200;
            opacity: 0;
            transition: opacity 0.15s;
            max-width: 280px;
        }
        .graph-tooltip.visible { opacity: 1; }

        .tooltip-name {
            font-size: 13px;
            font-weight: 700;
            color: var(--text);
            margin-bottom: 2px;
        }
        .tooltip-meta {
            font-size: 11px;
            color: var(--text-muted);
        }

        /* ===== Edge Legend ===== */
        .edge-legend {
            position: absolute;
            bottom: 20px;
            right: 20px;
            background: rgba(0, 0, 0, 0.85);
            backdrop-filter: blur(12px);
            border: 1px solid var(--glass-border);
            border-radius: 12px;
            padding: 14px 16px;
            z-index: 50;
        }

        .edge-legend-title {
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: var(--text-secondary);
            margin-bottom: 10px;
        }

        .edge-legend-item {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 11px;
            color: var(--text-muted);
            margin-bottom: 6px;
        }
        .edge-legend-item:last-child { margin-bottom: 0; }

        .edge-legend-line {
            width: 28px;
            height: 2px;
            flex-shrink: 0;
        }
        .edge-legend-line.progression {
            background: #6366f1;
            opacity: 0.5;
        }
        .edge-legend-line.prerequisite {
            background: repeating-linear-gradient(90deg, #94a3b8 0, #94a3b8 6px, transparent 6px, transparent 10px);
            opacity: 0.4;
            height: 1.5px;
        }
        .edge-legend-line.topic-link {
            background: repeating-linear-gradient(90deg, rgba(255,255,255,0.4) 0, rgba(255,255,255,0.4) 3px, transparent 3px, transparent 6px);
            height: 1px;
        }

        /* ===== Connection pills in detail panel ===== */
        .detail-connections {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
        }

        .detail-connection-pill {
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 11px;
            font-weight: 500;
            border: 1px solid;
            cursor: pointer;
            transition: all 0.2s;
            opacity: 0.8;
        }
        .detail-connection-pill:hover {
            opacity: 1;
            background: rgba(255,255,255,0.05);
        }

        /* ===== Noscript ===== */
        .noscript-content {
            max-width: 900px;
            margin: 40px auto;
            padding: 0 24px;
        }
        .noscript-content h2 {
            font-size: 28px;
            margin-bottom: 24px;
            color: var(--primary);
        }
        .noscript-content h3 {
            font-size: 18px;
            margin: 20px 0 8px;
            color: var(--text);
        }
        .noscript-content ul { padding-left: 20px; margin-bottom: 12px; }
        .noscript-content li {
            font-size: 14px;
            color: var(--text-secondary);
            margin-bottom: 6px;
            line-height: 1.6;
        }

        /* ===== Mobile ===== */
        @media (max-width: 768px) {
            .top-bar { padding: 10px 16px; }
            .page-title { font-size: 15px; }
            .zoom-hint { display: none; }

            .legend {
                bottom: 12px;
                left: 12px;
                right: 12px;
                max-height: 40vh;
            }
            .legend-items { grid-template-columns: 1fr 1fr; gap: 4px 12px; }

            .detail-panel {
                width: 100%;
                height: 65%;
                top: auto;
                bottom: 0;
                right: 0;
                border-left: none;
                border-top: 1px solid var(--glass-border);
                border-radius: 20px 20px 0 0;
                transform: translateY(100%);
            }
            .detail-panel.open { transform: translateY(0); }

            .edge-legend { display: none; }
            .breadcrumbs { font-size: 11px; }
        }

        @media (max-width: 480px) {
            .legend-items { grid-template-columns: 1fr; }
        }