:root {
  --bg: #050b12;
  --panel: #0a141f;
  --line: #123047;
  --teal: #2dd4a7;
  --teal-dim: #1a8f70;
  --amber: #f0a63a;
  --grey: #5b6b7a;
  --text: #d7e6ee;
  --text-dim: #7e93a3;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.topbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.toprow { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.brand h1 { font-size: 16px; font-weight: 700; letter-spacing: .5px; }
.sub { font-size: 11px; color: var(--text-dim); }
.dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 12px var(--teal);
  animation: breath 3.2s ease-in-out infinite;
  flex: 0 0 auto;
}
@keyframes breath { 0%,100% { transform: scale(1); opacity: .75; } 50% { transform: scale(1.35); opacity: 1; } }

.tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  flex-wrap: nowrap;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-dim);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: all .25s;
}
.tab.active { border-color: var(--teal); color: var(--teal); background: rgba(45,212,167,.08); }

.musicbtn {
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-dim);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: all .25s;
}
.musicbtn:hover { border-color: var(--teal-dim); }
.musicbtn.on {
  border-color: var(--teal);
  color: var(--teal);
  background: rgba(45,212,167,.10);
  box-shadow: 0 0 12px rgba(45,212,167,.30);
}

/* 顶栏按钮组（音乐 + 麦克） */
.btnrow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
/* 实况麦克开关：冰蓝系与音乐（青绿）区分；on=真实拾音中 */
.micbtn.on {
  border-color: #5fd0ff;
  color: #9fe4ff;
  background: rgba(95,208,255,.10);
  box-shadow: 0 0 12px rgba(95,208,255,.30);
}
.micbtn.denied {
  border-color: var(--line);
  color: var(--text-dim);
  opacity: .55;
  cursor: not-allowed;
}
@media (max-width: 560px) {
  .btnrow { flex-direction: column; gap: 6px; align-items: flex-end; }
}

.stage-wrap { position: relative; flex: 1; min-height: 0; }
#stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.overlay {
  position: absolute;
  left: 0; right: 0; bottom: 14%;
  text-align: center;
  pointer-events: none;
  padding: 0 12px;
}
.ov-title {
  font-size: 24px; font-weight: 700; letter-spacing: 2.5px;
  text-shadow: 0 0 22px rgba(45,212,167,.5), 0 0 42px rgba(34,211,238,.28);
  transform: translateZ(0);
}
.ov-sub { font-size: 12.5px; color: var(--text-dim); margin-top: 7px; letter-spacing: .8px; }

/* ================= L4 四角全息切角框 + 角标 ================= */
.hud {
  position: absolute; inset: 9px;
  pointer-events: none; z-index: 3;
  --hc: rgba(34,211,238,.42);
  animation: hudpulse 4.2s ease-in-out infinite;
  background:
    linear-gradient(var(--hc),var(--hc)) left top/16px 1.5px no-repeat,
    linear-gradient(var(--hc),var(--hc)) left top/1.5px 16px no-repeat,
    linear-gradient(var(--hc),var(--hc)) right top/16px 1.5px no-repeat,
    linear-gradient(var(--hc),var(--hc)) right top/1.5px 16px no-repeat,
    linear-gradient(var(--hc),var(--hc)) left bottom/16px 1.5px no-repeat,
    linear-gradient(var(--hc),var(--hc)) left bottom/1.5px 16px no-repeat,
    linear-gradient(var(--hc),var(--hc)) right bottom/16px 1.5px no-repeat,
    linear-gradient(var(--hc),var(--hc)) right bottom/1.5px 16px no-repeat;
}
@keyframes hudpulse { 0%,100% { opacity: .5; } 50% { opacity: 1; } }

.hud-tag {
  position: absolute; z-index: 4; pointer-events: none;
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase;
  color: rgba(34,211,238,.55);
  text-shadow: 0 0 7px rgba(34,211,238,.38);
  white-space: nowrap;
}
.hud-tl { top: 13px; left: 15px; }
.hud-tr { top: 13px; right: 15px; color: rgba(56,189,248,.55); text-shadow: 0 0 7px rgba(56,189,248,.35); }
.hud-bl { bottom: 13px; left: 15px; }
.hud-br { bottom: 13px; right: 15px; color: rgba(139,92,246,.5); text-shadow: 0 0 7px rgba(139,92,246,.3); }

/* ================= L5 遥测侧栏 ================= */
.telemetry {
  position: absolute; right: 12px; top: 46%;
  transform: translateY(-50%);
  z-index: 4; pointer-events: none;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-end;
  opacity: .92;
  padding: 8px 10px;
  border: 1px solid rgba(34,211,238,.18);
  border-radius: 6px;
  background: rgba(5,12,20,.58);
  box-shadow: 0 0 14px rgba(34,211,238,.08) inset;
}
.trow { display: flex; gap: 7px; align-items: baseline; }
.telemetry .tk {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 9px; letter-spacing: .16em;
  color: rgba(126,147,163,.75);
}
.telemetry .tv {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 10.5px; letter-spacing: .04em; font-variant-numeric: tabular-nums;
  color: rgba(120,235,220,.92);
  text-shadow: 0 0 7px rgba(34,211,238,.35);
  min-width: 62px; text-align: right;
}
.telemetry.off .tv { color: rgba(107,114,128,.75); text-shadow: none; }
.telemetry.off .tk { color: rgba(107,114,128,.6); }

/* 场景 6（数字员工）：右外侧岗位节点与遥测面板同高，面板上移避让 */
body.scene-staff .telemetry { top: 35%; }
/* 场景 7/9：中部主文案与右对齐清单在移动端会撞面板，同样上移避让 */
body.scene-render .telemetry { top: 29%; }
body.scene-checkup .telemetry { top: 29%; }
/* 场景 1：副标题长行在移动端延伸到面板区，上移避让 */
body.scene-vital .telemetry { top: 29%; }

body.scene-night .telemetry { opacity: .62; }
body.scene-brain .telemetry { right: 10px; }

.clock-big {
  position: absolute;
  top: 5.5%;
  right: 5%;
  font-size: 42px;
  font-weight: 200;
  letter-spacing: 4px;
  color: rgba(215,230,238,.85);
  text-shadow: 0 0 18px rgba(45,212,167,.35);
  pointer-events: none;
}
body.scene-brain .clock-big,
body.scene-call .clock-big,
body.scene-family .clock-big,
body.scene-staff .clock-big,
body.scene-night .clock-big { opacity: .22; }

.badge {
  position: absolute;
  top: 4%;
  left: 5%;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--teal);
  background: rgba(10,20,31,.75);
  pointer-events: none;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.badge.warn { color: var(--amber); border-color: rgba(240,166,58,.5); }
.badge.off { color: var(--grey); border-color: rgba(91,107,122,.5); }

.datarow {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: var(--panel);
  overflow-x: auto;
}
.cell {
  flex: 1;
  min-width: 84px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cell.wide { flex: 2; }
.cell .k { font-size: 10px; color: var(--text-dim); letter-spacing: 1px; }
.cell .v { font-size: 15px; font-weight: 600; color: var(--teal); font-variant-numeric: tabular-nums; }
.cell .v.warn { color: var(--amber); }
.cell .v.off { color: var(--grey); }
.cell.wide .v { font-size: 12px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 14px;
  font-size: 11px;
  color: var(--text-dim);
  background: var(--panel);
  border-top: 1px solid var(--line);
}

@media (max-width: 640px) {
  .ov-title { font-size: 19px; }
  .clock-big { font-size: 30px; }
  .brand h1 { font-size: 13.5px; }
}
