/* AI 导购悬浮窗样式。注意：主题的“返回顶部”按钮固定在 right:24px;bottom:26px，
   这里把悬浮按钮放在其上方，避免两个按钮重叠。 */
.fx-ai-launcher{position:fixed;right:22px;bottom:78px;z-index:1200;display:inline-flex;align-items:center;gap:9px;min-height:52px;padding:10px 18px 10px 12px;border:1px solid var(--fx-border,#dce1ec);border-radius:999px;background:var(--fx-panel,#fff);color:var(--fx-text,#424d65);font:inherit;font-size:14px;font-weight:600;cursor:pointer;box-shadow:0 12px 30px rgba(15,23,42,.16);transition:transform .18s ease,box-shadow .18s ease}
.fx-ai-launcher:hover{transform:translateY(-2px);box-shadow:0 16px 36px rgba(15,23,42,.22)}
.fx-ai-launcher img{width:32px;height:32px;border-radius:50%;object-fit:cover;flex:none}
.fx-ai-launcher>svg{width:26px;height:26px;flex:none;color:var(--fx-purple,#7151b5)}
.fx-ai-launcher .fx-ai-launcher-text{line-height:1}
.fx-ai-launcher.is-open{opacity:.9}

.fx-ai-panel{position:fixed;right:22px;bottom:142px;z-index:1200;display:flex;flex-direction:column;width:min(380px,calc(100vw - 32px));height:min(560px,calc(100vh - 200px));border:1px solid var(--fx-border,#dce1ec);border-radius:16px;background:var(--fx-panel,#fff);color:var(--fx-text,#424d65);box-shadow:0 24px 60px rgba(15,23,42,.28);overflow:hidden}
.fx-ai-header{display:flex;align-items:center;justify-content:space-between;padding:13px 16px;border-bottom:1px solid var(--fx-border,#e6e9f2);background:linear-gradient(135deg,color-mix(in srgb,var(--fx-purple,#7151b5) 12%,transparent),transparent)}
.fx-ai-header strong{font-size:15px;color:var(--fx-heading,#1c2540)}
.fx-ai-actions{display:flex;align-items:center;gap:4px;flex:none}
.fx-ai-expand,.fx-ai-clear{width:28px;height:28px;border:0;border-radius:8px;background:transparent;color:inherit;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}
.fx-ai-expand:hover,.fx-ai-clear:hover{background:var(--fx-border,#e6e9f2)}
.fx-ai-expand svg,.fx-ai-clear svg{width:16px;height:16px}
.fx-ai-expand .fx-ai-expand-off{display:none}
.fx-ai-panel.is-fullscreen .fx-ai-expand .fx-ai-expand-on{display:none}
.fx-ai-panel.is-fullscreen .fx-ai-expand .fx-ai-expand-off{display:inline}
.fx-ai-close{width:28px;height:28px;border:0;border-radius:8px;background:transparent;color:inherit;font-size:19px;line-height:1;cursor:pointer}
.fx-ai-close:hover{background:var(--fx-border,#e6e9f2)}

/* 全屏模式：面板铺满视口，内容居中限制阅读宽度 */
.fx-ai-panel.is-fullscreen{inset:0;right:auto;bottom:auto;width:100%;height:100vh;height:100dvh;max-width:none;max-height:none;border:0;border-radius:0;z-index:1400}
.fx-ai-panel.is-fullscreen .fx-ai-header{padding:14px 24px}
.fx-ai-panel.is-fullscreen .fx-ai-log{padding:22px 24px}
.fx-ai-panel.is-fullscreen .fx-ai-msg{width:100%;max-width:920px;margin-left:auto;margin-right:auto}
.fx-ai-panel.is-fullscreen .fx-ai-bubble{max-width:72%}
.fx-ai-panel.is-fullscreen .fx-ai-guide{width:100%;max-width:920px;margin:0 auto}
.fx-ai-panel.is-fullscreen .fx-ai-input-row{width:100%;max-width:920px;margin:0 auto;padding:14px 24px}
body.fx-ai-fullscreen-open{overflow:hidden}

.fx-ai-log{flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:10px}
.fx-ai-msg{display:flex}
.fx-ai-user{justify-content:flex-end}
.fx-ai-bubble{max-width:82%;padding:9px 13px;border-radius:13px;font-size:13.5px;line-height:1.6;overflow-wrap:anywhere}
.fx-ai-ai .fx-ai-bubble{background:color-mix(in srgb,var(--fx-purple,#7151b5) 8%,var(--fx-panel,#f6f5fb));border-top-left-radius:4px}
.fx-ai-user .fx-ai-bubble{background:var(--fx-purple,#7151b5);color:#fff;border-top-right-radius:4px}
.fx-ai-thinking{display:inline-flex;gap:4px;align-items:center}
.fx-ai-thinking span{width:6px;height:6px;border-radius:50%;background:currentColor;opacity:.4;animation:fx-ai-blink 1.1s infinite}
.fx-ai-thinking span:nth-child(2){animation-delay:.18s}
.fx-ai-thinking span:nth-child(3){animation-delay:.36s}
@keyframes fx-ai-blink{0%,80%,100%{opacity:.25;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}

.fx-ai-product{flex-direction:column}
.fx-ai-product-card{width:100%;border:1px solid var(--fx-border,#e6e9f2);border-radius:12px;padding:11px 13px;display:flex;flex-direction:column;gap:6px;background:var(--fx-panel,#fff)}
.fx-ai-product-group{font-size:11px;color:var(--fx-muted,#7c86a0);letter-spacing:.02em}
.fx-ai-product-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px}
.fx-ai-product-name{font-size:14px;font-weight:600;color:var(--fx-heading,#1c2540);text-decoration:none}
.fx-ai-product-name:hover{color:var(--fx-purple,#7151b5)}
.fx-ai-product-price{flex:none;font-size:13px;font-weight:700;color:var(--fx-purple,#7151b5);white-space:nowrap}
.fx-ai-product-reason{margin:0;font-size:12.5px;line-height:1.6;color:var(--fx-muted,#5f6b85)}
.fx-ai-product-buy{align-self:flex-start;font-size:12.5px;font-weight:600;color:var(--fx-purple,#7151b5);text-decoration:none}
.fx-ai-product-buy:hover{text-decoration:underline}

/* 思考过程与 AI 分析 */
.fx-ai-think{width:100%;border:1px solid var(--fx-border,#e6e9f2);border-radius:12px;padding:11px 13px;background:color-mix(in srgb,var(--fx-purple,#7151b5) 5%,var(--fx-panel,#fff))}
.fx-ai-think-title{display:flex;align-items:center;gap:6px;margin-bottom:8px;font-size:12px;font-weight:600;color:var(--fx-heading,#1c2540)}
.fx-ai-think-title .fx-icon{width:13px;height:13px;color:var(--fx-purple,#7151b5)}
.fx-ai-think-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
.fx-ai-think-list li{display:flex;gap:8px;align-items:flex-start;font-size:12px;line-height:1.6;color:var(--fx-muted,#7c86a0)}
.fx-ai-think-dot{width:6px;height:6px;margin-top:6px;border-radius:50%;background:var(--fx-purple,#7151b5);opacity:.4;flex:none}
.fx-ai-think-list li.is-running{color:var(--fx-text,#424d65)}
.fx-ai-think-list li.is-running .fx-ai-think-dot{opacity:1;animation:fx-ai-pulse 1s ease-in-out infinite}
.fx-ai-think-list li.is-done .fx-ai-think-dot{background:var(--fx-green,#2fb37f);opacity:1;animation:none}
@keyframes fx-ai-pulse{0%,100%{transform:scale(1);opacity:1}50%{transform:scale(1.7);opacity:.5}}
.fx-ai-analysis .fx-ai-bubble{max-width:100%}

.fx-ai-guide{padding:9px 16px;border-top:1px solid var(--fx-border,#e6e9f2);font-size:12px;color:var(--fx-muted,#7c86a0);line-height:1.6}
.fx-ai-input-row{display:flex;gap:8px;padding:12px 14px;border-top:1px solid var(--fx-border,#e6e9f2);background:var(--fx-panel,#fff)}
.fx-ai-input{flex:1;min-width:0;height:40px;padding:0 13px;border:1px solid var(--fx-border,#d5dbea);border-radius:10px;background:transparent;color:inherit;font:inherit;font-size:13.5px}
.fx-ai-input:focus{outline:none;border-color:var(--fx-purple,#7151b5);box-shadow:0 0 0 2px color-mix(in srgb,var(--fx-purple,#7151b5) 16%,transparent)}
.fx-ai-send{height:40px;padding:0 16px;border:0;border-radius:10px;background:var(--fx-purple,#7151b5);color:#fff;font:inherit;font-size:13.5px;font-weight:600;cursor:pointer}
.fx-ai-send:hover{filter:brightness(1.08)}
.fx-ai-send:disabled{opacity:.55;cursor:not-allowed}

@media(max-width:640px){
  .fx-ai-launcher{right:14px;bottom:64px;padding:9px 14px 9px 10px}
  .fx-ai-panel{right:10px;left:10px;width:auto;bottom:128px;height:min(70vh,500px)}
  .fx-ai-panel.is-fullscreen{left:0;right:0;top:0;bottom:0;width:100%;height:100vh;height:100dvh;border-radius:0}
  .fx-ai-panel.is-fullscreen .fx-ai-header{padding:12px 16px}
  .fx-ai-panel.is-fullscreen .fx-ai-log{padding:16px}
  .fx-ai-panel.is-fullscreen .fx-ai-input-row{padding:10px 14px}
  .fx-ai-panel.is-fullscreen .fx-ai-bubble{max-width:86%}
}
@media(prefers-reduced-motion:reduce){.fx-ai-launcher,.fx-ai-thinking span{animation:none!important;transition:none!important}}
