/* ===== 基础 ===== */
:root {
  --bg: #0f0f12;
  --card: #17171c;
  --card-hover: #1e1e25;
  --text: #f2f2f5;
  --text-dim: #9a9aa5;
  --accent: #ff7a59;
  --radius: 14px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  /* 防保存：禁止选中与长按呼出菜单 */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

/* 防保存：拖动图片/链接不生效 */
img, a { -webkit-user-drag: none; user-drag: none; pointer-events: auto; }

/* ===== 布局 ===== */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px 60px;
}

/* ===== 顶部 ===== */
header.site-header {
  padding: 34px 0 22px;
  text-align: center;
}
header.site-header h1 {
  font-size: 26px;
  letter-spacing: 4px;
  font-weight: 700;
}
header.site-header .subtitle {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 1px;
}

/* ===== 贴文列表 ===== */
.post-list { display: flex; flex-direction: column; gap: 18px; }

.post-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.post-card:hover { background: var(--card-hover); transform: translateY(-2px); }

.post-card .cover {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  display: block;
  background: #222;
}
.post-card .meta { padding: 12px 16px 14px; }
.post-card .meta h2 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card .meta .info {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  gap: 10px;
}

.empty-tip {
  text-align: center;
  color: var(--text-dim);
  padding: 80px 0;
  font-size: 14px;
}

/* ===== 贴文详情 ===== */
.back-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 0 14px;
}
.back-bar button {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 15px;
  cursor: pointer;
  padding: 4px 6px;
  font-family: inherit;
}

.post-detail { display: none; }
.post-detail.active { display: block; }
.post-list.hidden { display: none; }

.detail-title { font-size: 21px; font-weight: 700; line-height: 1.5; margin-bottom: 6px; }
.detail-info { font-size: 12px; color: var(--text-dim); margin-bottom: 20px; }

/* 文字块（与图片交错排列） */
.block-text {
  font-size: 15px;
  line-height: 1.9;
  color: var(--text);
  white-space: pre-wrap;
  padding: 2px 2px 10px;
  word-break: break-word;
}

/* 长图文图片流 */
.image-flow { display: flex; flex-direction: column; gap: 14px; }
.image-flow figure {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #1c1c22;
  line-height: 0;
}
.image-flow figure img {
  width: 100%;
  height: auto;
  display: block;
  cursor: zoom-in;
}
.image-flow figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 22px 14px 10px;
  font-size: 12px;
  color: #fff;
  text-align: right;
  line-height: 1;
  background: linear-gradient(transparent, rgba(0,0,0,.55));
}

/* 懒加载占位 */
img[data-src] { min-height: 60px; }

/* ===== 全屏查看器 ===== */
.viewer {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 1000;
  display: none;
  flex-direction: column;
  touch-action: pan-x pan-y;
}
.viewer.open { display: flex; }

.viewer .track {
  flex: 1;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.viewer .track::-webkit-scrollbar { display: none; }

.viewer .slide {
  min-width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: center;
  position: relative;
}
.viewer .slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform .25s ease;
}
.viewer .slide img.zoomed { transform: scale(2); cursor: zoom-out; }

.viewer .topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: max(14px, env(safe-area-inset-top)) 16px 14px;
  z-index: 2;
}
.viewer .topbar .page {
  font-size: 13px;
  color: rgba(255,255,255,.85);
  background: rgba(0,0,0,.35);
  padding: 4px 12px;
  border-radius: 20px;
}
.viewer .close-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(0,0,0,.4);
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}
.viewer .hint {
  position: absolute;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 0; right: 0;
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,.55);
  pointer-events: none;
  z-index: 2;
}

/* ===== 水印层（不影响图片文件本身，仅叠加显示）===== */
.watermark {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 500;
  display: none;
  overflow: hidden;
}
.watermark.on { display: block; }
.watermark .wm-item {
  position: absolute;
  color: rgba(255,255,255,.05);
  font-size: 14px;
  letter-spacing: 2px;
  white-space: nowrap;
  transform: rotate(-18deg);
}

/* ===== 提示条 ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(0,0,0,.8);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  opacity: 0;
  transition: all .25s ease;
  z-index: 2000;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== 移动端适配 ===== */
@media (max-width: 480px) {
  header.site-header { padding: 26px 0 18px; }
  header.site-header h1 { font-size: 22px; }
  .detail-title { font-size: 18px; }
}
