/* 非首屏关键样式：灯箱 / 返回顶部 / 搜索历史。
   由 layout.js 以 media=print + onload 异步加载，不阻塞首屏渲染；
   noscript 环境下回退为同步加载。改动需与 site.css 保持同步。 */

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; background: rgba(10,18,30,.94); z-index: 200; display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lb-stage { display: flex; align-items: center; justify-content: center; width: 92vw; height: 84vh; overflow: auto; cursor: zoom-out; }
.lb-stage img { max-width: 92vw; max-height: 84vh; object-fit: contain; transition: transform .18s ease; }
.lb-stage.zoomed { cursor: zoom-in; }
.lb-stage.zoomed img { max-width: none; max-height: none; width: auto; height: auto; transform: scale(1.6); transform-origin: center; }
.lb-close, .lb-prev, .lb-next { position: absolute; background: rgba(255,255,255,.12); border: 0; color: #fff; cursor: pointer; }
.lb-close { top: 18px; right: 22px; width: 42px; height: 42px; border-radius: 50%; font-size: 26px; line-height: 1; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; font-size: 30px; line-height: 1; }
.lb-prev { left: 18px; } .lb-next { right: 18px; }
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,.24); }
.lb-bar {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px; padding: 8px 16px;
  background: rgba(255,255,255,.1); border-radius: 999px; color: rgba(255,255,255,.85); font-size: 13px;
}
.lb-count { font-variant-numeric: tabular-nums; }
.lb-tools { display: flex; gap: 8px; }
.lb-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.16); color: #fff; font-size: 16px; cursor: pointer; text-decoration: none;
}
.lb-btn:hover { background: rgba(255,255,255,.3); }
.lb-hint { opacity: .65; font-size: 12px; }
@media (max-width: 720px) {
  .lb-hint { display: none; }
  .lb-bar { gap: 10px; padding: 6px 12px; }
}

