:root {
  --ink: #192026;
  --muted: #68717b;
  --line: #dce2e7;
  --paper: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #eef4f7;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --rose: #be5c7d;
  --amber: #b7791f;
  --violet: #6f3cff;
  --shadow: 0 20px 60px rgba(25, 32, 38, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 52px);
  border-bottom: 1px solid rgba(25, 32, 38, 0.1);
  background: rgba(246, 248, 251, 0.92);
  backdrop-filter: blur(18px);
}

.brand,
.nav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 850;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: var(--surface);
}

.nav {
  justify-content: center;
  gap: 22px;
  color: var(--muted);
  font-size: 0.94rem;
}

.nav a {
  text-decoration: none;
}

.nav a:hover {
  color: var(--ink);
}

.cart-button,
.checkout-button,
.primary-action,
.soft-action,
.icon-button,
.material-button,
.kit-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
}

.cart-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}

.cart-button strong {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
}

.studio {
  padding: clamp(28px, 5vw, 58px) clamp(18px, 4vw, 52px) 42px;
}

.studio-intro {
  max-width: 880px;
  margin-bottom: 26px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--rose);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.studio-intro h1,
.panel-head h2,
.control-title h2,
.section-head h2,
.cart-head h2 {
  margin: 0;
  letter-spacing: 0;
}

.studio-intro h1 {
  font-size: clamp(2.5rem, 5vw, 4.7rem);
  line-height: 0.98;
}

.studio-intro p:not(.eyebrow) {
  max-width: 720px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.75;
}

.studio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 22px;
  align-items: start;
}

.preview-panel,
.controls-panel,
.shop {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.preview-panel {
  min-width: 0;
  padding: clamp(18px, 3vw, 28px);
}

.panel-head,
.section-head,
.cart-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 18px;
}

.panel-head h2,
.control-title h2,
.section-head h2,
.cart-head h2 {
  font-size: 1.42rem;
}

.fit-badge {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #e8f5f1;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.bracelet-stage {
  position: relative;
  overflow: hidden;
  min-height: clamp(360px, 48vw, 560px);
  margin: 22px 0;
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(231, 239, 244, 0.92)),
    radial-gradient(circle at 25% 20%, rgba(190, 92, 125, 0.12), transparent 28%),
    radial-gradient(circle at 78% 72%, rgba(15, 118, 110, 0.16), transparent 30%);
}

.bracelet-stage::before {
  content: "";
  position: absolute;
  inset: 12%;
  border: 1px solid rgba(25, 32, 38, 0.08);
  border-radius: 999px;
}

.wrist-core {
  position: absolute;
  inset: 24% 28%;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(245, 217, 201, 0.82), rgba(226, 177, 153, 0.72)),
    #ead1c3;
  box-shadow: inset 0 0 35px rgba(112, 72, 58, 0.16);
  color: rgba(25, 32, 38, 0.72);
  font-weight: 850;
}

.bracelet-ring {
  position: absolute;
  inset: 0;
}

.bead {
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: var(--fill);
  box-shadow:
    inset -8px -10px 14px rgba(25, 32, 38, 0.18),
    inset 7px 7px 12px rgba(255, 255, 255, 0.72),
    0 10px 22px rgba(25, 32, 38, 0.16),
    0 0 18px var(--glow);
  transform: translate(-50%, -50%);
}

.bead::after {
  content: "";
  position: absolute;
  width: 22%;
  height: 22%;
  top: 18%;
  left: 22%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  filter: blur(0.5px);
}

