/* replays.css — 访客录像视图(2026-09-27,XP 试点)。沿用 styles.css 的变量与卡片风格,手机优先。 */

.replays-view, .replay-player-view { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.replays-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px; }

/* 筛选条 */
.rp-filter { margin-bottom: 10px; }
.rp-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 6px; }
.rp-chips::-webkit-scrollbar { display: none; }
.rp-chips .filter-chip { display: inline-flex; align-items: center; gap: 6px; }
.rp-date-chip { position: relative; overflow: hidden; }
.rp-date-chip input[type="date"] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; }
.rp-chips-active { padding-top: 0; }
.rp-tag { flex-shrink: 0; border: 1px solid #1a1a1a; background: #fff; color: var(--text); border-radius: 20px; padding: 5px 12px; font-size: 0.8rem; cursor: pointer; white-space: nowrap; }
.rp-mode-note { font-size: 0.75rem; color: var(--text-dim); padding: 0 2px; line-height: 1.4; }
.rp-mode-note:empty { display: none; }
.rp-warn { color: var(--danger); }
.rp-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); }

.rp-count { font-size: 0.78rem; color: var(--text-dim); margin: 2px 2px 8px; }
.rp-count-live { color: var(--danger); font-weight: 700; }

/* 会话卡片 */
.rp-card { display: block; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; color: inherit; text-decoration: none; }
.rp-card:active { transform: scale(0.99); }
.rp-card.is-live { border-color: rgba(231, 76, 60, 0.55); box-shadow: 0 0 0 1px rgba(231, 76, 60, 0.18); }
.rp-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; font-size: 0.8rem; color: var(--text-dim); line-height: 1.3; }
.rp-card-head strong { color: var(--text); font-weight: 700; }
.rp-flag { font-size: 1rem; }
.rp-when { margin-left: auto; font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.rp-cart { background: #fff4e6; color: #c0600a; border-radius: 9999px; padding: 1px 7px; font-size: 0.72rem; font-weight: 700; }
.rp-card-path { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 0.84rem; min-width: 0; }
.rp-path { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; }
.rp-path-last { color: #FF3D6E; }
.rp-arrow { color: var(--text-dim); flex: 0 0 auto; }
.rp-card-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 5px; font-size: 0.72rem; color: var(--text-dim); }

/* 「实时」红点标记 */
.rp-live { display: inline-flex; align-items: center; gap: 4px; background: var(--danger); color: #fff; font-size: 0.72rem; font-weight: 700; border-radius: 9999px; padding: 1px 8px 1px 6px; flex-shrink: 0; }
.rp-live i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: lv-blink 1.2s infinite; }

.rp-empty { padding: 48px 24px; }
.rp-empty-sub { font-size: 0.8rem; color: var(--text-dim); margin-top: 8px; line-height: 1.5; }

/* 播放器页 */
.rp-head-badge { min-width: 48px; display: flex; justify-content: flex-end; }
.rp-player-scroll { padding: 12px; }
.rp-stage-wrap { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; margin-bottom: 12px; overflow: hidden; }
.rp-stage { width: 100%; min-height: 220px; position: relative; }
.rp-stage-loading { min-height: 220px; }
.rp-stage .empty-state { padding: 40px 16px; }

/* rrweb-player 适配:去掉自带阴影/圆角,和卡片融为一体;控制条字号跟随看板 */
.rp-stage .rr-player { box-shadow: none !important; border-radius: 8px; overflow: hidden; background: #fff; float: none !important; margin: 0 auto; }
.rp-stage .rr-player__frame { background: #f0f0f2; }
.rp-stage .rr-controller { background: #fff; border-radius: 0 0 8px 8px; }
.rp-stage .rr-controller__btns button { font-size: 0.8rem; }
.rp-stage .replayer-wrapper { box-shadow: 0 0 0 1px var(--border); }

.rp-live-bar { display: flex; align-items: center; gap: 10px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 12px; font-size: 0.85rem; }
.rp-live-bar[hidden] { display: none; }
.rp-live-bar .btn { margin-left: auto; }
.rp-live-status { color: var(--text-dim); font-size: 0.8rem; }

/* 浏览路径 */
.rp-page { display: flex; align-items: center; gap: 8px; width: 100%; background: var(--bg-input); border: none; border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; text-align: left; font-size: 0.82rem; color: var(--text); cursor: pointer; }
.rp-page:active { opacity: 0.7; }
.rp-page-t { font-variant-numeric: tabular-nums; color: var(--text-dim); font-size: 0.75rem; flex: 0 0 auto; min-width: 34px; }
.rp-page-n { flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%; background: #3498db; color: #fff; font-size: 0.68rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.rp-page-u { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-page-cart { background: #fff4e6; }
.rp-meta-v { text-align: right; max-width: 65%; overflow-wrap: anywhere; font-weight: 500; }
.rp-meta-v a { color: #FF3D6E; text-decoration: none; }

/* 概览页「当前在线」卡片里的录像按钮 */
.lv-rec-btn { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 9999px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text); font-size: 0.72rem; font-weight: 600; text-decoration: none; margin-left: auto; }
.lv-rec-btn i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--text-dim); }
.lv-rec-btn.is-live i { background: var(--danger); animation: lv-blink 1.2s infinite; }
.lv-rec-btn + .lv-last { margin-left: 6px; }

/* 订单详情入口 */
.rp-order-entry .btn { text-decoration: none; }
.rp-order-count { font-weight: 400; color: var(--text-dim); font-size: 0.85rem; }

/* rrweb-player 控制条手机适配:进度条占满、时间显示收窄、按钮换行不溢出 */
.rp-stage .rr-timeline { width: 100% !important; padding: 0 6px; box-sizing: border-box; }
.rp-stage .rr-timeline__time { width: 52px !important; font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.rp-stage .rr-progress { height: 16px !important; }
.rp-stage .rr-controller { height: auto !important; min-height: 80px; padding: 6px 0; gap: 4px; }
.rp-stage .rr-controller__btns { flex-wrap: wrap; justify-content: center; row-gap: 4px; }
.rp-stage .rr-controller__btns .label { font-size: 0.8rem; margin: 0 6px; }

/* 0927 实时观看:rrweb.Replayer 直出,按访客视口等比缩放 */
.rp-stage .rp-live-screen { position: relative; overflow: hidden; margin: 0 auto; background: #f0f0f2; border-radius: 8px; box-shadow: 0 0 0 1px var(--border); max-width: 100%; }
.rp-stage .rp-live-root { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.rp-stage .rp-live-root .replayer-wrapper { box-shadow: none; position: relative; left: 0 !important; top: 0 !important; float: none !important; transform: none !important; margin: 0 !important; }
.rp-stage .rp-live-root iframe { border: 0; background: #fff; }

/* ── 手机全屏兜底(2026-09-27):iPhone 不支持元素全屏,改为铺满屏幕;竖持看横屏录像时转 90° ── */
html.rp-pfs-lock, html.rp-pfs-lock body { overflow: hidden !important; overscroll-behavior: none; }
#rp-stage.rp-pfs { position: fixed !important; top: 0 !important; left: 0 !important; z-index: 10050; background: #111; margin: 0 !important; padding: 0 !important; border-radius: 0 !important; max-width: none !important; display: block; }
#rp-stage.rp-pfs.rp-pfs-rot { transform-origin: top left; transform: rotate(90deg) translateY(-100%); }
#rp-stage.rp-pfs .rr-player { box-shadow: none !important; margin: 0 !important; border-radius: 0 !important; }
.rp-pfs-exit { position: absolute; top: 10px; right: 10px; z-index: 10060; width: 40px; height: 40px; border-radius: 20px; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 26px; line-height: 38px; padding: 0; cursor: pointer; }
