/* 发布内容独立页：深色外壳 + 浅色纸张，表格在手机上自动折成卡片 */
.post-body {
  min-height: 100svh;
}

.post-page {
  position: relative;
  z-index: 1;
  width: min(100%, 1080px);
  margin: 0 auto;
  padding: clamp(14px, 3vw, 26px) clamp(12px, 3vw, 22px) 44px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.post-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.post-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.16s ease;
}

.post-back:hover {
  background: rgba(255, 255, 255, 0.13);
}

.post-back svg {
  width: 16px;
  height: 16px;
}

.post-back--solid {
  padding: 0 18px;
  border: 0;
  background: linear-gradient(135deg, #6f9bff, #4a72e6);
  color: #fff;
  box-shadow: 0 12px 26px rgba(74, 114, 230, 0.3);
}

.post-brand {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-loading,
.post-error {
  padding: 32px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--panel);
  color: var(--muted);
  text-align: center;
  font-size: 15px;
}

.post-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.post-error p {
  margin: 0;
}

.post-sheet {
  padding: clamp(16px, 3.4vw, 30px);
  border-radius: 18px;
  background: #f7f8fc;
  color: #1f2430;
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.42);
}

.post-title {
  margin: 0;
  font-size: clamp(20px, 4.6vw, 30px);
  line-height: 1.32;
  font-weight: 800;
  color: #14181f;
  overflow-wrap: anywhere;
}

.post-meta {
  margin-top: 8px;
  font-size: 13px;
  color: #6b7280;
}

.post-meta:empty {
  display: none;
}

.post-cover {
  margin: 16px 0 0;
  border-radius: 14px;
  overflow: hidden;
  background: #eef1f7;
}

.post-cover img {
  display: block;
  width: 100%;
  height: auto;
}

.post-summary {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-left: 3px solid #4a72e6;
  border-radius: 8px;
  background: #eef2ff;
  color: #33405c;
  font-size: 15px;
  line-height: 1.7;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.post-blocks {
  display: flex;
  flex-direction: column;
  gap: 26px;
  margin-top: 20px;
}

.pb-title {
  margin: 0 0 10px;
  padding: 9px 12px;
  border-radius: 8px;
  background: #e8ecf6;
  color: #1f2430;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  overflow-wrap: anywhere;
}

/* 大标题字号档位（后台可设） */
.pb-title.pb-title--sm {
  font-size: 14px;
  padding: 7px 10px;
}

.pb-title.pb-title--lg {
  font-size: 20px;
  padding: 11px 14px;
}

.pb-title.pb-title--xl {
  font-size: 25px;
  padding: 14px 16px;
  letter-spacing: 0.4px;
}

.pb-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
}

.pb-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  background: #fff;
  font-size: 14px;
}

.pb-table th,
.pb-table td {
  padding: 9px 10px;
  border: 1px solid #dfe4ee;
  vertical-align: middle;
  text-align: center;
  overflow-wrap: anywhere;
}

.pb-table th {
  background: #eef1f7;
  font-weight: 800;
  color: #1f2430;
}

.pb-table.rows-head td:first-child {
  font-weight: 700;
}

.pb-rt {
  line-height: 1.65;
  text-align: left;
}

/* 单元格文字对齐（后台可设：左 / 居中 / 右） */
.pb-table td .pb-rt[data-align="left"] {
  text-align: left;
}

.pb-table td .pb-rt[data-align="center"] {
  text-align: center;
}

.pb-table td .pb-rt[data-align="right"] {
  text-align: right;
}

.pb-table th .pb-rt {
  text-align: center;
}

.pb-table th .pb-rt[data-align="left"] {
  text-align: left;
}

.pb-table th .pb-rt[data-align="center"] {
  text-align: center;
}

.pb-table th .pb-rt[data-align="right"] {
  text-align: right;
}

.pb-rt p {
  margin: 0 0 6px;
}

.pb-rt p:last-child {
  margin-bottom: 0;
}

.pb-rt a {
  color: #2f6fed;
  font-weight: 600;
  text-decoration: underline;
}

.pb-rt img {
  max-width: 100%;
  border-radius: 6px;
}

.pb-empty {
  padding: 20px 12px;
  border: 1px dashed #cfd6e4;
  border-radius: 10px;
  color: #7b8496;
  text-align: center;
  font-size: 14px;
}

.post-foot {
  display: flex;
  justify-content: center;
  padding-top: 4px;
}

