/* ============================================================
   论坛之家 · 社区广场（plaza.css）
   新设计系统换壳版：对齐 /js/common/theme.css 设计令牌
   - 主色：#c2410c / 辅助：#ea580c / #d97706
   - 页面背景：暖白 #fbf8f5（由 theme.css body 提供）
   - 结构约定：帖子卡片 DOM/ID/data 属性保持不变（plaza.js 依赖）
   - 通用弹层（展开帖/评论/验证码/图片预览）统一暖调深色，兼容单帖模式
   ============================================================ */

/* ============================================================
   参考稿「暖纸」色板（帖子卡片 / 展开层 / 评论区专用）
   - 权威来源：项目根目录《帖子卡片的设计，展开和布局…参考学习使用这个.html》
   - 只作用于本文件内的卡片与展开层，不污染 theme.css 的全局令牌
   - 深色主题下自动映射回 theme.css 暗色令牌，深色模式不受影响
   ============================================================ */
:root {
  --paper-card: #fbf9f3;          /* 卡片底 · 暖米白 */
  --paper-card-soft: #f5f1e7;     /* 卡片软底 · 输入框/评论条目 */
  --paper-line: #dcd3bc;          /* 主描边 · hover 加深 */
  --paper-line-soft: #e7e0cd;     /* 轻描边 · 卡片默认边 */
  --paper-ink: #221f1a;           /* 正文墨色 */
  --paper-ink-soft: #6b6250;      /* 次要文字 */
  --paper-ink-faint: #9c947f;     /* 弱化文字 · 时间/图标默认色 */
  --paper-ember: #b2492a;         /* 主色 · 赭红（点赞激活态） */
  --paper-ember-deep: #8f3a20;    /* 主色加深 */
  --paper-ember-soft: #f0dccb;    /* 主色浅底 · focus 光圈 */
  --paper-moss: #4e5b39;          /* 认证徽章 · 苔绿 */
  --paper-shadow-1: 0 1px 2px rgba(34, 31, 26, 0.05), 0 6px 18px rgba(34, 31, 26, 0.06);
  --paper-shadow-2: 0 10px 30px rgba(34, 31, 26, 0.14), 0 2px 8px rgba(34, 31, 26, 0.08);
}

:root[data-theme="dark"] {
  --paper-card: var(--surface);
  --paper-card-soft: var(--surface-subtle);
  --paper-line: var(--border-subtle);
  --paper-line-soft: var(--border-light);
  --paper-ink: var(--ink-primary);
  --paper-ink-soft: var(--ink-secondary);
  --paper-ink-faint: var(--ink-muted);
  --paper-ember: var(--accent);
  --paper-ember-deep: var(--accent-hover);
  --paper-ember-soft: var(--accent-light);
  --paper-moss: #6b7a52;
  --paper-shadow-1: var(--shadow-card);
  --paper-shadow-2: var(--shadow-popover);
}

/* ---------- 页面容器 ---------- */
/* 稳定保留滚动条槽位：展开帖弹层锁定滚动时背景布局不发生回流跳变 */
html {
  scrollbar-gutter: stable;
}
/* theme.css 的 .layout-container 是栅格布局，广场瀑布流由 plaza.js 自行定位，改为块级；
   页面已嵌入外层三栏 layout-container，这里取消自带的栅格宽度/内边距，避免双重留白 */
.layout-container.plaza-layout {
  display: block;
  max-width: none;
  margin: 0;
  padding: 0;
}

.plaza-page-head {
  padding: 10px 4px 4px;
  margin-bottom: 8px;
}

.plaza-page-head h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--ink-primary, #1c1917);
  display: flex;
  align-items: center;
  gap: 10px;
}

.plaza-page-head h1::before {
  content: '';
  width: 5px;
  height: 26px;
  border-radius: var(--radius-full, 9999px);
  background: var(--accent-gradient, linear-gradient(135deg, #c2410c 0%, #ea580c 100%));
}

.plaza-page-head p {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--ink-tertiary, #78716c);
}

/* ---------- 瀑布流容器 ---------- */
/* 位置/宽度/内边距由 plaza.js renderVirtualMasonry 内联计算，这里只给基础约束 */
#masonry {
  position: relative;
  min-height: 600px;
}

/* ==================== 帖子卡片（参考稿质感 · 媒体置顶竖版卡片） ==================== */
/* 质感要点：媒体网格置顶 + 文案在下 / 18px 大圆角 / 双层柔和阴影 / 悬停上浮 */
/* display/height 必须显式覆盖 theme.css 的全局 .post-card（flex column + height:100%），
   否则绝对定位卡片会被拉长到整个瀑布流容器高度 */
#masonry .post-card {
  display: block;
  height: auto;
  background: var(--paper-card, #fbf9f3);
  border: 1px solid var(--paper-line-soft, #e7e0cd);
  border-radius: 18px;
  overflow: hidden;
  break-inside: avoid;
  cursor: pointer;
  position: relative;
  box-shadow: var(--paper-shadow-1);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.28s ease;
}

/* 悬停：上浮 + 阴影加深 + 边框转为纸色描边（参考稿：不泛橙，只是纸色加深） */
#masonry .post-card:hover {
  transform: translateY(-5px);
  border-color: var(--paper-line, #dcd3bc);
  box-shadow: var(--paper-shadow-2);
}

/* 入场动画：淡入上浮，仅对首次出现的帖子播放（.card-enter 由 JS 控制，错峰出现） */
#masonry .post-card.card-enter {
  animation: plazaCardIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}
@keyframes plazaCardIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  #masonry .post-card.card-enter { animation: none; }
}

