/* 全幅環景 + 霧面玻璃浮層；單一深色外觀（畫面是照片，介面只做襯底）。 */
:root {
  --glass: rgba(16, 18, 22, 0.58);
  --glass-strong: rgba(16, 18, 22, 0.86);
  --line: rgba(255, 255, 255, 0.16);
  --ink: #f3f1ec;
  --ink-dim: rgba(243, 241, 236, 0.66);
  --lamp: #ffcf7a;            /* 展場投射燈的暖光，當唯一強調色 */
  --lamp-ink: #1d1608;
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r: 12px;
  color-scheme: dark;
}
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: #0d0e10; color: var(--ink); font-family: var(--sans); overflow: hidden; }
.v-root { position: fixed; inset: 0; background: #0d0e10; }
.v-stage { position: absolute; inset: 0; touch-action: none; cursor: grab; }
.v-stage:active { cursor: grabbing; }
.v-stage canvas { display: block; width: 100%; height: 100%; }

.v-ui { position: absolute; inset: 0; pointer-events: none; }
.v-ui > * { pointer-events: auto; }
.v-ui .v-hotspots, .v-ui .v-readout, .v-ui .v-fade, .v-ui .v-hint { pointer-events: none; }

.v-btn {
  font: 500 14px/1 var(--sans); color: var(--ink); background: var(--glass);
  border: 1px solid var(--line); border-radius: 999px; padding: 10px 16px; cursor: pointer;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: background .15s, border-color .15s;
}
.v-btn:hover { background: var(--glass-strong); border-color: rgba(255,255,255,.3); }
.v-btn:focus-visible, .v-thumb:focus-visible, .v-chip:focus-visible, .v-hs:focus-visible, .v-prod-item:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; }
.v-icon { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; font-size: 18px; }

.v-top {
  position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 16px 40px;
  background: linear-gradient(rgba(0,0,0,.5), transparent);
  pointer-events: none;
}
.v-top > * { pointer-events: auto; }
.v-titles { min-width: 0; text-shadow: 0 1px 8px rgba(0,0,0,.5); }
.v-eyebrow { margin: 0 0 4px; font-size: 12px; letter-spacing: .08em; color: var(--ink-dim); }
.v-title { margin: 0; font-size: clamp(20px, 3.2vw, 28px); font-weight: 700; letter-spacing: .02em; text-wrap: balance; }
.v-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
#v-products { background: var(--lamp); color: var(--lamp-ink); border-color: transparent; font-weight: 700; }
#v-products:hover { background: #ffdc99; }

.v-readout {
  position: absolute; right: 16px; bottom: calc(150px + env(safe-area-inset-bottom, 0px));
  display: flex; gap: 10px; font: 500 11px/1 var(--mono); letter-spacing: .06em; color: var(--ink-dim);
  font-variant-numeric: tabular-nums; text-shadow: 0 1px 4px rgba(0,0,0,.6);
}

