:root {
  color-scheme: dark;
  --panel: rgba(8, 14, 18, 0.62);
  --panel-strong: rgba(7, 12, 16, 0.82);
  --line: rgba(128, 224, 255, 0.72);
  --text: #f5fbff;
  --muted: #a9c1c8;
  --accent: #58d7ff;
  --ok: #8df5b1;
  --warn: #ffd166;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #05080a;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: var(--text);
}

.mirror-shell {
  width: 100vw;
  height: 100vh;
  background: #05080a;
}

.stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

video,
canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

video {
  object-fit: cover;
  transform: scaleX(-1);
}

canvas {
  pointer-events: none;
}

.top-bar {
  position: absolute;
  top: max(22px, env(safe-area-inset-top));
  left: 22px;
  right: 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 13px;
  letter-spacing: 0;
  color: var(--accent);
}

h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
  font-weight: 700;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
}

.status {
  min-width: 76px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: var(--panel);
  text-align: center;
  font-size: 14px;
}

.status.ready {
  color: var(--ok);
}

.status.warn {
  color: var(--warn);
}

.result-panel {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: max(142px, calc(env(safe-area-inset-bottom) + 142px));
  display: grid;
  grid-template-columns: 1.15fr 1fr 0.9fr;
  gap: 10px;
}

.metric {
  min-height: 88px;
  padding: 14px 12px;
  border: 1px solid rgba(128, 224, 255, 0.35);
  background: linear-gradient(180deg, rgba(8, 21, 28, 0.78), rgba(7, 12, 16, 0.62));
  backdrop-filter: blur(10px);
}

.metric span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
}

.metric strong {
  display: block;
  font-size: 31px;
  line-height: 1.05;
  font-weight: 700;
  white-space: nowrap;
}

.metric strong.warming {
  font-size: 26px;
  color: var(--warn);
}

.metric.compact strong {
  font-size: 27px;
}

.people-list {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: max(76px, calc(env(safe-area-inset-bottom) + 76px));
  display: flex;
  gap: 8px;
  overflow: hidden;
}

.person-pill {
  min-width: 0;
  flex: 1;
  padding: 9px 11px;
  border: 1px solid rgba(128, 224, 255, 0.32);
  background: rgba(7, 12, 16, 0.74);
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.person-pill.primary {
  color: var(--text);
  border-color: rgba(141, 245, 177, 0.74);
}

.bottom-strip {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: max(20px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 15px;
}

@media (max-width: 520px), (max-aspect-ratio: 9 / 15) {
  .top-bar {
    top: max(18px, env(safe-area-inset-top));
    left: 16px;
    right: 16px;
  }

  h1 {
    font-size: 25px;
  }

  .result-panel {
    left: 14px;
    right: 14px;
    bottom: max(148px, calc(env(safe-area-inset-bottom) + 148px));
    grid-template-columns: 1fr 1fr;
  }

  .metric {
    min-height: 78px;
  }

  .metric.compact {
    grid-column: span 2;
    min-height: 62px;
  }

  .metric strong {
    font-size: 25px;
  }

  .people-list {
    left: 14px;
    right: 14px;
    bottom: max(76px, calc(env(safe-area-inset-bottom) + 76px));
  }
}
