/* 装修模板库 · 作用域化样式（源：template-library.css v2.10.5）
   内嵌到主框架 #section-template-library；旧独立页 template-library.html 已废弃（只读），不要修改 */
#section-template-library{--ink:#20252b;--muted:#7b8590;--line:rgba(57,66,75,.13);--panel:rgba(255,255,255,.72);--deep:#31383f;--danger:#a44c4c;--shadow:0 22px 54px rgba(37,45,53,.09)}#section-template-library *{box-sizing:border-box}#section-template-library,#section-template-library{margin:0;min-height:100%;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",Arial,sans-serif;color:var(--ink);background:#eef1f4}#section-template-library{padding:18px;background-image:radial-gradient(circle at 12% 7%,rgba(255,255,255,.9),transparent 34%),linear-gradient(rgba(57,66,75,.045) 1px,transparent 1px),linear-gradient(90deg,rgba(57,66,75,.045) 1px,transparent 1px);background-size:auto,44px 44px,44px 44px}#section-template-library .template-shell{width:min(1580px,100%);margin:auto}#section-template-library .glass-panel{border:1px solid rgba(255,255,255,.95);background:var(--panel);box-shadow:var(--shadow);backdrop-filter:blur(24px)}#section-template-library button,#section-template-library input,#section-template-library select,#section-template-library textarea{font:inherit}#section-template-library .template-header{min-height:76px;padding:12px 16px;border-radius:24px;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:18px}#section-template-library .tool-brand,#section-template-library .header-context{display:flex;align-items:center;gap:11px;color:inherit;text-decoration:none}#section-template-library .context-icon{width:46px;height:46px;border-radius:14px;display:grid;place-items:center;overflow:hidden;background:linear-gradient(145deg,#69747f,#343a41);color:#fff;font-size:22px}#section-template-library .tool-brand-mark{width:46px;height:46px;border-radius:50%;display:grid;place-items:center;overflow:hidden;background:linear-gradient(145deg,#505863,#111419);color:#fff;border:1px solid rgba(255,255,255,.7);box-shadow:0 9px 18px rgba(28,33,40,.22),inset 0 1px 1px rgba(255,255,255,.38);font-size:22px}#section-template-library .tool-brand-mark img{width:100%;height:100%;object-fit:cover}#section-template-library .tool-brand strong,#section-template-library .header-context strong{display:block;font-size:14px}#section-template-library .tool-brand small,#section-template-library .header-context small{display:block;margin-top:3px;color:#8b949e;font-size:9px;letter-spacing:.16em;text-transform:uppercase}#section-template-library .header-context{justify-self:center}#section-template-library .back-button,#section-template-library .secondary-button,#section-template-library .primary-button,#section-template-library .small-primary,#section-template-library .danger-button,#section-template-library .danger-solid,#section-template-library .icon-close{border:0;cursor:pointer}#section-template-library .back-button{justify-self:end;min-height:42px;padding:0 15px;border:1px solid var(--line);border-radius:12px;display:inline-flex;align-items:center;color:#59636d;background:rgba(255,255,255,.75);text-decoration:none;font-size:12px}#section-template-library .library-view{padding:72px 4px 40px}#section-template-library .library-hero{display:flex;align-items:flex-end;justify-content:space-between;gap:26px;padding:0 8px 30px}#section-template-library .eyebrow{display:block;color:#8a95a0;font-size:10px;font-weight:800;letter-spacing:.18em}#section-template-library .library-hero h1{margin:12px 0 10px;font-size:clamp(38px,5vw,62px);line-height:1}#section-template-library .library-hero p{margin:0;color:#75808b;font-size:14px}#section-template-library .primary-button{min-height:44px;padding:0 18px;border-radius:13px;color:#fff;background:linear-gradient(135deg,#444c54,#252b31);box-shadow:0 10px 22px rgba(35,42,49,.17);font-weight:700}#section-template-library .library-toolbar{min-height:66px;padding:11px 13px;border-radius:18px;display:flex;align-items:center;gap:12px}#section-template-library .search-control{height:42px;min-width:260px;flex:1;padding:0 13px;display:flex;align-items:center;gap:9px;border:1px solid var(--line);border-radius:12px;background:rgba(255,255,255,.7);color:#808a94}#section-template-library .search-control input,#section-template-library .category-control select{width:100%;border:0;outline:0;color:var(--ink);background:transparent}#section-template-library .category-control{height:42px;padding:0 13px;display:flex;align-items:center;gap:9px;border:1px solid var(--line);border-radius:12px;background:rgba(255,255,255,.7);font-size:12px;color:#737e88}#section-template-library .category-control select{min-width:120px}#section-template-library .template-count{margin-left:auto;color:#8a949e;font-size:12px;white-space:nowrap}#section-template-library .template-grid{padding-top:22px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;align-items:start}#section-template-library .template-card{position:relative;min-width:0;border:1px solid rgba(255,255,255,.92);border-radius:22px;overflow:hidden;background:rgba(255,255,255,.69);box-shadow:0 18px 42px rgba(38,46,54,.08);transition:transform .2s ease,box-shadow .2s ease}#section-template-library .template-card:hover{transform:translateY(-4px);box-shadow:0 25px 50px rgba(38,46,54,.13)}#section-template-library .card-preview{position:relative;aspect-ratio:16/10;overflow:hidden;background:#e7eaed;border-bottom:1px solid var(--line)}#section-template-library .card-preview iframe{width:1440px;height:900px;border:0;pointer-events:none;transform:scale(var(--card-scale,.32));transform-origin:top left;background:#fff}#section-template-library .card-preview::after{content:"";position:absolute;inset:0}#section-template-library .card-actions{position:absolute;z-index:2;top:12px;right:12px;display:flex;gap:7px;opacity:0;transform:translateY(-4px);transition:.18s}#section-template-library .template-card:hover .card-actions,#section-template-library .template-card:focus-within .card-actions{opacity:1;transform:none}#section-template-library .card-actions button{min-height:34px;padding:0 12px;border:1px solid rgba(255,255,255,.75);border-radius:10px;color:#fff;background:rgba(35,42,49,.86);backdrop-filter:blur(10px);cursor:pointer;font-size:11px}#section-template-library .card-actions .delete-card{background:rgba(139,59,59,.9)}#section-template-library .card-body{padding:17px 18px 19px;display:grid;gap:9px;cursor:pointer}#section-template-library .card-body h2{margin:0;font-size:19px}#section-template-library .card-category{color:#68737e;font-size:12px}#section-template-library .card-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;color:#939ca5;font-size:10px}#section-template-library .empty-state{margin-top:22px;padding:72px 20px;border-radius:22px;text-align:center}#section-template-library .empty-state .empty-icon{font-size:36px}#section-template-library .empty-state h2{margin:12px 0 7px}#section-template-library .empty-state p{margin:0 0 20px;color:var(--muted)}#section-template-library .secondary-button{min-height:40px;padding:0 14px;border:1px solid var(--line);border-radius:12px;color:#58626c;background:rgba(255,255,255,.8)}#section-template-library .editor-view{padding-top:18px}#section-template-library .editor-topbar{min-height:70px;padding:10px 12px;border-radius:19px;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:12px}#section-template-library .editor-heading{text-align:center}#section-template-library .editor-heading strong{display:block;margin:3px 0;font-size:16px}#section-template-library .editor-heading small{display:block;color:#89939d;font-size:10px}#section-template-library .editor-heading small.is-saving{color:#806e42}#section-template-library .editor-heading small.is-error{color:#a44c4c}#section-template-library .editor-actions{justify-self:end;display:flex;gap:8px}#section-template-library .page-tabs{width:max-content;margin:14px auto;padding:5px;border-radius:14px;display:flex;gap:4px}#section-template-library .page-tabs button,#section-template-library .device-switch button,#section-template-library .code-tabs button{border:0;border-radius:9px;color:#707a84;background:transparent;cursor:pointer}#section-template-library .page-tabs button{min-height:38px;padding:0 20px}#section-template-library .page-tabs button.is-active,#section-template-library .device-switch button.is-active,#section-template-library .code-tabs button.is-active{color:#fff;background:#353c43}#section-template-library .builder-layout{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(360px,.72fr);gap:14px;min-height:calc(100vh - 196px)}#section-template-library .preview-panel,#section-template-library .module-panel{border-radius:21px;overflow:hidden}#section-template-library .preview-panel{display:grid;grid-template-rows:auto minmax(0,1fr)}#section-template-library .panel-heading{min-height:64px;padding:11px 15px;display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid var(--line)}#section-template-library .panel-heading strong{display:block;font-size:14px}#section-template-library .panel-heading small{display:block;margin-top:4px;color:#929ba4;font-size:10px}#section-template-library .device-switch,#section-template-library .code-tabs{display:flex;gap:4px;padding:4px;border:1px solid var(--line);border-radius:12px;background:rgba(244,246,247,.76)}#section-template-library .device-switch button{min-height:32px;padding:0 10px;font-size:11px}#section-template-library .preview-stage{padding:14px;min-height:640px;display:flex;align-items:flex-start;justify-content:center;overflow:auto;background:linear-gradient(135deg,rgba(233,236,239,.82),rgba(247,248,249,.95))}#section-template-library .preview-stage iframe{width:100%;height:calc(100vh - 294px);min-height:612px;border:1px solid var(--line);border-radius:14px;background:#fff;box-shadow:0 14px 36px rgba(29,36,43,.09);transition:width .24s ease}#section-template-library .preview-stage.is-mobile iframe{width:390px;max-width:100%}#section-template-library .module-panel{display:flex;flex-direction:column;min-height:640px}#section-template-library .template-fields{padding:13px;display:grid;grid-template-columns:1fr 1fr;gap:9px;border-bottom:1px solid var(--line)}#section-template-library .template-fields label,#section-template-library .modal-form label,#section-template-library .module-editor-heading label{display:grid;gap:6px;color:#7c8792;font-size:10px;font-weight:700}#section-template-library .template-fields input,#section-template-library .modal-form input,#section-template-library .modal-form select,#section-template-library .module-editor-heading input{width:100%;height:40px;padding:0 11px;border:1px solid var(--line);border-radius:10px;outline:0;color:var(--ink);background:rgba(255,255,255,.78)}#section-template-library .template-fields input:focus,#section-template-library .modal-form input:focus,#section-template-library .module-editor-heading input:focus,#section-template-library .code-field textarea:focus{border-color:#737d87;box-shadow:0 0 0 3px rgba(67,75,83,.08)}#section-template-library .module-list-heading{padding:13px;display:flex;align-items:center;justify-content:space-between;gap:9px}#section-template-library .module-list-heading span strong,#section-template-library .module-list-heading span small{display:block}#section-template-library .module-list-heading span strong{font-size:13px}#section-template-library .module-list-heading span small{margin-top:3px;color:#9099a2;font-size:10px}#section-template-library .small-primary{min-height:34px;padding:0 11px;border-radius:10px;color:#fff;background:#363d44;font-size:11px}#section-template-library .module-list{max-height:190px;padding:0 12px 12px;display:grid;gap:7px;overflow:auto}#section-template-library .module-item{min-height:44px;padding:7px 9px;border:1px solid var(--line);border-radius:11px;display:flex;align-items:center;gap:9px;color:#67727c;background:rgba(255,255,255,.6);cursor:pointer;text-align:left}#section-template-library .module-item.is-active{border-color:#555f68;color:#fff;background:#3b4249}#section-template-library .module-order{width:24px;height:24px;border-radius:7px;display:grid;place-items:center;background:rgba(104,115,125,.12);font-size:10px}#section-template-library .module-item.is-active .module-order{background:rgba(255,255,255,.12)}#section-template-library .module-item span:nth-child(2){min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:700}#section-template-library .module-editor{padding:13px;border-top:1px solid var(--line);display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;gap:10px;flex:1;min-height:0}#section-template-library .module-editor[hidden]{display:none}#section-template-library .module-editor-heading{display:grid;grid-template-columns:1fr auto;gap:9px;align-items:end}#section-template-library .danger-button{height:40px;padding:0 11px;border:1px solid rgba(164,76,76,.2);border-radius:10px;color:var(--danger);background:#fff5f5;font-size:11px}#section-template-library .code-tabs{width:max-content}#section-template-library .code-tabs button{min-height:31px;padding:0 10px;font-size:10px}#section-template-library .code-field{min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr);gap:6px;color:#77828d;font-size:10px;font-weight:700}#section-template-library .code-field textarea{width:100%;min-height:240px;padding:12px;resize:vertical;border:1px solid var(--line);border-radius:12px;outline:0;color:#e9edf0;background:#2e343a;font:11px/1.65 ui-monospace,SFMono-Regular,Consolas,monospace;tab-size:2}#section-template-library .code-note{margin:0;color:#969fa8;font-size:9px;line-height:1.6}#section-template-library .module-empty{padding:54px 20px;text-align:center;color:#8e98a1}#section-template-library .module-empty span{width:42px;height:42px;margin:auto;border-radius:13px;display:grid;place-items:center;color:#fff;background:#424950;font-size:23px}#section-template-library .module-empty strong{display:block;margin:12px 0 5px;font-size:14px;color:#545e68}#section-template-library .module-empty p{margin:0;font-size:11px;line-height:1.7}#section-template-library .modal[hidden]{display:none}#section-template-library .modal{position:fixed;z-index:50;inset:0;display:grid;place-items:center;padding:18px}#section-template-library .modal-backdrop{position:absolute;inset:0;border:0;background:rgba(31,37,43,.34);backdrop-filter:blur(7px)}#section-template-library .modal-card{position:relative;width:min(500px,100%);padding:22px;border-radius:22px}#section-template-library .compact-modal{text-align:center}#section-template-library .modal-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}#section-template-library .modal-heading h2,#section-template-library .compact-modal h2{margin:7px 0 0;font-size:24px}#section-template-library .icon-close{width:36px;height:36px;border-radius:10px;color:#68737d;background:rgba(237,240,242,.9);font-size:22px}#section-template-library .modal-form{margin-top:22px;display:grid;gap:14px}#section-template-library .modal-form input,#section-template-library .modal-form select{height:46px}#section-template-library .modal-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:4px}#section-template-library .modal-help{margin:-3px 0 0;color:#8b959f;font-size:11px}#section-template-library .danger-symbol{width:46px;height:46px;margin:auto;border-radius:50%;display:grid;place-items:center;color:#fff;background:#a85353;font-size:23px;font-weight:800}#section-template-library .compact-modal p{color:#7b858f;font-size:13px}#section-template-library .danger-solid{min-height:40px;padding:0 15px;border-radius:12px;color:#fff;background:#a64e4e}#section-template-library .toast{position:fixed;z-index:80;right:24px;bottom:24px;max-width:min(420px,calc(100vw - 48px));padding:13px 16px;border:1px solid rgba(255,255,255,.8);border-radius:13px;color:#fff;background:#343b42;box-shadow:0 14px 34px rgba(25,31,36,.22);font-size:12px}#section-template-library .toast.is-error{background:#9a4d4d}@media(max-width:1100px){#section-template-library .template-grid{grid-template-columns:repeat(2,minmax(0,1fr))}#section-template-library .builder-layout{grid-template-columns:1fr}#section-template-library .preview-stage iframe{height:620px}#section-template-library .module-panel{min-height:720px}}@media(max-width:720px){#section-template-library{padding:8px}#section-template-library .template-header{grid-template-columns:1fr auto;border-radius:18px}#section-template-library .header-context{grid-column:1/-1;grid-row:2;justify-self:start}#section-template-library .tool-brand span:last-child{display:none}#section-template-library .back-button{font-size:0}#section-template-library .back-button::after{content:"返回";font-size:12px}#section-template-library .library-view{padding-top:42px}#section-template-library .library-hero{align-items:flex-start;flex-direction:column}#section-template-library .library-hero h1{font-size:42px}#section-template-library .library-toolbar{align-items:stretch;flex-direction:column}#section-template-library .search-control{min-width:0}#section-template-library .category-control{justify-content:space-between}#section-template-library .template-count{margin-left:0}#section-template-library .template-grid{grid-template-columns:1fr}#section-template-library .card-actions{opacity:1;transform:none}#section-template-library .editor-topbar{grid-template-columns:auto 1fr}#section-template-library .editor-heading{text-align:left}#section-template-library .editor-actions{grid-column:1/-1;width:100%}#section-template-library .editor-actions button{flex:1}#section-template-library .page-tabs{width:100%;overflow:auto}#section-template-library .page-tabs button{flex:1;min-width:110px;padding:0 10px}#section-template-library .builder-layout{min-height:0}#section-template-library .preview-stage{min-height:500px;padding:8px}#section-template-library .preview-stage iframe{min-height:480px;height:68vh}#section-template-library .template-fields{grid-template-columns:1fr}#section-template-library .module-panel{min-height:680px}#section-template-library .modal{padding:10px}#section-template-library .toast{right:12px;bottom:12px;max-width:calc(100vw - 24px)}}#section-template-library .header-actions{justify-self:end;display:flex;align-items:center;gap:8px}#section-template-library .header-action,#section-template-library .header-save{min-height:38px;padding:0 13px;border:1px solid var(--line);border-radius:11px;cursor:pointer;font-size:11px}#section-template-library .header-action{color:#5d6771;background:rgba(255,255,255,.78)}#section-template-library .header-save{border-color:#343b42;color:#fff;background:#343b42;font-weight:700}#section-template-library .compact-back{padding:0 11px}#section-template-library .header-context{min-width:0;max-width:380px}#section-template-library .header-context>span:last-child{min-width:0}#section-template-library .header-context #header-context-title,#section-template-library .header-context #save-status{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#section-template-library .header-context #save-status{max-width:300px}#section-template-library .header-context #save-status.is-saving{color:#806e42}#section-template-library .header-context #save-status.is-error{color:#a44c4c}#section-template-library .editor-view{padding-top:14px}#section-template-library .builder-layout{grid-template-columns:minmax(0,1.55fr) minmax(520px,.9fr);min-height:calc(100vh - 112px)}#section-template-library .template-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:14px}#section-template-library .template-card{aspect-ratio:3/4;display:flex;flex-direction:column}#section-template-library .card-preview{min-height:0;flex:1;aspect-ratio:auto}#section-template-library .card-preview iframe{height:1320px}#section-template-library .card-body{flex:0 0 112px;padding:14px 15px 15px}#section-template-library .card-body h2{font-size:17px}#section-template-library .card-category{font-size:11px}#section-template-library .preview-heading{display:grid;grid-template-columns:1fr auto 1fr}#section-template-library .preview-heading .page-tabs{margin:0;padding:4px;border:1px solid var(--line);border-radius:12px;background:rgba(244,246,247,.76);box-shadow:none}#section-template-library .preview-heading .page-tabs button{min-height:32px;padding:0 14px;font-size:11px}#section-template-library .preview-heading .device-switch{justify-self:end}#section-template-library .module-panel{min-height:680px}#section-template-library .module-workspace{min-height:0;flex:1;display:grid;grid-template-columns:168px minmax(0,1fr);border-top:1px solid var(--line)}#section-template-library .module-sidebar{min-width:0;display:flex;flex-direction:column;border-right:1px solid var(--line);background:rgba(244,246,247,.42)}#section-template-library .module-list-heading{padding:12px 10px}#section-template-library .module-list{max-height:none;min-height:0;flex:1;padding:0 9px 10px;align-content:start}#section-template-library .module-item{padding:7px;gap:7px}#section-template-library .module-order{flex:0 0 23px;width:23px;height:23px}#section-template-library .small-primary{width:32px;padding:0;font-size:17px}#section-template-library .code-workspace{min-width:0;display:flex}#section-template-library .module-editor{width:100%;padding:13px;border-top:0;grid-template-rows:auto minmax(0,1fr) auto}#section-template-library .code-field textarea{height:100%;min-height:430px;resize:none}#section-template-library .module-empty{width:100%;align-self:center}#section-template-library .template-fields{padding:12px}@media(max-width:1350px){#section-template-library .template-grid{grid-template-columns:repeat(4,minmax(0,1fr))}#section-template-library .builder-layout{grid-template-columns:minmax(0,1.4fr) minmax(480px,.9fr)}#section-template-library .module-workspace{grid-template-columns:150px minmax(0,1fr)}}@media(max-width:1100px){#section-template-library .template-grid{grid-template-columns:repeat(3,minmax(0,1fr))}#section-template-library .builder-layout{grid-template-columns:1fr;min-height:0}#section-template-library .module-panel{min-height:720px}#section-template-library .module-workspace{grid-template-columns:190px minmax(0,1fr)}}@media(max-width:780px){#section-template-library .template-grid{grid-template-columns:repeat(2,minmax(0,1fr))}#section-template-library .template-header{grid-template-columns:1fr auto}#section-template-library .header-context{grid-column:1/-1;grid-row:2;justify-self:start}#section-template-library .header-actions{grid-column:1/-1;width:100%;justify-self:stretch}#section-template-library .header-actions>*{flex:1;justify-content:center}#section-template-library .editor-header-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}#section-template-library .preview-heading{grid-template-columns:1fr auto}#section-template-library .preview-heading .page-tabs{grid-column:1/-1;grid-row:2;width:100%;order:3}#section-template-library .preview-heading .page-tabs button{flex:1;padding:0 8px}#section-template-library .module-workspace{grid-template-columns:150px minmax(0,1fr)}}@media(max-width:540px){#section-template-library .template-grid{grid-template-columns:1fr}#section-template-library .template-card{width:min(330px,100%)}#section-template-library .module-workspace{grid-template-columns:1fr}#section-template-library .module-sidebar{border-right:0;border-bottom:1px solid var(--line)}#section-template-library .module-list{max-height:180px}#section-template-library .code-field textarea{min-height:360px}#section-template-library .header-action,#section-template-library .header-save{padding:0 8px;font-size:10px}}#section-template-library .header-actions[hidden]{display:none!important}#section-template-library .template-header{min-height:72px;padding:10px 14px;grid-template-columns:minmax(190px,1fr) minmax(210px,auto) minmax(340px,1fr);grid-template-rows:1fr;grid-auto-flow:column;gap:12px;overflow-x:auto;overflow-y:hidden}#section-template-library .tool-brand,#section-template-library .header-context,#section-template-library .header-actions{min-width:0;white-space:nowrap}#section-template-library .header-context{grid-column:2;grid-row:1;justify-self:center}#section-template-library .header-actions{grid-column:3;grid-row:1;width:auto;justify-self:end;flex-wrap:nowrap}#section-template-library .header-actions>*{flex:0 0 auto}#section-template-library .editor-header-actions{display:flex}#section-template-library .header-action,#section-template-library .header-save{min-height:36px;padding:0 11px}#section-template-library .builder-layout{grid-template-columns:minmax(0,1.7fr) minmax(190px,220px) minmax(360px,.7fr);gap:12px;min-height:calc(100vh - 108px);align-items:stretch}#section-template-library .preview-panel,#section-template-library .module-sidebar-panel,#section-template-library .code-panel{min-width:0;border-radius:21px;overflow:hidden}#section-template-library .module-sidebar-panel,#section-template-library .code-panel{min-height:680px;display:flex;flex-direction:column}#section-template-library .module-panel-heading{flex:0 0 auto}#section-template-library .module-sidebar-panel .module-list{max-height:none;min-height:0;flex:1;padding:12px;align-content:start;background:rgba(244,246,247,.38)}#section-template-library .module-drag-tip{flex:0 0 auto;padding:11px 12px;border-top:1px solid var(--line);color:#929ba4;background:rgba(255,255,255,.45);font-size:10px;text-align:center}#section-template-library .module-drag-tip span{font-weight:800;letter-spacing:-2px}#section-template-library .module-item{position:relative;width:100%;padding:8px 8px 8px 6px;gap:7px;cursor:grab;user-select:none;transition:opacity .15s ease,transform .15s ease,border-color .15s ease,box-shadow .15s ease}#section-template-library .module-item:active{cursor:grabbing}#section-template-library .module-drag-handle{flex:0 0 12px;color:#a0a8b0;font-size:14px;font-weight:800;letter-spacing:-4px;line-height:1}#section-template-library .module-item.is-active .module-drag-handle{color:rgba(255,255,255,.6)}#section-template-library .module-item-name{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:700}#section-template-library .module-kind-badge{flex:0 0 auto;margin-left:auto;padding:2px 8px;border-radius:999px;font-size:9px;font-weight:700;line-height:1.6;color:#3d6b59;background:rgba(46,125,102,.12);white-space:nowrap}#section-template-library .module-kind-badge.is-dynamic{color:#8a5a16;background:rgba(214,158,46,.16)}#section-template-library .module-ref-badge{flex:0 0 auto;padding:2px 7px;border-radius:6px;font-size:9px;font-weight:700;color:#8a6d3b;background:#faf3e0;white-space:nowrap}#section-template-library .module-item.is-active .module-kind-badge{color:#bfe6d8;background:rgba(255,255,255,.16)}#section-template-library .module-item.is-active .module-kind-badge.is-dynamic{color:#f2d9a8;background:rgba(255,255,255,.14)}#section-template-library .module-item.is-active .module-ref-badge{color:#f2d9a8;background:rgba(255,255,255,.12)}#section-template-library .module-item.is-dragging{opacity:.38;transform:scale(.98)}#section-template-library .module-item.is-drop-before{box-shadow:0 -3px 0 #2e7d66}#section-template-library .module-item.is-drop-after{box-shadow:0 3px 0 #2e7d66}#section-template-library .code-panel .template-fields{flex:0 0 auto}#section-template-library .code-workspace{min-width:0;min-height:0;display:flex;flex:1}#section-template-library .code-panel .module-editor{width:100%;border-top:0}#section-template-library .code-panel .module-empty{width:100%;align-self:center}@media(max-width:1350px){#section-template-library .template-header{grid-template-columns:minmax(160px,1fr) minmax(190px,auto) minmax(310px,1fr)}#section-template-library .builder-layout{grid-template-columns:minmax(0,1.45fr) 190px minmax(340px,.72fr)}
}@media(max-width:1180px){#section-template-library .builder-layout{grid-template-columns:minmax(190px,230px) minmax(0,1fr);min-height:0}#section-template-library .preview-panel{grid-column:1/-1;min-height:660px}#section-template-library .module-sidebar-panel,#section-template-library .code-panel{min-height:660px}
}@media(max-width:780px){#section-template-library .template-header{grid-template-columns:auto minmax(120px,1fr) auto;grid-template-rows:1fr;gap:8px;padding:8px 10px}#section-template-library .tool-brand{grid-column:1;grid-row:1}#section-template-library .tool-brand>span:last-child{display:none}#section-template-library .context-icon{width:38px;height:38px;border-radius:11px}#section-template-library .tool-brand-mark{width:38px;height:38px;border-radius:50%}#section-template-library .header-context{grid-column:2;grid-row:1;justify-self:start}#section-template-library .header-context .context-icon{display:none}#section-template-library .header-context #save-status{max-width:150px}#section-template-library .header-actions{grid-column:3;grid-row:1;width:auto;justify-self:end}#section-template-library .editor-header-actions{display:flex;grid-template-columns:none}#section-template-library .header-actions>*{flex:0 0 auto}#section-template-library .header-action,#section-template-library .header-save{min-height:34px;padding:0 8px;font-size:10px}#section-template-library .preview-heading{grid-template-columns:1fr auto}#section-template-library .preview-heading .page-tabs{grid-column:1/-1;grid-row:2;width:100%}#section-template-library .builder-layout{grid-template-columns:160px minmax(0,1fr)}#section-template-library .preview-panel{grid-column:1/-1}
}@media(max-width:560px){#section-template-library .header-context small{display:none}#section-template-library .builder-layout{grid-template-columns:1fr}#section-template-library .preview-panel,#section-template-library .module-sidebar-panel,#section-template-library .code-panel{grid-column:1}#section-template-library .module-sidebar-panel{min-height:320px}#section-template-library .module-sidebar-panel .module-list{max-height:310px}#section-template-library .code-panel{min-height:680px}
}#section-template-library .preview-stage{position:relative;align-items:flex-start;justify-content:center}#section-template-library .preview-viewport{position:relative;flex:0 0 auto;overflow:hidden;border:1px solid var(--line);border-radius:14px;background:#fff;box-shadow:0 14px 36px rgba(29,36,43,.09);transition:width .2s ease,height .2s ease}#section-template-library .preview-stage .preview-viewport iframe{position:absolute;inset:0;width:1440px;height:900px;min-height:0;max-width:none;border:0;border-radius:0;background:#fff;box-shadow:none;transform:scale(var(--preview-scale,1));transform-origin:top left;transition:transform .2s ease}#section-template-library .preview-stage.is-mobile .preview-viewport iframe{width:390px;max-width:none}@media(max-width:720px){#section-template-library .preview-stage .preview-viewport iframe{min-height:0;height:900px}#section-template-library .preview-stage.is-mobile .preview-viewport iframe{height:844px}
}#section-template-library .preview-stage{min-height:0;height:100%}#section-template-library .preview-viewport{min-height:0}#section-template-library .preview-tools{min-width:0;justify-self:end;display:flex;align-items:center;justify-content:flex-end;gap:7px}#section-template-library .preview-mode-switch{display:flex;gap:4px;padding:4px;border:1px solid var(--line);border-radius:12px;background:rgba(244,246,247,.76)}#section-template-library .preview-mode-switch button{min-height:32px;padding:0 11px;border:0;border-radius:9px;font-size:11px;color:#707a84;background:transparent;cursor:pointer;white-space:nowrap}#section-template-library .preview-mode-switch button.is-active{color:#fff;background:#353c43}#section-template-library .shopcc-connect{display:inline-flex;align-items:center;gap:7px;min-height:34px;padding:0 12px;border:1px solid var(--line);border-radius:11px;background:rgba(255,255,255,.86);color:#4b5560;font-size:11px;font-weight:600;cursor:pointer;white-space:nowrap}#section-template-library .shopcc-connect[hidden]{display:none!important}#section-template-library .ds-label{display:block;font-size:11px;font-weight:700;color:#7c8792;margin-bottom:7px}#section-template-library .ds-options{display:grid;gap:8px}#section-template-library .ds-option{position:relative;display:flex;align-items:center;min-height:46px;padding:11px 14px 11px 40px;border:1px solid var(--line);border-radius:11px;cursor:pointer;background:rgba(255,255,255,.72);text-align:left;transition:border-color .18s ease,background .18s ease}#section-template-library .ds-option:hover{border-color:#c3c9cf}
/* 单选框完全自绘。.modal-form input 的 height:46px + 边框 + 10px 圆角会落到 radio 上，
   之前单选框外那圈竖向椭圆描边就是它，这里把外观彻底接管，不再继承输入框样式。 */
