:root{--bg: #f4f6f8;--card: #ffffff;--text: #1a1f2b;--muted: #6b7280;--primary: #2563eb;--primary-ink: #ffffff;--border: #e5e7eb;--danger-bg: #fef2f2;--danger-ink: #b91c1c}@media (prefers-color-scheme: dark){:root{--bg: #0f1420;--card: #171e2e;--text: #e8ecf4;--muted: #9aa4b8;--primary: #3b82f6;--border: #263042;--danger-bg: #2a1516;--danger-ink: #fca5a5}}*{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{background:var(--bg);color:var(--text);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,PingFang TC,Microsoft JhengHei,Roboto,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased}.muted{color:var(--muted)}.small{font-size:.82rem}.auth-wrap{min-height:100%;display:flex;align-items:center;justify-content:center;padding:24px}.auth-card{width:100%;max-width:380px;background:var(--card);border:1px solid var(--border);border-radius:18px;padding:28px 24px 24px;box-shadow:0 10px 40px #00000014}.brand{text-align:center;margin-bottom:22px}.brand h1{font-size:1.25rem;margin:12px 0 4px}.brand-mark{display:inline-flex;align-items:center;justify-content:center;width:54px;height:54px;border-radius:14px;background:var(--primary);color:var(--primary-ink);font-weight:800;font-size:1.1rem;letter-spacing:1px}.brand-mark.big{width:72px;height:72px;font-size:1.5rem}.field{display:block;margin-bottom:16px}.field span{display:block;font-size:.85rem;margin-bottom:6px;color:var(--muted)}.field input{width:100%;padding:13px 14px;font-size:16px;border:1px solid var(--border);border-radius:12px;background:var(--bg);color:var(--text)}.field input:focus{outline:none;border-color:var(--primary)}.btn-primary{width:100%;padding:14px;border:none;border-radius:12px;background:var(--primary);color:var(--primary-ink);font-size:1rem;font-weight:600;cursor:pointer}.btn-primary:disabled{opacity:.55;cursor:default}.alert{background:var(--danger-bg);color:var(--danger-ink);border-radius:10px;padding:10px 12px;font-size:.88rem;margin-bottom:14px}.splash{height:100%;display:flex;flex-direction:column;gap:14px;align-items:center;justify-content:center}.app-shell{min-height:100%;display:flex;flex-direction:column}.topbar{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;padding-top:max(14px,env(safe-area-inset-top));background:var(--card);border-bottom:1px solid var(--border);position:sticky;top:0}.topbar-title{font-weight:700}.btn-ghost{background:transparent;border:1px solid var(--border);color:var(--text);padding:7px 14px;border-radius:10px;font-size:.88rem;cursor:pointer}.content{flex:1;padding:18px;display:flex;flex-direction:column;gap:16px}.user-chip{display:flex;align-items:center;gap:12px;background:var(--card);border:1px solid var(--border);border-radius:14px;padding:14px}.avatar{width:44px;height:44px;border-radius:50%;background:var(--primary);color:var(--primary-ink);display:flex;align-items:center;justify-content:center;font-weight:700}.user-name{font-weight:600}.placeholder{background:var(--card);border:1px dashed var(--border);border-radius:16px;padding:32px 20px;text-align:center}.placeholder-icon{font-size:2.4rem}.placeholder h2{font-size:1.05rem;margin:10px 0 8px}.placeholder .btn-primary{margin-top:16px;width:auto;padding:12px 22px}.tabbar{display:flex;border-top:1px solid var(--border);background:var(--card);padding-bottom:env(safe-area-inset-bottom)}.tab{flex:1;text-align:center;padding:12px 0;font-size:.8rem;color:var(--muted);background:transparent;border:none;cursor:pointer}.tab.active{color:var(--primary);font-weight:600}.capture-empty{text-align:center;padding:40px 16px;background:var(--card);border:1px dashed var(--border);border-radius:16px}.capture-actions{display:flex;flex-direction:column;gap:10px;margin-top:18px}.filter-bar{display:flex;gap:8px;overflow-x:auto;padding-bottom:4px}.chip{flex:0 0 auto;padding:8px 16px;border-radius:999px;border:1px solid var(--border);background:var(--card);color:var(--text);font-size:.85rem;cursor:pointer}.chip-active{background:var(--primary);color:var(--primary-ink);border-color:var(--primary)}.page-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.page-thumb{position:relative;aspect-ratio:3 / 4;border-radius:10px;overflow:hidden;border:1px solid var(--border);background:#000}.page-thumb img{width:100%;height:100%;object-fit:cover}.page-num{position:absolute;left:6px;bottom:6px;background:#0009;color:#fff;border-radius:6px;font-size:.72rem;padding:1px 7px}.page-del{position:absolute;top:4px;right:4px;width:24px;height:24px;border-radius:50%;border:none;background:#0009;color:#fff;cursor:pointer;font-size:.75rem}.page-add{aspect-ratio:3 / 4;border:1px dashed var(--border);border-radius:10px;background:var(--card);color:var(--muted);cursor:pointer;font-size:.8rem;line-height:1.4}.save-bar{display:flex;gap:10px}.save-bar .btn-primary,.save-bar .btn-ghost{flex:1;width:auto}.lib-msg{padding:40px 16px;text-align:center}.library{display:flex;flex-direction:column;gap:10px}.doc-card{display:flex;align-items:center;gap:12px;background:var(--card);border:1px solid var(--border);border-radius:14px;padding:12px 14px}.doc-icon{font-size:1.6rem}.doc-meta{flex:1;min-width:0}.doc-title{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.doc-actions{display:flex;gap:2px}.icon-btn{width:34px;height:34px;border-radius:8px;border:none;background:transparent;cursor:pointer;font-size:1rem}.icon-btn:active{background:var(--bg)}.icon-btn.danger{filter:grayscale(.2)}.modal{position:fixed;top:0;right:0;bottom:0;left:0;background:#0009;display:flex;align-items:center;justify-content:center;padding:16px;z-index:50}.modal-body{background:var(--card);border-radius:14px;width:100%;max-width:900px;height:90vh;display:flex;flex-direction:column;overflow:hidden}.modal-head{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border-bottom:1px solid var(--border);font-weight:600}.preview-frame{flex:1;border:none;width:100%;background:#525659}.shared-frame{min-height:60vh;border-radius:12px}.sheet{background:var(--card);border-radius:16px;width:100%;max-width:460px;padding:18px;display:flex;flex-direction:column;gap:14px}.sheet-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.sheet-title{font-weight:700;word-break:break-all}.link-box{display:flex;gap:8px}.link-box input{flex:1;min-width:0;padding:11px 12px;font-size:14px;border:1px solid var(--border);border-radius:10px;background:var(--bg);color:var(--text)}.copy-btn{width:auto;flex:0 0 auto;padding:11px 18px}.sheet-actions{display:flex;flex-direction:column;gap:10px}.crop-sheet{background:var(--card);border-radius:16px;width:100%;max-width:560px;max-height:92vh;padding:16px;display:flex;flex-direction:column;gap:12px;overflow:auto}.crop-box{position:relative;line-height:0;touch-action:none;-webkit-user-select:none;user-select:none;background:#000;border-radius:10px;overflow:hidden}.crop-box img{width:100%;height:auto;pointer-events:none}.crop-box svg{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%}.crop-box polygon{fill:#2563eb2e;stroke:#2563eb;stroke-width:3;vector-effect:non-scaling-stroke}.crop-box .handle{fill:#fff;stroke:#2563eb;stroke-width:3;vector-effect:non-scaling-stroke;cursor:grab}.crop-box .handle.on{fill:#2563eb}.crop-status{text-align:center}
