/* 万立FDE 联盟 · AI 需求诊断小窗（可拖动）v3 */
#bfwRoot{position:fixed;inset:0;pointer-events:none;z-index:120;font-family:"Noto Sans SC","Microsoft YaHei",sans-serif}

/* 启动按钮 */
#bfwLauncher{position:fixed;right:18px;bottom:18px;pointer-events:auto;display:flex;align-items:center;gap:7px;height:38px;padding:0 14px 0 11px;border-radius:20px;background:linear-gradient(135deg,#D9B878,#C8A15A);color:#0B1626;font-size:12.5px;font-weight:700;box-shadow:0 6px 18px rgba(11,22,38,.24);cursor:grab;user-select:none;touch-action:none;transition:transform .18s}
#bfwLauncher:hover{transform:translateY(-2px)}
#bfwLauncher:active{cursor:grabbing}
#bfwLauncher.dragged{transition:none}
#bfwLauncher svg{width:18px;height:18px;flex:none}
#bfwLauncher .dot{position:absolute;top:-2px;right:-2px;width:9px;height:9px;border-radius:50%;background:#4CB782;box-shadow:0 0 0 2px rgba(255,255,255,.9)}

/* 面板 */
#bfwPanel{position:fixed;right:20px;bottom:78px;width:350px;height:min(620px,calc(100vh - 110px));max-height:min(620px,calc(100vh - 110px));pointer-events:auto;background:#fff;border-radius:16px;box-shadow:0 24px 60px rgba(7,16,31,.32);display:none;flex-direction:column;overflow:hidden;border:1px solid rgba(200,161,90,.35)}
#bfwPanel.open{display:flex}
#bfwPanel.dragged{transition:none}
#bfwHead{display:flex;align-items:center;gap:10px;padding:12px 14px;background:linear-gradient(135deg,#10233B,#0B1626);color:#fff;cursor:move;touch-action:none;flex:none}
#bfwHead .t{flex:1;min-width:0}
#bfwHead .t b{display:block;font-size:14px;letter-spacing:.4px}
#bfwHead .t > span{display:block;font-size:11px;color:#9FB2CB;margin-top:2px}
#bfwHead .btn{width:26px;min-width:26px;height:26px;padding:0;border-radius:8px;border:0;background:rgba(255,255,255,.12);color:#fff;font-size:14px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;flex:none;font-weight:400}
#bfwHead .btn:hover{background:rgba(255,255,255,.22)}
#bfwHead .ic{width:28px;height:28px;border-radius:9px;background:rgba(200,161,90,.18);display:flex;align-items:center;justify-content:center;flex:none}
#bfwHead .ic svg{width:16px;height:16px;stroke:#C8A15A;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

/* 进度 */
#bfwBar{display:flex;gap:5px;padding:10px 14px 6px;flex:none;background:#fff}
#bfwBar i{flex:1;height:4px;border-radius:2px;background:#DDE5EF}
#bfwBar i.on{background:linear-gradient(90deg,#D9B878,#C8A15A)}