.empty-note {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 750;
  text-align: center;
  padding: 28px;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.spec-grid div {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.spec-grid span {
  color: var(--muted);
  font-size: 0.82rem;
}

.spec-grid strong {
  font-size: 1.04rem;
}

.sequence-strip {
  display: flex;
  gap: 8px;
  min-height: 42px;
  margin-top: 16px;
  overflow-x: auto;
  padding: 2px 0 10px;
}

.sequence-bead {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(25, 32, 38, 0.08);
  border-radius: 50%;
  background: var(--fill);
  box-shadow:
    inset -5px -6px 10px rgba(25, 32, 38, 0.16),
    inset 4px 4px 8px rgba(255, 255, 255, 0.7);
}

.controls-panel {
  display: grid;
  gap: 0;
  overflow: hidden;
}

.control-section {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.control-section:last-child {
  border-bottom: 0;
}

.control-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.control-title span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 850;
}

.field,
.product-toolbar label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 760;
}

.range-row {
  display: grid;
  grid-template-columns: 1fr 84px auto;
  align-items: center;
  gap: 10px;
}

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

input[type="number"],
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

input[type="number"] {
  padding: 0 10px;
}

select {
  padding: 0 34px 0 12px;
}

.range-row em {
  color: var(--muted);
  font-style: normal;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.material-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.material-button {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.material-button[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--fill);
  box-shadow:
    inset -5px -6px 9px rgba(25, 32, 38, 0.16),
    inset 4px 4px 7px rgba(255, 255, 255, 0.72);
}

.material-button strong,
.material-button small {
  display: block;
}

.material-button small {
  color: var(--muted);
  font-size: 0.76rem;
}

.material-detail {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  line-height: 1.55;
}

.material-detail strong {
  color: var(--ink);
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.primary-action,
.checkout-button {
  background: var(--accent);
  color: #fff;
  font-weight: 850;
}

.primary-action:hover,
.checkout-button:hover {
  background: var(--accent-strong);
}

.soft-action {
  background: var(--surface-soft);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}

.wide {
  width: 100%;
}

.shop {
  margin: 18px clamp(18px, 4vw, 52px) 56px;
  padding: clamp(18px, 3vw, 28px);
}

.section-head {
  margin-bottom: 18px;
}

.section-head p:not(.section-kicker) {
  max-width: 620px;
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.kit-card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.kit-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 160px;
  background:
    linear-gradient(145deg, #eef4f7, #fff),
    radial-gradient(circle at 25% 30%, rgba(183, 121, 31, 0.16), transparent 30%);
}

.kit-preview .sequence-bead {
  width: 38px;
  height: 38px;
}

.kit-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.kit-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.kit-meta h3,
.kit-body p {
  margin: 0;
}

.kit-meta strong {
  white-space: nowrap;
}

.kit-body p {
  min-height: 48px;
  color: var(--muted);
  line-height: 1.55;
}

.kit-button {
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  justify-content: end;
  background: rgba(25, 32, 38, 0.36);
}

.cart-drawer.is-open {
  display: flex;
}

.cart-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(440px, 100%);
  height: 100%;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.cart-head {
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.icon-button {
  width: 42px;
  background: var(--surface-soft);
  color: var(--ink);
}

.cart-items {
  display: grid;
  align-content: start;
  gap: 12px;
  overflow: auto;
  padding: 18px 22px;
}

.cart-empty {
  margin: 0;
  color: var(--muted);
}

.cart-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.cart-line h3,
.cart-line p {
  margin: 0;
}

.cart-line h3 {
  font-size: 1rem;
}

.cart-line p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.qty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.qty button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.cart-footer {
  display: grid;
  gap: 16px;
  padding: 18px 22px 22px;
  border-top: 1px solid var(--line);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.12rem;
}

@media (max-width: 1080px) {
  .studio-layout,
  .shop-grid {
    grid-template-columns: 1fr;
  }

  .controls-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .control-section {
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .control-section:last-child {
    border-right: 0;
  }
}

@media (max-width: 820px) {
  .controls-panel,
  .spec-grid {
    grid-template-columns: 1fr 1fr;
  }

  .control-section {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .control-section:last-child {
    border-bottom: 0;
  }

  .field-grid,
  .material-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .nav {
    display: none;
  }

  .studio-intro h1 {
    font-size: 2.55rem;
  }

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

  .wrist-core {
    inset: 31% 22%;
  }

  .controls-panel,
  .spec-grid,
  .section-head {
    grid-template-columns: 1fr;
  }

  .panel-head,
  .section-head {
    flex-direction: column;
  }

  .range-row {
    grid-template-columns: 1fr 78px auto;
  }
}
