/* 数据处理 AI 咨询落地页 —— 精致科技感 · 青蓝 + 橙
   桌面:深色氛围背景上悬浮对话卡片;移动:全屏。 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --teal-d: #04313a; --teal: #0e7490; --teal-l: #0891b2; --cyan: #2bd4e8;
  --amber: #f59e0b; --amber-l: #fbbf24;
  --ink: #0d1b22; --muted: #5b7884; --line: #e3eef2; --soft: #f3fafc;
  --bubble-ai: #ffffff;
  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", "Hiragino Sans GB", sans-serif;
}
html, body { height: 100%; }
body {
  font-family: var(--font); color: var(--ink); -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1100px 560px at 82% -12%, rgba(8,145,178,.30), transparent 60%),
    radial-gradient(820px 460px at -5% 112%, rgba(245,158,11,.12), transparent 60%),
    linear-gradient(160deg, #052830, #06222a 60%, #04181e);
  background-attachment: fixed;
}

/* 对话卡片容器 */
.app {
  position: relative; display: flex; flex-direction: column;
  max-width: 560px; margin: 0 auto; height: 100dvh; background: var(--soft); overflow: hidden;
}
@media (min-width: 620px) {
  body { padding: 30px 0; }
  .app {
    height: calc(100dvh - 60px); border-radius: 26px;
    box-shadow: 0 40px 110px rgba(2,18,24,.55), 0 0 0 1px rgba(255,255,255,.06);
  }
}