#section-template-library .modal-form .ds-option input[type="radio"]{-webkit-appearance:none;appearance:none;position:absolute;left:13px;top:50%;transform:translateY(-50%);flex:none;width:16px;height:16px;min-height:0;margin:0;padding:0;border:1.5px solid #c2c8ce;border-radius:50%;background:#fff;box-shadow:none;outline:0;cursor:pointer;transition:border-color .18s ease,background .18s ease,box-shadow .18s ease}#section-template-library .modal-form .ds-option input[type="radio"]:checked{border-color:#353c43;background:#353c43;box-shadow:inset 0 0 0 3px #fff}#section-template-library .modal-form .ds-option input[type="radio"]:focus-visible{box-shadow:0 0 0 3px rgba(53,60,67,.14)}#section-template-library .modal-form .ds-option input[type="radio"]:checked:focus-visible{box-shadow:inset 0 0 0 3px #fff,0 0 0 3px rgba(53,60,67,.14)}#section-template-library .ds-option:has(input:checked){border-color:#353c43;background:#f2f4f6;box-shadow:0 0 0 1px #353c43 inset}#section-template-library .ds-option .ds-name{font-size:13px;font-weight:700;color:#333}
/* 模拟品类下拉：磨砂面板 + SVG 指示图标，选中项右侧打勾 */
#section-template-library .ds-select-field{margin-top:10px}#section-template-library .ds-select-field[hidden]{display:none!important}#section-template-library .ds-field-label{display:block;font-size:11px;font-weight:700;color:#7c8792;margin-bottom:7px}#section-template-library .ds-select{position:relative}
/* 面板在流内展开：卡片随内容长高，不会遮挡上方选项，也不会被卡片的 overflow 裁掉 */
#section-template-library .ds-select-panel{position:static;margin-top:6px;max-height:296px;overflow-y:auto;padding:6px;border:1px solid rgba(233,236,239,.9);border-radius:13px;background:rgba(250,251,252,.96);-webkit-backdrop-filter:blur(20px) saturate(160%);backdrop-filter:blur(20px) saturate(160%);box-shadow:0 10px 24px -18px rgba(24,31,38,.28),0 0 0 1px rgba(31,38,45,.04);-webkit-mask-image:linear-gradient(to bottom,#000 calc(100% - 16px),transparent);mask-image:linear-gradient(to bottom,#000 calc(100% - 16px),transparent);animation:ds-select-in .2s cubic-bezier(.32,.72,0,1)}#section-template-library .ds-select-trigger{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;height:46px;padding:0 13px;border:1px solid var(--line);border-radius:11px;background:rgba(255,255,255,.82);color:var(--ink);font-size:13px;font-weight:600;text-align:left;cursor:pointer;transition:border-color .18s ease,box-shadow .18s ease,background .18s ease}#section-template-library .ds-select-trigger:hover{border-color:#c3c9cf;background:#fff}#section-template-library .ds-select.open .ds-select-trigger{border-color:#737d87;box-shadow:0 0 0 3px rgba(67,75,83,.08)}#section-template-library .ds-select-chevron{flex:none;color:#8b949d;transition:transform .22s cubic-bezier(.32,.72,0,1)}#section-template-library .ds-select.open .ds-select-chevron{transform:rotate(180deg)}#section-template-library .ds-select-panel[hidden]{display:none!important}@keyframes ds-select-in{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:none}}#section-template-library .ds-select-option{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;padding:8px 10px;border:0;border-radius:9px;background:transparent;color:var(--ink);text-align:left;cursor:pointer;transition:background .15s ease}#section-template-library .ds-select-option:hover{background:rgba(53,60,67,.07)}#section-template-library .ds-select-copy{display:flex;flex-direction:column;gap:2px;min-width:0}#section-template-library .ds-select-copy b{font-size:12.5px;font-weight:650}#section-template-library .ds-select-copy small{font-size:10px;color:#98a1aa;letter-spacing:.02em}#section-template-library .ds-select-check{flex:none;color:#353c43;opacity:0;transform:scale(.7);transition:opacity .16s ease,transform .16s ease}#section-template-library .ds-select-option[aria-selected="true"]{background:rgba(53,60,67,.06)}#section-template-library .ds-select-option[aria-selected="true"] .ds-select-check{opacity:1;transform:none}#section-template-library .ds-select-panel::-webkit-scrollbar{width:6px}#section-template-library .ds-select-panel::-webkit-scrollbar-thumb{border-radius:3px;background:rgba(53,60,67,.18)}#section-template-library #shopcc-domain-field{margin-top:9px}#section-template-library #shopcc-domain-field[hidden]{display:none}#section-template-library .shopcc-connect:hover{transform:translateY(-1px);border-color:#737d87}#section-template-library .shopcc-status-dot{width:9px;height:9px;border-radius:50%;flex:none;background:#9aa1a8}#section-template-library .shopcc-status-dot[data-status="connecting"]{background:#d9a23b;animation:shopcc-pulse 1.1s ease-in-out infinite}#section-template-library .shopcc-status-dot[data-status="connected"]{background:#2f9e63}#section-template-library .scrape-status{margin:0;padding:10px 12px;border-radius:10px;color:#68737e;background:rgba(238,241,244,.9);font-size:11px;line-height:1.55}#section-template-library .scrape-status.is-working{color:#76591f;background:#fff5d9}#section-template-library .scrape-status.is-error{color:#9b4040;background:#fdeaea}#section-template-library .scrape-live-panel[hidden]{display:none!important}#section-template-library .scrape-live-panel{position:absolute;z-index:12;top:24px;right:24px;width:min(390px,calc(100% - 48px));padding:15px;border:1px solid rgba(255,255,255,.9);border-radius:16px;background:rgba(250,251,252,.94);box-shadow:0 18px 50px rgba(28,35,42,.2);backdrop-filter:blur(18px)}#section-template-library .scrape-live-heading{display:flex;align-items:center;gap:10px}#section-template-library .scrape-live-heading>div:not(.scrape-live-actions){min-width:0;flex:1}#section-template-library .scrape-live-heading strong,#section-template-library .scrape-live-heading small{display:block}#section-template-library .scrape-live-heading strong{font-size:13px}#section-template-library .scrape-live-heading small{margin-top:3px;color:#89939d;font-size:9px}#section-template-library .scrape-live-heading button{min-height:30px;padding:0 9px;border:1px solid var(--line);border-radius:9px;color:#67717b;background:#fff;font-size:9px;cursor:pointer}#section-template-library .scrape-live-heading button[hidden]{display:none}#section-template-library .scrape-live-actions{display:flex;gap:5px}#section-template-library .scrape-live-pulse{width:10px;height:10px;border-radius:50%;background:#2f9e63;box-shadow:0 0 0 0 rgba(47,158,99,.34);animation:scrape-live-pulse 1.4s ease-out infinite}#section-template-library .scrape-live-panel[data-state="done"] .scrape-live-pulse{animation:none;box-shadow:none}#section-template-library .scrape-live-panel[data-state="error"] .scrape-live-pulse{animation:none;background:#cf5757;box-shadow:none}#section-template-library .scrape-live-track{height:7px;margin-top:13px;overflow:hidden;border-radius:999px;background:#e4e8eb}#section-template-library .scrape-live-track span{display:block;width:0;height:100%;border-radius:inherit;background:linear-gradient(90deg,#313940,#2f9e63);transition:width .45s ease}#section-template-library .scrape-live-panel[data-state="error"] .scrape-live-track span{background:#cf5757}#section-template-library .scrape-live-stats{margin-top:9px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}#section-template-library .scrape-live-stats span{padding:6px 7px;border:1px solid var(--line);border-radius:8px;color:#8a949d;background:rgba(255,255,255,.72);font-size:8px;text-align:center}#section-template-library .scrape-live-stats b{margin-left:3px;color:#303840;font-size:9px}#section-template-library .scrape-live-panel p{min-height:34px;margin:8px 0 9px;color:#65707a;font-size:10px;line-height:1.65}#section-template-library .scrape-live-pages{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}#section-template-library .scrape-live-pages>span{min-width:0;padding:7px;border:1px solid var(--line);border-radius:9px;color:#7e8993;background:rgba(239,242,244,.72);font-size:9px;text-align:center}#section-template-library .scrape-live-pages strong{display:block;font-size:9px}#section-template-library .scrape-live-pages small{display:flex;justify-content:center;gap:4px;margin-top:4px}#section-template-library .scrape-live-pages i{padding:2px 4px;border-radius:5px;color:#8c969f;background:rgba(255,255,255,.72);font-size:7px;font-style:normal}#section-template-library .scrape-live-pages i.is-running{color:#89621c;background:#fff0c8}#section-template-library .scrape-live-pages i.is-done{color:#247852;background:#dff3e8}#section-template-library .scrape-live-pages>span>b{display:block;margin-top:3px;color:#9ba3aa;font-size:8px}#section-template-library .scrape-live-pages>span.is-active{border-color:#d5aa52;color:#76591f;background:#fff5d9}#section-template-library .scrape-live-pages>span.is-done{border-color:#87c6aa;color:#247852;background:#eaf7f0}#section-template-library .scrape-live-pages>span.is-error{border-color:#dda1a1;color:#9b4040;background:#fdeaea}@keyframes scrape-live-pulse{0%{box-shadow:0 0 0 0 rgba(47,158,99,.4)}70%{box-shadow:0 0 0 8px rgba(47,158,99,0)}100%{box-shadow:0 0 0 0 rgba(47,158,99,0)}}#section-template-library .scrape-ai-option span,#section-template-library .local-extension-help span{min-width:0}#section-template-library .scrape-ai-option b,#section-template-library .scrape-ai-option small,#section-template-library .local-extension-help b,#section-template-library .local-extension-help small{display:block}#section-template-library .scrape-ai-option b,#section-template-library .local-extension-help b{color:#333;font-size:11px}#section-template-library .scrape-ai-option small,#section-template-library .local-extension-help small{margin-top:3px;color:#8d969f;font-size:9px;line-height:1.45}#section-template-library .local-extension-help{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border:1px solid rgba(47,158,99,.2);border-radius:11px;background:#eef8f2}#section-template-library .local-extension-help.is-missing{border-color:#dfb16a;background:#fff6e6}#section-template-library .local-extension-help a{flex:none;padding:7px 10px;border-radius:9px;color:#fff;background:#353c43;text-decoration:none;font-size:10px;font-weight:700}#section-template-library .scrape-ai-option{display:flex!important;grid-template-columns:none!important;flex-direction:row!important;align-items:flex-start;gap:10px!important;padding:10px 11px;border:1px solid var(--line);border-radius:11px;background:rgba(255,255,255,.65);cursor:pointer}#section-template-library .scrape-ai-option input{width:16px!important;height:16px!important;margin:1px 0 0;flex:none}@media(max-width:560px){#section-template-library .local-extension-help{align-items:flex-start;flex-direction:column}#section-template-library .scrape-live-actions{flex-wrap:wrap;justify-content:flex-end}}#section-template-library .scrape-ai-model-field{display:grid!important;gap:6px!important;padding:10px 11px;border:1px solid rgba(105,80,239,.2);border-radius:11px;background:#f5f3ff}#section-template-library .scrape-ai-model-field[hidden]{display:none!important}#section-template-library .scrape-ai-model-field>span{color:#4d426f;font-size:11px;font-weight:800}#section-template-library .scrape-ai-model-field select{width:100%;height:38px;padding:0 11px;border:1px solid #d9d4ee;border-radius:9px;color:#333;background:#fff;font-size:11px;font-weight:700}#section-template-library .scrape-ai-model-field small{color:#81799a;font-size:9px;line-height:1.5}#section-template-library .scrape-ai-model-field.is-error{border-color:#dda1a1;background:#fdeaea}#section-template-library .scrape-ai-model-field.is-error small{color:#9b4040}#section-template-library .shopcc-status-dot[data-status="error"]{background:#d14949}@keyframes shopcc-pulse{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.4;transform:scale(.82)}}#section-template-library .code-panel-heading{align-items:flex-start}#section-template-library .page-import-actions{display:flex;align-items:center;gap:6px}#section-template-library .copy-page-button,#section-template-library .split-page-button{min-height:34px;padding:0 9px;border:1px solid var(--line);border-radius:10px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;white-space:nowrap;font-size:10px;font-weight:700}#section-template-library .copy-page-button{color:#59646e;background:rgba(255,255,255,.82)}#section-template-library .split-page-button{color:#fff;background:#343b42}#section-template-library .page-import-actions .danger-button{min-height:34px;padding:0 9px;border-radius:10px;white-space:nowrap;font-size:10px}#section-template-library .copy-page-button:hover,#section-template-library .split-page-button:hover,#section-template-library .page-import-actions .danger-button:hover{transform:translateY(-1px)}@media(max-width:560px){#section-template-library .preview-heading{grid-template-columns:1fr}#section-template-library .preview-heading .page-tabs{grid-column:1;grid-row:2}#section-template-library .preview-tools{grid-column:1;grid-row:3;width:100%;padding-top:4px;justify-content:space-between;overflow-x:auto}#section-template-library .page-import-actions{width:100%;margin-top:7px}#section-template-library .code-panel-heading{align-items:stretch;flex-direction:column}#section-template-library .page-import-actions{flex-wrap:wrap}#section-template-library .copy-page-button,#section-template-library .split-page-button,#section-template-library .page-import-actions .danger-button{flex:1}
}#section-template-library .code-panel-heading{min-height:0;padding:14px;display:grid;grid-template-columns:minmax(0,1fr);align-items:stretch;gap:12px}#section-template-library .code-panel-intro{min-width:0;display:flex;align-items:baseline;justify-content:space-between;gap:12px}#section-template-library .code-panel-intro small{margin-top:0;text-align:right}#section-template-library .page-import-actions{min-width:0;display:grid;grid-template-columns:minmax(0,1fr);gap:8px}#section-template-library .html-import-dropzone{min-width:0;min-height:60px;padding:9px 10px;border:1px dashed rgba(78,90,101,.32);border-radius:12px;display:grid;grid-template-columns:34px minmax(0,1fr) auto;align-items:center;gap:9px;color:#59646e;background:rgba(255,255,255,.58);cursor:pointer;transition:border-color .18s ease,background .18s ease,box-shadow .18s ease,transform .18s ease}#section-template-library .html-import-dropzone:hover,#section-template-library .html-import-dropzone:focus-visible{border-color:#5e6973;background:rgba(255,255,255,.9);box-shadow:0 0 0 3px rgba(67,75,83,.07);outline:0}#section-template-library .html-import-dropzone.is-dragover{border-color:#343b42;background:#f4f7f8;box-shadow:0 0 0 4px rgba(52,59,66,.1);transform:translateY(-1px)}#section-template-library .html-import-icon{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;color:#fff;background:#3a4249;font-size:17px;font-weight:800}#section-template-library .html-import-copy{min-width:0}#section-template-library .html-import-copy strong,#section-template-library .html-import-copy small{display:block}#section-template-library .html-import-copy strong{font-size:11px}#section-template-library .html-import-copy small{margin-top:3px;overflow:hidden;text-overflow:ellipsis;color:#8b959e;font-size:9px;white-space:nowrap}#section-template-library .html-import-badge{min-height:28px;padding:0 9px;border:1px solid var(--line);border-radius:8px;display:inline-flex;align-items:center;justify-content:center;color:#65707a;background:#fff;font-size:9px;font-weight:700;white-space:nowrap}#section-template-library .page-code-buttons{min-width:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}#section-template-library .page-code-buttons .copy-page-button,#section-template-library .page-code-buttons .split-page-button,#section-template-library .page-code-buttons .danger-button{width:100%;min-width:0;min-height:36px;height:36px;padding:0 7px;overflow:hidden;text-overflow:ellipsis}@media(max-width:380px){#section-template-library .code-panel-intro{align-items:flex-start;flex-direction:column;gap:2px}#section-template-library .code-panel-intro small{text-align:left}#section-template-library .html-import-dropzone{grid-template-columns:34px minmax(0,1fr)}#section-template-library .html-import-badge{display:none}#section-template-library .page-code-buttons{grid-template-columns:1fr 1fr}#section-template-library .page-code-buttons .danger-button{grid-column:1/-1}
}#section-template-library .sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}#section-template-library .header-context{display:block;max-width:360px;text-align:center}#section-template-library .header-context #header-context-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:15px;font-weight:700}#section-template-library .size-modal-card{width:min(560px,100%)}#section-template-library .size-fields{display:grid;grid-template-columns:1fr 1fr 1fr auto;gap:10px;align-items:end}#section-template-library .size-fields label{min-width:0}#section-template-library .size-fields input,#section-template-library .size-fields select{height:46px;text-align:center}#section-template-library .size-lock{width:38px;height:46px;display:grid;place-items:center;color:#59636d;font-size:18px}#section-template-library .size-form .modal-actions .primary-button{min-width:112px}#section-template-library .module-item{scroll-margin-top:20px}@media(max-width:780px){#section-template-library .editor-header-actions{max-width:100%;overflow-x:auto}#section-template-library .header-context{text-align:left}
}@media(max-width:560px){#section-template-library .size-fields{grid-template-columns:1fr 1fr}#section-template-library .size-lock{display:none}
}#section-template-library .header-context{display:flex;align-items:center;justify-content:center;gap:7px}#section-template-library .header-title-edit{min-height:28px;padding:0 9px;border:1px solid var(--line);border-radius:9px;color:#68727c;background:rgba(255,255,255,.78);cursor:pointer;font-size:10px;white-space:nowrap}#section-template-library .header-title-edit:hover{color:#fff;background:#3b4249}#section-template-library .header-title-edit[hidden]{display:none!important}#section-template-library .size-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}#section-template-library .size-fields input{height:46px;text-align:center}#section-template-library .size-form .modal-actions>button,#section-template-library .equal-modal-actions>button{width:116px;min-width:116px;min-height:44px;height:44px;padding:0 14px;display:inline-flex;align-items:center;justify-content:center}#section-template-library .module-editor-heading{grid-template-columns:minmax(140px,1fr) auto;align-items:end;gap:8px}#section-template-library .module-name-field{max-width:190px;gap:4px!important}#section-template-library .module-editor-heading .module-name-field input{height:34px;padding:0 9px;border-radius:9px}#section-template-library .module-editor-actions{display:flex;align-items:center;gap:6px}#section-template-library .module-copy-button,#section-template-library .module-editor-actions .danger-button{height:34px;min-height:34px;padding:0 10px;border-radius:9px;cursor:pointer;font-size:10px;white-space:nowrap}#section-template-library .module-copy-button{border:1px solid var(--line);color:#5b6670;background:rgba(255,255,255,.82)}#section-template-library .module-copy-button:hover{color:#fff;background:#3b4249}#section-template-library .code-panel .code-workspace{border-top:0}@media(max-width:780px){#section-template-library .header-context{justify-content:flex-start}}@media(max-width:420px){#section-template-library .module-editor-heading{grid-template-columns:1fr}#section-template-library .module-name-field{max-width:none}#section-template-library .module-editor-actions{justify-content:flex-end}#section-template-library .size-form .modal-actions>button,#section-template-library .equal-modal-actions>button{width:auto;min-width:0;flex:1}
}#section-template-library .copy-page-button,#section-template-library .split-page-button{font-size:11px;line-height:1;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",Arial,sans-serif}#section-template-library .split-page-button{font-size:12px}#section-template-library .code-panel .module-editor{grid-template-rows:auto auto auto;align-content:start;flex:0 0 auto}#section-template-library .code-field{grid-template-rows:auto 280px auto;gap:7px}#section-template-library .code-field>label{color:#77828d;font-size:10px;font-weight:700}#section-template-library .code-field textarea{height:280px;min-height:280px;max-height:280px;resize:none}#section-template-library .show-full-code-button{width:100%;height:36px;border:1px solid var(--line);border-radius:10px;color:#58636d;background:rgba(255,255,255,.86);cursor:pointer;font-size:11px;font-weight:700}#section-template-library .show-full-code-button:hover{color:#fff;background:#3b4249}#section-template-library .code-modal-card{width:min(980px,100%);max-height:calc(100vh - 36px);display:flex;flex-direction:column}#section-template-library .full-code-form{min-height:0;margin-top:16px;display:grid;grid-template-rows:minmax(320px,1fr) auto;gap:12px;flex:1}#section-template-library .full-code-form textarea{width:100%;height:min(64vh,700px);min-height:320px;padding:16px;border:1px solid #4a535c;border-radius:14px;outline:0;resize:none;color:#eef2f5;background:#292f35;font:12px/1.65 ui-monospace,SFMono-Regular,Consolas,monospace;tab-size:2}#section-template-library .full-code-form textarea:focus{border-color:#7c8791;box-shadow:0 0 0 3px rgba(67,75,83,.12)}@media(max-width:560px){#section-template-library .code-field{grid-template-rows:auto 240px auto}#section-template-library .code-field textarea{height:240px;min-height:240px;max-height:240px}#section-template-library .code-modal-card{max-height:calc(100vh - 20px);padding:16px}#section-template-library .full-code-form textarea{height:62vh;min-height:260px}
}#section-template-library .code-size-indicator{
  font-size: 11px;
  font-weight: 400;
  color: #8a94a6;
  margin-left: 6px;
  padding: 2px 8px;
  background: #f0f2f5;
  border-radius: 10px;
  white-space: nowrap;
}#section-template-library .code-size-indicator.is-large{
  color: #d97706;
  background: #fef3c7;
}#section-template-library .code-size-indicator.is-overflow{
  color: #dc2626;
  background: #fee2e2;
}#section-template-library .preview-refresh-indicator{
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 11px;
  color: #6c5ce7;
  background: rgba(108, 92, 231, 0.1);
  padding: 3px 10px;
  border-radius: 10px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  z-index: 10;
}#section-template-library .preview-refresh-indicator.is-visible{
  opacity: 1;
}#section-template-library .template-header .tool-brand{ gap: 12px; }#section-template-library .template-header .tool-brand strong{ letter-spacing: .14em; }#section-template-library .template-header .tool-brand small{ font-size: 10px; letter-spacing: .18em; text-transform: uppercase; }#section-template-library #site-header-nav{ gap: 8px; }#section-template-library #site-header-nav .header-nav-button{
  height: 34px; padding: 0 12px; border: 1px solid rgba(20,29,38,.12); border-radius: 12px;
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  background: rgba(255,255,255,.62); color: #202833; text-decoration: none;
  font-size: 11px; font-weight: 700; cursor: pointer;
  transition: background .15s, transform .15s;
}#section-template-library #site-header-nav .header-nav-button:hover{ background: #fff; transform: translateY(-1px); }#section-template-library #site-header-nav .header-nav-button svg{ width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; display: block; }#section-template-library #site-header-nav .icon-button{
  width: 34px; height: 34px; border: 1px solid rgba(20,29,38,.12); border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.62); color: #202833; cursor: pointer;
  transition: background .15s, transform .15s;
}#section-template-library #site-header-nav .icon-button:hover{ background: #fff; transform: translateY(-1px); }#section-template-library #site-header-nav .icon-button svg{ width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; display: block; }@media (max-width: 540px){#section-template-library #site-header-nav .header-nav-button span{ display: none; }#section-template-library #site-header-nav .header-nav-button{ padding: 0; width: 34px; justify-content: center; }
}#section-template-library .editor-view{padding-top:12px}#section-template-library .editor-toolbar{
  display:flex;align-items:center;gap:10px;flex-wrap:nowrap;
  min-height:58px;padding:9px 12px;margin-bottom:12px;border-radius:18px;
}#section-template-library .editor-toolbar[hidden]{display:none}#section-template-library .toolbar-button{
  height:38px;padding:0 13px;border:1px solid rgba(20,29,38,.12);border-radius:12px;
  display:inline-flex;align-items:center;justify-content:center;gap:7px;white-space:nowrap;
  background:rgba(255,255,255,.72);color:#2a323b;cursor:pointer;
  font-size:12px;font-weight:600;line-height:1;
  transition:background .15s,transform .15s,box-shadow .15s;
}#section-template-library .toolbar-button svg{width:17px;height:17px;flex:0 0 auto;display:block;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}#section-template-library .toolbar-button:hover{background:#fff;transform:translateY(-1px)}#section-template-library .toolbar-back{font-weight:700;color:#333b43;padding-left:10px}#section-template-library .toolbar-back svg{width:19px;height:19px;margin-left:-3px}#section-template-library .toolbar-separator{width:1px;height:24px;background:var(--line);flex:0 0 auto}#section-template-library .toolbar-spacer{flex:1 1 auto;min-width:6px}#section-template-library .toolbar-scrape{
  border-color:#3a4149;color:#fff;
  background:linear-gradient(135deg,#4a535d,#2b3138);
  box-shadow:0 8px 18px rgba(35,42,49,.18);font-weight:700;
}#section-template-library .toolbar-scrape:hover{background:linear-gradient(135deg,#56606c,#323942)}#section-template-library .autosave-indicator{
  display:inline-flex;align-items:center;gap:6px;height:34px;padding:0 10px;border-radius:10px;
  color:#5c9466;font-size:11px;font-weight:600;white-space:nowrap;
}#section-template-library .autosave-indicator svg{width:15px;height:15px;flex:0 0 auto;display:block;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}#section-template-library .autosave-indicator.is-saving{color:#9a7d2e}#section-template-library .autosave-indicator.is-error{color:#a44c4c;cursor:pointer;border-radius:8px}#section-template-library .autosave-indicator.is-error:hover{background:rgba(164,76,76,.1)}#section-template-library .ghost-danger-button{
  height:34px;padding:0 12px;border:1px solid rgba(164,76,76,.22);border-radius:10px;
  background:#fff;color:#a44c4c;cursor:pointer;font-size:11px;font-weight:600;white-space:nowrap;
  transition:background .15s,transform .15s;
}#section-template-library .ghost-danger-button:hover{background:#fdf1f1;transform:translateY(-1px)}#section-template-library .code-panel-heading{
  min-height:64px;padding:11px 15px;display:flex;flex-direction:row;
  align-items:center;justify-content:space-between;gap:12px;
}#section-template-library .code-panel-intro{min-width:0;display:flex;flex-direction:column;gap:3px}#section-template-library .code-panel-intro small{margin-top:0;text-align:left}#section-template-library .scrape-pages{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin:4px 0 2px}#section-template-library .scrape-check{display:flex;flex-direction:column;gap:3px;padding:11px 12px;border:1px solid var(--line);border-radius:12px;background:rgba(255,255,255,.7)}#section-template-library .scrape-check input{width:15px;height:15px;margin:0 0 2px;accent-color:#3a4149}#section-template-library .scrape-check-name{font-size:12px;font-weight:700;color:#333b43}#section-template-library .scrape-check small{color:#929ba4;font-size:10px;line-height:1.4}#section-template-library .builder-layout{min-height:calc(100vh - 188px)}#section-template-library .preview-stage iframe{height:calc(100vh - 366px)}@media(max-width:1100px){#section-template-library .editor-toolbar{flex-wrap:wrap}#section-template-library .toolbar-spacer{display:none}#section-template-library .builder-layout{min-height:0}#section-template-library .preview-stage iframe{height:620px}
}#section-template-library .card-preview:not(.card-cover):not(:has(iframe[src])){
  background:linear-gradient(110deg,#e7eaed 20%,#f5f6f7 40%,#e7eaed 60%);
  background-size:220% 100%;animation:card-preview-loading 1.4s linear infinite;
}#section-template-library .card-preview.is-preview-empty,#section-template-library .card-preview.is-preview-error{animation:none;background:#e7eaed}#section-template-library .card-preview.is-preview-error::before{
  content:"预览加载失败，点击编辑仍可正常打开";position:absolute;inset:0;display:grid;place-items:center;
  padding:20px;text-align:center;color:#8a949e;font-size:11px;
}@keyframes card-preview-loading{to{background-position:-220% 0}}

