/* 编程闯关 · 关卡页（深空星图 + 积木） */

@font-face {
  font-family: 'PangMenZhengDao';
  src: url('../assets/fonts/pangmenzhengdao.ttf') format('truetype');
  font-display: swap;
}

@font-face {
  font-family: 'Morena';
  src: url('../assets/fonts/Morena.otf') format('opentype');
  font-display: swap;
}

:root {
  --bg: #070916;
  --line: rgba(99, 102, 241, 0.35);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --blue: #3b82f6;
  --cyan: #22d3ee;
  --gold: #fbbf24;
  --danger: #f87171;
  --success: #4ade80;
}

/* 图片禁止拖拽，避免用户拖到窗口外在新标签页打开 */
img {
  -webkit-user-drag: none;
  user-select: none;
}

/* 原生下拉选项统一深色，避免白底白字看不清 */
select option,
select optgroup {
  background-color: #121a33;
  color: #f1f4ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: #0a0a1f;
}

/* ================= 顶栏 ================= */
.header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 60px;
  padding: 0 16px;
  background: rgba(12, 9, 38, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 0 1 auto;
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  transition: 0.2s;
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.18);
}

.level-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.header-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  line-height: 1.1;
  color: #f0f9ff;
  text-decoration: none;
  white-space: nowrap;
}

.brand-ico {
  display: block;
  width: auto;
  height: 26px;
  filter: drop-shadow(0 0 8px rgba(139, 124, 246, .55));
}

.brand-name {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.brand-cn {
  font-family: 'PangMenZhengDao', "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 19px;
  line-height: 1;
  letter-spacing: 2px;
  color: #f0f9ff;
}

.header-brand .brand-en {
  font-family: 'Morena', Georgia, "Times New Roman", serif;
  font-size: 11px;
  letter-spacing: 1.4px;
  color: var(--muted);
  opacity: .9;
}

.header-brand:hover,
.header-brand:hover .brand-en,
.header-brand:hover .brand-cn {
  color: #93c5fd;
}

/* 比赛模式：隐藏底部通栏，只保留右下角参考答案浮层 */
body.is-contest-mode .info-bar {
  display: none !important;
}

.solution-float {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 160;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid rgba(250, 204, 21, 0.5);
  background: rgba(20, 18, 6, 0.92);
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .4);
}

.solution-float:hover {
  background: rgba(250, 204, 21, 0.22);
}

/* 比赛模式顶栏导航：实时榜单 / 上一题 / 全部题库 / 下一题 */
.lv-contest-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
}

@media (max-width: 1280px) {
  .lv-contest-nav {
    display: grid;
    grid-template-columns: auto auto;
    gap: 4px 6px;
  }
}

.lv-nav-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.lv-nav-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.lv-nav-btn.is-gold {
  background: rgba(255, 171, 25, 0.16);
  border-color: rgba(255, 171, 25, 0.55);
  color: #ffc042;
}

.lv-nav-btn.is-gold:hover {
  background: rgba(255, 171, 25, 0.26);
  color: #ffd166;
}

.lv-nav-btn.is-disabled,
.lv-nav-btn:disabled {
  opacity: .38;
  cursor: default;
  pointer-events: none;
}

.header-left [hidden] {
  display: none !important;
}

.header-crumb {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.header-crumb a {
  color: var(--muted);
  text-decoration: none;
}

.header-crumb a:hover {
  color: #93c5fd;
}

.header-crumb .crumb-sep {
  opacity: .45;
}

@media (max-width: 1180px) {
  .header-crumb {
    display: none;
  }
}

.level-title-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: none;
  background: none;
  color: #f0f9ff;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.level-title-btn:hover {
  color: #93c5fd;
}

.info-dot {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  opacity: 0.55;
}

.level-subtitle {
  font-size: 12px;
  color: var(--muted);
}

/* --- 地图上的运行工具条 --- */
.map-toolbar {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  width: max-content;
  max-width: calc(100% - 24px);
  margin: 0 auto;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: calc(100% - 24px);
  padding: 6px 12px;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.run-btn {
  background: #ffab19;
  color: #1a1200;
  padding: 8px 22px;
  font-size: 16px;
  font-weight: 800;
  font-family: inherit;
  letter-spacing: 0.5px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 0 #b45309;
  transition: 0.15s;
}

.run-btn:hover:not(:disabled) {
  background: #ffc042;
  transform: translateY(-1px);
  box-shadow: 0 5px 0 #b45309;
}

.run-btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #b45309;
}

.run-btn:disabled {
  background: #64748b;
  box-shadow: 0 4px 0 #334155;
  cursor: not-allowed;
  transform: none;
}

.divider {
  width: 1px;
  height: 24px;
  margin: 0 4px;
  background: rgba(99, 102, 241, 0.5);
}

.speed-control {
  display: flex;
  align-items: center;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.speed-icon {
  display: flex;
  align-items: center;
  padding: 0 8px 0 10px;
  color: var(--muted);
}

.speed-btn {
  padding: 4px 10px;
  border: none;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: 0.2s;
}

.speed-btn:last-child {
  border-right: none;
}

.speed-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

.speed-btn.active {
  background: var(--blue);
  color: #fff;
}

.icon-btn {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: 0.2s;
}

.icon-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

.icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.icon-btn.active {
  color: #60a5fa;
}


/* 停止：运行中才可点，提示色 */
.stop-btn:not(:disabled) {
  color: #f87171;
}

.stop-btn:not(:disabled):hover {
  background: rgba(248, 113, 113, 0.15);
  color: #fca5a5;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

/* --- 关卡页工具条：靠左，停止 / 重置强化，加速改下拉 --- */
.is-level-play .map-toolbar {
  justify-content: flex-start;
  margin: 0 auto 0 0;
}

.is-level-play .icon-btn.is-strong {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
}

.is-level-play .icon-btn.is-strong svg {
  width: 22px;
  height: 22px;
}

.is-level-play .stop-btn.is-strong:not(:disabled) {
  border-color: rgba(248, 113, 113, 0.85);
  background: linear-gradient(180deg, #ef4444, #b91c1c);
  color: #fff;
  box-shadow: 0 2px 0 rgba(127, 29, 29, 0.9);
}

.is-level-play .stop-btn.is-strong:not(:disabled):hover {
  background: linear-gradient(180deg, #f87171, #dc2626);
  color: #fff;
}

.is-level-play .reset-btn.is-strong {
  border-color: rgba(147, 197, 253, 0.7);
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
  color: #eff6ff;
  box-shadow: 0 2px 0 rgba(30, 64, 175, 0.9);
}

.is-level-play .reset-btn.is-strong:hover:not(:disabled) {
  background: linear-gradient(180deg, #60a5fa, #2563eb);
}

.is-level-play .speed-select {
  height: 32px;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.4);
  color: #e2e8f0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color-scheme: dark;
}

.is-level-play .speed-select:focus {
  outline: none;
  border-color: rgba(96, 165, 250, 0.7);
}

/* 工具条靠左后，广播章节的通讯日志下移，避免被压住 */
.is-level-play .comm-log {
  top: 62px;
  max-height: calc(100% - 78px);
}

@media (max-width: 1100px) {
  .is-level-play .map-toolbar {
    max-width: calc(100% - var(--hud-w, 150px) - 40px);
  }
}

@media (max-width: 620px) {
  /* 手机：工具条单行横向滑动，步数 / 能量整体下移，互不遮挡 */
  .is-level-play .map-toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: calc(100% - 24px);
    scrollbar-width: none;
  }

  .is-level-play .map-toolbar::-webkit-scrollbar {
    display: none;
  }

  .is-level-play .hud {
    top: 58px;
    right: 12px;
  }

  .is-level-play .status {
    top: 98px;
  }

  .is-level-play .grid-container.is-music .status {
    top: 126px;
  }
}

/* --- 右侧 --- */
.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex: 0 0 auto;
}

.timer-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.32);
  color: #fcd34d;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 16px;
  font-weight: 700;
}

.timer-box svg {
  width: 16px;
  height: 16px;
}

.stars-box {
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: var(--gold);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

/* ================= 主体 ================= */
.main-content {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

.game-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* 答题页：地图内容整体下移 150px，上方留出空间给大件装饰（工具条仍在顶部） */
.game-area.is-level-play .map-wrapper {
  top: calc(50% + 150px);
}

/* 地图 / 积木之间的可拖拽分隔条 */
.splitter {
  flex: 0 0 6px;
  position: relative;
  z-index: 30;
  cursor: col-resize;
  background: transparent;
  touch-action: none;
}
.splitter::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 2px;
  width: 2px;
  background: rgba(49, 46, 129, 0.9);
  transition: background 0.15s, box-shadow 0.15s;
}
.splitter:hover::after,
.splitter.is-dragging::after {
  background: rgba(125, 211, 252, 0.9);
  box-shadow: 0 0 10px rgba(125, 211, 252, 0.7);
}
body.is-col-resizing {
  cursor: col-resize;
  user-select: none;
}

.grid-container {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
  background-color: #030616;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(79, 70, 229, 0.28) 0%, transparent 50%),
    radial-gradient(circle at 80% 72%, rgba(168, 85, 247, 0.22) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(34, 211, 238, 0.1) 0%, transparent 60%);
}

.grid-container.is-dragging {
  cursor: grabbing;
}

/* 星空 */
.starfield {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.star {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  animation: twinkle ease-in-out infinite alternate;
}

@keyframes twinkle {
  0% {
    opacity: 0.1;
    transform: scale(0.8);
  }
  100% {
    opacity: 0.9;
    transform: scale(1.2);
  }
}

/* 地图层 */
/* 坐标轴罗盘：只在开放「面向」积木的关卡显示 */
.map-compass {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 108px;
  height: 96px;
  color: rgba(127, 214, 255, 0.85);
  pointer-events: none;
  z-index: 3;
}

.map-compass[hidden] {
  display: none;
}

.map-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  z-index: 2;
  transform: translate(-50%, -50%);
  transition: transform 0.16s ease-out;
  will-change: transform;
  pointer-events: none;
}

.grid-container.is-dragging .map-wrapper {
  transition: none;
}

/* 第 27 章：星图画板铺满游戏区，观测平台（LEO / 砖 / 望远镜）压在左下角上层 */
.grid-container.has-star-window .map-wrapper {
  left: 30%;
  top: 78%;
  z-index: 4;
}

/* 第 27 章：望远镜等场景摆设，只贴图，不碰撞 */
.map-prop {
  position: absolute;
  transform: translate(-50%, -100%);
  z-index: 4;
  pointer-events: none;
  object-fit: contain;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.48));
}

/* 第 27 章：星图终端窗口。透明窗体，露出后面的观测场景；标题栏可拖动 */
.star-window {
  position: absolute;
  right: 2%;
  top: 104px;
  width: clamp(280px, 58%, 520px);
  height: 58%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: none;
  border: 1px solid rgba(96, 165, 250, 0.42);
  border-radius: 14px;
  background-color: rgba(4, 10, 26, 0.2);
  background-image:
    radial-gradient(circle at 18% 0%, rgba(56, 189, 248, 0.1), transparent 55%),
    linear-gradient(160deg, rgba(7, 17, 38, 0.18), rgba(3, 8, 24, 0.26));
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.32), inset 0 0 28px rgba(56, 189, 248, 0.07);
  transition: box-shadow 0.2s ease;
}

.star-window.is-dragging {
  transition: none;
  box-shadow: 0 24px 52px rgba(0, 0, 0, 0.48), inset 0 0 28px rgba(56, 189, 248, 0.12);
}

.star-window[hidden] {
  display: none;
}

/* 第 33 章：星图画板占满游戏区，不再显示等距地图 */
body.is-star-board .map-wrapper {
  display: none;
}

