:root {
  --ink: #eaf2ff;
  --muted: rgba(205, 222, 250, 0.62);
  --line: rgba(150, 190, 255, 0.16);
  --glass: rgba(10, 16, 32, 0.55);
  --gold: #ffd479;
  --mint: #8ef7d4;
  --blue: #6fb7ff;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(120% 95% at 50% -10%, #0b1433 0%, #060a18 42%, #020307 100%);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system,
    "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

#vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(105% 80% at 50% 48%, rgba(0, 0, 0, 0) 32%, rgba(0, 0, 0, 0.45) 78%, rgba(0, 0, 0, 0.72) 100%);
  mix-blend-mode: multiply;
}

/* ---------------- top bar ---------------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 20px 26px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  pointer-events: none;
  z-index: 6;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 12px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--gold), #ff6b6b 45%, #5ce1a8 100%);
  box-shadow: 0 0 22px rgba(255, 200, 120, 0.55);
}

.brand-text h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.24em;
  background: linear-gradient(92deg, #fff 0%, #cfe6ff 40%, #9ad9c5 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-text p {
  margin: 4px 0 0;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 10px;
  pointer-events: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pill {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  padding: 9px 15px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  transition: border-color 0.25s, background 0.25s, transform 0.18s, box-shadow 0.25s;
}

.pill:hover {
  border-color: rgba(160, 220, 255, 0.45);
  background: rgba(18, 30, 56, 0.7);
  box-shadow: 0 0 24px rgba(90, 170, 255, 0.18);
}

.pill:active { transform: translateY(1px) scale(0.99); }

.pill[aria-pressed="true"] {
  border-color: rgba(142, 247, 212, 0.5);
  box-shadow: 0 0 22px rgba(90, 240, 200, 0.22);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(160, 180, 210, 0.5);
  box-shadow: none;
  transition: background 0.2s, box-shadow 0.2s;
}

.dot.live {
  background: var(--mint);
  box-shadow: 0 0 10px var(--mint), 0 0 22px rgba(142, 247, 212, 0.6);
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* ---------------- camera preview ---------------- */

.preview {
  position: fixed;
  right: 26px;
  bottom: 104px;
  width: 216px;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(150, 200, 255, 0.22);
  background: #05070f;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.35) inset;
  z-index: 7;
}

.preview video,
.preview canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  opacity: 0.85;
}

.preview canvas {
  transform: none;
  opacity: 1;
}

.preview-tag {
  position: absolute;
  left: 10px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(4, 8, 18, 0.66);
  border: 1px solid rgba(150, 200, 255, 0.16);
  backdrop-filter: blur(8px);
}

.preview-meter {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
}

.preview-meter i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--mint), var(--gold));
  box-shadow: 0 0 12px rgba(255, 212, 121, 0.7);
  transition: width 0.12s linear;
}

/* ---------------- hints ---------------- */

.gesture-label {
  position: fixed;
  left: 50%;
  bottom: 74px;
  transform: translateX(-50%);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: rgba(220, 236, 255, 0.72);
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(6, 10, 22, 0.5);
  border: 1px solid rgba(150, 200, 255, 0.12);
  backdrop-filter: blur(10px);
  white-space: nowrap;
  z-index: 6;
  transition: color 0.3s, border-color 0.3s, background 0.3s;
}

.gesture-label.active {
  color: #06121a;
  background: linear-gradient(95deg, var(--mint), var(--gold));
  border-color: transparent;
  box-shadow: 0 0 26px rgba(142, 247, 212, 0.45);
}

.hints {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 26px 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
}

.hint {
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(150, 190, 255, 0.1);
  background: rgba(8, 13, 26, 0.42);
  backdrop-filter: blur(8px);
}

.hint b {
  color: rgba(255, 236, 200, 0.9);
  font-weight: 500;
  margin-right: 4px;
}

/* ---------------- intro ---------------- */

