/* 面板 · 助手动态 的样式（pages/inbox.js，原来的「收件箱」）。归 M4 触达。只写这一页自己的类，类名带这一页的前缀 ibx-（ib- 被 app.css 的旧 .ib-panel、
   mb- 被 setup.css 占着）；共用的在 shell.css，一件事的经过（气泡、结果卡片）在 chat.css。需求见 docs/specs/assistant-feed.md。
   电脑上整屏高，顶上标题、说明和标签，下面左边一列卡片（宽 380，按天分组）、右边阅读区，各自滚动；手机上一次只看一边。 */
.ibx { display: flex; flex-direction: column; min-width: 0; height: 100vh; height: 100dvh; }
.ibx > * { animation: u-fade .36s var(--ease-out) backwards; }
.ibx-head { flex: none; display: grid; gap: 6px; padding: 40px max(32px, env(safe-area-inset-right, 0px)) 16px max(32px, env(safe-area-inset-left, 0px)); }
.ibx-head h1 { margin: 0; }
.ibx-lead { margin: 0 0 8px; color: var(--muted); font-size: 13.5px; }
.seg.ibx-seg { justify-self: start; max-width: 100%; overflow-x: auto; }
.ibx-seg button { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; white-space: nowrap; }
.ibx-seg button.on { font-weight: 600; }
.ibx-seg .chat-dot { width: 7px; height: 7px; }
.ibx-n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--yellow); color: #fff; font-size: 11px; font-weight: 600;
  line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.ibx-panes { flex: 1; min-height: 0; display: grid; grid-template-columns: 380px minmax(0, 1fr); border-top: 1px solid var(--line); }

