/*!
 * demand-more.css —— 首页「需求匹配大厅」区块：更多按钮 + 卡片保守打磨（2026-09-12）
 * ---------------------------------------------------------------------------
 * 作用域说明：`.demand-list` / `.demand-card` 是**首页专用**类名
 *   （已实测确认：/demands 整页用的是 .request-grid / .request-card），
 *   所以本文件所有规则只影响首页这一个区块，不会波及其它页面。
 *
 * 一、按钮部分刻意与 prod-more.css 保持同一套视觉（品牌红描边 + 浅绯底，hover 反相），
 *     只是换成 .demand-more* 命名空间 —— 让两个「更多」看起来是一套东西。
 * 二、卡片部分是「保守打磨」：描述限 3 行、数量/收货地做成小标签、底部对齐、悬停上浮。
 *     不新增元素、不改信息内容。
 */

/* ======================= 一、「更多」按钮 ======================= */
.demand-more-wrap {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.demand-more {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  min-height: 54px;
  padding: 12px 20px;
  border: 1px solid #f0d5d1;
  border-radius: 12px;
  background: #fdf3f1;
  color: var(--c-primary, #c93628);
  font-family: var(--font, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", Arial, sans-serif);
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .02em;
  cursor: pointer;
  transition: background .16s, color .16s, border-color .16s;
}
.demand-more:hover:not(:disabled) {
  background: var(--c-primary, #c93628);
  border-color: var(--c-primary, #c93628);
  color: #fff;
}
.demand-more:active:not(:disabled) { transform: translateY(1px); }
.demand-more:focus-visible { outline: 2px solid var(--c-primary, #c93628); outline-offset: 2px; }
.demand-more[disabled] { cursor: default; }

/* 加载中：文字换成「加载中…」，加一个转圈 */
.demand-more.is-loading { color: #a63329; }
.demand-more.is-loading::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: none;
  border: 2px solid rgba(201, 54, 40, .28);
  border-top-color: var(--c-primary, #c93628);
  border-radius: 50%;
  animation: demand-more-spin .7s linear infinite;
}
@keyframes demand-more-spin { to { transform: rotate(360deg); } }

/* 已到底：降级为静默说明条 */
.demand-more.is-done {
  background: transparent;
  border-color: var(--c-line, #e3d9cf);
  border-style: dashed;
  color: var(--c-ink-light, #74685d);
}
.demand-more-cnt {
  font-family: var(--font, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", Arial, sans-serif);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--c-ink-light, #74685d);
  text-align: center;
}
.demand-more-err { color: #c93628; }

/* ======================= 二、需求卡片保守打磨 ======================= */

/* 1) 卡片改成纵向 flex：描述短的卡片，底部「价格 / 按钮」也能对齐到卡片底部，
      三张卡片看起来才整齐（原来底部会悬在中间）。 */
.demand-card {
  display: flex;
  flex-direction: column;
  transition: box-shadow .18s, border-color .18s, transform .18s;
}
.demand-card > a {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

/* 2) 描述最多 3 行，超出用省略号 —— 这是「高度整齐」的主要来源 */
.demand-card .demand-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  margin-bottom: 13px;
}
/* 把底部推到底（原样式是 margin-top:13px，改 auto 后最小间距由上面的 margin-bottom 保证） */
.demand-card .demand-foot { margin-top: auto; }

/* 3) 「数量 / 收货地」做成浅色小标签（与站内 .response-details span 同一套观感） */
.demand-card .demand-meta { gap: 8px; margin-top: 11px; }
.demand-card .demand-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  min-width: 0;
  padding: 4px 10px;
  border-radius: 8px;
  background: #faf6f0;
  border: 1px solid #f0e7db;
  font-size: 12px;
  color: var(--c-ink-light, #74685d);
}
.demand-card .demand-meta > span b {
  color: var(--c-ink, #26211d);
  font-weight: 700;
  min-width: 0;
}

/* 4) 标题占据剩余宽度、日期不被挤压；标题最多 2 行 */
.demand-card .demand-top b {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  min-width: 0;
}
.demand-card .demand-top .time { flex: none; white-space: nowrap; }

/* 5) 同一排卡片「一样满」——预留固定行数，短卡片不再留大片空白。
      实测（1225px 宽栅格）：
        · .demand-top b  字号 15.5px、行高 24.8px → 2 行 = 49.6px = 3.2em
        · .demand-desc   字号 13px、行高 22.1px  → 3 行 = 66.3px = 5.1em
      两张卡的最小高度由此完全一致，配合上面的「页脚吸底」，
      栅格里每一格高度都相同，不会再出现
      「宠物用品那张下面空一大块」的情况。 */
.demand-card .demand-top b { min-height: 3.2em; }
.demand-card .demand-desc { min-height: 5.1em; }

/* 6) 悬停轻微上浮（与站内 .response-list-card:hover 同风格） */
.demand-card:hover {
  border-color: #e2d4c4;
  box-shadow: 0 10px 26px -16px rgba(38, 33, 29, .38);
  transform: translateY(-2px);
}

/* ======================= 三、窄屏 / 降低动效 ======================= */
@media (max-width: 640px) {
  .demand-more-wrap { margin-top: 14px; gap: 8px; }
  .demand-more { min-height: 48px; font-size: 14.5px; padding: 11px 16px; }
  .demand-more-cnt { font-size: 12px; }
  /* 触屏不做位移动效，避免点按后残留悬浮态 */
  .demand-card:hover { transform: none; }

  /* ---------------------------------------------------------------------
     ⚠️ 修 /demands 卡片区横向溢出（实测：卡片宽 909.656px，容器只有 347px，整页溢出到 924px）
     根因：主包窄屏口径是 `.request-grid{grid-template-columns:1fr}`，
     而裸 `1fr` 等价于 `minmax(auto,1fr)` —— 其中 `auto` 作为轨道下限等于 **min-content**。
     偏偏主包给标题写了
       `.request-card h3{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}`
     视觉上靠省略号截断、看着很安全，但 `nowrap` 会让 h3 的 min-content
     = **整行文本宽度**。站内有一条需求标题长约 56 字（≈896px），
     直接把网格轨道顶到 909.656px，整页横向溢出。
     修法：轨道下限显式写成 0，并让卡片自身可收缩（min-width:auto → 0）。
     验证过的定位手法：逐张 `display:none` 网格项看 `gridTemplateColumns` 变化 ——
     隐藏那条长标题的卡片后列宽 909.656 → 461.406，一击命中。
     ⚠️ 本文件排在 mobile-v5.css **之后**加载，所以这里**不能**无条件写
        `grid-template-columns`：那个文件里有 641~860px 的两列口径，无条件写会把平板压回单列。
     --------------------------------------------------------------------- */
  .request-grid { grid-template-columns: minmax(0, 1fr); }
  .request-card { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .demand-more.is-loading::before { animation-duration: 1.6s; }
  .demand-more { transition: none; }
  .demand-card, .demand-card:hover { transition: none; transform: none; }
}