body.is-star-board .map-hint {
  display: none;
}

.star-window.is-board {
  left: 3%;
  right: 3%;
  top: 74px;
  bottom: 3%;
  width: auto;
  height: auto;
}

.star-window.is-board .star-window-svg {
  padding: 4px 8px 6px;
}

.star-window.is-board .star-window-head {
  cursor: default;
}

.sw-axis-title {
  fill: rgba(253, 230, 138, 0.92);
  font-weight: 700;
}

.sb-axis-end {
  text-anchor: end;
}

/* 星图画板：底板格子更淡，星名压在点上 */
body.is-star-board .sb-grid,
.star-window.is-board .sb-grid {
  stroke: rgba(96, 165, 250, 0.12);
}

.sb-star-name {
  fill: rgba(253, 230, 138, 0.92);
  font-size: 8px;
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(3, 8, 24, 0.9);
  stroke-width: 2.5px;
  stroke-linejoin: round;
}

/* 星图画板的引导线：细虚线，只作提示 */
.sb-guide {
  stroke: rgba(125, 211, 252, 0.3);
  stroke-width: 1;
  stroke-dasharray: 4 6;
  stroke-linecap: round;
}

/* 徐霞客测绘：节点坐标标签 */
.sb-coord {
  fill: rgba(186, 230, 253, 0.95);
  font-size: 8px;
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(3, 8, 24, 0.9);
  stroke-width: 2.5px;
  stroke-linejoin: round;
}

/* 徐霞客测绘：显示奇点按钮与高亮 */
.star-hint-btn {
  margin-left: auto;
  padding: 3px 9px;
  border: 1px solid rgba(251, 191, 36, 0.45);
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.1);
  color: #fde68a;
  font-size: 10px;
  line-height: 1.4;
  cursor: pointer;
}

.star-hint-btn:hover {
  background: rgba(251, 191, 36, 0.2);
}

.sw-dot.is-odd {
  fill: #fbbf24;
  stroke: #fff7ed;
  stroke-width: 2;
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 1));
}

.sw-halo.is-odd {
  fill: rgba(251, 191, 36, 0.28);
  stroke: rgba(251, 191, 36, 0.65);
  stroke-width: 1.5;
}

/* 星座连线完成：金色线条整体发光 */
#starBoardStrokes.is-glow polyline,
#starBoardStrokes.is-glow circle {
  filter: drop-shadow(0 0 5px rgba(253, 224, 71, 0.95))
    drop-shadow(0 0 12px rgba(253, 224, 71, 0.6));
}

.star-window-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 12px 6px;
  border-bottom: 1px solid rgba(96, 165, 250, 0.22);
  background: linear-gradient(90deg, rgba(3, 8, 24, 0.42), rgba(3, 8, 24, 0.12));
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.star-window.is-dragging .star-window-head {
  cursor: grabbing;
}

.star-window-kicker {
  flex: none;
  font-size: 10px;
  letter-spacing: 2px;
  color: #7dd3fc;
}

.star-window-title {
  font-size: 15px;
  font-weight: 600;
  color: #e0f2fe;
}

.star-window-sub {
  font-size: 10px;
  color: rgba(191, 219, 254, 0.62);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.star-window-svg {
  flex: 1;
  width: 100%;
  min-height: 0;
}

.sw-grid {
  stroke: rgba(96, 165, 250, 0.24);
  stroke-width: 1;
}

.sw-axis {
  fill: rgba(224, 242, 254, 0.7);
  font-size: 9px;
  text-anchor: middle;
}

.sw-axis-y {
  text-anchor: start;
}

/* 第 27 章：星座连线与 9 章一致，用金色发光细线 */
.sw-line {
  stroke: rgba(253, 224, 71, 0.9);
  stroke-width: 2;
  stroke-linecap: round;
  filter: drop-shadow(0 0 4px rgba(253, 224, 71, 0.9))
    drop-shadow(0 0 10px rgba(253, 224, 71, 0.45));
}

.sw-star {
  pointer-events: all;
  cursor: help;
}

.sw-halo {
  fill: rgba(253, 224, 71, 0.1);
}

.sw-dot {
  fill: #fde68a;
  filter: drop-shadow(0 0 6px rgba(253, 224, 71, 0.95));
}

.sw-name {
  fill: #fff3c4;
  font-size: 11px;
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(3, 8, 24, 0.85);
  stroke-width: 2px;
}

.sw-mag {
  fill: rgba(224, 242, 254, 0.9);
  font-size: 9px;
  text-anchor: middle;
}

.star-window-foot {
  flex: none;
  padding: 5px 12px;
  border-top: 1px solid rgba(96, 165, 250, 0.18);
  background: rgba(3, 8, 24, 0.28);
  font-size: 10px;
  color: rgba(224, 242, 254, 0.82);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.grid-layer {
  position: absolute;
  top: -2000px;
  left: -2000px;
  width: 4000px;
  height: 4000px;
  display: none;
}

/* 画笔层：和 grid-layer 同一坐标系，1px = 1 用户单位 */
.pen-layer {
  position: absolute;
  top: -2000px;
  left: -2000px;
  width: 4000px;
  height: 4000px;
  overflow: visible;
  pointer-events: none;
}

.pen-star {
  fill: rgba(253, 230, 138, 0.35);
  stroke: #fde68a;
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.pen-goal-edge {
  stroke: rgba(125, 211, 252, 0.7);
  stroke-width: 3;
  stroke-dasharray: 7 6;
  stroke-linecap: round;
}

.pen-strokes polyline,
.pen-strokes circle {
  filter: drop-shadow(0 0 3px rgba(103, 232, 249, 0.65));
}

.tiles-layer,
.items-layer,
.fp-layer,
.drone-fp-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
}

/* 样板皮肤：图片地面（320×160 无缝图案）与墙件 */
.art-floor,
.art-wall-layer {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

.art-floor-tile {
  position: absolute;
  width: 80px;
  height: 52px;
  pointer-events: none;
}

/* 远景站体：每章一张透明底立绘，压暗压低饱和，只做氛围 */
.scene-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.scene-img {
  position: absolute;
  right: -5%;
  top: 2%;
  width: auto;
  height: auto;
  max-width: 68%;
  max-height: 88%;
  opacity: 0.6;
  filter: brightness(0.95) saturate(0.98);
  transition: transform 0.18s ease-out;
}

/* 个别章节（如鹊桥）远景靠左摆 */
.scene-img.scene-left {
  right: auto;
  left: -5%;
}

/* 天空装饰：卫星之类，固定在左上角，慢速漂移 */
.sky-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  pointer-events: none;
}

.sky-sat {
  position: absolute;
  left: 99px;
  top: 11%;
  width: 16%;
  filter: drop-shadow(0 0 18px rgba(140, 200, 255, 0.35));
  animation: skyDrift 14s ease-in-out infinite alternate;
}

@keyframes skyDrift {
  from { transform: translate3d(0, 0, 0) rotate(-2deg); }
  to { transform: translate3d(80px, -40px, 0) rotate(3deg); }
}

/* 砖面上的一层淡格子线，帮学生数格子 */
.art-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  overflow: visible;
  pointer-events: none;
}

.art-grid path {
  fill: none;
  stroke: rgba(20, 12, 4, 0.24);
  stroke-width: 1;
}

.art-wall {
  position: absolute;
  pointer-events: none;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.45));
  image-rendering: -webkit-optimize-contrast;
}

/* 自由装饰件：像素坐标绝对定位，位置由装饰编辑器摆放 */
.art-item-layer {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

.art-item {
  position: absolute;
  pointer-events: none;
  image-rendering: -webkit-optimize-contrast;
}

/* 平贴贴图：只取顶面，不带厚度，和地面齐平 */
.art-decal {
  position: absolute;
  pointer-events: none;
}

/* 穿梭机占地：把机身盖住的格子在地面上框出来 */
.fp-ship {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  transition-property: transform;
  transition-timing-function: cubic-bezier(0.33, 1, 0.68, 1);
  will-change: transform;
}

.fp-ship svg {
  position: absolute;
  overflow: visible;
}

.fp-ship path {
  stroke-linejoin: round;
}

/* 无人机落脚框：机身悬停时，地面用整格虚线菱形标出实际站位 */
.fp-drone {
  position: absolute;
  left: 0;
  top: 0;
  width: 80px;
  height: 60px;
  pointer-events: none;
  transition-property: transform;
  transition-timing-function: cubic-bezier(0.33, 1, 0.68, 1);
  will-change: transform;
}

.fp-drone svg {
  position: absolute;
  overflow: visible;
}

.fp-drone path {
  fill: rgba(103, 232, 249, 0.12);
  stroke: rgba(165, 243, 252, 0.95);
  stroke-width: 1.8;
  stroke-dasharray: 7 5;
  stroke-linejoin: round;
  animation: drone-frame-pulse 1.8s ease-in-out infinite;
}

@keyframes drone-frame-pulse {
  0%, 100% { opacity: 0.82; }
  50% { opacity: 1; }
}

/* 框里的淡色影子，让悬停的机身和地面格子产生联系 */
.fp-drone::before {
  content: '';
  position: absolute;
  left: 26px;
  top: 12px;
  width: 28px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(103, 232, 249, 0.30), rgba(103, 232, 249, 0) 72%);
}

/* 隐藏后的地面标记：虚线格框 + 中心圆点 */
.dev-hidden-mark {
  position: absolute;
  left: 0;
  top: 0;
  width: 88px;
  height: 48px;
  pointer-events: none;
  transition-property: transform;
  transition-timing-function: cubic-bezier(0.33, 1, 0.68, 1);
  will-change: transform;
  animation: hiddenMarkPulse 1.8s ease-in-out infinite;
}

.dev-hidden-mark svg {
  position: absolute;
  left: 0;
  top: 0;
  overflow: visible;
}

@keyframes hiddenMarkPulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 0.95; }
}

.tile {
  position: absolute;
  width: 80px;
  height: 60px;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.55));
}

/* 播放动画时关掉整片地砖的投影：几十个滤镜同时重绘是主要卡顿来源，静止时再恢复 */
body.is-animating .tile {
  filter: none;
}

/* 飞船航道：地面发光跑道，只是地板装饰，不挡点击也不投阴影 */
.tile-lane {
  filter: none;
  pointer-events: none;
}

/* 着陆点：停机砖，穿梭机压住它乘客才能下船 */
.tile-landing {
  filter: none;
  pointer-events: none;
}

.pickup {
  position: absolute;
  width: 17px;
  height: 24px;
  margin: -14px 0 0 -8.5px;
  transform: translateY(-5px);
  z-index: 6;
  transition: opacity 0.35s, transform 0.35s;
  filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.8));
}

.pickup img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  -webkit-user-select: none;
  user-select: none;
  animation: crystal-float 2.6s ease-in-out infinite;
}

/* 水晶上下浮动 + 轻微明暗呼吸（SVG 内部的动效在地图上尺寸太小，这里再补一层） */
@keyframes crystal-float {
  0%, 100% { transform: translateY(0); opacity: 0.9; }
  50% { transform: translateY(-4px); opacity: 1; }
}

/* 能量块被吃掉后：原地留下能量残影（这一格仍算“能量格”） */
.pickup.is-taken {
  opacity: 1;
  transform: translateY(2px) scale(0.5);
  filter: none;
  z-index: 4;
}

.pickup.is-taken img {
  animation: none;
  opacity: 0.3;
  filter: grayscale(0.75) brightness(0.75);
}

/* 门没有前后之分：默认用 door-b 贴图，dir=x 时换成 door-a 贴图 */
/* door-a / door-b 是同一张图的左右镜像，viewBox 也互为镜像，所以两套尺寸完全一致 */
.map-door {
  position: absolute;
  width: 165px;
  height: 179px;
  margin: -151px 0 0 -83px;
  z-index: 5;
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
}