/* 左边：一件一张卡片。顶上一行来源的小圆点、哪一类、几点；下面标题、一行小字、标签 */
.ibx-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; border-right: 1px solid var(--line); background: var(--soft); }
.ibx-list > [data-sec] { display: flex; flex-direction: column; gap: 8px; padding: 6px 14px 32px; }
.ibx-day { display: flex; align-items: center; gap: 6px; margin: 12px 4px 0; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.ibx-day .ic { width: 14px; height: 14px; }
.ibx-day.is-draft { color: var(--yellow); }
button.ibx-ev { display: grid; gap: 3px; width: 100%; padding: 11px 14px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  color: inherit; font-weight: 400; line-height: inherit; text-align: left; box-shadow: var(--shadow-1); transition: border-color .15s, background-color .15s; }
button.ibx-ev:hover { border-color: var(--line-2); }
button.ibx-ev:active { transform: none; background: var(--soft-2); }
button.ibx-ev.is-on { border-color: var(--tint); background: var(--sel); }
button.ibx-ev.is-draft { border-color: var(--yellow-line); }
button.ibx-ev.is-draft.is-on { background: var(--yellow-soft); }
.ibx-ev-top { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.ibx-ev-t { flex: none; color: var(--faint); font-variant-numeric: tabular-nums; }
.ibx-ev-h { flex: 1; min-width: 0; color: var(--ink); font-size: 14.5px; font-weight: 600; line-height: 1.45; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.ibx-dots { display: inline-flex; flex: none; gap: 3px; }
.ibx-dots .chat-dot { width: 7px; height: 7px; }
.ibx-ev-s { min-width: 0; color: var(--text); font-size: 13px; line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ibx-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.ibx-empty { padding: 48px 24px; color: var(--muted); text-align: center; font-size: 13.5px; line-height: 1.6; }

/* 右边的阅读区：一件事（标题、来源和时间、经过、发出的信、去哪接着说）；一封信；等你点头的信（为什么要你点头、正文） */
.ibx-read { min-height: 0; min-width: 0; overflow-y: auto; overscroll-behavior: contain; padding: 28px 36px 64px; }
.ibx-read > [data-sec] { max-width: 720px; }
.ibx-read > [data-sec] > * + * { margin-top: 16px; }
.ibx-read h2 { margin: 0; font-size: 20px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.ibx-meta { display: grid; gap: 4px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.ibx-meta b { color: var(--ink); font-weight: 600; }
.ibx-meta .ibx-ev-top { font-size: 13px; }
.ibx-num { font-variant-numeric: tabular-nums; }
.ibx-body { max-width: 62ch; padding: 18px 20px; border-radius: 12px; background: var(--soft); color: var(--text); font-size: 14px; line-height: 1.75;
  white-space: pre-wrap; overflow-wrap: anywhere; }
.ibx-why { max-width: 62ch; padding: 14px 16px; border: 1px solid var(--yellow-line); border-radius: 12px; background: var(--yellow-soft); font-size: 13.5px; line-height: 1.6; }
.ibx-why b { display: block; color: var(--ink); font-weight: 600; }
.ibx-why p { margin: 2px 0 0; color: var(--text); }
.ibx-why p.ibx-why-r { color: var(--muted); }
.ibx-why .ibx-body { margin-top: 12px; background: var(--panel); }
.ibx-sub { margin: 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; font-weight: 600; }
.ibx-read .ibx-sub + .chat-ev { padding-top: 0; border-top: 0; }
/* 经过里的一封信：谁、主题、她写的那句话；点开看正文、附件、她因此记下的事项 */
.ibx-mail { align-self: stretch; display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.ibx-mail.is-new { border-color: var(--tint); }
.ibx-mail.is-draft { border-color: var(--yellow-line); background: var(--yellow-soft); }
button.ibx-mail-h, div.ibx-mail-h { display: grid; grid-template-columns: 18px minmax(0, 1fr) 16px; gap: 10px; align-items: center; width: 100%; padding: 0; border: 0;
  background: none; color: inherit; font-weight: 400; text-align: left; }
div.ibx-mail-h { grid-template-columns: 18px minmax(0, 1fr); }
button.ibx-mail-h:hover, button.ibx-mail-h:active { background: none; transform: none; }
.ibx-mail-h .ic { width: 16px; height: 16px; color: var(--muted); }
.ibx-mail-h .ic.is-open { transform: rotate(90deg); }
.ibx-mail-w { display: grid; min-width: 0; }
.ibx-mail-w b { color: var(--ink); font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ibx-mail-w span { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.ibx-mail-did { display: flex; gap: 6px; margin: 0; color: var(--text); font-size: 13px; overflow-wrap: anywhere; }
.ibx-mail-did .ic { flex: none; width: 14px; height: 14px; margin-top: 3px; color: var(--tint); }
.ibx-mail .ibx-body { max-width: none; padding: 12px 14px; font-size: 13.5px; }
.ibx-did-items .up-row { margin-top: 6px; }
.ibx-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ibx-note { margin: 0; color: var(--muted); font-size: 13px; }
.ibx-read .chat-ev { padding-top: 14px; border-top: 1px solid var(--line); }
.ibx-next { padding-top: 14px; border-top: 1px solid var(--line); }
a.btn .ic, .ibx-next .btn .ic { width: 16px; height: 16px; }
.ibx-next .btn { display: inline-flex; align-items: center; gap: 6px; }
button.ibx-back { display: none; }
/* 邮件（docs/specs/inbox-mail.md）：附件名；来信下面「小优做了什么」那一块（样式稿的 .mr-att、.mr-did） */
.ibx-atts { display: flex; flex-wrap: wrap; gap: 8px; }
.ibx-att { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; height: 34px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px;
  color: var(--ink); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ibx-att .ic { flex: none; width: 15px; height: 15px; color: var(--muted); }

/* 窄一点的电脑：卡片那一列窄一些 */
@media (max-width: 1099.98px) and (min-width: 760px) {
  .ibx-panes { grid-template-columns: 320px minmax(0, 1fr); }
  .ibx-read { padding: 24px 24px 56px; }
}
/* 手机：一次只看一边。列表时只有卡片；点一张进阅读区，顶上「‹ 助手动态」回来。整块高度去掉顶上那一条（52px）和底部标签（64px） */
@media (max-width: 759.98px) {
  .ibx { height: calc(100vh - 116px - env(safe-area-inset-bottom, 0px)); height: calc(100dvh - 116px - env(safe-area-inset-bottom, 0px)); }
  .ibx-head { gap: 4px; padding: 18px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px)); }
  .ibx-lead { margin-bottom: 6px; font-size: 13px; }
  .ibx-panes { grid-template-columns: minmax(0, 1fr); }
  .ibx-list { border-right: 0; }
  .ibx-list > [data-sec] { padding: 4px 12px 28px; }
  .ibx-read { padding: 16px 16px 48px; }
  .ibx:not(.is-reading) .ibx-read { display: none; }
  .ibx.is-reading .ibx-list, .ibx.is-reading .ibx-head { display: none; }   /* 看一件事时标题和标签也收起来，「‹ 助手动态」回去 */
  .ibx.is-reading .ibx-panes { border-top: 0; }
  .ibx.is-reading .ibx-read { display: block; }
  button.ibx-back { display: inline-flex; align-items: center; gap: 2px; justify-self: start; margin-left: -6px; padding: 0; border: 0; background: none;
    color: var(--tint); font-size: 14px; font-weight: 400; }
  button.ibx-back:hover, button.ibx-back:active { background: none; transform: none; }
  .ibx-back .ic { width: 18px; height: 18px; }
}
@media (prefers-reduced-motion: reduce) { .ibx > * { animation-duration: .01ms; } }
.ibx-via { display: block; max-width: 100%; margin: 4px 0 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); color: var(--ink); font: inherit; font-size: 13px; }   /* 等你点头的信：从哪个邮箱发 */