#masonry .post-card.expanding {
  transform: scale(1.04);
  z-index: 999;
}

#masonry .post-card.collapsing {
  transform: scale(0.96);
}

/* ---------- 媒体网格（参考稿 m1/m2/m3：单图大图 / 双图横排 / 一大两小） ---------- */
#masonry .post-media {
  display: grid;
  gap: 2px;
  background: var(--paper-card-soft, #f5f1e7);
}

#masonry .post-media img {
  width: 100%;
  display: block;
  object-fit: cover;
  background: var(--paper-card-soft, #f5f1e7);
}

/* m1 单图：用 aspect-ratio 预留高度，图片加载前后卡片高度一致，避免瀑布流反复重排 */
#masonry .post-media.m1 img {
  aspect-ratio: 4 / 3;
  max-height: 220px;
}

#masonry .post-media.m2 {
  grid-template-columns: 1fr 1fr;
}
#masonry .post-media.m2 img {
  height: 124px;
}

#masonry .post-media.m3 {
  grid-template-columns: 1.2fr 1fr;
  grid-template-rows: 1fr 1fr;
}
#masonry .post-media.m3 img:first-child {
  grid-row: span 2;
  height: 100%;
}
#masonry .post-media.m3 img:not(:first-child) {
  height: 88px;
}

/* ---------- 下方内容区（用户行 + 正文 + 操作区，参考稿 post-body） ---------- */
#masonry .post-card .post-body {
  padding: 13px 15px 11px;
}

#masonry .post-card .post-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 11px;
  position: relative;
}

