/* Photo to 3D 项目页专属样式 */
.photo3d-body {
  background: #0b0d10;
  color: #e8eaed;
}

.photo3d-main {
  min-height: 100vh;
}

/* ---------- Hero(首屏标题,渲染后被场景覆盖) ---------- */
.photo3d-hero {
  position: relative;
  z-index: 2;
  max-width: 720px;
  margin: 0 auto;
  padding: 72px 24px 8px;
  text-align: center;
}

.photo3d-kicker {
  font-size: 12px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: #7fd4ff;
  opacity: .85;
  margin: 0 0 10px;
}

.photo3d-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 4.4vw, 44px);
  letter-spacing: -0.01em;
}

.photo3d-sub {
  color: #a9b0b8;
  margin: 0 auto;
  max-width: 560px;
}

/* 真 3D 分层标题(挤出 + 缓慢摆动) */
.photo3d-hero {
  perspective: 900px;
}

.t3d {
  position: relative;
  display: inline-block;
  transform-style: preserve-3d;
  animation: t3dSpin 9s ease-in-out infinite;
  margin: 0 0 12px;
  font-size: clamp(30px, 4.4vw, 46px);
  letter-spacing: -0.01em;
}

.t3d-layer {
  position: absolute;
  inset: 0;
  white-space: nowrap;
}

.t3d-layer[style*="--i:0"] {
  position: relative;
  background: linear-gradient(180deg, #ffffff 15%, #bfe0ff 55%, #6ea8e8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 18px 34px rgba(30, 80, 160, .35);
}

.t3d-depth {
  transform: translateZ(calc(var(--i) * -1.8px));
  color: #2c3a4e;
}

@media (prefers-reduced-motion: reduce) {
  .t3d {
    animation: none;
  }
}

@keyframes t3dSpin {
  0%, 100% { transform: rotateX(9deg) rotateY(-16deg); }
  50% { transform: rotateX(9deg) rotateY(16deg); }
}

/* ---------- 全屏渲染区 ---------- */
.photo3d-stage {
  position: fixed;
  inset: 0;
  z-index: 3;   /* stage(含 Dock)整体压在 hero 之上;未渲染时透明透出 hero */
}

.photo3d-stage canvas[data-engine] {
  position: absolute;
  inset: 0;
}

/* ---------- 左侧 Dock(Mac 风格,可折叠,3D 质感) ---------- */
#panel {
  position: fixed;
  left: 14px;
  top: 50%;
  transform: translateY(-50%) perspective(900px) rotateY(6deg);
  transform-origin: left center;
  z-index: 10;
  transition: transform .38s cubic-bezier(.2, .8, .25, 1);
}

#panel.collapsed {
  transform: translateY(-50%) perspective(900px) rotateY(6deg) translateX(calc(-100% + 30px));
}

#dockBody {
  width: 232px;
  max-height: 74vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 12px;
  border-radius: 16px;
  background: rgba(14, 16, 20, .66);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  backdrop-filter: blur(14px) saturate(1.25);
  border: 1px solid rgba(255, 255, 255, .10);
  box-shadow:
    0 30px 70px rgba(0, 0, 0, .55),
    0 6px 18px rgba(0, 0, 0, .40),
    inset 0 1px 0 rgba(255, 255, 255, .07);
}

#dockHandle {
  position: absolute;
  right: -26px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 60px;
  border-radius: 0 12px 12px 0;
  border: 1px solid rgba(255, 255, 255, .10);
  border-left: 0;
  background: rgba(14, 16, 20, .66);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: #9fd7ff;
  font-size: 16px;
  cursor: pointer;
  transition: transform .38s cubic-bezier(.2, .8, .25, 1), background .2s;
}

#dockHandle:hover {
  background: rgba(43, 127, 255, .35);
}

#panel.collapsed #dockHandle {
  transform: translateY(-50%) rotate(180deg);
}

#panel .row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#dockBody button,
#dockBody .file-label span {
  display: block;
  width: 100%;
  text-align: center;
  background: linear-gradient(180deg, #4a9bff 0%, #2b7fff 45%, #1c60d4 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(0, 20, 60, .35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .28),
    inset 0 -2px 4px rgba(0, 0, 0, .25),
    0 6px 14px rgba(8, 18, 40, .45);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

#dockBody button:not(:disabled):hover,
#dockBody .file-label span:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .32),
    inset 0 -2px 4px rgba(0, 0, 0, .25),
    0 12px 26px rgba(43, 127, 255, .48);
}