/* 调试标记：只在 ?gate=1 时插入，用来核对道闸落点 */
.gate-debug {
  position: absolute;
  pointer-events: none;
  z-index: 9999;
}

/* 道闸立绘：立柱落在门格左下侧，横杆沿「右上」方向横跨路面；
   整体比旧立绘门矮一截，不再挡住后面的道路 */
.map-door.is-new,
.map-timed-door.is-new,
.map-password-door.is-new,
.map-power-door.is-new {
  width: 140px;
  height: 132px;
  margin: -135px 0 0 -115px;
  transform: translate(40px, 20px);
}

/* 镜像门取消上面的右下偏移，保持原始锚点 */
.map-power-door.is-new.is-flip,
.map-timed-door.is-new.is-flip {
  transform: none;
}

/* 沿 y 轴的道路：整张道闸以门格中心左右镜像，横杆改朝左上，立柱换到另一侧 */
.map-power-door.is-new.is-flip {
  margin: -110px 0 0 -80px;
}

.map-power-door.is-new.is-flip img {
  transform: scaleX(-1);
  transform-origin: 75px 50%;
}

.map-power-door.is-new .pdw-badge {
  left: 36px;
  top: -12px;
}

.map-power-door.is-new.is-flip .pdw-badge {
  left: 114px;
}

.map-door img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.25s ease;
}

.map-door .md-open {
  opacity: 0;
}

.map-door.is-open .md-closed {
  opacity: 0;
}

.map-door.is-open .md-open {
  opacity: 1;
}

/* 收到广播的那一帧：门框闪一圈信号光，提示「这扇门就是被它打开的」 */
.map-door.is-signal img {
  animation: doorSignal 0.9s ease-out;
}

@keyframes doorSignal {
  0% {
    filter: brightness(1);
  }
  35% {
    filter: brightness(1.8) drop-shadow(0 0 18px rgba(125, 211, 252, 0.95));
  }
  100% {
    filter: brightness(1);
  }
}

/* 配对门的编号：挂在道闸立柱顶上，和开关编号同一套青色发光 */
.md-badge {
  position: absolute;
  left: 36px;
  top: -12px;
  transform: translateX(-50%);
  padding: 0 4px;
  border-radius: 9px;
  background: #0b1220;
  border: 1px solid #22d3ee;
  color: #a5f3fc;
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  text-shadow: 0 0 8px rgba(34, 211, 238, 0.9);
  box-shadow: 0 0 9px rgba(34, 211, 238, 0.5);
}

/* 开关：太阳能板式控制台，挡路；未按下整体熄灭，按下后面板通电发光 */
.map-switch {
  position: absolute;
  width: 96px;
  height: 101px;
  margin: -113px 0 0 -48px;
  z-index: 6;
  pointer-events: none;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.45));
}

/* 新版立绘开关：保持旧开关底边落点，只把画框加高 */
.map-switch.is-new {
  width: 69.1px;
  height: 70.7px;
  margin: -73.7px 0 0 -34.6px;
}

.map-switch img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.25s ease;
}

.map-switch .sw-on {
  opacity: 0;
}

.map-switch.is-on .sw-off {
  opacity: 0;
}

.map-switch.is-on .sw-on {
  opacity: 1;
}

/* 开关编号：用 SVG 贴在面板的等距坐标系里，和面板倾斜完全一致 */
.sw-num {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.sw-num .num-halo {
  fill: none;
  stroke: #3ff5ff;
  stroke-width: 18;
  opacity: 0.15;
}

.sw-num .num-glow {
  fill: none;
  stroke: #3ff5ff;
  stroke-width: 10;
  opacity: 0.4;
}

.sw-num .num-core {
  fill: #3ff5ff;
}

.sw-num .num-white {
  fill: #ffffff;
  opacity: 0.8;
}

/* ne/se 保持原图；nw 是朝左的视角，把斜面板水平镜像（水平方板左右对称，无需镜像） */
.map-switch.is-dir-nw .sw-off,
.map-switch.is-dir-nw .sw-on {
  transform: scaleX(-1);
}

/* 未通电时数字变暗，不再发光 */
.map-switch:not(.is-on) .num-halo {
  stroke: #46606f;
  opacity: 0.06;
}

.map-switch:not(.is-on) .num-glow {
  stroke: #46606f;
  opacity: 0.18;
}

.map-switch:not(.is-on) .num-core {
  fill: #8aa8bb;
}

.map-switch:not(.is-on) .num-white {
  opacity: 0.32;
}

/* 密码门：按顺序说对密码后打开；外观与普通门保持一致 */
.map-password-door {
  position: absolute;
  width: 165px;
  height: 179px;
  margin: -151px 0 0 -83px;
  z-index: 20;
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
}

.map-password-door img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.25s ease;
}

/* 密码门开启后：同样保留门框，中间的能量场消失 */
.map-password-door .pd-open {
  opacity: 0;
}

.map-password-door.is-open .pd-closed {
  opacity: 0;
}

.map-password-door.is-open .pd-open {
  opacity: 1;
}

/* 机器人走到门格或更靠前时，门让到机器人下层 */
.map-password-door.is-behind {
  z-index: 8;
}

/* 机器人头顶的说话气泡 */
.robot-say {
  position: absolute;
  transform: translateX(-50%);
  min-width: 46px;
  max-width: 150px;
  padding: 7px 12px;
  z-index: 900;
  border-radius: 12px;
  background: #e2e8f0;
  color: #0f172a;
  font-size: 18px;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.robot-say::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -7px;
  margin-left: -7px;
  border: 7px solid transparent;
  border-top-color: #e2e8f0;
  border-bottom: 0;
}

.robot-say.is-ok {
  background: #a7f3d0;
  color: #065f46;
}

.robot-say.is-ok::after {
  border-top-color: #a7f3d0;
}

.robot-say.is-wrong {
  background: #fecaca;
  color: #991b1b;
}

.robot-say.is-wrong::after {
  border-top-color: #fecaca;
}

.robot-say.is-open {
  background: #fde68a;
  color: #92400e;
}

.robot-say.is-open::after {
  border-top-color: #fde68a;
}

.robot-say[hidden] {
  display: none;
}

/* 定时门：外观与普通门一致，计步器显示「还要等几步」，0 表示可以进 */
.map-timed-door {
  position: absolute;
  width: 165px;
  height: 179px;
  margin: -151px 0 0 -83px;
  z-index: 5;
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
}

.map-timed-door img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.25s ease;
}

/* 定时门开启后：保留门框，中间的能量场消失 */
.map-timed-door .td-open {
  opacity: 0;
}

.map-timed-door .td-badge {
  position: absolute;
  left: 50%;
  top: 32px;
  transform: translateX(-50%);
  min-width: 17px;
  height: 17px;
  padding: 0 3px;
  border-radius: 9px;
  background: #0b1220;
  border: 1px solid #22d3ee;
  color: #a5f3fc;
  font-size: 10px;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.55);
}

/* 道闸版定时门：计步器挂在立柱顶上，和过路费徽章同一位置 */
.map-timed-door.is-new .td-badge {
  left: 36px;
  top: -12px;
  transform: none;
}

/* 竖向走廊里的定时门：整张道闸左右镜像，横杆改朝左上，立柱换到另一侧 */
.map-timed-door.is-new.is-flip {
  margin: -110px 0 0 -80px;
}

.map-timed-door.is-new.is-flip img {
  transform: scaleX(-1);
  transform-origin: 75px 50%;
}

.map-timed-door.is-new.is-flip .td-badge {
  left: 114px;
}

.map-timed-door.is-open .td-closed {
  opacity: 0;
}

.map-timed-door.is-open .td-open {
  opacity: 1;
}

/* 走过的定时门：门在身后合上，不再显示计步器 */
.map-timed-door.is-passed .td-badge {
  display: none;
}

.map-timed-door.is-passed {
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45)) brightness(0.8);
}

/* 电量闸门：门上的负数是过路费，交过一次之后门保持打开 */
.map-power-door {
  position: absolute;
  width: 165px;
  height: 179px;
  margin: -151px 0 0 -83px;
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
}

.map-power-door img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.25s ease;
}

.map-power-door .pdw-open {
  opacity: 0;
}

.map-power-door.is-open .pdw-closed {
  opacity: 0;
}

.map-power-door.is-open .pdw-open {
  opacity: 1;
}

.map-power-door .pdw-badge {
  position: absolute;
  left: 50%;
  top: 32px;
  transform: translateX(-50%);
  padding: 0 4px;
  border-radius: 9px;
  background: #0b1220;
  border: 1px solid #fbbf24;
  color: #fde68a;
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.9);
  box-shadow: 0 0 9px rgba(251, 191, 36, 0.5);
}

/* 传送门：地面漩涡台，踩上去立刻传送到配对格 */
.map-portal {
  position: absolute;
  width: 80px;
  height: 84px;
  margin: -60px 0 0 -40px;
  z-index: 5;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

.map-portal img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.55));
  animation: portalPulse 3.6s ease-in-out infinite;
}

@keyframes portalPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.95;
  }
  50% {
    transform: scale(1.04);
    opacity: 1;
  }
}

/* 未通电：漩涡变灰，并挂一个「待通电」小牌 */
.map-portal.is-locked img {
  filter: grayscale(0.7) brightness(0.5);
  animation: none;
  opacity: 0.55;
}

.map-portal .portal-lock {
  position: absolute;
  left: 50%;
  bottom: -12px;
  transform: translateX(-50%);
  padding: 1px 7px;
  border-radius: 9px;
  font-size: 11px;
  line-height: 1.5;
  color: #bae6fd;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(56, 189, 248, 0.45);
  white-space: nowrap;
}

/* 收到广播：通电瞬间亮一下 */
.map-portal.is-signal img {
  animation: signalUnlock 0.9s ease-out;
}

@keyframes signalUnlock {
  0% {
    transform: scale(0.92);
    filter: drop-shadow(0 0 2px rgba(56, 189, 248, 0.4));
  }
  45% {
    transform: scale(1.12);
    filter: drop-shadow(0 0 22px rgba(125, 211, 252, 1)) brightness(1.6);
  }
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.55)) brightness(1);
  }
}

/* 颜色灯：立在地上的灯柱，挡路；颜色随步数在蓝 / 红之间切换 */
.map-lamp {
  position: absolute;
  width: 68px;
  height: 110px;
  margin: -115px 0 0 -34px;
  z-index: 0;
  pointer-events: none;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.45));
}

.map-lamp img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  -webkit-user-select: none;
  user-select: none;
  transition: opacity 0.25s ease;
}

/* 灯柱顶部的呼吸光，颜色随灯的当前颜色变化 */
.map-lamp .ml-glow {
  position: absolute;
  left: 50%;
  top: 9px;
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(96, 196, 255, 0.9) 0%, rgba(70, 160, 255, 0.42) 42%, rgba(70, 160, 255, 0) 72%);
  animation: lamp-pulse 2.2s ease-in-out infinite;
  pointer-events: none;
}

.map-lamp.is-red .ml-glow {
  background: radial-gradient(circle, rgba(255, 96, 120, 0.9) 0%, rgba(255, 60, 90, 0.42) 42%, rgba(255, 60, 90, 0) 72%);
}

@keyframes lamp-pulse {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .map-lamp .ml-glow {
    animation: none;
    opacity: 0.8;
  }
}

.map-lamp .ml-red {
  opacity: 0;
}

.map-lamp.is-red .ml-blue {
  opacity: 0;
}

.map-lamp.is-red .ml-red {
  opacity: 1;
}

