* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #1a1a1a;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: #f3ead8;
  user-select: none;
}

#app, #app canvas { position: fixed; inset: 0; }
#hud { position: fixed; inset: 0; pointer-events: none; }
#hud button, #hud input { pointer-events: auto; }

/* 顶栏 */
#topbar {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px;
  background: linear-gradient(rgba(20,16,10,0.55), transparent);
  font-size: 14px;
}
#sceneTitle { font-size: 16px; font-weight: 600; letter-spacing: 1px; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
#heading { opacity: .85; }

/* 准星 */
#crosshair {
  position: absolute; left: 50%; top: 50%;
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(255,255,255,0.9);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.25);
  transform: translate(-50%, -50%);
}

/* 交互提示 */
#hint {
  position: absolute; left: 50%; bottom: 168px;
  transform: translateX(-50%);
  font-size: 13px; color: #ffe9bd;
  text-shadow: 0 1px 4px rgba(0,0,0,.7);
  background: rgba(30,24,14,0.45);
  padding: 5px 14px; border-radius: 14px;
  transition: opacity .3s;
}
#hint:empty { opacity: 0; }

/* 小地图 */
#minimapWrap {
  position: absolute; top: 52px; right: 18px;
  text-align: center;
}
#minimap { border-radius: 50%; box-shadow: 0 2px 12px rgba(0,0,0,.4); }
.mm-label { margin-top: 4px; font-size: 11px; opacity: .75; text-shadow: 0 1px 3px rgba(0,0,0,.6); }

/* 场景切换入口 */
#sceneChips {
  position: absolute; left: 16px; bottom: 16px;
  display: flex; gap: 8px;
}
.chip {
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(30,24,14,0.55);
  color: #f3ead8;
  padding: 6px 13px; border-radius: 16px;
  font-size: 13px; cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background .2s;
}
.chip:hover { background: rgba(120,84,32,0.7); }
.chip.active { background: #b5792c; border-color: #e8a33d; }
.chip.locked {
  display: inline-block; margin: 3px;
  opacity: .45; cursor: default;
  pointer-events: none;
}

/* 讲解字幕 */
#subtitle {
  position: absolute; left: 50%; bottom: 58px;
  transform: translateX(-50%);
  width: min(760px, 84%);
  background: rgba(22,18,10,0.78);
  border: 1px solid rgba(232,163,61,0.35);
  border-radius: 12px;
  padding: 14px 20px 10px;
  backdrop-filter: blur(6px);
}
#subTitle { color: #f0b45a; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
#subText { font-size: 14.5px; line-height: 1.75; color: #f6efdf; }
.subBtns { display: flex; gap: 8px; margin-top: 10px; justify-content: flex-end; }
.subBtns button {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.25);
  color: #f3ead8; font-size: 12px;
  padding: 4px 14px; border-radius: 12px; cursor: pointer;
}
.subBtns button:hover { background: rgba(232,163,61,0.35); }

/* 帮助面板 */
#helpPanel {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(22,18,10,0.88);
  border: 1px solid rgba(232,163,61,0.35);
  border-radius: 14px;
  padding: 24px 30px;
  max-width: 520px;
  backdrop-filter: blur(8px);
}
#helpPanel h2 { font-size: 18px; color: #f0b45a; margin-bottom: 14px; }
#helpPanel table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
#helpPanel td { padding: 6px 10px; border-bottom: 1px solid rgba(255,255,255,0.08); }
#helpPanel td:first-child { color: #f0b45a; white-space: nowrap; font-weight: 600; }
#helpPanel p { margin-top: 12px; font-size: 12.5px; }

/* 覆盖层（开始 / 暂停） */
.overlay {
  position: absolute; inset: 0;
  background: rgba(12,10,6,0.72);
  display: flex; align-items: center; justify-content: center;
  pointer-events: auto;
  backdrop-filter: blur(6px);
}
.panel {
  background: rgba(30,25,15,0.92);
  border: 1px solid rgba(232,163,61,0.4);
  border-radius: 18px;
  padding: 36px 44px;
  text-align: center;
  max-width: 620px;
  max-height: 86vh;
  overflow-y: auto;
  box-shadow: 0 12px 48px rgba(0,0,0,.5);
}
.panel h1 { font-size: 30px; letter-spacing: 4px; color: #f0c069; margin-bottom: 10px; }
.panel h3 { font-size: 14px; color: #f0b45a; margin: 18px 0 10px; text-align: left; }
.panel .sub { font-size: 14px; opacity: .85; margin-bottom: 6px; }
.panel .desc { font-size: 13px; opacity: .7; margin-bottom: 22px; }
.panel .keys { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 22px; }
.panel .keys span {
  font-size: 12px; opacity: .8;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 4px 10px; border-radius: 12px;
}
.primary {
  background: linear-gradient(135deg, #d98f2b, #b56a1d);
  border: none; color: #fff;
  font-size: 17px; letter-spacing: 3px;
  padding: 12px 46px; border-radius: 26px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(217,143,43,.4);
  transition: transform .15s;
}
.primary:hover { transform: scale(1.05); }
.dim { font-size: 12px; opacity: .55; margin-top: 14px; }

#menuScenes { display: flex; flex-wrap: wrap; gap: 8px; text-align: left; }
.overlay .panel { max-height: 88vh; overflow-y: auto; }

.volRow {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; margin-bottom: 8px; text-align: left;
}
.volRow span { width: 190px; }
.volRow input[type=range] { flex: 1; accent-color: #d98f2b; }
.volRow button {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.25);
  color: #f3ead8; font-size: 12px;
  padding: 4px 12px; border-radius: 10px; cursor: pointer;
}

.hidden { display: none !important; }
