:root {
  --ink: #202126;
  --muted: #717178;
  --line: #e7dfd7;
  --paper: #fffaf5;
  --panel: rgba(255, 255, 255, 0.86);
  --accent: #b98555;
  --accent-dark: #7c4f32;
  --rose: #f3b6c1;
  --mint: #b8ddca;
  --blue: #b8cce8;
  --gold: #e9c46a;
  --shadow: 0 24px 80px rgba(56, 42, 32, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, "Noto Sans SC", system-ui, sans-serif;
  background:
    radial-gradient(circle at 20% 0%, rgba(243, 182, 193, 0.42), transparent 32rem),
    radial-gradient(circle at 90% 8%, rgba(184, 221, 202, 0.48), transparent 28rem),
    linear-gradient(135deg, #fff8f0 0%, #f5efe7 48%, #fffdf8 100%);
}

button,
a,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

.page-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.site-header {
  position: sticky;
  top: 14px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.78);
  box-shadow: 0 14px 44px rgba(79, 57, 42, 0.12);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, #7d5136, #d49b62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.05;
}

.brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(185, 133, 85, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
}

.header-nav a {
  padding: 10px 16px;
  border-radius: 999px;
  color: #5b5651;
  font-size: 14px;
  font-weight: 700;
}

.header-nav a:hover {
  background: #fff;
}

.cart-button,
.primary-link,
.text-button,
.checkout-button,
.segmented button,
.bead-size-options button,
.icon-actions button {
  border: 0;
  cursor: pointer;
}

.cart-button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  color: #fff;
  background: #1f211f;
}

.cart-button span {
  color: rgba(255, 255, 255, 0.74);
  font-size: 13px;
}

.hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: 520px;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(185, 133, 85, 0.24);
  border-radius: 8px;
  background: #fffaf5;
  box-shadow: 0 28px 80px rgba(72, 54, 38, 0.18);
}

.hero-copy {
  position: relative;
  z-index: 2;
  width: min(520px, 60%);
  margin-left: clamp(18px, 4vw, 58px);
  padding: 38px;
}

.hero-copy::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(255, 250, 245, 0.94), rgba(255, 250, 245, 0.72));
  box-shadow: 0 24px 70px rgba(72, 54, 38, 0.16);
  backdrop-filter: blur(10px);
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 250, 245, 0.42), rgba(255, 250, 245, 0.05) 54%, rgba(255, 250, 245, 0));
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 520px;
  margin-bottom: 14px;
  font-size: clamp(34px, 4.3vw, 62px);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
}

h3 {
  margin-bottom: 14px;
  font-size: 16px;
}

.hero-text {
  max-width: 480px;
  color: #615d58;
  font-size: 15px;
  line-height: 1.68;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
}

.primary-link,
.text-button,
.checkout-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 800;
}

.primary-link,
.checkout-button {
  color: #fff;
  background: var(--accent-dark);
  box-shadow: 0 16px 36px rgba(124, 79, 50, 0.25);
}

.text-button {
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.76);
}

.hero-preview {
  position: relative;
  height: min(420px, 62vw);
  min-height: 330px;
}

.hero-image .hero-preview,
.hero-image .shanshui-preview {
  display: none;
}

.shanshui-preview {
  overflow: hidden;
  border: 1px solid rgba(185, 133, 85, 0.24);
  border-radius: 8px;
  background: #fffaf5;
  box-shadow: 0 28px 80px rgba(72, 54, 38, 0.18);
}

.shanshui-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.03);
}

.hero-preview:not(.shanshui-preview)::before {
  content: "";
  position: absolute;
  inset: 11% 4%;
  border: 2px solid rgba(124, 79, 50, 0.16);
  border-radius: 50%;
  transform: rotate(-12deg);
}

.hero-preview:not(.shanshui-preview) span {
  position: absolute;
  display: block;
  width: 122px;
  aspect-ratio: 1;
  border: 1px solid rgba(185, 133, 85, 0.28);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 102%, rgba(124, 79, 50, 0.18), transparent 35%),
    var(--hero-img) center / 112% 112% no-repeat,
    #fffaf5;
  box-shadow:
    inset 0 0 0 7px rgba(255, 250, 245, 0.26),
    inset -14px -18px 26px rgba(40, 25, 24, 0.08),
    0 0 0 8px rgba(255, 250, 245, 0.58),
    0 18px 38px rgba(69, 52, 42, 0.18);
}

