/* ============ 彩虹娱乐 · 深色高级主题 ============ */
:root {
  --rainbow: linear-gradient(100deg, #ff6b6b, #ff9f45, #ffe066, #63e6be, #4dabf7, #b197fc);
  --rainbow-soft: linear-gradient(135deg, #6b8bff, #a86bff, #ff6bcb);
  --text: #efeaf6;
  --muted: #a29bb5;
  --surface: rgba(255, 255, 255, 0.055);
  --surface-2: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.10);
  --radius: 18px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  overflow: hidden; color: var(--text);
  background:
    radial-gradient(1100px 560px at 12% -12%, rgba(177,151,252,.22), transparent 60%),
    radial-gradient(950px 500px at 105% 8%, rgba(77,171,247,.16), transparent 55%),
    radial-gradient(900px 620px at 50% 120%, rgba(255,107,107,.14), transparent 60%),
    linear-gradient(160deg, #0f0d17, #16121f 55%, #120f1a);
}
.hidden { display: none !important; }
img { max-width: 100%; }

/* ---------- 居中页（登录/审核/马甲名/被拒） ---------- */
.login, .center-page {
  height: 100%; display: flex; align-items: center; justify-content: center; padding: 22px;
}
.login-card {
  position: relative; width: 100%; max-width: 372px; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 26px;
  padding: 40px 30px; box-shadow: 0 30px 80px rgba(0,0,0,.5);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); overflow: hidden;
}
.login-card::before { /* 顶部彩虹光条 */
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--rainbow);
}
.login-logo { font-size: 62px; line-height: 1; filter: drop-shadow(0 6px 22px rgba(177,151,252,.55)); }
.login-card h1 {
  font-size: 23px; margin: 14px 0 8px; font-weight: 800; letter-spacing: .5px;
  background: var(--rainbow); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.login-sub { font-size: 13px; color: var(--muted); margin-bottom: 22px; line-height: 1.6; }
.login-card input, .center-page input {
  width: 100%; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px;
  font-size: 16px; outline: none; color: var(--text); background: rgba(255,255,255,.06); transition: border-color .2s, box-shadow .2s;
}
.login-card input::placeholder, .center-page input::placeholder { color: #8b83a0; }
.login-card input:focus, .center-page input:focus { border-color: #a86bff; box-shadow: 0 0 0 3px rgba(168,107,255,.22); }
.center-page button, #enterBtn, #devLoginBtn, #nickBtn {
  width: 100%; margin-top: 14px; padding: 14px; border: none; border-radius: 14px; cursor: pointer;
  color: #fff; font-size: 16px; font-weight: 700; background: var(--rainbow-soft);
  box-shadow: 0 10px 30px rgba(168,107,255,.35);
}
.center-page button:active, #devLoginBtn:active { transform: translateY(1px); }

.dev-box { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--border); }
.dev-tip { font-size: 11px; color: #6f6885; margin-bottom: 8px; }
.dev-box input { margin-bottom: 6px; }
#tgWidget { margin-top: 8px; min-height: 20px; display: flex; justify-content: center; }

.spinner {
  width: 34px; height: 34px; margin: 20px auto 0; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.12); border-top-color: #b197fc; animation: spin .9s linear infinite;
}
.myid-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 14px; flex-wrap: wrap;
  background: rgba(255,255,255,.05); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; }
