/* 能力矩阵 21/22/23/24/25：可信度徽标 / 洞察卡 / 工具行 */
.res-tools { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.res-tools .fb { min-width: 40px; }
.cred { margin-left: 6px; font-size: 11px; padding: 1px 5px; border-radius: 3px; border: 1px solid transparent; white-space: nowrap; }
.cred-high { color: #17663a; background: #eaf7ef; border-color: #bfe3cd; }
.cred-mid { color: #6b4a00; background: #fdf6e3; border-color: #ecd9a8; }
.cred-low { color: #8a1f1f; background: #fdecec; border-color: #f0c2c2; }

.ins-summary { font-size: 13.5px; line-height: 1.65; margin: 6px 0 10px; color: var(--fg); }
.ins-para { border-left: 2px solid var(--border); padding-left: 10px; margin: 8px 0; }
.ins-para-h { font-size: 12.5px; font-weight: 600; color: var(--fg); }
.ins-para-t { font-size: 13px; line-height: 1.65; color: var(--fg); margin-top: 3px; }
.ins-ev { font-size: 11.5px; color: var(--muted-fg); margin-top: 4px; line-height: 1.5; }
.ins-ev.muted { opacity: .7; }
.ins-stats { display: flex; gap: 8px; margin: 8px 0; }
.ins-stat { font-size: 12px; padding: 2px 8px; border-radius: 3px; border: 1px solid var(--border); }
.ins-stat.high { color: #8a1f1f; background: #fdecec; }
.ins-stat.mid { color: #6b4a00; background: #fdf6e3; }
.ins-stat.low { color: #35507a; background: #eef3fb; }
.ins-risk { border: 1px solid var(--border); border-radius: 4px; padding: 8px 10px; margin: 6px 0; }
.ins-risk-h { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.ins-risk-d { font-size: 12.5px; color: var(--fg); margin-top: 4px; line-height: 1.6; }
.ins-lv { font-size: 11px; padding: 0 5px; border-radius: 3px; border: 1px solid var(--border); font-weight: 500; }
.ins-lv.lv-high { color: #8a1f1f; background: #fdecec; }
.ins-lv.lv-mid { color: #6b4a00; background: #fdf6e3; }
.ins-lv.lv-low { color: #35507a; background: #eef3fb; }
.ins-note { font-size: 11.5px; color: var(--muted-fg); margin-top: 8px; }
.ins-empty { font-size: 12.5px; color: var(--muted-fg); }

/* ---------- 输入区上方示例条 + 空状态垂直居中 ---------- */
/* 空白问题根源：.stream 里空状态只有固定高度，剩余空间全堆在输入框上方。
   居中后空白被上下均分，不再像"塌在底部"。 */
/* 空状态撑满可用高度：hero 贴顶、能力卡贴底，消除输入框上方的死白 */
.stream > .empty-state {
  flex: 1 1 auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin: 0 !important;
  padding-top: 8px;
  padding-bottom: 4px;
}
.stream > .empty-state > .cap-grid {
  margin-top: 0;
  min-height: 64px;
}
.stream > .empty-state .cap-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
}

/* 示例条放在输入框上方：一行 5 个，窄屏自动换行 */
.composer .hint.hint-top {
  margin-top: 0;
  margin-bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  font-size: 12px;
}
.composer .hint .hint-label { color: var(--color-text-tertiary); }
.composer .hint.hint-top .try {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-bg-surface);
  color: var(--color-text-secondary, var(--color-text-tertiary));
  cursor: pointer;
  line-height: 1.5;
  transition: border-color .15s, color .15s, background .15s;
}
.composer .hint.hint-top .try:hover {
  border-color: var(--color-primary-border-strong);
  color: var(--color-primary);
  background: var(--color-bg-panel);
}

/* ---------- 可信度横条（能力矩阵 23 可感知化） ---------- */
.cred-bar {
  margin: 8px 0 2px;
  border: 1px solid var(--color-border);
  border-left-width: 3px;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12px;
  background: var(--color-bg-surface);
}
.cred-bar summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
}
.cred-bar summary::-webkit-details-marker { display: none; }
.cred-bar .cred-score { font-variant-numeric: tabular-nums; color: var(--color-text-secondary, #4b5563); }
.cred-bar .cred-hint { margin-left: auto; color: var(--color-text-tertiary); font-size: 11px; }
.cred-bar ul { margin: 6px 0 0 18px; padding: 0; color: var(--color-text-secondary, #4b5563); line-height: 1.7; }
.cred-bar-high { border-left-color: #2f9e5c; }
.cred-bar-mid { border-left-color: #d1a02a; }
.cred-bar-low { border-left-color: #c0392b; }
.cred-bar-high b { color: #17663a; }
.cred-bar-mid b { color: #8a5a00; }
.cred-bar-low b { color: #8a1f1f; }

/* ---------- 审计回执实时高亮 ---------- */
.card-receipt.rc-fresh { box-shadow: 0 0 0 2px rgba(31, 79, 216, .28); transition: box-shadow .3s; }
.rc-id.rc-live { color: var(--color-primary, #1F4FD8); }

/* ================= 结果卡层级简化（2026-11-04） =================
   目标：一屏只有一个视觉重心（数据表），其余降为注释级。
   做法：去掉有色底，只留左侧 2px 色条 + 字重差。 */

.mem-receipt {
  background: transparent !important;
  border: 0 !important;
  border-left: 2px solid var(--color-border) !important;
  border-radius: 0 !important;
  padding: 2px 0 2px 8px !important;
  font-size: 11.5px !important;
  color: var(--color-text-tertiary) !important;
}

.partial-note {
  background: transparent !important;
  border: 0 !important;
  border-left: 2px solid var(--color-border) !important;
  border-radius: 0 !important;
  padding: 3px 0 3px 8px !important;
  font-size: 11.5px !important;
  color: var(--color-text-tertiary) !important;
}

.conflict-note {
  background: transparent !important;
  border: 0 !important;
  border-left: 2px solid #d1a02a !important;
  border-radius: 0 !important;
  padding: 1px 0 1px 7px !important;
  margin: 3px 0 0 !important;
  font-size: 11.5px !important;
  color: var(--color-text-secondary, #4b5563) !important;
}

.cred-bar {
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px dashed var(--color-border) !important;
  border-radius: 0 !important;
  padding: 3px 0 5px !important;
  margin: 6px 0 0 !important;
}
.cred-bar summary { font-size: 11.5px; }
.cred-bar .cred-hint { opacity: .75; }

.audit-trace-row { margin: 4px 0 0 !important; }
.audit-trace-link {
  font-size: 11.5px !important;
  font-weight: 400 !important;
  color: var(--color-text-tertiary) !important;
}
.audit-trace-note { display: none !important; }

.res-tools .btn { font-size: 11.5px; }

/* 空态时把输入区上方的死白压掉：去掉 stream 底部内距与 composer 顶部多余留白 */
.stream:has(> .empty-state) { padding-bottom: 0 !important; }
.stream > .empty-state { padding-bottom: 0 !important; }
.composer { padding-top: 6px; }

/* ===== 布局修正（2026-11-04 第二轮）===== */

/* 空状态：不再用 space-between 撑散，回归自然流并贴住输入区（上方留白，输入区上方为零） */
.stream > .empty-state {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  margin: 0 !important;
  padding: 6px 0 0 !important;
}
/* 关键：清掉各块自带的外边距，否则 space-between 会叠成 100px+ 的大洞 */
.stream > .empty-state > * { margin-top: 0 !important; margin-bottom: 0 !important; }
.stream > .empty-state > .cap-grid {
  margin-top: 18px !important;
  min-height: 0 !important;
}
  margin-bottom: 18px !important;
}

/* 分隔线从 composer 顶部下移：改挂在「试一下」这一行的上边 */
.composer {
  border-top: 0 !important;
  padding-top: 4px !important;
}
.composer .hint.hint-top {
  border-top: 1px solid var(--color-border) !important;
  padding-top: 8px !important;
  padding-bottom: 2px;
  margin-bottom: 8px !important;
}
.composer .mode-row {
  margin-bottom: 2px !important;
}

/* 文件偏好与「试一下」同排，右对齐 */
.composer .hint .fmt-slot {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
}

/* 工具行：去掉悬空分隔点后，按图标间距排列即可 */
.composer .mode-row .set { display: inline-flex; align-items: center; gap: 10px; }
.composer .mode-row { min-height: 0; }

/* 示例 chip 缩小一号，避免和文件偏好挤成两行 */
.composer .hint.hint-top { font-size: 11.5px; gap: 5px 8px; }
.composer .hint.hint-top .try { padding: 2px 7px; font-size: 11.5px; }

/* 水平居中修正：空状态在容器内居中（之前贴左，右侧空 54px） */
.stream > .empty-state {
  margin-left: auto !important;
  margin-right: auto !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* ===== 瘦身第二批 ===== */

/* 更多菜单 */
.res-tools .more-wrap { position: relative; display: inline-flex; }
.res-tools .more-menu {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 4px);
  z-index: 20;
  padding: 4px;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  box-shadow: 0 6px 18px rgba(20, 32, 60, .12);
  white-space: nowrap;
}
.res-tools .more-wrap.open .more-menu { display: block; }

/* 时间维度提示 */
.time-note {
  margin: 6px 0 2px;
  padding: 3px 0 3px 8px;
  border-left: 2px solid #d1a02a;
  font-size: 11.5px;
  color: var(--color-text-secondary, #4b5563);
}

/* 右栏 tab 收敛：风险并入概览、记忆并入详情（暂以隐藏处理，内容保留可访问） */
aside.right .tabs .tab[data-tab="risk"],
aside.right .tabs .tab[data-tab="memory"] { display: none !important; }

/* 左栏跟踪池：移除按钮默认隐藏，hover 才出现 */
aside.left .wl-item .btn { opacity: 0; transition: opacity .15s; }
aside.left .wl-item:hover .btn { opacity: 1; }

/* 空状态只留一个主按钮时，居中更稳 */
.es-actions { justify-content: center; }

/* 更多菜单：右侧对齐、抬高层级，避免压在回执文字上 */
.res-tools { position: relative; z-index: 6; }
.res-tools .more-menu { left: auto; right: 0; z-index: 60; }

/* 左栏移除按钮：真实类名是 .btn-wl-remove（之前选择器写错了） */
aside.left .btn-wl-remove { opacity: 0; transition: opacity .15s; }
aside.left .wl-item:hover .btn-wl-remove,
aside.left .btn-wl-remove:focus { opacity: 1; }

/* ===== 主页视觉收敛（2026-11-04 第四轮） ===== */

/* 空状态：整块垂直水平居中，不撑散 */
.stream > .empty-state {
  flex: 0 0 auto !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: stretch !important;
  margin: auto 0 !important;
  padding: 0 !important;
  gap: 28px;
}
.stream > .empty-state .hero { margin: 0 !important; }
.empty-note { margin-top: 8px; font-size: 12px; color: var(--color-text-tertiary); }

/* 文件偏好：向上抽屉，尺寸像面板而不是气泡 */
.fp { position: relative; display: inline-flex; }
.fp-pop {
  position: absolute !important;
  right: 0 !important;
  left: auto !important;
  bottom: calc(100% + 8px) !important;
  top: auto !important;
  width: 300px !important;
  padding: 8px !important;
  border-radius: 6px;
  box-shadow: 0 -8px 24px rgba(20, 32, 60, .14);
}
.fp-pop-h { font-size: 11.5px; color: var(--color-text-tertiary); padding: 2px 6px 6px; }
.fp-opt { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 4px; }
.fp-opt + .fp-opt { margin-top: 4px; }
.fp-opt.is-on { background: var(--color-bg-panel, #f7f9ff); }
.fp-pop-f { display: none; }

/* 记忆对用户无感：机制保留（写入/审计照常），界面不展示回执与入口 */
.mem-receipt, .mem-chips, .memory-panel, .memory-drawer, .memory-entry { display: none !important; }

/* ===== 首屏收敛（2026-11-04 第七轮·干净版） ===== */

/* 标题：略大但不刺眼 */
.stream > .empty-state .hero-line {
  font-size: 34px;
  line-height: 1.28;
  max-width: 680px;
  margin: 0 auto;
}

/* 空状态：居中、间距适中，不再强行撑满 */
.stream > .empty-state {
  gap: 26px;
  padding-top: 0;
}

/* 输入区：底部留出页脚高度，避免被版本条盖住 */
.composer {
  padding-top: 6px;
  padding-bottom: 40px;
}

/* ===== 阶段2 · 中间区（C 版） ===== */

/* 副标题：一句人话，说明它能给你什么 */
.stream > .empty-state .hero-sub {
  margin-top: 10px;
  font-size: 13px;
  color: var(--color-text-tertiary);
}

/* 演示面板不再常驻：只有引导运行时才出现 */
/* 演示面板：首次访问可见；引导结束或跳过后不再常驻 */
body.tour-done .stream > .empty-state .onboard { display: none !important; }

/* 工具收进「⋯」：默认收起，点开是一行图标 */
.composer .tool-more { position: relative; margin-left: auto; }
.composer .tool-more > summary {
  list-style: none;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--color-text-tertiary);
  font-size: 14px;
  line-height: 1.4;
}
.composer .tool-more > summary::-webkit-details-marker { display: none; }
.composer .tool-more[open] > summary { background: var(--color-bg-panel, #f0f3fa); }
.composer .tool-more .set { margin-left: 0 !important; }

/* 标题里的强调词必须是行内，否则会把一行切成三行 */
.stream > .empty-state .hero-line b { display: inline !important; }

/* 「⋯」不再单独占一行：并入「试一下」右侧 */
.composer .hint .tool-more { margin-left: auto; }
.composer .hint .fmt-slot { margin-left: 8px; }

/* 空状态时把输入框抬到页面中部（Perplexity 式）：标题在上、输入在中 */
.mid:has(.stream > .empty-state) { justify-content: center; }
.mid:has(.stream > .empty-state) .stream { flex: 0 0 auto; }
.mid:has(.stream > .empty-state) .composer {
  margin-top: 0;
  margin-bottom: 0;
  flex: 0 0 auto;
}

/* 空态下输入区不再是底栏：去分隔线与玻璃底，变成浮起的输入块 */
.mid:has(.stream > .empty-state) .composer {
  border-top: 0 !important;
  background: transparent !important;
  backdrop-filter: none !important;
  padding-bottom: 0 !important;
}
.mid:has(.stream > .empty-state) .hint.hint-top {
  border-top: 0 !important;
  padding-top: 0 !important;
}

/* 首屏只留一句话：不再有 eyebrow 与大标题 */
.stream > .empty-state .hero-line.hero-line--single {
  font-size: 15px !important;
  font-weight: 400 !important;
  line-height: 1.8 !important;
  color: var(--color-text-secondary, #4b5563) !important;
  letter-spacing: .01em;
  max-width: 100% !important;
  white-space: normal !important;
}

/* 左栏：加入公司行默认隐藏（hidden 属性要能压过 display:flex） */
aside.left .wl-add[hidden] { display: none !important; }
aside.left .wl-add-toggle { width: 100%; justify-content: center; color: var(--color-text-tertiary); }

/* 窄屏：顶栏不因此溢出，「生成持仓简报」先收起（桌面端保留） */
@media (max-width: 720px) {
  #briefingbtn { display: none !important; }
}

/* ===== 结果卡：合并状态带（2026-11-08） ===== */

/* 一行状态带：部分返回 / 可信度 / 回执编号 / 查看记录 */
.card-receipt.statusbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 2px 0 0 !important;
  padding: 0 0 8px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--color-border) !important;
  font-size: 11.5px;
  color: var(--color-text-tertiary);
  background: transparent !important;
}
.card-receipt.statusbar .sb-sep { color: #c9cede; }
.card-receipt.statusbar .rc-id { font-weight: 500; color: #9aa1ae; font-variant-numeric: tabular-nums; }
.card-receipt.statusbar .rc-link { margin-left: 2px; }

/* 子块改为行内，不再各自占一层 */
.card-receipt.statusbar .partial-note {
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 11.5px !important;
  color: var(--color-text-secondary, #4b5563) !important;
  background: transparent !important;
}
.card-receipt.statusbar .cred-bar {
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 11.5px !important;
  background: transparent !important;
  display: inline-flex;
  flex-direction: column;
}
.card-receipt.statusbar .cred-bar summary {
  display: inline-flex;
  gap: 4px;
  font-size: 11.5px;
}
.card-receipt.statusbar .cred-bar .cred-hint { display: none; }
.card-receipt.statusbar .cred-bar ul {
  margin: 4px 0 0 12px;
  font-size: 11px;
}

/* 工具行右侧说明 */
.res-tools .rc-note {
  margin-left: auto;
  font-size: 11px;
  color: var(--color-text-tertiary);
}
