/* Bespoke Studio Journey — black & gold, matches brand home */
:root {
  --sj-ink: #0a0908;
  --sj-panel: #14110e;
  --sj-gold: #d4b483;
  --sj-gold-deep: #c4a473;
  --sj-mute: #9a8f80;
  --sj-line: rgba(212, 180, 131, 0.2);
  --sj-cream: #f3ebe0;
}

body.sj-on-journey.yy-in-studio #studioEntry {
  display: none !important;
}
body.sj-on-journey.yy-in-studio #designerWorkspace {
  display: none !important;
}
/* 必須維持 grid，否則珠庫會掉到預覽下方且像「沒有珠子可選」 */
body.sj-on-journey.yy-in-studio.sj-step-craft #designerWorkspace,
body.sj-on-journey.yy-in-studio.sj-step-reveal #designerWorkspace {
  display: grid !important;
}
body.sj-on-journey.yy-in-studio.sj-step-reveal .sj-craft-only {
  opacity: 0.55;
}

/* 搭配步驟：永遠顯示「前往選珠」，避免只看到預覽 */
body.sj-step-craft .catalog-scroll-hint,
body.sj-step-reveal .catalog-scroll-hint {
  display: flex !important;
  justify-content: center;
  margin: 8px 0 4px;
}
body.sj-step-craft .catalog-scroll-hint button,
body.sj-step-reveal .catalog-scroll-hint button {
  border: 1px solid rgba(212, 180, 131, 0.45);
  background: linear-gradient(135deg, rgba(212, 180, 131, 0.2), rgba(196, 164, 115, 0.12));
  color: #e8dcc8;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  font-family: inherit;
}
body.sj-step-craft #diyPanel {
  scroll-margin-top: 72px;
}

.sj-root {
  display: none;
  max-width: 720px;
  margin: 0 auto 28px;
  padding: 8px 0 32px;
}
body.sj-on-journey.yy-in-studio .sj-root {
  display: block;
}

.sj-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  justify-content: center;
  margin: 0 0 22px;
  padding: 0 8px;
}
.sj-progress button {
  background: none;
  border: none;
  color: var(--sj-mute);
  font-size: 11px;
  letter-spacing: 0.08em;
  cursor: pointer;
  padding: 4px 0;
  font-family: inherit;
}
.sj-progress button.is-active {
  color: var(--sj-gold);
}
.sj-progress button.is-done {
  color: rgba(212, 180, 131, 0.7);
}
.sj-progress button:disabled {
  cursor: default;
  opacity: 0.45;
}

.sj-panel {
  display: none;
  animation: sjIn 0.35s ease;
}
.sj-panel.is-active {
  display: block;
}
@keyframes sjIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.sj-eyebrow {
  margin: 0 0 8px;
  text-align: center;
  color: var(--sj-gold);
  letter-spacing: 0.28em;
  font-size: 11px;
  text-transform: uppercase;
}
.sj-title {
  margin: 0 0 10px;
  text-align: center;
  font-family: "Cormorant Garamond", "Noto Serif TC", serif;
  font-size: clamp(26px, 6vw, 34px);
  font-weight: 500;
  letter-spacing: 0.06em;
  color: #f3ebe0;
  line-height: 1.35;
}
.sj-lead {
  margin: 0 auto 24px;
  max-width: 28em;
  text-align: center;
  color: var(--sj-mute);
  font-size: 14px;
  line-height: 1.8;
}

.sj-intent-grid {
  display: grid;
  gap: 12px;
}
@media (min-width: 720px) {
  .sj-intent-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.sj-intent-card {
  text-align: left;
  background: linear-gradient(160deg, #1a1714 0%, #100e0c 100%);
  border: 1px solid var(--sj-line);
  border-radius: 16px;
  padding: 18px 16px;
  color: inherit;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}
.sj-intent-card:hover {
  border-color: rgba(212, 180, 131, 0.45);
  transform: translateY(-1px);
}
.sj-intent-card.is-primary {
  border-color: rgba(212, 180, 131, 0.55);
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(212, 180, 131, 0.14), transparent 55%),
    linear-gradient(160deg, #1e1a16 0%, #12100e 100%);
}
.sj-intent-card h3 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #e8dcc8;
}
.sj-intent-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--sj-mute);
}
.sj-intent-card .sj-tag {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--sj-gold);
}

