:root{--bg: #f2f7f5;--surface: #ffffff;--surface-2: #eaf3f0;--text: #12211d;--muted: #5d716b;--line: #d6e5e1;--brand: #2f9e7d;--brand-strong: #18765a;--warn: #d94848;--code-bg: #0f1f1b;--code-line: #142a24;--code-active: #1f3a32;--state-idle-fill: #dde9e6;--state-idle-stroke: #31554d;--state-current-fill: #2f9e7d;--state-current-stroke: #18765a;--state-compare-fill: #e8b04b;--state-compare-stroke: #b07a12;--state-visited-fill: #9ad3c2;--state-visited-stroke: #4f8d7b;--state-done-fill: #18765a;--state-done-stroke: #0f4f3d;--state-path-fill: #0f6b56;--state-path-stroke: #0a4a3b;--state-error-fill: #c94a4a;--state-error-stroke: #8f2f2f;--space-1: 4px;--space-2: 8px;--space-3: 12px;--space-4: 16px;--header-height: 44px;--footer-height: 48px;--code-panel-width: clamp(320px, 24vw, 400px);--radius-card: 10px;--radius-control: 8px}*{box-sizing:border-box}html,body,#root{margin:0;width:100%;height:100%}body{font-family:SF Pro Text,PingFang SC,Microsoft YaHei,sans-serif;color:var(--text);background:radial-gradient(circle at 10% 0%,#f8fcfb 0%,var(--bg) 42%,#ebf3f0 100%)}.app-root{height:100%;display:grid;grid-template-rows:auto auto auto 1fr auto}.problem-header{position:relative;display:flex;justify-content:center;align-items:center;min-height:var(--header-height);padding:0 var(--space-3);border-bottom:1px solid var(--line);background:var(--surface)}.hot100-link{position:absolute;left:var(--space-3);top:50%;transform:translateY(-50%);color:var(--brand-strong);text-decoration:none;font-size:12px;white-space:nowrap}.problem-title-link{max-width:calc(100% - 380px);color:var(--text);font-weight:700;text-decoration:none;font-size:16px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.top-actions{position:absolute;right:var(--space-3);top:6px;display:flex;gap:var(--space-1);z-index:8}.thought-btn,.github-badge,.tab-btn,.input-action-btn,.input-random-btn,.playback-btn,.speed-btn,.close-btn{border:1px solid var(--line);background:var(--surface);color:var(--text);border-radius:var(--radius-control);cursor:pointer;padding:5px 9px;font-size:12px;line-height:1.3}.thought-btn:hover,.github-badge:hover,.tab-btn:hover,.playback-btn:hover,.speed-btn:hover{border-color:var(--brand)}.github-badge{display:inline-flex;align-items:center;gap:6px;text-decoration:none}.github-stars{color:var(--brand-strong);font-weight:700}.data-input-bar{display:grid;grid-template-columns:auto minmax(240px,1fr) auto auto auto 1fr;align-items:center;gap:var(--space-2);padding:6px var(--space-3);border-bottom:1px solid var(--line);background:var(--surface)}.input-label{font-size:12px;color:var(--muted);white-space:nowrap}.data-input{border:1px solid var(--line);border-radius:var(--radius-control);padding:6px 8px;font-size:12px;min-width:0}.data-input.error{border-color:var(--warn)}.input-random-btn{background:var(--brand);border-color:var(--brand);color:#fff}.input-error{color:var(--warn);font-size:12px;justify-self:end}.solution-tabs{display:flex;gap:6px;padding:4px var(--space-3);border-bottom:1px solid var(--line);background:var(--surface-2)}.tab-btn.active{background:var(--brand);color:#fff;border-color:var(--brand)}.workspace{min-height:0;display:grid;grid-template-columns:minmax(0,1fr) var(--code-panel-width);gap:var(--space-2);padding:var(--space-2)}.canvas-section,.code-section{min-height:0}.canvas-card{height:100%;display:grid;grid-template-rows:auto 1fr auto auto auto;border:1px solid var(--line);border-radius:var(--radius-card);background:var(--surface);overflow:hidden}.canvas-title{display:flex;align-items:center;justify-content:space-between;gap:var(--space-2);padding:5px 10px;border-bottom:1px solid var(--line);font-size:12px;line-height:1.3;color:var(--muted)}.canvas-title-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.operation-badge{flex:none;border:1px solid #b9dccf;border-radius:999px;background:#e7f4ef;color:var(--brand-strong);padding:1px 8px;font-size:10px;font-weight:600;transition:background-color .24s ease,color .24s ease}.viz-canvas{width:100%;height:100%;min-height:0;background:linear-gradient(180deg,#fbfefd,#f4faf8)}.canvas-backdrop{fill:#ffffff05}.canvas-node .node-core{fill:var(--state-idle-fill);stroke:var(--state-idle-stroke);stroke-width:2;transition:fill .24s ease,stroke .24s ease}.canvas-node .node-ring{fill:none;stroke:transparent;stroke-width:2;opacity:0;pointer-events:none}.canvas-node.node--current .node-ring,.canvas-node.node--compare .node-ring{stroke:var(--state-current-stroke);stroke-dasharray:3 4;opacity:.75;animation:node-focus-pulse 1.6s ease-in-out infinite}@keyframes node-focus-pulse{0%,to{opacity:.35;stroke-width:2}50%{opacity:.9;stroke-width:3}}.canvas-node.node--current .node-core{fill:var(--state-current-fill);stroke:var(--state-current-stroke);filter:drop-shadow(0 0 5px rgba(47,158,125,.5))}.canvas-node.node--compare .node-core{fill:var(--state-compare-fill);stroke:var(--state-compare-stroke)}.canvas-node.node--visited .node-core{fill:var(--state-visited-fill);stroke:var(--state-visited-stroke)}.canvas-node.node--done .node-core{fill:var(--state-done-fill);stroke:var(--state-done-stroke)}.canvas-node.node--path .node-core{fill:var(--state-path-fill);stroke:var(--state-path-stroke);stroke-width:3}.canvas-node.node--error .node-core{fill:var(--state-error-fill);stroke:var(--state-error-stroke)}.canvas-node.is-null .node-core{fill:transparent;stroke:#8f8f8f;stroke-dasharray:4 4;filter:none}.canvas-node .node-label{fill:#0f1f1b;font-size:12px;font-weight:600;pointer-events:none;transition:fill .24s ease}.canvas-node.node--current .node-label,.canvas-node.node--done .node-label,.canvas-node.node--path .node-label,.canvas-node.node--error .node-label{fill:#fff}.canvas-node.node--compare .node-label{fill:#3a2a00}.canvas-node .node-badge{fill:#5d716b;font-size:10px;font-weight:600;pointer-events:none;paint-order:stroke;stroke:#fbfefd;stroke-width:3px;stroke-linejoin:round}.canvas-node .node-sublabel{fill:#5d716b;font-size:9.5px;pointer-events:none;paint-order:stroke;stroke:#fbfefd;stroke-width:3px;stroke-linejoin:round}.edge-line{stroke:#8fb3ad;stroke-width:2;transition:stroke .24s ease,stroke-width .24s ease}.edge--active .edge-line{stroke:var(--state-current-stroke);stroke-width:3}.edge--visited .edge-line{stroke:var(--state-visited-stroke)}.edge--path .edge-line{stroke:var(--state-path-stroke);stroke-width:3.5}.edge--error .edge-line{stroke:var(--state-error-stroke);stroke-width:3}.edge-label,.arrow-label{fill:#315e52;font-size:11px;font-weight:600;paint-order:stroke;stroke:#fbfefd;stroke-width:4px;stroke-linejoin:round}.arrow-line{fill:none;stroke:var(--brand);stroke-width:2;stroke-linecap:round;transition:stroke .24s ease}.arrow--transfer .arrow-line{stroke:#b07a12}.arrow--return .arrow-line{stroke:#18765a;stroke-width:2.5}.arrow--pointer .arrow-line{stroke:#6b7f79;stroke-width:1.5}.label-bg{fill:#fffffff0;stroke:#cfe3dc;stroke-width:1;filter:drop-shadow(0 2px 4px rgba(24,58,48,.08))}.label--caption .label-bg{fill:#ffffffd1;stroke:#dbe9e4}.label-tone--accent .label-bg{fill:#f2fbf7;stroke:#a9d5c5}.label-tone--warning .label-bg{fill:#fffaf0;stroke:#d9a441}.label-text{fill:#23453c;font-size:12px;font-weight:600}.label-detail{fill:#5d716b;font-size:10px}.label-leader{stroke:#8fb3ad;stroke-width:1.2;stroke-dasharray:3 3}.container-box{fill:#ffffffbd;stroke:#b9dccf;stroke-width:1.5;stroke-dasharray:6 4}.container--stack .container-box{fill:#f7fbfa}.slot-rect{fill:#2f9e7d0a;stroke:#d4e8e1;stroke-width:1;transition:fill .24s ease,stroke .24s ease}.slot-rect--filled{fill:#2f9e7d17}.container-title{fill:#315e52;font-size:12px;font-weight:700}.container-count{fill:#5d716b;font-size:10px}.container-slot-index{fill:#8aa39b;font-size:9px}.container-empty{fill:#8aa39b;font-size:11px;letter-spacing:.08em}.container-pointer line{stroke:#7c9a92;stroke-width:1.4}.container-pointer-label{fill:#315e52;font-size:10px;font-weight:600;paint-order:stroke;stroke:#fbfefd;stroke-width:3px;stroke-linejoin:round}.canvas-caption{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--space-2);padding:5px 10px;border-top:1px solid var(--line)}.caption-text{flex:1;min-width:0;max-height:2.8em;margin:0;overflow:hidden;color:var(--text);font-size:12px;line-height:1.4}.canvas-notes{display:flex;flex:none;flex-wrap:wrap;justify-content:flex-end;gap:var(--space-1);max-width:46%}.note-item{border:1px solid var(--line);border-radius:999px;padding:1px 6px;font-size:10px;color:var(--muted)}.canvas-meta-row{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:6px;padding:3px 10px;border-top:1px dashed var(--line)}.canvas-legend,.canvas-metrics{display:flex;align-items:center;flex-wrap:wrap;gap:6px}.legend-title{color:var(--muted);font-size:10px}.legend-chip{display:inline-flex;align-items:center;gap:3px;color:var(--muted);font-size:10px}.legend-dot{display:inline-block;width:8px;height:8px;border:1px solid transparent;border-radius:50%}.legend-dot.state-idle{background:var(--state-idle-fill);border-color:var(--state-idle-stroke)}.legend-dot.state-current{background:var(--state-current-fill);border-color:var(--state-current-stroke)}.legend-dot.state-compare{background:var(--state-compare-fill);border-color:var(--state-compare-stroke)}.legend-dot.state-visited{background:var(--state-visited-fill);border-color:var(--state-visited-stroke)}.legend-dot.state-done{background:var(--state-done-fill);border-color:var(--state-done-stroke)}.legend-dot.state-path{background:var(--state-path-fill);border-color:var(--state-path-stroke)}.legend-dot.state-error{background:var(--state-error-fill);border-color:var(--state-error-stroke)}.metric-chip{border:1px solid var(--line);border-radius:999px;padding:1px 6px;color:var(--muted);font-size:10px}.metric-chip b{margin-right:3px;color:var(--brand-strong);font-size:11px}.canvas-input-echo{padding:0 10px 4px;overflow:hidden;color:var(--muted);font-size:10px;line-height:1.4;white-space:nowrap;text-overflow:ellipsis}.code-panel{height:100%;display:grid;grid-template-rows:auto 1fr auto;border:1px solid #294339;border-radius:var(--radius-card);background:var(--code-bg);overflow:hidden}.code-toolbar{display:flex;gap:var(--space-1);padding:5px 6px;border-bottom:1px solid #294339}.lang-btn{border:1px solid #335247;background:transparent;color:#c7ddd6;border-radius:6px;padding:4px 8px;cursor:pointer;font-size:11px}.lang-btn.active{background:#2f9e7d;color:#fff;border-color:#2f9e7d}.code-content{min-height:0;overflow:auto;font-family:JetBrains Mono,Fira Code,Menlo,monospace;font-size:12px;line-height:1.5}.code-line{display:grid;grid-template-columns:42px minmax(0,1fr);gap:8px;padding:1px 10px;background:var(--code-line);color:#d3e6df}.code-line.active{background:var(--code-active)}.line-no{color:#87a79d;text-align:right;-webkit-user-select:none;user-select:none}.line-code{white-space:pre}.variable-watch{border-top:1px solid #294339;padding:5px 8px;display:grid;gap:3px;max-height:96px;overflow:auto}.var-row{display:flex;justify-content:space-between;color:#9cc7ba;font-size:12px}.playback-footer{display:grid;grid-template-columns:auto minmax(120px,1fr) auto;align-items:center;gap:var(--space-2);min-height:var(--footer-height);padding:5px var(--space-3);border-top:1px solid var(--line);background:var(--surface)}.playback-row{display:flex;align-items:center;gap:6px;flex-wrap:nowrap}.playback-btn.primary{background:var(--brand);border-color:var(--brand);color:#fff}.speed-group{display:flex;gap:var(--space-1);margin-left:var(--space-1)}.speed-btn.active{background:var(--brand-strong);border-color:var(--brand-strong);color:#fff}.timeline-track{position:relative;height:10px;border-radius:999px;background:#c9d8d3;cursor:pointer;overflow:hidden}.timeline-played{position:absolute;inset:0 auto 0 0;background:#25a17e}.timeline-thumb{position:absolute;top:50%;width:14px;height:14px;border:2px solid #fff;border-radius:50%;background:#1f7e63;transform:translate(-50%,-50%)}.timeline-meta{color:var(--muted);font-size:11px;white-space:nowrap}.modal-mask{position:fixed;top:0;right:0;bottom:0;left:0;z-index:40;background:#08171266;display:grid;place-items:center}.thought-modal{width:min(820px,calc(100vw - 40px));max-height:min(80vh,680px);overflow:auto;border-radius:14px;border:1px solid var(--line);background:var(--surface)}.thought-header{position:sticky;top:0;z-index:2;background:var(--surface);border-bottom:1px solid var(--line);padding:10px 12px;display:flex;justify-content:space-between;align-items:center}.thought-content{margin:0;padding:12px;font-family:inherit;white-space:pre-wrap;line-height:1.6;color:var(--text)}.community-float{position:fixed;right:18px;bottom:16px;z-index:12}.community-btn{border:none;background:#1aa667;color:#fff;border-radius:999px;padding:10px 14px;box-shadow:0 4px 18px #10362b40;cursor:pointer}.community-pop{position:absolute;right:0;bottom:48px;width:220px;border:1px solid var(--line);border-radius:12px;background:#fff;padding:10px;box-shadow:0 8px 28px #07171233}.community-qr{width:100%;height:auto;border-radius:8px;object-fit:contain}.community-pop p{margin:8px 0 0;font-size:12px;color:var(--muted)}.app-empty{height:100%;display:grid;place-items:center;color:var(--muted)}@media(max-width:1100px){.workspace{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) clamp(180px,22vh,240px)}.code-section{min-height:0}}@media(max-width:900px){.playback-footer{grid-template-columns:minmax(0,1fr)}.playback-row{flex-wrap:wrap;justify-content:center}}@media(prefers-reduced-motion:reduce){.canvas-node .node-core,.canvas-node .node-ring,.canvas-node .node-label,.canvas-node .node-badge,.canvas-node .node-sublabel,.edge-line,.arrow-line,.container-box,.container-pointer line,.slot-rect,.label-leader,.legend-dot,.operation-badge{transition:none!important;animation:none!important}}
