.studio-body {
  height: 100vh;
  overflow: hidden;
  background: var(--paper-2);
}

.studio-topbar {
  height: 68px;
  display: grid;
  grid-template-columns: minmax(260px, auto) 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 0 18px 0 20px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 70;
}
.studio-brand { display: flex; align-items: center; gap: 20px; min-width: 0; }
.studio-brand .logo-img { height: 28px; }
.studio-title-wrap { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-left: 20px; border-left: 1px solid var(--line); }
.studio-title-wrap input {
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 650;
  width: 150px;
  padding: 2px 4px;
  margin-left: -4px;
  border-radius: 5px;
  outline: none;
}
.studio-title-wrap input:hover { background: var(--paper); }
.studio-title-wrap input:focus { background: var(--paper); box-shadow: 0 0 0 1.5px var(--accent); }
.studio-title-wrap span { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 230px; }

.studio-steps { display: flex; align-items: center; justify-content: center; gap: 10px; }
.studio-steps .step {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--muted);
  transition: background 0.2s, color 0.2s;
}
.studio-steps .step i {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  display: grid;
  place-items: center;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 9px;
}
.studio-steps .step:hover { background: var(--paper); color: var(--ink); }
.studio-steps .step.done i { background: var(--lime); border-color: var(--lime); color: var(--ink); }
.studio-steps .step.active { background: var(--ink); color: var(--paper-2); }
.studio-steps .step.active i { background: var(--accent); border-color: var(--accent); color: var(--accent-on); }
.studio-steps .sep { width: 18px; height: 1px; background: var(--line); }

.studio-actions { display: flex; align-items: center; gap: 8px; justify-self: end; }
.studio-actions .orders-link {
  font-size: 11.5px; font-weight: 600; color: var(--muted); text-decoration: none;
  border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 11px; background: var(--paper);
}
.studio-actions .orders-link:hover { color: var(--ink); border-color: var(--line); }
.save-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--muted);
  margin-right: 4px;
  white-space: nowrap;
}
.save-state i { width: 6px; height: 6px; border-radius: 50%; background: #7aab66; }
.save-state.saving i { background: var(--accent); animation: pulse 1s infinite; }
.undo-group { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.undo-group button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  transition: background 0.2s;
}
.undo-group button + button { border-left: 1px solid var(--line); }
.undo-group button:hover { background: var(--paper); }
.undo-group button:disabled { opacity: 0.3; pointer-events: none; }
.undo-group .icon { width: 15px; height: 15px; }

.design-view {
  position: relative;
  display: grid;
  grid-template-columns: 76px 284px minmax(0, 1fr) 290px;
  height: calc(100vh - 68px);
  overflow: hidden;
}
.design-view[hidden], .settings-view[hidden], .summary-view[hidden] { display: none; }

.tool-rail {
  background: var(--white);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 12px 8px;
  gap: 2px;
  overflow-y: auto;
}
.tool-rail button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 11px 2px 9px;
  border-radius: 10px;
  font-size: 9.5px;
  color: var(--muted);
  transition: background 0.2s, color 0.2s;
}
.tool-rail button .icon { width: 19px; height: 19px; }
.tool-rail button:hover { background: var(--paper); color: var(--ink); }
.tool-rail button.active { background: var(--ink); color: var(--paper-2); }
.tool-rail button.active::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.tool-rail .rail-sep { height: 1px; background: var(--line); margin: 7px 4px; }

.tool-panel {
  background: var(--white);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.tool-panel-head {
  position: relative;
  padding: 20px 20px 15px;
  border-bottom: 1px solid var(--line);
}
.tool-panel-close { display: none; position: absolute; top: 14px; right: 14px; width: 26px; height: 26px; border-radius: 50%; color: var(--muted); font-size: 13px; }
.tool-panel-close:hover { background: var(--paper); color: var(--ink); }
.tool-panel-head .kicker {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--accent);
  text-transform: uppercase;
}
.tool-panel-head h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; margin-top: 5px; }
.tool-panel-head p { margin-top: 5px; font-size: 11px; color: var(--muted); line-height: 1.55; }
.tool-body { flex: 1; overflow-y: auto; padding: 16px 20px 30px; }

.tool-section { margin-bottom: 22px; }
.tool-section:last-child { margin-bottom: 0; }
.tool-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.tool-section-title span { font-family: var(--font); letter-spacing: 0; text-transform: none; font-size: 10px; color: var(--muted-2); }

.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #f1ede4;
}
.workspace-tools {
  height: auto;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 8px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.72);
  gap: 16px;
  row-gap: 8px;
}
.side-switch {
  display: flex;
  padding: 3px;
  background: var(--paper-3);
  border-radius: 999px;
  gap: 2px;
  flex: none;
}
.side-switch button {
  height: 28px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.side-switch button.on { background: var(--white); color: var(--ink); box-shadow: 0 2px 8px rgba(30, 22, 10, 0.08); }
.view-actions { display: flex; align-items: center; gap: 16px; row-gap: 8px; flex-wrap: wrap; justify-content: flex-end; flex: none; margin-left: auto; }
.switch { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); cursor: pointer; user-select: none; white-space: nowrap; flex: none; }
.switch input { display: none; }
.switch span {
  width: 28px;
  height: 16px;
  border-radius: 99px;
  background: var(--line-2);
  position: relative;
  transition: background 0.2s;
}
.switch span::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  transition: transform 0.2s var(--ease);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.switch input:checked + span { background: var(--ink); }
.switch input:checked + span::after { transform: translateX(12px); }
.zoom-control {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  overflow: hidden;
  height: 30px;
  flex: none;
}
.zoom-control button {
  width: 28px;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 14px;
  color: var(--muted);
  transition: background 0.2s;
}
.zoom-control button:hover { background: var(--paper); color: var(--ink); }
.zoom-control span { font-family: var(--font-mono); font-size: 9.5px; padding: 0 8px; color: var(--ink-2); min-width: 42px; text-align: center; border-left: 1px solid var(--line); border-right: 1px solid var(--line); height: 100%; display: grid; place-items: center; }
.zoom-control button.zoom-fit { width: auto; min-width: 40px; padding: 0 9px; font-size: 10.5px; letter-spacing: 0.02em; }
.zoom-control button.zoom-fit + button { border-left: 1px solid var(--line); }

