/* 手机直播间 — 完整独立页面 */
.mobile-live-room {
  display: none;
}

.mobile-live-room:not([hidden]) {
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0;
  z-index: 200;
  width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  background: #f5f5f5;
}

body.auth-open #mobileLiveRoom,
body.gift-open #mobileLiveRoom {
  pointer-events: none;
}

body.auth-open .mobile-live-header,
body.auth-open .mobile-live-header * {
  pointer-events: auto;
}

body.auth-open .auth-modal:not([hidden]),
body.mobile-live-room-open.auth-open .auth-modal:not([hidden]) {
  z-index: 300 !important;
  pointer-events: auto;
}

body.auth-open .auth-dialog,
body.auth-open .auth-dialog * {
  pointer-events: auto;
}

body.mobile-live-room-open,
body:has(#mobileLiveRoom:not([hidden])) {
  overflow: hidden;
  overscroll-behavior: none;
}

body.mobile-live-room-open .page,
body.mobile-live-room-open .mobile-bottom-nav,
body.mobile-live-room-open .mobile-app-banner,
body.mobile-site.mobile-live-room-open .page,
body.mobile-site.mobile-live-room-open .mobile-bottom-nav,
body.mobile-site.mobile-live-room-open .mobile-app-banner,
body:has(#mobileLiveRoom:not([hidden])) .page,
body:has(#mobileLiveRoom:not([hidden])) .mobile-bottom-nav,
body:has(#mobileLiveRoom:not([hidden])) .mobile-app-banner {
  display: none !important;
}

/* 顶栏 */
.mobile-live-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: calc(44px + env(safe-area-inset-top));
  padding: calc(4px + env(safe-area-inset-top)) 10px 4px;
  background: #111;
  color: #fff;
}

.mobile-live-back {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.mobile-live-header__main {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.mobile-live-header__title {
  overflow: hidden;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mobile-live-header__sub {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mobile-live-header__link {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: #ffb600;
  color: #111;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

/* 视频区 */
.mobile-live-stage {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  height: 0;
  padding-top: 56.25%;
  background: #000;
  overflow: hidden;
}

.mobile-live-stage > video,
.mobile-live-stage > #liveVideo {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.mobile-live-stage .live-video-ticker {
  inset: 8px 0 54px;
  z-index: 5;
}

.mobile-live-stage .live-danmaku-item {
  height: 22px;
  max-width: 78%;
  padding: 0 9px;
  font-size: 13px;
  font-weight: 800;
}

.mobile-live-stage .video-message,
.mobile-live-stage #liveStatus {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 12px;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.5);
  color: #ffd65a;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}

.mobile-live-stage .video-message[hidden],
.mobile-live-stage #liveStatus[hidden] {
  display: none !important;
}

.mobile-live-stage .live-unmute-hint {
  position: absolute;
  right: 8px;
  bottom: 52px;
  left: 8px;
  z-index: 4;
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 13px;
  text-align: center;
}

.mobile-live-stage .live-unmute-hint[hidden] {
  display: none !important;
}

/* 视频底部控制条：声音 / 全屏 / 刷新 */
.mobile-live-stage .live-player-bar {
  display: flex !important;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.82) 38%, rgba(0, 0, 0, 0.94) 100%);
  pointer-events: auto;
  touch-action: manipulation;
}

.mobile-live-stage .live-player-bar__row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
}

.mobile-live-stage .live-player-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.mobile-live-stage .live-player-btn.is-muted {
  opacity: 0.72;
}

.mobile-live-stage .live-player-time,
.mobile-live-stage .live-quality-select,
.mobile-live-stage .live-player-progress,
.mobile-live-stage #livePlayPauseBtn {
  display: none !important;
}

.mobile-live-stage .live-player-spacer {
  flex: 1 1 auto;
}

.mobile-live-stage .live-volume-range {
  width: 56px;
  min-width: 48px;
  height: 4px;
  margin: 0;
  accent-color: #ffb600;
  touch-action: manipulation;
}

.mobile-live-room.is-expanded .mobile-live-stage .live-player-bar {
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}

.mobile-live-room.is-expanded .mobile-live-stage .live-player-btn {
  width: 42px;
  height: 42px;
  font-size: 18px;
}

.mobile-live-room.is-expanded .mobile-live-stage .live-volume-range {
  width: 72px;
}

/* 主播信息条 */
.mobile-live-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding: 10px 12px;
  background: #fff;
  border-bottom: 1px solid #eee;
}

.mobile-live-info__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #eee;
  flex: 0 0 auto;
}

.mobile-live-info__copy {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.mobile-live-info__copy b {
  overflow: hidden;
  font-size: 14px;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mobile-live-info__copy span {
  color: #888;
  font-size: 12px;
}

.mobile-live-info__follow {
  flex: 0 0 auto;
  min-width: 58px;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 16px;
  background: #ffb600;
  color: #111;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.mobile-live-info__follow.followed {
  background: #f0f0f0;
  color: #888;
}

/* Tab */
.mobile-live-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  flex: 0 0 auto;
  min-height: 40px;
  background: #fff;
  border-bottom: 1px solid #eee;
}

.mobile-live-tabs button {
  border: 0;
  background: transparent;
  color: #666;
  font-size: 14px;
  font-weight: 500;
  line-height: 40px;
  cursor: pointer;
}

.mobile-live-tabs button.active {
  color: #111;
  font-weight: 700;
  box-shadow: inset 0 -3px 0 #ffb600;
}

/* 聊天 */
.mobile-live-chat-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 8px 12px;
  background: #fff;
}

.mobile-live-chat-list .chat-item,
.mobile-live-chat-list .chat-message {
  margin-bottom: 6px;
  line-height: 1.45;
  font-size: 14px;
}

