/* ============================================================
   帖子多类型区块样式（post_type_blocks）
   覆盖：论坛 / 圈子 · poll 投票 · gallery 多图 · product 商品
         video 视频双布局 · debate 辩论 · longform 长文
   设计语言：与全站一致的液态玻璃 + 主题变量（--accent 系列）
   ============================================================ */

/* —— 类型徽标（帖子卡片上的小标签） —— */
.pt-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .4px;
  color: var(--accent-strong, #5b21b6);
  background: var(--accent-soft, rgba(139, 92, 246, .12));
  border: 1px solid var(--accent-line, rgba(139, 92, 246, .25));
  vertical-align: middle;
}

/* —— 类型区块统一容器 —— */
.pt-block { margin: 14px 0 20px; }

/* ============================================================
   POLL 投票
   ============================================================ */
.pt-poll {
  border-radius: 16px;
  padding: 16px 16px 14px;
  background: linear-gradient(160deg, rgba(255,255,255,.92), rgba(245,243,255,.72));
  border: 1px solid rgba(139,92,246,.16);
}
.pt-poll-title { margin: 0 0 4px; font-size: 14.5px; font-weight: 600; }
.pt-poll-meta { font-size: 12px; color: var(--muted, #6b7280); margin-bottom: 12px; }

.pt-poll-opt {
  display: block;
  width: 100%;
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(139,92,246,.22);
  background: rgba(255,255,255,.6);
  text-align: left;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color .15s ease, background .15s ease;
}
.pt-poll-opt:hover { border-color: var(--accent, #7c3aed); background: var(--accent-soft, rgba(139,92,246,.08)); }
.pt-poll-opt.selected { border-color: var(--accent, #7c3aed); background: var(--accent-soft, rgba(139,92,246,.14)); }
.pt-poll-opt-bar {
  position: absolute; inset: 0;
  width: var(--pct, 0%);
  background: var(--accent-soft, rgba(139,92,246,.16));
  border-radius: 11px;
  transition: width .5s ease;
}
.pt-poll-opt-inner {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  font-size: 13.5px;
}
.pt-poll-opt-pct { margin-left: auto; font-weight: 700; color: var(--accent-strong, #5b21b6); font-size: 13px; }
.pt-poll-opt-check { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(139,92,246,.4); flex: none; }
.pt-poll-opt.selected .pt-poll-opt-check { background: var(--accent, #7c3aed); border-color: var(--accent, #7c3aed); }

.pt-poll-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; font-size: 12px; color: var(--muted, #6b7280);
}
.pt-poll-btn {
  border: none; cursor: pointer;
  padding: 6px 16px; border-radius: 999px;
  background: var(--accent, #7c3aed); color: #fff;
  font-size: 12.5px; font-weight: 600;
}
.pt-poll-btn:disabled { opacity: .45; cursor: not-allowed; }
.pt-poll-voted-tip { color: var(--accent-strong, #5b21b6); font-weight: 600; }

/* ============================================================
   GALLERY 多图
   ============================================================ */
.pt-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.pt-gallery img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: 12px;
  display: block;
  background: rgba(139,92,246,.08);
}
.pt-gallery.one { grid-template-columns: 1fr; }
.pt-gallery.one img { aspect-ratio: 16 / 9; }
.pt-gallery.three { grid-template-columns: repeat(3, 1fr); }
.pt-gallery.many img:nth-child(1) { grid-column: 1 / -1; aspect-ratio: 16 / 9; }

/* ============================================================
   PRODUCT 商品卡
   ============================================================ */
/* 大卡：图左文右，详情页 / 信息完整时 */
.pt-prod-card {
  display: flex; gap: 14px;
  border-radius: 16px;
  padding: 14px;
  background: linear-gradient(160deg, rgba(255,255,255,.94), rgba(245,243,255,.7));
  border: 1px solid rgba(139,92,246,.16);
}
.pt-prod-img {
  width: 118px; height: 118px; flex: none;
  border-radius: 12px; object-fit: cover;
  background: #f1f5f9;
}
.pt-prod-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pt-prod-plat {
  display: inline-flex; align-items: center; gap: 6px;
  width: fit-content;
  padding: 2px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700;
  color: #fff;
}
.pt-prod-plat.jd       { background: #e1251b; } /* 京东红 */
.pt-prod-plat.taobao   { background: #ff5000; } /* 淘宝橙 */
.pt-prod-plat.sgow     { background: #ff2f54; } /* 闪购 */
.pt-prod-plat.goofish  { background: #f2c13d; color: #443200; } /* 闲鱼黄 */
.pt-prod-plat.pdd      { background: #e02e24; } /* 拼多多红 */
.pt-prod-plat.meituan  { background: #ffd100; color: #333; } /* 美团黄 */
.pt-prod-plat.eleme    { background: #0085ff; } /* 饿了么蓝 */
.pt-prod-plat.vip      { background: #e0313a; } /* 唯品会红 */
.pt-prod-plat.suning   { background: #ff6600; } /* 苏宁橙 */
.pt-prod-plat.gome     { background: #d3232a; } /* 国美红 */
.pt-prod-plat.kaola    { background: #ff7c1f; } /* 考拉橙 */
.pt-prod-plat.dangdang { background: #e53e2f; } /* 当当红 */
.pt-prod-plat.yhd      { background: #e60012; } /* 一号店红 */
.pt-prod-plat.womai    { background: #31a03e; } /* 我买绿 */
.pt-prod-plat._163     { background: #bf2a24; } /* 严选红 */
.pt-prod-plat.amazon   { background: #232f3e; } /* 亚马逊深蓝 */
.pt-prod-plat.tmall    { background: #ff0f3b; } /* 天猫红 */
.pt-prod-plat.weibo    { background: #e6162d; }
.pt-prod-plat.xiaohongshu { background: #ff2442; }
.pt-prod-plat.zhihu    { background: #056de8; }
.pt-prod-plat.douban   { background: #00b51d; }
.pt-prod-plat.dianping { background: #ff6633; }
.pt-prod-plat.unknown  { background: #6b7280; }
.pt-prod-title {
  margin: 0; font-size: 14.5px; font-weight: 600; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pt-prod-desc {
  margin: 0; font-size: 12.5px; color: var(--muted, #6b7280); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pt-prod-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; }
.pt-prod-price { font-size: 17px; font-weight: 800; color: #e11d48; }
.pt-prod-go {
  margin-left: auto;
  padding: 5px 14px; border-radius: 999px;
  background: var(--accent, #7c3aed); color: #fff;
  font-size: 12px; font-weight: 600;
  text-decoration: none;
}
.pt-prod-go:hover { opacity: .88; }

/* 小卡：信息不全 / 列表内紧凑态 */
.pt-prod-card.small { align-items: center; }
.pt-prod-card.small .pt-prod-img { width: 64px; height: 64px; }
.pt-prod-card.small .pt-prod-title { font-size: 13px; -webkit-line-clamp: 2; }
.pt-prod-card.small .pt-prod-price { font-size: 14px; }
.pt-prod-card.small .pt-prod-plat { font-size: 10.5px; padding: 1px 8px; }

/* 降级卡：仅平台 logo + 链接（抓取失败） */
.pt-prod-fallback {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 14px;
  border: 1px dashed rgba(139,92,246,.35);
  background: rgba(255,255,255,.55);
}
.pt-prod-fallback-logo {
  flex: none; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent-soft, rgba(139,92,246,.14));
  color: var(--accent-strong, #5b21b6);
  font-size: 12px; font-weight: 800;
}
.pt-prod-fallback .pt-prod-fb-url {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12.5px; color: var(--muted, #6b7280);
}
.pt-prod-fallback a {
  margin-left: auto; flex: none;
  font-size: 12px; font-weight: 600;
  color: var(--accent-strong, #5b21b6);
}

/* ============================================================
   VIDEO 视频双布局
   ============================================================ */
.pt-video-frame { border: 0; border-radius: 14px; display: block; background: #000; width: 100%; aspect-ratio: 16 / 9; }

/* 布局 top：上视频下评论 —— 必须用「双类名」把权重压过下面那条基础栅格规则，
   否则同权重、顺序在后，回收单列这句话等于没说，点了按钮排版纹丝不动 */
.pt-video-wrap.pt-video-layout-top { grid-template-columns: 1fr; }
.pt-video-layout-top .pt-video { margin-bottom: 12px; }
.pt-video-layout-top .pt-video-frame { width: 100%; aspect-ratio: 16 / 9; }

/* 布局 left：左视频右评论区 */
.pt-video-wrap { display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px; align-items: start; }
.pt-video-wrap .pt-video-frame { width: 100%; aspect-ratio: 16 / 9; }
.pt-video-side { min-width: 0; }
.pt-video-side .echo-replies { margin: 0; }

/* 不可内嵌（抖音等）→ 跳转卡 */
.pt-video-jump {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 14px;
  background: linear-gradient(160deg, rgba(255,255,255,.92), rgba(245,243,255,.7));
  border: 1px solid rgba(139,92,246,.16);
}
.pt-video-jump-ico {
  flex: none; width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--accent, #7c3aed); color: #fff; font-size: 18px;
}
.pt-video-jump-body { min-width: 0; }
.pt-video-jump-name { font-size: 13.5px; font-weight: 700; }
.pt-video-jump-hint { font-size: 12px; color: var(--muted, #6b7280); }
.pt-video-jump .pt-video-open {
  margin-left: auto; flex: none;
  padding: 6px 14px; border-radius: 999px;
  background: var(--accent, #7c3aed); color: #fff; font-size: 12px; font-weight: 600;
}

/* 布局切换按钮 */
.pt-video-tools { display: flex; align-items: center; gap: 8px; margin: 10px 0 6px; }
.pt-video-tools span { font-size: 12px; color: var(--muted, #6b7280); }
.pt-layout-btn {
  border: 1px solid rgba(139,92,246,.25);
  background: rgba(255,255,255,.6);
  color: var(--accent-strong, #5b21b6);
  padding: 4px 12px; border-radius: 999px;
  font-size: 12px; cursor: pointer;
}
.pt-layout-btn.active { background: var(--accent, #7c3aed); color: #fff; border-color: transparent; }

/* 回声抽屉的外壳：宽屏、平板、横屏一律不现身，只在手机竖屏（≤639px）出场 */
.pt-drawer-btn, .pt-drawer-grip, .pt-drawer-head { display: none; }
.pt-drawer-body { min-width: 0; }

/* ============================================================
   DEBATE 辩论对阵
   ============================================================ */
.pt-debate {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.pt-debate-side {
  border-radius: 16px; padding: 14px;
  border: 1px solid rgba(139,92,246,.18);
  background: linear-gradient(160deg, rgba(255,255,255,.92), rgba(245,243,255,.66));
  display: flex; flex-direction: column; gap: 8px;
}
.pt-debate-side .pt-debate-tag {
  align-self: flex-start;
  padding: 2px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700;
}
.pt-debate-pro .pt-debate-tag  { background: #22c55e; color: #fff; }
.pt-debate-con .pt-debate-tag  { background: #f43f5e; color: #fff; }
.pt-debate-side h4 { margin: 0; font-size: 14.5px; font-weight: 700; }
.pt-debate-side p  { margin: 0; font-size: 13px; color: var(--muted, #4b5563); line-height: 1.65; flex: 1; }
.pt-debate-stats { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted, #6b7280); }
.pt-debate-btn {
  border: 1px solid rgba(139,92,246,.3);
  background: rgba(255,255,255,.6);
  color: var(--accent-strong, #5b21b6);
  padding: 6px 0; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: all .15s ease;
}
.pt-debate-btn:hover { background: var(--accent-soft, rgba(139,92,246,.12)); }
.pt-debate-btn.active { background: var(--accent, #7c3aed); color: #fff; border-color: transparent; }

/* ============================================================
   LONGFORM 长文排版
   ============================================================ */
.pt-longform-body {
  font-size: 15.5px; line-height: 2;
}
.pt-longform-body h1, .pt-longform-body h2, .pt-longform-body h3 {
  margin: 1.4em 0 .6em; line-height: 1.5;
}
.pt-longform-body h1 { font-size: 1.5em; } .pt-longform-body h2 { font-size: 1.3em; } .pt-longform-body h3 { font-size: 1.15em; }
.pt-longform-body p { margin: .7em 0; }
.pt-longform-body blockquote {
  margin: 1em 0; padding: .6em 1em;
  border-left: 3px solid var(--accent-line, rgba(139,92,246,.4));
  color: var(--muted, #4b5563); background: rgba(139,92,246,.06);
  border-radius: 0 10px 10px 0;
}
.pt-longform-body code {
  background: rgba(139,92,246,.1); color: var(--accent-strong, #5b21b6);
  padding: .12em .4em; border-radius: 6px; font-size: .92em;
}
.pt-longform-body pre {
  background: #1e1b2e; color: #e5e7eb;
  padding: 14px; border-radius: 12px; overflow-x: auto;
}
.pt-longform-body pre code { background: none; color: inherit; padding: 0; }
.pt-longform-body img { max-width: 100%; border-radius: 12px; }

/* ============================================================
   发布表单（帖子类型切换）
   ============================================================ */
.pt-type-tabs {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 12px 0;
}
.pt-type-tab { margin: 0; }
.pt-type-tab input { position: absolute; opacity: 0; pointer-events: none; }
.pt-type-tab span {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 13px; border-radius: 999px;
  border: 1px solid rgba(139,92,246,.22);
  background: rgba(255,255,255,.55);
  color: var(--muted, #4b5563);
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: all .15s ease; white-space: nowrap;
}
.pt-type-tab:hover span { border-color: var(--accent, #7c3aed); color: var(--accent-strong, #5b21b6); }
.pt-type-tab input:checked + span {
  background: var(--accent, #7c3aed); color: #fff; border-color: transparent;
}

/* 投票选项动态行 */
.pt-opt-rows { display: flex; flex-direction: column; gap: 8px; }
.pt-opt-row { display: flex; gap: 8px; align-items: center; }
.pt-opt-row input {
  flex: 1; min-width: 0;
  border: 1px solid rgba(139,92,246,.22);
  background: rgba(255,255,255,.6);
  padding: 9px 12px; border-radius: 10px; font-size: 13.5px;
}
.pt-opt-row input:focus { outline: none; border-color: var(--accent, #7c3aed); }
.pt-opt-del {
  flex: none; width: 30px; height: 30px; border-radius: 9px;
  border: 1px solid rgba(244,63,94,.25);
  background: rgba(244,63,94,.06); color: #e11d48;
  cursor: pointer; font-size: 12px; line-height: 1;
}
.pt-opt-del:hover { background: rgba(244,63,94,.14); }
.pt-opt-tools {
  display: flex; align-items: center; gap: 14px; margin-top: 10px;
}
.pt-opt-add {
  border: 1px dashed rgba(139,92,246,.4);
  background: transparent; color: var(--accent-strong, #5b21b6);
  padding: 7px 14px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.pt-opt-add:hover { background: var(--accent-soft, rgba(139,92,246,.1)); }
.pt-multi { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted, #4b5563); cursor: pointer; }
.pt-multi input { accent-color: var(--accent, #7c3aed); }

/* 多图上传 */
.pt-upload-btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 999px;
  border: 1px dashed rgba(139,92,246,.45);
  background: var(--accent-soft, rgba(139,92,246,.08));
  color: var(--accent-strong, #5b21b6);
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.pt-upload-btn:hover { background: var(--accent-soft, rgba(139,92,246,.14)); }
/* 原生文件框铺满整个按钮：点击按钮任意处都能唤起选择框，命中区域更大；
   透明但保留在可访问性树中，键盘 Tab 可聚焦、屏幕阅读器可识别 */
.pt-upload-btn input[type="file"] {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
}
.pt-gal-pre {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin-top: 10px;
}
.pt-gal-pre img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  border-radius: 10px; border: 1px solid rgba(139,92,246,.15);
}
.pt-gal-tip { margin: 8px 0 0; font-size: 12px; color: var(--muted, #6b7280); }

/* 辩论编辑 */
.pt-debate-ed { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.pt-debate-ed-side {
  border-radius: 12px; padding: 10px;
  border: 1px solid rgba(139,92,246,.18);
  background: rgba(255,255,255,.55);
  display: flex; flex-direction: column; gap: 8px;
}
.pt-debate-ed-side.pro { border-color: rgba(34,197,94,.35); }
.pt-debate-ed-side.con { border-color: rgba(244,63,94,.35); }
.pt-debate-ed-tag {
  align-self: flex-start; padding: 2px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; color: #fff;
}
.pt-debate-ed-side.pro .pt-debate-ed-tag { background: #22c55e; }
.pt-debate-ed-side.con .pt-debate-ed-tag { background: #f43f5e; }
.pt-debate-ed-side input, .pt-debate-ed-side textarea {
  border: 1px solid rgba(139,92,246,.2);
  background: rgba(255,255,255,.65);
  padding: 8px 10px; border-radius: 9px; font-size: 13px; resize: vertical;
}
.pt-debate-ed-side input:focus, .pt-debate-ed-side textarea:focus { outline: none; border-color: var(--accent, #7c3aed); }

/* ============================================================
   响应式：视频贴的三种形态
   ------------------------------------------------------------
   宽屏 / 折叠屏展开 / 手机横屏 → 左视频右评论（基础栅格）
   平板与折叠屏展开（宽度够）    → 左右分栏 + 视频吸顶
   手机竖屏、折叠屏折叠态        → 单列 + 回声沉底抽屉
   条件刻意写成「宽度 + 方向」双条件：折叠屏展开后宽度可能跨过 640，
   但方向仍是竖屏，只看宽度会把内外屏误判成两台设备。
   ============================================================ */

/* B2：左右分栏时让视频吸顶，长回声串往下滚，画面还在眼前。
   只作用于「左视频右评论」——上下布局里吸住一整块视频没有意义；
   另加 min-height 兜底，免得手机横屏那种矮屏被吸走半屏。 */
@media (min-width: 640px) and (max-width: 1179px) and (min-height: 560px) {
  .pt-video-wrap:not(.pt-video-layout-top) .pt-video { position: sticky; top: 88px; }
}

/* A2 + C4：窄屏竖屏，回声沉底成抽屉 */
@media (max-width: 639px) and (orientation: portrait) {
  .pt-video-wrap { grid-template-columns: 1fr; }
  /* 单列之下「左视频右评论」是句空话，索性收起按钮换成抽屉开关，不让按钮说谎 */
  .pt-tools-label, .pt-video-tools .pt-layout-btn { display: none; }
  .pt-drawer-btn {
    display: inline-flex; align-items: center; gap: 6px; margin-left: auto;
    padding: 7px 14px; border-radius: 999px;
    border: 1px solid rgba(139,92,246,.28);
    background: rgba(255,255,255,.72);
    color: var(--accent-strong, #5b21b6);
    font-size: 12.5px; font-weight: 700; cursor: pointer;
  }
  .pt-video-side {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    height: 52vh; height: 52dvh;
    display: flex; flex-direction: column; overflow: hidden;
    padding: 0 14px calc(12px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
    border-top: 1px solid var(--field-line, #c2cfe4);
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(18px) saturate(175%);
    -webkit-backdrop-filter: blur(18px) saturate(175%);
    transform: translateY(100%);
    transition: transform .28s cubic-bezier(.22,.61,.36,1), height .28s cubic-bezier(.22,.61,.36,1);
  }
  .pt-video-side[data-drawer="half"], .pt-video-side[data-drawer="full"] { transform: translateY(0); }
  .pt-video-side[data-drawer="full"] { height: 88vh; height: 88dvh; }
  /* 收起时不接手势，免得它在屏幕外拦住底部按钮 */
  .pt-video-side[data-drawer="closed"] { pointer-events: none; }
  .pt-drawer-dragging { transition: none; }
  .pt-drawer-grip {
    display: block; width: 100%; padding: 10px 0 4px;
    background: none; border: 0; cursor: grab; touch-action: none;
  }
  .pt-drawer-grip span {
    display: block; width: 40px; height: 4px; margin: 0 auto;
    border-radius: 999px; background: #cbd5e1;
  }
  .pt-drawer-head { display: flex; align-items: center; gap: 8px; padding: 0 2px 8px; }
  .pt-drawer-title { font-size: 13px; font-weight: 800; color: var(--ink, #1f2937); }
  .pt-drawer-close {
    margin-left: auto; padding: 4px 12px; border-radius: 999px;
    border: 1px solid var(--field-line, #c2cfe4); background: rgba(255,255,255,.7);
    font-size: 12px; color: var(--muted, #6b7280); cursor: pointer;
  }
  /* 抽屉里自己滚：不动 body，关上就还页面自由 */
  .pt-drawer-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .pt-drawer-body .echo-replies-title { margin-top: 2px; }
}

@media (max-width: 560px) {
  .pt-prod-card { flex-direction: column; }
  .pt-prod-img { width: 100%; height: auto; aspect-ratio: 4 / 3; }
  .pt-gallery.three { grid-template-columns: repeat(2, 1fr); }
  .pt-debate { grid-template-columns: 1fr; }
  .pt-poll-opt-inner { font-size: 13px; }
}
