/* Shared workspace layout. Tool renderers and document formats remain independent. */
:root{--ws-paper:#fffdf8;--ws-bg:#f5f3ed;--ws-line:#e5e0d3;--ws-ink:#292620;--ws-muted:#777065;--ws-accent:#b23b2e}
*,*::before,*::after{box-sizing:border-box}
[hidden]{display:none!important}
button,a,input,select,textarea{ -webkit-tap-highlight-color:transparent }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible{outline:2px solid var(--ws-accent);outline-offset:3px}
.ws-switch{position:relative;flex-shrink:0;margin-left:8px;font:13px/1.4 -apple-system,BlinkMacSystemFont,"PingFang SC",sans-serif}
.ws-switch>summary{list-style:none;cursor:pointer;min-height:40px;padding:10px 12px;border:1px solid var(--ws-line);border-radius:8px;background:var(--ws-paper);color:var(--ws-muted);white-space:nowrap;letter-spacing:0}
.ws-switch>summary::-webkit-details-marker{display:none}
.ws-switch>summary::after{display:none!important}
.ws-switch>nav{position:absolute;top:calc(100% + 8px);left:0;min-width:190px;background:var(--ws-paper);border:1px solid var(--ws-line);border-radius:12px;box-shadow:0 8px 32px #2926201a;padding:6px;z-index:100;display:grid!important;gap:2px!important}
.ws-switch nav a{display:block;padding:12px;border-radius:6px;font-size:14px;color:var(--ws-ink);text-decoration:none;min-height:44px;white-space:nowrap}
.ws-switch nav a:hover,.ws-switch nav a[aria-current=page]{background:#f8ece8;color:var(--ws-accent)}
.ws-expand{border:1px solid var(--ws-line);background:var(--ws-paper);color:var(--ws-muted);border-radius:7px;min-width:44px;min-height:44px;font-size:13px;margin-left:auto;cursor:pointer}
.ws-mobile{display:none!important}
body[data-workspace] .topbar,body[data-workspace] .studio-header,body[data-workspace] .site-header{height:64px;min-height:64px;padding:0 20px;gap:12px;flex-wrap:nowrap;background:var(--ws-paper);border-bottom:1px solid var(--ws-line);z-index:60}
body[data-workspace] .brand,body[data-workspace] .brand-text{letter-spacing:0;font-size:17px}
body[data-workspace] .brand small{display:none}
body[data-workspace] .top-actions{gap:10px}
body[data-workspace] .topbar button,body[data-workspace] .studio-header button{min-height:40px}
body[data-workspace] dialog{border:1px solid var(--ws-line);border-radius:16px;max-height:90dvh}
body[data-workspace] dialog::backdrop{background:#28251f50;backdrop-filter:blur(2px)}
body[data-workspace] .small-note,body[data-workspace] .hint{font-size:13px;line-height:1.65}
/* Toolbox: four clear entry cards, with the action always visible. */
body[data-workspace=home] .wrap{max-width:1120px}
body[data-workspace=home] .rv{opacity:1;transform:none;transition:none}
body[data-workspace=home] .hero{padding:40px 0 30px}
body[data-workspace=home] .hero h1{font-size:38px;letter-spacing:.1em}
body[data-workspace=home] .hero p{margin-top:12px;font-size:13px}
body[data-workspace=home] .seal{width:62px;height:62px}
body[data-workspace=home] .seal b{font-size:18px}
body[data-workspace=home] .catalog{border:0}
body[data-workspace=home] .catalog-head{border:0;padding:12px 0 18px}
body[data-workspace=home] .slips{display:grid;grid-template-columns:1fr 1fr;gap:20px;border:0}
body[data-workspace=home] .slip{border:1px solid var(--ws-line);background:var(--ws-paper);border-radius:16px;overflow:hidden}
body[data-workspace=home] .slip a{grid-template-columns:48px 1fr;grid-template-rows:auto 1fr auto;min-height:230px;padding:24px;gap:16px}
body[data-workspace=home] .slip .num{display:none}
body[data-workspace=home] .slip .tag{padding:0;border:0;width:48px;height:48px;border-radius:10px;background:#f8ece8;align-self:start}
body[data-workspace=home] .slip .tag i{writing-mode:horizontal-tb;font-size:17px;letter-spacing:0;color:var(--ws-accent)}
body[data-workspace=home] .slip .body{grid-column:2;grid-row:1/3;padding:0;justify-content:start;gap:10px}
body[data-workspace=home] .slip .body .t{font-size:21px;letter-spacing:.04em;margin-top:7px}
body[data-workspace=home] .slip .body .t::after{display:none}
body[data-workspace=home] .slip .body .d{font-size:14px;line-height:1.8;letter-spacing:0}
body[data-workspace=home] .slip .go{grid-column:2;grid-row:3;padding:0;display:flex;font-family:inherit;font-size:14px;letter-spacing:0;min-height:32px}
body[data-workspace=home] .slip a:hover{background:#faf7f0}
body[data-workspace=home] .soon{display:none}
body[data-workspace=home] footer{padding-top:28px}
/* Long-form workspace. */
body[data-workspace=paiban] .shell{height:calc(100dvh - 64px)}
body[data-workspace=paiban] .drafts{width:220px}
body[data-workspace=paiban] .settings{width:320px}
body[data-workspace=paiban] .settings-heading{min-height:58px;gap:6px}
body[data-workspace=paiban] .preview-toolbar{min-height:58px;gap:10px}
body[data-workspace=paiban] .tabs button{min-height:44px}
.export-group{margin:18px 0;border-top:1px solid var(--ws-line);padding-top:12px}
.export-group h3{font-size:13px;color:var(--ws-muted);font-weight:500;margin:0 0 10px}
/* 3D workspace. */
body[data-workspace=mockup] .shell{height:calc(100dvh - 64px)}
body[data-workspace=mockup] .panel{width:350px}
body[data-workspace=mockup] .panel-close{width:44px;height:44px}
body[data-workspace=mockup] .panel-head{gap:8px}
body[data-workspace=mockup] .work-tabs button{min-height:44px}
body[data-workspace=mockup] .draft-toolbar{padding:10px 12px;background:#fbf8f2;box-shadow:none}
body[data-workspace=mockup] .panel-foot>.primary{display:none}
body[data-workspace=mockup] .stage{background:radial-gradient(ellipse at center,#faf8f2,#e8e3d8)}
/* Guided promotion workspace. */
body[data-workspace=xuantu] .intro{padding:22px 0 18px}
body[data-workspace=xuantu] .topbar{position:sticky;top:0}
body[data-workspace=xuantu] .topbar{justify-content:flex-start}
body[data-workspace=xuantu] .topbar>nav{margin-left:auto}
body[data-workspace=xuantu] .preview{height:calc(100dvh - 64px);padding:16px 24px 12px;top:64px;min-height:0}
body[data-workspace=xuantu] .intro h1{font-size:24px;margin:0}
body[data-workspace=xuantu] .intro p,body[data-workspace=xuantu] .intro .eyebrow{display:none}
body[data-workspace=xuantu] main{height:calc(100dvh - 64px);grid-template-columns:390px minmax(0,1fr)}
body[data-workspace=xuantu] .editor{padding:0 22px 30px}
body[data-workspace=xuantu] .form-section{padding-top:20px;padding-bottom:20px}
body[data-workspace=xuantu] .preview-header{padding:0;min-height:44px;margin-bottom:8px}
body[data-workspace=xuantu] .preview-header .eyebrow{display:none}
body[data-workspace=xuantu] .preview-header h2{font-size:17px}
.header-disclosure{margin:16px 0 0;border:1px solid var(--ws-line);border-radius:10px}
.header-disclosure>summary{padding:12px 14px;font-size:14px;cursor:pointer;min-height:44px;color:var(--ws-muted)}
.header-disclosure .header-upload{border:0;margin:0;padding:12px}
.product-card.is-collapsed>*:not(.product-head){display:none!important}
.product-card.is-collapsed{padding-bottom:12px}
.product-head{flex-wrap:wrap;gap:8px}
.product-collapse{border:0;background:transparent;color:var(--ws-accent);font-size:13px;padding:8px;min-height:40px;margin-left:auto}
.product-summary{font-size:13px;font-weight:400;color:var(--ws-muted);display:block;max-width:220px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
/* Advanced promotion editor, retaining the existing editing engine. */
body[data-workspace=advanced] [code-path="src/components/TopBar.tsx:14:5"]{height:64px;min-height:64px;padding:0 16px;gap:10px;background:var(--ws-paper)!important;border-bottom:1px solid var(--ws-line)}
.ws-guided-link{font-size:13px;white-space:nowrap;color:var(--ws-accent);padding:10px;border-right:1px solid var(--ws-line)}
body[data-workspace=advanced] [code-path="src/components/TopBar.tsx:20:7"]{max-width:340px;font-size:15px}
body[data-workspace=advanced] [code-path="src/components/TopBar.tsx:38:7"]{margin-left:auto;min-height:40px}
body[data-workspace=advanced] [code-path="src/App.tsx:98:7"]{background:#e9e5dd!important}
@media(min-width:901px){
 body[data-workspace=advanced] [code-path="src/components/Toolbar.tsx:17:5"]{position:absolute;left:0;top:64px;bottom:0;height:auto!important;width:88px;flex-direction:column;justify-content:flex-start;padding:16px 8px;gap:8px;border-right:1px solid var(--ws-line);background:var(--ws-paper)!important}
 body[data-workspace=advanced] [code-path="src/components/Toolbar.tsx:21:11"]{width:72px;min-height:64px;flex:none}
 body[data-workspace=advanced] [code-path="src/components/Toolbar.tsx:27:13"]{font-size:12px}
 body[data-workspace=advanced] [code-path="src/App.tsx:98:7"]{padding:24px 24px 24px 112px!important}
 body[data-workspace=advanced]:has([code-path="src/components/Drawer.tsx:38:5"]) [code-path="src/App.tsx:98:7"]{padding-right:348px!important}
 body[data-workspace=advanced]:has([code-path="src/components/Drawer.tsx:38:5"]) [code-path="src/App.tsx:115:9"]{right:336px}
 body[data-workspace=advanced] [code-path="src/components/Drawer.tsx:38:5"]{position:fixed;left:auto;right:0;top:64px;bottom:0;width:320px;height:auto!important;border-radius:0;border-left:1px solid var(--ws-line);animation:none!important;transform:none!important}
 body[data-workspace=advanced] [code-path="src/components/Drawer.tsx:48:9"]{display:none}
}
/* Bookshelf and book studio. */
body[data-workspace=ebook] .site-header{max-width:none;width:100%;margin:0}
body[data-workspace=ebook] .site-header nav a.ws-create{height:40px;min-height:40px;line-height:20px;padding:10px 16px;border-radius:8px}
body[data-workspace=ebook] .site-header>nav{gap:16px;margin-left:auto;align-items:center}
body[data-workspace=ebook] .header-note{display:none}
body[data-workspace=ebook] .library-heading{padding-top:34px;padding-bottom:28px}
body[data-workspace=ebook] .library-heading h1{font-size:34px}
body[data-workspace=ebook] #book-empty{padding:52px 24px;text-align:center;background:var(--ws-paper);border:1px dashed #cfc7b8;border-radius:16px;color:var(--ws-muted);line-height:2}
.ws-create{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:10px 20px;border-radius:8px;background:var(--ws-accent);color:white!important;font-size:14px;text-decoration:none;white-space:nowrap}
body[data-workspace=ebook] #book-empty .ws-create{margin-top:20px}
body[data-workspace=ebook]:has(#book-empty:not([hidden])) .filters{display:none}
body[data-workspace=ebook]:has(#book-empty:not([hidden])) #bookshelf{display:none}
body[data-workspace=studio]{background:var(--ws-bg)}
body[data-workspace=studio] .studio-header strong{font-size:17px;white-space:nowrap}
body[data-workspace=studio] .studio-layout{grid-template-columns:220px minmax(0,1fr);height:calc(100dvh - 64px);overflow:hidden}
body[data-workspace=studio] .book-panel{padding:18px 14px;min-height:0;overflow:auto;background:var(--ws-paper)}
body[data-workspace=studio] .book-panel .panel-heading{display:grid;grid-template-columns:1fr 1fr;gap:10px}
body[data-workspace=studio] .book-panel .panel-heading h2{font-size:16px;white-space:nowrap}
body[data-workspace=studio] .book-panel #new-book{min-height:40px}
body[data-workspace=studio] .book-panel #backup-books,body[data-workspace=studio] .book-panel #restore-books{font-size:12px;min-height:36px;flex:1}
body[data-workspace=studio] .editor{padding:0;display:flex;flex-direction:column;overflow:hidden}
body[data-workspace=studio] .editor-toolbar{margin:0;padding:12px 16px;background:var(--ws-paper);border-bottom:1px solid var(--ws-line);flex-shrink:0;gap:8px}
body[data-workspace=studio] .editor-toolbar button,body[data-workspace=studio] .editor-toolbar a{min-height:40px;font-size:13px;border-color:var(--ws-line);white-space:nowrap}
body[data-workspace=studio] .page-workspace{flex:1;min-height:0;grid-template-columns:100px minmax(180px,1fr) 260px;gap:0;align-items:stretch;overflow:hidden}
body[data-workspace=studio] .page-panel{border:0;border-right:1px solid var(--ws-line);border-radius:0;background:var(--ws-paper);max-height:none}
body[data-workspace=studio] .canvas-area{padding:16px;overflow:auto;background:#ece8df}
body[data-workspace=studio] #canvas-mount{min-height:0;padding:8px 8px 20px}
body[data-workspace=studio] .properties{border:0;border-left:1px solid var(--ws-line);border-radius:0;background:var(--ws-paper);overflow:auto;padding:18px}
body[data-workspace=studio] .properties h3{display:flex;gap:8px;align-items:center;margin-bottom:16px}
body[data-workspace=studio] .properties h3 button{width:auto;margin:0 0 0 auto;flex-shrink:0}
body[data-workspace=studio] #notice{position:fixed;top:70px;left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100vw - 32px);z-index:80;border-radius:10px;box-shadow:0 4px 16px #29262014;pointer-events:none}
body[data-workspace=studio] .editor-footer{padding:8px 16px;margin:0;min-height:44px;background:var(--ws-paper);border-top:1px solid var(--ws-line);flex-shrink:0}
body[data-workspace=studio] .editor-footer button{border:0;background:transparent;padding:6px;min-height:32px}
body[data-workspace=studio] #book-info-dialog{width:min(680px,94vw);padding:24px}
body[data-workspace=studio] #book-info-dialog .book-settings{grid-template-columns:1fr 1fr;border:0;padding:0;background:transparent;margin-top:20px}
body[data-workspace=studio] #book-info-dialog .cover-settings{flex-wrap:wrap}
body[data-workspace=studio] .studio label{font-size:13px}
body[data-workspace=studio] .studio input{font-size:15px}
@media(min-width:901px) and (max-width:1200px){body[data-workspace=studio] .studio-layout{grid-template-columns:180px minmax(0,1fr)}body[data-workspace=studio] .page-workspace{grid-template-columns:80px minmax(160px,1fr) 230px}body[data-workspace=studio] .editor-toolbar{gap:5px;padding:10px}}
@media(max-width:900px){
 .ws-mobile{display:inline-flex!important}.ws-switch{margin-left:0}.ws-switch>summary{font-size:12px;padding:10px 8px}.ws-switch nav{left:0}
 body[data-workspace] .topbar,body[data-workspace] .studio-header,body[data-workspace] .site-header{height:58px;min-height:58px;padding:0 12px;gap:8px}
 body[data-workspace] .brand,body[data-workspace] .brand-text{font-size:15px;white-space:nowrap}
 body[data-workspace] .brand .mark{width:28px;height:28px}
 body[data-workspace] button,body[data-workspace] select{min-height:44px}
 body[data-workspace] input:not([type=color]):not([type=range]):not([type=checkbox]):not([type=radio]),body[data-workspace] textarea{font-size:16px}
 body[data-workspace=home] .wrap{padding:0 20px}body[data-workspace=home] .hero{padding:28px 0 20px}body[data-workspace=home] .hero h1{font-size:30px}body[data-workspace=home] .slips{grid-template-columns:1fr;gap:12px}body[data-workspace=home] .slip a{min-height:160px;padding:20px;gap:12px}body[data-workspace=home] .slip .body .t{font-size:19px}body[data-workspace=home] .top-tag{display:none}
 body[data-workspace=paiban] .shell,body[data-workspace=mockup] .shell{height:calc(100dvh - 58px)}
 body[data-workspace=paiban] .doc-info{display:none}body[data-workspace=paiban] #saved{display:none}body[data-workspace=paiban] .top-actions{margin-left:auto;gap:4px}body[data-workspace=paiban] #undo{display:none}
 body[data-workspace=paiban] .settings{width:auto;height:56dvh;max-height:none;border-radius:16px 16px 0 0;box-shadow:0 -4px 24px #2926201a}
 body[data-workspace=paiban] #sheet-backdrop{display:none!important}
 body[data-workspace=paiban].ws-sheet-open .workspace{height:calc(44dvh - 58px);padding-bottom:0}
 body[data-workspace=paiban].ws-sheet-open .paper-stage{padding:8px;min-height:0;align-items:center;overflow:hidden}
 body[data-workspace=paiban] #preview{max-width:100%}
 body[data-workspace=paiban].ws-sheet-open #preview{max-height:100%;width:auto;height:auto;object-fit:contain;flex-shrink:1}
 body[data-workspace=paiban].ws-sheet-open .preview-hint{display:none}
 body[data-workspace=paiban] .preview-toolbar{padding:6px 10px;min-height:50px;gap:4px;flex-wrap:nowrap}
 body[data-workspace=paiban] .preview-toolbar button{font-size:12px;padding-inline:7px}
 body[data-workspace=paiban] .settings-heading{min-height:54px;padding:6px 14px}
 body[data-workspace=paiban] .page-nav{padding:2px;min-height:40px}
 body[data-workspace=paiban] .page-nav button{min-height:36px}
 body[data-workspace=paiban] .settings-footer{font-size:12px;padding:8px 14px}
 body[data-workspace=paiban].ws-expanded .settings{height:84dvh}
 body[data-workspace=paiban].ws-expanded.ws-sheet-open .workspace{height:calc(16dvh - 58px)}
 body[data-workspace=mockup] .panel{width:auto;height:56dvh;max-height:none}
 body[data-workspace=mockup].panel-open .stage{height:calc(44dvh - 58px);min-height:100px}
 body[data-workspace=mockup].ws-expanded .panel{height:84dvh}
 body[data-workspace=mockup].ws-expanded.panel-open .stage{height:calc(16dvh - 58px);min-height:50px}
 body[data-workspace=mockup] .panel-foot>.primary{display:block}
 body[data-workspace=mockup] .panel-heading small{display:none}
 body[data-workspace=mockup] .panel-title{font-size:16px}
 body[data-workspace=mockup] .top-actions{margin-left:auto}
 body[data-workspace=mockup] .top-actions #export-btn{display:none}
 body[data-workspace=xuantu] main{height:auto;display:block}
 body[data-workspace=xuantu] .editor{padding:0 18px 100px;max-width:600px;margin:auto}
 body[data-workspace=xuantu] .intro{padding:22px 0 12px}
 body[data-workspace=xuantu] .intro h1{font-size:22px}
 body[data-workspace=xuantu] .topbar>nav{margin-left:auto;gap:6px}
 body[data-workspace=xuantu] .topbar>nav>a{display:none}
 body[data-workspace=xuantu] .preview{padding-top:0;top:58px;height:calc(100dvh - 58px)}
 body[data-workspace=xuantu] .preview-close{position:absolute;top:4px;right:12px;min-height:44px;z-index:2;padding:8px}
 body[data-workspace=xuantu] .preview-header{padding:16px 18px 10px}
 body[data-workspace=xuantu] .preview-header h2{font-size:16px}
 body[data-workspace=xuantu] .preview-header #preview-meta{display:none}
 body[data-workspace=advanced] [code-path="src/components/TopBar.tsx:14:5"]{height:58px;min-height:58px;padding:0 8px;gap:4px}
 body[data-workspace=advanced] .ws-guided-link{padding:8px 6px;font-size:12px}
 body[data-workspace=advanced] .ws-switch{display:none}
 body[data-workspace=advanced] [code-path="src/components/Drawer.tsx:38:5"]{bottom:calc(62px + env(safe-area-inset-bottom));height:54dvh!important;border:1px solid var(--ws-line);border-radius:16px 16px 0 0}
 body[data-workspace=advanced] [code-path="src/components/Drawer.tsx:51:11"]{min-width:44px;min-height:44px}
 body[data-workspace=advanced] [code-path="src/components/Toolbar.tsx:27:13"]{font-size:12px}
 body[data-workspace=ebook] .site-header>nav{gap:8px}
 body[data-workspace=ebook] .site-header>nav>a:not(.ws-create){display:none}
 body[data-workspace=ebook] .brand-symbol{display:none}
 body[data-workspace=ebook] .ws-create{padding:8px 10px;font-size:13px}
 body[data-workspace=ebook] .brand small{display:none}
 body[data-workspace=ebook] .library-heading h1{font-size:28px}
 body[data-workspace=ebook] .reader-bottom>span{display:none}
 body[data-workspace=studio] .studio-header>a{display:none}
 body[data-workspace=studio] .studio-header strong{font-size:15px;max-width:100px;overflow:hidden;text-overflow:ellipsis}
 body[data-workspace=studio] #save-state{font-size:11px;margin-left:auto;max-width:60px;line-height:1.4}
 body[data-workspace=studio] #save-book{padding:8px 12px;font-size:13px;white-space:nowrap}
 body[data-workspace=studio] .studio-layout{display:block;height:calc(100dvh - 58px)}
 body[data-workspace=studio] .editor{height:100%;padding:0}
 body[data-workspace=studio] .book-panel{display:none;position:fixed;inset:58px 0 auto;z-index:45;max-height:65dvh;box-shadow:0 8px 30px #29262030;border-bottom:1px solid var(--ws-line)}
 body[data-workspace=studio].ws-books-open .book-panel{display:block}
 body[data-workspace=studio] #book-list{display:block}
 body[data-workspace=studio] .book-row{display:block;width:100%;max-width:none}
 body[data-workspace=studio] .editor-toolbar{padding:8px;flex-wrap:nowrap;overflow-x:auto;gap:6px;min-height:60px}
 body[data-workspace=studio] .editor-toolbar button,body[data-workspace=studio] .editor-toolbar a{flex-shrink:0;font-size:12px;padding:8px 10px}
 body[data-workspace=studio] .page-workspace{grid-template-columns:64px minmax(0,1fr)}
 body[data-workspace=studio] .page-panel{padding:8px 5px}
 body[data-workspace=studio] .page-panel .panel-heading{flex-direction:column;gap:4px;margin-bottom:10px}
 body[data-workspace=studio] .page-panel #add-page{width:44px}
 body[data-workspace=studio] .canvas-area{padding:10px 8px}
 body[data-workspace=studio] .canvas-heading{font-size:12px;flex-wrap:wrap}
 body[data-workspace=studio] .page-actions{gap:4px}
 body[data-workspace=studio] .page-actions button{font-size:12px;padding:8px;min-height:40px}
 body[data-workspace=studio] .properties{display:none;position:fixed;inset:auto 0 0;z-index:55;height:50dvh;border:1px solid var(--ws-line);border-radius:16px 16px 0 0;box-shadow:0 -4px 24px #29262024;padding:14px 18px calc(20px + env(safe-area-inset-bottom))}
 body[data-workspace=studio].ws-properties-open .properties{display:block}
 body[data-workspace=studio].ws-properties-open .page-workspace{padding-bottom:calc(50dvh - 44px)}
 body[data-workspace=studio] .properties #element-fields{display:block}
 body[data-workspace=studio] .properties .ws-expand{padding:8px;margin-left:auto}
 body[data-workspace=studio] .editor-footer{font-size:12px;padding:6px 10px}
 body[data-workspace=studio] .editor-footer #delete-book{display:none}
 body[data-workspace=studio] #book-info-dialog{padding:20px}
 body[data-workspace=studio] #book-info-dialog .book-settings{grid-template-columns:1fr 1fr;gap:14px}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}body[data-workspace=home] .rv{opacity:1;transform:none}}
