:root {
  --accent: #6366f1;
  --accent2: #8b5cf6;
  --accent3: #ec4899;
  --accent-grad: linear-gradient(135deg, #6366f1, #8b5cf6 55%, #ec4899);
  --accent-grad-soft: linear-gradient(135deg, #818cf8, #a78bfa);
  --bg: #eef1f8;
  --panel: #ffffff;
  --border: #eaeaef;
  --text: #1f2430;
  --muted: #8a93a6;
  --danger: #ef4444;
  --shadow: 0 18px 50px rgba(31, 38, 64, .12);
  --shadow-sm: 0 6px 18px rgba(31, 38, 64, .08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}
/* 动态渐变光斑背景 */
body::before, body::after {
  content: ""; position: fixed; z-index: -1; border-radius: 50%;
  filter: blur(90px); opacity: .55; pointer-events: none;
}
body::before {
  width: 60vw; height: 60vw; top: -18vw; left: -10vw;
  background: radial-gradient(circle at 30% 30%, #c4b5fd, #a5b4fc 60%, transparent 70%);
  animation: drift1 18s ease-in-out infinite alternate;
}
body::after {
  width: 55vw; height: 55vw; bottom: -20vw; right: -12vw;
  background: radial-gradient(circle at 70% 70%, #f9a8d4, #c4b5fd 55%, transparent 70%);
  animation: drift2 22s ease-in-out infinite alternate;
}
@keyframes drift1 { from { transform: translate(0,0) scale(1); } to { transform: translate(8vw,6vw) scale(1.12); } }
@keyframes drift2 { from { transform: translate(0,0) scale(1); } to { transform: translate(-7vw,-5vw) scale(1.1); } }

.hidden { display: none !important; }
/* v20260722da：媒体选择 input 用视觉隐藏而非 display:none，保证 iOS Safari 上 <label for> 关联能稳定触发文件选择器（display:none 的 input 在部分 iOS 上 label 点击无反应） */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); font-size: 13px; }

/* 落地页（含顶部下载APP 横幅 + 居中卡片）整体占满视口并竖向排列，
   让卡片无论有没有横幅都真正处于「横幅之下剩余高度的正中央」 */
#app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border: 1px solid var(--border); border-radius: 12px;
  background: rgba(255,255,255,.7); color: var(--text); cursor: pointer;
  font-size: 14px; font-weight: 600; text-decoration: none; transition: .2s; backdrop-filter: blur(6px);
}
.btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn.primary { background: var(--accent-grad); border: none; color: #fff; box-shadow: 0 8px 22px rgba(124,58,237,.38); }
.btn.primary:hover { color: #fff; filter: brightness(1.07); transform: translateY(-2px); box-shadow: 0 12px 30px rgba(124,58,237,.45); }
#sendBtn { white-space: nowrap; flex: 0 0 auto; min-width: 64px; padding: 0 16px; height: 42px; border-radius: 22px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.btn.sm { padding: 7px 13px; font-size: 13px; border-radius: 10px; }
.btn.muted { opacity: .55; filter: grayscale(.5); } /* 来消息提醒已静音时弱化显示 */
.btn.danger { color: var(--danger); border-color: #f4c9c9; background: #fff5f5; }
.btn.danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

/* ---------- 落地页 ---------- */
.landing {
  flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center; padding: 24px 28px;
}
.landing-card {
  position: relative;
  background: rgba(255,255,255,.72); backdrop-filter: blur(22px) saturate(140%);
  border: 1px solid rgba(255,255,255,.7); border-radius: 26px; padding: 40px 38px;
  width: 460px; max-width: 100%; box-shadow: var(--shadow);
  animation: cardIn .6s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
.landing-card h1 {
  margin: 0 0 6px; font-size: 32px; font-weight: 800; letter-spacing: .5px; line-height: 1.2;
  background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.landing-card .sub { color: var(--muted); font-size: 14px; margin: 0 0 22px; }
.landing-actions { display: flex; gap: 12px; margin: 0 0 4px; }
.landing-actions .btn { flex: 1; padding: 13px; font-size: 15px; }

/* 创建房间表单 */
.create-box {
  background: rgba(248,249,255,.8); border: 1px solid var(--border); border-radius: 18px;
  padding: 20px; margin: 18px 0; animation: expand .3s ease both;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
}
@keyframes expand { from { opacity: 0; transform: scaleY(.9); } to { opacity: 1; transform: none; } }
.create-box input {
  width: 100%; padding: 12px 14px; margin-bottom: 12px; border: 1px solid var(--border);
  border-radius: 12px; font-size: 14px; background: #fff; transition: .18s;
}
.create-box input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(99,102,241,.15); }
.create-box .btn.primary { width: 100%; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 16px; color: var(--muted); cursor: pointer; }
.chk input { width: auto; margin: 0; accent-color: var(--accent); }

/* 公开房间列表 */
.room-section-title { display: flex; align-items: center; gap: 8px; margin: 26px 0 12px; font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .4px; }
.room-section-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border), transparent); }
.room-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.room-list li { margin: 0; border: none; padding: 0; }
.room-list a {
  display: flex; align-items: center; gap: 12px; padding: 13px 15px;
  background: rgba(255,255,255,.6); border: 1px solid var(--border); border-radius: 14px;
  color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px; transition: .2s;
}
.room-list a:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-sm); color: var(--accent); background: #fff; }
.room-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--accent-grad); flex: 0 0 11px; box-shadow: 0 0 0 4px rgba(124,58,237,.14); }
.room-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-go { font-size: 18px; opacity: .4; transition: .2s; }
.room-list a:hover .room-go { opacity: 1; transform: translateX(3px); }
.room-meta { flex: 0 0 auto; font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; max-width: 46%; overflow: hidden; text-overflow: ellipsis; }

