/* 自研產品：整頁唯一的暖色塊。用嘿零豆 Healing 自己的米白和杏色，像深色頁面上開了一扇亮著的窗。
   這裡的顏色只在本區塊使用。 */
#product {
  --pd-paper: #f7f3ec;
  --pd-mat: #efe8dd;
  --pd-ink: #2f2a25;
  --pd-ink-2: #625a52;
  --pd-ink-3: #776e65;
  --pd-line: #e2d8ca;
  --pd-apricot: #ef9f55;
  --pd-apricot-soft: #fbe6d1;
  --pd-ease: cubic-bezier(0.22, 1, 0.36, 1);
  isolation: isolate;
}
/* 窗裡的光漫到窗外的深色檯面上 */
#product::before {
  content: ""; position: absolute; inset: 8% 0; z-index: -1; pointer-events: none;
  background: radial-gradient(52% 46% at 50% 50%, rgba(239, 159, 85, .10), rgba(239, 159, 85, 0) 72%);
}

#product .pd-window {
  position: relative;
  background: var(--pd-paper); color: var(--pd-ink);
  border-radius: 24px;
  padding: clamp(28px, 4.6vw, 64px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .05), 0 50px 120px -50px rgba(239, 159, 85, .38);
  overflow: hidden;
}

/* 上半：左文案，右物件 */
#product .pd-top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 72px); align-items: center; }

#product .pd-tag { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; border-radius: 999px;
  background: var(--pd-apricot-soft); color: #8a4d17; font-size: 13px; font-weight: 600; letter-spacing: .06em; }
#product .pd-tag i { width: 6px; height: 6px; border-radius: 50%; background: var(--pd-apricot); }
#product .pd-mark { width: auto; height: clamp(44px, 4.4vw, 60px); margin-top: 26px; }
#product .pd-h2 { margin-top: 18px; font-size: var(--fs-h2); line-height: 1.15; color: var(--pd-ink); }
#product .pd-lead { margin-top: 20px; font-size: 17px; line-height: 1.85; color: var(--pd-ink-2); max-width: 30em; }
#product .pd-facts { margin: 32px 0 0; border-top: 1px solid var(--pd-line); }
#product .pd-facts > div { display: grid; grid-template-columns: 4em 1fr; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--pd-line); font-size: 15px; }
#product .pd-facts dt { color: var(--pd-ink-3); }
#product .pd-facts dd { margin: 0; color: var(--pd-ink); }

/* 物件：拼豆工作臺 */
#product .pd-maker { margin: 0; min-width: 0; }
#product .pd-stage {
  position: relative; aspect-ratio: 1 / 1.04; overflow: hidden;
  touch-action: pan-y; cursor: ew-resize; user-select: none; -webkit-user-select: none;
}
#product .pd-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#product .pd-side { position: absolute; top: 16px; height: 28px; padding: 0 12px; display: inline-flex; align-items: center; border-radius: 999px;
  font-size: 13px; font-weight: 600; background: rgba(255, 253, 249, .92); color: var(--pd-ink-2); box-shadow: 0 1px 0 rgba(98, 74, 52, .08);
  transition: opacity .3s var(--pd-ease); pointer-events: none; }
#product .pd-side--l { left: 16px; }
#product .pd-side--r { right: 16px; }
#product .pd-side [data-ml] { display: none; }
#product .pd-side [data-ml].is-on { display: inline; }
#product .pd-split { position: absolute; top: 0; bottom: 0; left: 0; width: 2px; margin-left: -1px; background: var(--pd-ink); opacity: .82; pointer-events: none; }
#product .pd-handle {
  position: absolute; top: 50%; left: 0; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%;
  display: grid; place-items: center; background: var(--pd-ink); color: #fff8ee; cursor: ew-resize;
  box-shadow: 0 6px 18px -6px rgba(47, 42, 37, .55); transition: transform .2s var(--pd-ease);
}
#product .pd-handle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#product .pd-handle:hover, #product .pd-stage.is-dragging .pd-handle { transform: scale(1.06); }
#product .pd-handle:focus-visible { outline: 2px solid var(--pd-apricot); outline-offset: 3px; }
@keyframes pd-nudge { 0%, 100% { transform: translateX(0); } 30% { transform: translateX(-7px); } 60% { transform: translateX(5px); } }
#product .pd-handle.is-hint svg { animation: pd-nudge 1.1s var(--pd-ease) 2; }

/* 舞臺下：圖紙名和真實讀數，右邊切換左側效果 */
#product .pd-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-top: 18px; }
#product .pd-readout { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 0; }
#product .pd-title { font-size: 17px; font-weight: 650; color: var(--pd-ink); letter-spacing: -0.01em; }
#product .pd-stat { font-size: 14px; color: var(--pd-ink-3); font-variant-numeric: tabular-nums; }
#product .pd-stat b { color: var(--pd-ink); font-weight: 600; }
#product .pd-seg { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 10px; background: var(--pd-mat); }
#product .pd-seg button { height: 36px; min-width: 52px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--pd-ink-2);
  font-size: 14px; font-weight: 600; cursor: pointer; transition: background-color .2s var(--pd-ease), color .2s var(--pd-ease); font-variant-numeric: tabular-nums; }
