/* ============================================================
   百莲凯直播间 · 观众端样式 v3（直角设计系统）
   横屏：文档式（舞台 + 菜单标签 + 互动/介绍面板）
   竖屏：全屏沉浸式（画面铺满 + 悬浮评论）
   色值：主色 #2F6BFF；直播中 #F5222D；未开始 #FA8C16；可回放 #22C55E
   全局 border-radius:0（仅圆形悬浮按钮例外）
   ============================================================ */
/* hidden 属性兜底：任何带 hidden 的元素必须 display:none，
   防止 .lr-intro-slide/.lr-cover 等的 display:flex 覆盖 UA 默认样式 */
[hidden] { display: none !important; }

:root {
  --brand: #2F6BFF;
  --brand-hover: #1E55E8;
  --brand-light: #EDF2FF;
  --brand-bright: #6B97FF;
  --live: #F5222D;
  --live-light: #FFF1F0;
  --live-border: #FFA39E;
  --wait: #FA8C16;
  --wait-light: #FFF7E6;
  --ok: #22C55E;
  --ok-deep: #16A34A;
  --ok-light: #EAFBF1;
  --danger: #EF4444;
  --notice-bg: #F59E0B;
  --notice-fg: #FCD34D;
  --t1: #1D2129;
  --t2: #4E5969;
  --t3: #86909C;
  --t4: #A0A6B0;
  --t5: #C9CDD4;
  --line: #E5E6EB;
  --line-2: #EFF0F3;
  --divider: #F2F3F5;
  --page: #F7F8FA;
}