/* 巡逻体：橙红哨兵，每走一步沿路线移动一格 */
/* 外星人巡逻哨兵：与机器人共用同一套脚底基线与深度 */
.map-patrol {
  position: absolute;
  width: 104px;
  height: 104px;
  margin-left: -52px;
  margin-top: -85.34px;
  pointer-events: none;
  transition-property: left, top;
  transition-timing-function: cubic-bezier(0.33, 1, 0.68, 1);
  will-change: left, top;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.55));
}

.map-patrol .pt-img {
  position: absolute;
  left: 0;
  top: -15px;
  width: 104px;
  height: 104px;
  -webkit-user-select: none;
  user-select: none;
}

.map-goal {
  position: absolute;
  width: 48px;
  height: 60px;
  margin: -75px 0 0 -24px;
  z-index: 6;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  filter: drop-shadow(0 4px 7px rgba(55, 80, 110, 0.4));
}

.map-goal svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* 第 26 章：分身关灯位。地面上的小灯点，站上去点亮 */
.map-lamp-spot {
  position: absolute;
  width: 22px;
  height: 13px;
  margin: -7px 0 0 -11px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, rgba(150, 198, 255, 0.5), rgba(150, 198, 255, 0.1) 70%, transparent 76%);
  box-shadow: 0 0 0 1px rgba(160, 205, 255, 0.35) inset;
  z-index: 5;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.map-lamp-spot.is-pen {
  width: 14px;
  height: 8px;
  margin: -4px 0 0 -7px;
}

.map-lamp-spot.is-base {
  background: radial-gradient(circle at 50% 45%, rgba(110, 231, 183, 0.55), rgba(110, 231, 183, 0.08) 70%, transparent 76%);
  box-shadow: 0 0 0 1px rgba(110, 231, 183, 0.5) inset;
}

.map-lamp-spot.is-clone {
  background: radial-gradient(circle at 50% 45%, rgba(253, 224, 71, 0.55), rgba(253, 224, 71, 0.08) 70%, transparent 76%);
  box-shadow: 0 0 0 1px rgba(253, 224, 71, 0.5) inset;
}

.map-lamp-spot.is-lit {
  background: radial-gradient(circle at 50% 45%, #ffe9a8, #ffb020 62%, rgba(255, 176, 32, 0) 80%);
  box-shadow: 0 0 10px rgba(255, 190, 60, 0.85), 0 0 3px rgba(255, 228, 160, 0.9);
  transform: scale(1.15);
}

/* 第 27 章：星图上的星点，名字与亮度只作展示 */
.map-star {
  position: absolute;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  z-index: 5;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

.map-star svg {
  width: 20px;
  height: 20px;
  fill: #fde68a;
  filter: drop-shadow(0 0 5px rgba(253, 224, 71, 0.9));
}

.map-star .ms-name {
  position: absolute;
  left: 50%;
  top: -15px;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 10px;
  line-height: 12px;
  color: #fff3c4;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

.map-star .ms-mag {
  position: absolute;
  left: 50%;
  bottom: -13px;
  transform: translateX(-50%);
  min-width: 12px;
  padding: 0 3px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.75);
  color: #fde68a;
  font-size: 9px;
  line-height: 12px;
  text-align: center;
  font-style: normal;
}

.gp-pin {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: gpFloat 3.2s ease-in-out infinite;
}

.gp-ripple {
  fill: none;
  stroke: #b9cee2;
  stroke-width: 3;
  transform-box: fill-box;
  transform-origin: center;
  animation: gpRipple 2.8s ease-out infinite;
}

.gp-r2 {
  animation-delay: 1.4s;
}

.gp-ground {
  transform-box: fill-box;
  transform-origin: center;
  animation: gpGround 3.2s ease-in-out infinite;
}

@keyframes gpFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-11px);
  }
}

@keyframes gpRipple {
  0% {
    transform: scale(0.3);
    opacity: 0.8;
  }
  70% {
    transform: scale(1.9);
    opacity: 0;
  }
  100% {
    transform: scale(1.9);
    opacity: 0;
  }
}

@keyframes gpGround {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.26;
  }
  50% {
    transform: scale(0.78);
    opacity: 0.14;
  }
}

/* 扫描线：立在路中间的能量幕，颜色由 need 决定（红 / 蓝 / 透明检测） */
.scan-svg {
  position: absolute;
  width: 80px;
  height: 40px;
  overflow: visible;
  pointer-events: none;
}

.scan-svg.is-red {
  color: #ff5f6d;
}

.scan-svg.is-blue {
  color: #48d8ff;
}

.scan-svg.is-ghost {
  color: #d8e6ff;
}

.scan-svg.is-solid {
  color: #ffd166;
}

/* 绿色造型扫描线：只放外星人通过 */
.scan-svg.is-alien {
  color: #4ade80;
}

.scan-glow {
  fill: currentColor;
  opacity: 0.28;
  filter: blur(8px);
}

/* 幕布本体：很淡的一层，让网格有"面"的感觉 */
.scan-body {
  fill: currentColor;
  opacity: 0.08;
}

/* 静态底网：纵向纯垂直，横向按等距坡度斜过去 */
.scan-grid line {
  stroke: currentColor;
  stroke-width: 1;
  opacity: 0.35;
}

/* 左右两条能量边，纯垂直 */
.scan-edges {
  animation: scanPulse 2s ease-in-out infinite;
}

.scan-edges line {
  stroke: currentColor;
  stroke-width: 2.5;
  opacity: 0.9;
  filter: drop-shadow(0 0 3px currentColor);
}

/* 流动电流：纵向向下、横向向右 */
.scan-flow {
  animation: scanBreathe 2.5s ease-in-out infinite;
}

.scan-flow-v {
  stroke: currentColor;
  stroke-width: 2;
  stroke-dasharray: 14 40;
  animation: scanFlowDown 1.5s linear infinite;
}

.scan-flow-h {
  stroke: #ffffff;
  stroke-width: 1.2;
  stroke-dasharray: 18 60;
  opacity: 0.9;
  animation: scanFlowRight 2s linear infinite;
}

/* 穿过扫描线的一瞬间亮一下 */
.scan-svg.is-flash {
  animation: scanFlash 0.6s ease-out;
}

@keyframes scanFlash {
  0% {
    filter: brightness(2.6) saturate(1.4);
  }
  45% {
    filter: brightness(1.9) saturate(1.2);
  }
  100% {
    filter: brightness(1) saturate(1);
  }
}

@keyframes scanFlowDown {
  from {
    stroke-dashoffset: 54;
  }
  to {
    stroke-dashoffset: -54;
  }
}

@keyframes scanFlowRight {
  from {
    stroke-dashoffset: 78;
  }
  to {
    stroke-dashoffset: -78;
  }
}

@keyframes scanPulse {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 0.85;
  }
}

@keyframes scanBreathe {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

/* 机器人（LEO 四方向位图） */
.dev {
  position: absolute;
  left: 0;
  top: 0;
  width: 104px;
  height: 104px;
  z-index: 10;
  pointer-events: none;
  transition-property: transform;
  transition-timing-function: cubic-bezier(0.33, 1, 0.68, 1);
  will-change: transform;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.55));
}

.dev-img {
  position: absolute;
  left: 0;
  top: -15px;
  width: 100%;
  height: 100%;
  -webkit-user-select: none;
  user-select: none;
  transform-origin: 50% 100%;
  transform: translate(var(--press-x, 0px), var(--press-y, 0px)) scale(var(--dev-scale, 1));
  opacity: var(--dev-alpha, 1);
  filter: var(--dev-tint, hue-rotate(0deg));
  transition: transform 0.16s ease-out, opacity 60ms linear, filter 240ms linear;
}

/* 外星人贴图比 LEO 窄一圈，视觉上放大 50% 与 LEO 匹配（只放大贴图，不改占地与逻辑尺寸） */
.dev[data-costume="alien"] .dev-img {
  transform: translate(var(--press-x, 0px), var(--press-y, 0px))
    scale(var(--dev-scale, 1)) scale(1.5);
}

/* 上船后乘客暂时离场，视觉上直接从船上消失（下船那一帧再出现） */
.dev.is-riding .dev-img {
  opacity: 0;
}

/* 穿梭机：贴图按 2×3 格显示，逻辑占地同样是 2×3（长边跟着朝向转）。
   图片比角色框大一圈，靠 left / top 让机身压在整片占地的中心。 */
.dev.is-ship {
  /* 底部椭圆投影已经单独画，关掉通用的外投影，避免双影 */
  filter: none;
}

/* 地面投影：固定画在占地区域上，机身抬起时缩小、变淡 */
.dev.is-ship::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 67px;
  width: 160px;
  height: 38px;
  margin-left: -80px;
  margin-top: -19px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center,
    rgba(0, 0, 0, 0.6) 0%,
    rgba(0, 0, 0, 0.28) 52%,
    rgba(0, 0, 0, 0) 74%);
  transform: scale(var(--dev-shadow, 1));
  opacity: var(--dev-shadow-alpha, 0.9);
  transition: transform 0.16s ease-out, opacity 0.16s ease-out;
  pointer-events: none;
}

/* 多格停机坪：一整块方型投影 */
.pad-svg {
  position: absolute;
  pointer-events: none;
  overflow: visible;
}

/* 空中障碍层：压在所有地面元素和角色之上 */
.air-layer {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  z-index: 500;
  pointer-events: none;
}

/* 贴图约为占地的 2/3，留出一圈地面，让占格框线露出来 */
/* 空中障碍：漂浮陨石 + 地面禁飞圈 */
.air-rock {
  position: absolute;
  width: 120px;
  height: 170px;
  pointer-events: none;
  z-index: 6;
  overflow: visible;
}
.air-rock .air-ring {
  fill: rgba(244, 63, 94, 0.10);
  stroke: rgba(251, 113, 133, 0.62);
  stroke-width: 1.6;
  stroke-dasharray: 5 4;
  stroke-linejoin: round;
}
.air-rock .air-beam {
  stroke: rgba(251, 191, 36, 0.30);
  stroke-width: 1.2;
  stroke-dasharray: 3 5;
}
.air-cloud-img {
  animation: airCloudFloat 3.2s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0.8;
}
@keyframes airCloudFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
.air-rock-body {
  animation: airRockFloat 2.8s ease-in-out infinite;
  transform-origin: 60px 58px;
}
@keyframes airRockFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.dev.is-ship .dev-img {
  left: -40px;
  top: -35px;
  width: calc(184px * var(--ship-img-scale, 1));
  height: auto;
  object-fit: contain;
  transform: translateY(var(--dev-lift, 0px));
  transition: transform 0.15s ease-out;
}

/* 右上那张画布更宽扁，同样宽度会矮一截，单独缩放并抬回底部齐平 */
.dev.is-ship[data-dir="north"] .dev-img,
.dev.is-ship[data-dir="west"] .dev-img {
  left: -32px;
  top: -20px;
  width: calc(167px * var(--ship-img-scale, 1));
}

/* 3×3 大机身：用新的一套飞船贴图，按 3×3 占地居中 */
.dev.is-ship.is-big .dev-img {
  left: -21px;
  top: -4px;
  width: calc(166px * var(--ship-img-scale, 1));
}
.dev.is-ship.is-big[data-dir="north"] .dev-img,
.dev.is-ship.is-big[data-dir="west"] .dev-img {
  left: -21px;
  top: -4px;
  width: calc(166px * var(--ship-img-scale, 1));
}

/* 左下那张贴图画布更高、机翼更靠右下，同一锚点会压出停机坪下缘约 20px。
   朝南 / 朝东（左下贴图）单独上提 20px，让机身轮廓收进框线内 */
.dev.is-ship.is-big[data-dir="south"] .dev-img,
.dev.is-ship.is-big[data-dir="east"] .dev-img {
  top: -24px;
}

