:root{--surface:#fdfcf9;--ink:#31332f;--muted:#817f77;--line:#e8e5dd;--accent:#a56b53;--accent-soft:#f6e9e1;--ui:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;--book:"Songti SC","STSong","SimSun",serif}
*{box-sizing:border-box;letter-spacing:0}body{margin:0;color:var(--ink);background:var(--surface);font:13px/1.55 var(--ui);-webkit-font-smoothing:antialiased}button,input,select{font:inherit;color:inherit}button,a,input,select{-webkit-tap-highlight-color:transparent}button{cursor:pointer}a{color:inherit;text-decoration:none}button{border:0;background:none}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--accent);outline-offset:4px}[hidden]{display:none!important}.ico{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round;flex:none}.topbar{height:68px;display:flex;align-items:center;padding:0 42px;gap:64px;border-bottom:1px solid var(--line);background:var(--surface)}.brand{display:flex;gap:10px;align-items:center;font:600 25px var(--book)}.brand-icon{width:30px;height:30px;display:grid;place-items:center;border:1px solid #e0d6ca;background:#f8f2ea;border-radius:8px;color:var(--accent)}.topbar nav{display:flex;align-self:stretch;gap:32px}.topbar nav a{position:relative;display:flex;align-items:center;color:var(--muted)}.topbar nav a[aria-current=page]{color:var(--ink);font-weight:600}.topbar nav a[aria-current=page]:after{content:"";position:absolute;bottom:0;left:0;right:0;height:2px;background:var(--accent)}.topbar>.btn{margin-left:auto}.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:36px;padding:8px 14px;border:1px solid var(--line);border-radius:6px;white-space:nowrap;background:var(--surface);font-weight:500}.btn:hover{background:#f1eee7}.btn.primary{background:var(--ink);border-color:var(--ink);color:#fff}.btn.primary:hover{background:#50534d}.icon-btn{display:grid;place-items:center;width:34px;height:34px;border-radius:6px}.icon-btn:hover{background:#eeeae2}main{max-width:1364px;padding:0 42px;margin:auto}.scene-section{padding-top:38px}.section-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:23px}.section-heading h1{font:500 29px/1.45 var(--book);margin:6px 0 0}.eyebrow{font-size:10px;color:var(--muted)}.section-note{color:var(--muted);font-size:12px;align-self:flex-end;padding-bottom:4px}.scene-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px}.scene-card{padding:0;text-align:left;min-width:0;border-bottom:2px solid var(--line);transition:border-color .18s}.scene-card[aria-selected=true]{border-color:var(--accent)}.scene-art{position:relative;display:flex;align-items:center;justify-content:center;aspect-ratio:1.62;overflow:hidden;border-radius:5px}.album-art{background:#e8eff1}.journal-art{background:#f2e6e7}.magazine-art{background:#e8e9e4}.scene-art img{display:block;width:82%;height:auto;box-shadow:0 8px 13px #29373220;transition:transform .22s}.journal-art img{transform:rotate(-5deg);width:78%}.magazine-art img{transform:rotate(3deg);width:80%}.scene-card:hover .scene-art img{transform:translateY(-4px)}.scene-number{position:absolute;bottom:12px;left:16px;font-size:8px;color:#64716f}.scene-caption{display:flex;align-items:center;justify-content:space-between;padding:17px 1px 19px}.scene-caption strong{font:600 21px var(--book);display:block;margin-bottom:5px}.scene-caption small{display:block;font-size:12px;color:var(--muted)}.scene-arrow{width:30px;height:30px;border:1px solid var(--line);border-radius:50%;display:grid;place-items:center}.scene-card[aria-selected=true] .scene-arrow{background:var(--accent-soft);border-color:#e4cdbf;color:var(--accent)}.templates-section{padding:33px 0 32px}.section-heading h2{margin:0;font-size:19px;font-weight:600}.section-heading p{margin:6px 0 0;font-size:12px;color:var(--muted)}.topic-row{display:flex;flex-wrap:wrap;gap:22px;margin:-4px 0 22px;border-bottom:1px solid var(--line)}.topic-row button{padding:9px 0 12px;position:relative;color:var(--muted)}.topic-row button[aria-pressed=true]{color:var(--accent);font-weight:600}.topic-row button[aria-pressed=true]:after{content:"";position:absolute;bottom:-1px;left:0;right:0;height:2px;background:var(--accent)}.template-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px;min-height:242px}.template{min-width:0}.template-preview{padding:0;display:flex;align-items:center;justify-content:center;position:relative;width:100%;aspect-ratio:1.82;background:#f0f1ed;border-radius:4px;overflow:hidden}.template-preview img{width:85%;height:auto;display:block;box-shadow:0 4px 8px #22222214;transition:transform .2s}.template-preview:hover img{transform:scale(1.025)}.preview-label{position:absolute;bottom:12px;right:12px;display:flex;align-items:center;gap:5px;padding:5px 8px;border:1px solid var(--line);border-radius:5px;background:#fdfcf9f5;font-size:11px;opacity:0;transition:opacity .2s}.template-preview:hover .preview-label,.template-preview:focus-visible .preview-label{opacity:1}.template-meta{display:flex;gap:10px;align-items:center;justify-content:space-between;padding:13px 0}.template-meta h3{margin:0;font-size:13px;font-weight:500}.template-meta p{margin:4px 0 0;color:var(--muted);font-size:11px}.template-meta .icon-btn{color:var(--muted)}.blank-preview{border:1px dashed #d7d7cc;background:transparent}.blank-book{display:grid;place-items:center;width:64%;aspect-ratio:1.484;background:#fff;box-shadow:0 4px 8px #2222220c;position:relative;color:#aaa99e}.blank-book:before{content:"";position:absolute;left:50%;top:0;bottom:0;border-left:1px solid var(--line)}.blank-book .ico{background:#fff;z-index:1;width:24px;height:24px}.works-section{padding:28px 0;border-top:1px solid var(--line)}.text-link{display:flex;gap:8px;align-items:center;color:var(--muted);font-size:12px}.text-link:hover{color:var(--accent)}.works-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:22px}.work-image{aspect-ratio:1.7;display:flex;align-items:center;justify-content:center;background:#ecefe9;border-radius:4px;overflow:hidden}.work-image img{width:100%;height:100%;object-fit:cover}.work-image span{font:24px var(--book);padding:20px;overflow-wrap:anywhere}.work-card h3{font-size:13px;font-weight:500;margin:10px 0 3px;overflow-wrap:anywhere}.work-card p{color:var(--muted);font-size:11px;margin:0}.work-card:hover h3{color:var(--accent)}.empty-state{color:var(--muted);padding:14px 0;margin:0;font-size:12px}.footer{border-top:1px solid var(--line);display:flex;gap:18px;align-items:center;color:var(--muted);font-size:11px;padding:23px 0 28px}.footer-brand{font:600 17px var(--book);color:var(--ink)}.storage-note{margin-left:auto}.works-toolbar{display:flex;gap:12px;margin-bottom:24px}.search{display:flex;gap:8px;align-items:center;border:1px solid var(--line);border-radius:6px;padding:8px 11px;max-width:340px;flex:1}.search input{border:0;outline:0;background:transparent;width:100%;min-width:0}.works-toolbar select{border:1px solid var(--line);border-radius:6px;padding:8px;background:var(--surface)}body.works-view .works-section{border:0;min-height:65vh;padding-top:42px}dialog{border:1px solid var(--line);border-radius:8px;padding:20px;width:min(840px,calc(100% - 32px));max-height:calc(100dvh - 40px);overflow:auto;background:var(--surface);color:var(--ink);box-shadow:0 22px 80px #0002}dialog::backdrop{background:#24292660;backdrop-filter:blur(3px)}.dialog-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px;color:var(--muted);font-size:12px}.dialog-art{background:#e9edeb;padding:24px;display:flex;justify-content:center;border-radius:4px}.dialog-art img{width:100%;height:auto;display:block;box-shadow:0 6px 16px #0002}.dialog-bottom{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:22px 0 4px}.dialog-bottom h2{font:600 24px var(--book);margin:0 0 6px}.dialog-bottom p{color:var(--muted);font-size:12px;margin:0}
.scene-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.scene-art img{width:74%}.magazine-art img{width:70%}.template-preview img{width:74%}
@media(min-width:651px){.scene-grid .scene-art{aspect-ratio:2.45}.scene-art img{width:auto;max-width:77%;height:79%;object-fit:contain}.scene-grid .magazine-art img{width:auto}}
.dialog-art{aspect-ratio:920/620;max-height:52dvh}.dialog-art img{width:auto;height:100%;max-width:100%;object-fit:contain}.dialog-pages{display:flex;justify-content:center;gap:24px;margin-top:14px}.dialog-pages button{padding:7px 2px;color:var(--muted);font-size:12px;border-bottom:2px solid transparent}.dialog-pages button[aria-pressed=true]{color:var(--accent);border-color:var(--accent)}.template-reference{display:inline-block;color:var(--muted);font-size:11px;margin-top:12px;text-decoration:underline;text-underline-offset:3px}.template-reference:hover{color:var(--accent)}
.create-dialog{width:min(430px,calc(100% - 32px));padding:24px}.create-dialog h2{font-size:18px;margin:0;color:var(--ink)}.new-scene-options{border:0;margin:24px 0;padding:0;display:flex;gap:10px}.new-scene-options legend{font-size:12px;color:var(--muted);margin-bottom:12px}.new-scene-options label{flex:1;display:flex;justify-content:center;align-items:center;gap:7px;border:1px solid var(--line);padding:16px 8px;border-radius:6px;cursor:pointer}.new-scene-options label:has(:checked){border-color:var(--accent);color:var(--accent);background:var(--accent-soft)}.new-scene-options label:has(:focus-visible){outline:2px solid var(--accent);outline-offset:3px}.new-scene-options input{position:absolute;opacity:0;width:1px;height:1px}.create-dialog .btn.primary{width:100%}
@media(min-width:1550px){.scene-section{padding-top:48px}.scene-art{aspect-ratio:1.65}}
@media(max-width:1000px){.topbar{padding:0 24px;gap:32px}main{padding:0 24px}.scene-grid,.template-grid{gap:16px}.scene-art{aspect-ratio:1.45}.scene-number{font-size:7px;left:12px;bottom:10px}.section-note{display:none}.works-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.template-grid{min-height:200px}.scene-caption strong{font-size:20px}}
@media(max-width:650px){.topbar{height:62px;padding:0 18px;gap:24px}.brand{font-size:22px}.brand-icon{display:none}.topbar nav{gap:20px;font-size:12px}.topbar>.btn{width:32px;min-height:32px;padding:6px;font-size:0;gap:0}.topbar>.btn .ico{width:18px;height:18px}main{padding:0 18px}.scene-section{padding-top:26px}.section-heading h1{font-size:25px}.intro{margin-bottom:20px}.scene-grid{grid-template-columns:1fr;gap:12px}.scene-card{display:grid;grid-template-columns:43% 1fr;gap:18px;border:1px solid var(--line);border-radius:5px;overflow:hidden}.scene-card[aria-selected=true]{border-color:var(--accent)}.scene-art{aspect-ratio:1.3;border-radius:0}.scene-number{font-size:6px;left:8px;bottom:7px}.scene-caption{padding:14px 14px 14px 0;gap:7px}.scene-caption strong{font-size:20px}.scene-caption small{font-size:11px;max-width:110px}.scene-arrow{width:25px;height:25px;flex:none}.templates-section{padding-top:28px}.section-heading h2{font-size:18px}.section-heading{gap:12px}.section-heading>.btn{font-size:12px;padding:7px 9px}.topic-row{gap:22px}.template-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 12px;min-height:0}.template-preview{aspect-ratio:1.5}.template-meta{padding:10px 0}.template-meta h3{font-size:12px}.template-meta p{font-size:10px}.template-meta .icon-btn{width:24px;height:28px}.template-grid .template:last-child{grid-column:1/-1;display:flex;align-items:center;gap:14px;border-top:1px solid var(--line);padding-top:16px}.template-grid .template:last-child .template-preview{width:90px;flex:none}.template-grid .template:last-child .template-meta{flex:1}.preview-label{display:none}.works-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 12px}.works-section{padding-top:24px}.footer{flex-wrap:wrap;gap:10px 16px}.storage-note{margin-left:0;width:100%;font-size:10px}.dialog-art{padding:12px}.dialog-bottom{flex-wrap:wrap;gap:18px}.dialog-bottom h2{font-size:22px}.dialog-bottom>.btn{width:100%}.works-toolbar{flex-wrap:wrap}.search{min-width:160px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}
.editorial-preview{aspect-ratio:1.25}.editorial-preview img{height:87%;width:auto;max-width:87%;object-fit:contain;box-shadow:2px 6px 13px #2222}
.dialog-pages{justify-content:flex-start;gap:10px;overflow-x:auto;padding:3px 2px 8px;scrollbar-width:thin}
.dialog-pages button{flex:0 0 72px;padding:5px 4px;font-size:10px;border:1px solid transparent;border-bottom:2px solid transparent;border-radius:3px}
.dialog-pages button img{display:block;width:64px;height:43px;object-fit:contain;margin-bottom:7px}
.dialog-pages button[aria-pressed=true]{background:var(--accent-soft);border-color:var(--accent)}
.work-image{position:relative;display:flex;align-items:center;justify-content:center}
.work-image .work-backdrop{position:absolute;inset:0;background-size:cover;background-position:center}
.work-image img{position:relative;width:auto;max-width:80%;height:80%;object-fit:contain}
@media(max-width:650px){.editorial-preview{aspect-ratio:.88}.editorial-preview img{height:83%}.dialog-pages{gap:6px}.dialog-pages button{flex-basis:60px}.dialog-pages button img{width:52px;height:36px}}
/* Article is a peer creation scene; previews use the article renderer. */
.scene-grid{grid-template-columns:repeat(var(--scene-count,3),minmax(0,1fr))}.article-art{background:#eaded3}.scene-grid .article-art img{height:auto;width:58%;max-width:58%;max-height:none;align-self:flex-start;transform:rotate(-4deg) translateY(20px);object-fit:cover}.article-template{background:#e9e3d9;align-items:flex-start;padding-top:22px}.article-template img{width:60%;height:auto;box-shadow:0 3px 15px #30251920}.article-template-reading{background:#fff;max-width:430px;margin:auto;padding:25px 22px;max-height:55vh;overflow:auto}.article-template-reading h1{font-size:24px;line-height:1.5;color:#292925}.article-blank>span{width:45%;height:80%;background:white;display:grid;place-items:center;border:1px solid var(--line)}.new-scene-options{flex-wrap:wrap}.new-scene-options label{min-width:95px;font-size:12px}
@media(min-width:651px){.scene-grid .scene-art{aspect-ratio:1.8}.scene-caption strong{font-size:20px}.scene-caption small{font-size:11px}}
@media(max-width:650px){.scene-grid{grid-template-columns:1fr}.scene-grid .article-art img{width:70%;max-width:70%;transform:rotate(-4deg) translateY(14px)}.intro h1{font-size:23px}.article-template{padding-top:12px}.article-template img{width:70%}}

/* Keep both template choices together in one trailing action group. */
.dialog-template-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;margin-left:auto;flex-shrink:0}
@media(max-width:700px){.dialog-bottom{flex-wrap:wrap}.dialog-template-actions{width:100%;flex-wrap:wrap}.dialog-template-actions>.btn{flex:1 1 auto}}

.topbar #cloudAccount{width:auto;font-size:12px;min-width:44px;margin-left:8px}#importBackup{margin-bottom:16px}#importStatus{color:var(--muted);font-size:12px}