:root{--paper:#fffdf8;--base:#f8f4ec;--ink:#443b35;--muted:#887e73;--line:#e6dfd3;--rose:#a34f58;--pink:#f6e5e3;--green:#516d54;--mint:#e5ecdf;--gold:#e2b566;--shadow:0 8px 28px #493b2a08;font-family:"Microsoft YaHei","PingFang SC",system-ui,sans-serif;color:var(--ink);font-size:16px;line-height:1.6;background:var(--base);font-synthesis:none}
*{box-sizing:border-box}body{margin:0}button,input,textarea,select{font:inherit;color:inherit}button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{opacity:.5;cursor:wait}a{color:var(--rose);text-underline-offset:4px}button{border:0;background:none}input,textarea,select{border:1px solid var(--line);background:var(--paper);border-radius:9px;padding:10px 12px;outline:none}input:focus,textarea:focus,select:focus{border-color:var(--rose);box-shadow:0 0 0 3px #a34f5810}button:focus-visible,a:focus-visible{outline:3px solid #a34f5870;outline-offset:3px}button svg,.icon{width:20px;height:20px;flex:none;vertical-align:middle;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}.button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:42px;border-radius:10px;padding:9px 17px;font-size:.9rem;font-weight:600;white-space:nowrap;background:var(--paper);border:1px solid var(--line)}.button:hover{background:#f0ebe2}.button.primary{background:var(--rose);border-color:var(--rose);color:white}.button.primary:hover{background:#8d414b}.button.green{background:var(--green);color:#fff;border-color:var(--green)}.button.quiet{background:transparent}.button.danger{color:#a03939}.icon-button{width:36px;height:36px;border-radius:8px;display:inline-grid;place-items:center}.icon-button:hover{background:#e9e2d7}.muted{color:var(--muted)}.small{font-size:.85rem}.hidden{display:none!important}.brand{display:flex;align-items:center;gap:12px;color:var(--ink);text-decoration:none}.brand-mark{width:42px;height:46px;border-radius:8px 15px 15px 8px;background:var(--rose);color:#fff7ef;display:grid;place-items:center;font-family:serif;font-size:24px;box-shadow:inset 5px 0 #ffffff20;transform:rotate(-5deg)}.brand strong{font-family:"STKaiti","KaiTi",serif;font-size:1.5rem;letter-spacing:2px}.brand small{display:block;letter-spacing:2px;font-size:.68rem;color:var(--muted);line-height:1.4}.boot{min-height:100vh;display:grid;place-content:center;justify-items:center}.shell{display:grid;grid-template-columns:236px minmax(0,1fr);min-height:100vh}.sidebar{background:#f0ece2;border-right:1px solid #e3ddd1;padding:32px 20px 20px;display:flex;flex-direction:column;position:sticky;top:0;height:100vh;overflow:auto}.sidebar .brand{margin:0 3px 35px}.new-button{width:100%;margin-bottom:26px}.nav-group{display:grid;gap:6px}.nav-item{width:100%;padding:10px 13px;display:flex;align-items:center;gap:11px;border-radius:8px;color:#6a6258;text-align:left;font-size:.9rem}.nav-item svg{width:18px}.nav-item:hover{background:#e8e2d7}.nav-item.active{background:#e5ddcf;color:#654d3d;font-weight:600}.nav-item .count{margin-left:auto;font-size:.75rem;background:#ffffff70;min-width:21px;text-align:center;border-radius:4px}.nav-label{font-size:.75rem;letter-spacing:2px;color:var(--muted);margin:30px 12px 9px;display:flex;align-items:center;justify-content:space-between}.category-dot{width:9px;height:9px;background:var(--dot,#a34f58);border-radius:50%;margin:0 4px}.sidebar-bottom{margin-top:auto;padding-top:35px}.sidebar-note{border-top:1px dashed #d4ccbd;margin:25px 12px 12px;padding-top:16px;font-family:"STKaiti","KaiTi",serif;color:#928574;font-size:.95rem}.account{display:flex;align-items:center;gap:9px;padding:12px 5px;font-size:.86rem}.avatar{width:31px;height:31px;border-radius:50%;background:#dfd6c7;display:grid;place-items:center}.account .icon-button{margin-left:auto}.workspace{min-width:0}.topbar{height:84px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 40px;gap:18px}.breadcrumb{color:var(--muted);font-size:.83rem}.breadcrumb span{color:var(--ink)}.search{position:relative;max-width:260px}.search svg{position:absolute;left:12px;top:12px;color:#9a8f80;width:17px}.search input{width:100%;font-size:.84rem;border-color:transparent;background:#efeae0;padding:9px 12px 9px 39px}.collection{max-width:1360px;margin:auto;padding:38px 44px 60px}.collection-heading{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:28px;gap:20px}.eyebrow{font-size:.72rem;letter-spacing:3px;color:#9c7760;margin:0 0 7px;text-transform:uppercase}.collection h1{font-family:"STKaiti","KaiTi",serif;font-size:2rem;letter-spacing:2px;margin:0 0 8px;font-weight:600}.collection-heading p{margin:0;color:var(--muted);font-size:.88rem}.date-stamp{border:1px solid #d3c8b8;padding:8px 16px;text-align:center;border-radius:4px;transform:rotate(3deg);color:#8b7561;font-size:.75rem;white-space:nowrap;box-shadow:inset 0 0 0 3px var(--base),inset 0 0 0 4px #e0d7c8}.date-stamp b{display:block;font-family:Georgia,serif;font-size:1.35rem;letter-spacing:2px}.tabs{display:flex;gap:24px;border-bottom:1px solid var(--line);margin:16px 0 28px;overflow:auto}.tab{padding:11px 2px;font-size:.88rem;color:var(--muted);white-space:nowrap;border-bottom:2px solid transparent}.tab.active{color:var(--rose);border-color:var(--rose);font-weight:600}.note-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:24px}.note-card{background:var(--paper);border:1px solid var(--line);border-radius:4px 12px 12px 4px;position:relative;min-height:252px;text-align:left;transition:transform .2s,box-shadow .2s;box-shadow:var(--shadow);display:flex;flex-direction:column;overflow:hidden}.note-card:hover{transform:translateY(-4px);box-shadow:0 12px 28px #493b2a11}.card-open{display:flex;flex-direction:column;align-items:stretch;width:100%;padding:27px 25px 14px;flex:1;text-align:left}.note-card:before{content:"";height:4px;position:absolute;left:0;right:0;top:0;background:var(--card-color,#e5d0c4)}.note-card h2{font-family:"STKaiti","KaiTi",serif;font-weight:600;font-size:1.4rem;line-height:1.5;margin:17px 0 10px;overflow-wrap:anywhere}.card-top{display:flex;gap:9px;align-items:center;font-size:.73rem;color:var(--muted)}.card-top .badge{margin-left:auto}.badge{display:inline-flex;align-items:center;gap:5px;padding:3px 7px;font-size:.7rem;border-radius:5px;background:#eee9df;color:#776c5f;white-space:nowrap}.badge svg{width:12px;height:12px}.badge.published{background:var(--mint);color:var(--green)}.badge.locked{background:var(--pink);color:var(--rose)}.card-excerpt{font-size:.85rem;color:#8a8174;margin:0 0 20px;line-height:1.8;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.card-footer{display:flex;align-items:center;justify-content:space-between;padding:0 22px 16px;font-size:.75rem;color:var(--muted);gap:8px}.card-tag{display:flex;align-items:center;gap:5px}.new-card{min-height:252px;border:1px dashed #cdbfac;border-radius:5px 12px 12px 5px;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#877561;gap:10px;background:#f3eee4}.new-card img{width:76px;height:76px;transform:rotate(-10deg)}.new-card strong{font-size:.95rem;font-weight:500}.new-card small{font-size:.75rem;color:var(--muted)}.empty{padding:35px 20px 45px;text-align:center;max-width:520px;margin:12px auto}.empty img{height:125px;width:125px}.empty h2{font-family:"STKaiti","KaiTi",serif;font-size:1.65rem;font-weight:500}.empty p{font-size:.92rem;color:var(--muted);line-height:1.9}.empty-actions{display:flex;gap:12px;justify-content:center;flex-wrap:wrap}.shelf-footer{text-align:center;color:#a69b8b;font-family:"STKaiti","KaiTi",serif;font-size:.9rem;margin-top:45px;letter-spacing:2px}.editor-topbar{padding:0 26px;gap:10px}.editor-actions{display:flex;gap:9px;align-items:center}.save-state{font-size:.75rem;color:var(--muted);margin-right:7px}.save-state.error{color:#a03939}.editor-layout{display:grid;grid-template-columns:minmax(0,1fr) 270px;min-height:calc(100vh - 84px)}.editor-main{min-width:0;padding:28px 34px 45px;background-image:radial-gradient(#cfc3af60 .7px,transparent .7px);background-size:16px 16px}.editor-paper{background:var(--paper);border:1px solid var(--line);border-radius:4px;box-shadow:0 7px 25px #66554009;min-height:calc(100vh - 160px);position:relative}.paper-meta{display:flex;align-items:center;gap:12px;color:var(--muted);padding:29px 38px 0;font-size:.78rem}.paper-meta svg{height:15px;width:15px}.paper-title{font-family:"STKaiti","KaiTi",serif;font-size:2rem;font-weight:600;padding:9px 38px 20px;width:100%;border:0;background:transparent;border-radius:0;box-shadow:none!important;line-height:1.6}.paper-title::placeholder{color:#b9ae9d}.toolbar{padding:9px 27px;border-top:1px solid #eee8dc;border-bottom:1px solid #eee8dc;display:flex;align-items:center;gap:4px;flex-wrap:wrap;background:#faf7f0}.toolbar button{min-width:33px;height:33px;padding:4px 7px;border-radius:5px;font-size:.86rem}.toolbar button:hover{background:#eae3d7}.toolbar svg{width:17px;height:17px}.toolbar .divider{height:19px;border-left:1px solid #ddd4c5;margin:0 6px}.mode-tabs{display:flex;gap:1px;margin-left:auto;background:#ebe5db;border-radius:6px;padding:2px}.mode-tabs button{height:27px;font-size:.73rem;padding:3px 10px}.mode-tabs .selected{background:var(--paper);box-shadow:0 1px 3px #493b2a10}.writing-area{display:grid;grid-template-columns:1fr;min-height:470px}.writing-area.split{grid-template-columns:1fr 1fr}.markdown-input{border:0!important;box-shadow:none!important;border-radius:0;resize:vertical;width:100%;min-height:470px;padding:27px 38px;line-height:2;font-size:.94rem;tab-size:2;background:transparent;color:#574e45}.writing-area.split .markdown-input{padding:25px 22px;border-right:1px dashed var(--line)!important}.writing-area .rendered{padding:24px 38px;min-width:0;overflow-wrap:anywhere}.writing-area.split .rendered{padding:25px 22px}.paper-bottom{display:flex;justify-content:space-between;gap:10px;padding:13px 30px;border-top:1px solid #eee8dc;font-size:.72rem;color:#9b8f7e}.editor-aside{border-left:1px solid var(--line);padding:25px 21px;background:#f4f0e7}.aside-section{padding-bottom:22px;margin-bottom:22px;border-bottom:1px dashed #ddd3c3}.aside-section:last-child{border-bottom:0}.aside-section h3{font-weight:600;font-size:.88rem;margin:0 0 14px;display:flex;align-items:center;gap:8px}.aside-section h3 svg{width:17px;height:17px}.field-label{display:block;font-size:.78rem;color:var(--muted);margin:12px 0 6px}.aside-section select,.aside-section input{width:100%;font-size:.84rem;padding:9px}.sticker-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}.sticker{background:var(--paper);border:1px solid #e9e0d2;border-radius:9px;aspect-ratio:1;position:relative;padding:4px;transition:transform .18s}.sticker:hover{transform:rotate(-7deg) scale(1.08);border-color:#c4ad96}.sticker img{width:100%;height:100%;display:block}.sticker-help{font-size:.75rem;color:#9c8c78;text-align:center;margin:11px 0 0}.upload-box{border:1px dashed #c5b9a4;width:100%;min-height:91px;border-radius:9px;background:#eee9dd;color:#88775f;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;font-size:.8rem}.upload-box svg{width:24px;height:24px}.upload-box:hover{background:#e8e1d3}.aside-note{font-size:.75rem;line-height:1.8;color:var(--muted);margin-top:12px}.page-count{font-family:Georgia,serif;color:#b5a084;font-size:2.2rem;margin:0}.editor-bottom-actions{display:flex;flex-wrap:wrap;gap:7px}.editor-bottom-actions button{font-size:.78rem;padding:5px 7px;color:var(--muted);display:flex;align-items:center;gap:5px}.editor-bottom-actions button:hover{color:var(--rose)}.editor-bottom-actions svg{width:16px;height:16px}.rendered{font-size:1rem;line-height:1.95;color:#554b40}.rendered h1,.rendered h2,.rendered h3{font-family:"STKaiti","KaiTi",serif;color:var(--ink);line-height:1.6;margin:1.2em 0 .6em}.rendered h1{font-size:1.7rem}.rendered h2{font-size:1.4rem}.rendered h3{font-size:1.2rem}.rendered p{margin:.7em 0 1.1em}.rendered img{max-width:100%;height:auto;border-radius:8px;vertical-align:middle}.rendered img[src^="/stickers/"]{width:96px;height:96px;object-fit:contain;display:inline-block;margin:4px 5px;filter:drop-shadow(0 3px 2px #80604212)}.rendered pre{white-space:pre-wrap;overflow:auto;background:#f1ece3;border:1px solid var(--line);padding:16px;border-radius:6px;font-size:.82rem}.rendered code{font-size:.88em;padding:2px 4px;background:#f0e9df;border-radius:4px}.rendered pre code{background:none;padding:0}.rendered blockquote{border-left:3px solid #d2ab8e;background:#f6f0e6;padding:5px 19px;margin:18px 0;color:#86715d}.rendered hr{border:0;border-top:1px dashed #d1c2ac;margin:26px 0}.rendered table{border-collapse:collapse;width:100%;display:block;overflow:auto;font-size:.88rem}.rendered td,.rendered th{padding:8px 14px;border:1px solid #d8cfbe;white-space:normal}.rendered th{background:#f1eadf}.rendered ul,.rendered ol{padding-left:1.6em}.rendered input[type="checkbox"]{width:15px;vertical-align:middle;accent-color:var(--rose)}.auth-page{min-height:100vh;display:grid;grid-template-columns:1fr 1fr;max-width:1300px;margin:auto;padding:70px 80px;align-items:center;gap:80px}.auth-illustration{position:relative;padding:25px}.auth-illustration .brand{margin-bottom:50px}.mini-journal{background:var(--paper);padding:35px 33px 65px;max-width:370px;border:1px solid #dcd0be;border-radius:3px 14px 14px 3px;box-shadow:12px 12px #e8decd,0 12px 35px #67513112;transform:rotate(-5deg);position:relative;min-height:340px;background-image:repeating-linear-gradient(transparent,transparent 31px,#e8dfd22b 31px,#e8dfd22b 32px)}.mini-journal:before{content:"";position:absolute;top:-11px;left:35%;height:29px;width:95px;background:#dacba9a8;transform:rotate(8deg)}.mini-journal .eyebrow{margin-top:20px}.mini-journal h2{font-family:"STKaiti","KaiTi",serif;font-weight:500;font-size:1.85rem;line-height:1.9;margin-bottom:15px}.mini-journal p{font-size:.85rem;color:#9c8b75}.mini-journal .cat{position:absolute;width:118px;height:118px;right:3px;bottom:0;transform:rotate(10deg)}.mini-journal .flower{position:absolute;width:67px;height:67px;top:-15px;right:-15px;transform:rotate(20deg)}.auth-form{max-width:390px;width:100%}.auth-form h1{font-family:"STKaiti","KaiTi",serif;font-size:2rem;font-weight:500;margin:0 0 10px}.auth-form>p{color:var(--muted);font-size:.9rem;margin-bottom:28px}.auth-form label{display:block;font-size:.86rem;margin-bottom:8px}.auth-form input{display:block;width:100%;margin:0 0 19px;padding:12px 14px}.auth-form .button{width:100%;margin-top:5px;padding:12px}.auth-links{text-align:center;font-size:.83rem;margin-top:25px}.form-error{color:#a63c43;font-size:.85rem;min-height:1.5em;margin:8px 0}.public-header{display:flex;align-items:center;justify-content:space-between;gap:20px;max-width:1040px;margin:auto;padding:29px 32px}.public-main{max-width:900px;margin:25px auto 70px;padding:0 25px}.public-paper{background:var(--paper);padding:50px 68px;box-shadow:var(--shadow);border:1px solid var(--line);border-radius:3px;position:relative}.public-paper:before{content:"";position:absolute;top:-11px;left:42%;height:29px;width:100px;background:#dfceb4a8;transform:rotate(-4deg)}.public-title{font-family:"STKaiti","KaiTi",serif;font-size:2.1rem;margin:12px 0 22px;line-height:1.6;overflow-wrap:anywhere}.public-meta{font-size:.8rem;color:var(--muted);margin-bottom:30px;padding-bottom:20px;border-bottom:1px dashed #d8cdbb}.public-footer{text-align:center;padding:32px;color:#aa9a85;font-size:.8rem}.lock-page{max-width:410px;margin:60px auto;text-align:center;padding:25px}.lock-page img{width:115px}.lock-page h1{font-family:"STKaiti","KaiTi",serif;font-size:1.75rem;font-weight:500}.lock-page input{width:100%;margin:20px 0 12px}.lock-page .button{width:100%}dialog{border:1px solid var(--line);border-radius:14px;padding:28px;max-width:470px;width:calc(100% - 32px);background:var(--paper);color:var(--ink);box-shadow:0 20px 100px #443b3530}dialog::backdrop{background:#443b3560;backdrop-filter:blur(3px)}dialog h2{font-family:"STKaiti","KaiTi",serif;font-size:1.6rem;margin:0 0 12px;font-weight:600}dialog p{font-size:.9rem;color:var(--muted)}dialog input,dialog select{width:100%;margin:6px 0 12px}.dialog-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:22px}.category-row{display:flex;gap:8px;align-items:center;padding:8px 0;border-bottom:1px solid var(--line)}.category-row span:nth-child(2){flex:1}.category-row button svg{width:16px}.link-box{font-size:.85rem;background:#f1eadf;padding:10px;border-radius:7px;overflow-wrap:anywhere;margin:17px 0}#toast{position:fixed;bottom:25px;left:50%;transform:translate(-50%,20px);padding:12px 22px;background:#4a443a;color:#fffaf1;border-radius:10px;font-size:.86rem;box-shadow:0 5px 30px #493b2a20;z-index:100;opacity:0;transition:all .2s;pointer-events:none;max-width:90vw}#toast.visible{opacity:1;transform:translate(-50%,0)}.mobile-menu{display:none}.mobile-sidebar-shade{display:none}.link-button{font-size:inherit;color:var(--rose);text-decoration:underline;text-underline-offset:4px;padding:0}.preview-empty{color:#b1a18b;font-family:"STKaiti","KaiTi",serif;padding:30px 0}.trash-card{opacity:.8}
@media(min-width:1600px){.editor-main{padding:38px 60px}.editor-layout{grid-template-columns:minmax(0,1fr) 300px}.editor-aside{padding:30px}}
@media(max-width:1200px){.shell{grid-template-columns:205px minmax(0,1fr)}.sidebar{padding:27px 15px 16px}.collection{padding:30px}.editor-layout{grid-template-columns:minmax(0,1fr) 220px}.editor-main{padding:24px 20px}.editor-aside{padding:23px 15px}.paper-title{font-size:1.75rem;padding-left:25px;padding-right:25px}.paper-meta{padding-left:25px}.markdown-input,.writing-area .rendered{padding:23px 25px}.toolbar{padding:7px 15px}.topbar{padding:0 28px}.editor-topbar{padding:0 20px}.editor-topbar .button{padding:8px 12px}.auth-page{padding:60px;gap:50px}}
@media(max-width:1000px){.editor-layout{grid-template-columns:minmax(0,1fr)}.editor-aside{border-left:0;border-top:1px solid var(--line);display:grid;grid-template-columns:1fr 1fr;gap:20px}.aside-section{margin-bottom:0}.sticker-grid{grid-template-columns:repeat(6,1fr)}.stickers-section{grid-column:1/-1;grid-row:1}.sticker{max-height:77px}.save-state{display:none}.auth-page{padding:40px;gap:40px}.mini-journal{padding:25px 25px 75px}}
@media(max-width:760px){.shell{display:block}.sidebar{display:none}.sidebar.open{display:flex;position:fixed;z-index:40;width:245px;left:0;top:0;height:100dvh;box-shadow:10px 0 40px #443b3525}.mobile-sidebar-shade.open{display:block;position:fixed;inset:0;background:#443b3550;z-index:39}.mobile-menu{display:inline-grid}.topbar{height:67px;padding:0 18px;gap:9px}.breadcrumb{font-size:.8rem;margin-right:auto}.search{max-width:170px}.collection{padding:27px 20px}.collection h1{font-size:1.8rem}.date-stamp{padding:5px 10px;font-size:.65rem}.date-stamp b{font-size:1.1rem}.note-grid{gap:17px;grid-template-columns:repeat(auto-fill,minmax(235px,1fr))}.collection-heading p{font-size:.8rem}.tabs{gap:23px;margin-bottom:23px}.editor-layout{min-height:calc(100vh - 67px)}.editor-topbar .breadcrumb{display:none}.editor-actions{margin-left:auto;gap:6px}.editor-actions .button{min-height:37px;font-size:.77rem;padding:7px 10px;gap:5px}.editor-actions svg{width:16px}.editor-main{padding:18px 12px 25px}.editor-paper{min-height:calc(100vh - 120px)}.paper-meta{padding:21px 22px 0}.paper-title{padding:6px 22px 16px;font-size:1.65rem}.toolbar{padding:8px 12px;gap:2px}.toolbar .divider{margin:0 3px}.mode-tabs{margin-left:auto}.mode-tabs button{padding:3px 7px;font-size:.7rem}.markdown-input{padding:22px;font-size:1rem;min-height:420px}.writing-area{min-height:420px}.writing-area.split{grid-template-columns:1fr}.writing-area.split .markdown-input{border-right:0!important;border-bottom:1px dashed var(--line)!important}.writing-area .rendered{padding:20px 22px}.editor-aside{padding:23px 20px;gap:15px}.sticker-grid{gap:8px}.sticker{max-height:70px}.paper-bottom{padding:12px 20px;font-size:.7rem}.auth-page{grid-template-columns:1fr;max-width:480px;padding:35px 28px 60px;gap:30px}.auth-illustration{padding:0}.auth-illustration .brand{margin:0 0 35px}.mini-journal{display:none}.auth-form{max-width:none}.auth-form h1{font-size:1.9rem}.public-header{padding:23px 20px}.public-header .brand strong{font-size:1.25rem}.public-header .button{font-size:.78rem;min-height:37px;padding:7px 11px}.public-main{margin:15px auto 40px;padding:0 13px}.public-paper{padding:35px 24px}.public-title{font-size:1.8rem}.rendered{font-size:1rem}.lock-page{margin:20px auto}.shelf-footer{margin-top:33px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important;transform:none!important}} 

/* 编辑器：固定操作区，书写与预览各自滚动。 */
:root{--editor-topbar-height:84px}
.editor-topbar{position:sticky;top:0;z-index:25;height:var(--editor-topbar-height);background:var(--base);box-shadow:0 3px 12px #493b2a05}
.editor-actions{min-width:0}
.editor-topbar .preview-toggle{color:var(--rose);border-color:#cda3a5;background:#fbefec;box-shadow:inset 0 0 0 1px #fff7f2}
.editor-topbar .preview-toggle:hover,.editor-topbar .preview-toggle[aria-pressed="true"]{background:var(--pink);border-color:var(--rose)}
.editor-controls{position:sticky;top:var(--editor-topbar-height);z-index:15;background:var(--paper);box-shadow:0 4px 10px #493b2a08}
.editor-controls .toolbar{border-bottom:0;min-width:0;gap:3px}
.editor-controls .toolbar button{flex-shrink:0}
.editor-controls .toolbar .shortcut-help{margin-left:auto;color:#78624e;font-size:.76rem;white-space:nowrap;padding-inline:9px}
.editor-controls .toolbar button:disabled{opacity:.35;cursor:not-allowed;background:transparent;box-shadow:none}
.redo-icon{display:inline-flex;align-items:center;justify-content:center;transform:scaleX(-1)}
.editor-view-bar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 14px;padding:10px 22px;border-top:1px dashed #e4d9cb;border-bottom:1px solid #e7dccd;background:#f6f1e7}
.editor-view-bar .mode-tabs{display:flex;flex:0 1 auto;min-width:0;margin:0;gap:3px;padding:4px;border:1px solid #e2d4c3;border-radius:10px;background:#ece3d6}
.editor-view-bar .mode-tabs button{height:34px;min-width:0;padding:5px 13px;border-radius:7px;font-size:.8rem;line-height:1.5;color:#766552;white-space:nowrap}
.editor-view-bar .mode-tabs button:hover{background:#f8f1e6}
.editor-view-bar .mode-tabs button.selected,.editor-view-bar .mode-tabs button[aria-pressed="true"]{background:var(--paper);color:var(--rose);font-weight:600;box-shadow:0 2px 5px #6e513c14,inset 0 0 0 1px #fff}
.preview-status{min-width:0;max-width:100%;font-size:.73rem;line-height:1.6;color:#817460;overflow-wrap:anywhere}
.preview-status.error,.preview-status[data-state="error"]{color:#a05b37}
.preview-status[data-state="loading"]{color:#9a8061}
.writing-area{min-width:0;grid-template-columns:minmax(0,1fr)}
.writing-area.split{height:clamp(420px,calc(100dvh - 290px),760px);min-height:0;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:minmax(0,1fr);overflow:hidden}
.writing-area.split>.markdown-input{height:100%;min-height:0;min-width:0;max-width:100%;resize:none;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding:24px 22px;background:#fffdf8}
.preview-pane{min-width:0;max-width:100%;min-height:0;position:relative}
.writing-area.split>.preview-pane{height:100%;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;background:#fffaf1}
.writing-area.split .rendered{min-height:100%;padding:24px 22px}
.writing-area[data-mode="preview"]{display:block;min-height:360px}
.writing-area[data-mode="preview"]>.preview-pane{height:auto;max-height:none;overflow:visible;background:var(--paper)}
.writing-area[data-mode="preview"] .rendered{min-height:360px;padding:28px 38px 40px}
.preview-message{display:flex;align-items:center;flex-wrap:wrap;gap:6px 12px;position:sticky;top:0;z-index:1;padding:11px 18px;border-bottom:1px solid #e8cfaa;background:#fff1dc;color:#8c5c38;font-size:.8rem;line-height:1.7;box-shadow:0 2px 6px #6e513c08}
.preview-message>span{flex:1 1 180px;min-width:0;overflow-wrap:anywhere}
.preview-message .link-button{min-height:30px;flex:0 0 auto;color:#995230;font-weight:600;white-space:nowrap}
.writing-area[data-mode="preview"] .preview-message{position:static}
.paper-bottom>span{min-width:0;overflow-wrap:anywhere}
.paper-bottom>span:last-child{flex-shrink:0;white-space:nowrap}
.shortcuts-table{width:100%;max-width:100%;border-collapse:collapse;table-layout:fixed;margin:14px 0 4px;font-size:.82rem;line-height:1.8}
.shortcuts-table th,.shortcuts-table td{padding:10px 7px;border-bottom:1px dashed #e2d7c7;vertical-align:middle;text-align:left;overflow-wrap:anywhere}
.shortcuts-table th{color:#897360;font-size:.76rem;font-weight:600;background:#f7f0e5}
.shortcuts-table td:first-child,.shortcuts-table th:first-child{width:40%}
.shortcuts-table td:last-child,.shortcuts-table th:last-child{text-align:right}
kbd{display:inline-block;max-width:100%;padding:1px 5px;border:1px solid #d7cbb8;border-bottom-width:2px;border-radius:4px;background:#f7f1e6;color:#655542;font-family:ui-monospace,"Cascadia Code",Consolas,monospace;font-size:.75rem;line-height:1.65;vertical-align:baseline;white-space:normal;overflow-wrap:anywhere;box-shadow:0 1px 1px #70573708}
dialog.image-viewer{width:min(960px,calc(100% - 32px));max-width:min(960px,calc(100% - 32px));max-height:calc(100dvh - 32px);padding:20px;overflow:auto}
.image-viewer h2{font-size:1.35rem;padding-right:28px;overflow-wrap:anywhere}
.image-viewer img{display:block;width:auto;height:auto;max-width:100%;max-height:70dvh;object-fit:contain;margin:0 auto;border-radius:8px;background:#f0ebe2}
.image-viewer .dialog-actions{margin-top:15px}
.image-viewer .image-caption{font-size:.8rem;text-align:center;overflow-wrap:anywhere;margin:12px 0 0}
.rendered img[data-viewer]{cursor:zoom-in}
@media(max-width:1200px){.editor-view-bar{padding-inline:15px;gap:7px 10px}.editor-view-bar .mode-tabs button{padding-inline:10px}.writing-area[data-mode="preview"] .rendered{padding-inline:25px}}
@media(max-width:760px){
  :root{--editor-topbar-height:67px}
  .editor-controls .toolbar{padding:8px 10px;gap:2px}
  .editor-controls .toolbar .shortcut-help{padding-inline:7px}
  .editor-view-bar{padding:8px 10px;gap:5px 8px}
  .editor-view-bar .mode-tabs{flex:1 1 210px;gap:2px;padding:3px}
  .editor-view-bar .mode-tabs button{flex:1 1 0;height:34px;padding:5px 7px;font-size:.76rem}
  .preview-status{flex:1 1 auto;text-align:right;font-size:.7rem}
  .writing-area.split{height:clamp(300px,calc(100dvh - 300px),560px);min-height:0;grid-template-columns:minmax(0,1fr);grid-template-rows:repeat(2,minmax(0,1fr))}
  .writing-area.split>.markdown-input{height:100%;min-height:0;padding:16px 18px;line-height:1.9;border-right:0!important;border-bottom:1px dashed #d8c9b8!important}
  .writing-area.split>.preview-pane{height:100%;min-height:0}
  .writing-area.split .rendered{padding:16px 18px}
  .writing-area[data-mode="preview"] .rendered{padding:22px 22px 30px}
  .preview-message{padding:8px 13px;font-size:.76rem}
  .preview-message>span{flex-basis:150px}
  .shortcuts-table th,.shortcuts-table td{padding:9px 4px}
  dialog.image-viewer{padding:15px}
}
@media(max-width:480px){
  .editor-topbar{padding-inline:12px;gap:6px}
  .editor-topbar>.icon-button{width:32px;flex:0 0 32px}
  .editor-actions{gap:5px}
  .editor-actions .button{padding:7px 8px;font-size:.74rem;gap:4px}
  .editor-actions svg{width:15px;height:15px}
  .paper-bottom{padding-inline:16px;gap:8px}
}
@media(max-width:360px){.editor-view-bar .preview-status{flex-basis:100%;text-align:left;padding-inline:4px}.editor-actions .button{padding-inline:6px}}
@media(prefers-reduced-motion:reduce){.redo-icon{transform:scaleX(-1)!important}}