/* 内容 */
#bfwBody{padding:12px 14px 14px;overflow-y:auto;flex:1;-webkit-overflow-scrolling:touch}
#bfwBody h4{font-size:14.5px;color:#16324F;margin:0 0 4px;line-height:1.5}
#bfwBody p.hint{font-size:12px;color:#8A97A8;margin:0 0 10px;line-height:1.6}
#bfwBody .grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
#bfwBody .opt{display:flex;flex-direction:column;gap:2px;text-align:left;padding:10px 11px;border:1px solid #DDE4EE;border-radius:11px;background:#FCFDFE;cursor:pointer;font-size:13px;color:#22314A;line-height:1.4;transition:.15s}
#bfwBody .opt:hover{border-color:#C8A15A;background:#FFFDF7}
#bfwBody .opt b{font-size:13px;color:#16324F;font-weight:700}
#bfwBody .opt span{font-size:11.5px;color:#8A97A8}
#bfwBody .opt.sel{border-color:#C8A15A;background:#FBF5E8}
#bfwBody .opt.sel b{color:#8A6A2A}
#bfwBody .list{display:flex;flex-direction:column;gap:7px}
#bfwBody .rowlist{display:flex;flex-direction:column;gap:7px}
#bfwBody label{display:block;font-size:12px;color:#6B7A90;font-weight:600;margin:8px 0 4px}
#bfwBody textarea,#bfwBody input{width:100%;border:1px solid #D7DEE8;border-radius:9px;padding:9px 10px;font-size:13px;font-family:inherit;color:#22314A;background:#FCFDFE;outline:none;line-height:1.6}
#bfwBody textarea:focus,#bfwBody input:focus{border-color:#C8A15A;background:#fff}
#bfwBody textarea{min-height:58px;resize:vertical}
#bfwBody .chips{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0 2px}
#bfwBody .chip{font-size:11.5px;color:#5B6B84;background:#F2F6FB;border:1px solid #E1E8F1;border-radius:20px;padding:4px 10px;cursor:pointer}
#bfwBody .chip:hover{border-color:#C8A15A;color:#8A6A2A}
#bfwFoot{display:flex;gap:8px;padding:10px 14px 12px;border-top:1px solid #EEF2F7;flex:none;background:#fff}
#bfwFoot .ghost{flex:none;padding:10px 14px;border-radius:9px;border:1px solid #DDE4EE;background:#fff;color:#5B6B84;font-size:12.5px;cursor:pointer}
#bfwFoot .ghost:hover{border-color:#C8A15A;color:#8A6A2A}
#bfwFoot .main{flex:1;padding:10px 14px;border-radius:9px;border:0;background:linear-gradient(135deg,#D9B878,#C8A15A);color:#0B1626;font-size:13.5px;font-weight:700;cursor:pointer}
#bfwFoot .main:disabled{opacity:.6;cursor:not-allowed}
#bfwFoot .main:hover:not(:disabled){filter:brightness(1.04)}
#bfwMsg{font-size:12px;margin:8px 0 0;line-height:1.6}
#bfwMsg.err{color:#C0504D}
#bfwMsg.ok{color:#2C7A5B}
.bfw-badge{display:inline-block;font-size:10.5px;color:#8A6A2A;background:#FBF3E2;border:1px solid #EBD8AE;border-radius:6px;padding:2px 7px;margin-left:6px}
#bfwDone{text-align:center;padding:16px 4px 6px}
#bfwDone .ic{width:46px;height:46px;margin:0 auto 10px;border-radius:50%;background:#EAF6EF;display:flex;align-items:center;justify-content:center}
#bfwDone .ic svg{width:22px;height:22px;stroke:#2C7A5B;fill:none;stroke-width:2.2;stroke-linecap:round}
#bfwDone b{display:block;font-size:14.5px;color:#16324F;margin-bottom:4px}
#bfwDone p{font-size:12px;color:#5B6B84;margin:0 0 4px}
#bfwDone p b{display:inline;font-size:12px;color:#8A6A2A;margin:0 2px}
#bfwDone .no{font-size:12px;color:#8A6A2A;background:#FBF5E8;border:1px dashed #E3C98E;border-radius:8px;padding:6px 10px;display:inline-block;margin-top:8px}

@media(max-width:640px){
  #bfwPanel{right:0;left:0;bottom:0;width:auto;max-height:88vh;border-radius:16px 16px 0 0;box-shadow:0 -12px 40px rgba(7,16,31,.34)}
  #bfwHead{cursor:default;padding:14px 16px}
  #bfwLauncher{right:12px;bottom:12px}
}

/* 草案页：公示起价 */
#bfwPr{display:block;margin:0 0 10px;padding:9px 11px;border-radius:8px;background:#FBF6EA;border:1px solid #EADFC4;font-size:12.5px;line-height:1.6;color:#7A6432}
#bfwPr b{font-size:15px;color:#8A6A2A;margin:0 4px}
#bfwPr span{display:block;font-size:11px;color:#9C8E70}

/* 需求帖（帖式预览 / 完成页复用） */
#bfwBody .two{display:grid;grid-template-columns:1fr 1fr;gap:8px}
#bfwAi{display:flex;align-items:center;gap:6px;font-size:11.5px;color:#8A6A2A;background:#FBF6EA;border:1px solid #EADFC4;border-radius:7px;padding:6px 9px;margin:0 0 8px}
#bfwAi i{width:7px;height:7px;border-radius:50%;background:#C8A15A;flex:none}
#bfwAi.busy i{animation:bfwPulse 1s infinite}
#bfwAi.ok{background:#EDF7F1;border-color:#CDE8D8;color:#2C7A5B}
#bfwAi.ok i{background:#4CB782}
@keyframes bfwPulse{0%,100%{opacity:.25}50%{opacity:1}}
.post,#bfwPostMini{border:1px solid #E3E9F2;border-radius:12px;background:#FFFDF9;padding:12px 13px;text-align:left;margin:0 0 10px}
.post .ptag,#bfwPostMini .ptag{display:flex;align-items:center;gap:8px;margin-bottom:6px}
.post .ptag span,#bfwPostMini .ptag span{font-size:11px;color:#8A6A2A;background:#FBF3E2;border:1px solid #EBD8AE;border-radius:20px;padding:2px 9px}
.post .ptag em,#bfwPostMini .ptag em{font-style:normal;font-size:11px;color:#7B8A9E;margin-left:auto}
.post .pttl,#bfwPostMini .pttl{font-size:15px;font-weight:700;color:#16324F;line-height:1.45;margin-bottom:7px}
.post .prow,#bfwPostMini .prow{display:grid;grid-template-columns:52px 1fr;gap:8px;font-size:12px;color:#5B6B84;line-height:1.6;padding:2px 0}
.post .prow b,#bfwPostMini .prow b{font-weight:600;color:#98A5B6}
.post .pfoot,#bfwPostMini .pfoot{display:flex;align-items:center;justify-content:space-between;gap:8px;border-top:1px dashed #E3E9F2;margin-top:8px;padding-top:7px}
.post .pfoot .price,#bfwPostMini .pfoot .price{font-size:13px;font-weight:700;color:#B0843C}
.post .pfoot .meta,#bfwPostMini .pfoot .meta{font-size:11px;color:#8A97A8}
#bfwPostMini{background:#FBFDFF}
#bfwBody .linkbtn{background:none;border:0;color:#B0843C;font-size:11.5px;padding:0 0 6px;cursor:pointer;text-decoration:underline}
#bfwDone .ic.bad{background:#FDEEEE}
#bfwDone .ic.bad svg{stroke:#C0504D}
#bfwDone .act2{display:flex;align-items:center;justify-content:center;gap:10px;margin-top:6px;flex-wrap:wrap}
#bfwDone .act2 button{font-family:inherit;font-size:12px;padding:8px 12px;border-radius:8px;border:1px solid #DDE4EE;background:#fff;color:#5B6B84;cursor:pointer}
#bfwDone .act2 button.pri{border-color:#C8A15A;color:#8A6A2A;font-weight:700}
#bfwDone .act2 a.tel{font-size:11.5px;color:#98A5B6}

/* v3 新增：上次记录 / 同类案例 / 复制行 / 输入命中 */
#bfwBody .lastbar{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-size:11.5px;color:#7B8A9E;background:#F4F8FD;border:1px solid #E3ECF6;border-radius:8px;padding:7px 9px;margin:0 0 10px}
#bfwBody .lastbar button{border:0;background:none;color:#B0843C;font-size:11.5px;font-weight:700;cursor:pointer;padding:0;text-decoration:underline}
#bfwBody .sim{font-size:11.5px;color:#2C7A5B;background:#EDF7F1;border:1px solid #CDE8D8;border-radius:8px;padding:7px 9px;margin:-2px 0 8px;line-height:1.6}
#bfwBody .sim b{color:#1F5F45}
#bfwBody .sim.new{color:#8A6A2A;background:#FBF6EA;border-color:#EADFC4}
#bfwBody .row2{display:flex;gap:14px;align-items:center}
#bfwBody textarea.hit{background:#FFFBF0;border-color:#D9B878;transition:background .2s}
#bfwLauncher.dragged{transition:none;transform:none}
#bfwLauncher:active{cursor:grabbing}

/* ===== v4（2026-11-26）：对话式追问 ===== */
#bfwChatWrap{display:flex;flex-direction:column;min-height:0;flex:1}
#bfwChat{flex:1;min-height:150px;overflow-y:auto;padding:12px 12px 6px;display:flex;flex-direction:column;gap:8px;background:#FBFCFE;-webkit-overflow-scrolling:touch}
#bfwChat .msg{display:flex}
#bfwChat .msg.ai{justify-content:flex-start}
#bfwChat .msg.me{justify-content:flex-end}
#bfwChat .bub{max-width:86%;padding:9px 12px;border-radius:12px;font-size:13px;line-height:1.62;background:#fff;border:1px solid #E3E9F2;color:#22314A;word-break:break-word}
#bfwChat .me .bub{background:#FBF3E2;border-color:#EBD8AE;color:#5B4526}
#bfwChat .typing .bub{padding:11px 13px}
#bfwChat .typing .bub i{display:inline-block;width:6px;height:6px;border-radius:50%;background:#C8A15A;margin-right:4px;animation:bfwPulse 1s infinite}
#bfwChat .typing .bub i:nth-child(2){animation-delay:.18s}
#bfwChat .typing .bub i:nth-child(3){animation-delay:.36s}
#bfwSug{display:none;flex-wrap:wrap;gap:6px;padding:2px 12px 8px;background:#FBFCFE;flex:none}
#bfwSug .sug{font-size:11.5px;color:#5B6B84;background:#fff;border:1px solid #E1E8F1;border-radius:16px;padding:5px 11px;cursor:pointer;font-family:inherit;line-height:1.5}
#bfwSug .sug:hover{border-color:#C8A15A;color:#8A6A2A;background:#FFFDF7}
#bfwCompose{display:flex;gap:8px;padding:9px 12px 11px;border-top:1px solid #EEF2F7;background:#fff;flex:none;align-items:flex-end}
#bfwIn{flex:1;min-width:0;border:1px solid #D7DEE8;border-radius:10px;padding:8px 10px;font-size:13px;line-height:1.6;font-family:inherit;color:#22314A;background:#FCFDFE;outline:none;resize:none;max-height:96px;overflow-y:auto}
#bfwIn:focus{border-color:#C8A15A;background:#fff}
#bfwSend{border:0;border-radius:10px;padding:9px 15px;background:linear-gradient(135deg,#D9B878,#C8A15A);color:#0B1626;font-size:12.5px;font-weight:700;cursor:pointer;font-family:inherit;flex:none}
#bfwSend:disabled{opacity:.6;cursor:not-allowed}
#bfwStage{padding:12px 14px 14px;overflow-y:auto;flex:1;display:none}
#bfwStage h4{font-size:14.5px;color:#16324F;margin:0 0 4px;line-height:1.5}
#bfwStage p.hint{font-size:12px;color:#8A97A8;margin:0 0 10px;line-height:1.6}
#bfwStage label{display:block;font-size:12px;color:#6B7A90;font-weight:600;margin:8px 0 4px}
#bfwStage input,#bfwStage textarea{width:100%;border:1px solid #D7DEE8;border-radius:9px;padding:9px 10px;font-size:13px;font-family:inherit;color:#22314A;background:#FCFDFE;outline:none;line-height:1.6}
#bfwStage textarea{min-height:120px;resize:vertical}
#bfwStage .two{display:grid;grid-template-columns:1fr 1fr;gap:8px}
#bfwStage .row2{display:flex;gap:14px;align-items:center}
#bfwStage .linkbtn{background:none;border:0;color:#B0843C;font-size:11.5px;padding:0 0 6px;cursor:pointer;text-decoration:underline}
#bfwMsg{font-size:12px;margin:8px 0 0;line-height:1.6}
#bfwMsg.err{color:#C0504D}
@media(max-width:640px){
  #bfwChat{min-height:120px}
  #bfwPanel{height:86vh;max-height:86vh}
}