/* 只有右上 / 左下两张贴图，east 与 west 靠水平镜像 */
.dev.is-ship .dev-img.is-flip {
  transform: translateY(var(--dev-lift, 0px)) scaleX(-1);
}

/* 月球车：2×2 贴图，南 / 北两张原图，东 / 西靠水平镜像 */
.dev.is-rover .dev-img {
  transform-origin: 50% 50%;
  transform: translate(var(--press-x, 0px), var(--press-y, 0px)) scale(var(--dev-scale, 1));
}

.dev.is-rover .dev-img.is-flip {
  transform: translate(var(--press-x, 0px), var(--press-y, 0px))
    scale(var(--dev-scale, 1)) scaleX(-1);
}

/* 无人机：使用真实贴图，始终悬停在地砖上方；西/北朝向整机旋转 180° */
.dev.is-drone {
  filter: drop-shadow(0 10px 7px rgba(0, 0, 0, 0.32));
}

.dev.is-drone img.drone-img {
  width: 66px;
  height: auto;
  left: 50%;
  top: 12px;
  margin-left: -33px;
  transform-origin: 50% 50%;
  transform: translateY(-4px) scale(var(--dev-scale, 1));
}

.dev.is-drone img.drone-img.is-flip-y {
  transform: translateY(-4px) scale(var(--dev-scale, 1)) scaleY(-1);
}

.dev.is-drone .dev-img.is-riding {
  opacity: 0;
}

/* 「按下按钮」单独一层：60ms 交叉淡入，避免造型硬切 */
.dev-img-press {
  opacity: 0;
  pointer-events: none;
}

.dev.is-press .dev-img {
  opacity: 0;
}

.dev.is-press .dev-img-press {
  opacity: var(--dev-alpha, 1);
}

/* 完全透明时用角色自己的白色剪影代替，比虚线框更像"隐身" */
.dev.is-ghost::after {
  content: '';
  position: absolute;
  left: var(--dev-ghost-left, 0px);
  top: var(--dev-ghost-top, -15px);
  width: 100%;
  height: 100%;
  background-image: var(--dev-src);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  filter: brightness(0) invert(1);
  opacity: 0.22;
  pointer-events: none;
  transform-origin: 50% 100%;
  transform: translate(var(--press-x, 0px), var(--press-y, 0px)) scale(var(--dev-scale, 1));
  animation: ghostPulse 1.8s ease-in-out infinite;
}

/* 外星人隐身剪影跟随同样的 50% 放大，避免与本体大小对不上 */
.dev[data-costume="alien"].is-ghost::after {
  transform: translate(var(--press-x, 0px), var(--press-y, 0px))
    scale(var(--dev-scale, 1)) scale(1.5);
}

@keyframes ghostPulse {
  0%,
  100% {
    opacity: 0.14;
  }
  50% {
    opacity: 0.28;
  }
}

.dev.is-crash {
  animation: crash 0.45s ease-in-out 2;
}

@keyframes crash {
  0%,
  100% {
    filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.55));
  }
  50% {
    filter: drop-shadow(0 0 14px rgba(248, 113, 113, 0.95)) saturate(1.6);
  }
}

.dev svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* 机器人头顶电量条：暗色凹槽 + 20 段渐变格 + 流光 */
.robot-energy {
  position: absolute;
  width: 60px;
  height: 12px;
  z-index: 600;
  pointer-events: none;
  transition-property: left, top;
  transition-timing-function: cubic-bezier(0.33, 1, 0.68, 1);
  will-change: left, top;
}

.robot-energy[hidden] {
  display: none;
}

.robot-energy .re-groove {
  position: absolute;
  inset: 0;
  display: flex;
  gap: 1px;
  padding: 1px;
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid #2a3038;
  border-radius: 4px;
  background: rgba(10, 12, 16, 0.9);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
}

.robot-energy .re-groove i {
  flex: 1;
  border-radius: 2px;
  background: hsl(var(--seg-hue, 120), 100%, 45%);
  transition: background 160ms linear, opacity 160ms linear;
}

.robot-energy .re-groove i.is-off {
  background: #232a33;
  opacity: 0.8;
}

/* 顶部统一高光 */
.robot-energy .re-groove::after {
  content: '';
  position: absolute;
  left: 2px;
  right: 2px;
  top: 2px;
  height: 2px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.25);
  pointer-events: none;
}

/* 表面流光 */
.robot-energy .re-scan {
  position: absolute;
  top: 1px;
  bottom: 1px;
  width: 16px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0));
  animation: reScan 2.6s linear infinite;
  pointer-events: none;
}

@keyframes reScan {
  from {
    left: -16px;
  }
  to {
    left: 60px;
  }
}

/* 电量数字：读屏尺寸恒定，不随地图缩放变小 */
.robot-energy .re-num {
  position: absolute;
  left: calc(100% + 5px);
  top: 50%;
  transform: translateY(-50%) scale(var(--inv-scale, 1));
  transform-origin: left center;
  font: 700 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #e5f7ee;
  white-space: nowrap;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.95), 0 1px 2px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}

.robot-energy.is-low .re-num {
  color: #fecaca;
}

/* 电量低于 1/4：红色告警边框 */
.robot-energy.is-low .re-groove {
  border-color: rgba(248, 113, 113, 0.85);
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.5);
}

/* 状态提示 */
.status {
  position: absolute;
  top: 68px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: 8px 20px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fcd34d;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: 0.2s;
  z-index: 50;
  pointer-events: none;
}

.status.is-on {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* HUD 与提示 */
.hud {
  position: absolute;
  right: 16px;
  top: 14px;
  display: flex;
  gap: 8px;
  z-index: 20;
  pointer-events: none;
}

.hud-chip {
  padding: 5px 12px;
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid rgba(99, 102, 241, 0.35);
  font-size: 12.5px;
  color: var(--muted);
}

.hud-chip b {
  color: #e2e8f0;
  font-size: 14px;
}

.map-hint {
  position: absolute;
  right: 16px;
  bottom: 16px;
  font-size: 12px;
  color: rgba(148, 163, 184, 0.55);
  z-index: 20;
  pointer-events: none;
}

/* 通讯日志：广播章节专用的下行链路面板 */
.comm-log {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 208px;
  max-height: calc(100% - 32px);
  z-index: 21;
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  background: rgba(3, 10, 24, 0.78);
  border: 1px solid rgba(88, 202, 255, 0.32);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.42), inset 0 0 18px rgba(56, 189, 248, 0.08);
  backdrop-filter: blur(6px);
  pointer-events: none;
  overflow: hidden;
}

.comm-log[hidden] {
  display: none;
}

.comm-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  font-size: 12px;
  letter-spacing: 1px;
  color: #bfe6ff;
  border-bottom: 1px solid rgba(88, 202, 255, 0.18);
}

.comm-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
  animation: comm-blink 1.8s ease-in-out infinite;
}

.comm-body {
  list-style: none;
  margin: 0;
  padding: 6px 10px 8px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}

.comm-body li {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #dbeafe;
  animation: comm-in 0.32s ease-out;
}

.comm-no {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #7dd3fc;
  font-size: 10px;
  line-height: 14px;
  text-align: center;
}

.comm-name {
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.comm-tag {
  flex: 0 0 auto;
  color: #34d399;
  font-size: 10.5px;
}

@keyframes comm-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@keyframes comm-in {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: none; }
}

/* 广播信号波纹：从机器人头顶扩散 */
.signal-wave {
  position: absolute;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border-radius: 50%;
  border: 2px solid rgba(125, 211, 252, 0);
  z-index: 30;
  pointer-events: none;
}

.signal-wave.is-on {
  animation: signal-ring 0.9s ease-out forwards;
}

@keyframes signal-ring {
  0% {
    transform: scale(0.5);
    border-color: rgba(125, 211, 252, 0.95);
    box-shadow: 0 0 0 0 rgba(125, 211, 252, 0.5);
  }
  70% { border-color: rgba(125, 211, 252, 0.35); }
  100% {
    transform: scale(3.4);
    border-color: rgba(125, 211, 252, 0);
    box-shadow: 0 0 0 14px rgba(125, 211, 252, 0);
  }
}

/* ================= 积木区 ================= */
.blockly-area {
  position: relative;
  flex: 0 0 38%;
  min-width: 320px;
  background: #f9f9f9;
}

.blockly-host {
  position: absolute;
  inset: 0;
}

/* 第 16 章：列表监视器（只读，参考 Scratch 的列表监视器） */
.record-card {
  position: absolute;
  top: 62px;
  right: 16px;
  z-index: 6;
  width: 196px;
  max-height: 62%;
  border: 1px solid #e0d9d2;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(20, 12, 4, 0.16);
  overflow-y: auto;
}

.record-card[hidden] { display: none; }

.rc-section + .rc-section { border-top: 1px solid #f0e6dd; }

/* 唱片 + 节拍两张表并排：共用纵向滚动，行对齐，便于同一序号对照 */
#recordLists.is-columns {
  display: flex;
  align-items: flex-start;
}
#recordLists.is-columns .rc-section {
  flex: 1 1 0;
  min-width: 0;
}
#recordLists.is-columns .rc-section + .rc-section {
  border-top: 0;
  border-left: 1px solid #f0e6dd;
}
#recordLists.is-columns .rc-head {
  position: sticky;
  top: 0;
  z-index: 1;
  gap: 3px;
  padding: 5px 5px;
  font-size: 11px;
}
#recordLists.is-columns .rc-head span { font-size: 9px; }
#recordLists.is-columns .rc-list li {
  gap: 4px;
  padding: 3px 5px;
}
#recordLists.is-columns .rc-idx {
  flex: 0 0 12px;
  font-size: 10px;
}
#recordLists.is-columns .rc-note { font-size: 11px; }
#recordLists.is-columns .rc-midi {
  padding: 0 3px;
  font-size: 9.5px;
}

.rc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 8px;
  background: #ff661a;
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.5px;
}

.rc-head span { font-size: 11px; opacity: 0.85; }

.rc-list {
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: #fff;
}

.rc-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  color: #3a3a3a;
  font-size: 12px;
  line-height: 1.5;
}

.rc-list li.is-active {
  background: #ffe6d5;
  color: #b23c00;
  font-weight: 600;
}

.rc-idx {
  flex: 0 0 16px;
  text-align: right;
  color: #a5a5a5;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.rc-list li.is-active .rc-idx { color: #b23c00; }

.rc-note { flex: 1 1 auto; }

.rc-midi {
  flex: 0 0 auto;
  padding: 0 4px;
  border-radius: 4px;
  background: #fff1e7;
  color: #c2571a;
  font-size: 10.5px;
  font-weight: 700;
}

.rc-empty {
  color: #a5a5a5;
  font-size: 11px;
}

.blockly-bar {
  position: absolute;
  top: 10px;
  right: 14px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #e2e8f5;
  box-shadow: 0 2px 8px rgba(52, 84, 140, 0.12);
  font-size: 12.5px;
  color: #6b7c99;
}

.blockly-bar b {
  color: #3579e0;
  font-size: 14px;
}

.blockly-bar.is-over b {
  color: #ef4444;
}

/* ================= 多角色：角色选项卡 ================= */
/* 多角色标签：学 Scratch 的角色区，编辑器左下角横排卡片，图标在上、名字在下 */
.actor-tabs {
  position: absolute;
  left: 168px;
  bottom: 12px;
  z-index: 6;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: calc(100% - 190px);
  overflow-x: auto;
  padding: 2px;
}

.actor-tab {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  width: 80px;
  height: 88px;
  padding: 6px 4px 7px;
  border: 2px solid #e2e8f5;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 2px 8px rgba(15, 35, 70, 0.14);
  font-size: 12px;
  color: #47536b;
  cursor: pointer;
  transition: transform 0.12s ease-out, box-shadow 0.12s ease-out;
}

/* 4~5 个角色时收窄卡片，尽量一排放得下；放不下仍可横向滚动 */
.actor-tabs[data-count="4"] .actor-tab {
  width: 68px;
  height: 80px;
}

.actor-tabs[data-count="4"] .actor-tab img {
  width: 44px;
  height: 44px;
}

.actor-tabs[data-count="5"] {
  gap: 6px;
}

.actor-tabs[data-count="5"] .actor-tab {
  width: 56px;
  height: 74px;
  padding: 5px 3px 6px;
}

.actor-tabs[data-count="5"] .actor-tab img {
  width: 36px;
  height: 36px;
}

.actor-tabs[data-count="5"] .actor-tab span {
  font-size: 11px;
}

.actor-tab:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 14px rgba(15, 35, 70, 0.22);
}

