﻿@charset "utf-8";
/* ============================================================
   hb-ai.css  —  控制页右侧「AI分析」面板重排版
   原则：只做布局/间距/字号/配色，不改 DOM、不改业务逻辑
   结构锚点由 hb-ai.js 打 class（.hb-ai-panel / .hb-ai-stats ...）
   ============================================================ */

/* ---------- 面板根 ---------- */
.hb-ai-panel{ position:relative; min-width:0; }

/* 外壳：把原本「卡片套卡片」的两层内边距收掉 */
.hb-ai-panel .hb-ai-shell{
  padding:0 !important;
  gap:0 !important;
  border:0 !important;
  border-radius:0 !important;
  background:transparent !important;
  box-shadow:none !important;
  height:100% !important;
}
.hb-ai-panel .hb-ai-body{
  padding:10px 12px 12px !important;
  gap:8px !important;
  min-height:0 !important;
}

/* ---------- 头部 ---------- */
.hb-ai-panel .hb-ai-head{
  padding:0 2px 9px !important;
  gap:8px !important;
  align-items:center !important;
  border-bottom:1px solid #edf2fa !important;
  flex-wrap:nowrap !important;
}
.hb-ai-panel .hb-ai-head > div:first-child{ gap:7px !important; min-width:0; }
.hb-ai-panel .hb-ai-head > div:first-child > span:not(.inline-flex){
  font-size:14px !important;
  font-weight:700 !important;
  letter-spacing:-.01em !important;
  color:#0e1a31 !important;
  white-space:nowrap;
}
.hb-ai-panel .hb-ai-head > div:first-child > svg{
  width:15px !important; height:15px !important; color:#2563eb !important; flex:none;
}
.hb-ai-panel .hb-ai-head span.inline-flex{
  height:19px !important;
  padding:0 7px !important;
  font-size:10px !important;
  font-weight:600 !important;
  border-radius:6px !important;
  background:#e9f9f0 !important;
  color:#0b8f63 !important;
  border:1px solid #c6efdb !important;
  box-shadow:none !important;
  white-space:nowrap;
}
.hb-ai-panel .hb-ai-head button{
  height:28px !important;
  padding:0 10px !important;
  border-radius:8px !important;
  font-size:11.5px !important;
  font-weight:600 !important;
  gap:4px !important;
  box-shadow:none !important;
  transition:background .15s ease,border-color .15s ease,color .15s ease !important;
}
.hb-ai-panel .hb-ai-head button svg{ width:12px !important; height:12px !important; }
.hb-ai-panel .hb-ai-head button:first-of-type{
  background:#fff !important;
  border:1px solid #e2eaf7 !important;
  color:#42536e !important;
}
.hb-ai-panel .hb-ai-head button:first-of-type:hover{
  border-color:#c5d8f7 !important; color:#1d4ed8 !important; background:#f7faff !important;
}
.hb-ai-panel .hb-ai-head button:last-of-type{
  background:linear-gradient(180deg,#3b82f6,#2563eb) !important;
  border:1px solid #2563eb !important;
  color:#fff !important;
}
.hb-ai-panel .hb-ai-head button:last-of-type:hover{
  background:linear-gradient(180deg,#2f74e8,#1d4ed8) !important;
}

/* ---------- 滚动区 ---------- */
.hb-ai-panel .hb-ai-inner{
  padding-right:2px !important;
  overscroll-behavior:contain;
}
.hb-ai-panel .hb-ai-inner > *{ margin-top:0 !important; margin-bottom:0 !important; }
.hb-ai-panel .hb-ai-inner > * + *{ margin-top:9px !important; }
.hb-ai-panel .hb-ai-inner::-webkit-scrollbar{ width:6px; }
.hb-ai-panel .hb-ai-inner::-webkit-scrollbar-track{ background:transparent; }
.hb-ai-panel .hb-ai-inner::-webkit-scrollbar-thumb{
  background:#dde6f3; border-radius:99px; border:1px solid #fff;
}
.hb-ai-panel .hb-ai-inner::-webkit-scrollbar-thumb:hover{ background:#c7d5ea; }

/* ---------- 6 个统计卡：3 列 × 2 行，等高 ---------- */
.hb-ai-panel .hb-ai-stats{
  display:grid !important;
  grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  grid-auto-rows:minmax(80px,auto) !important;
  gap:7px !important;
  align-items:stretch !important;
}
.hb-ai-panel .hb-ai-stats > [data-slot="card"]{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  min-width:0 !important;
  min-height:72px !important;
  padding:9px 7px !important;
  gap:0 !important;
  border:1px solid #e8eefa !important;
  border-radius:12px !important;
  background:linear-gradient(180deg,#fbfdff 0%,#f5f9ff 100%) !important;
  box-shadow:0 1px 2px rgba(12,18,34,.03) !important;
}
.hb-ai-panel .hb-ai-stats > [data-slot="card"] > [data-slot="card-content"]{
  display:flex !important;
  flex-direction:column !important;
  align-items:stretch !important;
  justify-content:center !important;
  gap:2px !important;
  width:100% !important;
  min-width:0 !important;
  padding:0 !important;
}
.hb-ai-panel .hb-ai-stats .text-3xl{
  font-size:21px !important; line-height:1.12 !important; font-weight:700 !important;
  color:#0e1a31 !important; text-align:center !important; letter-spacing:-.02em !important;
  font-variant-numeric:tabular-nums;
}
.hb-ai-panel .hb-ai-stats .text-lg{
  font-size:16.5px !important; line-height:1.2 !important; font-weight:700 !important;
  text-align:center !important; letter-spacing:-.01em !important;
  font-variant-numeric:tabular-nums;
}
.hb-ai-panel .hb-ai-stats span.inline-flex{
  height:17px !important; padding:0 6px !important; margin:1px auto 0 !important;
  font-size:9.5px !important; font-weight:600 !important; border-radius:5px !important;
  background:#fff6e6 !important; color:#b45309 !important; border:1px solid #ffe4b8 !important;
  line-height:15px !important;
}
.hb-ai-panel .hb-ai-stats div.text-xs{
  font-size:10.5px !important; line-height:1.3 !important; color:#8b97ab !important;
  text-align:center !important; margin-top:1px !important;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.hb-ai-panel .hb-ai-stats div.flex.items-center.gap-1{ justify-content:center !important; }
.hb-ai-panel .hb-ai-stats div.flex.items-center.gap-1 > svg{
  width:14px !important; height:14px !important;
}
/* 储蓄率卡 */
.hb-ai-panel .hb-ai-stats div.flex.items-center.justify-between{
  gap:6px !important; margin-bottom:5px !important;
}
.hb-ai-panel .hb-ai-stats div.flex.items-center.justify-between > span:first-child{
  font-size:10px !important; color:#8b97ab !important; white-space:nowrap;
}
.hb-ai-panel .hb-ai-stats div.flex.items-center.justify-between > span:last-child{
  font-size:13px !important; font-weight:700 !important; color:#0e1a31 !important;
}

/* ---------- 银行 / 风险 两栏收纳 ---------- */
.hb-ai-panel .hb-ai-row{ display:block !important; margin:0 !important; }
.hb-ai-panel .hb-ai-row > div{ width:100% !important; min-width:0 !important; }
.hb-ai-panel .hb-ai-row > div:empty{ display:none !important; }
.hb-ai-panel .hb-ai-row > div > *{ margin-top:0 !important; margin-bottom:0 !important; }
.hb-ai-panel .hb-ai-row > div > * + *{ margin-top:8px !important; }

.hb-ai-panel .hb-ai-bank,
.hb-ai-panel .hb-ai-risk,
.hb-ai-panel .hb-ai-summary{
  padding:0 !important;
  gap:0 !important;
  border-radius:14px !important;
  background:#fff !important;
  border:1px solid #e8eefa !important;
  box-shadow:0 1px 2px rgba(12,18,34,.03) !important;
  overflow:hidden;
}
.hb-ai-panel .hb-ai-bank > [data-slot="card-content"],
.hb-ai-panel .hb-ai-risk > [data-slot="card-content"],
.hb-ai-panel .hb-ai-summary > [data-slot="card-content"]{
  padding:12px !important;
}

/* 银行账户：3 个账户横排小卡 */
.hb-ai-panel .hb-ai-bank{ border-color:#e4ecfb !important; }
.hb-ai-panel .hb-ai-bank > [data-slot="card-content"]{
  display:grid !important;
  grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  gap:7px !important;
}
.hb-ai-panel .hb-ai-bank > [data-slot="card-content"] > *:first-child{
  grid-column:1/-1 !important;
  display:flex !important; align-items:center !important; gap:5px !important;
  margin:0 0 1px !important;
  font-size:12px !important; font-weight:600 !important; color:#0e1a31 !important;
}
.hb-ai-panel .hb-ai-bank > [data-slot="card-content"] > *:first-child > svg{
  width:14px !important; height:14px !important; color:#2563eb !important; flex:none;
}
.hb-ai-panel .hb-ai-bank > [data-slot="card-content"] > *:not(:first-child){
  display:flex !important;
  flex-direction:column !important;
  align-items:flex-start !important;
  gap:3px !important;
  min-width:0 !important;
  margin:0 !important;
  padding:8px 9px !important;
  border:1px solid #eef3fc !important;
  border-radius:10px !important;
  background:#f8fbff !important;
  font-size:11px !important;
  line-height:1.35 !important;
  overflow:hidden;
}
.hb-ai-panel .hb-ai-bank > [data-slot="card-content"] > *:not(:first-child) > *:first-child{
  max-width:100% !important;
  font-size:10.5px !important;
  line-height:1.35 !important;
  color:#7a879c !important;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.hb-ai-panel .hb-ai-bank > [data-slot="card-content"] > *:not(:first-child) > *:last-child{
  font-size:13px !important;
  font-weight:700 !important;
  line-height:1.2 !important;
  color:#0b9e6a !important;
  white-space:nowrap;
}

/* 风险警告：2 列紧凑胶囊 */
.hb-ai-panel .hb-ai-risk{
  border-color:#fbdede !important;
  background:linear-gradient(180deg,#fffafa 0%,#fff 100%) !important;
}
.hb-ai-panel .hb-ai-risk > [data-slot="card-content"]{
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:6px !important;
}
.hb-ai-panel .hb-ai-risk > [data-slot="card-content"] > *:first-child{
  grid-column:1/-1 !important;
  display:flex !important; align-items:center !important; gap:5px !important;
  margin:0 0 2px !important;
  font-size:12px !important; font-weight:600 !important; color:#dc2626 !important;
}
.hb-ai-panel .hb-ai-risk > [data-slot="card-content"] > *:first-child > svg{
  width:14px !important; height:14px !important; flex:none;
}
.hb-ai-panel .hb-ai-risk > [data-slot="card-content"] > *:not(:first-child){
  margin:0 !important;
  padding:7px 9px !important;
  background:#fef4f4 !important;
  border:1px solid #fbe0e0 !important;
  border-radius:9px !important;
  color:#b42318 !important;
  font-size:10.8px !important;
  line-height:1.55 !important;
  word-break:break-word;
  overflow-wrap:anywhere;
}
.hb-ai-panel .hb-ai-risk > [data-slot="card-content"] > *:last-child{
  grid-column:1/-1 !important;
}

/* AI 总结 */
.hb-ai-panel .hb-ai-summary{
  border-color:#e2ebfd !important;
  background:linear-gradient(180deg,#fbfdff 0%,#fff 100%) !important;
}
.hb-ai-panel .hb-ai-summary > [data-slot="card-content"]{
  font-size:12px !important;
  line-height:1.75 !important;
  color:#3a4a63 !important;
  white-space:pre-wrap !important;
}

/* 分析时间 */
.hb-ai-panel .hb-ai-time{
  margin:0 !important;
  padding:1px 0 4px !important;
  text-align:center !important;
  font-size:10.5px !important;
  color:#9aa7bb !important;
  letter-spacing:.01em;
}

/* ---------- 宽度自适应 ---------- */
.hb-ai-panel.hb-ai-narrow .hb-ai-stats{ grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
.hb-ai-panel.hb-ai-narrow .hb-ai-bank > [data-slot="card-content"]{ grid-template-columns:repeat(1,minmax(0,1fr)) !important; }
.hb-ai-panel.hb-ai-narrow .hb-ai-risk > [data-slot="card-content"]{ grid-template-columns:repeat(1,minmax(0,1fr)) !important; }
.hb-ai-panel.hb-ai-xl .hb-ai-stats{ grid-template-columns:repeat(6,minmax(0,1fr)) !important; }
.hb-ai-panel.hb-ai-xl .hb-ai-risk > [data-slot="card-content"]{ grid-template-columns:repeat(3,minmax(0,1fr)) !important; }