.hero-preview:not(.shanshui-preview) span:nth-child(1) { --gem: var(--rose); left: 8%; top: 16%; }
.hero-preview:not(.shanshui-preview) span:nth-child(2) { --gem: var(--mint); right: 10%; top: 6%; width: 95px; }
.hero-preview:not(.shanshui-preview) span:nth-child(3) { --gem: var(--gold); right: 4%; top: 42%; }
.hero-preview:not(.shanshui-preview) span:nth-child(4) { --gem: var(--blue); left: 18%; bottom: 10%; width: 102px; }
.hero-preview:not(.shanshui-preview) span:nth-child(5) { --gem: #dab6f0; left: 46%; bottom: 0; width: 84px; }
.hero-preview:not(.shanshui-preview) span:nth-child(6) { --gem: #f5d9ad; left: 42%; top: 28%; width: 74px; }

.studio-grid {
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(420px, 1fr) minmax(260px, 330px);
  gap: 18px;
  align-items: stretch;
}

.tool-panel,
.designer-card {
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.tool-panel {
  padding: 20px;
}

.panel-title,
.designer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel-title > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin: 20px 0;
  padding: 5px;
  border-radius: 8px;
  background: #f0e7dd;
}

.segmented button {
  min-height: 36px;
  border-radius: 8px;
  color: #6a6058;
  background: transparent;
  font-size: 13px;
  font-weight: 800;
}

.segmented button.active {
  color: var(--accent-dark);
  background: #fff;
  box-shadow: 0 6px 18px rgba(82, 57, 42, 0.12);
}

.stone-list {
  display: grid;
  gap: 10px;
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
}

.stone-card {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 86px;
  padding: 10px;
  border: 1px solid rgba(185, 133, 85, 0.16);
  border-radius: 8px;
  color: inherit;
  text-align: left;
  background: rgba(255, 255, 255, 0.66);
  cursor: pointer;
}

.stone-card.active {
  border-color: rgba(124, 79, 50, 0.7);
  background: #fff;
  box-shadow: 0 12px 28px rgba(124, 79, 50, 0.12);
}

.swatch,
.bead {
  border-radius: 50%;
  background:
    radial-gradient(circle at 31% 25%, rgba(255, 255, 255, 0.95) 0 9%, transparent 10%),
    radial-gradient(circle at 36% 34%, rgba(255, 255, 255, 0.52), transparent 27%),
    var(--color);
  box-shadow:
    inset -7px -9px 16px rgba(38, 28, 32, 0.18),
    inset 8px 9px 13px rgba(255, 255, 255, 0.45),
    0 8px 18px rgba(62, 46, 39, 0.14);
}

.swatch {
  width: 48px;
  height: 48px;
}

.stone-photo {
  width: 66px;
  height: 66px;
  border: 1px solid rgba(185, 133, 85, 0.18);
  border-radius: 8px;
  object-fit: cover;
  background: #fffaf5;
  box-shadow: 0 8px 18px rgba(62, 46, 39, 0.12);
}

.stone-card strong,
.stone-card small {
  display: block;
}

.stone-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stone-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.stone-card .price {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
}

.designer-card {
  padding: 22px;
}

.icon-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.icon-actions button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(124, 79, 50, 0.12);
  border-radius: 50%;
  color: #513a2d;
  background: #fff;
}

.icon-actions button.mode-active {
  color: #fff;
  background: var(--accent-dark);
  box-shadow: 0 12px 24px rgba(124, 79, 50, 0.22);
}

.icon-actions svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.bracelet-stage {
  position: relative;
  display: grid;
  min-height: 610px;
  place-items: center;
  overflow: hidden;
}

.soft-glow {
  position: absolute;
  width: min(78%, 560px);
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.52) 46%, transparent 70%),
    conic-gradient(from 30deg, rgba(243, 182, 193, 0.24), rgba(184, 221, 202, 0.3), rgba(233, 196, 106, 0.24), rgba(184, 204, 232, 0.24), rgba(243, 182, 193, 0.24));
}

.bracelet {
  position: relative;
  z-index: 2;
  width: var(--bracelet-size, 470px);
  max-width: 100%;
  aspect-ratio: 1;
  transition: width 180ms ease;
}

.bracelet::before {
  content: "";
  position: absolute;
  inset: 18%;
  border: 2px dashed rgba(124, 79, 50, 0.16);
  border-radius: 50%;
}

.bead-slot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--bead-size, 50px);
  height: var(--bead-size, 50px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(124, 79, 50, 0.13);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  overflow: visible;
  transform:
    rotate(var(--angle))
    translateY(calc(var(--slot-radius, 190px) * -1))
    rotate(calc(var(--angle) * -1))
    translate(-50%, -50%);
  transition: border-color 160ms ease, box-shadow 160ms ease, scale 160ms ease;
  cursor: pointer;
}

.bead-slot:hover,
.bead-slot.next,
.bead-slot.drag-over {
  border-color: rgba(124, 79, 50, 0.72);
  box-shadow: 0 0 0 7px rgba(185, 133, 85, 0.12);
}

.bead {
  display: block;
  width: 112%;
  height: 112%;
  max-width: none;
  border-radius: 50%;
}

