/* =============================================================================
 * css/feed.css —— 社媒动态流视图的样式（单元 B15-webui-feed）
 *
 * owner：B15-webui-feed。只服务 js/views/feed.js 画的 DOM（.feed-* 前缀），
 * 不改 layout.css / components.css 里的任何既有规则（那两份各有其席）。
 *
 * 纪律（ui-contract §0 U2）
 * ----------------------
 *   · 颜色 / 尺寸**全部**走 var(--fc-*)；本文件里没有 hex、没有 px 字面量
 *     （例外：0 与 var(--fc-hairline)）。带 hex 形态的 id 选择器一律不用。
 *   · 形状 / 层级沿用 ui-tokens：列表项圆角 --fc-radius-md、卡片 --fc-radius-lg、
 *     焦点环 --fc-focus-ring、状态色 --fc-danger / --fc-warning / --fc-success。
 *   · 三态**不同形**在样式层也要成立：loading=骨架条、empty=空态插图、
 *     unavailable=警示边框 + 重试按钮排。
 * ========================================================================== */

/* ── 列头（#list-header / #content-header 由视图改写，样式在这里补） ─────────────── */

.feed-header__title {
  font-size: var(--fc-font-heading-size);
  line-height: var(--fc-font-heading-line-height);
  font-weight: var(--fc-font-heading-weight);
  color: var(--fc-text-primary);
}

.feed-header__hint {
  margin-inline-start: var(--fc-space-8);
  font-size: var(--fc-font-caption-size);
  line-height: var(--fc-font-caption-line-height);
  color: var(--fc-text-tertiary);
}

/* ── 三态：每个态一个可辨形状 ────────────────────────────────────────────────── */

.feed-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--fc-space-8);
  padding: var(--fc-space-24);
  color: var(--fc-text-primary);
}

.feed-state__art {
  display: block;
  inline-size: var(--fc-space-64);
  block-size: var(--fc-space-64);
  color: var(--fc-text-tertiary);
}

.feed-state__title {
  margin: 0;
  font-size: var(--fc-font-title-size);
  line-height: var(--fc-font-title-line-height);
  font-weight: var(--fc-font-title-weight);
}

.feed-state__desc {
  margin: 0;
  max-inline-size: var(--fc-bubble-max-w);
  font-size: var(--fc-font-body-size);
  line-height: var(--fc-font-body-line-height);
  color: var(--fc-text-secondary);
}

.feed-state__hint {
  margin: 0;
  font-size: var(--fc-font-caption-size);
  line-height: var(--fc-font-caption-line-height);
  color: var(--fc-text-tertiary);
  overflow-wrap: anywhere;
}

.feed-state__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--fc-space-8);
  margin-block-start: var(--fc-space-8);
}

/* loading 专属：骨架条（与 empty 的插图、unavailable 的警示框不同形） */
.feed-state__skeletons {
  display: flex;
  flex-direction: column;
  gap: var(--fc-space-8);
  inline-size: 100%;
}

.feed-skeleton {
  block-size: var(--fc-item-h-compact);
  border-radius: var(--fc-radius-md);
  background: var(--fc-bg-sunken);
  animation: feed-pulse var(--fc-motion-slow) var(--fc-ease-standard) infinite alternate;
}

.feed-skeleton--short {
  inline-size: 60%;
}

@keyframes feed-pulse {
  from { opacity: 1; }
  to { opacity: 0.55; }
}

@media (prefers-reduced-motion: reduce) {
  .feed-skeleton { animation: none; }
}

/* unavailable 专属：警示左边条 + 状态色标题 */
.feed-state--unavailable {
  border-inline-start: var(--fc-hairline) solid var(--fc-danger);
  background: var(--fc-bg-surface);
  border-radius: var(--fc-radius-md);
}

.feed-state--unavailable .feed-state__title {
  color: var(--fc-danger);
}

/* empty 专属：细边框盒（形状 B） */
.feed-state--empty {
  border: var(--fc-hairline) solid var(--fc-line-subtle);
  border-radius: var(--fc-radius-lg);
  background: var(--fc-bg-surface);
}

/* ── 按钮（视图自带，不去改 components.css 的 .btn 词表） ──────────────────────── */

