/* 鱼塘聊天室 - 摸鱼基地（挂载进主站 SPA 的组件样式）
 * 玻璃效果直接复用主站 moyu.css 的 .liquid-glass / .liquid-glass-strong */
:root {
  --accent: #35d0c5;
  --accent-soft: rgba(53, 208, 197, 0.16);
  --panel: rgba(255, 255, 255, 0.07);
  --panel-strong: rgba(255, 255, 255, 0.11);
  --border: rgba(255, 255, 255, 0.14);
  --text: #eaf3f5;
  --text-sub: rgba(234, 243, 245, 0.6);
  --text-faint: rgba(234, 243, 245, 0.35);
  --mine: rgba(53, 208, 197, 0.18);
  --mine-border: rgba(53, 208, 197, 0.35);
  --danger: #ff7a7a;
  --blur: blur(22px) saturate(1.35);
}

/* ===== 挂载容器 =====
 * 只算一次高度：chatMount = 视口 - 页面各层留白(14.45rem)
 * 里面全部自然流式：main 撑满 → chat-col 纵向 flex →
 * 消息流 flex:1 自动滚动（= chat-col 高 - 输入区高），输入区天然贴底 */
.chat-view { height: 100vh; overflow: hidden; }
.chat-view .page-split { padding: 6.25rem 1.5rem 2.5rem; }
.chat-view .page-panel { min-height: 0; width: min(1180px, 100%); }
.chat-view .page-content { min-height: 0; padding: 1.5rem 1.5rem 1.2rem; }
#chatMount { height: calc(100vh - 11rem); min-height: 480px; }
@media (max-width: 768px) {
  .chat-view { height: auto; overflow: visible; }
  #chatMount { height: 70vh; }
}
.chat-root { height: 100%; color: var(--text); font-family: "PingFang SC", "Microsoft YaHei", sans-serif; }

/* ===== 通用 ===== */
/* 连接状态提示：位于侧栏标题下方，只占侧栏空间，不影响聊天列 */
.conn-tip { padding: 0 16px 8px; font-size: 12px; color: #ffc069; }
.login-btn {
  background: linear-gradient(135deg, #35d0c5, #1fa89f); color: #fff; border: none; cursor: pointer;
  padding: 7px 18px; border-radius: 10px; font-size: 13px; font-weight: 600;
  box-shadow: 0 4px 14px rgba(53, 208, 197, 0.35);
}

/* ===== 主体 ===== */
.main { height: 100%; display: flex; min-height: 0; gap: 10px; padding: 0; position: relative; }

/* 在线列表 */
.sidebar {
  width: 220px; border-radius: 14px;
  display: flex; flex-direction: column; flex-shrink: 0;
}
.sidebar-title { padding: 14px 16px 8px; font-size: 12px; color: var(--text-sub); font-weight: 600; }
.online-list { flex: 1; overflow-y: auto; padding: 0 8px 12px; }
.online-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border-radius: 10px; cursor: pointer; user-select: none;
}
.online-item:hover { background: rgba(255, 255, 255, 0.08); }
.online-item .n { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online-item .dot {
  width: 8px; height: 8px; border-radius: 50%; background: #3ddc7c; margin-left: auto; flex-shrink: 0;
  box-shadow: 0 0 8px rgba(61, 220, 124, 0.7);
}

/* 聊天列：纵向 flex，消息流自动占满剩余高度，输入区天然贴底 */
.chat-col { flex: 1; position: relative; display: flex; flex-direction: column; min-width: 0; border-radius: 14px; overflow: hidden; }

/* 公告栏：顶部横向跑马灯，两端渐隐遮罩，悬停暂停 */
.notice-bar {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  margin: 10px 12px 0; padding: 5px 10px;
  background: rgba(9, 38, 48, 0.42); border: 1px solid var(--border); border-radius: 10px;
}
.notice-icon { font-size: 14px; flex-shrink: 0; }
.notice-track {
  flex: 1; overflow: hidden; white-space: nowrap;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
}
.notice-scroll {
  display: inline-flex; animation: notice-marquee 32s linear infinite;
}
.notice-bar:hover .notice-scroll { animation-play-state: paused; }
.notice-item { font-size: 13px; color: var(--text-sub); margin-right: 56px; }
@keyframes notice-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }   /* 内容渲染两份，位移一半即无缝循环 */
}

