:root{--bg: #f6f5f1;--surface: #ffffff;--surface-2: #fbfaf7;--surface-3: #f1efe9;--ink: #1b1a17;--ink-2: #45423b;--muted: #837e74;--line: #e4e1d8;--line-strong: #d3cfc3;--accent: #2f6f5e;--accent-soft: #e6f0ec;--accent-ink: #ffffff;--danger: #b23b2e;--shadow-1: 0 1px 2px rgba(27, 26, 23, .06), 0 4px 14px rgba(27, 26, 23, .05);--shadow-2: 0 8px 40px rgba(27, 26, 23, .14);--radius: 10px;--radius-lg: 16px;--font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;--font-serif: "Iowan Old Style", "Palatino Linotype", Georgia, "Songti SC", serif;--font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;--hl-yellow: 255 233 163;--hl-green: 199 236 210;--hl-blue: 201 226 251;--hl-pink: 251 208 221;--hl-purple: 227 213 251;--hl-orange: 255 217 176;--safe-top: env(safe-area-inset-top, 0px);--safe-bottom: env(safe-area-inset-bottom, 0px);--sidebar-w: 288px;--panel-w: 320px}@media (prefers-color-scheme: dark){:root{--bg: #14140f;--surface: #1c1c17;--surface-2: #22221c;--surface-3: #2a2a23;--ink: #ece9e1;--ink-2: #c9c5ba;--muted: #8d887c;--line: #302f28;--line-strong: #3d3b33;--accent: #6bbfa5;--accent-soft: #23342e;--accent-ink: #10201b;--danger: #e28072;--shadow-1: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3);--shadow-2: 0 8px 40px rgba(0, 0, 0, .5);--hl-yellow: 120 98 30;--hl-green: 50 96 66;--hl-blue: 45 78 116;--hl-pink: 118 55 75;--hl-purple: 82 60 118;--hl-orange: 124 78 40}}*{box-sizing:border-box}html,body,#root{height:100%}body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--font-ui);font-size:15px;line-height:1.55;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent;-webkit-text-size-adjust:100%;overscroll-behavior:none}button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}input,textarea{font:inherit;color:inherit}a{color:var(--accent)}::selection{background:rgb(var(--hl-yellow) / .75)}.app{display:grid;grid-template-columns:var(--sidebar-w) minmax(0,1fr);height:100dvh;overflow:hidden}.app[data-mobile=true]{grid-template-columns:minmax(0,1fr)}.app[data-view=doc][data-mobile=true] .sidebar,.app[data-view=list][data-mobile=true] .main{display:none}.sidebar{display:flex;flex-direction:column;min-height:0;background:var(--surface-2);border-right:1px solid var(--line);padding-top:var(--safe-top)}.sidebar__head{padding:18px 18px 10px;display:flex;align-items:baseline;justify-content:space-between;gap:8px}.wordmark{font-family:var(--font-serif);font-size:25px;letter-spacing:-.02em;line-height:1;display:flex;align-items:baseline;gap:8px}.wordmark small{font-family:var(--font-ui);font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}.sidebar__tools{padding:0 14px 10px;display:flex;gap:8px;align-items:center}.search{position:relative;flex:1}.search input{width:100%;height:34px;padding:0 30px;border-radius:8px;border:1px solid var(--line);background:var(--surface);outline:none;font-size:14px}.search input:focus{border-color:var(--line-strong);box-shadow:0 0 0 3px var(--accent-soft)}.search__icon{position:absolute;left:9px;top:50%;transform:translateY(-50%);color:var(--muted);display:flex}.search__clear{position:absolute;right:6px;top:50%;transform:translateY(-50%);width:20px;height:20px;border-radius:50%;color:var(--muted);display:grid;place-items:center;font-size:14px}.search__clear:hover{background:var(--surface-3)}.btn{height:34px;padding:0 12px;border-radius:8px;border:1px solid var(--line);background:var(--surface);font-size:13.5px;display:inline-flex;align-items:center;gap:6px;white-space:nowrap;transition:background .12s ease,border-color .12s ease}.btn:hover{background:var(--surface-3)}.btn--primary{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}.btn--primary:hover{filter:brightness(1.06);background:var(--accent)}.btn--ghost{border-color:transparent;background:transparent}.btn--ghost:hover{background:var(--surface-3)}.btn--icon{width:34px;padding:0;justify-content:center}.btn--sm{height:28px;font-size:12.5px;padding:0 9px}.btn[disabled]{opacity:.45;pointer-events:none}.doclist{flex:1;min-height:0;overflow-y:auto;padding:4px 8px calc(12px + var(--safe-bottom));-webkit-overflow-scrolling:touch}.doclist__empty{padding:40px 18px;text-align:center;color:var(--muted);font-size:13.5px;line-height:1.7}.docitemwrap{position:relative}.docitemwrap .docitem{padding-right:34px}.docitem__del{position:absolute;top:6px;right:6px;width:24px;height:24px;display:grid;place-items:center;border-radius:6px;color:var(--muted);opacity:0;transition:opacity .12s ease,background .12s ease,color .12s ease}.docitemwrap:hover .docitem__del,.docitemwrap:focus-within .docitem__del{opacity:1}.docitem__del:hover{background:color-mix(in srgb,var(--danger) 14%,transparent);color:var(--danger)}@media (hover: none){.docitem__del{opacity:.55}}.docitem{display:block;width:100%;text-align:left;padding:10px;border-radius:8px;border:1px solid transparent;margin-bottom:2px}.docitem:hover{background:var(--surface)}.docitem[aria-current=true]{background:var(--surface);border-color:var(--line);box-shadow:var(--shadow-1)}.docitem__top{display:flex;align-items:baseline;gap:8px;justify-content:space-between}.docitem__title{font-size:14px;font-weight:600;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.docitem__time{font-size:11.5px;color:var(--muted);flex:none}.docitem__excerpt{margin-top:3px;font-size:12.5px;color:var(--muted);overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;line-height:1.45}.docitem__meta{margin-top:4px;display:flex;gap:8px;font-size:11px;color:var(--muted)}.dot{width:3px;height:3px;border-radius:50%;background:currentColor;opacity:.5;display:inline-block;vertical-align:middle}.sidebar__foot{border-top:1px solid var(--line);padding:8px 12px calc(8px + var(--safe-bottom));display:flex;align-items:center;gap:8px;font-size:12.5px;color:var(--muted)}.syncbadge{display:inline-flex;align-items:center;gap:6px;padding:4px 8px;border-radius:999px;font-size:12px;border:1px solid var(--line);background:var(--surface);color:var(--muted);white-space:nowrap}.syncbadge__dot{width:6px;height:6px;border-radius:50%;background:currentColor}.syncbadge[data-state=idle] .syncbadge__dot{background:var(--accent)}.syncbadge[data-state=syncing] .syncbadge__dot{background:var(--accent);animation:pulse 1s ease-in-out infinite}.syncbadge[data-state=error]{color:var(--danger);border-color:color-mix(in srgb,var(--danger) 30%,transparent)}.syncbadge[data-state=offline] .syncbadge__dot{background:var(--muted)}@keyframes pulse{50%{opacity:.25}}.main{position:relative;min-width:0;min-height:0;display:flex;flex-direction:column;background:var(--bg)}.topbar{height:52px;flex:none;display:flex;align-items:center;gap:10px;padding:0 14px;padding-top:var(--safe-top);height:calc(52px + var(--safe-top));border-bottom:1px solid var(--line);background:color-mix(in srgb,var(--bg) 82%,transparent);backdrop-filter:saturate(160%) blur(12px);-webkit-backdrop-filter:saturate(160%) blur(12px);position:relative;z-index:20}.topbar__title{font-size:14.5px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0}.topbar__actions{display:flex;gap:4px;align-items:center}.iconbtn{width:32px;height:32px;border-radius:8px;display:grid;place-items:center;color:var(--ink-2)}.iconbtn:hover{background:var(--surface-3)}.iconbtn[aria-pressed=true]{background:var(--accent-soft);color:var(--accent)}.reader{flex:1;min-height:0;display:flex;position:relative}.reader__frame{flex:1;min-width:0;position:relative;background:var(--surface)}.reader__frame iframe{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;border:0;display:block;background:var(--surface)}.reader__placeholder{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-content:center;justify-items:center;gap:10px;color:var(--muted);text-align:center;padding:24px}.reader__placeholder p{margin:0;font-size:13.5px}.reader__progress{position:absolute;left:0;top:0;height:2px;background:var(--accent);opacity:.55;transition:width .15s linear;z-index:3;pointer-events:none}.annpanel{width:var(--panel-w);flex:none;border-left:1px solid var(--line);background:var(--surface-2);display:flex;flex-direction:column;min-height:0}.annpanel__head{padding:12px 14px 8px;display:flex;align-items:baseline;justify-content:space-between}.annpanel__head h2{margin:0;font-size:13px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);font-weight:600}.annpanel__body{flex:1;min-height:0;overflow-y:auto;padding:0 10px 14px}.anncard{width:100%;text-align:left;padding:9px 10px;border-radius:8px;border:1px solid var(--line);background:var(--surface);margin-bottom:8px;display:block}.anncard:hover{border-color:var(--line-strong)}.anncard[data-active=true]{border-color:var(--accent);box-shadow:0 0 0 2px var(--accent-soft)}.anncard__quote{font-size:13px;line-height:1.5;color:var(--ink);overflow:hidden;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical}.anncard__note{margin-top:6px;font-size:12.5px;color:var(--ink-2);background:var(--surface-2);border-radius:6px;padding:5px 7px;white-space:pre-wrap;overflow-wrap:anywhere}.anncard__foot{margin-top:6px;display:flex;align-items:center;gap:6px;font-size:11px;color:var(--muted)}.anncard__swatch{width:8px;height:8px;border-radius:2px;flex:none}.anncard__orphan{color:var(--danger);font-size:11px}.anncard__spacer{flex:1}.drawer{position:fixed;top:0;right:0;bottom:0;left:0;z-index:60;display:flex;flex-direction:column;justify-content:flex-end}.drawer__scrim{position:absolute;top:0;right:0;bottom:0;left:0;background:#14120e59;animation:fade .18s ease}.drawer__sheet{position:relative;background:var(--surface-2);border-radius:18px 18px 0 0;box-shadow:var(--shadow-2);max-height:78dvh;display:flex;flex-direction:column;animation:slideup .22s cubic-bezier(.2,.9,.3,1);padding-bottom:var(--safe-bottom)}@keyframes fade{0%{opacity:0}}@keyframes slideup{0%{transform:translateY(16px);opacity:.6}}.selbar{position:fixed;left:0;right:0;bottom:0;z-index:70;display:flex;justify-content:center;padding:0 12px calc(12px + var(--safe-bottom));pointer-events:none}.selbar__inner{pointer-events:auto;background:var(--surface);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow-2);padding:8px;display:flex;align-items:center;gap:8px;max-width:560px;flex-wrap:wrap;justify-content:center;animation:pop .16s ease}@keyframes pop{0%{transform:translateY(8px) scale(.98);opacity:0}}.swatch{width:30px;height:30px;border-radius:50%;border:1px solid rgb(0 0 0 / .12);display:grid;place-items:center;transition:transform .1s ease}.swatch:active{transform:scale(.92)}.swatch[data-color=yellow]{background:rgb(var(--hl-yellow))}.swatch[data-color=green]{background:rgb(var(--hl-green))}.swatch[data-color=blue]{background:rgb(var(--hl-blue))}.swatch[data-color=pink]{background:rgb(var(--hl-pink))}.swatch[data-color=purple]{background:rgb(var(--hl-purple))}.swatch[data-color=orange]{background:rgb(var(--hl-orange))}.swatch[data-color=erase]{background:var(--surface-3);color:var(--muted)}.selbar__divider{width:1px;height:22px;background:var(--line)}.selbar__label{font-size:12px;color:var(--muted);max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sheet-pad{padding:14px 16px}.sheet-title{font-size:14px;font-weight:600;margin:0 0 10px;display:flex;align-items:center;gap:8px}.sheet-quote{font-size:13px;color:var(--muted);border-left:3px solid rgb(var(--hl-yellow));padding:2px 0 2px 10px;margin-bottom:12px;max-height:96px;overflow:auto;white-space:pre-wrap}.textarea{width:100%;min-height:88px;padding:10px 12px;border-radius:10px;border:1px solid var(--line);background:var(--surface);resize:vertical;outline:none;line-height:1.6}.textarea:focus{border-color:var(--line-strong);box-shadow:0 0 0 3px var(--accent-soft)}.row{display:flex;gap:8px;align-items:center}.row--end{justify-content:flex-end}.grow{flex:1}.toast{position:fixed;left:50%;transform:translate(-50%);bottom:calc(24px + var(--safe-bottom));z-index:90;background:var(--ink);color:var(--bg);font-size:13px;padding:9px 14px;border-radius:999px;box-shadow:var(--shadow-2);max-width:calc(100vw - 40px);animation:pop .16s ease}.empty{height:100%;display:grid;place-content:center;justify-items:center;gap:12px;text-align:center;padding:32px;color:var(--muted)}.empty h1{font-family:var(--font-serif);font-size:26px;color:var(--ink);margin:0;font-weight:500}.empty p{margin:0;font-size:13.5px;line-height:1.7;max-width:40ch}.settings{flex:1;overflow-y:auto;padding:20px;padding-bottom:calc(40px + var(--safe-bottom))}.settings__inner{max-width:620px;margin:0 auto;display:flex;flex-direction:column;gap:22px}.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-lg);padding:16px 18px}.card h3{margin:0 0 4px;font-size:14px}.card p.hint{margin:0 0 12px;font-size:12.5px;color:var(--muted);line-height:1.65}.field{display:flex;flex-direction:column;gap:6px;margin-bottom:12px}.field label{font-size:12.5px;color:var(--ink-2);font-weight:500}.field input{height:38px;padding:0 11px;border-radius:9px;border:1px solid var(--line);background:var(--surface-2);outline:none;font-size:14px}.field input:focus{border-color:var(--line-strong);box-shadow:0 0 0 3px var(--accent-soft);background:var(--surface)}.mono{font-family:var(--font-mono);font-size:12.5px}.kv{display:flex;justify-content:space-between;gap:12px;padding:7px 0;border-bottom:1px dashed var(--line);font-size:13px}.kv:last-child{border-bottom:0}.kv span:first-child{color:var(--muted)}.editor{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:0}.editor[data-mode=body]{grid-template-columns:minmax(0,1fr)}.editor__pane{min-width:0;min-height:0;display:flex;flex-direction:column;border-right:1px solid var(--line)}.editor__pane:last-child{border-right:0}.editor__bar{flex:none;height:40px;display:flex;align-items:center;gap:8px;padding:0 12px;border-bottom:1px solid var(--line);font-size:12.5px;color:var(--muted);background:var(--surface-2)}.segmented{display:inline-flex;background:var(--surface-3);border-radius:8px;padding:2px;gap:2px}.segmented button{padding:4px 10px;border-radius:6px;font-size:12.5px;color:var(--muted)}.segmented button[aria-selected=true]{background:var(--surface);color:var(--ink);box-shadow:var(--shadow-1)}.code{flex:1;width:100%;min-height:0;border:0;outline:none;resize:none;padding:14px 16px;font-family:var(--font-mono);font-size:12.5px;line-height:1.65;background:var(--surface);color:var(--ink);-moz-tab-size:2;tab-size:2;white-space:pre;overflow:auto}.wysiwyg{flex:1;overflow:auto;padding:0;background:var(--surface);position:relative}.wysiwyg iframe{width:100%;height:100%;border:0;display:block}@media (max-width: 879px){.editor{grid-template-columns:minmax(0,1fr)}.editor__preview{display:none}.annpanel{width:100%;border-left:0}}