.actor-tab img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
}

.actor-tab span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.actor-tab.is-active {
  border-color: #3579e0;
  background: #eef4ff;
  color: #1f4fa8;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(53, 121, 224, 0.32);
}

/* 工具箱文字用深色，避免和浅色底对比不足 */
.blocklyToolboxDiv,
.blocklyToolboxDiv .blocklyTreeLabel,
.blocklyToolboxDiv .blocklyTreeRow {
  color: #111827 !important;
}

.mini-btn {
  padding: 3px 10px;
  border: 1px solid #e2e8f5;
  border-radius: 6px;
  background: #fff;
  color: #6b7c99;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}

.mini-btn:hover {
  border-color: #c3d4f2;
  background: #f7faff;
}

/* ================= 关卡说明（底部通栏） ================= */
.info-bar {
  position: fixed;
  top: 84px;
  right: 18px;
  width: 360px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 120px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 14px 16px 16px;
  border: 1px solid rgba(129, 140, 248, 0.35);
  border-radius: 14px;
  background: rgba(10, 12, 32, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  z-index: 120;
  user-select: none;
}

.info-bar.is-off {
  display: none;
}

.info-bar.is-dragging {
  cursor: grabbing;
  box-shadow: 0 26px 64px rgba(0, 0, 0, 0.6);
}

/* 收起后留下的小按钮，点一下重新打开题目 */
.info-fab {
  position: fixed;
  top: 84px;
  right: 18px;
  padding: 7px 14px;
  border: 1px solid rgba(250, 204, 21, 0.4);
  border-radius: 999px;
  background: rgba(10, 12, 32, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--gold);
  font-size: 12.5px;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  z-index: 121;
  transition: 0.2s;
}

.info-fab:hover {
  background: rgba(250, 204, 21, 0.16);
}

.info-fab[hidden] {
  display: none;
}

.info-bar-id {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: none;
  min-width: 0;
  padding-right: 60px;
  cursor: move;
  touch-action: none;
}

.info-bar-name {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.info-bar-name strong {
  font-size: 16px;
  color: #f0f9ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.info-seq {
  align-self: flex-start;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.14);
  border: 1px solid rgba(96, 165, 250, 0.35);
  color: #93c5fd;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
}

.info-stage {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.info-best {
  font-size: 12px;
  color: var(--gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.info-goal,
.info-know {
  margin: 0;
  flex: 0 0 auto;
  min-width: 0;
  font-size: 13.5px;
  line-height: 1.7;
  color: #cbd5e1;
}

/* 音乐关：简谱 / 唱名 / 音名 / MIDI 对照表 */
.info-scale {
  flex: 0 0 auto;
  margin: 2px 0 0;
  font-size: 12.5px;
  color: #cbd5e1;
}

.info-scale summary {
  cursor: pointer;
  width: -moz-fit-content;
  width: fit-content;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(129, 140, 248, 0.4);
  background: rgba(99, 102, 241, 0.14);
  color: #c7d2fe;
  list-style: none;
}

.info-scale summary::-webkit-details-marker {
  display: none;
}

.info-scale summary::before {
  content: '♪ ';
}

.info-scale[open] summary {
  margin-bottom: 6px;
}

.info-scale table {
  width: 100%;
  border-collapse: collapse;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

.info-scale th,
.info-scale td {
  padding: 2px 4px;
  text-align: center;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.info-scale th {
  color: #94a3b8;
  font-weight: 500;
}

.info-scale td {
  color: #e2e8f0;
}

.info-scale-tip {
  margin: 6px 0 0;
  font-size: 11.5px;
  color: #94a3b8;
}

.info-goal .info-line {
  display: block;
}

/* 题面里的算式行：等宽字体 + 高亮 */
.info-goal .info-formula {
  display: block;
  margin: 6px 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(96, 165, 250, 0.12);
  border-left: 3px solid rgba(96, 165, 250, 0.6);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 15px;
  letter-spacing: 1px;
  color: #dbeafe;
}

.info-know b {
  display: block;
  margin-bottom: 2px;
  font-size: 11.5px;
  letter-spacing: 0.5px;
  color: #93c5fd;
}

.info-bar-close {
  position: absolute;
  top: 10px;
  right: 12px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: 0.2s;
}

.info-bar-close:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* ================= 结算弹窗 ================= */
.modal-mask {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 6, 22, 0.72);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: 0.2s;
  z-index: 220;
}

.modal-mask.is-on {
  opacity: 1;
  visibility: visible;
}

.result-modal {
  width: 380px;
  max-width: 100%;
  padding: 26px 24px;
  text-align: center;
  border-radius: 18px;
  background: linear-gradient(180deg, #15123a 0%, #0b0a22 100%);
  border: 1px solid rgba(129, 140, 248, 0.4);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  transform: translateY(10px) scale(0.97);
  transition: 0.25s;
}

.modal-mask.is-on .result-modal {
  transform: translateY(0) scale(1);
}

/* 应用题题面：居中大字卡，避免长题挤在左下角 */
.question-modal {
  width: min(760px, 100%);
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  text-align: left;
  border-radius: 18px;
  background: linear-gradient(180deg, #15123a 0%, #0b0a22 100%);
  border: 1px solid rgba(129, 140, 248, 0.4);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  transform: translateY(10px) scale(0.97);
  transition: 0.25s;
}

.modal-mask.is-on .question-modal {
  transform: translateY(0) scale(1);
}

.qm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 26px 0;
}

.qm-kicker {
  font-size: 12px;
  letter-spacing: 2px;
  color: #7dd3fc;
}

.qm-x {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.qm-x:hover {
  color: #fff;
  border-color: rgba(125, 211, 252, 0.5);
}

.qm-title {
  margin: 8px 26px 0;
  font-size: 22px;
  line-height: 1.4;
  color: #f0f9ff;
}

.qm-body {
  margin-top: 14px;
  padding: 0 26px 10px;
  overflow: auto;
  color: #dbeafe;
  font-size: 16px;
  line-height: 1.9;
}

.qm-body p {
  margin: 0 0 10px;
}

.qm-body p:last-child {
  margin-bottom: 0;
}

.qm-foot {
  padding: 14px 26px 22px;
  text-align: right;
}

.qm-start {
  padding: 10px 24px;
  border-radius: 10px;
  border: 1px solid rgba(34, 211, 238, 0.55);
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.24), rgba(14, 116, 144, 0.24));
  color: #e0f2fe;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.qm-start:hover {
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.36), rgba(14, 116, 144, 0.32));
}

@media (max-width: 640px) {
  .qm-head,
  .qm-title,
  .qm-body,
  .qm-foot {
    padding-left: 18px;
    padding-right: 18px;
  }
  .qm-title {
    margin-left: 18px;
    margin-right: 18px;
  }
  .qm-body {
    font-size: 15px;
  }
}

.result-kicker {
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--muted);
}

.result-title {
  margin: 8px 0 0;
  font-size: 24px;
  color: #f0f9ff;
}

.result-title.is-pass {
  color: var(--success);
}

.result-title.is-fail {
  color: var(--danger);
}

.result-stars {
  margin-top: 12px;
  font-size: 34px;
  letter-spacing: 8px;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.14);
}

.result-stars .on {
  color: var(--gold);
  text-shadow: 0 0 16px rgba(251, 191, 36, 0.55);
}

.result-sub {
  margin: 10px 0 0;
  font-size: 13.5px;
  line-height: 1.7;
  color: #cbd5e1;
  min-height: 22px;
}

.result-ref-msg {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.6;
  min-height: 18px;
  color: #93c5fd;
}

.result-stats {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
}

.result-stats span {
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.result-actions {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.act {
  padding: 9px 20px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: 0.15s;
}

.act:hover {
  background: rgba(255, 255, 255, 0.14);
}

.act-primary {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}

.act-primary:hover {
  background: #2563eb;
}

.act-gold {
  background: #ffab19;
  border-color: #ffab19;
  color: #1a1200;
}

.act.is-disabled {
  opacity: .38;
  cursor: default;
  pointer-events: none;
}

/* 比赛倒计时：进行中琥珀色，结束红色 */
#timerDisplay.is-contest {
  color: #ffc042;
}

#timerDisplay.is-ended {
  color: #f87171;
}

.act-gold:hover {
  background: #ffc042;
}

/* ================= 窄屏兜底 ================= */
@media (max-width: 1100px) {
  .map-toolbar {
    gap: 6px;
    padding: 5px 8px;
  }

  .run-btn {
    padding: 7px 16px;
    font-size: 15px;
  }

  .blockly-area {
    flex-basis: 42%;
  }
}

@media (max-width: 860px) {
  body {
    height: auto;
    overflow: auto;
    overflow-x: hidden;
  }

  .header {
    flex-wrap: wrap;
    height: auto;
    padding: 8px 12px;
    gap: 8px;
  }

  .header-left {
    flex: 1 1 100%;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
  }

  .header-right {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }

  .map-toolbar {
    top: 8px;
    gap: 5px;
    padding: 5px 8px;
    max-width: calc(100% - 16px);
  }

  .map-toolbar .run-btn {
    padding: 7px 14px;
    font-size: 14px;
  }

  .map-toolbar .icon-btn {
    width: 32px;
    height: 32px;
  }

  .status {
    top: 104px;
  }

  .main-content {
    flex-direction: column;
  }

  .game-area {
    flex: 0 0 62vh;
    border-right: none;
    border-bottom: 2px solid rgba(49, 46, 129, 0.9);
  }

  .blockly-area {
    flex: 0 0 70vh;
    min-width: 0;
  }

  .info-bar {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px 16px;
    padding: 10px 12px 34px;
  }

  .info-bar-id {
    max-width: none;
  }

  .info-goal,
  .info-know {
    flex: 1 1 100%;
  }

  /* 竖屏/窄屏：题目胶囊改到地图区右上角，避免压住底部任务条的「收起」 */
  .info-fab {
    top: 110px !important;
    right: 12px !important;
    left: auto !important;
    bottom: auto !important;
  }
}

/* ================= 权限：参考答案 / 会员锁定 ================= */
/* 参考答案底部通栏：普通模式保留原来的整条底栏，比赛模式隐藏 */
.solution-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 9px 18px;
  background: linear-gradient(180deg, rgba(14, 12, 38, 0.98), rgba(7, 9, 26, 0.98));
  border-top: 1px solid var(--line);
  /* 底栏是 flex item，z-index 会生效；这里压到 40，低于右下角「云存档」胶囊的 60，避免把它挡住 */
  z-index: 40;
}

.solution-bar[hidden] {
  display: none;
}

.info-solution {
  flex: 0 0 auto;
  margin: 0;
  padding: 6px 12px;
  border: 1px solid rgba(250, 204, 21, 0.4);
  border-radius: 8px;
  background: rgba(250, 204, 21, 0.12);
  color: var(--gold);
  font-size: 12px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s;
}

.info-solution:hover {
  background: rgba(250, 204, 21, 0.24);
}

.solution-mask {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(3, 6, 22, 0.76);
}

.solution-mask.is-on {
  display: grid;
}

.solution-box {
  width: min(1000px, 94vw);
  max-height: 82vh;
  overflow: auto;
  padding: 22px;
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 18px;
  background: linear-gradient(180deg, #111631, #0a0d24);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.55);
}

.solution-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.solution-head h3 {
  margin: 0;
  font-size: 17px;
  color: #f0f9ff;
}

.solution-close {
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}

.solution-close:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.solution-body {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.solution-body > * {
  min-width: 0;
}

.solution-body > .solution-code {
  flex: 1 1 0;
}

.solution-code {
  margin: 0;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: #dbeafe;
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 积木截图限制最大尺寸，避免参考解弹窗被图片撑满；保持等比缩放 */
.solution-body img {
  display: block;
  flex: 0 0 auto;
  width: auto;
  max-width: min(420px, 100%);
  max-height: 42vh;
  height: auto;
  margin: 0;
  background: none;
  border-radius: 10px;
}

@media (max-width: 520px) {
  .solution-body {
    flex-direction: column;
  }
}

.solution-empty {
  margin: 6px 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.8;
}

.solution-empty a {
  color: #93c5fd;
}

/* ---------------- 非会员解析预览（三段式转化卡） ---------------- */
.solution-upsell {
  display: block;
}

.upsell-step {
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(96, 165, 250, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.upsell-step-tag {
  margin-bottom: 8px;
  color: #93c5fd;
  font-size: 12px;
  letter-spacing: 0.5px;
}

.upsell-step-text {
  margin: 0;
  color: #dbeafe;
  font-size: 13.5px;
  line-height: 1.9;
}

.upsell-knowledge {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.solution-code.is-preview {
  position: relative;
  max-height: 190px;
  overflow: hidden;
}

.solution-code.is-preview::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 72px;
  background: linear-gradient(180deg, rgba(10, 13, 36, 0), #0b0f24);
  pointer-events: none;
}

.upsell-cta {
  margin-top: 4px;
  padding: 18px;
  border: 1px solid rgba(139, 124, 246, 0.4);
  border-radius: 14px;
  text-align: center;
  background: linear-gradient(135deg, rgba(111, 92, 240, 0.22), rgba(75, 139, 255, 0.18));
}

.upsell-cta h4 {
  margin: 0 0 6px;
  color: #fff;
  font-size: 16px;
}

.upsell-cta p {
  margin: 0 0 14px;
  color: #b9c6e8;
  font-size: 12.5px;
}

.upsell-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.upsell-primary,
.upsell-later {
  padding: 10px 20px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

.upsell-primary {
  border: 0;
  background: linear-gradient(135deg, #6f5cf0, #4b8bff);
  color: #fff;
  font-weight: 600;
}

.upsell-later {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: #b9c6e8;
}

.upsell-later:hover {
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 520px) {
  .upsell-cta-actions {
    flex-direction: column;
  }
}

.level-locked {
  max-width: 560px;
  margin: 8vh auto;
  padding: 38px 32px;
  text-align: center;
  border: 1px solid rgba(96, 165, 250, 0.28);
  border-radius: 20px;
  background: rgba(10, 14, 38, 0.86);
}

.level-locked-tag {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid rgba(250, 204, 21, 0.4);
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.12);
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 1px;
}

.level-locked h2 {
  margin: 16px 0 10px;
  font-size: 24px;
  color: #f0f9ff;
}

.level-locked p {
  margin: 0 0 24px;
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.8;
}

.level-locked-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.level-locked-btn,
.level-locked-link {
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
}

.level-locked-btn {
  background: linear-gradient(135deg, #facc15, #f59e0b);
  color: #1a1400;
}

.level-locked-link {
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--muted);
}


/* 太阳能充电板：2×2 格地面道具，用过后变暗 */
.map-solar {
  position: absolute;
  width: 160px;
  height: 96px;
  pointer-events: none;
  z-index: 1;
}

.map-solar .solar-img {
  display: block;
  width: 160px;
  height: auto;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.55));
  transition: filter 0.35s ease;
}

.map-solar .solar-amt {
  position: absolute;
  left: 80px;
  top: 43px;
  transform: translate(-50%, -50%);
  font-size: 15px;
  font-weight: 700;
  color: #a8e6ff;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.95);
  transition: opacity 0.35s ease;
}

.map-solar.is-used .solar-img {
  filter: grayscale(0.85) brightness(0.42) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
}

.map-solar.is-used .solar-amt {
  opacity: 0.22;
}

/* 未收到广播：板面灰暗，并挂一个「待广播」小牌 */
.map-solar.is-locked .solar-img {
  filter: grayscale(0.7) brightness(0.5) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
}

.map-solar.is-locked .solar-amt {
  opacity: 0.3;
}

.map-solar .solar-lock {
  position: absolute;
  left: 80px;
  top: 66px;
  transform: translateX(-50%);
  padding: 1px 7px;
  border-radius: 9px;
  font-size: 11px;
  line-height: 1.5;
  color: #bae6fd;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(56, 189, 248, 0.45);
  white-space: nowrap;
}

/* 收到广播：解锁瞬间亮一下 */
.map-solar.is-signal .solar-img {
  animation: solarSignal 0.9s ease-out;
}

@keyframes solarSignal {
  0% {
    filter: brightness(1);
  }
  40% {
    filter: brightness(1.9) drop-shadow(0 0 20px rgba(125, 211, 252, 0.95));
  }
  100% {
    filter: brightness(1);
  }
}
/* =========================================================
   第 16 章：音乐关卡（窄谱带浮在地图上方，不做整屏演奏台）
   ========================================================= */
.music-band {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  pointer-events: none;
}

.grid-container.is-music .status { top: 72px; }
.grid-container.is-music .hud-chip:nth-child(2) { display: none; }

.mb-track {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
}

.mb-label {
  flex: 0 0 126px;
  min-width: 0;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: rgba(160, 200, 240, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mb-label b {
  margin-left: 4px;
  color: rgba(255, 210, 160, 0.92);
  font-weight: 600;
}

.mb-sheet {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.mb-sheet::-webkit-scrollbar { display: none; }

.music-note {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #221002;
  background: linear-gradient(180deg, #ffd08a, #ff9a3d);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.28);
  transition: transform 0.15s, background 0.2s;
}

.music-note.is-rest {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.45);
  box-shadow: none;
}

.music-note.is-played {
  background: linear-gradient(180deg, #a9ecff, #3dc7ff);
  animation: musicNoteIn 0.18s ease-out;
}

.music-note.is-wrong {
  color: #fff;
  background: linear-gradient(180deg, #ff9a9a, #ef4444);
  animation: musicNoteWrong 0.32s ease-out;
}

.music-note.is-cursor {
  outline: 2px solid rgba(255, 214, 140, 0.85);
  outline-offset: 1px;
}

/* 分句空隙：目标谱与演奏谱在同一位置断开，长句能看出哪一句该打包成函数 */
.music-note.is-phrase-start {
  margin-left: 10px;
}

/* 长歌谱（21 音）缩小音符并允许折行，保证整句能一屏看完 */
.mb-sheet.is-long {
  flex-wrap: wrap;
  gap: 3px;
}

.mb-sheet.is-long .music-note.is-phrase-start {
  margin-left: 7px;
}

.mb-sheet.is-long .music-note {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  font-size: 11px;
}

@media (max-width: 520px) {
  .mb-label { flex-basis: 82px; }
}

/* 唱片监视器：列表 / 变量 / 当前音 */
.mb-vars {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding-top: 6px;
  border-top: 1px dashed rgba(125, 190, 255, 0.14);
}

.mb-vars[hidden] { display: none; }

.mb-var {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border: 1px solid rgba(125, 190, 255, 0.16);
  border-radius: 7px;
  background: rgba(10, 18, 34, 0.7);
  font-size: 11.5px;
  color: rgba(170, 205, 240, 0.78);
}

.mb-var b { color: #ffd08a; font-weight: 600; }

.mb-var-list { display: inline-flex; gap: 3px; }

.mb-var-list i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 2px;
  border-radius: 4px;
  background: rgba(255, 154, 61, 0.16);
  color: #ffd08a;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 700;
}

.mb-var-list i.is-active {
  background: linear-gradient(180deg, #a9ecff, #3dc7ff);
  color: #062231;
}

/* 机器人头顶的音符气泡 */
.robot-note {
  position: absolute;
  z-index: 900;
  transform: translate(-50%, -100%);
  padding: 3px 10px;
  border: 1px solid rgba(255, 170, 90, 0.45);
  border-radius: 10px;
  background: rgba(6, 12, 26, 0.94);
  color: #ffd08a;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  pointer-events: none;
  transition: left 0.16s ease-out, top 0.16s ease-out;
  animation: robotNotePop 0.22s ease-out;
}

.robot-note.is-wrong {
  border-color: rgba(248, 113, 113, 0.85);
  background: rgba(40, 8, 12, 0.94);
  color: #fecaca;
}

/* 地图装饰：老唱机（纯摆设）与信号发射塔 */
.map-gramophone {
  position: absolute;
  width: 56px;
  height: 58px;
  margin: -46px 0 0 -28px;
  z-index: 5;
  pointer-events: none;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.55));
}

.map-tower {
  position: absolute;
  width: 64px;
  height: 96px;
  margin: -84px 0 0 -32px;
  z-index: 5;
  pointer-events: none;
  filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.35));
}

.map-tower .tower-beam { animation: towerPulse 2.4s ease-in-out infinite; }

.map-gramophone svg,
.map-tower svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* 第 10 章美术：音乐盒占 1 格、广播塔底座占 2×2 格，底边对齐落点 */
.map-musicbox,
.map-broadcast {
  position: absolute;
  pointer-events: none;
  transform: translate(-50%, -100%);
  -webkit-user-select: none;
  user-select: none;
  /* 缩小绘制时用更锐利的降采样，避免细节被平均成糊块 */
  image-rendering: -webkit-optimize-contrast;
}

.map-broadcast {
  z-index: 4;
  width: 160px;
  filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.28));
}

.map-musicbox {
  z-index: 6;
  width: 64px;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.5));
}

/* 开场过场：东方红一号 + 唱片监视器 */
.story-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  gap: 18px;
  padding: 34px 30px 28px;
  background: radial-gradient(ellipse at 30% 18%, #0b1030, #02040c 72%);
  animation: storyIn 0.5s ease-out;
}

.story-overlay[hidden] { display: none; }

.story-space {
  position: relative;
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(90, 140, 220, 0.18);
  border-radius: 14px;
  overflow: hidden;
  background: radial-gradient(circle at 62% 30%, rgba(40, 80, 180, 0.28), rgba(2, 4, 12, 0.92) 70%);
}

.story-stars {
  position: absolute;
  inset: 0;
  opacity: 0.75;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 22%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 32% 68%, #cfe6ff, transparent),
    radial-gradient(1.6px 1.6px at 48% 14%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 66% 52%, #dbeafe, transparent),
    radial-gradient(1.4px 1.4px at 82% 26%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 90% 74%, #cfe6ff, transparent),
    radial-gradient(1.4px 1.4px at 24% 86%, #fff, transparent);
  animation: storyTwinkle 2.6s ease-in-out infinite alternate;
}

.story-satellite {
  position: absolute;
  left: 16%;
  top: 34%;
  width: 210px;
  height: 80px;
  animation: satIn 2.2s ease-out both, satHover 4.2s ease-in-out 2.2s infinite;
}

.sat-body {
  position: absolute;
  left: 76px;
  top: 12px;
  width: 58px;
  height: 56px;
  border-radius: 12px;
  background: linear-gradient(160deg, #eef4fc, #93a9c6);
  box-shadow: 0 0 26px rgba(150, 200, 255, 0.5);
}

.sat-body::after {
  content: '';
  position: absolute;
  inset: 13px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #fff, #7aa0c8);
  box-shadow: inset 0 0 10px rgba(20, 40, 70, 0.5);
}

.sat-wing {
  position: absolute;
  top: 28px;
  width: 76px;
  height: 24px;
  border: 1px solid #5d7fbe;
  border-radius: 4px;
  background: repeating-linear-gradient(90deg, #1b2a55 0 8px, #2f4a86 8px 10px);
  box-shadow: inset 0 0 12px rgba(90, 160, 255, 0.35);
}

.sat-l { left: 0; }
.sat-r { right: 0; }

.sat-signal {
  position: absolute;
  left: 76px;
  top: 12px;
  width: 58px;
  height: 56px;
  border: 1px solid rgba(120, 200, 255, 0.55);
  border-radius: 50%;
  animation: satSignal 2s ease-out infinite;
}

.story-caption {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 18px;
  min-height: 3.6em;
  font-size: 14px;
  line-height: 1.85;
  color: rgba(220, 235, 255, 0.92);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85);
}

/* 先贤全息投影：右侧淡入，青色偏光 + 扫描线，台词让位到左边 */
.story-sage {
  position: absolute;
  right: 3%;
  bottom: 0;
  height: 88%;
  pointer-events: none;
  animation: sageIn 0.9s ease-out both;
}

.story-sage[hidden] {
  display: none;
}

.story-sage img {
  height: 100%;
  width: auto;
  opacity: 0.95;
  /* 青色单色调：去饱和 → 棕调 → 转到青蓝，做出全息投影的色偏 */
  filter: brightness(1.14) saturate(0.32) sepia(0.42) hue-rotate(152deg)
    drop-shadow(0 0 22px rgba(90, 220, 255, 0.34));
  animation: sageFlicker 5.5s ease-in-out infinite;
}

/* 扫描线按立绘的透明通道裁形，只落在人身上 */
.story-sage::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(180deg, rgba(170, 245, 255, 0.13) 0 1px, transparent 1px 4px);
  -webkit-mask-image: var(--sage-mask);
  mask-image: var(--sage-mask);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  pointer-events: none;
  animation: sageScan 7s linear infinite;
}

.sage-base {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: -6px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(80, 230, 255, 0.55), rgba(60, 160, 255, 0.12) 60%, transparent 72%);
  filter: blur(3px);
}

.sage-tag {
  position: absolute;
  left: -6px;
  bottom: 7%;
  padding: 5px 10px;
  border: 1px solid rgba(110, 240, 255, 0.45);
  border-radius: 7px;
  background: rgba(4, 22, 40, 0.72);
  color: #bff2ff;
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-shadow: 0 0 10px rgba(90, 225, 255, 0.7);
}

/* 有立绘时台词收窄，不压在人身上 */
.story-space.is-sage .story-caption {
  right: 38%;
}

/* 地图左下角的先贤小立绘：全身贴底，站着陪课 */
.map-sage {
  position: absolute;
  left: 6px;
  bottom: 0;
  height: 44%;
  z-index: 3;
  pointer-events: none;
}

.map-sage img {
  height: 100%;
  width: auto;
  opacity: 1;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.55));
}

.map-sage-tag {
  position: absolute;
  left: 84%;
  bottom: 14px;
  white-space: nowrap;
  padding: 3px 8px;
  border: 1px solid rgba(120, 200, 255, 0.28);
  border-radius: 6px;
  background: rgba(4, 14, 30, 0.66);
  color: #a9c8ef;
  font-size: 11.5px;
  letter-spacing: 0.1em;
}

@keyframes mapSageBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes sageIn {
  from { opacity: 0; transform: translateY(26px); filter: blur(7px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

@keyframes sageFlicker {
  0%, 100% { opacity: 0.94; }
  48% { opacity: 0.94; }
  49% { opacity: 0.72; }
  50% { opacity: 0.94; }
  77% { opacity: 0.86; }
  78% { opacity: 0.94; }
}

@keyframes sageScan {
  from { background-position: 0 0; }
  to { background-position: 0 400px; }
}

.story-monitor {
  flex: 0 0 300px;
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  border: 1px solid rgba(88, 202, 255, 0.28);
  border-radius: 14px;
  background: rgba(4, 10, 22, 0.82);
}

.sm-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(88, 202, 255, 0.16);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: #bfe6ff;
}

.sm-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8;
  animation: smBlink 1.2s ease-in-out infinite;
}

.sm-list {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: flex-start;
  padding: 12px 0;
}

.sm-note {
  padding-top: 10px;
  border-top: 1px dashed rgba(88, 202, 255, 0.16);
  font-size: 13px;
  color: rgba(190, 216, 240, 0.78);
}

.story-skip {
  position: absolute;
  right: 24px;
  top: 20px;
  z-index: 2;
  padding: 6px 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.72);
  color: #dbeafe;
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
}

.story-skip:hover { background: rgba(56, 189, 248, 0.18); }

@keyframes musicNoteIn {
  from { transform: translateY(4px) scale(0.92); }
  to { transform: none; }
}

@keyframes musicNoteWrong {
  0% { transform: translateY(-6px) scale(1.25); }
  60% { transform: translateY(0) scale(0.96); }
  100% { transform: none; }
}

@keyframes robotNotePop {
  from { transform: translate(-50%, -85%) scale(0.8); }
  to { transform: translate(-50%, -100%) scale(1); }
}

@keyframes towerPulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.95; }
}

@keyframes storyIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes storyTwinkle {
  from { opacity: 0.45; }
  to { opacity: 0.9; }
}

@keyframes satIn {
  from { opacity: 0; transform: translateX(-120px) scale(0.9); }
  to { opacity: 1; transform: none; }
}

@keyframes satHover {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes satSignal {
  0% { transform: scale(0.7); opacity: 0.85; }
  100% { transform: scale(2.3); opacity: 0; }
}

@keyframes smBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ================= 天问台：运行时真输入面板 ================= */
.ask-panel {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 42%, rgba(8, 20, 40, 0.3), rgba(3, 9, 20, 0.68));
  backdrop-filter: blur(2px);
}

.ask-panel[hidden] {
  display: none;
}

.ask-card {
  width: min(340px, 82%);
  padding: 18px 20px 14px;
  border-radius: 16px;
  border: 1px solid rgba(127, 214, 255, 0.35);
  background: linear-gradient(160deg, rgba(14, 30, 56, 0.97), rgba(7, 16, 32, 0.99));
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: #e8f4ff;
}

.ask-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 3px;
  color: #7fd6ff;
}

.ask-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8;
  animation: askPulse 1.4s ease-in-out infinite;
}

