:root{
  --ui-bg:#f4f4f7;
  --ui-panel:rgba(255,255,255,.88);
  --ui-panel-solid:#fff;
  --ui-line:#e7e7ec;
  --ui-line-strong:#d9d9e1;
  --ui-text:#17171c;
  --ui-muted:#7a7a86;
  --ui-soft:#a3a3ad;
  --ui-accent:#7c5cff;
  --ui-accent-2:#ff5f91;
  --ui-accent-soft:#f0ecff;
  --ui-shadow:0 18px 50px rgba(31,31,44,.10);
  --ui-radius:16px;
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;font-family:Inter,"Noto Sans SC","Microsoft YaHei",system-ui,-apple-system,sans-serif;background:var(--ui-bg);color:var(--ui-text)}
button,input,textarea{font:inherit}
button{color:inherit}

.studio-topbar{
  height:64px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:0 18px 0 16px;
  position:sticky;
  top:0;
  z-index:100;
  background:rgba(249,249,251,.88);
  border-bottom:1px solid rgba(218,218,225,.78);
  backdrop-filter:blur(22px) saturate(150%);
  -webkit-backdrop-filter:blur(22px) saturate(150%);
}
.brand-zone{display:flex;align-items:center;gap:11px;min-width:240px}
.brand-mark{width:34px;height:34px;border-radius:10px;background:#18181d;display:grid;place-items:center;position:relative;box-shadow:inset 0 0 0 1px #000}
.brand-mark span{position:absolute;width:13px;height:13px;border-radius:4px;transform:rotate(12deg)}
.brand-mark span:first-child{background:var(--ui-accent);left:7px;top:7px}
.brand-mark span:last-child{background:var(--ui-accent-2);right:6px;bottom:6px;mix-blend-mode:screen}
.brand-copy{display:grid;gap:3px}
.brand{font-size:14px;font-weight:750;letter-spacing:-.02em}
.brand strong{font-weight:900}
.project-meta{display:flex;align-items:center;gap:6px;font-size:10px;color:var(--ui-muted);white-space:nowrap}
.project-meta b{font-size:10px;color:#4f4f59;font-weight:800}
.project-dot{width:6px;height:6px;border-radius:50%;background:#23a36d;box-shadow:0 0 0 3px rgba(35,163,109,.11)}

.top-actions{display:flex;align-items:center;gap:8px}
.studio-version{
  display:inline-flex;
  align-items:center;
  height:28px;
  padding:0 8px;
  border:1px solid #e2e2e8;
  border-radius:999px;
  background:rgba(255,255,255,.72);
  color:#8a8a94;
  font-size:9px;
  font-weight:800;
  letter-spacing:.03em;
  white-space:nowrap;
  user-select:none;
}
.action-group{display:flex;align-items:center;gap:4px;padding:3px;background:#eeeef2;border:1px solid #e2e2e8;border-radius:12px}
.action-group button,.top-actions .primary{
  border:0;
  min-height:34px;
  border-radius:9px;
  cursor:pointer;
  transition:background .16s ease,transform .16s ease,box-shadow .16s ease,color .16s ease;
}
.action-group button{display:inline-flex;align-items:center;gap:7px;padding:0 10px;background:transparent;font-size:11px;font-weight:750;color:#5c5c66}
.action-group button:hover:not(:disabled){background:#fff;color:#1d1d22;box-shadow:0 1px 4px rgba(0,0,0,.06)}
.action-group button:disabled{opacity:.32;cursor:not-allowed}
.action-icon{font-size:14px;line-height:1}
.action-group .icon-button{width:32px;padding:0;justify-content:center;font-size:17px}
.action-separator{width:1px;height:24px;background:#dedee5;margin:0 2px}
.top-actions .primary{
  display:inline-flex;align-items:center;gap:8px;
  padding:0 14px;
  background:#18181d;
  color:white;
  font-size:11px;
  font-weight:850;
  box-shadow:0 5px 14px rgba(18,18,24,.16);
}
.top-actions .primary:hover{transform:translateY(-1px);background:#28282f;box-shadow:0 7px 18px rgba(18,18,24,.2)}
.publish-arrow{opacity:.65;font-size:13px}

.studio-shell{
  display:grid;
  grid-template-columns:220px minmax(0,1fr) 300px;
  min-height:calc(100vh - 64px);
}
.sidebar,.inspector{
  position:sticky;
  top:64px;
  height:calc(100vh - 64px);
  overflow:auto;
  background:rgba(252,252,253,.84);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
}
.sidebar{border-right:1px solid var(--ui-line);padding:14px 12px 18px}
.inspector{border-left:1px solid var(--ui-line);padding:14px}

.sidebar-head{height:34px;display:flex;align-items:center;justify-content:space-between;padding:0 4px 0 6px}
.workspace-label{font-size:11px;font-weight:800;color:#4b4b54}
.sidebar-more{border:0;background:transparent;color:#8d8d96;cursor:pointer;letter-spacing:2px;font-size:11px;padding:7px;border-radius:8px}
.sidebar-more:hover{background:#eeeef2;color:#55555e}

.side-title{
  margin:18px 7px 8px;
  font-size:9px;
  font-weight:850;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:#9a9aa4;
}
.side-title-pages{margin-top:22px}
.template-card{
  width:100%;
  display:grid;
  grid-template-columns:48px 1fr auto;
  align-items:center;
  gap:10px;
  border:1px solid transparent;
  background:transparent;
  border-radius:13px;
  padding:7px;
  text-align:left;
  cursor:pointer;
  transition:.18s ease;
}
.template-card:hover{background:#f1f1f5}
.template-card.active{background:#fff;border-color:#e5e5eb;box-shadow:0 5px 15px rgba(27,27,37,.06)}
.template-thumb{
  width:48px;height:38px;border-radius:9px;
  background:linear-gradient(135deg,#fff3f7,#f2efff);
  border:1px solid #e6dfe7;
  position:relative;overflow:hidden;
}
.template-thumb i{position:absolute;border-radius:999px}
.template-thumb i:nth-child(1){width:28px;height:28px;background:#ff81a7;right:-5px;top:-6px}
.template-thumb i:nth-child(2){width:18px;height:18px;background:#72d8ff;left:4px;bottom:3px}
.template-thumb i:nth-child(3){width:15px;height:4px;background:#24242a;left:8px;top:9px;border-radius:3px}
.template-copy{min-width:0}
.template-copy b{display:block;font-size:11px;font-weight:850;letter-spacing:-.01em}
.template-copy small{display:block;margin-top:3px;font-size:9px;color:#8c8c96;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.template-check{display:grid;place-items:center;width:18px;height:18px;border-radius:50%;background:#18181d;color:white;font-size:9px}

.page-nav{display:grid;gap:2px}
.page-nav button{
  width:100%;
  display:flex;
  align-items:center;
  gap:10px;
  min-height:36px;
  border:0;
  background:transparent;
  border-radius:10px;
  padding:0 9px;
  text-align:left;
  cursor:pointer;
  color:#5e5e68;
  font-size:11px;
  font-weight:720;
  transition:.15s ease;
}
.page-nav button:hover{background:#eeeef3;color:#1c1c22;transform:translateX(1px)}
.nav-icon{display:grid;place-items:center;width:20px;color:#85858f;font-size:13px}
.page-nav button:hover .nav-icon{color:var(--ui-accent)}

.sidebar-tip{
  margin:22px 5px 0;
  padding:11px;
  border:1px solid #e6e6ec;
  border-radius:12px;
  background:linear-gradient(180deg,#fff,#fafafd);
  display:grid;
  grid-template-columns:20px 1fr;
  gap:8px;
  align-items:start;
}
.tip-icon{display:grid;place-items:center;width:18px;height:18px;border-radius:6px;background:#eeeeff;color:#6a54d8;font-size:10px;font-weight:900}
.sidebar-tip p{margin:1px 0 0;font-size:9.5px;line-height:1.55;color:#7a7a84}

.canvas-wrap{
  min-width:0;
  padding:14px 20px 28px;
  position:relative;
  background:
    radial-gradient(circle at 1px 1px,rgba(97,97,113,.12) 1px,transparent 1.2px) 0 0/18px 18px,
    #f4f4f7;
}
.canvas-toolbar{
  max-width:1180px;
  min-height:32px;
  margin:0 auto 10px;
  display:grid;
  grid-template-columns:1fr auto 1fr;
  align-items:center;
  gap:10px;
  color:#85858f;
  font-size:10px;
}
.save-status{display:flex;align-items:center;gap:7px;font-weight:720}
.status-dot{width:7px;height:7px;border-radius:50%;background:#24a66a;box-shadow:0 0 0 3px rgba(36,166,106,.10)}
.canvas-title{display:flex;align-items:center;gap:6px;padding:6px 10px;border:1px solid #e2e2e8;background:rgba(255,255,255,.82);border-radius:999px;box-shadow:0 2px 8px rgba(30,30,40,.04)}
.canvas-title b{font-size:10px;color:#4d4d56}
.canvas-title span:not(.canvas-page-dot){color:#9b9ba4}
.canvas-page-dot{width:6px;height:6px;border-radius:2px;background:var(--ui-accent)}
.canvas-hint{justify-self:end;color:#9999a3}

.canvas-stage{position:relative;max-width:1180px;margin:auto}
.canvas-stage:before{
  content:"";
  position:absolute;
  inset:10px -10px -10px;
  border-radius:22px;
  background:rgba(255,255,255,.42);
  border:1px solid rgba(255,255,255,.72);
  pointer-events:none;
}
.canvas{
  position:relative;
  width:min(1180px,100%);
  height:calc(100vh - 126px);
  min-height:620px;
  margin:auto;
  background:white;
  border:1px solid #dedee5;
  box-shadow:0 18px 46px rgba(34,34,48,.12),0 2px 8px rgba(34,34,48,.05);
  border-radius:18px;
  overflow:hidden;
  transition:width .22s ease,box-shadow .22s ease;
}
.canvas.mobile{
  width:390px;
  box-shadow:0 22px 60px rgba(34,34,48,.18),0 2px 10px rgba(34,34,48,.07);
}
.live-frame{display:block;width:100%;height:100%;border:0;background:#fff}

.inspector-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  min-height:44px;
  padding:2px 2px 12px;
  border-bottom:1px solid #ececf0;
}
.inspector-header>div{display:grid;gap:2px}
.inspector-kicker{font-size:9px;letter-spacing:.13em;color:#a1a1aa;font-weight:850;text-transform:uppercase}
.inspector-header b{font-size:12px}
.inspector-badge{font-size:8px;font-weight:900;letter-spacing:.08em;color:#1c8c5a;background:#eaf8f1;border:1px solid #d7f0e3;padding:4px 6px;border-radius:999px}

.inspector h3{margin:14px 2px 10px;font-size:12px}
.inspector label{display:grid;gap:7px;margin:14px 0;font-size:10px;font-weight:760;color:#676771}
.inspector input,.inspector textarea{
  width:100%;
  border:1px solid #dedee5;
  border-radius:11px;
  padding:10px 11px;
  background:#fff;
  color:#25252b;
  outline:none;
  transition:border .15s ease,box-shadow .15s ease;
}
.inspector input:focus,.inspector textarea:focus{border-color:#a895ff;box-shadow:0 0 0 3px rgba(124,92,255,.10)}
.inspector textarea{min-height:106px;resize:vertical;line-height:1.55}
.inspector .row{display:flex;gap:7px;flex-wrap:wrap}
.inspector button{border:1px solid #dedee5;background:#fff;border-radius:10px;padding:8px 10px;cursor:pointer;font-size:10px;font-weight:750;transition:.15s ease}
.inspector button:hover{border-color:#cfcfd8;background:#f8f8fa}
.inspector button.danger{color:#b42318;border-color:#f0c7c2;background:#fffafa}
.inspector .hint{font-size:9.5px;line-height:1.55;color:#92929c}

.inspector-empty{
  min-height:300px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  color:#84848e;
  padding:28px 20px;
}
.empty-visual{
  width:66px;height:52px;
  position:relative;
  margin-bottom:18px;
  border:1px solid #dfdfe6;
  border-radius:12px;
  background:linear-gradient(145deg,#fff,#f5f5f8);
  box-shadow:0 8px 20px rgba(35,35,48,.06);
}
.empty-visual span{position:absolute;border:1px solid #cfcfd8;background:#fff;border-radius:5px}
.empty-visual span:nth-child(1){width:30px;height:7px;left:10px;top:10px}
.empty-visual span:nth-child(2){width:46px;height:7px;left:10px;top:22px}
.empty-visual span:nth-child(3){width:22px;height:12px;right:9px;bottom:7px;background:#eeeaff;border-color:#d8cffc}
.inspector-empty b{font-size:11px;color:#575761}
.inspector-empty p{max-width:220px;margin:7px 0 0;font-size:9.5px;line-height:1.55;color:#9a9aa4}

.toast{
  position:fixed;
  left:50%;
  bottom:22px;
  transform:translateX(-50%) translateY(16px);
  opacity:0;
  background:rgba(24,24,29,.94);
  color:#fff;
  border:1px solid rgba(255,255,255,.08);
  box-shadow:0 10px 30px rgba(0,0,0,.18);
  backdrop-filter:blur(14px);
  border-radius:999px;
  padding:9px 13px;
  font-size:10px;
  font-weight:720;
  transition:.2s;
  pointer-events:none;
  z-index:300;
}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

@media(max-width:1180px){
  .studio-shell{grid-template-columns:190px minmax(0,1fr)}
  .inspector{position:fixed;right:10px;top:74px;width:286px;height:calc(100vh - 84px);z-index:90;border:1px solid var(--ui-line);border-radius:16px;box-shadow:0 18px 45px rgba(30,30,42,.14)}
  .canvas-wrap{padding-right:314px}
  .project-meta span:last-child{display:none}
}
@media(max-width:820px){
  .studio-shell{grid-template-columns:1fr}
  .sidebar{display:none}
  .canvas-wrap{padding:12px}
  .inspector{display:none}
  .brand-zone{min-width:0}
  .project-meta{display:none}
  .top-actions{gap:4px}
  .action-group button span:last-child{display:none}
  .canvas-toolbar{grid-template-columns:1fr auto}
  .canvas-title{display:none}
}
/* richer inspector */
.inspector{
  display:flex;
  flex-direction:column;
  background:
    linear-gradient(180deg,rgba(255,255,255,.96),rgba(249,249,252,.92));
}
.inspector-header{
  margin:-2px -2px 0;
  padding:4px 4px 13px;
}
.inspector-header b{font-size:13px;letter-spacing:-.015em}
.inspector-context{
  margin-top:12px;
  display:grid;
  grid-template-columns:34px 1fr 28px;
  align-items:center;
  gap:10px;
  padding:10px;
  border:1px solid #e6e6ec;
  border-radius:13px;
  background:#fff;
  box-shadow:0 4px 12px rgba(25,25,36,.04);
}
.context-icon{
  display:grid;
  place-items:center;
  width:34px;height:34px;
  border-radius:10px;
  background:linear-gradient(145deg,#f2efff,#fff0f6);
  color:#6f58e8;
  font-size:15px;
  border:1px solid #e6defd;
}
.context-copy{display:grid;gap:2px;min-width:0}
.context-copy span{font-size:8px;text-transform:uppercase;letter-spacing:.11em;color:#aaaab3;font-weight:850}
.context-copy b{font-size:10.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.context-action{
  width:28px;height:28px;padding:0!important;
  display:grid;place-items:center;
  border-radius:8px!important;
  background:#f6f6f9!important;
  color:#7c7c86;
}
.inspector-empty{
  min-height:0;
  flex:1;
  justify-content:flex-start;
  padding:30px 18px 20px;
}
.empty-visual{
  width:82px;height:66px;
  margin-bottom:20px;
  border-radius:16px;
}
.empty-visual:after{
  content:"";
  position:absolute;
  width:18px;height:18px;
  right:-7px;bottom:-7px;
  border-radius:7px;
  background:#18181d;
  box-shadow:0 4px 10px rgba(20,20,28,.15);
}
.inspector-empty b{font-size:12px}
.inspector-empty p{max-width:230px;font-size:10px;line-height:1.65}
.empty-shortcuts{
  display:flex;
  gap:6px;
  margin-top:15px;
}
.empty-shortcuts span{
  padding:5px 8px;
  border-radius:999px;
  background:#f1f1f5;
  border:1px solid #e7e7ed;
  color:#7d7d87;
  font-size:8px;
  font-weight:800;
}
.inspector-footer{
  margin-top:auto;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:11px 4px 2px;
  border-top:1px solid #ececf1;
  color:#9898a2;
  font-size:9px;
}
.inspector-footer b{
  color:#27865c;
  font-size:9px;
  font-weight:850;
}

/* dynamic inspector field presentation */
.inspector h3{
  margin:14px 0 8px;
  padding:0 2px;
  font-size:11px;
  color:#2c2c33;
}
.inspector label{
  margin:10px 0 14px;
  padding:12px;
  border:1px solid #e7e7ec;
  border-radius:13px;
  background:#fff;
  box-shadow:0 3px 10px rgba(28,28,39,.035);
}
.inspector label:before{
  content:"内容";
  display:block;
  margin-bottom:2px;
  font-size:8px;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:#aaaab3;
  font-weight:850;
}
.inspector textarea,.inspector input{
  margin-top:4px;
  border:1px solid #e2e2e7;
  background:#fafafd;
}
.inspector textarea:focus,.inspector input:focus{
  background:#fff;
}
.inspector .row{
  padding:12px;
  border:1px solid #e7e7ec;
  background:#fff;
  border-radius:13px;
}
.inspector .row:before{
  content:"快捷操作";
  width:100%;
  font-size:8px;
  letter-spacing:.11em;
  text-transform:uppercase;
  color:#aaaab3;
  font-weight:850;
  margin-bottom:3px;
}
.inspector .row button{
  flex:1;
  min-width:88px;
  background:#f7f7fa;
}
.inspector .hint{
  margin:8px 2px 0;
  padding:10px 11px;
  border-radius:10px;
  background:#f5f3ff;
  color:#7165a8;
  border:1px solid #e7e1ff;
}

/* future section-card rhythm */
.inspector-section{
  margin-top:12px;
  border:1px solid #e7e7ec;
  border-radius:14px;
  background:#fff;
  overflow:hidden;
}
.inspector-section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 12px;
  border-bottom:1px solid #efeff3;
  font-size:9px;
  font-weight:850;
  color:#5b5b64;
}
.inspector-section-body{padding:10px 12px}

/* editable collections */
.item-inspector-head{display:flex;align-items:center;justify-content:space-between;padding:12px 2px 13px;border-bottom:1px solid #ececf1}
.item-inspector-head>div:first-child{display:grid;gap:3px}.item-inspector-head span{font-size:9px;color:#9999a3;font-weight:800;letter-spacing:.08em}.item-inspector-head b{font-size:13px}
.item-tools{display:flex;gap:5px}.item-tools button{width:30px;height:30px;padding:0!important}.item-tools button:disabled{opacity:.3;cursor:not-allowed}
.item-fields{display:grid;gap:9px;margin-top:12px}.item-fields label{margin:0;padding:10px 11px;gap:6px}.item-fields label:before{display:none}
.item-fields label>span{font-size:9px;font-weight:800;color:#7b7b85}.item-fields input,.item-fields textarea{margin:0}.item-fields input[type=color]{height:36px;padding:4px}
.item-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:12px;padding-top:12px;border-top:1px solid #ececf1}.item-actions button{width:100%}

/* compact adaptive inspector inputs */
.inspector textarea{min-height:36px;field-sizing:content;overflow:hidden;resize:none}
.item-fields textarea{min-height:36px!important;height:auto;overflow:hidden;resize:none}
.item-fields label{padding:9px 10px}
.item-fields input,.item-fields textarea{padding:8px 9px}
.item-media{margin-top:10px;padding:11px;border:1px solid #e7e7ec;border-radius:13px;background:#fff}
.item-media>span{display:block;margin-bottom:8px;font-size:9px;font-weight:800;color:#7b7b85}
.item-media-row{display:grid;grid-template-columns:72px 1fr;gap:10px;align-items:center}
.item-media-row img,.item-media-empty{width:72px;height:72px;border-radius:10px;border:1px solid #e0e0e7;object-fit:cover;background:#f7f7fa}
.item-media-empty{display:grid;place-items:center;color:#aaaab4;font-size:18px}
.item-media-row>div:last-child{display:grid;gap:6px}
.item-media-row button{width:100%}.item-media-row .ghost{background:#fafafd;color:#777781}

/* optional modules */
.module-switches{display:grid;gap:2px;margin:0 3px 14px}
.module-switches label{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:34px;padding:0 7px;border-radius:9px;font-size:10px;font-weight:720;color:#666670}
.module-switches label:hover{background:#f0f0f4}
.module-switches input{appearance:none;width:28px;height:17px;border-radius:999px;background:#d9d9df;position:relative;cursor:pointer;transition:.16s}
.module-switches input:after{content:"";position:absolute;width:13px;height:13px;left:2px;top:2px;border-radius:50%;background:#fff;box-shadow:0 1px 3px #0003;transition:.16s}
.module-switches input:checked{background:#7c5cff}
.module-switches input:checked:after{translate:11px 0}
.page-nav button.active{background:#ece8ff;color:#5e48ca}
.page-nav button[hidden]{display:none}

/* image cropper */
.image-crop-dialog{width:min(940px,calc(100vw - 32px));max-width:none;padding:0;border:0;border-radius:20px;background:#fff;box-shadow:0 28px 80px rgba(18,18,24,.28)}
.image-crop-dialog::backdrop{background:rgba(16,16,22,.72);backdrop-filter:blur(7px)}
.crop-shell{display:grid;grid-template-rows:auto minmax(360px,68vh) auto;min-height:560px}
.crop-head,.crop-foot{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:14px 16px}
.crop-head{border-bottom:1px solid #ececf1}.crop-foot{border-top:1px solid #ececf1}
.crop-head>div{display:grid;gap:2px}.crop-head b{font-size:13px}.crop-head span,.crop-tools span{font-size:9px;color:#92929c;font-weight:750}
.crop-head button{width:32px;height:32px;border:1px solid #dedee5;background:#fff;border-radius:9px;font-size:17px;cursor:pointer}
.crop-stage{position:relative;min-height:360px;background:#17171c;overflow:hidden}
.crop-stage>img{display:block;max-width:100%;opacity:0;pointer-events:none}
.crop-stage cropper-canvas{width:100%;height:100%}
.crop-stage.loading:after{content:"加载裁剪器…";position:absolute;inset:0;display:grid;place-items:center;color:#fff;font:700 11px system-ui;background:#17171c}
.crop-tools,.crop-actions{display:flex;align-items:center;gap:7px}
.crop-foot button{border:1px solid #dedee5;background:#fff;border-radius:10px;padding:9px 12px;font-size:10px;font-weight:800;cursor:pointer}
.crop-foot button.primary{background:#18181d;color:#fff;border-color:#18181d}
.crop-foot button:disabled{opacity:.45;cursor:wait}
@media(max-width:700px){.image-crop-dialog{width:calc(100vw - 16px)}.crop-shell{grid-template-rows:auto minmax(320px,62vh) auto}.crop-foot{align-items:stretch;flex-direction:column}.crop-tools,.crop-actions{width:100%}.crop-actions button{flex:1}}

.inspector-section-head{display:flex;align-items:flex-end;justify-content:space-between;gap:10px;margin:14px 2px 10px}
.inspector-section-head>div{display:grid;gap:2px}
.inspector-section-head h3{margin:0;font-size:12px}
.inspector-section-head small{font-size:9px;color:#9a9aa4;font-weight:720}
.inspector-section-head>b{font-size:10px;color:#6f5ee7;background:#f0edff;border:1px solid #e1dcff;border-radius:999px;padding:4px 7px}
.segmented-count{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;gap:3px;padding:3px;border:1px solid #dedee5;background:#f1f1f5;border-radius:11px}
.segmented-count button{min-width:0;border:0!important;border-radius:8px!important;padding:8px 4px!important;background:transparent!important;color:#777780;font-size:10px!important;font-weight:850!important;box-shadow:none!important}
.segmented-count button:hover{background:#e8e8ee!important}
.segmented-count button.active{background:#fff!important;color:#26262d;box-shadow:0 1px 4px rgba(28,28,36,.10)!important}
.inspector-note{margin:8px 2px 0;font-size:9px;line-height:1.45;color:#9a9aa4}

/* connected content inspector */
.reference-panel{margin-top:10px;padding:11px;border:1px solid #e7e7ec;border-radius:13px;background:#fff}
.reference-panel>b{display:block;font-size:9px;color:#7b7b85;margin-bottom:8px}
.reference-panel label{margin:0!important;padding:0!important;border:0!important;box-shadow:none!important}
.reference-panel select{width:100%;border:1px solid #dedee5;border-radius:10px;padding:8px;background:#fafafd;color:#2d2d33}
.reference-list{display:grid;gap:5px;margin-top:10px}.reference-list>span{font-size:9px;font-weight:800;color:#7b7b85}
.check-row{display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:7px!important;min-height:28px!important}
.check-row input{width:auto!important;margin:0!important}.linked-summary{display:flex;flex-wrap:wrap;gap:5px}
.linked-summary span{font-size:9px;padding:5px 7px;border-radius:999px;background:#f0edff;color:#6658aa}
.product-editor{margin-top:10px;padding-top:10px;border-top:1px solid #ececf1}
.product-editor-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.product-editor-head>b{font-size:9px;color:#7b7b85}
.product-edit-card{position:relative;display:grid;grid-template-columns:54px 1fr auto;gap:8px;padding:8px;border:1px solid #e7e7ec;border-radius:11px;background:#fff;margin-bottom:7px}
.product-edit-media{display:grid;gap:4px}.product-edit-media img,.product-edit-media>div{width:54px;height:54px;border-radius:8px;object-fit:cover;background:#f5f5f8;display:grid;place-items:center;color:#aaa}
.product-edit-media button{padding:4px!important;font-size:8px!important}.product-edit-fields{display:grid;gap:4px}
.product-edit-fields input{padding:6px 7px!important;margin:0!important;font-size:9px}.product-remove{align-self:start;padding:3px 6px!important}

.content-managers{display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:0 2px}
.content-managers button{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0;border:1px solid #e4e4ea;background:#fff;border-radius:9px;padding:8px 9px;color:#555560;font-size:10px;font-weight:760;cursor:pointer}
.content-managers button:hover{border-color:#cbc7e8;background:#faf9ff}.content-managers button.active{border-color:#8d79ff;background:#f1eeff;color:#5d4dc4}
.content-managers button span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.content-managers button b{display:grid;place-items:center;min-width:20px;height:20px;border-radius:999px;background:#f0f0f4;color:#777780;font-size:9px}.content-managers button.active b{background:#fff;color:#6958d8}
.collection-manager-head{display:flex;align-items:flex-end;justify-content:space-between;margin:8px 0 12px}.collection-manager-head span{font-size:9px;color:#9898a2;font-weight:800}.collection-manager-head h3{margin:2px 0 0;font-size:15px}.collection-manager-head>b{font-size:9px;padding:5px 8px;border-radius:999px;background:#f0edff;color:#6758c2}
.collection-list{display:grid;gap:6px}.content-row{width:100%;display:flex;align-items:center;justify-content:space-between;gap:10px;border:1px solid #e5e5eb;background:#fff;border-radius:11px;padding:10px;text-align:left;cursor:pointer}.content-row:hover{border-color:#cbc5f0;background:#fbfaff}.content-row>span{display:grid;gap:2px;min-width:0}.content-row b{font-size:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.content-row small{font-size:9px;color:#92929b;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.content-row i{font-style:normal;color:#aaa}
.collection-empty{border:1px dashed #d8d8df;border-radius:11px;padding:18px;text-align:center;font-size:9px;color:#999}
.collection-add{width:100%;margin-top:10px;border:1px solid #cfc9f3!important;background:#f4f1ff!important;color:#6555c7!important;border-radius:10px!important;padding:9px!important;font-size:10px!important;font-weight:850!important;cursor:pointer}
.inspector-back{border:0;background:transparent;padding:2px 0 8px;color:#8173d8;font-size:9px;font-weight:850;cursor:pointer}

/* Studio 8.16 — workspace architecture inspired by mature visual editors */
.studio-shell{grid-template-columns:244px minmax(0,1fr) 310px}
.sidebar{padding:12px 10px 18px}
.sidebar-head{height:30px;padding:0 5px 8px;border-bottom:1px solid #ededf1}
.workspace-template{font-size:8px;font-weight:900;letter-spacing:.08em;color:#7666d7;background:#f0edff;border:1px solid #e0dbff;border-radius:999px;padding:4px 7px}
.workspace-tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:3px;margin:11px 2px 12px;padding:3px;border:1px solid #e1e1e7;background:#f0f0f4;border-radius:12px}
.workspace-tabs button{border:0;background:transparent;border-radius:9px;min-height:42px;display:grid;place-items:center;align-content:center;gap:2px;color:#85858f;cursor:pointer}
.workspace-tabs button span{font-size:12px}.workspace-tabs button b{font-size:9px}
.workspace-tabs button:hover{background:#e8e8ed;color:#46464f}.workspace-tabs button.active{background:#fff;color:#25252b;box-shadow:0 1px 5px rgba(30,30,40,.10)}
.workspace-panel[hidden]{display:none!important}.workspace-panel-head{display:flex;align-items:flex-end;justify-content:space-between;padding:3px 7px 9px}
.workspace-panel-head b{font-size:10px}.workspace-panel-head small{font-size:8px;color:#9a9aa4}
.page-nav{gap:3px}.page-nav button{min-height:38px}.page-nav button.active{box-shadow:inset 3px 0 0 #7c5cff}
.content-managers{grid-template-columns:1fr 1fr;gap:5px;padding:0 2px 10px;border-bottom:1px solid #ececf1}
.content-managers button{padding:7px 8px;background:transparent}.content-managers button:hover{background:#f4f3fa}.content-managers button.active{background:#efebff;border-color:#d8d0ff}
.sidebar-content-list{padding:10px 2px 0}.sidebar-content-empty{padding:20px 10px;text-align:center;color:#9a9aa4;font-size:9px;line-height:1.6;border:1px dashed #dddde4;border-radius:11px}
.sidebar-content-head{display:grid;gap:8px;margin-bottom:8px}.sidebar-content-head>div{display:flex;align-items:center;justify-content:space-between;padding:0 4px}.sidebar-content-head b{font-size:10px}.sidebar-content-head span{font-size:8px;color:#9999a3}
.sidebar-content-search{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:6px;border:1px solid #dedee5;border-radius:9px;background:#fff;padding:0 8px}.sidebar-content-search input{min-width:0;border:0;outline:0;padding:8px 0;font-size:9px;background:transparent}
.sidebar-content-rows{display:grid;gap:4px;max-height:calc(100vh - 430px);overflow:auto;padding-right:2px}
.sidebar-content-row{width:100%;display:grid;grid-template-columns:36px minmax(0,1fr) auto;align-items:center;gap:8px;border:1px solid transparent;background:transparent;border-radius:10px;padding:6px;text-align:left;cursor:pointer;color:#4e4e57}
.sidebar-content-row:hover{background:#f2f2f6}.sidebar-content-row.active{background:#fff;border-color:#dcd9f0;box-shadow:0 3px 10px rgba(40,35,80,.06)}
.sidebar-content-row[hidden]{display:none}.sidebar-content-thumb{width:36px;height:36px;border-radius:9px;background:linear-gradient(135deg,#f0edff,#fff3f7);border:1px solid #e5e1ea;display:grid;place-items:center;font-size:9px;font-weight:900;color:#7869c4;overflow:hidden}
.sidebar-content-thumb img{width:100%;height:100%;object-fit:cover}.sidebar-content-copy{display:grid;gap:2px;min-width:0}.sidebar-content-copy b,.sidebar-content-copy small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sidebar-content-copy b{font-size:9.5px}.sidebar-content-copy small{font-size:8px;color:#96969f}.sidebar-content-row>i{font-style:normal;color:#aaa}
.product-manager-entry{grid-template-columns:minmax(0,1fr);padding:10px 12px}
.product-manager-entry .sidebar-content-copy b{overflow:visible;text-overflow:clip;white-space:normal}
.product-manager-name-row{grid-template-columns:minmax(0,1fr);padding:10px 12px}
.product-manager-name-row .sidebar-content-copy b{overflow:visible;text-overflow:clip;white-space:normal;line-height:1.4}
.sidebar-content-add{width:100%;margin-top:7px;border:1px solid #d7d1f8;background:#f5f2ff;border-radius:9px;padding:8px;color:#6555c7;font-size:9px;font-weight:850;cursor:pointer}.sidebar-content-add:hover{background:#eee9ff}
.module-switches{margin-top:0}

.inspector{padding:0 14px 14px}.inspector-header{position:sticky;top:0;z-index:5;margin:0 -14px 0;padding:13px 14px 11px;background:rgba(252,252,253,.94);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}
.inspector-header b{font-size:12px;max-width:210px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.inspector-status{display:inline-flex;align-items:center;gap:5px;font-size:8px;font-weight:800;color:#7d7d86}.inspector-status i{width:6px;height:6px;border-radius:50%;background:#23a36d;box-shadow:0 0 0 3px rgba(35,163,109,.10)}
.inspector-body{padding-top:4px}.inspector-path{font-size:9px;color:#9a9aa4;overflow-wrap:anywhere;background:#f5f5f8;border-radius:8px;padding:8px}
.item-inspector-head{margin-top:8px}

.device-group button.active,.preview-group button.active{background:#fff!important;color:#1d1d22!important;box-shadow:0 1px 4px rgba(0,0,0,.08)!important}

body.previewing .sidebar,body.previewing .inspector,body.previewing .canvas-toolbar{display:none!important}
body.previewing .studio-shell{display:block;min-height:calc(100vh - 64px)}
body.previewing .brand-zone,body.previewing .history-group,body.previewing .action-separator,body.previewing #publishBtn{display:none!important}
body.previewing .studio-topbar{justify-content:center}
body.previewing .top-actions{width:auto}
body.previewing .canvas-wrap{padding:0;min-height:calc(100vh - 64px);display:grid;place-items:center;background:#fff}
body.previewing .canvas-stage{width:100%;max-width:none;height:calc(100vh - 64px)}
body.previewing .canvas:not(.mobile){width:100%;height:100%;min-height:0;border:0;border-radius:0;box-shadow:none}
body.previewing .canvas.mobile{height:calc(100vh - 88px);min-height:560px;margin:12px auto;border-radius:18px}
body.previewing .canvas-stage:before{display:none}
@media(max-width:980px){.studio-shell{grid-template-columns:214px minmax(0,1fr) 280px}.sidebar-content-row{grid-template-columns:30px minmax(0,1fr) auto}.sidebar-content-thumb{width:30px;height:30px}}

/* Studio 8.20 — variable ticker items */
.ribbon-setting-list{display:grid;gap:7px}.ribbon-setting-row{display:grid;grid-template-columns:28px minmax(0,1fr) auto;gap:7px;align-items:center;padding:7px;border:1px solid #e3e3e9;border-radius:10px;background:#fff}.ribbon-setting-index{font-size:8px;font-weight:950;color:#8f8f99;text-align:center}.ribbon-setting-row input{min-width:0;border:1px solid #dedee5;border-radius:8px;padding:7px 8px;font-size:9px;outline:none}.ribbon-setting-row input:focus{border-color:#8876e8;box-shadow:0 0 0 2px #eeeaff}.ribbon-setting-actions{display:flex;gap:3px}.ribbon-setting-actions button{width:25px;height:25px;border:1px solid #dddde4;background:#f8f8fa;border-radius:7px;padding:0;font-size:9px;cursor:pointer}.ribbon-setting-actions button:hover:not(:disabled){background:#eeebff;border-color:#cfc7ff}.ribbon-setting-actions button:disabled{opacity:.28;cursor:default}

/* Studio 8.21 — map image + shortcut labels */
.map-image-actions{display:flex;gap:6px;margin:8px 0}.map-image-actions button{flex:1}
.map-link-settings{margin-top:12px}.map-link-setting-row{display:grid;grid-template-columns:26px minmax(0,1fr) auto;gap:7px;align-items:center;padding:7px 0;border-top:1px solid #ececf1}.map-link-setting-row:first-of-type{border-top:0}.map-link-setting-index{font-size:8px;font-weight:950;color:#999;text-align:center}.map-link-setting-fields{display:grid;grid-template-columns:1fr 1fr;gap:5px;min-width:0}.map-link-setting-fields input,.map-link-setting-fields select{min-width:0;border:1px solid #dddde5;border-radius:8px;padding:7px;font-size:9px;background:#fff}.map-link-setting-actions{display:flex;gap:3px}.map-link-setting-actions button{width:24px;height:24px;padding:0;border:1px solid #dddde5;border-radius:7px;background:#fafafa;font-size:8px}.map-link-setting-actions button:disabled{opacity:.25}


/* Studio 8.26 — fixed image, free crop frame */
.crop-stage cropper-image{pointer-events:none}
.crop-stage cropper-selection{cursor:move}

/* Studio 8.27 — convention-style crop dialog with live result preview */
.image-crop-dialog{width:min(1220px,calc(100vw - 28px));border-radius:18px}
.crop-shell{display:grid;grid-template-rows:auto minmax(430px,72vh) auto;min-height:620px}
.crop-head{padding:18px 24px}.crop-head>div{display:flex;align-items:baseline;gap:12px}.crop-head b{font-size:18px}.crop-head span{font-size:10px}
.crop-workspace{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(280px,.95fr);gap:18px;padding:18px 24px 20px;min-height:0;background:#fff}
.crop-pane{min-width:0;display:grid;grid-template-rows:auto minmax(0,1fr);gap:10px}
.crop-pane-label{font-size:13px;font-weight:800;color:#8b8b95}
.crop-pane-source{padding-right:18px;border-right:1px solid #ececf1}
.crop-stage{min-height:0;height:100%;border-radius:12px;background:#3c3c42}
.crop-pane-preview{align-content:start}
.crop-preview-shell{width:100%;min-height:220px;display:grid;place-items:start center;overflow:auto;border-radius:12px;background:#f6f6f8;padding:0}
.crop-preview-shell canvas{display:block;max-width:100%;width:100%;height:auto;background:#fff;border-radius:12px}
.crop-preview-meta{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:8px;font-size:9px;color:#9a9aa4}.crop-preview-meta b{color:#6f6f79}
.crop-foot{padding:14px 24px 18px}.crop-actions{gap:12px}.crop-actions button{min-width:128px}.crop-actions .primary{background:#59aee8;border-color:#59aee8}.crop-actions .primary:hover{background:#439edb}
.crop-tools button{background:#fafafd}
@media(max-width:820px){
 .image-crop-dialog{width:calc(100vw - 12px)}
 .crop-shell{grid-template-rows:auto auto auto;min-height:0;max-height:94vh;overflow:auto}
 .crop-workspace{grid-template-columns:1fr;padding:14px}
 .crop-pane-source{padding-right:0;border-right:0}
 .crop-stage{min-height:360px;height:54vh}
 .crop-preview-shell{min-height:160px}
 .crop-head{padding:14px 16px}.crop-head b{font-size:15px}
 .crop-foot{padding:12px 14px;position:sticky;bottom:0;background:#fff}
}


/* 8.30 page tree + page content management */
.preset-add{margin:0 0 10px;padding:10px;border:1px solid #e7e7ec;border-radius:11px;background:#fff}
.preset-add>span{display:block;margin-bottom:7px;font-size:8px;font-weight:850;color:#8b8b95}
.preset-add>div{display:flex;flex-wrap:wrap;gap:5px}
.preset-add button{border:1px solid #ddd9f4!important;background:#f7f5ff!important;color:#6657be!important;border-radius:999px!important;padding:6px 8px!important;font-size:8px!important;font-weight:800!important}

.page-workspace{padding-bottom:20px}
.page-tree{display:grid;gap:4px}
.page-tree-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  min-height:40px;
  border-radius:10px;
  transition:background .15s ease;
}
.page-tree-row:hover{background:#f1f1f5}
.page-tree-row.active{background:#ece8ff}
.page-tree-row.is-disabled button{opacity:.46}
.page-tree-row .page-nav button,.page-tree-row>button{min-width:0}
.page-tree-row>button{background:transparent!important;box-shadow:none!important}
.page-tree-row.active>button{color:#5e48ca}
.page-fixed-mark{margin-right:7px;font-size:8px;font-weight:800;color:#a0a0a9}
.page-inline-switch{width:34px;height:22px;display:grid;place-items:center;margin:0 6px 0 4px;cursor:pointer}
.page-inline-switch input{position:absolute;opacity:0;pointer-events:none}
.page-inline-switch i{position:relative;width:29px;height:17px;border-radius:999px;background:#d4d4dc;box-shadow:inset 0 0 0 1px rgba(0,0,0,.04);transition:.16s}
.page-inline-switch i:after{content:"";position:absolute;width:13px;height:13px;left:2px;top:2px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.24);transition:.16s}
.page-inline-switch input:checked+i{background:#7c5cff}
.page-inline-switch input:checked+i:after{translate:12px 0}
.page-inline-switch:focus-within i{box-shadow:0 0 0 3px rgba(124,92,255,.14)}

.page-content-block{margin:14px 1px 0;padding-top:12px;border-top:1px solid #e9e9ee}
.page-content-title{display:flex;align-items:center;justify-content:space-between;padding:0 5px 8px}
.page-content-title b{font-size:9px;color:#666670}
.page-content-nav{display:grid;grid-template-columns:1fr 1fr;gap:5px}
.page-content-nav button{
  display:flex;align-items:center;justify-content:space-between;gap:6px;min-width:0;
  border:1px solid #e3e3e9;background:#fff;border-radius:9px;padding:7px 8px;
  color:#5b5b65;font-size:9px;font-weight:760;cursor:pointer;
}
.page-content-nav button:hover{border-color:#cbc7e8;background:#faf9ff}
.page-content-nav button.active{border-color:#8d79ff;background:#f1eeff;color:#5d4dc4}
.page-content-nav button span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.page-content-nav button b{display:grid;place-items:center;min-width:19px;height:19px;border-radius:999px;background:#f0f0f4;color:#777780;font-size:8px}
.page-content-nav button.active b{background:#fff;color:#6958d8}
.page-content-block .sidebar-content-list{padding-top:9px}
.page-content-block .sidebar-content-rows{max-height:calc(100vh - 460px)}

.guide-media-add{margin-top:10px}
.guide-media-add button{width:100%;border-style:dashed!important;color:#777784!important;background:#fafafd!important}


/* 8.32.1 bugfix — keep sidebar width stable */
.sidebar{
  overflow-y:auto;
  overflow-x:hidden;
  scrollbar-gutter:stable;
  min-width:0;
}
.page-content-block,
.page-content-nav,
.sidebar-content-list,
.sidebar-content-head,
.sidebar-content-rows,
.sidebar-content-row{
  min-width:0;
  max-width:100%;
}


/* custom first-level pages */
#createCustomPageBtn.create-custom-page{
  margin-top:6px;
  min-height:34px;
  border:1px dashed #d8d6e2;
  background:#faf9fd;
  color:#6f6878;
}
#createCustomPageBtn.create-custom-page:hover{border-color:#8e73ff;background:#f4f0ff;color:#5e43c5}
#createCustomPageBtn.create-custom-page span:first-child{font-size:15px;line-height:1}
#customPageRows{display:grid;gap:2px}
.custom-page-preset-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:116px;gap:8px}
.custom-page-preset{
  width:100%;height:116px;min-height:116px;box-sizing:border-box;
  border:1px solid #e4e1e9;background:#fff;border-radius:12px;padding:12px;text-align:left;cursor:pointer;
  display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;overflow:hidden;
}
.custom-page-preset:hover{border-color:#8c72ff;background:#faf8ff}
.custom-page-preset b{display:block;width:100%;font-size:11px;line-height:1.35;margin-bottom:5px}
.custom-page-preset small{display:-webkit-box;width:100%;font-size:9px;line-height:1.45;color:#83808a;-webkit-box-orient:vertical;-webkit-line-clamp:4;overflow:hidden}
.custom-page-row .custom-page-type{font-size:8px;color:#9a96a2;margin-left:auto}
.page-nav .custom-page-row-delete{
  width:28px!important;min-width:28px!important;min-height:28px!important;height:28px!important;
  margin-right:6px!important;padding:0!important;display:grid!important;place-items:center!important;
  border-radius:8px!important;color:#aaa6b0!important;font-size:15px!important;font-weight:700!important;
  opacity:.38;transform:none!important
}
.custom-page-row:hover .custom-page-row-delete{opacity:1}
.page-nav .custom-page-row-delete:hover{background:#fff0f0!important;color:#c43d3d!important}
.custom-page-settings-actions{display:flex;gap:7px;margin-top:12px}
.custom-page-settings-actions button{flex:1}


/* Studio 8.33.39 — crop preview height follows the actual preview image */
.crop-pane-preview{
  align-content:start;
  grid-template-rows:auto auto auto;
}
.crop-preview-shell{
  min-height:0;
  height:auto;
  overflow:hidden;
  align-self:start;
  background:transparent;
}
.crop-preview-shell canvas{
  width:100%;
  height:auto;
  max-height:none;
  object-fit:contain;
}
@media(max-width:820px){
  .crop-preview-shell{min-height:0}
}

/* Studio 8.33.51 — direct product editing */
.product-edit-card.active{
  border-color:#7b61ff;
  box-shadow:0 0 0 2px rgba(123,97,255,.14);
}

/* Studio 8.33.52 — simplified direct product editor */
.product-direct-head{display:grid;gap:3px;margin-bottom:12px}
.product-direct-head span{font-size:9px;color:#8a8490}
.product-direct-head b{font-size:18px}
.product-direct-media{margin-top:0}
.product-direct-fields{margin-top:12px}
.product-direct-fields label{margin-bottom:8px}
.product-direct-fields input,.product-direct-fields textarea{width:100%}
