:root {
  --bg: #000;
  --text: #fff8f0;
  --muted: #c9b8a6;
  --accent: #ff5a5a;
  --radius: 20px;
  font-family: "SF Pro Rounded", "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", sans-serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  background: #000;
  color: var(--text);
  overflow: hidden;
}

/* 全息舱：铺满 2160×3840 / 9:16，纯黑=透明 */
.cabin {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  margin: 0;
  display: grid;
  grid-template-rows: var(--topbar-h, 64px) 1fr;
  padding: var(--pad, 8px);
  gap: var(--gap, 4px);
  background: #000;
}

.topbar {
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 40px 0 6px; /* 右侧给语言按钮留空 */
  transform: translateY(var(--topbar-oy, 0px));
  position: relative;
  overflow: visible;
  z-index: 8;
}
.topbar-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  position: relative;
  min-height: 28px;
}
.btn-lang {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  border: 1px solid rgba(255, 209, 102, 0.55);
  background: rgba(255, 90, 90, 0.25);
  color: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}
.logo-text {
  height: var(--logo-text-h, 32px);
  width: auto;
  max-width: 58%;
  object-fit: contain;
  background: transparent;
  mix-blend-mode: multiply;
}
.headline {
  margin: 0;
  font-size: var(--headline-size, 16px);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 2px 12px rgba(255, 90, 90, 0.25);
  white-space: nowrap;
}

.stage {

  min-height: 0;
  display: grid;
  grid-template-columns: var(--side-w, 112px) 1fr var(--side-w, 112px);
  gap: var(--gap, 4px);
  align-items: stretch;
}

.col {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  gap: var(--char-gap, 6px);
  min-height: 0;
  overflow: hidden;
  background: transparent;
}

.char-card {
  appearance: none;
  border: 2.5px solid transparent;
  background: transparent;
  color: inherit;
  padding: 3px 2px;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
  max-width: 100%;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.char-card:hover { transform: scale(1.04); }
.char-card.active {
  border: 2.5px solid transparent;
  background:
    linear-gradient(var(--bg), var(--bg)) padding-box,
    linear-gradient(130deg, #ff4d6d, #ffd166, #06d6a0, #4cc9f0, #b5179e, #ff4d6d) border-box;
  box-shadow: 0 0 14px rgba(255, 209, 102, 0.35);
}
.char-name {
  order: -1;
  font-size: clamp(9px, 1.2vh, 12px);
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #ffe8c8;
  text-shadow: 0 1px 2px rgba(0,0,0,0.65);
}
.char-card img {
  width: var(--char-img, 74px);
  height: var(--char-img, 74px);
  object-fit: contain;
  border-radius: 12px;
  background: transparent;
  mix-blend-mode: multiply;
  filter: none;
}

.stage-center {
  position: relative;
  border-radius: 0;
  overflow: hidden;
  background: #000;
  min-width: 0;
  border: 0;
}
#video-output {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  background: #000;
}
.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  background: transparent;
}
.empty-state.hidden { display: none; }

.logo-hit {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  line-height: 0;
}
.logo-hit:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.logo-3d {
  width: min(var(--logo-pct, 52%), 280px);
  height: auto;
  object-fit: contain;
  background: transparent;
  mix-blend-mode: multiply;
  filter: none;
  transform-origin: center center;
}
.logo-hit.pulse .logo-3d,
.logo-3d.pulse-always {
  animation: heartbeat 1.05s ease-in-out infinite;
}
@keyframes heartbeat {
  0%   { transform: scale(1); }
  14%  { transform: scale(1.08); }
  28%  { transform: scale(1); }
  42%  { transform: scale(1.06); }
  70%  { transform: scale(1); }
  100% { transform: scale(1); }
}

.empty-text {
  margin: 0;
  font-size: clamp(13px, 1.8vh, 18px);
  font-weight: 600;
  color: #ffe0c2;
  text-align: center;
}
.status {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  font-size: 12px;
  z-index: 3;
}
.status.hidden { display: none; }
.btn-stop {
  position: absolute;
  right: 8px;
  bottom: 16%;
  z-index: 5;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  background: rgba(0,0,0,0.48);
  color: rgba(255,255,255,0.95);
  cursor: pointer;
  backdrop-filter: blur(8px);
}
.btn-stop.hidden { display: none; }
.btn-stop:active { transform: scale(0.98); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  background: rgba(20, 16, 28, 0.92);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  z-index: 30;
  max-width: 90vw;
}
.toast.hidden { display: none; }

#jt-mode-switch {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.08em;
  border: 1px solid rgba(255,255,255,0.18);
  padding: 6px 10px;
}
