/* =====================================================
   万物皆可拆解 · Explode Engine v1.0 (XT-EXPLODE-20260915)
   引擎与内容分离：新增拆解对象 = 新增一个 JSON，零代码
   纯 CSS 3D 爆炸图 + 逐层解说（文字 + Web Speech TTS）
   无构建、无依赖、纯外部文件 —— CSP 严格模式可用
   ===================================================== */

/* ====== 页面骨架（演示站用，引擎组件带 ex- 前缀） ====== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #F1F5F9;
  color: #0F172A;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.ex-header {
  background: linear-gradient(135deg, #0F172A, #1E293B 60%, #0F172A);
  color: #fff;
  padding: 36px 20px 30px;
  text-align: center;
}
.ex-header h1 { font-size: 26px; font-weight: 800; letter-spacing: .02em; }
.ex-header h1 span {
  background: linear-gradient(135deg, #60A5FA, #22D3EE);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.ex-header p { color: rgba(255,255,255,.65); font-size: 14px; margin-top: 6px; }

.ex-wrap { max-width: 1100px; margin: 0 auto; padding: 24px 16px 60px; }

/* ====== 对象切换 Tabs ====== */
.ex-tabs { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 20px; }
.ex-tab {
  padding: 9px 18px;
  border-radius: 9999px;
  font-size: 14px; font-weight: 600;
  color: #475569;
  background: #fff;
  border: 1px solid #E2E8F0;
  transition: all .18s ease;
}
.ex-tab:hover { border-color: #2563EB; color: #2563EB; }
.ex-tab.ex-active { background: #2563EB; border-color: #2563EB; color: #fff; box-shadow: 0 4px 12px rgba(37,99,235,.3); }

/* ====== 主舞台布局 ====== */
.ex-main { display: grid; grid-template-columns: 1.2fr .8fr; gap: 20px; align-items: stretch; }
@media (max-width: 860px) { .ex-main { grid-template-columns: 1fr; } }

.ex-stage-card {
  background: radial-gradient(circle at 30% 20%, #1E293B, #0F172A 75%);
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.08);
  position: relative;
  overflow: hidden;
  min-height: 480px;
  display: flex; flex-direction: column;
}
.ex-stage-title {
  padding: 14px 18px 0;
  color: rgba(255,255,255,.85);
  font-size: 13px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px;
}
.ex-stage-title b { color: #fff; font-size: 15px; }

/* 3D 舞台 */
.ex-scene {
  flex: 1;
  perspective: 1400px;
  display: flex; align-items: center; justify-content: center;
  min-height: 380px;
  touch-action: none;
  cursor: grab;
  user-select: none;
}
.ex-scene:active { cursor: grabbing; }

.ex-stage3d {
  position: relative;
  width: 300px; height: 300px;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, 58deg)) rotateZ(var(--rz, -38deg));
  transition: transform .25s ease;
}
.ex-stage3d.ex-dragging { transition: none; }

/* 地面投影 */
.ex-shadow {
  position: absolute; left: 50%; top: 50%;
  width: 340px; height: 340px;
  margin: -170px 0 0 -170px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,0,0,.55), transparent 65%);
  transform: rotateX(90deg) translateZ(-12px);
  filter: blur(6px);
}

/* ====== 拆解层（核心组件） ====== */
.ex-layer {
  position: absolute; left: 50%; top: 50%;
  width: 280px; height: 280px;
  margin: -140px 0 0 -140px;
  transform-style: preserve-3d;
  transition: transform .5s cubic-bezier(.22,.9,.35,1.05), filter .3s ease, opacity .3s ease;
}
.ex-plate {
  width: 100%; height: 100%;
  border-radius: 22px;
  border: 1.5px solid rgba(255,255,255,.35);
  box-shadow: 0 0 0 1px rgba(0,0,0,.25), inset 0 0 60px rgba(255,255,255,.08);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  position: relative;
  overflow: hidden;
}
.ex-plate::before {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}
.ex-glyph { font-size: 58px; line-height: 1; filter: drop-shadow(0 4px 10px rgba(0,0,0,.4)); }
.ex-layer-name {
  color: #fff; font-size: 13px; font-weight: 700;
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
  letter-spacing: .04em;
}
.ex-layer-idx {
  position: absolute; top: 10px; left: 12px;
  color: rgba(255,255,255,.5);
  font-size: 11px; font-weight: 700; font-family: Consolas, monospace;
}

