/* ============================================
   CSS Variables & Design Tokens
   ============================================ */
:root {
    --bg-primary: #0a0b10;
    --bg-secondary: #10121a;
    --bg-card: #141620;
    --bg-elevated: #1a1c2e;
    --bg-input: #0d0e16;

    --text-primary: #e8eaf0;
    --text-secondary: #8a8fa8;
    --text-muted: #5a5f78;

    --accent: #3b82f6;
    --accent-light: #60a5fa;
    --accent-glow: rgba(59, 130, 246, 0.25);
    --accent-subtle: rgba(59, 130, 246, 0.08);

    --green: #22c55e;
    --green-glow: rgba(34, 197, 94, 0.25);
    --red: #ef4444;
    --red-glow: rgba(239, 68, 68, 0.25);
    --orange: #f59e0b;
    --orange-glow: rgba(245, 158, 11, 0.25);
    --purple: #a855f7;
    --purple-glow: rgba(168, 85, 247, 0.25);
    --cyan: #06b6d4;
    --cyan-glow: rgba(6, 182, 212, 0.25);

    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);

    --sidebar-width: 270px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    --font-display: 'Space Grotesk', 'Noto Sans SC', sans-serif;
    --font-body: 'Noto Sans SC', 'Space Grotesk', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* ============================================
   Reset & Base
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-primary);
    display: flex;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background grain texture */
.bg-grain {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px;
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    padding: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    border-right: 1px solid var(--border);
    transition: transform var(--transition);
}

.logo {
    padding: 28px 24px 24px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
    margin-bottom: 16px;
    letter-spacing: 1px;
}