/* ============================================================
   主框架内嵌适配：尺寸、留白与两页布局
   配色沿用工具自身黑白磨砂灰，不覆盖任何颜色
   ============================================================ */
#section-template-library{
  padding:0;
  background:none;
  box-sizing:border-box;
  height:calc(100vh - 130px);
  min-height:560px;
  display:flex;
  flex-direction:column;
  color:var(--ink);
  /* 关掉主框架的入场动画：transform 会让 fixed 弹窗被困在面板内 */
  animation:none;
}
#section-template-library[hidden]{display:none}
#section-template-library .template-shell{
  width:100%;
  max-width:none;
  margin:0;
  height:100%;
  min-height:0;
  display:flex;
  flex-direction:column;
  gap:12px;
}

/* 模板库首页 */
#section-template-library #library-view{
  display:flex;
  flex-direction:column;
  gap:12px;
  flex:1 1 auto;
  padding:18px 18px 20px;
  margin-bottom:38px;
  min-height:0;
  position:relative;
  background:#fff;
  border:1px solid var(--line);
  border-radius:22px;
  box-shadow:0 18px 42px rgba(38,46,54,.08);
}
#section-template-library #library-view[hidden]{display:none}
#section-template-library .library-toolbar{
  flex:0 0 auto;
  min-height:64px;
  padding:10px 14px;
  gap:14px;
  border-radius:18px;
}
#section-template-library .library-title{
  flex:1 1 auto;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:2px;
}
#section-template-library .library-title strong{font-size:15px;letter-spacing:-.01em}
#section-template-library .library-title small{color:#8b949e;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#section-template-library .library-title .eyebrow{font-size:9px;line-height:1.2}
/* 弹窗盖过底部 dock，避免弹窗打开时 dock 仍浮在最上层 */
#section-template-library .modal{z-index:130}
/* 单选/复选沿用黑白灰，不用系统蓝 */
#section-template-library .modal input[type="radio"],
#section-template-library .modal input[type="checkbox"]{accent-color:#3a4149}
#section-template-library .device-switch button{white-space:nowrap}
#section-template-library .shopcc-connect{white-space:nowrap}
#section-template-library .preview-panel{grid-template-rows:auto minmax(0,1fr)}
#section-template-library .category-control>span{white-space:nowrap}
#section-template-library .template-grid{
  flex:1 1 auto;
  min-height:0;
  padding:0 0 4px;
  overflow-y:auto;
  align-content:start;
  grid-template-columns:repeat(5,minmax(0,1fr));
  /* 行高按卡片实际高度走，避免被容器剩余空间分摊后上下两排叠在一起 */
  grid-auto-rows:max-content;
  gap:14px;
}
/* 卡片交给正常流排版：预览固定宽幅比例、信息区紧凑，避免 aspect-ratio 与 grid 行高打架 */
#section-template-library .template-card{
  aspect-ratio:auto;
  display:flex;
  flex-direction:column;
}
#section-template-library .template-card .card-preview{
  flex:0 0 auto;
  aspect-ratio:16/10;
  min-height:0;
}
/* 组件卡片与编辑器使用同一张 1920×1200（16:10）画布；占位阶段也保持同比例，
   避免从 16:10 切到 1.85:1 时高度突然变矮，导致已算好的缩放下半截被裁掉。 */
