:root {
  --stage-height: 405px;
  --avatar-width: min(236px, 100%);
  --gallery-width: min(720px, 100%);
  --gallery-ratio: 16 / 9;
  color-scheme: light;
  font-family:
    Inter, "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background: #f7f9fc;
  color: #172033;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(186, 219, 255, 0.5), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(226, 232, 255, 0.55), transparent 32rem),
    #f7f9fc;
}

button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.page-shell {
  display: grid;
  min-height: 100vh;
  padding: 32px;
  place-items: center;
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(560px, 760px);
  gap: 36px;
  width: min(1260px, 100%);
  padding: 28px;
  border: 1px solid rgba(136, 153, 180, 0.16);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 28px 80px rgba(94, 116, 148, 0.18);
  backdrop-filter: blur(20px);
}

.transcript-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.06);
}

.avatar-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 26px;
  text-align: center;
}

.avatar-ring {
  position: relative;
  display: grid;
  width: var(--avatar-width);
  height: var(--stage-height);
  place-items: center;
  border-radius: 28px;
  overflow: hidden;
}

.avatar-video {
  display: none;
}

.avatar-canvas {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  filter: saturate(1.12) contrast(1.04);
  transform: scale(1);
  transition: transform 180ms ease, filter 180ms ease;
}

.speaking .avatar-canvas {
  animation: avatar-speaking 900ms ease-in-out infinite alternate;
  filter: saturate(1.3) contrast(1.1) brightness(1.08);
}

.voice-wave {
  position: absolute;
  right: 24px;
  bottom: 42px;
  display: flex;
  align-items: end;
  gap: 5px;
  height: 42px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(1, 8, 18, 0.58);
  opacity: 0;
  transition: opacity 160ms ease;
}

.speaking .voice-wave {
  opacity: 1;
}

.voice-wave span {
  width: 5px;
  height: 14px;
  border-radius: 999px;
  background: #70d7ff;
  animation: wave 700ms ease-in-out infinite;
}

.voice-wave span:nth-child(2) {
  animation-delay: 120ms;
}

.voice-wave span:nth-child(3) {
  animation-delay: 240ms;
}

.status-text {
  display: none;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  margin-top: 24px;
  transition: opacity 160ms ease, visibility 160ms ease;
}

.playback-active .controls {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.primary-button,
.ghost-button {
  position: relative;
  display: grid;
  width: 64px;
  height: 64px;
  min-width: 0;
  padding: 0;
  place-items: center;
  border-radius: 50%;
  color: #fff;
}

.primary-button {
  background: linear-gradient(135deg, #2f8cff, #7c5cff);
  box-shadow: 0 12px 28px rgba(47, 140, 255, 0.28);
}

.ghost-button {
  border: 1px solid rgba(62, 75, 99, 0.18);
  background: rgba(62, 75, 99, 0.72);
  box-shadow: 0 10px 24px rgba(62, 75, 99, 0.18);
}

.primary-button::before {
  content: "";
  width: 16px;
  height: 26px;
  border: 3px solid currentColor;
  border-radius: 999px;
}

.primary-button::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 16px;
  margin-top: 24px;
  border-right: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  border-left: 3px solid currentColor;
  border-radius: 0 0 999px 999px;
}

.ghost-button::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: currentColor;
}

.content-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
}

.dialog-banner {
  display: block;
  width: var(--gallery-width);
  max-height: 96px;
  object-fit: contain;
}

.intent-tabs {
  display: none;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding-right: 4px;
}

.debug-mode .intent-tabs {
  display: flex;
}

.intent-tab {
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #d7e3f7;
}

.intent-tab.active {
  background: rgba(112, 215, 255, 0.18);
  color: #85ddff;
  box-shadow: inset 0 0 0 1px rgba(112, 215, 255, 0.42);
}

.transcript-card,
.gallery-card {
  padding: 18px;
}

.gallery-card {
  position: relative;
  display: grid;
  width: var(--gallery-width);
  height: var(--stage-height);
  aspect-ratio: var(--gallery-ratio);
  padding: 0;
  place-items: center;
  overflow: hidden;
}

.eyebrow {
  display: block;
  margin-bottom: 8px;
  color: #7fb8ff;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#transcriptText {
  min-height: 54px;
  margin: 0;
  color: #f3f7ff;
  font-size: 19px;
  line-height: 1.55;
}

.slideshow {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 24px;
  background: transparent;
  place-items: center;
}

.slideshow.empty {
  display: grid;
  place-items: center;
}

.slide-image {
  width: 100%;
  height: 100%;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: contain;
}

.slide-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

@keyframes avatar-speaking {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.045);
  }
}

@keyframes wave {
  0%,
  100% {
    height: 10px;
  }

  50% {
    height: 28px;
  }
}

@keyframes pull-from-avatar {
  from {
    opacity: 0;
    transform: translateX(-34%) translateY(10px) scale(0.9) rotate(-4deg);
  }

  to {
    opacity: 1;
    transform: translateX(0) translateY(0) scale(1) rotate(0);
  }
}

@media (max-width: 1080px) {
  :root {
    --stage-height: 320px;
    --avatar-width: min(186px, 100%);
    --gallery-width: min(720px, 100%);
  }

  .page-shell {
    padding: 16px;
  }

  .hero-card {
    grid-template-columns: 1fr;
    padding: 16px;
  }

}
