:root {
  --ink: #eaf7f4;
  --ink-2: #a9c8cd;
  --ink-3: #6f939b;
  --line: rgba(168, 226, 226, 0.18);
  --glass: rgba(8, 38, 52, 0.55);
  --sea: #06202c;
  --accent: #7fe0d2;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--sea);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
}

#stage {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

/* ── HUD ─────────────────────────────────────────────── */
.hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 30px;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.9s ease;
}

body.playing .hud {
  opacity: 1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  letter-spacing: 0.14em;
  color: var(--ink-2);
}

.brand .mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(127, 224, 210, 0.85);
}

.brand-text i {
  font-style: normal;
  margin: 0 6px;
  color: var(--ink-3);
}

.steps {
  display: flex;
  gap: 22px;
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
}

.steps span {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  transition: color 0.5s ease, border-color 0.5s ease;
}

.steps span i {
  font-style: normal;
  font-size: 9.5px;
  letter-spacing: 0.06em;
  opacity: 0.6;
}

.steps span.on {
  color: var(--ink);
  border-color: rgba(127, 224, 210, 0.55);
}

.steps span.done {
  color: rgba(169, 200, 205, 0.5);
}

.tools {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--glass);
  color: var(--ink-2);
  cursor: pointer;
  padding: 0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.25s ease;
}

.icon:hover {
  color: var(--ink);
  border-color: rgba(168, 226, 226, 0.4);
}

.icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon svg .on {
  fill: currentColor;
  stroke-width: 1.2;
}

.icon.muted svg {
  opacity: 0.35;
}

.text-btn {
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  color: var(--ink-2);
  font-family: var(--font);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  cursor: pointer;
  white-space: nowrap;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.25s ease;
}

.text-btn:hover {
  color: var(--ink);
  border-color: rgba(168, 226, 226, 0.4);
}

.text-btn[disabled] {
  opacity: 0.5;
  cursor: default;
}

/* ── 摄像头小窗 ──────────────────────────────────────── */
.cam {
  position: absolute;
  right: 28px;
  bottom: 28px;
  width: 168px;
  border-radius: 14px;
  overflow: hidden;
  background: #0a2c3a;
  box-shadow: 0 12px 34px rgba(2, 14, 20, 0.4), 0 0 0 1px rgba(168, 226, 226, 0.2) inset;
  z-index: 6;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.cam[hidden] {
  display: none;
}

body.playing .cam:not([hidden]) {
  opacity: 1;
  transform: translateY(0);
}

.cam video,
.cam canvas {
  display: block;
  width: 100%;
  height: auto;
  transform: scaleX(-1);
}

.cam canvas {
  position: absolute;
  inset: 0;
  height: 100%;
}

.cam video {
  opacity: 0.72;
  filter: saturate(0.9) contrast(1.05);
}

.cam-status {
  position: absolute;
  left: 9px;
  bottom: 9px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(4, 22, 30, 0.62);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  backdrop-filter: blur(6px);
}

.cam-status i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #7fe0d2;
  box-shadow: 0 0 8px #7fe0d2;
}

.cam-status.live {
  color: var(--ink);
}

/* ── 提示胶囊 ────────────────────────────────────────── */
.hint {
  position: absolute;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 20px 9px 13px;
  border-radius: 999px;
  background: rgba(6, 32, 44, 0.62);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(2, 14, 20, 0.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--ink);
  z-index: 6;
  transition: opacity 0.4s ease;
}

.hint[hidden] {
  display: none;
}

.gesture {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
}

