/* ============ H5 观看端：明亮主题 ============ */
:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --line: #e8eaed;
  --text: #1f2329;
  --sub: #8b919c;
  --brand: #ff3b5c;
  --brand2: #ff7a45;
  --link: #3a6df0;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* 兜底：凡用 hidden 属性控制显隐的元素，一律不显示（避免被 author 的 display 覆盖） */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
}

.room {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

/* ---------- 顶部栏 ---------- */
.top-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #e9ebef;
  color: #6b7280;
  flex: none;
}
.badge[data-status="1"] {
  background: linear-gradient(90deg, var(--brand), var(--brand2));
  color: #fff;
}
.badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; opacity: .9;
}
.badge[data-status="1"] .dot { animation: blink 1.2s infinite; }
@keyframes blink { 0%,100% { opacity: 1 } 50% { opacity: .25 } }

.top-bar .title {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-bar .online {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--sub);
}

/* ---------- 视频舞台 ---------- */
.stage {
  position: relative;
  width: 100%;
  flex: none;
  aspect-ratio: 16 / 9;
  max-height: 52vh;
  background: #000;
  overflow: hidden;
}
.stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
  pointer-events: none; /* 禁止任何点击交互（防误触起播/暂停） */
}
.stage video::-webkit-media-controls,
.stage video::-webkit-media-controls-enclosure,
.stage video::-webkit-media-controls-panel { display: none !important; opacity: 0 !important; }

.cover-layer { position: absolute; inset: 0; background: #1f2329; }
.cover-layer img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-layer .cover-mask {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, rgba(0,0,0,.12), rgba(0,0,0,.45));
}
.cover-text {
  font-size: 15px; color: #fff; letter-spacing: 1px;
  padding: 8px 16px; border-radius: 999px;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(4px);
}
.cover-layer[hidden] { display: none; }

.stage-loading {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-size: 13px; color: #fff; background: rgba(0,0,0,.5);
  padding: 6px 14px; border-radius: 999px;
}
.stage-loading[hidden] { display: none; }

.sound-btn {
  position: absolute;
  right: 10px; bottom: 10px;
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  color: #fff;
  background: rgba(0, 0, 0, .45);
  backdrop-filter: blur(4px);
}
.sound-btn[hidden] { display: none; }

/* ---------- 互动区 ---------- */
.chat { position: relative; flex: 1; min-height: 0; background: var(--bg); }
.chat-list {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-empty { color: var(--sub); font-size: 13px; text-align: center; padding: 24px 0; }

.chat-item {
  animation: slideUp .28s ease;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-all;
  align-self: flex-start;
  max-width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 7px 10px;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
.chat-item .nick { color: var(--link); margin-right: 6px; font-size: 13px; }
.chat-item .time { color: #aab0bb; font-size: 11px; margin-left: 6px; }
.chat-item .text { color: var(--text); }
.chat-item.mine { background: #fff4f6; border-color: #ffd9e1; }
.chat-item.mine .nick { color: var(--brand); }

.chat-new {
  position: absolute; left: 50%; bottom: 10px;
  transform: translateX(-50%);
  background: rgba(255, 59, 92, .92);
  color: #fff; font-size: 12px;
  padding: 5px 12px; border-radius: 999px;
  z-index: 5;
}
.chat-new[hidden] { display: none; }

/* ---------- 底部输入栏 ---------- */
.input-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px calc(8px + var(--safe-b));
  background: var(--panel);
  border-top: 1px solid var(--line);
}
.input-bar input {
  height: 38px;
  border: 1px solid var(--line);
  background: #f7f8fa;
  color: var(--text);
  border-radius: 999px;
  padding: 0 14px;
  font-size: 14px;
  outline: none;
}
.input-bar .nick-input { width: 78px; flex: none; }
.input-bar .msg-input { flex: 1; min-width: 0; }
.input-bar input::placeholder { color: #aab0bb; }

.send-btn {
  flex: none;
  height: 38px;
  padding: 0 16px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--brand2));
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
.send-btn:active { opacity: .85; }

.like-btn {
  flex: none;
  min-width: 62px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1px solid #ffd9e1;
  border-radius: 999px;
  background: #fff4f6;
  color: #ff3b5c;
  font-size: 13px;
}
.like-btn.pulse { animation: pulse .35s ease; }
@keyframes pulse { 0% { transform: scale(1) } 45% { transform: scale(1.18) } 100% { transform: scale(1) } }

/* ---------- 飘心 / 提示 ---------- */
.float-hearts { position: fixed; right: 16px; bottom: 90px; width: 60px; height: 240px; pointer-events: none; z-index: 20; }
.heart {
  position: absolute; right: 0; bottom: 0;
  font-size: 20px;
  animation: floatUp 2.4s ease-out forwards;
}
@keyframes floatUp {
  0% { opacity: 1; transform: translateY(0) scale(.8) }
  100% { opacity: 0; transform: translateY(-200px) scale(1.3) }
}

.toast {
  position: fixed; left: 50%; top: 42%;
  transform: translateX(-50%);
  background: rgba(31,35,41,.9); color: #fff;
  font-size: 13px; padding: 8px 16px; border-radius: 8px;
  z-index: 99;
}
.toast[hidden] { display: none; }

/* ---------- 平板/桌面 ---------- */
@media (min-width: 720px) {
  .room { max-width: 480px; margin: 0 auto; box-shadow: 0 0 40px rgba(0,0,0,.12); }
  body { background: #eceef1; }
}

/* ---------- 顶栏按钮（分享 / 登录） ---------- */
.top-bar .actions {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.top-btn {
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.top-btn:active { opacity: .85; }
.top-btn.primary {
  border: none;
  background: linear-gradient(90deg, var(--brand), var(--brand2));
  color: #fff;
  font-weight: 600;
}

/* ---------- 登录 / 注册弹窗 ----------
   已随「去掉登录」一并移除（无服务号无法获取用户信息）。
   如需恢复：见 docs/PLAN_wechat_login_share_report.md（HTML 结构 + 上述样式 + watch.js 里的登录逻辑）。 */