.mobile-live-chat-list .sys-message.sys-ad {
  color: #1677ff;
  font-size: 13px;
  line-height: 1.5;
}

.mobile-live-chat-list .level-badge.lv-1 { background: #8c8c8c; color: #fff; }
.mobile-live-chat-list .level-badge.lv-2 { background: #52c41a; color: #fff; }
.mobile-live-chat-list .level-badge.lv-3 { background: #1677ff; color: #fff; }
.mobile-live-chat-list .level-badge.lv-5 { background: #722ed1; color: #fff; }

.mobile-live-chat-list .level-badge,
.mobile-live-chat-list .level-badge.house-manager {
  display: inline-block;
  min-width: 34px;
  padding: 0 4px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  vertical-align: middle;
}

.mobile-live-chat-list .user-name { color: #666; font-weight: 600; }
.mobile-live-chat-list .chat-content { color: #222; }
.mobile-live-chat-list .chat-badge.zb.anchor-badge { background: #ff8c00; color: #fff; }

.mobile-live-guest-bar .live-chat-login-em { color: #1677ff; font-weight: 700; }

.mobile-live-anchor-panel,
.mobile-live-schedule-panel { padding: 12px; }

.mobile-live-anchor-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  background: #fafafa;
}

.mobile-live-anchor-card img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: #eee;
}

/* 输入框 */
.mobile-live-input-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px 44px;
  gap: 8px;
  flex: 0 0 auto;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid #eee;
  background: #fff;
}

.mobile-live-input-wrap.is-guest { grid-template-columns: 1fr; }
.mobile-live-input-wrap.is-guest .mobile-live-chat-input,
.mobile-live-input-wrap.is-guest .mobile-live-send-btn,
.mobile-live-input-wrap.is-guest .mobile-live-gift-btn { display: none; }
.mobile-live-input-wrap.is-guest .mobile-live-guest-bar { display: block; }

.mobile-live-guest-bar {
  display: none;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #e8e8e8;
  border-radius: 22px;
  background: #f5f5f5;
  color: #666;
  font-size: 16px;
  text-align: left;
  cursor: pointer;
}

.mobile-live-chat-input {
  height: 44px;
  padding: 0 14px;
  border: 1px solid #e8e8e8;
  border-radius: 22px;
  background: #f5f5f5;
  font-size: 16px;
  width: 100%;
  box-sizing: border-box;
}

.mobile-live-chat-input:focus {
  outline: none;
  border-color: #ffb600;
  background: #fff;
}

.mobile-live-send-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffd02b 0%, #f0b310 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.mobile-live-gift-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: #fff5e6;
  font-size: 24px;
  cursor: pointer;
}

/* 全屏 */
.mobile-live-room.is-expanded {
  background: #000;
}

.mobile-live-room.is-expanded .mobile-live-info,
.mobile-live-room.is-expanded .mobile-live-tabs,
.mobile-live-room.is-expanded .mobile-live-chat-list,
.mobile-live-room.is-expanded .mobile-live-input-wrap {
  display: none !important;
}

.mobile-live-room.is-expanded .mobile-live-header {
  display: flex !important;
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 20;
  min-height: calc(44px + env(safe-area-inset-top));
  padding-top: calc(4px + env(safe-area-inset-top));
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
}

.mobile-live-room.is-expanded .mobile-live-back,
.mobile-live-room.is-expanded .mobile-live-header__link {
  pointer-events: auto;
}

.mobile-live-room.is-expanded .mobile-live-header__main {
  opacity: 0;
  pointer-events: none;
}

.mobile-live-room.is-expanded .mobile-live-stage {
  flex: 1 1 0;
  width: 100%;
  min-height: 0;
  height: auto !important;
  padding-top: 0 !important;
  background: #000;
}

.mobile-live-room.is-expanded .mobile-live-stage > video,
.mobile-live-room.is-expanded .mobile-live-stage > #liveVideo {
  object-fit: contain;
  background: #000;
}

/* 20260708 mobile live-room polish */
@media (max-width: 760px) {
  .mobile-live-room:not([hidden]) {
    background: #f2f5f9;
  }

  .mobile-live-header {
    min-height: calc(48px + env(safe-area-inset-top));
    padding-inline: 8px 12px;
    background: #0f121a;
  }

  .mobile-live-back {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.1);
  }

  .mobile-live-header__link {
    border-radius: 8px;
    background: #f8c21b;
  }

  .mobile-live-stage {
    box-shadow: 0 8px 18px rgba(15, 18, 26, 0.18);
  }

  .mobile-live-stage .live-player-bar {
    padding-inline: 10px;
  }

  .mobile-live-stage .live-player-btn {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.16);
  }

  .mobile-live-info,
  .mobile-live-tabs,
  .mobile-live-chat-list,
  .mobile-live-input-wrap {
    background: #fff;
  }

  .mobile-live-info {
    padding: 11px 12px;
  }

  .mobile-live-info__copy b {
    color: #151a24;
    font-weight: 800;
  }

  .mobile-live-tabs {
    min-height: 42px;
  }

  .mobile-live-tabs button {
    line-height: 42px;
  }

  .mobile-live-chat-list {
    padding: 10px 12px;
  }

  .mobile-live-chat-list .chat-item,
  .mobile-live-chat-list .chat-message {
    margin-bottom: 8px;
  }

  .mobile-live-input-wrap {
    gap: 7px;
    border-top-color: rgba(17, 24, 39, 0.08);
  }

  .mobile-live-chat-input,
  .mobile-live-guest-bar {
    background: #f5f7fa;
  }
}