@keyframes askPulse {
  0%, 100% { opacity: 0.45; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

.ask-q {
  margin: 12px 0 14px;
  font-size: 16px;
  line-height: 1.55;
  color: #f2f9ff;
}

.ask-row {
  display: flex;
  gap: 10px;
}

.ask-input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(127, 214, 255, 0.3);
  background: rgba(6, 16, 32, 0.92);
  color: #fff;
  font-size: 16px;
  font-family: inherit;
  outline: none;
}

.ask-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}

.ask-submit {
  height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  background: linear-gradient(180deg, #38bdf8, #0ea5e9);
  color: #04121f;
  font-weight: 700;
  font-size: 15px;
  font-family: inherit;
}

.ask-submit:hover {
  filter: brightness(1.08);
}

.ask-tip {
  margin: 9px 0 0;
  font-size: 12px;
  color: #8fb3d0;
}

.ask-tip.is-error {
  color: #f87171;
}

/* =========================================================
   底部任务条：题目说明 + 演奏谱带（占布局高度，全站统一）
   ========================================================= */
.task-bar {
  position: relative;
  inset: auto;
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 14px;
  width: auto;
  max-width: none;
  max-height: 44vh;
  overflow: visible;
  padding: 10px 16px 12px;
  border: 0;
  border-top: 1px solid rgba(129, 140, 248, 0.26);
  border-radius: 0;
  background: linear-gradient(180deg, rgba(8, 12, 26, 0.9), rgba(5, 8, 18, 0.98));
  box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 30;
}

.task-bar .tb-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  overflow: hidden;
}

