:root {
  --bg: #eef3f8;
  --text: #172033;
  --muted: #687383;
  --panel: #ffffff;
  --line: #dfe6ef;
  --primary: #1677ff;
  --primary-dark: #0f5fd1;
  --success: #20b26b;
  --shadow: 0 22px 70px rgba(25, 42, 70, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-page {
  min-height: 100vh;
  padding: 24px;
  background:
    linear-gradient(120deg, rgba(22, 119, 255, 0.12), rgba(32, 178, 107, 0.08)),
    radial-gradient(circle at 82% 14%, rgba(255, 255, 255, 0.95), transparent 28%),
    var(--bg);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
}

.ghost-button,
.primary-button {
  height: 40px;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 700;
}

.ghost-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
}

.primary-button {
  border: 0;
  background: var(--primary);
  color: #fff;
}

.primary-button:hover,
.composer button:hover,
.floating-service-button:hover {
  background: var(--primary-dark);
}

.hero {
  width: min(1120px, 100%);
  margin: 110px auto 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-weight: 800;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.05;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 560px;
  margin: 22px 0 28px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.chat-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: min(390px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: 76px auto 1fr auto 106px;
  overflow: hidden;
  border: 1px solid rgba(223, 230, 239, 0.95);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  transform-origin: right bottom;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  z-index: 10;
}

.chat-widget.is-minimized {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.96);
  pointer-events: none;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #1269df;
  color: #fff;
}

.agent-avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  font-weight: 800;
}

.chat-header h2 {
  margin: 0;
  font-size: 17px;
}

.chat-header p {
  margin: 5px 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.86);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(32, 178, 107, 0.2);
}

.icon-button {
  width: 34px;
  height: 34px;
  margin-left: auto;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 22px;
  line-height: 1;
}

.notice {
  margin: 12px 14px 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f4f7fb;
  color: var(--muted);
  font-size: 13px;
}

.notice strong {
  color: var(--text);
}

.message-list {
  overflow-y: auto;
  padding: 16px 14px;
  background:
    linear-gradient(#fff, #fff),
    repeating-linear-gradient(0deg, transparent 0, transparent 31px, #eef2f7 32px);
}

.message {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  align-items: flex-start;
}

.message.user {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #ecf3ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.message.user .message-avatar {
  background: var(--primary);
  color: #fff;
}

.bubble {
  max-width: 76%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f7f9fc;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}

.message.user .bubble {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.quick-question-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 14px 12px;
}

.quick-question-list button {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 12px;
  border: 1px solid #cfe0f8;
  border-radius: 999px;
  background: #f5f9ff;
  color: #1d62bd;
  font-size: 13px;
}

.composer {
  display: grid;
  grid-template-columns: 1fr 68px;
  gap: 10px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.composer textarea {
  width: 100%;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  padding: 10px 12px;
  color: var(--text);
  line-height: 1.5;
}

.composer textarea:focus {
  border-color: rgba(22, 119, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}

.composer button {
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

.floating-service-button {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow);
  font-weight: 800;
  z-index: 9;
}

.floating-service-button small {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #e35d6a;
  color: #fff;
  font-size: 12px;
}

.floating-service-button.is-hidden {
  display: none;
}

@media (max-width: 640px) {
  .site-page {
    padding: 18px;
  }

  .hero {
    margin-top: 72px;
  }

  .chat-widget {
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .floating-service-button {
    right: 18px;
    bottom: 18px;
  }
}