.bead-image {
  aspect-ratio: 1 / 1;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.remove-mark {
  position: absolute;
  right: -3px;
  top: -4px;
  display: none;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  background: #b64a42;
  box-shadow: 0 8px 18px rgba(105, 52, 43, 0.25);
}

.delete-mode .filled .remove-mark {
  display: flex;
}

.delete-mode .filled {
  border-color: rgba(182, 74, 66, 0.76);
  box-shadow: 0 0 0 7px rgba(182, 74, 66, 0.12);
}

.empty-dot {
  position: absolute;
  inset: 38%;
  border-radius: 50%;
  background: rgba(124, 79, 50, 0.25);
}

.center-label {
  position: absolute;
  z-index: 1;
  display: grid;
  width: 170px;
  height: 170px;
  place-content: center;
  border: 1px solid rgba(124, 79, 50, 0.14);
  border-radius: 50%;
  text-align: center;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: inset 0 0 32px rgba(255, 255, 255, 0.8);
}

.center-label span {
  padding: 0 16px;
  font-size: 18px;
  font-weight: 900;
}

.center-label small {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.size-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(124, 79, 50, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
}

.bead-size-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  margin-top: 12px;
  padding: 16px;
  border: 1px solid rgba(124, 79, 50, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
}

.bead-size-row > span {
  font-weight: 900;
}

.bead-size-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.bead-size-options button {
  min-height: 38px;
  border-radius: 999px;
  color: #6a6058;
  background: #f0e7dd;
  font-size: 13px;
  font-weight: 900;
}

.bead-size-options button.active {
  color: #fff;
  background: var(--accent-dark);
}

.size-row label,
.size-row output {
  font-weight: 900;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent-dark);
}

.summary-stack {
  display: grid;
  gap: 10px;
  margin: 22px 0;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.summary-item span {
  color: var(--muted);
}

.summary-item strong {
  color: var(--accent-dark);
}

.pattern-box {
  min-height: 240px;
  padding: 16px;
  border: 1px solid rgba(124, 79, 50, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.pattern-box ol {
  display: grid;
  gap: 8px;
  max-height: 330px;
  margin: 0;
  overflow: auto;
  padding-left: 22px;
  color: #5d5650;
  font-size: 14px;
}

.checkout-button {
  width: 100%;
  margin-top: 18px;
}

.confirm-style-button {
  width: 100%;
  min-height: 50px;
  margin-top: 14px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: #1f211f;
  box-shadow: 0 16px 36px rgba(31, 33, 31, 0.18);
  cursor: pointer;
  font-weight: 900;
}

.confirm-style-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.bracelet.assembling .bead-slot {
  animation: beadAssemble 880ms ease both;
}

.bracelet.assembled .bead-slot.filled {
  box-shadow: 0 0 0 4px rgba(185, 133, 85, 0.16), 0 12px 24px rgba(72, 54, 38, 0.18);
}

@keyframes beadAssemble {
  0% {
    scale: 0.78;
    filter: blur(2px);
    opacity: 0.45;
  }
  60% {
    scale: 1.12;
    filter: blur(0);
    opacity: 1;
  }
  100% {
    scale: 1;
  }
}

.final-order-panel {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(124, 79, 50, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.final-order-panel[hidden] {
  display: none;
}

.final-order-panel img {
  display: block;
  width: 100%;
  margin-top: 10px;
  border: 1px solid rgba(124, 79, 50, 0.12);
  border-radius: 8px;
  background: #fffaf5;
}

.customer-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.customer-form label {
  display: grid;
  gap: 6px;
  color: #5d5650;
  font-size: 13px;
  font-weight: 800;
}

.customer-form input,
.customer-form textarea {
  width: 100%;
  border: 1px solid rgba(124, 79, 50, 0.16);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  outline: none;
}

.customer-form input:focus,
.customer-form textarea:focus {
  border-color: rgba(124, 79, 50, 0.62);
  box-shadow: 0 0 0 4px rgba(185, 133, 85, 0.12);
}

.summary-stack.compact {
  margin: 12px 0 0;
}

.fine-print {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 1120px) {
  .studio-grid {
    grid-template-columns: 1fr 1fr;
  }

  .designer-card {
    grid-column: 1 / -1;
    grid-row: 1;
  }
}

@media (max-width: 760px) {
  .page-shell {
    padding: 10px;
  }

  .site-header {
    align-items: stretch;
    border-radius: 8px;
    flex-wrap: wrap;
  }

  .header-nav {
    order: 3;
    width: 100%;
  }

  .header-nav a {
    flex: 1;
    text-align: center;
  }

  .cart-button {
    margin-left: auto;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    min-height: 430px;
    padding: 0;
  }

  .hero-copy {
    width: calc(100% - 28px);
    margin: 14px;
    padding: 24px;
  }

  h1 {
    font-size: 38px;
  }

  .hero-preview {
    min-height: 270px;
  }

  .hero-preview span {
    width: 86px;
  }

  .studio-grid {
    grid-template-columns: 1fr;
  }

  .designer-card {
    grid-column: auto;
  }

  .bracelet-stage {
    min-height: 470px;
  }

  .bracelet {
    width: var(--bracelet-size, 420px);
    max-width: 100%;
  }

  .center-label {
    width: 134px;
    height: 134px;
  }

  .center-label span {
    font-size: 15px;
  }

  .size-row {
    grid-template-columns: 1fr auto;
  }

  .size-row input {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .bead-size-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px) {
  .brand small,
  .cart-button span {
    display: none;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-link,
  .text-button {
    width: 100%;
  }

  .segmented {
    grid-template-columns: repeat(2, 1fr);
    border-radius: 8px;
  }

  .segmented button {
    border-radius: 8px;
  }
}
