/* ============================================================
   Step 2 对话系统：全屏覆盖层 / 打字机 / 排行榜卡片组 / 历史会话
   ============================================================ */

/* ---------- 移动端全屏对话覆盖层 ---------- */
.chat-overlay {
  position: fixed; inset: 0; z-index: 80;
  display: flex; flex-direction: column;
  background: var(--bg-base);
  transform: translateY(102%);
  transition: transform 0.42s cubic-bezier(0.32, 0.9, 0.3, 1);
  visibility: hidden;
}
.chat-overlay.open { transform: translateY(0); visibility: visible; }

/* 推挤：打开时主舞台微缩下沉 */
.stage { transition: transform 0.42s cubic-bezier(0.32, 0.9, 0.3, 1), filter 0.42s ease; transform-origin: 50% 0; }
body.chat-open .stage { transform: scale(0.965) translateY(10px); filter: brightness(0.86); border-radius: 22px; overflow: hidden; }
body.chat-open { overflow: hidden; }
body.chat-open .hotzone, body.chat-open .tabbar { opacity: 0; pointer-events: none; transition: opacity 0.25s; }

/* 覆盖层头部 */
.co-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px calc(12px);
  padding-top: calc(14px + env(safe-area-inset-top));
  background: var(--bg-glass);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line-soft);
  flex: none;
}
.co-head .avatar { width: 44px; height: 44px; }
.co-head .co-name { font-size: 16px; font-weight: 900; }
.co-head .co-status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); font-weight: 600; margin-top: 1px; }
.co-head .co-actions { margin-left: auto; display: flex; gap: 9px; }
.co-icon {
  width: 40px; height: 40px; border-radius: 13px; flex: none;
  display: grid; place-items: center;
  background: var(--bg-soft); color: var(--ink-2);
  border: 1px solid var(--line-soft);
  transition: transform 0.2s, color 0.2s;
}
.co-icon:hover { transform: translateY(-2px); color: var(--ink-1); }
.co-icon svg { width: 19px; height: 19px; }

/* 下拉手势提示条 */
.co-grabber {
  position: absolute; top: calc(6px + env(safe-area-inset-top)); left: 50%;
  transform: translateX(-50%);
  width: 40px; height: 4.5px; border-radius: 999px;
  background: var(--line-strong); z-index: 2;
}

/* 消息流（移动端 + 覆盖层通用） */
.co-scroll {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 20px 16px 28px;
  display: flex; flex-direction: column; gap: 18px;
  overscroll-behavior: contain;
}
@media (max-width: 1023px) {
  .msg { display: flex; gap: 10px; max-width: 96%; }
  .msg > .avatar { width: 38px; height: 38px; margin-top: 2px; flex: none; }
  .bubble {
    background: var(--bg-card);
    border: 1px solid var(--line-soft);
    border-radius: 17px; border-top-left-radius: 6px;
    padding: 13px 15px;
    box-shadow: var(--shadow-card);
    font-size: 15px; line-height: 1.85;
    min-width: 0;
  }
  .msg.user { align-self: flex-end; flex-direction: row-reverse; }
  .msg.user .bubble {
    background: var(--grad-brand); color: #fff;
    border: none; border-radius: 17px; border-top-right-radius: 6px;
  }
  .suggest-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 11px; }
  .schip {
    padding: 8px 14px; border-radius: 999px;
    background: var(--bg-card);
    border: 1.5px solid var(--line-strong);
    font-size: 13.5px; font-weight: 700; color: var(--ink-2);
    transition: all 0.2s;
  }
  .schip:active { border-color: var(--c-gold); color: var(--c-gold); transform: scale(0.97); }
}

/* ---------- AI 消息气泡 — 毛玻璃 + 金色点缀 ---------- */
.msg .bubble {
  background: var(--bg-glass);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line-soft);
  border-radius: 18px; border-top-left-radius: 6px;
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
  font-size: 14.5px; line-height: 1.8; color: var(--ink-2);
  min-width: 0; position: relative; overflow: hidden;
}
.msg .bubble::before {
  content: ''; position: absolute; left: 0; top: 12px; bottom: 12px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--c-gold), var(--c-lilac));
  opacity: 0.5;
}
.msg .bubble .tw-text { white-space: pre-wrap; word-break: break-word; }

.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg.user .bubble {
  background: var(--grad-brand); color: #fff;
  border: none; border-radius: 18px; border-top-right-radius: 6px;
  padding: 13px 17px; font-size: 15px;
}
.msg.user .bubble::before { display: none; }

/* 导航联动消息 — 比普通 AI 回复更轻量 */
.msg.nav-msg .bubble {
  background: var(--bg-glass);
  border: 1px dashed var(--c-gold);
  border-radius: 14px; border-top-left-radius: 6px;
  padding: 10px 15px;
}
.msg.nav-msg .bubble::before { display: none; }
.msg.nav-msg .nav-text { font-size: 13.5px; color: var(--ink-2); font-weight: 600; }

/* AI 气泡内的 Markdown 内容排版 */
.msg .bubble .md-rendered { font-size: 14.5px; }

/* 覆盖层 / Pane 的全局消息布局 */
.msg { display: flex; gap: 10px; max-width: 96%; }
.msg > .avatar { width: 38px; height: 38px; margin-top: 2px; flex: none; border-radius: 50%; }
.suggest-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 11px; }
.schip {
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  background: var(--bg-card);
  border: 1.5px solid var(--line-strong);
  font-size: 13.5px; font-weight: 700; color: var(--ink-2);
  transition: all 0.2s; font-family: inherit;
}
.schip:active, .schip:hover { border-color: var(--c-gold); color: var(--c-gold); transform: scale(0.97); }

@media (max-width: 1023px) {
  .msg .bubble { font-size: 14.5px; padding: 14px 16px; }
}