.intro {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(60% 60% at 50% 50%, rgba(4, 8, 20, 0.42), rgba(2, 4, 10, 0.78));
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  z-index: 10;
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.intro.hidden {
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
}

.card {
  position: relative;
  width: min(520px, 100%);
  padding: 38px 36px 30px;
  border-radius: 26px;
  border: 1px solid rgba(160, 205, 255, 0.2);
  background: linear-gradient(160deg, rgba(16, 24, 46, 0.86), rgba(6, 10, 22, 0.92));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  overflow: hidden;
  text-align: left;
}

.card-glow {
  position: absolute;
  top: -140px;
  left: -60px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 196, 120, 0.22), rgba(255, 120, 160, 0.08) 45%, transparent 70%);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 10.5px;
  letter-spacing: 0.34em;
  color: rgba(142, 247, 212, 0.75);
}

.card h2 {
  margin: 0 0 14px;
  font-size: 27px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.34;
  background: linear-gradient(96deg, #ffffff, #d6ecff 45%, #a9e7d2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  margin: 0 0 26px;
  font-size: 13.5px;
  line-height: 1.85;
  color: rgba(210, 226, 248, 0.72);
}

.card-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.primary,
.ghost {
  appearance: none;
  font: inherit;
  font-size: 13.5px;
  letter-spacing: 0.06em;
  border-radius: 999px;
  padding: 13px 24px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.18s, box-shadow 0.25s, background 0.25s, border-color 0.25s;
}

.primary {
  color: #05121a;
  font-weight: 600;
  background: linear-gradient(100deg, #9ff8da, #ffd98b 92%);
  box-shadow: 0 12px 34px rgba(120, 240, 210, 0.28);
}

.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 42px rgba(140, 245, 215, 0.4);
}

.ghost {
  color: rgba(226, 238, 255, 0.86);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(160, 200, 255, 0.2);
}

.ghost:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(160, 200, 255, 0.4);
}

.note {
  margin: 20px 0 0;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(170, 192, 220, 0.5);
  line-height: 1.7;
}

.note.warn { color: rgba(255, 190, 140, 0.85); }

.switch-link {
  color: rgba(255, 212, 121, 0.9);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 212, 121, 0.4);
  padding-bottom: 1px;
}

.switch-link:hover { color: #fff; }

/* 粒子版左上角：返回金色华彩版 */
.back-home {
  margin-left: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(142, 247, 212, 0.28);
  background: rgba(8, 14, 26, 0.5);
  color: rgba(200, 245, 230, 0.85);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-decoration: none;
  white-space: nowrap;
  pointer-events: auto;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}

.back-home:hover {
  background: rgba(142, 247, 212, 0.14);
  border-color: rgba(142, 247, 212, 0.5);
  color: #fff;
}

@media (max-width: 860px) {
  .back-home { margin-left: 8px; padding: 4px 9px; font-size: 10px; }
}

/* ---------------- loader / toast ---------------- */

.loader {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  border-radius: 999px;
  border: 1px solid rgba(150, 200, 255, 0.2);
  background: rgba(6, 11, 24, 0.82);
  backdrop-filter: blur(14px);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: rgba(220, 236, 255, 0.85);
  z-index: 12;
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(142, 247, 212, 0.22);
  border-top-color: var(--mint);
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed;
  left: 50%;
  bottom: 130px;
  transform: translateX(-50%);
  max-width: min(420px, calc(100vw - 48px));
  padding: 12px 20px;
  border-radius: 14px;
  font-size: 12.5px;
  line-height: 1.6;
  text-align: center;
  color: #ffe6c9;
  background: rgba(38, 20, 12, 0.9);
  border: 1px solid rgba(255, 180, 120, 0.4);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55);
  z-index: 20;
}

/* ---------------- responsive ---------------- */

@media (max-width: 860px) {
  .topbar { padding: 14px 16px; }
  .brand-text p { display: none; }
  .hints { padding: 0 12px 14px; gap: 6px; }
  .hint { font-size: 10px; padding: 4px 8px; }
  .mouse-hint { display: none; }
  .preview { width: 132px; right: 12px; bottom: 82px; border-radius: 12px; }
  .gesture-label { bottom: 58px; font-size: 11px; }
  .card { padding: 30px 24px 24px; }
  .card h2 { font-size: 22px; }
  .lead { font-size: 12.5px; }
}

@media (max-height: 620px) {
  .hints { display: none; }
  .gesture-label { bottom: 20px; }
  .preview { bottom: 20px; }
}