.canvas-shell {
  flex: 1;
  min-height: 0;
  overflow: auto;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 26px 34px;
  background-image: radial-gradient(rgba(60, 48, 30, 0.12) 0.7px, transparent 0.7px);
  background-size: 18px 18px;
  background-position: center;
}
.canvas-stage {
  position: relative;
  flex: none;
  margin: auto;
  filter: drop-shadow(0 22px 35px rgba(45, 32, 14, 0.13));
  transition: width 0.2s, height 0.2s;
}
.canvas-stage svg { width: 100%; height: 100%; display: block; overflow: visible; }
.canvas-stage .el { cursor: move; }
.canvas-stage .el:hover > rect[fill="transparent"] { stroke: rgba(var(--accent-rgb), 0.35); stroke-width: 0.6; stroke-dasharray: 2 2; }
.canvas-stage [data-handle] { cursor: pointer; }
.canvas-stage [data-handle="nw"], .canvas-stage [data-handle="se"] { cursor: nwse-resize; }
.canvas-stage [data-handle="ne"], .canvas-stage [data-handle="sw"] { cursor: nesw-resize; }
.canvas-stage [data-handle="w"], .canvas-stage [data-handle="e"] { cursor: ew-resize; }
.canvas-stage [data-handle="rot"] { cursor: grab; }
.canvas-empty[hidden] { display: none; }
.canvas-empty {
  position: absolute;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  color: var(--muted);
  box-shadow: var(--shadow-s);
  z-index: 5;
  white-space: nowrap;
}
.canvas-empty b { color: var(--ink); font-weight: 650; }
.canvas-empty button { color: var(--accent); font-weight: 650; }
.canvas-empty button:hover { text-decoration: underline; }
.workspace-foot {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  border-top: 1px solid var(--line);
  background: var(--white);
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--muted);
}
.workspace-foot .spacer { flex: 1; }
.workspace-foot button { color: var(--ink-2); font-family: var(--font); font-size: 10.5px; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.workspace-foot button:hover { color: var(--accent); }

.props-panel {
  background: var(--white);
  border-left: 1px solid var(--line);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.props-head {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.props-head h3 { font-size: 13px; font-weight: 700; }
.props-close {
  display: none;
  width: 24px; height: 24px; border: 1px solid var(--line-2); border-radius: 50%;
  background: var(--white); color: var(--muted); font-size: 15px; line-height: 1;
  place-items: center; cursor: pointer;
}
.props-close:hover { color: var(--ink); border-color: var(--ink-2); }
.props-head .type-chip {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 3px 8px;
}
.props-body { padding: 16px 18px 30px; }
.props-empty { padding: 30px 20px; text-align: center; color: var(--muted); font-size: 11.5px; line-height: 1.7; }
.props-empty .icon-box {
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  border-radius: 14px;
  border: 1px dashed var(--line-2);
  background: var(--paper);
  display: grid;
  place-items: center;
  color: var(--muted-2);
}
.props-empty b { display: block; color: var(--ink); font-size: 13px; margin-bottom: 4px; }

.p-section { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.p-section:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.p-section-title {
  font-size: 9px;
  font-family: var(--font-mono);
  letter-spacing: 0.13em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.p-section-title button { font-family: var(--font); letter-spacing: 0; text-transform: none; color: var(--accent); font-size: 10px; }
.p-row { display: flex; gap: 8px; margin-bottom: 9px; }
.p-row:last-child { margin-bottom: 0; }
.p-field { flex: 1; min-width: 0; }
.p-field label { display: block; font-size: 9.5px; color: var(--muted); margin-bottom: 5px; }
.p-input, .p-select, .p-textarea {
  width: 100%;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper-2);
  padding: 0 9px;
  font-size: 11.5px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.p-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%237d7466' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; padding-right: 24px; }
.p-input:focus, .p-select:focus, .p-textarea:focus { border-color: var(--ink); background: #fff; }
.p-textarea { height: auto; min-height: 76px; padding: 8px 9px; resize: vertical; line-height: 1.5; }
.p-color {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper-2);
  padding: 0 8px;
}
.p-color input[type="color"] { width: 20px; height: 20px; border: 0; padding: 0; background: none; border-radius: 5px; overflow: hidden; cursor: pointer; }
.p-color input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.p-color input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 4px; }

/* antd ColorPicker 与面板输入框体系统一：同高 32px、色块垂直居中、满宽 */
.p-field .ant-color-picker-trigger {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border-radius: 7px;
  border-color: var(--line);
  background: var(--paper-2);
  transition: border-color 0.2s, background 0.2s;
}
.p-field .ant-color-picker-trigger:hover { border-color: var(--ink); background: #fff; }
.p-field .ant-color-picker-trigger .ant-color-picker-color {
  inset-inline-start: 8px;
  inset-block-start: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 5px;
  padding: 0;
}
.p-field .ant-color-picker-trigger .ant-color-picker-color .ant-color-picker-clear {
  inset: 0;
  border-radius: 5px;
}
.p-field .ant-color-picker-trigger .ant-color-picker-input {
  height: 100%;
  margin-inline-start: 32px;
  display: flex;
  align-items: center;
}
.p-field .ant-color-picker-trigger .ant-color-picker-input input {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--muted);
  text-transform: uppercase;
  height: auto;
  line-height: 32px;
  padding: 0;
  border: 0;
  background: none;
}
.p-color span { font-family: var(--font-mono); font-size: 9.5px; color: var(--muted); text-transform: uppercase; }
.p-swatches { display: flex; flex-wrap: wrap; gap: 7px; }
.p-swatch {
  width: 23px;
  height: 23px;
  border-radius: 50%;
  border: 1.5px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  position: relative;
  transition: transform 0.15s;
}
.p-swatch:hover { transform: scale(1.12); }
.p-swatch.on::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
}
.p-seg { display: flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: var(--paper-2); }
.p-seg button { flex: 1; height: 30px; font-size: 11px; color: var(--muted); display: grid; place-items: center; transition: background 0.2s, color 0.2s; }
.p-seg button + button { border-left: 1px solid var(--line); }
.p-seg button.on { background: var(--ink); color: var(--paper-2); }
.p-seg button:hover:not(.on) { background: var(--paper-3); color: var(--ink); }
.p-check { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--ink-2); padding: 3px 0; }
.p-check input { width: 15px; height: 15px; accent-color: var(--accent); }
.p-range { display: flex; align-items: center; gap: 9px; }
.p-range input { flex: 1; accent-color: var(--accent); height: 3px; }
.p-range span { font-family: var(--font-mono); font-size: 9px; color: var(--muted); width: 34px; text-align: right; }
.p-actions { display: flex; gap: 7px; }
.p-actions button {
  flex: 1;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 10.5px;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background 0.2s, border-color 0.2s;
}
.p-actions button:hover { background: var(--paper); border-color: var(--line-2); }
.p-actions button.danger:hover { background: #fff0ec; border-color: #ffc3b2; color: #d63d13; }
.p-layer-actions { display: flex; justify-content: space-between; gap: 5px; margin-top: 4px; }
.p-hint { font-size: 9.5px; color: var(--muted-2); line-height: 1.55; margin-top: 7px; }
.p-price-card { background: var(--paper); border-radius: 10px; padding: 12px; }
.p-price-line { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin-bottom: 6px; }
.p-price-line:last-child { margin-bottom: 0; padding-top: 8px; border-top: 1px dashed var(--line-2); font-size: 12px; color: var(--ink); font-weight: 650; }
.p-price-line b { color: var(--ink); }

.template-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.template-mini {
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  text-align: left;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  background: var(--white);
}
.template-mini:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow-s); }
.template-mini .thumb { height: 108px; display: flex; align-items: center; justify-content: center; }
.template-mini .thumb svg { width: 70%; max-height: 100px; filter: drop-shadow(0 7px 9px rgba(40, 28, 12, 0.15)); }
.template-mini .name { padding: 7px 9px 8px; font-size: 10.5px; font-weight: 600; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 5px; align-items: center; }
.template-mini .name span { font-size: 8px; color: var(--muted); font-weight: 400; }

.upload-zone {
  border: 1.5px dashed var(--line-2);
  border-radius: 12px;
  padding: 22px 14px;
  text-align: center;
  background: var(--paper-2);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--accent); background: #fff8f3; }
.upload-zone .icon-box { width: 42px; height: 42px; border-radius: 12px; background: var(--white); border: 1px solid var(--line); display: grid; place-items: center; margin: 0 auto 10px; color: var(--accent); }
.upload-zone b { display: block; font-size: 11.5px; font-weight: 650; }
.upload-zone span { display: block; font-size: 9.5px; color: var(--muted); margin-top: 3px; }
.uploaded-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 10px; }
.uploaded-item { position: relative; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--paper); }
.uploaded-item img { width: 100%; height: 100%; object-fit: cover; }
.uploaded-item button { position: absolute; right: 3px; top: 3px; width: 17px; height: 17px; border-radius: 50%; background: rgba(23, 20, 15, 0.72); color: #fff; display: grid; place-items: center; font-size: 10px; opacity: 0; transition: opacity 0.2s; }
.uploaded-item:hover button { opacity: 1; }

.text-preset {
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
  margin-bottom: 7px;
  transition: border-color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.text-preset:hover { border-color: var(--ink); background: var(--paper-2); }
.text-preset b { display: block; font-weight: 700; }
.text-preset span { font-size: 9.5px; color: var(--muted); }
.text-preset .t-label { font-size: 20px; line-height: 1; color: var(--ink); }

.shape-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.shape-btn {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  display: grid;
  place-items: center;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.shape-btn:hover { border-color: var(--ink); transform: translateY(-2px); }
.shape-btn .shape-ico { width: 24px; height: 24px; border: 1.5px solid var(--ink); }
.shape-btn .shape-ico.circle { border-radius: 50%; }
.shape-btn .shape-ico.line { height: 0; border-width: 1.5px 0 0; }
.shape-btn .shape-ico.star { border: 0; background: var(--ink); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.shape-btn .shape-ico.badge { border-radius: 50%; border-style: dashed; }
.shape-btn .shape-ico.triangle { border: 0; background: var(--ink); clip-path: polygon(50% 4%, 96% 94%, 4% 94%); }

.asset-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.asset-btn {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  display: grid;
  place-items: center;
  padding: 7px;
  transition: border-color 0.2s, transform 0.2s;
}
.asset-btn:hover { border-color: var(--ink); transform: translateY(-2px); }
.asset-btn svg { width: 100%; height: 100%; display: block; }

.plan-save { display: flex; gap: 6px; align-items: center; margin-bottom: 10px; }
.plan-save .ant-input { font-size: 11.5px; }
.plan-list { display: flex; flex-direction: column; gap: 7px; }
.plan-item { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 9px; padding: 6px; background: var(--white); }
.plan-thumb { width: 42px; height: 54px; flex: none; border-radius: 5px; overflow: hidden; background: var(--paper); border: 1px solid var(--line); }
.plan-thumb svg { width: 100%; height: 100%; display: block; }
.plan-meta { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.plan-meta b { font-size: 11px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-meta span { font-size: 9px; color: var(--muted); }
.plan-actions { display: flex; flex-direction: column; gap: 3px; }
.plan-actions button { font-size: 9.5px; padding: 3px 7px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); color: var(--ink-2); font-family: inherit; }
.plan-actions button:hover { border-color: var(--ink); color: var(--ink); }
.plan-actions button.del:hover { border-color: #ffc3b2; color: #d63d13; background: #fff0ec; }

.sticker-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.sticker-btn {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  display: grid;
  place-items: center;
  transition: border-color 0.2s, transform 0.2s;
}
.sticker-btn:hover { border-color: var(--ink); transform: translateY(-2px); }
.sticker-btn svg { width: 26px; height: 26px; }

.layer-list { display: flex; flex-direction: column; gap: 5px; }
.layer-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.layer-item:hover { background: var(--paper); }
.layer-item.on { background: var(--paper); border-color: var(--line-2); }
.layer-icon {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  background: var(--white);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--ink-2);
  flex: none;
}
.layer-icon .icon { width: 13px; height: 13px; }
.layer-name { flex: 1; min-width: 0; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.layer-name small { display: block; font-size: 8.5px; color: var(--muted-2); }
.layer-eye { width: 22px; height: 22px; display: grid; place-items: center; color: var(--muted); border-radius: 4px; }
.layer-eye:hover { background: var(--paper-3); color: var(--ink); }
.layer-eye .icon { width: 13px; height: 13px; }

.rail-extra { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }

.settings-view {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 318px;
  height: calc(100vh - 68px);
  overflow: hidden;
  background: var(--paper-2);
}
.settings-side {
  border-right: 1px solid var(--line);
  padding: 24px 22px 30px;
  overflow-y: auto;
  background: var(--white);
}
.settings-side .step-kicker { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.16em; color: var(--accent); }
.settings-side h1 { font-size: 22px; font-weight: 750; letter-spacing: -0.03em; margin-top: 6px; }
.settings-side > p { font-size: 11px; color: var(--muted); margin-top: 5px; line-height: 1.6; }
.field-block { margin-top: 22px; }
.field-label { display: flex; align-items: center; justify-content: space-between; font-size: 10px; font-family: var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.field-label span { font-family: var(--font); letter-spacing: 0; text-transform: none; font-size: 9.5px; color: var(--muted-2); }
.product-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.product-choice {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 5px 7px;
  background: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  position: relative;
}
.product-choice:hover { border-color: var(--line-2); background: var(--paper-2); }
.product-choice.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); background: var(--paper-2); }
.product-choice .thumb { height: 58px; width: 100%; display: flex; align-items: center; justify-content: center; }
.product-choice .thumb svg { height: 56px; width: auto; max-width: 88%; filter: drop-shadow(0 4px 5px rgba(40, 28, 12, 0.14)); }
.product-choice b { font-size: 10px; font-weight: 600; }
.product-choice em { font-style: normal; font-size: 8px; color: var(--muted); }
.product-choice .on-dot { position: absolute; top: 5px; right: 5px; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); color: var(--white); display: grid; place-items: center; font-size: 8px; opacity: 0; }
.product-choice.on .on-dot { opacity: 1; }
.choice-list { display: flex; flex-direction: column; gap: 5px; }
.choice-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  text-align: left;
  transition: border-color 0.2s;
}
.choice-item:hover { border-color: var(--line-2); }
.choice-item.on { border-color: var(--ink); }
.choice-item .radio { width: 13px; height: 13px; border-radius: 50%; border: 1.2px solid var(--line-2); flex: none; position: relative; }
.choice-item.on .radio { border-color: var(--ink); }
.choice-item.on .radio::after { content: ""; position: absolute; inset: 2.5px; background: var(--ink); border-radius: 50%; }
.choice-item b { font-size: 10.5px; font-weight: 600; }
.choice-item span { margin-left: auto; font-size: 9px; color: var(--muted); font-family: var(--font-mono); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.two-col label { font-size: 9px; color: var(--muted); display: block; margin-bottom: 5px; }
.two-col select { width: 100%; height: 32px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper-2); padding: 0 8px; font-size: 10.5px; outline: none; }
.qty-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.qty-chip { height: 34px; border: 1px solid var(--line); border-radius: 7px; background: var(--white); font-size: 10.5px; font-weight: 600; }
.qty-chip span { display: block; font-size: 7.5px; color: var(--muted); font-weight: 400; }
.qty-chip.on { border-color: var(--ink); background: var(--ink); color: var(--paper-2); }
.qty-chip.on span { color: rgba(255, 253, 248, 0.6); }

.settings-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #f1ede4;
  position: relative;
  overflow: hidden;
}
.settings-stage-head {
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.7);
}
.settings-stage-head b { font-size: 12px; font-weight: 650; }
.settings-stage-head span { font-size: 10px; color: var(--muted); }
.settings-preview { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 18px; position: relative; background-image: radial-gradient(rgba(60, 48, 30, 0.11) 0.7px, transparent 0.7px); background-size: 18px 18px; }
.settings-preview .bag-wrap { width: min(480px, 76%); max-height: 100%; filter: drop-shadow(0 28px 36px rgba(45, 32, 14, 0.18)); }
.settings-preview svg { width: 100%; height: auto; max-height: calc(100vh - 300px); }
.settings-colorbar { height: 62px; border-top: 1px solid var(--line); background: rgba(255, 253, 248, 0.8); display: flex; align-items: center; gap: 16px; padding: 0 22px; flex-wrap: wrap; }
.settings-colorbar span { font-size: 10px; font-family: var(--font-mono); letter-spacing: 0.08em; color: var(--muted); }
.color-dots { display: flex; gap: 7px; }
.color-dot { width: 23px; height: 23px; border-radius: 50%; border: 1.5px solid transparent; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); }
.color-dot.on { border-color: var(--ink); }

