/* ============================================================
   帖子列表卡片（步骤47）：首页、个人主页、搜索、标签 / 话题页共用（post/post-list.php，含「加载更多」）
   - 标记 class 由 Qirisha_UI::feed_class() 加：qh-feed-card（所有类型的卡片外观）、qh-feed-titled（论坛帖 / 文章的新排版）
   - 只在「矩状」列表风格生效：右下角偏好设置切成「时光轴」时，主题给列表加 .time，这里的规则全部不匹配，保持主题原样
   - 不改主题的 HTML 结构和功能（点赞、评论、查看全文、设置菜单都是主题原来的），只重新排版
   规范：_优化补丁/前端设计基线.md 6.11
   ============================================================ */

/* ---- 卡片外观（所有类型）：同页面卡片，日间极细阴影勾边、夜间 1px 细描边 ---- */
:not(.time) > .qh-feed-card {
  margin-bottom: 12px;
  border: 1px solid var(--qh-s-edge);
  border-radius: var(--qh-r-card);
  background-color: var(--qh-s-card);
  box-shadow: var(--qh-s-shadow);
  --qh-ring-gap: var(--qh-s-card);
  transition: box-shadow .2s, border-color .2s;
}
.theme-light :not(.time) > .qh-feed-card:hover { box-shadow: var(--qh-s-shadow), 0 6px 18px -10px rgba(0, 0, 0, .18); }
.theme-dark :not(.time) > .qh-feed-card:hover { border-color: rgba(255, 255, 255, .13); }

/* ---- 论坛帖 / 文章：网格排版 ----
   第 1 行标题（占满整行，右边留出设置菜单按钮）、第 2 行摘要、第 3 行留白（让封面撑高时不拉开摘要和底栏）、第 4 行多图、第 5 行应用卡片、第 6 行底栏；
   封面在右列跨 2~3 行（和摘要并排） */
:not(.time) > .qh-feed-titled {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto 1fr auto auto auto;
  padding: 18px 20px 14px;
  font-family: var(--qh-font);
}
:not(.time) > .qh-feed-titled > .jinsom-post-user-info { display: none; }
:not(.time) > .qh-feed-titled .jinsom-post-single-content,
:not(.time) > .qh-feed-titled .jinsom-post-single-excerp-content { display: contents; }
:not(.time) > .qh-feed-titled .jinsom-post-single-content::after,
:not(.time) > .qh-feed-titled .jinsom-post-single-excerp-content::after,
:not(.time) > .qh-feed-titled .jinsom-post-single-bar::after { display: none; }

/* 标题：最多两行；标题前的置顶 / 精华 / 标记等小标签做成实心底白字 */
:not(.time) > .qh-feed-titled > h2.single {
  grid-column: 1 / -1;
  grid-row: 1;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0 !important;
  padding: 0 32px 0 0 !important;   /* 右边留给设置菜单按钮 */
  color: var(--qh-s-text);
  font-size: 17px !important;
  font-weight: 600;
  line-height: 1.5 !important;
  word-break: break-all;
}
:not(.time) > .qh-feed-titled > h2.single a {
  overflow: visible;
  white-space: normal;
  color: var(--qh-s-text);
  transition: color .15s;
}
:not(.time) > .qh-feed-titled > h2.single a:hover { color: var(--qh-accent); }
/* 后台设置的标题颜色：日间原色（行内 color），夜间用 PHP 提亮的 --qh-tc-d */
.theme-dark :not(.time) > .qh-feed-titled > h2.single a[style*="--qh-tc-d"] { color: var(--qh-tc-d) !important; }
:not(.time) > .qh-feed-titled > h2.single > span {
  display: inline-block;
  height: 20px;
  margin: 0 6px 0 0;
  padding: 0 7px;
  border-radius: 5px;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 20px;
  vertical-align: 2px;
}
:not(.time) > .qh-feed-titled > h2.single > .jinsom-bbs-post-type-file,
:not(.time) > .qh-feed-titled > h2.single > .jinsom-bbs-post-type-img { padding: 0 5px; background: var(--qh-s-sunken); }
:not(.time) > .qh-feed-titled > h2.single > .jinsom-bbs-post-type-file i,
:not(.time) > .qh-feed-titled > h2.single > .jinsom-bbs-post-type-img i { color: var(--qh-s-muted); font-size: 13px; vertical-align: 0; }

/* 摘要：两行 */
:not(.time) > .qh-feed-titled .jinsom-post-single-content-right,
:not(.time) > .qh-feed-titled .jinsom-post-single-excerp {
  grid-column: 1;
  grid-row: 2;
  float: none;
  width: auto;
  height: auto;
}
:not(.time) > .qh-feed-titled .jinsom-post-single-excerp {
  margin-top: 6px;
  color: var(--qh-s-text2);
  font-size: 14px;
  line-height: 1.7;
}
:not(.time) > .qh-feed-titled .jinsom-post-single-excerp a {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  width: auto;
  height: auto;
  color: inherit;
  word-break: break-all;
}
:not(.time) > .qh-feed-titled .jinsom-post-single-excerp a:hover { color: var(--qh-s-text); }