.sj-finish-grid {
  display: grid;
  gap: 12px;
}
.sj-finish-card {
  position: relative;
  text-align: left;
  background: #14110e;
  border: 1px solid var(--sj-line);
  border-radius: 16px;
  padding: 18px 16px;
  color: inherit;
  cursor: pointer;
  font-family: inherit;
}
.sj-finish-card.is-recommended {
  border-color: rgba(212, 180, 131, 0.55);
  box-shadow: 0 0 0 1px rgba(212, 180, 131, 0.12);
}
.sj-finish-card .sj-rec {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: #0d0c0b;
  background: linear-gradient(135deg, var(--sj-gold), var(--sj-gold-deep));
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 700;
}
.sj-finish-card h3 {
  margin: 0 0 4px;
  font-size: 18px;
  color: #e8dcc8;
  letter-spacing: 0.04em;
}
.sj-finish-card .sj-en {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--sj-gold);
  letter-spacing: 0.14em;
  font-family: "Cormorant Garamond", serif;
}
.sj-finish-card p {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--sj-mute);
}
.sj-finish-card .sj-from {
  font-size: 12px;
  color: rgba(212, 180, 131, 0.75);
}

.sj-stone-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 0 0 16px;
}
.sj-chip {
  border: 1px solid var(--sj-line);
  background: rgba(0, 0, 0, 0.25);
  color: var(--sj-mute);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
.sj-chip.is-active {
  color: #0d0c0b;
  background: linear-gradient(135deg, var(--sj-gold), var(--sj-gold-deep));
  border-color: transparent;
}

.sj-stone-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (min-width: 720px) {
  .sj-stone-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.sj-stone-card {
  background: #14110e;
  border: 1px solid var(--sj-line);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.sj-stone-card .sj-img {
  aspect-ratio: 1;
  background: #0a0908;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.sj-stone-card .sj-img img {
  width: 72%;
  height: 72%;
  object-fit: contain;
  border-radius: 50%;
}
.sj-stone-card .sj-body {
  padding: 12px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.sj-stone-card h3 {
  margin: 0;
  font-size: 14px;
  color: #e8dcc8;
  letter-spacing: 0.04em;
  line-height: 1.4;
}
.sj-stone-card .sj-meta {
  margin: 0;
  font-size: 11px;
  color: var(--sj-mute);
}
.sj-stone-card .sj-why {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: rgba(243, 235, 224, 0.72);
  flex: 1;
}
.sj-stone-card .sj-price {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--sj-gold);
  font-weight: 700;
}
.sj-stone-card .sj-cta {
  margin-top: 8px;
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 10px 8px;
  background: linear-gradient(135deg, var(--sj-gold), var(--sj-gold-deep));
  color: #0d0c0b;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  cursor: pointer;
  font-family: inherit;
}

.sj-empty {
  text-align: center;
  color: var(--sj-mute);
  font-size: 13px;
  padding: 28px 12px;
  line-height: 1.7;
}

.sj-selected-bar {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--sj-line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  display: flex;
  gap: 12px;
  align-items: center;
}
.sj-selected-bar img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: #0a0908;
}
.sj-selected-bar .sj-sel-text {
  min-width: 0;
}
.sj-selected-bar strong {
  display: block;
  color: #e8dcc8;
  font-size: 14px;
}
.sj-selected-bar span {
  color: var(--sj-mute);
  font-size: 12px;
}

.sj-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 22px;
}
.sj-btn {
  min-height: 44px;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  letter-spacing: 0.08em;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
}
.sj-btn-primary {
  border: none;
  background: linear-gradient(135deg, var(--sj-gold), var(--sj-gold-deep));
  color: #0d0c0b;
}
.sj-btn-secondary {
  border: 1px solid rgba(212, 180, 131, 0.4);
  background: transparent;
  color: var(--sj-gold);
}
.sj-btn-ghost {
  border: none;
  background: none;
  color: var(--sj-mute);
  font-weight: 500;
  text-decoration: underline;
}

.sj-craft-banner {
  display: none;
  margin: 0 0 14px;
  padding: 14px 14px 12px;
  border: 1px solid var(--sj-line);
  border-radius: 14px;
  background: rgba(20, 17, 14, 0.92);
}
body.sj-step-craft .sj-craft-banner,
body.sj-step-reveal .sj-craft-banner {
  display: block;
}
.sj-craft-banner .sj-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  justify-content: space-between;
}
.sj-craft-banner p {
  margin: 0;
  font-size: 13px;
  color: var(--sj-mute);
  line-height: 1.6;
}
.sj-craft-banner strong {
  color: #e8dcc8;
}

