/* ==========================================================================
   CASEME —— 定制页样式
   左：步骤面板 / 右：实时预览（手机端上下排列，预览吸顶）
   ========================================================================== */

.cz-page{ padding-block:var(--sp-5) var(--sp-9); }
.cz-layout{ display:grid; grid-template-columns:minmax(0,1fr) minmax(370px,470px); gap:clamp(24px,3.4vw,52px); align-items:start; }
.cz-panel{ min-width:0; }

/* ------------------------------------------------------------ 步骤指示 */
.cz-top{ display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:18px; }
.cz-count{ font-size:.82rem; color:var(--ink-2); letter-spacing:.04em; }
.cz-count b{ font-family:var(--font-display); font-size:1.1rem; color:var(--ink); }
.cz-progress{ height:4px; border-radius:2px; background:var(--paper-3); overflow:hidden; margin-bottom:22px; }
.cz-progress i{ display:block; height:100%; background:var(--ink); border-radius:2px; transition:width .45s var(--ease); }
.cz-steps{ display:flex; gap:6px; margin-bottom:26px; flex-wrap:wrap; }
.cz-steps button{
  display:flex; align-items:center; gap:7px; padding:7px 13px 7px 8px; border-radius:var(--r-pill);
  font-size:.8rem; color:var(--ink-3); border:1px solid transparent; transition:all var(--dur) var(--ease);
}
.cz-steps button i{
  width:22px; height:22px; border-radius:50%; display:grid; place-items:center; font-style:normal;
  font-size:.72rem; background:var(--paper-3); color:var(--ink-2); flex:none; transition:all var(--dur) var(--ease);
}
.cz-steps button:hover:not(:disabled){ background:var(--white); color:var(--ink); }
.cz-steps button[aria-current="step"]{ background:var(--ink); color:var(--paper); }
.cz-steps button[aria-current="step"] i{ background:var(--rose); color:#fff; }
.cz-steps button.is-done i{ background:var(--sage); color:#fff; }
.cz-steps button:disabled{ opacity:.45; cursor:not-allowed; }
@media (max-width:1040px){ .cz-steps{ display:none; } }

/* ---------------------------------------------------------------- 步骤 */
.cz-step{ display:none; animation:fade-up .45s var(--ease) both; }
.cz-step.is-on{ display:block; }
.cz-step__title{ font-size:clamp(1.3rem,2.4vw,1.7rem); }
.cz-step__hint{ color:var(--ink-2); font-size:.92rem; margin-top:10px; max-width:52ch; }
.cz-block{ margin-top:26px; }
.cz-block__label{ font-size:.84rem; font-weight:600; margin-bottom:12px; display:flex; align-items:center; gap:8px; }
.cz-block__label span{ font-weight:400; color:var(--ink-3); font-size:.78rem; }

/* 品牌与型号 */
.cz-brands{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:20px; }
.cz-models{ display:grid; grid-template-columns:repeat(auto-fill,minmax(158px,1fr)); gap:10px; }
.cz-model{
  display:flex; flex-direction:column; gap:3px; align-items:flex-start; padding:13px 15px; text-align:left;
  border:1px solid var(--line); border-radius:var(--r-md); background:var(--white); transition:all var(--dur) var(--ease);
}
.cz-model:hover{ border-color:var(--ink); transform:translateY(-2px); box-shadow:var(--shadow-sm); }
.cz-model.is-on{ border-color:var(--ink); background:var(--ink); color:var(--paper); box-shadow:var(--shadow-sm); }
.cz-model small{ font-size:.72rem; opacity:.65; }
.cz-noresult{ padding:26px; text-align:center; color:var(--ink-3); font-size:.9rem; border:1px dashed var(--line); border-radius:var(--r-md); }

/* 工艺 */
.cz-finishes{ display:grid; grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); gap:12px; }
.cz-finish{ padding:16px; border:1px solid var(--line); border-radius:var(--r-md); background:var(--white); text-align:left; transition:all var(--dur) var(--ease); }
.cz-finish:hover{ transform:translateY(-3px); box-shadow:var(--shadow-sm); border-color:rgba(43,38,34,.28); }
.cz-finish.is-on{ border-color:var(--ink); box-shadow:0 0 0 1px var(--ink) inset; }
.cz-finish__top{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
.cz-finish__name{ font-weight:600; }
.cz-finish__price{ font-size:.82rem; color:var(--cocoa); font-weight:600; }
.cz-finish p{ font-size:.78rem; color:var(--ink-3); margin-top:6px; line-height:1.6; }
.cz-finish__swatch{ height:56px; border-radius:10px; margin-bottom:12px; position:relative; overflow:hidden; }

/* 颜色 */
.cz-colors{ display:flex; gap:16px; flex-wrap:wrap; }
.cz-colors--sm{ gap:10px 12px; }
.cz-colors--sm .swatch{ width:34px; height:34px; }
.cz-colors--sm .cz-color span{ font-size:.68rem; }
.cz-color{ display:flex; flex-direction:column; align-items:center; gap:8px; }
.cz-color span{ font-size:.74rem; color:var(--ink-2); }
.cz-color.is-on span{ color:var(--ink); font-weight:600; }

/* 配件 */
.cz-accs{ display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:12px; }
.cz-acc{ display:flex; gap:12px; align-items:center; padding:12px; border:1px solid var(--line); border-radius:var(--r-md); background:var(--white); text-align:left; transition:all var(--dur) var(--ease); }
.cz-acc:hover{ border-color:rgba(43,38,34,.3); transform:translateY(-2px); }
.cz-acc.is-on{ border-color:var(--ink); box-shadow:0 0 0 1px var(--ink) inset; }
.cz-acc__art{ width:52px; height:52px; flex:none; border-radius:10px; background:var(--paper-2); display:grid; place-items:center; }
.cz-acc__art svg{ width:38px; height:38px; }
.cz-acc b{ font-size:.9rem; font-weight:600; display:block; }
.cz-acc p{ font-size:.74rem; color:var(--ink-3); line-height:1.5; }
.cz-acc__price{ font-size:.78rem; color:var(--cocoa); font-weight:600; margin-top:3px; display:block; }

/* --------------------------------------------------------- 图案方式 */
.cz-tabs{ display:inline-flex; padding:4px; background:var(--paper-2); border-radius:var(--r-pill); gap:4px; margin-bottom:22px; }
.cz-tabs button{ padding:9px 22px; border-radius:var(--r-pill); font-size:.88rem; font-weight:600; color:var(--ink-2); transition:all var(--dur) var(--ease); }
.cz-tabs button[aria-selected="true"]{ background:var(--white); color:var(--ink); box-shadow:var(--shadow-xs); }
.cz-ai__tags{ display:flex; gap:8px; flex-wrap:wrap; margin:14px 0 18px; }
.cz-ai__actions{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-top:16px; }
.cz-ai__note{ font-size:.78rem; color:var(--ink-3); }

.cz-cands{ display:grid; grid-template-columns:repeat(2,1fr); gap:14px; margin-top:22px; }
.cz-cand{ border:1px solid var(--line); border-radius:var(--r-md); overflow:hidden; background:var(--white); position:relative; transition:all var(--dur) var(--ease); }
.cz-cand:hover{ transform:translateY(-3px); box-shadow:var(--shadow-md); }
.cz-cand.is-on{ border-color:var(--ink); box-shadow:0 0 0 2px var(--ink) inset; }
.cz-cand__art{ background:var(--paper-2); }
.cz-cand__art svg{ width:100%; height:auto; display:block; }
.cz-cand__bar{ display:flex; align-items:center; justify-content:space-between; gap:8px; padding:10px 12px; border-top:1px solid var(--line-soft); }
.cz-cand__name{ font-size:.78rem; color:var(--ink-2); }
.cz-cand__acts{ display:flex; gap:4px; }
.cz-cand--skeleton{ aspect-ratio:5/8; }

.cz-lib__cats{ display:flex; gap:8px; flex-wrap:wrap; margin:16px 0; }
.cz-lib__grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(116px,1fr)); gap:12px; }
.cz-pat{ border-radius:var(--r-md); overflow:hidden; border:2px solid transparent; background:var(--white); box-shadow:var(--shadow-xs); transition:all var(--dur) var(--ease); }
.cz-pat:hover{ transform:translateY(-3px); box-shadow:var(--shadow-md); }
.cz-pat.is-on{ border-color:var(--ink); }
.cz-pat__art{ aspect-ratio:5/7; }
.cz-pat__art svg{ width:100%; height:100%; }
.cz-pat__name{ font-size:.72rem; padding:7px 9px; color:var(--ink-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* ----------------------------------------------------------- 编辑器 */
.cz-editor{ display:grid; grid-template-columns:1fr; gap:18px; margin-top:24px; }
.cz-tools{ display:flex; gap:8px; flex-wrap:wrap; }
.cz-tool{
  display:inline-flex; align-items:center; gap:7px; height:38px; padding:0 14px; border-radius:var(--r-pill);
  border:1px solid var(--line); background:var(--white); font-size:.82rem; color:var(--ink-2); transition:all var(--dur) var(--ease);
}
.cz-tool:hover:not(:disabled){ border-color:var(--ink); color:var(--ink); transform:translateY(-1px); }
.cz-tool[aria-pressed="true"]{ background:var(--ink); border-color:var(--ink); color:var(--paper); }
.cz-tool:disabled{ opacity:.4; cursor:not-allowed; }
.cz-tool svg{ width:16px; height:16px; }
.cz-sliders{ display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:16px 24px; }
.cz-slider{ display:flex; flex-direction:column; gap:6px; }
.cz-slider__top{ display:flex; justify-content:space-between; font-size:.8rem; color:var(--ink-2); }
.cz-slider__top b{ font-weight:600; color:var(--ink); font-variant-numeric:tabular-nums; }
input[type=range].cz-range{ -webkit-appearance:none; appearance:none; width:100%; height:22px; background:transparent; cursor:pointer; }
input[type=range].cz-range::-webkit-slider-runnable-track{ height:4px; border-radius:2px; background:var(--paper-3); }
input[type=range].cz-range::-webkit-slider-thumb{
  -webkit-appearance:none; width:18px; height:18px; margin-top:-7px; border-radius:50%;
  background:var(--ink); border:3px solid var(--paper); box-shadow:var(--shadow-xs);
}
input[type=range].cz-range::-moz-range-track{ height:4px; border-radius:2px; background:var(--paper-3); }
input[type=range].cz-range::-moz-range-thumb{ width:14px; height:14px; border-radius:50%; background:var(--ink); border:3px solid var(--paper); }
.cz-layers{ display:flex; flex-direction:column; gap:8px; }
.cz-layer{
  display:flex; align-items:center; gap:10px; padding:9px 12px; border-radius:var(--r-sm);
  border:1px solid var(--line); background:var(--white); font-size:.82rem; text-align:left; transition:all var(--dur) var(--ease);
}
.cz-layer:hover{ border-color:rgba(43,38,34,.3); }
.cz-layer.is-on{ border-color:var(--ink); box-shadow:0 0 0 1px var(--ink) inset; }
.cz-layer__tag{ font-size:.68rem; padding:2px 7px; border-radius:var(--r-pill); background:var(--paper-2); color:var(--ink-2); }
.cz-textpanel{ display:grid; grid-template-columns:1fr 1fr; gap:14px; padding:16px; border:1px solid var(--line); border-radius:var(--r-md); background:var(--white); }
.cz-textpanel .full{ grid-column:1/-1; }
@media (max-width:560px){ .cz-textpanel{ grid-template-columns:1fr; } }

/* ------------------------------------------------------------- 预览区 */
.cz-stage{ position:sticky; top:calc(var(--nav-h) + 22px); }
.cz-stage__card{
  background:linear-gradient(170deg,var(--paper-2) 0%,var(--paper-3) 100%);
  border-radius:var(--r-xl); padding:22px 22px 18px; box-shadow:var(--shadow-sm); position:relative; overflow:hidden;
}
.cz-views{ display:flex; gap:6px; flex-wrap:wrap; margin-bottom:16px; position:relative; z-index:2; }
.cz-views .chip{ height:32px; font-size:.78rem; padding:0 13px; }
.cz-stage__art{ position:relative; display:grid; place-items:center; min-height:320px; perspective:1400px; }
.cz-stage__art .holder{ width:100%; max-width:330px; transition:transform .5s var(--ease), filter .5s var(--ease); transform-style:preserve-3d; }
.cz-stage__art svg{ width:100%; height:auto; display:block; }
.cz-stage__art.is-3d .holder{ transform:rotateY(-17deg) rotateX(4deg) scale(.94); filter:drop-shadow(24px 30px 26px rgba(43,38,34,.28)); }
.cz-stage__art.is-zoom .holder{ transform:scale(1.42); cursor:grab; }
.cz-stage__art.is-zoom.is-panning .holder{ cursor:grabbing; transition:none; }
.cz-stage__art.is-scene{ padding:22px 0; }
.cz-stage__art.is-scene::before{
  content:""; position:absolute; inset:6% 2% 12%; border-radius:var(--r-lg);
  background:radial-gradient(120% 80% at 50% 8%,rgba(255,253,250,.9),rgba(229,213,190,.5) 60%,rgba(107,79,63,.22));
  box-shadow:inset 0 -30px 60px -30px rgba(43,38,34,.35);
}
.cz-light--warm .holder{ filter:sepia(.16) saturate(1.08) brightness(1.03); }
.cz-light--cool .holder{ filter:saturate(.92) hue-rotate(-8deg) brightness(1.02); }
.cz-light--studio .holder{ filter:contrast(1.06) saturate(1.02); }
.cz-scene-props{ position:absolute; inset:auto 0 4% 0; display:flex; justify-content:center; gap:20px; opacity:.9; z-index:0; }
.cz-scene-props svg{ width:64px; height:auto; }

.cz-stage__meta{ margin-top:16px; padding-top:16px; border-top:1px solid rgba(43,38,34,.1); position:relative; z-index:2; }
.cz-stage__row{ display:flex; justify-content:space-between; gap:12px; font-size:.82rem; color:var(--ink-2); }
.cz-stage__row b{ color:var(--ink); font-weight:600; }
.cz-stage__price{ display:flex; align-items:baseline; justify-content:space-between; margin-top:14px; }
.cz-stage__price b{ font-family:var(--font-display); font-size:1.7rem; }
.cz-stage__badge{ position:absolute; top:18px; right:18px; z-index:3; }

/* 拖动提示 */
.cz-drag-hint{
  position:absolute; left:50%; bottom:8px; transform:translateX(-50%);
  font-size:.72rem; color:var(--ink-2); background:rgba(255,253,250,.92); padding:5px 12px;
  border-radius:var(--r-pill); box-shadow:var(--shadow-xs); white-space:nowrap; pointer-events:none;
}

/* ------------------------------------------------------------- 底部栏 */
.cz-foot{
  position:sticky; bottom:0; z-index:20; margin-top:34px; padding:14px 0 16px;
  background:linear-gradient(to top,var(--paper) 62%,rgba(251,247,241,0)); display:flex; gap:12px; align-items:center;
}
.cz-foot .btn{ flex:none; }
.cz-foot__info{ margin-left:auto; font-size:.82rem; color:var(--ink-2); text-align:right; }
.cz-foot__info b{ font-family:var(--font-display); font-size:1.15rem; color:var(--ink); }

/* ------------------------------------------------------------- 确认页 */
.cz-summary{ display:grid; gap:12px; }
.cz-summary__row{ display:flex; justify-content:space-between; gap:16px; font-size:.9rem; padding-bottom:12px; border-bottom:1px dashed var(--line); }
.cz-summary__row span:first-child{ color:var(--ink-2); flex:none; }
.cz-summary__row span:last-child{ text-align:right; font-weight:600; }
.cz-summary__art{ display:flex; gap:18px; align-items:center; padding:18px; border-radius:var(--r-md); background:var(--paper-2); }
.cz-summary__art .mini{ width:92px; flex:none; }
.cz-summary__art .mini svg{ width:100%; height:auto; }
.cz-actions{ display:flex; gap:12px; flex-wrap:wrap; margin-top:24px; }

/* 小屏：预览吸顶在上方，横向通栏（用 100vw 明确宽度，否则内容会把吸顶栏撑宽） */
@media (max-width:1040px){
  .cz-layout{ display:flex; flex-direction:column; gap:18px; }
  .cz-stage{
    order:-1; position:sticky; top:var(--nav-h); z-index:30;
    width:100vw; margin-left:calc(50% - 50vw); margin-right:0;
    padding:10px var(--gutter) 12px; background:var(--paper);
    border-bottom:1px solid var(--line); box-shadow:0 10px 24px -22px rgba(43,38,34,.7);
  }
  .cz-stage__card{ background:none; box-shadow:none; padding:0; border-radius:0; min-width:0; }
  .cz-views{ margin-bottom:8px; overflow-x:auto; flex-wrap:nowrap; padding-bottom:2px; min-width:0; }
  .cz-views .chip{ flex:none; }
  .cz-stage__art{ min-height:0; }
  .cz-stage__art .holder{ max-width:190px; }
  .cz-stage__art.is-zoom .holder{ transform:scale(1.2); }
  .cz-stage__meta{ margin-top:8px; padding-top:10px; display:flex; align-items:center; gap:14px; flex-wrap:wrap; }
  .cz-stage__rows{ flex:1; min-width:0; }
  .cz-stage__price{ margin-top:0; }
  .cz-stage__price b{ font-size:1.3rem; }
  .cz-drag-hint{ display:none; }
  .cz-foot{ margin-top:24px; }
}
@media (max-width:560px){
  .cz-models{ grid-template-columns:repeat(auto-fill,minmax(132px,1fr)); }
  .cz-cands{ grid-template-columns:1fr 1fr; }
  .cz-foot{ flex-wrap:wrap; }
  .cz-foot__info{ width:100%; text-align:left; order:-1; }
}