/* ---------- 返回顶部 ---------- */
.back-top {
  position: fixed; right: 22px; bottom: 32px; z-index: 55;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: var(--navy, #1a365d); color: #fff; font-size: 20px; line-height: 1;
  cursor: pointer; box-shadow: 0 6px 18px rgba(16, 28, 46, .28);
  opacity: .92; transition: opacity .2s, transform .2s, background .2s;
}
.back-top:hover { opacity: 1; transform: translateY(-2px); background: #22467c; }
.back-top[hidden] { display: none; }
/* 移动端：抬到底栏(58px)与 AI 悬浮条(70px+约46px)之上，避免三层互相遮挡 */
@media (max-width: 720px) { .back-top { right: 14px; bottom: 128px; width: 40px; height: 40px; } }

/* ---- 搜索历史 ---- */
.search-history { margin-top: 26px; }
.search-history[hidden] { display: none; }
.sh-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.sh-head b { font-size: 14px; color: var(--navy, #1a365d); }
.sh-head button {
  border: 0; background: none; color: #7a8798; font-size: 12.5px; cursor: pointer; text-decoration: underline;
}
.sh-head button:hover { color: #c0392b; }
.sh-list { display: flex; flex-wrap: wrap; gap: 8px; }
.sh-chip {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line, #e3e8ef);
  background: #fff; color: var(--body, #2a3442); font-size: 13px; cursor: pointer; transition: all .2s;
}
.sh-chip:hover { border-color: var(--navy, #1a365d); color: var(--navy, #1a365d); background: #f6f9fc; }

/* ================= AI 选材助手 =================
   浮动入口位于右下角（back-top 32px / 咨询浮窗 88px 之上，互不遮挡）；
   移动端隐藏浮动入口，由搜索页内联入口与移动底部栏承担。 */

/* 浮动入口：图标 + 文字标签（材质对比 / 价格咨询），更醒目 */
.ai-fab {
  position: fixed; right: 22px; bottom: 96px;
  /* 低于面板(80)与页头(60)，避免悬浮球被页头或对话面板压住 */
  z-index: 55;
  display: flex; align-items: center; gap: 9px;
  padding: 9px 16px 9px 12px; border: 0; border-radius: 40px;
  background: linear-gradient(135deg, #1a365d 0%, #2c5282 62%, #3f6fb5 100%);
  color: #fff; cursor: pointer;
  box-shadow: 0 10px 26px rgba(26, 54, 93, .38);
  transition: transform .18s ease, box-shadow .18s ease;
}
.ai-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(26, 54, 93, .48); }
.ai-fab.is-open { background: linear-gradient(135deg, #22467c, #22467c); }
.ai-fab-icon { display: flex; flex: none; }
.ai-fab-icon svg { width: 26px; height: 26px; }
.ai-fab-text {
  display: flex; flex-direction: column; line-height: 1.25; text-align: left;
}
.ai-fab-text b { font-size: 13.5px; font-weight: 700; letter-spacing: .3px; }
.ai-fab-text em {
  font-style: normal; font-size: 11.5px; opacity: .88;
  border-top: 1px solid rgba(255, 255, 255, .28); margin-top: 2px; padding-top: 2px;
}
.ai-fab:focus-visible, .ai-send:focus-visible, .ai-close:focus-visible,
.ai-chip:focus-visible, .ai-follow-chip:focus-visible, .ai-open-btn:focus-visible {
  outline: 2px solid var(--gold, #c9a961); outline-offset: 2px;
}

.ai-panel {
  position: fixed; right: 16px; bottom: 180px;
  /* 层级要高于页头(60)与移动端底栏(70)：面板是浮层，
     聊多轮后面板变高，顶部标题栏（含关闭按钮）不能被页头盖住——
     手机上没有 Esc 键，一旦被盖住就关不掉了。 */
  z-index: 80;
  /* 默认宽度＝页面的一半（50vw）：左半屏让给官网内容，右半屏放对话。
     四边与四角都带缩放手柄，用户可自行拉大或拉小。 */
  width: 50vw; max-width: calc(100vw - 32px);
  max-height: min(820px, calc(100vh - 210px));
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line, #e2e8f0); border-radius: 14px;
  box-shadow: 0 18px 50px rgba(16, 28, 46, .22);
  overflow: hidden;
  /* 弹出动画：从缩放原点（JS 每次打开时把原点设为悬浮按钮中心）放大弹出，
     让用户清楚看到面板「从哪儿弹出来」；带轻微回弹更有弹性感。
     动画用独立的 .is-opening 类触发（只在打开时加一次）——
     如果把 animation 直接挂在 .ai-panel 上，拖拽时 is-dragging 的
     animation:none 会让动画在松手瞬间重播，面板会突然缩放一下。 */
  transform-origin: calc(100% - 60px) 100%;
}
.ai-panel.is-opening { animation: aiPopFromFab .42s cubic-bezier(.34, 1.56, .64, 1); }
.ai-panel[hidden] { display: none; }
@keyframes aiPopFromFab {
  from { opacity: 0; transform: scale(.2); }
    to { opacity: 1; transform: scale(1); }
}

/* 拖动/缩放进行中：禁用文字选中与过渡，避免抖动 */
.ai-panel.is-dragging { user-select: none; transition: none !important; }
/* 用户拖动后改为 left/top 定位（JS 负责切换 right/bottom → left/top）
   注意：不能移除 max-height，否则 .ai-msgs 的 flex:1 会把面板撑到内容全高。
   改为用一个足够大的上限，实际高度由 JS 显式设置。 */
.ai-panel.is-positioned { right: auto; bottom: auto; max-width: none; max-height: calc(100vh - 24px); }

.ai-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--line, #e2e8f0);
  background: linear-gradient(180deg, #f7f9fd, #fff);
  cursor: move; user-select: none; touch-action: none;
}
.ai-head-text { display: flex; flex-direction: column; line-height: 1.35; flex: 1; min-width: 0; }
.ai-head-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.ai-title { font-size: 14.5px; color: var(--navy, #1a365d); }
.ai-subtitle { font-size: 11.5px; color: var(--muted, #718096); }
.ai-close {
  border: 0; background: none; font-size: 20px; line-height: 1; cursor: pointer;
  color: #7a8798; padding: 4px 8px; border-radius: 8px;
}
.ai-close:hover { color: var(--navy, #1a365d); background: #eef2f8; }

/* 回答模式切换：材料咨询 / 价格咨询 —— 两个按钮需醒目易点 */
.ai-modes {
  display: flex; gap: 8px; padding: 10px 12px 0;
  border-bottom: 1px solid var(--line, #e2e8f0);
  background: #fff;
}
.ai-mode {
  flex: 1; border: 2px solid #c3cede; background: #f4f7fc;
  border-radius: 9px; padding: 9px 8px; cursor: pointer;
  font-size: 13.5px; font-weight: 600; color: #40506a;
  transition: border-color .15s, color .15s, background .15s, box-shadow .15s;
  white-space: nowrap; letter-spacing: .3px;
}
.ai-mode:hover { border-color: #8ea6c8; color: var(--navy, #1a365d); background: #eaf0fa; }
.ai-mode:focus-visible { outline: 3px solid #c9a961; outline-offset: 2px; }
.ai-mode.is-on {
  border-color: var(--navy, #1a365d); color: #fff;
  background: linear-gradient(135deg, #1a365d, #2c5282);
  box-shadow: 0 3px 10px rgba(26, 54, 93, .28);
}
.ai-mode.is-on:hover { color: #fff; background: linear-gradient(135deg, #22467c, #2c5282); }
.ai-mode-note {
  padding: 7px 13px 0; font-size: 11.5px; line-height: 1.55;
  color: #6b7a90; background: #fff;
}

/* 右下角缩放手柄（带「拖动缩放」文字标注） */
/* ---- 八向缩放手柄：上 / 下 / 左 / 右四条边 + 四个角 ----
   说明：面板是 overflow:hidden（圆角裁切内容），手柄必须贴着面板内侧，
   否则会被裁掉一半。命中区做到 10px，足够好点。 */
.ai-rz { position: absolute; z-index: 3; touch-action: none; }
.ai-rz-n { top: 0; left: 14px; right: 14px; height: 10px; cursor: ns-resize; }
.ai-rz-s { bottom: 0; left: 14px; right: 14px; height: 10px; cursor: ns-resize; }
.ai-rz-w { left: 0; top: 14px; bottom: 14px; width: 10px; cursor: ew-resize; }
.ai-rz-e { right: 0; top: 14px; bottom: 14px; width: 10px; cursor: ew-resize; }
.ai-rz-nw { left: 0; top: 0; width: 16px; height: 16px; cursor: nwse-resize; }
.ai-rz-ne { right: 0; top: 0; width: 16px; height: 16px; cursor: nesw-resize; }
.ai-rz-sw { left: 0; bottom: 0; width: 16px; height: 16px; cursor: nesw-resize; }
.ai-rz-se { right: 0; bottom: 0; width: 16px; height: 16px; cursor: nwse-resize; }

/* 手柄的可视提示：平时只有很淡的边线，鼠标靠近才明显 */
.ai-rz-n::after, .ai-rz-s::after,
.ai-rz-w::after, .ai-rz-e::after {
  content: ""; position: absolute; background: transparent;
  transition: background .15s;
}
.ai-rz-n::after { left: 0; right: 0; top: 0; height: 2px; }
.ai-rz-s::after { left: 0; right: 0; bottom: 0; height: 2px; }
.ai-rz-w::after { top: 0; bottom: 0; left: 0; width: 2px; }
.ai-rz-e::after { top: 0; bottom: 0; right: 0; width: 2px; }
.ai-panel:hover .ai-rz-n::after, .ai-panel:hover .ai-rz-s::after,
.ai-panel:hover .ai-rz-w::after, .ai-panel:hover .ai-rz-e::after { background: #c6d2e2; }
.ai-rz-nw::after, .ai-rz-ne::after, .ai-rz-sw::after, .ai-rz-se::after {
  content: ""; position: absolute; width: 11px; height: 11px;
  opacity: .5; transition: opacity .15s;
}
.ai-rz-nw::after { left: 3px; top: 3px; background: linear-gradient(135deg, #b7c3d4 50%, transparent 50%); }
.ai-rz-ne::after { right: 3px; top: 3px; background: linear-gradient(225deg, #b7c3d4 50%, transparent 50%); }
.ai-rz-sw::after { left: 3px; bottom: 3px; background: linear-gradient(45deg, #b7c3d4 50%, transparent 50%); }
.ai-rz-se::after { right: 3px; bottom: 3px; background: linear-gradient(315deg, #b7c3d4 50%, transparent 50%); }
.ai-panel:hover .ai-rz-nw::after, .ai-panel:hover .ai-rz-ne::after,
.ai-panel:hover .ai-rz-sw::after, .ai-panel:hover .ai-rz-se::after { opacity: 1; }

/* 右下角保留旧的「拖动缩放」文字提示 */
.ai-resize {
  position: absolute; right: 0; bottom: 0; width: 74px; height: 22px;
  cursor: nwse-resize; touch-action: none; z-index: 2;
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 5px;
  background: linear-gradient(135deg, transparent 58%, #b7c3d4 58%, #b7c3d4 68%, transparent 68%);
  opacity: .85;
}
.ai-resize:hover { opacity: 1; }
.ai-resize-tip {
  font-size: 10.5px; line-height: 1; color: #8a97a8;
  background: #fff; padding: 2px 3px; border-radius: 3px;
  pointer-events: none; white-space: nowrap;
}
.ai-resize:hover .ai-resize-tip { color: var(--navy, #1a365d); }

.ai-msgs {
  flex: 1; overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
  background: #fbfcfe; overscroll-behavior: contain;
}
.ai-msg {
  max-width: 100%; padding: 11px 14px; border-radius: 12px;
  font-size: 15px; line-height: 1.72; word-break: break-word;
}
.ai-msg.ai-user {
  align-self: flex-end; background: var(--navy, #1a365d); color: #fff;
  border-bottom-right-radius: 4px; white-space: pre-wrap;
}
.ai-msg.ai-bot {
  align-self: flex-start; background: #fff; border: 1px solid var(--line, #e2e8f0);
  color: var(--body, #2d3748); border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(26, 54, 93, .06);
}
.ai-msg-title { display: block; font-size: 13.5px; color: var(--navy, #1a365d); margin-bottom: 4px; }
.ai-para { margin: 0 0 6px; white-space: pre-wrap; }
.ai-para:last-child { margin-bottom: 0; }
.ai-note {
  margin: 6px 0 0; padding: 7px 10px; border-radius: 8px;
  background: #fff8ec; color: #92600a; font-size: 12.5px;
}
/* 价格免责声明：加大加粗、醒目底色，确保客户看到 */
.ai-note-blue {
  margin: 8px 0 2px; padding: 11px 14px; border-radius: 10px;
  background: #eef4ff; border: 1px solid #bcd3f7; border-left: 5px solid #1a56c4;
  color: #10357f; font-size: 15px; line-height: 1.85; font-weight: 700;
}
.ai-note-blue + .ai-note-blue { margin-top: 4px; }
.ai-note-blue::before { content: "💡 提示 "; color: #1a56c4; font-weight: 800; }

/* 特别标记提醒：不同颜色区分不同含义（蓝=普通提示 / 橙=需额外加价 / 绿=已含不需加价） */
.ai-note-mark {
  margin: 8px 0 2px; padding: 11px 14px; border-radius: 10px;
  font-size: 14.5px; line-height: 1.8; font-weight: 700;
  border: 1px solid; border-left-width: 5px;
}
/* 橙：含工艺 / 需额外加价的项目 */
.ai-note-mark.ai-mark-craft {
  background: #fff4e6; border-color: #f3c489; border-left-color: #d97706;
  color: #8a4400;
}
.ai-note-mark.ai-mark-craft::before { content: "⚡ 加价项 "; color: #b45309; font-weight: 800; }
/* 绿：已包含 / 无需额外付费 */
.ai-note-mark.ai-mark-included {
  background: #edf9f0; border-color: #a8dcb8; border-left-color: #16a34a;
  color: #14532d;
}
.ai-note-mark.ai-mark-included::before { content: "✔ 已包含 "; color: #15803d; font-weight: 800; }
/* 红：异常价 / 已剔除的提醒 */
.ai-note-mark.ai-mark-dropped {
  background: #fdeeee; border-color: #f2b8b8; border-left-color: #dc2626;
  color: #8a1c1c;
}
.ai-note-mark.ai-mark-dropped::before { content: "⛔ 已剔除 "; color: #b91c1c; font-weight: 800; }
/* 价格档位表格里的彩色标记单元格 */
.ai-mark-cell {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.ai-mark-cell.craft { background: #fff0d9; color: #a35a00; border: 1px solid #f0c489; }
.ai-mark-cell.plain { background: #eef4ff; color: #1a56c4; border: 1px solid #bcd3f7; }
.ai-mark-cell.special { background: #edf9f0; color: #15803d; border: 1px solid #a8dcb8; }
/* 逐个回答：每个问题一个独立分组，排列整齐 */
.ai-qa {
  margin: 10px 0; border: 1px solid #dbe6f7; border-radius: 10px;
  background: #fbfcff; overflow: hidden;
}
.ai-qa-head {
  padding: 9px 13px; background: #eef4ff; border-bottom: 1px solid #dbe6f7;
  font-size: 14.5px; font-weight: 700; color: #10357f;
}
.ai-qa-body { padding: 11px 13px; }
.ai-qa-body .ai-para:last-child { margin-bottom: 0; }
.ai-list { margin: 4px 0 6px; }
.ai-list-title { display: block; font-size: 13px; color: var(--navy, #1a365d); margin-bottom: 2px; }
.ai-list ul { list-style: none; margin: 0; padding: 0; }
.ai-list li { position: relative; padding-left: 14px; margin: 2px 0; font-size: 13px; }
.ai-list li::before { content: "·"; position: absolute; left: 3px; color: var(--gold, #c9a961); font-weight: 700; }

.ai-tablewrap { overflow-x: auto; margin: 6px 0; -webkit-overflow-scrolling: touch; }
.ai-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.ai-table th, .ai-table td {
  border: 1px solid var(--line, #e2e8f0); padding: 8px 10px; text-align: left; vertical-align: top;
}
.ai-table thead th { background: #eef3f9; color: var(--navy, #1a365d); white-space: nowrap; }
.ai-table .ai-td-key { background: #f6f9fc; color: var(--navy, #1a365d); font-weight: 600; white-space: nowrap; }

/* 相关产品卡片：单列大卡（宽度为原两列布局的 2 倍） */
.ai-prods { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 8px 0 2px; }
.ai-prod {
  display: flex; flex-direction: column; border: 1px solid var(--line, #e2e8f0);
  border-radius: 10px; overflow: hidden; background: #fff; transition: border-color .15s;
}
.ai-prod:hover { border-color: var(--navy, #1a365d); }
.ai-prod img { width: 100%; height: 150px; object-fit: cover; background: #eef2f8; }
.ai-prod-name {
  padding: 9px 12px 0; font-size: 15px; font-weight: 700; color: var(--navy, #1a365d);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ai-prod-brief {
  padding: 3px 12px 11px; font-size: 13.5px; line-height: 1.6; color: var(--muted, #718096);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.ai-follow { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line, #e2e8f0); }
.ai-follow-label { font-size: 12px; color: var(--muted, #718096); }
.ai-follow-chip {
  display: inline-block; margin: 4px 4px 0 0; padding: 4px 10px;
  border: 1px solid #dbe4ef; border-radius: 999px; background: #fff;
  color: var(--navy, #1a365d); font-size: 12px; cursor: pointer; transition: all .15s;
}
.ai-follow-chip:hover { background: var(--navy, #1a365d); color: #fff; border-color: var(--navy, #1a365d); }

.ai-typing { padding: 12px 14px; }
.ai-dots { display: inline-flex; gap: 4px; }
.ai-dots i {
  width: 6px; height: 6px; border-radius: 50%; background: #9aa7b8;
  animation: aiDot 1.1s infinite ease-in-out;
}
.ai-dots i:nth-child(2) { animation-delay: .18s; }
.ai-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes aiDot { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.ai-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 10px 14px 4px; border-top: 1px solid var(--line, #e2e8f0); background: #fff;
}
.ai-chip {
  padding: 6px 12px; min-height: 30px; border: 1px solid #dbe4ef; border-radius: 999px;
  background: #fff; color: var(--navy, #1a365d); font-size: 12.5px; cursor: pointer; transition: all .15s;
}
.ai-chip:hover { background: var(--navy, #1a365d); color: #fff; border-color: var(--navy, #1a365d); }

.ai-inputrow {
  display: flex; gap: 8px; padding: 10px 14px;
  border-top: 1px solid var(--line, #e2e8f0); background: #fff;
}
.ai-input {
  flex: 1; min-width: 0; border: 1px solid var(--line, #e2e8f0); border-radius: 999px;
  padding: 9px 14px; font-size: 13.5px; color: var(--body, #2d3748);
  background: #fff; outline: none; transition: border-color .15s;
}
.ai-input:focus { border-color: var(--navy, #1a365d); box-shadow: 0 0 0 3px rgba(26, 54, 93, .1); }
.ai-send {
  flex: none; width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: var(--navy, #1a365d); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.ai-send:hover { background: #22467c; }
.ai-send:disabled { background: #9aa7b8; cursor: not-allowed; }

.ai-foot {
  padding: 7px 14px 10px; font-size: 11.5px; color: var(--muted, #718096); background: #fff;
}
.ai-foot a { color: var(--navy-2, #2c5282); }
.ai-handover-tip { margin-left: 8px; opacity: .75; }

/* ---- 搜索页内联入口（搜索框旁边） ---- */
.ai-entry {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px;
  margin: -6px 0 24px;
}
.ai-open-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 18px; min-height: 40px; border: 0; border-radius: 999px;
  background: linear-gradient(135deg, #1a365d, #2c5282); color: #fff;
  font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 14px rgba(26, 54, 93, .25); transition: transform .15s, box-shadow .15s;
}
.ai-open-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(26, 54, 93, .35); }
.ai-open-btn svg { flex: none; }
.ai-entry-tip { font-size: 13px; color: var(--muted, #718096); }
.ai-entry-tip b { color: var(--navy, #1a365d); font-weight: 600; }
.ai-quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.ai-quick .ai-chip { background: #f6f9fc; }
.ai-quick-label { font-size: 13px; color: var(--muted, #718096); align-self: center; margin-right: 2px; }

/* ---- 移动端：面板变底部抽屉，AI 入口改为吸底横条（咨询浮窗已移除，不再冲突） ---- */
@media (max-width: 720px) {
  /* 移动端底部有固定底栏（.mobile-bar，高约 58px，z-index 70），
     AI 悬浮按钮与对话面板必须抬到底栏之上，否则会被压住一半。 */
  .ai-fab {
    left: 12px; right: 12px; bottom: 70px; width: auto;
    justify-content: center; gap: 10px; padding: 11px 18px;
    border-radius: 32px;
  }
  .ai-fab-text { flex-direction: row; align-items: center; gap: 8px; }
  .ai-fab-text em { border-top: 0; margin-top: 0; padding-top: 0; }
  .ai-fab-text em::before { content: '·'; margin-right: 8px; opacity: .7; }
  .ai-panel {
    left: 10px; right: 10px; bottom: 70px; width: auto;
    max-height: calc(100vh - 96px); max-width: none;
  }
  /* 移动端也允许拖动标题栏改变位置（用户拖过之后 is-positioned 生效） */
  .ai-panel.is-positioned { left: 10px; right: 10px; width: auto; }
  .ai-mode { font-size: 13px; padding: 8px 6px; }
  .ai-mode-note { font-size: 10.5px; }
  body.ai-chat-open { overflow: hidden; }
  .ai-entry { margin: -4px 0 18px; }
}

/* ---------------- 人工客服接管：消息气泡 + 确认条 ---------------- */
/* 人工回复与 AI 回复视觉上明确区分，客户一眼能看出是人工在答 */
.ai-msg.ai-agent-msg {
  background: #eef6ff;
  border-color: #1a56c4;
  border-left: 3px solid #1a56c4;
}
.ai-msg.ai-agent-msg .ai-msg-title { color: #1a56c4; }

/* 「是否需要人工接管」确认条 */
.ai-handover-prompt {
  margin: 10px 0;
  padding: 12px 14px;
  border: 1px solid #1a56c4;
  border-radius: 10px;
  background: #f2f8ff;
}
.ai-handover-text {
  margin: 0 0 10px;
  font-size: 13.5px;
  line-height: 1.6;
  color: #1a365d;
  font-weight: 700;
}
.ai-handover-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ai-handover-btn {
  appearance: none;
  border: 1px solid #1a56c4;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.ai-handover-yes { background: #1a56c4; color: #fff; }
.ai-handover-yes:hover { background: #15489f; }
.ai-handover-no { background: #fff; color: #1a56c4; }
.ai-handover-no:hover { background: #e6f0ff; }
.ai-handover-btn:disabled { opacity: .55; cursor: default; }

@media (prefers-reduced-motion: reduce) {
  .ai-panel.is-opening { animation: none; }
  .ai-dots i { animation: none; }
  .ai-fab, .ai-open-btn, .ai-chip, .ai-prod, .ai-follow-chip { transition: none; }
}