#section-template-library .template-card[data-template-type="component"] .card-preview:not(.card-cover){
  aspect-ratio:16/10;
  background:#fff;
}
#section-template-library .card-preview[data-card-fit="content"] iframe{background:#fff}
#section-template-library .template-card .card-body{
  flex:0 0 auto;
  min-height:84px;
  padding:10px 12px 12px;
  gap:5px;
}
#section-template-library .template-card .card-body h2{font-size:14px;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#section-template-library .template-card .card-category{font-size:10.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#section-template-library .template-card .card-meta{font-size:9.5px}
#section-template-library #library-empty{
  position:absolute;
  inset:0;
  margin:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  background:transparent;
  border:0;
  box-shadow:none;
  -webkit-backdrop-filter:none;
  backdrop-filter:none;
  padding:24px 20px;
}
#section-template-library #library-empty[hidden]{display:none}

/* 模板编辑页 */
#section-template-library #editor-view{
  display:flex;
  flex-direction:column;
  gap:12px;
  padding:0;
  height:100%;
  min-height:0;
}
#section-template-library #editor-view[hidden]{display:none}
#section-template-library .editor-toolbar{
  flex:0 0 auto;
  margin:0;
  min-height:58px;
}
#section-template-library .editor-title{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:0;
}
#section-template-library .editor-title strong{font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#section-template-library .editor-title .eyebrow{font-size:9px;line-height:1.2}
#section-template-library .builder-layout{
  flex:1 1 auto;
  height:auto;
  min-height:0;
  grid-template-columns:minmax(0,1.62fr) minmax(196px,214px) minmax(350px,.78fr);
  align-items:stretch;
}
#section-template-library .preview-panel,
#section-template-library .module-sidebar-panel,
#section-template-library .code-panel{min-height:0}
#section-template-library .preview-stage{min-height:0;padding:12px}
#section-template-library .preview-stage iframe{height:100%;min-height:0}
#section-template-library .module-panel{min-height:0}
#section-template-library .module-list{max-height:none;min-height:0;flex:1;overflow:auto}
#section-template-library .code-workspace{min-height:0}
#section-template-library .code-field{min-height:0}
#section-template-library .code-field textarea{min-height:0;height:100%;resize:none}
#section-template-library .module-empty{padding:32px 18px}