.settings-order { border-left: 1px solid var(--line); padding: 24px 20px; background: var(--white); overflow-y: auto; }
.order-card { background: var(--paper-2); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.order-card .eyebrow { font-size: 9px; }
.order-card h2 { font-size: 18px; font-weight: 750; letter-spacing: -0.02em; margin-top: 6px; }
.order-lines { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line-2); }
.order-line { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); padding: 4px 0; }
.order-line b { color: var(--ink-2); font-weight: 600; }
.order-total { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--line); }
.order-total span { font-size: 10px; color: var(--muted); }
.order-total b { font-size: 26px; letter-spacing: -0.04em; font-weight: 750; }
.order-total b small { font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.order-card .btn { width: 100%; margin-top: 15px; }
.micro { font-size: 9px; color: var(--muted-2); text-align: center; line-height: 1.6; margin-top: 10px; }
.mini-guarantees { margin-top: 16px; display: flex; flex-direction: column; gap: 9px; }
.mini-guarantee { display: flex; gap: 8px; align-items: flex-start; font-size: 10px; color: var(--muted); line-height: 1.5; }
.mini-guarantee .icon { width: 13px; height: 13px; color: var(--accent); margin-top: 1px; }
.settings-note { margin-top: 18px; background: var(--lime); border-radius: 10px; padding: 12px 14px; font-size: 10px; line-height: 1.6; color: var(--ink); }
.settings-note b { display: block; margin-bottom: 2px; }

.summary-view {
  height: calc(100vh - 68px);
  overflow-y: auto;
  background: var(--paper);
}
.summary-inner {
  width: min(1180px, calc(100% - 64px));
  margin: 0 auto;
  padding: 44px 0 70px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
  gap: 54px;
  align-items: start;
}
.summary-head h1 { font-size: 40px; letter-spacing: -0.045em; font-weight: 800; margin-top: 12px; }
.summary-head p { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.summary-preview {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #f1ede4;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px;
  min-height: 600px;
  position: relative;
  background-image: radial-gradient(rgba(60, 48, 30, 0.11) 0.7px, transparent 0.7px);
  background-size: 18px 18px;
}
.summary-preview #summaryPreview { width: 100%; display: flex; align-items: center; justify-content: center; }
.summary-preview .bag-wrap { width: min(388px, 84%); filter: drop-shadow(0 26px 34px rgba(45, 32, 14, 0.17)); }
.summary-preview svg { width: 100%; }
.summary-side-switch { position: absolute; top: 14px; left: 14px; }
.summary-thumbs { display: flex; gap: 10px; margin-top: 12px; }
.summary-thumb { width: 86px; height: 74px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper-2); display: flex; align-items: center; justify-content: center; padding: 5px; }
.summary-thumb.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.summary-thumb svg { width: 100%; height: 100%; }
.summary-actions { display: flex; gap: 16px; margin-top: 18px; align-items: center; }
.summary-actions button { font-size: 11.5px; font-weight: 600; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.summary-actions button:hover { color: var(--accent); }
.summary-right { position: sticky; top: 20px; }
.summary-right .order-card { background: var(--white); padding: 24px; }
.summary-right .order-card h2 { margin-bottom: 14px; }
.summary-specs { border-top: 1px dashed var(--line-2); padding-top: 12px; margin-top: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.form-grid input, .form-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
  height: 38px;
  padding: 0 11px;
  font-size: 11px;
  outline: none;
}
.form-grid textarea { grid-column: 1 / -1; height: 72px; padding: 9px 11px; resize: none; line-height: 1.5; }
.form-grid input:focus, .form-grid textarea:focus { border-color: var(--ink); background: #fff; }
.summary-right .btn { width: 100%; margin-top: 12px; }

.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(23, 20, 15, 0.62); backdrop-filter: blur(8px); }
.modal-panel {
  position: relative;
  width: min(880px, 100%);
  max-height: calc(100vh - 48px);
  background: var(--paper-2);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.modal-head h3 span { font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.1em; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 3px 7px; }
.modal-close { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); font-size: 16px; }
.modal-close:hover { background: var(--paper); color: var(--ink); }
.scene {
  flex: 1;
  min-height: 440px;
  background: radial-gradient(ellipse at 50% 40%, #fffdf8, #efe9dc 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1500px;
  overflow: hidden;
  position: relative;
  cursor: grab;
  touch-action: none;
}
.scene:active { cursor: grabbing; }
.scene::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 15%;
  transform: translateX(-50%);
  width: 400px;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(35, 24, 10, 0.34), rgba(35, 24, 10, 0.16) 55%, transparent 75%);
  filter: blur(16px);
}
.pouch3d {
  position: relative;
  width: 280px;
  height: 400px;
  transform-style: preserve-3d;
  transform: rotateX(4deg) rotateY(-18deg);
  transition: transform 0.15s linear;
  z-index: 2;
  animation: bagFloat 6s ease-in-out infinite;
}
@keyframes bagFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -10px; }
}
.pouch3d .face3d {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  overflow: hidden;
  /* 正/背面：设计主体完整，仅顶部两角圆切与侧肩封合贴合 + 底部圆角 */
  clip-path: url(#pouchFrontClip);
}
.pouch3d .face3d svg { width: 100%; height: 100%; }
.pouch3d .face3d.front {
  /* 充填形态：顶部封口贴合（Z 小），底部内容物撑开（Z 大）→ rotateX 微倾实现 */
  transform: rotateX(-4.5deg) translateZ(20px);
  transform-origin: 50% 0%;
}
.pouch3d .face3d.back {
  transform: rotateY(180deg) rotateX(-4.5deg) translateZ(20px);
  transform-origin: 50% 0%;
  background: var(--paper-3);
}
/* 顶部横向热封压痕：细平行条纹压纹（高约7%，哑光），压纹风格前后统一 */
.pouch3d .face3d.front::after,
.pouch3d .face3d.back::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 7.5%;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.34), rgba(0,0,0,0.05) 85%, rgba(0,0,0,0.16)),
    repeating-linear-gradient(180deg, rgba(0,0,0,0.10) 0 1px, transparent 1px 3.2px);
  border-bottom: 1px solid rgba(0,0,0,0.22);
  pointer-events: none;
  z-index: 5;
}
/* 易撕口：封边右上 V 形冲切缺口 */
.pouch3d .face3d.front::before,
.pouch3d .face3d.back::before {
  content: "";
  position: absolute;
  top: 0; right: 9%;
  width: 12px; height: 5.4%;
  background: inherit;
  z-index: 6;
  pointer-events: none;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: brightness(1.35) saturate(0.9);
  box-shadow: 0 1.5px 0 rgba(0,0,0,0.18);
}
.pouch3d .face3d.side {
  width: 44px;
  left: 50%;
  margin-left: -22px;
  transform: rotateY(90deg) translateZ(140px);
  background: linear-gradient(90deg, #b9ac97, #efe7d6 45%, #a99b85);
  backface-visibility: visible;
  /* 侧面：水滴形（封口 fin 极薄→中下膨鼓→底部满宽），不影响正反面 */
  clip-path: url(#pouchSideClip);
  width: 72px;
  margin-left: -36px;
  /* 体积兜底（JS 按袋色重建：顶部薄暗哑光、中下鼓面亮、底部承重微暗） */
  background:
    radial-gradient(ellipse 120% 60% at 50% 74%, rgba(255,255,255,0.30), transparent 58%),
    linear-gradient(180deg, rgba(0,0,0,0.34) 0%, rgba(0,0,0,0.08) 22%, transparent 42%, rgba(0,0,0,0.10) 92%),
    linear-gradient(90deg, rgba(0,0,0,0.30), rgba(255,255,255,0.16) 46%, rgba(0,0,0,0.34));
}
/* 放射状斜褶：从封口窄点向下发散 + 底部轻微堆积感 */
.pouch3d .face3d.side::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(168deg, transparent 0 5px, rgba(0,0,0,0.045) 5px 6.2px),
    repeating-linear-gradient(12deg, transparent 0 5px, rgba(0,0,0,0.045) 5px 6.2px);
  pointer-events: none;
}
.pouch3d .face3d.side::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 16%;
  background:
    repeating-linear-gradient(180deg, transparent 0 3.5px, rgba(0,0,0,0.05) 3.5px 4.4px),
    linear-gradient(180deg, transparent, rgba(0,0,0,0.10));
  border-top: 1px solid rgba(0,0,0,0.14);
  pointer-events: none;
}
.modal-controls {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--white);
}
.modal-controls .hint { font-size: 10px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.modal-controls input[type="range"] { flex: 1; accent-color: var(--accent); }
.modal-controls .side-switch button { padding: 0 12px; height: 26px; font-size: 10.5px; }

.inline-text-editor {
  position: fixed;
  z-index: 150;
  width: 300px;
  background: var(--white);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(23, 20, 15, 0.22);
  padding: 10px;
}
.inline-text-editor[hidden] { display: none; }
.inline-text-editor textarea {
  width: 100%;
  border: 0;
  background: var(--paper-2);
  border-radius: 7px;
  padding: 9px 10px;
  font-size: 12px;
  resize: vertical;
  min-height: 78px;
  outline: none;
  line-height: 1.5;
}
.inline-text-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.inline-text-actions span { font-size: 9px; color: var(--muted-2); font-family: var(--font-mono); }
.inline-text-actions button { height: 28px; padding: 0 13px; border-radius: 6px; background: var(--ink); color: var(--paper-2); font-size: 10.5px; }

.success-view {
  position: fixed;
  inset: 0;
  z-index: 220;
  background: rgba(23, 20, 15, 0.55);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 24px;
}
.success-view[hidden] { display: none; }
.success-card {
  width: min(460px, 100%);
  background: var(--paper-2);
  border-radius: 22px;
  padding: 38px 34px 30px;
  text-align: center;
  box-shadow: var(--shadow-l);
}
.success-icon { width: 62px; height: 62px; border-radius: 50%; background: var(--lime); display: grid; place-items: center; margin: 0 auto 20px; }
.success-icon .icon { width: 28px; height: 28px; color: var(--ink); }
.success-card h2 { font-size: 24px; letter-spacing: -0.03em; font-weight: 750; }
.success-card p { font-size: 11.5px; color: var(--muted); line-height: 1.7; margin-top: 9px; }
.success-order { background: var(--paper); border: 1px dashed var(--line-2); border-radius: 10px; padding: 13px; margin: 18px 0; font-family: var(--font-mono); font-size: 10px; color: var(--muted); }
.success-order b { display: block; font-size: 16px; color: var(--ink); letter-spacing: 0.04em; margin-top: 3px; }
.success-card #successTip { color: #e0a83a; }
.success-actions { display: flex; gap: 10px; }
.success-actions .btn { flex: 1; }
.success-actions .btn:last-child { flex: 0 0 auto; width: auto; padding-inline: 18px; }

@media (max-width: 1240px) {
  .design-view { grid-template-columns: 72px 260px minmax(0, 1fr) 264px; }
  .settings-view { grid-template-columns: 296px minmax(0, 1fr) 290px; }
}
@media (max-width: 1100px) {
  .design-view { grid-template-columns: 68px 240px minmax(0, 1fr); }
  .props-panel { display: none; }
  /* 窄屏下选中元素时以浮层抽屉展示属性，避免属性面板被隐藏后无法编辑 */
  body.props-open .props-panel {
    display: flex;
    position: fixed;
    top: 70px;
    right: 12px;
    bottom: 12px;
    width: 286px;
    max-width: calc(100vw - 24px);
    z-index: 70;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 20px 55px rgba(40, 30, 10, 0.18);
  }
  body.props-open .props-close { display: grid; }
  .studio-title-wrap { display: none; }
  .summary-inner { grid-template-columns: 1fr; gap: 30px; }
  .summary-right { position: static; }
  .summary-preview { min-height: 380px; }
}
@media (max-width: 900px) {
  .settings-view { grid-template-columns: 280px minmax(0, 1fr); }
  .settings-order { display: none; }
  .studio-steps .step span { display: none; }
  .studio-actions .save-state, .undo-group { display: none; }
}
@media (max-width: 760px) {
  .studio-topbar { grid-template-columns: auto 1fr auto; height: 60px; padding: 0 12px; }
  .studio-brand .logo-img { height: 24px; }
  .studio-steps { gap: 4px; }
  .studio-steps .sep { display: none; }
  .studio-actions .btn-ghost { display: none; }
  .design-view { grid-template-columns: 1fr; grid-template-rows: 1fr 58px; height: calc(100vh - 60px); }
  .tool-rail { order: 2; flex-direction: row; padding: 6px 8px; overflow-x: auto; border-right: 0; border-top: 1px solid var(--line); }
  .tool-rail button { flex: 1; min-width: 52px; flex-direction: row; justify-content: center; gap: 5px; padding: 8px 4px; }
  .tool-rail button .icon { width: 15px; height: 15px; }
  .tool-rail button.active::before { left: 50%; top: auto; bottom: -6px; transform: translateX(-50%); width: 18px; height: 3px; border-radius: 3px 3px 0 0; }
  .tool-rail .rail-sep, .rail-extra { display: none; }
  .tool-panel-close { display: grid; place-items: center; }
  .tool-panel { position: absolute; left: 0; bottom: 58px; top: auto; height: min(360px, 50vh); width: 100%; z-index: 30; border-right: 0; border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; box-shadow: 0 -18px 40px rgba(20, 14, 6, 0.18); transform: translateY(calc(100% + 70px)); transition: transform 0.35s var(--ease); }
  .design-view.panel-open .tool-panel { transform: translateY(0); }
  .workspace { order: 1; }
  .workspace-tools { padding: 0 12px; }
  .view-actions { gap: 10px; }
  .view-actions .switch { display: none; }
  .canvas-shell { padding: 16px; }
  .settings-view { display: block; height: calc(100vh - 60px); overflow-y: auto; }
  .settings-side { border-right: 0; overflow: visible; padding-bottom: 8px; }
  .settings-main { min-height: 540px; }
  .settings-preview { padding: 14px; }
  .settings-preview svg { width: auto; max-width: 100%; max-height: 380px; }
  .settings-colorbar { height: auto; padding: 12px 16px; }
  .summary-inner { width: calc(100% - 32px); padding-top: 24px; }
  .summary-head h1 { font-size: 28px; }
  .summary-preview { min-height: 300px; padding: 16px; flex-direction: column; align-items: stretch; justify-content: flex-start; }
  .summary-side-switch { position: static; align-self: flex-start; margin-bottom: 12px; }
  .modal-panel { max-height: calc(100vh - 24px); }
  .scene { min-height: 340px; }
  .pouch3d { width: 200px; height: 290px; }
  .pouch3d .face3d.side { transform: rotateY(90deg) translateZ(100px); }
  .modal-controls { flex-wrap: wrap; gap: 10px; }
  .modal-controls input[type="range"] { min-width: 120px; }
}

/* ---------- custom size & quantity ---------- */
.s-custom-size {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px dashed var(--line-2);
  border-radius: 9px;
  background: var(--paper-2);
  transition: border-color 0.2s, background 0.2s;
}
.s-custom-size.on { border-color: var(--accent); background: #fff8f3; }
.s-custom-title { display: flex; justify-content: space-between; align-items: center; font-size: 10.5px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.s-custom-title span { font-family: var(--font-mono); font-size: 9px; color: var(--muted-2); }
.s-custom-inputs { display: flex; align-items: flex-end; gap: 7px; }
.s-inline-field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.s-inline-field label { font-size: 9.5px; color: var(--muted-2); }
.s-inline-input {
  width: 100%;
  height: 32px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: var(--white);
  padding: 0 8px;
  font-size: 12px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s;
}
.s-inline-input:focus { border-color: var(--ink); }
.s-times { font-size: 11px; color: var(--muted-2); padding-bottom: 9px; }
.s-qty-custom { display: flex; align-items: center; gap: 7px; margin-top: 9px; }
.s-qty-custom label { font-size: 10px; color: var(--muted-2); white-space: nowrap; }
.s-qty-custom .s-inline-input { width: 104px; flex: none; }
.s-qty-custom span { font-size: 9.5px; color: var(--muted-2); white-space: nowrap; }

/* ---------- layer actions ---------- */
.layer-del { width: 20px; height: 20px; border-radius: 4px; color: var(--muted-2); display: grid; place-items: center; font-size: 10px; flex: none; }
.layer-del:hover { background: #fff0ec; color: #d63d13; }

/* ---------- collapse / expand animation ---------- */
.design-view { transition: grid-template-columns 0.32s var(--ease); }
.tool-panel { min-width: 0; transition: transform 0.32s var(--ease), opacity 0.28s var(--ease); }
@media (min-width: 1101px) {
  .tool-panel-close { display: grid; place-items: center; }
  .design-view.panel-collapsed { grid-template-columns: 76px 0 minmax(0, 1fr) 290px; }
  .design-view.panel-collapsed .tool-panel { transform: translateX(-18px); opacity: 0; pointer-events: none; }
}
@keyframes plSlideInLeft { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
@keyframes plSlideInRight { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes plFadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.design-view:not([hidden]) .tool-panel { animation: plSlideInLeft 0.34s var(--ease); }
.design-view:not([hidden]) .props-panel { animation: plSlideInRight 0.34s var(--ease); }
.design-view:not([hidden]) .workspace { animation: plFadeUp 0.3s var(--ease); }
.settings-view:not([hidden]) { animation: plFadeUp 0.32s var(--ease); }
.summary-view:not([hidden]) { animation: plFadeUp 0.32s var(--ease); }

.tool-panel { overflow: hidden; }

/* 图层顺序操作 */
.p-actions.order-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.layer-row .layer-order {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 12px;
  color: #8a8478;
  padding: 4px 5px;
  flex: none;
}
.layer-row .layer-order:hover { color: #c2451f; }

/* 图层拖拽排序 */
.layer-row { touch-action: none; }
.layer-row.dragging { opacity: 0.35; }
.layer-row.drop-above { box-shadow: inset 0 2.5px 0 #c2451f; }
.layer-row.drop-below { box-shadow: inset 0 -2.5px 0 #c2451f; }

/* AI 交互式排版 */
#plAiFab {
  position: fixed; right: 26px; bottom: 30px; z-index: 60;
  display: inline-flex; align-items: center; gap: 7px;
  border: 0; cursor: pointer; font-family: inherit;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: var(--accent-on);
  border-radius: 999px; padding: 11px 18px; font-size: 13px; font-weight: 700;
  box-shadow: 0 12px 30px rgba(var(--accent-rgb), 0.35);
  transition: transform 0.15s;
}
#plAiFab:hover { transform: translateY(-2px); }
.pl-ai-panel {
  position: fixed; right: 26px; bottom: 84px; z-index: 60; width: 320px;
  background: var(--paper, #fffdf8); border: 1px solid var(--line-2, #e2dacb);
  border-radius: 14px; padding: 14px; box-shadow: 0 24px 60px rgba(23,20,15,0.18);
}
.pl-ai-panel[hidden] { display: none; }
.pl-ai-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; cursor: move; user-select: none; touch-action: none; }
.pl-ai-head b { font-size: 14px; }
.pl-ai-quota { font-size: 11px; color: var(--muted); background: var(--bg); border-radius: 999px; padding: 2px 8px; }
.pl-ai-close { margin-left: auto; border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 13px; }
.pl-ai-sides { display: flex; gap: 6px; margin-bottom: 8px; }
.pl-ai-sides button {
  flex: 1; border: 1px solid var(--line-2); background: var(--paper); border-radius: 8px;
  padding: 6px 0; font-size: 12px; cursor: pointer; color: var(--muted); font-family: inherit;
}
.pl-ai-sides button.on { border-color: var(--accent, var(--accent)); color: var(--accent, var(--accent)); background: #fff3ec; }
.pl-ai-panel textarea {
  width: 100%; box-sizing: border-box; border: 1px solid var(--line-2); border-radius: 10px;
  padding: 9px; font-size: 12.5px; min-height: 96px; resize: vertical; font-family: inherit;
  background: #fff; color: var(--ink);
}
.pl-ai-actions { display: flex; gap: 8px; margin-top: 8px; }
.pl-ai-actions .btn { flex: 1; }
.pl-ai-clear { border: 1px solid var(--line-2); background: var(--paper); border-radius: 9px; padding: 8px; cursor: pointer; font-size: 12.5px; color: var(--muted); font-family: inherit; }
.pl-ai-tip { font-size: 10.5px; color: var(--muted); margin: 8px 0 0; line-height: 1.5; }
#plAiGen[disabled] { opacity: 0.55; cursor: not-allowed; }

/* 参考潘通色（防侵权叫法：不称潘通色；实际以打样效果为准） */
.pms-title { font-size: 11px; font-weight: 700; color: #4c473f; margin: 12px 0 7px; }
.pms-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.pms-dot {
  width: 21px; height: 21px; border-radius: 50%;
  border: 1.5px solid rgba(0,0,0,.10); cursor: pointer; padding: 0;
  transition: transform .15s;
}
.pms-dot:hover { transform: scale(1.15); }
.pms-dot.on { outline: 2px solid #c2451f; outline-offset: 1.5px; }
.pms-note { font-size: 10px; color: #a79d8d; line-height: 1.5; margin-top: 8px; }

/* ===== 面板对齐统一（宽度/高度输入 = 32px 基准体系） ===== */
/* 1. 自定义底色取色器：与其他输入框同高同圆角，色块垂直居中 */
.props-panel .p-field .ant-color-picker-trigger,
.props-panel .p-field .ant-color-picker-trigger.ant-color-picker-trigger,
.p-field .ant-color-picker-trigger,
.p-field .ant-color-picker-trigger.ant-color-picker-trigger {
  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
  width: 100% !important;
  padding: 0 8px !important;
  border-radius: 7px !important;
  border-color: var(--line) !important;
  background: var(--paper-2) !important;
}
.props-panel .p-field .ant-color-picker-trigger:hover {
  border-color: var(--ink) !important;
  background: #fff !important;
}
.p-field .ant-color-picker-trigger .ant-color-picker-color,
/* flex 垂直居中：不依赖 top/translate，无取整误差 */
.props-panel .p-field .ant-color-picker-trigger,
.p-field .ant-color-picker-trigger {
  display: flex !important;
  align-items: center !important;
  padding: 0 8px !important;
}
.props-panel .p-field .ant-color-picker-trigger .ant-color-picker-color,
.p-field .ant-color-picker-trigger .ant-color-picker-color {
  position: static !important;
  transform: none !important;
  inset: auto !important;
  inset-inline-start: auto !important;
  inset-block-start: auto !important;
  width: 20px !important;
  height: 20px !important;
  flex: none !important;
  border-radius: 5px !important;
  padding: 0 !important;
  margin: 0 !important;
}
.props-panel .p-field .ant-color-picker-trigger .ant-color-picker-color .ant-color-picker-clear {
  inset: 0 !important;
  border-radius: 5px !important;
}
.p-field .ant-color-picker-trigger .ant-color-picker-input,
.props-panel .p-field .ant-color-picker-trigger .ant-color-picker-input,
.p-field .ant-color-picker-trigger .ant-color-picker-input {
  position: static !important;
  flex: 1 1 auto !important;
  height: auto !important;
  margin: 0 0 0 9px !important;
  display: flex !important;
  align-items: center !important;
}
.props-panel .p-field .ant-color-picker-trigger .ant-color-picker-input input {
  font-family: var(--font-mono) !important;
  font-size: 10px !important;
  color: #4c473f !important;
  text-transform: uppercase !important;
  height: auto !important;
  line-height: 32px !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
}
/* 2. 当前面分段：与输入框同高，字号统一 */
.props-panel .p-field .ant-segmented { height: 32px !important; width: 100% !important; }
.props-panel .p-field .ant-segmented .ant-segmented-group { height: 100% !important; }
.props-panel .p-field .ant-segmented .ant-segmented-item {
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
}
.props-panel .p-field .ant-segmented .ant-segmented-item-label {
  font-size: 12px !important;
  line-height: 30px !important;
  min-height: 30px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
/* 3. 字段标签统一 11px */
.props-panel .p-field > label,
.props-panel .p-field label {
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #4c473f !important;
  margin-bottom: 5px !important;
  line-height: 1.3 !important;
}
.props-panel .p-section-title {
  font-size: 12px !important;
  font-weight: 800 !important;
  color: #26211a !important;
  margin-bottom: 10px !important;
}
/* 4. 两组色板统一 22px */
.props-panel .p-swatch { width: 22px !important; height: 22px !important; }
.props-panel .pms-dot { width: 22px !important; height: 22px !important; }

/* 换肤：设计器画布上的辅助线/选中框/控制柄跟随主题色（仅 UI 覆盖层，data-ui 元素） */
[data-uistroke] { stroke: var(--accent); }
[data-uifill] { fill: var(--accent); }
