/* TIKSNS 视频直播样式（独立文件，不改动现有 CSS） */

/* ===== 开播页 ===== */
.live-start-body { padding: 16px; }
.live-start-preview { position: relative; margin-bottom: 16px; }
.live-start-preview__hint {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; background: rgba(0,0,0,.55); font-size: 14px; border-radius: 12px;
}
.live-start-form .form-group { margin-bottom: 14px; }
.live-start-form .info-feedback { display: block; margin-top: 10px; color: #888; font-size: 12px; }

/* ===== 观看页 ===== */
.live-room-stage { background: #000; position: relative; }
.live-room-stage__bar {
  position: absolute; top: 10px; left: 10px; right: 10px; z-index: 5;
  display: flex; align-items: center; gap: 10px;
}
.live-room-stage__bar .sp-stage__pill { background: #f00; color: #fff; padding: 3px 10px; border-radius: 20px; font-size: 12px; }
.live-room-stage__bar .sp-stage__pill_ended { background: #777; }
.live-room-stage__bar .sp-stage__count { color: #fff; font-size: 12px; background: rgba(0,0,0,.4); padding: 3px 10px; border-radius: 20px; }
.live-room-player {
  position: relative; width: 100%; aspect-ratio: 16/9; background: #000;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.live-room-player video { width: 100% !important; height: 100% !important; object-fit: cover; }
.live-room-cover { width: 100%; height: 100%; object-fit: cover; opacity: .5; filter: blur(8px); }
.live-room-msg { position: absolute; color: #fff; font-size: 14px; }
.live-room-host { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--cl-body-bg, #fff); }
.live-room-host > img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.live-room-host__name { font-weight: 600; color: var(--cl-main-color, #333); }
.live-room-host__name span { color: inherit; }
.live-room-title { font-size: 13px; color: #888; margin-top: 2px; }
.live-room-title span { color: inherit; }

/* 礼物飘屏 */
.live-gift-float { position: absolute; left: 12px; bottom: 12px; z-index: 20; pointer-events: none; }
.live-gift-float__item {
  background: linear-gradient(90deg, rgba(255,90,120,.95), rgba(255,150,60,.95));
  color: #fff; padding: 6px 14px; border-radius: 20px; font-size: 13px; margin-top: 6px;
  animation: lvGiftIn .3s ease; box-shadow: 0 2px 10px rgba(0,0,0,.2);
}
.live-gift-float__item strong { color: #fff8a0; }
.live-gift-float__mine { background: linear-gradient(90deg, rgba(80,140,255,.95), rgba(120,90,255,.95)); }
@keyframes lvGiftIn { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: none; } }

/* 聊天/礼物面板 */
.live-room-panel { border-top: 1px solid #eee; }
.live-room-tabs { display: flex; border-bottom: 1px solid #eee; }
.live-room-tabs button { flex: 1; padding: 12px 0; background: none; border: none; color: #888; font-size: 14px; }
.live-room-tabs button.active { color: var(--cl-primary-color, #1d9bf0); border-bottom: 2px solid var(--cl-primary-color, #1d9bf0); font-weight: 600; }
.live-room-feed { min-height: 180px; max-height: 320px; overflow-y: auto; padding: 10px 14px; }
.live-feed-empty { color: #aaa; text-align: center; padding: 30px 0; font-size: 13px; }
.live-feed-item { display: flex; gap: 8px; margin-bottom: 10px; }
.live-feed-item > img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: 0 0 30px; }
.live-feed-item__body { font-size: 13px; line-height: 1.4; }
.live-feed-item__body b { color: var(--cl-primary-color, #1d9bf0); margin-right: 6px; }
.live-gift-panel, .live-room-gifts { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
.live-gift-item {
  width: 72px; padding: 8px 4px; background: #f7f7f7; border: 1px solid #eee; border-radius: 10px;
  text-align: center; cursor: pointer;
}
.live-gift-item img { width: 40px; height: 40px; object-fit: contain; }
.live-gift-item span { display: block; font-size: 11px; color: #555; margin-top: 4px; }
.live-gift-item b { display: block; font-size: 11px; color: #e0913a; margin-top: 2px; }
.live-room-send { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid #eee; }
.live-room-send .form-control { flex: 1; }
.x-hidden { display: none !important; }

/* ===== 列表页 ===== */
.lives-body { padding: 16px; }
.lives-go-live {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; background: var(--cl-primary-color, #1d9bf0); color: #fff;
  border-radius: 10px; text-decoration: none; font-weight: 600; margin-bottom: 16px;
}
.lives-go-live svg { width: 20px; height: 20px; fill: #fff; }
.lives-section-title { font-size: 15px; margin: 8px 0 12px; }
.lives-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.live-card { display: block; text-decoration: none; color: inherit; }
.live-card__thumb { position: relative; width: 100%; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; background: #000; }
.live-card__thumb > img { width: 100%; height: 100%; object-fit: cover; opacity: .75; }
.live-card__badge { position: absolute; top: 8px; left: 8px; background: #f00; color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.live-card__viewers { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,.5); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.live-card__meta { display: flex; gap: 8px; margin-top: 8px; }
.live-card__meta > img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: 0 0 34px; }
.live-card__title { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-card__title span, .live-card__name span { color: inherit; }
.live-card__name { font-size: 12px; color: #888; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lives-empty { text-align: center; color: #aaa; padding: 50px 0; }

@media (min-width: 768px) {
  .lives-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ===== 发布器 Live 下拉入口 ===== */
.lv-entry { position: relative; display: inline-flex; }
.lv-menu {
  display: none; position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  min-width: 150px; background: var(--cl-body-bg, #fff); border: 1px solid #e5e5e5;
  border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.15); z-index: 1050; overflow: hidden;
  padding: 6px 0;
}
.lv-menu.is-open { display: block; }
.lv-menu a {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  color: var(--cl-main-color, #333); text-decoration: none; font-size: 14px; white-space: nowrap;
}
.lv-menu a:hover { background: rgba(29,155,240,.08); }
.lv-menu__ic { display: inline-flex; width: 18px; height: 18px; }
.lv-menu__ic svg { width: 100%; height: 100%; fill: var(--cl-primary-color, #1d9bf0); }

/* ===== 直播间：主播头像挂件（光环 + 认证标）与结束按钮 ===== */
.live-room-host__ava {
  position: relative; display: inline-flex; width: 48px; height: 48px; flex: 0 0 48px;
  padding: 2px; border-radius: 50%; border: 2px solid transparent; box-sizing: border-box;
}
.live-room-host__ava img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.live-room-host__ava.is-live {
  border-color: #f4212e;
  animation: lv-host-pulse 2s ease-in-out infinite;
}
@keyframes lv-host-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(244,33,46,.45); }
  50%      { box-shadow: 0 0 0 5px rgba(244,33,46,0); }
}
.live-room-host__name { display: inline-flex; align-items: center; gap: 4px; }
.lv-verified { display: inline-flex; width: 15px; height: 15px; vertical-align: middle; }
.lv-verified svg { width: 100%; height: 100%; fill: #1d9bf0; }

.lv-end-btn {
  margin-left: auto; padding: 5px 14px; border: none; border-radius: 999px; cursor: pointer;
  background: #f4212e; color: #fff; font-size: 13px; font-weight: 600; line-height: 1.4;
}
.lv-end-btn:disabled { opacity: .6; cursor: default; }

/* ===== 全站头像直播挂件：圆形光环（绝不套方形框）===== */
/* 推文头像：holder 外层是方形容器，圆形光环画在 ::after 上贴合圆形头像 */
.avatar-holder-live {
  position: relative;
  border: 0 !important;
  animation: none !important;
}
.avatar-holder-live::after {
  content: ""; position: absolute; inset: 0;
  border: 2px solid #f4212e; border-radius: 100%; box-sizing: border-box;
  z-index: 1; pointer-events: none;
  animation: lv-ava-ring 2s ease-in-out infinite;
}
@keyframes lv-ava-ring {
  0%, 100% { box-shadow: 0 0 0 0 rgba(244,33,46,.45); }
  50%      { box-shadow: 0 0 0 5px rgba(244,33,46,0); }
}
.avatar-live-badge {
  position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%);
  background: #f4212e; color: #fff; font-size: 8px; font-weight: 800; line-height: 1;
  padding: 2px 6px; border-radius: 999px; letter-spacing: .5px; white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,.25); z-index: 2; pointer-events: none;
}

/* 个人主页头像：.avatar-image 本身即圆形，直接把它的边框染红 */
body.cl-app-profile .user-profile__header-avatar a.profile-avatar-live-link {
  display: block; position: relative;
}
body.cl-app-profile .user-profile__header-avatar div.profile-avatar-onair {
  border: 0 !important;
  animation: none !important;
}
body.cl-app-profile .user-profile__header-avatar div.profile-avatar-onair .avatar-image {
  border-color: #f4212e !important;
  animation: lv-ava-ring 2s ease-in-out infinite;
}
body.cl-app-profile .user-profile__header-avatar div.profile-avatar-onair .avatar-live-badge {
  left: 50%; bottom: -6px; font-size: 9px; padding: 3px 9px; border-radius: 999px;
}

/* ===== 开播页：摄像头授权引导卡（替代丑陋的默认提示） ===== */
.live-start-preview { position: relative; }
.live-start-preview__hint {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.55); border-radius: 12px; padding: 16px; text-align: center;
}
.lv-perm-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  max-width: 300px; color: #fff;
}
.lv-perm-card__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 50%; font-size: 26px;
  background: rgba(244,33,46,.18); border: 1px solid rgba(244,33,46,.5);
}
.lv-perm-card__title { font-size: 15px; font-weight: 700; }
.lv-perm-card__desc { font-size: 12px; line-height: 1.5; opacity: .85; }
.lv-perm-card.is-error .lv-perm-card__icon {
  background: rgba(255,170,0,.18); border-color: rgba(255,170,0,.6);
}

/* ===== 结束直播确认弹窗（自定义，替代浏览器 confirm） ===== */
.lv-confirm-overlay {
  position: fixed; inset: 0; z-index: 100000; display: none;
  align-items: center; justify-content: center; padding: 24px;
  background: rgba(0,0,0,.6); backdrop-filter: blur(3px);
}
.lv-confirm-overlay.is-open { display: flex; animation: lv-cf-fade .18s ease; }
@keyframes lv-cf-fade { from { opacity: 0; } to { opacity: 1; } }
.lv-confirm-box {
  width: 100%; max-width: 340px; background: #fff; color: #14171f;
  border-radius: 18px; padding: 24px 22px 18px; text-align: center;
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
  animation: lv-cf-pop .2s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes lv-cf-pop { from { transform: translateY(12px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.lv-confirm-icon {
  width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(244,33,46,.12); color: #f4212e;
}
.lv-confirm-icon span {
  font-size: 30px; font-weight: 800; line-height: 1;
  border: 3px solid #f4212e; border-radius: 50%; width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
}
.lv-confirm-title { font-size: 18px; font-weight: 800; margin: 0 0 8px; }
.lv-confirm-desc { font-size: 13px; line-height: 1.55; color: #657786; margin: 0 0 22px; }
.lv-confirm-actions { display: flex; gap: 10px; }
.lv-confirm-cancel, .lv-confirm-ok {
  flex: 1; border: 0; border-radius: 10px; padding: 12px 8px;
  font-size: 14px; font-weight: 700; cursor: pointer; transition: filter .15s;
}
.lv-confirm-cancel { background: #eff3f4; color: #14171f; }
.lv-confirm-ok { background: #f4212e; color: #fff; }
.lv-confirm-cancel:active, .lv-confirm-ok:active { filter: brightness(.92); }

/* 深色模式适配 */
body.dark-mode .lv-confirm-box,
body.cl-dark-mode .lv-confirm-box { background: #1c2733; color: #e7e9ea; }
body.dark-mode .lv-confirm-desc,
body.cl-dark-mode .lv-confirm-desc { color: #8b98a5; }
body.dark-mode .lv-confirm-cancel,
body.cl-dark-mode .lv-confirm-cancel { background: #2a3644; color: #e7e9ea; }

/* ===== 钱包礼物流水：直播间信息小字 ===== */
.wallet-live-gift-meta { display: block; font-size: 11px; color: var(--cl-secondary-text-color); margin-top: 2px; }
