:root { font-family: system-ui, "Microsoft YaHei", sans-serif; color: #242b38; background: #fff; }
* { box-sizing: border-box; }
body { margin: 0; display: flex; min-height: 100vh; }
aside { width: 156px; flex-shrink: 0; padding: 24px 12px; background: #f6f7f9; border-right: 1px solid #e5e7eb; }
.brand { padding: 0 12px 24px; font-weight: 600; }
nav { display: grid; gap: 8px; }
button { padding: 11px 16px; border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
button:hover { background: #eaeef4; }
button[aria-current="page"] { background: #e6edff; color: #285ccc; }
button:focus-visible { outline: 2px solid #285ccc; outline-offset: 2px; }
main { flex: 1; min-width: 0; padding: 36px; }
h1 { margin: 0 0 24px; font-size: 24px; }
p { color: #7b8492; }
[hidden] { display: none !important; }
/* 笔记三栏：导航 / 页面目录 / 正文。目录交互沿用旧版页面树。 */
body:has(#notes:not([hidden])) { height:100vh; overflow:hidden; }
body:has(#notes:not([hidden])) > aside { width:278px; overflow:auto; }
main:has(#notes:not([hidden])) { padding:0; overflow:hidden; }
#notes { height:100%; min-width:0; position:relative; }
#notes > .notes-heading { display:none; }
#notes .notes-workspace { --page-width:280px; display:grid; grid-template-columns:var(--page-width) 6px minmax(0,1fr); gap:0; height:100%; align-items:stretch; position:relative; }
#notes .notes-pages { border:0; border-right:1px solid var(--line); border-radius:0; padding:0; display:flex; flex-direction:column; min-height:0; background:var(--col-bg); }
#notes .notes-toolbar { display:flex; align-items:center; gap:3px; padding:14px 10px; margin:0; border-bottom:1px solid var(--line); }
#notes .notes-toolbar button { flex:none; padding:6px 8px; background:transparent; color:var(--tx-sub); }
#notes .page-count { flex:1; font-size:12px; color:var(--tx-faint); }
#notes .notes-tree { flex:1; overflow:auto; padding:8px; min-height:0; }
#notes .notes-row { display:flex; flex-wrap:nowrap; gap:0; min-height:40px; border:2px solid transparent; padding-left:calc(var(--depth)*18px); margin:3px 0; border-radius:var(--r-sm); cursor:default; }
#notes .notes-row:hover { background:var(--tab-bg); }
#notes .notes-row.on { background:var(--accent-soft); }
#notes .notes-row button { padding:5px 3px; flex:none; font-size:13px; }
#notes .notes-row .notes-name { flex:1; min-width:70px; text-align:left; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; background:transparent; }
#notes .page-drag { cursor:grab; color:var(--tx-faint); }
#notes .page-fold { width:20px; color:var(--tx-sub); }
#notes .page-fold:disabled { cursor:default; opacity:.4; }
#notes .page-more { color:var(--tx-faint); }
#notes .page-select { flex:none; }
#notes .notes-root-drop { flex:none; margin:8px; padding:12px 5px; font-size:12px; }
#notes .notes-message:empty { display:none; }
#notes .notes-message { margin:8px; }
#notes .notes-batch-bar { padding:8px; border-top:1px solid var(--line); display:flex; gap:6px; }
#notes .notes-batch-bar button { padding:8px; font-size:12px; background:var(--accent-soft); }
#notes .notes-document { min-width:0; overflow:auto; padding:28px 32px; background:var(--content-bg); }
#notes .notes-current-title { padding-right:90px; }
#notes #notes-history-button { position:absolute; right:24px; top:22px; z-index:1; font-size:12px; }
#notes .page-divider { cursor:col-resize; background:var(--line2); }
#notes .page-divider:hover, #notes .page-divider:focus-visible { background:var(--accent-soft); }
#notes .restore-pages { display:none; position:absolute; left:2px; top:8px; padding:7px 4px; z-index:2; }
#notes .panel-hidden { grid-template-columns:28px minmax(0,1fr); }
#notes .panel-hidden .notes-pages, #notes .panel-hidden .page-divider { display:none; }
#notes .panel-hidden .restore-pages { display:block; }
#notes .panel-hidden .notes-document { grid-column:2; }
#notes .notes-drop-before { border-top-color:var(--accent); }
#notes .notes-drop-after { border-bottom-color:var(--accent); }
#notes .notes-drop-inside { border-color:var(--accent); background:var(--accent-soft); }
.page-menu { position:fixed; z-index:150; width:190px; padding:6px; border:1px solid var(--line); border-radius:var(--r-sm); background:var(--panel-bg); color:var(--tx); box-shadow:var(--sh-pop); }
.page-menu button { display:block; width:100%; padding:9px 10px; font-size:13px; }
.notes-dialog .delete-scope { display:flex; align-items:center; gap:8px; }
.resizing-pages, .resizing-pages * { cursor:col-resize !important; user-select:none !important; }
@media(max-width:800px) { body:has(#notes:not([hidden])) > aside { width:156px; } #notes .notes-document { padding:20px; } }
#notes input.notes-current-title { display:block; width:100%; margin:0 0 16px; padding:0 100px 8px 0; border:0; border-bottom:1px solid transparent; border-radius:0; font:600 19px system-ui,"Microsoft YaHei",sans-serif; color:var(--tx); background:transparent; }
#notes input.notes-current-title:focus { outline:none; border-bottom-color:var(--accent); }
.sync-state { margin-top:auto; padding:24px 8px 0; font-size:12px; line-height:1.6; color:var(--tx-sub); overflow-wrap:anywhere; }
.sync-conflict-dialog { width:min(520px,calc(100vw - 32px)); max-height:90vh; padding:26px; border:1px solid var(--card-bd); border-radius:var(--r); background:var(--panel-bg); color:var(--tx); box-shadow:var(--sh-pop); }
.sync-conflict-dialog::backdrop { background:rgba(20,30,50,.45); }
.sync-conflict-dialog h2 { margin:0 0 16px; font-size:21px; }
.sync-conflict-dialog p { line-height:1.7; color:var(--tx-sub); }
.sync-conflict-hint { font-size:13px; }
.sync-conflict-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:10px; margin-top:24px; }
.sync-conflict-actions button { padding:10px 16px; border:1px solid var(--line); background:var(--accent-soft); color:var(--accent); }
.sync-conflict-actions button:disabled { opacity:.5; cursor:wait; }
