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

:root {
  --bg: #0b1220;
  --card: #111a2e;
  --card-border: #1f2a44;
  --text: #e6edf7;
  --muted: #8b9bb8;
  --accent: #06c755;
  --accent-2: #7b4fe9;
  --danger: #f43f5e;
}

body {
  font-family: "Noto Sans TC", -apple-system, "PingFang TC", "Microsoft JhengHei", sans-serif;
  background:
    radial-gradient(1000px 500px at 85% -10%, rgba(123, 79, 233, 0.15), transparent 60%),
    radial-gradient(800px 400px at -10% 20%, rgba(6, 199, 85, 0.1), transparent 55%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Hero ── */
.hero {
  border-bottom: 1px solid var(--card-border);
  background: rgba(17, 26, 46, 0.6);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.hero-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  box-shadow: 0 6px 18px rgba(6, 199, 85, 0.3);
}

.brand-text h1 {
  font-size: 18px;
  font-weight: 700;
}

.brand-text p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.hero-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  background: rgba(6, 199, 85, 0.08);
  border: 1px solid rgba(6, 199, 85, 0.25);
  padding: 8px 14px;
  border-radius: 999px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.6s ease-in-out infinite;
}

.pulse-dot.small {
  width: 7px;
  height: 7px;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(6, 199, 85, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(6, 199, 85, 0); }
}

/* ── Content ── */
.content {
  max-width: 960px;
  margin: 0 auto;
  padding: 56px 24px;
}

.intro-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 48px 32px;
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.bot-avatar {
  width: 84px;
  height: 84px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(6, 199, 85, 0.25), rgba(123, 79, 233, 0.25));
  border: 2px solid rgba(6, 199, 85, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
}

.intro-card h2 {
  font-size: 24px;
  font-weight: 700;
}

.tagline {
  color: var(--muted);
  font-size: 15px;
  margin: 12px 0 28px;
  line-height: 1.7;
}

.feature-grid {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.feature {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
}

.feature-icon {
  font-size: 15px;
}

.chat-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 8px 24px rgba(6, 199, 85, 0.35);
}

.chat-start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(6, 199, 85, 0.45);
}

.btn-arrow {
  transition: transform 0.2s ease;
}

.chat-start-btn:hover .btn-arrow {
  transform: translateX(3px);
}

/* ── Chat FAB ── */
.chat-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(6, 199, 85, 0.45);
  transition: all 0.2s ease;
  z-index: 60;
}

.chat-fab:hover {
  transform: scale(1.06);
}

.fab-close {
  display: none;
}

.chat-fab.active .fab-open {
  display: none;
}

.chat-fab.active .fab-close {
  display: block;
}

/* ── Chat Panel ── */
.chat-panel {
  position: fixed;
  right: 24px;
  bottom: 96px;
  width: 380px;
  max-width: calc(100vw - 48px);
  height: 560px;
  max-height: calc(100vh - 120px);
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(16px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s ease;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  z-index: 55;
}

.chat-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(6, 199, 85, 0.18), rgba(123, 79, 233, 0.14));
  border-bottom: 1px solid var(--card-border);
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(6, 199, 85, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.chat-header-name {
  font-size: 15px;
  font-weight: 700;
}

.chat-header-status {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.chat-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.chat-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

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

.msg {
  display: flex;
  gap: 10px;
  max-width: 88%;
}

.msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.msg-bubble {
  padding: 11px 15px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.65;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.06);
  word-break: break-word;
}

.msg.bot .msg-bubble {
  border-top-left-radius: 4px;
}

.msg.user .msg-bubble {
  background: linear-gradient(135deg, var(--accent), #05a848);
  border: none;
  border-top-right-radius: 4px;
  color: #fff;
}

.chat-input-bar {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.2);
}

.chat-input-bar input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  color: var(--text);
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}

.chat-input-bar input:focus {
  border-color: var(--accent);
}

.chat-input-bar input::placeholder {
  color: #5a6a88;
}

#sendBtn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

#sendBtn:hover {
  filter: brightness(1.1);
}

#sendBtn:active {
  transform: scale(0.95);
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}

@media (max-width: 480px) {
  .chat-panel {
    right: 12px;
    bottom: 84px;
    width: calc(100vw - 24px);
    height: calc(100vh - 100px);
  }
  .chat-fab {
    right: 16px;
    bottom: 16px;
  }
}