.sj-preview-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 10px 0 12px;
}
.sj-preview-tabs button {
  border: 1px solid var(--sj-line);
  background: rgba(0, 0, 0, 0.3);
  color: var(--sj-mute);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
.sj-preview-tabs button.is-active {
  color: #0d0c0b;
  background: linear-gradient(135deg, var(--sj-gold), var(--sj-gold-deep));
  border-color: transparent;
}
.sj-scene-chips {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 0 0 12px;
}

.sj-lifestyle {
  display: none;
  margin: 0 auto 12px;
  max-width: 420px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--sj-line);
  background: #0a0908;
  position: relative;
}
body.sj-preview-lifestyle .sj-lifestyle {
  display: block;
}
/* 佩戴圖嵌進預覽舞台，取代結構圈 */
body.sj-preview-lifestyle #previewSection .studio-ring-stage > .preview-ring-wrap,
body.sj-preview-lifestyle #previewSection .studio-ring-stage > .ring-capacity-line,
body.sj-preview-lifestyle #previewSection .studio-ring-stage > .preview-drop-hint,
body.sj-preview-lifestyle #previewSection .studio-ring-stage > .catalog-scroll-hint {
  display: none !important;
}
body.sj-preview-lifestyle #previewSection .studio-ring-stage > .sj-lifestyle {
  display: block !important;
  max-width: 100%;
  margin: 0 auto 8px;
  border-radius: 12px;
}
body.sj-preview-lifestyle.sj-step-craft #previewSection .preview-ring-wrap,
body.sj-preview-lifestyle.sj-step-reveal #previewSection .preview-ring-wrap {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}
.sj-lifestyle-bg {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center center;
}
.sj-lifestyle[data-scene="table"] .sj-lifestyle-bg {
  aspect-ratio: 1 / 1;
  object-position: center;
}
.sj-lifestyle canvas {
  position: absolute;
  left: 50%;
  top: 48%;
  width: min(58%, 240px);
  height: auto;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45));
  pointer-events: none;
  opacity: 1;
}
/* 極簡焦點：主石短弧，對齊腕關節外側 */
.sj-lifestyle[data-scene="wrist"][data-overlay="focal"] canvas {
  left: 52%;
  top: 51%;
  width: min(28%, 124px);
  transform: translate(-50%, -50%) rotate(38deg) scaleY(0.8);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
  opacity: 1;
}
/* 滿手圍：可拖曳旋轉；貼腕可見弧（遠側遮擋） */
.sj-lifestyle[data-scene="wrist"][data-overlay="wrap"] {
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: auto;
}
.sj-lifestyle[data-scene="wrist"][data-overlay="wrap"] .sj-lifestyle-bg {
  pointer-events: none;
  -webkit-user-drag: none;
  user-drag: none;
}
.sj-lifestyle[data-scene="wrist"][data-overlay="wrap"].is-spinning {
  cursor: grabbing;
}
.sj-lifestyle[data-scene="wrist"][data-overlay="wrap"] canvas {
  /* 上下 40%；左側再略鬆 */
  left: 58%;
  top: 40%;
  width: min(39%, 156px);
  transform: translate(-50%, -50%) rotate(36deg);
  filter: none;
  opacity: 1;
  pointer-events: none;
}
.sj-spin-bar {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 4px 0 2px;
  position: relative;
  left: auto;
  bottom: auto;
  transform: none;
  z-index: 5;
  pointer-events: auto;
}
.sj-spin-bar button {
  border: 1px solid rgba(212, 180, 131, 0.55);
  background: rgba(10, 9, 8, 0.72);
  color: #e8dcc8;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.sj-spin-bar[hidden] {
  display: none !important;
}
.sj-spin-hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  padding: 4px 10px;
  border: 1px solid rgba(212, 175, 110, 0.35);
  border-radius: 999px;
  background: rgba(10, 9, 8, 0.55);
  color: #e8dcc8;
  font-size: 11px;
  letter-spacing: 0.08em;
  pointer-events: none;
  z-index: 2;
}
.sj-lifestyle:not([data-overlay="wrap"]) .sj-spin-hint {
  display: none;
}
.sj-lifestyle-caption {
  padding: 10px 12px 12px;
  text-align: center;
  font-size: 12px;
  color: var(--sj-mute);
  line-height: 1.55;
}