/* ===== 顶部 ===== */
.hdr {
  position: relative; padding: 22px 22px 18px; color: #fff;
  background:
    radial-gradient(420px 200px at 86% -40%, rgba(43,212,232,.42), transparent 70%),
    linear-gradient(140deg, var(--teal-d) 0%, var(--teal) 62%, var(--teal-l) 100%);
  animation: fadeDown .5s ease both;
}
.hdr::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 38px 38px; mask-image: linear-gradient(180deg, #000, transparent 92%);
}
.hdr-row { position: relative; display: flex; align-items: center; gap: 13px; }
.logo {
  width: 46px; height: 46px; border-radius: 14px; flex: none;
  background: linear-gradient(145deg, #19c3da, var(--teal-l) 55%, var(--teal));
  box-shadow: 0 6px 18px rgba(2,18,24,.35), 0 0 22px rgba(43,212,232,.30), inset 0 1px 0 rgba(255,255,255,.5);
  display: flex; align-items: center; justify-content: center; font-size: 25px; font-weight: 800; color: #fff;
}
.hdr-title { font-size: 21px; font-weight: 800; letter-spacing: .5px; }
.hdr-sub { font-size: 12.5px; color: #bfeef6; margin-top: 3px; letter-spacing: .2px; }
.hdr-trust { position: relative; display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.hdr-trust span {
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.22);
  color: #eafbfe; font-size: 12.5px; padding: 4px 11px; border-radius: 100px; backdrop-filter: blur(4px);
}
.hdr-safe { position: relative; margin-top: 11px; font-size: 12px; color: #9fd6e0; line-height: 1.5; }
.hdr-safe::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--amber-l); margin-right: 7px; vertical-align: middle; }

/* ===== 聊天区 ===== */
.chat { position: relative; flex: 1; overflow-y: auto; padding: 22px 18px 10px; display: flex; flex-direction: column; gap: 16px; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: rgba(14,116,144,.25) transparent; }
.chat::-webkit-scrollbar { width: 6px; }
.chat::-webkit-scrollbar-track { background: transparent; }
.chat::-webkit-scrollbar-thumb { background: rgba(14,116,144,.20); border-radius: 100px; }
.chat::-webkit-scrollbar-thumb:hover { background: rgba(14,116,144,.36); }
.chat::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image: radial-gradient(rgba(14,116,144,.05) 1px, transparent 1px);
  background-size: 22px 22px;
}
.msg { position: relative; z-index: 1; display: flex; gap: 10px; max-width: 90%; animation: msgIn .42s cubic-bezier(.22,.85,.26,1) both; }
.msg .av {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 800; color: #fff;
  box-shadow: 0 4px 12px rgba(2,18,24,.16);
}
.msg.ai { align-self: flex-start; }
.msg.ai .av { background: linear-gradient(145deg, var(--teal), var(--teal-l)); }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg.user .av { background: linear-gradient(145deg, var(--amber), #ea7e00); }
.bubble { padding: 13px 16px; font-size: 16px; line-height: 1.68; white-space: pre-wrap; word-break: break-word; }
.msg.ai .bubble {
  background: var(--bubble-ai); color: #1b3038;
  border-radius: 4px 18px 18px 18px;
  box-shadow: 0 12px 28px rgba(6,53,66,.09), 0 1px 2px rgba(6,53,66,.04);
}
.msg.user .bubble {
  background: linear-gradient(140deg, var(--teal), var(--teal-l)); color: #fff;
  border-radius: 18px 4px 18px 18px; box-shadow: 0 10px 26px rgba(8,145,178,.28);
}
.bubble b { font-weight: 700; }
.cursor { display: inline-block; width: 8px; height: 16px; background: var(--teal-l); margin-left: 2px; border-radius: 2px; animation: blink 1s steps(2) infinite; vertical-align: -2px; }

/* 需求小结操作条 */
.lead-actions { position: relative; z-index: 1; align-self: stretch; margin: 4px 2px; background: linear-gradient(135deg, #fff7ed, #fff1e0); border: 1px solid #fcd9a8; border-radius: 16px; padding: 15px 16px; box-shadow: 0 12px 30px rgba(245,158,11,.12); animation: msgIn .42s ease both; }
.lead-tip { font-size: 13.5px; color: #9a3412; margin-bottom: 11px; font-weight: 600; }
.lead-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.lead-btns button { flex: 1; min-width: 132px; border: none; border-radius: 12px; padding: 13px 14px; font-size: 15px; font-weight: 700; cursor: pointer; transition: transform .12s ease, box-shadow .2s ease; }
.lead-btns button:active { transform: scale(.97); }
.btn-copy { background: #fff; color: var(--teal); border: 1.5px solid var(--teal) !important; }
.btn-kefu { background: linear-gradient(140deg, var(--amber), #ea7e00); color: #fff; box-shadow: 0 8px 20px rgba(245,158,11,.35); animation: kefuPulse 2.4s ease-in-out infinite; }
.btn-copy.done { background: var(--teal); color: #fff; border-color: var(--teal) !important; }

/* 起始示例需求(开场消息下方,一点即发) */
.examples { position: relative; z-index: 1; align-self: flex-start; max-width: 92%; margin-left: 46px; display: flex; flex-direction: column; gap: 8px; animation: msgIn .5s ease both; animation-delay: .12s; }
.examples-t { font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
.ex-chip { text-align: left; background: #fff; border: 1px solid var(--line); color: var(--teal-d); font-size: 14px; padding: 11px 15px; border-radius: 13px; cursor: pointer; box-shadow: 0 4px 12px rgba(6,53,66,.05); transition: transform .14s ease, border-color .2s ease, box-shadow .2s ease; }
.ex-chip:hover { transform: translateX(3px) scale(1.012); border-color: var(--teal-l); box-shadow: 0 10px 22px rgba(8,145,178,.18); }

/* 快捷选项 */
.quick { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 10px; }
.quick button {
  background: #fff; border: 1px solid var(--line); color: var(--teal);
  font-size: 13px; padding: 9px 15px; border-radius: 100px; cursor: pointer;
  box-shadow: 0 4px 12px rgba(6,53,66,.05); transition: transform .14s ease, border-color .2s ease, color .2s ease;
  animation: chipIn .5s ease both;
}
.quick button:hover { transform: translateY(-2px); border-color: var(--teal-l); color: var(--teal-d); }
.quick button:nth-child(1){animation-delay:.05s} .quick button:nth-child(2){animation-delay:.1s}
.quick button:nth-child(3){animation-delay:.15s} .quick button:nth-child(4){animation-delay:.2s}
.quick button:nth-child(5){animation-delay:.25s} .quick button:nth-child(6){animation-delay:.3s}

/* 输入栏 */
.composer { position: relative; z-index: 2; display: flex; gap: 10px; padding: 13px 14px calc(13px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(8px); align-items: flex-end; }
.composer textarea {
  flex: 1; resize: none; border: 1.5px solid var(--line); border-radius: 15px; padding: 12px 15px;
  font-size: 16px; font-family: inherit; line-height: 1.5; max-height: 120px; outline: none; background: var(--soft);
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.composer textarea:focus { border-color: var(--teal-l); background: #fff; box-shadow: 0 0 0 4px rgba(8,145,178,.12); }
.composer #send {
  flex: none; border: none; border-radius: 15px; padding: 0 22px; height: 48px;
  background: linear-gradient(140deg, var(--teal), var(--teal-l)); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer;
  box-shadow: 0 8px 20px rgba(8,145,178,.32); transition: transform .12s ease, box-shadow .2s ease;
}
.composer #send:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(8,145,178,.42); }
.composer #send:active { transform: scale(.96); }
.composer #send:disabled { opacity: .5; cursor: default; box-shadow: none; transform: none; }

/* 图片上传 */
.img-preview[hidden] { display: none; }
.attach-btn {
  flex: none; width: 48px; height: 48px; border-radius: 14px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--soft); color: var(--teal);
  font-size: 26px; line-height: 1; display: flex; align-items: center; justify-content: center;
  transition: border-color .2s ease, background .2s ease, transform .12s ease;
}
.attach-btn:hover { border-color: var(--teal-l); background: #fff; transform: translateY(-1px); }
.attach-btn:active { transform: scale(.94); }
.img-preview {
  position: relative; z-index: 2; display: flex; align-items: center; gap: 11px;
  margin: 0 14px; padding: 9px 11px; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 6px 16px rgba(6,53,66,.07); animation: msgIn .3s ease both;
}
.img-preview img { width: 46px; height: 46px; object-fit: cover; border-radius: 9px; border: 1px solid var(--line); }
.img-hint { flex: 1; font-size: 13px; color: var(--muted); }
#imgRemove {
  flex: none; width: 26px; height: 26px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--soft); color: var(--muted); font-size: 17px; line-height: 1;
  display: flex; align-items: center; justify-content: center; transition: background .2s ease, color .2s ease;
}
#imgRemove:hover { background: #ffe4e4; color: #d4380d; }
.bubble-img { max-width: 220px; max-height: 240px; border-radius: 11px; display: block; margin-bottom: 6px; box-shadow: 0 6px 16px rgba(2,18,24,.2); }
.thinking { color: var(--muted); font-size: 14.5px; display: inline-flex; align-items: center; gap: 8px; }
.thinking .dots { display: inline-flex; gap: 5px; }
.thinking .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--teal-l); display: inline-block; animation: typingDot 1.3s ease-in-out infinite; }
.thinking .dots i:nth-child(2) { animation-delay: .18s; }
.thinking .dots i:nth-child(3) { animation-delay: .36s; }

/* 客服弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(4,28,34,.6); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 50; animation: fadeIn .2s ease; }
.modal-mask[hidden] { display: none; }
.modal { background: #fff; border-radius: 22px; padding: 28px 24px; max-width: 360px; width: 100%; text-align: center; box-shadow: 0 30px 80px rgba(2,18,24,.5); animation: popIn .28s cubic-bezier(.2,.9,.3,1.2); }
.modal-title { font-size: 19px; font-weight: 800; color: var(--teal); }
.kefu-qr { width: 210px; height: 210px; display: block; margin: 18px auto 0; border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 10px 26px rgba(6,53,66,.12); }
.modal-body { margin-top: 14px; font-size: 16px; }
.modal-body b { color: var(--amber); font-size: 19px; user-select: all; }
.modal-note { margin-top: 8px; font-size: 13px; color: var(--muted); }
.modal-close { margin-top: 22px; border: none; background: linear-gradient(140deg, var(--teal), var(--teal-l)); color: #fff; font-size: 15px; font-weight: 700; padding: 13px 0; width: 100%; border-radius: 13px; cursor: pointer; transition: transform .12s ease; }
.modal-close:active { transform: scale(.97); }

/* ===== 动画 ===== */
@keyframes blink { 0%,50%{opacity:1} 50.01%,100%{opacity:0} }
@keyframes typingDot { 0%, 60%, 100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-5px); opacity: 1; } }
@keyframes kefuPulse {
  0%, 100% { box-shadow: 0 8px 20px rgba(245,158,11,.35); }
  50% { box-shadow: 0 8px 28px rgba(245,158,11,.55), 0 0 0 6px rgba(245,158,11,.10); }
}
@keyframes msgIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes chipIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }
