*{margin:0;padding:0;box-sizing:border-box}html,body,#root{width:100%;height:100%;overflow:hidden}body{font-family:Inter,Noto Sans SC,Segoe UI,sans-serif;-webkit-font-smoothing:antialiased;background:#0b1513;color:#e4f0eb}button{font:inherit}button:focus-visible,a:focus-visible,input:focus-visible{outline:2px solid #70c5a0;outline-offset:2px}::selection{background:#276e58;color:#fff}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:#10201c}::-webkit-scrollbar-thumb{background:#3b5d51;border-radius:4px}a{color:#9bcbb6;text-decoration:none}a:hover{color:#c3e8d6}@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}.header{position:relative;display:flex;align-items:center;justify-content:space-between;padding:0 12px;background:#10201c;border-bottom:1px solid #29423b;height:48px;flex:0 0 48px;box-sizing:border-box}.header-left{position:absolute;left:12px;display:flex;align-items:center;z-index:1}.back-link{color:#9bcbb6;text-decoration:none;font-size:12px;transition:color .2s;white-space:nowrap}.back-link:hover{color:#c3e8d6}.header-center{position:absolute;left:50%;transform:translate(-50%);width:min(50%,520px);display:flex;justify-content:center}.title-link{text-decoration:none}.title{color:#e4f0eb;font-size:16px;font-weight:700;margin:0;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:color .2s}.title-link:hover .title{color:#63b3ed}.solution-tabs{display:flex;align-items:center;gap:4px}.solution-tabs button{border:1px solid #36564b;border-radius:5px;padding:5px 8px;background:#172a25;color:#9db5aa;font-size:11px;cursor:pointer;white-space:nowrap}.solution-tabs button.active{color:#e4f0eb;background:#23654f;border-color:#3c9a76}.header-right{position:absolute;right:12px;display:flex;align-items:center;justify-content:flex-end;gap:8px;z-index:1}.thought-btn{background:linear-gradient(135deg,#2d3748,#1a202c);border:1px solid #4a5568;color:#f7fafc;padding:6px 12px;border-radius:6px;cursor:pointer;font-size:13px;transition:all .2s;white-space:nowrap}.thought-btn:hover{background:linear-gradient(135deg,#4a5568,#2d3748);border-color:#63b3ed}.github-link{display:flex;align-items:center;gap:6px;color:#f7fafc;text-decoration:none;padding:6px 10px;border-radius:6px;background:#ffffff1a;transition:all .2s}.github-link:hover{background:#fff3}.github-icon{width:20px;height:20px}.star-count{font-size:13px;font-weight:500}.data-input-container{padding:6px 12px;background:#10201c;border-bottom:1px solid #29423b;flex:0 0 auto}.input-row{display:flex;align-items:center;gap:8px}.input-label{color:#a9c0b7;font-size:12px;white-space:nowrap}.input-field{flex:1;min-width:120px;max-width:460px;padding:6px 10px;border:1px solid #3a5c51;border-radius:6px;background:#172c27;color:#e0eee8;font-size:12px;font-family:Monaco,Menlo,monospace;transition:border-color .2s}.input-field:focus{outline:none;border-color:#63b3ed}.input-field.input-error{border-color:#fc8181}.input-field::placeholder{color:#718096}.random-btn{padding:6px 10px;background:#18765a;border:none;border-radius:6px;color:#fff;font-size:11px;cursor:pointer;transition:all .2s;white-space:nowrap}.random-btn:hover{background:linear-gradient(135deg,#48bb78,#38a169);transform:translateY(-1px)}.error-message{color:#f28a83;font-size:10px;white-space:nowrap}.examples-row{display:flex;align-items:center;gap:6px;min-height:24px}.examples-label{color:#7e9b90;font-size:10px}.example-btn{padding:3px 8px;background:#1b322c;border:1px solid #36564b;border-radius:4px;color:#c5d9d0;font-size:10px;cursor:pointer;transition:all .2s}.example-btn:hover{background:#4a5568;border-color:#63b3ed}.code-panel{display:flex;flex-direction:column;background:#1e1e1e;border-radius:8px;overflow:hidden;height:100%}.code-header{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background:#252526;border-bottom:1px solid #3c3c3c}.code-title{color:#ccc;font-size:13px;font-weight:500}.language-tabs{display:flex;gap:4px}.language-tab{padding:4px 10px;background:transparent;border:1px solid transparent;border-radius:4px;color:#858585;font-size:12px;cursor:pointer;transition:all .2s}.language-tab:hover{color:#ccc;background:#3c3c3c}.language-tab.active{color:#fff;background:#0e639c;border-color:#0e639c}.code-content{flex:1;overflow:auto;padding:8px 0}.code-pre{margin:0;font-family:Monaco,Menlo,Consolas,monospace;font-size:13px;line-height:1.6}.code-line{display:flex;align-items:center;padding:0 12px;min-height:22px;transition:background-color .2s}.code-line.highlighted{background:#ffd50026;border-left:3px solid #ffd500;padding-left:9px}.line-number{width:35px;color:#858585;text-align:right;padding-right:12px;-webkit-user-select:none;user-select:none;flex-shrink:0}.line-content{flex:1;color:#d4d4d4;white-space:pre}.variable-value{margin-left:20px;padding:2px 8px;background:#264f78;border-radius:4px;color:#9cdcfe;font-size:11px;white-space:nowrap}.keyword{color:#569cd6}.comment{color:#6a9955}.number{color:#b5cea8}.string{color:#ce9178}.code-content::-webkit-scrollbar{width:10px;height:10px}.code-content::-webkit-scrollbar-track{background:#1e1e1e}.code-content::-webkit-scrollbar-thumb{background:#424242;border-radius:5px}.code-content::-webkit-scrollbar-thumb:hover{background:#4f4f4f}.canvas-container{display:flex;flex-direction:column;background:#101d1b;border:1px solid #29423b;border-radius:10px;overflow:hidden;height:100%;min-height:0;position:relative}.canvas-header{display:flex;align-items:center;justify-content:space-between;height:32px;flex:0 0 32px;padding:0 10px;background:#142522;border-bottom:1px solid #29423b}.canvas-title{color:#c0d4cd;font-size:12px;font-weight:600}.canvas-hint{color:#829b92;font-size:10px}.canvas-svg{width:100%;flex:1;min-height:0;cursor:grab;background-color:#0d1917;background-image:radial-gradient(#29423b .7px,transparent .7px);background-size:18px 18px}.canvas-svg:active{cursor:grabbing}.canvas-teaching{flex:0 0 auto;padding:7px 10px 8px;border-top:1px solid #29423b;background:#13221f}.teaching-topline,.canvas-legend{display:flex;align-items:center;gap:8px;min-width:0}.teaching-topline strong{color:#8eaaa0;font-size:10px;font-weight:600}.operation-badge{padding:2px 7px;border:1px solid #4e8a74;border-radius:999px;color:#a9dfc8;font-size:10px}.canvas-teaching p{margin:5px 0;color:#d0ded9;font-size:13px;line-height:1.45}.canvas-teaching .phase-explainer{color:#b7d2c6;font-size:12px;line-height:1.5;margin:4px 0}.canvas-legend{color:#91a89f;font-size:10px;flex-wrap:wrap}.canvas-legend span{display:inline-flex;align-items:center;gap:4px}.canvas-legend i{width:8px;height:8px;border-radius:50%;display:inline-block}.legend-current{background:#dda944}.legend-cycle{background:#315e52}.legend-done{background:#17765b}.canvas-metrics{margin-left:auto;color:#708b81}.result-badge{margin-left:auto;padding:3px 8px;border-radius:999px;background:#17765b;color:#eafff5;font-size:11px;font-weight:600}.function-edge{stroke:#66867b;stroke-width:1.8}.function-node circle{transition:fill .18s ease,stroke .18s ease}.node-value{fill:#eff8f4;font-size:18px;font-weight:700}.node-index{fill:#a9c5b9;font-size:13px;font-weight:600}.node-sublabel{fill:#95bdac;font-size:12px}.node-value-label{fill:#c7dfd4;font-size:12px;font-weight:700}.edge-label{fill:#c1d8ce;font-size:11px;font-weight:600;paint-order:stroke;stroke:#0d1917;stroke-width:4px;stroke-linejoin:round}.edge-guide{fill:#a8bdb4;font-size:12px;font-weight:600}.range-axis{stroke:#78948a;stroke-width:2}.range-tick line{stroke:#78948a;stroke-width:1}.range-tick text,.range-caption,.range-interval,.range-input{fill:#c0d4cd;font-size:13px}.candidate-zone{fill:#dda9442e;stroke:#dda944;stroke-width:2}.mid-marker{stroke:#f2cf77;stroke-width:2;stroke-dasharray:5 4}.mid-label{fill:#f2cf77;font-size:14px;font-weight:700}.count-dot{stroke:#0d1917;stroke-width:1}.count-label{fill:#c0d4cd;font-size:13px;font-weight:600}.range-result{fill:#68d2a5;font-size:18px;font-weight:700}.pointer-watch{display:flex;gap:12px;flex-wrap:wrap;padding:4px 0;border-top:1px solid #29423b;color:#b7d2c6;font-size:12px}.pointer-watch span{white-space:nowrap}.pointer-watch b{font-weight:700}.movement-key{display:flex;gap:12px;flex-wrap:wrap;color:#a8bdb4;font-size:11px;padding-top:2px}.movement-key span{display:inline-flex;align-items:center;gap:4px}.movement-key i{width:8px;height:8px;display:inline-block;border-radius:50%;background:currentColor}.movement-key .edge-swatch{width:14px;height:2px;border-radius:0;background:#66867b}.array-title{fill:#c0d4cd;font-size:16px;font-weight:700}.array-index,.array-caption{fill:#9ab5a9;font-size:12px}.array-cell text{fill:#eff8f4;font-size:18px;font-weight:700}.mapping-key{fill:#9ab7ab;font-size:10px}.array-cell text{fill:#eff8f4;font-size:15px;font-weight:700}.array-cell rect{stroke-width:1px}.cycle-entry-label{fill:#78d2aa;font-size:11px;text-anchor:middle}.annotation{paint-order:stroke;stroke:#0d1917;stroke-width:4px;stroke-linejoin:round}.graph-region rect{pointer-events:none}.region-title{fill:#9cbaae;font-size:13px;font-weight:700}.graph-annotation{fill:#a9c7bb;font-size:12px;font-weight:600;paint-order:stroke;stroke:#0d1917;stroke-width:4px;stroke-linejoin:round}@media(prefers-reduced-motion:reduce){.function-node circle,.result-badge{transition:none;animation:none}}.control-panel{display:grid;grid-template-columns:minmax(120px,1fr) auto minmax(160px,2fr);grid-template-rows:32px;align-items:center;gap:12px;height:40px;min-height:40px;background:#10201c;border-top:1px solid #29423b;padding:4px 12px;flex:0 0 40px;overflow:visible;position:relative;z-index:5}.control-row{display:contents}.control-row>.step-info{grid-column:1;grid-row:1}.control-row>.control-buttons{grid-column:2;grid-row:1}.control-panel>.progress-bar{grid-column:3;grid-row:1}@media(max-width:900px){.control-panel{grid-template-columns:1fr auto;grid-template-rows:32px 5px;height:48px;min-height:48px;flex-basis:48px;gap:3px 8px}.control-row>.step-info{grid-column:1;grid-row:1}.control-row>.control-buttons{grid-column:2;grid-row:1}.control-panel>.progress-bar{grid-column:1 / -1;grid-row:2}}.step-info{display:flex;align-items:center;gap:8px;min-width:0}.step-counter{color:#9bcbb6;font-size:12px;font-weight:600;white-space:nowrap}.step-description{color:#a0aec0;font-size:13px;max-width:400px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.control-buttons{display:flex;align-items:center;gap:6px}.control-btn{display:flex;align-items:center;gap:5px;min-height:28px;padding:4px 8px;background:#203a34;border:1px solid #3a5c51;border-radius:6px;color:#d4e4dd;font-size:11px;cursor:pointer;transition:all .2s;white-space:nowrap}.control-btn:hover:not(:disabled){background:#4a5568;border-color:#63b3ed}.control-btn:disabled{opacity:.5;cursor:not-allowed}.control-btn kbd{padding:2px 6px;background:#1a202c;border-radius:3px;font-size:11px;color:#718096}.play-btn{background:#18765a;border-color:#2a9b75;min-width:96px;justify-content:center}.play-btn .pause-label,.play-btn[aria-label=暂停] .play-label{display:none}.play-btn[aria-label=暂停] .pause-label{display:inline}.play-btn:hover:not(:disabled){background:#218b69;border-color:#49b58e}.reset-btn{background:linear-gradient(135deg,#744210,#5a3510);border-color:#744210}.reset-btn:hover:not(:disabled){background:linear-gradient(135deg,#975a16,#744210);border-color:#975a16}.speed-control{position:relative}.speed-btn{min-height:28px;padding:4px 8px;background:#2d3748;border:1px solid #4a5568;border-radius:6px;color:#e2e8f0;font-size:11px;cursor:pointer;transition:all .2s}.speed-btn:hover{background:#4a5568}.speed-menu{position:absolute;bottom:100%;right:0;margin-bottom:4px;background:#2d3748;border:1px solid #4a5568;border-radius:6px;overflow:hidden;z-index:100}.speed-option{display:block;width:100%;padding:8px 16px;background:transparent;border:none;color:#e2e8f0;font-size:13px;cursor:pointer;text-align:left;transition:background .2s}.speed-option:hover{background:#4a5568}.speed-option.active{background:#3182ce;color:#fff}.progress-bar{position:relative;height:6px;flex:1;min-width:80px;background:#3b504a;border-radius:4px;cursor:pointer;overflow:visible}.progress-fill{height:100%;background:#3caf83;border-radius:4px;transition:width .1s ease-out}.progress-handle{position:absolute;top:50%;width:16px;height:16px;background:#3caf83;border:2px solid #e6f4ee;border-radius:50%;transform:translate(-50%,-50%);cursor:grab;transition:transform .1s;box-shadow:0 2px 4px #0000004d}.progress-handle:hover{transform:translate(-50%,-50%) scale(1.2)}.progress-bar:active .progress-handle{cursor:grabbing;transform:translate(-50%,-50%) scale(1.3)}.thought-overlay{position:fixed;inset:0;background:#000000b3;display:flex;align-items:center;justify-content:center;z-index:1000;animation:fadeIn .2s ease-out}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.thought-modal{background:#1a1a2e;border-radius:12px;width:90%;max-width:700px;max-height:80vh;display:flex;flex-direction:column;box-shadow:0 20px 60px #00000080;animation:slideUp .3s ease-out}@keyframes slideUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.thought-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid #2d3748}.thought-title{color:#f7fafc;font-size:18px;font-weight:600;margin:0}.thought-close{width:32px;height:32px;background:#2d3748;border:none;border-radius:6px;color:#a0aec0;font-size:16px;cursor:pointer;transition:all .2s}.thought-close:hover{background:#4a5568;color:#f7fafc}.thought-content{flex:1;overflow-y:auto;padding:20px;color:#e2e8f0;line-height:1.7}.thought-h2{color:#63b3ed;font-size:20px;font-weight:600;margin:0 0 16px;padding-bottom:8px;border-bottom:2px solid #2d3748}.thought-h3{color:#48bb78;font-size:16px;font-weight:600;margin:20px 0 12px}.thought-p{margin:8px 0;color:#a0aec0}.thought-bold{color:#f7fafc;font-weight:600;margin:16px 0 8px}.thought-li{padding-left:8px;color:#a0aec0;list-style-type:disc;margin:6px 0 6px 20px}.thought-li-num{padding-left:8px;color:#a0aec0;list-style-type:decimal;margin:6px 0 6px 20px}.thought-code{background:#0d1117;border-radius:6px;padding:12px 16px;margin:12px 0;overflow-x:auto}.thought-code code{color:#e6edf3;font-family:Monaco,Menlo,monospace;font-size:13px;line-height:1.5}.thought-content::-webkit-scrollbar{width:8px}.thought-content::-webkit-scrollbar-track{background:#1a1a2e}.thought-content::-webkit-scrollbar-thumb{background:#4a5568;border-radius:4px}.thought-content::-webkit-scrollbar-thumb:hover{background:#5a6578}.wechat-float{position:fixed;bottom:24px;right:24px;z-index:900}.wechat-btn{display:flex;align-items:center;gap:6px;padding:10px 16px;background:linear-gradient(135deg,#07c160,#06ad56);border-radius:24px;color:#fff;cursor:pointer;box-shadow:0 4px 16px #07c16066;transition:all .3s}.wechat-btn:hover{transform:translateY(-2px);box-shadow:0 6px 20px #07c16080}.wechat-icon{width:20px;height:20px}.wechat-text{font-size:13px;font-weight:500}.wechat-popup{position:absolute;bottom:100%;right:0;margin-bottom:12px;background:#fff;border-radius:12px;box-shadow:0 8px 32px #0003;animation:popupFadeIn .2s ease-out;overflow:hidden}@keyframes popupFadeIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.popup-arrow{position:absolute;bottom:-8px;right:24px;width:16px;height:16px;background:#fff;transform:rotate(45deg);box-shadow:4px 4px 8px #0000001a}.popup-content{position:relative;padding:16px;background:#fff;z-index:1}.qrcode-img{width:200px;height:auto;display:block;border-radius:8px}.popup-hint{margin:12px 0 0;text-align:center;color:#666;font-size:13px;line-height:1.5}.popup-hint strong{color:#07c160}.app{display:flex;flex-direction:column;height:100dvh;min-height:0;overflow:hidden;background:#0b1513}.main-content{flex:1;display:grid;grid-template-columns:minmax(0,1fr) clamp(320px,24vw,400px);gap:8px;padding:8px;min-height:0}.left-panel,.right-panel{min-width:0;min-height:0;display:flex;flex-direction:column}.right-panel{order:-1}@media(max-width:1099px){.main-content{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) clamp(180px,22vh,240px)}}@media(max-width:700px){.main-content{padding:4px;gap:4px;grid-template-rows:minmax(0,1fr) 180px}}
