/* 查看器样式：制作器预览与独立成品共用。背景颗粒由各自页面单独指定。 */
:root {
  --maker-paper: #c1d4dd;
  --maker-ink: #254451;
  --maker-mount: rgba(37, 68, 81, 0.18);
}
.sphere-orbit { position: absolute; inset: 0; }
.sphere-node {
  position: absolute; left: 50%; top: 50%;
  padding: 0; border: 0; background: none; cursor: pointer;
  transform-origin: 50% 50%; will-change: transform, opacity;
  -webkit-tap-highlight-color: transparent;
}
.sphere-node img {
  display: block; width: 100%; height: 100%; object-fit: contain;
  border: 0.5px solid var(--maker-mount);
  transition: transform 140ms ease;
}
@media(hover:hover) and (pointer:fine){.sphere-node:not(:disabled):hover img { transform: scale(1.05); }}
.sphere-node.is-back { pointer-events: none; cursor: default; }
.sphere-node:disabled { opacity: inherit; }
.sphere-node:focus-visible { outline: 2px solid var(--maker-ink); outline-offset: 4px; }
.sphere-node.is-cutout img {
  border: 0; border-radius: 0; box-shadow: none;
  filter: drop-shadow(0 6px 6px rgba(37, 68, 81, 0.13));
}
.sphere-list { position: absolute; inset: 0; overflow-y: auto; }
.sphere-list[hidden] { display: none; }