/* 消息流：flex:1 = chat-col 高度 - 输入区高度 */
.msg-flow { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px; }
.day-divider { text-align: center; margin: 10px 0; }
.day-divider span {
  font-size: 12px; color: var(--text-sub); background: rgba(255, 255, 255, 0.1);
  padding: 2px 12px; border-radius: 10px;
}
.msg-row { display: flex; gap: 10px; margin-bottom: 16px; position: relative; }
.msg-row.mine { flex-direction: row-reverse; }
.msg-body { max-width: 62%; display: flex; flex-direction: column; align-items: flex-start; }
.msg-row.mine .msg-body { align-items: flex-end; }
.msg-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 12px; }
.msg-row.mine .msg-meta { flex-direction: row-reverse; }
.msg-meta .nick { font-weight: 600; color: #fff; }
/* 时间：气泡下方小字，自己的消息跟随右对齐 */
.msg-time { font-size: 11px; color: var(--text-faint); margin-top: 2px; display: block; }
.msg-row.mine .msg-time { text-align: right; }
.badge-pill { font-size: 11px; padding: 1px 7px; border-radius: 9px; color: #fff; font-weight: 600; }
.bubble {
  position: relative; border-radius: 4px 12px 12px 12px; padding: 9px 13px;
  font-size: 14px; line-height: 1.6; word-break: break-word; white-space: pre-wrap;
  border: 1px solid rgba(255, 255, 255, 0.6);  /* 所有气泡统一白边框（略暗，避免刺眼），只有底色区分自己/别人 */
}
/* 覆盖主站 liquid-glass：去掉它的渐变描边伪元素，统一用上面的白边框 */
.bubble.liquid-glass {
  background: rgba(9, 38, 48, 0.55);
}
.bubble.liquid-glass::before { display: none; }
.msg-row.mine .bubble {
  border-radius: 12px 4px 12px 12px;
  background: rgba(11, 68, 62, 0.62);
}
.bubble .at-hl {
  color: var(--accent); font-weight: 600; background: var(--accent-soft);
  border-radius: 3px; padding: 0 2px;
}
.bubble img.pic { max-width: 240px; max-height: 200px; border-radius: 8px; display: block; cursor: zoom-in; }
/* 引用块：与消息气泡同风格的深色底 + 白色细边框 */
.quote-block {
  /* border: 1px solid #fff; border-left: 3px solid var(--accent); */
  background: rgba(9, 38, 48, 0.5);
  border-radius: 4px 8px 8px 4px; padding: 5px 9px; margin-bottom: 6px;
  font-size: 12px; color: var(--text-sub);
  cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px;
}
.quote-block:hover { background: rgba(9, 38, 48, 0.68); }
.quote-block b { color: var(--accent); font-weight: 600; }
/* 撤回占位 */
.msg-row .revoked {
  font-size: 12px; color: var(--text-sub);
  background: rgba(255, 255, 255, 0.08); padding: 4px 12px; border-radius: 10px;
}
/* 悬停操作：文字按钮，鼠标悬停气泡时显示在其下方 */
.msg-actions { display: flex; gap: 4px; margin-top: 4px; opacity: 0; transition: opacity 0.15s; }
.msg-row:hover .msg-actions { opacity: 1; }
/* 加深色胶囊底：亮色沙滩背景上保证可读 */
.msg-actions button {
  border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(9, 38, 48, 0.55); cursor: pointer;
  font-size: 12px; color: var(--text); padding: 2px 10px; border-radius: 11px;
}
.msg-actions button:hover { color: var(--accent); border-color: var(--accent); background: rgba(9, 38, 48, 0.75); }
/* 消息头像：左键查看资料 / 右键艾特 */
.msg-row > .avatar { font-size: 34px; line-height: 1; cursor: pointer; user-select: none; }
/* 图片头像：在线列表与消息行通用，圆形 */
.avatar-img {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover;
  cursor: pointer; flex-shrink: 0; border: 1px solid var(--border);
}
.online-item .avatar-img { width: 24px; height: 24px; }

/* ===== 输入区 ===== */
.input-area {
  position: relative; flex-shrink: 0; padding: 10px 16px 12px;  /* relative：作为遮罩/emoji面板的定位基准 */
  /* 加深输入区底色：亮色沙滩背景上保证文字对比度 */
  background: rgba(9, 38, 48, 0.42);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
/* 单行输入栏：工具按钮 | 输入框（自适应增高，最多3行） | 发送按钮 */
.input-tools { display: flex; gap: 2px; align-self: flex-end; padding-bottom: 6px; }
.input-tools button {
  border: none; background: none; font-size: 18px; cursor: pointer;
  width: 30px; height: 28px; border-radius: 6px; line-height: 28px;
}
.input-tools button:hover { background: rgba(255, 255, 255, 0.12); }
.input-row { display: flex; gap: 8px; align-items: flex-end; }
.input-row textarea {
  flex: 1; resize: none; border: 1px solid var(--border); border-radius: 10px;
  min-height: 38px; max-height: 96px; overflow-y: auto;
  padding: 8px 12px; font-size: 14px; font-family: inherit; line-height: 1.5; outline: none;
  background: rgba(8, 32, 42, 0.38); color: var(--text);
}
.input-row textarea::placeholder { color: rgba(234, 243, 245, 0.6); }
.input-row textarea:focus { border-color: var(--accent); }
.send-btn {
  border: none; background: linear-gradient(135deg, #35d0c5, #1fa89f); color: #fff;
  font-weight: 600; padding: 9px 18px; border-radius: 10px; cursor: pointer; font-size: 14px;
  box-shadow: 0 4px 14px rgba(53, 208, 197, 0.3); flex-shrink: 0;
}
.send-btn:disabled { background: rgba(255, 255, 255, 0.15); box-shadow: none; cursor: not-allowed; }
.hint { font-size: 11px; color: var(--text-sub); margin-top: 5px; }

/* emoji 面板 */
.emoji-panel {
  position: absolute; bottom: 100%; left: 16px; margin-bottom: 8px;
  width: 340px; max-height: 260px; overflow-y: auto;
  border-radius: 12px; padding: 10px; z-index: 20;
  background: rgba(10, 34, 46, 0.92); border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.emoji-panel .cat { font-size: 12px; color: var(--text-sub); margin: 6px 0 4px; }
.emoji-panel .grid { display: grid; grid-template-columns: repeat(8, 1fr); }
.emoji-panel .grid button {
  border: none; background: none; font-size: 20px; cursor: pointer; padding: 4px 0; border-radius: 6px;
}
.emoji-panel .grid button:hover { background: rgba(255, 255, 255, 0.14); }

/* @ 下拉 */
.at-pop {
  position: absolute; bottom: 100%; left: 60px; margin-bottom: 8px;
  width: 220px; max-height: 220px; overflow-y: auto;
  border-radius: 12px; z-index: 20;
  background: rgba(10, 34, 46, 0.92); border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.at-pop .item {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px;
  cursor: pointer; font-size: 13px;
}
.at-pop .item:hover, .at-pop .item.active { background: var(--accent-soft); }

/* 引用草稿条 */
.quote-draft {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.08); border-left: 3px solid var(--accent);
  padding: 5px 10px; border-radius: 4px; font-size: 12px; color: var(--text-sub);
}
.quote-draft .x { margin-left: auto; cursor: pointer; color: var(--text-sub); font-size: 14px; }
.quote-draft .x:hover { color: var(--danger); }

/* 灯箱 */
.lightbox {
  position: fixed !important; inset: 0 !important; background: rgba(0, 0, 0, 0.78); z-index: 99;
  display: flex; align-items: center; justify-content: center; cursor: zoom-out;
}
.lightbox img { max-width: 90vw; max-height: 90vh; border-radius: 8px; }

/* toast */
.toast {
  position: fixed !important; top: 70px !important; left: 50% !important; transform: translateX(-50%) !important;
  background: rgba(10, 40, 50, 0.9); color: #fff; font-size: 13px;
  padding: 8px 18px; border-radius: 10px; z-index: 100;
  border: 1px solid var(--border);
  animation: fadein 0.2s;
}
@keyframes fadein { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; } }

/* ===== 成员右键菜单 / 资料卡片 ===== */
.ctx-mask { position: fixed; inset: 0; z-index: 40; }
.ctx-menu {
  position: fixed; z-index: 41; min-width: 124px; padding: 6px; border-radius: 10px;
  display: flex; flex-direction: column; gap: 2px;
}
.ctx-menu button {
  border: none; background: none; cursor: pointer; text-align: left;
  font-size: 13px; color: var(--text); padding: 7px 12px; border-radius: 7px;
}
.ctx-menu button:hover { background: rgba(255, 255, 255, 0.12); }

.profile-mask {
  position: fixed; inset: 0; z-index: 50; background: rgba(4, 18, 26, 0.45);
  display: flex; align-items: center; justify-content: center;
}
.profile-card { width: 260px; border-radius: 16px; padding: 22px 20px 18px; text-align: center; }
.p-emoji { font-size: 52px; line-height: 1.15; }
.p-name {
  margin-top: 10px; font-size: 16px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.p-id { margin-top: 4px; font-size: 12px; color: var(--text-sub); }
.p-actions { margin-top: 14px; display: flex; gap: 8px; justify-content: center; }
.p-actions .p-close {
  border: 1px solid var(--border); background: none; color: var(--text-sub);
  cursor: pointer; padding: 7px 16px; border-radius: 10px; font-size: 13px;
}
.p-actions .p-close:hover { color: var(--text); }

/* 举报弹窗 */
.report-card {
  background: rgba(10, 34, 46, 0.96); border: 1px solid var(--border); border-radius: 16px;
  width: min(400px, calc(100vw - 48px)); padding: 20px 22px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
  color: var(--text); font-size: 13px;
}
.rp-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.rp-quote {
  background: rgba(255, 255, 255, 0.07); border-left: 3px solid var(--accent); border-radius: 8px;
  padding: 8px 12px; margin-bottom: 14px; color: var(--text-sub);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rp-label { color: var(--text-sub); margin-bottom: 8px; }
.rp-reasons { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.rp-reasons button {
  background: rgba(255, 255, 255, 0.08); border: 1px solid var(--border); color: var(--text-sub);
  padding: 6px 14px; border-radius: 999px; cursor: pointer; font-size: 12px;
}
.rp-reasons button:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.4); }
.rp-reasons button.active {
  background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600;
}
.rp-detail {
  width: 100%; box-sizing: border-box; min-height: 64px; resize: vertical;
  background: rgba(255, 255, 255, 0.07); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); padding: 9px 12px; font-size: 13px; font-family: inherit;
}
.rp-detail::placeholder { color: var(--text-faint); }
.rp-detail:focus { outline: none; border-color: var(--accent); }
.rp-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.rp-actions button { padding: 8px 18px; border-radius: 10px; cursor: pointer; font-size: 13px; border: none; }
.rp-cancel { background: none; border: 1px solid var(--border) !important; color: var(--text-sub); }
.rp-cancel:hover { color: var(--text); }
.rp-submit { background: linear-gradient(135deg, #35d0c5, #1fa89f); color: #fff; font-weight: 600; }
.rp-submit:disabled { opacity: 0.45; cursor: not-allowed; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 3px; }

/* 侧栏/聊天列在 liquid-glass 上微调内边距 */
.sidebar, .chat-col { overflow: hidden; }