/* 覆盖层输入栏 */
.chat-bottom {
  position: relative; flex: none;
  background: var(--bg-glass);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line-soft);
}
.co-inputbar {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 10px 14px calc(14px + env(safe-area-inset-bottom));
}
.chat-pane .chat-inputbar { border-top: none; }
.co-inputbar .field {
  flex: 1; display: flex; align-items: center; gap: 8px;
  background: var(--bg-card);
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 11px 17px;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
  background-clip: padding-box;
}
.co-inputbar .field::before {
  content: ''; position: absolute; inset: -2px; border-radius: 999px;
  background: linear-gradient(135deg, rgba(247,169,37,0.55), rgba(78,168,255,0.35), rgba(247,169,37,0.25), rgba(78,168,255,0.45), rgba(247,169,37,0.55));
  background-size: 400% 100%;
  z-index: -1; animation: inputShimmer 2.4s ease-in-out infinite;
}
@keyframes inputShimmer {
  0%, 100% { background-position: 0% 50%; }
  25% { background-position: 50% 50%; }
  50% { background-position: 100% 50%; }
  75% { background-position: 50% 50%; }
}
.co-inputbar .field:focus-within { box-shadow: 0 0 0 8px rgba(247,169,37,0.15), 0 0 36px rgba(247,169,37,0.12); }
.co-inputbar .field:focus-within::before {
  background: linear-gradient(135deg, rgba(247,169,37,0.7), rgba(247,169,37,0.4), rgba(247,169,37,0.7));
  background-size: 200% 100%;
  animation: inputShimmerFocus 1.2s ease-in-out infinite;
}
@keyframes inputShimmerFocus {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.co-inputbar input { flex: 1; font-size: 15px; min-width: 0; background: transparent; position: relative; z-index: 1; }
.co-inputbar input::placeholder { color: var(--ink-3); font-weight: 500; }
.co-inputbar .send-btn {
  position: relative; z-index: 1;
  background: linear-gradient(135deg, var(--c-gold), #E89820);
  color: #fff; border: none;
  box-shadow: 0 2px 12px rgba(247,169,37,0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}
.co-inputbar .send-btn:hover { transform: scale(1.06); box-shadow: 0 4px 20px rgba(247,169,37,0.45); }
.co-inputbar .send-btn[disabled] { opacity: 0.45; transform: none; background: var(--bg-soft); color: var(--ink-3); box-shadow: none; }

/* ---------- 打字机 ---------- */
.bubble .tw-text { white-space: pre-wrap; word-break: break-word; }
.tw-cursor {
  display: inline-block; width: 3px; height: 1.05em;
  background: var(--c-gold); border-radius: 2px;
  vertical-align: -0.15em; margin-left: 2px;
  animation: twBlink 0.8s steps(1) infinite;
}
@keyframes twBlink { 50% { opacity: 0; } }

/* “正在思考”状态行 */
.think-row { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 13px; font-weight: 600; padding: 2px 0; }
.think-dots { display: inline-flex; gap: 4px; }
.think-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--c-gold); animation: thinkB 1.1s ease-in-out infinite; }
.think-dots i:nth-child(2) { animation-delay: 0.15s; }
.think-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes thinkB { 0%, 100% { transform: translateY(0); opacity: 0.5; } 40% { transform: translateY(-5px); opacity: 1; } }

/* ---------- 排行榜卡片组 ---------- */
.rk-card {
  margin-top: 13px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: var(--bg-soft);
  overflow: hidden;
}
.rk-head {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 14px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--line-soft);
}
.rk-head .avatar { width: 42px; height: 42px; }
.rk-head .rk-titles { min-width: 0; flex: 1; }
.rk-head .rk-name { font-size: 14.5px; font-weight: 900; }
.rk-head .rk-sub { font-size: 11.5px; color: var(--ink-3); font-weight: 600; margin-top: 1px; }
.rk-share {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  display: grid; place-items: center; color: var(--ink-3);
  background: var(--bg-soft); border: 1px solid var(--line-soft);
  transition: color 0.2s, transform 0.2s;
}
.rk-share:hover { color: var(--c-gold); transform: scale(1.08); }
.rk-share svg { width: 16px; height: 16px; }

/* 策略逻辑卡（可展开） */
.rk-logic {
  margin: 11px 12px 0;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--bg-card);
  overflow: hidden;
}
.rk-logic-head {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 10px 13px;
  font-size: 13px; font-weight: 800; color: var(--c-gold);
}
.rk-logic-head svg { width: 15px; height: 15px; }
.rk-logic-head .chev { margin-left: auto; transition: transform 0.25s; color: var(--ink-3); }
.rk-logic.open .rk-logic-head .chev { transform: rotate(180deg); }
.rk-logic-body { display: none; padding: 2px 13px 13px; }
.rk-logic.open .rk-logic-body { display: block; animation: rise 0.3s ease both; }
.rk-factor { padding: 8px 0; border-top: 1px dashed var(--line-soft); }
.rk-factor:first-child { border-top: none; }
.rk-factor-top { display: flex; align-items: center; gap: 9px; }
.rk-factor-name { font-size: 13px; font-weight: 800; }
.rk-factor-bar { flex: 1; height: 6px; border-radius: 6px; background: var(--bg-soft); overflow: hidden; }
.rk-factor-bar i { display: block; height: 100%; border-radius: 6px; background: var(--grad-brand); }
.rk-factor-w { font-size: 12px; font-weight: 800; color: var(--c-gold); font-family: var(--font-num); }
.rk-factor-why { font-size: 12px; color: var(--ink-3); margin-top: 4px; line-height: 1.7; }

