:root{--ink: #1a2233;--ink-2: #4b5563;--ink-3: #8a94a6;--line: #e4e7ee;--bg: #eef1f6;--panel: #ffffff;--accent: #2f6bff;--accent-soft: #eef3ff;--radius: 12px}*{margin:0;padding:0;box-sizing:border-box}html,body,#app{height:100%}body{font-family:Open Sans,Arial,Helvetica,Microsoft Yahei,STXihei,sans-serif;font-size:14px;color:var(--ink);background:var(--bg);-webkit-font-smoothing:antialiased}button,textarea,input{font-family:inherit;font-size:inherit;color:inherit}.app{height:100%;display:flex;flex-direction:column}.topbar{flex:none;height:56px;padding:0 18px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:18px}.brand{display:flex;align-items:center;gap:10px;font-size:15px;font-weight:700;white-space:nowrap}.brand-tag{font-size:11px;font-weight:400;color:var(--accent);background:var(--accent-soft);border-radius:20px;padding:2px 8px}.stats{display:flex;align-items:center;gap:14px;margin-left:auto;font-size:12px;color:var(--ink-3)}.stats .saved{color:#0f8a4b}.actions{display:flex;gap:8px}.btn{height:32px;padding:0 14px;border-radius:8px;border:1px solid transparent;cursor:pointer;transition:all .18s ease;white-space:nowrap}.btn.ghost{background:#fff;border-color:var(--line);color:var(--ink-2)}.btn.ghost:hover{border-color:var(--accent);color:var(--accent)}.btn.primary{background:var(--accent);color:#fff}.btn.primary:hover:not(:disabled){background:#245cdf}.btn:disabled{opacity:.5;cursor:not-allowed}.switch{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--ink-2);cursor:pointer;-webkit-user-select:none;user-select:none}.switch input{display:none}.switch__track{position:relative;width:34px;height:18px;border-radius:999px;background:#dfe3eb;transition:background .18s ease}.switch__track:after{content:"";position:absolute;top:2px;left:2px;width:14px;height:14px;border-radius:50%;background:#fff;box-shadow:0 1px 3px #141e3233;transition:transform .18s ease}.switch input:checked+.switch__track{background:var(--accent)}.switch input:checked+.switch__track:after{transform:translate(16px)}.clean-details{position:relative}.clean-details>summary{list-style:none;cursor:pointer;padding:2px 8px;color:#0f8a4b;background:#eefaf3;border-radius:20px}.clean-details>summary::-webkit-details-marker{display:none}.clean-panel{position:fixed;top:60px;right:12px;z-index:40;width:300px;max-width:calc(100vw - 24px);max-height:calc(100vh - 90px);overflow:auto;padding:12px 14px;text-align:left;background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:0 12px 30px #141e3229}.clean-panel__title{margin-bottom:8px;color:var(--ink-3)}.clean-panel__row{display:flex;justify-content:space-between;gap:12px;padding:3px 0;color:var(--ink-2)}.clean-panel__row b{color:var(--accent)}.workspace{flex:1;min-height:0;display:grid;grid-template-columns:minmax(360px,1fr) minmax(0,1.15fr);gap:14px;padding:14px}.pane{min-height:0;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);display:flex;flex-direction:column;overflow:hidden}.pane-head{flex:none;height:44px;padding:0 16px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:12px}.pane-title{font-size:13px;font-weight:600}.pane-hint{font-size:12px;color:var(--ink-3);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.pane-head--editor{height:auto;min-height:44px;padding:6px 12px 6px 16px;gap:10px;flex-wrap:nowrap}.fmt-bar{display:flex;align-items:center;gap:6px;flex-wrap:nowrap;margin-left:auto;overflow-x:auto;scrollbar-width:thin;padding-bottom:2px}.fmt-bar::-webkit-scrollbar{height:6px}.fmt-bar::-webkit-scrollbar-thumb{background:#d7dce5;border-radius:3px}.fmt-btn{width:26px;height:26px;display:flex;align-items:center;justify-content:center;padding:0;font-size:13px;color:var(--ink-2);background:#fff;border:1px solid var(--line);border-radius:6px;cursor:pointer;transition:all .18s ease}.fmt-btn:hover{color:var(--accent);border-color:var(--accent)}.fmt-btn--text{width:auto;padding:0 8px;font-size:12px}.fmt-select{height:26px;padding:0 6px;font-size:12px;color:var(--ink-2);background:#fff;border:1px solid var(--line);border-radius:6px;cursor:pointer}.fmt-select--size{width:62px}.fmt-colors{display:flex;align-items:center;gap:4px;padding:0 2px}.fmt-color{width:16px;height:16px;padding:0;border:1px solid rgba(0,0,0,.12);border-radius:50%;cursor:pointer}.fmt-color:hover{transform:scale(1.12)}.fmt-color-input{width:22px;height:22px;padding:0;border:1px solid var(--line);border-radius:6px;background:#fff;cursor:pointer}.editor-shell{position:relative;flex:1 1 auto;min-height:0;overflow:hidden;display:flex;flex-direction:column;background:#fff}.editor-shell>div:not(.image-bar){flex:1 1 auto;min-height:0;display:flex;flex-direction:column;overflow:hidden}.editor-shell .ProseMirror,.editor-body{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;padding:22px 26px 60px;outline:none;background:#fff;color:#1f2733;scrollbar-width:thin}.editor-shell .ProseMirror::-webkit-scrollbar{width:8px}.editor-shell .ProseMirror::-webkit-scrollbar-thumb{background:#d7dce5;border-radius:4px}.editor-shell .ProseMirror::-webkit-scrollbar-thumb:hover{background:#bcc4d1}.editor-body>*:first-child{margin-top:0}.editor-placeholder{position:absolute;left:26px;top:22px;right:26px;color:#b6bdca;font-size:14px;line-height:1.8;pointer-events:none}.md-body img{display:block;max-width:min(100%,var(--page-img-width, 436px));max-height:var(--page-img-max, 560px);width:auto;height:auto;margin:10px auto;border-radius:6px}.editor-body img{cursor:pointer}.editor-body img.ProseMirror-selectednode{outline:2px solid var(--accent);outline-offset:2px}.image-bar{position:absolute;z-index:6;display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;gap:3px;max-width:calc(100% - 12px);overflow-x:auto;padding:4px 6px;font-size:12px;color:var(--ink-2);white-space:nowrap;background:#fff;border:1px solid var(--line);border-radius:8px;box-shadow:0 8px 22px #141e3224}.image-bar button{flex:none;height:22px;padding:0 6px;font-size:12px;color:var(--ink-2);background:transparent;border:0;border-radius:5px;cursor:pointer}.image-bar button:hover{color:var(--accent);background:#f1f4f9}.image-bar button.is-active{color:#fff;background:var(--accent)}.image-bar__custom,.image-bar__group{flex:none;display:flex;align-items:center;gap:2px;padding-left:5px;border-left:1px solid var(--line)}.image-bar__custom input{width:58px;height:22px;padding:0 4px;font-size:12px;color:var(--ink);border:1px solid var(--line);border-radius:5px;outline:none}.image-bar__custom input:focus{border-color:var(--accent)}.image-bar__unit{color:var(--ink-3)}.image-bar__danger{color:#c62842!important}.image-bar__danger:hover{color:#fff!important;background:#c62842!important}.editor-body .math-node{cursor:pointer;border-radius:4px;outline:1px dashed transparent;outline-offset:2px;transition:outline-color .15s ease}.editor-body .math-node:hover,.editor-body .math-node.ProseMirror-selectednode{outline-color:var(--accent)}.fmt-btn.is-active{color:#fff;background:var(--accent);border-color:var(--accent)}.fmt-btn:disabled{opacity:.35;cursor:not-allowed}.fmt-group{display:flex;align-items:center;gap:2px}.fmt-color--hl{border-radius:4px}.math-preview{margin-top:10px;padding:10px 12px;max-height:140px;overflow:auto;background:#fbfcfe;border:1px dashed var(--line);border-radius:8px;text-align:center}.math-dialog{position:fixed;left:50%;top:30%;transform:translate(-50%);z-index:60;width:min(520px,calc(100vw - 32px));padding:16px 18px;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 18px 46px #141e3233}.math-dialog__title{margin-bottom:10px;font-size:13px;font-weight:600;color:var(--ink)}.math-dialog__input{width:100%;padding:10px 12px;font-family:SFMono-Regular,Consolas,Menlo,monospace;font-size:13px;line-height:1.6;color:#24303f;background:#fbfcfe;border:1px solid var(--line);border-radius:8px;resize:vertical}.math-dialog__input:focus{outline:none;border-color:var(--accent)}.math-dialog__hint{margin-top:6px;font-size:12px;color:var(--ink-3)}.math-dialog__actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}.preview-scroll{flex:1;min-height:0;overflow:auto;padding:18px;background:#f4f6fa;display:flex;flex-direction:column;align-items:center;gap:18px}.carousel-viewport{position:relative;flex:none;overflow:hidden;border-radius:8px;background:#fff;box-shadow:0 6px 22px #1620341a}.carousel-track{display:flex;width:100%;height:100%;transition:transform .28s ease;will-change:transform}.carousel-slide{position:relative;flex:0 0 100%;width:100%;height:100%}.page-scale-inner{position:absolute;left:0;top:0;transform-origin:top left}.page-canvas{box-sizing:border-box;overflow:hidden;background:#fff}.carousel-bar{display:flex;align-items:center;gap:12px;padding:4px 10px;background:#fff;border:1px solid var(--line);border-radius:999px;box-shadow:0 2px 10px #141e320f}.carousel-arrow{width:26px;height:26px;display:flex;align-items:center;justify-content:center;padding:0;font-size:18px;line-height:1;color:var(--ink-2);background:transparent;border:0;border-radius:50%;cursor:pointer;transition:color .18s ease,background .18s ease}.carousel-arrow:hover:not(:disabled){color:var(--accent);background:var(--accent-soft, #eef3ff)}.carousel-arrow:disabled{opacity:.3;cursor:not-allowed}.carousel-index{min-width:54px;font-size:13px;color:var(--ink-3);text-align:center;font-variant-numeric:tabular-nums}.carousel-index b{font-weight:600;color:var(--ink)}.page-warn{font-size:12px;color:#c0562c}.paper-empty{min-height:320px;width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center;color:var(--ink-3);font-size:13px;border:1px dashed var(--line);border-radius:8px}.paper-empty-tip{font-size:12px;color:#b6bdca}.toast{position:fixed;left:50%;bottom:32px;transform:translate(-50%);z-index:50;padding:10px 18px;font-size:13px;color:#fff;background:#1a2233eb;border-radius:10px;box-shadow:0 10px 28px #141e3238}.toast-error{background:#c62842f2}.toast-enter-active,.toast-leave-active{transition:opacity .22s ease,transform .22s ease}.toast-enter-from,.toast-leave-to{opacity:0;transform:translate(-50%,8px)}.md-body{font-size:16px;line-height:1.95;color:#1f2733;word-break:break-word}.md-body>*:first-child{margin-top:0}.md-body>*:last-child{margin-bottom:0}.md-body h1,.md-body h2,.md-body h3,.md-body h4{line-height:1.5;margin:1.5em 0 .7em;font-weight:700}.md-body h1{font-size:26px;padding-bottom:10px;border-bottom:2px solid #eef1f6}.md-body h2{font-size:22px;padding-left:12px;border-left:4px solid var(--accent)}.md-body h3{font-size:18px;color:#2b3547}.md-body h4{font-size:16px}.md-body p{margin:.85em 0}.md-body strong{font-weight:700;color:#101a2b}.md-body em{font-style:italic;color:var(--ink-2)}.md-body ul,.md-body ol{margin:.85em 0;padding-left:1.6em}.md-body li{margin:.4em 0}.md-body li>p{margin:.2em 0}.md-body blockquote{margin:1em 0;padding:10px 16px;color:var(--ink-2);background:#f7f9fc;border-left:3px solid #cfd8e6;border-radius:0 6px 6px 0}.md-body blockquote>*:first-child{margin-top:0}.md-body blockquote>*:last-child{margin-bottom:0}.md-body code{padding:2px 6px;font-family:SFMono-Regular,Consolas,Menlo,monospace;font-size:.88em;color:#b03a5b;background:#fdf2f5;border-radius:4px}.md-body pre{margin:1em 0;padding:14px 16px;overflow-x:auto;background:#f5f7fb;border-radius:8px}.md-body pre code{padding:0;color:#2b3547;background:transparent;font-size:.86em;line-height:1.7}.md-body hr{margin:1.8em 0;border:0;border-top:1px solid var(--line)}.md-body a{color:var(--accent);text-decoration:none}.md-body table{width:100%;margin:1em 0;border-collapse:collapse;font-size:.94em}.md-body th,.md-body td{padding:8px 10px;border:1px solid var(--line);text-align:left}.md-body th{background:#f5f7fb;font-weight:600}.math-block{margin:1em 0;padding:2px 0;overflow-x:auto;overflow-y:hidden}.math-block .katex-display{margin:.4em 0}.md-body .katex{font-size:1.06em}.math-error{display:inline-block;padding:0 6px;font-size:.82em;color:#c62842;background:#fff1f4;border:1px dashed #f0b3c0;border-radius:4px;white-space:nowrap;cursor:help}.math-error--block{display:block;padding:10px 14px;margin:.8em 0;white-space:normal;line-height:1.6}.math-error__label{font-size:13px;font-weight:600}.math-error__src{display:block;margin-top:6px;padding:0;font-size:12px;color:#8a94a6;background:transparent;white-space:pre-wrap;word-break:break-all}.render-error{padding:10px 14px;margin-bottom:10px;font-size:13px;color:#c62842;background:#fff1f4;border-radius:8px}.render-error__raw{white-space:pre-wrap;word-break:break-word;font-size:12px;color:#6b7280}@media(max-width:1024px){.workspace{grid-template-columns:1fr;grid-template-rows:minmax(460px,1.1fr) minmax(420px,1fr)}.topbar{flex-wrap:wrap;height:auto;padding:10px 14px;gap:10px}.stats{margin-left:0}}