/* 单图：封面放右边 */
:not(.time) > .qh-feed-titled .jinsom-post-single-content-left {
  grid-column: 2;
  grid-row: 2 / 4;
  float: none;
  margin: 8px 0 0 16px;
}
:not(.time) > .qh-feed-titled .jinsom-post-single-content-left a {
  display: block;
  width: 176px;
  height: 104px;
  border: 0;
  border-radius: 8px;
  background-color: var(--qh-s-sunken);
}

/* 多图：摘要下面一排三张 */
:not(.time) > .qh-feed-titled .jinsom-post-single-thum {
  grid-column: 1 / -1;
  grid-row: 4;
  gap: 8px;
  margin-top: 12px;
}
:not(.time) > .qh-feed-titled .jinsom-post-single-thum a {
  width: calc((100% - 16px) / 3);
  height: 132px;
  margin: 0;
  border: 0;
  border-radius: 8px;
  background-color: var(--qh-s-sunken);
}
:not(.time) > .qh-feed-titled .jinsom-post-single-thum a:last-child span {
  top: auto;
  right: 6px;
  bottom: 6px;
  width: auto;
  height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 12px;
  line-height: 20px;
}

/* 帖子里插入的应用（商品、链接…） */
:not(.time) > .qh-feed-titled .jinsom-post-application-show {
  grid-column: 1 / -1;
  grid-row: 5;
  margin: 12px 0 0;
  border: 0;
  border-radius: 8px;
  background-color: var(--qh-s-sunken);
}
:not(.time) > .qh-feed-titled .jinsom-post-application-show:hover { background-color: var(--qh-s-hover); }

/* ---- 底栏：作者（22px 头像，认证只用头像上的图标）· 友好时间 板块，右边点赞 / 评论 / 浏览 ---- */
:not(.time) > .qh-feed-titled .jinsom-post-single-bar {
  grid-column: 1 / -1;
  grid-row: 6;
  position: static;
  display: flex;
  align-items: center;
  gap: 8px;
  width: auto;
  min-width: 0;
  margin-top: 12px;
  padding: 0;
  color: var(--qh-s-muted);
  font-size: 12px;
  line-height: 1.5;
}
:not(.time) > .qh-feed-titled .jinsom-post-single-bar li {
  float: none;
  display: inline-flex;
  align-items: center;
  height: auto;
  margin: 0;
  line-height: inherit;
  white-space: nowrap;
}
:not(.time) > .qh-feed-titled .jinsom-post-single-bar li a { color: inherit; }
:not(.time) > .qh-feed-titled .jinsom-post-single-bar li:not(.author):not(.cat):not(.right),
:not(.time) > .qh-feed-titled .jinsom-post-single-bar li:not(.author):not(.cat):not(.right) > a { display: inline-flex; align-items: center; gap: 4px; }
:not(.time) > .qh-feed-titled .jinsom-post-single-bar .author { order: 1; display: inline-flex; gap: 6px; min-width: 0; overflow: visible; }
:not(.time) > .qh-feed-titled .jinsom-post-single-bar .author > a:first-child { position: relative; flex: none; display: block; width: 22px; height: 22px; }
:not(.time) > .qh-feed-titled .jinsom-post-single-bar .author ls { display: contents; }
:not(.time) > .qh-feed-titled .jinsom-post-single-bar .author x { display: none; }   /* 头像框插件：22px 太小，不显示头像框 */
:not(.time) > .qh-feed-titled .jinsom-post-single-bar .author img {
  display: block;
  width: 22px;
  height: 22px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: top;
}
:not(.time) > .qh-feed-titled .jinsom-post-single-bar .author i.jinsom-verify {
  right: -4px;
  bottom: -4px;
  transform: scale(.6);
  transform-origin: 100% 100%;
}
:not(.time) > .qh-feed-titled .jinsom-post-single-bar .author > a:last-child {
  overflow: hidden;
  max-width: 160px;
  margin: 0;
  color: var(--qh-s-text);
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
}
:not(.time) > .qh-feed-titled .jinsom-post-single-bar .author > a:last-child:hover { color: var(--qh-accent); }
/* 时间：友好时间（N 分钟前…），鼠标停留显示完整时间（li 的 title）；不显示「电脑端」来源 */
:not(.time) > .qh-feed-titled .jinsom-post-single-bar .right { order: 2; float: none; cursor: default; }
:not(.time) > .qh-feed-titled .jinsom-post-single-bar .right::before { content: "·"; margin-right: 8px; }
:not(.time) > .qh-feed-titled .jinsom-post-single-bar .right > span { display: none; margin: 0; }
:not(.time) > .qh-feed-titled .jinsom-post-single-bar .right > .qh-feed-ago { display: inline; }
/* 板块 */
:not(.time) > .qh-feed-titled .jinsom-post-single-bar .cat { order: 3; margin-left: 4px; }
:not(.time) > .qh-feed-titled .jinsom-post-single-bar .cat > i { display: none; }
:not(.time) > .qh-feed-titled .jinsom-post-single-bar .cat a {
  display: block;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background-color: var(--qh-s-sunken);
  color: var(--qh-s-text2);
  line-height: 22px;
  transition: background-color .15s, color .15s;
}
:not(.time) > .qh-feed-titled .jinsom-post-single-bar .cat a:hover { background-color: var(--qh-s-tint); color: var(--qh-accent); }
/* 点赞 / 评论 / 转发 / 浏览：靠右 */
:not(.time) > .qh-feed-titled .jinsom-post-single-bar .jinsom-no-like,
:not(.time) > .qh-feed-titled .jinsom-post-single-bar .jinsom-had-like { order: 4; margin-left: auto; padding-left: 8px; }
:not(.time) > .qh-feed-titled .jinsom-post-single-bar li:nth-child(3) { order: 5; }
:not(.time) > .qh-feed-titled .jinsom-post-single-bar .reprint { order: 6; }
:not(.time) > .qh-feed-titled .jinsom-post-single-bar .views { order: 7; }
:not(.time) > .qh-feed-titled .jinsom-post-single-bar .jinsom-no-like,
:not(.time) > .qh-feed-titled .jinsom-post-single-bar .jinsom-had-like,
:not(.time) > .qh-feed-titled .jinsom-post-single-bar li:nth-child(3),
:not(.time) > .qh-feed-titled .jinsom-post-single-bar .reprint,
:not(.time) > .qh-feed-titled .jinsom-post-single-bar .views { margin-right: 8px; transition: color .15s; }
:not(.time) > .qh-feed-titled .jinsom-post-single-bar .views { margin-right: 0; }
:not(.time) > .qh-feed-titled .jinsom-post-single-bar li > i,
:not(.time) > .qh-feed-titled .jinsom-post-single-bar li > a > i { margin: 0; font-size: 15px; }
:not(.time) > .qh-feed-titled .jinsom-post-single-bar .jinsom-no-like:hover,
:not(.time) > .qh-feed-titled .jinsom-post-single-bar li:nth-child(3):hover,
:not(.time) > .qh-feed-titled .jinsom-post-single-bar .reprint:hover,
:not(.time) > .qh-feed-titled .jinsom-post-single-bar .views:hover { color: var(--qh-s-text2); }
:not(.time) > .qh-feed-titled .jinsom-post-single-bar .jinsom-had-like { color: var(--qh-accent); }