/* 榜单行 */
.rk-rows { padding: 6px 12px 8px; }
.rk-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 4px;
  border-bottom: 1px dashed var(--line-soft);
}
.rk-row:last-child { border-bottom: none; }
.rk-no {
  width: 26px; height: 26px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 900; font-family: var(--font-num);
  background: var(--bg-card); color: var(--ink-3);
  border: 1px solid var(--line-soft);
}
.rk-no.top { background: var(--grad-brand); color: #fff; border: none; box-shadow: 0 4px 10px -2px rgba(247,169,37,0.5); }
.rk-main { flex: 1; min-width: 0; }
.rk-stock { display: flex; align-items: center; gap: 7px; }
.rk-stock b { font-size: 14.5px; }
.rk-stock .code { font-size: 11.5px; color: var(--ink-3); font-family: var(--font-num); }
.rk-stats { display: flex; flex-wrap: wrap; gap: 3px 9px; margin-top: 5px; }
.rk-stat { font-size: 11px; color: var(--ink-3); font-weight: 600; white-space: nowrap; }
.rk-stat b { font-family: var(--font-num); font-weight: 800; color: var(--ink-2); margin-left: 3px; }
.rk-score { flex: none; text-align: center; }
.rk-score b {
  display: block; font-size: 17px; font-weight: 900; font-family: var(--font-num);
  background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.rk-score span { font-size: 10px; color: var(--ink-3); font-weight: 700; }

/* 卡片脚：会员锁 + 调整 + 免责 */
.rk-foot {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 10px 13px 13px;
  font-size: 11.5px; color: var(--ink-3); font-weight: 600;
}
/* feed-cards 卡片内行业 chip 条 */
.fc-industries { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 10px; }
.fc-ind-chip { font-size: 11px; padding: 3px 10px; border-radius: 999px; border: 1.5px solid var(--line-1); background: none; cursor: pointer; font-weight: 600; }
.fc-date { text-align: center; font-size: 10px; color: var(--ink-3); padding-bottom: 4px; }
.rk-adjust {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 800; color: var(--c-gold);
  padding: 6px 12px; border-radius: 999px;
  background: rgba(247,169,37,0.10);
  border: 1.5px solid rgba(247,169,37,0.32);
  transition: background 0.2s, transform 0.2s;
}
.rk-adjust:hover { background: rgba(247,169,37,0.2); transform: scale(1.04); }
.rk-adjust svg { width: 13px; height: 13px; }
.rk-actions { padding: 4px 0 0; }
.rk-link-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 700; color: var(--c-sky);
  padding: 5px 11px; border-radius: 999px;
  background: rgba(78,168,255,0.08);
  border: 1px solid rgba(78,168,255,0.25);
  cursor: pointer; font-family: inherit;
  transition: background .2s, transform .2s;
}
.rk-link-btn:hover { background: rgba(78,168,255,0.18); transform: scale(1.03); }
.rk-link-btn svg { width: 11px; height: 11px; }

/* 每条回复的免责微条 */
.msg-disclaimer {
  margin-top: 10px; padding-top: 9px;
  border-top: 1px dashed var(--line-soft);
  font-size: 10.5px; color: var(--ink-3); line-height: 1.7;
}

/* 调整参数小气泡 */
.adj-bubble {
  margin-top: 11px;
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: 15px;
  padding: 12px 13px;
  animation: rise 0.3s ease both;
}
.adj-title { font-size: 12.5px; font-weight: 800; color: var(--ink-2); margin-bottom: 9px; }
.adj-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.adj-chip {
  font-size: 12.5px; font-weight: 700; color: var(--ink-2);
  padding: 7px 13px; border-radius: 999px;
  background: var(--bg-soft); border: 1.5px solid var(--line-soft);
  transition: all 0.18s;
}
.adj-chip.on { border-color: var(--c-gold); color: var(--c-gold); background: rgba(247,169,37,0.10); }
.adj-apply {
  margin-top: 11px; width: 100%;
  padding: 10px; border-radius: 12px;
  background: var(--grad-brand); color: #fff;
  font-size: 13.5px; font-weight: 800;
  box-shadow: var(--shadow-pop);
  transition: transform 0.18s;
}
.adj-apply:hover { transform: scale(1.02); }

/* ---------- 会话历史抽屉 ---------- */
.hist-mask {
  position: fixed; inset: 0; z-index: 85;
  background: rgba(12, 16, 38, 0.45);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.hist-mask.open { opacity: 1; pointer-events: auto; }
.hist-drawer {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 86;
  width: min(320px, 84vw);
  background: var(--bg-card);
  border-right: 1px solid var(--line-soft);
  box-shadow: var(--shadow-float);
  transform: translateX(-104%);
  transition: transform 0.38s cubic-bezier(0.32, 0.9, 0.3, 1);
  display: flex; flex-direction: column;
}
.hist-drawer.open { transform: translateX(0); }
.hist-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px;
  padding-top: calc(16px + env(safe-area-inset-top));
  border-bottom: 1px solid var(--line-soft);
}
.hist-head h4 { font-size: 16px; font-weight: 900; }
.hist-head .co-icon { margin-left: auto; }
.hist-new {
  margin: 13px 14px 6px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px; border-radius: 14px;
  border: 1.5px dashed var(--line-strong);
  color: var(--c-gold); font-size: 13.5px; font-weight: 800;
  transition: background 0.2s;
}
.hist-new:hover { background: rgba(247,169,37,0.08); }
.hist-new svg { width: 15px; height: 15px; }
.hist-list { flex: 1; overflow-y: auto; padding: 8px 14px 20px; }
.hist-item {
  width: 100%; text-align: left;
  display: flex; align-items: center; gap: 11px;
  padding: 12px 12px; border-radius: 14px;
  transition: background 0.18s;
}
.hist-item:hover, .hist-item.on { background: var(--bg-soft); }
.hist-item .avatar { width: 36px; height: 36px; flex: none; }
.hist-item .hi-main { flex: 1; min-width: 0; }
.hist-item .hi-title { font-size: 13.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-item .hi-time { font-size: 11px; color: var(--ink-3); font-weight: 600; margin-top: 2px; }
.hist-item .hi-del {
  flex: none; width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; color: var(--ink-3);
  opacity: 0; transition: opacity 0.2s, color 0.2s;
}
.hist-item:hover .hi-del { opacity: 1; }
.hist-item .hi-del:hover { color: var(--c-rose); }
.hist-item .hi-del svg { width: 14px; height: 14px; }
.hist-empty { text-align: center; color: var(--ink-3); font-size: 13px; padding: 40px 20px; line-height: 2; }

/* ---------- 快捷提问弹层 ---------- */
.quick-pop {
  position: fixed; z-index: 82;
  left: 14px; right: 14px; bottom: calc(146px + env(safe-area-inset-bottom));
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  box-shadow: var(--shadow-float);
  padding: 14px;
  transform: translateY(14px) scale(0.97);
  opacity: 0; pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s;
  transform-origin: bottom right;
}
.quick-pop.open { transform: none; opacity: 1; pointer-events: auto; }
.quick-pop h5 { font-size: 13px; font-weight: 900; color: var(--ink-2); margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.quick-pop h5 svg { width: 15px; height: 15px; color: var(--c-lilac); }
.quick-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-grid .schip { font-size: 13px; }

/* ---------- 「刚刚探索了」回导卡 ---------- */
.resume-tip {
  display: flex; align-items: center; gap: 12px;
  margin: 0 auto; max-width: 1080px;
  padding: 13px 16px;
  background: linear-gradient(135deg, rgba(247,169,37,0.12), rgba(255,107,157,0.10));
  border: 1.5px solid rgba(247,169,37,0.35);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  animation: rise 0.5s ease both;
}
.resume-tip .avatar { width: 40px; height: 40px; flex: none; }
.resume-tip .rt-main { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.resume-tip .rt-main b { color: var(--c-gold); }
.resume-tip .rt-btn {
  flex: none; font-size: 12.5px; font-weight: 800; color: #fff;
  background: var(--grad-brand); padding: 8px 15px; border-radius: 999px;
  box-shadow: var(--shadow-pop);
  transition: transform 0.18s;
}
.resume-tip .rt-btn:hover { transform: scale(1.05); }
.resume-tip .rt-close { flex: none; color: var(--ink-3); width: 30px; height: 30px; display: grid; place-items: center; }
.resume-tip .rt-close svg { width: 15px; height: 15px; }

/* ---------- 数据时效提示 ---------- */
.stale-note {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; color: var(--ink-3); font-weight: 600;
  background: var(--bg-soft);
  border: 1px dashed var(--line-soft);
  border-radius: 11px;
  padding: 8px 12px;
  margin-top: 10px;
}
.stale-note svg { width: 13px; height: 13px; flex: none; }

/* ---------- 下拉刷新 ---------- */
.ptr-hint {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: center;
  height: 0; overflow: visible;
  pointer-events: none;
}
.ptr-hint span {
  margin-top: 10px;
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; color: var(--ink-3);
  background: var(--bg-card); border: 1px solid var(--line-soft);
  padding: 7px 14px; border-radius: 999px;
  box-shadow: var(--shadow-card);
  opacity: 0; transform: translateY(-8px);
  transition: opacity 0.25s, transform 0.25s;
}
.ptr-hint.show span { opacity: 1; transform: none; }
.ptr-hint svg { width: 14px; height: 14px; }
.ptr-hint.spin svg { animation: ptrSpin 0.8s linear infinite; }
@keyframes ptrSpin { to { transform: rotate(360deg); } }

/* ---------- PC 端补充：消息流内卡片宽度 ---------- */
@media (min-width: 1024px) {
  .rk-card { max-width: 560px; }
  .hist-drawer { left: 0; }
  .quick-pop { left: auto; right: auto; bottom: 96px; width: 380px; }
  .chat-pane .msg { max-width: 100%; }
}

/* ---------- 常驻入口栏 ---------- */
/* ---- 上下文标签栏 ---- */
.ctx-bar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 0 14px 8px;
}
.ctx-label {
  font-size: 11px; color: var(--ink-3); font-weight: 600;
  flex-shrink: 0;
}
.ctx-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(247,169,37,0.10);
  border: 1px solid rgba(247,169,37,0.3);
  color: var(--c-gold);
}
.ctx-tag-x {
  width: 16px; height: 16px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  background: transparent; color: var(--c-gold);
  border: none; cursor: pointer;
  line-height: 1; padding: 0;
  transition: background .15s;
}
.ctx-tag-x:hover { background: rgba(247,169,37,0.2); }

.entry-bar {
  display: flex; gap: 8px;
  padding: 10px 14px 0;
  flex-wrap: wrap;
}
.entry-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 700;
  background: var(--bg-card);
  border: 1.5px solid var(--line-soft);
  padding: 8px 14px; border-radius: 999px;
  transition: all 0.2s;
  position: relative; overflow: hidden;
}
.entry-btn::before {
  content: ''; position: absolute; inset: 0;
  opacity: 0; transition: opacity 0.2s;
  border-radius: 999px;
}
.entry-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
/* 每个入口按钮的品牌色 */
.entry-btn:nth-child(1) { color: var(--c-sky); border-color: rgba(78,168,255,0.3); }
.entry-btn:nth-child(1)::before { background: linear-gradient(135deg, rgba(78,168,255,0.08), rgba(78,168,255,0.03)); }
.entry-btn:nth-child(1) svg { color: var(--c-sky); }
.entry-btn:nth-child(2) { color: var(--c-gold); border-color: rgba(247,169,37,0.35); }
.entry-btn:nth-child(2)::before { background: linear-gradient(135deg, rgba(247,169,37,0.1), rgba(247,169,37,0.03)); }
.entry-btn:nth-child(2) svg { color: var(--c-gold); }
.entry-btn:nth-child(3) { color: var(--c-mint); border-color: rgba(34,201,162,0.3); }
.entry-btn:nth-child(3)::before { background: linear-gradient(135deg, rgba(34,201,162,0.08), rgba(34,201,162,0.03)); }
.entry-btn:nth-child(3) svg { color: var(--c-mint); }
.entry-btn:nth-child(4) { color: var(--c-coral); border-color: rgba(255,93,115,0.3); }
.entry-btn:nth-child(4)::before { background: linear-gradient(135deg, rgba(255,93,115,0.08), rgba(255,93,115,0.03)); }
.entry-btn:nth-child(4) svg { color: var(--c-coral); }
.entry-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.entry-btn:hover::before { opacity: 1; }
.entry-btn:nth-child(1):hover { border-color: var(--c-sky); box-shadow: 0 4px 18px rgba(78,168,255,0.18); }
.entry-btn:nth-child(2):hover { border-color: var(--c-gold); box-shadow: 0 4px 18px rgba(247,169,37,0.22); }
.entry-btn:nth-child(3):hover { border-color: var(--c-mint); box-shadow: 0 4px 18px rgba(34,201,162,0.18); }
.entry-btn:nth-child(4):hover { border-color: var(--c-coral); box-shadow: 0 4px 18px rgba(255,93,115,0.18); }
.entry-btn.on { transform: translateY(-1px); }
.entry-btn:nth-child(1).on { border-color: var(--c-sky); background: rgba(78,168,255,0.12); box-shadow: 0 0 0 4px rgba(78,168,255,0.12); }
.entry-btn:nth-child(2).on { border-color: var(--c-gold); background: rgba(247,169,37,0.12); box-shadow: 0 0 0 4px rgba(247,169,37,0.14); }
.entry-btn:nth-child(3).on { border-color: var(--c-mint); background: rgba(34,201,162,0.12); box-shadow: 0 0 0 4px rgba(34,201,162,0.12); }
.entry-btn:nth-child(4).on { border-color: var(--c-coral); background: rgba(255,93,115,0.12); box-shadow: 0 0 0 4px rgba(255,93,115,0.12); }

/* ---------- 选择面板 ---------- */
.picker-pop {
  position: absolute; left: 10px; right: 10px; bottom: 100%;
  margin-bottom: 8px; z-index: 6;
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  box-shadow: var(--shadow-float);
  padding: 14px;
  max-height: 46vh; overflow-y: auto;
  animation: rise 0.25s ease both;
}
.pk-t { font-size: 12px; font-weight: 800; color: var(--ink-3); margin-bottom: 10px; }
.pk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pk-ind {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 700; color: var(--ink-2);
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  border-radius: 12px; padding: 9px 10px;
  transition: all 0.18s;
}
.pk-ind i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.pk-ind:hover { border-color: var(--c-gold); color: var(--c-gold); transform: translateY(-1px); }
.pk-list { display: flex; flex-direction: column; gap: 2px; }
.pk-strat {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 9px; border-radius: 12px; text-align: left;
  transition: background 0.15s;
}
.pk-strat:hover { background: var(--bg-soft); }
.pk-strat .avatar { width: 30px; height: 30px; flex: none; }
.pk-strat b { font-size: 13.5px; }
.pk-strat span { font-size: 11px; color: var(--ink-3); font-weight: 600; display: block; margin-top: 1px; }
.pk-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pk-row { display: flex; flex-wrap: wrap; gap: 7px; }
.pk-strat-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700; color: var(--ink-2);
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  border-radius: 999px; padding: 6px 12px 6px 7px;
  transition: all 0.18s;
}
.pk-strat-chip .avatar { width: 20px; height: 20px; }
.pk-strat-chip:hover { border-color: var(--c-gold); color: var(--c-gold); transform: translateY(-1px); }

