/* =========================================================
   3D 参数化预览页 · 沿用站点黑白灰设计规范
   ========================================================= */
:root{ --hd:72px; }

body.p3d-page{
  height:100vh; height:100svh; overflow:hidden;
  background:#F7F7F8;
}
.p3d-stage{ position:fixed; top:var(--hd); left:0; right:0; bottom:0; }
#viewport{ position:absolute; inset:0; }
#viewport canvas{ display:block; outline:none; }

/* ---------- 浮层基础 ---------- */
.p3d-badge,.p3d-toolbar,.p3d-fab,.p3d-stats,.p3d-loading,.p3d-panel{
  position:absolute; z-index:20;
  background:rgba(255,255,255,.94);
  backdrop-filter:blur(14px) saturate(170%);
  -webkit-backdrop-filter:blur(14px) saturate(170%);
  border:1px solid var(--line); border-radius:14px;
  box-shadow:0 10px 30px rgba(0,0,0,.08);
  color:var(--ink);
}
.hidden{ display:none !important; }
.acc{ color:var(--ink) !important; font-weight:700; font-variant-numeric:tabular-nums; }

/* ---------- 左上：标题卡 ---------- */
.p3d-badge{
  top:20px; left:24px; display:flex; align-items:center; gap:12px;
  padding:12px 18px 12px 14px; max-width:min(430px, calc(100vw - 130px));
}
.p3d-ico{
  width:38px; height:38px; border-radius:10px; flex:0 0 auto;
  background:#0B0B0D; color:#fff; display:grid; place-items:center;
  box-shadow:0 4px 12px rgba(0,0,0,.18);
}
.p3d-ico svg{ width:20px; height:20px; }
.p3d-badge .eyebrow{ font-size:9.5px; letter-spacing:.2em; gap:6px; color:var(--ink-4); }
.p3d-badge .eyebrow::before{ width:12px; height:1.5px; }
.p3d-badge h1{
  margin:4px 0 0; font-size:15.5px; font-weight:700; letter-spacing:-.01em;
  line-height:1.35; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.p3d-badge p{
  margin:2px 0 0; font-size:11.5px; color:var(--ink-4); letter-spacing:.01em;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}

/* ---------- 顶部工具条 ---------- */
.p3d-toolbar{
  top:20px; left:50%; transform:translateX(-50%);
  display:flex; align-items:center; gap:10px; padding:8px 10px;
}
.p3d-toolbar .chips{ flex-wrap:nowrap; gap:6px; }
.p3d-toolbar .chip{ height:30px; padding:0 12px; font-size:12.5px; }
.p3d-vdiv{ width:1px; height:20px; background:var(--line); margin:0 2px; flex:0 0 auto; }

.p3d-mini{
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  height:30px; padding:0 12px; border-radius:7px; cursor:pointer;
  border:1px solid var(--line); background:#fff; color:var(--ink-2);
  font-family:inherit; font-size:12.5px; font-weight:500; white-space:nowrap;
  transition:background .2s, border-color .2s, color .2s, transform .15s;
}
.p3d-mini:hover{ border-color:#C4C4CB; color:var(--ink); }
.p3d-mini:active{ transform:scale(.97); }
.p3d-mini.on{ background:#0B0B0D; border-color:#0B0B0D; color:#fff; box-shadow:0 6px 16px rgba(0,0,0,.18); }
.p3d-mini svg{ width:13px; height:13px; flex:0 0 auto; }

/* ---------- 折叠按钮 ---------- */
.p3d-fab{
  top:20px; right:24px; width:42px; height:42px; border-radius:11px;
  display:grid; place-items:center; cursor:pointer; padding:0;
  transition:transform .2s var(--ease), box-shadow .25s;
}
.p3d-fab:hover{ transform:scale(1.04); box-shadow:0 12px 28px rgba(0,0,0,.12); }
.p3d-fab svg{ width:18px; height:18px; }

/* ---------- 左下：统计卡 ---------- */
.p3d-stats{ bottom:20px; left:24px; padding:12px 16px 11px; min-width:308px; }
.p3d-stats-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:2px 20px; }
.p3d-stats-grid span{
  display:block; font-size:9.5px; letter-spacing:.13em; text-transform:uppercase;
  color:var(--ink-4); font-weight:600; line-height:1.6;
}
.p3d-stats-grid b{
  display:block; font-size:14.5px; font-weight:700; letter-spacing:-.015em;
  font-variant-numeric:tabular-nums; line-height:1.45;
}
.p3d-stats-foot{
  display:flex; align-items:center; justify-content:space-between; gap:14px;
  margin-top:9px; padding-top:8px; border-top:1px solid var(--line);
  font-size:11px; color:var(--ink-4);
}
.p3d-stats-foot span:last-child{ font-variant-numeric:tabular-nums; font-weight:600; color:var(--ink-3); }

/* ---------- 右侧参数面板 ---------- */
.p3d-panel{
  top:76px; right:24px; bottom:20px; width:344px;
  display:flex; flex-direction:column; overflow:hidden;
  transition:transform .3s cubic-bezier(.22,1,.36,1), opacity .22s ease;
}
.p3d-panel.collapsed{ transform:translateX(calc(100% + 32px)); opacity:0; pointer-events:none; }
.p3d-panel-head{
  flex:0 0 auto; display:flex; align-items:flex-start; justify-content:space-between; gap:12px;
  padding:14px 16px 12px; border-bottom:1px solid var(--line);
}
.p3d-panel-head .eyebrow{ font-size:9.5px; letter-spacing:.2em; color:var(--ink-4); }
.p3d-panel-head .eyebrow::before{ width:12px; height:1.5px; }
.p3d-panel-head h2{ margin:4px 0 0; font-size:15px; font-weight:700; letter-spacing:-.01em; }
.p3d-panel-body{
  flex:1; overflow-y:auto; overscroll-behavior:contain;
  padding:16px; display:flex; flex-direction:column; gap:18px;
}
.p3d-panel-body::-webkit-scrollbar{ width:5px; }
.p3d-panel-body::-webkit-scrollbar-track{ background:transparent; }
.p3d-panel-body::-webkit-scrollbar-thumb{ background:rgba(0,0,0,.14); border-radius:99px; }
.p3d-panel-body::-webkit-scrollbar-thumb:hover{ background:rgba(0,0,0,.26); }

.p3d-sec{ display:flex; flex-direction:column; gap:9px; }
.p3d-sec-head{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
.p3d-sec-head h3{ margin:0; font-size:12.5px; font-weight:700; letter-spacing:.015em; }
.p3d-inline{ display:flex; align-items:center; gap:6px; }
.p3d-link{
  background:none; border:0; padding:0; cursor:pointer;
  font-family:inherit; font-size:11.5px; font-weight:600; color:var(--ink-3);
  text-decoration:underline; text-underline-offset:3px;
}
.p3d-link:hover{ color:var(--ink); }

.p3d-card{
  background:#FAFAFA; border:1px solid #EDEDF0; border-radius:10px;
  padding:12px; display:flex; flex-direction:column; gap:12px;
}
.p3d-row{ display:flex; flex-direction:column; gap:6px; }
.p3d-row-h{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  font-size:12px; color:var(--ink-3);
}
.p3d-row-h b{ color:var(--ink); font-weight:650; font-variant-numeric:tabular-nums; }
.p3d-row-h label{ font-size:12px; color:var(--ink-3); }

.p3d-dirty{
  font-size:10px; font-weight:600; letter-spacing:.02em; color:var(--ink-3);
  background:#F0F0F2; border:1px solid var(--line); padding:2px 8px; border-radius:99px;
}

/* 滑块 */
input[type="range"]{
  -webkit-appearance:none; appearance:none; width:100%; height:4px;
  border-radius:99px; background:#E7E7EA; outline:none; cursor:pointer;
}
input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance:none; appearance:none; width:14px; height:14px; border-radius:50%;
  background:#0B0B0D; border:2px solid #fff; box-shadow:0 1px 4px rgba(0,0,0,.28);
  transition:transform .12s ease;
}
input[type="range"]::-webkit-slider-thumb:hover{ transform:scale(1.15); }
input[type="range"]::-moz-range-thumb{
  width:14px; height:14px; border-radius:50%; background:#0B0B0D;
  border:2px solid #fff; box-shadow:0 1px 4px rgba(0,0,0,.28); cursor:pointer;
}

.p3d-seed{ display:flex; align-items:center; gap:8px; }
.p3d-seed label{ font-size:12px; color:var(--ink-3); white-space:nowrap; }
.p3d-input{
  width:100%; height:32px; padding:0 10px; border-radius:8px;
  border:1px solid var(--line); background:#fff; color:var(--ink);
  font-family:inherit; font-size:12.5px; font-weight:600;
  font-variant-numeric:tabular-nums; outline:none; transition:border-color .2s, box-shadow .2s;
}
.p3d-input:focus{ border-color:var(--ink); box-shadow:0 0 0 3px rgba(0,0,0,.07); }
.p3d-input.w-sm{ width:76px; text-align:right; }
.p3d-unit{ font-size:11.5px; color:var(--ink-4); }

/* 精度三档 */
.p3d-res-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:6px; }
.res-btn{
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
  padding:8px 4px; border-radius:9px; cursor:pointer;
  border:1px solid var(--line); background:#fff; color:var(--ink);
  font-family:inherit; transition:background .2s, border-color .2s, color .2s, box-shadow .2s;
}
.res-btn b{ font-size:12px; font-weight:650; letter-spacing:-.01em; }
.res-btn .hint{ font-size:9.5px; color:var(--ink-4); }
.res-btn:hover{ border-color:#C4C4CB; }
.res-btn.on{ background:#0B0B0D; border-color:#0B0B0D; color:#fff; box-shadow:0 6px 16px rgba(0,0,0,.18); }
.res-btn.on .hint{ color:rgba(255,255,255,.72); }

.p3d-gen{ width:100%; height:38px; border-radius:8px; font-size:13px; }
.p3d-grid2{ display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.p3d-grid2 .btn{ height:36px; font-size:12.5px; }
.p3d-size{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  background:#F2F2F4; border-radius:8px; padding:7px 10px;
  font-size:11.5px; color:var(--ink-3);
}
.p3d-size b{ color:var(--ink); font-weight:650; font-variant-numeric:tabular-nums; }
.p3d-exports{ display:flex; flex-direction:column; gap:8px; }

/* 进度 */
.p3d-track{ height:4px; border-radius:99px; background:#EDEDF0; overflow:hidden; }
.p3d-fill{ height:100%; border-radius:99px; background:#0B0B0D; transition:width .15s linear; }
.pdot{
  display:inline-block; width:6px; height:6px; border-radius:50%;
  background:#0B0B0D; vertical-align:middle; animation:pulseDot 1.4s ease-in-out infinite;
}
@keyframes pulseDot{
  0%,100%{ opacity:1; transform:scale(1); }
  50%{ opacity:.42; transform:scale(1.4); }
}
.p3d-loading{
  left:50%; bottom:26px; transform:translateX(-50%); width:330px;
  padding:13px 15px; opacity:0; pointer-events:none; z-index:25;
  transition:opacity .2s ease;
}
.p3d-loading .p3d-load-top{ display:flex; align-items:center; justify-content:space-between; gap:10px; font-size:12px; font-weight:600; margin-bottom:8px; }
.p3d-panelprog{ display:flex; flex-direction:column; gap:6px; }
.p3d-panelprog .p3d-load-top{ display:flex; align-items:center; justify-content:space-between; gap:8px; font-size:11px; color:var(--ink-3); }

/* 底部定制条 */
.p3d-cta{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding-top:14px; margin-top:2px; border-top:1px solid var(--line);
}
.p3d-cta b{ display:block; font-size:12.5px; font-weight:700; }
.p3d-cta span{ display:block; margin-top:2px; font-size:11px; color:var(--ink-4); }

/* Toast */
.p3d-toasts{
  position:fixed; top:calc(var(--hd) + 16px); left:50%; transform:translateX(-50%);
  z-index:60; display:flex; flex-direction:column; align-items:center; gap:8px;
  pointer-events:none;
}
.toast{
  background:#0B0B0D; color:#fff; padding:9px 16px; border-radius:9px;
  font-size:12.5px; font-weight:500; letter-spacing:.01em;
  box-shadow:0 12px 30px rgba(0,0,0,.26);
  transition:opacity .3s ease, transform .3s ease;
}
.toast.hide{ opacity:0; transform:translateY(-8px); }
.toast.warn{ background:#3A3A42; }
.toast.err{ background:#8E2A2A; }

.only-mobile{ display:none; }

/* ---------- 响应式 ---------- */
@media (max-width:1180px){
  .p3d-toolbar{ display:none; }
}
@media (max-width:860px){
  .p3d-panel{ width:318px; }
}
@media (max-width:760px){
  :root{ --hd:64px; }
  /* 头部单行化 */
  .p3d-page .nav{ height:64px; gap:12px; padding:0 16px; }
  .p3d-page .brand span small{ display:none; }
  .p3d-page .brand > span:last-child{ display:none; }
  .p3d-page .nav-tel{ display:none; }
  .p3d-page .nav-right{ gap:8px; }
  .p3d-page .nav-right .btn{ height:34px; padding:0 12px; font-size:12.5px; }
  .p3d-badge{ top:12px; left:12px; right:62px; max-width:none; padding:10px 12px; gap:10px; }
  .p3d-ico{ width:32px; height:32px; border-radius:8px; }
  .p3d-ico svg{ width:17px; height:17px; }
  .p3d-badge h1{ font-size:13.5px; }
  .p3d-badge p{ font-size:10.5px; }
  .p3d-fab{ top:12px; right:12px; width:38px; height:38px; border-radius:10px; }
  .p3d-panel{ top:66px; left:12px; right:12px; bottom:12px; width:auto; }
  .p3d-stats{ left:12px; right:12px; bottom:12px; min-width:0; padding:10px 12px; }
  .p3d-stats-grid span{ font-size:9px; }
  .p3d-stats-grid b{ font-size:13px; }
  .p3d-loading{ bottom:104px; width:calc(100vw - 24px); }
  .only-mobile{ display:flex; }
}

/* =========================================================
   付费下载（STL / OBJ ¥69）与嵌入模式
   ========================================================= */

/* 导出按钮上的价签 */
.pay-tag{
  display:inline-flex; align-items:center; justify-content:center;
  margin-left:8px; padding:2px 7px; border-radius:999px;
  font-style:normal; font-family:"SFMono-Regular",Consolas,monospace;
  font-size:10px; letter-spacing:.06em;
  background:rgba(255,255,255,.18); color:#fff; border:1px solid rgba(255,255,255,.3);
}
.p3d-paid.btn-ghost .pay-tag{ background:#0B0B0D; color:#fff; border-color:#0B0B0D; }
.p3d-paid.btn-ghost{ display:inline-flex; align-items:center; justify-content:center; }
.p3d-gen.p3d-paid{ display:flex; align-items:center; justify-content:center; gap:7px; }
.p3d-gen.p3d-paid .pay-tag{ margin-left:2px; }
.p3d-free{
  font-family:"SFMono-Regular",Consolas,monospace; font-size:9.5px; letter-spacing:.1em;
  color:var(--ink-3); background:#EFEFF2; border-radius:999px; padding:3px 8px;
}
.p3d-payhint{ margin:10px 0 0; font-size:10.5px; line-height:1.7; color:var(--ink-4); }
.p3d-cta-btns{ display:flex; align-items:center; gap:8px; flex:0 0 auto; }
.p3d-cta .btn-sm{ height:32px; padding:0 13px; font-size:12.5px; border-radius:8px; }
.p3d-cta .btn-ghost{ background:#fff; border:1px solid var(--line); color:var(--ink); }

/* 弹窗 */
.pay-mask{ position:fixed; inset:0; z-index:90; display:none; }
.pay-mask.on{ display:block; }
.pay-bg{
  position:absolute; inset:0; background:rgba(8,8,10,.52);
  backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px);
  opacity:0; transition:opacity .3s ease;
}
.pay-mask.in .pay-bg{ opacity:1; }
.pay-box{
  position:absolute; left:50%; top:50%;
  transform:translate(-50%,-46%) scale(.98);
  width:min(482px, calc(100vw - 28px)); max-height:calc(100vh - 32px); overflow:auto;
  background:#fff; border-radius:18px; padding:26px 26px 20px;
  box-shadow:0 40px 110px rgba(0,0,0,.42), 0 0 0 1px rgba(0,0,0,.04);
  color:var(--ink); opacity:0;
  transition:transform .42s cubic-bezier(.16,1,.3,1), opacity .3s ease;
}
.pay-mask.in .pay-box{ transform:translate(-50%,-50%); opacity:1; }
.pay-x{
  position:absolute; top:13px; right:13px; width:32px; height:32px;
  display:grid; place-items:center; border-radius:50%;
  border:1px solid var(--line); background:#fff; color:var(--ink);
  font-size:18px; line-height:1; cursor:pointer; transition:background .2s;
}
.pay-x:hover{ background:#F2F2F4; }
.pay-k{ display:flex; align-items:center; gap:10px; margin-bottom:9px; }
.pay-kicker{
  font-family:"SFMono-Regular",Consolas,monospace; font-size:9.5px;
  letter-spacing:.2em; color:var(--ink-4);
}
.pay-flag{
  font-family:"SFMono-Regular",Consolas,monospace; font-size:9.5px; letter-spacing:.08em;
  padding:3px 8px; border-radius:999px; background:#0B0B0D; color:#fff;
}
.pay-title{ margin:0 0 12px; font-size:20px; font-weight:700; letter-spacing:-.02em; }
.pay-price{
  display:flex; align-items:baseline; gap:10px;
  padding:11px 0 14px; border-bottom:1px solid var(--line);
}
.pay-price b{ font-size:34px; letter-spacing:-.035em; font-variant-numeric:tabular-nums; }
.pay-price s{ color:var(--ink-4); font-size:13px; }
.pay-price span{ margin-left:auto; font-size:11px; color:var(--ink-4); text-align:right; line-height:1.5; }
.pay-list{ list-style:none; margin:15px 0 0; padding:0; display:flex; flex-direction:column; gap:9px; }
.pay-list li{ display:flex; gap:10px; font-size:12.5px; line-height:1.7; color:var(--ink-2); }
.pay-list i{
  flex:0 0 40px; height:20px; margin-top:2px; border-radius:4px; background:#F2F2F4;
  color:var(--ink-3); font-style:normal; font-family:"SFMono-Regular",Consolas,monospace;
  font-size:9.5px; letter-spacing:.06em; display:grid; place-items:center;
}
.pay-code{
  margin:16px 0 14px; padding:11px 13px; border-radius:10px;
  background:#F7F7F8; border:1px dashed #D5D5DB;
  display:grid; grid-template-columns:1fr auto; gap:6px 10px; align-items:center;
}
.pay-code span{ grid-column:1 / -1; font-size:10.5px; color:var(--ink-4); letter-spacing:.04em; }
.pay-code b{
  font-family:"SFMono-Regular",Consolas,monospace; font-size:11.5px;
  line-height:1.65; word-break:break-all; letter-spacing:.01em;
}
.pay-copy{
  height:26px; padding:0 12px; border-radius:6px; border:1px solid var(--line);
  background:#fff; color:var(--ink); font-family:inherit; font-size:11.5px; cursor:pointer;
  transition:background .2s;
}
.pay-copy:hover{ background:#F2F2F4; }
.pay-steps{ margin:0 0 16px; padding-left:17px; font-size:12px; line-height:1.95; color:var(--ink-2); }
.pay-steps li{ margin-bottom:3px; }
.pay-steps code{
  font-family:"SFMono-Regular",Consolas,monospace; font-size:11.5px;
  background:#F2F2F4; padding:1px 5px; border-radius:4px;
}
.pay-actions{ display:flex; gap:8px; }
.pay-actions .btn{ flex:1; height:42px; font-size:13px; border-radius:10px; }
.pay-actions .pay-ghost{ background:#fff; border:1px solid var(--line); color:var(--ink); }
.pay-actions .pay-ghost:hover{ background:#F7F7F8; }
.pay-fine{ margin:12px 0 0; font-size:10.5px; line-height:1.7; color:var(--ink-4); }

/* 嵌入模式（抽屉内）：隐藏站点头部，画布铺满 */
html.p3d-embed{ --hd:0px !important; }
html.p3d-embed .site{ display:none !important; }
html.p3d-embed .p3d-cta-link{ display:none !important; }
html.p3d-embed .p3d-badge{ top:14px; left:14px; }
html.p3d-embed .p3d-toasts{ top:16px; }
html.p3d-embed body.p3d-page{ background:#F7F7F8; }
/* 嵌入时隐藏优惠券悬浮钮，避免遮挡参数面板 */
html.p3d-embed .cp-fab{ display:none !important; }

@media (max-width:760px){
  .pay-box{ padding:22px 18px 16px; border-radius:16px; }
  .pay-title{ font-size:17.5px; }
  .pay-price b{ font-size:29px; }
  .pay-price span{ display:none; }
  .pay-actions{ flex-direction:column-reverse; }
  html.p3d-embed .p3d-badge{ top:10px; left:10px; right:56px; }
}