.myid-label { color: var(--muted); font-size: 14px; }
#myTgId { color: #ffd93d; font-size: 18px; font-weight: 800; letter-spacing: 1px; user-select: all; }
.copy-id-btn { border: none; border-radius: 9px; padding: 6px 12px; font-size: 13px; font-weight: 700; cursor: pointer;
  background: var(--rainbow-soft); color: #fff; }
.invite-err { margin-top: 12px; color: #ff7a7a; font-size: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 聊天页 ---------- */
.chat { height: 100%; display: flex; flex-direction: column; position: relative; }

.topbar {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 11px 12px; z-index: 5;
  background: rgba(18,15,26,.72); border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--rainbow); opacity: .9; }
.group-avatar {
  width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0; background: conic-gradient(from 210deg, #ff6b6b, #ffe066, #63e6be, #4dabf7, #b197fc, #ff6b6b);
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
.group-meta { flex: 1; min-width: 0; }
.group-name { font-size: 17px; font-weight: 700; }
.group-status { font-size: 12px; color: var(--muted); }
.icon-btn {
  background: none; border: none; color: var(--muted); font-size: 22px; cursor: pointer;
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.icon-btn:active { background: rgba(255,255,255,.08); }

/* 置顶栏 */
.pinned-bar {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; z-index: 4; cursor: pointer;
  background: rgba(255,217,61,.1); border-bottom: 1px solid rgba(255,217,61,.3);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.pinned-bar:active { background: rgba(255,217,61,.18); }
.msg-row.msg-flash .bubble { animation: flashPulse 1.6s ease-out; }
@keyframes flashPulse { 0% { box-shadow: 0 0 0 0 rgba(255,217,61,.95); } 100% { box-shadow: 0 0 0 10px rgba(255,217,61,0); } }
.pin-icon { font-size: 16px; flex-shrink: 0; }
.pin-content { flex: 1; min-width: 0; font-size: 13px; line-height: 1.3; overflow: hidden; }
.pin-name { font-weight: 700; color: #ffd93d; }
.pin-text { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pinned-bar .icon-btn { font-size: 18px; width: 30px; height: 30px; }

.messages { flex: 1; overflow-y: auto; padding: 14px 10px 8px; }

.msg-row { display: flex; align-items: flex-end; gap: 8px; margin: 3px 0; }
.msg-row.me { flex-direction: row-reverse; }

.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 15px; font-weight: 700;
  box-shadow: 0 2px 10px rgba(0,0,0,.35);
}
.avatar.spacer { visibility: hidden; }
.avatar-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.bubble {
  max-width: 76%; border-radius: var(--radius); padding: 8px 11px 6px; position: relative;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 15px; line-height: 1.4;
  word-break: break-word; box-shadow: 0 3px 14px rgba(0,0,0,.28);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.msg-row.me .bubble {
  background: var(--rainbow-soft); border: none; color: #fff;
  box-shadow: 0 6px 20px rgba(168,107,255,.35);
}
.bubble .sender { font-size: 13px; font-weight: 700; margin-bottom: 2px; display: flex; align-items: center; }
.bubble .sender-mine { justify-content: flex-end; }
.admin-badge {
  position: relative; overflow: hidden;
  margin-left: 6px; font-size: 10px; font-weight: 800; color: #fff; padding: 2px 9px; border-radius: 9px; letter-spacing: .5px; white-space: nowrap;
  background: linear-gradient(100deg, #ff2d55, #ff9500, #ffe14d, #34c759, #5ac8fa, #af52de, #ff2d55);
  background-size: 300% auto; border: 1px solid rgba(255,255,255,.45);
  animation: rankShine 2.4s linear infinite, adminGlow 1.7s ease-in-out infinite;
}
.admin-badge::before {
  content: ""; position: absolute; top: 0; left: -60%; width: 45%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.85), transparent);
  transform: skewX(-20deg); animation: adminSweep 2.6s ease-in-out infinite;
}
@keyframes adminGlow { 0%,100% { box-shadow: 0 0 7px rgba(255,120,60,.6); } 50% { box-shadow: 0 0 20px rgba(255,210,90,1); } }
@keyframes adminSweep { 0% { left: -60%; } 45%,100% { left: 135%; } }
.bubble .text { white-space: pre-wrap; }
.bubble .text.emoji-only { font-size: 46px; line-height: 1.1; }
.bubble img.photo { display: block; max-width: 250px; width: 100%; border-radius: 12px; margin: 3px 0; }

.reply-quote {
  border-left: 3px solid #b197fc; background: rgba(255,255,255,.07);
  border-radius: 8px; padding: 4px 9px; margin-bottom: 4px; font-size: 13px; cursor: pointer;
}
.msg-row.me .reply-quote { border-left-color: #fff; background: rgba(255,255,255,.18); }
.reply-quote .rq-name { font-weight: 700; }
.reply-quote .rq-text { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-row.me .reply-quote .rq-text { color: rgba(255,255,255,.8); }

.time { font-size: 11px; color: var(--muted); float: right; margin: 6px 0 0 10px; }
.msg-row.me .time { color: rgba(255,255,255,.8); }

/* 贴纸消息（无气泡） */
.bubble.sticker-msg { background: none !important; border: none; box-shadow: none; padding: 2px 0; backdrop-filter: none; }
.bubble.sticker-msg .time { color: var(--muted); }
.sticker-img { display: block; width: 138px; height: 138px; object-fit: contain; filter: drop-shadow(0 6px 16px rgba(0,0,0,.4)); }

/* 系统消息 / 日期 */
.system-msg { text-align: center; margin: 12px 0; }
.system-msg span {
  background: rgba(255,255,255,.09); color: var(--muted); font-size: 12px; padding: 5px 14px; border-radius: 14px;
  border: 1px solid var(--border); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}

/* 回复条 */
.reply-bar {
  display: flex; align-items: center; gap: 9px; padding: 8px 12px;
  background: rgba(18,15,26,.85); border-top: 1px solid var(--border);
}
.reply-bar-line { width: 3px; align-self: stretch; border-radius: 3px; background: var(--rainbow); }
.reply-bar-content { flex: 1; min-width: 0; }
.reply-bar-name { font-size: 13px; font-weight: 700; color: #c9b6ff; }
.reply-bar-text { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 输入栏 */
.composer {
  display: flex; align-items: center; gap: 5px; padding: 9px 10px;
  background: rgba(18,15,26,.82); border-top: 1px solid var(--border);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
#msgInput {
  flex: 1; border: none; outline: none; font-size: 16px; padding: 10px 8px; background: none; color: var(--text);
}
#msgInput::placeholder { color: #7d7592; }
.send-btn {
  width: 44px; height: 44px; border-radius: 50%; border: none; color: #fff; font-size: 18px; cursor: pointer;
  flex-shrink: 0; background: var(--rainbow); box-shadow: 0 6px 18px rgba(168,107,255,.45);
}
.send-btn:active { transform: scale(.94); }

/* ---------- 表情/贴纸面板 ---------- */
.picker-panel {
  position: absolute; bottom: 62px; left: 0; right: 0; height: 312px; z-index: 6;
  display: flex; flex-direction: column;
  background: rgba(20,16,30,.96); border-top: 1px solid var(--border);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.picker-content { flex: 1; overflow-y: auto; padding: 10px; display: grid; gap: 8px; align-content: start; }
.picker-content.emoji-grid { grid-template-columns: repeat(8, 1fr); }
.picker-content.emoji-grid span { font-size: 26px; text-align: center; cursor: pointer; padding: 3px; border-radius: 10px; }
.picker-content.emoji-grid span:active { background: rgba(255,255,255,.1); }
.picker-content.sticker-grid { grid-template-columns: repeat(4, 1fr); }
.sticker-thumb { width: 100%; aspect-ratio: 1; object-fit: contain; cursor: pointer; border-radius: 12px; padding: 5px; }
.sticker-thumb:active { background: rgba(255,255,255,.1); }

.picker-tabs {
  display: flex; gap: 5px; padding: 7px 9px; border-top: 1px solid var(--border);
  background: rgba(12,10,18,.6); overflow-x: auto; flex-shrink: 0;
}
.picker-tab {
  flex-shrink: 0; width: 44px; height: 44px; border: none; background: none; border-radius: 12px;
  font-size: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 5px;
}
.picker-tab.active { background: rgba(168,107,255,.22); box-shadow: inset 0 0 0 1px rgba(177,151,252,.5); }
.picker-tab img { width: 100%; height: 100%; object-fit: contain; }

/* 管理员操作菜单（底部弹出） */
.action-sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; }
.action-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.action-menu {
  position: relative; width: 100%; padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 8px; animation: sheetup .18s ease;
}
@keyframes sheetup { from { transform: translateY(100%); } to { transform: translateY(0); } }
.action-item {
  width: 100%; padding: 15px; border: none; border-radius: 14px; font-size: 16px; font-weight: 600; cursor: pointer;
  background: rgba(30,26,42,.96); color: var(--text); border: 1px solid var(--border);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.action-item:active { background: rgba(45,40,60,.98); }
.action-item.danger { color: #ff7a7a; }
.action-item.cancel { background: rgba(20,16,30,.96); color: var(--muted); font-weight: 700; margin-top: 2px; }
.action-item.header { background: transparent; border: none; color: var(--muted); font-size: 13px; font-weight: 700; padding: 6px; pointer-events: none; }
.action-item.save { background: var(--rainbow-soft); color: #fff; border: none; }

/* 修改昵称弹窗 */
.nick-modal {
  position: relative; margin: auto; width: calc(100% - 32px); max-width: 380px; align-self: center;
  background: rgba(28,24,40,.98); border: 1px solid var(--border); border-radius: 20px; padding: 22px;
  box-shadow: 0 30px 80px rgba(0,0,0,.55); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
#nickModal, #drawModal, #inviteGenModal, #rankModal { align-items: center; }

/* 身份境界标签（越高越炫） */
.rank-tag { margin-left: 6px; font-size: 10px; font-weight: 800; padding: 1px 7px; border-radius: 8px; letter-spacing: .5px; color: #fff; white-space: nowrap; }
.rank-tag[data-tier="0"] { background: #6b7280; }
.rank-tag[data-tier="1"] { background: #3f9142; }
.rank-tag[data-tier="2"] { background: #0e9488; }
.rank-tag[data-tier="3"] { background: #2563eb; }
.rank-tag[data-tier="4"] { background: linear-gradient(135deg, #f5c542, #e0a020); color: #4a2e00; }
.rank-tag[data-tier="5"] { background: linear-gradient(135deg, #9b5cff, #6b3fd1); }
.rank-tag[data-tier="6"] { background: linear-gradient(135deg, #ff5cc8, #c026a3); }
.rank-tag[data-tier="7"] { background: linear-gradient(135deg, #ff7a45, #ff3d3d); box-shadow: 0 0 8px rgba(255,80,60,.6); }
.rank-tag[data-tier="8"] { background: var(--rainbow); box-shadow: 0 0 10px rgba(177,151,252,.7); }
.rank-tag[data-tier="9"] { background: var(--rainbow); background-size: 220% auto; animation: rankShine 2s linear infinite; box-shadow: 0 0 14px rgba(255,215,80,.9); color: #3a2600; }
/* 官方职位（宗门长老/圣女）—— 流光炫酷 */
.rank-tag[data-tier="10"] { background: linear-gradient(100deg, #7c3aed, #ffd93d, #7c3aed); background-size: 220% auto; color: #fff; box-shadow: 0 0 12px rgba(180,120,255,.85); animation: rankShine 2.2s linear infinite; }
.rank-tag[data-tier="11"] { background: linear-gradient(100deg, #ff8fc7, #ffffff, #ff8fc7); background-size: 220% auto; color: #b3145f; box-shadow: 0 0 13px rgba(255,143,199,.9); animation: rankShine 2.4s linear infinite; }
.rank-tag[data-tier="12"] {
  position: relative; overflow: hidden;
  background: linear-gradient(100deg, #17c9c0, #7cf5d8, #4dd6ff, #17c9c0);
  background-size: 260% auto; color: #05463f; border: 1px solid rgba(255,255,255,.55);
  text-shadow: 0 1px 2px rgba(255,255,255,.4);
  animation: rankShine 2.4s linear infinite, mintGlow 1.6s ease-in-out infinite;
}
.rank-tag[data-tier="12"]::before {
  content: ""; position: absolute; top: 0; left: -60%; width: 45%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.9), transparent);
  transform: skewX(-20deg); animation: adminSweep 2.8s ease-in-out infinite;
}
@keyframes mintGlow { 0%,100% { box-shadow: 0 0 8px rgba(60,230,210,.7); } 50% { box-shadow: 0 0 22px rgba(90,245,220,1), 0 0 34px rgba(60,210,255,.6); } }
@keyframes rankShine { to { background-position: 220% center; } }

/* 授予身份选择 */
.rank-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.rank-choice { padding: 11px 4px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.06); color: var(--text); font-size: 14px; font-weight: 700; cursor: pointer; }
.rank-choice:active { background: rgba(255,255,255,.14); }
.rank-choice.clear { grid-column: span 3; color: var(--muted); background: transparent; }
.rank-choice[data-tier="10"] { grid-column: span 3; background: linear-gradient(100deg, #7c3aed, #ffd93d, #7c3aed); background-size: 220% auto; animation: rankShine 2.2s linear infinite; color: #fff; border: none; }
.rank-choice[data-tier="11"] { grid-column: span 3; background: linear-gradient(100deg, #ff8fc7, #fff, #ff8fc7); background-size: 220% auto; animation: rankShine 2.4s linear infinite; color: #b3145f; border: none; }
.rank-choice[data-tier="12"] { grid-column: span 3; background: linear-gradient(100deg, #17c9c0, #7cf5d8, #4dd6ff, #17c9c0); background-size: 220% auto; animation: rankShine 2.6s linear infinite; color: #05463f; border: none; }
/* 置顶消息详情弹窗 */
.pin-popup { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 24px; }
.pin-popup.hidden { display: none; }
.pin-popup-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(2px); }
.pin-popup-card { position: relative; width: 100%; max-width: 340px; background: var(--panel, #1b1726); border: 1px solid rgba(255,217,61,.35);
  border-radius: 18px; padding: 20px; box-shadow: 0 24px 70px rgba(0,0,0,.6), 0 0 22px rgba(255,217,61,.2); }
.pin-popup-head { font-size: 15px; font-weight: 800; color: #ffd93d; margin-bottom: 12px; }
.pin-popup-name { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.pin-popup-text { font-size: 16px; line-height: 1.5; color: var(--text); white-space: pre-wrap; word-break: break-word; max-height: 50vh; overflow-y: auto; }
.pin-popup-close { margin-top: 18px; width: 100%; padding: 12px; border: none; border-radius: 12px; background: var(--rainbow-soft, #7b6cff); color: #fff; font-weight: 700; font-size: 15px; cursor: pointer; }

/* 右下角悬浮按钮：@提及 / 回到最新 */
.fab-col { position: absolute; right: 12px; bottom: 78px; z-index: 40; display: flex; flex-direction: column; gap: 14px; pointer-events: none; }
.fab { pointer-events: auto; position: relative; width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--panel, #23202e); color: var(--text, #fff); box-shadow: 0 6px 18px rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center;
  transition: transform .12s, opacity .2s; }
.fab:active { transform: scale(.92); }
.fab.hidden { display: none; }
.fab-icon { font-size: 22px; font-weight: 700; line-height: 1; }
.fab-chevron { font-size: 30px; margin-top: -6px; }
.fab-badge { position: absolute; top: -5px; right: -3px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: #2ea6ff; color: #fff; font-size: 12px; font-weight: 800; line-height: 20px; text-align: center; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.fab-badge.hidden { display: none; }

/* @ 成员选择浮层 */
.mention-box { position: absolute; left: 10px; right: 10px; bottom: 66px; z-index: 45; max-height: 210px; overflow-y: auto;
  background: var(--panel, #1b1726); border: 1px solid var(--border, rgba(255,255,255,.12)); border-radius: 14px; padding: 6px; box-shadow: 0 -8px 30px rgba(0,0,0,.5); }
.mention-box.hidden { display: none; }
.mention-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.mention-item:active { background: rgba(255,255,255,.1); }
.mention-av { width: 30px; height: 30px; border-radius: 50%; overflow: hidden; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 14px; }
.mention-av img { width: 100%; height: 100%; object-fit: cover; }
.mention-nm { font-size: 15px; font-weight: 600; color: var(--text, #fff); }

/* 拖拽图片到聊天窗口 */
.chat.drag-over::after { content: "松开发送图片"; position: absolute; inset: 10px; z-index: 60; display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: #fff; background: rgba(123,108,255,.25); border: 2px dashed rgba(255,255,255,.7); border-radius: 18px; pointer-events: none; }
.bubble img.photo { cursor: zoom-in; }

/* 图片放大查看 */
.img-viewer { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.9); display: flex; align-items: center; justify-content: center; padding: 16px; cursor: zoom-out; }
.img-viewer.hidden { display: none; }
.img-viewer-pic { max-width: 100%; max-height: 100%; border-radius: 8px; }

/* 消息里的 @提及 高亮 */
.mention { color: #4db6ff; font-weight: 600; }
.mention-me { color: #ffd93d; background: rgba(255,217,61,.16); border-radius: 5px; padding: 0 3px; }
.msg-row.me .mention { color: #d9ecff; }
.msg-row.me .mention-me { color: #fff5c2; background: rgba(255,255,255,.22); }

.gen-result { margin-top: 14px; text-align: center; }
.gen-code { font-size: 30px; font-weight: 800; letter-spacing: 5px; color: #ffd93d; padding: 14px; background: rgba(255,217,61,.1); border: 1px solid rgba(255,217,61,.4); border-radius: 12px; user-select: all; }
.gen-bound { font-size: 12px; color: var(--muted); margin-top: 8px; }
.gen-copy { margin-top: 12px; width: 100%; padding: 12px; border: none; border-radius: 12px; background: var(--rainbow-soft); color: #fff; font-weight: 700; font-size: 15px; cursor: pointer; }
.nick-title { font-size: 18px; font-weight: 800; text-align: center; }
.nick-sub { font-size: 12px; color: var(--muted); text-align: center; margin: 6px 0 16px; }
.nick-modal input {
  width: 100%; padding: 13px 15px; border: 1px solid var(--border); border-radius: 13px;
  font-size: 16px; outline: none; color: var(--text); background: rgba(255,255,255,.06);
}
.nick-modal input:focus { border-color: #a86bff; box-shadow: 0 0 0 3px rgba(168,107,255,.22); }
.nick-btns { display: flex; gap: 10px; margin-top: 16px; }
.nick-btns .action-item { margin: 0; }

/* ---------- 抽奖卡片 ---------- */
.draw-card {
  margin: 12px auto; max-width: 90%; padding: 14px 16px; border-radius: 18px;
  background: linear-gradient(135deg, rgba(168,107,255,.16), rgba(77,171,247,.12));
  border: 1px solid rgba(177,151,252,.35); box-shadow: 0 6px 22px rgba(0,0,0,.3);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.draw-card .dc-head { font-size: 16px; font-weight: 800; }
.draw-card .dc-sub { font-size: 13px; color: var(--muted); margin: 4px 0 10px; }
.draw-card .dc-count { color: #ffd93d; }
.dc-countdown { color: #ffd93d; font-weight: 700; }
.draw-mode-row { display: flex; gap: 6px; margin-top: 12px; }
.draw-mode-btn { flex: 1; padding: 9px 4px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.05); color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.draw-mode-btn.active { background: var(--rainbow-soft); color: #fff; border-color: transparent; }
.dc-actions { display: flex; gap: 8px; }
.dc-join, .dc-start {
  flex: 1; padding: 10px; border: none; border-radius: 12px; font-size: 14px; font-weight: 700; cursor: pointer; color: #fff;
}
.dc-join { background: var(--rainbow-soft); }
.dc-join.joined { background: rgba(255,255,255,.12); color: var(--muted); }
.dc-start { background: linear-gradient(135deg, #ffb300, #ff7a45); flex: 0 0 40%; }
.dc-winners { display: flex; flex-wrap: wrap; gap: 8px; font-weight: 700; align-items: center; max-height: 160px; overflow-y: auto; }
.dc-replay-hint { margin-top: 8px; font-size: 12px; color: var(--muted); text-align: center; }
.dw-win { display: inline-flex; align-items: center; gap: 5px; background: rgba(255,217,61,.15); border: 1px solid rgba(255,217,61,.4); padding: 3px 10px 3px 3px; border-radius: 14px; font-size: 13px; }
.dw-av { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 700; overflow: hidden; }
.dw-av img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 开奖动画舞台 ---------- */
.draw-stage {
  position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px; overflow-y: auto; padding: 24px 16px;
  background: radial-gradient(circle at 50% 40%, rgba(40,30,60,.96), rgba(10,8,16,.98));
}
.draw-stage-title { font-size: 22px; font-weight: 800; background: var(--rainbow); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; text-align: center; padding: 0 20px; }
.draw-spotlight { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.spot-avatar {
  width: 130px; height: 130px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 52px; font-weight: 800; color: #fff; overflow: hidden;
  box-shadow: 0 0 0 5px rgba(255,255,255,.12), 0 0 46px rgba(177,151,252,.75); transition: transform .1s;
}
.spot-avatar img { width: 100%; height: 100%; object-fit: cover; }
.spot-avatar.spot-hit { animation: hit .6s ease; box-shadow: 0 0 0 6px #ffd93d, 0 0 70px #ffd93d; }
@keyframes hit { 0%,100% { transform: scale(1); } 30% { transform: scale(1.28); } 60% { transform: scale(.95); } }
.spot-name { font-size: 22px; font-weight: 800; }
.draw-winners { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 92%; max-height: 46vh; overflow-y: auto; }
.dw-chip { display: flex; align-items: center; gap: 6px; background: rgba(255,217,61,.16); border: 1px solid rgba(255,217,61,.5); padding: 5px 12px 5px 5px; border-radius: 18px; font-weight: 700; }
.dw-chip .dw-av { width: 30px; height: 30px; font-size: 14px; }
.draw-stage-close { padding: 12px 40px; border: none; border-radius: 14px; background: var(--rainbow-soft); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; flex: 0 0 auto; }
.draw-stage-close.done { background: var(--rainbow); color: #2a1800; box-shadow: 0 0 24px rgba(255,215,120,.7); animation: doneP 1.3s ease-in-out infinite; }
@keyframes doneP { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.confetti-bit { position: absolute; top: -14px; width: 9px; height: 14px; border-radius: 2px; animation: fall 2s linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); opacity: .2; } }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: rgba(20,16,30,.92); color: #fff; padding: 10px 18px; border-radius: 22px; font-size: 14px; z-index: 50;
  border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
