* { box-sizing: border-box; }
html, body, #app {
  min-height: 100%;
  overflow: hidden;
  touch-action: manipulation;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f2f2ef;
  color: #202321;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}
button, input { font: inherit; }
button {
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button:focus,
button:focus-visible,
input:focus,
input:focus-visible {
  outline: none;
}
.site-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.phone {
  position: relative;
  width: min(100vw, 430px);
  height: min(100vh, 932px);
  overflow: hidden;
  background: #fbfaf8;
  border-radius: 34px;
  box-shadow: 0 28px 90px rgba(35, 38, 33, .22);
}
.diy-screen {
  --drawer-h: 224px;
  height: 100%;
  overflow: hidden;
  position: relative;
  padding: 24px 18px 0;
  background:
    radial-gradient(circle at 50% 20%, rgba(239, 234, 224, .78), transparent 32%),
    linear-gradient(#fbfaf8, #fbfaf7 61%, #fff 62%);
}
.topbar {
  position: relative;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.brand-logo {
  margin: 0;
  display: none;          /* 顶部 logo 拿掉，把空间让给盘面 */
}
.brand-logo img {
  display: block;
  width: 148px;
  height: 44px;
  object-fit: contain;
}
.price-count {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex: 0 0 auto;
}
.price-count strong {
  color: #a65f5a;
  font-size: 15px;
  font-weight: 900;
}
.price-count span {
  color: #8c918b;
  font-size: 12px;
}
.wrist-range-text {
  flex: 1;
  min-width: 0;
  text-align: center;
  color: #ae625c;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.guide-btn {
  flex: 0 0 auto;
  color: #7c807a;
  background: transparent;
  font-size: 12.5px;
  white-space: nowrap;
}
/* 顶部右上角登录信息（手机端仅图标 + 登录小绿点） */
.account-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 2px;
  color: #7c807a;
}
.account-btn .account-label { display: none; }
.account-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3f7d52;
  box-shadow: 0 0 0 2px #fbfaf8;
}
.lang-btn {
  flex: 0 0 auto;
  padding: 3px 9px;
  border: 1px solid #cfd2cc;
  border-radius: 999px;
  background: transparent;
  color: #7c807a;
  font-size: 11.5px;
  font-weight: 800;
}
.guide-btn b {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-left: 2px;
  border: 1px solid #9da19b;
  border-radius: 50%;
}
.design-plate {
  --plate-size: clamp(300px, min(91vw, calc(100dvh - var(--drawer-h) - 258px)), 382px);
  position: absolute;
  left: 50%;
  bottom: calc(var(--drawer-h) + 154px);
  transform: translateX(-50%);
  width: var(--plate-size);
  height: var(--plate-size);
  aspect-ratio: 1 / 1;
  margin: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  isolation: isolate;
  overflow: visible;
}
.design-plate::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  border-radius: 50%;
  clip-path: circle(50% at 50% 50%);
  transform: translateZ(0);
  box-shadow:
    inset 0 4px 12px rgba(255, 255, 255, .30),
    inset 0 -16px 30px rgba(70, 54, 36, .14),
    inset 0 0 0 1px rgba(255, 255, 255, .35),
    0 22px 46px rgba(43, 38, 31, .16),
    0 6px 14px rgba(43, 38, 31, .10);
}
/* 共用的立体层：盘心微凹的环形阴影 + 从左上到右下的方向光，营造真实釉面立体感 */
.design-plate::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  border-radius: 50%;
  clip-path: circle(50% at 50% 50%);
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, transparent 0 60%, rgba(60, 46, 30, .06) 73%, transparent 80%),
    radial-gradient(circle at 50% 50%, transparent 0 86%, rgba(255, 255, 255, .28) 87.5% 89%, transparent 90%),
    linear-gradient(152deg, rgba(255, 255, 255, .20) 0 16%, rgba(255, 255, 255, 0) 38% 62%, rgba(40, 30, 18, .12) 100%);
}
/* 奶白瓷：中性哑光陶釉，盘心平整、盘沿微微起翘、近沿一圈柔和投影 */
.design-plate.cream::before {
  background:
    radial-gradient(circle at 42% 34%, rgba(255,255,255,.26), transparent 46%),
    radial-gradient(circle at 50% 50%,
      #eeeae1 0%, #ebe7dd 42%, #e6e1d6 62%,
      #ddd7c9 74%, #f4f1ea 79% 80.5%,
      #d3ccbd 83% 86%, #c7bfae 88%, #e9e4d9 92% 100%);
}
/* 青瓷：天青釉面 + 细密开片纹，盘沿暖棕 */
.design-plate.celadon::before {
  background:
    linear-gradient(28deg, transparent 0 30%, rgba(60,90,82,.14) 30.4% 31%, transparent 31.6% 52%, rgba(255,255,255,.18) 52.5% 53%, transparent 53.6%),
    linear-gradient(108deg, transparent 0 40%, rgba(55,82,74,.10) 40.4% 41%, transparent 41.6% 70%, rgba(255,255,255,.16) 70.4% 71%, transparent 71.6%),
    radial-gradient(circle at 41% 33%, rgba(255,255,255,.45), transparent 42%),
    radial-gradient(circle at 50% 50%,
      #d6e3dc 0%, #c6d6cd 44%, #b2c5bb 64%,
      #9fb4a9 74%, #e8efe9 79% 80.5%,
      #8aa395 83% 86%, #6f8c7c 88%, #b8cabf 92% 100%);
}
/* 粗陶：手作陶土暖陶色，盘心高光柔和 */
.design-plate.stoneware::before {
  background:
    radial-gradient(circle at 50% 50%, rgba(120,84,48,.05) 0 38%, transparent 60%),
    radial-gradient(circle at 42% 35%, rgba(255,250,242,.55), transparent 38%),
    radial-gradient(circle at 50% 50%,
      #f2e6d1 0%, #e9d6b8 44%, #ddc59c 64%,
      #cdb083 74%, #f6ecd9 79% 80.5%,
      #b58f5c 83% 86%, #97713f 88%, #ddc7a5 92% 100%);
}
/* 胡桃木：木纹托盘，年轮纹理 + 深木色盘沿 */
.design-plate.walnut::before {
  background:
    repeating-radial-gradient(circle at 50% 50%, rgba(54,30,14,.10) 0 1px, transparent 1px 7px, rgba(120,78,44,.06) 7px 9px, transparent 9px 17px),
    radial-gradient(circle at 43% 35%, rgba(255,234,200,.32), transparent 44%),
    radial-gradient(circle at 50% 50%,
      #b78a5b 0%, #a87a4b 46%, #966840 66%,
      #835633 75%, #c89a6a 79% 80.5%,
      #6e4a29 83% 86%, #543819 88%, #9c7045 92% 100%);
}
/* 墨黑釉：深黑釉面，珠子在深色盘上更出彩 */
.design-plate.ink::before {
  background:
    radial-gradient(circle at 40% 31%, rgba(255,255,255,.16), transparent 34%),
    radial-gradient(circle at 50% 50%,
      #43474a 0%, #383c3f 44%, #2d3134 64%,
      #262a2d 74%, #565a5b 79% 80.5%,
      #1d1f22 83% 87%, #101215 89%, #34383b 92% 100%);
}
/* 云石：白玉大理石，灰色脉络纹 */
.design-plate.marble::before {
  background:
    linear-gradient(116deg, transparent 0 20%, rgba(138,140,148,.20) 20.6% 21.3%, transparent 22% 44%, rgba(150,150,158,.12) 44.5% 45.1%, transparent 46%),
    linear-gradient(58deg, transparent 0 60%, rgba(130,132,141,.15) 60.5% 61.2%, transparent 62% 83%, rgba(150,150,158,.09) 83.4% 84%, transparent 85%),
    linear-gradient(150deg, transparent 0 68%, rgba(142,144,152,.10) 68.5% 69%, transparent 70%),
    radial-gradient(circle at 43% 34%, rgba(255,255,255,.6), transparent 42%),
    radial-gradient(circle at 50% 50%,
      #fdfdfc 0%, #f4f3f1 46%, #e9e7e3 66%,
      #dddbd6 75%, #ffffff 79% 80.5%,
      #cfccc6 83% 86%, #bdb9b2 88%, #efedea 92% 100%);
}
/* 深色墨黑盘：空盘提示文字与水印改为浅色，避免深底上看不清 */
.design-plate.ink .empty-copy { color: rgba(245,243,238,.82); }
.design-plate.ink .lab-watermark { filter: brightness(0) invert(1); opacity: .16; }
.zoom-btn {
  position: absolute;
  z-index: 6;
  top: 16px;
  right: -5px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,.86);
  color: #67766a;
  box-shadow: inset 0 0 0 1px #e5e3dc;
  font-size: 24px;
}
.cube-btn, .undo-btn {
  position: absolute;
  z-index: 9;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 50%;
  background: #fff;
  color: #293029;
  box-shadow: inset 0 0 0 1px #e8e5de, 0 8px 18px rgba(31,35,30,.05);
  font-size: 22px;
}
.cube-btn { left: 18px; bottom: calc(var(--drawer-h) + 152px); }
.undo-btn { right: 18px; bottom: calc(var(--drawer-h) + 152px); }
.lab-watermark {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 108px;
  height: 32px;
  object-fit: contain;
  opacity: .18;
}
.empty-copy {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 49%;
  width: 260px;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #303630;
  font-size: 19px;
  font-weight: 850;
}
.bead {
  position: absolute;
  z-index: 4;
  width: var(--bead-size, 28px);
  height: var(--bead-size, 28px);
  transform: translate(-50%, -50%);
  background: var(--bead-image) center / contain no-repeat;
  border: none;
  filter: drop-shadow(0 3px 5px rgba(0,0,0,.24));
  transition: left .46s cubic-bezier(.2,.75,.2,1), top .46s cubic-bezier(.2,.75,.2,1), transform .46s ease;
  cursor: grab;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
.bead.loose { transform: translate(-50%, -50%) scale(.98); }
.bead.dragging {
  opacity: 0;
}
.bead.clear::after, .gem.clear::after {
  content: "";
  position: absolute;
  left: 16%;
  right: 12%;
  top: 49%;
  height: 1px;
  background: rgba(70, 70, 70, .38);
  transform: rotate(-16deg);
}
/* 异形配饰（吊坠等）保留更修长的占位框，图片以原始比例 contain 渲染 */
.bead.charm {
  width: calc(var(--bead-size, 28px) * .82);
  height: calc(var(--bead-size, 28px) * 1.12);
  background: var(--bead-image) center / contain no-repeat;
  border: none;
  filter: drop-shadow(0 3px 5px rgba(0,0,0,.22));
}
/* 无图片素材的兜底：用本色渲染对应形态 */
.bead.no-img, .gem.no-img {
  background:
    radial-gradient(circle at 36% 28%, rgba(255,255,255,.45), transparent 44%),
    radial-gradient(circle at 72% 74%, rgba(0,0,0,.16), transparent 54%),
    var(--bead-color, #d9dcda);
  border-radius: 50%;
  filter: none;
  box-shadow: 0 3px 6px rgba(0,0,0,.14);
}
.bead.no-img.metal, .gem.no-img.metal { border-radius: 14%; }
.bead.no-img.facet, .gem.no-img.facet { border-radius: 54% 36% 62% 34% / 44% 56% 36% 54%; }
.controls {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: calc(var(--drawer-h) + 96px);
  z-index: 6;
  display: grid;
  grid-template-columns: 104px 48px 48px 48px minmax(104px, 1fr);
  gap: 9px;
  align-items: center;
  margin: 0;
}
.wrist-btn, .circle-btn, .string-btn {
  height: 46px;
  border-radius: 999px;
  background: #fff;
  color: #293029;
  box-shadow: inset 0 0 0 1px #e8e5de, 0 8px 18px rgba(31,35,30,.05);
  font-weight: 800;
  white-space: nowrap;
}
.wrist-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 14px;
}
.circle-btn {
  width: 46px;
  display: grid;
  place-items: center;
  font-size: 18px;
}
.icon-svg {
  display: block;
  width: 22px;
  height: 22px;
  color: #273027;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.05;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-svg-small {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}
.icon-svg-action {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke-width: 2.15;
}
.cube-btn .icon-svg,
.undo-btn .icon-svg {
  width: 24px;
  height: 24px;
}
.undo-btn .icon-svg {
  transform: translateX(-1px);
}
.circle-btn:active,
.cube-btn:active,
.undo-btn:active,
.wrist-btn:active {
  transform: translateY(1px) scale(.98);
}
.string-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: #232a23;
  color: #fff;
  font-size: 14px;
}
.string-btn .icon-svg {
  color: #fff;
}
.search-row {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: calc(var(--drawer-h) + 50px);
  z-index: 6;
  display: grid;
  grid-template-columns: 1fr 136px;
  gap: 8px;
  align-items: center;
  margin: 0;
}
.search-row input {
  grid-column: 1;
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid #eeeae3;
  border-radius: 16px;
  background: #fff;
  color: #323832;
  outline: none;
}
.search-row input::placeholder { color: #c1c2bd; }
.search-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  border-radius: 16px;
  background: #232a23;
  color: #fff;
  font-size: 14px;
  font-weight: 850;
}
.search-row button .icon-svg {
  color: #fff;
}
.category-tabs {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--drawer-h);
  z-index: 8;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  height: 46px;
  margin: 0;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid #efede8;
}
.category-tabs button {
  position: relative;
  background: transparent;
  color: #8a8f89;
  font-size: 15px;
  font-weight: 850;
}
.category-tabs button.active {
  color: #202321;
}
.category-tabs button.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 28px;
  height: 4px;
  transform: translateX(-50%);
  border-radius: 99px;
  background: #b36d63;
}
.material-drawer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--drawer-h);
  display: grid;
  grid-template-columns: 90px 1fr;
  background: #ffffff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -6px 24px rgba(35,38,33,.08);
}
.material-drawer aside {
  overflow: auto;
  padding: 18px 6px 24px 0;
  background: #ffffff;
  border-right: 1px solid rgba(35,38,33,.06);
}
.material-drawer aside button {
  width: 100%;
  min-height: 40px;
  padding-left: 10px;
  text-align: left;
  background: transparent;
  color: #9a9d97;
  font-size: 14px;
  font-weight: 800;
  border-left: 4px solid transparent;
  white-space: nowrap;
}
.material-drawer aside button.active {
  color: #202321;
  background: #faf9f5;
  border-left-color: #b36d63;
}
.cards {
  height: var(--drawer-h);
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: min-content;
  align-content: start;
  gap: 10px 6px;
  padding: 18px 10px 22px 10px;
}
.empty-result {
  grid-column: 1 / -1;
  align-self: center;
  justify-self: center;
  margin: 48px 0 0;
  color: #a4a7a0;
  font-size: 14px;
  font-weight: 700;
}
.material-card {
  min-width: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border: none;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(35,38,33,.07);
  overflow: visible;
  touch-action: manipulation;
  padding: 8px 4px 8px;
}
.material-card:active { transform: translateY(1px); }
/* 橱窗缩略图统一尺寸，不随素材真实 mm 变化（托盘上的珠子仍按真实比例） */
.gem {
  position: relative;
  flex: 0 0 auto;
  width: 60px;
  height: 60px;
  margin: 4px auto 2px;
  background: var(--bead-image) center / contain no-repeat;
  border: none;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.16));
}
.gem.charm,
.material-card.charm-card .gem {
  width: 60px;
  height: 60px;
  aspect-ratio: auto;
  margin: 4px auto 2px;
}
.material-card strong {
  display: block;
  width: 100%;
  padding: 0 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 16px;
  min-height: 16px;
  font-weight: 700;
  color: rgba(47,43,36,.85);
}
.material-card small {
  margin-top: 0;
  color: rgba(47,43,36,.45);
  font-size: 10px;
  font-style: normal;
  line-height: 14px;
  min-height: 14px;
}
.stepper {
  width: 100%;
  height: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 4px;
  border-top: 1px solid rgba(35,38,33,.07);
}
.stepper button {
  background: transparent;
  color: rgba(47,43,36,.35);
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: 4px;
}
.stepper .add-btn {
  color: rgba(47,43,36,.55);
  background: rgba(179,109,99,.06);
}
.stepper button + button {
  border-left: 1px solid rgba(35,38,33,.07);
}
.flying-bead {
  position: absolute;
  z-index: 90;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  pointer-events: none;
  /* 飞入过程沿用落盘后的渲染方式：图片按原始比例 contain 在透明底上，
     而不是 cover 填进带底色的方块，避免飞行时变成方块 */
  background: var(--bead-image) center / contain no-repeat;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.22));
  animation: roll-in .86s cubic-bezier(.18, .82, .22, 1) forwards;
}
/* 无图片素材的兜底：飞行时也用本色圆珠，而非方块 */
.flying-bead.no-img {
  background:
    radial-gradient(circle at 36% 28%, rgba(255,255,255,.45), transparent 44%),
    radial-gradient(circle at 72% 74%, rgba(0,0,0,.16), transparent 54%),
    var(--bead-color, #d9dcda);
  border-radius: 50%;
  filter: none;
  box-shadow: 0 4px 9px rgba(0,0,0,.14);
}
.flying-bead.no-img.metal { border-radius: 14%; }
.flying-bead.no-img.facet { border-radius: 54% 36% 62% 34% / 44% 56% 36% 54%; }
.drag-ghost {
  z-index: 100;
  pointer-events: none;
  opacity: .96;
  transition: none;
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: inset -8px -8px 12px rgba(0,0,0,.15), 0 12px 24px rgba(0,0,0,.22);
}
.flying-bead.charm {
  width: 24px;
  height: 36px;
  border-radius: 46% 46% 52% 52%;
}
@keyframes roll-in {
  0% {
    transform: translate(calc(var(--from-x) - 15px), calc(var(--from-y) - 15px)) rotate(0deg) scale(1.08);
    opacity: .96;
  }
  40% {
    transform: translate(calc(var(--hit-x) - 15px), calc(var(--hit-y) - 15px)) rotate(260deg) scale(1.02);
    opacity: 1;
  }
  64% {
    transform: translate(calc(var(--rebound-x) - 15px), calc(var(--rebound-y) - 15px)) rotate(455deg) scale(.96);
    opacity: .98;
  }
  86% {
    transform: translate(calc(var(--to-x) - 15px), calc(var(--to-y) - 15px)) rotate(620deg) scale(.9);
    opacity: .9;
  }
  100% {
    transform: translate(calc(var(--to-x) - 15px), calc(var(--to-y) - 15px)) rotate(660deg) scale(.78);
    opacity: 0;
  }
}
.toast {
  position: absolute;
  z-index: 60;
  left: 50%;
  bottom: 320px;
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(31,36,31,.88);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}
.modal {
  position: absolute;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.42);
  backdrop-filter: blur(5px);
}
.close-btn {
  position: absolute;
  right: 18px;
  top: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f1f0ed;
  color: #777b75;
  font-size: 22px;
}
.wrist-sheet, .guide-sheet, .preview-sheet {
  position: relative;
  width: calc(100% - 48px);
  max-width: 382px;
  padding: 28px;
  border-radius: 28px;
  background: #fff;
  text-align: center;
  box-shadow: 0 18px 48px rgba(0,0,0,.18);
}
.wrist-sheet h2, .guide-sheet h2, .preview-sheet h2 {
  margin: 0 0 20px;
  font-size: 22px;
}
.wrist-display {
  display: grid;
  grid-template-columns: 62px 1fr 62px;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border-radius: 24px;
  background: #f7f5ef;
}
.wrist-display button {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #fff;
  color: #697067;
  font-size: 26px;
  box-shadow: 0 5px 16px rgba(0,0,0,.08);
}
.wrist-display strong {
  display: block;
  font-size: 54px;
  line-height: .9;
}
.wrist-display small {
  display: block;
  margin-top: 8px;
  color: #8d918b;
  font-size: 13px;
  letter-spacing: 3px;
}
.wrist-sheet input {
  width: 100%;
  margin: 18px 0;
  accent-color: #252c25;
}
.wrist-sheet p, .guide-sheet p {
  margin: 0 0 20px;
  color: #8b8f89;
  line-height: 1.8;
  font-size: 14px;
}
.confirm-btn {
  height: 52px;
  min-width: 150px;
  padding: 0 26px;
  border-radius: 999px;
  background: #252c25;
  color: #fff;
  font-weight: 900;
}
.guide-sheet {
  align-self: end;
  width: 100%;
  max-width: none;
  height: min(78vh, 670px);
  min-height: 620px;
  border-radius: 28px 28px 0 0;
  overflow: hidden;
}
.guide-sheet nav {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 22px;
}
.guide-sheet nav button {
  height: 40px;
  border-radius: 999px;
  background: #fff;
  color: #7e837d;
  box-shadow: inset 0 0 0 1px #eceae5;
  font-weight: 800;
}
.guide-sheet nav button.active {
  background: #202321;
  color: #fff;
}
.guide-sheet article {
  height: calc(100% - 92px);
  overflow: auto;
  display: block;
  padding: 18px;
  border: 1px solid #eeece6;
  border-radius: 24px;
  background: #fbfaf7;
}
.guide-sheet article b {
  display: block;
  margin-bottom: 16px;
  font-size: 22px;
}
.size-guide {
  width: 100%;
  min-height: 360px;
  display: flex;
  justify-content: center;
  gap: 34px;
  align-items: center;
  color: #202321;
  font-weight: 900;
}
.size-guide span {
  color: #202321;
  font-size: 18px;
  line-height: 1.45;
}
.size-guide span br + * {
  color: #8b8f89;
}
.size-guide span::before {
  content: "";
  display: block;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: #e9e4da;
  box-shadow: inset 6px 6px 10px rgba(255,255,255,.7), inset -6px -6px 10px rgba(0,0,0,.08);
}
.size-guide span:nth-child(1)::before { width: 34px; height: 34px; }
.size-guide span:nth-child(2)::before { width: 48px; height: 48px; }
.size-guide span:nth-child(3)::before { width: 62px; height: 62px; }
.measure-guide-crop {
  display: block;
  width: 100%;
  max-height: 246px;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid #eeeae3;
  background: #fff;
}
.measure-guide-img {
  display: block;
  width: 100%;
  transform: scale(1.08);
  transform-origin: top center;
}
.gender-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 16px 0;
}
.gender-switch button {
  height: 40px;
  border-radius: 999px;
  background: #fff;
  color: #777b75;
  box-shadow: inset 0 0 0 1px #eceae5;
  font-weight: 850;
}
.gender-switch button.active {
  background: #202321;
  color: #fff;
}
.wrist-reference {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.wrist-reference div {
  min-height: 76px;
  display: grid;
  place-items: center;
  padding: 12px;
  border: 1px solid #eeece6;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 7px 16px rgba(42,42,38,.04);
}
.wrist-reference strong {
  color: #202321;
  font-size: 24px;
  line-height: 1;
}
.wrist-reference span {
  color: #8b8f89;
  font-size: 12px;
}
.preview-sheet {
  align-self: end;
  width: 100%;
  max-width: none;
  border-radius: 28px 28px 0 0;
}
.preview-sheet img {
  width: min(76vw, 310px);
  max-height: 58vh;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(31,35,30,.12);
  background: #fbfaf7;
}
.preview-sheet div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}
.preview-sheet div button {
  height: 52px;
  border-radius: 999px;
  background: #f6f4ee;
  color: #252c25;
  font-weight: 900;
}
.preview-sheet div .confirm-btn {
  background: #252c25;
  color: #fff;
}

