/* Stacy Moon — Style */

:root {
  --bg: #0a0a0f;
  --accent: #F97316;
  --accent-glow: rgba(249, 115, 22, 0.25);
  --text: #e4e4e7;
  --text-muted: #71717a;
  --surface: #12121a;
  --bubble-ai: #1a1820;
  --border: rgba(255, 255, 255, 0.06);
  --radius: 18px;
  --radius-sm: 14px;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Noto Sans SC', sans-serif;
  background: var(--bg);
  color: var(--text);
  max-width: 420px;
  margin: 0 auto;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Header ────────────────────────────── */

.header {
  text-align: center;
  padding: 28px 20px 20px;
  flex-shrink: 0;
}

.moon-logo {
  display: block;
  margin: 0 auto 12px;
  filter: drop-shadow(0 0 20px var(--accent-glow));
}

.title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
}

.subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 0.03em;
}

/* ── Chat Box ──────────────────────────── */

.chat-box {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

/* ── Bubble Row ────────────────────────── */

.bubble-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 88%;
  animation: bubbleIn 0.32s ease-out;
}

.bubble-row.ai {
  align-self: flex-start;
}

.bubble-row.user {
  align-self: flex-end;
}

.bubble-row .avatar {
  font-size: 1.5rem;
  flex-shrink: 0;
  line-height: 1;
}

@keyframes bubbleIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Bubbles ───────────────────────────── */

.bubble {
  padding: 10px 14px;
  font-size: 0.9rem;
  line-height: 1.6;
}

.ai-bubble {
  background: var(--bubble-ai);
  color: #fff;
  border-radius: 0 var(--radius) var(--radius) var(--radius);
}

.user-bubble {
  background: rgba(249, 115, 22, 0.15);
  border: 1px solid rgba(249, 115, 22, 0.3);
  color: #fff;
  border-radius: var(--radius) 0 var(--radius) var(--radius);
}

/* ── Loading Bubble ────────────────────── */

.loading-bubble {
  color: var(--text-muted);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.loading-bubble::before {
  content: '';
  display: inline-flex;
  gap: 4px;
  /* 用三个圆点表示加载中 — 通过 dotted-symbol 模拟 */
  width: 24px;
  height: 8px;
  background:
    radial-gradient(circle at 4px 50%, var(--text-muted) 1.8px, transparent 2px),
    radial-gradient(circle at 12px 50%, var(--text-muted) 1.8px, transparent 2px),
    radial-gradient(circle at 20px 50%, var(--text-muted) 1.8px, transparent 2px);
  animation: dotPulse 1.4s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

/* ── Input Area ────────────────────────── */

.input-area {
  flex-shrink: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 10px 16px 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

.notify-hint {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.user-input {
  flex: 1;
  height: 42px;
  border-radius: 21px;
  border: 1px solid var(--border);
  background: #1c1c24;
  color: #fff;
  font-family: inherit;
  font-size: 0.88rem;
  padding: 0 16px;
  outline: none;
  transition: border-color 0.2s;
}

.user-input::placeholder {
  color: var(--text-muted);
}

.user-input:focus {
  border-color: rgba(249, 115, 22, 0.45);
}

.send-btn {
  flex-shrink: 0;
  height: 42px;
  padding: 0 22px;
  border-radius: 21px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  user-select: none;
}

.send-btn:active {
  opacity: 0.85;
  transform: scale(0.96);
}

/* ── ElevenLabs Widget ─────────────────── */

elevenlabs-convai {
  position: fixed !important;
  bottom: 80px !important;
  right: 16px !important;
  z-index: 999 !important;
  --el-convai-bottom: 80px;
  --el-convai-right: 16px;
}