.feed-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--fc-space-4);
  min-block-size: var(--fc-hit-min);
  padding-inline: var(--fc-space-12);
  border: var(--fc-hairline) solid var(--fc-line-subtle);
  border-radius: var(--fc-radius-md);
  background: var(--fc-bg-surface);
  color: var(--fc-text-primary);
  font-size: var(--fc-font-label-size);
  line-height: var(--fc-font-label-line-height);
  cursor: pointer;
}

.feed-btn:hover {
  background: var(--fc-bg-hover);
}

.feed-btn:focus-visible {
  outline: var(--fc-hairline) solid var(--fc-focus-ring);
  outline-offset: var(--fc-hairline);
}

.feed-btn--primary {
  border-color: var(--fc-brand-solid);
  background: var(--fc-brand-solid);
  color: var(--fc-text-on-brand);
}

.feed-btn--primary:hover {
  background: var(--fc-brand-hover);
}

.feed-btn--more {
  inline-size: 100%;
  justify-content: center;
}

.feed-btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── 列表（左栏 #conversation-list） ────────────────────────────────────────── */

/* 列表落点就是外壳的 #conversation-list（role=list）：条目是它的直接子节点（role=listitem），
   所以间距靠卡片自身的 margin，不再套一层 .feed-list。 */
.feed-list__more {
  padding: var(--fc-space-4) var(--fc-space-8) var(--fc-space-8);
}

.feed-card {
  margin: var(--fc-space-4) var(--fc-space-8);
  display: flex;
  flex-direction: column;
  gap: var(--fc-space-4);
  border: var(--fc-hairline) solid var(--fc-line-subtle);
  border-radius: var(--fc-radius-md);
  background: var(--fc-bg-surface);
  overflow: hidden;
}

.feed-card:hover {
  background: var(--fc-bg-hover);
}

.feed-card__open {
  display: flex;
  flex-direction: column;
  gap: var(--fc-space-4);
  inline-size: 100%;
  padding: var(--fc-space-12);
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.feed-card__open:focus-visible {
  outline: var(--fc-hairline) solid var(--fc-focus-ring);
  outline-offset: calc(var(--fc-hairline) * -1);
}

.feed-card__author {
  font-size: var(--fc-font-label-size);
  line-height: var(--fc-font-label-line-height);
  color: var(--fc-text-brand);
}

.feed-card__title {
  font-size: var(--fc-font-body-strong-size);
  line-height: var(--fc-font-body-strong-line-height);
  font-weight: var(--fc-font-body-strong-weight);
  color: var(--fc-text-primary);
}

.feed-card__excerpt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  font-size: var(--fc-font-label-size);
  line-height: var(--fc-font-label-line-height);
  color: var(--fc-text-secondary);
}

.feed-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--fc-space-8);
  padding-inline: var(--fc-space-12);
  font-size: var(--fc-font-caption-size);
  line-height: var(--fc-font-caption-line-height);
  color: var(--fc-text-tertiary);
}

.feed-card__count {
  margin-inline-start: auto;
}

.feed-badge {
  padding-inline: var(--fc-space-8);
  border-radius: var(--fc-radius-full);
  background: var(--fc-bg-selected);
  color: var(--fc-text-primary);
  font-size: var(--fc-font-micro-size);
  line-height: var(--fc-font-micro-line-height);
}

.feed-card__actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 var(--fc-space-8) var(--fc-space-8);
}


/* ── 点赞（aria-pressed 真值；不靠颜色单独表达） ─────────────────────────────── */

.feed-like {
  display: inline-flex;
  align-items: center;
  gap: var(--fc-space-4);
  min-block-size: var(--fc-hit-min);
  padding-inline: var(--fc-space-8);
  border: var(--fc-hairline) solid var(--fc-line-subtle);
  border-radius: var(--fc-radius-full);
  background: var(--fc-bg-surface);
  color: var(--fc-text-secondary);
  font-size: var(--fc-font-label-size);
  line-height: var(--fc-font-label-line-height);
  cursor: pointer;
}

.feed-like[aria-pressed="true"] {
  border-color: var(--fc-brand-solid);
  color: var(--fc-text-brand);
}

.feed-like:focus-visible {
  outline: var(--fc-hairline) solid var(--fc-focus-ring);
  outline-offset: var(--fc-hairline);
}

.feed-like[aria-busy="true"] {
  opacity: 0.6;
}

