*{box-sizing:border-box}body{margin:0;color:#263846;background:#f6f8fa;font:13px -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif}button,input,select{font:inherit}button{cursor:pointer;background:#fff;border:1px solid #d4dde4;border-radius:6px;padding:8px 11px;color:inherit}button:hover{background:#edf4f8}button:disabled{opacity:.4;cursor:default}.active,.primary{background:#17698a!important;color:#fff!important;border-color:#17698a!important}button:focus-visible,input:focus-visible,select:focus-visible,canvas:focus-visible{outline:2px solid #288ab5;outline-offset:2px}[hidden]{display:none!important}header{height:66px;display:flex;align-items:center;gap:12px;padding:0 20px;background:white;border-bottom:1px solid #dfe5e9}.brand{text-decoration:none;color:#193c50;font-size:20px;font-weight:750;white-space:nowrap}.brand small{display:block;font-size:10px;font-weight:400;color:#82949f}select,input:not([type=checkbox],[type=range],[type=color]){min-width:0;border:1px solid #d9e1e6;border-radius:5px;padding:8px;background:white;color:inherit}#vehicle{max-width:285px}#project-name{flex:1}.toolbar{display:flex;align-items:center;gap:7px;padding:10px 18px;background:white;border-bottom:1px solid #dfe5e9;flex-wrap:wrap}#tools{display:flex;gap:5px;margin-right:auto}.toolbar label{display:flex;align-items:center;gap:4px;font-size:11px}#view-angle{width:55px;padding:5px}main{display:grid;grid-template-columns:235px minmax(350px,1fr) 245px;height:calc(100dvh - 124px);min-height:570px}aside{padding:18px;background:white;overflow:auto}.library{border-right:1px solid #dfe5e9}.inspector{border-left:1px solid #dfe5e9}.tabs{display:flex;gap:4px}.tabs button{padding:7px 9px;font-size:11px}.library .tabs{margin-bottom:22px}h2{font-size:14px;margin:20px 0 13px}h3{font-size:12px;margin:22px 0 10px}p,li{line-height:1.8;color:#73848f}ol{padding-left:20px}.wide{width:100%;margin-bottom:9px}.swatches{display:flex;gap:8px;flex-wrap:wrap}.swatches button{width:27px;height:27px;padding:0;border-radius:50%;border:2px solid white;box-shadow:0 0 0 1px #dbe2e7}.presets{display:grid;grid-template-columns:1fr 1fr;gap:8px}.presets button{height:48px;font-size:11px;background:#edf3f6}#drop-zone{padding:14px;text-align:center;font-size:11px;border:1px dashed #bacbd5;color:#8b9aa4;border-radius:6px;margin-bottom:15px}label{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:11px 0;font-size:12px}label input:not([type=checkbox],[type=color],[type=range]){width:110px}input[type=color]{width:65px;height:30px;border:1px solid #dae0e5;background:white;border-radius:4px}input[type=range]{max-width:110px}.check{justify-content:flex-start}.workspace{display:flex;flex-direction:column;min-width:0;overflow:hidden}.canvas-head{height:64px;flex:none;display:flex;align-items:center;justify-content:space-between;padding:0 22px;background:#f8fafb;gap:10px}.canvas-head strong{font-size:13px}.canvas-head small{display:block;color:#92a0a9;font-size:11px;margin-top:5px}#stage-layout{display:flex;flex:1;min-height:0}#art-viewport{position:relative;flex:1;min-width:0;overflow:auto;display:flex;align-items:center;justify-content:center;background-color:#dce3e8;background-image:radial-gradient(#b9c8d155 .7px,transparent .7px);background-size:12px 12px}#art-wrap{position:relative;flex:none;box-shadow:0 5px 30px #233d4f1a;transform-origin:center}#display{display:block;width:100%;height:100%}#interaction{position:absolute;inset:0;width:100%;height:100%;touch-action:none}#preview-panel{flex:1;min-width:0;display:flex;flex-direction:column;background:#e8edf0}#personal-3d{flex:1;min-height:280px;position:relative}#personal-3d iframe{width:100%;height:100%;position:absolute;inset:0;border:0}#personal-3d[data-loading=true]:after{content:'正在载入 3D 车型…';position:absolute;inset:0;display:grid;place-items:center;background:#e8edf0}.camera-views{display:flex;justify-content:center;gap:5px;padding:10px}#preview-status,#preview-note{padding:0 18px;font-size:11px;margin:4px 0 10px}footer{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:38px;padding:0 16px;background:#f8fafb;font-size:11px;color:#69808e}footer label{font-size:11px}#layer-list{max-height:250px;overflow:auto;display:grid;gap:6px}.layer-row{display:flex;align-items:center;gap:6px}.layer-row button{flex:1;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.layer-actions{display:flex;flex-wrap:wrap;gap:4px;margin-top:10px}.layer-actions button{font-size:11px;padding:6px 9px}.grid{display:grid;grid-template-columns:1fr 1fr;gap:7px}.grid label{display:block;margin:4px 0}.grid input{width:100%!important;margin-top:5px}#project-list{display:grid;gap:8px;margin-top:15px}.project-card{text-align:left;line-height:1.7}a{color:#17698a}.empty{padding:15px 0;font-size:12px;color:#8a9da7}@media(max-width:1100px){main{grid-template-columns:200px minmax(300px,1fr) 205px}header{flex-wrap:wrap;height:auto;padding:12px}.toolbar{padding:8px}#project-name{max-width:200px}aside{padding:12px}}@media(max-width:780px){header{gap:8px}.brand{font-size:17px}#vehicle{order:3;max-width:100%;flex:1}#project-name{max-width:100%;order:4;flex:1;min-width:150px}main{height:auto;display:flex;flex-direction:column;min-height:0}.workspace{order:-1;height:670px}.library,.inspector{overflow:visible;border:0;padding:20px}.canvas-head{padding:12px;flex-wrap:wrap;height:auto;min-height:70px}#stage-layout{min-height:430px}#stage-layout.split{flex-direction:column}#stage-layout.split #art-viewport{min-height:260px}#stage-layout.split #preview-panel{min-height:270px}.workspace:has(.split){height:800px}#tools{flex-wrap:wrap}.toolbar button{font-size:11px;padding:7px}.grid{grid-template-columns:repeat(3,1fr)}footer{flex-wrap:wrap;padding:7px 12px}.tabs button{padding:6px 8px}.library .presets{grid-template-columns:repeat(4,1fr)}}
@media(max-width:780px){#vehicle{flex:1 0 100%;width:100%;max-width:100%}#project-name{flex:1 0 100%;width:100%}}
/* PRD v1: a stable three-column editing shell. */
body{height:100dvh;display:flex;flex-direction:column;overflow:hidden}header{height:58px;flex:none;padding:0 16px}.brand{font-size:18px}.toolbar{flex:none;flex-wrap:nowrap;padding:8px 12px;gap:12px;min-height:51px}.tool-group{display:flex;align-items:center;gap:5px}.edit-tools{border-left:1px solid #dce3e8;border-right:1px solid #dce3e8;padding:0 12px}.view-tools{margin-left:auto}#tools{margin:0;align-items:center}.toolbar button{padding:7px 9px;font-size:12px}.toolbar label{margin:0}.shape-menu{position:relative}.shape-menu summary{cursor:pointer;border:1px solid #d4dde4;border-radius:6px;padding:7px 9px;list-style:none;white-space:nowrap}.shape-menu>div{position:absolute;top:36px;left:0;padding:6px;background:white;box-shadow:0 8px 24px #26384626;z-index:10;display:grid;min-width:100px}
main{flex:1;min-height:0;height:auto;grid-template-columns:210px minmax(400px,1fr) 260px}aside{padding:12px;position:relative}.collapse{width:28px;height:28px;padding:2px;display:block;margin:0 0 10px auto;border:0}.library .collapse{margin-left:0}.sidebar-content{min-width:0}.library .tabs{margin-bottom:20px}.canvas-head{height:84px;position:relative;align-items:flex-start;padding:12px 16px}.canvas-head strong{font-size:12px}.canvas-head small{font-size:10px}.mode-switch{position:absolute;bottom:8px;left:50%;transform:translateX(-50%);padding:3px;background:#e6ebef;border-radius:8px;white-space:nowrap}.mode-switch button{border:0;background:transparent;min-width:85px}.mode-switch button.active{box-shadow:0 1px 4px #203d5426}footer{min-height:28px;padding:0 12px}footer label{margin:5px 0}#status{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.error{color:#b72b38!important;font-weight:600}.focus-mode .error{position:fixed;bottom:12px;left:16px;background:white;padding:10px;z-index:100}
.left-collapsed main{grid-template-columns:44px minmax(400px,1fr) 260px}.right-collapsed main{grid-template-columns:210px minmax(400px,1fr) 44px}.left-collapsed.right-collapsed main{grid-template-columns:44px minmax(400px,1fr) 44px}.left-collapsed .library,.right-collapsed .inspector{padding:10px 7px}.left-collapsed .library .sidebar-content,.right-collapsed .inspector .sidebar-content{display:none}.focus-mode main{grid-template-columns:minmax(0,1fr)}.focus-mode aside{display:none}.focus-mode footer{height:0;min-height:0;overflow:visible}.focus-mode footer label,.focus-mode footer #status:not(.error){display:none}
#context-tools{padding:7px 12px;background:#fff;border-bottom:1px solid #dfe5e9;display:flex;align-items:center;gap:8px;flex-wrap:wrap;flex:none;font-size:11px}#context-tools strong{font-size:11px;margin-right:5px}#context-tools label{font-size:10px;margin:0;gap:4px}#context-tools input{width:52px;padding:5px}#context-tools input[type=color]{width:30px;height:26px}#context-tools select{max-width:88px;padding:4px}#context-tools button{font-size:11px;padding:5px 7px}.layer-row{gap:3px}.layer-row>button:first-child{min-width:0;padding:9px 6px}.layer-row .layer-icon{flex:0 0 25px;width:25px;padding:4px;text-align:center;border:0;background:transparent}.layer-row[draggable=true]{cursor:grab}#layer-list{max-height:38vh}.layer-actions{padding-bottom:12px;border-bottom:1px solid #e5e9ec}#properties h3{margin-top:15px}.presets button{height:auto;padding:5px;background:white;overflow:hidden}.preset-art{display:block;height:52px;border-radius:4px;background:#dce2e6;margin-bottom:6px}.preset-art.stripe{background:linear-gradient(150deg,#dce2e6 40%,#1878a0 40% 60%,#dce2e6 60%)}.preset-art.split{background:linear-gradient(90deg,#dce2e6 50%,#1878a0 50%)}.preset-art.checker{background:conic-gradient(#263846 25%,#e5e9ec 0 50%,#263846 0 75%,#e5e9ec 0);background-size:24px 24px}.preset-art.clean{background:#1878a0}#preset-preview{height:150px}dialog{border:1px solid #d5dfe6;border-radius:12px;width:min(460px,90vw);padding:24px;color:#263846;box-shadow:0 20px 80px #17334633}dialog::backdrop{background:#26384655}dialog h2{margin-top:0;font-size:18px}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:24px}dialog select{max-width:280px}.camera-views{padding:8px 4px;gap:3px}.camera-views button{padding:6px 9px;font-size:11px}#preview-status{margin:0 0 4px;font-size:10px;text-align:center}#preview-note{font-size:10px;text-align:center;margin:0 0 4px;cursor:help}.sync-control{justify-content:center;font-size:10px;margin:4px 0 8px;gap:4px}#personal-3d{min-height:160px}#personal-3d[data-loading=true]:after{content:attr(data-progress)}
@media(max-width:1200px) and (min-width:781px){main,.left-collapsed main{grid-template-columns:44px minmax(400px,1fr) 240px}.library{padding:10px 7px}.library .sidebar-content{display:none}.library:focus-within .sidebar-content{display:block;position:fixed;left:44px;top:120px;bottom:0;width:210px;background:white;z-index:20;padding:16px;overflow:auto;box-shadow:5px 0 20px #26384622}.right-collapsed main,.left-collapsed.right-collapsed main{grid-template-columns:44px minmax(400px,1fr) 44px}.toolbar{gap:5px;flex-wrap:wrap}.toolbar .edit-tools{padding:0 6px}}
@media(max-width:780px){body{height:auto;min-height:100dvh;overflow:auto}header{height:auto;padding:10px}.toolbar{flex-wrap:wrap}.tool-group{flex-wrap:wrap}.view-tools{margin-left:0}.toolbar #tools{flex-wrap:wrap}main,.left-collapsed main,.right-collapsed main,.left-collapsed.right-collapsed main{display:flex;min-height:0}.workspace{height:720px;min-height:560px}.workspace:has(.split){height:900px}.canvas-head{height:95px;min-height:95px}.canvas-head .mode-switch{flex-wrap:nowrap}.library,.inspector{width:100%;padding:12px 20px}.left-collapsed .library,.right-collapsed .inspector{padding:8px 20px}.focus-mode .workspace{height:calc(100dvh - 160px)}#context-tools{max-height:135px;overflow:auto}.focus-mode .workspace:has(.split){height:900px}.presets{grid-template-columns:repeat(4,1fr)}#status{white-space:normal}footer{padding:4px 10px}#stage-layout{min-height:0}}
#art-viewport{align-items:safe center;justify-content:safe center}
.auth-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.auth-heading h2{margin:0}.auth-heading button{border:0;font-size:22px;padding:0 8px}#auth-dialog input{width:100%;margin-bottom:12px}#auth-dialog label{justify-content:flex-start}#auth-dialog small{color:#71818c;line-height:1.7;display:block}.auth-divider{text-align:center;color:#8a98a1}#account-email{overflow-wrap:anywhere;font-weight:600}#auth-status{margin-bottom:0;min-height:24px}#account-project-list{display:grid;gap:8px}#account-button{white-space:nowrap}
#ai-prompt{width:100%;resize:vertical;border:1px solid #d4dde4;border-radius:6px;padding:9px;font:inherit}#ai-reference{width:100%;font-size:11px}#ai-result-preview{width:100%;height:auto;border-radius:6px}#credit-packs{display:grid;gap:10px;margin:18px 0}.credit-pack{padding:18px;text-align:left;font-weight:600}#credits-button{white-space:nowrap}.library .tabs{flex-wrap:wrap}#ai-status,#billing-status{overflow-wrap:anywhere}#credit-entries{max-height:220px;overflow:auto}

/* Immersive studio theme: UI surfaces only; artwork colors stay untouched. */
:root{color-scheme:dark;--studio-bg:#101216;--studio-panel:#191c21;--studio-raised:#23272e;--studio-border:#30353e;--studio-text:#e5e8ed;--studio-muted:#a0a8b5;--studio-accent:#467ee8}
body{background:var(--studio-bg);color:var(--studio-text)}
header,.toolbar,aside,#context-tools{background:var(--studio-panel);border-color:var(--studio-border)}
header{box-shadow:0 1px 0 #0005}.brand{color:#f3f5f8}.brand small{color:var(--studio-muted)}
button,.shape-menu summary{background:var(--studio-raised);border-color:var(--studio-border);color:var(--studio-text);transition:background-color .14s,border-color .14s}
button:hover,.shape-menu summary:hover{background:#303641;border-color:#535e70}
button:disabled{opacity:.42}.active,.primary{background:var(--studio-accent)!important;border-color:var(--studio-accent)!important;color:#fff!important}
button.primary:hover{background:#568df2!important;border-color:#568df2!important}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible,canvas:focus-visible,a:focus-visible{outline:2px solid #91b5ff;outline-offset:3px}
select,input:not([type=checkbox],[type=range],[type=color]),#ai-prompt{background:#12151a;border-color:var(--studio-border);color:var(--studio-text)}
input::placeholder,textarea::placeholder{color:#8993a2}input[type=color]{background:var(--studio-raised);border-color:#48515f}input[type=range],input[type=checkbox]{accent-color:var(--studio-accent)}
p,li,.empty,#auth-dialog small,.auth-divider{color:var(--studio-muted)}a{color:#99bbff}
.canvas-head,footer{background:#171a1f;color:var(--studio-muted);border-color:var(--studio-border)}.canvas-head strong{color:var(--studio-text)}.canvas-head small{color:var(--studio-muted)}
.canvas-head{border-bottom:1px solid #282d35}.mode-switch{background:#0d0f13;border:1px solid #30353e}.mode-switch button{color:#aab3c1}.mode-switch button.active{box-shadow:0 2px 8px #0004}
#art-viewport{background-color:#101216;background-image:radial-gradient(#49515e55 .7px,transparent .7px);background-size:16px 16px}
#art-wrap{box-shadow:0 12px 48px #0006;outline:1px solid #ffffff12}
#preview-panel,#personal-3d[data-loading=true]:after{background:#14171c;color:var(--studio-muted)}
.camera-views{border-top:1px solid #2a3038}.camera-views button{background:#20252c}.camera-views button:hover{background:#303641}
.edit-tools,.layer-actions{border-color:var(--studio-border)}.shape-menu>div{background:var(--studio-panel);border:1px solid var(--studio-border);box-shadow:0 12px 32px #0008}
.collapse{background:transparent;color:#929dad}.collapse:hover{background:var(--studio-raised);color:#fff}
#drop-zone{background:#14171c;border-color:#414b59;color:var(--studio-muted)}
.presets button{background:var(--studio-raised)}.presets button:hover{background:#303641}.swatches button{border-color:#252a32;box-shadow:0 0 0 1px #586170}
#layer-count{color:var(--studio-muted);background:#292f38;border-radius:4px;padding:2px 6px;margin-left:5px}
.layer-row .layer-icon{color:#aab3c1}.layer-row .layer-icon:hover{background:#303641}.layer-row:has(.active) .layer-icon{color:#d9e6ff}
footer{border-top:1px solid #282d35}.error{color:#ff969e!important}.focus-mode .error{background:#252027;border:1px solid #74404b;border-radius:6px}
dialog{background:#1c2027;color:var(--studio-text);border-color:#414957;box-shadow:0 24px 100px #000a}dialog::backdrop{background:#05070cbd;backdrop-filter:blur(5px)}
.credit-pack{background:#242b36;border-color:#3a4658}.credit-pack:hover{background:#2b374a}.credit-pack:disabled{opacity:.65}
#ai-reference::file-selector-button{background:#272e38;border:1px solid #414b59;border-radius:5px;color:var(--studio-text);padding:6px;margin:5px 5px 5px 0}
*{scrollbar-width:thin;scrollbar-color:#48515f #191c21}
@media(max-width:1200px) and (min-width:781px){.library:focus-within .sidebar-content{background:var(--studio-panel);box-shadow:8px 0 30px #0006;border-right:1px solid var(--studio-border)}}
@media(prefers-reduced-motion:reduce){button,.shape-menu summary{transition:none}}
.library,.inspector{border-color:var(--studio-border)}
#preset-category{width:100%;margin-bottom:10px}.preset-thumb{display:block;width:100%;height:auto;aspect-ratio:1;object-fit:cover;border-radius:4px;margin-bottom:7px}.presets button{padding:6px;text-align:left;font-size:11px}.presets button:hover{border-color:#729de9}#preset-preview{height:auto;display:flex;justify-content:center;background:#11151a;border-radius:8px;overflow:hidden}#preset-preview canvas{display:block;width:100%;max-height:48vh;object-fit:contain}
.preset-heading{display:flex;align-items:center;justify-content:space-between;gap:6px;margin:22px 0 10px;flex-wrap:wrap}.preset-heading h3{margin:0}.preset-heading small{font-weight:400;color:var(--studio-muted);font-size:10px}.preset-heading button{font-size:11px;padding:5px 7px;white-space:nowrap}

#ai-status:not(:empty){padding:12px;border:1px solid #354862;border-radius:8px;background:#172638;color:#c6ddff;line-height:1.6}#ai-status.error{background:#33281c;border-color:#765532;color:#f6d2a3}

/* Local sticker library */
.library .tabs{flex-wrap:wrap}
#sticker-search,#sticker-category,#sticker-layout{width:100%;margin-bottom:10px}
#sticker-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;max-height:290px;overflow:auto;padding:3px}
.sticker-card{display:flex;flex-direction:column;align-items:center;gap:7px;padding:12px 4px;background:#20252e;border:1px solid #343b48;min-width:0}
.sticker-card.active{border-color:#729cf4;background:#27344d;box-shadow:0 0 0 1px #729cf4}
.sticker-card img{object-fit:contain}.sticker-card span{font-size:11px}
.sticker-options{border-top:1px solid #343b48;margin-top:16px;padding-top:4px}
#sticker-preview{display:block;width:min(100%,240px);height:auto;aspect-ratio:1;margin:10px auto;border-radius:10px;background:repeating-conic-gradient(#cfd2d8 0% 25%,#e8eaf0 0% 50%) 0/18px 18px;object-fit:contain}
#sticker-status{line-height:1.5;color:#b8d4ed}#sticker-status.error{color:#f6b3a3}.sticker-license{font-size:11px;margin-top:12px;line-height:1.6}.sticker-license a{color:#a8c6ff}
