/* Whole-space palette: the paper, chrome and controls share one chosen accent. */
:root{--app-bg:#f8f9f3;--sidebar-bg:#f0f2e9;--surface:#fcfdf8;--active-bg:#e2e8d9;--accent-ink:#455d43;--on-accent:#fff;--accent-faint:#a5b29b}
body{background:var(--app-bg);color:var(--ink)}
.sidebar{background:var(--sidebar-bg);border-color:var(--border)}
.topbar,.tool-panel,dialog,.selection-toolbar,.tool-dock{background:var(--surface);border-color:var(--border)}
.brand-mark,.breadcrumb span:last-child,.page-position b,.strip-label,.panel-field,.form-field,.panel-label{color:var(--accent-ink)}
.nav-item,.sidebar-label,.side-section-title,.new-album-link,.sidebar-bottom,.breadcrumb,.save-status,.eyebrow,.album-heading p,.desk-topline,.desk-bottomline,.desk-bottomline button,.page-position,.dock-grip,.tool-dock button,.panel-hint,.theme-choice small,.workspace-footer,.keyboard-hint,.collection-view>p,.timeline-entry small{color:var(--muted)}
.nav-item.active,.album-entry.active{background:var(--active-bg);color:var(--accent-ink)}
.button.primary,.toast{background:var(--green);color:var(--on-accent)}
.button.primary:hover{background:var(--green);filter:brightness(.93)}
.button.subtle,.target-pages button,.theme-choice,.sticker-choice,.page-arrow{border-color:var(--border);background:var(--surface)}
.button.subtle:hover,.target-pages button.active,.theme-choice.active,.tool-dock button.active,.tool-dock button:hover,.sticker-choice:hover,.selection-toolbar button:hover{background:var(--soft);color:var(--accent-ink);border-color:var(--accent-faint)}
.target-pages button:disabled{opacity:.55;background:var(--soft);cursor:not-allowed}
.button.primary:disabled{opacity:.45;transform:none;cursor:not-allowed}
.album-entry small,.sidebar-bottom small,.sidebar-bottom button,.help-copy,.help-copy strong,.theme-choice strong,.collection-card p,.collection-card h3{color:var(--muted)}
.sidebar-bottom button,.workspace-footer,.modal-footer,.timeline-entry{border-color:var(--border)}
.little-flower,.heading-spark,.keyboard-hint kbd{color:var(--accent-faint)}
.save-status>span,.desk-topline i{background:var(--green)}
.book-underlay{background:var(--accent-ink)}
.paper{color:var(--paper-ink,var(--ink))}
.memory-item.text,.memory-item.text.title{color:var(--paper-ink,var(--accent-ink))}
.memory-item.text.micro,.paper-header,.page-number{color:var(--paper-muted,#9a9a80)}
.memory-item.selected,.memory-item:focus-visible{outline-color:var(--green)}
.upload-zone,.collection-card{background:var(--soft);border-color:var(--accent-faint);color:var(--accent-ink)}
.thumb-index{background:var(--app-bg)}
.empty-state,.strip-add{border-color:var(--border);color:var(--muted)}
.spread-thumb.active{border-color:var(--green);box-shadow:0 0 0 2px var(--soft)}
.theme-choice.active{border-color:var(--green)}
.theme-swatch{border-width:3px}
.theme-presets{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.theme-presets .theme-choice{margin:0;display:flex;flex-direction:column;align-items:flex-start;gap:9px;padding:13px 12px;min-height:114px}
.theme-presets .theme-swatch{width:100%;height:32px;border-radius:3px;box-shadow:none;border-width:0 0 7px 0}
.theme-presets .theme-choice strong{font-size:11px;color:var(--ink)}
.theme-presets .theme-choice small{font-size:6px;letter-spacing:.6px;margin-top:3px}
.custom-theme-fields{border-top:1px solid var(--border);padding-top:14px;margin-top:24px}
.custom-theme-fields h3{font:500 15px var(--serif);margin:4px 0 16px}
.custom-theme-fields label{display:flex;align-items:center;gap:10px;font-size:11px;margin:12px 0}
.color-value{font:9px monospace;color:var(--muted);margin-left:auto}
.custom-theme-fields input[type=color]{width:36px;height:30px;padding:3px;border-radius:5px;cursor:pointer;border-color:var(--border);background:var(--surface)}
.custom-theme-fields .panel-hint{font-size:9px;margin:17px 0 0}
.page-lock-controls{display:flex;align-items:center;gap:7px}
.page-lock-controls button{font-size:8px;padding:5px 9px;gap:5px;color:var(--muted);border:1px solid var(--border);border-radius:20px;background:var(--surface)}
.page-lock-controls svg{width:11px;height:11px}
.page-lock-controls button.locked{color:var(--accent-ink);background:var(--active-bg);border-color:var(--accent-faint)}
.heading-actions{gap:7px}
.heading-actions #lockSpreadBtn{white-space:nowrap}
.paper.is-locked .memory-item{pointer-events:none;cursor:default}
.paper.is-locked{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--green) 15%,transparent)}
.left-paper.is-locked{box-shadow:inset -24px 0 23px -23px #514e3e68,inset 0 0 0 1px color-mix(in srgb,var(--green) 15%,transparent)}
.paper.is-locked:after{content:'已固定';position:absolute;left:7%;bottom:3%;color:var(--paper-muted,var(--muted));font:7px var(--sans);letter-spacing:1px;pointer-events:none}
.book .memory-item{transform-origin:50% 50%}
.memory-item.photo img{min-height:0;flex:1;backface-visibility:hidden}
.memory-item.transforming{will-change:transform;cursor:grabbing}
.is-transforming{user-select:none;cursor:grabbing}
.memory-item.selected{outline:1.5px solid var(--green);outline-offset:3px}
.transform-controls{position:absolute;inset:0;pointer-events:none;z-index:5}
.resize-handle{pointer-events:auto;position:absolute;width:13px;height:13px;padding:0;border:1.5px solid var(--green);border-radius:3px;background:var(--surface);box-shadow:0 1px 4px #0002;touch-action:none}
.resize-handle:before,.rotation-handle:before{content:'';position:absolute;inset:-7px}
.handle-nw{left:-9px;top:-9px;cursor:nwse-resize}
.handle-ne{right:-9px;top:-9px;cursor:nesw-resize}
.handle-sw{left:-9px;bottom:-9px;cursor:nesw-resize}
.handle-se{right:-9px;bottom:-9px;cursor:nwse-resize}
.rotation-handle{pointer-events:auto;position:absolute;left:50%;top:-39px;transform:translateX(-50%);width:24px;height:24px;background:var(--green);color:var(--on-accent);border:2px solid var(--surface);border-radius:50%;padding:4px;box-shadow:0 2px 5px #0002;cursor:grab;touch-action:none}
.rotation-handle svg{width:13px;height:13px;stroke-width:1.8}
.rotation-stem{position:absolute;left:50%;top:-18px;width:1px;height:15px;background:var(--green)}
.transform-readout{position:absolute;left:50%;bottom:-30px;transform:translateX(-50%);padding:3px 8px;white-space:nowrap;border-radius:4px;background:var(--accent-ink);color:var(--surface);font:9px/1.4 var(--sans);letter-spacing:.5px}
.memory-item.transforming .transform-readout{display:block}
.selection-toolbar{gap:4px;padding:6px;z-index:390}
.selection-toolbar input{width:85px;accent-color:var(--green)}
.selection-toolbar button{color:var(--accent-ink)}
.tool-dock{position:fixed;top:auto;bottom:auto;right:auto;left:calc(50% + 20px);transform:none;flex-direction:row;align-items:center;gap:5px;padding:6px 8px;border-radius:12px;width:max-content;max-width:calc(100vw - 16px);z-index:420;box-shadow:0 7px 30px #24311f1c;transition:box-shadow .2s}
.tool-dock button{width:49px;height:45px;flex-direction:column;gap:3px;flex-shrink:0;font-size:9px;white-space:nowrap}
.tool-dock button svg{width:17px;height:17px}
.tool-dock .dock-grip{width:23px;height:43px;cursor:grab;touch-action:none;border-right:1px solid var(--border);border-radius:0;padding-right:5px;margin-right:2px}
.tool-dock .dock-grip svg{width:17px;height:22px}
.tool-dock.dragging{box-shadow:0 9px 35px #24311f33;user-select:none}
.tool-dock.dragging .dock-grip{cursor:grabbing}
.tool-dock>i{width:1px;height:27px;margin:0 3px;background:var(--border)}
.tool-dock .dock-reset{width:25px;height:35px;margin-left:2px;color:var(--muted)}
.tool-dock .dock-reset svg{width:13px;height:13px}
.tool-panel{z-index:500;padding-bottom:30px}
.page-arrow{width:34px;height:34px;color:var(--accent-ink);background:var(--surface);box-shadow:0 2px 7px #00000008}
.page-arrow.prev{left:-12px}.page-arrow.next{right:-12px}
.page-arrow:hover{background:var(--soft)}
.workspace-footer{padding-bottom:90px}
.toast{bottom:92px;left:50%}
.immersive .page-lock-controls{display:none}
@media(max-width:1050px){.heading-actions .button{padding:8px;font-size:8px;gap:5px}.heading-actions .button svg{width:13px;height:13px}.heading-actions{flex-wrap:wrap;justify-content:flex-end;max-width:255px}.page-lock-controls button{padding:5px 7px;font-size:7px}.page-arrow.prev{left:-19px}.page-arrow.next{right:-19px}}
@media(max-width:720px){.heading-actions{flex-direction:column;flex-wrap:nowrap;max-width:none;gap:6px}.heading-actions .button{padding:6px 8px;font-size:8px}.desk{padding-top:15px;padding-bottom:20px}.desk-topline{flex-wrap:wrap;gap:12px}.desk-topline>span:first-child{font-size:6px;letter-spacing:.5px}.page-lock-controls{gap:4px;margin-left:auto}.page-lock-controls button{font-size:6px;padding:4px 6px;gap:3px}.page-lock-controls svg{width:9px;height:9px}.book-stage{margin-top:23px}.tool-dock{gap:3px;padding:6px;border-radius:10px;max-width:calc(100vw - 16px)}.tool-dock button{width:45px;height:41px;flex-direction:column;font-size:8px;padding:0 3px;gap:4px}.tool-dock .dock-grip{width:21px;height:37px}.tool-dock>i{margin:0 2px;height:24px}.tool-dock .dock-reset{width:22px}.tool-panel{bottom:90px;max-height:calc(100dvh - 115px)}.page-arrow{width:27px;height:27px}.page-arrow.prev{left:-24px}.page-arrow.next{right:-24px}.resize-handle{width:14px;height:14px}.rotation-handle{width:25px;height:25px}.theme-presets{grid-template-columns:repeat(3,1fr);gap:7px}.theme-presets .theme-choice{padding:9px;min-height:100px}.theme-presets .theme-choice strong{font-size:9px}.theme-presets .theme-choice small{font-size:5px;letter-spacing:0}.workspace-footer{padding-bottom:90px}.paper.is-locked:after{font-size:5px}.custom-theme-fields h3{font-size:14px}}