.task-bar .info-bar-id {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding-right: 0;
  cursor: default;
}

.task-bar .info-bar-id strong {
  font-size: 14.5px;
}

.task-bar .info-seq {
  align-self: center;
}

.task-bar .info-goal {
  font-size: 12.5px;
  line-height: 1.55;
  color: #b6c2d4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-bar .tb-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}

.task-bar .info-know {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
}

.task-bar .info-know b {
  flex: 0 0 auto;
}

.task-bar .info-know span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-bar .info-know b {
  color: #93c5fd;
  margin-right: 6px;
}

.task-bar .info-scale {
  position: relative;
  margin: 0;
}

.task-bar .info-scale[open] {
  position: absolute;
  bottom: 100%;
  left: 0;
  z-index: 60;
  width: 320px;
  padding: 10px 12px;
  border: 1px solid rgba(129, 140, 248, 0.35);
  border-radius: 10px;
  background: rgba(6, 10, 22, 0.97);
}

.task-bar .info-bar-close {
  position: static;
  flex: 0 0 auto;
  margin-left: auto;
}

.task-bar .music-band {
  flex: 0 0 clamp(280px, 44%, 560px);
  display: flex;
  padding-right: 4px;
}

/* 谱带浮在地图底部：任务条只留题目，两边都不挤 */
.grid-container .music-band {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 9;
  display: none;
  flex: none;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(129, 140, 248, 0.22);
  border-radius: 14px;
  background: rgba(9, 18, 34, 0.82);
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.grid-container .music-band:not([hidden]) {
  display: flex;
}

.grid-container .music-band .mb-track {
  gap: 12px;
}

.grid-container .music-band .mb-label {
  flex: 0 0 96px;
}

.task-bar .music-band[hidden] {
  display: none;
}

.task-bar .mb-label {
  flex: 0 0 108px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ================= 结算弹窗：左侧关卡弹窗 ================= */
.result-modal.has-story {
  width: min(1040px, 100%);
  max-height: 90vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  padding: 0;
  text-align: left;
  overflow: hidden;
}
.result-story {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 34px 36px;
  overflow: auto;
  text-align: left;
  border-right: 1px solid rgba(129, 140, 248, 0.18);
  background: radial-gradient(circle at 12% 8%, rgba(37, 63, 109, 0.55) 0%, rgba(12, 18, 36, 0) 60%);
}
.result-story[hidden] { display: none; }
.rs-kicker { font-size: 12px; letter-spacing: 3px; color: #fbbf24; }
.rs-title { margin: 4px 0 0; font-size: 26px; line-height: 1.35; color: #f8fafc; }
.rs-num { color: #f87171; }
.rs-lead { margin: 2px 0 4px; font-size: 15px; line-height: 1.75; color: #fcd34d; }
.rs-body { display: flex; flex-direction: column; gap: 10px; }
.rs-body p { margin: 0; font-size: 14.5px; line-height: 1.9; color: #cbd5e1; }
.rs-media { width: 100%; margin-top: 6px; border-radius: 12px; object-fit: cover; }
.result-modal.has-story .result-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 26px 24px;
  text-align: center;
}
@media (max-width: 720px) {
  .result-modal.has-story { grid-template-columns: 1fr; max-height: 88vh; overflow: auto; }
  .result-story {
    max-height: none;
    overflow: visible;
    padding: 26px 22px 22px;
    border-right: 0;
    border-bottom: 1px solid rgba(129, 140, 248, 0.18);
  }
  .result-modal.has-story .result-panel { padding: 22px; }
}