.feed-like__mark {
  font-size: var(--fc-font-body-size);
}

/* ── 能力矩阵 + 边界（details 折叠；默认收起，不抢列表注意力） ─────────────────── */

.feed-platforms {
  margin: var(--fc-space-8);
  border: var(--fc-hairline) solid var(--fc-line-subtle);
  border-radius: var(--fc-radius-md);
  background: var(--fc-bg-surface);
}

.feed-platforms__summary {
  padding: var(--fc-space-8) var(--fc-space-12);
  font-size: var(--fc-font-label-size);
  line-height: var(--fc-font-label-line-height);
  color: var(--fc-text-secondary);
  cursor: pointer;
}

.feed-platforms__list,
.feed-boundary__list {
  margin: 0;
  padding: 0 var(--fc-space-12) var(--fc-space-8) var(--fc-space-20);
  list-style: disc;
}

.feed-platform {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--fc-space-8);
  font-size: var(--fc-font-label-size);
  line-height: var(--fc-font-label-line-height);
}

.feed-platform__label {
  font-weight: var(--fc-font-body-strong-weight);
  color: var(--fc-text-primary);
}

.feed-platform__status {
  padding-inline: var(--fc-space-8);
  border-radius: var(--fc-radius-full);
  background: var(--fc-bg-sunken);
  color: var(--fc-text-secondary);
  font-size: var(--fc-font-micro-size);
  line-height: var(--fc-font-micro-line-height);
}

.feed-platform__status[data-available="true"] {
  background: var(--fc-bg-selected);
  color: var(--fc-text-brand);
}

.feed-platform__status[data-available="false"] {
  background: var(--fc-bg-sunken);
  color: var(--fc-warning);
}

.feed-platform__note {
  color: var(--fc-text-tertiary);
  font-size: var(--fc-font-caption-size);
  line-height: var(--fc-font-caption-line-height);
}

.feed-boundary {
  padding: var(--fc-space-8) var(--fc-space-12) var(--fc-space-12);
  border-block-start: var(--fc-hairline) solid var(--fc-line-subtle);
}

.feed-boundary__title {
  margin: 0 0 var(--fc-space-4);
  font-size: var(--fc-font-label-size);
  line-height: var(--fc-font-label-line-height);
  color: var(--fc-text-primary);
}

.feed-boundary__list {
  margin: 0;
  padding-inline-start: var(--fc-space-20);
}

.feed-boundary__list > li {
  margin-block-end: var(--fc-space-4);
  font-size: var(--fc-font-caption-size);
  line-height: var(--fc-font-caption-line-height);
  color: var(--fc-text-secondary);
}

/* ── 右栏首页（没选条目）：空态 + 能力矩阵 ───────────────────────────────────── */

.feed-home {
  display: flex;
  flex-direction: column;
  gap: var(--fc-space-16);
  padding: var(--fc-space-16);
  block-size: 100%;
  overflow-y: auto;
  background: var(--fc-bg-canvas);
}

.feed-home .feed-platforms {
  margin: 0;
}

/* ── 详情 ──────────────────────────────────────────────────────────────────── */

.feed-detail {
  display: flex;
  flex-direction: column;
  gap: var(--fc-space-12);
  block-size: 100%;
  padding: var(--fc-space-16) var(--fc-space-24) var(--fc-space-24);
  overflow-y: auto;
  background: var(--fc-bg-canvas);
  color: var(--fc-text-primary);
}

.feed-detail__toolbar {
  display: flex;
  align-items: center;
  gap: var(--fc-space-12);
}

.feed-detail__toolbar-hint {
  font-size: var(--fc-font-caption-size);
  line-height: var(--fc-font-caption-line-height);
  color: var(--fc-text-tertiary);
}

.feed-detail__title {
  margin: 0;
  max-inline-size: var(--fc-bubble-max-w);
  font-size: var(--fc-font-display-size);
  line-height: var(--fc-font-display-line-height);
  font-weight: var(--fc-font-display-weight);
}

.feed-detail__title:focus-visible {
  outline: var(--fc-hairline) solid var(--fc-focus-ring);
  outline-offset: var(--fc-space-4);
}

.feed-detail__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--fc-space-8);
  font-size: var(--fc-font-caption-size);
  line-height: var(--fc-font-caption-line-height);
  color: var(--fc-text-tertiary);
}