.sj-reveal-summary {
  margin: 16px 0 0;
  padding: 16px;
  border: 1px solid var(--sj-line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
}
.sj-reveal-summary h3 {
  margin: 0 0 10px;
  font-size: 16px;
  color: #e8dcc8;
  letter-spacing: 0.06em;
  text-align: center;
}
.sj-reveal-summary ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sj-reveal-summary li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 13px;
  color: var(--sj-mute);
}
.sj-reveal-summary li span:last-child {
  color: #e8dcc8;
  text-align: right;
}
.sj-reveal-total {
  margin-top: 12px;
  text-align: center;
  font-size: 18px;
  color: var(--sj-gold);
  font-weight: 700;
}

@media (max-width: 767px) {
  .sj-root {
    padding: 4px 4px 24px;
  }
  /*
   * 手機選珠：改用 fixed 釘住精簡預覽（sticky 在 iOS／長頁會失效）。
   * 搭配 JS spacer，避免珠庫被蓋住。
   */
  body.sj-preview-lifestyle.sj-step-craft #previewSection.studio-live,
  body.sj-preview-lifestyle.sj-step-reveal #previewSection.studio-live {
    position: fixed !important;
    top: var(--sticky-top, 0px);
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    max-height: none;
    overflow: visible;
    z-index: 40;
    margin: 0;
    padding: 6px 10px 6px !important;
    border-radius: 0 0 14px 14px;
    background: linear-gradient(180deg, rgba(18, 16, 14, 0.98) 0%, rgba(14, 12, 10, 0.96) 100%);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
    box-sizing: border-box;
    transform: none !important;
    -webkit-transform: none !important;
  }
  body.sj-preview-lifestyle #previewSection .studio-ring-stage {
    overflow: visible;
    place-items: stretch;
    width: 100%;
    margin-bottom: 2px;
  }
  body.sj-preview-lifestyle #previewSection .studio-ring-stage > .sj-lifestyle {
    display: block !important;
    width: 100%;
    max-width: 100%;
    margin: 0 auto 2px;
    border-radius: 10px;
  }
  /* 精簡：矮預覽，選珠時螢幕留給珠庫 */
  body.sj-preview-lifestyle:not(.sj-preview-expanded) .sj-lifestyle-bg {
    width: 100%;
    height: min(16vh, 118px);
    aspect-ratio: auto;
    object-fit: cover;
    object-position: 58% 38%;
  }
  body.sj-preview-lifestyle:not(.sj-preview-expanded) .sj-lifestyle[data-scene="table"] .sj-lifestyle-bg {
    height: min(14vh, 108px);
    object-position: center;
  }
  body.sj-preview-lifestyle:not(.sj-preview-expanded) .sj-lifestyle-caption {
    display: none;
  }
  body.sj-preview-lifestyle:not(.sj-preview-expanded) .sj-spin-hint {
    display: none;
  }
  /* 精簡模式隱藏旋轉列（仍可拖曳圖上旋轉），省垂直空間 */
  body.sj-preview-lifestyle:not(.sj-preview-expanded) .sj-spin-bar {
    display: none !important;
  }
  body.sj-preview-lifestyle .sj-spin-bar {
    margin: 2px 0 4px;
  }
  body.sj-preview-lifestyle .sj-spin-bar button {
    padding: 8px 14px;
    font-size: 12px;
    min-height: 36px;
  }
  body.sj-preview-lifestyle:not(.sj-preview-expanded) .sj-lifestyle[data-scene="wrist"][data-overlay="wrap"] canvas {
    left: 59%;
    top: 42%;
    width: min(43%, 118px);
  }
  body.sj-preview-lifestyle:not(.sj-preview-expanded) .sj-lifestyle[data-scene="wrist"][data-overlay="focal"] canvas {
    left: 56%;
    top: 50%;
    width: min(38%, 100px);
  }
  /* 展開大圖時仍 fixed，但加高 */
  body.sj-preview-lifestyle.sj-preview-expanded .sj-lifestyle-bg {
    width: 100%;
    height: min(48vh, 360px);
    aspect-ratio: auto;
    object-fit: cover;
    object-position: 58% 38%;
  }
  body.sj-preview-lifestyle.sj-preview-expanded .sj-lifestyle-caption {
    display: block;
    padding: 6px 8px 8px;
    font-size: 11px;
  }
  body.sj-preview-lifestyle.sj-preview-expanded .sj-spin-hint {
    bottom: 34px;
  }
  body.sj-preview-lifestyle.sj-preview-expanded .sj-lifestyle[data-scene="wrist"][data-overlay="wrap"] canvas {
    left: 58%;
    top: 40%;
    width: min(39%, 150px);
  }
  /* 展開時隱藏過長 meta，節省空間 */
  body.sj-preview-lifestyle:not(.sj-preview-expanded) #previewSection .studio-fit-toggle,
  body.sj-preview-lifestyle:not(.sj-preview-expanded) #previewSection .studio-meta-sub,
  body.sj-preview-lifestyle:not(.sj-preview-expanded) #previewSection .studio-live-info {
    display: none !important;
  }
  .sj-preview-expand {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 2px 0 2px;
  }
  .sj-preview-expand button {
    border: 1px solid rgba(212, 180, 131, 0.4);
    background: rgba(212, 180, 131, 0.12);
    color: #e8dcc8;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    font-family: inherit;
  }
  body:not(.sj-preview-lifestyle) .sj-preview-expand {
    display: none !important;
  }
  #sjPreviewSpacer {
    display: block;
    width: 100%;
    pointer-events: none;
  }
  body:not(.sj-preview-lifestyle) #sjPreviewSpacer {
    display: none !important;
    height: 0 !important;
  }
  body.sj-preview-lifestyle.sj-step-craft #diyPanel,
  body.sj-preview-lifestyle.sj-step-reveal #diyPanel {
    scroll-margin-top: calc(var(--sticky-top, 0px) + 150px);
  }
  .sj-back-preview {
    display: none !important; /* fixed 預覽常駐，不需回預覽鈕 */
  }

  /* Studio 內客服改明確浮動：固定於視窗、高於預覽釘住層，不隨頁面捲動 */
  body.sj-on-journey .yy-cs-root {
    position: fixed !important;
    left: 12px !important;
    right: auto !important;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 1300 !important;
    pointer-events: none;
  }
  body.sj-on-journey .yy-cs-root .yy-cs-fab,
  body.sj-on-journey .yy-cs-root .yy-cs-panel {
    pointer-events: auto;
  }
  body.sj-on-journey .yy-cs-fab {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(212, 180, 131, 0.28);
  }
}

@media (min-width: 768px) {
  .sj-preview-expand,
  .sj-back-preview,
  #sjPreviewSpacer {
    display: none !important;
  }
}
