/* 沐发咨询 — 站内搜索入口 / 搜索面板 / 顾问助手（从 components.css 拆出，避免 .tag 等全局冲突）
   依赖 style.css 的品牌变量 */
/* 沐发咨询 — 站内搜索 / 智能助手 / 顾问工作台 v1
   与 style.css 共用品牌变量：--ink #0A1420 / --blue #1E5EFF */

/* ================= 导航里的搜索入口 ================= */
.nav-search-btn {
  display: flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 13px 0 11px; margin-left: 10px;
  border: 1px solid rgba(255,255,255,.20); border-radius: 18px;
  background: rgba(255,255,255,.05); color: rgba(255,255,255,.72);
  font-size: 12.5px; font-weight: 500; cursor: pointer; flex-shrink: 0;
  transition: border-color .2s, background .2s, color .2s;
}
.nav-search-btn:hover { border-color: rgba(255,255,255,.45); background: rgba(255,255,255,.11); color: #fff; }
.nav-search-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.nav-search-btn kbd {
  font: inherit; font-size: 10.5px; letter-spacing: .02em;
  padding: 1px 5px; border-radius: 4px;
  background: rgba(255,255,255,.12); color: rgba(255,255,255,.62);
}
@media (max-width: 1180px) { .nav-search-btn kbd { display: none; } }
@media (max-width: 980px) { .nav-search-btn span { display: none; } .nav-search-btn { padding: 0; width: 34px; justify-content: center; } }
@media (max-width: 820px) {
  .nav-search-btn { display: inline-flex; width: 40px; height: 40px; padding: 0; margin-left: 6px; justify-content: center; }
  .nav-search-btn span, .nav-search-btn kbd { display: none; }
}

/* 移动端菜单内的搜索行 */
.m-nav-search {
  display: none; align-items: center; gap: 9px;
  margin: 4px 0 12px; padding: 11px 13px;
  border: 1px solid rgba(255,255,255,.18); border-radius: 9px;
  background: rgba(255,255,255,.05); color: rgba(255,255,255,.65);
  font-size: 13.5px; cursor: pointer; font-family: inherit; text-align: left; width: 100%;
}
.m-nav-search:hover { background: rgba(255,255,255,.1); color: #fff; }
@media (max-width: 820px) { .m-nav-search { display: flex; } }

/* ================= 站内搜索面板 ================= */
.qs { position: fixed; inset: 0; z-index: 600; display: none; }
.qs.open { display: block; }
.qs-bd { position: absolute; inset: 0; background: rgba(6,13,22,.62); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); animation: qsFade .18s ease; }
.qs-panel {
  position: relative; width: min(760px, calc(100% - 28px));
  margin: 11vh auto 0; background: #fff; border-radius: 14px;
  box-shadow: 0 50px 120px -34px rgba(0,0,0,.7); overflow: hidden;
  display: flex; flex-direction: column; max-height: 74vh;
  animation: qsUp .24s var(--ease);
}
.qs-top { display: flex; align-items: center; gap: 13px; padding: 17px 20px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.qs-top > svg { width: 17px; height: 17px; color: var(--text-3); flex-shrink: 0; }
.qs-input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 16.5px; font-weight: 500; color: var(--ink); font-family: inherit; }
.qs-input::placeholder { color: var(--text-3); font-weight: 400; }
.qs-kbd { font-size: 10.5px; color: var(--text-3); border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; flex-shrink: 0; }
.qs-chips { display: flex; gap: 7px; padding: 11px 18px; overflow-x: auto; border-bottom: 1px solid var(--line); background: #FAFBFD; flex-shrink: 0; scrollbar-width: none; }
.qs-chips::-webkit-scrollbar { display: none; }
.qs-chip {
  font-size: 12px; font-weight: 500; white-space: nowrap; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--text-2);
  border-radius: 14px; padding: 5px 12px; transition: all .16s;
}
.qs-chip:hover { border-color: rgba(30,94,255,.34); color: var(--blue); }
.qs-chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.qs-res { overflow-y: auto; padding: 8px; flex: 1; }
.qs-item { display: block; padding: 12px 14px; border-radius: 9px; cursor: pointer; }
.qs-item:hover, .qs-item.on { background: #F2F6FF; }
.qs-g { font-size: 10px; font-weight: 700; letter-spacing: .11em; color: var(--blue); text-transform: uppercase; }
.qs-t { font-size: 14.5px; font-weight: 600; color: var(--ink); margin: 3px 0 4px; line-height: 1.45; }
.qs-d { font-size: 12.5px; color: var(--text-2); line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qs-t mark, .qs-d mark { background: rgba(30,94,255,.15); color: var(--blue-dk); border-radius: 2px; padding: 0 1px; font-weight: 700; }
.qs-hits { font-size: 11px; color: var(--text-3); padding: 10px 20px 6px; flex-shrink: 0; }
.qs-empty { padding: 42px 24px 36px; text-align: center; }
.qs-empty h4 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.qs-empty p { font-size: 12.5px; color: var(--text-2); margin-bottom: 18px; }
.qs-empty .btn { height: 40px; padding: 0 22px; font-size: 13px; }
.qs-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 10px 18px; border-top: 1px solid var(--line); background: #FAFBFD;
  font-size: 11px; color: var(--text-3); flex-shrink: 0;
}
.qs-foot .keys { display: flex; gap: 12px; }
.qs-foot b { font-weight: 600; color: var(--text-2); }
@keyframes qsFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes qsUp { from { opacity: 0; transform: translateY(-10px) scale(.99); } to { opacity: 1; transform: none; } }
@media (max-width: 820px) {
  .qs-panel { margin-top: 6vh; max-height: 82vh; }
  .qs-foot .keys { display: none; }
}

/* ================= 智能助手 ================= */
.bot-btn {
  position: fixed; right: 28px; bottom: 96px; z-index: 190;   /* 抬到 96px，给右下角 Knocket 气泡让位 */
  display: flex; align-items: center; gap: 9px;
  height: 48px; padding: 0 20px 0 15px; border: 0; border-radius: 24px;
  background: var(--ink); color: #fff; font-family: inherit;
  font-size: 13px; font-weight: 600; cursor: pointer;
  box-shadow: 0 16px 40px -14px rgba(10,20,32,.72);
  transition: background .2s, transform .2s var(--ease), box-shadow .2s;
}
.bot-btn:hover { background: var(--blue); transform: translateY(-2px); box-shadow: 0 20px 44px -14px rgba(30,94,255,.6); }
.bot-btn:active { transform: scale(.97); }
.bot-btn svg { width: 19px; height: 19px; flex-shrink: 0; }
.bot-btn .dot { width: 6px; height: 6px; border-radius: 50%; background: #38E08A; box-shadow: 0 0 0 3px rgba(56,224,138,.22); }
.bot-btn.hide { opacity: 0; visibility: hidden; transform: translateY(8px); }

.bot-panel {
  position: fixed; right: 28px; bottom: 84px; z-index: 480;
  width: 388px; height: min(640px, calc(100vh - 132px));
  background: #fff; border-radius: 15px; overflow: hidden;
  box-shadow: 0 44px 100px -32px rgba(6,13,22,.6), 0 0 0 1px rgba(10,20,32,.06);
  display: none; flex-direction: column;
}
.bot-panel.open { display: flex; animation: qsUp .24s var(--ease); }
.bot-head {
  display: flex; align-items: center; gap: 11px; padding: 15px 16px;
  background: linear-gradient(135deg, #0A1420 0%, #12233A 62%, #17304F 100%);
  color: #fff; flex-shrink: 0;
}
.bot-ava {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--blue), #4E86FF);
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
}
.bot-head .who { flex: 1; line-height: 1.35; }
.bot-head strong { font-size: 13.5px; font-weight: 600; display: block; }
.bot-head small { font-size: 10.5px; color: rgba(255,255,255,.52); display: flex; align-items: center; gap: 5px; }
.bot-head small i { width: 5px; height: 5px; border-radius: 50%; background: #38E08A; display: inline-block; }
.bot-x { background: none; border: 0; color: rgba(255,255,255,.6); font-size: 17px; cursor: pointer; padding: 4px 2px; line-height: 1; }
.bot-x:hover { color: #fff; }
.bot-body { flex: 1; overflow-y: auto; padding: 18px 16px 10px; background: #F6F8FC; display: flex; flex-direction: column; gap: 11px; scrollbar-width: thin; }
.msg { max-width: 88%; font-size: 13px; line-height: 1.72; border-radius: 13px; padding: 11px 14px; word-break: break-word; }
.msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; color: var(--ink); }
.msg.me { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.msg a { color: var(--blue); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.msg.me a { color: #fff; }
.msg b { font-weight: 700; }
.msg ul { margin: 7px 0 2px; padding-left: 15px; }
.msg li { margin: 3px 0; }
.msg .lnk {
  display: inline-flex; align-items: center; gap: 4px; margin: 7px 7px 0 0;
  font-size: 12px; font-weight: 600; color: var(--blue);
  border: 1px solid rgba(30,94,255,.3); background: #fff;
  border-radius: 13px; padding: 4px 11px; text-decoration: none;
}
.msg .lnk:hover { background: rgba(30,94,255,.06); }
.typing { display: flex; gap: 4px; align-items: center; height: 14px; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--text-3); animation: botBlink 1.1s infinite; }
.typing i:nth-child(2) { animation-delay: .16s; }
.typing i:nth-child(3) { animation-delay: .32s; }
@keyframes botBlink { 0%, 60%, 100% { opacity: .28; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.bot-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 16px 11px; background: #F6F8FC; flex-shrink: 0; }
.chip {
  font-family: inherit; font-size: 12px; font-weight: 500; cursor: pointer;
  border: 1px solid rgba(30,94,255,.3); background: #fff; color: var(--blue);
  border-radius: 14px; padding: 6px 12px; transition: background .16s, border-color .16s;
}
.chip:hover { background: rgba(30,94,255,.07); border-color: rgba(30,94,255,.55); }

.bot-input { display: flex; gap: 8px; padding: 11px 12px; border-top: 1px solid var(--line); background: #fff; flex-shrink: 0; }
.bot-input input {
  flex: 1; height: 40px; border: 1px solid var(--line); border-radius: 20px;
  padding: 0 15px; font-size: 13px; font-family: inherit; color: var(--ink); outline: 0; background: #F8FAFD;
  transition: border-color .16s, background .16s;
}
.bot-input input:focus { border-color: rgba(30,94,255,.5); background: #fff; }
.bot-send {
  width: 40px; height: 40px; border-radius: 50%; border: 0; flex-shrink: 0;
  background: var(--blue); color: #fff; cursor: pointer; display: grid; place-items: center;
  transition: background .16s, transform .16s;
}
.bot-send:hover { background: var(--blue-dk); }
.bot-send:active { transform: scale(.94); }

/* 机器人内表单 */
.bform { align-self: stretch; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 9px; }
.bform label { font-size: 11px; font-weight: 600; color: var(--text-2); letter-spacing: .02em; }
.bform input, .bform textarea, .bform select {
  width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 9px 11px;
  font-size: 12.5px; font-family: inherit; color: var(--ink); outline: 0; background: #FBFCFE;
}
.bform textarea { resize: vertical; min-height: 56px; }
.bform input:focus, .bform textarea:focus, .bform select:focus { border-color: rgba(30,94,255,.5); background: #fff; }
.bform .row { display: flex; gap: 9px; }
.bform .row > div { flex: 1; }
.bform button {
  height: 38px; border: 0; border-radius: 19px; background: var(--blue); color: #fff;
  font-size: 12.5px; font-weight: 600; font-family: inherit; cursor: pointer; margin-top: 2px;
}
.bform button:hover { background: var(--blue-dk); }
.bform .note { font-size: 10.5px; color: var(--text-3); line-height: 1.6; }

@media (max-width: 820px) {
  .bot-btn { right: 16px; bottom: 86px; height: 44px; padding: 0 16px 0 13px; font-size: 12.5px; }
  .bot-panel { right: 10px; left: 10px; bottom: 76px; width: auto; height: min(600px, calc(100vh - 110px)); }
  .bot-btn.hide { opacity: 0; }
  .to-top { right: 16px; bottom: 22px; }
}

/* 导航搜索入口：细边小按钮（覆盖上方胶囊样式，保持整站轻量质感） */
.nav-search-btn {
  height: 30px; padding: 0 11px; margin-left: 12px;
  border-radius: 2px; border: 1px solid rgba(255,255,255,.22);
  background: transparent; color: rgba(255,255,255,.72);
  font-size: 12px; letter-spacing: .04em; gap: 6px;
}
.nav-search-btn:hover { border-color: rgba(255,255,255,.5); color: #fff; background: transparent; }
.nav-search-btn kbd { font-size: 10px; opacity: .5; border: 1px solid rgba(255,255,255,.2); border-radius: 2px; padding: 0 4px; }

/* 空态热门搜索标签（原 .tag 来自 components.css，此处局部定义避免全局污染） */
.qs-empty .tagrow { display: flex; flex-wrap: wrap; gap: 8px; }
.qs-empty .tag {
  font-family: var(--sans); font-size: 11.5px; font-weight: 600; line-height: 1.5;
  padding: 6px 12px; border-radius: 3px; border: 1px solid var(--line);
  background: #fff; color: var(--text-2); cursor: pointer;
  transition: border-color .16s, color .16s, background .16s;
}
.qs-empty .tag:hover { border-color: var(--ink); color: var(--ink); background: var(--bg-light); }
.qs-chips { mask-image: linear-gradient(90deg, #000 94%, transparent 100%); -webkit-mask-image: linear-gradient(90deg, #000 94%, transparent 100%); }

/* ================= 智能客服 v2：主菜单 / 图文卡片 / 多轮流程 / 转人工 / 会话 ================= */
/* 主菜单按钮网格（欢迎语按钮） */
.menu-card { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 10px; }
.menu-btn {
  font-family: inherit; font-size: 12px; font-weight: 600; text-align: left; cursor: pointer;
  padding: 9px 11px; border-radius: 8px; border: 1px solid rgba(30,94,255,.28);
  background: #fff; color: var(--ink); transition: background .16s, border-color .16s, color .16s;
}
.menu-btn:hover { background: rgba(30,94,255,.07); border-color: rgba(30,94,255,.6); color: var(--blue); }

/* 图文链接卡片 */
.lcs { display: flex; flex-direction: column; gap: 6px; margin-top: 9px; }
.lc {
  display: flex; align-items: center; gap: 9px; text-decoration: none;
  border: 1px solid var(--line); border-radius: 9px; background: #FBFCFE;
  padding: 9px 12px; transition: border-color .16s, background .16s;
}
.lc:hover { border-color: rgba(30,94,255,.45); background: #F2F6FF; }
.lc .lc-main { flex: 1; min-width: 0; }
.lc .lc-t { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.lc .lc-d { display: block; font-size: 11px; color: var(--text-3); margin-top: 2px; line-height: 1.5; }
.lc .lc-go { flex-shrink: 0; color: var(--blue); font-size: 13px; }

/* 多轮流程步骤条 */
.fstep {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .06em;
  color: var(--blue); background: rgba(30,94,255,.08); border-radius: 4px;
  padding: 2px 7px; margin-bottom: 6px;
}

/* 留资确认卡 */
.bform.confirm { gap: 8px; }
.conf { display: flex; gap: 10px; font-size: 12px; line-height: 1.55; }
.conf span { width: 78px; flex-shrink: 0; color: var(--text-3); }
.conf b { font-weight: 600; color: var(--ink); word-break: break-all; }
.conf-row { display: flex; gap: 8px; margin-top: 4px; }
.conf-row button { flex: 1; height: 36px; border: 0; border-radius: 18px; font-size: 12.5px; font-weight: 600; font-family: inherit; cursor: pointer; transition: background .16s; }
.conf-row .ok { background: var(--blue); color: #fff; }
.conf-row .ok:hover { background: var(--blue-dk); }
.conf-row .redo { background: #F1F3F7; color: var(--text-2); }
.conf-row .redo:hover { background: #E6EAF0; }

/* 转人工联系卡 */
.contact-card { border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; }
.contact-row { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.contact-row:last-child { border-bottom: 0; }
.contact-row .k { width: 56px; flex-shrink: 0; font-size: 11px; font-weight: 600; color: var(--text-3); }
.contact-row .v { flex: 1; min-width: 0; font-size: 12px; color: var(--ink); word-break: break-all; }
.contact-row a.v { color: var(--blue); font-weight: 600; text-decoration: none; }
.contact-row a.v:hover { text-decoration: underline; text-underline-offset: 2px; }
.contact-row .copy-btn {
  flex-shrink: 0; font-family: inherit; font-size: 10.5px; font-weight: 600; cursor: pointer;
  border: 1px solid rgba(30,94,255,.3); color: var(--blue); background: #fff;
  border-radius: 11px; padding: 3px 9px; transition: background .16s, border-color .16s, color .16s;
}
.contact-row .copy-btn:hover { background: rgba(30,94,255,.07); }
.contact-row .copy-btn.done { border-color: #38E08A; color: #1E9E5E; }

/* 新对话按钮（面板头部） */
.bot-new {
  flex-shrink: 0; margin-right: 4px;
  background: rgba(255,255,255,.14); border: 0; color: #fff; font-family: inherit;
  font-size: 10.5px; font-weight: 600; cursor: pointer; border-radius: 4px; padding: 4px 8px;
  transition: background .16s;
}
.bot-new:hover { background: rgba(255,255,255,.28); }

/* 轻提示（复制成功等） */
.bot-toast {
  position: absolute; left: 50%; bottom: 94px; transform: translateX(-50%);
  background: rgba(10,20,32,.88); color: #fff; font-size: 11.5px; padding: 6px 13px;
  border-radius: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 6;
  white-space: nowrap;
}
.bot-toast.on { opacity: 1; }

@media (max-width: 820px) {
  .menu-card { grid-template-columns: 1fr 1fr; }
  .contact-row .k { width: 50px; }
}
