/* ===== 圈子页面 ===== */
#page-circle { background: #F0F1F3; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; }
.circle-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.circle-header { padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px; background: #F0F1F3; position: relative; z-index: 10; transition: opacity 250ms ease; }
.circle-header .top-row { display: flex; align-items: center; justify-content: space-between; }
.circle-logo { width: 120px; height: 32px; flex-shrink: 0; display: flex; align-items: center; justify-content: flex-start; }
.circle-logo img { height: 100%; object-fit: contain; }
.circle-header-auth { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.circle-header-login-btn { width: 70px; height: 32px; background: #FF5C39; color: #fff; border-radius: 6px; font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; cursor: pointer; border: none; flex-shrink: 0; }
.circle-header-login-btn:active { transform: scale(0.95); }
.circle-header-login-btn.hidden { display: none; }
.circle-header-avatar { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: #E8EAED; }
.circle-header-avatar img { width: 100%; height: 100%; object-fit: cover; }
.circle-header-name { font-size: 14px; font-weight: 600; color: #1A1C1E; white-space: nowrap; max-width: 72px; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.circle-notice-bar { height: 32px; background: rgba(79,140,255,0.08); border-radius: 6px; display: flex; align-items: center; padding: 0 12px; gap: 8px; margin-top: 8px; overflow: hidden; }
.circle-notice-icon svg { width: 16px; height: 16px; fill: #4F8CFF; flex-shrink: 0; }
.circle-notice-text { flex: 1; overflow: hidden; white-space: nowrap; position: relative; }
.circle-notice-text-inner { display: inline-block; padding-left: 100%; animation: marquee 12s linear infinite; font-size: 13px; color: #4F8CFF; font-weight: 500; }
/* ★2026-10-25：没有播报内容时停掉跑马灯（板块保留、文字为空） */
.circle-notice-text-inner:empty, .circle-fixed-notice-inner:empty { animation: none; padding-left: 0; }
@keyframes marquee { 0% { transform: translate(0, 0); } 100% { transform: translate(-100%, 0); } }

.circle-fixed-header { position: fixed; top: 0; left: 50%; right: auto; transform: translateX(-50%) translateY(-100%); width: 100%; max-width: 430px; z-index: 50; background: rgba(255,255,255,0.95); backdrop-filter: blur(10px); display: flex; align-items: center; padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px; gap: 10px; opacity: 0; pointer-events: none; transition: opacity 250ms ease, transform 250ms ease; border-bottom: 1px solid rgba(0,0,0,0.06); }
.circle-fixed-header.visible { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.circle-fixed-notice { flex: 1; overflow: hidden; white-space: nowrap; position: relative; font-size: 13px; color: #4F8CFF; font-weight: 500; }
.circle-fixed-notice-inner { display: inline-block; padding-left: 100%; animation: marquee 12s linear infinite; }

.circle-post-list { padding: 0 12px; }
.post-card { background: #fff; border-radius: 12px; padding: 16px; margin-bottom: 8px; box-shadow: 0 2px 12px rgba(0,0,0,0.04); }
.post-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.post-avatar { width: 40px; height: 40px; border-radius: 50%; background: #E8EAED; flex-shrink: 0; overflow: hidden; }
.post-avatar img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.post-user-info { flex: 1; }
.post-nickname { font-size: 15px; font-weight: 600; color: #1A1C1E; display: flex; align-items: center; }
.post-time { font-size: 11px; color: #B0B3B8; margin-top: 2px; }
.post-body { font-size: 14px; color: #3A3C40; line-height: 1.5; margin-bottom: 8px; word-break: break-word; text-align: left; }
.post-title { font-weight: 700; font-family: "Heiti SC", "SimHei", -apple-system, sans-serif; font-size: 16px; color: #1A1C1E; text-align: left; line-height: 1.4; margin-bottom: 6px; word-break: break-word; }
.post-status-badge { font-size: 11px; padding: 2px 6px; border-radius: 4px; color: #fff; font-weight: 500; flex-shrink: 0; align-self: flex-start; }
.post-status-badge.ended { background: #34C759; }
.post-status-badge.ongoing { background: #FF9500; }
.post-images { display: flex; gap: 4px; margin-bottom: 8px; }
.post-images.single .post-img-wrap { width: 100%; aspect-ratio: auto; background: #E8EAED; display: flex; min-height: 120px; }
.post-images.single .post-img-wrap.horizontal { width: 100%; }
.post-images.single .post-img-wrap.horizontal img { width: 100%; height: auto; max-height: 60vh; object-fit: contain; }
.post-images.single .post-img-wrap.vertical { width: calc(50% - 2px); align-self: flex-start; }
.post-images.single .post-img-wrap.vertical img { width: 100%; height: auto; max-height: 60vh; object-fit: contain; }
.post-images.double .post-img-wrap { width: calc(50% - 2px); aspect-ratio: 1 / 1; }
.post-img-wrap { position: relative; overflow: hidden; border-radius: 8px; background: #E8EAED; cursor: pointer; }
.post-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.post-actions { display: flex; align-items: center; gap: 24px; padding-top: 4px; border-top: 1px solid #F0F1F3; }
.post-action { display: flex; align-items: center; gap: 4px; cursor: pointer; user-select: none; transition: transform 0.1s; font-size: 13px; color: #8E96A3; }
.post-action:active { transform: scale(0.9); }
.post-action.liked { color: #FF6B6B; }
.post-action svg { width: 18px; height: 18px; fill: none; stroke: #8E96A3; stroke-width: 2; transition: fill 0.2s, stroke 0.2s; }
.post-action.liked svg { fill: #FF6B6B; stroke: #FF6B6B; }
.like-burst { animation: likeBurst 0.4s ease; }
@keyframes likeBurst { 0% { transform: scale(1); } 30% { transform: scale(1.4); } 100% { transform: scale(1); } }
.circle-end-tip { text-align: center; padding: 20px 0; font-size: 13px; color: #A0A4A8; }

/* 评论页 */
#page-comment-detail { background: #F0F1F3; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; }
.comment-detail-header { display: flex; align-items: center; padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px; background: #fff; gap: 12px; flex-shrink: 0; border-bottom: 1px solid rgba(0,0,0,0.06); position: relative; z-index: 60; }
.comment-back-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.comment-back-btn svg { width: 22px; height: 22px; fill: none; stroke: #333; stroke-width: 2.5; }
.comment-detail-title { font-size: 16px; font-weight: 600; color: #1A1C1E; flex: 1; text-align: center; margin-right: 32px; }
.comment-detail-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.comment-original-post { background: #fff; margin: 12px; border-radius: 12px; padding: 16px; }
.comment-list-section { background: #fff; margin: 0 12px 12px; border-radius: 12px; padding: 8px 16px; }
.comment-item { padding: 12px 0; border-bottom: 1px solid #F0F1F3; }
.comment-item:last-child { border-bottom: none; }
.comment-item-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.comment-item-avatar { width: 28px; height: 28px; border-radius: 50%; background: #E8EAED; flex-shrink: 0; overflow: hidden; }
.comment-item-avatar img { width: 100%; height: 100%; object-fit: cover; }
.comment-item-nickname { font-size: 13px; font-weight: 600; color: #1A1C1E; }
.comment-item-time { font-size: 11px; color: #B0B3B8; margin-left: auto; }
.comment-item-body { font-size: 14px; color: #3A3C40; line-height: 1.5; margin-bottom: 6px; }
.comment-item-reply-btn { font-size: 12px; color: #8E96A3; cursor: pointer; display: inline-block; padding: 2px 0; }
.comment-item-reply-btn:active { color: #4F8CFF; }
.comment-reply-nest { margin-left: 20px; padding: 8px 12px; background: #F8F9FA; border-radius: 8px; margin-top: 6px; border-left: 3px solid #4F8CFF; color: #3A3C40; }
.comment-reply-nest .comment-item-nickname { color: #1A1C1E; }
.comment-empty { text-align: center; padding: 32px 0; font-size: 14px; color: #A0A4A8; }

.comment-original-post .post-img-wrap { background: #fff; border-radius: 8px; }
.comment-original-post .post-images.single .post-img-wrap { min-height: 120px; }
.comment-original-post .post-images.single .post-img-wrap.vertical { width: calc(50% - 2px); align-self: flex-start; }
.comment-original-post .post-images.single .post-img-wrap.vertical img { width: 100%; height: auto; max-height: 60vh; object-fit: contain; }
.comment-original-post .post-images.single .post-img-wrap.horizontal img { width: 100%; height: auto; max-height: 60vh; object-fit: contain; }

.post-header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.post-header-actions .like-action { gap: 0; }
.post-header-actions .like-action svg { width: 18px; height: 18px; }
.fav-btn-circle { height: 28px; padding: 0 12px; border-radius: 14px; font-size: 12px; font-weight: 600; border: none; cursor: pointer; transition: all 0.15s; white-space: nowrap; flex-shrink: 0; background: #FF5C39; color: #fff; }
.fav-btn-circle.favorited { background: transparent; color: #8E96A3; border: 1px solid #D0D3D8; }
.fav-btn-circle:active { transform: scale(0.95); }

/* 评论遮罩 + 输入栏 */
.comment-mask { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); z-index: 70; }
.comment-mask.show { display: block; }
.comment-mask.transparent { background: transparent; }
.comment-input-bar { flex-shrink: 0; display: flex; align-items: center; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid rgba(0,0,0,0.06); gap: 8px; position: relative; z-index: 80; }
.comment-emoji-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.comment-emoji-btn svg { width: 20px; height: 20px; fill: none; stroke: #8E96A3; stroke-width: 2; }
.comment-input-field { flex: 1; height: 38px; background: #F0F1F3; border-radius: 19px; border: none; padding: 0 14px; font-size: 14px; outline: none; color: #1A1C1E; }
.comment-input-field:focus { background: #fff; box-shadow: 0 0 0 1.5px #4F8CFF; }
.comment-send-btn { background: #4F8CFF; color: #fff; border: none; border-radius: 16px; padding: 0 16px; height: 32px; font-size: 13px; font-weight: 600; cursor: pointer; flex-shrink: 0; }
.comment-send-btn:active { opacity: 0.8; }

/* Emoji 下拉板块（键盘同高） */
.dock-shell { height: var(--dock-h, 0px); width: 100%; flex-shrink: 0; position: relative; overflow: hidden; }
/* ⚠️ 过渡只由 JS 通过 `.dock-anim` 控制（键盘跟手必须无过渡；面板/收起才用过渡）。
   若把 transition 常驻在 .dock-shell 上，实测（Chrome）会出现「值已改但高度仍为 0」的卡死。 */
.dock-shell.dock-anim { transition: height 0.2s ease; }
.dock-shell > .emoji-dock,
.dock-shell > .plus-dock { position: absolute; left: 0; right: 0; top: 0; height: 0; }
.dock-shell > .emoji-dock.show,
.dock-shell > .plus-dock.show { height: 100%; }
/* ⚠️ 面板高度由 .dock-shell 的 --dock-h 决定（见 messages.css 同款说明），此处不再写死 300px。 */
.emoji-dock { overflow: hidden; background: #F7F8FA; border-radius: 16px 16px 0 0; box-shadow: 0 -4px 16px rgba(0,0,0,0.1); z-index: 80; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 0; height: 100%; overflow-y: auto; padding: 8px; box-sizing: border-box; }
.emoji-item { width: 100%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 24px; cursor: pointer; }

/* 图片查看器 / 统一媒体查看器（公示图片 · 聊天图片 + 视频） */
.image-viewer { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95); z-index: 2000; display: none; align-items: center; justify-content: center; }
.image-viewer.show { display: flex; }
.viewer-scroll { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.viewer-scroll::-webkit-scrollbar { display: none; }
/* ⚠ 长图（高于视口）必须**顶部对齐**（由 JS 按实际尺寸加 `.tall`）。
   背景：容器是 `display:flex; align-items:center`（短图垂直居中是正确的）；
   但长图若仍居中，flex 会把图片首尾**同时**溢出容器上下两端，而浏览器
   **不能滚动到负值** → 图片顶部被永久裁掉、滚不上去。
   实测（公示页 720×1280 图 / 874×930 视口）：居中时图片 top = -387px，
   而可滚范围也只有 387px（正确应为 1554 − 930 = 624px）。
   改 `flex-start` 后从顶部开始，可滚范围 = 图高 − 视口高，整张图都能看到。 */
.viewer-scroll.tall { align-items: flex-start; }
/* ⚠ `#viewerStage` = **被 transform 的元素**（图片与视频都住在它里面 → 两者走同一条缩放通道）。
   `touch-action` / `will-change` 由 JS 动态切换：
     未放大 → `pan-y`（长图可上下滚）；放大后 → `none`（全手势交给平移）。
   `pointer-events:none` 的 `<video>` 让事件落到容器上，由共享引擎统一判定
   「单击显隐控件」还是「滑动切图」（video 自身不该吞事件）。 */
.viewer-stage { display: block; width: 100%; }
/* ⚠️ `margin:0 auto` 不可省：`display:block` 的 `<img>` 在**比 stage 窄**时默认**贴左**。
   横屏下竖图等比缩放后宽度远小于 stage（实测 720×1280 图 / 1108 视口 → 宽 623）
   → 少了这行就会"图片跑到屏幕左侧"（用户 2026-10-02 反馈）。
   竖屏下图片宽 = 屏宽、无剩余空间 → auto margin 为 0，行为不变。 */
.viewer-stage img { display: block; margin: 0 auto; }
/* ⚠️ 视频：**钉成全屏铺满 + contain**（不按 intrinsic 比例算高）。
   改造前是 `width:100vw; height:auto` → 元数据未到达时 `<video>` 的 intrinsic 是
   300×150（比例 2.0）→ 算出一个**矮框**；元数据到达后按真实 0.563 重算 → **跳大**
   （用户 2026-10-01 反馈"先出现小尺寸显示，然后再变大"）。
   固定 100%/100% 后，加载中与成品的外框完全相同 → 尺寸全程恒定。 */
.viewer-stage video {
  display: block; width: 100%; height: 100%; object-fit: contain;
  background: #000; pointer-events: none;
}
/* 视频页：stage 也铺满（与上面的 video 一致） */
.image-viewer.video-on .viewer-stage { width: 100%; height: 100%; }

/* ── 视频加载占位（封面 + 转圈 + 文案）───────────────────────────
   铺满整屏 → 与成品同尺寸；z-index 低于控件（9 < 10），不挡返回/设置键。 */
.mv-loading {
  position: absolute; inset: 0; z-index: 9;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; pointer-events: none;
}
.mv-spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,0.25); border-top-color: #fff;
  animation: mv-spin 0.8s linear infinite;
}
@keyframes mv-spin { to { transform: rotate(360deg); } }
.mv-loading-text { color: #fff; font-size: 13px; }

/* ── 沉浸式控件（`#imageViewer` 与 `#lightbox` **共用**；由 JS 给 root 加 `.chrome-show`） ──
   默认全部隐藏：进入查看器只显示画面，单击一下才出现。 */
.mv-back, .mv-more, .mv-indicator, .mv-video-bar, .mv-menu {
  position: absolute; opacity: 0; pointer-events: none; transition: opacity 0.18s; z-index: 10;
}
.chrome-show .mv-back, .chrome-show .mv-more, .chrome-show .mv-indicator,
.chrome-show .mv-video-bar, .chrome-show .mv-menu {
  opacity: 1; pointer-events: auto;
}
.mv-back, .mv-more {
  top: 16px; width: 36px; height: 36px; border-radius: 50%; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.mv-back { left: 16px; }
.mv-more { right: 16px; }
.mv-indicator {
  bottom: 20px; left: 50%; transform: translateX(-50%); padding: 6px 12px;
  border-radius: 999px; background: rgba(0,0,0,0.45); color: #fff; font-size: 12px; line-height: 1;
}
.mv-menu { top: 60px; right: 16px; min-width: 132px; padding: 4px 0; border-radius: 10px; background: rgba(0,0,0,0.6); overflow: hidden; }
.mv-menu-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; color: #fff; font-size: 13px; cursor: pointer; }
.mv-menu-item:active { background: rgba(255,255,255,0.12); }

/* ── 视频 · 画面中央播放/暂停键 ─────────────────────────────────────────────
   ⚠️ **不放进 `.mv-chrome` 组**：它的可见规则与其它控件不同 ——
      **暂停时始终显示**（Telegram 同款，即便用户已把控件收起来也能直接点播放），
      播放中才跟随控件淡出。该规则由 JS 在 syncVideoBar 里切换 `.chrome-show` 实现：
      暂停 → 挂 `chrome-show`（强制可见）；播放 → 撤掉（回归"跟随控件"）。 */
.mv-video-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  opacity: 0; pointer-events: none; transition: opacity 0.18s; z-index: 10;
}
.mv-video-center.on { opacity: 1; pointer-events: auto; }
.mv-play { width: 48px; height: 48px; border-radius: 50%; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.mv-play svg { display: block; }

/* ── 视频 · 底部**极简**进度条（用户 2026-10-01：不要大胶囊卡片） ────────────── */
.mv-video-bar {
  bottom: 14px; left: 0; right: 0;
  /* ⚠️ 20px 容器高：保证 14px 圆点不被裁切，同时保持"无背景块"的极简观感 */
  height: 20px; display: flex; align-items: center;
}
.mv-progress {
  flex: 1; height: 20px; margin: 0 14px; padding: 0; cursor: pointer;
  -webkit-appearance: none; appearance: none; background: transparent; outline: none;
}
.mv-progress::-webkit-slider-runnable-track { height: 3px; background: rgba(255,255,255,0.35); border-radius: 2px; }
.mv-progress::-moz-range-track { height: 3px; background: rgba(255,255,255,0.35); border-radius: 2px; }
.mv-progress::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5.5px;
  background: #fff; border-radius: 50%;
}
.mv-progress::-moz-range-thumb { width: 14px; height: 14px; background: #fff; border: none; border-radius: 50%; }

/* 视频页：页码给底部进度条让位（两者同处底部，不重叠） */
.image-viewer.video-on .mv-indicator { bottom: 44px; }


@media (orientation: landscape) {
  .circle-fixed-header { max-width: 430px; left: 50%; right: auto; transform: translateX(-50%) translateY(-100%); }
  .circle-fixed-header.visible { transform: translateX(-50%) translateY(0); }
}
