/* ===== 场景 Modal 覆盖层 ===== */
.scenes-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
}

.scenes-modal-box {
  width: 94%;
  max-width: 1000px;
  height: 88vh;
  background: var(--surface, rgba(15, 15, 35, 0.95));
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  border: 1px solid var(--border, rgba(226, 232, 240, 0.15));
}

.scenes-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: var(--surface-2, rgba(30, 30, 60, 0.9));
  backdrop-filter: blur(10px);
  color: var(--text, #e2e8f0);
  border-bottom: 1px solid var(--border, rgba(226, 232, 240, 0.15));
}

.scenes-modal-header .scenes-btn {
  padding: 6px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 14px;
}

.scenes-btn.primary { background: #6366f1; color: #fff; }
.scenes-btn.secondary { background: var(--surface-2, rgba(30, 30, 60, 0.9)); color: var(--text-muted, #94a3b8); border: 1px solid var(--border, rgba(226, 232, 240, 0.2)); }
.scenes-btn:hover { opacity: 0.9; }

.scenes-modal-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  min-height: 0;
}

.scenes-pane {
  flex: 1;
  overflow: auto;
  padding: 16px;
  min-width: 0;
}

.scene-view-pane { padding: 0; position: relative; }

.scene-view-inner {
  width: 100%;
  height: 100%;
  min-height: 400px;
}

/* 场景列表卡片 */
.scenes-list {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.scene-card {
  width: 280px;
  background: var(--surface, rgba(15, 15, 35, 0.9));
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border, rgba(226, 232, 240, 0.15));
  transition: box-shadow 0.2s, transform 0.2s;
}

.scene-card:hover {
  box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.15);
  transform: translateY(-2px);
}

.scene-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

.scene-card h3 {
  margin: 12px 14px 8px;
  font-size: 18px;
  color: var(--text, #e2e8f0);
}

.scene-card .enter-btn {
  display: block;
  width: calc(100% - 24px);
  margin: 8px 12px 14px;
  padding: 10px 16px;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
}

.scene-card .enter-btn:hover { background: #4f46e5; }

.scene-card { position: relative; }

/* 未解锁小场景卡片：图片区蒙层 + 大号「未解锁」+ 无按钮、点击无反应 */
.scene-card-locked {
  pointer-events: none;
  opacity: 1;
}
.scene-card-locked .scene-card-img-wrap {
  position: relative;
  width: 100%;
  height: 160px;
  overflow: hidden;
}
.scene-card-locked .scene-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.6) brightness(0.75);
}
.scene-card-lock-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.scene-card-lock-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.scene-card-lock-svg svg {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
.scene-card-locked h3 {
  color: var(--text-muted, #94a3b8);
}
.scene-card-enter-disabled {
  display: block;
  width: calc(100% - 24px);
  margin: 8px 12px 14px;
  padding: 10px 16px;
  text-align: center;
  background: var(--surface-2, rgba(30, 30, 60, 0.9));
  color: var(--text-muted, #94a3b8);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border, rgba(226, 232, 240, 0.15));
}

/* 场景视图（背景 + NPC） */
.scene-container {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 450px;
  background-size: cover;
  background-position: center;
  background-color: #8b7355;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.scene-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);
  color: #fff;
}

.scene-header h2 { margin: 0; font-size: 20px; }

.npc-layer {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 48px;
  padding: 32px 24px;
}

.npc {
  position: relative;
  width: 120px;
  text-align: center;
  cursor: pointer;
  color: var(--text, #e2e8f0);
  padding: 12px 10px 14px;
  border-radius: 12px;
  background: var(--surface, rgba(15, 15, 35, 0.95));
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  border: 2px solid rgba(99, 102, 241, 0.35);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.npc:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  border-color: rgba(99, 102, 241, 0.6);
}

/* 卡片顶部角标：可对话 / 未解锁 */
.npc-badge {
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: 0 0 10px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  z-index: 3;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.npc-badge-unlocked {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  color: #fff;
}
.npc-badge-locked {
  background: linear-gradient(180deg, #64748b 0%, #475569 100%);
  color: #fff;
}

.npc-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin: 12px auto 10px;
  background: linear-gradient(135deg, #e8d5c4 0%, #d4b896 100%);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.npc-label { font-weight: 600; font-size: 15px; margin-bottom: 4px; color: var(--text, #e2e8f0); }
.npc-hint { font-size: 12px; color: var(--text-muted, #94a3b8); }

/* 未解锁 NPC：灰底 + 虚线边框 + 顶部「未解锁」角标 + 头像区大锁，点击无反应 */
.npc-locked {
  pointer-events: none;
  cursor: default;
  background: linear-gradient(180deg, rgba(30, 30, 55, 0.95) 0%, rgba(20, 25, 45, 0.95) 100%);
  border: 2px dashed var(--text-muted, #94a3b8);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.2);
}
.npc-locked:hover {
  transform: none;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.2);
}
.npc-locked .npc-label { color: var(--text-muted, #94a3b8); }
.npc-locked .npc-hint-locked {
  color: var(--text-muted, #94a3b8);
  font-weight: 600;
  font-size: 12px;
}
.npc-avatar-locked {
  background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%) !important;
}
.npc-lock-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted, #94a3b8);
}
.npc-lock-icon svg {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
}

/* 场景内聊天弹窗 */
.scene-chat-floating {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 360px;
  max-width: calc(100vw - 48px);
  z-index: 2100;
}

.scene-chat-window {
  background: var(--surface, rgba(15, 15, 35, 0.95));
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border, rgba(226, 232, 240, 0.15));
}

.scene-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: #6366f1;
  color: #fff;
}

.scene-chat-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.scene-chat-body {
  height: 220px;
  overflow-y: auto;
  padding: 12px;
  background: var(--surface-2, rgba(30, 30, 60, 0.9));
  color: var(--text, #e2e8f0);
}

.scene-chat-body .message { margin: 8px 0; padding: 8px 12px; border-radius: 8px; }
.scene-chat-body .message.user { text-align: right; background: rgba(99, 102, 241, 0.25); color: #c7d2fe; }
.scene-chat-body .message.ai { text-align: left; background: var(--surface, rgba(15, 15, 35, 0.9)); border: 1px solid var(--border, rgba(226, 232, 240, 0.15)); color: var(--text, #e2e8f0); }

.scene-chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border, rgba(226, 232, 240, 0.15));
}

.scene-chat-input-row input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border, rgba(226, 232, 240, 0.2));
  border-radius: 8px;
  font-size: 14px;
  background: var(--surface-2, rgba(30, 30, 60, 0.9));
  color: var(--text, #e2e8f0);
}

.scene-chat-input-row button {
  padding: 10px 16px;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.scene-chat-input-row button:hover { background: #4f46e5; }

/* 场景练习载入提示 */
.scene-practice-loading {
  padding: 32px;
  text-align: center;
  color: #fff;
  font-size: 18px;
  background: rgba(15, 23, 42, 0.85);
  border-radius: 12px;
  margin: auto;
}

/* 场景内练习叠加层 - 半透明背景，居中练习面板 */
.scene-practice-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  padding: 20px;
  overflow: auto;
}

.scene-practice-container {
  width: 100%;
  max-width: 520px;
  max-height: 100%;
  overflow-y: auto;
}

.scene-practice-container .practice-dialogue-area {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.practice-scene-record-btn.recording {
  background: #b71c1c !important;
  animation: pulse-recording 1s ease-in-out infinite;
}
@keyframes pulse-recording {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Modal 打开时隐藏底部场景按钮 */
body.scenes-modal-open .enter-scenes-btn { visibility: hidden; pointer-events: none; }

/* 场景内练习时，输入/录音区域置于顶层，用户可继续录音 */
body.scene-practice-active .input-area {
  position: relative;
  z-index: 2500;
}