/* ---------- 引导选择卡 ---------- */
.guide-card { padding: 13px; }
.guide-card .pk-ind { font-size: 12px; padding: 8px 6px; }
.guide-sec + .guide-sec { margin-top: 13px; padding-top: 12px; border-top: 1px dashed var(--line-soft); }
.guide-t { font-size: 12px; font-weight: 800; color: var(--ink-3); margin-bottom: 8px; }

/* ---------- 板块速览卡 ---------- */
.ov-card { padding-top: 14px; }
.ov-top {
  display: flex; align-items: center; gap: 14px;
  padding: 0 14px 12px;
  border-bottom: 1px solid var(--line-soft);
}
.ov-temp {
  width: 66px; height: 66px; border-radius: 20px; flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: color-mix(in srgb, var(--ot) 13%, transparent);
  border: 1.5px solid var(--ot);
}
.ov-temp b { font-size: 21px; font-weight: 900; color: var(--ot); font-family: var(--font-num); line-height: 1; }
.ov-temp span { font-size: 10px; font-weight: 700; color: var(--ot); }
.ov-name { font-size: 16.5px; font-weight: 900; }
.ov-meta { flex: 1; min-width: 0; }
.ov-sub { font-size: 12px; color: var(--ink-3); font-weight: 600; margin-top: 2px; }
.ov-best { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--ink-2); margin-top: 7px; }
.ov-best .avatar { width: 22px; height: 22px; }

/* ---------- 策略解读卡 ---------- */
.se-card .se-desc {
  padding: 0 14px 12px;
  font-size: 13.5px; color: var(--ink-2); line-height: 1.85;
}
.se-bt-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  padding: 0 14px 14px;
}
.se-bt-item {
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: 12px; padding: 10px 6px;
}
.se-bt-item b { display: block; font-size: 16px; font-weight: 900; font-family: var(--font-num); }
.se-bt-item span { font-size: 10.5px; color: var(--ink-3); font-weight: 700; }
.se-actions {
  display: flex; gap: 8px;
  padding: 10px 13px 13px;
}
.se-primary-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 800; color: #fff;
  background: var(--grad-brand);
  box-shadow: var(--shadow-pop);
  transition: transform 0.18s;
}
.se-primary-btn:hover { transform: scale(1.03); }
.se-primary-btn svg { width: 14px; height: 14px; }
.se-secondary-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 700; color: var(--ink-2);
  background: var(--bg-soft);
  border: 1.5px solid var(--line-soft);
  transition: all 0.2s;
}
.se-secondary-btn:hover { border-color: var(--c-gold); color: var(--c-gold); }

