:root {
  color-scheme: dark;
  --page: #0d1117;
  --surface: #161b22;
  --surface-raised: #1c2128;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --blue: #3b82f6;
  --blue-light: #60a5fa;
  --danger: #f87171;
  --danger-bg: rgba(127, 29, 29, 0.18);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.7;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  border-bottom: 1px solid rgba(48, 54, 61, 0.84);
  background: rgba(13, 17, 23, 0.88);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1120px, calc(100% - 40px));
  min-height: 62px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 1.03rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-light), var(--blue));
  color: #fff;
  font-size: 0.83rem;
}

.public-badge,
.example-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(96, 165, 250, 0.5);
  border-radius: 999px;
  color: #bfdbfe;
  font-size: 0.78rem;
  line-height: 1;
  white-space: nowrap;
}

.public-badge {
  padding: 6px 9px;
  background: rgba(59, 130, 246, 0.12);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 94px 20px 70px;
}

.hero::before {
  position: absolute;
  top: -210px;
  left: 50%;
  width: min(870px, 100vw);
  height: 510px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(59, 130, 246, 0.19), transparent 66%);
  content: "";
  pointer-events: none;
  transform: translateX(-50%);
}

.hero-inner,
.section-heading,
.profile-section,
.safety-section {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.hero-inner {
  position: relative;
  max-width: 935px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue-light);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 20px;
  font-size: clamp(1.72rem, 4vw, 3rem);
  line-height: 1.35;
  letter-spacing: -0.035em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.38rem, 2.5vw, 1.88rem);
  line-height: 1.4;
}

h3 {
  margin-bottom: 14px;
  font-size: 1.03rem;
  line-height: 1.45;
}

.hero-summary {
  margin-bottom: 28px;
  color: #b8c2cc;
  font-size: clamp(1rem, 2vw, 1.16rem);
}

.primary-button,
.send-button {
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.27);
  color: #fff;
  font-weight: 700;
}

.primary-button {
  min-height: 46px;
  padding: 0 20px;
}

.primary-button:hover,
.send-button:hover {
  filter: brightness(1.1);
}

.primary-button:focus-visible,
.skip-button:focus-visible,
.chip:focus-visible,
.send-button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(96, 165, 250, 0.65);
  outline-offset: 3px;
}

.demo-section {
  padding: 38px 0 88px;
}

.section-heading {
  margin-bottom: 20px;
}

.chat-shell {
  width: min(720px, calc(100% - 40px));
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.chat-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 59px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(28, 33, 40, 0.72);
}

.chat-agent {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.94rem;
  font-weight: 700;
}

.agent-avatar {
  display: block;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
}

.agent-avatar circle {
  fill: var(--blue);
}

.agent-avatar text {
  fill: #fff;
  font-size: 17px;
  font-weight: 700;
}

.skip-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.86rem;
}

.skip-button:hover {
  color: var(--text);
}

.skip-button[hidden] {
  display: none;
}

.conversation {
  display: flex;
  min-height: 358px;
  max-height: 580px;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  padding: 20px;
  scroll-behavior: smooth;
}

.message {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 92%;
  animation: message-enter 260ms ease-out both;
}

.message.agent {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message.visitor {
  align-self: flex-start;
}

.message-bubble {
  padding: 11px 13px;
  border-radius: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.visitor .message-bubble {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #172033;
  border-bottom-left-radius: 3px;
}

.agent .message-bubble {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  border-bottom-right-radius: 3px;
}

.example-badge {
  margin: 0 0 5px auto;
  padding: 4px 6px;
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.68rem;
}

.message-copy:empty::after {
  display: inline-block;
  width: 0.45em;
  height: 1.05em;
  border-right: 2px solid currentColor;
  content: "";
  vertical-align: -0.15em;
  animation: caret 700ms step-end infinite;
}

.message-copy.done:empty::after,
.message-copy.done::after {
  content: none;
}

.interaction-panel {
  padding: 0 20px 20px;
  border-top: 1px solid var(--border);
  animation: message-enter 260ms ease-out both;
}

.interaction-panel[hidden] {
  display: none;
}

.try-prompt {
  margin: 16px 0 9px;
  color: var(--muted);
  font-size: 0.87rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 13px;
}

.chip {
  border: 1px solid #315b97;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.1);
  color: #bfdbfe;
  font-size: 0.85rem;
  line-height: 1.2;
  padding: 7px 10px;
}

.chip:hover {
  background: rgba(59, 130, 246, 0.23);
}

.question-form {
  display: flex;
  gap: 8px;
}

.question-form input {
  min-width: 0;
  flex: 1;
  height: 43px;
  border: 1px solid var(--border);
  border-radius: 9px;
  outline: 0;
  background: #0d1117;
  color: var(--text);
  padding: 0 12px;
}

.question-form input::placeholder {
  color: #6e7681;
}

.send-button {
  min-width: 66px;
  padding: 0 13px;
}

.send-button:disabled,
.question-form input:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.profile-section {
  padding: 0 0 88px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.profile-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 22px;
}

.profile-card p,
.profile-card li {
  color: #c4ccd4;
  font-size: 0.93rem;
}

.profile-card p {
  margin-bottom: 0;
}

.profile-card ul,
.profile-card ol,
.safety-card ul {
  margin: 0;
  padding-left: 1.3em;
}

.profile-card li + li,
.safety-card li + li {
  margin-top: 7px;
}

.wide-card {
  grid-column: span 2;
}

.boundary-card {
  border-color: rgba(248, 113, 113, 0.62);
  background: var(--danger-bg);
}

.boundary-card h3,
.boundary-card li {
  color: #fecaca;
}

.safety-section {
  padding: 0 0 72px;
}

.safety-card {
  border: 1px solid #315b97;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.26), rgba(22, 27, 34, 0.96) 55%);
  padding: clamp(22px, 4vw, 34px);
}

.safety-card h2 {
  margin-bottom: 16px;
}

.safety-card li,
.safety-card > p:last-child {
  color: #c9d9ef;
}

.safety-card > p:last-child {
  margin: 16px 0 0;
}

footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.86rem;
  padding: 24px 20px 32px;
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@keyframes message-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

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

@keyframes caret {
  50% {
    border-color: transparent;
  }
}

@media (max-width: 680px) {
  .header-inner,
  .hero-inner,
  .section-heading,
  .profile-section,
  .safety-section {
    width: min(100% - 28px, 1120px);
  }

  .hero {
    padding: 66px 14px 52px;
  }

  .demo-section {
    padding: 26px 0 62px;
  }

  .chat-shell {
    width: min(100% - 28px, 720px);
    border-radius: 13px;
  }

  .conversation {
    min-height: 320px;
    max-height: 530px;
    padding: 15px;
  }

  .message {
    max-width: 96%;
  }

  .message-bubble {
    padding: 10px 11px;
    font-size: 0.92rem;
  }

  .interaction-panel {
    padding: 0 15px 15px;
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .wide-card {
    grid-column: auto;
  }

  .profile-section {
    padding-bottom: 62px;
  }

  .safety-section {
    padding-bottom: 54px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
