:root{color-scheme:light;--paper:#fff;--desk:#f8f9fb;--code-paper:#fafbfc;--ink:#252b3b;--soft-ink:#687186;--pencil:#939aab;--line:#e4e7ee;--accent:#315ae8;--accent-soft:#edf1ff;--green:#218265;--red:#b63046;--red-soft:#fff3f4;--mono:ui-monospace,"SFMono-Regular",Consolas,"Liberation Mono",monospace;--sans:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;--code-size:14px;--code-line:25px;--split:48%;font-family:var(--sans);color:var(--ink);font-size:14px;background:var(--desk);-webkit-font-smoothing:antialiased}
*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button,a,input,select,textarea{touch-action:manipulation}button,a,select{ -webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{cursor:default;opacity:.38}button,a{transition:background .14s,color .14s}button:active:not(:disabled){transform:translateY(1px)}a{color:var(--accent);text-decoration:none}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,[tabindex]:focus-visible{outline:2px solid var(--accent);outline-offset:3px}button{border:0;background:none;color:inherit}button:hover:not(:disabled){background:var(--accent-soft)}.sr-only,.skip-link:not(:focus){position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.skip-link:focus{position:fixed;z-index:20;top:8px;left:8px;background:var(--paper);padding:12px}.app-header{height:76px;padding:0 28px;display:flex;align-items:center;gap:44px;background:var(--paper);border-bottom:1px solid var(--line)}.brand{display:flex;gap:10px;align-items:center;color:var(--ink);font-size:16px;font-weight:650;white-space:nowrap;letter-spacing:-.4px}.brand-light{font-weight:400;color:var(--soft-ink)}.app-header nav{display:flex;align-self:stretch;gap:24px}.nav-link{position:relative;display:flex;align-items:center;gap:7px;font-size:13px;font-weight:550;color:var(--soft-ink)}.nav-link.active{color:var(--accent)}.nav-link.active:after{position:absolute;bottom:-1px;left:0;right:0;content:"";height:2px;background:var(--accent)}.nav-link:hover{color:var(--accent)}.header-actions{display:flex;gap:8px;margin-left:auto}.quiet-button{height:38px;padding:0 12px;border-radius:6px;font-size:13px}.file-extension{color:var(--pencil);font-family:var(--mono);font-size:11px;margin-left:6px}.workspace{display:grid;grid-template-columns:minmax(0,var(--split)) 7px minmax(0,1fr);height:calc(100dvh - 76px);min-height:400px}.code-pane,.preview-pane{display:flex;flex-direction:column;min-height:0;min-width:0;background:var(--paper)}.code-pane{background:var(--code-paper)}.pane-toolbar{height:68px;min-height:68px;padding:0 24px;display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid var(--line)}.pane-title{display:flex;align-items:center;gap:10px}.pane-title h1,.pane-title h2{font-size:13px;font-weight:600;margin:0}.code-mark{font-family:var(--mono);font-weight:600;color:var(--pencil);font-size:13px}.preview-mark{font-size:20px;color:var(--pencil)}.example-picker select{height:36px;max-width:175px;border:1px solid var(--line);background:var(--paper);color:var(--soft-ink);border-radius:6px;padding:0 28px 0 12px;font-size:12px;cursor:pointer}.render-actions{display:flex;align-items:center;gap:16px}.auto-label{display:flex;align-items:center;gap:7px;cursor:pointer;color:var(--soft-ink);font-size:12px;min-height:40px}.auto-label input{accent-color:var(--accent);width:14px;height:14px;margin:0}.primary-button{border-radius:6px;background:var(--accent);color:#fff;font-size:12px;font-weight:550;min-height:36px;padding:0 13px;display:flex;align-items:center;gap:14px}.primary-button:hover:not(:disabled){background:#2448ce}kbd{font:11px var(--mono);opacity:.7}.divider{background:var(--desk);border-left:1px solid var(--line);border-right:1px solid var(--line);display:flex;justify-content:center;align-items:center;cursor:col-resize;touch-action:none}.divider span{height:28px;width:2px;border-radius:1px;background:#c8cedb}.divider:hover,.divider.dragging{background:var(--accent-soft)}.code-editor{position:relative;display:flex;flex:1;min-height:0;overflow:hidden}.line-numbers{padding:24px 12px 100px 12px;min-width:54px;text-align:right;font:var(--code-size)/var(--code-line) var(--mono);color:#a3aaba;overflow:hidden;user-select:none;white-space:pre}.code-scroll{position:relative;flex:1;min-width:0;min-height:0;overflow:hidden}.code-scroll pre,.code-scroll textarea{font:var(--code-size)/var(--code-line) var(--mono);tab-size:2;letter-spacing:0;font-variant-ligatures:none;white-space:pre;margin:0;border:0;padding:24px 24px 100px 4px;width:100%;height:100%;overflow:auto}.code-scroll pre{position:absolute;inset:0;pointer-events:none;color:var(--ink);scrollbar-width:none}.code-scroll pre::-webkit-scrollbar{display:none}.code-scroll textarea{position:relative;display:block;resize:none;background:transparent;color:transparent;-webkit-text-fill-color:transparent;caret-color:var(--ink);outline:0}.code-scroll textarea::selection{background:#b8cbfa77}.syntax-directive{color:#a45b3c}.syntax-keyword{color:#7960a9}.syntax-string{color:#347669}.syntax-comment{color:#929aae;font-style:italic}.syntax-relation{color:#4165bf}.pane-footer{height:48px;min-height:48px;display:flex;align-items:center;justify-content:space-between;padding:0 20px;border-top:1px solid var(--line);font-size:11px;color:var(--soft-ink);gap:12px;background:var(--paper);font-variant-numeric:tabular-nums}.code-pane .pane-footer{background:var(--code-paper)}#save-status:before{content:"";display:inline-block;width:5px;height:5px;border-radius:50%;background:var(--green);margin-right:7px}#save-status.warning:before{background:var(--red)}#position{font-family:var(--mono);font-size:10px;white-space:nowrap}.preview-stage{position:relative;flex:1;min-height:0;overflow:auto;background-color:var(--desk);background-image:radial-gradient(#dfe3ed .7px,transparent .7px);background-size:18px 18px;padding:40px;display:flex;align-items:safe center;justify-content:safe center}.preview-stage img{display:block;flex:none;object-fit:contain;background:white;border-radius:3px;box-shadow:0 0 0 1px #e2e6ef80,0 6px 24px #20294305;max-width:none}.preview-stage img[hidden]{display:none}.preview-stage[aria-busy="true"] img{opacity:.45}.preview-empty{text-align:center;color:var(--pencil);font-size:13px}.preview-empty[hidden]{display:none}.preview-empty svg{stroke:#a7b0c3;stroke-width:1.2}.preview-empty p{margin:16px 0}.render-status{display:flex;align-items:center;gap:7px;white-space:nowrap}.render-status i{height:6px;width:6px;border-radius:50%;background:var(--pencil)}.render-status.success i{background:var(--green)}.render-status.error i{background:var(--red)}.render-status.loading i{background:var(--accent);animation:pulse 1s infinite}.zoom-controls,.export-actions{display:flex;align-items:center;gap:2px}.zoom-controls{margin-left:auto}.icon-button{font-size:18px;min-width:32px;height:34px;border-radius:4px;line-height:1}.zoom-value{height:34px;min-width:60px;font-size:10px;border-radius:4px;color:var(--soft-ink)}.text-button{font-size:11px;min-height:34px;padding:0 8px;border-radius:4px}.export-actions{border-left:1px solid var(--line);padding-left:10px}.render-message{background:var(--red-soft);color:var(--red);padding:16px 24px;border-top:1px solid #f1d7dc;max-height:210px;overflow:auto}.render-message[hidden]{display:none}.render-message strong{font-size:13px;font-weight:600}.render-message pre{font:12px/1.6 var(--mono);white-space:pre-wrap;overflow-wrap:anywhere;margin:8px 0 0}.render-message .text-button{color:var(--red);padding-left:0}.toast{position:fixed;bottom:64px;left:50%;transform:translateX(-50%);background:var(--ink);color:var(--paper);padding:12px 20px;border-radius:8px;box-shadow:0 4px 24px #252b3b20;z-index:10;font-size:12px;max-width:calc(100% - 32px)}
/* The reference is a reading page, using the same paper and ink as the editor. */
.reference-layout{max-width:1160px;padding:56px 36px 80px;margin:auto;display:grid;grid-template-columns:180px minmax(0,1fr);gap:68px}.reference-sidebar{position:sticky;top:32px;align-self:start;display:flex;flex-direction:column;gap:4px}.reference-sidebar a{color:var(--soft-ink);font-size:12px;line-height:1.5;padding:10px 12px;border-radius:5px}.reference-sidebar a:hover{background:var(--accent-soft);color:var(--accent)}.reference-sidebar .back-link{margin-top:24px;color:var(--accent)}.reference-header{display:flex;align-items:center;justify-content:space-between;gap:24px;margin:0 0 40px}.reference-header h1{font-size:30px;letter-spacing:-1px;font-weight:600;margin:0}.search-field{max-width:240px;width:100%;height:40px;border:1px solid var(--line);border-radius:6px;padding:0 12px;background:var(--paper);color:var(--ink);font-size:12px}.reference-section{margin-bottom:52px;scroll-margin-top:24px}.reference-section>h2{font-size:12px;font-weight:600;color:var(--soft-ink);letter-spacing:.07em;text-transform:uppercase;margin:0 0 18px}.reference-card{display:grid;grid-template-columns:52px minmax(0,1fr);gap:24px;padding:28px 0;border-top:1px solid var(--line)}.reference-card[hidden],.reference-section[hidden]{display:none}.notation-icon{width:52px;height:52px;border-radius:10px;display:flex;align-items:center;justify-content:center;color:var(--accent);background:var(--accent-soft)}.notation-icon svg{width:40px;height:40px;stroke:currentColor;fill:none;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round}.reference-card h3{font-size:19px;font-weight:600;letter-spacing:-.4px;margin:0 0 10px}.reference-card h3 span{font-family:var(--mono);font-size:11px;font-weight:400;color:var(--soft-ink);margin-left:10px;letter-spacing:0}.reference-card p{font-size:14px;line-height:1.75;margin:0 0 14px;max-width:650px}.reference-card p:last-child{margin-bottom:0}.reference-card .tip{font-size:12px;color:var(--soft-ink);line-height:1.7;margin-top:12px}.snippet{display:flex;align-items:flex-start;background:#f0f2f7;border:1px solid #e5e8f0;border-radius:6px;margin-top:14px}.snippet pre{padding:16px;margin:0;flex:1;min-width:0;overflow:auto;font:12px/1.8 var(--mono);color:#3a4963}.snippet .copy-button{flex:none;font-size:11px;padding:8px 10px;margin:8px;border-radius:4px;color:var(--soft-ink);min-height:32px}.reference-card .example-button{color:var(--accent);font-size:12px;padding:12px 0 0}.reference-card .example-button:hover{background:none;text-decoration:underline}.reference-note{padding:20px 24px;border-radius:8px;background:var(--accent-soft);font-size:13px;line-height:1.8;color:#425780}.reference-note p{margin:0}.reference-note a{text-decoration:underline;text-underline-offset:3px}.no-results{color:var(--soft-ink);padding:24px 0}.no-results[hidden]{display:none}.page-footer{color:var(--soft-ink);font-size:11px;border-top:1px solid var(--line);padding-top:24px;line-height:1.8}.page-footer a{text-decoration:underline;text-underline-offset:3px}.empty-icon{font-family:var(--mono);font-weight:500;font-size:20px}.error-line{color:var(--red);background:#ffebee}.print-only{display:none}@keyframes pulse{50%{opacity:.3}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}
@media(min-width:1600px){:root{--code-size:15px;--code-line:27px}.pane-toolbar{height:76px;min-height:76px}.preview-stage{padding:56px}}
@media(max-width:1000px){.app-header{gap:28px;padding:0 20px}.brand-light{display:none}.pane-toolbar{padding:0 16px}.render-actions{gap:8px}.preview-footer{padding:0 12px;gap:6px}.render-status{font-size:10px}.export-actions{padding-left:5px}.preview-stage{padding:24px}.reference-layout{gap:32px;grid-template-columns:150px minmax(0,1fr);padding:40px 24px}}
@media(max-width:700px){.app-header{height:64px;padding:0 16px;gap:20px;flex-wrap:wrap}.brand{font-size:14px;gap:8px}.brand img{width:24px;height:24px}.app-header nav{gap:16px;margin-left:auto}.header-actions{display:none}.nav-link{font-size:12px}.workspace{height:auto;min-height:calc(100dvh - 64px);grid-template-columns:minmax(0,1fr);grid-template-rows:430px 450px}.divider{display:none}.code-pane{border-bottom:1px solid var(--line)}.pane-toolbar{height:56px;min-height:56px}.code-scroll pre,.code-scroll textarea{padding-top:16px}.line-numbers{padding-top:16px;min-width:42px;font-size:12px;padding-right:8px}.code-scroll pre,.code-scroll textarea{font-size:12px;line-height:25px}.pane-footer{height:42px;min-height:42px;padding:0 16px}.preview-stage{padding:24px}.reference-layout{display:block;padding:32px 20px 48px}.reference-sidebar{display:none}.reference-header{display:block;margin-bottom:28px}.reference-header h1{font-size:28px;margin-bottom:20px}.search-field{max-width:100%}.reference-card{grid-template-columns:36px minmax(0,1fr);gap:16px;padding:24px 0}.notation-icon{height:36px;width:36px;border-radius:7px}.notation-icon svg{width:30px;height:30px}.reference-card h3{font-size:17px}.reference-card h3 span{display:block;margin:6px 0 0}.reference-card p{font-size:13px}.snippet{display:block}.snippet pre{padding:12px}.snippet .copy-button{margin:0 6px 6px}.reference-note{padding:16px}.file-extension{display:none}}
@media print{.editor-page .app-header,.editor-page .code-pane,.editor-page .divider,.editor-page .pane-toolbar,.editor-page .pane-footer,.render-message,.toast,.preview-empty{display:none!important}.editor-page,.editor-page .workspace,.editor-page .preview-pane,.editor-page .preview-stage{height:auto!important;display:block!important;background:#fff!important;overflow:visible!important;padding:0!important;min-height:0!important}.preview-stage img{width:100%!important;height:auto!important;max-height:95vh;object-fit:contain!important;box-shadow:none!important;opacity:1!important}.reference-sidebar,.reference-header input,.copy-button,.example-button,.reference-page .app-header{display:none!important}.reference-layout{display:block;padding:0}.reference-card{break-inside:avoid}.reference-card p{font-size:11px}.reference-section{margin-bottom:20px}.reference-header{margin-bottom:20px}}
.help-detail{font-size:12px;line-height:1.8;color:var(--soft-ink);margin:20px 0 0}.example-button{display:inline-block}
@media(max-width:700px){.editor-page .app-header{height:112px;align-content:center;row-gap:6px}.editor-page .header-actions{display:flex;flex-basis:100%;justify-content:flex-end;gap:6px;height:32px}.editor-page .header-actions button{height:30px;font-size:11px;padding:0 10px}.editor-page .workspace{min-height:calc(100dvh - 112px)}}
