@charset "UTF-8";
@font-face{font-family:"Noto Serif SC";src:url("./fonts/noto-serif-sc-400.woff2") format("woff2");font-weight:400;font-style:normal;font-display:swap}
/* Recent library columns and name dialogs follow the supplied Mubu references. */
.recent-columns,.recent-row{display:grid;grid-template-columns:minmax(0,1fr) 156px 156px 32px;align-items:center;column-gap:24px}
.recent-columns{margin:0 56px 8px;padding:0 calc(12px + var(--list-scrollbar,15px)) 0 12px;color:var(--muted);font-size:12px;min-height:28px}
.recent-columns>span:nth-child(2),.recent-columns>span:nth-child(3){text-align:right}
.note-panel[data-list-view="recent"] .list-controls{padding-bottom:12px}
.note-panel[data-list-view="recent"] .virtual-row{height:56px;padding:0}
.recent-row{position:relative;height:56px;padding:0 12px;border-radius:6px}
.recent-row:hover,.recent-row.marked{background:var(--hover)}
.recent-name{display:flex;align-items:center;gap:12px;min-width:0;height:100%;padding:0;text-align:left;font-size:16px}
.recent-name>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.recent-name>svg{width:20px;height:20px;color:var(--soft)}
.recent-updated,.recent-created{font-size:12px;color:var(--muted);text-align:right;white-space:nowrap}
.recent-row>input{position:absolute;left:10px;width:15px;height:15px;margin:0}
.recent-row:has(>input) .recent-name{padding-left:25px}
.recent-more{color:var(--muted)}
#folder-menu{width:212px;padding:6px;border-radius:10px;overflow-y:auto}
#folder-menu button{justify-content:flex-start;gap:12px;min-height:38px;padding:8px 10px}
#folder-menu button svg{width:18px;height:18px;stroke-width:1.5}
#folder-menu button span{flex:1}
#input-dialog{width:var(--dialog-width);padding:22px 24px;border:0;border-radius:12px;box-shadow:0 8px 32px #0003}
#input-dialog h2{font-size:18px;line-height:26px;margin:0 32px 20px 0;font-weight:600}
#input-dialog #dialog-description,#input-dialog #dialog-label{display:none}
#input-dialog .dialog-close{display:flex;align-items:center;justify-content:center;top:16px;right:16px;width:28px;height:28px;padding:0;color:var(--muted);font-size:24px;line-height:1;border-radius:6px}
#input-dialog .dialog-close:hover{background:var(--hover)}
#input-dialog input{height:36px;border-radius:6px;font-size:14px}
#input-dialog input:focus{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 12%,transparent);outline:none}
#input-dialog .dialog-actions{gap:12px;margin-top:24px;flex-wrap:nowrap}
#input-dialog .dialog-actions>button{flex:1;min-height:var(--control-height);padding:0 16px;border:0;border-radius:var(--control-radius);font-size:13px}
#input-dialog .dialog-actions>button:not(.primary){background:var(--hover)}
#input-dialog .dialog-actions>.primary{background:var(--accent);color:#fff}
@media(max-width:1100px){.recent-columns,.recent-row{grid-template-columns:minmax(0,1fr) 132px 132px 32px;column-gap:12px}}
@media(max-width:900px){.recent-columns{margin-right:24px;margin-left:24px}}
@media(max-width:620px){.recent-columns{margin-right:16px;margin-left:16px}.recent-columns,.recent-row{grid-template-columns:minmax(0,1fr) 120px 28px;column-gap:8px}.recent-created,.recent-columns>span:nth-child(3){display:none}.recent-name{font-size:14px;gap:8px}.recent-updated{font-size:11px}}
/* Mubu screenshot alignment; the original application icon is unchanged. */
:root{color-scheme:light;--font:-apple-system,BlinkMacSystemFont,"PingFang SC",Helvetica,Arial,"Microsoft YaHei",sans-serif;--bg:#f8f8fa;--sidebar:#f8f8fa;--panel:#fff;--paper:#fff;--editor-bg:#fff;--ink:#2e2e2e;--soft:#595959;--muted:#949494;--line:rgba(0,0,0,.1);--hover:rgba(0,0,0,.05);--accent:#2e2e2e;--blue:#595959;--accent-soft:#eeeeef;--accent-border:#d4d4d4;--action:#2e2e2e;--input-bg:#fff;--input-border:rgba(0,0,0,.2);--danger:#c43c3c;--shadow:0 4px 16px #0000001f}
body.dark{color-scheme:dark;--bg:#121212;--sidebar:#121212;--panel:#1c1c1e;--paper:#121212;--editor-bg:#121212;--ink:#d4d4d4;--soft:#b8b8b8;--muted:#949494;--line:rgba(255,255,255,.1);--hover:rgba(255,255,255,.05);--accent:#d4d4d4;--blue:#b8b8b8;--accent-soft:#28282b;--accent-border:#3f3f43;--action:#2e2e2e;--input-bg:#0d0d0f;--input-border:#3f3f43;--danger:#f08080;--shadow:0 4px 16px #0006}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:14px/1.5 var(--font);-webkit-font-smoothing:antialiased}button,input,select{font:inherit;color:inherit}button{cursor:pointer;border:0;background:transparent}button:disabled{opacity:.4;cursor:default}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--blue);outline-offset:2px}input::placeholder{color:var(--muted)}input[type="checkbox"]{accent-color:var(--accent)}
svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}[hidden]{display:none!important}.symbols{position:absolute;width:0;height:0;overflow:hidden}.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
/* Two panes: navigation and library; opening a note replaces the library. */
#app{display:grid;grid-template-columns:271px minmax(0,1fr);height:100dvh;overflow:hidden;padding:12px 8px 8px 0;gap:0}
.sidebar{grid-column:1;grid-row:1;display:flex;flex-direction:column;background:var(--sidebar);padding:12px;overflow-y:auto;min-height:0}.sidebar>*{flex-shrink:0}
.brand{display:flex;align-items:center;gap:8px;margin:0 6px 16px;text-decoration:none;color:var(--soft);font-size:16px;font-weight:400}.brand small{display:none}.brand-icon{display:block;width:24px;height:24px;flex-shrink:0}.brand-icon img{display:block;width:100%;height:100%;object-fit:contain}
.sidebar-search{display:flex;align-items:center;gap:10px;margin-bottom:16px}
.search-wrap{display:flex;align-items:center;gap:8px;min-width:0;flex:1;height:34px;padding:0 10px;background:var(--input-bg);border:1px solid var(--line);border-radius:8px}
.search-wrap:focus-within{border-color:var(--blue)}.search-wrap svg{width:16px;height:16px;color:var(--soft)}.search-wrap input{width:100%;min-width:0;border:0;background:transparent;font-size:13px}.search-wrap input:focus-visible{outline:none}.search-wrap kbd{display:none}
.new-note{display:flex;align-items:center;justify-content:center;flex:0 0 34px;width:34px;height:34px;padding:0;background:var(--action);color:#fff;border-radius:50%}.new-note:hover{filter:brightness(1.15)}.new-note svg{width:18px;height:18px}
kbd{font:11px var(--font);color:var(--muted);border:1px solid var(--line);border-radius:3px;padding:1px 4px;white-space:nowrap}
.nav-item{display:flex;align-items:center;width:100%;min-height:36px;gap:10px;padding:6px 8px;margin:2px 0;border-radius:6px;text-align:left;color:var(--soft);font-size:16px;font-weight:400}.nav-item svg{width:18px;height:18px}.nav-item:hover,.icon-button:hover{background:var(--hover);color:var(--ink)}.nav-item.active{background:var(--accent-soft);color:var(--ink);font-weight:600}.count{margin-left:auto;color:var(--muted);font-size:12px}
.sidebar-heading{display:flex;align-items:center;justify-content:space-between;color:var(--muted);font-size:13px;padding:0 8px;margin:24px 0 12px}.icon-button{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:6px;color:var(--soft);flex-shrink:0}.sidebar-heading .icon-button{width:24px;height:24px}
.all-notes-row,.folder-row{display:flex;align-items:center;min-width:0}.all-notes-row>.nav-item,.folder-row .nav-item{flex:1;min-width:0}.all-notes-row>.icon-button{width:28px}
#folder-nav{min-height:80px;overflow-y:auto;overflow-x:hidden;flex:1}.folder-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.folder-manage{display:inline-flex;align-items:center;justify-content:center;width:24px;height:28px;flex-shrink:0;border-radius:6px;color:var(--muted)}.folder-manage:hover,.folder-manage[aria-expanded="true"]{background:var(--hover);color:var(--ink)}
.tree-row{display:flex;align-items:center;padding-left:calc(var(--depth,0)*12px);min-height:36px;border-radius:6px}.tree-row:hover{background:var(--hover)}.tree-row.selected{background:var(--accent-soft)}.tree-row .nav-item{flex:1;min-width:0;margin:0;padding:6px 4px;gap:8px;font-size:16px;background:transparent}.tree-row .nav-item svg{width:16px;height:16px}.tree-toggle{width:16px;flex-shrink:0;padding:0;font-size:16px;color:var(--muted)}.tree-note{padding-left:calc(16px + var(--depth,0)*12px)}.tree-row small{font-size:12px;color:var(--muted)}.tree-empty{display:block;padding:12px 8px;font-size:12px;color:var(--muted)}
.tag-nav{display:flex;flex-wrap:wrap;gap:6px;padding:4px 8px 12px}.tag-nav button{border:1px solid var(--line);border-radius:4px;padding:3px 7px;font-size:12px;color:var(--soft)}.tag-nav button:hover,.tag-nav button.active{background:var(--accent-soft);color:var(--ink);border-color:var(--accent-border)}
.sidebar-bottom{margin-top:auto;padding-top:12px;border-top:1px solid var(--line)}.local-card{display:flex;align-items:center;gap:8px;padding:8px 4px;margin:8px 4px 0;font-size:12px}.sync-card{width:calc(100% - 8px);text-align:left}.local-card small{display:block;margin-top:4px;color:var(--muted);font-size:11px}.local-card>svg{width:14px;margin-left:auto;color:var(--muted)}#sync-detail{max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sync-card:hover #sync-label{color:var(--blue)}
.local-dot,.save-dot{display:inline-block;width:5px;height:5px;flex-shrink:0;border-radius:50%;background:var(--muted)}#sync-dot.pending{background:var(--accent)}#sync-dot.error{background:var(--danger)}#sync-dot.offline{background:var(--muted)}
.sidebar-tools{display:flex;align-items:center;justify-content:space-between;margin:8px 0 0}.sidebar-tools button{display:flex;align-items:center;gap:6px;min-height:32px;padding:6px;font-size:12px;color:var(--soft)}.sidebar-tools button:hover{background:var(--hover);border-radius:6px}.sidebar-tools svg{width:16px;height:16px}.edition{font-size:11px;color:var(--muted)}
.note-panel,.editor-panel{grid-column:2;grid-row:1;border:1px solid var(--line);border-radius:10px;min-width:0;background:var(--paper)}
.note-panel{display:flex;flex-direction:column;overflow:hidden;min-height:0}.editor-panel{display:none;position:relative;overflow:hidden}
.mobile-edit .note-panel{display:none}.mobile-edit .editor-panel{display:block}
.list-header{display:flex;align-items:center;justify-content:space-between;padding:64px 64px 28px}.list-header p,.dialog-eyebrow{display:none}.list-header h1{display:flex;align-items:center;gap:12px;font-size:34px;line-height:48px;font-weight:600;margin:0}.list-header h1 span{font-size:13px;font-weight:400;color:var(--muted)}
.list-controls{display:flex;align-items:center;gap:12px;padding:0 64px 20px;font-size:12px;color:var(--muted)}#list-description{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#list-description:not(.search-description){color:var(--muted)}.list-controls select{border:0;background:transparent;color:var(--soft);max-width:104px;cursor:pointer;font-size:12px}#multi-select{padding:4px 6px;border-radius:4px;color:var(--soft);font-size:12px;flex-shrink:0}#multi-select:hover{background:var(--hover)}#multi-select[aria-pressed="true"]{background:var(--accent-soft)}
#note-list{overflow-y:auto;min-height:0;flex:1;padding:0 56px 24px;scrollbar-gutter:stable}
.note-card{display:block;position:relative;width:100%;height:82px;margin:0;padding:10px 12px;text-align:left;border:1px solid transparent;border-radius:6px}.note-card:hover{background:var(--hover)}.note-card.selected,.note-select-row.marked .note-card{background:var(--accent-soft)}
.card-head{display:flex;align-items:center;gap:8px;height:20px;margin-bottom:3px}.card-title{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:16px;line-height:20px;font-weight:400}.card-head svg{width:12px;height:12px;color:var(--soft)}.card-preview{display:block;height:18px;margin-bottom:5px;color:var(--muted);font-size:13px;line-height:18px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.card-foot{display:flex;align-items:center;gap:6px;height:14px;font-size:11px;line-height:14px;color:var(--muted);white-space:nowrap}.card-foot svg{width:12px;height:12px}.card-category{margin-left:auto;max-width:32%;overflow:hidden;text-overflow:ellipsis}.card-label{max-width:35%;padding:0 4px;background:var(--hover);border-radius:3px;overflow:hidden;text-overflow:ellipsis;font-size:10px}.card-color{width:5px;height:5px;flex:0 0 5px;border-radius:50%;background:var(--muted)}.card-color.yellow{background:#d9b758}.card-color.green{background:#88a675}.card-color.blue{background:#8ba9c8}.card-color.pink{background:#c58f9f}
.list-footer{display:flex;justify-content:space-between;gap:8px;padding:12px 24px;border-top:1px solid var(--line);font-size:11px;color:var(--muted)}.list-footer>span:last-child{display:none}.list-empty{padding:64px 20px;text-align:center;color:var(--muted);font-size:14px;line-height:1.8}.list-empty svg{display:block;width:32px;height:32px;margin:0 auto 16px;color:var(--muted)}
.sidebar-toggle{display:none}.virtual-list-space{position:relative;width:100%;overflow-anchor:none}.virtual-row{position:absolute;left:0;right:0;height:88px;padding:3px 0}.virtual-row .note-card,.virtual-row .note-select-row{height:82px;margin:0}.note-select-row{display:flex;align-items:center;gap:6px}.note-select-row>input{flex:0 0 15px;width:15px;height:15px;margin:0 0 0 4px}.note-select-row .note-card{flex:1;min-width:0}
#list-batch-bar{display:flex;align-items:center;gap:8px;padding:8px;margin:0 64px 6px;background:var(--accent-soft);border-radius:4px;font-size:12px}#list-batch-bar label{display:flex;align-items:center;gap:4px;white-space:nowrap}#batch-count{color:var(--soft);white-space:nowrap}#move-selected{margin-left:auto;padding:5px;background:var(--paper);border-radius:4px;white-space:nowrap}
#editor-shell{display:flex;height:100%;flex-direction:column}.editor-header{display:flex;align-items:center;gap:10px;height:56px;padding:0 24px;border-bottom:1px solid var(--line);flex-shrink:0}.breadcrumb{display:flex;align-items:center;gap:8px;min-width:0;color:var(--muted);font-size:13px}.breadcrumb svg{width:14px;height:14px}#breadcrumb-folder{max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slash{color:var(--muted)}.editor-actions{display:flex;align-items:center;gap:8px;margin-left:auto}#save-state{display:flex;align-items:center;gap:6px;white-space:nowrap;font-size:12px;color:var(--muted)}#pin-note.active{color:var(--blue);background:var(--accent-soft)}
.format-toolbar{display:flex;align-items:center;gap:4px;height:48px;padding:0 24px;border-bottom:1px solid var(--line);flex-shrink:0;overflow-x:auto;overflow-y:hidden}.format-toolbar>button{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:24px;height:24px;padding:0;border-radius:6px;color:var(--soft);font-size:15px;white-space:nowrap}.format-toolbar>button:hover{background:var(--hover);color:var(--ink)}.format-toolbar>button.active,.format-toolbar>button[aria-pressed="true"]{background:var(--accent-soft);color:var(--blue)}.format-toolbar svg{width:16px;height:16px}.toolbar-divider{flex:0 0 1px;height:16px;background:var(--line);margin:0 6px}.small-x{font-size:10px}
.color-picker{display:flex;align-items:center;gap:10px;flex-shrink:0;margin-left:auto;padding:0 6px}.color-dot{width:14px;height:14px;border:1px solid var(--input-border);border-radius:50%;flex-shrink:0}.color-dot.selected{outline:2px solid var(--blue);outline-offset:3px}.color-dot.neutral{background:var(--paper)}
.paper{flex:1;min-height:0;overflow-y:auto;background:var(--paper);margin:0;border:0;border-radius:0;padding:48px max(48px,calc((100% - 800px)/2));color:var(--ink)}
.paper[data-color="yellow"],.color-dot.yellow{background:#fff9e8}.paper[data-color="green"],.color-dot.green{background:#f0f7e3}.paper[data-color="blue"],.color-dot.blue{background:#f0f6fb}.paper[data-color="pink"],.color-dot.pink{background:#fcf1f1}body.dark .paper[data-color="yellow"]{background:#29271c}body.dark .paper[data-color="green"]{background:#20271c}body.dark .paper[data-color="blue"]{background:#1c232b}body.dark .paper[data-color="pink"]{background:#2b1f24}
.paper-topline{display:flex;justify-content:flex-end;color:var(--muted);font-size:12px;margin-bottom:16px}.note-title{display:block;width:100%;border:0;background:transparent;padding:0;margin:0 0 12px;font-size:34px;line-height:48px;font-weight:600;color:var(--ink)}.note-title:focus-visible{outline:none;box-shadow:0 1px 0 var(--accent-border)}.note-meta{display:flex;align-items:center;flex-wrap:wrap;gap:6px;color:var(--muted);font-size:12px;margin-bottom:32px}.note-meta svg{width:13px;height:13px}.meta-separator{margin:0 4px}.note-meta select{max-width:180px;border:0;background:transparent;color:var(--muted);font-size:12px;cursor:pointer}
#note-body{min-height:210px;color:var(--ink);font:16px/26px var(--font);overflow-wrap:anywhere;white-space:pre-wrap;outline:none}#note-body:empty::before,#note-body[data-empty="true"]::before{content:none}#note-body.ql-container{height:auto;border:0;font-family:var(--font)}#note-body .ql-editor{padding:0;min-height:210px;overflow:visible;font:16px/26px var(--font)}#note-body .ql-editor.ql-blank::before{left:0;right:0;color:var(--muted);font-style:normal}
#note-body p{margin:0 0 12px}#note-body h2{font-size:24px;font-weight:600;line-height:34px;margin:24px 0 12px}#note-body h3{font-size:20px;font-weight:600;line-height:30px;margin:20px 0 10px}#note-body li{margin-bottom:4px}#note-body blockquote{border-left:3px solid var(--input-border);padding:4px 16px;margin:16px 0;color:var(--soft);background:transparent}#note-body a{color:var(--blue);text-underline-offset:3px}
#note-body img{display:block;max-width:100%;height:auto;min-height:24px;margin:16px 0;border-radius:4px;cursor:pointer}#note-body img.selected-image{outline:2px solid var(--blue);outline-offset:4px}#note-body .todo{display:flex;align-items:flex-start;gap:10px;margin:8px 0;white-space:normal}#note-body .todo input{width:16px;height:16px;margin:5px 0 0;flex-shrink:0;cursor:pointer}#note-body .todo span{flex:1;min-width:0;white-space:pre-wrap}#note-body .todo input:checked+span,#note-body .ql-editor li[data-list="checked"]{text-decoration:line-through;color:var(--muted)}
#note-body .ql-editor li[data-list="checked"]>.ql-ui,#note-body .ql-editor li[data-list="unchecked"]>.ql-ui{cursor:pointer}#note-body .ql-editor .ql-ui[role="checkbox"]{width:1.5em;height:26px;transform:translateX(-100%);display:inline-block;color:var(--blue)}#note-body .ql-editor .ql-ui[role="checkbox"]::before{margin:0;width:100%;text-align:center}#note-body .ql-editor .ql-ui[role="checkbox"]:focus-visible{outline:2px solid var(--blue);outline-offset:1px;border-radius:3px}#note-body .ql-editor[contenteditable="false"] .ql-ui{pointer-events:none}
.note-tags{display:flex;align-items:center;gap:8px;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:16px;margin-top:32px;color:var(--muted)}.note-tags>svg{width:14px;height:14px}#current-tags{display:flex;flex-wrap:wrap;gap:6px}#current-tags button{font-size:12px;padding:3px 7px;border-radius:4px;background:var(--hover);color:var(--soft)}#current-tags button:hover{background:var(--accent-soft);color:var(--ink)}#add-tag{font-size:12px;color:var(--muted);padding:4px}
.editor-footer{display:flex;justify-content:space-between;gap:10px;padding:12px 24px;border-top:1px solid var(--line);color:var(--muted);font-size:11px;flex-shrink:0}.image-status,.legacy-warning{color:var(--muted);font-size:12px}.legacy-warning{margin:0 0 16px}
#trash-banner{display:flex;align-items:center;flex-wrap:wrap;gap:12px;padding:12px 24px;background:var(--accent-soft);font-size:13px}#trash-banner button{color:var(--blue)}.empty-editor{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px;text-align:center}.empty-mark{display:grid;place-items:center;width:48px;height:48px;margin-bottom:16px;color:var(--muted);font-size:32px}.empty-mark svg{width:36px;height:36px}.empty-editor h2{font-size:20px;font-weight:500;margin:0 0 12px}.empty-editor p{font-size:14px;color:var(--muted);margin:0 0 24px}.empty-editor>button{margin-bottom:8px}#back-list{display:inline-flex}
.primary{background:var(--action);color:#fff;border-radius:4px;min-height:36px;padding:0 20px;font-weight:500}.primary:hover{filter:brightness(1.15)}
.context-menu,.menu{z-index:30;width:200px;padding:4px;border:1px solid var(--line);border-radius:8px;background:var(--panel);box-shadow:var(--shadow)}.context-menu{position:fixed}.menu{position:absolute;right:0;top:40px}.context-menu button,.menu button{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:36px;padding:8px 12px;text-align:left;border-radius:4px;font-size:14px}.context-menu button:hover,.context-menu button:focus-visible,.menu button:hover{background:var(--hover)}.context-menu hr{border:0;border-top:1px solid var(--line);margin:4px 8px}.submenu-wrap{position:relative}#import-submenu{width:190px}.danger,.format-toolbar>button.danger,#privacy-error,#move-error,#account-error,#login-error{color:var(--danger)}
#image-context-menu{width:152px;max-width:calc(100vw - 16px)}
#image-context-menu button{padding:8px 10px;white-space:nowrap}
dialog{width:500px;max-width:calc(100vw - 32px);max-height:85dvh;overflow:auto;padding:24px;border:1px solid var(--line);border-radius:8px;background:var(--panel);color:var(--ink);box-shadow:var(--shadow)}dialog::backdrop{background:#0006}dialog h2{font-size:16px;font-weight:600;line-height:24px;margin:0 32px 16px 0}dialog p{font-size:14px;line-height:22px;color:var(--soft);white-space:pre-line;margin:12px 0}dialog label{display:block;font-size:13px;color:var(--soft);margin:16px 0 8px}dialog input:not([type="checkbox"]),dialog select{display:block;width:100%;height:36px;padding:0 12px;border:1px solid var(--input-border);border-radius:2px;background:var(--input-bg)}
.dialog-actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px;margin-top:24px}.dialog-actions>button{min-height:36px;padding:0 20px;border-radius:4px;font-size:14px}.dialog-actions>button:not(.primary){border:1px solid var(--input-border)}.dialog-actions>button:not(.primary):hover{background:var(--hover)}.dialog-close{position:absolute;right:16px;top:16px;font-size:22px}.account-dialog,.history-dialog{width:500px}
.account-links{display:flex;justify-content:space-between;margin-top:12px}.account-links button,.account-link{color:var(--blue);font-size:13px;padding:6px 0}.account-settings{display:grid;gap:8px}.account-settings button{display:flex;justify-content:space-between;text-align:left;padding:12px;border:1px solid var(--line);border-radius:4px;background:var(--bg)}.account-search{display:flex;align-items:center;gap:8px}.account-search input{flex:1;min-width:0}.account-search button,.account-row button{min-height:32px;padding:0 12px;border:1px solid var(--input-border);border-radius:4px}
.account-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border-bottom:1px solid var(--line)}.account-row strong{overflow-wrap:anywhere;font-weight:500}.account-row small{display:block;margin-top:4px;color:var(--muted)}.account-pagination{display:flex;align-items:center;justify-content:space-between;margin-top:16px;font-size:12px}.account-pagination button{min-height:32px;padding:4px}#recovery-value{font:12px monospace}dialog .recovery-saved{display:flex;align-items:center;gap:8px}dialog .recovery-saved input{width:16px;height:16px;margin:0}#ac-action{width:100%;min-height:36px;padding:8px 12px;border:1px solid var(--input-border);border-radius:4px;background:var(--paper)}.login-help{font-size:12px}
.history-row{display:flex;gap:12px;padding:12px 0;border-bottom:1px solid var(--line);font-size:13px}.history-row>button:first-child{flex:1;text-align:left;overflow-wrap:anywhere}.history-row>button:last-child{color:var(--blue);padding:6px}#history-preview{max-height:200px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;color:var(--soft);font:14px/22px var(--font)}#history-preview img{max-width:100%;height:auto}
#toast,#button-tooltip{position:fixed;z-index:40;background:#2e2e2e;color:#fff;border-radius:6px;box-shadow:var(--shadow);font-size:12px;line-height:18px;overflow-wrap:anywhere}#toast{bottom:24px;left:50%;transform:translateX(-50%);padding:10px 16px;max-width:calc(100vw - 32px)}#button-tooltip{max-width:min(260px,calc(100vw - 16px));padding:6px 10px;pointer-events:none}
@media(max-width:900px){#app{grid-template-columns:minmax(0,1fr);padding:8px}.note-panel,.editor-panel{grid-column:1}.sidebar{position:fixed;left:0;top:0;bottom:0;width:271px;z-index:20;transform:translateX(-100%);box-shadow:var(--shadow)}.sidebar.open{transform:translateX(0)}.sidebar-toggle{display:inline-flex}.list-header{padding:40px 32px 24px}.list-controls{padding:0 32px 16px}#note-list{padding:0 24px 16px}#list-batch-bar{margin:0 32px 6px}.paper{padding:32px}.breadcrumb{gap:6px}#breadcrumb-folder{max-width:100px}}
@media(max-width:620px){#app{padding:0}.note-panel,.editor-panel{border:0;border-radius:0}.editor-header{height:56px;padding:0 12px}.editor-actions{gap:2px}#save-state{font-size:10px}.breadcrumb>svg,.breadcrumb>.slash,.breadcrumb>span:last-child{display:none}#breadcrumb-folder{max-width:80px}.format-toolbar{padding:0 12px}.paper{padding:24px}.note-title{font-size:28px;line-height:40px}#note-body h2{font-size:21px;line-height:30px}#note-body h3{font-size:18px;line-height:28px}.paper-topline{margin-bottom:12px}.note-meta{margin-bottom:24px}.editor-footer{padding:10px 12px}.footer-shortcut{display:none}.list-header{padding:24px}.list-header h1{font-size:28px;line-height:40px}.list-controls{padding:0 24px 16px}#note-list{padding:0 16px 16px}#list-batch-bar{margin:0 24px 6px}dialog{padding:20px}.dialog-actions>button{padding:0 16px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}
/* Keep bottom actions visible even in short windows. */
html,body{height:100%;overflow:hidden}
.visually-hidden{top:0;left:0}
.sidebar{overflow:hidden}
.sidebar-navigation{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden}
.sidebar-navigation #folder-nav{min-height:0;max-height:none;overflow:visible}
.sidebar-navigation .tags-heading{margin-top:20px}
/* Pages live inside this app; they share its repository and editor. */
#app{grid-template-rows:48px minmax(0,1fr);padding-top:0}
.sidebar,.note-panel,.editor-panel{grid-row:2}
.app-tabbar{grid-column:1/-1;grid-row:1;display:flex;align-items:center;gap:8px;min-width:0;padding:6px 12px;border-bottom:1px solid var(--line);background:var(--sidebar)}
.app-tablist{display:flex;align-items:center;gap:8px;min-width:0;overflow-x:auto;scrollbar-width:none}
.app-tablist::-webkit-scrollbar{display:none}
.app-tab{display:flex;align-items:center;flex:0 0 210px;min-width:100px;height:34px;border:1px solid transparent;border-radius:8px;color:var(--muted)}
.app-tab.active{background:var(--panel);border-color:var(--line);color:var(--ink)}
.app-tab:not(.active):hover{background:var(--hover)}
.app-tab>button[role="tab"]{display:flex;align-items:center;gap:8px;flex:1;min-width:0;height:100%;padding:0 12px;text-align:left;border-radius:8px;font-size:14px}
.app-tab-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.app-tab-close{display:grid;place-items:center;width:28px;height:28px;flex-shrink:0;margin-right:6px;padding:0;border-radius:5px;color:var(--soft);line-height:0}
.app-tab-close svg{display:block;width:20px;height:20px;stroke-width:1.8}
.tree-toggle{display:flex;align-items:center;justify-content:center;align-self:center;width:16px;height:36px;flex:0 0 16px;padding:0;line-height:0}
.tree-toggle svg{display:block;width:14px;height:14px}
.app-tab-close:hover{background:var(--hover);color:var(--ink)}
#new-app-tab{flex-shrink:0}
#exit-focus{flex:0 0 auto;margin-left:auto;padding:6px 10px;border:1px solid var(--line);border-radius:8px;background:var(--panel);color:var(--ink);font-size:12px;white-space:nowrap}
#exit-focus:hover{background:var(--hover)}
@media(max-width:620px){#app{grid-template-rows:44px minmax(0,1fr)}.app-tabbar{padding:4px 8px}.app-tab{flex-basis:160px;height:32px}.note-panel,.editor-panel{height:auto;min-height:0}}
/* One shell grid: identity at left, page tabs above the workspace at right. */
:root{--sidebar-width:272px;--shell-header:48px;--content-inset:64px;--row-inset:12px}
#app{grid-template-columns:var(--sidebar-width) minmax(0,1fr);grid-template-rows:var(--shell-header) minmax(0,1fr);padding:0 8px 8px 0}
.sidebar{grid-column:1;grid-row:1/3;padding:0 12px 12px;min-width:0}
.brand{height:auto;min-height:104px;margin:0 8px 12px;gap:14px;padding:18px 0;color:var(--ink)}
.brand-icon{width:52px;height:52px;filter:drop-shadow(0 5px 9px #00000012)}
.brand-copy{display:flex;flex-direction:column;gap:5px;min-width:0}
.brand-name{font-family:"Noto Serif SC","Songti SC","STSong","Noto Serif CJK SC",serif;font-size:26px;font-weight:700;line-height:1.2;letter-spacing:1px;white-space:nowrap}
.brand small{display:block;color:var(--muted);font-size:12px;font-weight:400;line-height:1.5;letter-spacing:.5px;white-space:nowrap}
.sidebar-search{margin-bottom:16px;gap:10px}
.sidebar-navigation{display:flex;flex-direction:column;overflow:hidden}
.sidebar-navigation #main-nav{flex:0 0 auto}
.sidebar-navigation #folder-nav{flex:1;min-height:36px;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-gutter:stable;scrollbar-color:transparent transparent}
.sidebar-navigation #folder-nav:hover,.sidebar-navigation #folder-nav:has(:focus-visible){scrollbar-color:var(--muted) transparent}
.sidebar-navigation #folder-nav::-webkit-scrollbar{width:8px}
.sidebar-navigation #folder-nav::-webkit-scrollbar-track{background:transparent}
.sidebar-navigation #folder-nav::-webkit-scrollbar-thumb{background:transparent;border-radius:8px}
.sidebar-navigation #folder-nav:hover::-webkit-scrollbar-thumb,.sidebar-navigation #folder-nav:has(:focus-visible)::-webkit-scrollbar-thumb{background:var(--muted)}
.sidebar-navigation .tags-heading{flex:0 0 auto;margin:12px 0 8px}
.sidebar-navigation #tag-nav{flex:0 0 auto;max-height:60px;overflow-y:auto}
.nav-item{font-size:14px;min-height:36px;margin:0;gap:10px}
.sidebar-heading{margin:24px 0 10px;font-size:12px}
.tree-row .nav-item{font-size:14px;gap:8px}
.tree-row{min-height:36px}
.tree-note{padding-left:calc(20px + var(--depth,0)*16px)}
.tree-row:not(.tree-note){padding-left:calc(var(--depth,0)*16px)}
#folder-nav{padding-top:4px}
.sidebar-bottom{flex:0 0 auto;margin-top:12px;padding-top:8px}
.local-card{margin-top:4px;padding:6px 4px}
.sidebar-tools{margin-top:4px}
.app-tabbar{grid-column:2;grid-row:1;padding:6px 8px 6px 0;border-bottom:0;gap:8px}
.app-tablist{flex:0 1 auto}
.app-tab{flex-basis:180px;height:34px}
.note-panel,.editor-panel{grid-column:2;grid-row:2}
.list-header{padding:88px var(--content-inset) 24px;gap:16px}
.list-header>div:first-child{flex:1;min-width:0}
.list-header h1{font-size:32px;line-height:44px;gap:12px;align-items:baseline}
.list-header .list-controls{padding:0;min-height:32px;gap:16px;flex:0 0 auto}
#list-description:empty{display:none}
#list-description{max-width:120px}
#note-list{padding:0 calc(var(--content-inset) - var(--row-inset)) 24px}
.recent-columns{margin:0 calc(var(--content-inset) - var(--row-inset)) 4px;padding:0 calc(var(--row-inset) + var(--list-scrollbar,15px)) 0 var(--row-inset);min-height:32px}
.recent-columns,.recent-row{grid-template-columns:minmax(0,1fr) 156px 156px 32px;column-gap:24px}
.note-panel[data-list-layout="table"] .virtual-row{height:56px;padding:0}
.recent-row{padding:0 var(--row-inset);height:56px}
.recent-name{font-size:16px;gap:12px}
.recent-name>svg{width:20px;height:20px}
#list-batch-bar{margin:0 var(--content-inset) 12px}
.list-footer{padding:12px var(--content-inset)}
.editor-header,.format-toolbar,.editor-footer{padding-left:24px;padding-right:24px}
@media(max-width:1100px){:root{--content-inset:40px}.list-header{padding-top:56px}.recent-columns,.recent-row{grid-template-columns:minmax(0,1fr) 132px 132px 32px;column-gap:16px}}
@media(max-width:900px){:root{--content-inset:32px}#app{grid-template-columns:minmax(0,1fr);padding:0 8px 8px}.app-tabbar,.note-panel,.editor-panel{grid-column:1}.sidebar{top:0;bottom:0;width:var(--sidebar-width);padding:0 12px 12px}.list-header{padding-top:40px}.list-footer{padding-left:var(--content-inset);padding-right:var(--content-inset)}}
@media(max-width:620px){:root{--content-inset:24px;--shell-header:44px}#app{padding:0}.app-tabbar{padding:6px 8px}.app-tab{flex-basis:160px;height:32px}.list-header{padding-top:24px}.list-header h1{font-size:28px;line-height:40px}.recent-columns,.recent-row{grid-template-columns:minmax(0,1fr) 116px 28px;column-gap:8px}.recent-created,.recent-columns>span:nth-child(3){display:none}.recent-name{font-size:14px;gap:8px}.recent-updated{font-size:11px}.editor-header,.format-toolbar,.editor-footer{padding-left:12px;padding-right:12px}}
@media(max-width:620px){.list-header{flex-wrap:wrap;gap:12px}.list-header>div:first-child{order:0}.list-header>.sidebar-toggle{order:1}.list-header .list-controls{order:2;flex-basis:100%;justify-content:flex-end}}
@media(max-width:620px){.app-tabbar{padding-left:0}}
/* Quiet sidebar actions and persistent tab outlines. */
.all-notes-row{border-radius:6px}
.all-notes-row:hover,.all-notes-row:focus-within{background:var(--hover)}
.library-actions{display:flex;align-items:center;flex:0 0 56px;visibility:hidden;opacity:0;pointer-events:none}
.library-actions .icon-button{width:28px;height:32px}
.all-notes-row:hover .library-actions,.all-notes-row:has(:focus-visible) .library-actions,.library-actions:has([aria-expanded="true"][aria-haspopup="menu"]){visibility:visible;opacity:1;pointer-events:auto}
.all-notes-row:has(.nav-item.active){background:var(--accent-soft)}
.all-notes-row .nav-item.active{background:transparent}
.app-tab{border-color:var(--line);background:color-mix(in srgb,var(--panel) 45%,transparent)}
.app-tab.active{background:var(--panel)}
#folder-menu{width:184px;padding:6px 0}
#folder-menu button{width:calc(100% - 8px);margin:0 4px;padding:8px;gap:10px;min-height:34px;font-size:13px}
#folder-menu hr{margin:5px 0;border-top-color:color-mix(in srgb,var(--ink) 6%,transparent)}
.library-heading{width:100%;text-align:left;border-radius:4px}
.library-heading:hover{color:var(--ink)}
.breadcrumb-root{color:var(--muted);padding:4px 6px;margin-left:-6px;border-radius:4px;white-space:nowrap}
.breadcrumb-root:hover{background:var(--hover);color:var(--ink)}
@media(hover:none){.library-actions{visibility:visible;opacity:1;pointer-events:auto}}
/* Reference menus and a resizable sidebar with its scrollbar at the divider. */
#app{position:relative}
.sidebar{padding-right:0;border-right:0}
.brand,.sidebar-search,.sidebar-bottom{margin-right:12px}
.sidebar-navigation{display:block;overflow-y:auto;overflow-x:hidden;scrollbar-gutter:stable;scrollbar-width:auto;scrollbar-color:auto}
.sidebar-navigation #main-nav{padding-right:8px}
.sidebar-navigation #folder-nav{overflow:visible;min-height:0;scrollbar-gutter:auto;padding-right:6px}
.sidebar-navigation .tags-heading,.sidebar-navigation #tag-nav{margin-right:12px}
.sidebar-navigation::-webkit-scrollbar{width:10px}
.sidebar-navigation::-webkit-scrollbar-track{background:transparent}
.sidebar-navigation::-webkit-scrollbar-thumb{background:transparent;border-radius:10px}
.sidebar-navigation:hover::-webkit-scrollbar-thumb,.sidebar-navigation:has(:focus-visible)::-webkit-scrollbar-thumb{background:var(--muted)}
@supports not selector(::-webkit-scrollbar){.sidebar-navigation{scrollbar-width:thin;scrollbar-color:transparent transparent}.sidebar-navigation:hover,.sidebar-navigation:has(:focus-visible){scrollbar-color:var(--muted) transparent}}
.nav-section-row{display:flex;align-items:center;border-radius:6px;position:relative}
.nav-section-row:hover,.nav-section-row:has(:focus-visible){background:var(--hover)}
.nav-section-row>.nav-item:hover{background:transparent}
.all-notes-row{position:relative}
.sidebar-navigation #main-nav>.nav-item{position:relative;padding-right:72px}
.sidebar-navigation #main-nav .count{position:absolute;right:64px;top:50%;transform:translateY(-50%);margin:0;min-width:24px;text-align:right;font-weight:400;font-variant-numeric:tabular-nums;line-height:20px}
.nav-section-row>.nav-item,.all-notes-row>.nav-item{padding-right:36px}
.nav-section-row>.nav-item{flex:1;min-width:0}
.section-toggle{width:28px;height:32px;flex:0 0 28px;margin-left:28px;padding:0;color:var(--muted);visibility:hidden;pointer-events:none}
.nav-section-row:hover .section-toggle,.nav-section-row:has(:focus-visible) .section-toggle{visibility:visible;pointer-events:auto}
.nav-section-row:has(.active){background:var(--accent-soft)}
.nav-section-row .nav-item.active{background:transparent}
.shortcut-list{padding-left:24px}
.shortcut-item{width:100%;text-align:left}
.shortcut-item>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.shortcut-more{padding:6px 8px;color:var(--muted);font-size:12px}
.sidebar-bottom{border-top-color:color-mix(in srgb,var(--ink) 5%,transparent)}
#breadcrumb-folder{display:flex;align-items:center;gap:6px;min-width:0;max-width:none;overflow:hidden}
.breadcrumb-folder-link{padding:4px 6px;border-radius:4px;color:var(--muted);max-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.breadcrumb-folder-link:hover{color:var(--ink);background:var(--hover)}
.breadcrumb-folder-link:first-child{margin-left:0}
.tree-note.selected .nav-item>svg,.shortcut-item.selected>svg{color:#111}
.shortcut-item.selected{background:var(--accent-soft)}
body.dark .tree-note.selected .nav-item>svg,body.dark .shortcut-item.selected>svg{color:var(--ink)}
.tree-row .folder-manage{width:28px;height:32px;visibility:hidden;opacity:0;pointer-events:none}
.tree-row:hover .folder-manage,.tree-row:has(:focus-visible) .folder-manage,.tree-row:has([aria-expanded="true"][aria-haspopup="menu"]) .folder-manage{visibility:visible;opacity:1;pointer-events:auto}
#sidebar-resizer{position:absolute;left:calc(var(--sidebar-width) - 2px);top:var(--shell-header);bottom:8px;width:5px;cursor:col-resize;touch-action:none;z-index:25}
#sidebar-resizer::after{content:"";position:absolute;top:0;bottom:0;left:2px;width:1px;background:transparent}
#sidebar-resizer:hover::after,#sidebar-resizer:focus-visible::after,.sidebar-resizing #sidebar-resizer::after{background:var(--accent)}
.sidebar-resizing,.sidebar-resizing *{cursor:col-resize!important;user-select:none!important}
#create-menu,#import-submenu,#folder-menu{width:176px;padding:6px 0;border-radius:9px;border:1px solid color-mix(in srgb,var(--ink) 18%,transparent);box-shadow:0 8px 28px #00000012;color:var(--ink)}
#create-menu button,#import-submenu button,#folder-menu button{width:calc(100% - 12px);margin:0 6px;min-height:32px;padding:6px 8px;gap:10px;justify-content:flex-start;font-size:14px;line-height:20px;border-radius:6px;white-space:nowrap}
#create-menu button svg,#import-submenu button svg,#folder-menu button svg{width:16px;height:16px;stroke-width:1.5}
#create-menu button span,#import-submenu button span,#folder-menu button span{flex:1}
#create-menu button .submenu-chevron{width:14px;height:14px;margin-left:auto;color:var(--muted)}
#folder-menu hr{margin:6px 0;border-top-color:color-mix(in srgb,var(--ink) 6%,transparent)}
@media(hover:none){.tree-row .folder-manage,.section-toggle{visibility:visible;opacity:1;pointer-events:auto}}
@media(max-width:900px){#sidebar-resizer{display:none}.sidebar{padding-right:0}}
/* Shared row background; only the hovered action has a small square. */
.nav-section-row>.nav-item:hover,.all-notes-row>.nav-item:hover{background:transparent}
.tree-row:not(.tree-note):has(.nav-item.active){background:var(--accent-soft)}
.tree-row .nav-item:hover{background:transparent}
.library-actions .icon-button,.section-toggle,.tree-row .folder-manage{width:28px;height:28px;border-radius:5px;background:transparent;color:var(--soft);padding:0;font-size:20px;line-height:1}
.library-actions .icon-button:hover,.section-toggle:hover,.tree-row .folder-manage:hover{background:transparent;color:var(--ink)}
.tree-row .folder-manage[aria-expanded="true"]:not(:hover){background:transparent}
.library-actions svg,.section-toggle svg,.tree-toggle svg,.tree-row .folder-manage svg{width:20px;height:20px;stroke-width:1.8}

/* Counts are one size larger; form controls use the shared neutral palette. */
.sidebar .count{font-size:13px}
.list-header h1 #view-count{font-size:15px;line-height:1.2}
input[type="radio"],select{accent-color:var(--accent)}
.tree-row .folder-manage[data-manage]{font-weight:700}
.tree-toggle{width:20px;height:28px;flex-basis:20px}
#format-toolbar[hidden]{display:none!important}
#format-toolbar{height:auto;min-height:48px;flex-wrap:wrap;padding:8px 24px;overflow:visible}
#format-toolbar>button{min-width:30px}
#heading-select{font:12px var(--font);background:var(--panel);border:1px solid var(--line);border-radius:4px;padding:4px}
.editor-text-action{flex-shrink:0;font-size:12px;color:var(--soft);padding:5px 8px;border-radius:4px}
.editor-text-action:hover{background:var(--hover)}
#note-body h1{font-size:30px;line-height:1.4;margin:24px 0 16px}
#note-body h4{font-size:18px}#note-body h5{font-size:16px}#note-body h6{font-size:14px;color:var(--soft)}
#note-body table,#history-preview table{width:100%;border-collapse:collapse;margin:16px 0;table-layout:fixed}
#note-body td,#note-body th,#history-preview td,#history-preview th{border:1px solid var(--line);padding:8px;vertical-align:top;overflow-wrap:anywhere;min-width:40px}
#note-body td[data-table-header="true"],#note-body th,#history-preview th{font-weight:600;background:var(--hover)}
#note-body .ql-code-block-container,#history-preview pre{position:relative;background:var(--hover);border-radius:6px;padding:16px;font:13px/1.8 ui-monospace,monospace;white-space:pre;overflow-x:auto}
#note-body .ql-code-block{white-space:pre}
#note-body .ql-code-block[data-language]::before{content:attr(data-language);display:block;color:var(--muted);font-size:11px}
#note-body .ql-code-block[data-language]+.ql-code-block[data-language]::before{display:none}
#note-body code{font:0.9em ui-monospace,monospace;background:var(--hover);border-radius:3px;padding:2px 4px}
#note-body hr{border:0;border-top:1px solid var(--line);margin:24px 0}
#markdown-preview,#confirm-message{white-space:pre-wrap;overflow-wrap:anywhere;max-height:45vh;overflow:auto}
#markdown-preview{font:12px/1.8 ui-monospace,monospace;background:var(--hover);padding:16px}
.paper{width:100%;max-width:none;padding:32px 32px 24px}
#note-body,#note-body .ql-editor{width:100%;max-width:none;min-height:calc(100dvh - 330px)}
.breadcrumb{flex:1;min-width:0}
.breadcrumb-document{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink);max-width:240px}
.selection-toolbar{position:fixed;z-index:40;display:flex;align-items:center;gap:2px;max-width:calc(100vw - 16px);height:43px;padding:5px 7.5px 5px 7px;border:.5px solid color-mix(in srgb,var(--ink) 27%,transparent);border-radius:6px;background:var(--panel);color:var(--ink);box-shadow:0 3px 12px #0000001c;overflow-x:auto;overflow-y:hidden;scrollbar-width:none}
.selection-toolbar::-webkit-scrollbar{display:none}
.selection-toolbar button{position:relative;display:flex;align-items:center;justify-content:center;width:34px;height:32px;flex:0 0 34px;padding:0;border-radius:4px;cursor:pointer}
.selection-toolbar button:hover{background:var(--hover)}
.selection-toolbar button[aria-pressed=true]{background:var(--hover)}
.selection-toolbar svg{width:22px;height:22px;stroke-width:1.8}
.selection-toolbar .selection-divider{height:20px;width:1px;flex:0 0 1px;margin:0 4.5px;background:var(--line)}
.selection-toolbar .selection-divider:nth-of-type(2){margin:0 5px}
.selection-toolbar .reference-glyph{fill:currentColor;stroke:none}
.selection-toolbar .reference-precision{display:none;fill:currentColor;stroke:none}
@media(min-resolution:2dppx){.selection-toolbar .reference-glyph{display:none}.selection-toolbar .reference-precision{display:block}}
.selection-toolbar .marker-color{stroke:#a7aeb8;stroke-width:6}
.selection-toolbar .text-color{stroke:#c7161e;stroke-width:6}
.selection-panel{position:fixed;z-index:41;display:grid;gap:4px;padding:8px;min-width:148px;max-width:calc(100vw - 16px);max-height:calc(100vh - 16px);overflow:auto;border:1px solid var(--line);border-radius:6px;background:var(--panel);color:var(--ink);box-shadow:0 3px 12px #0000001c}
.selection-panel button{padding:7px 10px;text-align:left;border-radius:4px;cursor:pointer}
.selection-panel button:hover,.selection-panel button:focus-visible{background:var(--hover)}
.selection-panel input{min-width:0;max-width:100%;padding:6px;border:1px solid var(--line);border-radius:4px;background:var(--panel);color:var(--ink)}
.selection-panel form{display:grid;gap:6px;width:250px;max-width:calc(100vw - 34px)}
.selection-panel .selection-error{font-size:12px;color:#e32b2b;margin:0}
.selection-panel.topic-panel{display:flex;flex-direction:column;width:278px;min-width:0;max-height:min(390px,calc(100vh - 16px));gap:10px}
.topic-panel>strong,.topic-panel>input,.topic-panel>button{flex-shrink:0}
.topic-groups{min-height:0;overflow:auto}
.topic-panel strong{font-size:15px}
.topic-groups p{font-size:12px;color:var(--muted);margin:8px 0}
.topic-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:4px}
.topic-grid button{font-size:22px;text-align:center;padding:5px 0;height:36px}
.topic-grid .topic-number{font-size:15px;background:#3478db;color:white;border-radius:50%;width:28px;height:28px;padding:0;margin:4px}
.ql-editor [data-topic-icon]::before{content:attr(data-topic-icon);display:inline-block;margin-right:8px;font-family:system-ui,sans-serif;font-size:1em;vertical-align:baseline}
.ql-editor [data-topic-icon="1"]::before,.ql-editor [data-topic-icon="2"]::before,.ql-editor [data-topic-icon="3"]::before,.ql-editor [data-topic-icon="4"]::before,.ql-editor [data-topic-icon="5"]::before,.ql-editor [data-topic-icon="6"]::before,.ql-editor [data-topic-icon="7"]::before,.ql-editor [data-topic-icon="8"]::before,.ql-editor [data-topic-icon="9"]::before,.ql-editor [data-topic-icon="10"]::before{background:#3478db;color:#fff;border-radius:50%;width:1.5em;height:1.5em;line-height:1.5;text-align:center;font-size:.85em}
.selection-panel.color-panel,.selection-panel.heading-panel{display:flex;align-items:center;gap:6px;min-width:0;flex-wrap:nowrap}
.selection-panel.color-panel{height:43px;min-width:0;gap:12px;padding:9px 11.75px;border-width:.5px;overflow-x:auto;overflow-y:hidden;box-sizing:border-box;scrollbar-width:none}
.selection-panel.color-panel button{flex:0 0 24px;width:24px;height:24px;padding:0;text-align:center;border-radius:6px}
.selection-panel.color-panel .color-swatch{border:1px solid transparent}
.selection-panel.color-panel .color-swatch[aria-pressed=true]{border-color:#aeb0b6}
.selection-panel.color-panel .color-letter{font-size:22px;font-weight:400;line-height:24px;border:1px solid transparent}
.selection-panel.color-panel .color-letter[aria-pressed=true]{border-color:#aeb0b6;background:transparent}
.selection-panel.color-panel .clear-highlight{border:1px solid #d8dade;background:transparent;color:#cfd1d7}
.selection-panel.color-panel .clear-highlight svg{width:22px;height:22px;stroke-width:1;display:block}
.selection-panel.heading-panel button{font-size:20px;padding:5px 10px}
.selection-panel.link-panel{min-width:0;padding:6px}
.selection-panel.link-panel form{grid-template-columns:1fr 30px;align-items:center;width:320px}
.selection-panel.link-panel form button{border:1px solid var(--line);border-radius:50%;width:28px;height:28px;padding:0;text-align:center}
.selection-panel.link-panel .selection-error{grid-column:1/-1}
.selection-panel.link-panel .selection-error:empty{display:none}
.selection-panel.link-panel>button{font-size:12px}
#add-image-dialog{width:800px;max-width:calc(100vw - 32px);padding:26px 24px 20px;border-radius:18px}
#add-image-dialog .image-dialog-heading{display:flex;align-items:center;gap:16px;padding-right:24px;flex-wrap:wrap}
#add-image-dialog h2{margin:0;font-size:24px}
#add-image-dialog .image-original{display:flex;align-items:center;gap:10px;position:static;font-size:14px;background:var(--hover);border-radius:30px;padding:6px 10px;flex-direction:row-reverse}
#image-original{appearance:none;width:36px;height:22px;border:0;border-radius:20px;background:var(--muted);margin:0;position:relative;cursor:pointer;flex-shrink:0;padding:0}
#image-original:before{content:"";position:absolute;left:3px;top:3px;width:16px;height:16px;background:white;border-radius:50%;transition:transform .15s}
#image-original:checked{background:var(--action)}
#image-original:checked:before{transform:translateX(14px)}
#add-image-dialog .image-help{font-size:13px;color:var(--muted);margin:12px 0 24px}
#image-dropzone{border:1px dashed var(--input-border);border-radius:12px;min-height:170px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:12px;padding:24px;text-align:center}
#image-dropzone.dragging{background:var(--accent-soft);border-color:var(--accent)}
#image-choose{border-radius:40px;width:300px;max-width:100%;height:48px;background:var(--action);font-size:16px}
#image-dropzone small{font-size:13px;color:var(--muted)}
#image-view-dialog{width:max-content;max-width:calc(100vw - 32px);padding:44px 20px 20px}
#image-view-dialog img{display:block;max-width:calc(100vw - 80px);max-height:calc(100vh - 120px);object-fit:contain}
#history-backdrop{position:fixed;inset:0;z-index:80;background:color-mix(in srgb,var(--accent) 15%,transparent);backdrop-filter:blur(5px)}
#history-sidebar{position:fixed;inset:0 0 0 auto;z-index:81;width:360px;max-width:100vw;background:var(--panel);box-shadow:-8px 0 32px #163e2314;display:flex;flex-direction:column;animation:history-enter .18s ease-out}
#history-sidebar[hidden],#history-backdrop[hidden]{display:none}
#history-sidebar header{display:flex;align-items:center;justify-content:space-between;padding:22px 20px 0}
#history-sidebar h2{margin:0;font-size:20px;font-weight:650}
#history-close{background:var(--hover);border-radius:9px;color:var(--muted);font-size:24px}
#history-sidebar .history-help{margin:2px 20px 0;padding-bottom:20px;color:var(--muted);font-size:12px}
.history-scroll{flex:1;overflow:auto;border-top:1px solid var(--line);padding:20px}
#history-list{position:relative;padding-left:20px}
#history-list:before{content:"";position:absolute;left:5px;top:20px;bottom:40px;width:1px;background:var(--accent-soft)}
.history-version{position:relative;display:flex;flex-direction:column;gap:5px;text-align:left;padding:8px 6px 16px;width:100%;border-radius:8px;margin-bottom:6px}
.history-version:before{content:"";position:absolute;left:-20px;top:17px;width:10px;height:10px;border-radius:50%;background:var(--accent-border)}
.history-version.selected:before{background:var(--accent);box-shadow:0 0 0 4px var(--accent-soft)}
.history-version:hover{background:var(--hover)}
.history-time{font-size:14px;font-weight:600}
.history-time b{display:block;font-size:16px;color:var(--accent);margin-top:3px}
.history-version strong{font-size:13px;font-weight:400;color:var(--soft);overflow-wrap:anywhere}
.history-version small,#history-empty{font-size:12px;color:var(--muted)}
#history-sidebar footer{display:flex;gap:10px;padding:14px 20px;border-top:1px solid var(--line)}
#history-sidebar footer button{flex:1;height:40px;border-radius:9px;border:1px solid var(--input-border);color:var(--accent);font-weight:600}
#history-sidebar footer .primary{background:var(--action);color:white;border:0}
#history-sidebar #history-preview{max-height:none;overflow:visible;white-space:normal;border-top:1px solid var(--line);margin-top:10px}
.history-preview-section{padding:8px 0}
.history-preview-section h3{font-size:13px;color:var(--ink)}
.history-preview-section>div{padding:12px;background:var(--hover);border-radius:8px}
@keyframes history-enter{from{transform:translateX(100%)}to{transform:translateX(0)}}
@media(prefers-reduced-motion:reduce){#history-sidebar{animation:none}}
#image-choose{margin:0;padding:0 20px}
.image-help,#recent-images-empty{font-size:12px;color:var(--muted)}
#add-image-dialog h3{font-size:14px;margin:24px 0 12px}
#recent-images{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;max-height:210px;overflow:auto}
#recent-images button{height:74px;border:1px solid var(--line);border-radius:6px;padding:4px;cursor:pointer}
#recent-images img{width:100%;height:100%;object-fit:contain}
.capture-dialog{width:calc(100vw - 48px);max-width:1200px}
.capture-dialog h2{font-size:16px;margin-bottom:14px}
.capture-stage{position:relative;width:fit-content;max-width:100%;margin:auto;cursor:crosshair;touch-action:none;user-select:none}
.capture-stage img{display:block;max-width:100%;max-height:calc(100vh - 190px);object-fit:contain;pointer-events:none}
.capture-selection{position:absolute;border:2px solid #3478db;background:#3478db22;pointer-events:none}
.selection-panel.document-actions{display:flex;align-items:center;gap:2px;min-width:0;height:44px;padding:5px 6px;overflow:visible;border-color:color-mix(in srgb,var(--ink) 20%,transparent)}
.selection-panel.document-actions button{display:flex;align-items:center;justify-content:center;width:34px;height:32px;padding:0}
.selection-panel.document-actions svg{width:22px;height:22px;stroke-width:1.8}
.selection-panel.document-actions .danger{color:#ff002b}
.selection-toolbar button[aria-expanded=true]{background:var(--hover)}
/* Reference icons: tall bullet documents, rounded folders and outline actions. */
.sidebar .nav-item>svg{width:20px;height:20px;stroke-width:1.55}
.sidebar .encryption-badge{display:inline-flex;align-items:center;justify-content:center;flex:0 0 14px;width:14px;height:16px;color:var(--muted);pointer-events:none}
.sidebar .encryption-badge svg{display:block;width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}
#create-menu button>svg:not(.submenu-chevron),#import-submenu button>svg,#folder-menu button>svg{width:20px;height:20px;stroke-width:1.55}
#folder-menu .danger{color:#ff3030}
.library-actions,.section-toggle{margin-right:8px}
.sidebar-navigation #main-nav .count{right:72px}
.library-actions .icon-button:hover,.section-toggle:hover,.tree-row .folder-manage:hover{background:transparent;box-shadow:none}
/* Trash follows the same file table, with its own compact recovery menu. */
/* Reference sidebar rows retain a visible strip of the base background. */
.sidebar-navigation .nav-section-row,.sidebar-navigation .all-notes-row,.sidebar-navigation .tree-row{margin-bottom:3px}
.sidebar-navigation #folder-nav{padding-right:8px}
.note-panel[data-list-view="trash"] #sort,.note-panel[data-list-view="trash"] #list-description,.note-panel[data-list-view="trash"] #view-count,.note-panel[data-list-view="trash"] .list-footer{display:none}
.note-panel[data-list-view="trash"] .list-controls{margin-left:auto;padding:0}
#empty-trash{padding:4px 0;font-size:14px;line-height:20px;color:var(--accent)}
#empty-trash:hover{text-decoration:underline;text-underline-offset:3px}
.note-panel[data-list-view="trash"] .recent-more{width:24px;height:24px;border-radius:4px}
.note-panel[data-list-view="trash"] .recent-more svg{width:16px;height:16px;fill:currentColor;stroke:none}
.note-panel[data-list-view="trash"] .recent-name>svg{padding:2px;border:1px solid var(--line);border-radius:2px;background:var(--panel);box-shadow:0 1px 2px #0000000d}
#folder-menu.trash-menu{width:176px;padding:6px 0}
#folder-menu.trash-menu button{min-height:32px}
#folder-menu.trash-menu button>svg{width:16px;height:16px}
#list-batch-bar #restore-selected{margin-left:auto}
#list-batch-bar>button{padding:5px 8px;border-radius:4px;background:var(--panel)}
.sidebar-bottom>.nav-item{margin:0;min-height:40px}
#settings-dialog{width:400px;padding:24px;border-radius:12px}
#settings-dialog h2{font-size:18px;font-weight:600;margin:0 32px 16px 0}
#settings-dialog .dialog-close{position:absolute;right:16px;top:16px;width:28px;height:28px;padding:0;border-radius:6px;font-size:24px;line-height:28px;color:var(--muted)}
#settings-dialog .dialog-close:hover{background:var(--hover)}
.settings-options{display:flex;flex-direction:column;gap:4px}
.settings-options>button{display:flex;align-items:center;gap:12px;width:100%;min-height:44px;padding:10px 12px;margin:0;border-radius:6px;text-align:left;font-size:14px}
.settings-options>button:hover{background:var(--hover)}
.settings-options>button>svg{width:20px;height:20px}
.settings-options .sync-card{margin-bottom:8px;border-bottom:1px solid var(--line);border-radius:0;padding-bottom:16px}
.settings-options .sync-card>div{flex:1;min-width:0}
.settings-options .sync-card small{font-size:12px}
.settings-options .sync-card>svg{width:16px;height:16px;margin-left:auto}
@media(max-width:620px){.note-panel[data-list-view="trash"] .list-header{padding-bottom:24px}.note-panel[data-list-view="trash"] .list-controls{padding:0;flex-basis:auto;order:0}}
@media(max-width:620px){.paper{padding:24px 20px}.breadcrumb>.breadcrumb-document{display:block;max-width:120px}.editor-actions #save-state{display:none}}
.paper{padding-top:20px}
.paper-title-row{display:flex;align-items:center;gap:20px;margin-bottom:12px}
.paper-title-row .note-title{flex:1;min-width:0;margin:0}
.paper .note-meta{gap:6px;color:color-mix(in srgb,var(--accent) 42%,var(--muted));font-size:12px;line-height:1.9;margin-bottom:8px}
.paper .note-meta time,.paper .note-meta #note-sync-state{white-space:nowrap}
.paper .note-meta .meta-separator{margin:0 2px}
.note-location{margin-bottom:24px}
.note-location select{max-width:100%;border:0;background:transparent;color:var(--muted);font:12px var(--font);padding:0;cursor:pointer}
#note-sync-state[data-state="error"]{color:var(--danger)}
#note-body .todo input{width:18px;height:18px;margin-top:5px}
#note-body .ql-editor .ql-ui[role="checkbox"]{width:32px;height:28px;top:0;color:var(--accent)}
#note-body .ql-editor .ql-ui[role="checkbox"]::before{content:"";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);box-sizing:border-box;width:18px;height:18px;margin:0;border:1.5px solid currentColor;border-radius:3px;background:transparent}
#note-body .ql-editor li[data-list="checked"]>.ql-ui[role="checkbox"]::before{background:var(--accent)}
#note-body .ql-editor li[data-list="checked"]>.ql-ui[role="checkbox"]::after{content:"";position:absolute;left:50%;top:50%;width:5px;height:9px;border:solid var(--paper);border-width:0 1.5px 1.5px 0;transform:translate(-50%,-60%) rotate(45deg)}
#save-state.visually-hidden{display:block}
.app-tab-close:hover{background:color-mix(in srgb,var(--ink) 7%,var(--accent-soft));color:var(--ink)}
.settings-choice{border:0;border-top:1px solid var(--line);padding:14px 12px 8px;margin:12px 0 0;display:flex;gap:20px;flex-wrap:wrap}
.settings-choice legend{padding:0 6px;font-size:13px;color:var(--muted)}
.settings-choice label{display:flex;align-items:center;gap:6px;margin:0;cursor:pointer}
.settings-choice input[type="radio"]{width:15px;height:15px;padding:0;margin:0;accent-color:var(--accent)}
#diagnostic-content{white-space:pre-wrap;overflow-wrap:anywhere;max-height:45vh;overflow:auto;font:12px/1.8 var(--font);background:var(--bg);padding:12px;border-radius:6px}
.profile-avatar{display:block;width:72px;height:72px;object-fit:cover;border-radius:50%;margin:12px 0}
.profile-avatar-input{margin-bottom:16px}
body.compact .nav-item,body.compact .tree-row,body.compact .nav-section-row,body.compact .all-notes-row{min-height:30px;height:30px}
body.compact .shortcut-row{min-height:28px}
body.compact .recent-row,body.compact .trash-row{height:44px}
body.compact .note-panel .virtual-row{height:44px}
body.compact .settings-options>button{min-height:36px;padding-top:6px;padding-bottom:6px}
@media(max-width:620px){.paper-title-row{gap:12px}.paper-title-row .note-title{font-size:26px}.paper-title-row #note-date{font-size:11px}}
.account-access>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.login-dialog{width:420px;padding:28px;border-radius:16px;max-height:calc(100dvh - 32px)}
.login-brand{display:flex;align-items:center;gap:12px;margin-bottom:20px}
.login-brand img{flex:0 0 48px;object-fit:contain}
.login-brand>span{font-family:"Noto Serif SC","Songti SC","STSong",serif;font-size:22px;font-weight:700;letter-spacing:1px}
.login-brand small{display:block;font-family:var(--font);font-size:11px;font-weight:400;letter-spacing:.5px;color:var(--muted);margin-top:3px}
.login-dialog h2{font-size:24px;line-height:32px;margin:0 0 8px}
.login-dialog #login-description{font-size:13px;margin:0 0 16px}
.login-dialog label{margin:12px 0 6px}
.login-dialog input:not([type="checkbox"]){height:42px;border-radius:8px}
.login-dialog input:focus{outline:none;border-color:var(--blue);box-shadow:0 0 0 3px color-mix(in srgb,var(--blue) 12%,transparent)}
.login-dialog .dialog-actions{display:grid;grid-template-columns:minmax(0,1fr);justify-content:stretch;gap:8px;margin-top:20px}
.login-dialog .dialog-actions>button{height:42px;border-radius:8px}
.login-dialog .dialog-actions>#sync-close{border:0;color:var(--muted);height:32px}
.login-dialog .login-help{font-size:12px;line-height:18px;color:var(--muted);margin:10px 0}
#login-error:empty{display:none}
.login-server{margin-top:16px;padding-top:12px;border-top:1px solid var(--line)}
.login-server summary{cursor:pointer;font-size:12px;color:var(--soft)}
dialog .registration-choice{display:flex;align-items:center;gap:10px;padding:16px;border:1px solid var(--line);border-radius:8px;background:var(--bg)}
.registration-choice input{width:18px;height:18px;margin:0}
.auth-screen{position:fixed;inset:0;overflow:auto;display:flex;flex-direction:column;align-items:center;justify-content:safe center;padding:24px;background:var(--bg);z-index:50}
.auth-card{flex-shrink:0;width:min(100%,420px);max-height:none;padding:36px;background:var(--panel);border:1px solid var(--line);box-shadow:0 12px 44px rgba(30,40,60,.05)}
.auth-card .login-brand{margin-bottom:32px}
.auth-card h1{font-size:28px;line-height:1.3;letter-spacing:-.5px;margin:0 0 10px}
.auth-description{font-size:13px;color:var(--muted);line-height:1.7;margin:0 0 26px}
.auth-card label{display:block;font-size:13px;color:var(--soft)}
.auth-card input{width:100%;border:1px solid var(--line);background:var(--panel);color:var(--ink);padding:10px 12px;font:inherit}
.auth-card .account-links{margin-top:12px}
.auth-card #login-error{font-size:13px;color:var(--danger);line-height:1.6;margin-bottom:0}
.auth-footer{flex-shrink:0;margin-top:20px;font-size:11px;color:var(--muted);letter-spacing:2px}
#auth-status:empty{display:none}
@media(max-width:480px){.auth-screen{padding:24px 20px}.auth-card{padding:28px 24px}.auth-card .login-brand{margin-bottom:26px}}
.sidebar-bottom{padding-top:8px}
.account-bar{display:flex;align-items:center;gap:12px;min-height:76px;width:100%;padding:12px 8px;border-radius:10px;text-align:left}
.account-bar:hover,.account-bar[aria-expanded="true"]{background:var(--hover)}
.account-avatar{display:inline-flex;align-items:center;justify-content:center;flex:0 0 40px;width:40px;height:40px;border-radius:50%;background:var(--accent-soft);overflow:hidden;color:var(--soft)}
.account-avatar img,.account-summary-avatar img{width:100%;height:100%;object-fit:cover}
.account-avatar svg{width:22px;height:22px}
.account-bar-copy{display:flex;flex-direction:column;min-width:0;flex:1;gap:3px}
.account-bar-copy strong{font-size:15px;font-weight:600}
.account-bar-copy small{font-size:12px;color:var(--muted)}
.account-bar-copy strong,.account-bar-copy small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.account-bar-gear{width:20px;height:20px;color:var(--muted)}
.account-menu{position:fixed;width:264px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);overflow:auto;z-index:110;padding:8px;border:1px solid var(--line);border-radius:12px;background:var(--panel);box-shadow:0 8px 28px #0002}
.account-menu-heading{display:flex;align-items:center;gap:12px;padding:12px 10px 16px;margin-bottom:6px;border-bottom:1px solid var(--line)}
.account-menu-heading>div{flex:1;min-width:0}
.account-menu-heading strong,.account-menu-heading small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.account-menu-heading strong{font-size:16px;font-weight:600}
.account-menu-heading small{font-size:12px;color:var(--muted);margin-top:4px}
.account-menu>button{display:flex;align-items:center;gap:12px;width:100%;min-height:42px;padding:9px 10px;border-radius:6px;text-align:left;font-size:14px}
.account-menu>button:hover,.account-menu>button:focus-visible,.account-menu>button[aria-expanded="true"]{background:var(--hover)}
.account-menu>button>svg{width:19px;height:19px;stroke-width:1.5}
.account-menu>button>span:first-of-type{flex:1}
.account-menu>button>small{color:var(--muted);font-size:12px}
.account-menu .menu-chevron{width:14px;height:14px;margin-left:-8px;color:var(--muted)}
.account-menu-divider{height:1px;background:var(--line);margin:6px 10px}
.appearance-menu{width:188px}
.theme-choice{display:flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:50%;border:1px solid var(--input-border);flex:0 0 16px}
[aria-checked="true"]>.theme-choice{background:var(--accent);border-color:var(--accent);color:#fff}
[aria-checked="true"]>.theme-choice::after{content:"✓";font-size:12px}
.account-dialog.account-overview{width:780px}
.account-dialog h2{font-size:20px;line-height:28px}
.account-summary{display:flex;align-items:center;gap:16px;padding:16px 0}
.account-summary-avatar{display:flex;align-items:center;justify-content:center;flex:0 0 56px;width:56px;height:56px;border-radius:50%;overflow:hidden;background:var(--accent-soft);font-size:24px}
.account-summary>div{flex:1;min-width:0}
.account-summary h3{font-size:18px;margin:0;overflow-wrap:anywhere}
.account-summary p{margin:4px 0 0;font-size:13px;overflow-wrap:anywhere}
.account-summary>button,.account-table button{padding:6px 10px;border:1px solid var(--line);border-radius:6px;white-space:nowrap}
.account-summary>button:hover,.account-table button:hover{background:var(--hover)}
.account-user-menu{position:fixed;inset:auto;margin:0;width:144px;padding:5px;border:1px solid var(--line);border-radius:8px;background:var(--panel);color:var(--ink);box-shadow:var(--shadow)}
.account-user-menu button{display:block;width:100%;padding:9px 12px;border-radius:5px;text-align:left;font-size:13px}
.account-user-menu button:not(:disabled):hover,.account-user-menu button:focus-visible{background:var(--hover)}
.account-user-menu button.danger{color:var(--danger)}
.account-table button[aria-expanded="true"]{background:var(--hover)}
.account-facts{display:grid;grid-template-columns:1fr 1fr;gap:16px 24px;margin:8px 0 24px;padding:20px;background:var(--bg);border-radius:8px}
.account-facts dt{font-size:12px;color:var(--muted)}
.account-facts dd{font-size:14px;margin:4px 0 0;overflow-wrap:anywhere}
.account-actions{grid-template-columns:repeat(auto-fit,minmax(140px,1fr))}
.account-actions button{font-size:13px;gap:8px}
.account-admin-section{margin-top:28px;border-top:1px solid var(--line);padding-top:20px}
.account-admin-section h3{font-size:15px;margin:0 0 16px}
.account-table-wrap{overflow-x:auto;margin-top:16px}
.account-table{width:100%;border-collapse:collapse;font-size:12px;text-align:left}
.account-table th{font-weight:500;color:var(--muted);background:var(--bg);white-space:nowrap}
.account-table th,.account-table td{padding:10px;border-bottom:1px solid var(--line)}
.account-table td{white-space:nowrap}
.account-table td:first-child{white-space:normal;min-width:130px;overflow-wrap:anywhere}
.account-table strong{font-weight:500;font-size:13px}
.account-table small{display:block;color:var(--muted);margin-top:4px}
.profile-avatar{display:block;width:64px;height:64px;border-radius:50%;object-fit:cover;margin-top:18px}
dialog .profile-help{font-size:12px;line-height:1.7;color:var(--muted)}
#sync-dialog #connected-info{font-size:12px}
#sync-dialog #connected-panel>.account-link,#sync-dialog #connected-panel .danger{display:none}
#sync-dialog #connected-panel .dialog-actions{margin-top:12px}
.sync-login-form{margin-top:20px;padding-top:8px;border-top:1px solid var(--line)}
#sync-error,#backup-error{font-size:13px;color:var(--danger)}
#sync-error:empty,#backup-error:empty{display:none}
#backup-dialog{width:520px;border-radius:12px}
#backup-dialog h2{font-size:20px}
.backup-summary{display:flex;gap:12px;margin:20px 0}
.backup-summary>div{flex:1;display:flex;flex-direction:column;padding:14px;background:var(--bg);border-radius:8px}
.backup-summary strong{font-size:24px;font-weight:600}
.backup-summary span{font-size:12px;color:var(--muted);margin-top:4px}
.backup-formats{border:0;padding:0;margin:24px 0}
.backup-formats legend{font-size:13px;color:var(--soft)}
dialog .backup-formats label{display:flex;align-items:center;gap:12px;padding:14px;border:1px solid var(--line);border-radius:8px;margin:10px 0}
dialog .backup-formats input[type="radio"]{flex:0 0 16px;width:16px;height:16px;margin:0;padding:0;accent-color:var(--accent)}
.backup-formats small{display:block;color:var(--muted);font-size:12px;margin-top:4px}
@media(max-width:620px){.account-facts{gap:16px;padding:16px}.account-summary{gap:12px}.account-dialog.account-overview{padding:20px}.account-menu{width:252px}.appearance-menu{width:178px}}
/* Approved split login, compact trash confirmation and reference-sized menus. */
.auth-screen{display:grid;grid-template-columns:1fr 1fr;align-items:stretch;justify-content:normal;padding:0;background:var(--panel)}
.auth-form-side{display:grid;place-items:center;min-height:640px;padding:40px 24px}
.auth-card{width:min(384px,100%);max-height:none;border:0;box-shadow:none;border-radius:0;padding:0;background:transparent}
.auth-card .login-brand{margin-bottom:40px;gap:9px}
.auth-card .login-brand img{flex:0 0 30px;width:30px;height:30px}
.auth-card .login-brand>span{font-family:var(--font);font-size:21px;font-weight:600;letter-spacing:0}
.auth-card .login-brand small{display:none}
.auth-card .auth-description{font-size:14px;color:var(--soft);margin-bottom:28px}
.auth-card input{height:46px;border:1px solid var(--input-border);border-radius:9px;padding:0 12px}
.auth-card input:focus{border-color:var(--accent);outline:none;box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 12%,transparent)}
.auth-card .dialog-actions>#login-submit{height:46px;border-radius:10px;background:#343643;color:#fff}
.auth-card .login-server input{height:36px;font-size:12px}
.auth-illustration{display:flex;flex-direction:column;justify-content:space-between;min-height:640px;padding:30px 40px 36px;overflow:hidden;background:linear-gradient(145deg,#e8edf2,#eee7e6 55%,#e1eaf3);color:#303443}
.notes-art{position:relative;width:100%;flex:1;min-height:440px;max-width:650px;margin:0 auto}
.auth-illustration .art-note{position:absolute;border:1px solid #252a4014;border-radius:17px;padding:20px;box-shadow:0 10px 22px #23374c15;color:#303443}
.art-note h3{font-size:17px;line-height:1.35;margin:0 0 13px;font-weight:600}
.art-note p{font-size:14px;line-height:1.85;margin:0 0 13px}
.art-note small{display:inline-block;font-size:11px;padding:3px 8px;border-radius:12px;background:#ffffff70;color:#6c6574}
.auth-illustration .travel{left:5%;top:7%;width:42%;height:65%;background:#dcf6f3;transform:rotate(-6deg);overflow:hidden}
.sea{height:43%;margin:-20px -20px 20px;background:linear-gradient(172deg,#f4caa6 0 45%,#d9e7df 46% 52%,#92c4d5 53% 68%,#71adc1 69%);position:relative}
.sea span{position:absolute;right:18%;top:14%;color:#fff1d4;font-size:36px}
.auth-illustration .weekly{right:7%;top:3%;width:42%;background:#fff4c9;transform:rotate(5deg)}
.auth-illustration .groceries{left:32%;top:35%;width:43%;background:#ffe7e1;transform:rotate(1deg)}
.auth-illustration .reading{right:0;top:48%;width:38%;background:#f6e7fc;transform:rotate(-4deg)}
.reading blockquote{margin:0 0 15px;padding-left:10px;border-left:2px solid #eea193;font-size:14px;line-height:1.8;color:#7e698a}
.auth-illustration .thoughts{left:2%;bottom:1%;width:45%;background-color:#eef0f5;background-image:radial-gradient(#cbdbea 1.5px,transparent 1.5px);background-size:19px 19px;transform:rotate(7deg)}
.thoughts mark{background:#bfe9ec;color:inherit}
.art-copy h2{font-family:"Noto Serif SC","Songti SC","STSong",serif;font-size:29px;letter-spacing:1px;margin:30px 0 8px}
.art-copy p{color:#677388;font-size:14px;line-height:1.6;margin:0;max-width:370px}
body.dark .auth-illustration{background:linear-gradient(145deg,#222934,#302b30 55%,#26313b)}
body.dark .art-copy{color:#e5e8ed}body.dark .art-copy p{color:#afb9c8}
#confirm-dialog.compact-confirm{width:360px;padding:22px 24px;border:0;border-radius:12px;box-shadow:0 8px 32px #0002}
#confirm-dialog.compact-confirm h2{font-size:17px;line-height:24px;margin:0 0 12px}
#confirm-dialog.compact-confirm p{font-size:13px;line-height:1.6;margin:0;color:var(--soft)}
#confirm-dialog.compact-confirm .dialog-actions{gap:10px;margin-top:22px}
#confirm-dialog.compact-confirm .dialog-actions>button{font-size:13px;min-height:36px;border:0;border-radius:7px;padding:0 18px;background:var(--hover)}
#confirm-dialog.compact-confirm .dialog-actions>.primary{background:var(--danger);color:#fff}
#create-menu,#import-submenu{width:168px;border-radius:10px}
#create-menu button,#import-submenu button{height:32px;padding:0 8px;line-height:20px}
#create-menu button>svg:not(.submenu-chevron),#import-submenu button>svg{width:16px;height:16px;stroke-width:1.6}
#create-menu button .submenu-chevron{width:10px}
#import-submenu-toggle[aria-expanded="true"]{background:var(--hover)}
#import-submenu .import-format-icon{display:flex;align-items:center;justify-content:center;flex:0 0 14px;width:14px;height:14px;border-radius:3px;background:var(--ink);color:var(--panel);font-size:7px;font-weight:800}
@media(max-width:1100px){.auth-illustration{padding:20px 20px 30px}.auth-illustration .art-note{padding:13px;border-radius:12px}.art-note h3{font-size:13px;margin-bottom:8px}.art-note p,.reading blockquote{font-size:11px;line-height:1.9}.art-note small{font-size:9px;padding:2px 4px}.sea{margin:-13px -13px 13px}.art-copy h2{font-size:24px}.art-copy p{font-size:12px}}
@media(max-width:760px){.auth-screen{grid-template-columns:1fr}.auth-illustration{display:none}.auth-form-side{min-height:100dvh;padding:32px 24px}}
/* Shared UI standards: compact by default, two explicit content extensions. */
:root{--dialog-width:360px;--dialog-roomy-width:520px;--dialog-wide-width:720px;--menu-width:168px;--account-menu-width:240px;--dialog-radius:12px;--menu-radius:10px;--control-radius:7px;--control-height:36px;--menu-row-height:32px;--accent:#2e2e2e;--blue:#595959;--action:#2e2e2e}
body.dark{--accent:#d4d4d4;--blue:#b8b8b8;--action:#2e2e2e}
dialog,#input-dialog,#settings-dialog,#sync-dialog,#account-dialog,#confirm-dialog,#move-dialog,#privacy-dialog,#recovery-dialog{width:var(--dialog-width);padding:22px 24px;border-radius:var(--dialog-radius);max-width:calc(100vw - 32px)}
#history-dialog,#backup-dialog,#diagnostic-dialog{width:var(--dialog-roomy-width)}
#account-dialog.account-overview{width:var(--dialog-wide-width)}
dialog h2,#input-dialog h2,#settings-dialog h2,#backup-dialog h2,.account-dialog h2{font-size:17px;line-height:24px;margin:0 28px 18px 0;font-weight:600}
dialog input:not([type="checkbox"]):not([type="radio"]),dialog select{height:var(--control-height);border-radius:6px}
dialog .dialog-actions,#input-dialog .dialog-actions,#confirm-dialog.compact-confirm .dialog-actions{gap:10px;margin-top:22px}
dialog .dialog-actions>button,#input-dialog .dialog-actions>button,#confirm-dialog.compact-confirm .dialog-actions>button{min-height:var(--control-height);height:var(--control-height);padding:0 18px;border:0;border-radius:var(--control-radius);font-size:13px}
dialog .dialog-actions>button:not(.primary){background:var(--hover)}
dialog .dialog-actions>.primary,#input-dialog .dialog-actions>.primary{background:var(--action);color:#fff}
#confirm-dialog.compact-confirm .dialog-actions>.primary{background:var(--danger)}
.auth-card .dialog-actions>#login-submit{background:var(--action)}
.context-menu,.menu,#create-menu,#import-submenu,#folder-menu,#folder-menu.trash-menu,.appearance-menu{width:var(--menu-width);max-width:calc(100vw - 16px);padding:6px 0;border-radius:var(--menu-radius)}
.context-menu button,.menu button,#folder-menu button,#folder-menu.trash-menu button{min-height:var(--menu-row-height);height:var(--menu-row-height);padding:0 8px;margin:0 6px;width:calc(100% - 12px);font-size:14px;gap:10px;justify-content:flex-start}
#folder-menu button>svg,#folder-menu.trash-menu button>svg{width:16px;height:16px}
.account-menu{width:var(--account-menu-width);border-radius:var(--menu-radius)}
.account-menu>button{min-height:var(--menu-row-height);height:var(--menu-row-height);padding:0 10px;font-size:14px;gap:10px}
.account-menu>button>svg{width:16px;height:16px}
.appearance-menu{width:var(--menu-width)}
#list-description.search-description{max-width:none;color:var(--soft)}
.note-panel[data-list-view="trash"] #list-description.search-description{display:block}
/* One inset hover square for every action; keep the existing hit areas and glyphs. */
.library-actions .icon-button,.section-toggle,.tree-row .folder-manage,.recent-more{position:relative;isolation:isolate;box-shadow:none}
.library-actions .icon-button::before,.section-toggle::before,.tree-row .folder-manage::before,.recent-more::before{content:"";position:absolute;inset:4px;border-radius:5px;background:transparent;z-index:-1;pointer-events:none}
.library-actions .icon-button:hover::before,.library-actions .icon-button:focus-visible::before,.section-toggle:hover::before,.section-toggle:focus-visible::before,.tree-row .folder-manage:hover::before,.tree-row .folder-manage:focus-visible::before,.recent-more:hover::before,.recent-more:focus-visible::before{background:color-mix(in srgb,var(--ink) 7%,transparent)}
.recent-more:hover,.recent-more:focus-visible{background:transparent;box-shadow:none}
.all-notes-row .nav-item.active>svg{color:#111}
body.dark .all-notes-row .nav-item.active>svg{color:var(--ink)}
dialog input:not([type="checkbox"]):not([type="radio"]):focus,dialog select:focus,#input-dialog input:focus{outline:none;border-color:var(--soft);box-shadow:0 0 0 2px color-mix(in srgb,var(--ink) 10%,transparent)}
dialog p:empty{display:none}
#privacy-dialog label,#move-dialog label{margin:14px 0 6px}
#privacy-dialog p,#move-dialog p{font-size:13px}
/* The selection header shares both insets with the document checkbox column. */
#list-batch-bar{margin:0 calc(var(--content-inset) - var(--row-inset)) 12px;padding:8px var(--row-inset);min-height:40px;border-radius:6px}
#list-batch-bar label{gap:10px;margin:0}
#list-batch-bar input,.recent-row>input{width:16px;height:16px;margin:0}
.recent-row>input{left:var(--row-inset)}
.recent-row:has(>input) .recent-name{padding-left:26px}
/* Screenshot-style sort menu, three radio rows and two real view switches. */
#sort-control{position:relative;flex-shrink:0}
#sort-trigger{display:flex;align-items:center;gap:5px;height:30px;padding:0 6px;font-size:12px;border-radius:5px;color:var(--soft)}
#sort-trigger:hover,#sort-trigger[aria-expanded="true"]{background:var(--hover)}
#sort-trigger svg{width:14px;height:14px}
#sort-menu{position:absolute;right:0;top:calc(100% + 8px);z-index:35;width:var(--menu-width);max-width:calc(100vw - 16px);padding:6px 0;border:1px solid var(--line);border-radius:var(--menu-radius);background:var(--panel);box-shadow:var(--shadow);color:var(--ink)}
#sort-menu button{display:flex;align-items:center;justify-content:space-between;gap:6px;height:var(--menu-row-height);width:calc(100% - 12px);margin:0 6px;padding:0 8px;border-radius:5px;font-size:14px;white-space:nowrap;text-align:left}
#sort-menu button:hover,#sort-menu button:focus-visible{background:var(--hover)}
.sort-radio{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;border:1px solid var(--input-border);border-radius:50%;font-size:10px;line-height:1;flex-shrink:0}
#sort-menu [aria-checked="true"] .sort-radio{background:var(--action);border-color:var(--action);color:#fff}
.sort-divider{height:1px;background:var(--line);margin:6px 0}
.sort-switch{position:relative;width:24px;height:16px;background:var(--muted);border-radius:20px;flex-shrink:0}
.sort-switch::after{content:"";position:absolute;top:3px;left:3px;width:10px;height:10px;background:#fff;border-radius:50%}
#sort-menu [aria-checked="true"] .sort-switch{background:var(--action)}
#sort-menu [aria-checked="true"] .sort-switch::after{left:11px}
.note-panel[data-list-view="trash"] #sort-control{display:none}
.note-panel[data-fit-width="false"]{--content-inset:max(24px,calc((100% - 880px)/2))}
.note-panel[data-list-layout="grid"] .virtual-row{height:176px;padding:0}
.note-panel[data-list-layout="grid"] .recent-row{height:160px;grid-template-columns:minmax(0,1fr) 32px;grid-template-rows:1fr auto auto;column-gap:12px;row-gap:8px;padding:16px;border:1px solid var(--line);border-radius:8px;background:var(--panel)}
.note-panel[data-list-layout="grid"] .recent-row:hover,.note-panel[data-list-layout="grid"] .recent-row.marked{background:var(--hover)}
.note-panel[data-list-layout="grid"] .recent-name{grid-column:1;grid-row:1;align-self:start;height:auto;min-height:28px;font-size:16px}
.note-panel[data-list-layout="grid"] .recent-updated,.note-panel[data-list-layout="grid"] .recent-created{display:block;grid-column:1 / -1;text-align:left;font-size:11px}
.note-panel[data-list-layout="grid"] .recent-updated{grid-row:2}
.note-panel[data-list-layout="grid"] .recent-created{grid-row:3}
.note-panel[data-list-layout="grid"] .recent-updated::before{content:"编辑于 "}
.note-panel[data-list-layout="grid"] .recent-created::before{content:"创建于 "}
.note-panel[data-list-layout="grid"] .recent-more{grid-column:2;grid-row:1;align-self:start}
.note-panel[data-list-layout="grid"] .recent-row>input{left:16px;top:22px}
.note-panel[data-list-layout="grid"] .recent-row:has(>input) .recent-name{padding-left:26px}
.note-panel[data-list-layout="grid"] #list-batch-bar{padding-left:17px}
/* Keep title and last-edited text together, with actions centered on the row. */
.recent-row{grid-template-columns:minmax(0,1fr) 32px;grid-template-rows:22px 16px;align-content:center;column-gap:12px;row-gap:2px}
.recent-name{grid-column:1;grid-row:1;height:auto;align-self:center}
.recent-name .note-name-copy>span{line-height:22px}
.note-row-meta{grid-column:1;grid-row:2;font-size:11px;line-height:16px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-left:32px}
.recent-more{grid-column:2;grid-row:1 / -1;align-self:center;justify-self:center}
.recent-row>input{top:12px}
.recent-row:has(>input) .note-row-meta{padding-left:57px}
.note-panel[data-list-layout="grid"] .recent-row{grid-template-rows:auto auto;align-content:normal}
.note-panel[data-list-layout="grid"] .note-row-meta{display:block;grid-column:1 / -1;grid-row:2;text-align:left;padding-left:0}
.note-panel[data-list-layout="grid"] .recent-name{align-self:start}
/* Quill's theme loads later; these selectors prevent its default blue chrome. */
body .ql-snow .ql-picker.ql-expanded .ql-picker-label,body .ql-snow .ql-picker-label:hover,body .ql-snow .ql-picker-item:hover,body .ql-snow .ql-picker-item.ql-selected,body .ql-snow.ql-toolbar button:hover,body .ql-snow.ql-toolbar button.ql-active{color:var(--ink)}
body .ql-snow.ql-toolbar button:hover .ql-stroke,body .ql-snow.ql-toolbar button.ql-active .ql-stroke,body .ql-snow .ql-picker-label:hover .ql-stroke{stroke:var(--ink)}
body .ql-snow.ql-toolbar button:hover .ql-fill,body .ql-snow.ql-toolbar button.ql-active .ql-fill{fill:var(--ink)}
/* Fixed action columns are shared by every sidebar row, regardless of depth. */
.sidebar-navigation{display:flex;flex-direction:column;overflow-y:auto;overflow-x:hidden;scrollbar-gutter:stable}
.sidebar-navigation::-webkit-scrollbar{width:8px}
.sidebar-navigation #main-nav{padding-right:0}
.sidebar-navigation #folder-nav{flex:0 0 auto;overflow:visible;min-height:0;padding-right:0;scrollbar-gutter:auto}
.sidebar .nav-item{white-space:nowrap}
.nav-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sidebar-navigation .nav-section-row,.sidebar-navigation .all-notes-row{display:grid;grid-template-columns:minmax(0,1fr) 28px 28px;align-items:center;padding-right:8px}
.nav-section-row>.nav-item,.all-notes-row>.nav-item{padding:6px 8px}
.sidebar-navigation #main-nav .count{position:static;transform:none;min-width:24px;margin-left:auto;flex-shrink:0}
.section-toggle{grid-column:3;margin:0}
.library-actions{grid-column:2 / 4;display:grid;grid-template-columns:28px 28px;margin:0}
.sidebar-navigation .tree-row{display:grid;grid-template-columns:min(calc(28px + var(--depth,0)*16px),max(28px,calc(100% - 144px))) minmax(0,1fr) 28px 28px;align-items:center;padding:0 8px 0 0}
.tree-row .tree-toggle{grid-column:1;justify-self:end;width:28px;height:28px;display:flex;align-items:center;justify-content:center}
.tree-row:not(.tree-note) .nav-item{grid-column:2;padding:6px 4px}
.tree-row .folder-manage[data-folder-new]{grid-column:3}
.tree-row .folder-manage[data-manage]{grid-column:4}
.tree-note .nav-item{grid-column:1 / 3;padding:6px 4px 6px min(calc(32px + var(--depth,0)*16px),max(32px,calc(100% - 88px)))}
.library-actions .icon-button,.section-toggle,.tree-row .folder-manage{width:28px;height:28px}
.library-actions svg,.section-toggle svg,.tree-toggle svg,.tree-row .folder-manage svg{width:20px;height:20px;stroke-width:1.8}
/* 青蔓: final theme overrides follow every legacy layout rule. */
:root{
  --bg:#f3f8f6;--sidebar:#f3f8f6;--panel:#fff;--paper:#fff;--editor-bg:#fff;
  --ink:#293731;--soft:#52655d;--muted:#5d7064;
  --line:#dfe9e3;--hover:#eaf2ed;--accent:#26715a;--blue:#26715a;
  --accent-soft:#e0efe6;--accent-border:#bdd8c8;--action:#26715a;
  --input-bg:#fff;--input-border:#cad9d0;--shadow:0 4px 16px #193c2812;
}
body.dark{
  --bg:#141d19;--sidebar:#141d19;--panel:#1c2721;--paper:#1a231e;--editor-bg:#1a231e;
  --ink:#e2ebe5;--soft:#b2c3b8;--muted:#8ea698;
  --line:#314238;--hover:#293a30;--accent:#85c6a4;--blue:#85c6a4;
  --accent-soft:#2b4336;--accent-border:#42634f;--action:#326f52;
  --input-bg:#19231d;--input-border:#42604e;--shadow:0 4px 16px #0003;
}
.brand-name{font-family:var(--font);font-size:23px;font-weight:600;letter-spacing:.5px;color:var(--accent)}
.brand-copy small{color:var(--soft);letter-spacing:.4px}
.auth-card .login-brand>span{display:flex;flex-direction:column;color:var(--accent);line-height:1.35}
.auth-card .login-brand small{display:block;margin-top:3px;color:var(--soft);font-size:12px;font-weight:400;letter-spacing:.4px}
.auth-card .dialog-actions>#login-submit{background:var(--action)}
.auth-illustration{background:#eef7ef;color:var(--ink)}
.auth-illustration .art-note{color:var(--ink);border-color:#cfdfd3;box-shadow:0 8px 20px #234d3410}
.auth-illustration .travel{background:#e1f4e5}
.auth-illustration .sea{background:linear-gradient(172deg,#c7efa0 0 45%,#f2fbdf 46% 52%,#91dca8 53% 68%,#61bf91 69%)}
.auth-illustration .sea span{color:#faffdf}
.auth-illustration .weekly{background:#fcfff4}
.auth-illustration .groceries{background:#eef8df}
.auth-illustration .reading{background:#e3f3e9}
.auth-illustration .thoughts{background:#f8fcf5}
.art-note small{background:#ffffff90;color:#526b5b}
.reading blockquote{border-color:#96bca5;color:#526b5b}
.thoughts mark{background:#d4edb8}
.art-copy h2{font-family:var(--font);font-size:28px;font-weight:500;letter-spacing:.5px}
.art-copy p{color:var(--soft)}
body.dark .auth-illustration{background:#1c2b21}
body.dark .auth-illustration .art-note{background:#273c2e;border-color:#3d5544}
body.dark .auth-illustration .sea{background:linear-gradient(172deg,#527c42 0 45%,#b2c99a 46% 52%,#447d5e 53% 68%,#306449 69%)}
body.dark .auth-illustration .sea span{color:#e7f3cc}
body.dark .art-note small{background:#334c3b;color:#bed0c3}
body.dark .reading blockquote{border-color:#699a7d;color:#bed0c3}
body.dark .thoughts mark{background:#3a5f47}
body.dark .art-copy{color:var(--ink)}
body.dark .art-copy p{color:var(--soft)}
body.dark button.primary{background:var(--action);color:#fff}
@media(max-width:1100px){.art-copy h2{font-size:24px}}
.auth-illustration.auth-window{position:relative;isolation:isolate;justify-content:flex-end;background:#ecf8f0}
.login-window-art{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center;z-index:0}
.auth-window::after{content:"";position:absolute;inset:50% 0 0;background:linear-gradient(transparent,#f0faf2 95%);pointer-events:none;z-index:1}
.auth-window .art-copy{position:relative;z-index:2}
body.dark .auth-illustration.auth-window{background:#1c2b21}
body.dark .login-window-art{filter:brightness(.62)}
body.dark .auth-window::after{background:linear-gradient(transparent,#1c2b21 95%)}
.auth-card .login-brand{margin-bottom:12px}
.auth-card .login-brand img{flex-basis:44px;width:44px;height:44px}
.auth-card .login-brand-heading{display:flex;flex-direction:column}
.auth-card .login-brand h1{font-family:var(--font);font-weight:600;font-size:24px;line-height:1.3;letter-spacing:.5px;margin:0;color:var(--accent)}
.auth-card .auth-description{margin-bottom:24px}
.login-password-field{position:relative}
.auth-card .login-password-field input{padding-right:48px}
#login-password-toggle{position:absolute;right:4px;top:0;width:40px;height:42px;display:grid;place-items:center;border:0;border-radius:8px;background:transparent;color:var(--soft)}
#login-password-toggle:hover{color:var(--accent);background:var(--hover)}
#login-password-toggle:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
#login-password-toggle svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.auth-card .account-links{display:flex;justify-content:flex-end;gap:20px}
.sidebar-account{display:flex;align-items:center;gap:4px;flex:0 0 auto;margin:12px 12px 20px 0;padding:8px 0 16px;border-bottom:1px solid var(--line)}
.sidebar-account .account-bar{flex:1;min-width:0;width:auto;min-height:64px;padding:8px}
.sidebar-account .account-bar-copy small:empty{display:none}
.sidebar-account>.icon-button{width:36px;height:36px;margin-right:4px;color:var(--soft)}
#about-dialog{width:360px;max-width:calc(100vw - 32px);padding:40px 28px 32px;text-align:center}
#about-dialog .about-icon{display:block;margin:0 auto 18px;object-fit:contain}
#about-dialog h2{margin:0;color:var(--accent);font-size:24px;font-weight:600;letter-spacing:.5px}
#about-dialog .about-english{margin:4px 0 24px;color:var(--soft);font-size:12px;letter-spacing:.5px}
#about-dialog .about-tagline{margin:0;font-size:16px}
#about-dialog .about-description{margin:8px 0 28px;font-size:13px;color:var(--muted)}
#about-dialog .about-version{margin:0;color:var(--muted);font-size:12px}
/* Nature and paper are styles; each supports light, dark and system appearance. */
body[data-theme-style="forest"]{--bg:#f0f5f2;--sidebar:#eff6f2;--paper:#fdfefd;--panel:#fdfefd;--editor-bg:#fdfefd;--ink:#283c33;--soft:#536b5e;--muted:#7a8e81;--line:#3159441b;--accent:#3e755b;--blue:#3e755b;--action:#3e755b;--accent-soft:#d7e8dc;--accent-border:#b4cdbc;--input-bg:#ffffffad;--input-border:#b9c9be;--hover:#4974580c}
body.dark[data-theme-style="forest"]{--bg:#192622;--sidebar:#1e3029;--paper:#202e28;--panel:#26372e;--editor-bg:#202e28;--ink:#deeadf;--soft:#b6cdbd;--muted:#8fa897;--line:#d7eadd19;--accent:#a2c6a8;--blue:#a2c6a8;--action:#406b51;--accent-soft:#344e3d;--accent-border:#51715b;--input-bg:#263a30;--input-border:#496251;--hover:#bfd8c50b}
body[data-theme-style="paper"]{--bg:#f4f2ed;--sidebar:#f1efe9;--paper:#fffefa;--panel:#fffefa;--editor-bg:#fffefa;--ink:#373a37;--soft:#626761;--muted:#92978f;--accent:#586953;--blue:#586953;--action:#586953;--accent-soft:#e6e9df;--input-bg:#fffefa}
body.dark[data-theme-style="paper"]{--bg:#1e201f;--sidebar:#242724;--paper:#292c29;--panel:#2b2e2b;--editor-bg:#292c29;--ink:#e0e3dd;--soft:#bfc5bb;--muted:#959f90;--accent:#bacbb0;--blue:#bacbb0;--action:#52624a;--accent-soft:#394035;--input-bg:#252924}
.sidebar{position:relative;isolation:isolate;background:var(--sidebar);overflow:hidden}
body[data-theme-style="forest"] .sidebar{background:linear-gradient(164deg,#f0f7ed 0%,#e4efe6 48%,#cbdfd1 100%)}
body.dark[data-theme-style="forest"] .sidebar{background:linear-gradient(164deg,#2d4232 0%,#23382b 48%,#152b22 100%)}
.sidebar-account,.sidebar-search,.sidebar-navigation{position:relative;z-index:1}
body[data-theme-style="forest"] .sidebar-navigation{padding-bottom:0;margin-bottom:140px}
.sidebar-landscape{position:absolute;bottom:0;left:0;right:0;height:210px;pointer-events:none;z-index:0;overflow:hidden;--mountain-far:#a9c3b5;--mountain-mid:#7ba292;--mountain-near:#5f8876;--forest-back:#527966;--forest-front:#355e4c;opacity:.75}
body.dark .sidebar-landscape{--mountain-far:#476653;--mountain-mid:#365844;--mountain-near:#294e3d;--forest-back:#234934;--forest-front:#183b2d;opacity:.95}
body[data-theme-style="paper"] .sidebar-landscape{display:none}
.sidebar-landscape>span{position:absolute;display:block}
.landscape-sun{width:32px;height:32px;right:25%;top:27px;border-radius:50%;background:#f4f4d9;box-shadow:0 0 40px #f8f8da50;opacity:.65}
body.dark .landscape-sun{background:#cdd8b8;opacity:.55}
.mountain{inset:0;bottom:-1px;clip-path:polygon(0 68%,14% 48%,25% 60%,44% 19%,57% 40%,69% 30%,83% 52%,100% 38%,100% 100%,0 100%);background:var(--mountain-far)}
.mountain-middle{top:34px;background:var(--mountain-mid);clip-path:polygon(0 48%,14% 59%,30% 34%,47% 64%,66% 45%,81% 61%,100% 30%,100% 100%,0 100%)}
.mountain-near{top:80px;background:var(--mountain-near);clip-path:polygon(0 43%,17% 62%,32% 70%,48% 51%,66% 70%,80% 55%,100% 74%,100% 100%,0 100%)}
.forest{left:0;right:0;bottom:-1px;height:90px;background:var(--forest-back);clip-path:polygon(0 50%,4% 28%,8% 54%,12% 6%,17% 62%,23% 35%,28% 70%,34% 18%,40% 67%,47% 38%,53% 79%,60% 31%,65% 64%,73% 15%,80% 68%,86% 40%,91% 59%,96% 20%,100% 52%,100% 100%,0 100%)}
.forest-front{height:58px;left:-18px;right:-22px;background:var(--forest-front)}
/* Settings keeps the permanent application navigation as its first column. */
.settings-open .note-panel,.settings-open .editor-panel{display:none}
#settings-dialog{position:relative;inset:auto;grid-column:2;grid-row:2;align-self:stretch;justify-self:stretch;margin:0;max-height:none;max-width:none;width:auto;height:100%;padding:0;border:1px solid var(--line);border-radius:12px;background:var(--paper);color:var(--ink);box-shadow:none;overflow:hidden}
#settings-dialog[open]{display:grid;grid-template-columns:200px minmax(0,1fr)}
.settings-nav{display:flex;flex-direction:column;gap:6px;padding:34px 16px 20px;background:color-mix(in srgb,var(--sidebar) 45%,var(--paper));border-right:1px solid var(--line);min-height:0;overflow-y:auto}
#settings-dialog .settings-nav h2{font-size:20px;line-height:30px;margin:0 12px 28px}
.settings-nav button{display:flex;align-items:center;gap:10px;flex-shrink:0;text-align:left;min-height:42px;padding:10px 12px;border-radius:8px;color:var(--soft);font-size:13px}
.settings-nav button:hover{background:var(--hover)}
.settings-nav button[aria-current="true"]{background:var(--accent-soft);color:var(--accent);font-weight:600}
.settings-nav .settings-return{margin-top:auto;padding-top:18px}
.settings-content{position:relative;overflow:auto;min-width:0;min-height:0;padding:48px clamp(24px,5vw,76px) 40px;scrollbar-gutter:stable}
.settings-page-heading{position:relative;margin-bottom:40px}
.settings-page-heading p{font-size:12px;letter-spacing:1px;color:var(--muted);margin:0 0 8px}
.settings-page-heading h1{font-size:30px;line-height:42px;font-weight:600;margin:0}
.settings-section{padding:0 0 32px;margin:0 0 32px;border-bottom:1px solid var(--line);scroll-margin-top:28px}
.settings-section:last-child{margin-bottom:0;border:0}
.settings-section h3{font-size:18px;font-weight:600;margin:0 0 8px}
.settings-section>p{color:var(--muted);font-size:13px;margin:0 0 24px}
.settings-profile-card{display:flex;align-items:center;gap:18px;padding:20px;border:1px solid var(--line);border-radius:12px;background:var(--panel)}
.settings-profile-card .account-avatar{width:56px;height:56px;flex-basis:56px}
.settings-profile-card>div{flex:1;min-width:0}
.settings-profile-card strong,.settings-about-brand strong{display:block;font-size:16px;font-weight:600;overflow-wrap:anywhere}
.settings-profile-card small,.settings-about-brand small{display:block;color:var(--muted);font-size:12px;margin-top:4px;overflow-wrap:anywhere}
#settings-dialog .settings-button{display:inline-flex;align-items:center;gap:8px;justify-content:center;padding:8px 14px;border:1px solid var(--line);border-radius:7px;font-size:13px;white-space:nowrap;background:var(--input-bg)}
.settings-button:hover{border-color:var(--accent)!important}
.theme-style-choice{border:0;padding:0;margin:0 0 24px}
.theme-style-choice legend{font-size:13px;margin-bottom:14px;color:var(--soft)}
.theme-style-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.theme-style-card{position:relative;display:block!important;cursor:pointer;border:1px solid var(--line);padding:10px;border-radius:12px;margin:0!important;background:var(--panel)}
.theme-style-card:has(input:checked){border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}
.theme-style-card:focus-within{outline:2px solid var(--accent);outline-offset:3px}
.theme-style-card>input{position:absolute;opacity:0;width:1px;height:1px}
.theme-style-card strong{display:flex;justify-content:space-between;font-size:14px;font-weight:600;margin:12px 4px 4px}
.theme-style-card small{display:block;font-size:11px;color:var(--muted);margin:0 4px 6px}
.theme-selected{color:var(--accent);visibility:hidden}
.theme-style-card:has(input:checked) .theme-selected{visibility:visible}
.theme-preview{display:flex;height:126px;border-radius:6px;overflow:hidden;background:#fafdf9;border:1px solid #53694b15}
.preview-sidebar{position:relative;display:block;width:30%;background:linear-gradient(#eaf2e5,#c2d9c8);padding:16px 8px;overflow:hidden}
.theme-preview i{display:block;height:4px;margin:0 0 10px;border-radius:3px;background:#607b6b25;max-width:80%}
.preview-sidebar i:first-child{height:10px;width:10px;border-radius:50%;background:#6d987c}
.preview-sidebar i:nth-child(2){max-width:90%;background:#74988060}
.preview-content{flex:1;padding:22px 14px}
.preview-content i:first-child{height:7px;width:44%;margin-bottom:20px}
.preview-content i:last-child{max-width:60%}
.preview-mountains{position:absolute;inset:45px 0 0;background:#769d89;clip-path:polygon(0 70%,28% 29%,48% 57%,70% 10%,100% 63%,100% 100%,0 100%)}
.preview-mountains::after{content:"";position:absolute;inset:30px 0 0;background:#476f57;clip-path:polygon(0 50%,18% 30%,37% 74%,70% 38%,100% 70%,100% 100%,0 100%)}
.preview-paper{background:#fffdf7}
.preview-paper .preview-sidebar{background:#ecebe4}
body.dark .preview-forest{background:#26372e}
body.dark .preview-forest .preview-sidebar{background:linear-gradient(#394e39,#223d2b)}
body.dark .preview-forest .preview-mountains{background:#496d50}
body.dark .preview-paper{background:#30332e}
body.dark .preview-paper .preview-sidebar{background:#272b26}
body.dark .theme-preview i{background:#aec4a733}
body.dark .preview-sidebar i:first-child{background:#8ca387}
#settings-dialog .settings-choice{border:0;padding:0;margin:0;gap:24px}
#settings-dialog .settings-choice legend{padding:0;margin:0 0 14px;color:var(--soft)}
#settings-dialog .settings-hint{margin:14px 0 0;font-size:12px}
#settings-dialog .settings-options{display:grid;gap:4px}
#settings-dialog .settings-options>button{display:flex;align-items:center;gap:12px;padding:12px;border:1px solid transparent;border-radius:8px;width:100%;margin:0;min-height:44px;text-align:left}
#settings-dialog .settings-options>button:hover{background:var(--hover);border-color:var(--line)}
#settings-dialog #sync-detail{max-width:none}
.settings-about-brand{display:flex;align-items:center;gap:14px;margin:24px 0 16px}
@media(max-width:1100px){#settings-dialog[open]{grid-template-columns:170px minmax(0,1fr)}.settings-content{padding-left:28px;padding-right:28px}.settings-nav{padding-left:10px;padding-right:10px}}
@media(max-width:900px){.sidebar{position:fixed}#settings-dialog{grid-column:1}.settings-page-heading .sidebar-toggle{position:absolute;right:0;top:10px;display:flex}.settings-nav{padding-top:24px}.settings-content{padding-top:28px}}
@media(max-width:620px){#settings-dialog[open]{grid-template-columns:1fr;grid-template-rows:auto minmax(0,1fr);border-radius:0}.settings-nav{flex-direction:row;gap:4px;padding:10px 12px;border-right:0;border-bottom:1px solid var(--line);overflow-x:auto}.settings-nav h2{display:none}.settings-nav button{padding:8px 10px;min-height:36px;font-size:12px;white-space:nowrap}.settings-nav button svg{display:none}.settings-nav .settings-return{margin:0;padding:8px 10px}.settings-content{padding:24px 20px}.settings-page-heading{margin-bottom:28px}.settings-profile-card{flex-wrap:wrap;padding:16px;gap:12px}.settings-profile-card>.settings-button{margin-left:68px}.theme-style-grid{gap:12px}.theme-preview{height:105px}.theme-style-card small{font-size:10px}body[data-theme-style="forest"] .sidebar-navigation{margin-bottom:100px}.sidebar-landscape{height:180px}}
/* Keep the approved landscape in its own flex row, below the scrollable library. */
body[data-theme-style="forest"] .sidebar{background:linear-gradient(165deg,#f6fbf8 0%,#eef8f4 36%,#deeeea 78%,#d4e9e4 100%)}
body.dark[data-theme-style="forest"] .sidebar{background:linear-gradient(165deg,#21362d 0%,#293f34 48%,#344e40 100%)}
body[data-theme-style="forest"] .sidebar-navigation{margin-bottom:0;padding-bottom:8px;flex:1 1 0;min-height:0}
/* Short windows still need room for the last row and the trash control. */
@media(max-height:620px){body[data-theme-style="forest"] .sidebar-navigation{padding-bottom:8px}}
.sidebar-landscape{position:relative;inset:auto;width:calc(100% + 24px);height:min(240px,32dvh);flex:0 0 min(240px,32dvh);margin:0 -12px -12px;opacity:1;color:#80aea0}
body.dark .sidebar-landscape{opacity:1;color:#698e73}
.sidebar-landscape>svg{display:block;width:100%;height:100%;stroke:none;fill:none}
.preview-scene{position:absolute;bottom:0;left:0;width:100%;height:75px;color:#80aea0;stroke:none}
body.dark .preview-scene{color:#698e73}
#trash-nav{flex:0 0 auto;margin-top:16px;font-size:13px}
.settings-content{padding-top:36px}
#settings-mobile-nav{position:absolute;right:18px;top:16px;z-index:2}
/* Embedded panels share the settings content scroll area, without a backdrop. */
#settings-dialog dialog.settings-inline{position:relative;inset:auto;margin:24px 0 0;padding:24px 0 0;width:100%;max-width:none;max-height:none;height:auto;border:0;border-top:1px solid var(--line);border-radius:0;box-shadow:none;background:transparent;color:var(--ink);overflow:visible}
#settings-dialog dialog.settings-inline[open]{display:block}
#settings-dialog dialog.settings-inline::backdrop{background:transparent}
#settings-dialog .settings-inline h2{font-size:16px;margin-bottom:14px}
#settings-dialog .settings-inline>p{font-size:13px;color:var(--soft)}
#settings-dialog .settings-inline .dialog-close{top:16px;right:0}
#settings-dialog .settings-inline input:not([type=checkbox]):not([type=radio]):not([type=file]),#settings-dialog .settings-inline select{max-width:560px;background:var(--input-bg);border:1px solid var(--input-border);border-radius:7px}
#settings-dialog .settings-inline label{color:var(--soft)}
#settings-dialog .settings-inline .dialog-actions{justify-content:flex-start}
#settings-dialog .settings-inline .account-summary{margin-top:16px}
#settings-dialog #sync-dialog>.login-brand,#settings-dialog #sync-dialog #account-settings,#settings-dialog #sync-dialog #logout{display:none}
#settings-dialog #diagnostic-content{white-space:pre-wrap;overflow-wrap:anywhere;max-height:none;padding:16px;background:var(--hover);border-radius:8px;font-size:12px}
#settings-dialog #account-dialog.account-overview{width:100%;padding-left:0;padding-right:0}
#settings-dialog .settings-inline .account-table-wrap{max-width:100%;overflow-x:auto}
@media(max-width:620px){.settings-content{padding-top:24px}#settings-mobile-nav{right:12px;top:16px}.settings-section:first-of-type>h3{padding-right:36px}}
/* 拾青：素纸与青瓷色的登录页。 */
.auth-screen{--auth-field-bg:#f8f7f2;--auth-field-ink:#28392f;grid-template-columns:48% 52%;background:var(--auth-field-bg);color:var(--auth-field-ink)}
.auth-form-side{min-height:100dvh;padding:48px 40px}
.auth-card{width:min(400px,100%);color:inherit}
.login-brand-row{display:flex;align-items:center;gap:16px;margin-bottom:22px}
.auth-card .login-brand{gap:13px;margin:0}
.auth-card .login-brand img{width:56px;height:56px;flex-basis:56px;border-radius:13px}
.auth-card .login-brand-heading h1{font-family:"Noto Serif SC","Songti SC","STSong",serif;font-size:28px;font-weight:500;letter-spacing:4px;color:#2d6550;margin:0;line-height:1.35}
.auth-card .login-brand-heading>span{display:block;margin-top:4px;font-family:Georgia,serif;font-size:12px;letter-spacing:2px;color:#7b8f83}
#login-server-switch{display:flex;align-items:center;justify-content:center;gap:8px;width:fit-content;max-width:100%;margin:0 auto;padding:7px 10px;border:0;border-radius:6px;background:transparent;color:#82988a;font-size:12px;cursor:pointer;list-style:none}
#login-server-switch::-webkit-details-marker{display:none}
#login-server-switch::after{content:none}
.login-server[open] #login-server-switch svg{transform:rotate(180deg)}
#login-server-switch:hover{color:#356b52}
#login-server-host{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#login-server-switch svg{width:18px;height:18px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.8;transition:transform .22s ease}
.server-indicator{width:7px;height:7px;flex-shrink:0;border-radius:50%;background:#d89538;box-shadow:0 0 0 3px #d8953819}
.auth-kicker{display:flex;align-items:center;gap:10px;margin:0 0 16px;font-size:12px;letter-spacing:2px;color:#82968a}
.auth-kicker::before{content:"";width:20px;height:1px;background:#8ca694}
.auth-card h1{font-family:"Noto Serif SC","Songti SC","STSong",serif;font-size:32px;font-weight:500;letter-spacing:2px;line-height:1.4;margin:0 0 9px}
.auth-card .auth-description{font-size:14px;line-height:1.9;color:#7b8f83;margin:0 0 32px}
.auth-card label{font-size:14px;color:#465b4f;margin:22px 0 5px}
.auth-card input:not([type="checkbox"]){height:46px;padding:0 2px;border:0;border-bottom:1px solid #c9d4c9;border-radius:0;background:transparent;color:inherit}
.auth-card input::placeholder{color:#99aaa0}
.auth-card input:focus{border-color:#3b785c;box-shadow:0 2px 0 #3b785c;outline:none}
.auth-card .login-password-field input{padding-right:44px}
#login-password-toggle{height:46px;border-radius:4px;color:#6e8074}
.auth-card .account-links{justify-content:space-between;margin-top:18px;gap:16px}
.auth-card .account-links button{font-size:13px;color:#356b52}
.auth-card .account-links #account-register{color:#82988a}
.auth-card .login-server{margin-top:16px;padding:0;border:0}
.login-server-body{margin-top:12px;padding:16px;border:1px solid #d9e1d9;border-radius:12px;background:#ffffff60}
.login-server-heading{display:flex;align-items:baseline;justify-content:space-between;gap:8px;flex-wrap:wrap;margin-bottom:10px}
.auth-card .login-server-heading label{margin:0;font-size:12px;font-weight:600}
.login-server-heading small{font-size:10px;color:#82988a}
.login-server-connect{display:flex;gap:8px;align-items:stretch}
.auth-card .login-server-connect input{min-width:0;height:38px;padding:0 10px;border:1px solid #c9d4c9;border-radius:7px;background:#ffffff70;font-size:12px}
#login-server-test{flex-shrink:0;padding:0 12px;border:1px solid #bfd1c5;border-radius:7px;background:#eaf3ec;color:#356b52;font-size:12px;font-weight:600}
#login-server-test:hover{background:#dcece1}
#login-server-test:disabled{opacity:.65;cursor:wait}
#login-server-test-status{padding-top:10px;color:#356b52}
#login-server-test-status.failed{color:#a24b3d}
.login-server-body .login-help{margin:0;font-size:11px;line-height:1.7}
.login-server-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:10px 0 0}
.login-server-footer>div{display:flex;gap:14px;flex-shrink:0}
.login-server-footer small{color:#82988a;font-size:11px}
#login-server-default{padding:2px 0;background:transparent;border:0;font-size:11px;color:#356b52}
#login-server-collapse{display:flex;align-items:center;gap:3px;padding:2px 0;background:transparent;border:0;font-size:11px;color:#356b52}
#login-server-collapse svg{width:13px;height:13px}
.auth-card .login-server summary{color:#82988a}
.auth-card .dialog-actions{margin-top:24px}
.auth-card .dialog-actions>#login-submit{height:48px;border:0;border-radius:10px;background:linear-gradient(110deg,#306b51,#244e3d);color:#fff;box-shadow:0 9px 20px #244e3d20;letter-spacing:6px;font-size:15px}
#login-submit span{margin-left:8px;letter-spacing:0;font-size:22px;font-weight:400}
.auth-illustration.auth-literary{position:relative;isolation:isolate;min-height:calc(100dvh - 32px);margin:16px 16px 16px 0;padding:44px;justify-content:flex-end;border:1px solid #c4ded1;border-radius:28px;overflow:hidden;background:radial-gradient(ellipse at 27% 18%,#eff8f0aa,transparent 65%),linear-gradient(145deg,#e4f2e9,#cbe7da);color:#304c3d}
.auth-literary::before{content:"";position:absolute;inset:14px;border:1px solid #8eb5a02c;border-radius:18px;pointer-events:none}
.auth-literary::after{content:"";position:absolute;inset:0;z-index:-1;opacity:.1;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath filter='url(%23n)' opacity='.3' d='M0 0h160v160H0z'/%3E%3C/svg%3E");pointer-events:none}
.literary-poem{position:absolute;right:48px;top:48px;display:flex;flex-direction:row-reverse;gap:20px;color:#6f9680;font-family:"Noto Serif SC","Songti SC","STSong",serif}
.literary-poem>span{writing-mode:vertical-rl;line-height:1.9;letter-spacing:4px;font-size:13px}
.literary-poem i{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;width:28px;height:48px;padding:4px;border:1px solid #a64d3e;border-radius:3px 2px 4px 2px;background:#b64c3b;color:#fff0da;font-family:"Noto Serif SC","Songti SC","STSong",serif;font-size:15px;font-style:normal;line-height:1.15;box-shadow:inset 0 0 0 2px #e9b59a77,0 2px 4px #764b3715;transform:rotate(-2deg)}
.literary-still-life{position:absolute;left:50%;top:46%;transform:translate(-50%,-50%);width:min(90%,660px);height:auto;overflow:visible;stroke:none}
.auth-literary .art-copy{position:relative;max-width:100%;z-index:1}
.auth-literary .art-kicker{display:flex;align-items:center;gap:12px;font-family:"Georgia","Noto Serif SC","Songti SC","STSong",serif;font-style:italic;font-size:11px;letter-spacing:1px;color:#5c8e73;margin:0 0 12px}
.art-kicker span{height:1px;width:84px;flex:0 1 84px;background:#90b09b}
.auth-literary .art-copy h2{font-family:"Noto Serif SC","Songti SC","STSong",serif;font-size:30px;font-weight:500;letter-spacing:2px;line-height:1.5;margin:0 0 12px}
.auth-literary .art-copy>p:last-child{color:#698171;font-size:14px;line-height:1.9;margin:0}
body.dark .auth-screen{--auth-field-bg:#202b25;--auth-field-ink:#dfebe0}
body.dark .auth-card .login-brand-heading h1{color:#abd0b6}
body.dark #login-server-switch,body.dark .login-server-footer small,body.dark .login-brand-heading>span{background:transparent;color:#9db5a4}
body.dark .login-server-body{background:#26382e;border-color:#445c4b}
body.dark #login-server-default{color:#bad6c3}
body.dark #login-server-collapse,body.dark #login-server-test-status{color:#bad6c3}
body.dark .login-server-heading small{color:#9db5a4}
body.dark .auth-card .login-server-connect input{background:#203027;border-color:#496251}
body.dark #login-server-test{background:#344e3d;border-color:#51715b;color:#deeadf}
body.dark #login-server-test-status.failed{color:#e1a89b}
body.dark .auth-card label{color:#c5d7c9}
body.dark .auth-card input{border-bottom-color:#536959}
body.dark .auth-card input:focus{border-color:#a3c8ae;box-shadow:0 2px 0 #a3c8ae}
body.dark .auth-card .auth-description,body.dark .auth-kicker,body.dark .auth-card .account-links #account-register{color:#9db5a4}
body.dark .auth-card .account-links button{color:#bad6c3}
body.dark .auth-card .login-server{border-color:#445b4a}
body.dark .auth-illustration.auth-literary{background:radial-gradient(ellipse at 25% 15%,#45654b55,transparent 65%),linear-gradient(145deg,#2b4435,#345441);border-color:#4a6955;color:#e0ecdf}
body.dark .auth-literary .art-copy>p:last-child,body.dark .auth-literary .art-kicker,body.dark .literary-poem{color:#a3bea8}
@media(max-width:1100px){.auth-form-side{padding:36px 30px}.auth-illustration.auth-literary{padding:34px}.literary-poem{right:34px;top:34px}.auth-literary .art-copy h2{font-size:27px}.auth-literary .art-copy>p:last-child{font-size:12px}.login-brand-row{gap:10px}}
@media(max-height:700px) and (min-width:761px){.auth-form-side{padding-top:28px;padding-bottom:28px}.login-brand-row{margin-bottom:18px}.auth-card .auth-description{margin-bottom:20px}.auth-card label{margin-top:16px}.auth-literary .art-copy h2{font-size:26px}.literary-still-life{width:min(82%,500px);top:42%}.literary-poem{top:28px}.auth-illustration.auth-literary{padding-bottom:30px}}
@media(max-height:620px) and (min-width:761px){.literary-still-life{width:min(68%,420px);top:40%}.literary-poem>span{font-size:11px;letter-spacing:2px}}
@media(max-width:760px){.auth-screen{grid-template-columns:1fr}.auth-form-side{padding:36px 24px;min-height:100dvh}.auth-illustration.auth-literary{display:none}.login-brand-row{margin-bottom:22px}}
@media(prefers-reduced-motion:no-preference){.auth-literary .literary-still-life{animation:leana-entrance .8s ease-out both}@keyframes leana-entrance{from{opacity:0;transform:translate(-50%,calc(-50% + 10px))}to{opacity:1;transform:translate(-50%,-50%)}}}
/* Fixed mountains; scroll distance reveals mist without moving the landscape. */
.sidebar{--mist-level:0;--mist-color:243,248,245}
body.dark .sidebar{--mist-color:41,63,52}
.sidebar-landscape>svg{position:absolute;inset:0;pointer-events:none;background:none;clip-path:none}
.sidebar-landscape .mountain-pines{opacity:calc(1 - var(--mist-level,0)*.88);filter:blur(calc(var(--mist-level,0)*2.8px))}
.sidebar-landscape .mountain-near{opacity:calc(1 - var(--mist-level,0)*.80);filter:blur(calc(var(--mist-level,0)*2.2px))}
.sidebar-landscape .mountain-far{opacity:calc(1 - var(--mist-level,0)*.25)}
.sb-mist-veil{position:absolute;inset:0;pointer-events:none;background:linear-gradient(180deg,transparent 0%,rgba(var(--mist-color),.95) 75%);opacity:calc(var(--mist-level,0)*.92)}
.sb-mist-veil::before{content:"";position:absolute;inset:32% -20% 0;pointer-events:none;background:radial-gradient(ellipse at 35% 65%,rgba(var(--mist-color),.3),transparent 64%);opacity:.2}
@media(prefers-reduced-motion:no-preference){.sb-mist-veil::before{animation:sidebar-mist-drift 18s ease-in-out infinite alternate}@keyframes sidebar-mist-drift{from{transform:translateX(-3%)}to{transform:translateX(3%)}}}
/* Use the user's exact sky and mountain pixels, including the source cloud bands. */
body[data-theme-style="forest"] .sidebar{background:#eef5f1 url("./sidebar-sky.png?v=2026.11.24-mountainReference1") no-repeat top left;background-size:100% 100%}
.sidebar-landscape{height:min(180px,24dvh);flex-basis:min(180px,24dvh)}
body.dark[data-theme-style="forest"] .sidebar{background:linear-gradient(165deg,#21362d 0%,#293f34 48%,#344e40 100%)}
body.dark .sidebar-landscape .mountain-far,body.dark .preview-scene{filter:brightness(.52) saturate(.72)}
body.dark .sidebar-landscape .mountain-near{filter:brightness(.52) saturate(.72) blur(calc(var(--mist-level,0)*2.2px))}
body.dark .sidebar-landscape .mountain-pines{filter:brightness(.52) saturate(.72) blur(calc(var(--mist-level,0)*2.8px))}
/* Screenshot revision: one quiet account surface, no reserved landscape row. */
.sidebar{isolation:isolate}
.sidebar-landscape{position:absolute;inset:auto 0 0;width:100%;height:min(180px,24dvh);margin:0;flex:none;z-index:0;pointer-events:none;mask-image:linear-gradient(to bottom,transparent,#000 38%);-webkit-mask-image:linear-gradient(to bottom,transparent,#000 38%)}
body[data-theme-style="forest"] .sidebar-navigation{margin-bottom:0;padding-bottom:8px;flex:1 1 0}
.sidebar-account{margin:12px 12px 18px 0;padding:4px;border:0;border-radius:12px;background:transparent}
.sidebar-account .account-bar,.sidebar-account>.icon-button{background:transparent;border:0;box-shadow:none}
.sidebar-account .account-bar{min-height:60px}
.sidebar-account>.icon-button{width:24px;height:24px;margin:0 4px 0 0;color:var(--muted)}
.sidebar-account>.icon-button:hover{background:transparent;color:var(--ink)}
.sidebar-account>.icon-button svg{transition:transform .4s cubic-bezier(.34,1.56,.64,1)}
.sidebar-account>.icon-button:hover svg{transform:rotate(60deg)}
.sidebar-account .account-avatar{background:linear-gradient(135deg,#4c8a63 0%,#8ec5a3 100%);color:#fff}
.sidebar-account .account-initial{font-size:17px;font-weight:600;line-height:1}
.sidebar-account .account-bar-copy small[data-state]::before{content:"";display:inline-block;width:6px;height:6px;margin:0 5px 1px 0;border-radius:50%;background:var(--muted)}
.sidebar-account .account-bar-copy small[data-state="synced"]::before{background:#29bd86}
.sidebar-account .account-bar-copy small[data-state="pending"]::before{background:#d7ae52}
.sidebar-account .account-bar-copy small[data-state="error"]::before{background:var(--danger)}
@media(prefers-reduced-motion:reduce){.sidebar-account>.icon-button svg{transition:none}.sidebar-account>.icon-button:hover svg{transform:none}}
.account-avatar{position:relative;flex-shrink:0}
.account-avatar img,.account-avatar svg{position:absolute;inset:0;margin:auto}
.account-avatar img[hidden],.account-avatar svg[hidden]{display:none!important}
.account-avatar img{border-radius:50%}
#settings-dialog,.settings-nav{border:0}
.app-header,.app-tabbar,.app-topbar{border:0}
.app-tab.active{border-color:transparent}
.note-panel,.editor-panel{border:0}
#sidebar-resizer::after,#sidebar-resizer:hover::after{background:transparent}
.settings-section{padding-bottom:40px;margin-bottom:40px;border-bottom:1px solid var(--line)}
.settings-section:last-child{padding-bottom:0;margin-bottom:0;border:0}
#settings-dialog dialog.settings-inline{border:0;padding-top:0;margin-top:20px}
#settings-section-profile:has(.profile-editor[open])>.settings-profile-card,#settings-section-profile:has(.profile-editor[open])>p{display:none}
#settings-dialog .profile-editor>#account-title,#settings-dialog .profile-editor>#account-description,#settings-dialog .profile-editor>#account-close{display:none}
#settings-section-security:has(#account-dialog[open])>h3,#settings-section-security:has(#account-dialog[open])>p,#settings-section-security:has(#account-dialog[open])>.settings-options{display:none}
#settings-section-security>#account-dialog{margin-top:0}
.profile-edit-card{border:1px solid var(--line);border-radius:18px;background:var(--panel);overflow:hidden;box-shadow:0 2px 3px #00000005}
.profile-upload-row{display:flex;align-items:center;gap:24px;padding:24px}
.profile-avatar-shell{position:relative;display:grid;place-items:center;width:100px;height:100px;flex:0 0 100px;border:5px solid var(--panel);outline:1px solid var(--line);border-radius:50%;background:linear-gradient(135deg,#4c8a63 0%,#8ec5a3 100%);color:#fff;font-size:38px;font-weight:600;overflow:hidden}
.profile-avatar-shell .profile-avatar{position:absolute;inset:0;margin:0;width:100%;height:100%;border:0;border-radius:50%;object-fit:cover}
.profile-fields{display:grid;grid-template-columns:1fr 1fr;gap:24px;padding:20px 24px 24px;border-top:1px solid var(--line)}
#settings-dialog .profile-fields label{margin:0 0 10px;font-weight:600;color:var(--ink)}
#settings-dialog .profile-fields input{height:46px;width:100%;max-width:none}
.profile-help{font-size:12px;color:var(--soft);line-height:1.7;margin:10px 0 0}
#profile-remove{font-size:12px;color:var(--soft);padding:4px 0}
.transfer-card{position:relative;display:flex;align-items:center;justify-content:space-between;gap:24px;margin-top:18px;padding:22px 24px;background:var(--panel);border:1px solid var(--line);border-radius:14px}
.transfer-card h4{font-size:16px;margin:0 0 6px}
.transfer-card p{font-size:13px;color:var(--soft);margin:0}
.export-dropdown{position:relative;flex-shrink:0}
.export-dropdown summary{cursor:pointer;list-style:none}
.export-dropdown summary::-webkit-details-marker{display:none}
.export-dropdown[open]{z-index:3}
.export-dropdown>div{position:absolute;right:0;top:calc(100% + 8px);width:250px;padding:6px;border:1px solid var(--line);background:var(--panel);border-radius:12px;box-shadow:var(--shadow)}
.export-dropdown button{display:block;width:100%;padding:10px 12px;border-radius:8px;text-align:left}
.export-dropdown button:hover{background:var(--hover)}
.export-dropdown small{display:block;font-size:11px;color:var(--muted);margin-top:4px}
#library-import-dialog{width:520px;max-width:calc(100vw - 32px);padding:28px;border:1px solid var(--line);border-radius:18px;background:var(--panel);color:var(--ink)}
#library-import-dialog>p{font-size:13px;color:var(--soft)}
.import-drop-zone{display:flex;flex-direction:column;align-items:center;gap:14px;margin:24px 0;padding:32px 18px;border:1px dashed var(--input-border);border-radius:12px;text-align:center;cursor:pointer}
.import-drop-zone.dragging{background:var(--accent-soft);border-color:var(--accent)}
.import-drop-zone>svg{width:32px;height:32px;color:var(--soft)}
.import-drop-zone>span{font-size:12px;color:var(--muted)}
.import-drop-zone button{padding:9px 20px;border-radius:8px}
.admin-stat-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.admin-stat-grid article{display:flex;flex-direction:column;gap:8px;padding:20px;border:1px solid var(--line);border-radius:14px;background:var(--panel)}
.admin-stat-grid strong{font-size:28px;line-height:1.2}
.admin-stat-grid span,.admin-stat-grid small{font-size:12px;color:var(--soft)}
.admin-tabs{display:flex;gap:24px;margin:20px 0}
.admin-tabs button{padding:12px 4px;border-bottom:2px solid transparent;color:var(--soft)}
.admin-tabs button[aria-selected=true]{color:var(--ink);border-color:var(--accent);font-weight:600}
#admin-users-content:has(.account-table){border:1px solid var(--line);border-radius:14px;background:var(--panel);overflow:hidden}
.people-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px}
.people-toolbar .account-search{margin:0;max-width:340px}
.people-toolbar>.primary{padding:8px 12px;border-radius:8px;white-space:nowrap}
#settings-dialog .account-table{font-size:12px;min-width:720px;width:100%}
#settings-dialog .account-table th{font-weight:500;color:var(--soft);font-size:11px;white-space:nowrap;background:transparent}
#settings-dialog .account-table td{padding-top:16px;padding-bottom:16px}
.person-cell{display:flex;align-items:center;gap:10px}
.person-avatar{display:grid;place-items:center;width:32px;height:32px;flex:0 0 32px;border-radius:50%;background:linear-gradient(135deg,#4c8a63 0%,#8ec5a3 100%);color:#fff;overflow:hidden}
.person-avatar img{width:100%;height:100%;object-fit:cover}
.role-badge{white-space:nowrap;border-radius:14px;background:var(--accent-soft);padding:4px 8px}
#settings-dialog .account-pagination{padding:12px 16px;margin:0}
.registration-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:16px 0 24px}
.registration-card{position:relative;display:flex!important;flex-direction:column;gap:10px;padding:18px;margin:0!important;border:1px solid var(--line);border-radius:12px;background:var(--panel);cursor:pointer}
.registration-card:has(input:checked){border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}
.registration-card input{position:absolute;top:18px;right:12px}
#settings-dialog .registration-card input[type=radio]{width:16px;height:16px;padding:0;margin:0}
.registration-card strong{font-size:14px;padding-right:18px;color:var(--ink)}
.registration-card span{font-size:12px}
.registration-card:has(input:disabled){cursor:default}
.sso-heading{margin-top:32px}
.sso-card{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:20px;border:1px solid var(--line);border-radius:12px;background:var(--panel)}
.sso-card p{font-size:12px;margin-bottom:0;color:var(--soft)}
.sso-switch{width:38px;height:22px;flex-shrink:0;border-radius:16px;background:var(--muted);opacity:.65!important}
.sso-switch::before{content:"";display:block;width:16px;height:16px;margin-left:-2px;border-radius:50%;background:var(--panel)}
@media(max-width:1100px){.settings-content{padding-left:24px;padding-right:24px}.admin-stat-grid article{padding:14px}.profile-fields{gap:16px;padding:20px}}
@media(max-width:620px){.profile-upload-row{gap:18px;padding:20px}.profile-avatar-shell{width:76px;height:76px;flex-basis:76px;font-size:30px}.profile-fields{grid-template-columns:1fr}.transfer-card{align-items:flex-start;padding:18px;gap:14px}.transfer-card p{font-size:12px}.admin-stat-grid{gap:8px}.admin-stat-grid article{padding:12px}.admin-stat-grid small{font-size:10px}.registration-grid{grid-template-columns:1fr}.people-toolbar{flex-wrap:wrap}.settings-nav{border:0}.sidebar-landscape{height:min(180px,24dvh)}}
/* Login recording: a green underline opens from the center on focus. */
.login-input-field{position:relative;--login-focus-line:#315b46}
.login-input-field::after{content:"";position:absolute;right:0;bottom:0;left:0;height:2px;background:var(--login-focus-line);transform:scaleX(0);transform-origin:50% 50%;transition:transform 240ms cubic-bezier(.22,.61,.36,1);pointer-events:none}
.login-input-field:focus-within::after{transform:scaleX(1)}
.auth-card .login-input-field input{display:block;caret-color:var(--login-focus-line)}
.auth-card .login-input-field input:focus,.auth-card .login-input-field input:focus-visible{border-bottom-color:#c9d4c9;box-shadow:none;outline:none}
body.dark .login-input-field{--login-focus-line:#a3c8ae}
body.dark .auth-card .login-input-field input:focus,body.dark .auth-card .login-input-field input:focus-visible{border-bottom-color:#536959;box-shadow:none}
@media(prefers-reduced-motion:reduce){.login-input-field::after{transition:none}}
/* 覆盖浏览器自动填充的浅蓝底色，保留账号密码自动填充。 */
.auth-card .login-input-field input:-webkit-autofill,
.auth-card .login-input-field input:autofill{
  -webkit-box-shadow:inset 0 0 0 1000px var(--auth-field-bg)!important;
  box-shadow:inset 0 0 0 1000px var(--auth-field-bg)!important;
  -webkit-text-fill-color:var(--auth-field-ink);
  caret-color:var(--login-focus-line);
}
/* 枝叶围绕瓶口轻摆，花瓶与书页保持稳定。 */
.literary-branches{transform-box:view-box;transform-origin:463px 222px}
@media(prefers-reduced-motion:no-preference){
  .literary-branches{animation:leana-branch-sway 5.8s ease-in-out infinite}
  @keyframes leana-branch-sway{0%,100%{transform:rotate(-1.8deg)}50%{transform:rotate(2deg)}}
}
/* 四种预览固定呈现各自的明暗，不随当前主题变色。 */
.preview-qingman{background:#fafdf9}
.preview-qingman .preview-sidebar{background:linear-gradient(#eaf2e5,#c2d9c8)}
.preview-mulin{background:#202e28}
.preview-mulin .preview-sidebar{background:linear-gradient(#394e39,#223d2b)}
.preview-suzhi{background:#fffefa}
.preview-suzhi .preview-sidebar{background:#f1efe9}
.preview-mojian{background:#292c29}
.preview-mojian .preview-sidebar{background:#242724}
.preview-qingman i,.preview-suzhi i{background:#607b6b25!important}
.preview-mulin i,.preview-mojian i{background:#aec4a733!important}
.preview-qingman .preview-sidebar i:first-child,.preview-suzhi .preview-sidebar i:first-child{background:#6d987c!important}
.preview-mulin .preview-sidebar i:first-child,.preview-mojian .preview-sidebar i:first-child{background:#8ca387!important}
body .preview-qingman .preview-scene{color:#80aea0;filter:none}
body .preview-mulin .preview-scene{color:#698e73;filter:brightness(.52) saturate(.72)}
@media(prefers-reduced-motion:reduce){#login-server-switch svg{transition:none}}
/* Document header and writing controls match the supplied airy reference. */
#editor-shell{--writing-inset:clamp(24px,5vw,64px)}
.editor-header{position:relative;height:84px;padding:20px var(--writing-inset) 12px;border-bottom:0;gap:16px;background:var(--paper)}
.editor-header #back-list{position:absolute;left:calc(var(--writing-inset) - 38px);width:28px}
.editor-header .breadcrumb{font-size:13px;gap:9px}
.editor-header .breadcrumb-document{font-weight:600;color:var(--soft)}
.editor-header .breadcrumb>.breadcrumb-document{display:block}
.editor-actions{gap:14px;flex-shrink:0}
.editor-actions .icon-button{width:30px;height:30px;color:var(--muted)}
.editor-actions svg{width:18px;height:18px;stroke-width:1.6}
#note-sync-state.document-sync{display:inline-flex;align-items:center;gap:7px;white-space:nowrap;color:var(--muted);font-size:12px}
.document-sync::before{content:"";width:6px;height:6px;border-radius:50%;background:var(--muted)}
.document-sync[data-state="synced"]::before{background:#29bd86}
.document-sync[data-state="pending"]::before{background:#d7ae52}
.document-sync[data-state="error"]::before{background:var(--danger)}
.document-share{display:flex;align-items:center;justify-content:center;gap:8px;min-height:36px;padding:0 15px;border-radius:10px;background:linear-gradient(115deg,#1aa76e,#116546);color:#fff;font-size:13px;font-weight:600;box-shadow:0 4px 12px #176f4820}
.document-share:hover{filter:brightness(1.06)}
.document-share svg{width:16px;height:16px}
.document-menu{position:relative}
.document-menu>summary{list-style:none;display:flex;align-items:center;justify-content:center;cursor:pointer;border-radius:6px}
.document-menu>summary::-webkit-details-marker{display:none}
.document-menu>summary:hover,.document-menu[open]>summary{background:var(--hover)}
.document-menu>.menu{top:38px;right:0;width:228px;padding:7px}
.document-menu .menu>button{justify-content:flex-start;gap:10px;font-size:13px}
.document-menu .note-location{margin:6px 8px 10px;padding:8px 0;border-top:1px solid var(--line)}
.document-menu .note-location label{display:block;color:var(--muted);font-size:11px;margin-bottom:5px}
.document-menu .note-location select{width:100%;font-size:12px}
.document-menu .color-picker{padding:4px 8px;justify-content:flex-start}
.document-menu .color-picker button{min-height:18px;width:18px;padding:0}
.paper{padding:18px var(--writing-inset) 32px}
.paper-title-row{margin:0 0 9px}
.paper-title-row .note-title{font-family:"Noto Serif SC","Songti SC","STSong",serif;font-size:38px;line-height:1.5;font-weight:400;letter-spacing:1px}
.paper .note-meta{margin:0 0 24px;gap:8px;color:var(--muted);font-size:12px}
.paper .note-meta .meta-separator{opacity:.55;margin:0 2px}
#paper #compact-toolbar{display:flex;flex-wrap:nowrap;align-items:center;gap:2px;min-height:44px;padding:6px 10px;margin:0 -8px 26px;border:1px solid var(--line);border-left:0;border-right:0;border-radius:0;background:color-mix(in srgb,var(--accent-soft) 16%,var(--paper));box-shadow:none;color:var(--soft);overflow-x:auto;overflow-y:hidden;scrollbar-width:thin}
#compact-toolbar>button,#compact-toolbar #format-toolbar>button{display:inline-flex;align-items:center;justify-content:center;flex:0 0 28px;width:28px;min-width:28px;height:28px;padding:0;border-radius:8px;font-size:16px;color:var(--soft);white-space:nowrap;transition:background-color 140ms ease,color 140ms ease,opacity 140ms ease}
#compact-toolbar b{font-weight:500}
#compact-toolbar .toolbar-spacer{flex:1 0 34px}
#compact-toolbar .toolbar-divider{flex:0 0 1px;height:18px;margin:0 5px;background:var(--line)}
#compact-toolbar #format-toolbar>[data-format-panel="高亮"] svg{border-bottom:2px solid #c8b86b}
.compact-toolbar>button:hover{background:var(--hover)}
.compact-toolbar>button[aria-pressed="true"]{background:var(--accent-soft);color:var(--accent)}
.compact-toolbar svg{width:16px;height:16px;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.compact-toolbar #heading-select{width:72px;min-width:72px;border:0;background:transparent;font-size:14px;padding:3px 0;cursor:pointer}
.compact-toolbar .toolbar-divider{margin:0 5px}
.toolbar-hint{flex:1;text-align:right;font-size:11px;color:var(--muted);white-space:nowrap;padding-left:12px}
#compact-toolbar #focus-editor{margin-left:0}
.paper #compact-toolbar #format-toolbar{display:contents}
.compact-toolbar #format-toolbar>button:hover{background:var(--hover)}
.compact-toolbar #format-toolbar>button[aria-pressed="true"]{background:var(--accent-soft);color:var(--accent)}
#compact-toolbar>button:not(:disabled):hover,#compact-toolbar #format-toolbar>button:not(:disabled):hover{background:var(--hover);color:var(--ink)}
#compact-toolbar>button[aria-pressed="true"],#compact-toolbar #format-toolbar>button[aria-pressed="true"]{background:#dfefe7;color:#2c6854}
body.dark #compact-toolbar>button[aria-pressed="true"],body.dark #compact-toolbar #format-toolbar>button[aria-pressed="true"]{background:#254338;color:#acd4bf}
#compact-toolbar>button:disabled,#compact-toolbar #format-toolbar>button:disabled{opacity:.35;background:transparent;color:var(--muted);cursor:default}
#breadcrumb-folder[hidden],#breadcrumb-folder-separator[hidden]{display:none}
#document-find{display:flex;align-items:center;gap:6px;margin:0 0 16px;padding:8px;border:1px solid var(--line);border-radius:8px;background:var(--panel)}
#document-find[hidden]{display:none}
#document-find input{flex:1;min-width:0;border:0;background:transparent;padding:4px}
#document-find output{white-space:nowrap;font-size:12px;color:var(--muted)}
#document-find button{flex:0 0 28px;height:28px;border-radius:8px}
#document-find button:hover:not(:disabled){background:var(--hover)}
/* Supplied toolbar click states: compact mint menus anchored below each control. */
.selection-panel.toolbar-reference-panel{--format-ink:#315646;--format-muted:#88a799;--format-green:#13875f;--format-line:#d9e6df;border:1px solid var(--format-line);border-radius:12px;background:color-mix(in srgb,#f5fbf8 55%,var(--panel));color:var(--format-ink);box-shadow:0 10px 22px #2747371c}
.toolbar-reference-panel .format-panel-title{font-size:11px;line-height:14px;font-weight:400;letter-spacing:1.5px;color:var(--format-muted)}
.selection-panel.toolbar-reference-panel.paragraph-panel{display:grid;gap:0;width:148px;min-width:148px;padding:8px}
#compact-toolbar #format-toolbar>button.typography-select{flex:0 0 66px;width:66px;min-width:66px;padding:0 7px;gap:5px;font-size:12px;justify-content:space-between}
#compact-toolbar #format-toolbar>button.size-select{flex-basis:54px;width:54px;min-width:54px}
#compact-toolbar .typography-select svg{width:11px;height:11px;flex-shrink:0}
.typography-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.selection-panel.typography-panel{max-height:min(390px,calc(100vh - 32px));overflow-y:auto}
.toolbar-reference-panel.paragraph-panel .format-panel-title{line-height:20px;padding:0 6px;margin-bottom:2px}
.selection-panel.toolbar-reference-panel.paragraph-panel button{height:32px;padding:7px 8px;border-radius:8px;font-size:13px;line-height:18px;white-space:nowrap}
.toolbar-reference-panel.paragraph-panel button[aria-checked="true"]{color:var(--format-green);background:#e8f5ee}
.selection-panel.toolbar-reference-panel.color-panel{display:grid;grid-template-columns:repeat(6,22px);gap:8px 6px;width:188px;height:auto;padding:12px;overflow:visible;border-width:1px}
.toolbar-reference-panel.color-panel .format-panel-title{grid-column:1/-1}
.selection-panel.toolbar-reference-panel.color-panel button{width:22px;height:22px;min-width:22px;padding:0;border:1px solid color-mix(in srgb,currentColor 12%,transparent);border-radius:6px}
.selection-panel.toolbar-reference-panel.color-panel button[aria-pressed="true"]{outline:2px solid var(--format-green);outline-offset:2px}
.selection-panel.toolbar-reference-panel.link-panel{display:grid;gap:8px;width:262px;min-width:0;padding:12px}
.selection-panel.toolbar-reference-panel.link-panel form{display:grid;grid-template-columns:minmax(0,1fr) 50px;gap:6px;align-items:center;width:100%;max-width:none}
.selection-panel.toolbar-reference-panel.link-panel input{width:100%;height:30px;padding:5px 8px;border:1px solid #22c787;border-radius:8px;font-size:13px;background:var(--panel)}
.selection-panel.toolbar-reference-panel.link-panel form button{width:50px;height:30px;padding:0;border:0;border-radius:8px;background:#1baa73;color:#fff;font-size:13px}
.toolbar-reference-panel.link-panel .selection-error{font-size:11px}
.toolbar-reference-panel button:hover,.toolbar-reference-panel button:focus-visible{background:#e8f5ee}
#compact-toolbar #heading-select{flex:0 0 72px;width:72px;min-width:72px;height:28px;padding:0 4px;justify-content:space-between;border:0;background:transparent;font-size:14px}
#compact-toolbar #heading-select svg{width:12px;height:12px;color:#88a799}
#compact-toolbar button.panel-open,#compact-toolbar #format-toolbar button.panel-open{background:#e4f4ed;color:#13875f}
#compact-toolbar #heading-select.panel-open{color:#315646;background:#eaf5ee}
#document-find{gap:8px;height:42px;min-height:42px;margin:-26px -8px 26px;padding:6px 12px;border:1px solid var(--line);border-left:0;border-right:0;border-top:0;border-radius:0;background:color-mix(in srgb,#edf8f2 42%,var(--paper));color:#719886}
#document-find .document-find-icon{flex:0 0 16px;width:16px;height:16px;color:#13875f}
#document-find input{flex:0 1 178px;width:178px;max-width:45%;height:28px;padding:4px 8px;border:1px solid #22c787;border-radius:6px;font-size:13px;background:var(--panel);outline:none}
#document-find input:focus-visible{outline:2px solid #22c78733;outline-offset:1px}
#document-find input::placeholder{color:#8d9892}
#document-find input::-webkit-search-cancel-button{display:none}
#document-find output{min-width:42px;font-size:12px;color:#8ca99b}
#document-find button{display:flex;align-items:center;justify-content:center;flex:0 0 22px;width:22px;height:28px;padding:0}
#document-find button svg{width:14px;height:14px;stroke-width:1.6}
#document-find #document-find-close{margin-left:auto}
#button-tooltip.editor-toolbar-tooltip{background:#193329;border-radius:6px;padding:5px 8px;box-shadow:none}
#note-body blockquote{border-left:2px solid #63ddac;padding:6px 16px;color:#688578;background:transparent}
#note-body table{border-color:#bdd5ca;font-size:14px;font-family:var(--font)}
#note-body td,#note-body th{height:40px;padding:10px 12px;border-color:#bdd5ca;line-height:18px}
#note-body td[data-table-header="true"],#note-body th{background:#eef7f2;color:#244d3d;font-weight:600}
#note-body .ql-editor li[data-list="bullet"]>.ql-ui::before,#note-body .ql-editor li[data-list="ordered"]>.ql-ui::before{color:inherit}
#note-body .ql-editor li[data-list="bullet"]>.ql-ui::before{content:"";width:7px;height:7px;margin-left:-1em;margin-right:calc(1em - 7px);border-radius:50%;background:currentColor;vertical-align:.15em}
/* Keep decimal numbering at every indent level, including existing documents. */
#note-body .ql-editor li[data-list="ordered"]>.ql-ui::before{content:counter(list-0,decimal) ". "}
#note-body .ql-editor li[data-list="ordered"].ql-indent-1>.ql-ui::before{content:counter(list-1,decimal) ". "}
#note-body .ql-editor li[data-list="ordered"].ql-indent-2>.ql-ui::before{content:counter(list-2,decimal) ". "}
#note-body .ql-editor li[data-list="ordered"].ql-indent-3>.ql-ui::before{content:counter(list-3,decimal) ". "}
#note-body .ql-editor li[data-list="ordered"].ql-indent-4>.ql-ui::before{content:counter(list-4,decimal) ". "}
#note-body .ql-editor li[data-list="ordered"].ql-indent-5>.ql-ui::before{content:counter(list-5,decimal) ". "}
#note-body .ql-editor li[data-list="ordered"].ql-indent-6>.ql-ui::before{content:counter(list-6,decimal) ". "}
#note-body .ql-editor li[data-list="ordered"].ql-indent-7>.ql-ui::before{content:counter(list-7,decimal) ". "}
#note-body .ql-editor li[data-list="ordered"].ql-indent-8>.ql-ui::before{content:counter(list-8,decimal) ". "}
#note-body .ql-editor li[data-list="ordered"].ql-indent-9>.ql-ui::before{content:counter(list-9,decimal) ". "}
body.dark .selection-panel.toolbar-reference-panel{--format-ink:var(--ink);--format-muted:#a0bbad;--format-green:#8ed5b0;--format-line:#375448;background:var(--panel)}
body.dark .toolbar-reference-panel button:hover,body.dark .toolbar-reference-panel button:focus-visible,body.dark .toolbar-reference-panel.paragraph-panel button[aria-checked="true"]{background:#254338}
body.dark #compact-toolbar button.panel-open,body.dark #compact-toolbar #format-toolbar button.panel-open{background:#254338;color:#acd4bf}
body.dark #document-find{background:#1c2b24}
body.dark #note-body td[data-table-header="true"],body.dark #note-body th{background:#254338;color:#acd4bf}
body.dark #note-body blockquote{color:#a0bbad}
.compact-toolbar #format-toolbar>[data-format-panel]{font-size:12px}
.compact-toolbar #format-toolbar>#capture-screen{font-size:11px;width:52px;flex-basis:52px}
.name-edit-row{background:var(--accent-soft);border-radius:6px}
.sidebar-navigation .name-edit-row:not(.tree-note) .nav-item{grid-column:2 / -1}
.sidebar-navigation .name-edit-row.tree-note .nav-item{grid-column:1 / -1}
.name-edit-row .nav-item{display:flex;min-width:0}
.name-edit-row .nav-item>svg{flex-shrink:0}
.node-name-input{display:block;flex:1;min-width:0;width:100%;height:28px;border:1px solid var(--accent-border);border-radius:4px;background:var(--input-bg);color:var(--ink);padding:2px 5px;font:inherit;outline:none}
.node-name-input:focus{border-color:var(--accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 12%,transparent)}
.node-name-input[aria-invalid="true"]{border-color:var(--danger)}
.editor-footer{justify-content:flex-end}
.editor-focused #app{grid-template-columns:minmax(0,1fr)}
.editor-focused .sidebar,.editor-focused #sidebar-resizer{display:none}
.editor-focused .editor-panel{grid-column:1}
.editor-focused .app-tabbar,.editor-focused #settings-dialog{grid-column:1}
.editor-focused #editor-shell{--writing-inset:max(32px,calc((100% - 960px)/2))}
.editor-focused .note-panel{grid-column:1}
@media(max-width:1150px){.toolbar-hint{display:none}.editor-actions{gap:8px}.editor-header .breadcrumb{gap:5px}.breadcrumb-document{max-width:160px}}
@media(max-width:760px){#editor-shell{--writing-inset:24px}.editor-header{height:70px;padding-top:14px;gap:8px}.editor-header .breadcrumb>.slash,.editor-header #breadcrumb-folder{display:none}.editor-header .breadcrumb-document{max-width:150px}.paper-title-row .note-title{font-size:32px}.compact-toolbar{flex-wrap:wrap;gap:2px;margin-bottom:22px}.compact-toolbar>button{flex-basis:28px;width:28px}.editor-actions{gap:3px}.document-share{padding:0 10px}.paper .note-meta{font-size:11px;gap:4px}.editor-actions .document-sync{max-width:90px;overflow:hidden;text-overflow:ellipsis}}
@media(max-width:480px){.editor-actions #note-sync-state.document-sync{display:none}.editor-header .breadcrumb-root{display:none}.editor-header .breadcrumb-document{max-width:120px}.editor-header{padding-left:14px;padding-right:16px}.compact-toolbar .toolbar-divider{margin:0 2px}.paper .note-meta{row-gap:2px}.paper-title-row .note-title{font-size:29px}}
.document-menu>.menu[popover]{position:fixed;inset:auto;margin:0;width:288px;max-width:calc(100vw - 16px);padding:6px;overflow-y:auto;overflow-x:hidden;border-radius:12px;color:var(--ink)}
.document-menu>.menu[popover] button,.document-submenu button{display:flex;align-items:center;justify-content:flex-start;width:100%;min-height:34px;padding:7px 12px;gap:12px;text-align:left;border-radius:7px;font-size:14px}
.document-menu>.menu[popover] button>span,.document-submenu button>span:first-of-type{flex:1}
.document-menu>.menu[popover] button svg,.document-submenu button svg{width:18px;height:18px}
.document-menu>.menu[popover] button:hover,.document-submenu button:not(:disabled):hover{background:var(--hover)}
.document-menu>.menu[popover] hr,.document-submenu hr{margin:6px 0;border:0;border-top:1px solid var(--line)}
.document-menu>.menu[popover] kbd{margin-left:auto;padding:0;border:0;font-size:12px}
.document-menu-metadata{padding:8px 12px;color:var(--muted);font-size:11px;line-height:1.9}
.document-submenu{position:fixed;inset:auto;margin:0;width:258px;max-width:calc(100vw - 16px);padding:6px;overflow-y:auto;overflow-x:hidden;border:1px solid var(--line);border-radius:12px;background:var(--panel);color:var(--ink);box-shadow:var(--shadow)}
.document-submenu .document-submenu-back{font-size:12px;color:var(--muted);min-height:28px}
.document-submenu .document-submenu-back svg{transform:rotate(90deg);width:14px;height:14px}
.document-submenu .document-switch{flex:none;width:30px;height:18px;background:var(--muted);border-radius:20px;position:relative}
.document-switch::after{content:"";position:absolute;top:3px;left:3px;width:12px;height:12px;background:#fff;border-radius:50%}
.document-setting-toggle[aria-checked="true"] .document-switch{background:var(--accent)}
.document-setting-toggle[aria-checked="true"] .document-switch::after{left:15px}
.document-setting-select{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 12px;font-size:14px}
.document-setting-select select{min-width:0;max-width:138px;padding:2px;border:0;background:transparent;color:var(--muted);font-size:12px}
.document-submenu .color-picker{display:flex;padding:8px 12px;gap:14px}
.document-submenu .color-picker button{min-height:26px;width:24px;padding:0;border-radius:5px}
#password-dialog{width:420px;border-radius:14px;padding:26px}
#password-dialog>p{font-size:13px;color:var(--soft)}
#password-form label{display:block;margin:18px 0 8px;font-size:13px}
#password-form input{display:block;width:100%;height:40px;padding:8px 12px;border:1px solid var(--input-border);border-radius:8px;background:var(--input-bg)}
#password-error{font-size:13px;color:var(--danger)}
#password-dialog .dialog-actions{margin-top:22px;gap:10px}
#password-dialog .dialog-actions button{min-height:36px;padding:8px 18px;border-radius:8px;background:var(--hover)}
#password-dialog .dialog-actions .primary{background:var(--accent);color:#fff}
#paper:not(.document-fluid) #note-body{max-width:720px;margin-left:auto;margin-right:auto}
#paper.document-paper{background-color:var(--panel);background-image:repeating-linear-gradient(transparent,transparent 31px,color-mix(in srgb,var(--line) 30%,transparent) 32px)}
#paper.document-loose #note-body .ql-editor{line-height:2.2}
#paper[data-document-font="small"] #note-body .ql-editor{font-size:14px}
#paper[data-document-font="large"] #note-body .ql-editor{font-size:20px}
#paper.document-thumbnail #note-body img{max-width:160px;max-height:120px;object-fit:contain}
#paper.document-hide-toolbar #compact-toolbar,#paper.document-hide-tags .note-tags{display:none}
#paper.document-hide-stats #note-reading-time,#paper.document-hide-stats .meta-separator:last-of-type{display:none}
.note-description{display:none}
.note-name-copy{min-width:0}
.note-name-copy>span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.note-panel[data-list-layout="grid"] .note-description{display:block;font-size:12px;font-weight:400;color:var(--muted);margin-top:8px;line-height:1.6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body[data-document-description="all"] .note-panel[data-list-layout="grid"] .note-description{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;white-space:normal}
.format-color-letter{border-bottom:2px solid var(--accent)}
#document-view-dialog{width:760px;border-radius:14px}
.document-shortcuts{margin:0}
.document-shortcuts>div{display:flex;justify-content:space-between;gap:20px;padding:9px 0;border-bottom:1px solid var(--line)}
.document-shortcuts dd{margin:0;color:var(--muted);font-size:12px}
.document-tutorial{padding-left:22px}.document-tutorial p{color:var(--soft);line-height:1.8}
#document-view-dialog.document-presentation{width:min(1100px,calc(100vw - 32px));height:min(760px,90dvh);padding:40px}
.document-presentation .document-view-content{display:flex;flex-direction:column;min-height:0;height:calc(100% - 48px)}
.document-slide{flex:1;overflow:auto;font-size:22px;line-height:1.9;overflow-wrap:anywhere}
.document-slide img{max-width:100%;max-height:45dvh;object-fit:contain}
.document-slide-controls{display:flex;justify-content:space-between;align-items:center;gap:20px;padding-top:24px;color:var(--muted)}
.document-slide-controls button{padding:8px 16px;border-radius:8px;background:var(--hover);color:var(--ink)}
.document-relations{display:grid;grid-template-columns:1fr 1fr 1fr;gap:18px;align-items:center}
.document-relations h3{font-size:13px;color:var(--muted)}
.document-relations section{padding:16px;border:1px solid var(--line);border-radius:12px}
.document-relations button{display:flex;gap:8px;align-items:center;width:100%;padding:10px 0;text-align:left;overflow-wrap:anywhere}
.document-relation-center{display:flex;flex-direction:column;align-items:center;gap:12px;text-align:center;padding:20px;border:1px solid var(--accent-border);border-radius:12px;overflow-wrap:anywhere}
@media(max-width:600px){.document-relations{grid-template-columns:1fr}.document-shortcuts>div{font-size:12px;gap:8px}#document-view-dialog.document-presentation{padding:24px}.document-slide{font-size:18px}}
@media print{body{background:#fff!important;color:#000!important}#app{display:block;height:auto;overflow:visible;padding:0}.sidebar,#sidebar-resizer,.app-tabbar,.editor-header,.editor-footer,#compact-toolbar,.note-panel,.note-tags,#button-tooltip,#toast,dialog,.menu,.document-submenu,#image-actions{display:none!important}.editor-panel,#editor-shell,#paper,#note-body,#note-body .ql-editor{display:block!important;position:static!important;height:auto!important;max-height:none!important;min-height:0!important;overflow:visible!important;border:0!important;background:#fff!important;color:#000!important;box-shadow:none!important}#paper{padding:0!important}#paper img{max-width:100%!important}#note-title{color:#000!important}}
@media(max-width:760px){.editor-header #back-list{position:static;flex-shrink:0}}
/* Settings workspace: one page per category, independent of document navigation. */
.settings-open .sidebar{display:flex!important}
.settings-open #sidebar-resizer{display:block!important}
.settings-open #app{grid-template-columns:var(--sidebar-width) minmax(0,1fr);padding:0 8px 8px 0}
.settings-open .app-tabbar{grid-column:2;padding-left:0;background:transparent}
.settings-open #settings-dialog{grid-column:2;border-radius:16px;background:color-mix(in srgb,var(--sidebar) 75%,var(--paper))}
#settings-dialog[open]{grid-template-columns:190px minmax(0,1fr)}
#settings-dialog .settings-nav{padding:32px 20px 24px;background:transparent;gap:5px}
#settings-dialog .settings-nav h2{font-family:"Noto Serif SC","Songti SC","STSong",serif;font-size:21px;margin:0 12px 22px}
#settings-dialog .settings-nav button{min-height:46px;font-size:14px;border:1px solid transparent;border-radius:12px;padding:11px 14px}
#settings-dialog .settings-nav button[aria-current="true"]{border-color:color-mix(in srgb,var(--accent) 23%,transparent)}
.settings-nav-group{margin:24px 14px 10px;font-size:11px;letter-spacing:3px;color:var(--muted)}
#settings-dialog .settings-nav .settings-return{margin-top:auto;padding-top:11px}
#settings-dialog .settings-content{padding:38px clamp(24px,4vw,64px) 60px}
#settings-dialog .settings-section{max-width:1100px;margin:0 auto;padding:0;border:0}
#settings-dialog .settings-section[hidden]{display:none!important}
#settings-dialog .settings-section>h3{font:400 32px/1.5 "Noto Serif SC","Songti SC","STSong",serif;letter-spacing:2px;margin:0 0 8px}
#settings-dialog .settings-section>p{font-size:14px;line-height:1.8;margin:0 0 28px}
#settings-dialog #settings-section-profile>p{display:block}
#settings-mobile-nav,#settings-document-nav{display:none}
.settings-card,.profile-summary,.profile-basic,.profile-session{border:1px solid var(--line);background:var(--panel);border-radius:20px;overflow:hidden;box-shadow:0 3px 8px #173c2410}
.settings-card{margin:20px 0}
.settings-card>header,.settings-card-body,.profile-basic>header,.profile-session>header{padding:24px 28px}
.settings-card>header,.profile-basic>header,.profile-session>header{border-bottom:1px solid var(--line)}
.settings-card h4,.profile-basic h4,.profile-session h4{font-family:"Noto Serif SC","Songti SC","STSong",serif;font-size:18px;margin:0 0 6px;font-weight:600}
.settings-card header p,.profile-basic header p,.profile-session header p{font-size:13px;color:var(--soft);margin:0;line-height:1.8}
#settings-dialog .preference-row{display:flex;justify-content:space-between;align-items:center;gap:24px;padding:23px 28px;margin:0;min-height:92px}
.preference-row+.preference-row{border-top:1px solid var(--line)}
.preference-row strong,.about-actions strong{display:block;font-size:14px;color:var(--ink);font-weight:600}
.preference-row small,.about-actions small{display:block;font-size:12px;color:var(--soft);margin-top:8px;line-height:1.7}
#settings-dialog .segmented-choice{display:flex;flex-shrink:0;gap:3px;padding:4px;border:1px solid var(--line);border-radius:10px;background:var(--paper);margin:0}
#settings-dialog .segmented-choice label{position:relative;display:block;cursor:pointer;margin:0;padding:8px 16px;font-size:12px;color:var(--soft);border-radius:7px}
.segmented-choice input{position:absolute;opacity:0;width:1px;height:1px}
.segmented-choice label:has(:checked){background:var(--panel);box-shadow:0 1px 4px #173c2418;color:var(--accent)!important}
.segmented-choice label:focus-within{outline:2px solid var(--accent);outline-offset:1px}
#settings-dialog .settings-switch{appearance:none;width:42px;height:24px;flex:0 0 42px;padding:0;margin:0;border:0;border-radius:20px;background:var(--input-border);cursor:pointer;position:relative}
.settings-switch::before{content:"";position:absolute;width:18px;height:18px;left:3px;top:3px;background:#fff;border-radius:50%;box-shadow:0 1px 3px #0002;transition:transform 180ms}
#settings-dialog .settings-switch:checked{background:var(--accent)}
.settings-switch:checked::before{transform:translateX(18px)}
.settings-switch:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
#settings-dialog .theme-style-grid{gap:20px}
#settings-dialog .theme-style-card{padding:14px;border-radius:18px}
#settings-dialog .theme-preview{height:150px;border-radius:10px}
#settings-dialog .theme-style-card strong{font-size:16px;margin:15px 6px 7px}
#settings-dialog .theme-style-card small{font-size:12px;margin:0 6px 6px}
#settings-dialog .settings-button{border-radius:10px;padding:10px 17px;font-size:13px}
#settings-dialog .settings-options{margin:0;display:block}
#settings-dialog .settings-options>button{width:100%;border:0;background:transparent;box-shadow:none;border-radius:0;padding:22px 28px;text-align:left}
#settings-dialog .settings-options>button+button{border-top:1px solid var(--line)}
#settings-dialog .settings-options>button:hover{background:var(--hover)}
.settings-card-body>input{display:block;width:100%;height:46px;border:1px solid var(--input-border);background:var(--input-bg);border-radius:10px;margin:12px 0 18px}
.settings-card-body>label{font-size:14px}
.server-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.server-actions>span{font-size:12px;color:var(--soft)}
.server-actions>span.failed{color:var(--danger)}
.settings-card-footer{display:flex;justify-content:flex-end;padding:18px 28px;border-top:1px solid var(--line)}
#settings-registration-summary{padding:0 24px}
#settings-registration-summary article{padding:20px;border:1px solid var(--line);border-radius:12px;display:flex;flex-direction:column;gap:9px}
#settings-registration-summary article.current{border-color:var(--accent);background:var(--accent-soft)}
#settings-registration-summary strong{font-size:14px}
#settings-registration-summary small{font-size:12px;color:var(--soft);line-height:1.7}
#settings-dialog .settings-about-brand{display:flex;flex-direction:column;align-items:center;text-align:center;margin:40px 0;gap:16px}
#settings-dialog .settings-about-brand img{width:96px;height:96px;border-radius:26px}
#settings-dialog .settings-about-brand strong{font-size:30px;font-weight:400}
.settings-about-brand strong span{font-size:20px;color:var(--soft);margin-left:8px}
#settings-dialog .settings-about-brand small{font-size:13px;margin-top:12px}
#settings-dialog .settings-about-brand p{font-size:13px;color:var(--soft);margin:0}
.about-actions{max-width:700px;margin:0 auto}
.about-actions>button{display:flex;align-items:center;justify-content:space-between;text-align:left;width:100%;padding:22px 28px;gap:20px}
.about-actions>button+button{border-top:1px solid var(--line)}
.about-actions>button:hover{background:var(--hover)}
#settings-update-result{text-align:center;margin-top:22px}
#settings-dialog .profile-edit-card{display:grid;grid-template-columns:minmax(220px,.7fr) minmax(0,1.5fr);gap:22px;border:0;background:transparent;box-shadow:none;overflow:visible}
.profile-summary{text-align:center;align-self:start;padding:28px 22px}
#settings-dialog .profile-upload-row{display:flex;flex-direction:column;padding:0;gap:16px}
#settings-dialog .profile-avatar-shell{width:112px;height:112px;flex-basis:112px;font-size:40px;border:6px solid var(--accent-soft)}
.profile-summary h4{font-family:"Noto Serif SC","Songti SC","STSong",serif;font-size:22px;overflow-wrap:anywhere;margin:4px 0 0}
.profile-summary-email{font-size:12px;color:var(--soft);overflow-wrap:anywhere}
.profile-summary .role-badge{display:inline-block;font-size:11px;margin:10px 0}
.profile-stats{display:grid;grid-template-columns:1fr 1fr;text-align:left;gap:22px 12px;padding:24px 0;border-top:1px solid var(--line);margin:20px 0 0}
.profile-stats strong{font-size:20px;color:var(--accent);font-weight:400;overflow-wrap:anywhere}
.profile-stats small{display:block;font-size:11px;color:var(--soft);margin-top:8px}
.profile-avatar-actions{display:flex;justify-content:center;gap:16px;align-items:center}
#settings-dialog .profile-fields{display:flex;flex-direction:column;gap:24px;padding:26px;border-top:0}
#settings-dialog .settings-inline .profile-fields input{border-radius:12px}
#settings-dialog .profile-basic .dialog-actions{justify-content:flex-end;padding:18px 26px;border-top:1px solid var(--line);margin:0}
#settings-dialog .profile-basic .dialog-actions button{border-radius:10px}
.profile-session{margin-top:20px}
.profile-session-body{display:flex;justify-content:space-between;align-items:center;padding:24px 26px;gap:20px}
.profile-session-body strong{font-size:14px}
.profile-session-body small{display:block;margin-top:9px;font-size:12px;color:var(--soft);overflow-wrap:anywhere}
body[data-body-font="sans"] #note-body .ql-editor{font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif}
body[data-body-font="serif"] #note-body .ql-editor{font-family:"Noto Serif SC","Songti SC","STSong",serif}
body[data-paragraph-spacing="compact"] #note-body .ql-editor p{margin-bottom:4px}
body[data-paragraph-spacing="relaxed"] #note-body .ql-editor p{margin-bottom:18px}
body.hide-reading-stats #note-reading-time{display:none}
body[data-motion="gentle"] *,body[data-motion="gentle"] *::before,body[data-motion="gentle"] *::after{transition-duration:120ms!important}
body[data-motion="gentle"] .literary-branches{animation-duration:9s}
body[data-motion="none"] *,body[data-motion="none"] *::before,body[data-motion="none"] *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
@media(max-width:1000px){
  #settings-dialog[open]{grid-template-columns:180px minmax(0,1fr)}
  #settings-dialog .settings-nav{padding-left:12px;padding-right:12px}
  #settings-dialog .settings-nav button{padding-left:10px;padding-right:10px;white-space:nowrap;font-size:13px}
  #settings-dialog .settings-content{padding:32px 24px 48px}
  #settings-dialog .profile-edit-card{grid-template-columns:1fr}
  .profile-summary{display:grid;grid-template-columns:1fr 1fr;gap:20px;align-items:center}
  .profile-stats{border:0;margin:0;padding:0}
  .profile-avatar-actions{grid-column:1/-1}
  #settings-dialog .preference-row{gap:18px;padding:20px}
  #settings-dialog .segmented-choice label{padding:8px 10px}
}
/* Connection verification is a modal, never a second form under the settings page. */
#sync-dialog{width:480px;max-width:calc(100vw - 32px);border:1px solid var(--line);border-radius:20px;background:var(--panel);color:var(--ink);padding:32px}
#sync-dialog #connected-panel{display:none!important}
#sync-dialog h2{font-family:"Noto Serif SC","Songti SC","STSong",serif;font-size:24px;margin:0 0 12px}
#sync-dialog>p{font-size:13px;line-height:1.8;color:var(--soft)}
#sync-dialog label{display:block;margin:20px 0 9px;font-size:13px}
#sync-dialog input{width:100%;height:44px;border:1px solid var(--input-border);border-radius:10px;background:var(--input-bg);color:var(--ink)}
#sync-dialog .dialog-actions{justify-content:flex-end}
#sync-dialog .dialog-actions button{flex:0 0 auto;width:auto;border-radius:10px}
#sync-dialog #connected-close{top:14px;right:12px}
.sync-workspace{padding:24px}
#sync-connection-editor{border-top:1px solid var(--line);margin-top:24px;padding-top:24px}
#sync-connection-editor[hidden]{display:none}
#sync-connection-editor>p{font-size:13px;color:var(--soft);line-height:1.8}
#sync-connection-editor label,.security-password-card label{display:block;margin:20px 0 8px;font-size:13px}
#sync-connection-editor input:not([type=hidden]),#settings-dialog .security-password-card input{display:block;width:100%;max-width:560px;height:44px;padding:10px 14px;border:1px solid var(--input-border);border-radius:10px;background:var(--input-bg);color:var(--ink)}
#sync-connection-editor .dialog-actions{justify-content:flex-start;gap:12px;margin-top:24px}
#sync-connection-editor .primary,.security-password-card .primary{width:auto;min-height:42px;padding:10px 18px;border-radius:10px;background:var(--accent);color:#fff}
#sync-error,#security-password-error{font-size:13px;color:var(--danger);overflow-wrap:anywhere}
#settings-dialog .security-password-card{border-top:1px solid var(--line);margin-top:32px;padding-top:26px}
#settings-dialog .security-password-card h3{font-size:18px;margin:0 0 10px}
.security-password-card>p{font-size:13px;color:var(--soft)}
#settings-dialog .account-page-back{position:static;width:auto;height:auto;display:inline-flex;padding:8px 0;margin-bottom:16px;font-size:13px;border:0;background:transparent}
#settings-dialog .profile-editor .account-page-back{display:none}
#settings-dialog .settings-nav #settings-logout{color:var(--danger)}
#settings-dialog .transfer-card>#import,#settings-dialog .export-dropdown>summary{width:116px;height:44px;padding:10px 14px;flex-shrink:0}
#settings-dialog .export-dropdown>summary>svg{width:18px;height:18px}
.export-dropdown[open]>summary>svg:last-child{transform:rotate(180deg)}
@media(max-width:620px){#settings-dialog .transfer-card{flex-wrap:wrap}#settings-dialog .transfer-card>#import,#settings-dialog .export-dropdown{margin-left:auto}}
.sync-status-banner{display:flex;align-items:center;gap:16px;padding:20px 24px;border:1px solid var(--accent-border);border-radius:16px;background:color-mix(in srgb,var(--accent-soft) 40%,var(--panel))}
.sync-status-banner>.local-dot{flex:0 0 8px;box-shadow:0 0 0 5px color-mix(in srgb,var(--accent) 12%,transparent)}
.sync-status-banner>div{flex:1;min-width:0}
.sync-status-banner strong{display:block;font-size:15px;overflow-wrap:anywhere}
.sync-status-banner small{display:block;margin-top:8px;color:var(--soft);font-size:12px;overflow-wrap:anywhere}
.sync-endpoint-card{border:1px solid var(--line);border-radius:16px;margin:22px 0;background:color-mix(in srgb,var(--sidebar) 28%,var(--panel))}
.sync-endpoint-card>header{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:24px 24px 0}
.sync-endpoint-card h4{display:flex;align-items:center;gap:9px;margin:0}
.sync-endpoint-card .role-badge{font-size:11px}
#settings-dialog .sync-endpoint-card .preference-row{padding:22px 24px}
.server-address-row{display:flex;align-items:center;gap:12px;margin:12px 0}
.server-address-row input{min-width:0;flex:1;height:44px;border:1px dashed var(--input-border);border-radius:10px;background:var(--input-bg);color:var(--ink);font-family:ui-monospace,monospace}
.server-address-row button{flex-shrink:0}
#settings-server-result{font-size:12px;color:var(--accent);line-height:1.8;margin:8px 0 18px}
#settings-server-result.failed{color:var(--danger)}
.server-note{border:1px solid var(--accent-border);background:color-mix(in srgb,var(--accent-soft) 35%,var(--panel));border-radius:12px;padding:14px 18px;font-size:12px;line-height:1.8;color:var(--soft);margin:16px 0}
.server-note-warning{border-color:color-mix(in srgb,var(--danger) 22%,transparent);background:color-mix(in srgb,var(--danger) 3%,var(--panel))}
.sync-endpoint-card .server-actions{justify-content:flex-end;margin-top:18px}
#settings-dialog .sync-workspace>label.preference-row{padding-left:0;padding-right:0;border-top:1px solid var(--line)}
#settings-section-security>.settings-card{display:none}
#settings-dialog #settings-section-security>#account-dialog{margin:0;padding:0;background:transparent}
#settings-dialog .account-overview #account-close{display:none}
#settings-dialog .account-overview #account-title{font-size:20px;font-family:"Noto Serif SC","Songti SC","STSong",serif;margin-bottom:10px}
#settings-dialog .account-overview .account-actions{display:flex;gap:12px;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:18px;margin-top:24px}
#settings-dialog .account-overview .account-actions button{width:auto;border:1px solid var(--line);border-radius:10px;padding:9px 12px;font-size:12px;background:var(--panel)}
/* Login header from the reference: leaf divider, centered title and wordmark. */
.auth-card .login-brand-row{justify-content:center;margin-bottom:0}
.auth-card .login-brand{display:flex;flex-direction:column;align-items:center;width:100%;gap:22px}
.login-leaf-divider{display:flex;align-items:center;justify-content:center;gap:18px;width:min(280px,75%);color:#19845d;margin:0 auto 5px}
.login-leaf-divider>span{height:1px;background:#bad6c6;flex:1}
.login-leaf-divider svg{width:22px;height:26px;flex-shrink:0}
.auth-card .login-brand-heading{align-items:center;text-align:center}
.auth-card .login-brand-heading h1{font-size:38px;letter-spacing:8px;line-height:1.5;margin:0;color:#173d2e}
.auth-card .login-brand-heading>span{font-family:var(--font);font-size:12px;font-weight:600;letter-spacing:7px;color:#19845d;margin-top:10px;padding-left:7px}
.auth-card .auth-description{text-align:center;font-family:"Noto Serif SC","Songti SC","STSong",serif;font-size:14px;letter-spacing:3px;margin:30px 0 30px}
body.dark .auth-card .login-brand-heading h1{color:#deeadf}
body.dark .login-leaf-divider,body.dark .auth-card .login-brand-heading>span{color:#a2c6a8}
@media(max-width:900px){
  .settings-open #app{grid-template-columns:minmax(0,1fr);padding:0 8px 8px}
  .settings-open .app-tabbar,.settings-open #settings-dialog{grid-column:1}
  .settings-open #sidebar-resizer{display:none!important}
  #settings-document-nav{display:inline-flex;position:absolute;right:24px;top:18px;border-radius:8px;background:var(--panel);z-index:4}
  #settings-dialog .settings-content{padding-top:64px}
}
@media(max-width:620px){
  .settings-open .app-tabbar{padding-left:8px}
  .sync-workspace{padding:16px}
  .sync-status-banner{padding:18px 16px;gap:12px;flex-wrap:wrap}
  .sync-status-banner>div{flex-basis:calc(100% - 28px)}
  .sync-status-banner>button{margin-left:20px}
  .server-address-row{flex-wrap:wrap}
  .server-address-row input{flex-basis:100%}
  .sync-endpoint-card>header{padding:20px 18px 0}
  #settings-dialog .sync-endpoint-card .preference-row{padding:20px 18px}
  .auth-card .login-brand-heading h1{font-size:34px}
}
@media(max-width:620px){
  .settings-open #app{padding:0}
  .settings-open .app-tabbar{padding-left:8px}
  #settings-dialog[open]{display:block;position:relative}
  #settings-dialog .settings-nav{display:none;flex-direction:column;position:absolute;inset:0 auto 0 0;width:230px;background:var(--panel);z-index:5;box-shadow:var(--shadow);border:0;overflow-x:hidden;overflow-y:auto}
  #settings-dialog.settings-nav-open .settings-nav{display:flex}
  #settings-dialog .settings-content{height:100%;padding:64px 18px 40px}
  #settings-mobile-nav{display:inline-flex;position:absolute;left:18px;top:18px;z-index:6;background:var(--panel);border-radius:8px}
  #settings-dialog .settings-section>h3{font-size:28px}
  #settings-dialog .settings-nav h2{display:block;padding-left:36px}
  #settings-dialog .settings-nav button svg{display:block}
  #settings-dialog .preference-row{gap:16px;flex-wrap:wrap;padding:20px}
  #settings-dialog label.preference-row{flex-wrap:nowrap}
  .preference-row small{max-width:240px}
  .settings-card>header,.settings-card-body{padding:22px 20px}
  #settings-dialog .theme-style-grid{gap:12px}
  #settings-dialog .theme-style-card{padding:9px}
  #settings-dialog .theme-preview{height:100px}
  .profile-summary{display:block}
  .profile-stats{margin:20px 0;padding:20px 0;border-top:1px solid var(--line)}
  #settings-registration-summary{grid-template-columns:1fr}
  .profile-session-body{flex-wrap:wrap}
}
/* Synchronization page follows the supplied mockup's compact two-line banner and server card. */
#settings-section-sync>h3{font-weight:600!important;font-size:28px!important;letter-spacing:1px!important}
#settings-dialog .sync-workspace{padding:18px 24px 0;box-shadow:none}
#settings-dialog .sync-status-banner{min-height:80px;padding:18px 22px;gap:20px;border-color:#cae9dc;background:color-mix(in srgb,#e5f5ed 28%,var(--panel))}
#settings-dialog .sync-status-banner strong{font-size:15px}
#settings-dialog .sync-status-banner small{font-size:13px;margin-top:5px;line-height:1.6}
#settings-connection-dot{width:9px;height:9px;border-radius:50%;background:var(--muted)}
#settings-connection-dot.connected{background:#2ab984;box-shadow:0 0 0 5px #2ab98426}
#settings-dialog .sync-status-banner .settings-button,#settings-dialog .server-address-row .settings-button{height:40px;min-width:88px;padding:8px 16px;font-size:14px;font-weight:600;color:var(--accent)}
#settings-dialog .sync-endpoint-card{margin:18px 0 20px;border-radius:16px;background:color-mix(in srgb,var(--sidebar) 20%,var(--panel));overflow:hidden}
#settings-dialog .sync-endpoint-card>header{padding:20px 22px 0}
#settings-dialog .sync-endpoint-card h4{font-family:var(--font);font-size:14px;font-weight:600}
#settings-dialog .sync-endpoint-card .role-badge{font-size:12px;font-weight:600;color:var(--accent);padding:4px 10px;background:var(--accent-soft)}
#settings-dialog .sync-endpoint-card .preference-row{padding:18px 22px;min-height:86px;position:relative}
#settings-dialog .sync-endpoint-card .preference-row::after{content:"";height:1px;background:var(--line);position:absolute;bottom:0;left:22px;right:22px}
#settings-dialog .sync-endpoint-card .preference-row small{margin-top:5px;font-size:13px}
#settings-dialog .sync-endpoint-card .settings-card-body{padding:16px 22px 18px}
#settings-dialog .sync-endpoint-card .settings-card-body>label{display:block;margin:0;font-size:14px;font-weight:600}
#settings-dialog .server-address-row{margin:10px 0}
#settings-dialog .server-address-row #settings-server-address{height:40px;border:1px dashed var(--accent-border);border-radius:12px;padding:8px 14px;background:transparent;font-size:14px;color:var(--soft)}
#settings-dialog #settings-server-result{font-size:13px;font-weight:600;margin:10px 0 16px;color:var(--accent)}
#settings-server-result:not(:empty)::before{content:"";display:inline-block;width:7px;height:7px;border-radius:50%;background:currentColor;margin-right:8px;vertical-align:1px}
#settings-dialog .server-note{display:flex;align-items:center;gap:12px;padding:14px 18px;font-size:13px;line-height:1.6;margin:14px 0 0;border-color:#cae9dc;background:color-mix(in srgb,#e5f5ed 22%,var(--panel))}
#settings-dialog .server-note svg{width:18px;height:18px;flex:0 0 18px;color:#20a477}
#settings-dialog .server-note-warning{border-color:#efd7d0;background:color-mix(in srgb,#f5e7e1 15%,var(--panel));color:#8c5e50}
#settings-dialog .server-note-warning svg{color:#bd5c45}
#settings-dialog .server-actions[hidden]{display:none!important}
#settings-dialog .sync-workspace>label.preference-row{min-height:80px;padding:20px 0;border-top:0}
#settings-dialog .sync-workspace>label.preference-row+label.preference-row{border-top:1px solid var(--line)}
#settings-dialog .sync-workspace>label.preference-row strong{font-size:15px}
#settings-dialog .sync-workspace>label.preference-row small{font-size:13px;margin-top:5px}
#settings-dialog .sync-workspace .settings-switch{width:44px;height:26px;border-radius:16px}
#settings-dialog .sync-workspace .settings-switch:checked{background:#1dab78}
#settings-dialog .sync-workspace .settings-switch::before{width:20px;height:20px}
body.dark #settings-dialog .server-note-warning{color:#ddb5a4;border-color:#62453a}
body.dark #settings-dialog .sync-status-banner,body.dark #settings-dialog .server-note{border-color:var(--accent-border)}
@media(max-width:620px){
  #settings-dialog .sync-workspace{padding:16px 16px 0}
  #settings-dialog .sync-status-banner{padding:16px;gap:12px}
  #settings-dialog .sync-endpoint-card>header{padding:18px 16px 0}
  #settings-dialog .sync-endpoint-card .preference-row,#settings-dialog .sync-endpoint-card .settings-card-body{padding:18px 16px}
  #settings-dialog .server-note{padding:12px;font-size:12px;align-items:flex-start}
}