.gesture svg {
  grid-area: 1 / 1;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hint.palm .g-palm,
.hint.fist .g-fist,
.hint.down .g-down {
  opacity: 1;
}

.hint.idle .hint-text {
  color: var(--ink-2);
}

/* ── 轻提示 ──────────────────────────────────────────── */
.toast {
  position: absolute;
  left: 50%;
  top: 72px;
  transform: translateX(-50%) translateY(-8px);
  padding: 10px 18px;
  border-radius: 13px;
  background: rgba(255, 248, 236, 0.95);
  color: #17323f;
  font-size: 12.5px;
  letter-spacing: 0.03em;
  line-height: 1.6;
  max-width: min(80vw, 560px);
  text-align: center;
  z-index: 9;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.32s ease, transform 0.32s ease;
  box-shadow: 0 12px 34px rgba(2, 14, 20, 0.3);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── 启动界面 ────────────────────────────────────────── */
.gate {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 8;
  text-align: center;
  padding: 30px;
  background:
    radial-gradient(ellipse 62% 52% at 50% 16%, rgba(52, 150, 164, 0.34), rgba(5, 24, 34, 0) 70%),
    rgba(5, 24, 34, 0.76);
  backdrop-filter: blur(7px) saturate(1.06);
  -webkit-backdrop-filter: blur(7px) saturate(1.06);
  transition: opacity 0.9s ease, visibility 0.9s;
}

.gate.leave {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.gate-inner {
  width: min(620px, 92vw);
  max-width: 620px;
  animation: rise 1.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.gate .kicker {
  margin: 0 0 26px;
  font-size: 10.5px;
  letter-spacing: 0.34em;
  color: rgba(168, 226, 226, 0.62);
}

.gate h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(46px, 7vw, 84px);
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1.15;
  color: #f2fbf8;
  text-shadow: 0 0 60px rgba(127, 224, 210, 0.35);
}

.gate .desc {
  margin: 22px 0 0;
  font-size: 14px;
  line-height: 1.9;
  letter-spacing: 0.06em;
  color: rgba(214, 236, 236, 0.72);
}

.acts-list {
  margin: 30px auto 0;
  width: 100%;
  max-width: 520px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-content: center;
  gap: 9px;
  max-width: 520px;
}

.acts-list span {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid rgba(168, 226, 226, 0.16);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: rgba(214, 236, 236, 0.66);
  white-space: nowrap;
}

.actions {
  margin-top: 34px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.primary,
.secondary {
  font-family: var(--font);
  font-size: 13px;
  letter-spacing: 0.1em;
  padding: 13px 28px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.28s ease;
}

.primary {
  border: 0;
  color: #04222c;
  background: linear-gradient(135deg, #a9f0e4, #6fd4c6);
  box-shadow: 0 14px 34px rgba(111, 212, 198, 0.22);
}

.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(111, 212, 198, 0.3);
}

.primary[disabled] {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.secondary {
  border: 1px solid rgba(168, 226, 226, 0.28);
  background: transparent;
  color: rgba(226, 246, 244, 0.85);
}

.secondary:hover {
  border-color: rgba(168, 226, 226, 0.55);
  color: #fff;
}

.gate .foot {
  margin: 26px 0 0;
  min-height: 18px;
  font-size: 11.5px;
  letter-spacing: 0.05em;
  line-height: 1.7;
  color: rgba(169, 200, 205, 0.65);
}

.gate .foot.warn {
  color: #ffb3a3;
}

/* 在 iframe 预览里：别让人白点一遍 */
.notice {
  margin: 22px auto 0;
  max-width: 520px;
  padding: 16px 20px 14px;
  border-radius: 14px;
  text-align: left;
  border: 1px solid rgba(127, 224, 210, 0.28);
  background: rgba(10, 52, 60, 0.5);
  animation: rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.notice[hidden] {
  display: none;
}

.notice-title {
  margin: 0 0 9px;
  font-size: 14px;
  letter-spacing: 0.06em;
  color: #a8ece2;
}

.notice-list {
  margin: 0;
  padding-left: 19px;
  font-size: 12.5px;
  line-height: 1.9;
  letter-spacing: 0.03em;
  color: rgba(224, 240, 240, 0.8);
}

.notice-list b {
  color: #ffd9a8;
  font-weight: 500;
}

.notice-list code,
.notice-url code {
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(140, 235, 220, 0.14);
  font-family: var(--sans);
  font-size: 12px;
  color: #d6f6f1;
}

.notice-url {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 0;
  padding-top: 11px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.notice-url code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 6px 10px;
}

.mini {
  flex: none;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(127, 224, 210, 0.3);
  background: rgba(127, 224, 210, 0.1);
  color: #a8ece2;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  cursor: pointer;
  font-family: var(--sans);
}

.mini:hover {
  background: rgba(127, 224, 210, 0.18);
}

/* 摄像头失败：把「为什么」和「怎么办」摊开写清楚 */
.camerr {
  margin: 24px auto 0;
  max-width: 520px;
  padding: 18px 22px 16px;
  border-radius: 14px;
  text-align: left;
  border: 1px solid rgba(255, 150, 130, 0.28);
  background: rgba(58, 20, 18, 0.42);
  animation: rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.camerr[hidden] {
  display: none;
}

.camerr-title {
  margin: 0 0 11px;
  font-size: 15px;
  letter-spacing: 0.06em;
  color: #ffc3b4;
}

.camerr-list {
  margin: 0;
  padding-left: 19px;
  font-size: 12.5px;
  line-height: 1.95;
  letter-spacing: 0.04em;
  color: rgba(233, 226, 222, 0.8);
}

.camerr-list li::marker {
  color: rgba(255, 179, 163, 0.55);
}

.camerr-list code {
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  font-family: var(--sans);
  font-size: 12px;
  color: #cdf0ea;
}

.camerr-meta {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 10.5px;
  line-height: 1.7;
  letter-spacing: 0.03em;
  color: rgba(190, 205, 208, 0.6);
  word-break: break-all;
}

.narrow {
  display: none;
}

@media (max-width: 820px) {
  .hud {
    padding: 14px 18px;
  }

  .steps {
    display: none;
  }

  .hint {
    bottom: 22px;
    font-size: 11.5px;
    padding: 8px 15px 8px 10px;
  }

  .cam {
    width: 126px;
    right: 16px;
    bottom: 74px;
  }

  .narrow {
    display: inline;
  }

  .toast {
    top: 56px;
    font-size: 11.5px;
    max-width: 88vw;
  }
}