/* 落地页工具栏：搜索 + 排序切换 */
.room-toolbar { display: flex; gap: 10px; margin: 18px 0 4px; flex-wrap: wrap; }
.room-search {
  flex: 1 1 180px; min-width: 0; padding: 10px 14px; font-size: 14px;
  border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,.7);
  color: var(--text); outline: none; transition: .2s;
}
.room-search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,58,237,.14); }
.room-sort { display: flex; gap: 4px; padding: 3px; background: rgba(255,255,255,.6); border: 1px solid var(--border); border-radius: 12px; }
.rs-tab {
  border: none; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600;
  padding: 7px 12px; border-radius: 9px; cursor: pointer; transition: .15s; white-space: nowrap;
}
.rs-tab:hover { color: var(--accent); }
.rs-tab.active { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.room-count { font-weight: 600; }

/* 加载更多 */
.room-more { margin: 16px 0 4px; }

/* ---------- 聊天页 ---------- */
.chat { display: flex; flex-direction: column; height: 100vh; height: 100dvh; flex: 1 1 auto; min-height: 0; width: 100%; max-width: 1320px; margin: 0 auto; align-self: center; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 14px 20px;
  background: rgba(255,255,255,.72); backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid rgba(255,255,255,.6); z-index: 5;
}
.room-info { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; }
.room-info::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--accent-grad); box-shadow: 0 0 0 4px rgba(99,102,241,.18); }
.tag { background: linear-gradient(135deg,#fde68a,#fbbf24); color: #7c4a03; font-size: 11px; padding: 3px 9px; border-radius: 20px; font-weight: 700; }
.status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.18); }
.dot.off { background: var(--danger); box-shadow: 0 0 0 3px rgba(239,68,68,.18); }
.online-pill { background: #eef2ff; color: var(--accent); padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: 700; }
.unread-pill {
  background: linear-gradient(135deg, #6366f1, #a855f7); color: #fff;
  padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 12px rgba(99,102,241,.32); transition: .2s; user-select: none;
}
.unread-pill:hover { filter: brightness(1.08); transform: translateY(-1px); }
.top-actions { margin-left: auto; display: flex; gap: 8px; }

.main { flex: 1; display: flex; min-height: 0; }
.messages {
  flex: 1; order: 1; overflow-y: auto;
  /* PC 端 composer 已回到文档流（聊天列底部），无需额外底距；移动端在媒体查询里另设固定定位底距 */
  padding: 24px 24px;
  display: flex; flex-direction: column; gap: 18px;
  background:
    radial-gradient(circle at 1px 1px, rgba(124,58,237,.06) 1px, transparent 0) 0 0 / 26px 26px,
    linear-gradient(180deg, #fbfcff 0%, #f3f4fb 100%);
}
.messages::-webkit-scrollbar { width: 9px; }
.messages::-webkit-scrollbar-thumb { background: #d7dbe2; border-radius: 8px; }

/* 上传进度条：固定在 composer 上方，软键盘弹出时由 JS 同步上顶 */
.upload-bar {
  position: fixed; left: 0; right: 0; bottom: 74px; z-index: 99;
  display: flex; align-items: center; gap: 10px;
  height: 22px; padding: 0 14px;
  background: linear-gradient(180deg, rgba(124,58,237,.04), rgba(236,72,153,.03));
  border-top: 1px solid rgba(124,58,237,.08);
  font-size: 12px; color: #6b5e91;
  transition: opacity .25s ease, transform .12s ease;
  will-change: transform;
}
.upload-bar.hidden { display: none !important; }
/* v20260722da：媒体选择 input 用视觉隐藏而非 display:none，保证 iOS Safari 上 <label for> 关联能稳定触发文件选择器（display:none 的 input 在部分 iOS 上 label 点击无反应） */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.upload-bar-track {
  flex: 1; height: 4px; border-radius: 4px;
  background: rgba(124,58,237,.10);
  overflow: hidden; position: relative;
}
.upload-bar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #7c3aed 0%, #ec4899 100%);
  border-radius: 4px;
  box-shadow: 0 0 6px rgba(124,58,237,.45);
  transition: width .18s ease-out;
}
.upload-bar-text { font-variant-numeric: tabular-nums; white-space: nowrap; opacity: .9; }
.upload-bar-text.done { color: #16a34a; }

/* 单条消息 */
.msg { display: flex; gap: 12px; align-items: flex-end; max-width: 82%; animation: pop .28s cubic-bezier(.2,.8,.2,1) both; }
.msg.me { flex-direction: row-reverse; align-self: flex-end; }
.avatar {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 16px; user-select: none;
  box-shadow: 0 4px 12px rgba(31,38,64,.18);
}
.msg-body { position: relative; /* 未读角标定位基准（标签挂在气泡左下角外侧下方，贴头像方向） */ display: flex; flex-direction: column; align-items: flex-start; min-width: 0; width: 100%; }
.msg.me .msg-body { align-items: flex-end; }
.msg-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 6px; }
.who { font-weight: 700; font-size: 13px; color: #444b5a; }
.time { font-size: 11px; color: var(--muted); }
.msg-text {
  position: relative; /* 未读角标定位基准（已废弃：标签挪到消息底部，与 .msg-receipt 同位置） */
  background: var(--panel); border: 1px solid var(--border); padding: 11px 15px;
  border-radius: 18px 18px 18px 6px; line-height: 1.6; word-break: break-word;
  box-shadow: 0 2px 6px rgba(31,38,64,.05); max-width: 560px; white-space: pre-wrap; font-size: 14.5px;
}
.msg.me .msg-text {
  background: var(--accent-grad); color: #fff; border: none;
  border-radius: 18px 18px 6px 18px; box-shadow: 0 8px 20px rgba(124,58,237,.3);
}
/* 媒体缩略图：用 flex wrap（替代 grid），iOS WebKit 兼容性更好，避免网格被压成空白 */
.msg-media-grid { position: relative; /* 未读角标定位基准 */ display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; max-width: 460px; min-width: 0; width: 100%; }
/* 语音条独立容器：不放进上面的缩略图网格，规避移动端 WebKit 网格排版异常导致语音条不显示 */
.msg-voices { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; max-width: 460px; align-items: flex-start; }
.msg-voices .voice-bar { width: auto; max-width: 100%; }
.media-cell { position: relative; width: 84px; height: 84px; flex: 0 0 84px; border-radius: 12px; overflow: hidden; cursor: pointer; background: #e9ecf3; box-shadow: var(--shadow-sm); transition: transform .16s, box-shadow .16s; }
.media-cell:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(31,38,64,.18); }
.media-cell .media-thumb { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.play-badge {
  position: absolute; inset: 0; margin: auto; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(10,12,22,.55); color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 13px; pointer-events: none; backdrop-filter: blur(2px);
}
.badge { position: absolute; right: 6px; bottom: 6px; font-size: 10px; padding: 2px 7px; border-radius: 8px; color: #fff; pointer-events: none; font-weight: 600; }
.badge.image { background: rgba(0,0,0,.55); }
.badge.video { background: var(--accent); }

/* 右侧：真心话大冒险游戏面板 */
.game {
  width: 300px; flex: 0 0 300px; order: 2; border-left: 1px solid rgba(255,255,255,.6); border-right: none;
  background: rgba(255,255,255,.55); backdrop-filter: blur(16px) saturate(140%); overflow-y: auto; padding: 18px 16px;
  display: flex; flex-direction: column;
}
.game-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.game-title { font-size: 16px; font-weight: 800; }
.game-sub { font-size: 12px; color: var(--muted); }
/* 收起/悬浮按钮仅移动端使用，桌面端隐藏 */
.game-close { display: none; }
.game-fab { display: none; }
.game-body { display: flex; flex-direction: column; gap: 12px; }
.game-idle .game-tip, .game-tip { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 0 0 12px; }
.game-state { font-size: 14px; font-weight: 700; padding: 9px 12px; border-radius: 12px; background: #eef2ff; color: var(--accent); text-align: center; }
.game-state.win { background: linear-gradient(135deg,#ffd86b,#ff9a3c); color: #5a3b00; }
.game-state.tie { background: linear-gradient(135deg,#c7d2fe,#a5b4fc); color: #3730a3; }
.game-actions { display: flex; flex-direction: column; gap: 8px; }
.btn.block { width: 100%; justify-content: center; }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.btn.ghost:hover { background: #f1f3f7; }
.gp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gp-chip { font-size: 12.5px; padding: 4px 10px; border-radius: 20px; background: #eef1f6; color: #444; }
.gp-chip.creator { background: var(--accent); color: #fff; }
.game-wait { font-size: 12.5px; color: var(--muted); text-align: center; padding: 4px; }
.gp-dice-wrap { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.gp-die { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 12px; border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); min-width: 64px; border: 2px solid transparent; }
.gp-die.win { border-color: #ffb020; background: #fff7e6; }
.gp-name { font-size: 12px; color: #555; }
.gp-pip { font-size: 28px; font-weight: 800; color: #222; }
.game-ask-box { display: flex; flex-direction: column; gap: 8px; }
.game-mode-row { display: flex; gap: 6px; }
.gm-btn { flex: 1; font-size: 12.5px; padding: 7px 0; border-radius: 10px; border: 1px solid var(--border); background: #fff; color: #555; cursor: pointer; transition: .15s; }
.gm-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.game-ask-input { width: 100%; box-sizing: border-box; min-height: 64px; resize: vertical; border-radius: 12px; border: 1px solid var(--border); padding: 10px; font: inherit; font-size: 13px; }
/* ---------- 游戏大厅 ---------- */
.game-lobby { display: flex; flex-direction: column; gap: 12px; }
.gl-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.gl-card { border: 1px solid var(--border); border-radius: 16px; padding: 14px; background: #fff; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 8px; transition: .15s; }
.gl-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.gl-icon { font-size: 26px; line-height: 1; }
.gl-name { font-weight: 800; font-size: 15px; color: #222; }
.gl-desc { font-size: 12.5px; color: var(--muted); line-height: 1.55; flex: 1; }
.gl-start { margin-top: 2px; }
/* 聊天流中的游戏结果卡片 */
.game-card-msg { display: flex; justify-content: center; margin: 8px 0; }
.gc-inner { max-width: 460px; width: 100%; background: linear-gradient(135deg,#fff,#fff6e9); border: 1px solid #ffe1ad; border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow-sm); }
.gc-banner { font-weight: 800; font-size: 14px; color: #b37400; margin-bottom: 8px; }
.gc-dices { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.gc-dice { font-size: 12.5px; padding: 3px 9px; border-radius: 18px; background: #f3f4f6; color: #555; }
.gc-dice.win { background: #ffd86b; color: #5a3b00; font-weight: 700; }
.gc-dice b { font-size: 14px; }
.gc-ask { font-size: 13px; line-height: 1.6; color: #333; }
.gc-mode { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 10px; margin-right: 6px; font-weight: 700; }
.gc-mode.truth { background: #cfe9ff; color: #0b5cad; }
.gc-mode.dare { background: #ffd6e0; color: #c2185b; }
.gc-mode.task { background: #d9f7e6; color: #0a7a47; }
.gc-mode.box { background: #e7e0ff; color: #5b3cc4; }
.gc-mode.voice { background: #ffe2cc; color: #c25a0a; }
.gc-box-penalty { font-size: 15px; font-weight: 700; color: #2a2440; margin: 6px 0 4px; line-height: 1.5; }
.gc-box-hint { font-size: 12px; color: var(--muted); }
.gc-box-tip { font-size: 12px; color: var(--muted); margin-top: 6px; }
.game-mode-fixed { font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.game-mode-fixed .gc-mode { margin-right: 0; }
.gc-q { vertical-align: middle; }
/* 真心话大冒险（简易版）出题卡片：问与答都在聊天流完成 */
.gc-inner.tod { background: linear-gradient(135deg,#fff,#f3f0ff); border-color: #d9d2ff; }
.gc-tod-head { font-size: 12.5px; color: #5b3cc4; font-weight: 700; margin-bottom: 8px; }
.gc-tod-head b { color: #2a2440; }
.gc-tod-mode { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 10px; margin-bottom: 8px; }
.gc-tod-mode.truth { background: #cfe9ff; color: #0b5cad; }
.gc-tod-mode.dare { background: #ffd6e0; color: #c2185b; }
.gc-tod-q { font-size: 16px; font-weight: 700; line-height: 1.55; color: #221c33; margin-bottom: 10px; word-break: break-word; }
.gc-tod-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.gc-tod-acts .btn { flex: 0 0 auto; }
.gc-tod-tip { font-size: 12px; color: var(--muted); margin-top: 10px; }
.gc-tod-answer { background: #5b3cc4; border-color: #5b3cc4; }
.gc-tod-answer:hover { background: #4a2fb0; }
/* 成人 / 自定义 徽标 */
.gc-tod-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 9px; margin-left: 6px; vertical-align: middle; }
.gc-tod-badge.adult { background: #ffd9e6; color: #c2185b; }
.gc-tod-badge.custom { background: #fff0cf; color: #9a6b00; }
.gc-tod-mode.adult { background: linear-gradient(135deg,#ffd6e0,#ffc2d6); color: #b01060; }
/* 大冒险：上传完成照片按钮 */
.gc-tod-proof { background: #0a7a47; border-color: #0a7a47; }
.gc-tod-proof:hover { background: #095f38; }
/* 已完成（已上传照片证明） */
.gc-tod-done { font-size: 13px; font-weight: 700; color: #0a7a47; margin-top: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gc-tod-proof-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: #f3f3f8; cursor: zoom-in; display: block; }
.gc-tod-proof-thumb[class*="video"] { background: #000; }

/* 发起面板（🎲 弹出） */
.tod-panel { position: absolute; left: 12px; right: 12px; bottom: calc(100% + 8px); background: var(--card,#fff); border: 1px solid var(--border); border-radius: 14px; padding: 14px; box-shadow: 0 10px 30px rgba(40,20,80,.18); z-index: 200; }
.tod-panel.hidden { display: none; }
.tod-panel-title { font-weight: 700; font-size: 14px; margin-bottom: 10px; color: var(--text,#222); }
.tod-panel-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.tod-panel-label { font-size: 13px; color: var(--muted); }
.tod-panel-adult { font-size: 13px; color: var(--text,#222); cursor: pointer; }
.tod-panel-adult input { margin-right: 4px; }
.tod-panel-row textarea { flex: 1 1 100%; width: 100%; min-height: 52px; resize: vertical; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font: 13px/1.5 inherit; background: var(--input,#fff); color: var(--text,#222); }
.tod-panel-actions { justify-content: flex-end; margin-bottom: 0; }
/* 类型选择按钮：明确选中态（填充主色）+ 指针，避免「点了看不出选中」的误判 */
.tod-pick-mode { cursor: pointer; pointer-events: auto; -webkit-tap-highlight-color: rgba(124,58,237,.18); }
.tod-pick-mode.active { background: var(--accent,#7c3aed); color: #fff; border-color: var(--accent,#7c3aed); box-shadow: 0 2px 8px rgba(124,58,237,.35); }
.gc-prove { margin-top: 10px; }

/* ---------- 微信风格语音条（区别于视频） ---------- */
/* 语音条已独立到 .msg-voices 容器，不再占用缩略图网格 */
.voice-bar {
  display: inline-flex; align-items: center; gap: 10px; box-sizing: border-box;
  width: auto; min-width: 120px; max-width: 100%; justify-self: start;
  padding: 10px 14px; border-radius: 18px;
  background: linear-gradient(135deg, #ffffff, #eef2ff);
  color: #1f2640; cursor: pointer; user-select: none;
  box-shadow: 0 1px 4px rgba(31,38,64,.10); transition: background .15s, transform .1s;
}
.voice-bar:hover { background: linear-gradient(135deg, #ffffff, #e3ebff); }
.voice-bar:active { transform: scale(.985); }
/* 自己发出的语音条用强调渐变（类似微信右侧气泡） */
.msg.me .voice-bar { background: var(--accent-grad); color: #fff; box-shadow: 0 4px 14px rgba(124,58,237,.28); }
.msg.me .voice-bar:hover { filter: brightness(1.05); }
.voice-bar .v-ico { flex: 0 0 auto; font-size: 13px; line-height: 1; opacity: .92; }
.voice-bar.playing .v-ico { font-size: 11px; }
.voice-bar .v-wave { flex: 1 1 auto; display: flex; align-items: center; gap: 3px; height: 18px; }
.voice-bar .v-wave i { display: block; width: 3px; height: 6px; border-radius: 3px; background: currentColor; opacity: .5; transform-origin: center; }
.voice-bar.playing .v-wave i { opacity: 1; animation: vwave .9s ease-in-out infinite; }
.voice-bar .v-wave i:nth-child(1) { animation-delay: 0s; }
.voice-bar .v-wave i:nth-child(2) { animation-delay: .12s; }
.voice-bar .v-wave i:nth-child(3) { animation-delay: .24s; }
.voice-bar .v-wave i:nth-child(4) { animation-delay: .36s; }
.voice-bar .v-wave i:nth-child(5) { animation-delay: .18s; }
.voice-bar .v-wave i:nth-child(6) { animation-delay: .30s; }
.voice-bar .v-dur { flex: 0 0 auto; margin-left: 2px; font-size: 12px; opacity: .8; font-variant-numeric: tabular-nums; }
@keyframes vwave { 0%,100% { height: 5px; } 50% { height: 18px; } }

/* ---------- 已读 / 已听回执 ---------- */
/* 未听红点（Soul 风格）：语音没点开听过就一直亮着，播放后带动画消失 */
.voice-bar .v-dot {
  flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%;
  background: #f43f5e; box-shadow: 0 0 0 3px rgba(244,63,94,.18);
  animation: vdotPulse 1.6s ease-in-out infinite;
  transition: transform .24s cubic-bezier(.2,.8,.2,1), opacity .24s;
}
.voice-bar .v-dot.gone { transform: scale(0); opacity: 0; box-shadow: none; animation: none; }
@keyframes vdotPulse {
  0%,100% { box-shadow: 0 0 0 3px rgba(244,63,94,.20); }
  50%     { box-shadow: 0 0 0 6px rgba(244,63,94,.06); }
}
/* 自己发的语音条不显示未听红点（改由下方「已听 N」回执表达） */
.msg.me .voice-bar .v-dot { display: none; }
/* 已听文字标签：与文字消息的「已读」同款（灰描边胶囊），听完后常驻显示 */
.voice-bar .v-listened {
  flex: 0 0 auto; margin-left: 4px;
  font-size: 10px; line-height: 1; padding: 2px 6px; border-radius: 8px;
  color: var(--muted, #9aa3b2); background: none;
  border: 1px solid var(--line, #e7ebf3); font-weight: 600; white-space: nowrap;
}
/* 自己发的语音条不显示「已听」文字（避免与下方「已听 N」回执重复） */
.msg.me .voice-bar .v-listened { display: none; }
/* 已听过的语音条整体略弱，与未听形成对比 */
.voice-bar.listened { opacity: .88; }
.voice-bar.listened .v-ico { opacity: .6; }



/* ---------- 文字 / 图片 / 视频的未读角标（Soul 风格小点） ---------- */
/* 停在屏幕上看够时间就自动消失并记为已读；语音用红色点（必须点开听），这里用主题紫区分 */
/* 点位置：默认贴文字气泡右上角内侧（外边距 -5/-5）；当点在 .media-cell 内部时改为内贴 4/4（避开 overflow:hidden 裁切），两种场景都紧贴气泡/图片 */
/* ---------- 文字 / 图片 / 视频的未读标签（「未读 / 已读」字样） ---------- */
/* 别人发的消息先显示紫色「未读」标，在屏幕上停留 READ_DWELL 毫秒后自动记为已读并变灰「已读」淡出 */
/* 未读角标：与发送端「● 已读 N」回执同款样式（小圆点 + 文字胶囊）
   放在 .msg-body 末尾（与 .msg-receipt 同位置），不再进气泡内部 */
.unread-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; line-height: 1; padding: 3px 9px 3px 7px;
  border-radius: 12px; margin-top: 5px; align-self: flex-start;
  background: linear-gradient(135deg, #6366f1, #a855f7); color: #fff;
  font-weight: 700; letter-spacing: .5px; user-select: none;
  box-shadow: 0 2px 6px rgba(99,102,241,.25);
  animation: udotPulse 1.8s ease-in-out infinite;
  transition: background .2s, color .2s, border-color .2s, box-shadow .2s;
}
/* 前置小圆点（类似语音未听红点，但接收端标签用紫色光晕） */
.unread-tag-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: #ff5b6e; box-shadow: 0 0 0 2px rgba(255,91,110,.35);
}
/* 已读：变灰描边胶囊 + 灰圆点 + 文字「已读」，与发送端「● 已读 N」视觉统一 */
.unread-tag.read-now {
  background: rgba(0,0,0,.04); color: var(--muted, #9aa3b2);
  border: 1px solid var(--line, #e7ebf3);
  animation: none; box-shadow: none; font-weight: 600;
}
.unread-tag.read-now .unread-tag-dot {
  background: var(--muted, #9aa3b2); box-shadow: none;
}
@keyframes udotPulse {
  0%,100% { box-shadow: 0 0 0 3px rgba(99,102,241,.18), 0 2px 6px rgba(99,102,241,.35); }
  50%     { box-shadow: 0 0 0 6px rgba(99,102,241,.05), 0 2px 6px rgba(99,102,241,.25); }
}
/* 自己的消息不显示未读标签（改由底部「已读 N」回执表达） */
.msg.me .unread-tag { display: none; }

/* 自己消息下方的「已读 N / 已听 N」回执 */
.msg-receipt {
  display: flex; align-items: center; gap: 5px; margin-top: 5px;
  font-size: 11px; color: var(--muted); user-select: none; line-height: 1;
  animation: fade .25s ease both;
}
.msg-receipt .rc-dots { display: inline-flex; align-items: center; gap: 3px; }
.msg-receipt .rc-dots i {
  display: block; width: 5px; height: 5px; border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #ec4899); opacity: .85;
}
.msg-receipt .rc-text { font-weight: 700; letter-spacing: .2px; }
.msg-receipt .rc-more { font-size: 10px; opacity: .75; }
/* 还没人读过：灰色「已送达 · 未读」，让发送方在单人房间里也能看到状态 */
.msg-receipt.pending { opacity: .55; font-weight: 500; }
.msg-receipt.pending .rc-text { font-weight: 600; }

/* 撤回提示（居中系统消息） */
/* 跨天日期分隔条：相邻消息日期不同（或会话首条）时居中显示 今天 / 昨天 / 月 日 */
.date-divider { display: flex; align-items: center; justify-content: center; margin: 14px 0 10px; pointer-events: none; }
.date-divider span { font-size: 12px; color: #8a8aa0; background: rgba(124,58,237,.08); padding: 3px 12px; border-radius: 999px; letter-spacing: .5px; }

.msg-system {
  text-align: center; margin: 8px 0; padding: 2px 0;
  font-size: 12px; color: var(--muted); user-select: none;
  animation: fade .25s ease both;
}
/* 本人消息：长摁(手机) / 右键(PC) 弹出的撤回浮层（仿微信气泡菜单） */
.recall-pop {
  position: fixed; z-index: 9998; min-width: 96px;
  background: #fff; border-radius: 12px; padding: 6px;
  box-shadow: 0 12px 32px rgba(31,38,64,.22); border: 1px solid rgba(31,38,64,.08);
  animation: fade .16s ease both;
}
.recall-pop.hidden { display: none; }
.recall-pop .recall-action {
  display: block; width: 100%; text-align: center;
  background: none; border: none; padding: 9px 14px;
  font-size: 14px; color: #dc2626; cursor: pointer; border-radius: 8px;
}
.recall-pop .recall-action:hover { background: #fef2f2; }



/* 语音预览条：固定在 composer 上方，与 upload-bar 错开/互斥显示 */
.voice-preview {
  position: fixed; left: 12px; right: 12px; bottom: 74px; z-index: 99;
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: var(--card, #fff); border: 1px solid var(--line, #eef2f9); border-radius: 14px;
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(31,38,64,.06));
  transition: transform .12s ease;
  will-change: transform;
}
.voice-preview audio { flex: 1; height: 36px; outline: none; min-width: 0; }
.voice-dur { font-size: 12px; color: #8a93a6; min-width: 34px; text-align: center; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #ef4444; flex: 0 0 auto; animation: recPulse 1s infinite; }
@keyframes recPulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
#micBtn.recording { color: #ef4444; animation: recPulse 1s infinite; }
.gallery-empty { font-size: 12.5px; color: var(--muted); text-align: center; padding: 20px 4px; line-height: 1.6; }

/* 输入区：PC 端随文档流置于聊天列底部（旧位置）；移动端在下方媒体查询里改为 fixed 贴底，软键盘弹出时由 JS 监听 visualViewport 上顶 */
.composer {
  position: relative; z-index: 100;
  display: flex; align-items: center; gap: 9px;
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.78); backdrop-filter: blur(18px) saturate(140%);
  border-top: 1px solid rgba(255,255,255,.6);
  transition: transform .12s ease;
  will-change: transform;
}
.icon-btn {
  border: none; background: transparent; font-size: 22px; cursor: pointer;
  width: 42px; height: 42px; border-radius: 12px; transition: .18s; line-height: 1; display: flex; align-items: center; justify-content: center;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", "EmojiOne Color", "Android Emoji", sans-serif;
  -webkit-text-size-adjust: 100%;
  flex: 0 0 auto;
}
.icon-btn:hover { background: #eef0ff; transform: translateY(-1px); }
/* 🎲 按钮：成人模式开启时的粉色环 + 🔞 角标提示 */
.icon-btn.adult-on {
  background: #ffe3ee;
  box-shadow: 0 0 0 2px #ff8fb3 inset;
  position: relative;
}
.icon-btn.adult-on::after {
  content: "🔞";
  position: absolute; top: -6px; right: -6px; font-size: 12px; line-height: 1;
  background: #fff; border-radius: 50%; padding: 1px; box-shadow: 0 0 0 1px #ff8fb3;
}
#msgInput {
  flex: 1; padding: 13px 18px; border: 1px solid var(--border); border-radius: 26px;
  font-size: 14.5px; background: #fff; transition: .18s;
}
#msgInput:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(124,58,237,.13); }
.emoji-panel {
  position: absolute; bottom: 76px; left: 20px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 16px; padding: 12px;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; width: 280px; box-shadow: var(--shadow); z-index: 10;
}
.emoji { font-size: 22px; text-align: center; cursor: pointer; padding: 5px; border-radius: 9px; transition: .12s; }
.emoji:hover { background: #eef0ff; transform: scale(1.18); }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; background: rgba(20,24,40,.5); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 50; animation: fade .2s ease; }
.modal-card { background: rgba(255,255,255,.92); backdrop-filter: blur(18px); border-radius: 20px; padding: 28px; width: 360px; max-width: 92%; box-shadow: var(--shadow); animation: cardIn .3s ease both; }
.modal-card h3 { margin: 0 0 16px; font-size: 19px; }
.modal-card input { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 14px; font-size: 14px; background: #fff; }
.modal-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(124,58,237,.14); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
#mediaModal { background: rgba(10,12,22,.88); }
.modal-backdrop { position: absolute; inset: 0; }
#mediaContent { position: relative; max-width: 90vw; max-height: 90vh; display: flex; align-items: center; justify-content: center; }
.media-stage { display: flex; align-items: center; justify-content: center; max-width: 90vw; max-height: 90vh; }
#mediaVideo { max-width: 90vw; max-height: 90vh; border-radius: 12px; display: block; background: #000; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.media-toolbar {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; background: rgba(20,24,40,.72);
  padding: 7px 12px; border-radius: 30px; z-index: 60; color: #fff; backdrop-filter: blur(6px);
  box-shadow: 0 6px 18px rgba(0,0,0,.3);
}
.mt-btn {
  border: none; background: rgba(255,255,255,.16); color: #fff; cursor: pointer;
  width: 34px; height: 34px; border-radius: 50%; font-size: 18px; line-height: 1;
  display: flex; align-items: center; justify-content: center; transition: .15s;
}
.mt-btn:hover { background: rgba(255,255,255,.32); }
#zoomLabel { font-size: 12px; min-width: 44px; text-align: center; user-select: none; }
#mediaImg { max-width: 90vw; max-height: 90vh; border-radius: 12px; display: block; transform-origin: center; transition: transform .12s ease; cursor: zoom-in; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
/* 多图查看：左右切换箭头 + 计数器 */
.media-nav {
  position: fixed; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(20,24,40,.6); color: #fff; font-size: 30px; line-height: 1;
  display: flex; align-items: center; justify-content: center; z-index: 70;
  backdrop-filter: blur(6px); box-shadow: 0 6px 18px rgba(0,0,0,.35); transition: .15s;
  user-select: none; -webkit-tap-highlight-color: transparent;
}
.media-nav:hover { background: rgba(40,46,70,.85); }
.media-nav.prev { left: max(16px, 3vw); }
.media-nav.next { right: max(16px, 3vw); }
.media-counter {
  position: fixed; top: 72px; left: 50%; transform: translateX(-50%);
  background: rgba(20,24,40,.72); color: #fff; font-size: 13px; font-weight: 600;
  padding: 4px 12px; border-radius: 20px; z-index: 70; user-select: none;
  backdrop-filter: blur(6px); box-shadow: 0 4px 12px rgba(0,0,0,.3);
}

/* ---------- Toast 提示 ---------- */
.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.toast {
  pointer-events: auto; min-width: 220px; max-width: 90vw; padding: 12px 18px; border-radius: 14px;
  font-size: 14px; font-weight: 600; color: #fff; box-shadow: 0 12px 30px rgba(31,38,64,.25);
  background: rgba(40,44,60,.92); backdrop-filter: blur(8px); animation: toastIn .3s cubic-bezier(.2,.8,.2,1) both;
  display: flex; align-items: center; gap: 9px;
}
.toast.ok { background: linear-gradient(135deg,#10b981,#059669); }
.toast.err { background: linear-gradient(135deg,#f43f5e,#e11d48); }
.toast.info { background: linear-gradient(135deg,#6366f1,#8b5cf6); }
.toast .t-ic { font-size: 16px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.96); } to { opacity: 1; transform: none; } }
.toast.hide { animation: toastOut .3s ease forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px) scale(.97); } }

@keyframes pop { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 760px) {
  .chat { max-width: 100%; }
  .main { flex-direction: column; }
  /* 移动端：游戏面板改为底部弹出层，默认收起，点悬浮按钮才展开，避免遮挡聊天 */
  .game {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    width: auto; flex: none; order: unset;
    border-left: none; border-top: 1px solid var(--border);
    max-height: 82vh; transform: translateY(110%);
    transition: transform .26s ease; z-index: 70;
    background: #fff; border-radius: 18px 18px 0 0;
    box-shadow: 0 -10px 30px rgba(0,0,0,.25);
  }
  .game.open { transform: translateY(0); }
  .game-head { position: sticky; top: 0; background: #fff; padding-bottom: 10px; z-index: 1; }
  .game-fab {
    display: flex; align-items: center; justify-content: center;
    position: fixed; right: 16px; bottom: 96px; width: 54px; height: 54px;
    border-radius: 50%; background: var(--accent-grad); color: #fff; font-size: 24px;
    border: none; box-shadow: 0 8px 22px rgba(124,58,237,.45); z-index: 60; cursor: pointer;
  }
  .game-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 65; }
  .game-close {
    display: inline-flex; align-items: center; justify-content: center;
    margin-left: auto; width: 30px; height: 30px; border-radius: 50%;
    border: none; background: #eef1f6; color: #555; font-size: 15px; cursor: pointer;
  }
  .msg { max-width: 92%; }
  .messages { padding: 16px; gap: 14px; }

  /* 顶栏：允许换行，避免一行挤爆按钮 */
  .topbar { flex-wrap: wrap; gap: 8px 12px; padding: 10px 14px; }
  .top-actions { margin-left: 0; width: 100%; flex-wrap: wrap; gap: 6px; }
  .top-actions .btn.sm { padding: 6px 10px; font-size: 12px; }
  .status { font-size: 12px; gap: 6px; }
  .online-pill { padding: 3px 10px; font-size: 12px; }

  #sendBtn { white-space: nowrap; flex: 0 0 auto; min-width: 64px; padding: 0 16px; height: 42px; border-radius: 22px; font-weight: 700; }

  /* 输入区：缩小按钮与间距，保证手机一行放得下；fixed 定位 + 安全区 */
  /* 输入区：移动端固定贴底 + 安全区，保持安卓软键盘适配 */
  .composer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; gap: 6px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); flex-wrap: nowrap; }
  .messages { padding: 16px 16px calc(76px + env(safe-area-inset-bottom)); }
  .upload-bar { bottom: 58px; }
  .voice-preview { bottom: 58px; }
  .icon-btn { width: 38px; height: 38px; font-size: 20px; }
  #msgInput { padding: 10px 14px; font-size: 14px; border-radius: 22px; min-width: 0; }
  #sendBtn { padding: 0 12px; font-size: 13px; min-width: 56px; height: 38px; }
  .emoji-panel { width: 92vw; max-width: 320px; left: 12px; }
  .emoji { font-size: 20px; }
  /* 游戏悬浮按钮要避开固定 composer + 安全区 */
  .game-fab { bottom: calc(88px + env(safe-area-inset-bottom)); }

  /* 语音预览条允许换行，按钮不溢出 */
  .voice-preview { flex-wrap: wrap; gap: 8px; }
  .voice-preview audio { flex: 1 1 100%; order: 3; height: 38px; }
  #voiceSend, #voiceCancel { flex: 1 1 auto; }

  /* 落地页 */
  .landing-card { padding: 30px 24px; }
  .landing-card h1 { font-size: 27px; }
  .landing-actions { flex-direction: column; gap: 10px; }
  .landing-actions .btn { width: 100%; }
  .create-box input, .create-box .btn { width: 100%; box-sizing: border-box; }

  /* 弹窗 */
  .modal-card { padding: 22px; }
}

/* ===================== 狼人杀 ===================== */
.wf-myrole { font-size: 13px; padding: 8px 12px; border-radius: 12px; background: #f7f7fb; text-align: center; }
.wf-role { display: inline-block; font-weight: 800; padding: 1px 9px; border-radius: 10px; }
.wf-role.werewolf { background: #2b2b3a; color: #ff5b6e; }
.wf-role.seer     { background: #e0f0ff; color: #0b5cad; }
.wf-role.witch    { background: #f3e0ff; color: #7a2db5; }
.wf-role.villager { background: #e7f7ec; color: #0a7a47; }
.wf-roles { font-size: 13px; text-align: center; }
.wf-seer { border: 1px dashed #bcdcff; border-radius: 12px; padding: 8px 12px; background: #f4faff; }
.wf-seer-h { font-size: 12px; font-weight: 700; color: #0b5cad; margin-bottom: 4px; }
.wf-seer-row { font-size: 12.5px; }
.wf-act { border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; background: #fff; display: flex; flex-direction: column; gap: 8px; }
.wf-act-h { font-size: 13px; font-weight: 800; color: var(--accent); }
.wf-targets { display: flex; flex-wrap: wrap; gap: 6px; }
.wf-target { margin: 0; }
.wf-row { display: flex; gap: 6px; flex-wrap: wrap; }
.wf-log { border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; background: #fafafa; display: flex; flex-direction: column; gap: 3px; }
.wf-log-h { font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.wf-log-row { font-size: 12px; color: #444; }
.gp-chip.dead { opacity: .45; text-decoration: line-through; background: #f0f0f0; }
.wf-event { border-left: 4px solid #6b7280; }
.wf-event-text { font-size: 13px; font-weight: 600; color: #333; }

/* ===================== 首页下载 APP 提示横幅 ===================== */
.app-banner {
  display: flex; align-items: center; gap: 12px;
  align-self: center; width: calc(100% - 32px);
  max-width: 1100px; margin: 14px 16px 0; padding: 12px 16px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6 55%, #ec4899);
  color: #fff; border-radius: 16px; box-shadow: 0 12px 30px rgba(124,58,237,.32);
  position: relative;
}
.app-banner-ic { font-size: 26px; line-height: 1; }
.app-banner-txt { display: flex; flex-direction: column; }
.app-banner-txt b { font-size: 15px; }
.app-banner-txt span { font-size: 12.5px; opacity: .92; }
.app-banner-btn {
  margin-left: auto; padding: 8px 20px; border-radius: 999px; background: #fff; color: #6d28d9;
  font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap; transition: .2s;
}
.app-banner-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(0,0,0,.18); }
.app-banner-x {
  border: none; background: rgba(255,255,255,.25); color: #fff; width: 28px; height: 28px;
  border-radius: 50%; cursor: pointer; font-size: 15px; line-height: 1; margin-left: 6px;
}
.app-banner-x:hover { background: rgba(255,255,255,.4); }

/* 手机端自适应：图标 + 文案一行，关闭按钮右上角，下载按钮整行铺满 */
@media (max-width: 600px) {
  .app-banner {
    flex-wrap: wrap; align-items: flex-start; gap: 8px 10px;
    padding: 30px 14px 14px; margin: 8px 10px 0; max-width: none; border-radius: 14px;
  }
  .app-banner-ic { font-size: 22px; }
  .app-banner-txt { flex: 1 1 auto; }
  .app-banner-txt b { font-size: 14px; }
  .app-banner-txt span { font-size: 11.5px; }
  .app-banner-btn {
    order: 4; flex: 1 1 100%; margin-left: 0; text-align: center; padding: 10px 0;
  }
  .app-banner-x { position: absolute; top: 8px; right: 8px; margin: 0; }
}

/* 平板 / 小屏 PC：横幅收窄，避免贴边 */
@media (max-width: 1180px) and (min-width: 601px) {
  .app-banner { max-width: calc(100% - 28px); margin: 14px 14px 0; }
}
/* 落地页统计信息条（后台「首页配置」填写） */
.site-stat {
  margin: 14px 0 4px; padding: 10px 14px; border-radius: 12px;
  background: rgba(255,255,255,.7); border: 1px solid var(--border);
  color: var(--muted); font-size: 13.5px; text-align: center;
}

/* ===================== 后台「首页配置」面板 ===================== */
.cfg-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.cfg-row label { font-weight: 600; font-size: 14px; }
.cfg-row .hint { color: var(--muted); font-size: 12.5px; }
.cfg-row textarea, .cfg-row input[type="text"] {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  font: 14px/1.5 inherit; resize: vertical;
}
.cfg-row textarea { min-height: 72px; }
.cfg-saved { color: #1a7f37; font-weight: 600; margin-left: 10px; }

/* ===================== 骰子比大小（聊天界面掷骰） ===================== */
/* 聊天工具栏「🎲 比大小」按钮 */
.game-quick-btn {
  display: inline-flex; align-items: center; gap: 4px;
  height: 40px; padding: 0 12px; border-radius: 20px;
  border: 1px solid var(--border); background: #fff; color: var(--text);
  font-size: 13.5px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.game-quick-btn:hover { border-color: var(--accent); color: var(--accent); }
.game-quick-btn:active { transform: translateY(1px); }

/* 弹窗与卡片 */
/* 聊天内微信风格骰子：点 🎲 直接发一枚旋转骰子到聊天流（无需弹层） */
.chat-die {
  width: 66px; height: 66px; margin: 6px auto 2px;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
  gap: 5px; padding: 8px; box-sizing: border-box;
  background: linear-gradient(145deg, #ffffff, #e7eaf4);
  border-radius: 16px; border: 1px solid #d3d8e8;
  box-shadow: inset 0 2px 6px rgba(255,255,255,.85), 0 6px 14px rgba(60,70,120,.22);
  transition: transform .2s;
}
.chat-die .pip {
  width: 12px; height: 12px; border-radius: 50%; align-self: center; justify-self: center;
  background: radial-gradient(circle at 35% 30%, #565d78, #1f2430);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.45);
  visibility: hidden;
}
.chat-die.rolling { animation: dieShake .32s linear infinite; }
@keyframes dieShake {
  0%   { transform: rotate(-12deg) scale(1.02); }
  25%  { transform: rotate(11deg)  scale(1.07); }
  50%  { transform: rotate(-9deg)  scale(1.02); }
  75%  { transform: rotate(13deg)  scale(1.07); }
  100% { transform: rotate(-12deg) scale(1.02); }
}
.dice-roll-card { text-align: center; }
.dice-roll-head { font-size: 13px; color: var(--text); margin-bottom: 2px; }
.dice-roll-foot { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* 比大小结果卡（聊天流内） */
.gc-dice.win { background: linear-gradient(135deg,#fff7e6,#ffe6c2); border-color: #f5b942; color: #b45309; }
.gc-dice-ask { margin-top: 2px; }
@media (max-width: 560px) {
  .chat-die { width: 58px; height: 58px; }
}

/* 附件选择菜单（相片 / 视频 / 拍照）：底部弹出 action sheet + 遮罩，合并原「图片」「视频」两按钮 */
.media-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 190; }
.media-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
  background: var(--card, #fff); border-top-left-radius: 16px; border-top-right-radius: 16px;
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 30px rgba(0,0,0,.18);
  display: flex; flex-direction: column; gap: 8px;
}
.media-opt {
  display: block; width: 100%; text-align: center; font-size: 16px; line-height: 1.2; border: none; border-radius: 12px;
  background: var(--btn, #f3f4f6); color: var(--text); cursor: pointer; padding: 13px 0;
  -webkit-tap-highlight-color: transparent;
}
.media-opt:active { background: var(--btn-active, #e5e7eb); }
.media-opt.media-cancel { color: #e11d48; font-weight: 600; }
.media-hint { font-size: 12.5px; color: #9ca3af; text-align: center; line-height: 1.45; padding: 4px 10px 2px; }

/* v20260722de：页内拍摄（getUserMedia 兜底）的预览层样式 */
.cam-sheet { position: fixed; left: 0; right: 0; top: 0; bottom: 0; z-index: 220; background: #000; display: flex; flex-direction: column; }
.cam-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cam-stage video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.cam-hint { position: absolute; top: 50%; left: 0; right: 0; transform: translateY(-50%); text-align: center; color: #fff; font-size: 15px; padding: 0 20px; }
.cam-err { position: absolute; left: 12px; right: 12px; top: 14px; text-align: center; color: #ffd5d5; font-size: 13px; background: rgba(0,0,0,.55); border-radius: 10px; padding: 8px 10px; }
.cam-actions { display: flex; gap: 10px; padding: 12px 12px calc(14px + env(safe-area-inset-bottom)); background: #000; }
.cam-btn { flex: 1; border: none; border-radius: 12px; padding: 14px 0; font-size: 15px; color: #fff; background: #2b2b2b; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.cam-btn.cam-shot { background: #e11d48; font-weight: 700; font-size: 17px; }
.cam-btn.cam-cancel { background: #444; }

/* ===== 虚拟动作 / 礼物（v20260722dt） ===== */
/* 聊天流里的动作条（比心 / 送礼物）：居中、轻量、带图标飞入特效 */
.action-msg {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 10px auto; max-width: 92%; padding: 7px 14px; border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,214,232,.5), rgba(214,224,255,.5));
  border: 1px solid rgba(214,160,200,.35);
  font-size: 13.5px; color: #5b3a52; text-align: center;
  backdrop-filter: blur(4px);
  animation: actionPop .32s cubic-bezier(.2,.9,.3,1.2);
}
.action-msg.gift {
  background: linear-gradient(135deg, rgba(255,236,179,.6), rgba(255,205,225,.55));
  border-color: rgba(230,180,90,.45);
  color: #7a4a12; font-weight: 600;
}
.action-msg .action-ic { font-size: 20px; line-height: 1; display: inline-block; }
.action-msg .action-text b { color: inherit; }
.action-msg .anim-fly { animation: giftFly .8s ease both; }
.action-msg .anim-rocket { animation: giftRocket .9s ease both; }
.action-msg .anim-beat { animation: giftBeat .7s ease both; }
.action-msg .anim-kiss { animation: giftKiss .7s ease both; }
.action-msg .anim-hug { animation: giftHug .7s ease both; }
.action-msg .anim-pat { animation: giftPat .7s ease both; }
.action-msg .anim-kiss2 { animation: giftKiss .7s ease both; }
@keyframes actionPop { from { opacity: 0; transform: scale(.7) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes giftFly { 0% { transform: translateY(14px) scale(.4); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; } }
@keyframes giftRocket { 0% { transform: translateY(20px) rotate(-12deg) scale(.5); opacity: 0; } 50% { opacity: 1; } 100% { transform: none; } }
@keyframes giftBeat { 0%,100% { transform: scale(1); } 30% { transform: scale(1.35); } 60% { transform: scale(.9); } }
@keyframes giftKiss { 0%,100% { transform: scale(1) rotate(0); } 30% { transform: scale(1.3) rotate(-8deg); } 60% { transform: scale(.92) rotate(6deg); } }
@keyframes giftHug { 0%,100% { transform: scale(1); } 40% { transform: scale(1.25); } }
@keyframes giftPat { 0%,100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-4px) rotate(-10deg); } 60% { transform: translateY(0) rotate(8deg); } }

/* ---------- 付费礼物大动画（全屏遮罩，与免费动作区分） ---------- */
.gift-burst {
  position: fixed; inset: 0; z-index: 9500; display: none;
  align-items: center; justify-content: center;
  background: rgba(10,8,24,.62); backdrop-filter: blur(6px);
  overflow: hidden;
}
.gift-burst.show { display: flex; animation: fade .25s ease both; }
.gift-burst .gb-card {
  position: relative; z-index: 2; text-align: center; color: #fff;
  padding: 26px 30px; border-radius: 22px;
  background: linear-gradient(135deg, rgba(255,255,255,.14), rgba(255,255,255,.06));
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
  animation: gbPop .6s cubic-bezier(.18,.9,.28,1.3) both;
  max-width: 86vw;
}
.gift-burst .gb-icon {
  font-size: 96px; line-height: 1; margin-bottom: 8px;
  filter: drop-shadow(0 8px 18px rgba(255,180,90,.5));
  animation: gbIcon 1.1s ease-in-out infinite;
}
.gift-burst .gb-title { font-size: 18px; font-weight: 800; letter-spacing: .5px; margin-bottom: 8px; color: #ffd98a; }
.gift-burst .gb-line { font-size: 14px; color: #f3eaff; margin-bottom: 2px; }
.gift-burst .gb-line b { color: #fff; }
.gift-burst .gb-gift { font-size: 22px; font-weight: 800; margin: 6px 0 4px; color: #ffe0a0; }
.gift-burst .gb-sub { font-size: 11px; color: rgba(255,255,255,.6); margin-top: 8px; }
.gift-burst .gb-petals { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.gift-burst .gb-petal {
  position: absolute; top: -8%; opacity: 0;
  animation: gbFall var(--t,2s) linear var(--d,0s) infinite;
}
@keyframes gbPop { 0% { opacity: 0; transform: scale(.6) translateY(20px); } 60% { opacity: 1; } 100% { transform: none; } }
@keyframes gbIcon { 0%,100% { transform: scale(1) rotate(-4deg); } 50% { transform: scale(1.18) rotate(4deg); } }
@keyframes gbFall {
  0% { opacity: 0; transform: translateY(-10vh) rotate(0); }
  12% { opacity: 1; }
  100% { opacity: .9; transform: translateY(108vh) rotate(360deg); }
}

/* 礼物面板（底部抽屉，结构与 media-sheet 一致） */
.gift-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 190; }
.gift-panel {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
  background: var(--card, #fff); border-top-left-radius: 16px; border-top-right-radius: 16px;
  padding: 0 0 calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 30px rgba(0,0,0,.18);
  max-height: 72vh; display: flex; flex-direction: column;
}
.gift-panel-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--card, #fff);
  border-top-left-radius: 16px; border-top-right-radius: 16px;
}
.gift-title { font-weight: 700; font-size: 15px; }
.gift-target-wrap { margin-left: auto; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.gift-target { max-width: 120px; font-size: 13px; padding: 5px 6px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); }
.gift-close { margin-left: 4px; border: none; background: transparent; font-size: 18px; color: var(--muted); cursor: pointer; line-height: 1; }
.gift-body { overflow-y: auto; padding: 12px 14px; }
.gift-group-title { font-size: 13px; color: var(--muted); font-weight: 600; margin: 6px 2px 10px; }
.gift-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 10px; }
.gift-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px 10px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--bg); cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; -webkit-tap-highlight-color: transparent;
}
.gift-item:active { transform: scale(.95); }
.gift-item.free:hover { border-color: #ec7aa6; box-shadow: 0 6px 16px rgba(236,122,166,.25); }
.gift-item.paid { border-color: rgba(230,180,90,.5); background: linear-gradient(135deg, #fff8e8, #ffeede); }
.gift-item.paid:hover { box-shadow: 0 6px 16px rgba(230,180,90,.3); }
.gift-item:disabled { opacity: .5; cursor: not-allowed; filter: grayscale(.3); }
.gift-ic { font-size: 30px; line-height: 1; }
.gift-name { font-size: 13px; color: var(--text); }
.gift-price { font-size: 12px; font-weight: 700; color: #d97706; }
.gift-empty { color: var(--muted); font-size: 13px; padding: 8px 2px; }
.gift-loading { color: var(--muted); font-size: 13px; padding: 20px 2px; text-align: center; }

/* 真心话大冒险：尺度等级选择（复用 tod-pick-mode 的按钮态） */
.tod-pick-level { cursor: pointer; pointer-events: auto; -webkit-tap-highlight-color: rgba(236,122,166,.18); }
.tod-pick-level.active { background: var(--accent,#7c3aed); color: #fff; border-color: var(--accent,#7c3aed); box-shadow: 0 2px 8px rgba(124,58,237,.35); }
.tod-pick-level.disabled { opacity: .4; cursor: not-allowed; filter: grayscale(.4); pointer-events: none; }
.gc-tod-badge.level { background: linear-gradient(135deg,#ffd1e8,#ffb3d9); color: #b3176b; border: 1px solid #ff9ec9; }


/* 聊天文本中的外部链接：可点击，但点击先弹确认框（#extLinkModal）再跳转 */
.msg-text .ext-link { color: var(--accent, #7c3aed); text-decoration: underline; cursor: pointer; word-break: break-all; }
.msg-text .ext-link:hover { opacity: .82; }
#extLinkUrl { white-space: pre-wrap; }

/* 举报房间弹窗：原因下拉 + 说明文本 */
.report-select, .report-textarea {
  width: 100%; box-sizing: border-box; margin-top: 4px; padding: 9px 10px;
  border: 1px solid var(--border, #ccc); border-radius: 8px;
  background: var(--input-bg, #fff); color: var(--text, #222); font-size: 14px;
}
.report-textarea { resize: vertical; margin-top: 10px; font-family: inherit; }