#dockBody button:not(:disabled):active,
#dockBody .file-label span:active {
  transform: translateY(1px);
  filter: brightness(.96);
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, .35),
    0 2px 6px rgba(8, 18, 40, .4);
}

#dockBody button:disabled {
  background: linear-gradient(180deg, #565d66 0%, #3f444b 100%);
  color: #9aa2ab;
  text-shadow: none;
  cursor: default;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .08),
    inset 0 -2px 4px rgba(0, 0, 0, .3);
}

/* 主行动按钮:紫色强调 */
#dockBody #run:not(:disabled) {
  background: linear-gradient(180deg, #b18cff 0%, #8a5cf6 45%, #6938d1 100%);
}

#dockBody #run:not(:disabled):hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .32),
    inset 0 -2px 4px rgba(0, 0, 0, .25),
    0 12px 26px rgba(138, 92, 246, .5);
}

/* 下载按钮:低调玻璃态 */
#dockBody #dlspz:not(:disabled) {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .18);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  text-shadow: none;
}

#dockBody .file-label input {
  display: none;
}

#noWebgpu {
  padding: 8px 10px;
  background: #5a3a12;
  border-radius: 8px;
  color: #ffd27f;
}

#noWebgpu button {
  margin-top: 6px;
  background: #8a5cf6;
}

#barWrap {
  display: none;
  height: 6px;
  background: #2a2e33;
  border-radius: 3px;
  overflow: hidden;
}

#bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2b7fff, #7fd4ff);
  transition: width .2s;
}

#status {
  white-space: pre-wrap;
  color: #9fd7ff;
  font-size: 12.5px;
  line-height: 1.5;
}

#status.error {
  color: #ff8080;
}

#stats {
  color: #ffd97f;
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.5;
}

/* ---------- 本地缓存行 ---------- */
#storageLine {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #77808a;
  flex-wrap: nowrap;
}

#storageLine span {
  white-space: nowrap;
}

#storageLine #storageSize {
  color: #9aa4ae;
}

#storageLine #storageClear {
  margin-left: auto;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .14);
  color: #aab4be;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
}

#storageLine #storageClear:hover {
  background: rgba(255, 255, 255, .14);
  color: #fff;
}

/* ---------- 360° 控制提示条 ---------- */
#hintToast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(14, 16, 20, .82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .5);
  font-size: 13px;
  color: #dfe6ee;
  animation: hintIn .3s ease;
  max-width: min(92vw, 560px);
}

#hintToast button {
  flex: none;
  background: #2b7fff;
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
}

#hintToast button.ghost {
  background: rgba(255, 255, 255, .1);
  color: #cfd6de;
}

@keyframes hintIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@media (max-width: 640px) {
  #hintToast {
    bottom: auto;
    top: 76px;
    flex-wrap: wrap;
  }
}

/* ---------- 许可与致谢(右下角,弱化) ---------- */
#licenseBox {
  position: fixed;
  right: 14px;
  bottom: 12px;
  z-index: 10;
  font-size: 11px;
  opacity: .5;
  transition: opacity .2s;
  color: #8b929a;
}

#licenseBox:hover,
#licenseBox[open] {
  opacity: .9;
}

#licenseBox summary {
  cursor: pointer;
  list-style: none;
  text-align: right;
}

#licenseBox summary::-webkit-details-marker {
  display: none;
}

#licenseBox .license-body {
  position: absolute;
  right: 0;
  bottom: 22px;
  width: 300px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(10, 12, 14, .85);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .08);
  line-height: 1.6;
}

#licenseBox a {
  color: #7fd4ff;
}

/* ---------- 移动端:Dock 移到屏幕底部 ---------- */
@media (max-width: 640px) {
  .photo3d-hero {
    padding-top: 60px;
  }
  #panel {
    left: 50%;
    right: auto;
    top: auto;
    bottom: 12px;
    transform: translateX(-50%) perspective(900px) rotateX(5deg);
    transform-origin: center bottom;
  }
  #panel.collapsed {
    transform: translateX(-50%) perspective(900px) rotateX(5deg) translateY(calc(100% - 26px));
  }
  #dockBody {
    width: min(92vw, 420px);
    max-height: 42vh;
  }
  #dockHandle {
    right: auto;
    left: 50%;
    top: -24px;
    transform: translateX(-50%);
    width: 60px;
    height: 24px;
    border-radius: 12px 12px 0 0;
    border: 1px solid rgba(255, 255, 255, .10);
    border-bottom: 0;
  }
  #panel.collapsed #dockHandle {
    transform: translateX(-50%) rotate(180deg);
  }
}
