import{n as e,s as t,t as n}from"./jsx-runtime-Bzw2jH9X.js";import{Zt as r,f as i,tn as a}from"./services-Ddh4dHvP.js";import{n as o}from"./date-CTxYulDo.js";import{t as s}from"./createLucideIcon-BkIMvJln.js";import{t as c}from"./chart-column-increasing-Btdnamvz.js";import{t as l}from"./clock-B5dcDzZw.js";import{t as u}from"./lightbulb-DrPhLIFI.js";import{t as d}from"./shield-check-Ctx3NQgx.js";import{t as f}from"./x-CkbzgTHo.js";import{n as p,t as m}from"./AiHistoryModal-Bsz4oT9k.js";import{n as h}from"./AuthContext-PSb2BBjo.js";import{G as g,cn as _,et as v,lt as y,un as b}from"./index-DkcBoy_T.js";import{t as x}from"./GeoSEO-CM_kwP_Q.js";import{t as S}from"./Button-CZzJ734d.js";import{t as C}from"./SearchModeToggle-Cpq-uZeO.js";var w={name:`git-branch`,size:24,node:[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]};w.node;var T=s(w),E=t(e(),1),D=n(),O=[`bg-blue-50 text-blue-700 hover:bg-blue-100`,`bg-emerald-50 text-emerald-700 hover:bg-emerald-100`,`bg-purple-50 text-purple-700 hover:bg-purple-100`];function k({onSubmit:e}){let[t]=b(),[n,o]=(0,E.useState)(()=>t.get(`q`)?.trim()??``),[s,c]=(0,E.useState)([]),[l,d]=(0,E.useState)(()=>localStorage.getItem(a)!==`1`),p=async()=>{try{let e=await i({recommend:!0,page:1,limit:6});c(e.data)}catch(e){console.error(`加载 AI 推荐问题失败:`,e)}};(0,E.useEffect)(()=>{p()},[]);let m=t=>{let n=t.trim();if(!n){r.info(`请输入研究问题`);return}d(!1),e(n)},h=()=>{localStorage.setItem(a,`1`),d(!1)},_=e=>{o(e),m(e)};return(0,D.jsx)(`div`,{className:`relative z-30 rounded-3xl border border-indigo-100 bg-linear-to-r from-indigo-200/50 via-slate-200 to-blue-200/50 p-px shadow-[0_12px_44px_rgba(79,70,229,0.06)]`,children:(0,D.jsxs)(`div`,{className:`relative rounded-[22px] bg-linear-to-br from-[#f8fafc] via-white to-indigo-50/30 p-8`,children:[(0,D.jsxs)(`div`,{className:`pointer-events-none absolute inset-0 overflow-hidden rounded-[22px]`,children:[(0,D.jsx)(`div`,{className:`absolute top-0 right-0 h-100 w-100 translate-x-1/3 -translate-y-1/3 rounded-full bg-indigo-100/30 blur-[100px]`}),(0,D.jsx)(`div`,{className:`absolute bottom-0 left-0 h-75 w-75 -translate-x-1/3 translate-y-1/3 rounded-full bg-blue-100/20 blur-[80px]`})]}),(0,D.jsxs)(`div`,{className:`relative z-10 mx-auto w-full`,children:[(0,D.jsxs)(`div`,{className:`mb-6 flex flex-col items-center overflow-hidden`,children:[(0,D.jsxs)(`h1`,{className:`flex flex-wrap items-center justify-center gap-2 text-center text-3xl leading-tight font-extrabold tracking-wide text-[#0f172a]`,children:[(0,D.jsx)(`span`,{children:`洞见智能`}),(0,D.jsx)(`span`,{className:`bg-linear-to-r from-indigo-600 to-blue-500 bg-clip-text font-black text-transparent`,children:`AI深度搜`}),(0,D.jsx)(`span`,{className:`rounded-full border border-indigo-100 bg-indigo-50 px-2 py-0.5 font-mono text-[10px] font-bold tracking-wider text-indigo-600`,children:`AI MODE`})]}),(0,D.jsx)(`p`,{className:`mt-2 text-center text-xs font-medium tracking-normal text-slate-400`,children:`输入复杂研究问题,大模型将智能跨报告分析、抽取核心论点与数据依据`})]}),(0,D.jsxs)(`div`,{className:`group/search relative mx-auto w-full max-w-4xl`,children:[l&&(0,D.jsx)(`div`,{className:`pointer-events-auto absolute bottom-full left-1/2 z-50 mb-1 -translate-x-1/2`,children:(0,D.jsxs)(`div`,{className:`animate-ai-search-tooltip flex items-center gap-2 rounded-xl border border-indigo-500 bg-indigo-600 px-4 py-2.5 text-sm font-medium whitespace-nowrap text-white shadow-lg shadow-indigo-900/30`,children:[(0,D.jsx)(g,{size:16,className:`text-indigo-200`}),(0,D.jsxs)(`span`,{children:[`AI深度搜模式下可以输入想问的问题,点击`,(0,D.jsx)(`strong`,{className:`mx-1 rounded bg-white/20 px-1`,children:`AI 搜索`}),`会自动生成`]}),(0,D.jsx)(`button`,{type:`button`,onClick:h,className:`ml-2 rounded-full p-1 text-indigo-100 transition-colors hover:bg-white/20 hover:text-white`,children:(0,D.jsx)(f,{size:14})})]})}),(0,D.jsx)(`div`,{className:`absolute -inset-0.5 rounded-2xl bg-indigo-500/10 opacity-70 blur-sm transition duration-300 group-hover/search:opacity-100`}),(0,D.jsxs)(`div`,{className:`relative flex flex-col rounded-2xl border-2 border-indigo-500/80 bg-white shadow-lg transition duration-200 focus-within:border-indigo-600 focus-within:shadow-[0_10px_35px_rgba(79,70,229,0.12)]`,children:[(0,D.jsxs)(`div`,{className:`flex items-center p-2`,children:[(0,D.jsx)(`div`,{className:`ml-3 p-1.5 text-indigo-500`,children:(0,D.jsx)(g,{size:18,className:`stroke-[2.25]`})}),(0,D.jsx)(`input`,{type:`text`,value:n,onChange:e=>o(e.target.value),onKeyDown:e=>{e.key===`Enter`&&m(n)},placeholder:`输入复杂研究问题,例如:某赛道的竞争格局与投资逻辑?`,className:`w-full bg-transparent px-3 py-3 text-[17px] font-semibold text-slate-800 outline-none placeholder:text-slate-400/80`}),(0,D.jsx)(S,{onClick:()=>m(n),className:`mr-1 flex h-12 min-w-25 shrink-0 items-center justify-center rounded-xl border-none bg-indigo-600 px-8 font-bold tracking-widest text-white shadow-md shadow-indigo-500/20 transition-all duration-200 hover:bg-indigo-700 active:bg-indigo-800`,children:`AI 搜索`})]}),(0,D.jsx)(C,{active:`ai`})]})]}),s.length>0&&(0,D.jsxs)(`div`,{className:`mx-auto mt-5 flex w-full max-w-4xl flex-wrap items-center justify-center gap-1.5`,children:[(0,D.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1 text-xs font-medium text-slate-400`,children:[(0,D.jsx)(u,{size:12,className:`animate-pulse text-amber-500`}),`试试这些问题:`]}),s.map((e,t)=>(0,D.jsx)(`button`,{type:`button`,title:e.title,onClick:()=>_(e.title),className:`max-w-[16rem] cursor-pointer truncate rounded-full px-2.5 py-1.5 text-xs font-semibold transition-colors duration-200 ${O[t%O.length]}`,children:e.title},e.sessionId))]})]})]})})}var A=[{title:`多源研报穿透`,desc:`聚合百万级研报观点与数据`,icon:`layers`,cardClass:`bg-[#e8f1fc]/85 border-[#d4e3f7]`,iconWrapClass:`bg-[#d4e3f7] text-[#2563eb]`,iconClass:`text-[#2563eb]`},{title:`结构化洞察图表`,desc:`自动提取表格数据与走势`,icon:`chart`,cardClass:`bg-[#ebf8f2]/85 border-[#d2efe2]`,iconWrapClass:`bg-[#d2efe2] text-[#10b981]`,iconClass:`text-[#10b981]`},{title:`产业链上下游`,desc:`还原价值分布与壁垒定位`,icon:`git`,cardClass:`bg-[#f3eefc]/85 border-[#e4daf5]`,iconWrapClass:`bg-[#e4daf5] text-[#7c3aed]`,iconClass:`text-[#7c3aed]`},{title:`源信息高保真对齐`,desc:`论断对应原文与置信依据`,icon:`shield`,cardClass:`bg-[#f8ebf8]/85 border-[#eedbf2]`,iconWrapClass:`bg-[#eedbf2] text-[#a855f7]`,iconClass:`text-[#a855f7]`}];function j({icon:e}){return e===`layers`?(0,D.jsx)(v,{size:22,className:`stroke-2`}):e===`chart`?(0,D.jsx)(c,{size:22,className:`stroke-2`}):e===`git`?(0,D.jsx)(T,{size:22,className:`stroke-2`}):(0,D.jsx)(d,{size:22,className:`stroke-2`})}function M({item:e}){return(0,D.jsxs)(`div`,{className:`group flex cursor-default items-center gap-4 rounded-2xl border p-5 shadow-[0_4px_16px_rgba(15,23,42,0.04)] transition-all duration-300 hover:scale-[1.02] ${e.cardClass}`,children:[(0,D.jsx)(`div`,{className:`flex h-12 w-12 shrink-0 items-center justify-center rounded-xl transition-transform duration-300 group-hover:scale-110 ${e.iconWrapClass}`,children:(0,D.jsx)(j,{icon:e.icon})}),(0,D.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,D.jsx)(`h4`,{className:`text-sm font-bold tracking-tight text-[#0c2340]`,children:e.title}),(0,D.jsx)(`p`,{className:`text-[11px] leading-normal font-medium text-slate-400`,children:e.desc})]})]})}function N(){let e=A.filter((e,t)=>t%2==0),t=A.filter((e,t)=>t%2==1),n=e=>(0,D.jsx)(`div`,{className:`z-20 flex w-75 shrink-0 flex-col gap-10`,children:e.map(e=>(0,D.jsx)(M,{item:e},e.title))});return(0,D.jsxs)(`div`,{className:`relative flex flex-col gap-10 overflow-visible p-6`,children:[(0,D.jsxs)(`div`,{className:`mx-auto flex max-w-2xl flex-col items-center gap-2 text-center`,children:[(0,D.jsx)(`h3`,{className:`text-2xl leading-tight font-extrabold tracking-tight text-[#0c2340]`,children:`在上方输入框直接提问即可开始`}),(0,D.jsx)(`p`,{className:`max-w-xl text-sm leading-relaxed font-medium text-slate-400`,children:`输入您关心的行业前景、产业链节点或政策命题,AI 智能体将瞬时为您多轮归纳与抽取。`})]}),(0,D.jsxs)(`div`,{className:`relative mx-auto flex w-full max-w-4xl items-center justify-between gap-8 py-2`,children:[n(e),(0,D.jsxs)(`div`,{className:`relative flex w-1/3 items-center justify-center py-8`,children:[(0,D.jsx)(`div`,{className:`absolute h-44 w-44 rounded-full border border-blue-100/35 bg-linear-to-tr from-blue-50/5 to-indigo-50/10`}),(0,D.jsx)(`div`,{className:`absolute h-50 w-50 rounded-full border border-dashed border-indigo-200/40`}),(0,D.jsx)(`div`,{className:`absolute h-30 w-30 rounded-full bg-linear-to-tr from-blue-400/8 via-indigo-400/10 to-purple-400/8 blur-xl`}),(0,D.jsx)(`div`,{className:`relative z-20 flex h-36 w-36 flex-col items-center justify-center rounded-full border border-blue-100/80 bg-white shadow-[0_12px_40px_rgba(99,102,241,0.08)]`,children:(0,D.jsxs)(`div`,{className:`absolute inset-1.5 flex flex-col items-center justify-center rounded-full border border-blue-50/40 bg-linear-to-b from-blue-50/50 to-indigo-50/70`,children:[(0,D.jsx)(`div`,{className:`mb-1 flex h-12 w-12 items-center justify-center rounded-full border border-[#d4e1f7] bg-[#e3eefa] text-[#2563eb] shadow-sm`,children:(0,D.jsx)(v,{size:22})}),(0,D.jsx)(`span`,{className:`text-[11px] font-black tracking-widest text-slate-800`,children:`AI 核心引擎`})]})})]}),n(t)]}),(0,D.jsxs)(`div`,{className:`mx-auto flex max-w-full flex-wrap items-center justify-center gap-2 rounded-full border border-slate-200/50 bg-white/80 px-6 py-2.5 text-xs text-slate-500 shadow-[0_4px_16px_rgba(15,23,42,0.02)] backdrop-blur-md`,children:[(0,D.jsx)(u,{size:14,className:`shrink-0 text-amber-500`}),(0,D.jsx)(`span`,{className:`font-medium`,children:`您也可以选择上方 AI 推荐主题或在输入框提出产业问题`})]})]})}function P({onSelect:e}){let{isAuthenticated:t}=h(),[n,r]=(0,E.useState)(!1),[a,s]=(0,E.useState)([]),[c,u]=(0,E.useState)(0),d=async()=>{try{let e=await i({page:1,limit:3});s(e.data),u(e.meta.itemCount)}catch(e){console.error(`加载 AI 搜索记录失败:`,e)}};return(0,E.useEffect)(()=>{t&&d()},[t]),!t||a.length===0?null:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{className:`mt-8 rounded-3xl border border-slate-200/85 bg-linear-to-b from-[#f4f7fc] to-[#f8fafd] p-8 shadow-sm`,children:[(0,D.jsxs)(`div`,{className:`mb-5 flex items-center justify-between px-2`,children:[(0,D.jsxs)(`h4`,{className:`flex items-center gap-2 text-sm font-bold text-slate-800`,children:[(0,D.jsx)(l,{size:16,className:`text-indigo-500`}),`历史记录`]}),(0,D.jsxs)(`button`,{type:`button`,onClick:()=>r(!0),className:`cursor-pointer text-xs font-extrabold text-indigo-600 transition-colors hover:text-indigo-800`,children:[`查看全部 `,c,` 条记录 >`]})]}),(0,D.jsx)(`div`,{className:`grid gap-2.5`,children:a.map(t=>(0,D.jsxs)(`button`,{type:`button`,onClick:()=>e(t.sessionId,t.title),className:`group flex w-full cursor-pointer items-center justify-between rounded-2xl border border-slate-200/80 bg-white p-4 text-left shadow-sm transition-all duration-300 hover:border-indigo-400 hover:bg-slate-50/80 hover:shadow`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-3 overflow-hidden`,children:[(0,D.jsx)(`div`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-indigo-50/50 transition-colors group-hover:bg-indigo-100`,children:(0,D.jsx)(l,{size:14,className:`shrink-0 text-indigo-500 group-hover:text-indigo-600`})}),(0,D.jsx)(`span`,{className:`truncate text-[15px] font-semibold text-slate-700 transition-colors group-hover:text-indigo-950`,children:t.title})]}),(0,D.jsxs)(`div`,{className:`ml-4 flex shrink-0 items-center gap-3`,children:[(0,D.jsx)(`span`,{className:`whitespace-nowrap text-xs font-semibold text-slate-400`,children:o(t.createdAt)}),(0,D.jsx)(y,{size:16,className:`shrink-0 text-slate-400 group-hover:text-indigo-600`})]})]},t.sessionId))})]}),n&&(0,D.jsx)(m,{onClose:()=>r(!1),onSelect:e})]})}function F(){let e=_();return(0,D.jsxs)(`div`,{className:`mx-auto w-full max-w-7xl px-6 py-6`,children:[(0,D.jsx)(x,{pageKey:`searchAi`}),(0,D.jsx)(k,{onSubmit:t=>{e(`/search/ai/${p}`,{state:{question:t}})}}),(0,D.jsx)(`div`,{className:`mt-8`,children:(0,D.jsx)(N,{})}),(0,D.jsx)(P,{onSelect:t=>{e(`/search/ai/${t}`)}})]})}export{F as default};