@charset "UTF-8";
/* 经典页面统一页头（同 Flux 的 page-header.css；脚本见 page-header.js）。
 * 一行：页签 | ⓘ | 工具；第二行是日期等筛选。桌面宽度标题只留给读屏，手机宽度显示。
 * 就地改造的吸顶页签条（.chapter-tabbar.kb-head）保留 style.css / look.css 里的吸顶与玻璃风格，这里只管它里面的排布。 */
main.main .kb-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  min-width: 0; margin: 0 0 12px;
}
/* 就地改造的吸顶条原来是 flex-end 对齐 + 内联样式，页签与 ⓘ / 工具要居中对齐 */
main.main .kb-head.chapter-tabbar { align-items: center !important; justify-content: flex-start !important; column-gap: 12px; margin-bottom: 9px; }
main.main .kb-head > :is(.tabs, .page-tabs, .profile-tabs) { order: 0; margin: 0; flex: 1 1 auto; min-width: 0; }
main.main .kb-head .kb-head-title { order: 1; display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; }
main.main .kb-head .kb-head-title h1 { margin: 0; font-size: 20px; line-height: 32px; font-weight: 600; }
main.main .kb-head .kb-head-tools {
  order: 2; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px;
  margin: 0; min-width: 0;
}
main.main .kb-head .kb-head-tools:empty { display: none; }
main.main .kb-head .kb-head-tools > * { margin: 0; }
main.main .kb-head .kb-head-tools :is(.btn-primary, .wb-btn) { height: 32px; padding: 0 12px; font-size: 13px; line-height: 20px; white-space: nowrap; }
main.main .kb-head .kb-head-tools :is(.select, select) { height: 32px; padding-block: 0; font-size: 13px; }
main.main .kb-head .client-switch { margin: 0; }
/* 没有页签的页头（只有 ⓘ / 工具）不要紧贴顶栏 */
main.main .kb-head:not(.chapter-tabbar):not(:has(> :is(.tabs, .page-tabs, .profile-tabs))) { padding-top: 4px; }
/* 第二行：日期区间等筛选，整行、排在页签行之后 */
main.main .kb-head > [data-kb-row2] { order: 5; flex: 1 1 100%; margin: 0 !important; }
/* 页签与说明 / 工具之间的空白让给页签：有页签时 ⓘ 与工具靠右 */
main.main .kb-head .kb-head-title.has-help { margin-left: auto; }
main.main .kb-head .kb-head-title.has-help + .kb-head-tools { margin-left: 0; }
main.main .kb-head .kb-head-title:not(.has-help) + .kb-head-tools { margin-left: auto; }

/* ⓘ 按钮与说明浮层 */
main.main .kb-head-info {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; padding: 0; border: 0; background: transparent;
  color: var(--muted); font: inherit; font-size: 16px; line-height: 20px; cursor: pointer;
}
main.main .kb-head-info[hidden] { display: none !important; }
main.main .kb-head-info:hover, main.main .kb-head-info[aria-expanded="true"] { color: var(--brand); }
main.main .kb-head-info:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; border-radius: 6px; }
.kb-head-popover {
  position: fixed; inset: auto; margin: 0; width: max-content; max-width: min(480px, calc(100vw - 16px));
  max-height: calc(100dvh - 32px); overflow: auto; padding: 16px;
  color: var(--text); background: var(--panel-solid, var(--panel)); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow); font-size: 13px; line-height: 24px;
  font-weight: 400; white-space: normal; overflow-wrap: anywhere;
}
.kb-head-popover .kb-head-help > * { margin: 0; font-size: 13px; color: var(--text); }
.kb-head-popover .kb-head-help > * + * { margin-top: 8px; }

/* 说明里若带「i」悬浮说明（如客户名录），浮层本身已经是浮层，不再嵌套一层：直接把那段文字展开在下面 */
.kb-head-popover .kb-head-help .info-ico { all: unset; display: block; font-size: 0; margin-top: 8px; }
.kb-head-popover .kb-head-help .info-pop { all: unset; display: block; font-size: 13px; line-height: 24px; color: var(--text); }
.kb-head-popover .kb-head-help .info-pop::after { content: none; }

/* 没有页签、说明、工具、筛选的页头：桌面宽度不占高度（标题仍在可访问性树里，同 Flux） */
@media (width > 900px) {
  main.main .kb-head h1 {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: 0;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
  }
  main.main .kb-head .kb-head-title:not(.has-help) { display: contents; }
  main.main .kb-head:not(.chapter-tabbar):not(:has(> :is(.tabs, .page-tabs, .profile-tabs), .kb-head-title.has-help, .kb-head-tools > *)) {
    height: 0; min-height: 0; margin: 0; padding: 0; overflow: visible;
  }
}
/* 手机宽度：标题显示，页签、工具各占一行 */
@media (max-width: 900px) {
  main.main .kb-head .kb-head-title { flex: 1 1 100%; order: -1; }
  main.main .kb-head .kb-head-title.has-help { margin-left: 0; }
  main.main .kb-head > :is(.tabs, .page-tabs, .profile-tabs) { flex-basis: 100%; overflow-x: auto; }
  main.main .kb-head .kb-head-tools { flex: 1 1 100%; justify-content: flex-start; margin-left: 0 !important; }
}

/* 页签：回到下划线式（CR-1175，用户 2026-11-17：「改回之前那种 tab 页的设计，之前那种更好看和更习惯」），
 * 不再画分段胶囊；页头里只管位置，外观沿用 style.css 的 .tabs / .tab-btn。 */
:is(.kb-head > .profile-tabs, .kb-head > .tabs:not(.chapter-tabbar > .tabs)) { margin-bottom: 0; }

/* ---------- 新收进页头的几页 ---------- */
/* 复盘报告：整页铺满视口高度。页头进来之后，左右两栏改为占页头以外的剩余高度，不再按 100vh 整数算 */
#chReports:not(.hidden):has(> .kb-head) { display: flex; flex-direction: column; height: calc(100vh - 92px); min-height: 520px; }
#chReports > .kb-head { flex: none; }
#chReports > .kb-head ~ .rp-wrap { flex: 1 1 auto; height: auto; min-height: 0; }
#chReports > .kb-head .rp-when { margin: 0; }
#chReports > .kb-head ~ .rp-wrap .rp-hrow:empty,
#chReports > .kb-head ~ .rp-wrap .rp-hrow:not(:has(*)) { display: none; }
@media (max-width: 900px) {
  #chReports:not(.hidden):has(> .kb-head) { height: auto; }
  #chReports > .kb-head ~ .rp-wrap { flex: none; }
}
/* 收益榜单：统计周期搬进工具区后，不再沿用卡片里的居右 / 负边距 / 绝对定位 */
.kb-head-tools > .lb-period { position: static; max-width: none; margin: 0; padding: 0; }
/* 我的图表：搜索框搬走后原条留一个空壳，不占位 */
#chAiCharts > .kb-head ~ .ac-host .ac-bar:empty { display: none; }