.feed-detail__author {
  color: var(--fc-text-brand);
  font-size: var(--fc-font-label-size);
}

.feed-detail__text {
  margin: 0;
  max-inline-size: var(--fc-bubble-max-w);
  padding: var(--fc-space-12) var(--fc-space-16);
  border: var(--fc-hairline) solid var(--fc-line-subtle);
  border-radius: var(--fc-radius-lg);
  background: var(--fc-bg-surface);
  font-size: var(--fc-font-body-size);
  line-height: var(--fc-font-body-line-height);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.feed-detail__actions {
  display: flex;
  align-items: center;
  gap: var(--fc-space-12);
}

.feed-detail__comments-count {
  font-size: var(--fc-font-caption-size);
  color: var(--fc-text-tertiary);
}

/* 状态行：role=status；hidden 时必须真的不显示（display:flex 会盖掉 UA 的 [hidden]） */
.feed-status {
  margin: 0;
  padding: var(--fc-space-8) var(--fc-space-12);
  border-radius: var(--fc-radius-md);
  background: var(--fc-bg-sunken);
  color: var(--fc-text-secondary);
  font-size: var(--fc-font-label-size);
  line-height: var(--fc-font-label-line-height);
}

.feed-status[data-tone="error"] {
  background: var(--fc-bg-surface);
  border-inline-start: var(--fc-hairline) solid var(--fc-danger);
  color: var(--fc-danger);
}

.feed-status[hidden] {
  display: none;
}

/* ── 评论 ──────────────────────────────────────────────────────────────────── */

.feed-comments {
  display: flex;
  flex-direction: column;
  gap: var(--fc-space-8);
  max-inline-size: var(--fc-bubble-max-w);
}

.feed-comments__title {
  margin: 0;
  font-size: var(--fc-font-heading-size);
  line-height: var(--fc-font-heading-line-height);
  font-weight: var(--fc-font-heading-weight);
}

.feed-comments__empty,
.feed-comments__more {
  margin: 0;
  font-size: var(--fc-font-label-size);
  line-height: var(--fc-font-label-line-height);
  color: var(--fc-text-tertiary);
}

.feed-comments__list {
  display: flex;
  flex-direction: column;
  gap: var(--fc-space-8);
  margin: 0;
  padding: 0;
  list-style: none;
}

.feed-comment {
  padding: var(--fc-space-8) var(--fc-space-12);
  border: var(--fc-hairline) solid var(--fc-line-subtle);
  border-radius: var(--fc-radius-md);
  background: var(--fc-bg-surface);
}

.feed-comment__head {
  display: flex;
  align-items: baseline;
  gap: var(--fc-space-8);
}

.feed-comment__author {
  font-size: var(--fc-font-label-size);
  color: var(--fc-text-brand);
}

.feed-comment__time {
  font-size: var(--fc-font-caption-size);
  color: var(--fc-text-tertiary);
}

.feed-comment__text {
  margin: var(--fc-space-4) 0 0;
  font-size: var(--fc-font-body-size);
  line-height: var(--fc-font-body-line-height);
  color: var(--fc-text-primary);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.feed-compose {
  display: flex;
  flex-direction: column;
  gap: var(--fc-space-4);
  margin-block-start: var(--fc-space-8);
}

.feed-compose__label {
  font-size: var(--fc-font-label-size);
  line-height: var(--fc-font-label-line-height);
  color: var(--fc-text-secondary);
}

.feed-compose__input {
  inline-size: 100%;
  padding: var(--fc-space-8) var(--fc-space-12);
  border: var(--fc-hairline) solid var(--fc-line-strong);
  border-radius: var(--fc-radius-md);
  background: var(--fc-bg-surface);
  color: var(--fc-text-primary);
  font-family: inherit;
  font-size: var(--fc-font-body-size);
  line-height: var(--fc-font-body-line-height);
  resize: vertical;
}

.feed-compose__input:focus-visible {
  outline: var(--fc-hairline) solid var(--fc-focus-ring);
  outline-offset: var(--fc-hairline);
}

.feed-compose__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--fc-space-12);
}

.feed-compose__hint {
  font-size: var(--fc-font-caption-size);
  line-height: var(--fc-font-caption-line-height);
  color: var(--fc-text-tertiary);
}
