.agency-layout:has(.site-builder){grid-template-columns:170px minmax(0,1fr);gap:16px}.agency-panel:has(.site-builder){background:transparent;border:0;box-shadow:none}.agency-panel:has(.site-builder) #agency-content{padding:0}.site-builder{min-width:0}.sb-toolbar{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:18px}.sb-toolbar h2{font-size:22px;margin:0 0 6px}.sb-toolbar p{font-size:12px;color:#7a8ca7;margin:0;line-height:1.7}.sb-toolbar .sb-actions{display:flex;gap:8px;flex-shrink:0}.sb-toolbar button{min-height:40px;padding:10px 16px;font-size:12px}.sb-layout{display:grid;grid-template-columns:310px minmax(0,1fr);gap:18px;align-items:start}.sb-editor,.sb-preview{background:white;border:1px solid #dfe7f3;border-radius:12px;min-width:0;overflow:hidden}.sb-editor{max-height:calc(100vh - 180px);overflow:auto;scrollbar-width:thin}.sb-editor-intro{padding:17px 18px;border-bottom:1px solid #e7edf6}.sb-editor-intro strong{font-size:14px}.sb-editor-intro p{font-size:11px;color:#8a9ab2;margin:5px 0 0}.sb-card{margin:12px;border:1px solid #e1e8f3;border-radius:9px;background:#fff;overflow:hidden}.sb-card[open]{border-color:#a9c1fa;box-shadow:0 2px 9px #315fe808}.sb-card>summary{display:flex;align-items:center;gap:9px;list-style:none;cursor:pointer;padding:14px 12px;font-size:13px;font-weight:600;background:#fcfdff}.sb-card[open]>summary{background:#f1f6ff;color:#2d60dc;border-bottom:1px solid #e0e9fb}.sb-card>summary:after{content:'⌄';margin-left:auto;color:#8296b9}.sb-card>summary::-webkit-details-marker{display:none}.sb-card-index{font-size:10px;color:#7d98c4;background:#edf3ff;border-radius:5px;padding:2px 5px;min-width:23px;text-align:center}.sb-card small{font-size:10px;font-weight:400;color:#97a5b9}.sb-card-body{padding:14px 12px}.sb-card-body .field{display:block;margin:0 0 14px}.sb-card-body .field>span{font-size:11px;font-weight:500;margin-bottom:7px;display:block}.sb-card-body input:not([type=checkbox]):not([type=file]),.sb-card-body textarea{font-size:12px!important;line-height:1.7!important;padding:9px 10px!important;border-radius:6px!important;min-height:38px!important;width:100%;font-weight:400}.sb-card-body textarea{resize:vertical;min-height:76px!important}.sb-card-body input[type=file]{width:100%;font-size:10px;margin-top:8px}.sb-card-body .sb-hint{font-size:10px;line-height:1.8;color:#8a9bb3;margin:10px 0}.sb-card-tools{display:flex;gap:7px;flex-wrap:wrap;align-items:center;border-top:1px solid #edf1f8;padding-top:12px;margin-top:14px}.sb-card-tools button,.sb-item button{min-height:28px;padding:4px 8px;font-size:10px;border-radius:5px}.sb-card-tools label{display:flex;align-items:center;gap:5px;font-size:11px;margin-right:auto;color:#6b809e}.sb-card-tools input{width:14px;height:14px}.sb-item{border:1px solid #e4ebf6;padding:10px;margin:10px 0;border-radius:7px;background:#fafcff}.sb-item .field{margin-bottom:8px}.sb-item>header{display:flex;align-items:center;justify-content:space-between;font-size:10px;color:#8c9db5;margin-bottom:9px}.sb-add{padding:4px 12px 16px}.sb-add label{display:block;font-size:11px;margin:0 0 7px;color:#6c82a4}.sb-add select{width:100%;padding:10px;border:1px solid #dce5f5;border-radius:7px;background:white;color:#49658c;font:inherit;font-size:12px}.sb-add>button{width:100%;margin-top:9px;min-height:39px;font-size:12px;border-style:dashed;color:#3162e8;background:#f8faff}.sb-preview{position:sticky;top:16px;background:#edf1f8}.sb-preview-head{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:13px 16px;background:white;border-bottom:1px solid #e1e8f3;flex-wrap:wrap}.sb-preview-head strong{font-size:13px}.sb-device{display:flex;gap:4px;background:#f3f6fc;padding:3px;border-radius:7px}.sb-device button{font-size:11px;padding:6px 10px;min-height:29px;border:0;background:transparent;color:#8292aa;box-shadow:none}.sb-device button[aria-pressed=true]{background:white;color:#2f60db;box-shadow:0 1px 4px #315da512}.sb-preview-address{display:flex;align-items:center;gap:7px;background:#f7f9fd;border-bottom:1px solid #e2e9f4;padding:10px 15px;font-size:10px;color:#8d9db5}.sb-preview-address i{width:6px;height:6px;border-radius:50%;background:#cbd6e8}.sb-preview-address span{margin-left:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sb-preview-stage{padding:16px;display:flex;justify-content:center;overflow:auto}.sb-preview iframe{display:block;width:100%;height:calc(100vh - 285px);min-height:540px;border:0;background:white;border-radius:7px;box-shadow:0 2px 14px #203e7510}.sb-preview.is-mobile iframe{width:390px;max-width:100%;flex-shrink:0}.sb-status{font-size:11px;padding:11px 16px;color:#8597b0;border-top:1px solid #e0e7f3;background:white;min-height:40px}.sb-status.is-error{color:#d34444;background:#fff8f8}.sb-image{display:block;max-height:100px;max-width:100%;margin:5px 0;border:1px solid #e3eaf6;border-radius:6px}.sb-disabled>summary{opacity:.55}.sb-empty{padding:25px;text-align:center;font-size:12px;color:#92a2b9}.sb-card-body button.sb-danger{color:#c04b56}.sb-card-body button:hover{background:#edf3ff;color:#2658d1}.sb-card-body button:disabled{opacity:.4;cursor:default}
@media(max-width:1450px){.sb-layout{grid-template-columns:285px minmax(0,1fr)}.agency-layout:has(.site-builder){grid-template-columns:155px minmax(0,1fr);gap:13px}.sb-preview-stage{padding:10px}}
@media(max-width:1150px){.agency-layout:has(.site-builder){display:block}.agency-layout:has(.site-builder)>.agency-navigation{margin-bottom:16px}.agency-layout:has(.site-builder) .agency-navigation-head{display:none}.agency-layout:has(.site-builder) .agency-nav-toggle{display:flex;width:100%;justify-content:space-between;border:0;background:white;padding:12px}.agency-layout:has(.site-builder) .agency-nav{display:none}.agency-layout:has(.site-builder) .agency-navigation.is-open .agency-nav{display:block}.sb-layout{grid-template-columns:300px minmax(0,1fr)}}
@media(max-width:750px){.sb-layout{grid-template-columns:1fr}.sb-editor{max-height:550px}.sb-preview{position:static}.sb-toolbar{align-items:flex-start;flex-direction:column}.sb-toolbar .sb-actions{width:100%}.sb-toolbar .sb-actions button{flex:1}.sb-preview iframe{height:620px;min-height:0}.sb-preview-stage{padding:8px}.sb-preview-head{padding:12px}.sb-editor-intro{padding:14px}.sb-toolbar h2{font-size:20px}.sb-status{overflow-wrap:anywhere}}