.logo h2 {
    font-family: var(--font-display);
    color: var(--text-primary);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.logo p {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 400;
}

.nav-menu {
    list-style: none;
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.nav-item {
    padding: 12px 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all var(--transition);
    position: relative;
    margin: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.nav-indicator {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
    transition: height var(--transition);
}

.nav-item:hover {
    background: var(--accent-subtle);
    color: var(--text-primary);
}

.nav-item:hover .nav-indicator {
    height: 20px;
}

.nav-item.active {
    background: var(--accent-subtle);
    color: var(--accent-light);
}

.nav-item.active .nav-indicator {
    height: 24px;
}

.nav-item .icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.nav-label {
    font-weight: 500;
    white-space: nowrap;
}

.footer {
    padding: 16px 24px;
    text-align: center;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.75rem;
    letter-spacing: 0.03em;
}

/* ============================================
   Mobile Header
   ============================================ */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    z-index: 90;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
}

.menu-toggle {
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.menu-toggle:hover {
    background: var(--accent-subtle);
    border-color: var(--accent);
}

.mobile-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99;
    backdrop-filter: blur(4px);
}

/* ============================================
   Main Content
   ============================================ */
.content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 40px 48px;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ============================================
   Section & Headers
   ============================================ */
.section {
    display: none;
    animation: sectionEnter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.section.active {
    display: block;
}

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

.section-header {
    margin-bottom: 28px;
}

.section-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: var(--accent-light);
    background: var(--accent-subtle);
    border: 1px solid rgba(59, 130, 246, 0.15);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.section-header h1 {
    font-family: var(--font-display);
    color: var(--text-primary);
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    display: inline;
    margin-right: 16px;
}

.section-header {
    margin-bottom: 20px;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 400;
}

/* ============================================
   Description Card
   ============================================ */
.description {
    background: var(--bg-card);
    padding: 20px 24px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    line-height: 1.8;
    border: 1px solid var(--border);
    font-size: 0.92rem;
    color: var(--text-secondary);
}

.description p {
    margin-bottom: 8px;
}

.description p:last-child {
    margin-bottom: 0;
}

.description strong {
    color: var(--accent-light);
    font-weight: 600;
}

/* ============================================
   Controls Panel
   ============================================ */
.controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.control-group {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
    overflow-x: auto;
    padding-bottom: 4px;
}

.controls input {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    width: 110px;
    flex-shrink: 0;
    transition: all var(--transition);
}

.controls input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.controls input::placeholder {
    color: var(--text-muted);
}

/* 容量控制样式 */
.capacity-control {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    padding: 4px 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.capacity-control label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.capacity-control input[type="number"] {
    width: 44px;
    padding: 5px 6px;
    text-align: center;
    font-size: 0.8rem;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.75rem;
    background: var(--green);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-small:hover {
    background: #16a34a;
    transform: translateY(-1px);
}

/* Buttons */
.controls button {
    padding: 10px 14px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}

.controls button:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.controls button:active {
    transform: translateY(0);
}

.controls button.btn-secondary {
    background: var(--bg-elevated);
    color: var(--accent-light);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.controls button.btn-secondary:hover {
    background: rgba(59, 130, 246, 0.12);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.controls button.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.controls button.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    box-shadow: 0 4px 12px var(--red-glow);
}

.controls button.btn-accent {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.controls button.btn-accent:hover {
    background: rgba(168, 85, 247, 0.25);
    box-shadow: 0 4px 12px var(--purple-glow);
}

.controls button.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.controls button.btn-ghost:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border-hover);
    box-shadow: none;
}

/* ============================================
   Toolbar (Compact Header)
   ============================================ */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin-bottom: 16px;
}

.toolbar-inputs {
    display: flex;
    gap: 8px;
}

.toolbar-inputs input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.85rem;
    width: 90px;
    transition: all var(--transition);
}

.toolbar-inputs input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.toolbar-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.toolbar-actions button {
    padding: 8px 14px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.toolbar-info {
    margin-left: auto;
    display: flex;
    gap: 12px;
    align-items: center;
}

.toolbar-info .complexity {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg-elevated);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
    cursor: help;
}

/* ============================================
   Main Stage (Primary Visualization Area)
   ============================================ */
.main-stage {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 16px;
    min-height: 500px;
}

.stage-visualization {
    grid-row: 1 / 3;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stage-code {
    min-height: 0;
}

.stage-flowchart {
    min-height: 0;
}

.stage-code .code-demo.compact,
.stage-flowchart .flowchart-demo.compact {
    height: 100%;
    margin: 0;
}

.stage-code .code-demo.compact .code-content,
.stage-flowchart .flowchart-demo.compact .flowchart-container {
    max-height: 200px;
    overflow-y: auto;
}

/* 响应式调整 */
@media (max-width: 1024px) {
    .main-stage {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }

    .stage-visualization {
        grid-row: 1;
        min-height: 200px;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-info {
        margin-left: 0;
        justify-content: center;
    }
}

/* ============================================
   Visualization Container (三栏布局)
   ============================================ */
.visualization-container {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
    align-items: stretch;
}

.visualization {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 32px;
    min-height: 280px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: auto;
    border: 1px solid var(--border);
    position: relative;
}

.visualization-container .flowchart-demo {
    margin: 0;
}

.visualization-container .info-panel {
    margin: 0;
    overflow-y: auto;
}

/* ============================================
   Code Demo Area (Markdown 风格代码框)
   ============================================ */
.code-demo {
    background: #1e1e2e;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: visible;
    display: flex;
    flex-direction: column;
}

.code-header {
    background: #181825;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 8px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    letter-spacing: 0.03em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-header span:first-child::before {
    content: '';
    display: inline-flex;
    gap: 6px;
    margin-right: 10px;
}

.code-header .code-lang-dots {
    display: inline-flex;
    gap: 6px;
    margin-right: 10px;
}

.code-header .code-lang-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.code-header .code-lang-dots span:nth-child(1) { background: #ff5f57; }
.code-header .code-lang-dots span:nth-child(2) { background: #febc2e; }
.code-header .code-lang-dots span:nth-child(3) { background: #28c840; }

/* 代码区域收起/展开按钮 */
.toggle-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
}

.toggle-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    transform: scale(1.05);
}

.toggle-icon {
    display: inline-block;
    transition: transform var(--transition);
}

/* 收起状态 */
.code-demo.collapsed .toggle-icon {
    transform: rotate(180deg);
}

.code-demo.collapsed .toggle-icon::after {
    content: "+";
}

.code-demo.collapsed .toggle-icon {
    font-size: 1rem;
}

/* 代码内容区域过渡动画 */
.code-content {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 500px;
    opacity: 1;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.code-demo.collapsed .code-content {
    max-height: 0;
    opacity: 0;
}

.code-block {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.75;
    padding: 16px 16px 16px 0;
    margin: 0;
    background: #1e1e2e !important;
    color: #cdd6f4;
    overflow-x: auto;
    flex: 1;
    white-space: pre;
    counter-reset: line;
}

.code-block code {
    counter-reset: line;
    display: block;
}

.code-block code .code-line-row {
    display: block;
    padding: 0 16px;
}

.code-block code .code-line-row::before {
    counter-increment: line;
    content: counter(line);
    display: inline-block;
    width: 2.5em;
    margin-right: 16px;
    text-align: right;
    color: #45475a;
    font-size: 0.75rem;
    user-select: none;
    border-right: 1px solid rgba(255,255,255,0.06);
    padding-right: 12px;
}

.code-block code .code-line-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.code-line {
    padding: 2px 0;
    transition: background-color 0.2s ease;
}

.code-line.highlight {
    background: rgba(59, 130, 246, 0.15);
    border-left: 3px solid var(--accent);
}

.code-comment {
    color: var(--text-muted);
    font-style: italic;
}

.code-keyword {
    color: #c084fc;
    font-weight: 500;
}

.code-function {
    color: #60a5fa;
    font-weight: 500;
}

.code-string {
    color: #f87171;
}

/* ============================================
   Flowchart Demo Area
   ============================================ */
.flowchart-demo {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.flowchart-header {
    background: var(--bg-elevated);
    color: var(--accent-light);
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Python代码按钮 */
.py-code-btn {
    background: linear-gradient(135deg, #f9e2af 0%, #fab387 100%);
    border: none;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(249, 226, 175, 0.25);
}

.py-code-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 226, 175, 0.4);
}

.py-code-btn:active {
    transform: translateY(0);
}

.py-icon {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: #1e1e2e;
    letter-spacing: 0.5px;
}

.flowchart-container {
    padding: 16px;
    flex: 1;
    min-height: 200px;
    overflow: auto;
    background: var(--bg-input);
}

/* 搜索历史显示区域 */
.search-history {
    padding: 12px 16px;
    background: rgba(59, 130, 246, 0.05);
    border-bottom: 1px solid rgba(59, 130, 246, 0.15);
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    min-height: 24px;
    display: none;
}

.search-history.show {
    display: block;
}

.search-history .history-step {
    margin-bottom: 4px;
}

.search-history .history-step:last-child {
    margin-bottom: 0;
}

.search-history .index {
    color: var(--accent-light);
    font-weight: 500;
}

.search-history .value {
    color: var(--text-primary);
    font-weight: 500;
}

.search-history .found {
    color: var(--green);
    font-weight: 600;
}

.search-history .not-found {
    color: var(--orange);
    font-weight: 500;
}

.flowchart-container svg {
    width: 100%;
    height: auto;
}

/* 流程图节点高亮样式 */
.flowchart-node-current {
    animation: pulse-node 0.6s ease-in-out infinite alternate;
}

.flowchart-node-visited {
    opacity: 0.7 !important;
}

.flowchart-node-visited rect,
.flowchart-node-visited circle,
.flowchart-node-visited ellipse,
.flowchart-node-visited polygon,
.flowchart-node-visited path {
    stroke: #3b82f6 !important;
    stroke-width: 2px !important;
}

/* 流程图边高亮样式 */
.flowchart-edge-highlight path {
    stroke: #22c55e !important;
    stroke-width: 3px !important;
    filter: drop-shadow(0 0 6px rgba(34, 197, 94, 0.6));
}

.flowchart-edge-highlight marker path {
    fill: #22c55e !important;
}

@keyframes pulse-node {
    0% {
        filter: drop-shadow(0 0 8px rgba(34, 197, 94, 0.5));
    }
    100% {
        filter: drop-shadow(0 0 15px rgba(34, 197, 94, 0.8));
    }
}

/* ============================================
   Responsive for three-column layout
   ============================================ */
@media (max-width: 1200px) {
    .visualization-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .visualization {
        min-height: 220px;
        padding: 20px;
    }

    .code-block {
        font-size: 0.75rem;
        padding: 12px;
    }
}

/* ============================================
   Array Styles
   ============================================ */
.array-container {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

.array-item {
    width: 62px;
    height: 62px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--accent), #2563eb);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 600;
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: arrayAppear 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.array-item .index {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 2px;
    font-weight: 400;
}

.array-item.highlight {
    background: linear-gradient(135deg, var(--orange), #d97706);
    transform: scale(1.1);
    box-shadow: 0 4px 20px var(--orange-glow);
}

.array-item.found {
    background: linear-gradient(135deg, var(--green), #16a34a);
    transform: scale(1.1);
    box-shadow: 0 4px 20px var(--green-glow);
}

@keyframes arrayAppear {
    from { opacity: 0; transform: scale(0.6); }
    to { opacity: 1; transform: scale(1); }
}

/* ============================================
   Stack Styles
   ============================================ */
.stack-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
}

.stack-container {
    display: flex;
    flex-direction: column-reverse;
    gap: 6px;
    min-height: 200px;
    justify-content: flex-start;
    padding: 14px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    border: 2px dashed rgba(168, 85, 247, 0.2);
    min-width: 90px;
}

.stack-label {
    color: var(--purple);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 8px 12px;
    letter-spacing: 0.05em;
}

.stack-item {
    width: 76px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--purple), #7c3aed);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 600;
    color: white;
    animation: stackPush 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 8px var(--purple-glow);
}

.stack-item.highlight {
    background: linear-gradient(135deg, var(--orange), #d97706);
    box-shadow: 0 4px 16px var(--orange-glow);
}

@keyframes stackPush {
    from { opacity: 0; transform: translateY(-20px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================
   Queue Styles
   ============================================ */
.queue-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.queue-container {
    display: flex;
    gap: 6px;
    min-width: 300px;
    min-height: 60px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    border: 2px dashed rgba(6, 182, 212, 0.2);
    align-items: center;
}

.queue-pointer {
    color: var(--cyan);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    padding: 6px 14px;
    background: rgba(6, 182, 212, 0.08);
    border-radius: 20px;
    border: 1px solid rgba(6, 182, 212, 0.15);
    letter-spacing: 0.03em;
}

.queue-item {
    width: 60px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--cyan), #0891b2);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 600;
    color: white;
    animation: queueEnqueue 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 8px var(--cyan-glow);
}

.queue-item.highlight {
    background: linear-gradient(135deg, var(--orange), #d97706);
    box-shadow: 0 4px 16px var(--orange-glow);
}

@keyframes queueEnqueue {
    from { opacity: 0; transform: translateX(20px) scale(0.9); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

/* ============================================
   Array Layout (New)
   ============================================ */
.array-visualization-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 30px 20px;
    margin: 20px 0;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.array-container {
    display: flex;
    flex-direction: row;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    min-height: 60px;
    width: 100%;
}

/* 数组代码区域布局 */
.array-code-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-top: 20px;
    align-items: stretch;
}

.array-code-section .code-demo,
.array-code-section .flowchart-demo {
    margin: 0;
}

.array-code-section .info-panel {
    margin: 0;
    overflow-y: auto;
}

@media (max-width: 1024px) {
    .array-code-section {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Tree Layout (New)
   ============================================ */
.tree-visualization-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    min-height: fit-content;
}

.tree-visualization-section canvas {
    display: block;
    max-width: 100%;
}

/* 二叉树代码区域布局 */
.tree-code-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-top: 20px;
    align-items: stretch;
}

.tree-code-section .code-demo,
.tree-code-section .flowchart-demo {
    margin: 0;
}

.tree-code-section .info-panel {
    margin: 0;
    overflow-y: auto;
}

@media (max-width: 1024px) {
    .tree-code-section {
        grid-template-columns: 1fr;
    }
    .tree-code-section .info-panel {
        max-height: none;
    }
}

/* ============================================
   Queue Horizontal Layout (New)
   ============================================ */
.queue-visualization-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 30px 20px;
    margin: 20px 0;
}

.queue-wrapper-horizontal {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 20px;
    min-height: 100px;
}

.queue-end-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cyan);
    padding: 10px 16px;
    background: rgba(6, 182, 212, 0.08);
    border-radius: var(--radius-md);
    border: 1px solid rgba(6, 182, 212, 0.2);
    white-space: nowrap;
}

.queue-end-label .arrow {
    font-size: 1.2rem;
    line-height: 1;
}

.front-label .arrow {
    color: var(--green);
}

.rear-label .arrow {
    color: var(--orange);
}

.queue-container-horizontal {
    display: flex;
    flex-direction: row;
    gap: 8px;
    min-width: 200px;
    min-height: 70px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    border: 2px dashed rgba(6, 182, 212, 0.25);
    align-items: center;
    justify-content: flex-start;
    overflow-x: auto;
}

/* 队列代码区域布局 */
.queue-code-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-top: 20px;
    align-items: stretch;
}

.queue-code-section .code-demo,
.queue-code-section .flowchart-demo {
    margin: 0;
}

.queue-code-section .info-panel {
    margin: 0;
    overflow-y: auto;
}

@media (max-width: 1024px) {
    .queue-code-section {
        grid-template-columns: 1fr;
    }

    .queue-wrapper-horizontal {
        flex-wrap: wrap;
        gap: 15px;
    }

    .queue-end-label {
        font-size: 0.75rem;
        padding: 8px 12px;
    }
}

/* ============================================
   Linked List Styles
   ============================================ */
.linkedlist-visualization-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 30px 20px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

.linkedlist-container {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
    justify-content: center;
    padding: 20px;
}

.linkedlist-node {
    display: flex;
    align-items: center;
    animation: nodeAppear 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.node-box {
    display: flex;
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-elevated);
}

.node-data {
    width: 52px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 600;
    color: white;
}

.node-pointer {
    width: 28px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(99, 102, 241, 0.12);
    font-size: 0.85rem;
    color: #818cf8;
}

.node-arrow {
    width: 28px;
    height: 2px;
    background: #818cf8;
    position: relative;
}

.node-arrow::after {
    content: '';
    position: absolute;
    right: 0;
    top: -4px;
    border: 5px solid transparent;
    border-left-color: #818cf8;
}

.node-null {
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    color: #f87171;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 500;
}

.linkedlist-node.highlight .node-data {
    background: linear-gradient(135deg, var(--orange), #d97706);
}

@keyframes nodeAppear {
    from { opacity: 0; transform: translateX(-12px); }
    to { opacity: 1; transform: translateX(0); }
}

/* 链表代码区域布局 */
.linkedlist-code-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-top: 20px;
    align-items: stretch;
}

.linkedlist-code-section .code-demo,
.linkedlist-code-section .flowchart-demo {
    margin: 0;
}

.linkedlist-code-section .info-panel {
    margin: 0;
    overflow-y: auto;
}

@media (max-width: 1024px) {
    .linkedlist-code-section {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Canvas (Tree & Graph)
   ============================================ */
#tree-canvas, #graph-canvas {
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    max-width: 100%;
}

/* ============================================
   Adjacency Display
   ============================================ */
.adjacency-display {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.adjacency-matrix, .adjacency-list {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius-lg);
    flex: 1;
    min-width: 250px;
    border: 1px solid var(--border);
}

.adjacency-matrix h4, .adjacency-list h4 {
    font-family: var(--font-display);
    color: var(--text-primary);
    margin-bottom: 14px;
    font-size: 0.95rem;
    font-weight: 600;
}

.matrix-table {
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.matrix-table th, .matrix-table td {
    width: 32px;
    height: 32px;
    text-align: center;
    border: 1px solid var(--border);
}

.matrix-table th {
    background: var(--accent-subtle);
    color: var(--accent-light);
    font-weight: 500;
}

.matrix-table td {
    background: var(--bg-input);
    color: var(--text-secondary);
}

.matrix-table td.has-edge {
    background: rgba(34, 197, 94, 0.12);
    color: var(--green);
    font-weight: 600;
}

.adj-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.88rem;
}

.adj-list-vertex {
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #ff5722, #e64a19);
    border-radius: 50%;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.8rem;
    color: white;
}

.adj-list-neighbors {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

/* ============================================
   Message Toast
   ============================================ */
.message {
    padding: 14px 20px;
    margin-bottom: 16px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    display: none;
    border: 1px solid transparent;
}

.message.show {
    display: block;
    animation: messageSlide 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.message.success {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.2);
    border-left: 3px solid var(--green);
    color: #4ade80;
}

.message.error {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
    border-left: 3px solid var(--red);
    color: #f87171;
}

.message.info {
    background: var(--accent-subtle);
    border-color: rgba(59, 130, 246, 0.15);
    border-left: 3px solid var(--accent);
    color: var(--accent-light);
}

@keyframes messageSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   Traversal Result
   ============================================ */
.traversal-result {
    padding: 18px 22px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    display: none;
    border: 1px solid var(--border);
}

.traversal-result.show {
    display: block;
}

.traversal-result h4 {
    font-family: var(--font-display);
    color: var(--text-primary);
    margin-bottom: 12px;
    font-size: 0.95rem;
    font-weight: 600;
}

.traversal-sequence {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.traversal-node {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--green), #16a34a);
    border-radius: 50%;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
    animation: traversalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    opacity: 0;
    box-shadow: 0 2px 8px var(--green-glow);
}

@keyframes traversalPop {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

/* ============================================
   Info Panel
   ============================================ */
.info-panel {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius-lg);
    margin-top: 20px;
    border: 1px solid var(--border);
}

.info-panel h3 {
    font-family: var(--font-display);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 10px;
    margin-top: 18px;
}

.info-panel h3:first-child {
    margin-top: 0;
}

.info-panel ul {
    list-style: none;
    padding-left: 0;
}

.info-panel li {
    padding: 6px 0 6px 20px;
    color: var(--text-secondary);
    font-size: 0.88rem;
    position: relative;
}

.info-panel li::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 14px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
}

.info-panel li strong {
    color: var(--text-primary);
    font-weight: 500;
}

/* ============================================
   Intro / Overview Page
   ============================================ */
.intro-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.intro-card {
    background: var(--bg-card);
    padding: 28px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: border-color var(--transition);
}

.intro-card:hover {
    border-color: var(--border-hover);
}

.intro-card-icon {
    font-size: 1.8rem;
    margin-bottom: 14px;
}

.intro-card h3 {
    font-family: var(--font-display);
    color: var(--text-primary);
    margin-bottom: 14px;
    font-size: 1.2rem;
    font-weight: 600;
}

.intro-card p {
    line-height: 1.8;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.intro-card p:last-child {
    margin-bottom: 0;
}

/* Formula badge */
.formula-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-subtle);
    border: 1px solid rgba(59, 130, 246, 0.15);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    margin-top: 8px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--accent-light);
}

.formula-op {
    color: var(--text-muted);
    font-weight: 400;
}

.intro-hero {
    border-left: 3px solid var(--accent);
}

.intro-cta {
    border-left: 3px solid var(--green);
}

/* Classification cards */
.classification {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

.class-item {
    background: var(--bg-elevated);
    padding: 22px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.class-tag {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    padding: 3px 10px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 10px;
    font-weight: 500;
}

.class-item.linear .class-tag {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-light);
    border: 1px solid rgba(59, 130, 246, 0.15);
}

.class-item.nonlinear .class-tag {
    background: rgba(168, 85, 247, 0.1);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.15);
}

.class-item h4 {
    font-family: var(--font-display);
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 1rem;
    font-weight: 600;
}

.class-item p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.7;
}

.class-item ul {
    list-style: none;
    margin-top: 12px;
}

.class-item li {
    padding: 4px 0 4px 18px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    position: relative;
}

.class-item li::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 12px;
    width: 6px;
    height: 1px;
}

.class-item.linear li::before {
    background: var(--accent);
}

.class-item.nonlinear li::before {
    background: var(--purple);
}

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.open {
        display: block;
    }

    .mobile-header {
        display: flex;
    }

    .content {
        margin-left: 0;
        padding: 72px 24px 24px;
    }

    .section-header h1 {
        font-size: 1.6rem;
    }

    .classification {
        grid-template-columns: 1fr;
    }

    .controls input {
        width: 100%;
    }

    .control-group {
        width: 100%;
    }

    #tree-canvas, #graph-canvas {
        width: 100%;
        height: auto;
    }
}

@media (max-width: 600px) {
    .content {
        padding: 64px 14px 14px;
    }

    .section-header h1 {
        font-size: 1.35rem;
    }

    .visualization {
        padding: 16px;
        min-height: 220px;
    }

    .intro-card {
        padding: 20px;
    }

    .formula-badge {
        flex-wrap: wrap;
        font-size: 0.85rem;
        padding: 8px 14px;
    }

    .adjacency-display {
        flex-direction: column;
    }

    .queue-container {
        min-width: auto;
    }
}

/* ============================================
   Prism.js Syntax Highlighting Overrides
   ============================================ */
/* Markdown 风格暗色代码高亮 (Catppuccin Mocha 配色) */
.code-block {
    background: #1e1e2e !important;
    margin: 0;
    padding: 16px 16px 16px 0;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.code-block code {
    font-family: var(--font-mono) !important;
    font-size: 0.82rem !important;
    line-height: 1.75 !important;
    text-shadow: none !important;
    background: transparent !important;
}

/* 覆盖 Prism tomorrow 主题颜色 */
.code-block .token.comment,
.code-block .token.prolog,
.code-block .token.doctype,
.code-block .token.cdata {
    color: #6c7086;
    font-style: italic;
}

.code-block .token.keyword {
    color: #cba6f7;
    font-weight: 600;
}

.code-block .token.string {
    color: #a6e3a1;
}

.code-block .token.number {
    color: #fab387;
}

.code-block .token.function {
    color: #89b4fa;
}

.code-block .token.class-name {
    color: #f9e2af;
    font-weight: 600;
}

.code-block .token.operator {
    color: #89dceb;
}

.code-block .token.punctuation {
    color: #bac2de;
}

.code-block .token.builtin {
    color: #f38ba8;
}

.code-block .token.boolean {
    color: #fab387;
}

.code-block .token.decorator {
    color: #f9e2af;
}

/* ============================================
   Toast Notification System
   ============================================ */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border);
    min-width: 280px;
    max-width: 420px;
    pointer-events: auto;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-icon {
    font-size: 1.2rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Toast 类型样式 */
.toast-success {
    border-left: 4px solid var(--green);
}

.toast-success .toast-icon {
    background: rgba(34, 197, 94, 0.15);
    color: var(--green);
}

.toast-error {
    border-left: 4px solid var(--red);
}

.toast-error .toast-icon {
    background: rgba(239, 68, 68, 0.15);
    color: var(--red);
}

.toast-info {
    border-left: 4px solid var(--accent);
}

.toast-info .toast-icon {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent);
}

.toast-warning {
    border-left: 4px solid var(--orange);
}

.toast-warning .toast-icon {
    background: rgba(245, 158, 11, 0.15);
    color: var(--orange);
}

/* 移动端适配 */
@media (max-width: 480px) {
    #toast-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }

    .toast {
        min-width: auto;
        max-width: none;
    }
}

/* ============================================
   Graph Layout (Full-width visualization)
   ============================================ */
.graph-visualization-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    min-height: 300px;
}

.graph-visualization-section canvas {
    display: block;
    max-width: 100%;
}

/* 图代码区域布局 */
.graph-code-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-top: 20px;
    align-items: stretch;
}

.graph-code-section .code-demo,
.graph-code-section .flowchart-demo {
    margin: 0;
}

.graph-code-section .info-panel {
    margin: 0;
    overflow-y: auto;
}

@media (max-width: 1024px) {
    .graph-code-section {
        grid-template-columns: 1fr;
    }
}
