/* ===== 拆分自 style.css（第 2 部分，原第 915-1368 行）—— 必须紧跟在上一部分之后按序加载，顺序影响层叠结果 ===== */
/* ===================================
   帖子列表卡片：首页 feed 与 /forum 分类页共用统一规范
   =================================== */
.tq-post-row {
    cursor: pointer;
}

/* 大卡片式：行内距提升，形成卡片呼吸感（视觉层级由标题 > 摘要 > 元信息保证） */
.tq-post-row {
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* 帖子列表作者：头像 + 昵称同排，身份角标挂在头像右下角（.official-badge-host） */
.tq-feed-author {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    vertical-align: middle;
}
.tq-feed-author__avatar {
    flex: none;
    text-decoration: none;
}
.tq-feed-author__name {
    color: inherit;
}

/* 缩略图：固定容器 + 模糊背景填充 + contain 完整显示不裁切；
   扁平化处理：去掉冗余边框；视觉层升级：主图/视频封面放大（大预览） */
.tq-feed-thumb {
    position: relative;
    display: block;
    width: 150px;
    min-width: 150px;
    height: 112px;
    flex-shrink: 0;
    border-radius: var(--border-radius-lg, 8px);
    overflow: hidden;
    background: var(--bg-surface, #1e1b2e);
}
.tq-feed-thumb-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(8px);
    transform: scale(1.15);
}
.tq-feed-thumb img {
    position: relative;
    display: block;
    width: 100%;
    height: 100% !important; /* 覆盖全局 img{height:auto} */
    object-fit: contain;
}

/* 正文只有视频的帖子：封面改用 <video> + #t 媒体片段，由浏览器解码首帧，不抽帧也不依赖 ffmpeg。
   容器背景铺默认占位图，首帧没解码出来时是「有图的灰底」而不是一块空白；
   写成 .tq-*-thumb.tq-thumb-video 两个类名是为了压过各列表页自带的同权重背景声明 */
.tq-feed-thumb.tq-thumb-video,
.tq-tag-thumb.tq-thumb-video {
    background: var(--bg-surface, #1e1b2e) url('/public/assets/images/default-article.svg') center / 60% no-repeat;
}
.tq-thumb-video video {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* 原生播放控制可用（controls）：点击仍由行级处理器回帖子详情，因此给 video 打 stopPropagation */
}

/* 视频封面的播放角标：提示这张图其实是视频 */
.tq-thumb-play {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 8px;
}
.tq-thumb-play i { padding-left: 1px; }

/* 标题：卡片视觉主层级，字号明显大于摘要与元信息，单行截断 */
.tq-feed-title {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: .25rem !important;
    font-size: 1.0625rem;   /* 17px */
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: .01em;
}

/* 摘要：次级信息，比标题小两档，两行截断 */
.tq-feed-excerpt {
    color: var(--text-secondary, #a1a1aa);
    font-size: .8125rem;    /* 13px */
    line-height: 1.55;
    margin-bottom: .3rem !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 元信息（作者/分类/城市/时间）：第三层级，最小字号；颜色沿用 text-muted */
.tq-feed-meta {
    font-size: .75rem;      /* 12px */
    line-height: 1.5;
}
.tq-feed-meta i { opacity: .75; }

/* 右侧浏览/评论统计：与元信息同档 */
.tq-feed-stats {
    font-size: .75rem;      /* 12px */
    line-height: 1.5;
    text-align: right;
}
.tq-feed-stats > div + div { margin-top: 2px; }
.tq-feed-stats i { opacity: .75; }

/* 话题标签：蓝底色高亮 + 加粗，更具互动感（Phase 2 内容呈现） */
.tq-hashtag {
    color: var(--primary-color, #0d6efd);
    font-weight: 700;
    cursor: pointer;
}

/* 只读徽标（置顶/精华/锁定），两页统一：比元信息再小一档，不与标题争视觉。
   排除等级/身份/爵位徽章：它们由 level-badges.css 统一控制尺寸与字重，
   否则这里的 (0,2,0) 权重会盖掉 .lv-level-badge-sm（0,1,0），
   导致帖子卡片的等级徽章与个人主页不一致。 */
.tq-post-row .badge:not(.lv-level-badge):not(.lv-identity-badge):not(.lv-nobility-badge) {
    font-size: .6875rem;    /* 11px */
    font-weight: 500;
    line-height: 1.35;
    padding: .18em .45em;
    vertical-align: .06em;
}
.tq-cat-badge-top { background: var(--danger-color, #dc3545); color: #fff; }
.tq-cat-badge-featured { background: var(--warning-color, #ffc107); color: #1D172B; }
.tq-cat-badge-lock { background: var(--bg-muted, #6c757d); color: var(--text-secondary, #a1a1aa); border: 1px solid var(--border-light, #dee2e6); }

@media (max-width: 576px) {
    .tq-feed-thumb {
        width: 112px;
        min-width: 112px;
        height: 84px;
    }
    /* 窄屏等比收一档，保持「标题 > 摘要 > 元信息」的层级差 */
    .tq-feed-title { font-size: 1rem; }        /* 16px */
    .tq-feed-excerpt { font-size: .75rem; }    /* 12px */
    .tq-feed-meta,
    .tq-feed-stats { font-size: .6875rem; }    /* 11px */
}
@media (max-width: 390px) {
    .tq-feed-thumb {
        width: 84px;
        min-width: 84px;
        height: 63px;
    }
}

/* ===================================
   整卡式信息流卡片：用户信息 → 正文 → 全宽媒体 → 互动栏
   （保留旧 .tq-post-row / .tq-feed-title 类名，点击与版务逻辑不变）
   =================================== */
/* 帖子列表外框：每张帖子自身已是带边框的圆角卡片，外层列表卡片不再重复画边框和底色，
   否则两条 1px 边框紧贴（中间 p-0 无留白）、圆角 12/14 错位，且外层底色会在卡片间隙
   露出一块比页面更亮的圆角底板，看起来仍像一圈外框。
   选择器带 body 前缀：dark-mode.css 的 [data-theme="dark"] .card 与之同为 (0,2,0)，
   且后者在文档中更靠后，必须提高一级特异性才能压住暗色分支。 */
body .card.tq-post-list {
    border: 0;
    background: transparent;
}
.tq-post-row.tq-feed-card {
    display: block;
    position: relative;
    margin-bottom: 14px;
    padding: 14px 16px 6px;
    border: 1px solid var(--border-color, rgba(255,255,255,.08));
    border-radius: 14px;
    background: var(--bg-surface, transparent);
}
.tq-feed-card__inner { display: block; }
.tq-feed-card__head { display: flex; align-items: center; gap: 10px; }
.tq-feed-card__avatar {
    width: 42px; height: 42px; flex: none; border-radius: 50%;
    display: inline-flex; text-decoration: none;
}
.tq-feed-card__avatar img {
    width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block;
}
.tq-feed-card__who { min-width: 0; flex: 1; }
.tq-feed-card__name-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tq-feed-card__name {
    font-weight: 600; font-size: var(--fs-sm, .875rem);
    color: var(--text-primary, inherit); text-decoration: none;
}
.tq-feed-card__meta {
    font-size: var(--fs-xs, .75rem); color: var(--text-muted);
    margin-top: 2px; line-height: 1.4;
}
.tq-feed-card__body { margin-top: 10px; }
.tq-feed-card__title { font-size: 1.0625rem; }
.tq-feed-card__text { margin-bottom: 0 !important; }
.tq-feed-media { margin-top: 10px; border-radius: 10px; overflow: hidden; background: var(--bg-muted, #000); }
.tq-feed-media-video {
    display: block; width: 100%; max-height: 420px; background: #000;
}
.tq-feed-media-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; }
.tq-feed-media-grid img { display: block; width: 100%; height: 180px; object-fit: cover; }
.tq-feed-media-grid.is-single { grid-template-columns: 1fr; }
.tq-feed-media-grid.is-single img { height: auto; max-height: 420px; object-fit: contain; }
.tq-feed-card__actions {
    display: flex; justify-content: space-around; gap: 4px;
    margin-top: 10px; padding: 8px 0;
    border-top: 1px solid var(--border-color, rgba(255,255,255,.08));
}
.tq-feed-action {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    flex: 1; padding: 4px 2px; border: 0; background: transparent;
    color: var(--text-muted); font-size: var(--fs-xs, .75rem);
    text-decoration: none; cursor: pointer; border-radius: 6px;
}
.tq-feed-action:hover { color: var(--primary-color, #0d6efd); background: var(--bg-muted, transparent); }
/* 列表卡片点赞态：仅图标/文字变色高亮，不切 btn-primary 渐变底色（避免整条互动栏渲染成大色块） */
.tq-feed-action.liked, .tq-feed-action.liked:hover { color: var(--pink-color, #ec4899); }

/* ===== 广告卡片（信息流 / 详情页插入） =====
   版式：左图 + 右侧三段式信息块（标题 / 描述 / 底行），底行左「广告」徽章、右「了解详情 ›」。
   与帖子卡片同源（同 border / radius / 背景），但用左侧主色竖条 + 更收敛的排版做区分，
   符合《互联网广告管理办法》第九条「可识别性」：标识必须显著且不可被遮挡。
   全部取值走站内设计令牌，跟随暗色主题，不写死颜色。 */
.tq-ad-card {
    position: relative;
    overflow: hidden;
    padding: 14px 16px !important;
    /* 底色沿用 --bg-surface；主色氛围由 ::after 的极淡叠层提供，
       不使用 color-mix()——该函数在较旧内核下不支持会导致整条声明失效。 */
    background: var(--bg-surface, #191426) !important;
}
/* 主色氛围叠层：从左上角极淡晕开，给广告卡片一点区分度又不喧宾夺主 */
.tq-ad-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
        135deg,
        var(--primary-color, #7C3AED) 0%,
        transparent 42%
    );
    opacity: .07;
}
/* 左侧主色竖条：一眼区分广告与原生内容，不依赖任何文字 */
.tq-ad-card::before {
    content: "";
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: 0;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--primary-color, #7C3AED);
    opacity: .85;
    z-index: 1;
}
/* 内容层级要高于叠层，否则 ::after 会盖住文字 */
.tq-ad-card__body,
.tq-ad-card__head,
.tq-ad-card__template {
    position: relative;
    z-index: 1;
}

/* ---- 主体：左图 + 右文 ---- */
.tq-ad-card__body {
    display: flex;
    align-items: stretch;
    gap: 14px;
}
/* 图片容器：为角标提供定位上下文。不设 overflow:hidden，
   否则角标被裁；圆角裁切交给内部 .tq-ad-card__media 自己做。 */
.tq-ad-card__media-wrap {
    position: relative;
    flex: none;
    width: 132px;
    aspect-ratio: 4 / 3;
}
.tq-ad-card__media {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-muted, #332B3D);
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, .28));
}
.tq-ad-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}
.tq-ad-card__media:hover img { transform: scale(1.04); }

.tq-ad-card__content {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.tq-ad-card__title {
    font-size: var(--fs-base, 1rem);
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary, #F4F4F5);
    /* 最多两行，超出省略，避免长标题把底行顶出画面 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tq-ad-card__title a {
    color: inherit;
    text-decoration: none;
}
.tq-ad-card__title a:hover { color: var(--primary-color, #7C3AED); }
.tq-ad-card__desc {
    margin: 0;
    font-size: var(--fs-sm, .875rem);
    line-height: 1.5;
    color: var(--text-secondary, #ACAFBC);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- 底行：无图时放标识，有图时只剩 CTA 右对齐 ---- */
.tq-ad-card__foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
/* 有图时标识已移到图内，底行只有 CTA，靠右收口 */
.tq-ad-card__media-wrap + .tq-ad-card__content .tq-ad-card__foot {
    justify-content: flex-end;
}
.tq-ad-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}
/* 「广告」徽章：细边框 + 低饱和，显著但不抢标题 */
.tq-ad-card__badge {
    display: inline-flex;
    align-items: center;
    flex: none;
    padding: 1px 6px;
    border: 1px solid var(--border-light, #4A3F55);
    border-radius: 4px;
    font-size: var(--fs-xs, .75rem);
    line-height: 1.6;
    letter-spacing: .04em;
    color: var(--text-muted, #7a7a92);
    background: var(--bg-primary, #120D1C);
    opacity: .92;
    pointer-events: none;   /* 标识不参与跳转，保证可单纯辨认 */
    user-select: none;
}
/* 图片左上角标识：叠在素材上，用深色半透明底 + 白字，
   保证在亮色/杂色图片上都清晰可读（合规要求「显著标明」）。 */
.tq-ad-card__badge--corner {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 2;
    padding: 1px 5px;
    border: 0;
    border-radius: 4px;
    color: #fff;
    background: rgba(0, 0, 0, .62);
    /* 叠在图片上时取消整体降透明，否则白字会发灰 */
    opacity: 1;
    font-size: 11px;
    line-height: 1.6;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
    backdrop-filter: blur(2px);
}
/* CTA：主色文字 + 箭头，弱化按钮感以贴合卡片 */
.tq-ad-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex: none;
    font-size: var(--fs-xs, .75rem);
    font-weight: 500;
    color: var(--primary-color, #7C3AED);
    text-decoration: none;
    white-space: nowrap;
}
.tq-ad-card__cta i { font-size: .7em; transition: transform .2s ease; }
.tq-ad-card__cta:hover { color: var(--primary-hover, #6D28D9); }
.tq-ad-card__cta:hover i { transform: translateX(2px); }

/* ---- 模板模式：片段自身排版，卡片只负责外框与标识 ---- */
.tq-ad-card__template { margin: 0; }
.tq-ad-card__template img { max-width: 100%; height: auto; display: block; border-radius: 8px; }

/* ---- 窄屏：图片缩小，描述单行，保持底行不被挤压 ---- */
@media (max-width: 575.98px) {
    .tq-ad-card { padding: 12px 14px !important; }
    .tq-ad-card__body { gap: 11px; }
    /* 宽度收在容器上，内层 .tq-ad-card__media 已改为 100% 跟随 */
    .tq-ad-card__media-wrap { width: 96px; }
    .tq-ad-card__badge--corner { top: 4px; left: 4px; font-size: 10px; padding: 0 4px; }
    .tq-ad-card__title { font-size: var(--fs-sm, .875rem); -webkit-line-clamp: 2; }
    .tq-ad-card__desc { font-size: var(--fs-xs, .75rem); -webkit-line-clamp: 1; }
}
/* 就地评论框：评论按钮在列表内展开，不跳详情页 */
.tq-inline-comment { padding: 4px 2px 8px; }
.tq-inline-comment textarea { resize: vertical; }
/* 版务靶改到卡片右上角，不再占用横排空间 */
.tq-post-row.tq-feed-card .tq-mod-cell {
    position: absolute; top: 10px; right: 12px; z-index: 2;
}
@media (max-width: 576px) {
    .tq-post-row.tq-feed-card { padding: 12px 12px 4px; margin-bottom: 10px; }
    .tq-feed-card__avatar { width: 38px; height: 38px; }
    .tq-feed-media-grid img { height: 140px; }
}