/* ---- 加载更多：卡片后面的整行按钮 ---- */
:not(.time) > .qh-feed-card ~ .jinsom-more-posts {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  height: 42px;
  padding: 0;
  border: 1px solid var(--qh-s-edge);
  border-radius: var(--qh-r-card);
  background-color: var(--qh-s-card);
  box-shadow: var(--qh-s-shadow);
  color: var(--qh-s-text2);
  font-family: var(--qh-font);
  font-size: 14px;
  font-weight: 500;
  transition: color .15s;
}
:not(.time) > .qh-feed-card ~ .jinsom-more-posts:hover { color: var(--qh-accent); }

/* ---- 设置菜单（查看全文、收藏、举报、管理…）：标题行最右边，菜单同导航栏浮层 ----
   按钮不设 z-index：设了会形成层叠上下文，展开的菜单（z-index 999）就盖不住下一张卡片的按钮 */
:not(.time) > .qh-feed-titled > .jinsom-post-setting {
  position: absolute;
  top: 19px;
  right: 14px;
  bottom: auto;
  float: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin: 0;
  border-radius: 6px;
  color: var(--qh-s-muted);
  font-size: 15px;
  transition: background-color .15s, color .15s;
}
:not(.time) > .qh-feed-titled > .jinsom-post-setting:hover { background-color: var(--qh-s-sunken); color: var(--qh-s-text); }
:not(.time) > .qh-feed-card .jinsom-post-setting-box {
  top: 28px;
  right: 0;
  box-sizing: border-box;
  min-width: 120px;
  padding: 6px;
  border: 1px solid var(--qh-chrome-edge);
  border-radius: var(--qh-r-pop);
  background: var(--qh-chrome-pop-solid);
  box-shadow: var(--qh-chrome-shadow);
  color: var(--qh-chrome-text-pop);
  font-family: var(--qh-font);
  font-size: 13px;
  text-align: left;
}
:not(.time) > .qh-feed-card .jinsom-post-setting-box li {
  padding: 7px 12px;
  border-radius: var(--qh-r-pop-item);
  color: inherit;
  line-height: 1.4;
  list-style: none;
}
:not(.time) > .qh-feed-card .jinsom-post-setting-box li a { display: block; color: inherit; }
:not(.time) > .qh-feed-card .jinsom-post-setting-box li:hover { background-color: var(--qh-chrome-pop-hover); }
