/* ==========================================================================
   interactive.css — 8 大互動系統樣式
   ========================================================================== */

/* ========== 共用 ix-caption ========== */
.ix-caption {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.5); backdrop-filter: blur(10px);
  color: #FFD166; padding: 8px 18px; border-radius: 12px;
  font-size: 14px; font-weight: 800;
  border: 1px solid rgba(255,255,255,.15);
  z-index: 10;
}

/* ========== 1. 地理系統 ========== */
.ix-geo-stage {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.ix-map {
  flex: 1; max-width: 65%;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,.5));
  animation: mapFlyIn 1.2s ease-out;
}
@keyframes mapFlyIn {
  from { transform: scale(2) translateZ(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.ix-map svg { width: 100%; height: 100%; max-height: 75vh; }
.ix-flag {
  position: absolute; right: 5%; top: 12%;
  width: 140px; height: auto;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,.6));
  border: 2px solid rgba(255,255,255,.3);
  border-radius: 6px;
  overflow: hidden;
  animation: flagRise 1s ease-out .3s both;
}
@keyframes flagRise {
  from { transform: translateY(-50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.ix-geo-hud {
  position: absolute; right: 5%; bottom: 18%;
  background: rgba(0,0,0,.7); backdrop-filter: blur(14px);
  border: 1px solid rgba(0,255,200,.3);
  border-radius: 14px;
  padding: 14px 18px;
  min-width: 220px;
  box-shadow: 0 8px 24px rgba(0,255,200,.2);
}
.hud-row {
  display: flex; justify-content: space-between;
  padding: 4px 0; border-bottom: 1px dashed rgba(255,255,255,.1);
  font-size: 13px;
}
.hud-row:last-child { border: 0; }
.hud-k { color: rgba(255,255,255,.7); }
.hud-v { color: #FFD166; font-weight: 900; }

/* ========== 2. 拆機爆炸圖 ========== */
.ix-exploded-stage {
  position: absolute; inset: 0;
}
.ix-explode-center {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 25%; max-height: 50%;
  object-fit: contain;
  filter: drop-shadow(0 12px 28px rgba(255,209,102,.4));
  animation: heroPulse 3s ease-in-out infinite;
}
.ix-part-tag {
  position: absolute;
  transform: translate(-50%, -50%);
  text-align: center;
  animation: partFlyIn .8s ease-out both;
}
@keyframes partFlyIn {
  from { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
.ix-part-tag .part-emoji {
  display: inline-block; font-size: 50px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.6));
  animation: floatBob 2s ease-in-out infinite;
}
@keyframes floatBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.ix-part-tag .part-info {
  background: rgba(0,0,0,.7); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  color: white;
  margin-top: 4px;
  white-space: nowrap;
}
.part-name { font-weight: 900; color: #FFD166; }
.part-spec { font-size: 10px; opacity: .85; }
.ix-explode-lines {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

/* ========== 3. 時光機 ========== */
.ix-timeline-stage {
  position: absolute; inset: 0;
  padding: 30px 40px;
  display: flex; flex-direction: column;
}
.ix-time-track {
  position: relative;
  height: 100px;
  margin: 20px 0;
}
.time-line {
  position: absolute; top: 50%; left: 0; right: 0;
  height: 4px; background: rgba(255,255,255,.2);
  border-radius: 2px;
  transform: translateY(-50%);
}
.time-fill {
  height: 100%; background: linear-gradient(90deg, #FFD166, #FF6B9D);
  border-radius: 2px;
  transition: width 1s;
}
.time-dot {
  position: absolute; top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 2;
}
.time-dot.active .time-marker { color: #FFD166; transform: scale(1.5); }
.time-marker {
  display: block;
  font-size: 24px;
  transition: transform .3s;
}
.time-year {
  display: block; font-size: 14px; font-weight: 900; color: white;
  margin-bottom: 6px;
}
.time-label {
  display: block; margin-top: 6px;
  font-size: 11px; color: rgba(255,255,255,.7);
  white-space: nowrap;
}
.ix-time-hero {
  flex: 1; display: flex; align-items: center; justify-content: center;
  gap: 30px;
}
.time-hero-img {
  max-height: 50vh; max-width: 40%;
  object-fit: contain;
  filter: drop-shadow(0 12px 28px rgba(0,0,0,.5));
  animation: heroPulse 2.5s ease-in-out infinite;
}
.time-hero-info { color: white; }
.th-year {
  font-size: 60px; font-weight: 900;
  background: linear-gradient(135deg, #FFD166, #FF6B9D);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.th-label { font-size: 22px; margin-top: 8px; font-weight: 700; }

/* ========== 4. 科學原理 ========== */
.ix-physics-stage {
  position: absolute; inset: 0;
  display: flex; align-items: center; padding: 20px;
}
.ix-physics-svg {
  flex: 1; max-width: 65%;
  filter: drop-shadow(0 8px 24px rgba(0,255,200,.3));
}
.ix-physics-svg svg { width: 100%; max-height: 60vh; }
.ix-physics-hero {
  position: absolute; right: 4%; top: 50%;
  transform: translateY(-50%);
  width: 24%; max-height: 60%;
  filter: drop-shadow(0 12px 28px rgba(0,0,0,.5));
  animation: heroPulse 2.5s infinite;
}
.ix-physics-info {
  position: absolute; left: 5%; bottom: 18%;
  background: rgba(0,0,0,.7); backdrop-filter: blur(14px);
  border: 1px solid rgba(0,255,200,.3);
  border-radius: 14px; padding: 12px 16px;
  max-width: 40%;
}
.phy-title { color: #00ff88; font-weight: 900; font-size: 16px; margin-bottom: 4px; }
.phy-desc { color: rgba(255,255,255,.85); font-size: 12px; line-height: 1.5; }

/* ========== 5. 人物肖像 ========== */
.ix-inventor-stage {
  position: absolute; inset: 0;
  display: grid; grid-template-columns: 1fr 1.5fr; gap: 20px; padding: 30px;
}
.ix-portrait {
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 18px;
  padding: 20px;
  text-align: center;
  align-self: center;
}
.ix-portrait img {
  width: 200px; height: 200px;
  object-fit: cover; border-radius: 50%;
  border: 4px solid #FFD166;
  filter: drop-shadow(0 8px 20px rgba(255,209,102,.4));
}
.portrait-placeholder {
  width: 200px; height: 200px; margin: 0 auto;
  background: radial-gradient(circle, #FFD166, #FF6B9D);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 100px;
}
.portrait-name { color: white; font-size: 22px; font-weight: 900; margin-top: 12px; }
.portrait-title { color: rgba(255,255,255,.7); font-size: 13px; }
.ix-quote {
  background: rgba(255,255,255,.05); border-radius: 18px;
  padding: 30px; align-self: center;
  position: relative;
}
.quote-marks {
  font-size: 80px; line-height: 0.5;
  color: #FFD166; opacity: .4;
  position: absolute; top: 30px; left: 20px;
}
.quote-text {
  color: white; font-size: 20px; font-weight: 700; line-height: 1.6;
  font-style: italic;
  padding-left: 40px;
}
.quote-source { color: #FFD166; margin-top: 16px; font-size: 13px; text-align: right; }
.ix-bio {
  grid-column: 1 / -1;
  background: rgba(0,0,0,.4); border-radius: 14px;
  padding: 14px 20px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.bio-row { color: white; font-size: 12px; text-align: center; }
.bio-k { display: block; color: rgba(255,255,255,.6); font-weight: 700; margin-bottom: 4px; }

/* ========== 6. 數據視覺化 ========== */
.ix-data-stage {
  position: absolute; inset: 0;
  display: flex; align-items: center; padding: 30px;
}
.ix-data-hero {
  width: 30%; max-height: 60%;
  filter: drop-shadow(0 12px 28px rgba(0,0,0,.5));
}
.ix-stats-grid {
  flex: 1; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; padding-left: 30px;
}
.ix-stat-big {
  background: linear-gradient(135deg, rgba(255,255,255,.18), rgba(255,255,255,.05));
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 18px;
  padding: 18px; text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
.ix-stat-big .stat-icon { font-size: 40px; }
.ix-stat-big .stat-value {
  font-size: 48px; font-weight: 900; line-height: 1;
  background: linear-gradient(135deg, #FFD166, #FF6B9D);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 12px rgba(255,209,102,.5));
  margin: 6px 0;
}
.ix-stat-big .stat-unit { font-size: 14px; color: rgba(255,255,255,.7); font-weight: 700; }
.ix-stat-big .stat-name { font-size: 13px; color: rgba(255,255,255,.9); margin-top: 6px; font-weight: 800; }

/* ========== 7. YouTube 影片 ========== */
.ix-video-stage {
  position: absolute; inset: 0;
  padding: 30px;
}
.video-frame {
  position: absolute; left: 50%; top: 45%;
  transform: translate(-50%, -50%);
  width: 70%; aspect-ratio: 16/9;
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.video-frame iframe { width: 100%; height: 100%; border: 0; }
/* 全息玻璃風格 */
.style-hologram .video-frame {
  border: 3px solid rgba(0,255,200,.5);
  box-shadow:
    0 0 30px rgba(0,255,200,.4),
    inset 0 0 30px rgba(0,255,200,.2),
    0 20px 60px rgba(0,0,0,.7);
}
.style-hologram .video-frame::before, .style-hologram .video-frame::after {
  content: ""; position: absolute;
  width: 30px; height: 30px;
  border: 4px solid #00ff88;
  z-index: 10;
}
.style-hologram .video-frame::before { top: -3px; left: -3px; border-right: 0; border-bottom: 0; }
.style-hologram .video-frame::after { bottom: -3px; right: -3px; border-left: 0; border-top: 0; }
/* CRT 風格 */
.style-crt .video-frame {
  border: 12px solid #4a3a2a;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,.7), inset 0 0 60px rgba(80,150,255,.3);
}
/* 博物館玻璃櫃 */
.style-museum .video-frame {
  border: 6px solid rgba(255,255,255,.15);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,.6), inset 0 0 80px rgba(255,255,255,.05);
}
/* 實驗室 */
.style-lab .video-frame {
  border: 4px solid #0fc;
  border-radius: 16px;
}
/* 機器人投影 */
.style-projection .video-frame {
  border: 2px solid rgba(135,206,250,.4);
  border-radius: 16px;
  background: rgba(0,40,60,.8);
}

/* 影片掃描線 overlay */
.video-scanlines {
  position: absolute; inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg, transparent 0px, transparent 2px,
    rgba(0,255,200,.05) 2px, rgba(0,255,200,.05) 3px
  );
  z-index: 5;
}

/* HUD 4 角 */
.video-hud {
  position: absolute;
  background: rgba(0,0,0,.7); backdrop-filter: blur(10px);
  color: #FFD166; font-size: 12px; font-weight: 900;
  padding: 6px 12px; border-radius: 10px;
  border: 1px solid rgba(255,209,102,.3);
  font-family: 'Courier New', monospace;
  z-index: 8;
}
.video-hud.tl { top: 20px; left: 20px; }
.video-hud.tr { top: 20px; right: 20px; }
.video-hud.bl { bottom: 90px; left: 20px; }
.video-hud.br { bottom: 90px; right: 20px; }

.ix-video-hero {
  position: absolute; bottom: 60px; right: 20px;
  width: 120px; height: auto;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,.5));
  z-index: 6;
}

.video-caption-card {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,.6); backdrop-filter: blur(20px);
  padding: 12px 24px;
  color: white;
  border-top: 1px solid rgba(255,255,255,.1);
}
.vc-title { font-size: 16px; font-weight: 900; color: #FFD166; }
.vc-desc { font-size: 12px; opacity: .85; margin-top: 4px; }

/* ========== 8. 文化彩蛋 ========== */
.ix-collage-stage {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 30px;
}
.collage-year-big {
  position: absolute; top: 8%; left: 50%;
  transform: translateX(-50%);
  font-size: clamp(80px, 12vw, 160px);
  font-weight: 900;
  background: linear-gradient(135deg, #FFD166, #FF6B9D, #C77DFF);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 6px 20px rgba(255,107,157,.5));
  opacity: .85;
}
.collage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 20px;
  max-width: 80%;
  margin-top: 80px;
}
.collage-item {
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 18px;
  padding: 20px; text-align: center;
  animation: collageBounce .8s ease-out both;
}
@keyframes collageBounce {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.ci-emoji { font-size: 60px; }
.ci-label { color: white; font-weight: 800; font-size: 13px; margin-top: 8px; text-shadow: 0 2px 4px rgba(0,0,0,.5); }
.ix-collage-hero {
  position: absolute; right: 4%; bottom: 4%;
  width: 18%; max-height: 30%;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,.5));
}