.v-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; display: grid; gap: 10px;
  padding: 40px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(transparent, rgba(0,0,0,.55));
  pointer-events: none;
}
.v-bottom > * { pointer-events: auto; }
.v-groups { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.v-chip {
  flex: none; font: 500 13px/1 var(--sans); color: var(--ink-dim); background: transparent;
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; cursor: pointer;
}
.v-chip[aria-pressed="true"] { color: var(--lamp-ink); background: var(--lamp); border-color: transparent; }
.v-strip-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.v-strip { flex: 1; min-width: 0; display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding: 2px; }
.v-thumb {
  flex: none; width: 112px; padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer;
  display: grid; gap: 4px; text-align: left; scroll-snap-align: center;
}
.v-thumb img { width: 112px; height: 64px; object-fit: cover; border-radius: 8px; border: 2px solid transparent; opacity: .72; transition: opacity .15s, border-color .15s; }
.v-thumb span { font-size: 12px; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-thumb:hover img { opacity: 1; }
.v-thumb[aria-current="true"] img { opacity: 1; border-color: var(--lamp); }
.v-thumb[aria-current="true"] span { color: var(--ink); }

/* 熱點：導航是地面光圈，商品是暖光標籤 */
.v-hotspots { position: absolute; inset: 0; overflow: hidden; }
.v-hs {
  position: absolute; left: 0; top: 0; pointer-events: auto; border: 0; background: none; padding: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--ink); font: 500 13px/1.2 var(--sans);
  margin: -22px 0 0 -60px; width: 120px; will-change: transform;
}
.v-hs span { padding: 4px 10px; border-radius: 999px; background: var(--glass-strong); white-space: nowrap; opacity: 0; transform: translateY(-4px); transition: opacity .15s, transform .15s; }
.v-hs:hover span, .v-hs:focus-visible span, .v-touched .v-hs span { opacity: 1; transform: none; }
.v-hs-nav i {
  width: 44px; height: 44px; border-radius: 50%; border: 3px solid rgba(255,255,255,.92);
  background: radial-gradient(circle, rgba(255,255,255,.35) 0 30%, rgba(255,255,255,.08) 31%);
  box-shadow: 0 0 0 1px rgba(0,0,0,.25), 0 4px 16px rgba(0,0,0,.4);
  transition: transform .15s;
}
.v-hs-nav:hover i { transform: scale(1.12); }
.v-hs-prod i {
  font: 700 13px/1 var(--mono); font-style: normal; color: var(--lamp-ink); background: var(--lamp);
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  box-shadow: 0 0 0 6px rgba(255,207,122,.28), 0 4px 16px rgba(0,0,0,.4);
}
.v-hs-prod span { opacity: 1; transform: none; }
@media (prefers-reduced-motion: no-preference) {
  .v-hs-prod i { animation: v-glow 2.4s ease-in-out infinite; }
  @keyframes v-glow { 50% { box-shadow: 0 0 0 12px rgba(255,207,122,0), 0 4px 16px rgba(0,0,0,.4); } }
}

.v-fade { position: absolute; inset: 0; background: #0d0e10; opacity: 0; transition: opacity .18s; }
.v-fade.on { opacity: 1; }
.v-hint {
  position: absolute; left: 50%; bottom: calc(150px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); margin: 0;  /* 放在縮圖列上方，不擋畫面中央的商品標籤 */
  padding: 10px 16px; border-radius: 999px; background: var(--glass); font-size: 13px; white-space: nowrap;
  transition: opacity .4s;
}
.v-touched .v-hint { opacity: 0; }
.v-toast {
  position: absolute; left: 50%; top: calc(80px + env(safe-area-inset-top, 0px)); transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 10px 16px; border-radius: var(--r); background: var(--glass-strong); font-size: 14px;
}

/* 彈窗 */
.v-modal { position: absolute; inset: 0; display: none; place-items: center; padding: 16px; background: rgba(0,0,0,.5); z-index: 5; }
.v-modal.open { display: grid; }
.v-sheet {
  width: min(960px, 100%); max-height: 100%; display: grid; grid-template-rows: auto 1fr auto; gap: 12px;
  background: var(--glass-strong); border: 1px solid var(--line); border-radius: 16px; padding: 16px;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.v-sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.v-sheet-head h2 { margin: 0; font-size: 18px; }
.v-prod-body { display: grid; grid-template-columns: 220px 1fr; gap: 12px; min-height: 0; }
.v-prod-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; align-content: start; overflow: auto; }
.v-prod-item {
  width: 100%; text-align: left; display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; cursor: pointer;
  font: 500 14px/1.3 var(--sans); color: var(--ink); background: transparent; border: 1px solid var(--line);
}
.v-prod-item small { font-size: 12px; color: var(--ink-dim); }
.v-prod-item[aria-pressed="true"] { border-color: var(--lamp); background: rgba(255,207,122,.1); }
.v-prod-canvas {
  position: relative; height: min(60vh, 520px); border-radius: var(--r); overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, #3a3d44, #17181c 75%);
}
.v-prod-canvas canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.v-prod-status { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--ink-dim); }
.v-prod-tip { position: absolute; left: 12px; bottom: 10px; margin: 0; font-size: 12px; color: var(--ink-dim); }
.v-prod-note { margin: 0; font-size: 12px; color: var(--ink-dim); }
.v-video { width: 100%; max-height: 70vh; border-radius: var(--r); background: #000; }

/* 編輯面板 */
.v-editor {
  position: absolute; top: calc(90px + env(safe-area-inset-top, 0px)); right: 16px; width: min(300px, calc(100% - 32px));
  max-height: calc(100% - 280px); overflow: auto; display: grid; gap: 8px; padding: 14px;
  background: var(--glass-strong); border: 1px solid var(--lamp); border-radius: var(--r); font-size: 13px;
}
.v-editor h2 { margin: 0; font-size: 15px; color: var(--lamp); }
.v-editor label { color: var(--ink-dim); }
.v-editor select, .v-editor input { font: 14px var(--sans); color: var(--ink); background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.ed-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ed-list li { display: flex; align-items: center; gap: 8px; }
.ed-list li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-list code { font: 11px var(--mono); color: var(--ink-dim); }
.ed-list .v-icon { width: 28px; height: 28px; font-size: 12px; }
.ed-empty { color: var(--ink-dim); }
.ed-row { display: flex; gap: 6px; flex-wrap: wrap; }

@media (max-width: 640px) {
  .v-thumb, .v-thumb img { width: 88px; }
  .v-thumb img { height: 52px; }
  .v-readout { display: none; }
  .v-prod-body { grid-template-columns: 1fr; }
  .v-prod-list { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; }
  .v-prod-canvas { height: 46vh; }
  #v-prev, #v-next { display: none; }
  .v-btn { padding: 9px 12px; }
}

.v-embed { width: min(1100px, 100%); height: min(88vh, 900px); grid-template-rows: auto 1fr; }
.v-embed iframe, .v-prod-frame { width: 100%; height: 100%; border: 0; border-radius: var(--r); background: #fff; }
.v-prod-frame { position: absolute; inset: 0; }
.v-prod-canvas:has(.v-prod-frame:not([hidden])) { height: min(70vh, 640px); }

/* 場地物件的浮動按鈕與 BOM 面板 */
.v-obj-btn {
  position: absolute; left: 0; top: 0; z-index: 2; margin: -60px 0 0 -100px; width: 200px;
  display: grid; justify-items: center; gap: 2px; padding: 8px 10px; cursor: pointer;
  font: 500 12px/1.2 var(--sans); color: var(--ink-dim); background: var(--glass-strong);
  border: 1px solid var(--line); border-radius: 12px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.v-obj-btn { cursor: default; width: auto; min-width: 140px; transform-origin: 50% 100%; }
.v-obj-actions { display: flex; gap: 6px; }
.v-obj-actions button { font: 700 13px/1 var(--sans); color: var(--lamp-ink); background: var(--lamp); border: 0; border-radius: 999px; padding: 6px 12px; cursor: pointer; white-space: nowrap; }
.v-obj-actions button + button { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.v-obj-actions button:hover { filter: brightness(1.08); }
.v-obj-actions button:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; }
.v-obj-btn::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 12px; height: 12px; margin-left: -6px; background: var(--glass-strong); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: rotate(45deg); }
.v-obj-btn:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; }
.v-bom {
  position: absolute; top: calc(84px + env(safe-area-inset-top, 0px)); right: 16px; bottom: calc(170px + env(safe-area-inset-bottom, 0px));
  width: min(320px, calc(100% - 32px)); display: grid; grid-template-rows: auto 1fr; gap: 10px; padding: 14px;
  background: var(--glass-strong); border: 1px solid var(--line); border-radius: 14px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.v-bom-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.v-bom-head h2 { margin: 0; font-size: 18px; }
.v-bom-head .v-eyebrow { font-family: var(--mono); font-size: 11px; }
.v-bom-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; align-content: start; overflow: auto; counter-reset: bom; }
.v-bom-item {
  width: 100%; display: grid; grid-template-columns: 26px 1fr auto; column-gap: 8px; row-gap: 2px; align-items: baseline; text-align: left;
  padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; font: 500 14px/1.3 var(--sans);
  counter-increment: bom;
}
.v-bom-item::before { content: counter(bom, decimal-leading-zero); font: 500 11px var(--mono); color: var(--ink-dim); grid-row: 1 / span 2; }
.v-bom-qty { font: 500 12px var(--mono); color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.v-bom-item small { grid-column: 2 / span 2; font-size: 12px; color: var(--ink-dim); font-weight: 400; }
.v-bom-item:hover, .v-bom-item[aria-pressed="true"] { border-color: var(--lamp); background: rgba(255,207,122,.1); }
.v-bom-item:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; }
.v-bom-label {
  position: absolute; left: 0; top: 0; margin: -12px 0 0 -40px; width: 80px; text-align: center; pointer-events: none;
  font: 500 12px/1 var(--sans); color: var(--ink); text-shadow: 0 1px 4px rgba(0,0,0,.8);
}
@media (max-width: 640px) {
  .v-bom { top: auto; bottom: calc(150px + env(safe-area-inset-bottom, 0px)); max-height: 40vh; }
}

.v-seat-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-content: start; overflow: auto; }
.v-seat-item {
  width: 100%; display: grid; gap: 6px; padding: 8px; border-radius: 10px; border: 1px solid var(--line); background: transparent;
  color: var(--ink); cursor: pointer; font: 500 13px/1.3 var(--sans); text-align: left;
}
.v-seat-thumb { aspect-ratio: 4 / 3; border-radius: 6px; background: radial-gradient(ellipse at 50% 40%, #3a3d44, #17181c 75%); display: grid; place-items: center; overflow: hidden; }
.v-seat-thumb img { width: 100%; height: 100%; object-fit: contain; }
.v-seat-item[aria-pressed="true"] { border-color: var(--lamp); background: rgba(255,207,122,.1); }
.v-seat-item[aria-busy="true"] { opacity: .6; cursor: progress; }
.v-seat-item:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; }
.v-yt { aspect-ratio: 16 / 9; height: auto; border: 0; }
.v-embed-acts { display: flex; gap: 8px; align-items: center; }
.v-embed-acts a { text-decoration: none; }

@media (max-width: 640px) {
  .v-obj-btn { min-width: 0; padding: 6px 8px; margin: -50px 0 0 -80px; width: 160px; font-size: 11px; }
  .v-obj-actions { gap: 4px; }
  .v-obj-actions button { font-size: 12px; padding: 6px 9px; }
  .v-hint { font-size: 12px; white-space: normal; text-align: center; max-width: calc(100% - 48px); }
  .v-embed { height: 100%; width: 100%; }
  .v-modal { padding: 8px; }
  .v-title { font-size: 20px; }
}
