/**
 * guided-tour.css - 引导系统样式
 */

/* 引导模式下场景全屏 */
body.tour-mode .scene-canvas,
body.tour-mode #scene-canvas {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 1 !important;
}

body.tour-mode .app-container {
  padding: 0 !important;
  margin: 0 !important;
}

body.tour-mode .main-content {
  padding: 0 !important;
  margin: 0 !important;
}

/* 强制隐藏所有面板（排除调试面板） */
body.tour-mode .scene-n-panel,
body.tour-mode .n-panel-tabs,
body.tour-mode .left-sidebar,
body.tour-mode .right-sidebar,
body.tour-mode .toolbar,
body.tour-mode #toolbar,
body.tour-mode .statusbar,
body.tour-mode #statusbar,
body.tour-mode #left-sidebar,
body.tour-mode .properties-panel,
body.tour-mode .control-panel,
body.tour-mode .transform-toolbar,
body.tour-mode .main-header,
body.tour-mode header,
body.tour-mode aside {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* 调试面板在引导模式下保持可用 */
body.tour-mode .debug-panel {
  display: flex !important;
  pointer-events: auto !important;
}

body.tour-mode .debug-panel.visible {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
}

body.tour-mode .debug-panel:not(.visible) {
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(-20px) !important;
}

/* 侧边栏特别处理 */
body.tour-mode [class*="sidebar"] {
  display: none !important;
}

/* 沉浸式覆盖层 */
.guided-tour-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.guided-tour-overlay.active {
  opacity: 1;
}

/* 淡入淡出层 */
.tour-fade-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  opacity: 0;
  transition: opacity 1.5s ease;
}

/* 暗角效果 */
.tour-vignette {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    ellipse at center,
    transparent 40%,
    rgba(0, 0, 0, 0.3) 70%,
    rgba(0, 0, 0, 0.6) 100%
  );
  pointer-events: none;
}

/* 叙事容器 */
.narrative-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.narrative-container.active {
  opacity: 1;
}

/* 主标题文字 */
.narrative-text {
  font-size: 3rem;
  font-weight: 300;
  color: #fff;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.15em;
  margin-bottom: 1rem;
  opacity: 0;
  transition: opacity 0.8s ease;
}

/* 副标题 */
.narrative-subtitle {
  font-size: 1.2rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.6);
  letter-spacing: 0.1em;
  opacity: 0;
  transition: opacity 0.8s ease 0.3s;
}

/* 跳过按钮 */
.tour-skip-button {
  position: fixed;
  bottom: 40px;
  right: 40px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  cursor: pointer;
  z-index: 10001;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.tour-skip-button.active {
  opacity: 1;
  pointer-events: auto;
}

.tour-skip-button:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

/* 电影黑边效果 */
.cinematic-bars {
  position: fixed;
  left: 0;
  width: 100%;
  height: 60px;
  background: #000;
  z-index: 9998;
  transition: transform 0.8s ease;
}

.cinematic-bars.top {
  top: 0;
  transform: translateY(-100%);
}

.cinematic-bars.bottom {
  bottom: 0;
  transform: translateY(100%);
}

.cinematic-bars.active {
  transform: translateY(0);
}

/* 进度指示器 */
.tour-progress {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10001;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tour-progress.active {
  opacity: 1;
}

.tour-progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

.tour-progress-dot.active {
  background: #fff;
  transform: scale(1.3);
}

/* 提示框 */
.tour-tooltip {
  position: absolute;
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  font-size: 0.95rem;
  max-width: 300px;
  z-index: 10002;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.tour-tooltip.active {
  opacity: 1;
  transform: translateY(0);
}

.tour-tooltip::before {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-right: none;
  border-bottom: none;
  transform: rotate(45deg);
}

.tour-tooltip.bottom::before {
  top: -7px;
  left: 50%;
  margin-left: -6px;
}

.tour-tooltip.top::before {
  bottom: -7px;
  left: 50%;
  margin-left: -6px;
  transform: rotate(-135deg);
}

/* ========================================
   教学助手对话气泡样式
   ======================================== */

.teaching-assistant-container {
  position: fixed;
  bottom: 80px;
  left: 40px;
  width: auto;
  height: auto;
  max-width: 500px;
  pointer-events: none;
  z-index: 10003;
}

/* 对话气泡 */
.dialogue-bubble {
  position: relative;
  max-width: 450px;
  padding: 16px 20px;
  background: rgba(20, 25, 35, 0.95);
  border-radius: 16px;
  border: 2px solid var(--bubble-color, #4a9eff);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
              0 0 20px rgba(var(--bubble-color, 74, 158, 255), 0.2);
  backdrop-filter: blur(12px);
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: auto;
  cursor: pointer;
}

.dialogue-bubble.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.dialogue-bubble.hiding {
  opacity: 0;
  transform: translateY(-10px) scale(0.95);
}

/* 气泡位置 */
.dialogue-bubble.bottom-right {
  bottom: 80px;
  right: 40px;
}

.dialogue-bubble.bottom-left {
  bottom: 80px;
  left: 40px;
}

.dialogue-bubble.top-right {
  top: 80px;
  right: 40px;
}

.dialogue-bubble.top-center {
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px) scale(0.95);
}

.dialogue-bubble.top-center.visible {
  transform: translateX(-50%) translateY(0) scale(1);
}

.dialogue-bubble.center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
}

.dialogue-bubble.center.visible {
  transform: translate(-50%, -50%) scale(1);
}

/* 气泡头部 */
.bubble-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bubble-avatar {
  font-size: 1.5rem;
}

.bubble-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bubble-color, #4a9eff);
  letter-spacing: 0.5px;
}

/* 气泡内容 */
.bubble-content {
  font-size: 1.1rem;
  line-height: 1.6;
  color: #fff;
}

.bubble-text {
  white-space: pre-wrap;
}

.bubble-cursor {
  display: inline-block;
  animation: blink 0.8s infinite;
  color: var(--bubble-color, #4a9eff);
  margin-left: 2px;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* 继续提示 */
.bubble-indicator {
  margin-top: 12px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  text-align: right;
}

/* 代码样式气泡 */
.dialogue-bubble:has(.bubble-name:contains('代码')) .bubble-content {
  font-family: 'Consolas', 'Monaco', monospace;
  background: rgba(0, 0, 0, 0.3);
  padding: 12px;
  border-radius: 8px;
  font-size: 0.95rem;
}
