/* ==========================================================
   首页专用样式 —— 明源绿浅色 OA 工作台（ERP 业务优先）
   ------------------------------------------------------------
   只服务 web/pages/workbench.js（首页），类名统一 hm- / ai- 前缀，
   与其它页面的 .oa- / .mp- 互不干扰。
   配色沿用业务页变量：--my-green #44b549 / --my-border #e7e8eb / --my-body-bg #e7e8eb。

   结构速查：
     .hm-wrap          页面容器（浅灰底）
     .hm-hero          顶部欢迎条 + AI 一句话办业务
     .ai-cmd           指令输入框
     .ai-confirm       解析结果确认卡
     .hm-insight       AI 业务洞察条
     .hm-main/.hm-aside 主区两栏 / 右侧 AI 助手
     .hm-kpi           KPI 数字卡
     .hm-card/.hm-hd   通用白底卡片
     .hm-apps/.hm-app  业务系统宫格（首页第一屏重点）
     .hm-list/.hm-row  待办/审批/公告列表
     .hm-tl            日程时间轴
     .ai-box/.ai-log   AI 助手对话面板
     .hm-fab           窄屏助手悬浮按钮
   ========================================================== */

/* ---------------- 主题变量 ---------------- */
.hm-wrap {
  --hm-brand: var(--my-green, #44b549);
  --hm-brand-d: var(--my-green-hover, #3da242);
  --hm-brand-dd: var(--my-green-dark, #1e8f51);
  --hm-brand-l: #eef7ef;
  --hm-blue: #1890ff;
  --hm-orange: #fa8c16;
  --hm-red: #f5222d;
  --hm-purple: #722ed1;
  --hm-line: var(--my-border, #e7e8eb);
  --hm-line-2: #f0f1f3;
  --hm-card: #fff;
  --hm-tx: #333;
  --hm-tx2: #555;
  --hm-tx3: #777;
  --hm-r: 3px;
  --hm-sh: 0 1px 3px rgba(0, 0, 0, .05);
  --hm-sh-h: 0 4px 14px rgba(0, 0, 0, .09);
  position: relative;
  color: var(--hm-tx);
  font-size: 13px;
  padding-bottom: 18px;
}

/* ---------------- 通用白底卡片 ---------------- */
.hm-card {
  position: relative;
  margin-bottom: 14px;
  padding: 14px 16px 16px;
  border: 1px solid var(--hm-line);
  border-radius: var(--hm-r);
  background: var(--hm-card);
  box-shadow: var(--hm-sh);
  transition: box-shadow .18s ease, border-color .18s ease;
}
.hm-card:hover { border-color: #cfd3d8; box-shadow: var(--hm-sh-h); }

.hm-hd {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 10px; margin-bottom: 12px;
  border-bottom: 1px solid var(--hm-line-2);
}
.hm-hd-t {
  position: relative; padding-left: 10px; font-size: 14px; font-weight: 700;
  color: #222; white-space: nowrap;
}
.hm-hd-t::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 13px; border-radius: 2px; background: var(--hm-brand);
}
.hm-hd-x {
  margin-left: auto; display: flex; align-items: center; gap: 10px;
  color: var(--hm-tx3); white-space: nowrap;
}
.hm-more {
  border: 1px solid var(--hm-line); background: #fff; color: var(--hm-brand);
  border-radius: 2px; padding: 3px 10px; font-size: 12px; cursor: pointer; font-family: inherit;
  transition: background .16s, border-color .16s, color .16s;
}
.hm-more:hover { background: var(--hm-brand-l); border-color: var(--hm-brand); }

.hm-empty { padding: 22px 0; text-align: center; color: var(--hm-tx3); font-size: 12px; }

/* ---------------- 1. 顶部欢迎条 + AI 指令框 ---------------- */
.hm-hero {
  position: relative;
  display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-end; justify-content: space-between;
  padding: 14px 18px 16px; margin-bottom: 14px;
  border: 1px solid var(--hm-line); border-left: 3px solid var(--hm-brand);
  border-radius: var(--hm-r);
  background: #fff;
  box-shadow: var(--hm-sh);
}
.hm-hello { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.hm-hello-hi { font-size: 13px; color: var(--hm-tx2); }
.hm-hello-n { font-size: 22px; font-weight: 700; color: #222; letter-spacing: .5px; }
.hm-hello-role { font-size: 12px; color: var(--hm-tx3); }
.hm-hero-sub { margin-top: 6px; font-size: 12px; color: var(--hm-tx2); }
.hm-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.hm-chip {
  padding: 3px 10px; border-radius: 2px; font-size: 12px; color: var(--hm-tx2);
  border: 1px solid var(--hm-line); background: #fafbfc;
}
.hm-chip b { color: #222; font-variant-numeric: tabular-nums; margin-right: 2px; }
.hm-chip.cyan { border-color: #b7e3ba; background: var(--hm-brand-l); }
.hm-chip.violet { border-color: #d6c9ec; background: #f6f2fc; }

.hm-hero-r { flex: 1 1 420px; min-width: 300px; max-width: 620px; }

/* AI 一句话办业务 */
.ai-cmd {
  display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 6px 0 12px;
  border: 1px solid var(--hm-line); border-radius: 2px;
  background: #fff;
  transition: border-color .16s, box-shadow .16s;
}
.ai-cmd:focus-within {
  border-color: var(--hm-brand);
  box-shadow: 0 0 0 2px rgba(68, 181, 73, .12);
}
.ai-cmd-ic {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; color: #fff;
  background: var(--hm-brand);
}
.ai-cmd-input {
  flex: 1; min-width: 0; height: 38px; border: 0; outline: none; background: transparent;
  color: #333; font-size: 13px; font-family: inherit;
}
.ai-cmd-input::placeholder { color: #aaa; }
.ai-cmd-go {
  flex: none; height: 30px; padding: 0 16px; border: 0; border-radius: 2px; cursor: pointer;
  font-size: 13px; font-family: inherit; color: #fff; font-weight: 600;
  background: var(--hm-brand);
  transition: background .16s;
}
.ai-cmd-go:hover { background: var(--hm-brand-d); }

.ai-egs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.ai-egs-l { font-size: 11px; color: var(--hm-tx3); }
.ai-eg {
  padding: 3px 9px; border-radius: 2px; cursor: pointer; font-size: 11px; font-family: inherit;
  color: var(--hm-tx2); border: 1px dashed var(--hm-line); background: #fff;
  transition: color .16s, border-color .16s, background .16s;
}
.ai-eg:hover { color: var(--hm-brand-d); border-color: var(--hm-brand); background: var(--hm-brand-l); }

/* 指令解析结果卡 */
.ai-cmd-box:empty { display: none; }
.ai-confirm {
  margin-top: 10px; padding: 12px 14px;
  border: 1px solid #b7e3ba; border-radius: var(--hm-r);
  background: #f8fdf8;
  animation: aiPop .22s ease both;
}
@keyframes aiPop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.ai-confirm.err { border-color: #ffccc7; background: #fff8f7; }
.ai-cf-hd { display: flex; align-items: center; gap: 10px; }
.ai-cf-ic {
  flex: none; width: 32px; height: 32px; border-radius: 2px; display: grid; place-items: center;
  font-size: 16px; background: var(--hm-brand-l); border: 1px solid #b7e3ba;
}
.ai-cf-t { display: flex; flex-direction: column; min-width: 0; }
.ai-cf-t b { font-size: 13px; color: #222; }
.ai-cf-t em { font-style: normal; font-size: 11px; color: var(--hm-tx3); }
.ai-cf-scan { margin-left: auto; display: flex; gap: 3px; align-items: flex-end; height: 16px; }
.ai-cf-scan i {
  width: 3px; background: var(--hm-brand); border-radius: 2px; opacity: .8;
  animation: aiScan 1s ease-in-out infinite;
}
.ai-cf-scan i:nth-child(1) { height: 7px; animation-delay: 0s; }
.ai-cf-scan i:nth-child(2) { height: 14px; animation-delay: .15s; }
.ai-cf-scan i:nth-child(3) { height: 10px; animation-delay: .3s; }
@keyframes aiScan { 0%, 100% { transform: scaleY(.5); opacity: .4; } 50% { transform: scaleY(1); opacity: 1; } }

.ai-cf-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.ai-cf-p {
  display: flex; flex-direction: column; gap: 2px; min-width: 120px; padding: 6px 10px;
  border: 1px solid var(--hm-line); border-radius: 2px; background: #fff;
}
.ai-cf-p em { font-style: normal; font-size: 11px; color: var(--hm-tx3); }
.ai-cf-p b { font-size: 13px; color: var(--hm-brand-dd); font-variant-numeric: tabular-nums; }
.ai-cf-to {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 7px 10px; border-radius: 2px; font-size: 12px;
  background: var(--hm-brand-l); border: 1px dashed #b7e3ba;
}
.ai-cf-to span { color: var(--hm-tx3); }
.ai-cf-to b { color: #222; }
.ai-cf-to code {
  font-family: Consolas, Monaco, monospace; font-size: 11px; color: var(--hm-brand-dd);
  padding: 1px 6px; border-radius: 2px; background: #fff;
}
.ai-cf-btns { display: flex; gap: 8px; margin: 10px 0 6px; }
.ai-cf-src { font-size: 11px; color: var(--hm-tx3); }
.ai-cf-ft { font-size: 11px; color: var(--hm-tx2); margin-top: 6px; }

/* 通用按钮 */
.hm-btn {
  height: 30px; padding: 0 14px; border-radius: 2px; cursor: pointer;
  font-size: 12px; font-family: inherit; white-space: nowrap;
  border: 1px solid var(--hm-line); color: var(--hm-tx2); background: #fff;
  transition: color .16s, background .16s, border-color .16s;
}
.hm-btn:hover { color: var(--hm-brand-d); border-color: var(--hm-brand); background: var(--hm-brand-l); }
.hm-btn.primary {
  color: #fff; font-weight: 600;
  border: 1px solid var(--hm-brand); background: var(--hm-brand);
}
.hm-btn.primary:hover { background: var(--hm-brand-d); border-color: var(--hm-brand-d); color: #fff; }

/* ---------------- 2. AI 业务洞察 ---------------- */
.hm-insight {
  position: relative; margin-bottom: 14px; padding: 12px 16px 14px;
  border: 1px solid var(--hm-line); border-left: 3px solid var(--hm-brand);
  border-radius: var(--hm-r);
  background: #fff;
  box-shadow: var(--hm-sh);
}
.hm-insight-hd { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.hm-insight-tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 2px;
  font-size: 12px; font-weight: 700; color: var(--hm-brand-dd);
  background: var(--hm-brand-l); border: 1px solid #b7e3ba;
}
.ai-spark {
  width: 7px; height: 7px; border-radius: 50%; background: var(--hm-brand);
  animation: aiBlink 1.6s ease-in-out infinite;
}
@keyframes aiBlink { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }
.hm-insight-src { font-size: 11px; color: var(--hm-tx3); }
.hm-insight-ops { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.hm-dots { display: inline-flex; gap: 4px; }
.hm-dot-nav {
  width: 7px; height: 7px; border-radius: 50%; cursor: pointer;
  background: #d9dde2; transition: background .16s;
}
.hm-dot-nav.on { background: var(--hm-brand); }
.hm-ghost-btn {
  height: 26px; padding: 0 12px; border-radius: 2px; cursor: pointer; font-family: inherit;
  font-size: 12px; color: var(--hm-brand-d); border: 1px solid var(--hm-line); background: #fff;
  transition: background .16s, border-color .16s;
}
.hm-ghost-btn:hover { background: var(--hm-brand-l); border-color: var(--hm-brand); }

.hm-insight-bd { display: flex; align-items: center; gap: 16px; }
.hm-insight-bd.ai-fade { animation: hmFadeIn .3s ease both; }
@keyframes hmFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* 置信度：纯数字徽标（已去掉原 SVG 圆环） */
.ai-ring {
  flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 62px; padding: 6px 8px;
  border: 1px solid var(--hm-line); border-radius: 2px; background: #fafbfc;
}
.ai-ring-n { font-size: 18px; font-weight: 700; color: var(--hm-brand-dd); line-height: 1.1; }
.ai-ring-n i { font-style: normal; font-size: 11px; margin-left: 1px; }
.ai-ring-l { font-size: 10px; color: var(--hm-tx3); }
.hm-insight-main { flex: 1 1 auto; min-width: 0; }
.hm-insight-top { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.hm-insight-cat {
  padding: 2px 9px; border-radius: 2px; font-size: 11px; font-weight: 700; color: #fff;
  background: var(--hm-brand);
}
.hm-insight-cat.lv-high { background: #f5222d; }
.hm-insight-cat.lv-mid { background: #fa8c16; }
.hm-insight-cat.lv-low { background: #1890ff; }
.hm-insight-lv { font-size: 11px; color: var(--hm-tx2); }
.hm-insight-tx { font-size: 13px; line-height: 1.7; color: #333; }
.hm-insight-ms { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.hm-ms {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px;
  border: 1px solid var(--hm-line); border-radius: 2px; background: #fafbfc;
}
.hm-ms em { font-style: normal; font-size: 11px; color: var(--hm-tx3); }
.hm-ms b { font-size: 12px; color: var(--hm-brand-dd); font-variant-numeric: tabular-nums; }
.hm-insight-basis { margin-top: 7px; font-size: 11px; color: var(--hm-tx3); }
.hm-insight-act { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.hm-insight-i { font-size: 11px; color: var(--hm-tx3); font-variant-numeric: tabular-nums; }

/* ---------------- 主区布局 ---------------- */
.hm-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.hm-main-l { min-width: 0; }
.hm-cols2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.hm-cols2 > .hm-card { margin-bottom: 0; }

/* ---------------- 3. KPI 数字卡 ---------------- */
.hm-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.hm-kpi {
  position: relative; overflow: hidden; cursor: pointer;
  padding: 12px 14px; border: 1px solid var(--hm-line); border-radius: var(--hm-r);
  background: #fff; box-shadow: var(--hm-sh);
  transition: box-shadow .18s ease, border-color .18s ease;
}
.hm-kpi::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--k, var(--hm-brand));
}
.hm-kpi:hover { border-color: var(--k, var(--hm-brand)); box-shadow: var(--hm-sh-h); }
.hm-kpi-top { display: flex; align-items: center; justify-content: space-between; }
.hm-kpi-l { font-size: 12px; color: var(--hm-tx2); }
.hm-kpi-d { font-style: normal; font-size: 11px; padding: 1px 6px; border-radius: 2px; }
.hm-kpi-d.up { color: #c0392b; background: #fdecea; }
.hm-kpi-d.down { color: var(--hm-brand-dd); background: #eaf7ec; }
.hm-kpi-d.flat { color: var(--hm-tx3); background: #f2f3f5; }
.hm-kpi-v { display: flex; align-items: baseline; gap: 4px; margin-top: 4px; }
.hm-num {
  font-size: 26px; font-weight: 700; line-height: 1.15; color: #222;
  font-variant-numeric: tabular-nums;
}
.hm-kpi-u { font-size: 11px; color: var(--hm-tx3); }

/* ---------------- 4. 业务系统宫格（首页第一屏重点） ---------------- */
.hm-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.hm-quick-l { font-size: 11px; color: var(--hm-tx3); }
.hm-qbtn {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px;
  border-radius: 2px; cursor: pointer; font-size: 12px; font-family: inherit;
  color: var(--hm-tx2); border: 1px solid var(--hm-line); background: #fff;
  transition: color .16s, border-color .16s, background .16s;
}
.hm-qbtn-ic { font-size: 13px; }
.hm-qbtn:hover {
  color: var(--hm-brand-d); border-color: var(--hm-brand); background: var(--hm-brand-l);
}
.hm-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 12px; }
.hm-app {
  position: relative; overflow: hidden; cursor: pointer; outline: none;
  display: grid; grid-template-columns: 40px minmax(0, 1fr); grid-template-rows: auto auto;
  gap: 2px 10px; padding: 12px;
  border: 1px solid var(--hm-line); border-radius: var(--hm-r);
  background: #fff;
  transition: box-shadow .18s ease, border-color .18s ease;
}
.hm-app:hover, .hm-app:focus-visible {
  border-color: var(--hm-brand); box-shadow: 0 2px 10px rgba(68, 181, 73, .16);
}
.hm-app-ic {
  grid-row: 1 / span 2; align-self: center;
  width: 40px; height: 40px; border-radius: 2px; display: grid; place-items: center; font-size: 19px;
  background: var(--hm-brand-l); border: 1px solid #cbe9cd;
}
.hm-app-t { display: flex; flex-direction: column; min-width: 0; }
.hm-app-t b { font-size: 13px; color: #222; }
.hm-app-t em { font-style: normal; font-size: 11px; color: var(--hm-tx3); }
.hm-app-bar {
  grid-column: 2; display: block; height: 4px; border-radius: 2px; margin-top: 6px;
  background: #eef0f2; overflow: hidden;
}
.hm-app-bar i {
  display: block; height: 100%; border-radius: 2px; background: var(--hm-brand);
  animation: hmGrow .7s ease both;
}
@keyframes hmGrow { from { width: 0 !important; } }
.hm-app-r { grid-column: 2; font-size: 11px; color: var(--hm-tx3); margin-top: 4px; }
.hm-app-go {
  position: absolute; right: 10px; top: 10px; font-size: 11px; color: var(--hm-brand);
  opacity: 0; transition: opacity .18s;
}
.hm-app:hover .hm-app-go { opacity: 1; }

/* ---------------- 5. 列表与时间轴 ---------------- */
.hm-filters { display: flex; gap: 6px; margin-left: 6px; }
.hm-f {
  height: 24px; padding: 0 10px; border-radius: 2px; cursor: pointer;
  font-size: 11px; font-family: inherit; color: var(--hm-tx3);
  border: 1px solid transparent; background: #f5f6f8;
  transition: color .16s, border-color .16s, background .16s;
}
.hm-f:hover { color: #222; }
.hm-f.active { color: var(--hm-brand-d); border-color: var(--hm-brand); background: var(--hm-brand-l); }

.hm-list { display: flex; flex-direction: column; }
.hm-row {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 9px 8px 9px 12px; border-radius: 2px; cursor: pointer;
  border-bottom: 1px solid var(--hm-line-2);
  transition: background .16s ease;
}
.hm-row:last-child { border-bottom: 0; }
.hm-row:hover { background: #f7faf7; }
.hm-row:hover .hm-row-go { opacity: 1; }
.hm-prio { flex: none; width: 3px; height: 22px; border-radius: 2px; background: #d9dde2; }
.hm-prio.P0 { background: #f5222d; }
.hm-prio.P1 { background: #fa8c16; }
.hm-prio.P2 { background: #1890ff; }
.hm-row-b { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hm-row-t {
  font-size: 13px; color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hm-en { font-style: normal; font-size: 11px; color: var(--hm-tx3); font-family: Consolas, Monaco, monospace; }
.hm-row-m { font-size: 11px; color: var(--hm-tx3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-amt { flex: none; font-size: 13px; color: var(--hm-brand-dd); font-variant-numeric: tabular-nums; }
.hm-tag {
  flex: none; padding: 1px 7px; border-radius: 2px; font-size: 11px;
  color: var(--hm-tx2); background: #f5f6f8; border: 1px solid var(--hm-line);
}
.hm-tag.P0 { color: #c0392b; background: #fdecea; border-color: #f9c9c4; }
.hm-tag.P1 { color: #ad6800; background: #fff7e6; border-color: #ffd591; }
.hm-tag.P2 { color: #0b5fa5; background: #e6f4ff; border-color: #b3d8f5; }
.hm-tag.gray { margin-left: 6px; }
.hm-row-go {
  flex: none; font-size: 11px; color: var(--hm-brand); opacity: 0;
  transition: opacity .18s;
}
.hm-new { flex: none; width: 6px; height: 6px; border-radius: 50%; background: #d9dde2; }
.hm-new.on { background: var(--hm-red); }

.hm-tl { display: flex; flex-direction: column; }
.hm-tl-i {
  position: relative; display: flex; gap: 10px; padding: 8px 6px 12px 0; cursor: pointer;
  border-left: 1px solid var(--hm-line); margin-left: 4px; padding-left: 16px;
  transition: border-color .16s;
}
.hm-tl-i:last-child { border-left-color: transparent; }
.hm-tl-i:hover { border-left-color: var(--hm-brand); }
.hm-tl-t { flex: none; width: 88px; font-size: 12px; color: var(--hm-brand-dd); font-variant-numeric: tabular-nums; }
.hm-tl-dot {
  position: absolute; left: -4px; top: 12px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--hm-brand);
}
.hm-tl-b { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hm-tl-title { font-size: 13px; color: #333; }
.hm-tl-p { font-size: 11px; color: var(--hm-tx3); }

/* ---------------- 6. AI 助手面板 ---------------- */
.hm-aside { position: sticky; top: 14px; }
.ai-box {
  display: flex; flex-direction: column; overflow: hidden;
  min-height: 430px; max-height: calc(100vh - 90px);
  border: 1px solid var(--hm-line); border-radius: var(--hm-r);
  background: #fff; box-shadow: var(--hm-sh);
}
.ai-hd { display: flex; align-items: center; gap: 9px; padding: 11px 12px; border-bottom: 1px solid var(--hm-line-2); }
.ai-av {
  flex: none; width: 28px; height: 28px; border-radius: 2px; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #fff; background: var(--hm-brand);
}
.ai-hd-t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.ai-hd-t b { font-size: 13px; color: #222; }
.ai-hd-t em { font-style: normal; font-size: 11px; color: var(--hm-tx3); }
.ai-hd-x {
  flex: none; width: 24px; height: 24px; border-radius: 2px; cursor: pointer;
  border: 1px solid var(--hm-line); background: #fff;
  color: var(--hm-tx2); font-size: 15px; line-height: 1; display: none;
  align-items: center; justify-content: center;
}
.ai-hd-x:hover { color: var(--hm-brand-d); background: var(--hm-brand-l); }

.ai-log { flex: 1 1 auto; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.ai-log::-webkit-scrollbar { width: 5px; }
.ai-log::-webkit-scrollbar-thumb { background: #d9dde2; border-radius: 5px; }
.ai-msg { display: flex; gap: 8px; align-items: flex-start; }
.ai-msg-av {
  flex: none; width: 24px; height: 24px; border-radius: 2px; display: grid; place-items: center;
  font-size: 11px; color: #fff; background: var(--hm-brand);
}
.ai-msg.user { flex-direction: row-reverse; }
.ai-msg.user .ai-msg-av { background: #8c8c8c; }
.ai-msg-bd { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.ai-msg.user .ai-msg-bd { align-items: flex-end; }
.ai-txt {
  font-style: normal; padding: 9px 11px; border-radius: 8px; font-size: 12.5px; line-height: 1.75;
  color: #333; background: #f5f7fa; border: 1px solid var(--hm-line);
  border-top-left-radius: 2px; white-space: pre-wrap; word-break: break-word;
}
.ai-msg.user .ai-txt {
  color: #fff; background: var(--hm-brand); border-color: var(--hm-brand);
  border-top-left-radius: 8px; border-top-right-radius: 2px;
}
.ai-txt.ai-thinking::after {
  content: '···'; display: inline-block; margin-left: 4px; color: var(--hm-brand);
  animation: aiDot 1.1s steps(4, end) infinite;
}
@keyframes aiDot { 0% { opacity: .2; } 50% { opacity: 1; } 100% { opacity: .2; } }
.ai-steps { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.ai-steps li { display: flex; gap: 7px; font-size: 12px; color: var(--hm-tx2); }
.ai-steps i {
  flex: none; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center;
  font-style: normal; font-size: 10px; color: #fff; background: var(--hm-brand);
}
.ai-act {
  align-self: flex-start; padding: 6px 12px; border-radius: 2px; cursor: pointer;
  font-size: 12px; font-family: inherit; color: #fff; font-weight: 600;
  border: 0; background: var(--hm-brand);
  transition: background .16s;
}
.ai-act:hover { background: var(--hm-brand-d); }
.ai-follow { display: flex; flex-wrap: wrap; gap: 6px; }

.ai-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--hm-line-2); }
.ai-chip {
  padding: 4px 10px; border-radius: 2px; cursor: pointer; font-family: inherit;
  font-size: 11.5px; color: var(--hm-tx2); border: 1px dashed var(--hm-line);
  background: #fff; transition: color .16s, background .16s, border-color .16s;
}
.ai-chip:hover { color: var(--hm-brand-d); background: var(--hm-brand-l); border-color: var(--hm-brand); }
.ai-chip.sm { font-size: 11px; padding: 3px 9px; }

.ai-input { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--hm-line-2); }
.ai-input input {
  flex: 1 1 auto; min-width: 0; height: 34px; padding: 0 11px; outline: none;
  border: 1px solid var(--hm-line); border-radius: 2px; background: #fff;
  color: #333; font-size: 12.5px; font-family: inherit;
  transition: border-color .16s, box-shadow .16s;
}
.ai-input input::placeholder { color: #aaa; }
.ai-input input:focus { border-color: var(--hm-brand); box-shadow: 0 0 0 2px rgba(68, 181, 73, .12); }
.ai-send {
  flex: none; height: 34px; padding: 0 14px; border: 0; border-radius: 2px; cursor: pointer;
  font-size: 12.5px; font-family: inherit; font-weight: 600; color: #fff;
  background: var(--hm-brand);
}
.ai-send:hover { background: var(--hm-brand-d); }

/* ---------------- 窄屏悬浮助手按钮 ---------------- */
.hm-fab {
  display: none; position: fixed; right: 18px; bottom: 26px; z-index: 400;
  width: 48px; height: 48px; border-radius: 50%; cursor: pointer;
  border: 0; font-size: 20px; color: #fff;
  background: var(--hm-brand);
  box-shadow: 0 6px 18px rgba(68, 181, 73, .4);
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 1280px) {
  .hm-main { grid-template-columns: minmax(0, 1fr); }
  .hm-aside { position: static; }
  .ai-box { min-height: 380px; max-height: none; }
  .ai-log { max-height: 320px; }
  .hm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
  .hm-cols2 { grid-template-columns: minmax(0, 1fr); }
  .hm-cols2 > .hm-card { margin-bottom: 14px; }
}

@media (max-width: 900px) {
  .hm-hero { flex-direction: column; align-items: stretch; }
  .hm-hero-r { max-width: none; }
  .hm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-insight-bd { flex-wrap: wrap; }
  .hm-insight-act { flex-direction: row; align-items: center; }
  /* 助手收成抽屉 */
  .hm-aside {
    position: fixed; right: 0; top: 0; bottom: 0; width: min(92vw, 380px); z-index: 500;
    padding: 10px; background: rgba(255, 255, 255, .98);
    transform: translateX(102%); transition: transform .26s ease;
  }
  .hm-aside.open { transform: none; box-shadow: -12px 0 32px -12px rgba(0, 0, 0, .28); }
  .ai-box { max-height: none; height: 100%; }
  .ai-hd-x { display: grid; }
  .hm-fab { display: grid; place-items: center; }
}

@media (max-width: 620px) {
  .hm-kpis { grid-template-columns: minmax(0, 1fr); }
}

/* ---------------- 无障碍：尊重减弱动效偏好 ---------------- */
@media (prefers-reduced-motion: reduce) {
  .hm-wrap *, .hm-wrap *::before, .hm-wrap *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ===================== OA 信息门户（首页三标签页） ===================== */
.oa-tabs { display: flex; gap: 4px; padding: 10px 14px 0; border-bottom: 1px solid var(--hm-line); }
.oa-tab {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border: 1px solid transparent; border-bottom: none;
  border-radius: 6px 6px 0 0; background: none; cursor: pointer;
  font-size: 13px; color: var(--hm-tx2); font-family: inherit;
}
.oa-tab > b { font-size: 12px; font-weight: 400; color: var(--hm-tx3); }
.oa-tab:hover { color: var(--hm-brand); }
.oa-tab.on {
  color: var(--hm-brand); font-weight: 500;
  border-color: var(--hm-line); background: var(--hm-card, #fff);
  margin-bottom: -1px; padding-bottom: 8px;
}
.oa-hot {
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--hm-red); color: #fff; font-size: 11px; font-style: normal;
  line-height: 16px; text-align: center;
}
.oa-panes { padding: 4px 0 8px; }
.oa-pane { display: none; }
.oa-pane.on { display: block; }
.oa-pane .hm-row { cursor: pointer; }
.oa-pane .hm-row:hover { background: #f7f9fb; }
.hm-tag.violet { color: #5b3fa8; background: #f2eeff; border-color: #d9cdf5; margin-left: 6px; }