#product .pd-seg button:hover { color: var(--pd-ink); }
#product .pd-seg button[aria-checked="true"] { background: #fffdf9; color: var(--pd-ink); box-shadow: 0 1px 2px rgba(98, 74, 52, .14), inset 0 0 0 1px rgba(239, 159, 85, .45); }
#product .pd-seg button:focus-visible { outline: 2px solid var(--pd-apricot); outline-offset: 1px; }
/* 色號圖例：這張圖紙用到的 12 個色號，按用量排，6 列兩行 */
#product .pd-legend { list-style: none; margin: 16px 0 0; padding: 14px 0 0; border-top: 1px solid var(--pd-line);
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px 12px; }
#product .pd-legend li { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 13px; line-height: 1; color: var(--pd-ink-3); font-variant-numeric: tabular-nums; }
#product .pd-legend i { flex: none; width: 14px; height: 14px; border-radius: 4px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(47, 42, 37, .12); }
#product .pd-legend b { color: var(--pd-ink); font-weight: 600; }

/* 下半：三臺手機，App 真實介面 */
#product .pd-screens { list-style: none; margin: clamp(48px, 6vw, 80px) 0 0; padding: clamp(40px, 5vw, 64px) 0 0; border-top: 1px solid var(--pd-line);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 4vw, 64px); }
#product .pd-screens figure { margin: 0; }
#product .pd-phone { aspect-ratio: 540 / 1120; border-radius: 30px; overflow: hidden; background: #fff;
  box-shadow: 0 0 0 1px rgba(98, 74, 52, .10), 0 30px 60px -32px rgba(98, 64, 34, .45);
  transition: transform .5s var(--pd-ease), box-shadow .5s var(--pd-ease); }
#product .pd-phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
#product .pd-screens li:nth-child(2) { transform: translateY(-28px); }
#product .pd-screens li:hover .pd-phone { transform: translateY(-6px); box-shadow: 0 0 0 1px rgba(98, 74, 52, .12), 0 40px 70px -32px rgba(98, 64, 34, .5); }
#product .pd-screens figcaption { margin-top: 20px; display: grid; gap: 4px; }
#product .pd-screens figcaption b { font-size: 16px; color: var(--pd-ink); }
#product .pd-screens figcaption span { font-size: 14px; color: var(--pd-ink-3); }

/* 進場：三臺手機依次升起，只播一次 */
#product .pd-screens.is-pre li { opacity: 0; translate: 0 28px; }
#product .pd-screens li { transition: opacity .8s var(--pd-ease), translate .8s var(--pd-ease); }
#product .pd-screens li:nth-child(2) { transition-delay: .1s; }
#product .pd-screens li:nth-child(3) { transition-delay: .2s; }

@media (max-width: 1080px) {
  #product .pd-top { grid-template-columns: 1fr; }
  #product .pd-copy { max-width: 40em; }
  #product .pd-stage { aspect-ratio: 1 / .9; }
}
@media (max-width: 720px) {
  #product .pd-window { border-radius: 18px; padding: 24px 18px 28px; }
  #product .pd-lead { font-size: 15px; }
  #product .pd-facts > div { grid-template-columns: 3.5em 1fr; font-size: 14px; }
  #product .pd-stage { aspect-ratio: 1 / 1.2; border-radius: 14px; }
  #product .pd-side { top: 10px; height: 26px; font-size: 12px; }
  #product .pd-side--l { left: 10px; }
  #product .pd-side--r { right: 10px; }
  #product .pd-seg button { min-width: 0; padding: 0 12px; }
  #product .pd-legend { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 8px; }
  #product .pd-legend li { font-size: 12px; gap: 6px; }
  /* 手機上三臺橫向滑動 */
  #product .pd-screens { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 16px; margin: 40px -18px 0; padding: 32px 18px 4px; scrollbar-width: none; }
  #product .pd-screens::-webkit-scrollbar { display: none; }
  #product .pd-screens li { flex: 0 0 64%; scroll-snap-align: center; }
  #product .pd-screens li:nth-child(2) { transform: none; }
  #product .pd-phone { border-radius: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  #product .pd-screens li, #product .pd-phone, #product .pd-handle { transition: none; }
  #product .pd-screens.is-pre li { opacity: 1; translate: none; }
  #product .pd-handle.is-hint svg { animation: none; }
}


/* 去產品詳情頁的入口 */
#product .pd-more-link { display: inline-flex; align-items: center; gap: 10px; margin-top: 28px; padding-bottom: 3px;
  font-size: 15px; font-weight: 600; color: var(--pd-ink); border-bottom: 1px solid var(--pd-apricot); }
#product .pd-more-link::after { content: "→"; font-weight: 400; color: #b0631f; transition: transform .3s var(--pd-ease); }
#product .pd-more-link:hover::after { transform: translateX(5px); }
