/* ============================================================
   海螺数字人 · 前端样式（统一设计体系）
   设计语言：海洋科技 / 青蓝品牌色 / 圆润卡片 / 细腻动效
   ============================================================ */
:root {
  /* 品牌色阶（青蓝海洋） */
  --brand-50:  #eff9ff;
  --brand-100: #dbf2ff;
  --brand-200: #b8e5ff;
  --brand-300: #7fd3fb;
  --brand-400: #38bdf8;
  --brand-500: #0ea5e9;
  --brand-600: #0284c7;
  --brand-700: #0369a1;
  --brand-800: #075985;
  --brand-900: #0c4a6e;

  /* 语义色 */
  --primary:       #0ea5e9;
  --primary-hover: #0284c7;
  --accent:        #22d3ee;
  --success:       #10b981;
  --warning:       #f59e0b;
  --danger:        #ef4444;
  --info:          #0ea5e9;

  /* 中性色 */
  --bg:     #f3f7fc;
  --card:   #ffffff;
  --text:   #0f172a;
  --muted:  #64748b;
  --border: #e3ebf4;
  --bg-soft:#f8fafc;

  /* 品牌渐变 */
  --grad-brand: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
  --grad-sea:   linear-gradient(160deg, #0b1220 0%, #0c2d4a 42%, #0ea5e9 135%);

  /* 圆角 / 阴影 */
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-md: 0 2px 10px rgba(15, 23, 42, .07), 0 10px 28px rgba(15, 23, 42, .05);
  --shadow-lg: 0 20px 50px rgba(3, 35, 75, .35);

  /* 字体 */
  --font-sans: "MiSans", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-num: "Inter", "SF Pro Display", "Segoe UI", sans-serif;

  /* 动效 */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur: .18s;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* 通用 SVG 图标 */
.ic {
  width: 1em; height: 1em; flex: none;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -0.12em;
}

button { font-family: inherit; cursor: pointer; }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd8e6; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #aebfd3; }
::-webkit-scrollbar-track { background: transparent; }

/* ==================== 顶栏 ==================== */
.topbar {
  background: linear-gradient(120deg, var(--brand-900) 0%, var(--brand-700) 55%, var(--brand-500) 130%);
  color: #fff;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 18px rgba(12, 74, 110, .28);
  position: relative;
  z-index: 5;
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--grad-brand);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700;
  box-shadow: 0 6px 16px rgba(2, 132, 199, .45);
}
.brand-text h1 { font-size: 20px; font-weight: 700; letter-spacing: .5px; }
.brand-text p { font-size: 12px; opacity: .82; margin-top: 2px; }
.admin-link {
  color: #fff; text-decoration: none; font-size: 14px;
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid rgba(255,255,255,.45); border-radius: 10px;
  padding: 8px 16px; transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
  backdrop-filter: blur(4px);
}
.admin-link:hover { background: rgba(255,255,255,.14); border-color: #fff; }
.admin-link .ic { width: 15px; height: 15px; }

/* 顶栏：方案 3D 演示入口（默认直达 /twin 全屏巡演，菜单可直选场景） */
.top-right { display: flex; align-items: center; gap: 10px; }
.twin-entry { position: relative; display: flex; align-items: stretch;
  border: 1px solid rgba(255,255,255,.45); border-radius: 10px;
  backdrop-filter: blur(4px); transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.twin-entry:hover { background: rgba(255,255,255,.1); border-color: #fff; }
.twin-go { color: #fff; text-decoration: none; font-size: 14px;
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 6px 8px 14px; white-space: nowrap; }
.twin-go .ic { width: 16px; height: 16px; }
.twin-arrow { background: transparent; border: none; border-left: 1px solid rgba(255,255,255,.3);
  color: #fff; cursor: pointer; padding: 0 8px; display: flex; align-items: center; }
.twin-arrow svg { width: 13px; height: 13px; transition: transform var(--dur) var(--ease); }
.twin-entry.open .twin-arrow svg { transform: rotate(180deg); }
.twin-menu { position: absolute; top: calc(100% + 10px); right: 0; min-width: 250px;
  max-height: 72vh; overflow-y: auto; background: #fff; color: var(--text);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 18px 44px rgba(15,23,42,.18);
  padding: 7px; display: none; z-index: 80; }
.twin-entry.open .twin-menu { display: block; }
.twin-menu a { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text);
  padding: 8px 11px; border-radius: 9px; text-decoration: none;
  transition: background var(--dur) var(--ease); }
.twin-menu a:hover { background: var(--brand-50); color: var(--brand-700); }
.twin-menu .tm-first { margin-bottom: 5px; padding-bottom: 10px;
  border-bottom: 1px dashed var(--border); }
.twin-menu a .ic { width: 17px; height: 17px; color: var(--brand-500); flex: none; }
.twin-menu a .tm-txt { flex: 1; }

/* ==================== 主体布局 ==================== */
.layout {
  flex: 1; display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px; padding: 20px 28px; min-height: 0;
}

/* ==================== 左侧数字人 ==================== */
.avatar-panel {
  background: var(--card); border-radius: var(--radius);
  padding: 20px; display: flex; flex-direction: column;
  align-items: center; box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

.avatar {
  position: relative;
  width: 100%; max-width: 280px; aspect-ratio: 420/520;
  border-radius: 14px; overflow: hidden;
  background: var(--grad-sea);
  box-shadow: inset 0 0 40px rgba(2, 132, 199, .25), var(--shadow-md);
  transition: box-shadow .4s var(--ease);
}
/* 顶部辉光 */
.avatar::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(120% 85% at 72% 6%, rgba(56, 189, 248, .42), transparent 62%),
    radial-gradient(90% 60% at 18% 95%, rgba(34, 211, 238, .18), transparent 65%);
  pointer-events: none;
}
/* 波光层 */
.avatar-wave {
  position: absolute; left: 0; width: 200%; bottom: 0; height: 46px;
  pointer-events: none; z-index: 1;
  animation: waveDrift 9s linear infinite;
}
.avatar-wave.w2 {
  height: 40px; bottom: -4px; opacity: .8;
  animation-duration: 13s; animation-direction: reverse;
}
@keyframes waveDrift { to { transform: translateX(-50%); } }

/* 悬浮粒子 */
.avatar .p { position: absolute; border-radius: 50%; background: #7dd3fc; z-index: 1; animation: floaty 6s ease-in-out infinite; }
.avatar .p1 { width: 6px; height: 6px; left: 18%; top: 24%; opacity: .7; }
.avatar .p2 { width: 4px; height: 4px; left: 76%; top: 34%; opacity: .5; animation-delay: 1.4s; }
.avatar .p3 { width: 5px; height: 5px; left: 30%; top: 62%; opacity: .45; animation-delay: 2.6s; }
.avatar .p4 { width: 3px; height: 3px; left: 62%; top: 70%; opacity: .6; animation-delay: 3.8s; }
@keyframes floaty {
  0%, 100% { transform: translateY(0); opacity: .3; }
  50% { transform: translateY(-16px); opacity: .85; }
}

/* 说话时的光环 */
.avatar.speaking { box-shadow: inset 0 0 40px rgba(2,132,199,.25), 0 0 0 5px rgba(34, 211, 238, .28), var(--shadow-md); }

#svgAvatar { position: absolute; inset: 0; z-index: 2; }
#live2dCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: none; z-index: 3; }

/* 加载占位形象（品牌化：玻璃圆盘 + 螺线 + 呼吸环） */
.avatar-fallback {
  height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 18px; color: #e0f2fe; z-index: 2;
}
.avatar-illo { width: 150px; height: 150px; position: relative; }
.avatar-illo svg { width: 100%; height: 100%; display: block; }
.avatar-illo .r { animation: ringPulse 2.8s var(--ease) infinite; transform-origin: 100px 100px; }
.avatar-illo .r2 { animation-delay: .6s; }
@keyframes ringPulse {
  0%, 100% { opacity: .35; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}
.avatar-illo .spiral { animation: spiralGlow 3s ease-in-out infinite; }
@keyframes spiralGlow {
  0%, 100% { opacity: .75; }
  50% { opacity: 1; }
}
.avatar-loading {
  font-size: 13px; letter-spacing: 1px;
  padding: 5px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(4px);
}

.avatar-meta { text-align: center; margin-top: 14px; }
.name-row { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 18px; font-weight: 700; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #22c55e; animation: pulse 1.6s infinite; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
.status { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* 实时接待面板（销售阶段 + 客户画像标签） */
.reception { margin-top: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(125, 211, 252, .22); border-radius: 12px; padding: 10px 12px; text-align: left; }
.recp-row { display: flex; align-items: center; gap: 8px; }
.recp-label { font-size: 11px; color: var(--muted); letter-spacing: .5px; flex: none; }
.recp-stage { font-size: 12px; font-weight: 700; color: #7dd3fc; background: rgba(56, 189, 248, .14); border: 1px solid rgba(125, 211, 252, .35); padding: 2px 10px; border-radius: 99px; }
.recp-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.recp-tag { font-size: 11px; color: var(--text); background: rgba(255, 255, 255, .09); border-radius: 6px; padding: 2px 8px; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 快捷提问 */
.quick-tags { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text);
  border-radius: 999px; padding: 7px 13px; font-size: 13px; cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.tag .ic { width: 15px; height: 15px; color: var(--brand-600); }
.tag:hover { border-color: var(--brand-400); color: var(--brand-700); background: var(--brand-50); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.tag.video-tag {
  background: var(--grad-brand); color: #fff; border: none;
  box-shadow: 0 6px 14px rgba(2, 132, 199, .35);
}
.tag.video-tag .ic { color: #fff; }
.tag.video-tag:hover { box-shadow: 0 8px 18px rgba(2, 132, 199, .45); transform: translateY(-1px); }

/* ==================== 右侧对话 ==================== */
.chat-panel {
  background: var(--card); border-radius: var(--radius);
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-md); border: 1px solid var(--border); min-height: 0;
}
.messages { flex: 1; overflow-y: auto; padding: 22px; }

.msg { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; align-items: flex-start; animation: msgIn .28s var(--ease); }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.msg-avatar {
  width: 32px; height: 32px; border-radius: 10px; flex: none;
  background: var(--grad-brand);
  box-shadow: 0 4px 10px rgba(2, 132, 199, .35);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.msg-avatar .ic { width: 17px; height: 17px; }
.msg .bubble {
  max-width: 72%; padding: 12px 16px; border-radius: 14px;
  line-height: 1.65; font-size: 15px; white-space: pre-wrap; word-break: break-word;
  box-shadow: var(--shadow-sm);
}
.msg.user { justify-content: flex-end; }
.msg.user .bubble {
  background: var(--grad-brand); color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 6px 16px rgba(2, 132, 199, .28);
}
.msg.assistant { justify-content: flex-start; }
.msg.assistant .bubble { background: var(--bg-soft); color: var(--text); border-bottom-left-radius: 4px; border: 1px solid var(--border); }
.msg .meta {
  font-size: 11px; color: var(--muted); margin-top: 6px;
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
}
.msg .meta .ic { width: 12px; height: 12px; color: var(--brand-600); }

/* “思考中”打字指示动画 */
.typing { display: flex; align-items: center; gap: 5px; padding: 2px 0; }
.typing-text { color: var(--muted); font-size: 14px; }
.typing .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #9ca3af; display: inline-block;
  animation: typingBounce 1.2s infinite ease-in-out;
}
.typing .dot:nth-child(2) { animation-delay: .15s; }
.typing .dot:nth-child(3) { animation-delay: .3s; }
.typing .dot:nth-child(4) { animation-delay: .45s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* 推荐追问 chips */
.chips { padding: 0 22px 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--brand-300); color: var(--brand-700); background: var(--brand-50);
  border-radius: 999px; padding: 6px 13px; font-size: 13px; cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.chip .ic { width: 13px; height: 13px; }
.chip:hover { background: var(--grad-brand); color: #fff; border-color: transparent; box-shadow: 0 6px 14px rgba(2,132,199,.3); transform: translateY(-1px); }

/* 输入栏 */
.input-bar { display: flex; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); align-items: center; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border);
  background: #fff; cursor: pointer; font-size: 20px;
  display: inline-flex; align-items: center; justify-content: center; color: var(--muted);
  transition: all var(--dur) var(--ease);
}
.icon-btn .ic { width: 19px; height: 19px; }
.icon-btn:hover { border-color: var(--brand-400); color: var(--brand-600); background: var(--brand-50); transform: translateY(-1px); }
.icon-btn.recording { background: #fee2e2; border-color: var(--danger); color: var(--danger); animation: recordPulse 1.2s ease-in-out infinite; }
@keyframes recordPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.35); } 50% { box-shadow: 0 0 0 5px rgba(239,68,68,0); } }

.input-bar input {
  flex: 1; height: 44px; border: 1px solid var(--border); border-radius: 12px;
  padding: 0 16px; font-size: 15px; outline: none; background: var(--bg-soft);
  font-family: inherit; transition: all var(--dur) var(--ease);
}
.input-bar input:focus { border-color: var(--brand-400); background: #fff; box-shadow: 0 0 0 3px rgba(14, 165, 233, .14); }
.input-bar input::placeholder { color: #9aa7b8; }
.send-btn {
  height: 44px; padding: 0 22px; border: none; border-radius: 12px;
  background: var(--grad-brand); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  box-shadow: 0 6px 14px rgba(2, 132, 199, .32);
  transition: all var(--dur) var(--ease);
}
.send-btn .ic { width: 16px; height: 16px; }
.send-btn:hover { box-shadow: 0 8px 20px rgba(2, 132, 199, .45); transform: translateY(-1px); }
.send-btn:active { transform: translateY(1px); box-shadow: none; }
.handoff-btn {
  height: 44px; padding: 0 16px; border: 1px solid var(--border); border-radius: 12px;
  background: #fff; color: var(--text); font-size: 14px; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px;
  transition: all var(--dur) var(--ease);
}
.handoff-btn .ic { width: 17px; height: 17px; color: var(--muted); }
.handoff-btn:hover { border-color: var(--brand-400); color: var(--brand-700); background: var(--brand-50); }
.handoff-btn:hover .ic { color: var(--brand-600); }

.footnote { text-align: center; color: var(--muted); font-size: 12px; padding: 10px 0 16px; }
.footnote a { color: var(--brand-600); }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; overflow-y: auto; }
  .avatar { max-width: 180px; }
}

/* ==================== 场景化演示 ==================== */
.scenario-box { padding: 0 22px 12px; display: flex; flex-direction: column; gap: 8px; }
.scenario-card {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border); border-left: 4px solid var(--brand-500);
  border-radius: 12px; padding: 10px 12px; background: var(--bg-soft);
  transition: all var(--dur) var(--ease);
}
.scenario-card:hover { background: #fff; box-shadow: var(--shadow-sm); transform: translateX(2px); }
.sc-icon {
  width: 40px; height: 40px; border-radius: 11px; flex: none;
  background: linear-gradient(135deg, var(--brand-50), var(--brand-100));
  display: flex; align-items: center; justify-content: center;
  color: var(--brand-600); font-size: 26px;
}
.sc-icon .ic { width: 21px; height: 21px; }
.sc-body { flex: 1; min-width: 0; }
.sc-name { font-size: 14px; font-weight: 600; }
.sc-scene { font-size: 12px; color: var(--muted); margin-top: 2px; }
.sc-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--brand-300); background: var(--brand-50); color: var(--brand-700);
  border-radius: 9px; padding: 7px 12px; font-size: 13px; cursor: pointer; white-space: nowrap;
  transition: all var(--dur) var(--ease);
}
.sc-btn .ic { width: 13px; height: 13px; }
.sc-btn:hover { background: var(--grad-brand); color: #fff; border-color: transparent; }

/* ==================== 场景化演示弹窗 ==================== */
.demo-modal {
  position: fixed; inset: 0; background: rgba(11, 22, 38, .55);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
  backdrop-filter: blur(3px);
}
.demo-modal.open { display: flex; }
.demo-modal.open .demo-card { animation: modalIn .26s var(--ease); }
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
.demo-card {
  width: 100%; max-width: 460px; max-height: 86vh; overflow-y: auto;
  background: #fff; border-radius: 18px; padding: 22px;
  box-shadow: var(--shadow-lg);
}
.demo-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.demo-title {
  font-size: 18px; font-weight: 700;
  display: flex; align-items: center; gap: 9px; color: var(--text);
}
.demo-title .ic { width: 20px; height: 20px; color: var(--brand-600); }
.demo-close {
  border: none; background: var(--bg-soft); width: 32px; height: 32px;
  border-radius: 9px; cursor: pointer; font-size: 16px; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  transition: all var(--dur) var(--ease);
}
.demo-close .ic { width: 15px; height: 15px; }
.demo-close:hover { background: #fee2e2; color: var(--danger); transform: rotate(90deg); }
.demo-content { font-size: 14px; line-height: 1.7; }
.demo-line { margin-bottom: 10px; color: var(--text); }
.demo-section { margin: 14px 0 6px; }
.demo-section h4 {
  font-size: 13px; color: var(--brand-700); margin-bottom: 6px;
  display: flex; align-items: center; gap: 6px;
}
.demo-section h4::before { content: ""; width: 3px; height: 13px; border-radius: 2px; background: var(--grad-brand); }
.demo-section ul { padding-left: 18px; }
.demo-section li { margin-bottom: 4px; }

/* 流程步骤动画 */
.demo-flow { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.flow-step {
  opacity: .35; transition: opacity .4s, transform .4s;
  padding: 8px 10px; border-radius: 8px; background: var(--bg-soft); font-size: 13px;
}
.flow-step.active { opacity: 1; background: var(--brand-50); transform: translateX(4px); border-left: 3px solid var(--brand-500); }

/* 讲解联动：数据可视化图表（随流程步骤同步高亮） */
.demo-charts { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.demo-chart {
  border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px;
  background: var(--bg-soft); transition: all var(--dur) var(--ease);
}
.demo-chart.active {
  border-color: var(--brand-400); background: #fff;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, .14);
}
.demo-chart h5 { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.demo-chart h5::before { content: ""; width: 3px; height: 11px; border-radius: 2px; background: var(--grad-brand); }
.demo-chart .c { height: 140px; }

/* ==================== 企业宣传片弹窗 ==================== */
.video-card { max-width: 760px; }
.video-card video { width: 100%; border-radius: 12px; background: #000; display: block; }

/* ==================== 场景图文讲解 ==================== */
.demo-slides { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
.demo-slide-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--bg-soft); transition: box-shadow var(--dur) var(--ease); }
.demo-slide-card:hover { box-shadow: var(--shadow-sm); }
.demo-slide-title { font-weight: 600; margin-bottom: 6px; color: var(--text); }
.demo-slide-points { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 0 0 8px; padding-left: 0; list-style: none; }
.demo-slide-points li { margin-bottom: 2px; }
.demo-slide-imgs { display: flex; flex-wrap: wrap; gap: 8px; }
.demo-slide-imgs img {
  width: 220px; height: 140px; object-fit: cover; border-radius: 9px;
  border: 1px solid var(--border); cursor: zoom-in; background: var(--bg-soft);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.demo-slide-imgs img:hover { transform: scale(1.02); box-shadow: var(--shadow-md); }

/* ==================== 扫码带走 ==================== */
.take-card { max-width: 340px; text-align: center; }
.take-qr {
  width: 224px; height: 224px; margin: 14px auto;
  padding: 10px; background: #fff; border: 1px solid var(--border);
  border-radius: 18px; box-shadow: var(--shadow-md);
}
.take-qr img { width: 100%; height: 100%; display: block; }
.take-hint { font-size: 12px; color: var(--muted); }
.take-error { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 18px; }

/* ==================== 留资表单 ==================== */
.lead-card { max-width: 380px; }
.lead-fields { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 14px; }
.lead-input {
  width: 100%; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; font-size: 14px; outline: none; background: var(--bg-soft);
  font-family: inherit; transition: all var(--dur) var(--ease);
}
.lead-input:focus { border-color: var(--brand-400); background: #fff; box-shadow: 0 0 0 3px rgba(14, 165, 233, .14); }
.lead-input::placeholder { color: #9aa7b8; }
textarea.lead-input { resize: none; }
.lead-section { margin: 2px 0 14px; }
.lead-label { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.lead-products { display: flex; flex-wrap: wrap; gap: 8px; }
.lead-product {
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.lead-product:hover { border-color: var(--brand-400); }
.lead-product.active { background: var(--grad-brand); color: #fff; border-color: transparent; box-shadow: 0 4px 10px rgba(2,132,199,.3); }
.lead-submit {
  width: 100%; height: 44px; border: none; border-radius: 12px;
  background: var(--grad-brand); color: #fff; font-size: 15px; font-weight: 600;
  cursor: pointer; box-shadow: 0 6px 16px rgba(2, 132, 199, .32);
  transition: all var(--dur) var(--ease);
}
.lead-submit:hover { box-shadow: 0 8px 22px rgba(2, 132, 199, .45); transform: translateY(-1px); }
.lead-submit:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.lead-error { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 18px; }
.lead-ok {
  width: 56px; height: 56px; margin: 6px auto 12px; border-radius: 50%;
  background: #dcfce7; color: var(--success);
  display: flex; align-items: center; justify-content: center;
  animation: msgIn .3s var(--ease);
}
.lead-ok .ic { width: 30px; height: 30px; }

/* ============ 场景弹窗 · 仿真孪生内嵌 ============ */
.twin-tag {
  display: inline-block; vertical-align: middle; margin-left: 6px;
  font-size: 10px; font-weight: 600; letter-spacing: .5px; color: var(--brand-400);
  border: 1px solid var(--brand-300); border-radius: 99px; padding: 1px 8px;
}
.twin-host {
  position: relative; width: 100%; height: 252px; margin-top: 10px;
  border-radius: 12px; overflow: hidden; background: #070d1d;
  border: 1px solid rgba(56, 189, 248, .25);
  box-shadow: inset 0 0 0 1px rgba(125, 211, 252, .06), inset 0 0 44px rgba(2, 30, 66, .55);
}
.twin-host::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  border-radius: inherit;
  background: radial-gradient(120% 90% at 50% 8%, transparent 55%, rgba(2, 12, 28, .38) 100%);
}
.twin-host canvas { border-radius: 12px; }
.twin-host .twin-toast { font-family: var(--font-sans); }
@media (max-width: 480px) { .twin-host { height: 210px; } }

/* ============ 回答溯源动效（知识库检索命中可视化） ============ */
.msg .trace { flex: 0 0 100%; margin-top: 5px; }
.trace-head {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: 11px; color: var(--brand-700); font-family: inherit;
  background: #e9f7ff; border: 1px solid #bde4f9; border-radius: 999px;
  padding: 4px 11px; transition: all var(--dur) var(--ease);
}
.trace-head:hover { background: #dcf1ff; }
.trace-head .ic { width: 12px; height: 12px; }
.trace-head .caret { width: 10px; height: 10px; transition: transform .2s var(--ease); }
.trace.open .trace-head .caret { transform: rotate(180deg); }
.trace-body {
  display: none; margin-top: 6px; max-width: 72%;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-left: 3px solid var(--brand-400); border-radius: 10px;
  padding: 4px 12px; box-shadow: var(--shadow-sm);
}
.trace.open .trace-body { display: block; }
.trace-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; color: var(--text); padding: 5px 0;
  border-bottom: 1px dashed var(--border); opacity: 0;
}
.trace-row:last-child { border-bottom: none; }
.trace.open .trace-row {
  animation: traceIn .38s var(--ease) forwards;
  animation-delay: calc((var(--i, 0) + 1) * 110ms);
}
@keyframes traceIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.trace-row .tdot {
  width: 6px; height: 6px; flex: none; border-radius: 50%;
  background: var(--brand-400); box-shadow: 0 0 6px rgba(14, 165, 233, .7);
}
.trace-row .tsrc {
  flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text);
}
.trace-row .tsc { flex: none; font-size: 10.5px; color: var(--brand-600); font-weight: 600; white-space: nowrap; }

/* ============ 语音电平 VU + 体感迎宾 ============ */
.input-bar { position: relative; }
.vu { position: absolute; left: 46px; right: 96px; bottom: calc(100% + 8px);
  display: flex; align-items: center; gap: 10px; background: #fff;
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-md);
  padding: 9px 14px; font-size: 12.5px; color: var(--brand-700); z-index: 6; }
.vu[hidden] { display: none; }
.vu-l { flex: none; color: var(--muted); }
.vu-bars { display: flex; align-items: center; gap: 3px; flex: 1; height: 24px; }
.vu-bars i { flex: 1; min-width: 2px; height: 100%; border-radius: 3px;
  background: linear-gradient(180deg, #22d3ee, #0ea5e9);
  transform-origin: bottom; transform: scaleY(0.06); transition: transform 0.05s linear; }
.wake-row { display: flex; align-items: center; gap: 9px; margin-top: 11px; }
.wake-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--brand-700);
  background: #eef7ff; border: 1px solid #bcdff5; border-radius: 999px; padding: 5px 12px;
  cursor: pointer; font-family: inherit; transition: all var(--dur) var(--ease); }
.wake-btn:hover { background: #e0f2ff; }
.wake-btn .ic { width: 13px; height: 13px; }
.wake-btn.on { background: var(--grad-brand); color: #fff; border-color: transparent;
  box-shadow: 0 4px 12px rgba(2, 132, 199, .3); }
.wake-state { font-size: 11px; color: var(--muted); }
.wake-state.on { color: var(--success); }
.wake-state.bad { color: var(--danger); }
.wake-state.ok { color: var(--brand-600); }
.wake-state.off { color: var(--muted); }
.avatar.wake-hot { animation: wakeGlow 1.2s ease-in-out infinite; }
@keyframes wakeGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0); }
  50% { box-shadow: 0 0 0 7px rgba(14, 165, 233, .3); }
}

/* 无障碍：减少动效 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ============ 播报音色（多语言） ============ */
.voice-row { display: flex; align-items: center; gap: 7px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.voice-row .ic { width: 14px; height: 14px; color: var(--brand-500); flex: none; }
.voice-row label { flex: none; }
.voice-row select { flex: 1; min-width: 0; font-family: inherit; font-size: 12px; color: var(--text);
  background: #f6fbff; border: 1px solid var(--border); border-radius: 8px; padding: 4px 6px; outline: none; }
.voice-row select:focus { border-color: var(--brand-400); }
