:root {
  --bg: #0b1020;
  --panel: rgba(18, 25, 46, 0.78);
  --line: rgba(130, 160, 255, 0.18);
  --text: #e7ecff;
  --muted: #8d9ac0;
  --accent: #6ea8ff;
  --accent-2: #9b7bff;
  --danger: #ff6b7d;
  --ok: #35d49a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(900px 600px at 15% -10%, rgba(110, 168, 255, 0.22), transparent 60%),
    radial-gradient(700px 500px at 100% 0%, rgba(155, 123, 255, 0.18), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

.app {
  width: min(920px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { display: flex; align-items: center; gap: 14px; }

.logo {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #08101f;
  font-weight: 800;
  font-size: 20px;
  box-shadow: 0 10px 30px rgba(110, 168, 255, 0.28);
}

h1 { margin: 0; font-size: 19px; letter-spacing: 0.02em; }
.brand p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }

.status {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
}
.status[data-state="connecting"] { color: #ffd479; border-color: rgba(255, 212, 121, 0.35); }
.status[data-state="live"] { color: var(--ok); border-color: rgba(53, 212, 154, 0.4); }
.status[data-state="error"] { color: var(--danger); border-color: rgba(255, 107, 125, 0.4); }

.stage {
  flex: 1;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(23, 32, 60, 0.7), rgba(13, 19, 38, 0.55));
  position: relative;
  overflow: hidden;
}

.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px 220px at 50% 25%, rgba(110, 168, 255, 0.12), transparent 70%);
  pointer-events: none;
}

.orb {
  width: 168px;
  height: 168px;
  position: relative;
  display: grid;
  place-items: center;
}

.orb-core {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #cfe1ff, #6ea8ff 38%, #6a4fd8 78%);
  box-shadow: 0 0 50px rgba(110, 168, 255, 0.45), inset 0 0 24px rgba(255, 255, 255, 0.35);
  transition: transform 180ms ease;
}

.orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(130, 160, 255, 0.35);
}

.orb.active .orb-ring {
  animation: pulse 1.8s ease-out infinite;
}
.orb.active .orb-core {
  animation: breathe 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0% { transform: scale(0.72); opacity: 0.9; }
  100% { transform: scale(1.35); opacity: 0; }
}
@keyframes breathe {
  0%, 100% { transform: scale(0.94); }
  50% { transform: scale(1.06); }
}

.hint { margin: 0; color: var(--muted); font-size: 13px; text-align: center; padding: 0 24px; }

.transcript-wrap {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  padding: 16px 18px;
  min-height: 150px;
}

.transcript-wrap h2 { margin: 0 0 10px; font-size: 13px; color: var(--muted); font-weight: 500; }

.transcript {
  height: 150px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.transcript .empty { color: #6f7ba0; font-size: 13px; margin: 0; }

.line { display: flex; gap: 8px; font-size: 14px; line-height: 1.55; }
.line .who { flex: 0 0 auto; font-size: 12px; color: var(--muted); padding-top: 2px; }
.line.agent .who { color: var(--accent); }
.line.user .who { color: var(--ok); }
.line .what { white-space: pre-wrap; word-break: break-word; }
.line.partial .what { color: #aab6d8; }

.controls { display: flex; gap: 12px; justify-content: center; }

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, opacity 120ms ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); background: rgba(255, 255, 255, 0.08); }
.btn:disabled { opacity: 0.38; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #08101f; border: none; font-weight: 700; }
.btn.danger { color: var(--danger); border-color: rgba(255, 107, 125, 0.35); }
.btn.live { box-shadow: 0 0 0 3px rgba(255, 107, 125, 0.12); }