/* 小尺寸描边 SVG（定位图标 / 回复折叠箭头，参考稿 .ic 风格） */
.location .ic-loc,
.location-info .ic-loc {
  width: 11px;
  height: 11px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.show-replies-button .ic-chev,
.expanded-post .ic-chev {
  width: 12px;
  height: 12px;
  margin-left: 5px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -2px;
}

/* ---------- 评论/回复操作按钮（描边 SVG，参考稿 .ic 风格） ---------- */
.comment-action .ic,
.reply-action .ic {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.comment-action.liked,
.reply-action.liked {
  color: var(--accent, #c2410c);
}

.comment-action.liked .ic-heart,
.reply-action.liked .ic-heart {
  fill: currentColor;
}

.comment-action .action-num,
.reply-action .action-num {
  font-variant-numeric: tabular-nums;
}

/* ---------- 统一举报选择弹层（一个举报按钮：内容→选类型 / 作者→选用户名头像） ---------- */
.report-target-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 19, 14, 0.55);
  backdrop-filter: blur(3px);
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.report-target-overlay.show {
  opacity: 1;
}
.report-target-dialog {
  background: var(--surface, #fffdfb);
  border: 1px solid var(--border-light, #ede7de);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(20, 15, 10, 0.35);
  width: 100%;
  max-width: 380px;
  padding: 22px 20px 16px;
  transform: translateY(12px) scale(0.97);
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.report-target-overlay.show .report-target-dialog {
  transform: translateY(0) scale(1);
}
.report-target-title {
  margin: 0 0 4px;
  font-size: 16.5px;
  font-weight: 700;
  color: var(--ink-primary, #1c1917);
}
.report-target-sub {
  margin: 0 0 14px;
  font-size: 12.5px;
  color: var(--ink-muted, #a8a29e);
}
.report-target-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.report-target-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
  background: var(--surface-subtle, #f8f4ee);
  border: 1px solid var(--border-light, #ede7de);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.report-target-item:hover {
  border-color: var(--accent-light-border, #fed7aa);
  background: var(--surface, #fffdfb);
  transform: translateY(-1px);
}
.report-target-item strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-primary, #1c1917);
}
.report-target-item span {
  font-size: 12px;
  color: var(--ink-muted, #a8a29e);
}
.report-target-cancel {
  display: block;
  margin: 12px auto 0;
  background: none;
  border: none;
  font-size: 13px;
  color: var(--ink-muted, #a8a29e);
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 999px;
  font-family: inherit;
  transition: color 0.18s ease, background 0.18s ease;
}
.report-target-cancel:hover {
  color: var(--ink-secondary, #44403c);
  background: var(--surface-subtle, #f8f4ee);
}

#masonry .post-card .avatar {
  border: 1px solid var(--paper-line, #dcd3bc);
  box-shadow: var(--shadow-xs, 0 1px 2px rgba(68, 45, 30, 0.03));
}

#masonry .user-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

#masonry .user-name-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

#masonry .user-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--paper-ink, #221f1a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 位置副行（参考稿 user-sub）：位置图标 + 发布时间由 footer 承载，此处只放位置 */
#masonry .user-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--paper-ink-faint, #9c947f);
  flex-wrap: wrap;
  min-width: 0;
}

#masonry .user-sub .sub-sep {
  color: var(--paper-ink-faint, #9c947f);
  opacity: 0.7;
}

#masonry .user-sub .sub-time {
  white-space: nowrap;
}

#masonry .location-info {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--paper-ink-faint, #9c947f);
}

#masonry .location-info i {
  font-size: 10px;
}

/* ---------- 卡片正文（最多两行，超出省略号 —— 卡片整体更紧凑） ---------- */
/* padding/display 显式重置，防 theme.css 全局 .post-content（padding:18px 20px + flex）漏入 */
#masonry .post-card .post-content {
  padding: 0;
  display: block;
  flex: none;
  min-height: 0;
}

#masonry .post-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--paper-ink, #221f1a);
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

/* ---------- 卡片操作区（左：点赞/评论 · 右：举报 + 时间，参考稿 post-actions） ---------- */
#masonry .post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0 2px;
  border-top: 1px solid var(--paper-line-soft, #e7e0cd);
  background: transparent;
  gap: 4px;
  margin-top: auto;
}

#masonry .post-foot-right {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

/* 时间贴右下角（参考稿 .post-time：11.5px 暖灰 + 等宽数字） */
#masonry .post-time {
  font-size: 11.5px;
  color: var(--paper-ink-faint, #9c947f);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#masonry .action-group {
  display: flex;
  align-items: center;
  gap: 2px;
}

/* 胶囊形动作按钮（参考稿 action-btn：无底无框，悬停浅纸底，点赞赭红填充） */
#masonry .action-btn {
  background: none;
  border: none;
  color: var(--paper-ink-faint, #9c947f);
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 12.5px;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  transition: background 0.18s ease, color 0.18s ease;
  flex: none;
}

#masonry .action-btn:hover {
  background: var(--paper-card-soft, #f5f1e7);
  color: var(--paper-ink, #221f1a);
}

/* 描边 SVG 图标（与参考稿 .ic 一致：18px / stroke 1.7 / 无填充） */
#masonry .action-btn .ic,
.post-actions .action-btn .ic,
.expanded-actions .action-btn .ic {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

#masonry .action-btn.liked {
  color: var(--paper-ember, #b2492a);
}

#masonry .action-btn.liked .ic-heart,
.action-btn.liked .ic-heart {
  fill: currentColor;
  animation: heartBeat 0.5s ease-in-out;
}

#masonry .post-footer .report-btn {
  background: none;
  border: none;
  color: var(--paper-ink-faint, #9c947f);
  font-size: 11.5px;
  font-family: inherit;
  border-radius: 999px;
  padding: 6px 8px;
  transition: all 0.2s ease;
  cursor: pointer;
}

#masonry .post-footer .report-btn:hover {
  color: #a32d2d;
  background: rgba(163, 45, 45, 0.07);
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.3); }
}

/* ==================== 通用弹层（展开帖 / 评论 · 暖调深色） ==================== */
/* 深色方案同时兼容信息流（浅色页面）与单帖模式（深色页面），且保证
   plaza.js 内联的 rgba(255,255,255,…) 白字始终可读 */

.expanded-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(28, 19, 14, 0.72);
  display: none;
  z-index: 1000;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.expanded-overlay.show {
  display: flex;
  opacity: 1;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

body.modal-open {
  overflow: hidden;
}

/* 展开层（参考稿 expanded-post：浅纸质感 · 左媒体 44% + 右内容滚动 56%） */
.expanded-post {
  display: flex;
  align-items: stretch;
  /* 参考稿材质：暖纸卡片底（深色主题下由 --paper-card 自动映射为暗色） */
  background: var(--paper-card, #fbf9f3);
  border: 1px solid var(--paper-line-soft, #e7e0cd);
  border-radius: 20px;
  box-shadow: 0 30px 70px rgba(20, 15, 10, 0.35);
  width: 100%;
  max-width: 1000px;
  max-height: min(660px, calc(100vh - 70px));
  overflow: hidden;
  position: relative;
  animation: none !important;
  transition: opacity 0.3s, transform 0.3s;
  transform: scale(1);
}

/* 左侧媒体面板（无图时由 JS display:none 隐藏；深底衬图，参考稿 expanded-media） */
.expanded-media {
  width: 44%;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  background: #1b1812;
}

/* 图片完整显示（contain）：不铺满裁剪，图片小就显示小 */
.expanded-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: zoom-in;
  display: block;
}

/* 多图：轮播（横向滑动 + 左右箭头 + 指示点），不再纵向挤在一起 */
.expanded-media.expanded-media-carousel {
  overflow: hidden;
}
.expanded-media .carousel-track {
  position: absolute;
  inset: 0;
  display: flex;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.expanded-media .carousel-track img {
  position: static;
  inset: auto;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.expanded-media .carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(20, 15, 10, 0.45);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: background 0.18s ease;
}
.expanded-media .carousel-btn:hover {
  background: rgba(20, 15, 10, 0.7);
}
.expanded-media .carousel-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.expanded-media .carousel-prev { left: 10px; }
.expanded-media .carousel-next { right: 10px; }
.expanded-media .carousel-dots {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  z-index: 3;
}
.expanded-media .carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transition: background 0.18s ease, transform 0.18s ease;
}
.expanded-media .carousel-dot.active {
  background: #fff;
  transform: scale(1.15);
}

/* 展开层头部副行：位置 + 发布时间（参考稿 user-sub） */
.expanded-post .user-details .location-info {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--paper-ink-faint, #9c947f);
}
.expanded-post .user-details .location-info .ic-loc {
  width: 11px;
  height: 11px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.expanded-time {
  font-size: 12px;
  color: var(--paper-ink-faint, #9c947f);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* 右侧内容滚动区（参考稿 expanded-scrollable：32px 36px 40px 内边距） */
.expanded-scrollable {
  flex: 1;
  min-width: 0;
  height: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px 36px 40px;
  color: var(--paper-ink, #221f1a);
}

/* 滚动条（参考稿：7px 细条 + line 色滑块） */
.expanded-scrollable::-webkit-scrollbar {
  width: 7px;
}
.expanded-scrollable::-webkit-scrollbar-track {
  background: transparent;
}
.expanded-scrollable::-webkit-scrollbar-thumb {
  background: var(--paper-line, #dcd3bc);
  border-radius: 4px;
}
.expanded-scrollable::-webkit-scrollbar-thumb:hover {
  background: var(--paper-ink-faint, #9c947f);
}

/* 关闭按钮（参考稿：固定右上角 42px 深棕半透明圆钮） */
.close-btn {
  position: fixed;
  top: 24px;
  right: 24px;
  font-size: 0;
  color: #f3eee1;
  z-index: 1002;
  background: rgba(24, 21, 16, 0.55);
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
  width: 42px;
  height: 42px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  line-height: 1;
  opacity: 0;
}
.close-btn.show {
  display: flex;
  opacity: 1;
}
/* 关闭按钮内的 × 用字重撑出参考稿的描边图标观感 */
.close-btn::before {
  content: '×';
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
}
.close-btn:hover {
  background: rgba(24, 21, 16, 0.75);
  color: #fff;
  transform: scale(1.06);
}

/* ---------- 展开层作者行（参考稿 expanded-header：46px 头像 + 名称 + 角色/位置/时间副行） ---------- */
.expanded-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 0;
  border-bottom: none;
}

.expanded-header .user-info {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

/* 展开层头像固定 46px（参考稿 .expanded-header .avatar） */
.expanded-header .avatar-container,
.expanded-header .avatar-container .avatar {
  width: 46px;
  height: 46px;
}

.expanded-header .user-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

/* 用户名行：名称 + VIP 徽章（徽章由 JS 插入本行内部，align-self 兜底防 flex 拉伸） */
.expanded-header .user-details h3,
.expanded-header .user-title {
  color: var(--paper-ink, #221f1a);
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.3;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
}

/* 副行：位置 · 时间（参考稿 .user-sub） */
.expanded-header .user-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--paper-ink-faint, #9c947f);
  flex-wrap: wrap;
  min-width: 0;
}

.expanded-header .user-sub .sub-sep {
  opacity: 0.6;
}

.expanded-header .user-status {
  font-size: 11.5px;
  color: var(--paper-ink-soft, #6b6250);
  font-weight: 500;
}

/* 旧的 user-status（VIP用户/普通用户文字）在展开层弱化为次要信息 */
.expanded-header .user-status.vip {
  color: var(--paper-ember, #b2492a);
}

.expanded-header .location-info {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 0;
  font-size: 12.5px;
  color: var(--paper-ink-faint, #9c947f);
}

/* 展开层正文（参考稿 expanded-text：衬线体 17px / 行高 1.9） */
.expanded-text {
  font-family: 'Songti SC', 'STSong', 'Source Han Serif SC', 'Noto Serif SC', 'SimSun', serif;
  font-size: 17px;
  line-height: 1.9;
  color: var(--paper-ink, #221f1a);
  margin: 0 0 26px;
  white-space: pre-line;
  word-break: break-word;
}

.expanded-text p {
  margin: 0 0 0.4em;
}

.expanded-text h2 {
  color: var(--paper-ink, #221f1a);
  margin-bottom: 1rem;
  font-size: 24px;
  font-weight: 700;
}

/* 操作栏（参考稿 expanded-actions：上下分隔线 + 19px 图标 + 13.5px 文案） */
.expanded-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
  padding: 16px 0;
  border-top: 1px solid var(--paper-line-soft, #e7e0cd);
  border-bottom: 1px solid var(--paper-line-soft, #e7e0cd);
}

.expanded-actions .action-group {
  display: flex;
  flex-direction: row;
  gap: 6px;
  align-items: center;
  justify-content: flex-start;
}

/* 展开层动作按钮：补齐完整基础样式
   （广场模式不加载 single.css，theme.css 也没有全局 .action-btn，
     缺了这段会退化成浏览器原生灰底按钮 —— 参考稿里是完全无底无框的） */
.expanded-actions .action-btn {
  background: none;
  border: none;
  color: var(--paper-ink-faint, #9c947f);
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  padding: 8px 12px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  transition: background 0.18s ease, color 0.18s ease;
  flex: none;
}

.expanded-actions .action-btn:hover {
  background: var(--paper-card-soft, #f5f1e7);
  color: var(--paper-ink, #221f1a);
}

/* 参考稿展开层图标 19px（覆盖上方 18px 的通用值） */
.expanded-actions .action-btn .ic {
  width: 19px;
  height: 19px;
}

.expanded-actions .action-btn.liked {
  color: var(--paper-ember, #b2492a);
}

.expanded-actions .action-btn.liked .ic-heart {
  fill: currentColor;
}

/* 举报按钮（参考稿：描边胶囊次要按钮） */
.expanded-actions .report-btn {
  margin-left: 16px;
  color: var(--paper-ink-soft, #6b6250);
  background: none;
  border: 1px solid var(--paper-line-soft, #e7e0cd);
  border-radius: var(--radius-full, 9999px);
  font-size: 12px;
  font-family: inherit;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.expanded-actions .report-btn:hover {
  color: #a32d2d;
  border-color: rgba(163, 45, 45, 0.35);
  background: rgba(163, 45, 45, 0.05);
}

/* ---------- 评论区（参考稿浅纸规范：卡片色输入框 + 深色圆形发送钮） ---------- */
.comments-section {
  margin-top: 0;
}

/* 参考稿是 h4「评论」衬线小标题 */
.comments-section h3,
.comments-section h4 {
  font-family: 'Songti SC', 'STSong', 'Source Han Serif SC', 'Noto Serif SC', 'SimSun', serif;
  color: var(--ink-primary, #1c1917);
  margin: 0 0 16px;
  font-size: 15.5px;
  font-weight: 600;
}

.comment-input {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

/* 胶囊输入框（参考稿 .comment-input input：软纸底 + line 描边 + ember 光圈） */
#commentInput {
  flex: 1;
  min-width: 0;
  padding: 11px 16px;
  font-size: 14px;
  border-radius: var(--radius-full, 9999px);
  border: 1px solid var(--paper-line, #dcd3bc);
  outline: none;
  background: var(--paper-card-soft, #f5f1e7);
  color: var(--paper-ink, #221f1a);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
  line-height: 1.4;
}

#commentInput::placeholder {
  color: var(--paper-ink-faint, #9c947f);
}

#commentInput:focus {
  border-color: var(--paper-ember, #b2492a);
  background: var(--paper-card, #fbf9f3);
  box-shadow: 0 0 0 3px var(--paper-ember-soft, #f0dccb);
}

/* 圆形发送按钮（参考稿：42px 深墨圆钮 + 纸飞机描边图标） */
#sendComment {
  width: 42px;
  height: 42px;
  padding: 0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--paper-ink, #221f1a);
  color: #f3eee1;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
  font-size: 0;
  font-family: inherit;
}

/* 用 CSS 画出纸飞机图标，替换掉原来的"发送"文字 */
#sendComment::before {
  content: '';
  width: 17px;
  height: 17px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 2 11 13'/%3E%3Cpath d='M22 2 15 22l-4-9-9-4 20-7z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 2 11 13'/%3E%3Cpath d='M22 2 15 22l-4-9-9-4 20-7z'/%3E%3C/svg%3E") center / contain no-repeat;
}

#sendComment:hover {
  transform: scale(1.06);
  background: #000;
}

#sendComment:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.comments-list {
  margin-top: 0;
}

/* 评论条目（参考稿 .comment-item：card-soft 底 + line-soft 描边 + 14px 圆角） */
.comment-item {
  background: var(--paper-card-soft, #f5f1e7);
  border: 1px solid var(--paper-line-soft, #e7e0cd);
  border-radius: 14px;
  padding: 14px 15px;
  margin-bottom: 12px;
  color: var(--paper-ink, #221f1a);
  transition: background 0.3s ease;
}

/* 评论头（参考稿 .comment-head：30px 头像 + 13.5px 用户名 + 右对齐时间） */
.comment-header,
.reply-header {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 7px;
}

/* 评论条目内头像 30px / 回复 26px（参考稿 .comment-avatar） */
.comment-header .avatar-container,
.reply-header .avatar-container {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}
.reply-header .avatar-container {
  width: 26px;
  height: 26px;
}

.comment-user,
.reply-user {
  font-weight: 600;
  color: var(--paper-ink, #221f1a);
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.comment-time,
.reply-time {
  color: var(--paper-ink-faint, #9c947f);
  font-size: 11.5px;
  margin-left: auto;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* 位置行（参考稿 .comment-loc：11px 小字 + 10px 图标） */
.comment-location {
  color: var(--paper-ink-faint, #9c947f);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 2px;
}

/* 评论位置行的定位图标：不加尺寸 SVG 会按默认尺寸撑开（300×150），把行挤成竖排 */
.comment-location .ic-loc {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.comment-text,
.reply-text {
  font-size: 13.5px;
  color: var(--paper-ink, #221f1a);
  line-height: 1.6;
  margin: 6px 0 8px;
  word-break: break-word;
}

/* 动作行（参考稿 .comment-actions：gap 14px，12px 字号，13px 图标） */
.comment-actions,
.reply-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.comment-actions button:not(:last-child),
.reply-actions button:not(:last-child) {
  margin-right: 0;
}

.comment-action,
.reply-action {
  background: none;
  border: none;
  color: var(--paper-ink-faint, #9c947f);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
  transition: color 0.18s ease, background 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* 评论/回复图标 13px（参考稿 .comment-action .ic） */
.comment-action .ic,
.reply-action .ic {
  width: 13px;
  height: 13px;
}

.comment-action:hover,
.reply-action:hover {
  color: var(--paper-ink, #221f1a);
  background: transparent;
}

.comment-action.liked,
.reply-action.liked {
  color: var(--paper-ember, #b2492a);
}

.comment-actions .report-btn,
.reply-actions .report-btn {
  color: var(--paper-ink-faint, #9c947f);
}

.comment-actions .report-btn i,
.reply-actions .report-btn i {
  font-size: 12px;
}

/* 回复输入区 */
.reply-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

/* 回复输入框（参考稿 .reply-form input：card 底 + line 描边 + 胶囊） */
.reply-input {
  flex: 1;
  min-width: 0;
  padding: 8px 14px;
  font-size: 12.5px;
  border-radius: var(--radius-full, 9999px);
  border: 1px solid var(--paper-line, #dcd3bc);
  outline: none;
  background: var(--paper-card, #fbf9f3);
  color: var(--paper-ink, #221f1a);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}

.reply-input::placeholder {
  color: var(--paper-ink-faint, #9c947f);
}

.reply-input:focus {
  border-color: var(--paper-ember, #b2492a);
  box-shadow: 0 0 0 3px var(--paper-ember-soft, #f0dccb);
}

/* 回复提交（参考稿 .reply-form button：ember 实底胶囊） */
.reply-submit {
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-full, 9999px);
  background: var(--paper-ember, #b2492a);
  color: #ffffff;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.15s ease;
  flex-shrink: 0;
  font-family: inherit;
}

.reply-submit:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.reply-section {
  margin-top: 10px;
  padding-left: 39px;
}

/* 回复条目（参考稿 .reply-item：card 底 + line-soft 描边 + 12px 圆角） */
.reply-item {
  background: var(--paper-card, #fbf9f3);
  border: 1px solid var(--paper-line-soft, #e7e0cd);
  border-radius: 12px;
  padding: 11px 13px;
  margin-bottom: 8px;
}

.reply-section .comment-item:last-child,
.reply-item:last-child {
  margin-bottom: 0;
}

/* 查看更多回复 */
.show-more-replies-container {
  margin: 8px 0 5px;
}

.show-replies-button {
  background-color: transparent;
  color: var(--paper-ink-soft, #6b6250);
  border: 1px solid var(--paper-line-soft, #e7e0cd);
  padding: 5px 12px;
  font-size: 0.85em;
  font-family: inherit;
  border-radius: var(--radius-full, 9999px);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.show-replies-button:hover {
  background-color: var(--paper-ember-soft, #f0dccb);
  color: var(--paper-ember-deep, #8f3a20);
  border-color: var(--paper-ember, #b2492a);
}

.show-replies-button i {
  margin-left: 5px;
  font-size: 0.9em;
}

/* 评论登录引导（未登录查看评论） */
.comment-login-prompt {
  margin: 2rem 0;
  padding: 2rem 1.6rem;
  background: var(--paper-card-soft, #f5f1e7);
  border: 1.5px dashed rgba(178, 73, 42, 0.35);
  border-radius: var(--radius-lg, 14px);
  text-align: center;
}

.login-prompt-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.lock-icon {
  font-size: 2.5rem;
  animation: lock-shake 2s ease-in-out infinite;
}

@keyframes lock-shake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
}

.login-prompt-content p {
  color: var(--paper-ink-soft, #6b6250);
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

.login-prompt-btn {
  padding: 10px 30px;
  background: linear-gradient(135deg, var(--paper-ember, #b2492a) 0%, var(--paper-ember-deep, #8f3a20) 100%);
  border: none;
  border-radius: var(--radius-full, 9999px);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 4px 15px rgba(143, 58, 32, 0.28);
  font-family: inherit;
}

.login-prompt-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(143, 58, 32, 0.42);
}

/* ---------- 头像与 VIP 标识（信息流 / 评论共用） ---------- */
.avatar-container {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}

.avatar-container .avatar,
.avatar-container .comment-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.avatar {
  border-radius: 50%;
  object-fit: cover;
}

/* VIP 标识（对齐参考稿「名称右侧小徽章」的位置与尺度）
   - 赭红实底小胶囊，替换原先的橙金渐变，贴合暖纸材质
   - align-self + width:auto + 固定 height 三重保险：
     即使被塞进 flex-column 容器（.user-details）也不会被横向拉伸成一条 */
.vip-label,
.vip-badge,
.vip-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: auto;
  min-width: 0;
  height: 16px;
  font-size: 10px;
  font-weight: 700;
  font-family: inherit;
  line-height: 1;
  padding: 0 6px;
  border-radius: var(--radius-full, 9999px);
  background: var(--paper-ember, #b2492a);
  color: #fdf6ef;
  letter-spacing: 0.3px;
  white-space: nowrap;
  flex: none;
  vertical-align: middle;
}

/* ---------- 展开层评论区：单帖模式兼容 ----------
   展开层变量已统一走 --paper-*（深色主题下自动映射为暗色令牌），
   这里只兜底登录引导的配色，保证嵌在深色单帖页面时仍是暖纸观感 */
.expanded-post .comment-login-prompt {
  border-color: rgba(178, 73, 42, 0.35);
}
.expanded-post .comment-login-prompt,
.expanded-post .comment-login-prompt h4,
.expanded-post .comment-login-prompt p {
  color: var(--paper-ink-soft, #6b6250);
}

/* 深色主题下展开层保持同色系（变量自动跟随，仅补卡片底衬） */
:root[data-theme="dark"] .expanded-post .comment-item {
  background: var(--surface-subtle, #272019);
}
:root[data-theme="dark"] .expanded-post .reply-item {
  background: var(--surface, #211b15);
}

/* ---------- 加载更多 / 没有更多（插入在 .site-footer 之前） ---------- */
.load-more-btn {
  display: block;
  margin: 26px auto;
  padding: 12px 42px;
  font-size: 14.5px;
  font-weight: 700;
  color: #ffffff;
  background: var(--accent-gradient, linear-gradient(135deg, #c2410c 0%, #ea580c 100%));
  border: none;
  border-radius: var(--radius-full, 9999px);
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 16px rgba(194, 65, 12, 0.32);
  font-family: inherit;
}

.load-more-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(194, 65, 12, 0.45);
}

.load-more-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.load-more-btn.login-required-btn {
  background: var(--surface, #ffffff);
  color: var(--accent, #c2410c);
  border: 1.5px solid var(--accent-light-border, #fed7aa);
  box-shadow: var(--shadow-card, 0 1px 3px rgba(68, 45, 30, 0.04));
}

.load-more-btn.login-required-btn:hover {
  background: var(--accent-light, #fff7ed);
  box-shadow: 0 6px 18px rgba(194, 65, 12, 0.18);
}

.no-more-posts {
  text-align: center;
  color: var(--ink-muted, #a8a29e);
  font-size: 13.5px;
  padding: 26px 0 8px;
  letter-spacing: 1px;
}

/* ---------- 加载指示器 ---------- */
.loading-indicator {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 0;
  color: var(--ink-tertiary, #78716c);
  font-size: 13.5px;
  gap: 12px;
}

.loading-indicator.show {
  display: flex;
}

.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--accent-light-border, #fed7aa);
  border-top-color: var(--accent, #c2410c);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- 悬浮发帖按钮 ---------- */
.floating-post-btn {
  position: fixed;
  right: 28px;
  bottom: 34px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--accent-gradient, linear-gradient(135deg, #c2410c 0%, #ea580c 100%));
  color: #ffffff;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 900;
  box-shadow: 0 8px 24px rgba(194, 65, 12, 0.45);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-post-btn:hover {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 12px 30px rgba(194, 65, 12, 0.55);
}

/* ---------- Toast 通知 ---------- */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  background: rgba(28, 25, 23, 0.94);
  color: #ffffff;
  padding: 11px 22px;
  border-radius: var(--radius-full, 9999px);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
  z-index: 3000;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  max-width: 80vw;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-success { background: rgba(5, 150, 105, 0.95); }
.toast-error { background: rgba(186, 26, 26, 0.95); }
.toast-warning { background: rgba(217, 119, 6, 0.95); }
.toast-info { background: rgba(28, 25, 23, 0.94); }

/* ---------- 人机验证弹窗（评论验证码） ---------- */
.captcha-modal {
  position: fixed;
  inset: 0;
  background: rgba(28, 19, 14, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2500;
  padding: 20px;
}

.captcha-modal-content {
  background: linear-gradient(160deg, #292524 0%, #1c1917 100%);
  border: 1px solid rgba(254, 215, 170, 0.16);
  border-radius: var(--radius-xl, 18px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  padding: 26px 24px;
  width: 100%;
  max-width: 380px;
  color: #f5f0ea;
}

.captcha-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.captcha-modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}

.captcha-modal-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.captcha-modal-close:hover {
  color: #ffffff;
}

.captcha-container {
  display: flex;
  justify-content: center;
  min-height: 65px;
}

/* ---------- 自定义通用模态框（#customModal，plaza.js showCustomModal） ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 19, 14, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  opacity: 0;
  transition: opacity 0.25s ease;
  padding: 20px;
}

.modal-overlay.show {
  opacity: 1;
}

.modal-content {
  background: linear-gradient(160deg, #292524 0%, #1c1917 100%);
  border: 1px solid rgba(254, 215, 170, 0.16);
  border-radius: var(--radius-xl, 18px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  padding: 28px 26px 22px;
  min-width: 320px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  transform: scale(0.94);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.show .modal-content {
  transform: scale(1);
}

.modal-icon {
  font-size: 34px;
  margin-bottom: 12px;
  line-height: 1;
}

.modal-title {
  font-size: 17px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 10px;
}

.modal-message {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.65;
  margin-bottom: 20px;
  word-break: break-word;
}

.modal-action-btn,
.modal-close-btn {
  font-family: inherit;
  cursor: pointer;
}

.modal-action-btn {
  display: inline-block;
  padding: 10px 34px;
  border: none;
  border-radius: var(--radius-md, 10px);
  background: var(--accent-gradient, linear-gradient(135deg, #c2410c 0%, #ea580c 100%));
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  transition: filter 0.2s ease;
}

.modal-action-btn:hover {
  filter: brightness(1.1);
}

.modal-close-btn {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: rgba(255, 255, 255, 0.65);
  font-size: 18px;
  line-height: 1;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.modal-content {
  position: relative;
}

/* ---------- 图片预览 ---------- */
.image-preview-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 6, 0.92);
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.image-preview-content {
  position: relative;
  max-width: 92vw;
  max-height: 92vh;
}

.image-preview-content img {
  max-width: 92vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  border-radius: var(--radius-md, 10px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
}

.image-preview-close {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
}

.image-preview-close:hover,
.image-preview-close:focus {
  background: var(--accent, #c2410c);
  color: #ffffff;
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .plaza-page-head h1 {
    font-size: 22px;
  }
  .plaza-page-head h1::before {
    height: 22px;
  }
  .expanded-overlay.show {
    padding: 0.75rem;
  }
  /* 移动端展开层：上下布局（上媒体 38vh，下内容滚动），参考稿响应式 */
  .expanded-post {
    flex-direction: column;
    overflow-y: auto;
  }
  .expanded-media {
    width: 100%;
    height: 38vh;
    flex-shrink: 0;
  }
  .expanded-scrollable {
    flex: 1;
    min-height: 0;
    padding: 1.25rem 1rem;
  }
  .floating-post-btn {
    right: 18px;
    bottom: 22px;
    width: 52px;
    height: 52px;
  }
  .reply-section {
    padding-left: 12px;
  }
}

@media (max-width: 480px) {
  .plaza-page-head {
    padding: 4px 2px 2px;
  }
  #masonry .post-card .post-body {
    padding-left: 12px;
    padding-right: 12px;
  }
  .modal-content {
    min-width: unset;
    padding: 22px 16px 18px;
  }
  .modal-title { font-size: 16px; }
  .modal-message { font-size: 13px; }
  .captcha-modal-content {
    max-width: 92vw;
    padding: 20px 14px;
  }
}

/* ---------- 页脚留白（加载按钮插在页脚之前） ---------- */
.site-footer {
  margin-top: 2rem;
  position: relative;
  z-index: 1;
}

/* ============================================================
   广场页头装饰（徽章 + 暖色光斑 + 状态胶囊）
   全部走 theme.css 变量，深浅模式自动成立
   ============================================================ */
.plaza-head-deco {
  position: relative;
  overflow: hidden;
  padding: 18px 22px;
  margin-bottom: 14px;
  background: var(--surface-subtle, #f8f4ee);
  border: 1px solid var(--border-light, #f0e7de);
  border-radius: 16px;
}
/* 页头升级后不再需要 h1 自带的橙色竖条（由渐变徽章替代） */
.plaza-head-deco h1::before {
  display: none;
}
/* 暖色光斑装饰 */
.plaza-head-blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.45;
  filter: blur(34px);
}
.plaza-head-blob-a {
  width: 220px;
  height: 220px;
  top: -110px;
  right: -60px;
  background: radial-gradient(circle, rgba(234, 88, 12, 0.35) 0%, transparent 70%);
}
.plaza-head-blob-b {
  width: 160px;
  height: 160px;
  bottom: -90px;
  left: 18%;
  background: radial-gradient(circle, rgba(217, 119, 6, 0.28) 0%, transparent 70%);
}
.plaza-head-main {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
}
/* 渐变徽章（替代竖条） */
.plaza-head-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--accent-gradient, linear-gradient(135deg, #c2410c 0%, #ea580c 100%));
  box-shadow: 0 6px 16px -6px rgba(194, 65, 12, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
}
.plaza-head-deco h1 {
  font-size: 24px;
  display: block;
}
.plaza-head-deco p {
  margin-top: 2px;
}
/* 右侧状态胶囊 */
.plaza-head-chips {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.plaza-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 9999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-secondary, #44403c);
  background: var(--surface, #fffdfb);
  border: 1px solid var(--border-light, #f0e7de);
}
/* 实时脉冲绿点 */
.plaza-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
  animation: plazaPulse 2s ease-out infinite;
}
@keyframes plazaPulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .plaza-pulse-dot { animation: none; }
}
/* 深色模式：光斑压暗、胶囊换深色表面 */
:root[data-theme="dark"] .plaza-head-blob { opacity: 0.18; }
:root[data-theme="dark"] .plaza-chip {
  background: var(--surface-subtle, #272019);
  color: var(--ink-secondary, #d3c9bd);
}
/* 移动端：胶囊换行放底部 */
@media (max-width: 768px) {
  .plaza-head-deco { padding: 14px 16px; }
  .plaza-head-main { flex-wrap: wrap; }
  .plaza-head-chips { margin-left: 0; width: 100%; }
  .plaza-head-deco h1 { font-size: 20px; }
}

/* ==================== 单帖详情页（复用帖子流卡片，内容全部 SSR 输出） ==================== */
/* 单帖页沿用同一个 id="masonry" 容器，所以上面整套 #masonry .post-card 纸质感样式
   自动生效，无需复制。这里只处理"详情页"相对"帖流卡片"的差异。
   注意：下面选择器都写成 body.plaza-single #masonry … 的形式，
   否则特异性低于 #masonry .xxx（id 权重更高），覆盖不生效。 */

/* 详情页不需要瀑布流的最小高度 */
body.plaza-single #masonry { min-height: 0; }

/* 详情页卡片不是"点开"的入口（没有展开浮层），去掉手型光标 */
body.plaza-single #masonry .post-card { cursor: default; }

/* 主帖不截断正文：详情页要完整展示，也利于 SEO/GEO 抓取全文 */
body.plaza-single #masonry .post-card--single .post-text {
  -webkit-line-clamp: unset;
  overflow: visible;
  display: block;
  font-size: 15px;
  line-height: 1.75;
}
body.plaza-single #masonry .post-card--single .post-body { padding: 18px 20px 15px; }

/* 4 张及以上图片：等宽网格铺满 */
#masonry .post-media.mall { grid-template-columns: repeat(3, 1fr); }
#masonry .post-media.mall img { height: 118px; }

/* 推荐卡正文压到 2 行，保持列表紧凑 */
#masonry .recommended-card .post-text { -webkit-line-clamp: 2; }

/* 返回广场按钮（原来由已废弃的 single.css 提供深色玻璃皮肤，这里换回纸质感） */
.back-button-container { margin-bottom: 14px; }
.back-to-plaza-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  background: var(--paper-card, #fbf9f3);
  border: 1px solid var(--paper-line-soft, #e7e0cd);
  color: var(--paper-ink-soft, #6b6250);
  border-radius: 999px;
  font-size: 13px;
  text-decoration: none;
  transition: border-color .2s ease, color .2s ease, transform .2s ease;
}
.back-to-plaza-btn:hover {
  border-color: var(--paper-line, #dcd3bc);
  color: var(--paper-ink, #221f1a);
  transform: translateX(-2px);
}

/* 页内评论区：浅色页面上包一层纸卡，与主帖视觉同源 */
.single-comments {
  margin-top: 20px;
  background: var(--paper-card, #fbf9f3);
  border: 1px solid var(--paper-line-soft, #e7e0cd);
  border-radius: 18px;
  padding: 18px 20px 14px;
  box-shadow: var(--paper-shadow-1);
}
.single-comments-empty {
  text-align: center;
  padding: 18px 0;
  font-size: 13px;
  color: var(--paper-ink-faint, #9c947f);
}

/* 推荐阅读 */
.recommended-posts-section { margin-top: 24px; }
.recommended-posts-section .section-title {
  font-family: 'Songti SC', 'STSong', 'Source Han Serif SC', 'Noto Serif SC', 'SimSun', serif;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink-primary, #1c1917);
  margin: 0 0 12px;
}
.recommended-card {
  display: block;
  text-decoration: none;
  color: inherit;
  margin-bottom: 12px;
}
.recommended-card:hover { transform: translateY(-3px); }

/* 推荐卡里只有统计数字，不是可点按钮 */
#masonry .action-btn.stat-only {
  pointer-events: none;
  cursor: default;
  padding: 6px 4px;
}
#masonry .action-btn.stat-only:hover {
  background: none;
  color: var(--paper-ink-faint, #9c947f);
}

@media (max-width: 768px) {
  body.plaza-single #masonry .post-card--single .post-body { padding: 15px 15px 13px; }
  .single-comments { padding: 15px 15px 12px; }
  #masonry .post-media.mall { grid-template-columns: repeat(2, 1fr); }
}
