/* ============================================================
 * builder.css —— 严格对照 RVRN-3D-Wheel-Builder.html 设计稿样式
 * （设计稿 <style> 1-803 行移植；末尾仅一条无真图时的 concept-wheel 显示覆写）
 * 字体依赖：Google Fonts（Inter / Inter Tight / JetBrains Mono），
 *           内网环境加载失败时回退系统字体栈。
 * ============================================================ */

:root {
  --page: #eef0f1;
  --surface: #fafafa;
  --surface-2: #f4f4f5;
  --surface-3: #ececee;
  --ink: #101112;
  --ink-2: #55585d;
  --ink-3: #74777d;
  --line: rgba(12, 14, 17, .12);
  --line-dark: rgba(250, 250, 250, .12);
  --accent: #d00a07;
  --accent-soft: rgba(208, 10, 7, .08);
  --accent-deep: #a90907;
  --dark: #0a0a0b;
  --dark-2: #171718;
  --success: #286448;
  --warning: #9a6413;
  --danger: #b22b27;
  --shadow: 0 18px 50px -38px rgba(24, 17, 17, .34);
  --header-h: 72px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  overflow: hidden;
  color: var(--ink);
  background: var(--page);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
}

button, input, select { font: inherit; }
button { color: inherit; }
button, select, input[type="range"] { cursor: pointer; }
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button:disabled { cursor: not-allowed; opacity: .42; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  color: #f8f8f8;
  background: var(--dark);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.app {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: var(--header-h) minmax(0, 1fr);
  background: var(--surface);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
  padding: 0 22px;
  background: rgba(250, 250, 250, .97);
  border-bottom: 1px solid var(--line);
  z-index: 20;
}
.brand-lockup {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand-lockup img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  flex: 0 0 auto;
}
.brand-divider {
  width: 1px;
  height: 34px;
  background: var(--line);
}
.brand-title {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.brand-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "Inter Tight", Inter, sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .01em;
}
.brand-title span {
  color: var(--ink-3);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.top-actions { display: flex; align-items: center; gap: 9px; }

.btn {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  transition: background-color 180ms var(--ease), border-color 180ms var(--ease), color 180ms var(--ease), transform 180ms var(--ease);
}
.btn:hover:not(:disabled) { border-color: rgba(12,14,17,.3); background: var(--surface-2); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-primary {
  color: #f9f9f8;
  border-color: var(--accent);
  background: var(--accent);
}
.btn-primary:hover:not(:disabled) { border-color: var(--accent-deep); background: var(--accent-deep); }
.btn-dark {
  color: #f7f7f5;
  border-color: var(--dark);
  background: var(--dark);
}
.btn-dark:hover:not(:disabled) { color: #f7f7f5; border-color: var(--dark-2); background: var(--dark-2); }
.btn-large { min-height: 54px; padding-inline: 24px; }
.btn-full { width: 100%; }
.btn-text { border-color: transparent; padding-inline: 8px; }

.builder-shell {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(440px, 1.44fr) minmax(430px, .68fr) minmax(218px, .31fr);
  /* 限高：与设计稿一致，让 workflow-panel 内部滚动而非撑开页面（body overflow:hidden） */
  height: calc(100dvh - var(--header-h));
  min-height: 620px;
}

/* ---------- 预览区（浅色摄影棚风格） ---------- */
.preview-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(255,255,255,.62), transparent 43%),
    linear-gradient(145deg, #dbd9d8 0%, #c8c6c5 52%, #bcbab9 100%);
  border-right: 1px solid var(--line);
}
/* 水印：居中、半透明、不拦截交互（浅色背景用深字） */
.wm-watermark { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3; pointer-events: none; user-select: none; color: rgba(12,14,17,.10); font-size: 24px; letter-spacing: .06em; font-weight: 600; white-space: nowrap; }
.preview-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .35;
  background-image:
    linear-gradient(rgba(255,255,255,.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.16) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, transparent, rgba(0,0,0,.28), transparent);
}
/* 价格浮层：一对一复制 rvrn_v7_new 的 .price-ov（变量映射见下） */
.price-ov {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 4;
  background: rgba(10,10,10,.92);
  border: 0.5px solid var(--line-dark, rgba(255,255,255,.12));
  border-radius: 3px;
  padding: 10px 14px;
  min-width: 170px;
  backdrop-filter: blur(8px);
  font-size: 14px;
}
.pov-base { font-size: 14px; color: rgba(255,255,255,.62); margin-bottom: 3px; }
.pov-rows { display: flex; flex-direction: column; gap: 2px; margin-bottom: 5px; }
.pov-row { display: flex; justify-content: space-between; gap: 14px; font-size: 14px; color: #fff; }
.pov-row.add { color: #fff; font-size: 13px; }
.pov-div { height: 0.5px; background: rgba(255,255,255,.14); margin: 4px 0; }
.pov-tot { display: flex; justify-content: space-between; align-items: baseline; }
.pov-tot-lbl { font-size: 12px; color: rgba(255,255,255,.62); text-transform: uppercase; letter-spacing: .07em; }
.pov-tot-val { font-family: "Georgia", "Times New Roman", serif; font-size: 20px; color: #fff; font-variant-numeric: tabular-nums; }

/* tone 徽标（右上角，替代原 prototype-tag/structure-badge 位置）：一对一复制 rvrn .tbadge */
.tbadge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 4;
  display: none;
  padding: 5px 11px;
  background: rgba(10,10,10,.92);
  border: 0.5px solid var(--line-dark, rgba(255,255,255,.12));
  border-radius: 3px;
  font-size: 14px;
  color: var(--accent);
  backdrop-filter: blur(8px);
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  width: max-content;
  max-width: min(260px, 60vw);
  white-space: normal;
  word-break: break-word;
}
.tbadge.show { display: flex; }

/* 每行一个 part：对齐 rvrn_v7_new 的 .tb-line 结构 */
/* 悬挂缩进：tb-part 同行区域先填满，tb-color 超宽换行后缩进 2em */
.tb-line { display: block; padding-left: 2em; text-indent: -2em; min-width: 0; font-size: 13px; line-height: 1.4; text-transform: uppercase; letter-spacing: .03em; }
.tb-prefix { color: #555; }
.tb-part { display: inline; white-space: nowrap; color: rgba(255,255,255,.7); font-weight: 600; }
.tb-color { display: inline; }
.tb-color .tbs, .tb-color .tbs-img { display: inline-block; vertical-align: middle; float: none; margin-right: 4px; }
.tb-color-name { display: inline; color: rgba(255,255,255,.9); }

/* 圆形色点 / cimg 图标（对齐 v7 .tbs / .tbs-img） */
.tbs { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; border: 1px solid rgba(255,255,255,.15); }
.tbs-img { background-size: 100% 100%; background-position: center; background-repeat: no-repeat; border: none; }

/* tone 分隔线 + tone 加价行（对齐 v7 updTone 末尾） */
.tb-divider { display: block; width: 100%; height: 1px; background: rgba(255,255,255,.36); margin: 4px 0 2px; }
.tb-tone { color: #555; font-size: 13px; font-weight: 700; }

/* 画布右下角：型号标签 + 结构徽标（值随 step1/step2 消息动态显示） */
.prototype-tag {
  position: absolute;
  right: 14px;
  bottom: 42px;
  z-index: 4;
  padding: 9px 12px;
  color: #f5f5f3;
  background: rgba(10,10,11,.86);
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.structure-badge {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 3;
  padding: 7px 10px;
  color: #f5f5f3;
  background: rgba(10,10,11,.78);
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.wheel-viewport {
  position: absolute;
  inset: 74px 28px 66px;
  display: grid;
  place-items: center;
  perspective: 1100px;
  touch-action: none;
}
.wheel-image {
  width: min(88%, 900px);
  height: min(88%, 790px);
  object-fit: contain;
  mix-blend-mode: multiply;
  filter: saturate(.88) contrast(1.02);
  transform: rotateY(var(--wheel-rotate, 0deg)) scale(var(--wheel-scale, 1));
  transform-origin: center;
  transition: transform 520ms var(--ease), filter 420ms var(--ease), opacity 240ms var(--ease);
  user-select: none;
  -webkit-user-drag: none;
}
.wheel-image.finish-black { filter: grayscale(1) brightness(.47) contrast(1.22); }
.wheel-image.finish-copper { filter: saturate(1.05) contrast(1.04); }
.concept-wheel {
  display: none;
  position: relative;
  width: min(52vw, 560px);
  aspect-ratio: 1;
  border: 28px solid #1b1b1c;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #c7c5c3 0 8%, transparent 8.5%),
    repeating-conic-gradient(from var(--spoke-angle, 0deg), #bab8b6 0 5deg, transparent 5deg var(--spoke-gap, 28deg)),
    radial-gradient(circle, transparent 0 53%, #9a9897 54% 62%, #c9c7c5 63% 67%, #19191a 68% 100%);
  box-shadow: inset 0 0 0 10px #bbb9b7, 0 28px 45px -35px rgba(0,0,0,.72);
  transform: rotateY(var(--wheel-rotate, 0deg)) scale(var(--wheel-scale, 1));
  transition: transform 520ms var(--ease);
}
.concept-wheel::after {
  content: "PROTOTYPE";
  position: absolute;
  left: 50%;
  bottom: -54px;
  transform: translateX(-50%);
  color: rgba(16,17,18,.58);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: .16em;
}
.concept-wheel.struct-3::before {
  content: "";
  position: absolute;
  inset: 9%;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.34);
  box-shadow: 0 0 0 1px rgba(0,0,0,.26);
}
.concept-wheel.struct-1::before {
  content: "";
  position: absolute;
  inset: 13%;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,.16);
}
.concept-wheel.step-lip {
  background:
    radial-gradient(circle at center, #c7c5c3 0 8%, transparent 8.5%),
    repeating-conic-gradient(from var(--spoke-angle, 0deg), #bab8b6 0 5deg, transparent 5deg var(--spoke-gap, 28deg)),
    radial-gradient(circle, transparent 0 53%, #9a9897 54% 62%, #c9c7c5 63% 67%, #19191a 68% 100%),
    radial-gradient(circle, transparent 0 76%, rgba(255,255,255,.18) 77% 81%, transparent 82%);
}
/* 无真实渲染图时显示概念轮（唯一的功能性覆写，样式本体不变） */
.wheel-viewport .concept-wheel { display: block; }

.preview-caption {
  position: absolute;
  left: 50%;
  bottom: 22px;
  z-index: 4;
  width: min(70%, 600px);
  transform: translateX(-50%);
  text-align: center;
}
.preview-caption strong {
  display: block;
  font-family: "Inter Tight", Inter, sans-serif;
  font-size: 14px;
  font-weight: 600;
}
.preview-caption span {
  display: block;
  margin-top: 4px;
  color: rgba(16,17,18,.58);
  font-size: 11px;
}
.size-control {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 250px;
  min-height: 42px;
  padding: 0 14px;
  color: #f4f4f3;
  background: rgba(10,10,11,.86);
}
.size-control label { color: rgba(255,255,255,.58); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.size-control input { width: 125px; accent-color: var(--accent); }
.size-control output { min-width: 34px; font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 工作流面板 ---------- */
.workflow-panel {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  scrollbar-width: thin;
  scrollbar-color: rgba(12,14,17,.25) transparent;
}
.screen {
  display: none;
  min-height: 100%;
  padding: 38px 28px 112px;
  animation: screen-in 380ms var(--ease) both;
}
.screen.active { display: block; }
@keyframes screen-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.step-kicker {
  margin-bottom: 8px;
  color: var(--ink-3);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.screen h1,
.screen h2 {
  max-width: 520px;
  margin: 0;
  font-family: "Inter Tight", Inter, sans-serif;
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -.025em;
  text-wrap: balance;
}
.screen h1 { font-size: 36px; }
.screen h2 { font-size: 31px; }
.lead {
  max-width: 520px;
  margin: 14px 0 0;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.65;
  text-wrap: pretty;
}
.info-note {
  margin: 22px 0 0;
  padding: 15px 16px;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.6;
}
.info-note strong { color: var(--ink); }

/* ---------- 路径卡（start 屏） ---------- */
.path-grid { display: grid; gap: 14px; margin-top: 30px; }
.path-card {
  position: relative;
  width: 100%;
  min-height: 132px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 22px;
  padding: 24px 26px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(31,20,20,.04);
  transition: border-color 220ms var(--ease), background 220ms var(--ease), transform 220ms var(--ease);
}
.path-card:hover { border-color: rgba(208,10,7,.5); background: var(--accent-soft); transform: translateY(-2px); }
.path-card.primary { color: #f7f7f5; border-color: var(--dark); background: var(--dark); }
.path-card.primary:hover { border-color: var(--accent); background: #171010; }
.path-card small {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.path-card.primary small { color: #ff5751; }
.path-card strong { display: block; font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.path-card p { max-width: 400px; margin: 8px 0 0; color: var(--ink-2); font-size: 12.5px; line-height: 1.5; }
.path-card.primary p { color: rgba(255,255,255,.66); }
.path-arrow { font-size: 26px; font-weight: 300; transition: transform 220ms var(--ease); }
.path-card:hover .path-arrow { transform: translateX(4px); }
.model-search-row { margin-top: 24px; }
.model-search-row input { font-family: "JetBrains Mono", monospace; }

/* ---------- 表单字段 ---------- */
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; margin-top: 28px; }
.field { display: grid; gap: 8px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 600; }
.field label .required { color: var(--accent); }
.field select,
.field input[type="search"],
.field input[type="text"] {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  appearance: none;
  transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}
.field select {
  background-image: linear-gradient(45deg, transparent 50%, #777 50%), linear-gradient(135deg, #777 50%, transparent 50%);
  background-position: calc(100% - 19px) 21px, calc(100% - 14px) 21px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.field select:focus,
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.field .help { color: var(--ink-3); font-size: 11px; line-height: 1.45; }
.error-text { display: none; color: var(--danger); font-size: 11px; }
.field.invalid .error-text { display: block; }
.field.invalid select, .field.invalid input { border-color: var(--danger); }

/* ---------- 筛选条 / 设计卡（design 屏） ---------- */
.filter-strip { display: flex; gap: 8px; margin: 22px -2px 16px; padding: 2px; overflow-x: auto; scrollbar-width: none; }
.filter-strip[hidden] { display: none; }   /* 修复：hidden 不被 display:flex 覆盖（Start with my ride 分支隐藏） */
.filter-strip[hidden] + .design-search { margin-top: 24px; }   /* 隐藏后补偿标题与搜索框的上下间隙 */
.filter-strip::-webkit-scrollbar { display: none; }
.filter-chip {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.filter-chip.active { color: #f8f8f6; border-color: var(--dark); background: var(--dark); }
.construction-seg {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.construction-opt {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: border-color 180ms var(--ease), background 180ms var(--ease), color 180ms var(--ease);
}
.construction-opt:hover { border-color: rgba(12,14,17,.3); }
.construction-opt.selected { color: #f8f8f6; border-color: var(--dark); background: var(--dark); }
.design-search { margin-bottom: 14px; }
.design-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 11px;
  /* 限高：grid 内部滚动，保证下方 panel-actions 在首屏高度内可点 */
  max-height: 640px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(12,14,17,.25) transparent;
}
.design-card {
  position: relative;
  min-height: 212px;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  transition: border-color 180ms var(--ease), transform 180ms var(--ease), box-shadow 180ms var(--ease);
}
.design-card:hover { transform: translateY(-2px); border-color: rgba(12,14,17,.32); box-shadow: var(--shadow); }
.design-card.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.design-thumb {
  position: relative;
  /* 800x800 截图按正方形展示，避免横向裁切轮毂上下缘 */
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #d5d3d2;
}
.design-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  mix-blend-mode: multiply;
  transition: transform 260ms var(--ease);
}
/* 有 glb_img 截图时隐藏 mini-wheel 占位（截图加载失败则由 onerror 反向显示） */
.design-thumb img + .mini-wheel { display: none; }
.design-card:hover img { transform: scale(1.03); }
.mini-wheel {
  width: 104px;
  aspect-ratio: 1;
  border: 10px solid #1d1d1e;
  border-radius: 50%;
  background:
    radial-gradient(circle, #b6b4b2 0 10%, transparent 11%),
    repeating-conic-gradient(from var(--mini-angle,0deg), #aaa8a6 0 6deg, transparent 6deg var(--mini-gap,32deg)),
    radial-gradient(circle, transparent 0 54%, #aaa8a6 55% 65%, #202021 66% 100%);
  box-shadow: inset 0 0 0 4px #c7c5c3;
}
.design-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 6px 7px;
  color: #f8f8f7;
  background: rgba(10,10,11,.82);
  font-family: "JetBrains Mono", monospace;
  font-size: 8px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.design-copy { display: grid; gap: 5px; padding: 13px 14px 14px; margin-top: auto; }
.design-copy strong { font-size: 13px; }
.design-copy span { color: var(--ink-3); font-family: "JetBrains Mono", monospace; font-size: 9px; letter-spacing: .05em; }

/* ---------- 区块 / 选项（construction / finish 屏） ---------- */
.section-block { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.section-block:first-of-type { margin-top: 24px; }
.section-title { margin-bottom: 13px; font-size: 11px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.option-stack { display: grid; gap: 9px; }
.option-row {
  width: 100%;
  min-height: 66px;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
}
.option-row.selected { border-color: var(--accent); background: var(--accent-soft); }
.swatch { width: 30px; height: 30px; border: 1px solid rgba(12,14,17,.18); border-radius: 50%; }
.swatch-silver { background: linear-gradient(135deg,#777,#eee 44%,#aaa 72%,#f7f7f7); }
.swatch-copper { background: linear-gradient(135deg,#71421e,#de9b57 45%,#855128 78%); }
.swatch-black { background: linear-gradient(135deg,#0d0d0e,#3f3f40); }
.construction-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
}
.option-row.selected .construction-icon { border-color: var(--accent); color: var(--accent); }
.option-name strong { display: block; font-size: 12px; }
.option-name span { display: block; margin-top: 3px; color: var(--ink-3); font-size: 10px; }
.option-price { color: var(--ink-2); font-family: "JetBrains Mono", monospace; font-size: 10px; }
.range-row { display: grid; grid-template-columns: 110px 1fr 52px; align-items: center; gap: 12px; margin: 15px 0; }
.range-row label { font-size: 11px; font-weight: 600; }
.range-row input { width: 100%; accent-color: var(--accent); }
.range-row output { font-family: "JetBrains Mono", monospace; font-size: 10px; text-align: right; }

/* ---------- 双选卡（details 屏 / lip profile） ---------- */
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-top: 24px; }
.detail-choice {
  min-height: 98px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 15px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
}
.detail-choice.selected { border-color: var(--accent); background: var(--accent-soft); }
.detail-choice strong { font-size: 12px; }
.detail-choice span { color: var(--ink-3); font-size: 10px; line-height: 1.4; }

/* ---------- 汇总卡（review 屏） ---------- */
.review-card { margin-top: 24px; border: 1px solid var(--line); background: var(--surface); }
.review-row { display: grid; grid-template-columns: 124px 1fr auto; gap: 12px; align-items: center; padding: 15px 16px; border-bottom: 1px solid var(--line); }
.review-row:last-child { border-bottom: 0; }
.review-row span { color: var(--ink-3); font-size: 11px; }
.review-row strong { font-size: 12px; font-weight: 600; }
.review-row .rr-item { display: block; padding-left: 1em; text-indent: -1em; line-height: 1.3; }
.review-row .rr-item + .rr-item { margin-top: 4px; }
.review-row .rr-part { display: inline; white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--ink-1); }
.review-row .rr-color { display: inline; font-size: 12px; color: var(--ink-3); }
.review-row .rr-part + .rr-color { margin-left: 4px; }
.review-row button { border: 0; background: transparent; color: var(--accent); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.check-card { margin-top: 14px; padding: 16px; border: 1px solid rgba(40,100,72,.24); background: rgba(40,100,72,.06); }
.check-card strong { display: block; color: var(--success); font-size: 12px; }
.check-card p { margin: 5px 0 0; color: var(--ink-2); font-size: 11px; line-height: 1.5; }

/* ---------- 底部操作栏 ---------- */
.panel-actions {
  position: sticky;
  left: 0;
  bottom: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 34px -28px -112px;
  padding: 15px 28px 18px;
  background: rgba(250,250,250,.93);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.panel-actions .btn-primary,
.panel-actions .btn-dark { margin-left: auto; }

/* ---------- 右侧步骤条 ---------- */
.step-rail {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  background: var(--surface-2);
  border-left: 1px solid var(--line);
}
.step-list { display: grid; }
.step-item {
  position: relative;
  width: 100%;
  min-height: 104px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 18px 19px 18px 25px;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}
.step-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
}
.step-item.active { background: var(--surface); }
.step-item.active::before { background: var(--accent); }
.step-number { color: var(--ink-3); font-family: "JetBrains Mono", monospace; font-size: 9px; letter-spacing: .13em; text-transform: uppercase; }
.step-item.active .step-number { color: var(--accent); }
.step-item.done .step-number { color: var(--success); }
.step-label { font-size: 12px; font-weight: 650; }
.step-description { color: var(--ink-3); font-size: 10px; line-height: 1.45; }

/* ---------- 移动端进度条 ---------- */
.mobile-progress {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.mobile-progress strong { flex: 0 0 auto; color: var(--accent); font-family: "JetBrains Mono", monospace; font-size: 10px; }
.progress-track { flex: 1; height: 3px; background: var(--surface-3); }
.progress-fill { width: 20%; height: 100%; background: var(--accent); transition: width 300ms var(--ease); }
.mobile-progress span { flex: 0 0 auto; color: var(--ink-3); font-size: 10px; }

/* ---------- 对话框 ---------- */
dialog {
  width: min(460px, calc(100vw - 32px));
  padding: 0;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  box-shadow: 0 40px 90px -50px rgba(20,20,20,.66);
}
dialog::backdrop { background: rgba(9,9,10,.58); backdrop-filter: blur(3px); }
.dialog-body { padding: 28px; }
.dialog-body h3 { margin: 0; font-family: "Inter Tight",Inter,sans-serif; font-size: 24px; }
.dialog-body p { margin: 13px 0 0; color: var(--ink-2); font-size: 13px; line-height: 1.65; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 28px 20px; border-top: 1px solid var(--line); }

/* ---------- 轻提示 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 80;
  min-width: 280px;
  max-width: calc(100vw - 32px);
  padding: 14px 18px;
  color: #f6f6f4;
  background: var(--dark);
  border: 1px solid var(--line-dark);
  transform: translate(-50%, 150%);
  opacity: 0;
  transition: transform 280ms var(--ease), opacity 280ms var(--ease);
  font-size: 12px;
  text-align: center;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- 全局 loading 遮罩（参考 rvrn_v7_new：覆盖整个 builder 窗口） ---------- */
.loading-mask {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(8, 8, 8, .55);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: all;
  cursor: wait;
}
.loading-mask.show {
  display: flex;
}
.loading-mask .lm-spinner {
  width: 36px;
  height: 36px;
  border: 2.5px solid rgba(255, 255, 255, .16);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: lm-spin .8s linear infinite;
}
@keyframes lm-spin {
  to { transform: rotate(360deg); }
}

/* ---------- 响应式 ---------- */
@media (max-width: 1280px) {
  .builder-shell { grid-template-columns: minmax(350px, 1.1fr) minmax(380px, .85fr) minmax(132px, .22fr); }
  .step-item { min-height: 80px; padding: 13px 12px 13px 18px; }
  .step-description { display: none; }
  .screen { padding-top: 30px; }
}

@media (max-width: 840px) {
  body { overflow: auto; }
  .app { min-height: 100dvh; grid-template-rows: 64px auto auto; }
  .builder-shell { height: auto; min-height: 0; }
  .step-rail { display: none; }
  .mobile-progress { display: flex; }
  .topbar { height: 64px; padding: 0 14px; }
  .brand-lockup { gap: 10px; }
  .brand-lockup img { width: 34px; height: 34px; }
  .brand-divider { height: 28px; }
  .brand-title strong { font-size: 13px; }
  .brand-title span { display: none; }
  .top-actions .reset-button { display: none; }
  .top-actions .btn { min-height: 40px; padding-inline: 10px; font-size: 9px; }
  .builder-shell { display: block; }
  .preview-stage { height: 42dvh; min-height: 330px; border-right: 0; border-bottom: 1px solid var(--line); }
  .wheel-viewport { inset: 56px 18px 42px; }
  .wheel-image { width: min(85%, 520px); height: min(88%, 460px); }
  .preview-meta { top: 10px; left: 10px; min-width: 150px; padding: 10px 11px; }
  .preview-meta-label { font-size: 10px; padding-bottom: 7px; }
  .preview-price { padding-top: 7px; }
  .preview-price strong { font-size: 18px; }
  .prototype-tag { top: 10px; right: 10px; padding: 7px 8px; font-size: 7px; }
  .size-control { display: none; }
  .preview-caption { bottom: 10px; }
  .preview-caption span { display: none; }
  .workflow-panel { overflow: visible; }
  .screen { min-height: auto; padding: 28px 18px 100px; }
  .screen h1 { font-size: 31px; }
  .screen h2 { font-size: 27px; }
  .path-card { min-height: 116px; padding: 18px; }
  .path-card p { display: none; }
  .field-grid, .design-grid, .detail-grid { grid-template-columns: 1fr; }
  /* 移动端 panel-actions 为 fixed 底栏：网格滚到底时留出底栏高度，尾行/分页不被盖住 */
  .design-grid { padding-bottom: 96px; }
  .field.full { grid-column: auto; }
  .panel-actions { position: fixed; left: 0; right: 0; z-index: 40; margin: 0; padding: 11px 14px calc(11px + env(safe-area-inset-bottom)); }
  .panel-actions .btn { min-height: 46px; }
  .design-card { min-height: 196px; }
  /* 正方形截图随列宽自适应，无需覆盖高度 */
  .design-thumb { min-height: 0; }
  .review-row { grid-template-columns: 100px 1fr auto; }
  .concept-wheel { width: min(58vw, 280px); border-width: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ============================================================
 * 新增：design 屏分页 + 空状态（流程改造配套，风格沿用设计稿按钮体系）
 * ============================================================ */
.design-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 24px 0 6px;
}
.design-pagination .btn {
  min-width: 64px;
  padding: 9px 16px;
  font-size: 12px;
}
.design-pagination .btn[disabled] {
  opacity: .35;
  cursor: not-allowed;
}
.page-info {
  font: 500 12px/1 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink-2);
  letter-spacing: .06em;
  min-width: 48px;
  text-align: center;
}

/* design 屏（桌面端 ≥841px）：flex 列布局 —— 网格吃满剩余高度并内部滚动，
   panel-actions / design-pagination 留在流内，不再被 sticky 悬浮操作栏盖住尾行 */
@media (min-width: 841px) {
  .screen[data-screen="design"].active {
    display: flex;
    flex-direction: column;
    min-height: 100%;
  }
  .screen[data-screen="design"] .design-grid {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
  }
}
.design-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--ink-3);
  font-size: 13px;
  padding: 36px 0;
}

/* 新增：构造/滑块不可用态（model 不支持 piece / concave / lip 时灰显） */
.option-row[disabled] {
  opacity: .38;
  cursor: not-allowed;
  pointer-events: none;
}
.range-row.disabled {
  opacity: .38;
}
.range-row.disabled input[type="range"] {
  cursor: not-allowed;
}

/* 新增：搜索框 + 按钮组合（quickModelSearch / designSearch） */
.search-bar {
  display: flex;
  gap: 10px;
}
.search-bar input {
  flex: 1;
  min-width: 0;
}
.search-bar .btn {
  flex: 0 0 auto;
  min-height: 42px;
  padding-inline: 18px;
}

/* ============================================================
 * 新增：步骤3 Finish / 步骤4 Details / 步骤5 Review
 * （参考 rvrn_v7_new 的 finish/accessories/review 形态）
 * ============================================================ */

/* ---------- per-part 手风琴（finish/details 共用） ---------- */
.finish-stack {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fpart {
  border: 1px solid var(--line);
  background: var(--surface);
}
.fpart-head {
  width: 100%;
  display: grid;
  grid-template-columns: 34px 1fr auto 16px;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.fpart-swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, #8a8a86, #d8d8d2 45%, #9c9c96);
}
.fpart-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.fpart-status {
  font-size: 10px;
  color: var(--ink-3);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}
.fpart-chevron {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--ink-2);
  border-bottom: 1.5px solid var(--ink-2);
  transform: rotate(-45deg);
  transition: transform .18s ease;
}
.fpart.open .fpart-chevron {
  transform: rotate(45deg);
}
.fpart-body {
  display: none;
  padding: 0 14px 16px;
  border-top: 1px solid var(--line);
}
.fpart.open .fpart-body {
  display: block;
  padding-top: 14px;
}
.fpart-body .section-title {
  margin: 14px 0 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-3);
}

/* ---------- surface treatment 网格（fc） ---------- */
/* 响应式：大屏一行最多 4 个，随分辨率降为 3 个，最小分辨率不少于 3 个/行 */
.fc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
@media (max-width: 1100px) {
  .fc-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.fc {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  background: #fff;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.fc:hover {
  border-color: var(--accent);
}
.fc.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.fc-swatch {
  width: 100%;
  height: 46px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.fc-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
}
.fc-price {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
}
.fc-price.fc-free {
  background: var(--line);
  color: var(--ink-2);
}
/* grid 底部描述控件：动态显示当前选中 treatment 的说明 */
.fc-desc-panel {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: #f7f7f5;
  font-size: 10px;
  line-height: 1.55;
  color: var(--ink-2);
}
.fc-desc-panel-label {
  display: block;
  margin-bottom: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-3);
}
.fc-desc-panel.empty .fc-desc-panel-text {
  color: var(--ink-3);
  font-style: italic;
}
/* 通用隐藏：供 csw-grid / grad-grid / cc-panel 等切换显示使用 */
.hidden {
  display: none !important;
}

/* ---------- colour 网格（csw） ---------- */
.csw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 8px;
}
.csw,
.grad-swatch {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  text-align: left;
}
.csw:hover,
.grad-swatch:hover {
  border-color: var(--accent);
}
.csw.selected,
.grad-swatch.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.csw-dot {
  display: inline-block;   /* 关键：span 默认 inline，width/height 不生效会把圆点塌缩成细条 */
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, .12);
}
.csw-name {
  font-size: 10px;
  color: var(--ink-2);
  line-height: 1.2;
}

/* ---------- 开关行（gradient / custom） ---------- */
.f-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 4px;
}
.f-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}
.f-price {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
}
.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex: 0 0 auto;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch .track {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  background: var(--line);
  transition: background .15s ease;
  cursor: pointer;
}
.switch .track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .15s ease;
}
.switch input:checked + .track {
  background: var(--accent);
}
.switch input:checked + .track::after {
  transform: translateX(16px);
}

/* ---------- 渐变颜色 / 自定义面板 ---------- */
.grad-grid {
  display: grid;
  /* 渐变卡列数 = 卡片实际数量（auto-fit 折叠空轨道），每列 1fr 拉伸铺满整行：
     2 个卡 → 2 列铺满、3 个 → 3 列铺满、4 个 → 4 列铺满；
     最多 4 列（min 88px）、最少 2 列（容器 <184px 时下限 50%-4px） */
  grid-template-columns: repeat(auto-fit, minmax(min(50% - 4px, 88px), 1fr));
  gap: 8px;
  /* 兼容两种隐藏形态：新版 JS 渲染 hidden 类；旧版渲染 hidden 属性——
     UA 的 [hidden]{display:none} 会被本规则 display:grid 覆盖，需显式兜底 */
}
.grad-grid[hidden] { display: none !important; }

/* 渐变颜色卡：外观对齐 solid 普通色卡 .csw（矩形卡片 + 圆形 dot） */
/* 渐变卡内的色点：与普通色卡 .csw-dot 一致（flex 布局下 dot+name 左右排列），
   差异仅在渐变图拉伸铺满圆形（对齐 rvrn 的 rvrn-grad-color-swatch） */
.grad-swatch .csw-dot {
  display: inline-block;   /* 关键：span 默认 inline，宽高不生效会塌缩成细条 */
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, .12);
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
}
.grad-swatch .csw-name {
  flex: 1;
  min-width: 0;                /* 长标题在圆点右侧折行，不撑破卡片 */
}
.grad-swatch:hover {
  border-color: var(--accent);
}
.grad-swatch.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
/* 渐变卡内的色点：圆形，cimg 渐变图拉伸铺满圆形（对齐 rvrn 的 rvrn-grad-color-swatch） */
.grad-swatch .csw-dot {
  display: inline-block;   /* 关键：span 默认 inline，宽高不生效会塌缩成细条 */
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, .12);
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
}
.cc-panel {
  margin-top: 8px;
  padding: 10px;
  border: 1px dashed var(--line);
  background: #fafafa;
}
/* ---------- custom colour 调色板（对齐 rvrn_v7_new 的 cc-picker） ---------- */
.cc-panel__lbl {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.cc-picker-wrap {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  cursor: crosshair;
  user-select: none;
  background: #f5f5f5;
  border: 1px solid var(--line);
}
.cc-picker-sl {
  display: block;
  width: 100%;
  height: auto;
}
.cc-picker-hue-wrap {
  position: relative;
  display: block;
  width: 100%;
  height: 28px;
  margin-top: 1px;
}
.cc-picker-hue {
  display: block;
  width: 100%;
  height: 28px;
}
.cc-picker-cursor {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 1px 4px rgba(0, 0, 0, .35);
  pointer-events: none;
  transform: translate(-50%, -50%);
  display: none;
  z-index: 2;
}
.cc-picker-hue-cursor {
  position: absolute;
  top: 50%;
  width: 4px;
  height: 28px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .4);
  box-shadow: 0 0 2px rgba(0, 0, 0, .4);
  pointer-events: none;
  transform: translate(-50%, -50%);
  display: none;
  z-index: 2;
}
.cc-hex-display {
  margin: 8px 0 10px;
  font: 700 12px/1.4 'JetBrains Mono', ui-monospace, Menlo, monospace;
  letter-spacing: .08em;
  text-align: center;
  color: var(--ink);
}
.cc-input-lbl {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-2);
}
.cc-required {
  margin-left: 2px;
  color: var(--accent);
}
.cc-input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #fff;
  font: 500 11px/1.4 'JetBrains Mono', ui-monospace, Menlo, monospace;
  color: var(--ink);
  box-sizing: border-box;
}
.cc-input:focus {
  border-color: var(--accent);
  outline: none;
}
.cc-input::placeholder {
  color: var(--ink-3);
}
.cc-actions {
  display: block;
  margin-top: 10px;
}
.cc-btn {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--dark);
  border-radius: 0;
  background: var(--dark);
  color: #fff;
  font: 700 10px/1 'Inter Tight', Inter, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  box-sizing: border-box;
  transition: all .14s ease;
}
.cc-btn:hover {
  background: #333;
  border-color: #333;
}
.cc-btn--help {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}
.cc-btn--help:hover {
  background: #f5f5f4;
  border-color: var(--ink-3);
}
/* 校验错误态（Paint Name 未填 / 未取色） */
.cc-input--error {
  border-color: #e84a4a !important;
  box-shadow: 0 0 0 2px rgba(232, 74, 74, .25);
  background: #fff6f6;
}
.cc-hex-display--error {
  color: #e84a4a;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- 步骤5 价格明细卡 ---------- */
.price-card {
  margin-top: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.price-head {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-3);
}
.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  color: var(--ink-2);
}
.price-row:last-child {
  border-bottom: 0;
}
.price-row strong {
  font-size: 12px;
  color: var(--ink);
  white-space: nowrap;
}
.price-row.sub {
  padding-left: 34px;
  color: var(--ink-3);
}
.price-row.total {
  background: var(--accent-soft);
}
.price-row.total strong {
  color: var(--accent);
}
.price-row.grand {
  border-top: 2px solid var(--ink);
}
.price-row.grand strong {
  font-size: 14px;
}

/* review 补充 */
.review-sub {
  font-size: 10px;
  color: var(--ink-3);
  font-weight: 400;
}
.review-missing {
  font-style: normal;
  color: var(--ink-3);
}

/* ---------- 3D 画布（wheel-3d.js 挂载） ---------- */
.glb-stage {
  position: absolute;
  inset: 0;
  z-index: 2;
}
.glb-stage[hidden] {
  display: none;
}
.glb-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;   /* 允许在画布上拖拽旋转，不触发页面滚动 */
}

/* ---------- 规则锁定：灰化不可选项 ---------- */
.fc-bl,
.csw-bl {
  opacity: .38;
  cursor: not-allowed;
  filter: grayscale(1);
}
.fc-bl:hover,
.csw-bl:hover {
  border-color: var(--line);
  box-shadow: none;
}
.fc-bl .fc-price,
.csw-bl .csw-name {
  color: var(--ink-3);
}

/* 渐变/自定义开启时：其余工艺变灰不可修改（与 rvrn_v7_new 一致） */
.fc-grad-locked {
  opacity: .22;
  cursor: not-allowed;
}
.fc-grad-locked:hover {
  border-color: var(--line);
  box-shadow: none;
}
.locked-note {
  font-style: normal;
  color: var(--ink-3);
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* 移动端窄屏：fc 网格最少 3 列、手风琴头紧凑 */
@media (max-width: 480px) {
  .fc-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .fpart-head {
    grid-template-columns: 30px 1fr auto 12px;
    gap: 8px;
    padding: 12px;
  }
  .fpart-swatch {
    width: 30px;
    height: 30px;
  }
  .fpart-status {
    max-width: 120px;
  }
}

/* ── workflow-panel 左侧收缩按钮（PC grid 布局） ── */
.builder-shell {
  position: relative;
}
.preview-stage { grid-column: 1; grid-row: 1; }
.workflow-panel { grid-column: 2; grid-row: 1; }
.step-rail { grid-column: 3; grid-row: 1; }
#panelCollapse {
  position: relative;
  z-index: 6;
  grid-column: 2;
  grid-row: 1;
  justify-self: start;
  align-self: center;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(12, 14, 17, .16);
  color: var(--ink-3);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: color .15s ease, box-shadow .15s ease, border-color .15s ease;
}
#panelCollapse:hover {
  color: var(--ink);
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(12, 14, 17, .22);
}

/* 收缩态：workflow-panel 折叠，preview 与 step-rail 直接相邻 */
body.panel-collapsed .workflow-panel { display: none; }
body.panel-collapsed .builder-shell {
  grid-template-columns: minmax(440px, 1fr) 0 minmax(218px, .31fr);
}
body.panel-collapsed #panelCollapse { grid-column: 2; }

@media (max-width: 840px) {
  #panelCollapse { display: none; }
}

/* ============================================================
 * Ask Expert 响应表单（Get Your RVRN Design Reviewed）
 * 参考 rvrn_v7_new 的 rvrn-dr 模态框：表单视图 / 成功视图双视图
 * ============================================================ */
#mo-expert {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 40px 16px;
  background: rgba(9, 9, 10, .62);
  backdrop-filter: blur(4px);
}
#mo-expert.is-open { display: flex; }
.dr-wrap {
  position: relative;
  width: 100%;
  max-width: 760px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
}
.dr-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 5;
  border: none;
  background: none;
  color: var(--ink-3);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.dr-container,
.dr-success-container {
  padding: 40px 48px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
}
.dr-header { margin-bottom: 32px; }
.dr-title {
  margin: 0 0 10px;
  font-family: "Inter Tight", Inter, sans-serif;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.02em;
  color: var(--ink);
}
.dr-description {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-2);
}
.dr-row { display: flex; gap: 24px; margin-bottom: 20px; }
.dr-row .dr-field { flex: 1 1 0; min-width: 0; }
.dr-field { display: flex; flex-direction: column; margin-bottom: 20px; }
.dr-field--full { width: 100%; margin-bottom: 26px; }
.dr-label {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}
.dr-input,
.dr-textarea {
  width: 100%;
  padding: 8px 0;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  outline: none;
  -webkit-appearance: none;
  transition: border-color .2s ease;
}
.dr-input:focus,
.dr-textarea:focus { border-bottom-color: var(--ink); }
.dr-input--error,
.dr-textarea--error { border-bottom-color: var(--accent); }
.dr-error-text {
  display: none;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--accent);
}
.dr-field--error .dr-error-text { display: block; }
.dr-asterisk { color: var(--accent); font-style: normal; }
.dr-input::placeholder,
.dr-textarea::placeholder { color: var(--ink-3); font-size: 13px; }
.dr-textarea { resize: vertical; min-height: 100px; }
.dr-radios { display: flex; flex-wrap: wrap; gap: 10px 32px; margin-top: 4px; }
.dr-radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}
.dr-radio input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.dr-radio-mark {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1.5px solid #d1d5db;
  border-radius: 50%;
  background: #fff;
  transition: all .15s ease;
}
.dr-radio input:checked + .dr-radio-mark { border-color: var(--ink); }
.dr-radio input:checked + .dr-radio-mark::after {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
}
.dr-radio-text { font-size: 14px; font-weight: 500; color: var(--ink); }
.dr-checkboxes { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 4px; }
.dr-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}
.dr-checkbox input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; }
.dr-checkbox-mark {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1.5px solid #d1d5db;
  border-radius: 3px;
  background: #fff;
  transition: all .15s ease;
}
.dr-checkbox input:checked + .dr-checkbox-mark {
  background: var(--accent);
  border-color: var(--accent);
}
.dr-checkbox input:checked + .dr-checkbox-mark::after {
  content: '';
  display: block;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-1px);
}
.dr-checkbox-text { font-size: 14px; color: var(--ink); }
.dr-camera-icon {
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
  color: var(--ink-3);
}
.dr-file-wrapper { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.dr-file-input { display: none; }
.dr-file-btn {
  display: inline-block;
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.dr-file-btn:hover { background: var(--surface-3); border-color: #d1d5db; }
.dr-file-name { font-size: 13px; color: var(--ink-2); }
.dr-actions { display: flex; justify-content: flex-end; margin-top: 28px; }
.dr-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 36px;
  border: none;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-family: "Inter Tight", Inter, sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
  cursor: pointer;
  transition: background .2s ease, transform .1s ease;
}
.dr-submit:hover { background: var(--accent-deep); }
.dr-submit:active { transform: scale(.98); }
.dr-submit:disabled { opacity: .6; cursor: default; }
.dr-success-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.dr-success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin-bottom: 24px;
  border-radius: 50%;
  color: var(--success);
}
.dr-success-title {
  margin: 0 0 14px;
  font-family: "Inter Tight", Inter, sans-serif;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.02em;
  color: var(--ink);
}
.dr-success-description {
  max-width: 460px;
  margin-bottom: 28px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-2);
}
.dr-success-help {
  width: 100%;
  max-width: 460px;
  margin-bottom: 32px;
  padding: 16px 24px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.dr-success-help-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.dr-success-help-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
}
.dr-success-help-text a { color: var(--accent); text-decoration: none; font-weight: 500; }
.dr-success-help-text a:hover { text-decoration: underline; }
.dr-success-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.dr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 32px;
  border: 1.5px solid transparent;
  border-radius: 4px;
  font-family: "Inter Tight", Inter, sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
  cursor: pointer;
  transition: all .2s ease;
}
.dr-btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.dr-btn--primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.dr-btn--secondary { background: #fff; border-color: var(--line); color: var(--ink); }
.dr-btn--secondary:hover { background: var(--surface-2); border-color: #d1d5db; }

@media (max-width: 680px) {
  .dr-container, .dr-success-container { padding: 28px 20px; }
  .dr-row { flex-direction: column; gap: 0; }
  .dr-title { font-size: 22px; }
  .dr-actions { justify-content: stretch; }
  .dr-submit { width: 100%; }
  .dr-checkboxes { flex-direction: column; gap: 8px; }
  .dr-success-actions { flex-direction: column; width: 100%; }
  .dr-btn { width: 100%; }
}