/* ---- 对比卡片 ---- */
.cmp-card { overflow: hidden; }
.cmp-head {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 0;
  padding: 14px 14px 0;
}
.cmp-stock { text-align: center; transition: background .2s; border-radius: 12px; padding: 6px; }
.cmp-stock:hover { background: var(--bg-soft); }
.cmp-s-name { font-size: 15px; font-weight: 800; color: var(--ink-1); }
.cmp-s-code { font-size: 11px; color: var(--ink-3); font-weight: 600; margin-top: 2px; }
.cmp-s-price { font-size: 16px; font-weight: 900; font-family: var(--font-num); margin-top: 4px; }
.cmp-s-price span { font-size: 12px; margin-left: 4px; }
.cmp-vs-badge {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-soft); color: var(--ink-2);
  font-size: 11px; font-weight: 900; margin: 0 auto;
  align-self: center;
}
.cmp-metrics { padding: 14px; }
.cmp-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-soft);
}
.cmp-row:last-child { border-bottom: none; }
.cmp-label { font-size: 11px; color: var(--ink-2); font-weight: 600; width: 64px; flex-shrink: 0; }
.cmp-val {
  flex: 1; text-align: center;
  font-size: 13px; font-weight: 700; font-family: var(--font-num);
  color: var(--ink-1);
}
.cmp-val.better { color: var(--c-gold); }
.cmp-vs { width: 20px; flex-shrink: 0; }
.cmp-conclusion {
  margin: 0 14px 14px;
  padding: 12px; background: var(--bg-soft);
  border-radius: var(--r-sm);
}
.cmp-conc-title { font-size: 12px; font-weight: 700; color: var(--ink-2); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.cmp-conc-title svg { width: 14px; height: 14px; color: var(--c-gold); }
.cmp-conc-row {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 11px; color: var(--ink-2); padding: 3px 0;
}
.cmp-conc-row span:last-child { font-weight: 700; color: var(--ink-1); text-align: right; }

@media (max-width: 560px) {
  .se-bt-row { grid-template-columns: repeat(2, 1fr); }
  .cmp-head { padding: 10px 10px 0; }
  .cmp-s-name { font-size: 13px; }
  .cmp-s-price { font-size: 14px; }
  .cmp-label { width: 48px; font-size: 10px; }
}

/* ============================================================
智能选股卡片
   ============================================================ */

/* ---- Diagnosis Card Shell ---- */
.diag-card {
  margin: 8px 0 4px;
  border-radius: 18px;
  overflow: hidden;
}
.diag-card.guide-card {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  padding: 18px;
}
.diag-card.result-card {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  padding: 0;
}
.diag-card-label {
  font-size: 14px; font-weight: 800; margin-bottom: 14px;
  display: flex; align-items: center; gap: 6px;
  color: var(--ink-1);
}
.diag-card-label svg { width: 16px; height: 16px; color: var(--c-gold); }

/* ---- Q1: Industry Grid ---- */
.diag-ind-search {
  width: 100%; box-sizing: border-box;
  padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: var(--bg-soft);
  font-size: 14px; font-family: inherit; color: var(--ink-1);
  margin-bottom: 12px; outline: none;
  transition: border-color .2s;
}
.diag-ind-search::placeholder { color: var(--ink-3); }
.diag-ind-search:focus { border-color: var(--c-gold); }

.diag-zone { margin-bottom: 4px; }
.diag-zone-header {
  display: flex; align-items: center; gap: 6px;
  width: 100%; padding: 8px 4px;
  background: none; border: none;
  font-family: inherit; cursor: pointer;
  color: var(--ink-2); font-size: 12px; font-weight: 700;
  letter-spacing: .3px;
  transition: opacity .15s;
}
.diag-zone-header:hover { opacity: .75; }
.diag-zone-label-text { flex-shrink: 0; }
.diag-zone-count {
  font-size: 11px; color: var(--ink-3); font-weight: 600;
  background: var(--bg-soft); border-radius: 999px;
  padding: 1px 8px; line-height: 1.6;
}
.diag-zone-arrow {
  margin-left: auto; transition: transform .2s;
  color: var(--ink-3); display: flex;
}
.diag-zone-arrow svg { width: 14px; height: 14px; }
.diag-zone .diag-ind-grid { display: none; }
.diag-zone.open .diag-ind-grid { display: grid; }
.diag-zone.open .diag-zone-arrow { transform: rotate(180deg); }

.diag-zone-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.diag-zone-dot.cold { background: #22C9A2; box-shadow: 0 0 6px rgba(34,201,162,0.4); }
.diag-zone-dot.warm { background: #F7A925; box-shadow: 0 0 6px rgba(247,169,37,0.4); }
.diag-zone-dot.hot { background: #FF5D73; box-shadow: 0 0 6px rgba(255,93,115,0.4); }

.diag-ind-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.diag-ind-chip {
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 8px; border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: var(--bg-soft);
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}
.diag-ind-chip:hover {
  border-color: var(--c-gold);
  box-shadow: var(--shadow-card);
}
.diag-ind-temp { font-size: 11px; font-weight: 800; font-family: var(--font-num); margin-bottom: 2px; }
.diag-ind-name { font-size: 14px; font-weight: 700; color: var(--ink-1); }
.diag-ind-count { font-size: 11px; color: var(--ink-3); margin-top: 2px; font-weight: 600; }
.diag-ind-universal { margin-top: 10px; }
.diag-ind-all { background: var(--grad-brand); color: #fff; border: none; }
.diag-ind-all .diag-ind-name { color: #fff; }
.diag-ind-auto {
  background: rgba(247,169,37,0.08);
  border-color: rgba(247,169,37,0.2);
}
.diag-ind-auto .diag-ind-name { color: var(--c-gold); font-size: 13px; }

/* ---- 聊天行业选择器：搜索 + 分区折叠 ---- */
.pk-ind-search {
  width: 100%; box-sizing: border-box;
  padding: 9px 13px; border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: var(--bg-soft);
  font-size: 13.5px; font-family: inherit; color: var(--ink-1);
  margin-bottom: 10px; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.pk-ind-search::placeholder { color: var(--ink-3); }
.pk-ind-search:focus { border-color: var(--c-gold); box-shadow: 0 0 0 4px rgba(247,169,37,0.14); }

.pk-zones .diag-zone .pk-zone-grid { display: none; }
.pk-zones .diag-zone.open .pk-zone-grid { display: grid; }
.pk-zones .diag-zone.open .diag-zone-arrow { transform: rotate(180deg); }

.pk-more {
  display: block; width: 100%; margin: 6px 0 2px;
  padding: 7px 0; border: 1px dashed var(--line-strong);
  border-radius: 10px; background: none;
  font-family: inherit; font-size: 12px; font-weight: 700;
  color: var(--ink-3); cursor: pointer;
  transition: color .15s, border-color .15s;
}
.pk-more:hover { color: var(--c-gold); border-color: var(--c-gold); }

.guide-ind-note { margin-top: 8px; font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.diag-ind-auto svg { width: 14px; height: 14px; color: var(--c-gold); margin-right: 4px; vertical-align: middle; }

/* ---- Q2: Style Chips ---- */
.diag-style-list {
  display: flex; flex-direction: column; gap: 8px;
}
.diag-style-chip {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 14px 16px; border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: var(--bg-soft);
  cursor: pointer; transition: all .2s;
  font-family: inherit; text-align: left;
}
.diag-style-chip:hover {
  border-color: var(--c-gold);
  box-shadow: var(--shadow-card);
  transform: translateX(3px);
}
.diag-style-chip b { font-size: 15px; font-weight: 800; color: var(--ink-1); }
.diag-style-chip span { font-size: 12px; color: var(--ink-3); margin-top: 2px; font-weight: 600; }

/* ---- Entry: Two Big Route Buttons ---- */
.diag-entry-options {
  display: flex; flex-direction: column; gap: 10px;
}
.diag-entry-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 16px 18px; border-radius: 14px;
  border: 1.5px solid var(--line-soft);
  background: var(--bg-soft);
  cursor: pointer; transition: all .2s;
  font-family: inherit; text-align: left;
}
.diag-entry-btn:hover { border-color: var(--c-gold); box-shadow: var(--shadow-card); transform: translateX(3px); }
.diag-entry-btn b { font-size: 15px; font-weight: 800; color: var(--ink-1); }
.diag-entry-btn > span { font-size: 12px; color: var(--ink-3); font-weight: 600; line-height: 1.5; }
.diag-entry-icon-wrap {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--bg-glass); display: grid; place-items: center; margin-bottom: 2px;
}
.diag-entry-icon-wrap svg { width: 18px; height: 18px; color: var(--c-gold); }
.diag-entry-btn.route-a { border-left: 3px solid var(--c-gold); }
.diag-entry-btn.route-b { border-left: 3px solid var(--c-gold); }

/* ---- Strategy Block (result cards) ---- */
.diag-strat-block {
  padding: 0;
  border-bottom: 1px solid var(--line-soft);
}
.diag-strat-block.winner {
  background: linear-gradient(135deg, rgba(247,169,37,0.06), transparent);
}
.diag-strat-block:last-of-type { border-bottom: none; }

.diag-strat-hdr {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
}
.diag-strat-rank {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--bg-soft); color: var(--ink-2);
  font-size: 13px; font-weight: 900; font-family: var(--font-num);
  display: grid; place-items: center; flex-shrink: 0;
}
.diag-strat-rank.gold { background: var(--grad-brand); color: #fff; }
.diag-strat-info { flex: 1; min-width: 0; }
.diag-strat-info b { display: block; font-size: 14px; font-weight: 800; color: var(--ink-1); }
.diag-strat-info span { font-size: 11px; color: var(--ink-3); font-weight: 600; }
.diag-strat-metrics-mini {
  display: flex; gap: 10px; flex-shrink: 0;
  font-size: 12px; font-weight: 700; font-family: var(--font-num); color: var(--ink-1);
}
.diag-strat-metrics-mini .masked .blur { filter: blur(4px); }

.diag-strat-body {
  padding: 0 18px 12px;
}
.diag-strat-why {
  font-size: 12px; color: var(--ink-2); font-weight: 600;
  line-height: 1.6; margin-bottom: 6px;
  padding: 8px 12px; background: var(--bg-soft); border-radius: 8px;
}
.diag-strat-why span {
  font-size: 10.5px; font-weight: 800; color: var(--c-gold);
  display: block; margin-bottom: 2px; text-transform: uppercase; letter-spacing: .5px;
}
.diag-strat-procon {
  display: flex; flex-direction: column; gap: 3px;
  font-size: 11.5px; font-weight: 600; line-height: 1.5;
}
.diag-pro { color: var(--c-mint); display: flex; align-items: center; gap: 4px; }
.diag-con { color: var(--c-rose); display: flex; align-items: center; gap: 4px; }
.diag-pro svg, .diag-con svg { width: 11px; height: 11px; flex-shrink: 0; }

.diag-strat-stocks {
  padding: 0 18px 12px;
}
.diag-strat-stocks-label {
  font-size: 11.5px; font-weight: 700; color: var(--ink-2);
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px;
}
.diag-strat-inds {
  padding: 0 18px 12px;
}
.diag-strat-inds-label {
  font-size: 11.5px; font-weight: 700; color: var(--ink-2);
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px;
}

/* ---- Stock Row (shared) ---- */
.diag-stock-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 10px;
  cursor: pointer; transition: background .15s;
}
.diag-stock-row:hover { background: var(--bg-soft); }
.diag-stock-idx {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--bg-soft); color: var(--ink-2);
  font-size: 11px; font-weight: 800;
  display: grid; place-items: center; flex-shrink: 0;
}
.diag-stock-name { font-size: 13px; font-weight: 700; color: var(--ink-1); white-space: nowrap; }
.diag-stock-name.masked .blur { filter: blur(4px); }
.diag-stock-code { font-size: 10.5px; color: var(--ink-3); flex-shrink: 0; }
.diag-stock-reason {
  font-size: 10.5px; color: var(--ink-3); font-weight: 600;
  margin-left: auto; text-align: right; max-width: 120px;
  line-height: 1.3;
}
.diag-stock-arrow { color: var(--ink-3); flex: none; }
.diag-stock-arrow svg { width: 12px; height: 12px; }
.lock-chip {
  font-size: 10px; font-weight: 700; color: var(--c-gold);
  background: rgba(247,169,37,0.1);
  padding: 3px 7px; border-radius: 100px; flex-shrink: 0;
}

/* ---- Industry Mini Row (Route B) ---- */
.diag-ind-mini {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 8px;
}
.diag-ind-mini:hover { background: var(--bg-soft); }
.diag-ind-mini-rank {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--bg-soft); color: var(--ink-3);
  font-size: 10px; font-weight: 800;
  display: grid; place-items: center; flex-shrink: 0;
}
.diag-ind-mini-name { font-size: 13px; font-weight: 700; color: var(--ink-1); }
.diag-ind-mini-temp { font-size: 11px; font-weight: 800; font-family: var(--font-num); flex-shrink: 0; }
.diag-ind-mini-calmar { font-size: 11px; color: var(--ink-3); margin-left: auto; font-weight: 600; }

/* ---- Demo Note ---- */
.diag-demo-note {
  margin: 12px 18px; padding: 10px 14px;
  background: rgba(247,169,37,0.06);
  border: 1px solid rgba(247,169,37,0.15);
  border-radius: 10px;
  font-size: 11.5px; color: var(--c-gold);
  display: flex; align-items: center; gap: 6px;
  font-weight: 600;
}
.diag-demo-note svg { width: 14px; height: 14px; flex: none; }

/* ---- Footer Buttons ---- */
.diag-foot {
  padding: 14px 18px;
  display: flex; gap: 8px; flex-wrap: wrap;
}
.diag-foot-btn {
  padding: 9px 16px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: all .2s;
  display: inline-flex; align-items: center; gap: 5px;
}
.diag-foot-btn.primary {
  background: var(--grad-brand); color: #fff;
  border: none; box-shadow: var(--shadow-pop);
}
.diag-foot-btn.primary:hover { transform: translateY(-1px); }
.diag-foot-btn:not(.primary) {
  background: var(--bg-soft); color: var(--ink-2);
  border: 1px solid var(--line-strong);
}
.diag-foot-btn:not(.primary):hover { border-color: var(--c-gold); }
.diag-foot-btn svg { width: 13px; height: 13px; }

/* ---- Trust Note ---- */
.diag-trust {
  padding: 12px 18px;
  font-size: 11px; color: var(--ink-3);
  line-height: 1.6; font-weight: 600;
  display: flex; gap: 6px;
}
.diag-trust svg { width: 14px; height: 14px; color: var(--c-gold); flex: none; margin-top: 1px; }

/* ---- Mobile ---- */
@media (max-width: 560px) {
  .diag-entry-btn { padding: 14px; }
  .diag-entry-btn b { font-size: 14px; }
  .diag-ind-search { font-size: 13px; padding: 9px 12px; }
  .diag-ind-grid { grid-template-columns: repeat(2, 1fr); }
  .diag-ind-chip { padding: 11px 6px; }
  .diag-ind-name { font-size: 13px; }
  .diag-ind-temp { font-size: 10px; }
  .diag-strat-hdr { padding: 10px 12px; gap: 8px; }
  .diag-strat-body { padding: 0 12px 10px; }
  .diag-strat-stocks { padding: 0 12px 10px; }
  .diag-strat-inds { padding: 0 12px 10px; }
  .diag-strat-metrics-mini { font-size: 11px; gap: 6px; }
  .diag-strat-info b { font-size: 13px; }
  .diag-stock-reason { display: none; }
  .diag-foot { flex-direction: column; }
  .diag-foot-btn { justify-content: center; }
}

/* ---------- Markdown 渲染内容样式（气泡内） ---------- */
.md-rendered { line-height: 1.78; word-break: break-word; }

.md-rendered .md-h2 {
  font-size: 16px; font-weight: 800; color: var(--ink-1);
  margin: 22px 0 10px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
  letter-spacing: 0.01em;
}
.md-rendered .md-h2:first-child { margin-top: 4px; }
.md-rendered .md-h3 {
  font-size: 14.5px; font-weight: 800; color: var(--ink-1);
  margin: 16px 0 6px;
}

.md-rendered .md-bold { color: var(--ink-1); font-weight: 800; }

.md-rendered .md-p { margin: 0 0 10px; }
.md-rendered .md-p:last-child { margin-bottom: 0; }

.md-rendered .md-table-wrap {
  margin: 12px -2px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-radius: 12px; border: 1px solid var(--line-soft);
  background: var(--bg-card);
}
.md-rendered .md-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.md-rendered .md-table th {
  background: var(--bg-soft); color: var(--ink-2);
  font-weight: 700; font-size: 11.5px; text-align: left;
  padding: 9px 12px; white-space: nowrap;
  letter-spacing: 0.03em; text-transform: uppercase;
}
.md-rendered .md-table td {
  padding: 8px 12px; color: var(--ink-1); font-weight: 600;
  border-top: 1px solid var(--line-soft);
  font-family: var(--font-num); font-size: 13px;
}
.md-rendered .md-table tr:first-child td { border-top: none; }
.md-rendered .md-table tr:hover td { background: rgba(247,169,37,0.03); }

.md-rendered .md-ul {
  margin: 8px 0; padding-left: 18px; list-style: none;
}
.md-rendered .md-li {
  position: relative; padding: 4px 0 4px 4px; font-size: 14px;
}
.md-rendered .md-li::before {
  content: ''; position: absolute; left: -14px; top: 12px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--c-gold); opacity: 0.7;
}

.md-rendered .md-code {
  background: var(--bg-soft); color: var(--c-coral);
  padding: 2px 7px; border-radius: 5px; font-size: 13px;
  font-family: var(--font-num); font-weight: 600;
}

.md-rendered .md-hr {
  border: none; border-top: 1px dashed var(--line-soft);
  margin: 18px 0;
}

/* ============================================================
   双栏联动：卡片「正在右侧展示」标记 + 超量 mini 卡
   ============================================================ */
.rk-card { position: relative; }
.rk-card.fc-live {
  border-color: rgba(247,169,37,.6);
  box-shadow: 0 0 0 1.5px rgba(247,169,37,.5), var(--shadow-card);
}
.rk-card.fc-live::after {
  content: '正在右侧展示';
  position: absolute; top: -9px; right: 14px; z-index: 2;
  font-size: 10px; font-weight: 800; letter-spacing: .02em;
  color: #0F1014; background: var(--c-gold);
  padding: 2.5px 10px; border-radius: 999px;
  box-shadow: 0 2px 10px rgba(247,169,37,.45);
  animation: fcLiveIn .3s cubic-bezier(.22,.9,.3,1);
}
@keyframes fcLiveIn {
  from { opacity: 0; transform: translateY(4px) scale(.9); }
  to   { opacity: 1; transform: none; }
}
@media (max-width: 1023px) {
  .rk-card.fc-live::after { content: '已在下方打开'; }
}

/* 超量工具卡：紧凑 mini 条（第 4 张起） */
.fc-mini {
  display: flex; align-items: center; gap: 9px;
  margin-top: 8px; padding: 8px 12px;
  background: var(--bg-tint);
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  font-size: 12.5px;
}
.fc-mini-ic { display: inline-flex; color: var(--c-gold); flex: none; }
.fc-mini-ic svg { width: 15px; height: 15px; }
.fc-mini-t { flex: 1; min-width: 0; font-weight: 700; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-mini-btn {
  flex: none; display: inline-flex; align-items: center; gap: 3px;
  font-size: 11.5px; font-weight: 800; color: var(--c-gold);
  background: rgba(247,169,37,.10);
  border: 1px solid rgba(247,169,37,.35);
  padding: 4px 10px; border-radius: 999px; cursor: pointer;
  transition: background .18s, transform .18s;
}
.fc-mini-btn:hover { background: rgba(247,169,37,.18); transform: translateY(-1px); }
.fc-mini-btn svg { width: 12px; height: 12px; }

/* 配额用尽 CTA（克制：一句话 + 一个按钮） */
.quota-cta { margin-top: 10px; }
.quota-cta-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 800; color: #3A2A08;
  background: var(--grad-gold);
  border: none; cursor: pointer;
  padding: 9px 16px; border-radius: 999px;
  box-shadow: 0 3px 12px rgba(247, 169, 37, 0.35);
  transition: transform 0.18s;
}
.quota-cta-btn:hover { transform: translateY(-1px); }
.quota-cta-btn svg { width: 14px; height: 14px; }

/* ---- 大师身份在 chat 卡片内 ---- */
.rk-st-persona { flex: 2; display: flex; align-items: center; gap: 7px; min-width: 0; }
.rk-st-persona .avatar { width: 26px; height: 26px; box-shadow: none; }
.rk-st-id { display: flex; flex-direction: column; min-width: 0; }
.rk-st-id b { font-size: 12.5px; font-weight: 700; color: var(--ink-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-st-id span { font-size: 10px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.rk-fit-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px;
}
.rk-fit-row .persona { flex: 1; min-width: 0; }
.rk-fit-row .fit-ring { width: 44px; }
.rk-fit-row .fit-num { font-size: 12px; }
.rk-card .persona .avatar { box-shadow: none; }

/* ============================================================
   对话体验升级：消息操作行 / 进度清单 / 欢迎卡 / 日期分隔 / 回最新
   ============================================================ */

/* ---------- 消息操作行：复制 + 👍👎（图标常显灰、hover 金） ---------- */
.msg-actions { display: inline-flex; align-items: center; gap: 2px; margin-top: 8px; }
.msg-act {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  color: var(--ink-3); background: transparent; border: none;
  cursor: pointer; padding: 0; font-family: inherit;
  transition: background .18s, color .18s, transform .18s;
}
.msg-act svg { width: 15px; height: 15px; }
.msg-act:hover { background: var(--bg-soft); color: var(--c-gold); transform: translateY(-1px); }
.msg-act.on { color: var(--c-gold); }
.msg-act.on:hover { background: rgba(247,169,37,.10); }
.msg-act:disabled { cursor: default; }
.msg-act:disabled:hover { background: transparent; transform: none; }

/* ---------- 工具进度清单 ---------- */
.prog-list { font-size: 13px; line-height: 2.1; color: var(--ink-2); font-weight: 600; }
.prog-item { display: flex; align-items: center; gap: 9px; }
.prog-item.is-done { color: var(--ink-3); }
.prog-done { color: #1a9c6b; font-weight: 800; width: 14px; text-align: center; flex: none; }
.prog-dot {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: var(--c-gold); margin: 0 3.5px;
  animation: progPulse 1.1s ease-in-out infinite;
}
@keyframes progPulse {
  0%, 100% { transform: scale(.75); opacity: .45; }
  50%      { transform: scale(1.1); opacity: 1; box-shadow: 0 0 0 4px rgba(247,169,37,.14); }
}

/* ---------- 空会话欢迎卡（居中英雄区，ChatGPT 式冷启动） ---------- */
.welcome-msg { justify-content: center; max-width: 620px; width: 100%; margin: 4vh auto 0; }
.welcome-msg .wc-inner {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 18px 16px 8px; gap: 7px;
  animation: rise .5s ease both;
}
.welcome-msg .wc-avatar {
  width: 66px; height: 66px;
  filter: drop-shadow(0 8px 22px rgba(247,169,37,.32));
}
.welcome-msg .wc-name {
  display: flex; align-items: center; gap: 9px;
  font-size: 20px; font-weight: 900; margin-top: 8px;
}
.welcome-msg .wc-name span {
  font-size: 11px; font-weight: 700; color: var(--c-gold);
  background: rgba(247,169,37,.10);
  border: 1px solid rgba(247,169,37,.30);
  padding: 2.5px 10px; border-radius: 999px;
}
.welcome-msg .wc-tag {
  font-size: 13.5px; color: var(--ink-3); font-weight: 600;
  line-height: 1.8; max-width: 420px;
}
.welcome-msg .wc-chips {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin-top: 14px;
}

/* ---------- 跨天日期分隔线 ---------- */
.day-sep {
  display: flex; align-items: center; gap: 12px;
  color: var(--ink-3); font-size: 11px; font-weight: 700;
  margin: 4px 0 -6px; user-select: none;
}
.day-sep::before, .day-sep::after { content: ''; flex: 1; height: 1px; background: var(--line-soft); }
.day-sep span { padding: 3px 12px; border-radius: 999px; background: var(--bg-soft); }

/* ---------- 「回最新」悬浮钮（用户上翻时出现于输入区上方） ---------- */
.jump-latest {
  position: absolute; left: 50%; transform: translateX(-50%);
  top: -46px; z-index: 6;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 800; font-family: inherit;
  color: var(--ink-2);
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 8px 15px;
  box-shadow: var(--shadow-pop); cursor: pointer;
  animation: rise .25s ease both;
  transition: color .2s, border-color .2s;
}
.jump-latest:hover { color: var(--c-gold); border-color: var(--c-gold); }
.jump-latest svg { width: 13px; height: 13px; }
.jump-latest[hidden] { display: none; }

/* ---------- 多行输入框：textarea 自增高，Enter 发送 / Shift+Enter 换行 ---------- */
.co-inputbar textarea,
.chat-inputbar textarea {
  flex: 1; font-size: 15px; min-width: 0;
  background: transparent; position: relative; z-index: 1;
  border: none; outline: none; resize: none;
  padding: 0; margin: 0;
  font-family: inherit; line-height: 1.55; color: var(--ink-1);
  max-height: 120px; overflow-y: auto;
}
.co-inputbar textarea::placeholder,
.chat-inputbar textarea::placeholder { color: var(--ink-3); font-weight: 500; }
.co-inputbar .field,
.chat-inputbar .field { align-items: flex-end; }

/* ============================================================
   美工升级 v2：AI 去气泡全宽排版 / 小牛品牌环 / 徽章 / 排印 / 微动效
   （追加在文件末尾，同特异性下靠源序覆盖上文）
   ============================================================ */

/* ---------- 策略徽章：会话内唯一角色是小牛，策略用色块字徽 ---------- */
.mono-badge {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; font-size: 13px;
  border: 1px solid; border-radius: 9px;
  font-weight: 800; line-height: 1;
}
.pk-strat .mono-badge { margin-top: 1px; }
.rk-st-persona .mono-badge { box-shadow: none; }
.persona .mono-badge { flex: none; }

/* ---------- AI 回复去气泡：全宽自由排版（主流 AI 产品形态） ---------- */
.msg.ai { max-width: 100%; }
.msg.ai .bubble {
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  border-radius: 0;
  padding: 1px 0 0;
  overflow: visible;
  font-size: 15px; line-height: 1.85; color: var(--ink-1);
}
.msg.ai .bubble::before { display: none; }

/* 思考中：轻胶囊，与正文形态区分 */
.msg.ai-think .bubble .think-row {
  display: inline-flex;
  background: var(--bg-glass);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 8px 16px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}

/* 用户气泡微调：更立体的投影，与自由排版正文形成对比 */
.msg.user .bubble { box-shadow: 0 4px 18px rgba(255, 107, 157, 0.28); }

/* ---------- 小牛品牌环：任何位置的 AI 头像都带金色描边，一眼可辨 ---------- */
.msg:not(.user) > .avatar {
  box-shadow: 0 0 0 1.5px rgba(247, 169, 37, 0.5), 0 4px 14px rgba(247, 169, 37, 0.22);
}

/* ---------- 排印精修：正文 15px/1.85 高对比，标题层级清晰 ---------- */
.msg.ai .md-rendered {
  font-size: 15px; line-height: 1.85; color: var(--ink-1);
  letter-spacing: 0.005em;
}
.md-rendered .md-h2 {
  font-size: 16.5px; font-weight: 800;
  letter-spacing: 0.01em;
}
.md-rendered .md-h3 { font-size: 15px; font-weight: 800; }
.md-rendered .md-li { font-size: inherit; padding: 4.5px 0 4.5px 4px; }
.md-rendered .md-p { margin: 0 0 11px; }
@media (max-width: 1023px) {
  .msg.ai .bubble, .msg.ai .md-rendered { font-size: 14.5px; }
}

/* ---------- 消息入场微动效 ---------- */
@keyframes msgIn {
  from { opacity: 0; transform: translateY(9px); }
  to   { opacity: 1; transform: none; }
}
.co-scroll .msg, .chat-pane .chat-scroll .msg {
  animation: msgIn 0.34s cubic-bezier(0.22, 0.9, 0.3, 1) both;
}
.msg-actions { animation: rise 0.28s ease both; }
@media (prefers-reduced-motion: reduce) {
  .co-scroll .msg, .chat-pane .chat-scroll .msg, .msg-actions { animation: none; }
  .welcome-msg .wc-avatar { animation: none !important; }
}

/* ---------- 欢迎卡光环呼吸 ---------- */
@keyframes haloBreath {
  0%, 100% { filter: drop-shadow(0 6px 18px rgba(247, 169, 37, 0.28)); transform: scale(1); }
  50%      { filter: drop-shadow(0 10px 30px rgba(247, 169, 37, 0.5)); transform: scale(1.04); }
}
.welcome-msg .wc-avatar { animation: haloBreath 3.8s ease-in-out infinite; }

/* ---------- 追问 chips：上浮代替缩压 ---------- */
.schip:hover {
  border-color: var(--c-gold); color: var(--c-gold);
  transform: translateY(-1.5px);
  background: rgba(247, 169, 37, 0.06);
}
.schip:active { transform: scale(0.97); }

/* ---------- 发送键按压反馈 ---------- */
.co-inputbar .send-btn:active,
.chat-inputbar .send-btn:active { transform: scale(0.9); transition-duration: 0.08s; }

/* ---------- 聊天内滚动条：细金线，不抢内容 ---------- */
.co-scroll,
.chat-pane .chat-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(247, 169, 37, 0.26) transparent;
}
.co-scroll::-webkit-scrollbar,
.chat-pane .chat-scroll::-webkit-scrollbar,
.co-inputbar textarea::-webkit-scrollbar,
.chat-inputbar textarea::-webkit-scrollbar { width: 5px; height: 5px; }
.co-scroll::-webkit-scrollbar-thumb,
.chat-pane .chat-scroll::-webkit-scrollbar-thumb,
.co-inputbar textarea::-webkit-scrollbar-thumb,
.chat-inputbar textarea::-webkit-scrollbar-thumb {
  background: rgba(247, 169, 37, 0.24); border-radius: 999px;
}
.co-scroll:hover::-webkit-scrollbar-thumb,
.chat-pane .chat-scroll:hover::-webkit-scrollbar-thumb { background: rgba(247, 169, 37, 0.42); }
.co-scroll::-webkit-scrollbar-track,
.chat-pane .chat-scroll::-webkit-scrollbar-track { background: transparent; }
