/* ============================================================
 * 九桥 AI 产品超市 · AI会议秘书对话页（2026-09-07 新版重设计·自包含）
 * 设计语言与 ai-product-market/index.html V2.0 对齐
 * 白底 / #2f6bff 主蓝 / 胶囊按钮 / 18·28 圆角 / eyebrow 小标
 * ============================================================ */

*{box-sizing:border-box;margin:0;padding:0}
body{
  font-family:Arial,"PingFang SC","Microsoft YaHei","Noto Sans SC",sans-serif;
  color:#202522;background:#fff;-webkit-font-smoothing:antialiased;
}
a{text-decoration:none;color:inherit}
button{font:inherit;cursor:pointer}
h1,h2{font-weight:600;letter-spacing:-.05em}
::selection{background:#2f6bff;color:#fff}

.chat-page{
  width:min(1320px,calc(100% - 9vw));margin:0 auto;
  padding:150px 0 90px;min-height:60vh;
}
.chat-shell{
  display:grid;grid-template-columns:290px minmax(0,1fr);gap:24px;
  height:calc(100vh - 300px);min-height:560px;align-items:stretch;
}

/* ---------- 左侧 · 历史对话 ---------- */
.chat-history{
  display:flex;flex-direction:column;min-height:0;
  border:1px solid #e8ebe8;border-radius:28px;background:#fff;padding:22px 16px;
  box-shadow:0 22px 65px rgba(35,44,38,.07);
}
.chat-history-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:0 4px 14px}
.chat-history-title{font-size:10px;font-weight:800;letter-spacing:.16em;color:#747b77;text-transform:uppercase}
.chat-new-btn{
  min-height:36px;padding:0 16px;border-radius:999px;border:1px solid rgba(47,107,255,.3);
  background:#eef4ff;color:#2458d1;font-size:12px;font-weight:750;transition:.18s;white-space:nowrap;
}
.chat-new-btn:hover{background:#2f6bff;border-color:#2f6bff;color:#fff;transform:translateY(-1px);box-shadow:0 8px 18px rgba(47,107,255,.2)}
.chat-history-list{flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:6px;padding-right:2px}
.chat-history-list::-webkit-scrollbar{width:4px}
.chat-history-list::-webkit-scrollbar-thumb{background:#dde2de;border-radius:999px}
.chat-history-item{
  position:relative;border:1px solid transparent;border-radius:16px;padding:12px 30px 12px 14px;
  background:#f6f7f5;cursor:pointer;transition:.18s;
}
.chat-history-item:hover{background:#eef4ff;border-color:rgba(47,107,255,.2)}
.chat-history-item.is-active{background:#eef4ff;border-color:rgba(47,107,255,.35)}
.chat-history-item-title{
  display:block;font-size:12.5px;font-weight:650;color:#202522;letter-spacing:-.01em;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-right:6px;
}
.chat-history-item-meta{margin-top:5px;display:flex;align-items:center;gap:8px}
.chat-history-item-time{font-size:10px;color:#a9b0ab}
.chat-history-item-badge{
  font-size:9px;font-weight:800;letter-spacing:.08em;color:#2458d1;background:#fff;
  border:1px solid rgba(47,107,255,.25);border-radius:999px;padding:2px 8px;text-transform:uppercase;
}
.chat-history-del{
  position:absolute;top:50%;right:8px;transform:translateY(-50%);
  width:22px;height:22px;border:0;border-radius:50%;background:transparent;color:#a9b0ab;
  font-size:12px;line-height:1;cursor:pointer;opacity:0;transition:.18s;
}
.chat-history-item:hover .chat-history-del{opacity:1}
.chat-history-del:hover{background:#fdf3f2;color:#c4453a}
.chat-history-empty{padding:26px 6px;text-align:center;color:#a9b0ab;font-size:12px;line-height:1.8}

/* ---------- 右侧 · 对话面板 ---------- */
.chat-panel{
  display:flex;flex-direction:column;min-height:0;overflow:hidden;
  border:1px solid #e8ebe8;border-radius:28px;background:#fff;
  box-shadow:0 22px 65px rgba(35,44,38,.07);
}
.chat-panel-head{
  display:flex;align-items:center;gap:16px;padding:20px 24px;
  border-bottom:1px solid #eef1ee;flex-wrap:wrap;
}
.chat-avatar{
  width:46px;height:46px;flex:none;border-radius:50%;display:flex;align-items:center;justify-content:center;
  background:#eef4ff;font-size:22px;
}
.chat-title{flex:1;min-width:180px}
.chat-title h1{font-size:18px;color:#202522}
.chat-title p{margin-top:4px;font-size:11.5px;color:#747b77;line-height:1.6}
.chat-meta{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.chat-balance{
  display:inline-flex;align-items:center;min-height:34px;padding:0 15px;border-radius:999px;
  background:#eef4ff;border:1px solid rgba(47,107,255,.25);color:#2458d1;
  font-size:11.5px;font-weight:750;white-space:nowrap;font-variant-numeric:tabular-nums;
}
.chat-clear{
  min-height:34px;padding:0 14px;border-radius:999px;border:1px solid #e8ebe8;background:#fff;
  color:#747b77;font-size:11.5px;font-weight:650;transition:.18s;white-space:nowrap;
}
.chat-clear:hover{border-color:#c4453a;color:#c4453a;background:#fdf3f2}

/* ---------- 消息区 ---------- */
.chat-body{
  flex:1;overflow-y:auto;padding:24px;display:flex;flex-direction:column;gap:16px;
  background:#f6f7f5;
}
.chat-body::-webkit-scrollbar{width:5px}
.chat-body::-webkit-scrollbar-thumb{background:#dde2de;border-radius:999px}

/* 欢迎 */
.chat-welcome{
  margin:auto;max-width:420px;text-align:center;background:#fff;border:1px solid #e8ebe8;
  border-radius:24px;padding:34px 30px;box-shadow:0 18px 44px rgba(35,44,38,.06);
}
.chat-welcome-icon{
  width:56px;height:56px;margin:0 auto 16px;border-radius:50%;background:#eef4ff;
  display:flex;align-items:center;justify-content:center;font-size:26px;
}
.chat-welcome h2{font-size:18px;color:#202522}
.chat-welcome p{margin-top:12px;font-size:12.5px;color:#555d58;line-height:1.9}
.chat-welcome ul{margin-top:14px;list-style:none;display:flex;flex-direction:column;gap:8px}
.chat-welcome li{
  font-size:12px;color:#555d58;background:#f6f7f5;border-radius:999px;padding:9px 16px;text-align:left;
}

/* 消息气泡 */
.chat-msg{display:flex;gap:12px;max-width:100%}
.chat-msg.is-user{flex-direction:row-reverse}
.chat-msg-icon{
  width:36px;height:36px;flex:none;border-radius:50%;display:flex;align-items:center;justify-content:center;
  background:#fff;border:1px solid #e8ebe8;font-size:17px;
}
.chat-msg.is-user .chat-msg-icon{background:#eef4ff;border-color:rgba(47,107,255,.25)}
.chat-bubble{
  max-width:min(640px,78%);padding:14px 18px;border-radius:18px;font-size:13px;line-height:1.85;
  background:#fff;border:1px solid #e8ebe8;color:#202522;white-space:pre-wrap;
  overflow-wrap:anywhere;box-shadow:0 10px 26px rgba(35,44,38,.05);
}
.chat-msg.is-user .chat-bubble{
  background:#2f6bff;border-color:#2f6bff;color:#fff;
  border-bottom-right-radius:6px;box-shadow:0 12px 26px rgba(47,107,255,.2);
}
.chat-msg.is-ai .chat-bubble{border-bottom-left-radius:6px}
.chat-msg.is-streaming .chat-bubble{border-color:rgba(47,107,255,.4)}

/* 正在思考指示器（AI 占位空气泡，首个流式内容到达即被覆盖） */
.chat-typing{display:inline-flex;align-items:center;gap:5px;height:22px;padding:0 4px}
.chat-typing i{
  width:7px;height:7px;border-radius:50%;background:#2f6bff;opacity:.35;
  animation:chat-think 1.15s ease-in-out infinite;
}
.chat-typing i:nth-child(2){animation-delay:.15s;background:#4d82ff}
.chat-typing i:nth-child(3){animation-delay:.3s;background:#8db0ff}
@keyframes chat-think{
  0%,60%,100%{transform:translateY(0);opacity:.35}
  30%{transform:translateY(-5px);opacity:1}
}
@media (prefers-reduced-motion:reduce){
  .chat-typing i{animation:none;opacity:.6}
}
.chat-bubble code{background:#f6f7f5;border-radius:6px;padding:1px 6px;font-size:12px}
.chat-msg.is-user .chat-bubble code{background:rgba(255,255,255,.16)}

/* 登录提示（chat-page.js 动态注入） */
.chat-login-hint{
  margin:auto;max-width:380px;text-align:center;background:#fff;border:1px solid rgba(47,107,255,.2);
  border-radius:24px;padding:36px 30px;
}
.chat-login-hint h2{font-size:18px;color:#202522}
.chat-login-hint p{margin-top:10px;font-size:12.5px;color:#747b77;line-height:1.9}
.chat-login-hint button,.chat-login-hint .chat-login-btn{
  display:flex;width:100%;align-items:center;justify-content:center;gap:8px;
  min-height:46px;padding:0 26px;border-radius:999px;border:1px solid #2f6bff;background:#2f6bff;
  color:#fff;font-size:12px;font-weight:750;cursor:pointer;transition:.18s;
  box-shadow:0 12px 24px rgba(47,107,255,.18);margin-top:18px;
}
.chat-login-hint button:hover,.chat-login-hint .chat-login-btn:hover{background:#1d4ed8;border-color:#1d4ed8;transform:translateY(-2px)}

/* ---------- 附件 ---------- */
.chat-attachments{display:flex;gap:8px;flex-wrap:wrap;padding:0 24px}
.chat-attachments:empty{padding:0}
.chat-attach-chip{
  display:inline-flex;align-items:center;gap:8px;margin-top:10px;max-width:100%;
  background:#f6f7f5;border:1px solid #e8ebe8;border-radius:999px;padding:7px 8px 7px 14px;
  font-size:11.5px;color:#555d58;
}
.chat-attach-name{max-width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-attach-del{
  width:20px;height:20px;flex:none;border:0;border-radius:50%;background:#fff;color:#747b77;
  font-size:11px;cursor:pointer;line-height:1;transition:.18s;
}
.chat-attach-del:hover{background:#fdf3f2;color:#c4453a}

/* ---------- 输入区 ---------- */
.chat-inputbar{
  display:flex;align-items:flex-end;gap:10px;padding:16px 20px;
  border-top:1px solid #eef1ee;background:#fff;
}
.chat-file-btn{
  width:44px;height:44px;flex:none;border-radius:50%;border:1px solid #e8ebe8;background:#fff;
  color:#555d58;font-size:17px;transition:.18s;display:flex;align-items:center;justify-content:center;
}
.chat-file-btn:hover{border-color:rgba(47,107,255,.35);background:#eef4ff;transform:translateY(-1px)}
.chat-inputbar textarea{
  flex:1;resize:none;border:1px solid #e8ebe8;border-radius:18px;background:#f6f7f5;
  padding:12px 16px;font-size:13px;line-height:1.7;color:#202522;outline:none;font-family:inherit;
  max-height:140px;transition:.18s;
}
.chat-inputbar textarea:focus{border-color:#2f6bff;background:#fff;box-shadow:0 0 0 4px rgba(47,107,255,.1)}
.chat-inputbar textarea::placeholder{color:#a9b0ab}
#chat-send{
  min-height:44px;padding:0 24px;border-radius:999px;border:1px solid #2f6bff;background:#2f6bff;
  color:#fff;font-size:12px;font-weight:750;transition:.18s;white-space:nowrap;
  box-shadow:0 12px 24px rgba(47,107,255,.18);
}
#chat-send:hover{background:#1d4ed8;border-color:#1d4ed8;transform:translateY(-2px)}
#chat-send:disabled{opacity:.5;cursor:not-allowed;transform:none}

/* ---------- 响应式 ---------- */
@media (max-width:980px){
  .chat-shell{grid-template-columns:1fr;height:auto;min-height:0}
  .chat-history{max-height:200px}
  .chat-panel{min-height:70vh}
  .chat-page{padding:120px 0 60px}
}
@media (max-width:640px){
  .chat-panel-head{padding:16px}
  .chat-body{padding:16px}
  .chat-bubble{max-width:88%}
  .chat-inputbar{padding:12px 14px}
}
