/* ===== 基础 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body {
  background: #f7f7f7;
  color: #1a1a1a;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  touch-action: manipulation;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ===== 顶部导航 ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: 44px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px;
  z-index: 100;
  color: #fff;
  background: linear-gradient(to bottom, rgba(0,0,0,0.45), rgba(0,0,0,0.15) 60%, transparent);
}
.nav-title { font-size: 17px; font-weight: 500; }
.nav-btn { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; }
.nav-btn svg { width: 22px; height: 22px; stroke: rgba(255,255,255,0.6); stroke-width: 1.5; }

/* ===== 封面区 ===== */
.cover {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 240px;
  max-height: 420px;
  background: #e5e5e5;
  overflow: visible;
}
.cover-empty {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: #999; font-size: 14px;
  background: linear-gradient(135deg, #dcdcdc, #c8c8c8);
}
.cover img.cover-img, .cover > img#coverImg {
  width: 100%; height: 100%; object-fit: cover;
}
/* 封面轮播 */
.cover-slider {
  position: absolute; inset: 0;
}
.cover-slider img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 0.6s ease;
}
.cover-slider img.active { opacity: 1; }
.me {
  position: absolute; right: 12px; bottom: -30px;
  display: flex; align-items: center; gap: 10px;
  z-index: 5;
}
.me-name {
  color: #fff; font-size: 16px; font-weight: 500;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
  margin-bottom: 2px;
}
.me-avatar {
  width: 64px; height: 64px; border-radius: 6px; overflow: hidden;
  background: #fff; border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.me-avatar img { width: 100%; height: 100%; object-fit: cover; }
.me-avatar.placeholder {
  display: flex; align-items: center; justify-content: center;
  color: #bbb; font-size: 12px;
}

/* ===== 动态流 ===== */
.feed { background: #fff; padding-bottom: 40px; padding-top: 20px; }
.loading { text-align: center; color: #999; padding: 30px 0; }

/* 到底提示 */
.feed-end {
  text-align: center;
  color: #c0c0c0;
  font-size: 12px;
  padding: 24px 0 32px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.feed-end::before, .feed-end::after {
  content: ''; width: 30px; height: 1px; background: #e5e5e5;
}
.feed-end svg { opacity: 0.6; }

.post {
  display: flex; gap: 12px;
  padding: 16px 14px;
  border-bottom: 1px solid #f0f0f0;
}
.post-avatar {
  width: 40px; height: 40px; border-radius: 6px; overflow: hidden;
  background: #eaeaea; flex-shrink: 0;
}
.post-avatar img { width: 100%; height: 100%; object-fit: cover; }
.post-avatar.placeholder {
  display: flex; align-items: center; justify-content: center;
  color: #bbb; font-size: 11px;
}
.post-body { flex: 1; min-width: 0; }
.post-name { color: #576b95; font-weight: 500; font-size: 15px; margin-bottom: 4px; }
.post-content { color: #1a1a1a; word-wrap: break-word; white-space: pre-wrap; }
.post-content.expand-toggle { color: #576b95; cursor: pointer; }
.post-images {
  display: grid; gap: 3px; margin-top: 10px;
  grid-template-columns: repeat(3, 1fr);
  max-width: 216px;
}
.post-images img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 3px;
  cursor: pointer;
}
.post-images.single {
  display: block;
  max-width: 240px;
}
.post-images.single img {
  width: auto; max-width: 100%; height: auto;
  max-height: 260px; aspect-ratio: auto;
  border-radius: 4px; object-fit: contain;
}

/* 视频块 */
.post-video {
  position: relative; margin-top: 10px;
  width: 200px; max-width: 100%;
  border-radius: 6px; overflow: hidden;
  background: #000; cursor: pointer;
}
/* 横屏视频：再缩小 */
.post-video.landscape { width: 160px; }
.post-video.landscape video { max-height: 120px; }
.post-video video {
  width: 100%; height: auto; max-height: 260px;
  display: block; object-fit: contain; background: #000;
}
.post-video .video-play {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.post-video.playing .video-play { display: none; }
/* 底部控制条 */
.post-video .video-controls {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 6px 8px;
  background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
  opacity: 0; transition: opacity 0.2s;
}
.post-video:active .video-controls,
.post-video.playing .video-controls { opacity: 1; }
.post-video .video-controls button {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(0,0,0,0.5); border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
}
.post-video .video-controls svg { width: 16px; height: 16px; fill: #fff; }

.post-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px; color: #b2b2b2; font-size: 13px;
}
.post-location { color: #576b95; cursor: pointer; }
.post-dot {
  width: 22px; height: 18px; border-radius: 4px;
  background: #f5f5f5;
  display: flex; align-items: center; justify-content: center;
}
.post-dot svg { width: 12px; height: 3px; display: block; }

/* ===== 图片查看器 ===== */
.viewer {
  position: fixed; inset: 0; background: rgba(0,0,0,0.92);
  z-index: 200; display: none;
  align-items: center; justify-content: center;
}
.viewer.show { display: flex; }
.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-close {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 5;
}
.viewer-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 5;
}
.viewer-nav#viewerPrev { left: 10px; }
.viewer-nav#viewerNext { right: 10px; }
.viewer-count {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  color: #fff; font-size: 14px; z-index: 5;
  background: rgba(0,0,0,0.4); padding: 4px 12px; border-radius: 12px;
}

/* ===== 下拉刷新 ===== */
.pull-refresh {
  position: fixed; top: 0; left: 0; right: 0;
  height: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  color: #999; font-size: 13px;
  transition: height 0.2s;
  z-index: 90;
}
.pull-refresh.show { height: 50px; }
.pull-refresh.spin svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 桌面端适配 ===== */
@media (min-width: 768px) {
  body { max-width: 560px; margin: 0 auto; box-shadow: 0 0 20px rgba(0,0,0,0.08); }
  .nav { max-width: 560px; left: 50%; transform: translateX(-50%); }
  .cover { max-height: 380px; }
}