/* 窄窗时回到两栏，预览占满一行 */
@media(max-width:1200px){
  #section-template-library .builder-layout{
    grid-template-columns:minmax(0,1.4fr) minmax(320px,.9fr);
    grid-template-rows:minmax(0,1.5fr) minmax(0,1fr);
  }
  #section-template-library .preview-panel{grid-column:1/-1}
  #section-template-library .library-toolbar{flex-wrap:wrap}
  #section-template-library .library-title small{display:none}
}

/* 轻提示：dock 占住底部，提示改到 dock 上方右角；ai-ruitu.css 的 .toast 是网格布局，这里显式改回块级 */
#section-template-library .toast{
  display:block;
  grid-template-columns:none;
  top:auto;
  bottom:86px;
  left:auto;
  right:22px;
  transform:none;
  width:max-content;
  min-width:0;
  max-width:min(400px,calc(100vw - 44px));
  white-space:normal;
  line-height:1.5;
  z-index:90;
}
#section-template-library .toast[hidden]{display:none}

/* 脚本需要的隐藏触发点 */
.tl-proxies{display:none}

/* 本视图铺满面板：收敛内容区为 dock 预留的留白，避免多余滚动条 */
.content:has(#section-template-library:not([hidden])){padding-bottom:26px}

/* v2.10 · Discover 工具栏：左侧圆形搜索 + 主题/UI 胶囊，点搜索后胶囊收起、展开输入框 */
#section-template-library .library-discover{display:flex;align-items:center;justify-content:center;gap:14px;flex:0 0 auto;min-height:56px}
#section-template-library .discover-round{width:56px;height:56px;flex:0 0 auto;display:grid;place-items:center;border:1px solid rgba(255,255,255,.95);border-radius:50%;background:rgba(255,255,255,.72);color:#2b333a;box-shadow:0 14px 32px rgba(38,46,54,.12);backdrop-filter:blur(22px);cursor:pointer;overflow:hidden;transition:width .38s cubic-bezier(.22,1,.36,1),opacity .28s ease,filter .32s ease,padding .38s ease}
#section-template-library .discover-round svg{width:22px;height:22px;display:block}
#section-template-library .discover-round:hover{color:#11151a;box-shadow:0 18px 38px rgba(38,46,54,.18)}
#section-template-library .discover-tabs{display:flex;gap:4px;flex:0 0 auto;max-width:440px;padding:6px;border:1px solid rgba(255,255,255,.95);border-radius:999px;background:rgba(255,255,255,.72);box-shadow:0 18px 42px rgba(38,46,54,.1);backdrop-filter:blur(24px);overflow:hidden;transition:max-width .38s cubic-bezier(.22,1,.36,1),opacity .28s ease,filter .32s ease,padding .38s ease}
#section-template-library .discover-tabs button{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 26px;border:0;border-radius:999px;background:transparent;color:#6b757f;font-size:13px;font-weight:700;white-space:nowrap;cursor:pointer;transition:color .18s ease,background .18s ease,box-shadow .18s ease}
#section-template-library .discover-tabs button svg{width:16px;height:16px;flex:0 0 auto}
#section-template-library .discover-tabs button:hover{color:#3a4249}
#section-template-library .discover-tabs button.is-active{color:#fff;background:linear-gradient(135deg,#4a525b,#262c32);box-shadow:0 9px 20px rgba(35,42,49,.22)}
#section-template-library .discover-field{display:flex;align-items:center;gap:10px;flex:0 0 auto;height:56px;max-width:0;padding:0;border:1px solid rgba(255,255,255,.95);border-radius:999px;background:rgba(255,255,255,.72);box-shadow:0 14px 34px rgba(38,46,54,.08);backdrop-filter:blur(22px);overflow:hidden;opacity:0;filter:blur(8px);pointer-events:none;transition:max-width .4s cubic-bezier(.22,1,.36,1),opacity .3s ease,filter .36s ease,padding .4s ease}
#section-template-library .discover-field svg{width:20px;height:20px;flex:0 0 auto;color:#8a949e}
#section-template-library .discover-field input{width:230px;max-width:38vw;border:0;outline:0;background:transparent;color:var(--ink);font-size:14px}
#section-template-library .discover-field input::placeholder{color:#9aa3ac}
#section-template-library .discover-close{width:0;opacity:0;filter:blur(8px);pointer-events:none}
#section-template-library .is-searching .discover-search-toggle,
#section-template-library .is-searching .discover-tabs{max-width:0;opacity:0;filter:blur(8px);pointer-events:none;padding:0}
#section-template-library .is-searching .discover-search-toggle{width:0}
#section-template-library .is-searching .discover-field{max-width:360px;padding:0 22px;opacity:1;filter:blur(0);pointer-events:auto}
#section-template-library .is-searching .discover-close{width:56px;opacity:1;filter:blur(0);pointer-events:auto}
@media(max-width:560px){
  #section-template-library .library-discover{gap:10px}
  #section-template-library .discover-tabs button{padding:0 18px;min-height:42px;font-size:12px}
  #section-template-library .discover-field input{width:180px;max-width:52vw}
}

/* v2.10 · 满屏高度传递 + 空态主题商店图标（白色面板与 dock 的间隙由 #library-view 的 margin-bottom 控制） */
#section-template-library{height:100%;display:flex;flex-direction:column;padding-bottom:0}
#section-template-library .template-shell{flex:1 1 auto;display:flex;flex-direction:column;min-height:0}
#section-template-library .library-discover{flex:0 0 auto;position:relative;z-index:2}
#section-template-library .empty-state .empty-icon{width:72px;height:72px;border-radius:22px;display:grid;place-items:center;color:#fff;background:linear-gradient(145deg,#505863,#22272d);box-shadow:0 14px 28px rgba(28,33,40,.22),inset 0 1px 1px rgba(255,255,255,.3)}
#section-template-library .empty-state .empty-icon svg{width:34px;height:34px}

/* 卡片网格响应式：默认 5 列，窄屏逐级降列，避免卡片被挤压 */
@media(max-width:1350px){#section-template-library .template-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:1100px){#section-template-library .template-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:780px){#section-template-library .template-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:540px){#section-template-library .template-grid{grid-template-columns:1fr}}

/* 卡片分页：每页 25 张，底部页码切换，避免组件变多后一次性挂满 iframe */
#section-template-library .library-pagination{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:18px;margin-top:6px;padding:12px 2px 0;border-top:1px solid rgba(57,66,75,.1)}
#section-template-library .library-pagination[hidden]{display:none!important}
#section-template-library .library-pagination-summary{color:#8a949e;font-size:11px;white-space:nowrap}
#section-template-library .library-pagination-pages{display:flex;align-items:center;justify-content:flex-end;gap:5px;min-width:0}
#section-template-library .library-page-button{min-width:32px;height:32px;padding:0 9px;border:1px solid transparent;border-radius:8px;display:inline-flex;align-items:center;justify-content:center;gap:4px;color:#56616b;background:transparent;cursor:pointer;font-size:11px;font-weight:600;line-height:1;transition:background .16s ease,color .16s ease,border-color .16s ease,box-shadow .16s ease}
#section-template-library .library-page-button:hover:not(:disabled):not(.is-active){border-color:#dfe4e8;background:#fff;color:#20272e}
#section-template-library .library-page-button:focus-visible{outline:0;border-color:#727d87;box-shadow:0 0 0 3px rgba(53,60,67,.08)}
#section-template-library .library-page-button.is-active{cursor:default;color:#fff;background:#343b42;border-color:#343b42;box-shadow:0 5px 12px rgba(35,42,49,.13)}
#section-template-library .library-page-button.is-nav{padding:0 8px;color:#6f7a84;font-weight:500}
#section-template-library .library-page-button:disabled{opacity:.35;cursor:default}
#section-template-library .library-page-icon{display:inline-flex;align-items:center;justify-content:center;width:12px;height:12px;flex:0 0 12px}
#section-template-library .library-page-icon svg{width:12px;height:12px}
#section-template-library .library-page-ellipsis{min-width:22px;height:32px;display:inline-flex;align-items:center;justify-content:center;color:#a0a9b2;font-size:11px}
@media(max-width:980px){#section-template-library .library-pagination{align-items:flex-start;flex-direction:column;gap:9px}#section-template-library .library-pagination-pages{width:100%;justify-content:center}}

/* v2.10.7 · 设备切换移到编辑器顶部；模块名称输入紧凑化 */
#section-template-library .top-device-switch{flex:0 0 auto;margin-right:2px}
#section-template-library .top-device-switch button{min-height:32px;padding:0 12px;font-size:11px}
#section-template-library .module-editor-heading .module-name-field{max-width:200px;gap:4px}
#section-template-library .module-editor-heading .module-name-field>span{font-size:9.5px;letter-spacing:.04em}
#section-template-library .module-editor-heading .module-name-field input{height:34px;padding:0 10px;border-radius:9px;font-size:12px}
@media(max-width:780px){
  #section-template-library .top-device-switch button{padding:0 9px;font-size:10px}
  #section-template-library .module-editor-heading .module-name-field{max-width:150px}
}
#section-template-library .card-preview iframe[data-card-baseline="1920"]{width:1920px;height:1200px}

/* v2.11 · 卡片改为轻量静态封面；实时预览只在用户点开单个模板时加载完整 iframe */
#section-template-library .card-cover{display:block;background:linear-gradient(145deg,var(--cover-a,#e8ecef),var(--cover-b,#dbe1e5))}
#section-template-library .card-cover[data-tone="sage"]{--cover-a:#e8eee5;--cover-b:#d6dfd0;--cover-ink:#485949}
#section-template-library .card-cover[data-tone="sand"]{--cover-a:#f2ebdf;--cover-b:#e3d7c3;--cover-ink:#655746}
#section-template-library .card-cover[data-tone="slate"]{--cover-a:#e9eef1;--cover-b:#d5dfe6;--cover-ink:#475862}
#section-template-library .card-cover[data-tone="rose"]{--cover-a:#f3e8e6;--cover-b:#e3d1cd;--cover-ink:#66504e}
#section-template-library .card-cover[data-tone="sky"]{--cover-a:#e7eff3;--cover-b:#d1e0e8;--cover-ink:#435962}
#section-template-library .card-cover[data-tone="olive"]{--cover-a:#edede0;--cover-b:#dcdcc7;--cover-ink:#575a44}
#section-template-library .card-cover-art{position:absolute;inset:0;overflow:hidden;color:var(--cover-ink,#4b565f);pointer-events:none}
#section-template-library .card-cover-grid{position:absolute;inset:0;opacity:.38;background-image:linear-gradient(rgba(255,255,255,.6) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.6) 1px,transparent 1px);background-size:22px 22px;mask-image:linear-gradient(135deg,#000 10%,transparent 78%)}
#section-template-library .card-cover-mark{position:absolute;right:auto;left:14px;bottom:-8px;max-width:calc(100% - 28px);overflow:hidden;color:var(--cover-ink,#4b565f);opacity:.13;font-size:clamp(30px,3.8vw,52px);font-weight:800;letter-spacing:-.09em;line-height:1;white-space:nowrap;text-overflow:clip}
#section-template-library .card-cover-icon{position:absolute;top:18px;left:18px;width:42px;height:42px;border:1px solid rgba(255,255,255,.65);border-radius:13px;display:grid;place-items:center;color:var(--cover-ink,#4b565f);background:rgba(255,255,255,.54);box-shadow:0 8px 18px rgba(38,47,54,.08);backdrop-filter:blur(8px)}
#section-template-library .card-cover-icon svg{width:20px;height:20px}
#section-template-library .card-cover-label{position:absolute;left:18px;bottom:16px;max-width:calc(100% - 104px);padding:5px 9px;border:1px solid rgba(255,255,255,.55);border-radius:8px;overflow:hidden;color:var(--cover-ink,#4b565f);background:rgba(255,255,255,.46);font-size:9.5px;font-weight:700;letter-spacing:.02em;text-overflow:ellipsis;white-space:nowrap;backdrop-filter:blur(8px)}
#section-template-library .card-cover-preview{position:absolute;right:12px;bottom:12px;min-height:30px;padding:0 10px;border:1px solid rgba(255,255,255,.75);border-radius:9px;color:#fff;background:rgba(43,50,57,.74);cursor:pointer;font-size:9.5px;font-weight:700;letter-spacing:.03em;opacity:.86;transition:opacity .16s ease,background .16s ease,transform .16s ease}
#section-template-library .card-cover-preview:hover{opacity:1;background:rgba(35,42,49,.9);transform:translateY(-1px)}
#section-template-library .card-cover-preview:focus-visible{outline:0;box-shadow:0 0 0 3px rgba(53,60,67,.2)}
@media(max-width:780px){#section-template-library .card-cover-preview{opacity:1}}
/* 真实缩略图：截图铺满 16:10 卡片，cover 图避免留白；只有加载失败才回退到色调封面。 */
#section-template-library .card-thumb .card-shot-img{position:absolute;z-index:1;inset:0;width:100%;height:100%;display:block;object-fit:cover;background:#fff}
#section-template-library .card-thumb:not(.is-thumb-missing) .card-cover-art,
#section-template-library .card-thumb:not(.is-thumb-missing) .card-cover-icon,
#section-template-library .card-thumb:not(.is-thumb-missing) .card-cover-label{display:none}
#section-template-library .card-thumb .card-cover-preview{z-index:3}
#section-template-library .card-thumb .card-actions{z-index:4}

#section-template-library .template-card-preview-modal-card{width:min(1120px,94vw);max-height:calc(100vh - 36px);padding:20px;display:flex;flex-direction:column}
#section-template-library .template-card-preview-meta{margin:7px 0 0;color:#7f8993;font-size:11px}
#section-template-library .template-card-preview-stage{position:relative;flex:1 1 auto;height:min(68vh,720px);min-height:280px;margin-top:16px;border:1px solid var(--line);border-radius:16px;overflow:hidden;background:#eef1f4}
#section-template-library .template-card-preview-stage iframe{width:100%;height:100%;display:block;border:0;background:#fff}
#section-template-library .template-card-preview-stage iframe[hidden]{display:none!important}
#section-template-library .template-card-preview-loading{position:absolute;z-index:2;inset:0;display:grid;place-content:center;gap:7px;text-align:center;color:#5d6872;background:radial-gradient(circle at 50% 42%,#fff,rgba(238,241,244,.96) 68%)}
#section-template-library .template-card-preview-loading[hidden]{display:none!important}
#section-template-library .template-card-preview-loading strong{font-size:13px}
#section-template-library .template-card-preview-loading small{color:#8a949e;font-size:10px}
#section-template-library .template-card-preview-spinner{width:26px;height:26px;margin:0 auto 4px;border:2px solid #d8dee3;border-top-color:#343b42;border-radius:50%;animation:template-preview-spin .8s linear infinite}
@keyframes template-preview-spin{to{transform:rotate(360deg)}}
#section-template-library .template-card-preview-error{position:absolute;z-index:3;inset:0;padding:28px;display:grid;place-content:center;gap:8px;text-align:center;color:#8d4f4f;background:#f7eeee;font-size:12px;line-height:1.7}
#section-template-library .template-card-preview-error[hidden]{display:none!important}
#section-template-library .template-card-preview-actions{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:14px}
#section-template-library .template-card-preview-actions>span{color:#8a949e;font-size:10px}
#section-template-library .template-card-preview-actions>div{display:flex;gap:8px}
@media(max-width:780px){#section-template-library .template-card-preview-modal-card{width:100%;max-height:calc(100vh - 20px);padding:14px}#section-template-library .template-card-preview-stage{height:60vh;margin-top:12px}#section-template-library .template-card-preview-actions{align-items:flex-start;flex-direction:column;gap:9px}#section-template-library .template-card-preview-actions>div{width:100%}#section-template-library .template-card-preview-actions button{flex:1}}



/* v2.11 · 组件库编辑器：去掉模块侧栏，左预览右代码两栏 */
#section-template-library[data-editor-type="component"] .module-sidebar-panel{display:none!important}
#section-template-library[data-editor-type="component"] .builder-layout{grid-template-columns:minmax(0,1.52fr) minmax(420px,.92fr)}
#section-template-library[data-editor-type="component"] .code-panel{min-height:0}
#section-template-library[data-editor-type="component"] .code-panel-heading{padding:14px}
@media(max-width:1200px){
  #section-template-library[data-editor-type="component"] .builder-layout{grid-template-columns:1fr;grid-template-rows:minmax(360px,54vh) minmax(420px,1fr)}
  #section-template-library[data-editor-type="component"] .preview-panel{grid-column:1}
  #section-template-library[data-editor-type="component"] .code-panel{grid-column:1}
}

#section-template-library .module-editor-heading[hidden]{display:none!important}

/* v2.18 · 模块 / 组件 JSON 导出面板 */
#section-template-library .module-json-panel{min-height:0;padding-top:2px;display:grid;gap:7px}
#section-template-library .module-json-heading{min-height:30px;display:flex;align-items:center;justify-content:space-between;gap:10px}
#section-template-library .module-json-copy{min-width:0;display:grid;gap:3px}
#section-template-library .module-json-copy strong{font-size:10px;color:#77828d}
#section-template-library .module-json-copy small{overflow:hidden;color:#99a1a9;font-size:9px;line-height:1.4;text-overflow:ellipsis;white-space:nowrap}
#section-template-library .module-json-actions{flex:0 0 auto;display:flex;align-items:center;gap:5px}
#section-template-library .module-json-apply{flex:0 0 auto;height:26px;padding:0 8px;border:1px solid #3b4249;border-radius:8px;display:inline-flex;align-items:center;gap:4px;color:#fff;background:#3b4249;cursor:pointer;font-size:9px;font-weight:700;white-space:nowrap}
#section-template-library .module-json-apply:hover{background:#252b31;border-color:#252b31}
#section-template-library .module-json-apply:disabled{opacity:.34;cursor:not-allowed}
#section-template-library .module-json-apply svg{width:13px;height:13px}
#section-template-library .module-json-import{flex:0 0 auto;height:26px;padding:0 9px;border:1px solid var(--line);border-radius:8px;display:inline-flex;align-items:center;gap:5px;color:#64707a;background:rgba(255,255,255,.7);cursor:pointer;font-size:9px;font-weight:700;white-space:nowrap}
#section-template-library .module-json-import:hover{color:#fff;background:#3b4249;border-color:#3b4249}
#section-template-library .module-json-import:disabled{opacity:.42;cursor:not-allowed}
#section-template-library .module-json-import svg{width:14px;height:14px}
#section-template-library .module-json-code{position:relative;min-height:0}
#section-template-library .module-json-download{position:absolute;z-index:2;top:8px;right:18px;width:30px;height:30px;padding:0;border:1px solid rgba(255,255,255,.2);border-radius:9px;display:grid;place-items:center;color:#e5ebef;background:rgba(255,255,255,.1);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);cursor:pointer;font-size:0;line-height:1}
#section-template-library .module-json-download:hover{color:#fff;background:rgba(255,255,255,.2);border-color:rgba(255,255,255,.34)}
#section-template-library .module-json-download:disabled{opacity:.45;cursor:not-allowed}
#section-template-library .module-json-panel textarea{width:100%;height:200px;min-height:200px;padding:10px 52px 10px 10px;resize:none;border:1px solid var(--line);border-radius:12px;outline:0;color:#dfe7ec;background:#252b31;font:10px/1.6 ui-monospace,SFMono-Regular,Consolas,monospace;tab-size:2}
#section-template-library .module-json-panel textarea:focus{border-color:#737d87;box-shadow:0 0 0 3px rgba(67,75,83,.08)}
#section-template-library .module-json-code.is-editing textarea{border-color:#98a2ab;box-shadow:0 0 0 3px rgba(67,75,83,.05)}
#section-template-library .module-json-panel textarea::selection{color:#fff;background:#4d5963}
@media(max-width:540px){#section-template-library .module-json-panel textarea{height:180px;min-height:180px}}

/* 代码区与 JSON 面板同时存在时，给代码区留出 200px；查看全部改为右下角悬浮眼睛图标 */
#section-template-library .code-panel .module-editor{grid-template-rows:auto auto auto;align-content:start}
#section-template-library .code-field{position:relative;grid-template-rows:auto 200px}
#section-template-library .code-field textarea{height:200px;min-height:200px;max-height:200px;padding-right:48px;padding-bottom:42px}
#section-template-library .show-full-code-button{position:absolute;z-index:2;right:18px;bottom:12px;width:30px;height:30px;padding:0;border:1px solid rgba(255,255,255,.18);border-radius:9px;display:grid;place-items:center;color:#dce3e8;background:rgba(22,27,32,.52);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);cursor:pointer;font-size:0;line-height:1}
#section-template-library .show-full-code-button:hover{color:#fff;background:rgba(22,27,32,.78);border-color:rgba(255,255,255,.32)}
#section-template-library .show-full-code-button svg{width:16px;height:16px}
@media(max-width:560px){
  #section-template-library .code-field{grid-template-rows:auto 180px}
  #section-template-library .code-field textarea{height:180px;min-height:180px;max-height:180px}
  #section-template-library .show-full-code-button{right:12px;bottom:9px;width:30px;height:30px}
}

/* 组件库只有一页：顶部只显示组件分类，不展示可下拉的箭头。 */
#section-template-library .page-tab-menu[data-component-mode="1"] .page-tab-trigger{padding:0 14px;cursor:default}
#section-template-library .page-tab-menu[data-component-mode="1"] .page-tab-chevron{display:none}

/* 从 JSON 还原组件：与完整代码弹窗共用尺寸，只把输入区改成 JSON。 */
#section-template-library .json-import-form{position:relative;min-height:0;margin-top:16px;display:grid;grid-template-rows:auto minmax(280px,1fr) auto auto;gap:10px;flex:1}
#section-template-library .json-drop-zone{position:relative;display:grid;min-height:0}
#section-template-library .json-import-form>label{display:grid;gap:4px;color:#7c8792;font-size:10px;font-weight:700}
#section-template-library .json-import-form>label small{color:#99a1a9;font-size:9px;font-weight:400}
#section-template-library .json-import-form textarea{width:100%;height:100%;min-height:280px;padding:14px;border:1px solid #4a535c;border-radius:14px;outline:0;resize:none;color:#eef2f5;background:#292f35;font:12px/1.65 ui-monospace,SFMono-Regular,Consolas,monospace;tab-size:2}
#section-template-library .json-import-form textarea:focus{border-color:#7c8791;box-shadow:0 0 0 3px rgba(67,75,83,.12)}
#section-template-library .json-import-form textarea::placeholder{color:#8f99a2}
#section-template-library .json-import-form .modal-help{margin:0;line-height:1.6}
#section-template-library .json-import-form .modal-help.is-error{color:#a44c4c}
#section-template-library .json-import-form .modal-help.is-success{color:#3d6b59}
#section-template-library .json-import-form.is-dragging textarea{border-color:#8f9aa4;background:#30373e;box-shadow:0 0 0 3px rgba(67,75,83,.14)}
#section-template-library .json-import-form.is-dragging .json-drop-zone::after{content:"松开鼠标，自动识别并导入 JSON";position:absolute;inset:0;z-index:4;display:grid;place-items:center;padding:24px;border:2px dashed #8f9aa4;border-radius:14px;color:#f1f4f6;background:rgba(37,43,49,.92);font-size:15px;font-weight:700;letter-spacing:.02em;pointer-events:none;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}
@media(max-width:560px){#section-template-library .json-import-form{grid-template-rows:auto minmax(220px,1fr) auto auto}#section-template-library .json-import-form textarea{min-height:220px}}

/* ------------------------------------------------------------------
   配置面板 v2.19.12
   目标：字段标签和控件共用同一条基线；所有控件左边缘对齐；
   文本/长文本压缩到合理高度；不同字段类型保持同一套紧凑密度。
------------------------------------------------------------------ */
#section-template-library .code-panel-heading{padding:12px 14px 11px}
#section-template-library .code-panel-intro{align-items:flex-start;gap:10px;flex-wrap:nowrap}
#section-template-library .code-panel-copy{min-width:0;flex:1 1 auto;overflow:hidden}
#section-template-library .code-panel-copy small{display:block;max-width:100%;margin-top:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;color:#929ba4;font-size:9.5px;line-height:1.4}
#section-template-library .panel-mode-switch{flex:0 0 auto;display:inline-flex;align-items:center;gap:2px;padding:3px;border:1px solid rgba(57,66,75,.13);border-radius:10px;background:rgba(244,246,247,.9);box-shadow:inset 0 1px 0 rgba(255,255,255,.82)}
#section-template-library .panel-mode-switch button{min-height:30px;padding:0 9px;border:0;border-radius:7px;display:inline-flex;align-items:center;justify-content:center;gap:5px;color:#707a84;background:transparent;font-size:10.5px;font-weight:600;white-space:nowrap;cursor:pointer;transition:color .16s ease,background .16s ease,box-shadow .16s ease}
#section-template-library .panel-mode-switch button svg{flex:0 0 auto;color:#8b949e;transition:color .16s ease}
#section-template-library .panel-mode-switch button:hover{color:#353c43;background:rgba(255,255,255,.72)}
#section-template-library .panel-mode-switch button.is-active{color:#fff;background:#343b42;box-shadow:0 2px 6px rgba(33,40,47,.16)}
#section-template-library .panel-mode-switch button.is-active svg{color:#fff}
#section-template-library .code-workspace[hidden]{display:none!important}
#section-template-library .module-config-panel[hidden]{display:none!important}
#section-template-library .module-config-panel{flex:1 1 auto;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;background:#f6f7f9}
#section-template-library .config-panel-summary{flex:0 0 auto;min-height:60px;padding:11px 14px;border-bottom:1px solid #e7eaed;display:flex;align-items:center;justify-content:space-between;gap:10px;background:rgba(255,255,255,.88);-webkit-backdrop-filter:blur(16px) saturate(145%);backdrop-filter:blur(16px) saturate(145%)}
#section-template-library .config-summary-copy{min-width:0;display:flex;align-items:center;gap:9px}
#section-template-library .config-summary-icon{flex:0 0 30px;width:30px;height:30px;border:1px solid rgba(57,66,75,.1);border-radius:9px;display:grid;place-items:center;color:#5f6974;background:#f0f3f5}
#section-template-library .config-summary-text{min-width:0}
#section-template-library .config-summary-text strong{display:block;color:#293139;font-size:12px;font-weight:700;line-height:1.35;white-space:nowrap}
#section-template-library .config-summary-text small{display:block;max-width:170px;margin-top:2px;overflow:hidden;text-overflow:ellipsis;color:#98a1aa;font-size:9.5px;line-height:1.35;white-space:nowrap}
#section-template-library .config-reset-button{flex:0 0 auto;min-height:30px;padding:0 9px;border:1px solid #e1e5e9;border-radius:8px;display:inline-flex;align-items:center;gap:5px;color:#6b7681;background:#fff;font-size:9.5px;font-weight:600;white-space:nowrap;cursor:pointer;transition:color .16s ease,border-color .16s ease,background .16s ease}
#section-template-library .config-reset-button svg{color:#8b949e}
#section-template-library .config-reset-button:hover{color:#293139;border-color:#cbd2d8;background:#fbfcfd}
#section-template-library .config-reset-button:active{background:#f2f4f6}
#section-template-library .config-reset-button:disabled{opacity:.45;cursor:default}
#section-template-library .config-groups{flex:1 1 auto;min-height:0;padding:12px 12px 16px;display:grid;align-content:start;gap:10px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:rgba(71,80,89,.22) transparent}
#section-template-library .config-groups::-webkit-scrollbar{width:6px}
#section-template-library .config-groups::-webkit-scrollbar-thumb{border-radius:4px;background:rgba(71,80,89,.2)}
#section-template-library .config-groups::-webkit-scrollbar-track{background:transparent}
#section-template-library .config-group{min-width:0;border:1px solid #e4e8eb;border-radius:13px;overflow:hidden;background:#fff;box-shadow:0 1px 2px rgba(28,35,42,.025)}
#section-template-library .config-group-heading{min-height:42px;padding:9px 14px;border-bottom:1px solid #eff1f3;display:flex;align-items:center;justify-content:space-between;gap:9px;background:#fff}
#section-template-library .config-group-heading>div{min-width:0;display:flex;align-items:baseline;gap:7px}
#section-template-library .config-group-heading strong{color:#303840;font-size:12px;font-weight:700;line-height:1.4}
#section-template-library .config-group-heading small{color:#a0a8b1;font-size:9px;font-weight:600;letter-spacing:.12em;text-transform:uppercase;white-space:nowrap}
#section-template-library .config-group-count{flex:0 0 auto;padding:2px 6px;border-radius:999px;color:#8b949e;background:#f3f5f7;font-size:9px;font-weight:600;white-space:nowrap}
#section-template-library .config-fields{padding:2px 0}
#section-template-library .config-field{min-width:0;padding:7px 14px;border-bottom:1px solid #f5f6f8;display:grid;grid-template-columns:84px minmax(0,1fr);column-gap:12px;align-items:start}
#section-template-library .config-field:last-child{border-bottom:0}
#section-template-library .config-field-label{justify-self:end;max-width:100%;padding-top:9px;overflow:hidden;text-overflow:ellipsis;color:#59636d;font-size:11.5px;font-weight:600;line-height:16px;text-align:right;white-space:nowrap}
#section-template-library .config-control{min-width:0;display:flex;flex-direction:column;gap:4px}
#section-template-library .config-input,#section-template-library .config-select,#section-template-library .config-textarea{width:100%;min-width:0;border:1px solid #dfe4e8;border-radius:9px;outline:0;color:#222a31;background:#fff;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",Arial,sans-serif;font-size:12px;line-height:1.45;transition:border-color .16s ease,box-shadow .16s ease,background .16s ease}
#section-template-library .config-input,#section-template-library .config-select{height:34px;padding:0 10px}
#section-template-library .config-input::placeholder,#section-template-library .config-textarea::placeholder{color:#a6afb8}
#section-template-library .config-input:hover,#section-template-library .config-select:hover,#section-template-library .config-textarea:hover{border-color:#cbd2d8}
#section-template-library .config-input:focus,#section-template-library .config-select:focus,#section-template-library .config-textarea:focus{border-color:#6f7a84;box-shadow:0 0 0 3px rgba(53,60,67,.08);background:#fff}
#section-template-library .config-input.is-invalid{border-color:#cf6c6c;box-shadow:0 0 0 3px rgba(164,76,76,.08)}
#section-template-library .config-textarea{height:auto;min-height:54px;max-height:132px;padding:7px 10px;resize:none;overflow-y:auto;line-height:1.55}
#section-template-library .config-hint{margin:0;color:#99a1aa;font-size:9.5px;line-height:1.45;word-break:break-word}
#section-template-library .config-hint.is-warn{color:#a47735}
#section-template-library .config-collection-meta{display:flex;align-items:flex-start;justify-content:space-between;gap:7px;min-width:0}
#section-template-library .config-collection-note{flex:1 1 auto;min-width:0}
#section-template-library .config-collection-note[data-tone="error"]{color:#a44c4c}
#section-template-library .config-collection-note[data-tone="ready"]{color:#8a949e}
#section-template-library .config-collection-refresh{flex:0 0 22px;width:22px;height:22px;margin-top:-2px;padding:0;border:1px solid #e3e7ea;border-radius:6px;display:inline-flex;align-items:center;justify-content:center;color:#8b949e;background:#fff;cursor:pointer;transition:color .15s ease,border-color .15s ease,background .15s ease}
#section-template-library .config-collection-refresh:hover{color:#343b42;border-color:#cbd2d8;background:#f8f9fa}
#section-template-library .config-collection-refresh:focus-visible{outline:0;border-color:#727d87;box-shadow:0 0 0 3px rgba(53,60,67,.08)}
#section-template-library .config-collection-refresh svg{width:12px;height:12px}
#section-template-library .config-link-wrap{position:relative;min-width:0}
#section-template-library .config-link-icon{position:absolute;left:10px;top:50%;width:14px;height:14px;transform:translateY(-50%);color:#98a1aa;pointer-events:none}
#section-template-library .config-link-input{padding-left:30px}
#section-template-library .config-media-row{min-width:0;display:flex;align-items:center;gap:8px}
#section-template-library .config-media-thumb{flex:0 0 34px;width:34px;height:34px;border:1px solid #dfe4e8;border-radius:9px;display:grid;place-items:center;overflow:hidden;color:#a0a8b1;background:#f4f6f7}
#section-template-library .config-media-thumb img{display:block;width:100%;height:100%;object-fit:cover}
#section-template-library .config-media-input{flex:1 1 auto;min-width:0}
#section-template-library .config-color-row{min-width:0;display:flex;align-items:center;gap:8px}
#section-template-library .config-color-picker{position:relative;flex:0 0 34px;width:34px;height:34px;border:1px solid #dfe4e8;border-radius:9px;overflow:hidden;background:#fff;cursor:pointer;box-shadow:inset 0 0 0 1px rgba(28,35,42,.035)}
#section-template-library .config-color-picker input[type="color"]{position:absolute;left:-8px;top:-8px;width:50px;height:50px;padding:0;border:0;opacity:0;cursor:pointer}
#section-template-library .config-color-picker span{position:absolute;inset:3px;border-radius:6px;background:var(--config-color,#fff);box-shadow:inset 0 0 0 1px rgba(28,35,42,.07);pointer-events:none}
#section-template-library .config-color-hex{flex:0 0 108px;width:108px;padding:0 8px;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:11px;letter-spacing:.015em;text-transform:lowercase}
#section-template-library .config-switch-control{height:34px;padding:0;border:0;display:inline-flex;align-items:center;gap:9px;color:#69737d;background:transparent;font-size:10.5px;cursor:pointer;align-self:flex-start}
#section-template-library .config-switch-track{position:relative;flex:0 0 36px;width:36px;height:21px;border-radius:999px;background:#d8dde2;box-shadow:inset 0 1px 2px rgba(28,35,42,.11);transition:background .18s ease}
#section-template-library .config-switch-thumb{position:absolute;left:2.5px;top:2.5px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(28,35,42,.22);transition:transform .18s cubic-bezier(.32,.72,0,1)}
#section-template-library .config-switch-control[aria-checked="true"] .config-switch-track{background:#343b42}
#section-template-library .config-switch-control[aria-checked="true"] .config-switch-thumb{transform:translateX(15px)}
#section-template-library .config-switch-control:focus-visible{outline:0}
#section-template-library .config-switch-control:focus-visible .config-switch-track{box-shadow:0 0 0 3px rgba(53,60,67,.12),inset 0 1px 2px rgba(28,35,42,.11)}
#section-template-library .config-switch-state{color:#98a1aa;font-size:9.5px;line-height:1;white-space:nowrap}
#section-template-library .config-switch-control[aria-checked="true"] .config-switch-state{color:#59636d}
#section-template-library .config-product-body{padding:10px 14px;display:flex;flex-direction:column;gap:9px}
#section-template-library .config-product-mode{display:flex;align-items:center;justify-content:space-between;gap:10px}
#section-template-library .config-product-mode-label{color:#59636d;font-size:11.5px;font-weight:600;line-height:1.4}
#section-template-library .config-product-pick{min-width:0;display:flex;align-items:center;gap:7px}
#section-template-library .config-product-pick .config-select-wrap{flex:1 1 auto;min-width:0}
#section-template-library .config-product-pick .config-collection-refresh{margin-top:0}
#section-template-library .config-product-reset{flex:0 0 auto;align-self:flex-start;height:28px;padding:0 8px;border:0;border-radius:7px;color:#6b7681;background:transparent;font-size:10.5px;font-weight:600;white-space:nowrap;cursor:pointer;transition:color .16s ease,background .16s ease}
#section-template-library .config-product-reset:hover{color:#293139;background:#f2f4f6}
#section-template-library .config-product-reset:disabled{opacity:.4;cursor:default;background:transparent}
#section-template-library .config-product-empty{padding:24px 16px;color:#98a1aa;font-size:10.5px;line-height:1.6;text-align:center}
#section-template-library .config-hidden-note{padding:8px 14px;border-bottom:1px solid #f5f6f8}
#section-template-library .config-hidden-note:last-child{border-bottom:0}
#section-template-library .config-number-control{min-width:0;display:flex;align-items:center;gap:9px}
#section-template-library .config-range{flex:1 1 auto;min-width:36px;height:34px;margin:0;padding:0;accent-color:#343b42;background:transparent;cursor:pointer}
#section-template-library .config-number-box{flex:0 0 auto;min-width:76px;height:34px;border:1px solid #dfe4e8;border-radius:9px;display:flex;align-items:center;overflow:hidden;background:#fff;transition:border-color .16s ease,box-shadow .16s ease}
#section-template-library .config-number-box:focus-within{border-color:#6f7a84;box-shadow:0 0 0 3px rgba(53,60,67,.08)}
#section-template-library .config-number-box input{width:100%;min-width:0;height:32px;padding:0 6px 0 8px;border:0;outline:0;color:#222a31;background:transparent;font-size:11.5px;text-align:right;appearance:textfield}
#section-template-library .config-number-box input::-webkit-outer-spin-button,#section-template-library .config-number-box input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
#section-template-library .config-number-unit{padding:0 7px 0 2px;color:#98a1aa;font-size:9px;line-height:1;white-space:nowrap}
#section-template-library .config-number-single{width:120px;max-width:100%;height:34px;border:1px solid #dfe4e8;border-radius:9px;display:flex;align-items:center;overflow:hidden;background:#fff}
#section-template-library .config-number-single input{width:100%;min-width:0;height:32px;padding:0 8px;border:0;outline:0;color:#222a31;background:transparent;font-size:12px;text-align:left;appearance:textfield}
#section-template-library .config-number-single input::-webkit-outer-spin-button,#section-template-library .config-number-single input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
#section-template-library .config-select-wrap{position:relative;min-width:0;width:100%}
#section-template-library .config-select{appearance:none;-webkit-appearance:none;padding-right:28px;cursor:pointer}
#section-template-library .config-select-chevron{position:absolute;right:9px;top:50%;width:13px;height:13px;transform:translateY(-50%);color:#98a1aa;pointer-events:none}
#section-template-library .config-field--complex{display:block;padding:9px 14px 11px}
#section-template-library .config-complex-head{min-height:28px;display:flex;align-items:center;justify-content:space-between;gap:9px;margin-bottom:7px}
#section-template-library .config-complex-label-row{min-width:0;display:flex;align-items:center;gap:6px}
#section-template-library .config-complex-label{color:#59636d;font-size:11.5px;font-weight:600;line-height:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#section-template-library .config-count-pill{flex:0 0 auto;padding:2px 6px;border-radius:999px;color:#8b949e;background:#f2f4f6;font-size:9px;line-height:1.5;white-space:nowrap}
#section-template-library .config-add-button{flex:0 0 auto;height:26px;padding:0 8px;border:1px solid #e1e5e9;border-radius:7px;display:inline-flex;align-items:center;gap:4px;color:#5d6873;background:#fff;font-size:9.5px;font-weight:600;white-space:nowrap;cursor:pointer;transition:color .16s ease,border-color .16s ease,background .16s ease}
#section-template-library .config-add-button:hover{color:#fff;border-color:#343b42;background:#343b42}
#section-template-library .config-add-button:disabled{opacity:.45;cursor:default}
#section-template-library .config-array-list{display:grid;gap:8px}
#section-template-library .config-array-item{min-width:0;border:1px solid #e7eaed;border-radius:10px;overflow:hidden;background:#fbfcfd}
#section-template-library .config-array-item-head{min-height:34px;padding:6px 8px;border-bottom:1px solid #edf0f2;display:flex;align-items:center;gap:7px;background:#f6f8f9}
#section-template-library .config-array-index{flex:0 0 21px;width:21px;height:21px;border-radius:6px;display:grid;place-items:center;color:#fff;background:#394047;font-size:8.5px;font-weight:700;font-variant-numeric:tabular-nums}
#section-template-library .config-array-title{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;color:#3d464e;font-size:10.5px;font-weight:600;white-space:nowrap}
#section-template-library .config-array-actions{flex:0 0 auto;display:flex;align-items:center;gap:1px}
#section-template-library .config-array-action{width:24px;height:24px;padding:0;border:0;border-radius:6px;display:grid;place-items:center;color:#8c959e;background:transparent;cursor:pointer;transition:color .14s ease,background .14s ease}
#section-template-library .config-array-action:hover{color:#343b42;background:#e9edf0}
#section-template-library .config-array-action.is-danger:hover{color:#a44c4c;background:#fbecec}
#section-template-library .config-array-action:disabled{opacity:.3;cursor:default}
#section-template-library .config-array-fields{padding:2px 0}
#section-template-library .config-array-fields .config-field.is-compact{grid-template-columns:62px minmax(0,1fr);column-gap:9px;padding:6px 9px;border-bottom-color:#f1f3f5}
#section-template-library .config-array-fields .config-field.is-compact .config-field-label{padding-top:8px;font-size:10.5px;line-height:15px}
#section-template-library .config-array-fields .config-field.is-compact .config-input,#section-template-library .config-array-fields .config-field.is-compact .config-select{height:31px;border-radius:8px;font-size:11px}
#section-template-library .config-array-fields .config-field.is-compact .config-textarea{min-height:46px;max-height:96px;padding:6px 8px;border-radius:8px;font-size:11px}
#section-template-library .config-array-fields .config-field.is-compact .config-switch-control{height:31px}
#section-template-library .config-array-empty{padding:12px 10px;border:1px dashed #dfe4e8;border-radius:8px;color:#99a1aa;background:#fafbfc;font-size:10px;line-height:1.5;text-align:center}
#section-template-library .config-object-card{border:1px solid #e7eaed;border-radius:10px;overflow:hidden;background:#fbfcfd}
#section-template-library .config-object-card .config-field.is-compact{grid-template-columns:62px minmax(0,1fr);column-gap:9px;padding:6px 9px;border-bottom-color:#f1f3f5}
#section-template-library .config-object-card .config-field.is-compact .config-field-label{padding-top:8px;font-size:10.5px;line-height:15px}
#section-template-library .config-object-card .config-field.is-compact .config-input,#section-template-library .config-object-card .config-field.is-compact .config-select{height:31px;border-radius:8px;font-size:11px}
#section-template-library .config-object-card .config-field.is-compact .config-textarea{min-height:46px;max-height:96px;padding:6px 8px;border-radius:8px;font-size:11px}
#section-template-library .config-empty{flex:1 1 auto;min-height:300px;padding:42px 24px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}
#section-template-library .config-empty[hidden]{display:none!important}
#section-template-library .config-empty-icon{width:46px;height:46px;border:1px solid #e1e5e9;border-radius:13px;display:grid;place-items:center;color:#7e8993;background:#fff;box-shadow:0 4px 12px rgba(28,35,42,.04)}
#section-template-library .config-empty strong{margin-top:14px;color:#3a424a;font-size:13px;font-weight:700;line-height:1.4}
#section-template-library .config-empty p{max-width:260px;margin:6px 0 0;color:#8e98a1;font-size:10.5px;line-height:1.65}
#section-template-library .config-empty-action{margin-top:16px;min-height:32px;padding:0 11px;border:1px solid #e1e5e9;border-radius:8px;color:#5d6873;background:#fff;font-size:10px;font-weight:600;cursor:pointer;transition:color .16s ease,border-color .16s ease,background .16s ease}
#section-template-library .config-empty-action:hover{color:#fff;border-color:#343b42;background:#343b42}
#section-template-library .config-panel-summary.is-compact{padding-top:9px;padding-bottom:9px}
@media(max-width:1350px){
  #section-template-library .config-field{grid-template-columns:78px minmax(0,1fr);column-gap:10px;padding-left:12px;padding-right:12px}
  #section-template-library .config-field-label{font-size:11px}
  #section-template-library .config-summary-text small{max-width:130px}
}
@media(max-width:1180px){
  #section-template-library .module-config-panel{min-height:500px}
  #section-template-library .config-field{grid-template-columns:88px minmax(0,1fr);column-gap:12px;padding-left:14px;padding-right:14px}
  #section-template-library .config-field-label{font-size:11.5px}
}
@media(max-width:560px){
  #section-template-library .code-panel-intro{align-items:stretch;flex-wrap:wrap}
  #section-template-library .panel-mode-switch{align-self:flex-start}
  #section-template-library .config-field{grid-template-columns:72px minmax(0,1fr);column-gap:9px;padding-left:10px;padding-right:10px}
  #section-template-library .config-field-label{font-size:10.5px}
  #section-template-library .config-summary-text small{display:none}
  #section-template-library .config-groups{padding:9px}
}


/* ------------------------------------------------------------------
   配置面板 v2.19.13 · 密度与对齐修正
   1) 标签列与控件列共用同一条 34px 基线
   2) 文本 / 长文本不再撑高，默认两行、最多四行
   3) 所有字段类型统一左边缘、统一圆角、统一行距
------------------------------------------------------------------ */
#section-template-library .config-summary-meta{flex:0 0 auto;padding:2px 8px;border:1px solid #e5e9ec;border-radius:999px;color:#8b949e;background:#f6f8f9;font-size:9px;font-weight:600;white-space:nowrap}

#section-template-library .config-reset-button[hidden],
#section-template-library .config-empty-action[hidden],
#section-template-library .config-empty[hidden],
#section-template-library .module-config-panel[hidden],
#section-template-library .code-workspace[hidden]{display:none!important}

#section-template-library .config-panel-summary{min-height:52px;padding:9px 14px}
#section-template-library .config-summary-icon{flex-basis:28px;width:28px;height:28px;border-radius:8px}
#section-template-library .config-summary-text strong{font-size:11.5px}
#section-template-library .config-summary-text small{margin-top:1px;font-size:9px}
#section-template-library .config-reset-button{min-height:28px;padding:0 8px;font-size:9px}

#section-template-library .config-groups{padding:10px 12px 14px;gap:9px}
#section-template-library .config-group{border-radius:12px}
#section-template-library .config-group-heading{min-height:38px;padding:8px 13px}
#section-template-library .config-group-heading strong{font-size:11.5px}
#section-template-library .config-group-heading small{font-size:8.5px}
#section-template-library .config-fields{padding:2px 0}

#section-template-library .config-field{padding:6px 13px;grid-template-columns:86px minmax(0,1fr);column-gap:12px;align-items:start}
#section-template-library .config-field-label{padding-top:8px;font-size:11px;line-height:16px;color:#5d6771}
#section-template-library .config-control{gap:3px}

#section-template-library .config-input,
#section-template-library .config-select{height:32px;border-radius:8px;padding:0 9px;font-size:11.5px}
#section-template-library .config-textarea{min-height:48px;max-height:104px;padding:6px 9px;border-radius:8px;font-size:11.5px;line-height:1.5}
#section-template-library .config-hint{font-size:9px;line-height:1.4}

#section-template-library .config-link-input{padding-left:28px}
#section-template-library .config-link-icon{left:9px;width:13px;height:13px}

#section-template-library .config-media-row{gap:7px}
#section-template-library .config-media-thumb{flex-basis:32px;width:32px;height:32px;border-radius:8px}

#section-template-library .config-color-row{gap:7px}
#section-template-library .config-color-picker{flex-basis:32px;width:32px;height:32px;border-radius:8px}
#section-template-library .config-color-picker span{inset:3px;border-radius:5px}
#section-template-library .config-color-hex{flex-basis:104px;width:104px;height:32px;font-size:10.5px}

#section-template-library .config-switch-control{height:32px;gap:8px}
#section-template-library .config-switch-track{flex-basis:34px;width:34px;height:20px}
#section-template-library .config-switch-thumb{left:2px;top:2px;width:16px;height:16px}
#section-template-library .config-switch-control[aria-checked="true"] .config-switch-thumb{transform:translateX(14px)}
#section-template-library .config-switch-state{font-size:9px}

#section-template-library .config-number-control{gap:8px}
#section-template-library .config-range{height:32px}
#section-template-library .config-number-box{height:32px;border-radius:8px;min-width:72px}
#section-template-library .config-number-box input{height:30px;font-size:11px}
#section-template-library .config-number-single{height:32px;border-radius:8px}
#section-template-library .config-number-single input{height:30px;font-size:11.5px}

#section-template-library .config-select{padding-right:26px}
#section-template-library .config-select-chevron{right:8px;width:12px;height:12px}

#section-template-library .config-field--complex{padding:8px 13px 10px}
#section-template-library .config-complex-head{min-height:26px;margin-bottom:6px}
#section-template-library .config-complex-label{font-size:11px}
#section-template-library .config-add-button{height:24px;border-radius:6px;font-size:9px}
#section-template-library .config-count-pill{font-size:8.5px}

#section-template-library .config-array-list{gap:7px}
#section-template-library .config-array-item{border-radius:9px}
#section-template-library .config-array-item-head{min-height:31px;padding:5px 8px}
#section-template-library .config-array-index{flex-basis:19px;width:19px;height:19px;border-radius:5px;font-size:8px}
#section-template-library .config-array-title{font-size:10px}
#section-template-library .config-array-action{width:22px;height:22px;border-radius:5px}
#section-template-library .config-array-fields .config-field.is-compact{grid-template-columns:64px minmax(0,1fr);column-gap:9px;padding:6px 9px}
#section-template-library .config-array-fields .config-field.is-compact .config-field-label{padding-top:8px;font-size:10px;line-height:15px}
#section-template-library .config-array-fields .config-field.is-compact .config-input,
#section-template-library .config-array-fields .config-field.is-compact .config-select{height:30px;font-size:10.5px}
#section-template-library .config-array-fields .config-field.is-compact .config-textarea{min-height:44px;max-height:88px;font-size:10.5px}
#section-template-library .config-object-card{border-radius:9px}
#section-template-library .config-object-card .config-field.is-compact{grid-template-columns:64px minmax(0,1fr);column-gap:9px;padding:6px 9px}
#section-template-library .config-object-card .config-field.is-compact .config-field-label{padding-top:8px;font-size:10px;line-height:15px}
#section-template-library .config-object-card .config-field.is-compact .config-input,
#section-template-library .config-object-card .config-field.is-compact .config-select{height:30px;font-size:10.5px}
#section-template-library .config-object-card .config-field.is-compact .config-textarea{min-height:44px;max-height:88px;font-size:10.5px}

#section-template-library .config-empty{min-height:260px;padding:36px 22px}
#section-template-library .config-empty-icon{width:42px;height:42px;border-radius:11px}
#section-template-library .config-empty strong{margin-top:12px;font-size:12.5px}
#section-template-library .config-empty p{max-width:250px;margin-top:5px;font-size:10px}
#section-template-library .config-empty-action{margin-top:13px;min-height:30px;font-size:9.5px}

@media(max-width:1350px){
  #section-template-library .config-field{grid-template-columns:80px minmax(0,1fr);column-gap:10px;padding-left:12px;padding-right:12px}
  #section-template-library .config-field-label{font-size:11px}
  #section-template-library .config-summary-text small{max-width:140px}
}


/* header row correction: title and mode switch share one 64px row */
#section-template-library .code-panel-intro{width:100%;flex:1 1 auto;flex-direction:row;align-items:center;gap:10px}
#section-template-library .code-panel-copy{flex:1 1 auto;min-width:0}

/* color row: hex input fills the remaining control width so rows share one right edge */
#section-template-library .config-color-hex{flex:1 1 auto;width:auto;max-width:none}

/* host manage.css sets input/select/textarea/button min-height:48px.
   Reset it inside the config panel so the intended 32px control rhythm is real. */
#section-template-library .config-input,
#section-template-library .config-select{min-height:32px;height:32px}
#section-template-library .config-textarea{min-height:48px}
#section-template-library .config-number-box input,
#section-template-library .config-number-single input{min-height:0;height:30px}
#section-template-library .config-range{min-height:0;height:32px}
#section-template-library .config-switch-control{min-height:32px;height:32px}
#section-template-library .config-color-picker input[type="color"]{min-height:0}
#section-template-library .config-add-button{min-height:24px}
#section-template-library .config-array-action{min-height:22px}
#section-template-library .config-empty-action{min-height:30px}
#section-template-library .config-array-fields .config-field.is-compact .config-input,
#section-template-library .config-array-fields .config-field.is-compact .config-select{min-height:30px;height:30px}
#section-template-library .config-array-fields .config-field.is-compact .config-textarea{min-height:44px}
#section-template-library .config-array-fields .config-field.is-compact .config-switch-control{min-height:30px;height:30px}
#section-template-library .config-object-card .config-field.is-compact .config-input,
#section-template-library .config-object-card .config-field.is-compact .config-select{min-height:30px;height:30px}
#section-template-library .config-object-card .config-field.is-compact .config-textarea{min-height:44px}
#section-template-library .config-object-card .config-field.is-compact .config-switch-control{min-height:30px;height:30px}

/* let the group grow to its content; config-groups owns the scroll, not the group */
#section-template-library .config-groups{display:flex;flex-direction:column;align-content:normal}
#section-template-library .config-group{flex:0 0 auto;align-self:stretch;height:auto}
#section-template-library .config-groups[hidden]{display:none!important}

/* 预览舞台内部有 overflow:auto，滚动条出现时会挤窄舞台；而舞台宽度又决定预览缩放，
   两者互相追逐会在 1366×768 / 1280×800 等尺寸下产生持续抖动。固定预留滚动条槽位，
   并让节点高度瞬时生效（只保留宽度过渡），切断 ResizeObserver 反馈回路。 */
#section-template-library .preview-stage{scrollbar-gutter:stable}
#section-template-library .preview-viewport{transition:width .2s ease}