.sb-add{position:sticky;bottom:0;background:linear-gradient(#fffffff0,#fff 20%);padding:12px;border-top:1px solid #edf1f8;z-index:1}
.sb-add>button{display:flex;align-items:center;justify-content:center;gap:7px;margin:0;min-height:42px;background:#f4f7ff;border:1px dashed #b8ccfa;color:#285ad7;font-weight:600}
.sb-add>button>span{font-size:20px;font-weight:400}
.sb-section-picker{width:1120px;max-width:calc(100vw - 48px);height:740px;max-height:calc(100dvh - 48px);padding:0;border:1px solid #dae3f0;border-radius:14px;box-shadow:0 20px 80px #112d563d;color:#18395e;overflow:hidden}
.sb-section-picker[open]{display:flex;flex-direction:column}
.sb-section-picker::backdrop{background:#14243f66;backdrop-filter:blur(3px)}
.sb-picker-header{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:21px 24px;border-bottom:1px solid #e6ecf5;flex-shrink:0;background:#fff}
.sb-picker-header h2{margin:0!important;font-size:19px!important}
.sb-picker-header p{font-size:12px;line-height:1.6;color:#8392a9;margin:6px 0 0}
.sb-picker-header>button{font-size:24px;line-height:1;width:34px;height:34px;min-height:34px;padding:0;border:0;box-shadow:none;background:#f5f7fb;color:#7c8aa0}
.sb-picker-layout{display:grid;grid-template-columns:270px minmax(0,1fr);flex:1;min-height:0;background:#f3f6fb}
.sb-picker-library{background:#fff;border-right:1px solid #e6ecf5;display:flex;flex-direction:column;min-height:0}
.sb-picker-search{display:block;padding:16px 14px 12px}
.sb-picker-search>span{display:block;font-size:11px;color:#8191aa;margin-bottom:7px}
.sb-picker-search input{font:inherit;font-size:12px;background:#f6f8fc;width:100%;padding:10px 11px;border:1px solid #e3eaf5;border-radius:7px}
.sb-picker-options{overflow:auto;padding:0 9px 12px;min-height:0}
.sb-picker-options>button{display:flex;align-items:center;gap:11px;width:100%;padding:12px 9px;margin:3px 0;border:1px solid transparent;background:white;text-align:left;box-shadow:none;font-weight:400;border-radius:8px;min-height:64px;color:#526b8d}
.sb-picker-options>button:hover{background:#f6f8fc}
.sb-picker-options>button[aria-pressed=true]{border-color:#d3e1ff;background:#edf3ff;color:#285ad6}
.sb-picker-symbol{display:grid;place-items:center;width:28px;height:28px;background:#f2f5fb;border-radius:6px;flex:0 0 28px;font-size:20px;color:#7492c1}
.sb-picker-options strong{display:block;font-size:13px;font-weight:600;line-height:1.5}
.sb-picker-options small{display:block;font-size:10px;line-height:1.5;color:#8a9ab1;margin-top:4px}
.sb-picker-arrow{margin-left:auto;font-size:18px;color:#7392c4}
.sb-picker-preview{min-width:0;display:flex;flex-direction:column;min-height:0;padding:20px}
.sb-picker-selection{padding:0 0 14px;flex-shrink:0}
.sb-picker-selection h3{font-size:15px;margin:0 0 6px}
.sb-picker-selection p{font-size:12px;color:#8293ab;margin:0;line-height:1.6}
.sb-picker-canvas{flex:1;min-height:0;border:1px solid #dfe7f2;border-radius:9px;background:#fff;overflow:hidden;position:relative;box-shadow:0 3px 16px #26486f05}
.sb-picker-canvas iframe{width:100%;height:100%;border:0;display:block;background:white}
.sb-picker-canvas iframe[hidden],.sb-picker-status[hidden]{display:none}
.sb-picker-status{display:flex;justify-content:center;align-items:center;flex-direction:column;gap:15px;height:100%;margin:0;padding:24px;font-size:13px;text-align:center;color:#8295b0;line-height:1.8}
.sb-picker-empty{padding:20px 12px;color:#8a9bb1;font-size:12px;line-height:1.8}
.sb-picker-footer{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:17px 24px;border-top:1px solid #e5ecf5;background:white;flex-shrink:0}
.sb-picker-footer>span{font-size:11px;color:#8495ae;line-height:1.7}
.sb-picker-footer>div{display:flex;gap:9px;flex-shrink:0}
.sb-picker-footer button{min-height:39px;padding:9px 16px;font-size:12px}
@media(max-width:700px){.sb-section-picker{max-width:calc(100vw - 20px);max-height:calc(100dvh - 20px);height:760px;border-radius:10px}.sb-picker-header{padding:15px}.sb-picker-layout{grid-template-columns:125px minmax(0,1fr)}.sb-picker-search{padding:12px 8px}.sb-picker-search input{padding:9px 6px;font-size:10px}.sb-picker-options{padding:0 5px 10px}.sb-picker-options>button{padding:10px 6px;gap:5px;min-height:48px}.sb-picker-symbol{width:20px;height:24px;flex-basis:20px;font-size:16px}.sb-picker-options strong{font-size:11px}.sb-picker-options small,.sb-picker-arrow{display:none}.sb-picker-preview{padding:12px 8px}.sb-picker-selection h3{font-size:13px}.sb-picker-selection p{font-size:10px}.sb-picker-footer{padding:12px;flex-wrap:wrap;gap:8px}.sb-picker-footer>div{width:100%;justify-content:flex-end}.sb-picker-footer>span{font-size:10px}.sb-picker-status{padding:12px;font-size:11px}}

.sb-card-body .sb-code-field textarea{font-family:Consolas,Monaco,monospace!important;font-size:11px!important;white-space:pre;tab-size:2;min-height:150px!important;background:#fbfcff;color:#35547b}

/* 装修工作台使用剩余视口，卡片与预览各自滚动。 */
@media(min-width:1151px){
 .agency-workspace:has(.site-builder){padding:18px 20px 16px}
 .agency-layout:has(.site-builder){grid-template-columns:170px minmax(0,1fr);gap:16px}
 .site-builder .sb-toolbar{margin-bottom:14px;min-height:48px}
 .sb-layout{height:calc(100dvh - 168px);min-height:360px;align-items:stretch;grid-template-columns:300px minmax(0,1fr);gap:16px}
 .sb-editor{height:100%;max-height:none;min-height:0}
 .sb-preview{height:100%;min-height:0;display:flex;flex-direction:column;position:static}
 .sb-preview-head,.sb-preview-address,.sb-status{flex:0 0 auto}
 .sb-preview-stage{flex:1;min-height:0;padding:10px;overflow:hidden}
 .sb-preview iframe{height:100%;min-height:0}
 .agency-layout:has(.site-builder)>.agency-navigation{max-height:calc(100dvh - 112px)}
}
@media(min-width:1151px) and (max-width:1450px){.sb-layout{grid-template-columns:275px minmax(0,1fr)}}

.sb-toolbar .sb-homepage-link{display:flex;flex-wrap:wrap;gap:4px;margin-top:8px}.sb-homepage-link a{color:#285be1;overflow-wrap:anywhere;text-decoration:underline;text-underline-offset:3px}.sb-homepage-link a:hover{color:#1644b5}

/* Compact builder chrome; reserve the viewport for editing and preview. */
.sb-toolbar>div:first-child{min-width:0}
.sb-toolbar h2{margin:0;font-size:20px}
.sb-toolbar>div:first-child>p:not(.sb-homepage-link){display:none}
.sb-toolbar .sb-homepage-link{margin-top:4px;font-size:11px;line-height:1.5}
.sb-toolbar button{min-height:36px;padding:7px 12px}
.sb-editor-intro{padding:10px 14px}
.sb-editor-intro p{margin-top:3px;font-size:10px}
.sb-preview-head{padding:7px 12px;min-height:42px}
.sb-preview-address{display:none}
.sb-status{padding:6px 12px;min-height:28px;font-size:10px}
@media(min-width:1151px){
 .agency-workspace:has(.site-builder){padding-top:10px;padding-bottom:10px}
 .agency-layout:has(.site-builder){grid-template-columns:190px minmax(0,1fr);gap:14px}
 .site-builder{height:calc(100dvh - 90px);min-height:440px;display:flex;flex-direction:column}
 .site-builder .sb-toolbar{flex:0 0 auto;min-height:44px;margin-bottom:8px;gap:10px}
 .sb-layout{flex:1;min-height:0;height:auto;gap:12px}
 .sb-preview-stage{padding:8px}
 .agency-layout:has(.site-builder)>.agency-navigation{max-height:calc(100dvh - 90px)}
 .agency-layout:has(.site-builder) .agency-navigation-head{padding:12px 10px;gap:6px}
 .agency-layout:has(.site-builder) .agency-navigation-mark{width:28px;height:28px;flex-basis:28px}
}
@media(max-width:750px){.sb-toolbar{gap:8px;margin-bottom:10px}.sb-toolbar .sb-actions{flex-wrap:wrap}.sb-toolbar .sb-actions button{padding:8px}.sb-homepage-link a{word-break:break-all}.sb-preview-head{padding:7px 10px}}

/* Save and publish stay beside the title instead of the far right. */
.site-builder .sb-toolbar{justify-content:flex-start;flex-wrap:wrap}
.sb-toolbar .sb-actions{justify-content:flex-start;flex-wrap:wrap}
@media(max-width:750px){.sb-toolbar .sb-actions button{flex:0 0 auto}}

/* A gallery of complete presets, applied only to the editable draft. */
dialog:has(.sb-template-grid){width:min(1120px,calc(100vw - 32px));max-width:1120px}
.sb-template-intro p{margin:0 0 8px;line-height:1.8}.sb-template-intro strong{display:block;color:#285bd5}.sb-template-intro small{font-size:12px;color:#6e809b;line-height:1.8}
.sb-template-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px;margin-top:24px}
.sb-template-card{border:1px solid #dfe6f1;border-radius:12px;overflow:hidden;background:#fff;min-width:0}
.sb-template-cover{padding:18px 20px 14px;background:#152d4d;color:#fff;overflow:hidden}
.sb-template-nav{display:flex;justify-content:space-between;gap:12px;font-size:8px;padding-bottom:16px;letter-spacing:1px}
.sb-template-nav span{opacity:.6;letter-spacing:0}
.sb-template-scene{display:grid;grid-template-columns:1fr 1fr;align-items:center;gap:20px;min-height:150px}
.sb-template-scene small{font-size:8px;opacity:.7}.sb-template-scene strong{display:block;font-size:22px;line-height:1.4;margin:10px 0 15px;max-width:220px}.sb-template-scene i{display:inline-block;padding:7px 12px;background:white;color:#243953;font-size:8px;font-style:normal;border-radius:3px}
.sb-template-scene img{width:100%;height:148px;object-fit:cover;border:5px solid #fff;border-radius:5px;transform:rotate(-4deg)}
.sb-template-blocks{display:flex;gap:8px;margin-top:20px}.sb-template-blocks span{height:22px;flex:1;border:1px solid currentColor;opacity:.15;border-radius:3px}
.sb-template-cover.is-studio{background:#eee5d8;color:#534334}.is-studio .sb-template-scene img{border:0;border-radius:75px 75px 0 0;transform:none}.is-studio .sb-template-scene strong{font-family:Georgia,'SimSun',serif;font-weight:500}
.sb-template-cover.is-enterprise{background:#e3eee8;color:#174d45}.is-enterprise .sb-template-scene img{border:0;border-radius:0;transform:none;box-shadow:5px 5px 0 #bad4c7}.is-enterprise .sb-template-scene i{background:#166e60;color:white}
.sb-template-cover.is-launch{background:linear-gradient(125deg,#eaddff,#e5ebff);color:#392653}.is-launch .sb-template-scene{display:block;text-align:center;position:relative;min-height:150px}.is-launch .sb-template-scene strong{max-width:270px;margin:10px auto;font-size:24px}.is-launch .sb-template-scene img{display:none}.is-launch .sb-template-scene i{background:#7345d9;color:white;border-radius:20px}
.sb-template-info{padding:20px 22px}.sb-template-info>span{font-size:10px;color:#5c72a0;background:#f1f5fc;border-radius:4px;padding:4px 8px}.sb-template-info h3{margin:12px 0 8px;font-size:19px}.sb-template-info p{font-size:13px;line-height:1.8;color:#6d7e95;margin:0 0 8px}.sb-template-info small{display:block;color:#8b9ab0;font-size:11px}.sb-template-info button{display:block;margin-top:18px}
.sb-actions [hidden]{display:none!important}
@media(max-width:640px){.sb-template-grid{grid-template-columns:1fr;gap:16px}.sb-template-cover{padding:16px}.sb-template-scene{gap:12px}.sb-template-scene strong{font-size:20px}.sb-template-info{padding:18px}.sb-template-intro p{font-size:13px}}

.agency-layout.is-builder-focus{display:block}.agency-layout.is-builder-focus>.agency-navigation{display:none}.is-builder-focus .sb-layout{grid-template-columns:minmax(310px,32%) minmax(0,1fr)}@media(max-width:700px){.is-builder-focus .sb-layout{display:block}}