body.lr-body {
  background: var(--page);
  color: var(--t1);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.lr-body.is-h { overflow-y: auto; overflow-x: hidden; }
body.lr-body.is-v { overflow: hidden; }

.lr { position: relative; background: var(--page); min-height: 100%; }
.is-v .lr { position: fixed; inset: 0; }

/* PC：内容居中限宽 */
@media (min-width: 900px) {
  .is-h .lr { max-width: 960px; margin: 0 auto; box-shadow: 0 1px 3px rgba(16,24,40,.06); }
  .is-v .lr { width: 420px; left: 50%; transform: translateX(-50%); }
}

/* ============ 舞台 ============ */
.lr-stage { position: relative; background: #000; overflow: hidden; }
.is-h .lr-stage { width: 100%; aspect-ratio: 16 / 9; }
.is-v .lr-stage { position: absolute; inset: 0; }
#video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; position: relative; z-index: 1; }
.is-v #video { object-fit: cover; }

/* 舞台全屏按钮（圆形悬浮，例外） */
.lr-fs-btn {
  position: absolute; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 9; width: 38px; height: 38px; padding: 0;
  border: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.4); color: #fff; cursor: pointer;
}
.lr-fs-btn:active { background: rgba(0,0,0,.6); }
/* 竖屏本身就是全屏画面，不需要全屏按钮（否则会躲在底部九宫格后面） */
.is-v .lr-fs-btn { display: none; }
/* 元素全屏态：舞台铺满屏幕，竖屏视频完整居中（两侧黑边，不裁剪） */
.lr-stage:fullscreen { width: 100%; height: 100%; background: #000; }
.lr-stage:-webkit-full-screen { width: 100%; height: 100%; background: #000; }
.lr-stage:fullscreen #video,
.lr-stage:-webkit-full-screen #video { object-fit: contain; }

/* 播放中卡顿缓冲提示 */
.lr-buffer {
  position: absolute; left: 50%; top: 50%; z-index: 10;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: rgba(0,0,0,.55); padding: 16px 20px;
  pointer-events: none;
}
.lr-buffer[hidden] { display: none; }
.lr-buffer-spin {
  width: 30px; height: 30px;
  border: 3px solid rgba(255,255,255,.28);
  border-top-color: var(--brand);
  animation: lrSpin .8s linear infinite;
}
.lr-buffer-text { font-size: 13px; color: #fff; }
@keyframes lrSpin { to { transform: rotate(360deg); } }

/* 舞台顶部信息 */
.lr-stage-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 8;
  display: flex; align-items: flex-start; gap: 8px;
  padding: max(10px, env(safe-area-inset-top)) 12px 30px;
  background: linear-gradient(180deg, rgba(0,0,0,.55), transparent);
}
.lr-head { flex: 1; min-width: 0; }
.lr-owner {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,.4); padding: 4px 11px 4px 4px;
}
.lr-owner-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.lr-owner-name { font-size: 12px; font-weight: 600; color: #fff; }

/* 右上角热度（在线人数/观看人次，由后台热度设置决定显隐） */
/* 右上角：抖音式头像堆（无背景）+ 在线人数（数字单独深色胶囊），整组可点 */
.lr-watchers {
  flex: 0 0 auto; display: inline-flex; align-items: center;
  gap: 6px; border: none; cursor: pointer;
  margin-top: 2px; padding: 0; background: transparent;
  color: #fff; white-space: nowrap;
}
.lr-avatar-pile { display: inline-flex; align-items: center; }
.lr-pile-item {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  overflow: hidden; margin-left: -11px;
  border: 1.5px solid rgba(255,255,255,.9);
  background: #6b6b73;
  box-sizing: border-box;
}
.lr-pile-item:first-child { margin-left: 0; }
.lr-pile-item img, .lr-pile-item i {
  display: block; border-radius: 50%; font-style: normal;
  color: #fff; text-align: center;
}
.lr-watchers-count {
  display: inline-flex; align-items: center;
  font-size: 15px; font-weight: 600; line-height: 1;
  color: #fff; background: rgba(0,0,0,.4);
  padding: 8px 11px; border-radius: 16px;
}
.lr-watchers .heat-pc { font-size: 11px; font-weight: 400; opacity: .85; padding-left: 3px; }

/* 状态标签（直角） */
.lr-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 600; padding: 2px 6px;
  background: rgba(255,255,255,.16); color: #fff;
}
.lr-pill.live { background: var(--live); color: #fff; }
.lr-pill.end { background: rgba(255,255,255,.18); color: #fff; }
.lr-pill.wait { background: var(--wait-light); color: var(--wait); }

/* 直播中红点 */
.dot-live {
  width: 6px; height: 6px; border-radius: 50%;
  background: #fff; display: inline-block;
  animation: lrPulse 1.2s infinite;
}
@keyframes lrPulse { 50% { opacity: .25; } }

/* 封面/状态层 */
.lr-cover {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px; gap: 10px;
  background: linear-gradient(160deg, #141722, #0a0c12);
  background-size: cover; background-position: center;
}
.lr-cover.has-img { justify-content: center; padding-bottom: 24px; }
.lr-cover > * { position: relative; z-index: 1; }
.lr-cover > .lr-cover-mask {
  position: absolute; inset: 0; z-index: 0;
  background: rgba(8,10,16,.55);
}
.lr-cover-sub { font-size: 13px; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.lr-count b { text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.lr-count i { text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.lr-count { display: flex; gap: 12px; }
.lr-count b { display: flex; flex-direction: column; align-items: center; font-size: 22px; }
.lr-count i { font-style: normal; font-size: 11px; color: var(--t4); }
.lr-big-btn {
  border: none; padding: 11px 28px;
  background: var(--brand);
  color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
}
.lr-big-btn:hover { background: var(--brand-hover); }
.lr-big-btn.ghost { background: rgba(255,255,255,.12); }
.lr-spin {
  width: 34px; height: 34px;
  border: 3px solid rgba(255,255,255,.15); border-top-color: var(--brand);
  animation: lrSpin .9s linear infinite;
}

/* 飘心（抖音式，页面级固定层：从下方点赞按钮位置向上飘满全屏并左右摆动） */
.lr-hearts { position: fixed; inset: 0; z-index: 25; pointer-events: none; overflow: hidden; }
.lr-heart {
  position: absolute; bottom: calc(108px + env(safe-area-inset-bottom)); font-size: 22px;
  --sway: 20px;
  will-change: transform, opacity;
  animation: lrFloat 2.8s ease-out forwards;
}
/* 文档式（横屏）：点赞按钮在 dock 上方，飘心从该位置起 */
.is-h .lr-heart { bottom: calc(66px + env(safe-area-inset-bottom)); }
@keyframes lrFloat {
  0% { transform: translate(0, 0) scale(.5) rotate(0deg); opacity: 0; }
  15% { opacity: 1; transform: translate(0, -10px) scale(1) rotate(0deg); }
  50% { transform: translate(calc(var(--sway) * -1), -40vh) scale(1.05) rotate(calc(var(--sway) * -0.35)); }
  100% { transform: translate(calc(var(--sway) * .45), -80vh) scale(1) rotate(calc(var(--sway) * 0.2)); opacity: 0; }
}

/* 轻提示 */
.lr-toast {
  position: absolute; left: 50%; bottom: 64px; z-index: 30;
  transform: translateX(-50%); max-width: 82%; text-align: center;
  background: rgba(0,0,0,.82); color: #fff; font-size: 13px;
  padding: 8px 16px;
}

/* 密码门（舞台内白色直角卡片） */
.lr-gate {
  position: absolute; inset: 0; z-index: 25;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 30px; text-align: center; background: #fff;
}
.lr-gate h2 { font-size: 18px; font-weight: 700; color: var(--t1); margin: 0; }
.lr-gate p { color: var(--t3); font-size: 13px; margin: 0; }
.lr-gate input {
  width: 100%; max-width: 280px; height: 42px; text-align: center;
  border: 1px solid var(--line); background: var(--page);
  color: var(--t1); padding: 0 14px; letter-spacing: 2px; box-sizing: border-box;
}
.lr-gate input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47,107,255,.12); }
.lr-gate .err { color: var(--live); font-size: 12px; }
.lr-btn {
  border: none; height: 40px; padding: 0 22px;
  background: var(--brand);
  color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
}
.lr-btn:hover { background: var(--brand-hover); }
.lr-btn:disabled { background: var(--divider); color: var(--t4); cursor: default; }

/* 实时回放条 */
.lr-rt-bar {
  position: absolute; top: 48px; left: 50%; z-index: 9;
  transform: translateX(-50%); display: flex; gap: 8px;
}
.lr-rt-bar button {
  border: none; padding: 6px 14px;
  background: rgba(0,0,0,.55); color: #fff; font-size: 12px; cursor: pointer;
}

/* ============ 舞台下：直播标题 ============ */
.lr-page-title { background: #fff; padding: 14px 16px 12px; }
.lr-page-title h2 {
  font-size: 17px; font-weight: 700; color: var(--t1); margin: 0;
  line-height: 1.4;
}
.lr-page-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 9px; }
.lr-page-time { font-size: 12px; color: var(--t3); }

/* 签到按钮（横屏 meta 行，直角蓝） */
.lr-sign-btn {
  flex: 0 0 auto; border: none; background: var(--brand); color: #fff;
  font-size: 11px; font-weight: 600; padding: 5px 13px; cursor: pointer;
}
.lr-sign-btn:hover { background: var(--brand-hover); }
.lr-sign-btn.checked { background: var(--divider); color: var(--t3); cursor: default; }

/* 竖屏悬浮签到圆钮（圆形例外） */
.lr-side-sign {
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(0,0,0,.4); border: 1px solid rgba(255,255,255,.25);
  color: #fff; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.lr-side-sign.checked { background: rgba(34,197,94,.85); border-color: rgba(34,197,94,.85); cursor: default; }
/* 竖屏签到圆钮仅在竖屏展示；横屏/PC 用标题行蓝色签到按钮 */
.is-h .lr-side-sign { display: none; }

/* PC 聊天面板标题（窄屏隐藏） */
.lr-chat-head { display: none; }

/* ============ 横屏：菜单标签 ============ */
.lr-tabbar {
  display: flex; gap: 22px; padding: 0 16px;
  background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.lr-tab {
  border: none; background: none; color: var(--t3); font-size: 13px; font-weight: 500;
  padding: 12px 4px; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer;
}
.lr-tab.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.is-v .lr-tabbar { display: none; }

/* ============ 面板 ============ */
.lr-panels { position: relative; padding-bottom: 88px; background: var(--page); }
.lr-panel { display: none; }
.lr-panel.on { display: block; }

.lr-notice {
  display: flex; gap: 8px; margin: 10px 12px 6px;
  padding: 8px 12px; background: var(--wait-light); font-size: 12px;
  color: #B45309; line-height: 1.6;
}
.lr-notice .ico { flex: 0 0 auto; }
/* 竖屏：公告压在视频上，用半透明琥珀底 + 黄字 */
.is-v .lr-notice {
  background: rgba(245,158,11,.25); color: var(--notice-fg);
  text-shadow: 0 1px 2px rgba(0,0,0,.5); margin: 0 0 4px;
}
.lr-pinned {
  display: flex; gap: 8px; margin: 8px 12px;
  padding: 8px 12px; background: #FFFBEB; border: 1px solid #FDE68A;
  font-size: 12px; color: #4A3D1A;
}
.lr-pinned-item b { color: var(--wait); margin-right: 6px; }

/* 消息列表 */
.lr-msgs { padding: 14px 12px 4px; }
.is-h .lr-msgs { height: 40vh; min-height: 230px; max-height: 440px; overflow-y: auto; }
.lr-empty { text-align: center; color: var(--t4); font-size: 13px; padding: 30px 0; }

/* 评论：统一无背景、无圆角，昵称在上、内容在下 */
.lr-msg { display: flex; gap: 8px; margin-bottom: 13px; align-items: flex-start; }
.lr-msg .av {
  width: 32px; height: 32px; flex: 0 0 auto; border-radius: 50%; object-fit: cover; background: var(--divider);
}
.lr-msg .bd { min-width: 0; }
.lr-msg .nm { font-size: 11px; color: var(--t3); margin-bottom: 3px; line-height: 1.4; }
.lr-msg .ct {
  font-size: 13px; line-height: 1.45; color: var(--t1); word-break: break-word;
}
/* 自己发的评论：无气泡，文字蓝色右对齐 */
.lr-msg.mine { flex-direction: row-reverse; }
.lr-msg.mine .ct { color: var(--brand); text-align: right; }
/* 系统/公告/点赞类消息 */
.lr-msg.hidden { display: none; }
.lr-msg.notice, .lr-msg.sys, .lr-msg.like { background: transparent; }
.lr-msg.notice .ct, .lr-msg.sys .ct { color: var(--t3); font-size: 12px; }
.lr-msg.like .ct { color: var(--live); font-size: 12px; }

/* 竖屏：面板容器不建立定位上下文、不占高度（否则 #panel-chat 会以塌陷的
   .lr-panels 为定位基准，bottom:74px 反而把评论顶到画面左上角）。
   改为让 #panel-chat 以 .is-v .lr（fixed inset:0）为基准，正确浮在左下角。 */
.is-v .lr-panels { position: static; padding-bottom: 0; background: transparent; }

/* 竖屏：评论悬浮在画面左下（对齐微赞直播） */
.is-v #panel-chat {
  position: absolute; left: 12px; right: 88px; bottom: 74px; z-index: 9; display: block;
  background: transparent;
}
.is-v #panel-chat[hidden] { display: none; }
.is-v .lr-msgs {
  padding: 4px 0; max-height: 328px; overflow-y: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 46px);
  mask-image: linear-gradient(180deg, transparent, #000 46px);
}
.is-v .lr-msgs::-webkit-scrollbar { display: none; }
/* 竖屏评论：半透明深色圆角胶囊，昵称与内容同一行；无头像 */
.is-v .lr-msg {
  display: flex; align-items: center; gap: 0; margin-bottom: 6px; width: fit-content;
  max-width: 100%; padding: 5px 10px; border-radius: 14px;
  background: rgba(255,255,255,0.1);
}
.is-v .lr-msg .av { display: none; }
.is-v .lr-msg .bd {
  display: flex; flex-wrap: wrap; align-items: baseline; min-width: 0;
}
.is-v .lr-msg .nm {
  display: inline; font-size: 14px; font-weight: 400; line-height: 1.4;
  margin: 0 5px 0 0; color: #8CC5FF;
}
.is-v .lr-msg .ct {
  display: inline; font-size: 14px; line-height: 1.4; color: #fff;
}
/* 管理员橙色小标签 */
.is-v .badge-admin {
  display: inline-flex; align-items: center; flex: 0 0 auto;
  margin: 0 6px 0 0; padding: 1px 6px; border-radius: 5px;
  font-size: 11px; line-height: 1.5; color: #fff;
  background: linear-gradient(180deg, #FFA624, #FF7A00);
}
.is-v .lr-msg.mine { flex-direction: row; }
.is-v .lr-msg.mine .ct { color: #fff; text-align: left; }
/* 系统/点赞/公告类消息：无胶囊，浅色文字带阴影 */
.is-v .lr-msg.sys, .is-v .lr-msg.like, .is-v .lr-msg.notice {
  background: transparent; padding: 0; border-radius: 0;
}
.is-v .lr-msg.sys .ct, .is-v .lr-msg.like .ct, .is-v .lr-msg.notice .ct {
  font-size: 12px; color: rgba(255,255,255,0.8); text-shadow: 0 1px 3px rgba(0,0,0,.7);
}

/* 快捷评论 */
.lr-quick { display: flex; gap: 8px; padding: 6px 12px; overflow-x: auto; }
.lr-quick-btn {
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--page);
  color: var(--t2); font-size: 12px; padding: 5px 12px;
}
.is-v .lr-quick { display: none; }

/* 广告位 */
.lr-ad { position: relative; margin: 10px 12px; overflow: hidden; }
.lr-ad img { width: 100%; display: block; }
.lr-ad #adClose {
  position: absolute; top: 6px; right: 8px; width: 24px; height: 24px;
  border: none; background: rgba(0,0,0,.5); color: #fff; cursor: pointer;
}

/* 直播介绍文档 */
.lr-intro-doc { padding: 16px 16px 30px; font-size: 14px; line-height: 1.8; color: var(--t2); }
.lr-intro-doc p { margin: 8px 0; }
.lr-intro-doc img { max-width: 100%; margin: 8px 0; }
.lr-intro-doc video { max-width: 100%; height: auto; margin: 8px 0; }
.lr-intro-doc h3 { font-size: 17px; margin: 16px 0 8px; color: var(--t1); }
.lr-intro-doc ul, .lr-intro-doc ol { padding-left: 22px; margin: 8px 0; }
.lr-intro-doc blockquote {
  border-left: 3px solid var(--brand); margin: 10px 0; padding: 2px 14px;
  color: var(--t3); background: var(--brand-light);
}
.lr-intro-doc a { color: var(--brand); }

/* 竖屏：介绍滑层（白底） */
.lr-intro-slide {
  position: absolute; inset:0; z-index: 40;
  display: flex; flex-direction: column;
  background: #fff; padding-top: env(safe-area-inset-top);
}
.lr-intro-slide-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 15px;
  color: var(--t1);
}
.lr-intro-slide-head button {
  width: 32px; height: 32px; border: none;
  background: var(--divider); color: var(--t2); font-size: 18px; cursor: pointer;
}
.lr-intro-slide .lr-intro-doc { flex: 1; overflow-y: auto; }

/* ============ 底部固定输入栏（横屏白底；竖屏覆盖视频保持深色） ============ */
.lr-dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid var(--line);
}
.is-v .lr-dock {
  background: linear-gradient(to top, rgba(0,0,0,.6), transparent);
  border-top: none;
}
@media (min-width: 900px) {
  .is-h .lr-dock { max-width: 960px; left: 50%; transform: translateX(-50%); }
  .is-v .lr-dock { width: 420px; left: 50%; transform: translateX(-50%); right: auto; }
}
.lr-dock > input[type="text"] {
  flex: 1; height: 38px;
  border: 1px solid var(--line); background: var(--page);
  color: var(--t1); padding: 0 12px; font-size: 13px; box-sizing: border-box;
}
.lr-dock > input[type="text"]:focus { outline: none; border-color: var(--brand); }
.is-v .lr-dock > input[type="text"] {
  border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.16); color: #fff;
}
.lr-dock > input[type="text"]::placeholder { color: var(--t4); }
.is-v .lr-dock > input[type="text"]::placeholder { color: rgba(255,255,255,.75); }
.lr-dock .lr-btn { height: 38px; padding: 0 16px; }

/* 表情按钮：默认隐藏，输入框聚焦（输入法弹出）后才显示在输入框左侧 */
.lr-emoji-btn {
  flex: 0 0 auto; width: 38px; height: 38px; padding: 0;
  display: none; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--t2); cursor: pointer;
}
.lr-emoji-btn.show { display: flex; }
.is-v .lr-emoji-btn { color: rgba(255,255,255,.9); }
.lr-emoji-btn:active { opacity: .6; }

/* 表情面板：从 dock 顶部向上弹出，emoji 网格 */
.lr-emoji-panel {
  position: absolute; left: 0; right: 0; bottom: 100%;
  z-index: 21; max-height: 240px; overflow-y: auto;
  background: #fff; border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(16,24,40,.12);
  padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
}
.is-v .lr-emoji-panel {
  background: rgba(24,24,27,.96); border-top-color: rgba(255,255,255,.12);
}
.lr-emoji-grid {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px;
}
.lr-emoji-cell {
  aspect-ratio: 1; padding: 0; border: none; background: transparent;
  font-size: 22px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
}
.lr-emoji-cell:active { background: var(--divider); }
.is-v .lr-emoji-cell:active { background: rgba(255,255,255,.14); }

/* 点赞按钮（页面级固定，圆形悬浮例外）：竖屏沉浸式在右侧，文档式在 dock 上方 */
.lr-side-actions {
  position: fixed; right: 14px; z-index: 30;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  bottom: calc(120px + env(safe-area-inset-bottom));
}
.lr-side-like {
  position: relative; width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%;
  background: var(--brand); color: #fff;
  box-shadow: 0 6px 16px rgba(47,107,255,.45);
  cursor: pointer; transition: transform .12s ease;
}
.lr-side-like:active { transform: scale(1.25); }
.lr-side-like svg { width: 22px; height: 22px; }
.lr-side-like .n {
  position: absolute; top: -5px; right: -5px;
  font-size: 10px; font-style: normal; line-height: 16px;
  background: var(--live); color: #fff; border-radius: 10px; padding: 0 5px;
  border: 1.5px solid #fff;
}
/* 文档式（横屏）：点赞按钮移到舞台下方、dock 上方右侧，不再与全屏按钮重叠 */
.is-h .lr-side-actions { bottom: calc(54px + env(safe-area-inset-bottom) + 12px); right: 14px; }
/* PC 端：悬浮红色爱心（设计稿 08） */
@media (min-width: 900px) {
  .is-h .lr-side-like {
    background: linear-gradient(135deg, #FF5A5F, var(--live));
    box-shadow: 0 6px 16px rgba(245,34,45,.4);
  }
}

/* 静音时的“点击开启声音”悬浮按钮（圆形例外） */
.lr-sound-btn {
  position: absolute; left: 14px; z-index: 12;
  bottom: calc(120px + env(safe-area-inset-bottom));
  width: 42px; height: 42px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.5); color: #fff;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.is-h .lr-sound-btn { bottom: 64px; }

.lr-grid-btn {
  flex: 0 0 auto; width: 38px; height: 38px;
  border: 1px solid var(--line); background: var(--page); color: var(--t2); font-size: 18px;
  cursor: pointer;
}
.is-v .lr-grid-btn { border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.16); color: #fff; }

/* ============ 底部弹层（分享/榜单/管理） ============ */
.lr-sheet-mask {
  position: fixed; inset: 0; z-index: 60;
  display: none; align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,.62);
}
.lr-sheet-mask.show { display: flex; }
.lr-sheet {
  width: 100%; max-height: 82vh; overflow-y: auto;
  background: #fff; color: var(--t1);
  padding: 18px 16px calc(20px + env(safe-area-inset-bottom));
}
.lr-sheet h3 { font-size: 16px; font-weight: 600; text-align: center; margin: 0 0 14px; }
@media (min-width: 900px) {
  .lr-sheet-mask { align-items: center; }
  .lr-sheet { max-width: 480px; }
}

/* 在线观众列表（抖音式底部弹层，无贡献榜标签横栏） */
.lr-viewers-sheet {
  border-radius: 16px 16px 0 0;
  padding: 0; max-height: 72vh;
}
.lr-viewers-head {
  position: relative; display: flex; align-items: center; justify-content: center;
  padding: 16px 16px 12px;
}
.lr-viewers-head h3 { margin: 0; font-size: 16px; font-weight: 600; text-align: center; }
.lr-viewers-close {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border: none; border-radius: 50%;
  background: rgba(0,0,0,.06); color: #666; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.lr-viewers-list {
  max-height: calc(72vh - 56px); overflow-y: auto;
  padding: 4px 16px calc(20px + env(safe-area-inset-bottom));
}
.lr-viewer-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.lr-viewer-rank {
  width: 24px; flex: 0 0 24px; text-align: center;
  font-size: 15px; font-weight: 600; color: #b8b8b8;
}
.lr-viewer-rank.r1 { color: #ff2e4d; }
.lr-viewer-rank.r2 { color: #ff7a00; }
.lr-viewer-rank.r3 { color: #ffb000; }
.lr-viewer-av {
  width: 42px; height: 42px; flex: 0 0 42px;
  border-radius: 50%; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  background: #d8d8de;
}
.lr-viewer-av img, .lr-viewer-av i {
  display: block; border-radius: 50%; font-style: normal; color: #fff; text-align: center;
}
.lr-viewer-name {
  flex: 1; font-size: 15px; color: #222; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (min-width: 900px) {
  .lr-viewers-sheet { max-width: 480px; border-radius: 16px; }
}
.lr-link { display: none; }
.lr-sheet .copy-row { display: flex; gap: 8px; margin-bottom: 14px; }
.lr-sheet .copy-row input {
  flex: 1; height: 40px;
  border: 1px solid var(--line); background: var(--page);
  color: var(--t2); padding: 0 12px; font-size: 12px; box-sizing: border-box;
}
.lr-sheet .copy-row button {
  height: 40px; border: none;
  background: var(--brand); color: #fff; padding: 0 16px; font-size: 13px; cursor: pointer;
}
.lr-qr { display: flex; justify-content: center; margin: 6px 0 12px; }
.lr-qr img, .lr-qr canvas { border: 1px solid var(--line); background: #fff; padding: 6px; }

.lr-rank-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.lr-rank-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--page); padding: 10px 14px; font-size: 14px;
  color: var(--t1);
}
.lr-rank-row .pos { width: 28px; text-align: center; }
.lr-rank-row .nm { flex: 1; }
.lr-rank-row.top .nm { color: var(--wait); font-weight: 600; }
.lr-rank-row .val { color: var(--t3); font-size: 12px; }

/* ============ 管理员面板（行式列表，无标题） ============ */
.lr-msg-sheet { text-align: left; }
.ap-panel {
  text-align: left; background: #fff;
  padding: 0; max-height: 88vh;
}
/* 顶部：数据概览 + 关闭 */
.ap-top {
  position: relative;
  display: flex; align-items: center;
  padding: 16px 48px 14px 16px;
  border-bottom: 1px solid var(--divider);
}
.ap-stats { display: flex; gap: 24px; flex: 1 1 auto; }
.ap-stat { display: flex; flex-direction: column; gap: 3px; }
.ap-stat b { font-size: 21px; font-weight: 600; color: var(--t1); line-height: 1.1; }
.ap-stat span { font-size: 12px; color: var(--t3); }
.ap-close {
  position: absolute; top: 10px; right: 10px;
  width: 32px; height: 32px; border: none; background: transparent;
  color: var(--t3); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.ap-close:hover { color: var(--t1); background: var(--page); }

/* 分组 */
.ap-group { padding: 14px 0 0; }
.ap-label { padding: 0 16px; font-size: 12px; color: var(--t3); margin-bottom: 6px; }
.ap-rows { border-top: 1px solid var(--divider); border-bottom: 1px solid var(--divider); background: #fff; }
.ap-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; border: none; border-bottom: 1px solid var(--divider);
  background: #fff; padding: 12px 16px;
  font-size: 14px; color: var(--t1); text-align: left;
  cursor: pointer; text-decoration: none;
}
.ap-row:last-child { border-bottom: none; }
.ap-row:hover { background: var(--page); }
.ap-ri { flex: 0 0 auto; color: var(--t2); display: flex; }
.ap-rl { flex: 1 1 auto; }
.ap-rs { flex: 0 0 auto; font-size: 13px; color: var(--t3); }
.ap-rs.on { color: var(--brand); }
.ap-rs-muted { color: var(--t4); }
.ap-arrow { flex: 0 0 auto; color: var(--t4); font-size: 19px; line-height: 1; }
.ap-badge {
  display: none; min-width: 18px; height: 18px; padding: 0 5px;
  background: #e03131; color: #fff;
  font-size: 11px; line-height: 18px; text-align: center;
}
.ap-row-danger { color: #e03131; }
.ap-row-danger .ap-ri { color: #e03131; }
.ap-row-danger.disabled { opacity: .5; pointer-events: none; }

/* 详情展开区 */
.ap-detail { background: var(--page); padding: 2px 16px; border-bottom: 1px solid var(--divider); }
.ap-detail-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 9px 0; font-size: 13px; border-bottom: 1px solid var(--divider);
}
.ap-detail-row:last-child { border-bottom: none; }
.ap-detail-row span { color: var(--t3); flex: 0 0 auto; }
.ap-detail-row b { font-weight: 500; text-align: right; word-break: break-all; }

/* 待审核评论列表 */
.ap-pending-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--divider);
}
.ap-pending-row:last-child { border-bottom: none; }
.ap-pending-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.ap-pending-body b { font-size: 13px; font-weight: 600; color: var(--t1); }
.ap-pending-body span { font-size: 13px; color: var(--t2); word-break: break-all; }
.ap-pending-btns { display: flex; gap: 6px; flex: 0 0 auto; }
.ap-pb {
  border: 1px solid var(--line); background: #fff; padding: 6px 12px;
  font-size: 13px; cursor: pointer; color: var(--t2);
}
.ap-pb.ok { border-color: var(--brand); color: var(--brand); }
.ap-pb.no { border-color: #e03131; color: #e03131; }

/* 管理员可见已隐藏评论（半透明标记），普通观众完全隐藏 */
.room-admin .lr-msg.hidden { display: flex; opacity: .45; }
.room-admin .lr-msg.hidden .ct::before { content: "已隐藏 · "; color: #e03131; }

/* 二次确认视图（删除/禁言，替代原生 confirm） */
.lr-confirm-msg {
  margin-bottom: 16px; padding: 0 4px;
  font-size: 15px; line-height: 1.6; color: var(--t2); text-align: center;
}
.lr-btn-danger { width: 100%; height: 44px; margin-bottom: 10px; background: var(--danger); }
.lr-btn-danger:hover { background: #dc2626; }
.lr-btn-ghost {
  width: 100%; height: 44px;
  background: #fff; color: var(--t2);
  border: 1px solid var(--line);
}
.lr-btn-ghost:hover { background: var(--page); }

/* ============ 黑色操作框（点击评论 / 头像昵称） ============ */
.dark-mask {
  position: fixed; inset: 0; z-index: 9000;
  display: none; align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,.45);
}
.dark-mask.show { display: flex; }
.dark-sheet {
  width: 100%; max-width: 480px;
  background: #1F2024;
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 8px 0 calc(10px + env(safe-area-inset-bottom));
}
.dark-title {
  padding: 10px 18px 12px; font-size: 13px; color: rgba(255,255,255,.5);
  text-align: center; word-break: break-all;
}
.dark-actions { background: #2A2B30; margin: 0 10px; }
.dark-act {
  display: block; width: 100%; border: none; background: transparent;
  padding: 14px 18px; font-size: 16px; color: #fff;
  text-align: center; cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.dark-act:last-child { border-bottom: none; }
.dark-act:active { background: rgba(255,255,255,.08); }
.dark-act.danger { color: #FF4D4F; }
.dark-cancel {
  display: block; width: calc(100% - 20px); margin: 8px 10px 0;
  border: none; background: #2A2B30; color: #fff;
  padding: 14px; font-size: 16px; cursor: pointer;
}
.dark-cancel:active { background: #35363C; }
@media (min-width: 900px) {
  .dark-mask { align-items: center; }
  .dark-sheet { max-width: 420px; }
}

/* ============ 输入弹窗（修改本场昵称） ============ */
.lr-prompt-wrap { margin-bottom: 8px; }
.lr-prompt-input {
  width: 100%; box-sizing: border-box; height: 44px;
  border: 1px solid var(--line); background: #fff;
  padding: 0 12px; font-size: 15px; color: var(--t1);
}
.lr-prompt-input:focus { outline: none; border-color: var(--brand); }
.lr-prompt-hint { margin: 0 0 16px; font-size: 12px; color: var(--t3); text-align: center; }

/* ============ 直播密码门（live_gate.ejs：微信授权引导页，直角浅色卡片） ============ */
.gate-page {
  min-height: 100vh; box-sizing: border-box; margin: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--page); padding: 24px;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.gate-box {
  width: 100%; max-width: 380px; background: #fff;
  border: 1px solid var(--line-2); padding: 36px 28px; text-align: center;
  box-shadow: 0 1px 3px rgba(16,24,40,.06);
}
.gate-box .logo { font-size: 40px; line-height: 1; }
.gate-box h1 { font-size: 19px; font-weight: 700; color: var(--t1); margin: 16px 0 6px; }
.gate-box .sub { font-size: 13px; color: var(--t3); line-height: 1.8; margin: 8px 0; }
.gate-box .sub b { color: var(--t1); }
.gate-qr { display: flex; justify-content: center; margin: 20px 0 4px; }
.gate-qr canvas, .gate-qr img { padding: 8px; border: 1px solid var(--line); background: #fff; }
.gate-box .copy-row { display: flex; gap: 8px; margin: 16px 0; }
.gate-box .copy-row input {
  flex: 1; height: 38px; min-width: 0;
  border: 1px solid var(--line); background: var(--page);
  color: var(--t2); padding: 0 12px; font-size: 12px; box-sizing: border-box;
}
.gate-box .copy-row button {
  height: 38px; border: none; background: var(--brand); color: #fff;
  padding: 0 16px; font-size: 13px; cursor: pointer;
}
.gate-box .copy-row button:hover { background: var(--brand-hover); }
.gate-tip { font-size: 12px; color: var(--t4); line-height: 1.8; margin: 12px 0 0; }
.gate-box .err { color: var(--live); font-size: 12px; margin-top: 4px; }

/* ============ PC 宽屏（≥1024px）：左右双栏 ============ */
@media (min-width: 1024px) {
  .is-h .lr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    column-gap: 16px;
    max-width: 1400px;
    margin: 0 auto;
    box-shadow: 0 1px 3px rgba(16,24,40,.06);
  }
  /* 让面板包裹层消失，两个 section 直接进网格（仅横屏；竖屏保持手机浮层） */
  .is-h .lr-panels { display: contents; }
  .is-h .lr-page-title { grid-column: 1; grid-row: 1; }
  .is-h .lr-stage { grid-column: 1; grid-row: 2; }
  .is-h .lr-tabbar { grid-column: 1; grid-row: 3; }
  /* PC 下聊天固定在右栏，左栏只保留"直播介绍"标签 */
  .is-h .lr-tab[data-panel="chat"] { display: none; }
  .is-h #panel-intro.on { grid-column: 1; grid-row: 4; }

  /* 右栏：聊天互动（独立卡片，顶部拉到页面顶部、与标题栏顶部对齐，底部与舞台底部对齐，
     与视频框之间靠 column-gap 留间隙） */
  .is-h .lr-chat-head {
    flex: 0 0 auto; display: flex; flex-direction: column; justify-content: center;
    text-align: center; padding: 0 18px;
    height: 85px; box-sizing: border-box;
    font-size: 16px; font-weight: 700; color: var(--brand);
    background: #fff; border-bottom: 1px solid var(--line);
  }
  .is-h .lr-chat-head::after { display: none; }
  .is-h #panel-chat.on {
    /* 右栏贯穿标题行与舞台行：顶部与标题栏顶部对齐、底部与舞台底部对齐；
       消息区在面板内部滚动，不撑高 grid。padding-bottom 为底部输入栏预留空间。 */
    grid-column: 2;
    grid-row: 1 / span 2;
    display: flex; flex-direction: column;
    box-sizing: border-box;
    min-height: 0;
    overflow: hidden;
    background: #fff; border: 1px solid var(--line);
    padding-bottom: 58px;
  }
  .is-h #panel-chat .lr-msgs {
    flex: 1 1 0; min-height: 0;
    height: auto; max-height: none; overflow-y: auto;
    padding: 16px 18px 12px;
  }
  .is-h #panel-chat .lr-msg { gap: 0; margin-bottom: 13px; }
  .is-h #panel-chat .lr-msg .av { display: none; }
  .is-h #panel-chat .lr-msg .nm { display: block; font-size: 12px; color: var(--t4); margin-bottom: 3px; }
  .is-h #panel-chat .lr-msg .ct { display: block; font-size: 13px; line-height: 1.45; }
  .is-h #panel-chat .lr-msg.mine { flex-direction: row; }
  .is-h #panel-chat .lr-msg.mine .ct { text-align: left; }

  .is-h #panel-chat .lr-notice { margin: 0 0 8px; }
  .is-h #panel-chat .lr-pinned { margin: 0 0 8px; }
  .is-h #panel-chat .lr-ad { margin: 0 18px 10px; }
  .is-h #panel-chat .lr-quick { padding: 6px 18px 10px; }

  .is-h .lr-dock {
    /* 底部输入栏：贯穿右栏两行，贴在舞台底部（与舞台底部对齐），不固定到视口。
       用 relative（而非 static）：仍是网格项不脱离布局，同时作为表情面板
       absolute 定位的包含块，否则面板会向上找到顶层祖先、跑到页面顶部。 */
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: end;
    position: relative;
    left: auto; right: auto; transform: none;
    max-width: none;
    width: 100%;
    box-sizing: border-box;
    border-top: 1px solid var(--divider); background: #fff;
    height: 58px; padding: 10px 12px;
  }
  /* 点赞按钮移出聊天消息区：放到舞台（视频）右下角，飘心从视频画面向上飘 */
  .is-h .lr-side-actions {
    grid-column: 1; grid-row: 2;
    position: relative;
    align-self: end; justify-self: end;
    margin: 0 18px 18px 0;
    z-index: 6;
  }
}

/* ============ 手机窄屏（<900px）：竖屏顶部信息去掉透明黑底 ============ */
/* 用户要求：百莲凯官方直播间、直播中、N人在线这几个元素的透明黑背景在手机端去掉，
   直接以白色文字+阴影压在视频画面上；PC 宽屏（≥900px）保留黑色胶囊背景。 */
@media (max-width: 899px) {
  .is-v .lr-stage-top { background: transparent; }
  .is-v .lr-owner {
    background: transparent; padding: 0;
    text-shadow: 0 1px 3px rgba(0,0,0,.7);
  }
  .is-v .lr-owner-name { text-shadow: 0 0 12px rgba(0,0,0,.7); }
  .is-v .lr-watchers { margin-top: 4px; }
}