/* 聚焦态：非选中层压暗 */
.ex-scene.ex-focus .ex-layer { filter: brightness(.35) saturate(.6); }
.ex-scene.ex-focus .ex-layer.ex-sel { filter: none; }
.ex-layer:hover { filter: brightness(1.12); }

/* ====== 控制条 ====== */
.ex-controls {
  padding: 12px 18px 16px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.ex-slider { flex: 1; min-width: 160px; -webkit-appearance: none; appearance: none; height: 6px; border-radius: 3px; background: rgba(255,255,255,.18); outline: none; }
.ex-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(135deg, #60A5FA, #22D3EE);
  cursor: pointer; border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.ex-btn {
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px; font-weight: 600;
  background: rgba(255,255,255,.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  transition: all .15s ease;
}
.ex-btn:hover { background: rgba(255,255,255,.2); }
.ex-btn.ex-primary { background: linear-gradient(135deg, #2563EB, #1D4ED8); border-color: transparent; }
.ex-btn.ex-primary:hover { box-shadow: 0 4px 14px rgba(37,99,235,.5); }
.ex-btn.ex-rec { background: #DC2626; border-color: transparent; animation: ex-pulse 1.2s infinite; }
@keyframes ex-pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.ex-hint { color: rgba(255,255,255,.4); font-size: 11px; width: 100%; }

/* ====== 解说面板 ====== */
.ex-side { display: flex; flex-direction: column; gap: 16px; }
.ex-panel {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  padding: 20px;
}
.ex-panel h3 { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.ex-panel .ex-badge {
  font-size: 11px; font-weight: 700; color: #2563EB;
  background: #EFF6FF; border-radius: 9999px; padding: 2px 10px;
}
.ex-narr { font-size: 14px; color: #475569; margin-top: 10px; min-height: 96px; }
.ex-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.ex-fact {
  font-size: 12px; color: #475569;
  background: #F8FAFC; border: 1px solid #E2E8F0;
  border-radius: 8px; padding: 3px 10px;
}
.ex-narr-ctrl { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.ex-narr-btn {
  padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 600;
  background: #F1F5F9; color: #334155;
  transition: all .15s ease;
}
.ex-narr-btn:hover { background: #E2E8F0; }
.ex-narr-btn.ex-speaking { background: #FEE2E2; color: #DC2626; animation: ex-pulse 1.2s infinite; }
.ex-status { font-size: 12px; color: #94A3B8; margin-top: 8px; min-height: 18px; }

/* 层列表 */
.ex-list { display: flex; flex-direction: column; gap: 4px; }
.ex-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13px; font-weight: 600; color: #475569;
  cursor: pointer;
  transition: all .15s ease;
  text-align: left; width: 100%;
}
.ex-item:hover { background: #F1F5F9; }
.ex-item.ex-active { background: #EFF6FF; color: #1D4ED8; }
.ex-item .ex-no {
  width: 22px; height: 22px; flex-shrink: 0;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
  background: #E2E8F0; color: #475569;
}
.ex-item.ex-active .ex-no { background: #2563EB; color: #fff; }

/* ====== 文档区（可复制可推广说明） ====== */
.ex-doc {
  background: #fff; border: 1px solid #E2E8F0; border-radius: 16px;
  padding: 24px; margin-top: 28px;
}
.ex-doc h2 { font-size: 18px; margin-bottom: 6px; }
.ex-doc p.doc-sub { font-size: 13px; color: #64748B; margin-bottom: 16px; }
.ex-doc code.inline {
  font-family: Consolas, monospace; font-size: 13px; color: #1D4ED8;
  background: #EFF6FF; border-radius: 6px; padding: 1px 6px;
}
.ex-doc pre {
  background: #0F172A; color: #93C5FD;
  border-radius: 10px; padding: 14px 16px;
  font-family: Consolas, monospace; font-size: 12.5px;
  overflow-x: auto; margin: 12px 0;
  line-height: 1.7; white-space: pre;
}
.ex-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 14px 0; }
.ex-step {
  background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 12px; padding: 14px;
  font-size: 13px; color: #475569;
}
.ex-step b { display: block; color: #0F172A; margin-bottom: 4px; font-size: 14px; }

.ex-footer { text-align: center; color: #94A3B8; font-size: 12px; padding: 20px; }
.ex-footer a { color: #2563EB; }

/* ====== 控制条补充（替代内联样式的标签 / 层列表间距） ====== */
.ex-ctl-label { color: rgba(255,255,255,.5); font-size: 12px; }
.ex-panel .ex-list { margin-top: 10px; }
.ex-doc .doc-sub-mt { margin-top: 8px; }

/* =====================================================
   影院模式 · 完整拆解动画（cx- 前缀，纯 CSS+JS，无外部依赖）
   只动 transform / opacity / filter，配合 will-change 保 60fps
   ===================================================== */
.ex-stage3d { will-change: transform; }
.ex-layer { will-change: transform, opacity; }

/* 入口按钮：醒目渐变 + 辉光 */
.ex-cine-go {
  background: linear-gradient(135deg, #7C3AED, #2563EB 55%, #22D3EE);
  border-color: transparent;
  box-shadow: 0 0 14px rgba(124,58,237,.45);
}
.ex-cine-go:hover { box-shadow: 0 0 24px rgba(34,211,238,.6); }
.ex-cine-go.cx-on { background: linear-gradient(135deg, #DC2626, #7C3AED); animation: ex-pulse 1.2s infinite; }
.cx-loopbtn.cx-on { background: rgba(34,211,238,.16); border-color: rgba(34,211,238,.55); color: #7DD3FC; }
.cx-hidden { display: none !important; }
.ex-stage-card.cx-cine .ex-controls { opacity: .55; transition: opacity .5s ease; }

/* 影院模式相机由 rAF 逐帧驱动，禁用舞台过渡 */
.cx-cine-cam { transition: none !important; }

/* 星空粒子（JS 用 CSSOM 撒点，CSS 只管动画） */
.cx-stars {
  position: absolute; inset: 0; z-index: 6;
  pointer-events: none;
  opacity: 0; transition: opacity .9s ease;
}
.ex-stage-card.cx-cine .cx-stars { opacity: 1; }
.cx-star {
  position: absolute; width: 2px; height: 2px; border-radius: 50%;
  background: #E0F2FE;
  box-shadow: 0 0 6px rgba(224,242,254,.9);
  opacity: .2;
  animation: cx-twinkle 3s ease-in-out infinite;
  will-change: opacity, transform;
}
@keyframes cx-twinkle {
  0%, 100% { opacity: .12; transform: scale(.8); }
  50% { opacity: .95; transform: scale(1.3); }
}

/* HUD 科幻框：四角括号 + 层名编号 */
.cx-hud {
  position: absolute; top: 14px; left: 14px; right: 14px; height: 76px;
  z-index: 30; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: linear-gradient(180deg, rgba(8,20,38,.6), rgba(8,20,38,.12));
  border: 1px solid rgba(34,211,238,.22);
}
.cx-corner {
  position: absolute; width: 16px; height: 16px;
  border: 2px solid #22D3EE;
  filter: drop-shadow(0 0 6px rgba(34,211,238,.8));
  animation: cx-corner-blink 1.6s ease-in-out infinite;
}
.cx-tl { top: -2px; left: -2px; border-right: none; border-bottom: none; }
.cx-tr { top: -2px; right: -2px; border-left: none; border-bottom: none; }
.cx-bl { bottom: -2px; left: -2px; border-right: none; border-top: none; }
.cx-br { bottom: -2px; right: -2px; border-left: none; border-top: none; }
@keyframes cx-corner-blink { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.cx-hud-title {
  color: #7DD3FC;
  font-family: Consolas, monospace;
  font-size: 16px; font-weight: 700; letter-spacing: .12em;
  text-shadow: 0 0 12px rgba(34,211,238,.6);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 92%;
}
.cx-hud-sub { color: rgba(255,255,255,.55); font-size: 12px; letter-spacing: .28em; }

/* 扫描线：每拆一层从下往上掠过一次 */
.ex-scene { position: relative; }
.cx-scan {
  position: absolute; left: 6%; right: 6%; height: 2px; top: 90%;
  z-index: 25; pointer-events: none;
  background: linear-gradient(90deg, transparent, #22D3EE 30%, #A5F3FC 50%, #22D3EE 70%, transparent);
  box-shadow: 0 0 14px rgba(34,211,238,.85);
  animation: cx-sweep .95s ease-in-out forwards;
}
@keyframes cx-sweep {
  0% { top: 92%; opacity: 0; }
  18% { opacity: 1; }
  100% { top: 6%; opacity: 0; }
}

/* 当前层辉光 + 远层景深虚化 */
.ex-layer.cx-glow { z-index: 99; }
.ex-layer.cx-glow .ex-plate {
  border-color: rgba(34,211,238,.9);
  box-shadow: 0 0 0 2px rgba(34,211,238,.7), 0 0 38px rgba(34,211,238,.55), inset 0 0 46px rgba(34,211,238,.22);
}
.ex-scene.ex-focus .ex-layer.cx-glow { filter: brightness(1.3) saturate(1.15); }
.ex-scene.ex-focus .ex-layer.cx-blur { filter: blur(1.6px) brightness(.68) saturate(.7); }

/* 底部进度条：scaleX 驱动，不触发重排 */
.cx-progress {
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: rgba(255,255,255,.08); z-index: 31; pointer-events: none;
}
.cx-progress-fill {
  height: 100%; width: 100%;
  transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, #2563EB, #22D3EE);
  box-shadow: 0 0 10px rgba(34,211,238,.8);
  will-change: transform;
}

/* =====================================================
   v2.0 · 下半界面（仿 /create/）：AI 拆物台 / 我的拆物 / 对象总览
   ===================================================== */

/* ✨ AI 拆物台 */
.ex-ai {
  background: linear-gradient(135deg, #0F172A, #1E293B 70%);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 8px 30px rgba(15,23,42,.25);
}
.ex-ai-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.ex-ai-head b { color: #fff; font-size: 17px; letter-spacing: .02em; }
.ex-ai-head span { color: rgba(255,255,255,.55); font-size: 13px; }
.ex-ai-row { display: flex; gap: 10px; align-items: stretch; }
.ex-ai-q {
  flex: 1; min-width: 0; resize: vertical; min-height: 52px;
  padding: 10px 14px; border-radius: 12px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
  color: #fff; font-family: inherit; font-size: 14px; line-height: 1.5; outline: none;
}
.ex-ai-q::placeholder { color: rgba(255,255,255,.35); }
.ex-ai-q:focus { border-color: rgba(34,211,238,.6); box-shadow: 0 0 0 3px rgba(34,211,238,.12); }
.ex-ai-go {
  flex-shrink: 0; padding: 10px 20px; border-radius: 12px;
  font-size: 14px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #7C3AED, #2563EB 60%, #22D3EE);
  box-shadow: 0 0 16px rgba(124,58,237,.4);
  transition: all .15s ease;
}
.ex-ai-go:hover { box-shadow: 0 0 26px rgba(34,211,238,.65); }
.ex-ai-go:disabled { opacity: .6; cursor: wait; }
.ex-ai-go.ex-ai-busy { animation: ex-pulse 1.6s infinite; }
.ex-ai-status { color: rgba(255,255,255,.6); font-size: 12.5px; margin-top: 8px; min-height: 18px; }

/* 📁 我的拆物 */
.ex-saves {
  background: #fff; border: 1px solid #E2E8F0; border-radius: 16px;
  padding: 18px 20px; margin-top: 24px;
}
.ex-saves-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ex-saves-head > b { font-size: 16px; color: #0F172A; }
.ex-saves.ex-saves-collapsed .ex-fav-list,
.ex-saves.ex-saves-collapsed .ex-fav-status { display: none; }
.ex-fav-tools { display: flex; gap: 8px; }
.ex-fav-q {
  width: 200px; max-width: 56vw;
  padding: 7px 12px; border-radius: 9px;
  background: #F8FAFC; border: 1px solid #E2E8F0;
  color: #0F172A; font-size: 13px; outline: none;
}
.ex-fav-q::placeholder { color: #94A3B8; }
.ex-fav-q:focus { border-color: #2563EB; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.ex-fav-refresh, .ex-fav-x {
  width: 34px; height: 34px; border-radius: 9px;
  color: #475569; font-size: 14px;
  background: #F1F5F9; border: 1px solid #E2E8F0;
}
.ex-fav-refresh:hover, .ex-fav-x:hover { background: #E2E8F0; }
.ex-fav-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin-top: 12px; }
.ex-fav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 12px;
  background: #F8FAFC; border: 1px solid #E2E8F0;
  cursor: pointer; text-align: left; width: 100%;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.ex-fav-item:hover { background: #EFF6FF; border-color: #93C5FD; transform: translateY(-1px); }
.ex-fav-main { flex: 1; min-width: 0; }
.ex-fav-t { color: #0F172A; font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-fav-meta { color: #64748B; font-size: 11.5px; margin-top: 2px; }
.ex-fav-badge {
  display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 9999px;
  font-size: 10.5px; font-weight: 700; vertical-align: 1px;
  background: #EFF6FF; color: #2563EB;
}
.ex-fav-del {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 8px;
  font-size: 13px; color: #64748B;
  background: #F1F5F9; border: 1px solid #E2E8F0;
}
.ex-fav-del:hover { background: #FEE2E2; border-color: #FCA5A5; color: #DC2626; }
.ex-fav-empty {
  grid-column: 1 / -1;
  color: #94A3B8; font-size: 13px; text-align: center; padding: 20px 0;
  background: #F8FAFC; border: 1px dashed #E2E8F0; border-radius: 12px;
}
.ex-fav-status { color: #94A3B8; font-size: 12px; margin-top: 8px; min-height: 16px; }

/* 对象总览四页签 */
.ex-info { background: #fff; border: 1px solid #E2E8F0; border-radius: 16px; padding: 18px 20px; margin-top: 24px; }
.ex-infotabs { display: flex; gap: 8px; flex-wrap: wrap; border-bottom: 1px solid #E2E8F0; padding-bottom: 10px; }
.ex-itab {
  padding: 7px 16px; border-radius: 9999px;
  font-size: 13.5px; font-weight: 600; color: #475569;
  background: #F1F5F9;
  transition: all .15s ease;
}
.ex-itab:hover { color: #2563EB; }
.ex-itab.ex-active { background: #2563EB; color: #fff; box-shadow: 0 3px 10px rgba(37,99,235,.3); }
.ex-infobody { margin-top: 14px; color: #334155; font-size: 13.5px; line-height: 1.7; }
.ex-ichips { display: flex; flex-wrap: wrap; gap: 6px; }
.ex-ichip {
  font-size: 12px; color: #334155;
  background: #F8FAFC; border: 1px solid #E2E8F0;
  border-radius: 8px; padding: 3px 10px;
}
.ex-ichip-wide { width: 100%; }
.ex-ioverview p { margin-bottom: 10px; }
.ex-ilayers { display: flex; flex-direction: column; gap: 8px; }
.ex-ilayer { display: flex; gap: 10px; padding: 10px 12px; background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 12px; }
.ex-ilayer-no {
  flex-shrink: 0; height: 24px; padding: 0 9px; border-radius: 9999px;
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 800; font-family: Consolas, monospace;
  background: #2563EB; color: #fff;
}
.ex-ilayer-main { flex: 1; min-width: 0; }
.ex-ilayer-name { font-weight: 700; color: #0F172A; }
.ex-ilayer-narr { color: #64748B; font-size: 12.5px; margin-top: 2px; }
.ex-ipoints { display: flex; flex-direction: column; gap: 10px; }
.ex-ipoint { display: flex; gap: 10px; align-items: flex-start; }
.ex-ipoint-label {
  flex-shrink: 0; font-size: 12px; font-weight: 700; color: #1D4ED8;
  background: #EFF6FF; border-radius: 8px; padding: 3px 10px;
}
.ex-ieggs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.ex-iegg { background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 12px; padding: 12px 14px; }
.ex-iegg-name { font-weight: 700; color: #0F172A; font-size: 13px; }
.ex-iegg-text { color: #475569; font-size: 12.5px; margin-top: 4px; }

@media (max-width: 860px) {
  .ex-ai-row { flex-direction: column; }
  .ex-ai-go { width: 100%; }
}

/* =====================================================
   C · 视觉逼真度第一波：层质感 / 摇摆飘浮 / HUD 电影化
   ===================================================== */

/* 层体：顶部受光 + 底部阴影 + 边缘高光，增强厚度感 */
.ex-plate {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.4),
    inset 0 -16px 32px rgba(0,0,0,.38),
    inset 0 18px 30px rgba(255,255,255,.12),
    0 0 0 1px rgba(0,0,0,.28),
    0 14px 34px rgba(0,0,0,.35);
}
.ex-plate::after {
  content: '';
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,.32), rgba(255,255,255,.05) 26%, rgba(0,0,0,0) 55%, rgba(0,0,0,.22)),
    radial-gradient(120% 60% at 50% -8%, rgba(255,255,255,.25), transparent 60%);
}
.ex-layer-name { text-shadow: 0 1px 2px rgba(0,0,0,.75), 0 0 14px rgba(0,0,0,.35); }

/* 拆离层：轻微摇摆飘浮 */
.ex-layer.cx-sway .ex-plate { animation: cx-sway 1.4s ease-in-out infinite; }
@keyframes cx-sway {
  0%, 100% { transform: translate3d(0, 0, 0) rotateX(0deg); }
  50% { transform: translate3d(0, -7px, 0) rotateX(3deg) rotateZ(-1.2deg); }
}

/* HUD 电影化：扫掠光线 */
.cx-hud::after {
  content: '';
  position: absolute; top: 0; bottom: 0; width: 34%;
  background: linear-gradient(100deg, transparent, rgba(125,211,252,.10), transparent);
  animation: cx-hud-sweep 3.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes cx-hud-sweep {
  0% { left: -36%; }
  55%, 100% { left: 104%; }
}

/* 移动端修正：视角转到层背面时不再显示镜像文字（只隐藏文字面，保留层体） */
.ex-glyph, .ex-layer-name, .ex-layer-idx {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* =====================================================
   收藏 / 查询（xf- 前缀，纯 CSS+JS，失败静默降级）
   面板样式在下方 v2.0「我的拆物」浅色主题区，此处仅保留按钮态
   ===================================================== */
.ex-fav-ok { background: #16A34A !important; border-color: transparent !important; }
.ex-fav:disabled { opacity: .55; cursor: wait; }

/* 尊重系统减弱动效：影院模式退化为快速切换 */
@media (prefers-reduced-motion: reduce) {
  .cx-star, .cx-scan, .cx-corner { animation: none !important; }
  .ex-layer, .ex-stage3d { transition: none !important; }
  .cx-stars, .ex-stage-card.cx-cine .ex-controls { transition: none; }
}

/* =====================================================
   v20260917f · A 叠片舞台窗口适当缩小（功能不变，仅尺寸）
   ===================================================== */
.ex-main { grid-template-columns: 1.05fr .95fr; }
.ex-stage-card { min-height: 440px; }
.ex-scene { min-height: 330px; }
.ex-stage3d { width: 264px; height: 264px; }
.ex-shadow { width: 300px; height: 300px; margin: -150px 0 0 -150px; }
.ex-layer { width: 246px; height: 246px; margin: -123px 0 0 -123px; }

@media (max-width: 860px) {
  .ex-main { grid-template-columns: 1fr; }
  .ex-stage-card { min-height: 400px; }
  .ex-scene { min-height: 300px; }
  .ex-stage3d { width: 232px; height: 232px; }
  .ex-shadow { width: 264px; height: 264px; margin: -132px 0 0 -132px; }
  .ex-layer { width: 216px; height: 216px; margin: -108px 0 0 -108px; }
}

/* =====================================================
   v20260917f · B 🎬 Blender 大片窗口
   ===================================================== */
.ex-movie {
  margin-top: 22px;
  background: linear-gradient(180deg, #0B1220, #0F172A 70%);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px;
  padding: 16px 18px 12px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 18px 42px rgba(2,6,23,.5);
}
.ex-movie-head {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px;
  margin-bottom: 12px;
}
.ex-movie-head b { color: #E2E8F0; font-size: 15px; }
.ex-movie-head span { color: rgba(226,232,240,.62); font-size: 12.5px; }
.ex-movie-body {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: radial-gradient(circle at 30% 20%, #16233A, #070C16 78%);
  min-height: 200px;
  display: flex; align-items: center; justify-content: center;
}
.ex-movie-video {
  display: block; width: 100%; height: auto;
  aspect-ratio: 16 / 9;
  background: #000;
  outline: none;
}
.ex-movie-empty {
  padding: 58px 18px;
  text-align: center;
  color: rgba(226,232,240,.55);
  font-size: 13px;
  letter-spacing: .3px;
}
.ex-movie-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  margin-top: 10px;
}
.ex-movie-hint { color: rgba(148,163,184,.75); font-size: 12px; }
.ex-movie-dl {
  flex-shrink: 0;
  color: #7DD3FC; text-decoration: none; font-size: 12.5px;
  border: 1px solid rgba(125,211,252,.4); border-radius: 9999px;
  padding: 5px 13px;
  transition: background .2s ease, color .2s ease;
}
.ex-movie-dl:hover { background: rgba(125,211,252,.14); color: #BAE6FD; }
.ex-movie .ex-hidden { display: none !important; }

/* =====================================================
   v20260917g · A 大片窗口升主视觉（1020px · 16:9 约 574px 高）
   ===================================================== */
.ex-movie {
  max-width: 1020px;
  padding: 20px 24px 16px;
  border-radius: 22px;
  margin-top: 24px;
}
.ex-movie-head { margin-bottom: 14px; }
.ex-movie-head b { font-size: 18px; }
.ex-movie-head span { font-size: 13.5px; }
.ex-movie-empty { padding: 96px 24px; font-size: 14px; }
.ex-movie-hint { font-size: 12.5px; }
.ex-movie-dl { font-size: 13px; padding: 6px 15px; }

/* =====================================================
   v20260917g · B 叠片舞台再缩小（功能零改动，纯尺寸）
   ===================================================== */
.ex-stage-card { min-height: 384px; }
.ex-scene { min-height: 276px; }
.ex-stage3d { width: 210px; height: 210px; }
.ex-shadow { width: 240px; height: 240px; margin: -120px 0 0 -120px; }
.ex-layer { width: 196px; height: 196px; margin: -98px 0 0 -98px; }

@media (max-width: 860px) {
  .ex-main { grid-template-columns: 1fr; }
  .ex-stage-card { min-height: 340px; }
  .ex-scene { min-height: 246px; }
  .ex-stage3d { width: 180px; height: 180px; }
  .ex-shadow { width: 206px; height: 206px; margin: -103px 0 0 -103px; }
  .ex-layer { width: 168px; height: 168px; margin: -84px 0 0 -84px; }
}

/* =====================================================
   v20260917h · 大片窗口「⭐ 保存大片」按钮（复用 /saves 体系）
   纯新增，不影响叠片系统任何现存样式
   ===================================================== */
.ex-movie-actions {
  display: inline-flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.ex-movie-save-status {
  font-size: 12.5px; line-height: 1.35;
  color: rgba(226,232,240,.72);
  max-width: 320px;
}
.ex-movie-save-status:empty { display: none; }
.ex-fav-badge {
  margin-top: 5px;
  display: inline-block;
  font-size: 11.5px; line-height: 1;
  color: #FDE68A;
  background: rgba(251,191,36,.12);
  border: 1px solid rgba(251,191,36,.38);
  border-radius: 9999px;
  padding: 3px 9px;
}
.ex-movie-save {
  flex-shrink: 0;
  font: inherit; font-size: 13px; line-height: 1;
  color: #FDE68A; cursor: pointer;
  background: rgba(251,191,36,.10);
  border: 1px solid rgba(251,191,36,.42); border-radius: 9999px;
  padding: 7px 16px;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.ex-movie-save:hover:not(:disabled) { background: rgba(251,191,36,.18); color: #FEF3C7; }
.ex-movie-save:disabled { cursor: default; opacity: .75; }
.ex-movie-save-ok {
  background: #16A34A !important;
  border-color: transparent !important;
  color: #F0FDF4 !important;
}
@media (max-width: 860px) {
  .ex-movie-actions { width: 100%; justify-content: space-between; }
  .ex-movie-save { font-size: 12.5px; padding: 6px 14px; }
}

/* =====================================================
   v20260917i · 🧊 真3D 查看器（Blender GLB · Three.js 本地渲染）
   纯新增卡片 + glbmode 显隐开关, 不改动叠片系统任何既有样式
   ===================================================== */
.ex-glb {
  margin-top: 24px;
  background: linear-gradient(180deg, #0B1220, #0F172A 70%);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 22px;
  padding: 20px 24px 16px;
  max-width: 1020px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 18px 42px rgba(2,6,23,.5);
}
.ex-glb-head {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px;
  margin-bottom: 14px;
}
.ex-glb-head b { color: #E2E8F0; font-size: 18px; }
.ex-glb-head > span:not(.ex-glb-status) { color: rgba(226,232,240,.62); font-size: 13.5px; }
.ex-glb-status { color: #FDE68A; font-size: 12.5px; margin-left: auto; }
.ex-glb-close {
  font: inherit; color: rgba(226,232,240,.7); cursor: pointer;
  background: transparent; border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px; width: 28px; height: 24px; line-height: 1;
}
.ex-glb-close:hover { color: #fff; border-color: rgba(255,255,255,.4); }
.ex-glb-stage {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: radial-gradient(circle at 30% 20%, #16233A, #070C16 78%);
  aspect-ratio: 16 / 9;
  min-height: 240px;
}
.ex-glb-stage canvas { display: block; width: 100%; height: 100%; outline: none; touch-action: none; }
.ex-glb-foot {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px;
}
.ex-glb-lab { color: rgba(148,163,184,.85); font-size: 12.5px; flex-shrink: 0; }
.ex-glb-slider { flex: 1 1 160px; min-width: 120px; }
.ex-glb-btn {
  flex-shrink: 0;
  font: inherit; font-size: 12.5px; line-height: 1;
  color: #BAE6FD; cursor: pointer;
  background: rgba(125,211,252,.08);
  border: 1px solid rgba(125,211,252,.35); border-radius: 9999px;
  padding: 6px 13px;
  transition: background .2s ease, color .2s ease;
}
.ex-glb-btn:hover { background: rgba(125,211,252,.16); color: #E0F2FE; }
/* 真3D 模式: 隐藏 CSS 3D 板层舞台, 其余控件/列表/解说/TTS 全保留 */
body.ex-glbmode .ex-scene { display: none; }
body.ex-glbmode .ex-stage-card .ex-hint { display: none; }
@media (max-width: 860px) {
  .ex-glb { padding: 16px 14px 12px; border-radius: 18px; }
  .ex-glb-head b { font-size: 15.5px; }
  .ex-glb-status { width: 100%; margin-left: 0; order: 9; }
  .ex-glb-stage { min-height: 200px; }
}