/* ---------- 手机端：一行 = 一张卡片，字段压成一行（标签左 / 内容右） ---------- */
@media (max-width: 720px) {
  .post-page {
    padding-bottom: calc(30px + env(safe-area-inset-bottom, 0px));
    gap: 12px;
  }

  .post-sheet {
    padding: 15px 12px;
    border-radius: 15px;
  }

  .post-blocks {
    gap: 16px;
    margin-top: 16px;
  }

  .pb-title {
    margin-bottom: 8px;
    padding: 8px 10px;
    border-radius: 7px;
    font-size: 15px;
  }

  .pb-scroll {
    overflow: visible;
  }

  .pb-table {
    display: block;
    min-width: 0;
    background: transparent;
    font-size: 14.5px;
  }

  .pb-table thead {
    display: none;
  }

  .pb-table tbody {
    display: block;
  }

  /* 每个数据行 = 一张卡片 */
  .pb-table tr {
    display: block;
    margin-bottom: 9px;
    padding: 8px 11px 9px;
    border: 1px solid #e3e8f2;
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(23, 34, 59, 0.045);
  }

  .pb-table tr:last-child {
    margin-bottom: 0;
  }

  /* 关键：标签和内容并排，一个字段只占一行 */
  .pb-table td {
    display: grid;
    grid-template-columns: minmax(54px, 30%) minmax(0, 1fr);
    align-items: start;
    column-gap: 10px;
    padding: 4px 0;
    border: 0;
    border-top: 1px dashed #edf0f7;
    border-radius: 0;
    text-align: left;
  }

  /* 每张卡片第一格当标题（值本身就是版本名，不再重复列名） */
  .pb-table td:first-child {
    padding: 0 0 6px;
    margin-bottom: 4px;
    border-top: 0;
    border-bottom: 1px solid #edf0f7;
  }

  .pb-table td:first-child .pb-rt {
    font-size: 15.5px;
    font-weight: 800;
    color: #14181f;
    line-height: 1.45;
  }

  .pb-table td.is-empty {
    display: none;
  }

  .pb-table td[data-label]:not([data-label=""])::before {
    content: attr(data-label);
    color: #8b93a5;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.5;
    white-space: normal;
    word-break: break-word;
  }

  .pb-rt {
    text-align: left;
    line-height: 1.5;
  }

  /* 没有列名的格子 / 带底色的格子：整格铺开，标签在值上方 */
  .pb-table td:not([data-label]) {
    grid-template-columns: minmax(0, 1fr);
  }

  .pb-table td.has-bg {
    grid-template-columns: minmax(0, 1fr);
    padding: 7px 10px;
    margin: 6px 0;
    border-top: 0;
    border-radius: 8px;
  }

  .pb-table td.has-bg:first-child {
    padding: 9px 10px;
    margin: 0 0 7px;
  }
}

/* ---------- 发布页：顶部 / 底部图片（一行多张，按数量自适应列数） ---------- */
.post-imgs {
  display: grid;
  gap: 8px;
  margin: 0;
}

.post-imgs[data-count="1"] {
  grid-template-columns: 1fr;
}

.post-imgs[data-count="2"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.post-imgs[data-count="3"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.post-imgs[data-count="4"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.post-imgs[data-count="5"],
.post-imgs[data-count="6"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.post-img {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
  min-width: 0;
}

.post-img-link {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  background: #eef1f7;
}

.post-img img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 360px;
  object-fit: cover;
}

.post-img-cap {
  font-size: 13px;
  line-height: 1.5;
  color: #4a5262;
  text-align: center;
  overflow-wrap: anywhere;
  padding: 0 2px;
}

.post-img-cap--sm {
  font-size: 11.5px;
  color: #6b7280;
}

.post-img-cap--md {
  font-size: 13px;
}

.post-img-cap--lg {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
}

.post-img-cap--xl {
  font-size: 21px;
  font-weight: 800;
  line-height: 1.35;
}

@media (max-width: 720px) {
  .post-imgs {
    gap: 6px;
  }

  .post-imgs[data-count="2"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .post-imgs[data-count="3"],
  .post-imgs[data-count="5"],
  .post-imgs[data-count="6"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .post-imgs[data-count="4"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .post-img img {
    max-height: 240px;
  }

  .post-img-link {
    border-radius: 8px;
  }

  .post-img-cap--sm {
    font-size: 11px;
  }

  .post-img-cap--md {
    font-size: 12.5px;
  }

  .post-img-cap--lg {
    font-size: 15px;
  }

  .post-img-cap--xl {
    font-size: 18px;
  }
}