/* ---------- 手串运势卡 ---------- */
.fortune-modal {
  background: rgba(20, 17, 12, .5);
  animation: fortune-fade .3s ease both;
}
@keyframes fortune-fade { from { opacity: 0; } to { opacity: 1; } }
.fortune-sheet {
  position: relative;
  width: min(86vw, 340px);
  max-height: 88vh;
  overflow: hidden auto;
  padding: 26px 24px 24px;
  border-radius: 26px;
  text-align: center;
  background:
    radial-gradient(circle at 50% -6%, #fff6e6 0%, transparent 52%),
    linear-gradient(180deg, #fffdf9 0%, #fbf3e6 100%);
  box-shadow: 0 26px 64px rgba(40, 28, 14, .34), inset 0 0 0 1px rgba(201, 164, 106, .35);
  animation: fortune-pop .5s cubic-bezier(.2, .9, .25, 1.15) both;
}
@keyframes fortune-pop {
  0% { opacity: 0; transform: translateY(26px) scale(.9); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.fortune-spark {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 30%, #e7c485 70%, transparent 100%);
  opacity: 0;
  pointer-events: none;
  animation: fortune-twinkle 2.4s ease-in-out infinite;
}
@keyframes fortune-twinkle {
  0%, 100% { opacity: 0; transform: scale(.4); }
  50% { opacity: .9; transform: scale(1.25); }
}
.fortune-kicker {
  margin: 0 0 14px;
  color: #b08a4e;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 3px;
}
.fortune-ring {
  position: relative;
  width: 132px;
  height: 132px;
  margin: 0 auto 6px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #fffaf0 0 56%, transparent 57%),
    conic-gradient(#caa46a, #b36d63, #8f9f7e, #caa46a);
  box-shadow: 0 10px 24px rgba(160, 120, 60, .28), inset 0 0 0 1px rgba(255,255,255,.6);
  animation: fortune-spin 1s ease both;
}
@keyframes fortune-spin {
  0% { transform: rotate(-30deg) scale(.7); opacity: 0; }
  100% { transform: rotate(0) scale(1); opacity: 1; }
}
.fortune-score {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 50px;
  font-weight: 800;
  line-height: 1;
  color: #2c2f2a;
}
.fortune-level {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 800;
  color: #a65f5a;
  letter-spacing: 2px;
}
.fortune-title {
  margin: 12px 0 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 4px;
  color: #21402f;
}
.fortune-summary {
  margin: 0 4px 16px;
  color: #5b5247;
  font-size: 13px;
  line-height: 1.7;
  text-align: left;
}
.fortune-bars {
  display: grid;
  gap: 9px;
  margin: 0 0 16px;
}
.fortune-bar {
  display: grid;
  grid-template-columns: 36px 1fr 28px;
  align-items: center;
  gap: 9px;
}
.fortune-bar-label {
  font-size: 12px;
  font-weight: 800;
  color: #5b5247;
  text-align: left;
}
.fortune-bar-track {
  height: 8px;
  border-radius: 99px;
  background: rgba(120, 100, 74, .14);
  overflow: hidden;
}
.fortune-bar-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, #d8b87e, #b36d63);
  animation: fortune-fill .9s cubic-bezier(.2, .8, .2, 1) forwards;
  animation-delay: var(--delay, 0s);
}
@keyframes fortune-fill { to { width: var(--bar, 60%); } }
.fortune-bar-val {
  font-size: 12px;
  font-weight: 800;
  color: #2c2f2a;
  text-align: right;
}
.fortune-lucky {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 12px;
  padding: 11px 14px;
  border-radius: 14px;
  background: rgba(201, 164, 106, .12);
  box-shadow: inset 0 0 0 1px rgba(201, 164, 106, .28);
}
.fortune-lucky b { color: #8a5a2e; font-size: 13px; font-weight: 850; }
.fortune-lucky span { color: #7a6b54; font-size: 12px; }
.fortune-advice {
  margin: 0 4px 18px;
  color: #6a6155;
  font-size: 12.5px;
  line-height: 1.6;
}
.fortune-confirm {
  width: 100%;
  height: 50px;
  border-radius: 999px;
  background: linear-gradient(120deg, #2f3a2c, #4a5b3a);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 2px;
}
@media (max-width: 900px) {
  .site-shell {
    min-height: 100dvh;
    padding: 0;
  }
  .phone {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }
  .diy-screen {
    --drawer-h: 226px;
    padding: 8px 8px 0;
  }
  .topbar {
    height: 30px;
  }
  .design-plate {
    --plate-size: clamp(330px, min(97vw, calc(100dvh - var(--drawer-h) - 186px)), 500px);
    position: absolute;
    left: 50%;
    bottom: calc(var(--drawer-h) + 150px);
    transform: translateX(-50%);
    margin: 0;
  }
  .bead {
    width: var(--bead-size, 26px);
    height: var(--bead-size, 26px);
  }
  .bead.charm {
    width: calc(var(--bead-size, 26px) * .72);
    height: calc(var(--bead-size, 26px) * .95);
  }
  .zoom-btn {
    width: 40px;
    height: 40px;
  }
  .cube-btn,
  .undo-btn {
    bottom: calc(var(--drawer-h) + 154px);
    width: 44px;
    height: 44px;
  }
  .cube-btn {
    left: 18px;
  }
  .undo-btn {
    right: 18px;
  }
  .controls {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: calc(var(--drawer-h) + 96px);
    grid-template-columns: 104px 44px 44px 44px minmax(100px, 1fr);
    gap: 8px;
    margin: 0;
  }
  .wrist-btn,
  .circle-btn,
  .string-btn {
    height: 42px;
  }
  .circle-btn {
    width: 44px;
  }
  .string-btn {
    font-size: 13px;
  }
  .search-row {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: calc(var(--drawer-h) + 50px);
    grid-template-columns: 1fr 126px;
    margin: 0;
  }
  .search-row input,
  .search-row button {
    height: 38px;
  }
  .category-tabs {
    position: absolute;
    left: 0;
    right: 0;
    bottom: var(--drawer-h);
    height: 44px;
    margin: 0;
  }
  .material-drawer {
    height: var(--drawer-h);
    border-radius: 0;
  }
  .cards {
    height: var(--drawer-h);
    gap: 10px 6px;
    padding: 16px 8px 18px;
  }
  .material-card {
    padding: 4px 2px 6px;
  }
  .gem,
  .gem.charm,
  .material-card.charm-card .gem {
    width: 56px;
    height: 56px;
    aspect-ratio: auto;
    margin: 3px auto 0;
  }
  .material-card strong {
    font-size: 11px;
    line-height: 15px;
  }
  .material-card small {
    font-size: 9px;
    line-height: 13px;
  }
}
@media (max-width: 900px) and (max-height: 760px) {
  .diy-screen {
    --drawer-h: 204px;
    padding-top: 8px;
  }
  .topbar {
    height: 28px;
  }
  .design-plate {
    --plate-size: clamp(290px, min(96vw, calc(100dvh - var(--drawer-h) - 184px)), 430px);
    bottom: calc(var(--drawer-h) + 130px);
  }
  .cube-btn,
  .undo-btn {
    bottom: calc(var(--drawer-h) + 160px);
  }
  .controls {
    bottom: calc(var(--drawer-h) + 88px);
    grid-template-columns: 98px 40px 40px 40px minmax(92px, 1fr);
    gap: 6px;
  }
  .wrist-btn,
  .circle-btn,
  .string-btn {
    height: 38px;
  }
  .circle-btn {
    width: 40px;
  }
  .string-btn,
  .search-row button {
    font-size: 12px;
  }
  .search-row {
    bottom: calc(var(--drawer-h) + 42px);
    grid-template-columns: 1fr 112px;
  }
  .search-row input,
  .search-row button {
    height: 36px;
  }
  .category-tabs {
    height: 40px;
  }
  .cards {
    gap: 8px 5px;
    padding: 14px 7px 16px;
  }
  .material-card {
    padding: 2px 2px 4px;
  }
  .gem,
  .gem.charm,
  .material-card.charm-card .gem {
    width: 52px;
    height: 52px;
    aspect-ratio: auto;
    margin: 2px auto 0;
  }
  .material-card strong {
    font-size: 11px;
    line-height: 15px;
  }
  .material-card small {
    font-size: 9px;
    line-height: 13px;
  }
  .stepper {
    height: 18px;
  }
}