/* 成品布局 */
.viewer-body { margin: 0; min-height: 100svh; color: var(--maker-ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; }
.viewer-main { position: relative; min-height: 100svh; }
.viewer-header { position: absolute; top: 34px; left: 0; right: 0; text-align: center; pointer-events: none; z-index: 2; }
.viewer-header h1 { font-size: clamp(20px, 3vw, 30px); font-weight: 500; margin: 0 0 10px; letter-spacing: .04em; }
.viewer-header p { font-size: 12px; opacity: .72; margin: 0; letter-spacing: .08em; }
.viewer-main #stage { position: absolute; inset: 130px 6vw 110px; cursor: grab; touch-action: none; overflow: hidden; }
.viewer-main #stage:active { cursor: grabbing; }
.viewer-footer { position: fixed; bottom: 26px; left: 24px; right: 24px; display: flex;
  align-items: center; justify-content: space-between; font-size: 12px; z-index: 2; }
.viewer-footer button { font: inherit; color: inherit; background: none; border: 0; padding: 8px 0; cursor: pointer; }
.viewer-footer span { opacity: .65; }
.viewer-error { position: fixed; inset: 40% 10% auto; text-align: center; font-size: 15px; line-height: 1.9; }

/* 详情弹窗：预览与成品共用 */
dialog.cv-dialog, dialog#detail {
  width: min(1000px, 92vw); max-height: 90svh; padding: 0;
  border: 1px solid #526e7a; background: #edf2ef; color: var(--maker-ink);
  box-shadow: 8px 8px rgba(39, 73, 87, 0.15);
}
dialog::backdrop { background: rgba(151, 180, 193, 0.43); backdrop-filter: blur(7px); }
dialog.cv-dialog > header, dialog#detail > header {
  display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-bottom: 1px solid #a1b6bd; font-size: 13px;
}
dialog.cv-dialog > header button, dialog#detail > header button {
  border: 1px solid #64818b; background: none; color: inherit; border-radius: 50%;
  width: 32px; height: 32px; font-size: 22px; line-height: 1; cursor: pointer; padding: 0;
}
.cv-layout { padding: 30px; display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: center; }
.cv-layout.image-only { grid-template-columns: 1fr; }
.cv-layout[data-content-type="text"] { grid-template-columns: 1fr; }
.cv-gallery[hidden], .cv-copy[hidden] { display: none; }
.cv-image { display: block; width: 100%; max-height: 60svh; object-fit: contain; }
.image-only .cv-image { max-height: 70svh; }
.cv-nav { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 16px; font-size: 13px; }
.cv-nav button { font: inherit; color: inherit; background: none; border: 1px solid #9bb1ba; padding: 6px 14px; cursor: pointer; }
.cv-counter { opacity: .7; font-variant-numeric: tabular-nums; }
.cv-title { font-size: 22px; font-weight: 500; margin: 0 0 14px; overflow-wrap: anywhere; }
.cv-text { font-size: 14px; line-height: 2; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 18px; }
.cv-link { font-size: 13px; color: inherit; border-bottom: 1px solid; padding-bottom: 4px; text-decoration: none; }
@media (max-width: 650px) {
  .viewer-main #stage { inset: 120px 4px 120px; }
  .viewer-header { top: 24px; }
  .cv-layout { grid-template-columns: 1fr; padding: 20px; gap: 18px; }
  .cv-image { max-height: 42svh; }
}
@media (prefers-reduced-motion: reduce) {
  .sphere-node img { transition: none; }
}

/* Approved picture-first layout */
#detailDialog,dialog#detail{width:min(1200px,94vw)}
.cv-layout{padding:clamp(24px,4vw,56px);grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:clamp(24px,4vw,60px)}
.cv-image{max-height:70svh}.cv-text{font-size:clamp(16px,1.5vw,22px);line-height:1.85}.cv-title{font-size:clamp(24px,3vw,38px)}
.cv-layout.image-only,.cv-layout.text-only{grid-template-columns:1fr}.image-only .cv-image{max-height:72svh}
#detailDialog header #detailEdit{margin-left:auto;width:auto;height:auto;padding:8px 16px;border-radius:3px;font-size:14px}
@media(max-width:650px){.cv-layout{grid-template-columns:1fr}.cv-image{max-height:55svh}}

/* 与制作首页统一字体层级，文字内容不重复显示标题 */
.cv-copy{max-width:640px}.cv-title{font-size:clamp(24px,2.5vw,34px);font-weight:500;margin-bottom:20px}.cv-text{font-size:clamp(16px,1.5vw,20px);line-height:1.9}.cv-layout.text-only{padding:clamp(30px,5vw,64px)}.cv-layout.text-only .cv-copy{width:100%;margin:0 auto}.cv-link{font-size:15px}

.viewer-body,.cv-dialog{font-family:'LXGW WenKai','PingFang SC',sans-serif}
.cv-layout[data-content-type="profile"]{padding:0;gap:0;grid-template-columns:1fr 1fr;align-items:stretch;background:#e1ebf1}
.contact-art{display:flex;align-items:center;justify-content:center;padding:44px;border-right:1px solid #526e7a;min-height:350px}
.contact-object{display:block;width:100%;height:430px;max-height:60svh;object-fit:contain}
.contact-info{padding:clamp(28px,4vw,54px);align-self:center;min-width:0}
.contact-display-row{padding:20px 0;border-bottom:1px solid #aebfc5}.contact-label{display:block;font-size:16px;margin-bottom:12px;color:#526b76}
.contact-value{font-size:clamp(20px,2vw,29px);line-height:1.5;overflow-wrap:anywhere;margin:0;white-space:pre-wrap}
@media(max-width:650px){.cv-layout[data-content-type="profile"]{grid-template-columns:1fr}.contact-art{min-height:0;padding:22px;border-right:0;border-bottom:1px solid #aebfc5}.contact-object{height:180px}.contact-info{padding:24px}}

/* 相纸只用于球上的照片，详情中的原图保持不变。 */
.sphere-node.is-photo-paper {
  box-sizing: border-box;
  padding: var(--photo-padding, 5px);
  background: #f6f1e6;
  box-shadow: 0 3px 7px rgba(37, 68, 81, .15);
}
.sphere-node.is-photo-paper img {
  border: 0;
  box-shadow: none;
  filter: none;
  object-fit: contain;
}
.sphere-node.is-photo-paper:hover img { transform: none; }
