/** * 文件功能:聊天室主界面样式表 * 复刻原版海军蓝聊天室色系 (CHAT.CSS) * 包含布局、消息窗格、输入工具栏、用户列表、弹窗等所有聊天界面样式 * * @author ChatRoom Laravel * @version 1.0.0 */ /* Alpine.js x-cloak:初始化完成前完全隐藏,防止弹窗闪烁 */ [x-cloak] { display: none !important; } /* ═══════════════════════════════════════════════════ 原版海军蓝聊天室色系 (CHAT.CSS 复刻) ═══════════════════════════════════════════════════ */ :root { --bg-main: #EAF2FF; --bg-bar: #b0d8ff; --bg-header: #4488aa; --bg-toolbar: #5599aa; --text-link: #336699; --text-navy: #112233; --text-white: #ffffff; --border-blue: #336699; --scrollbar-base: #b0d8ff; --scrollbar-arrow: #336699; --scrollbar-track: #EAF2FF; } * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: "Microsoft YaHei", "SimSun", "宋体", sans-serif; font-size: 10pt; background: var(--bg-main); color: var(--text-navy); overflow: hidden; height: 100vh; } /* 全局链接样式 */ a { color: var(--text-link); text-decoration: none; } a:hover { color: #009900; } /* 自定义滚动条 - 模拟原版 */ ::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background-color: var(--scrollbar-base); border-radius: 2px; border: 1px solid var(--scrollbar-arrow); } ::-webkit-scrollbar-track { background-color: var(--scrollbar-track); } ::-webkit-scrollbar-corner { background-color: var(--scrollbar-base); } /* ── 主布局 ─────────────────────────────────────── */ .chat-layout { display: flex; height: 100vh; width: 100vw; overflow: hidden; /* 防止整体滚动 */ } /* 左侧主区域 */ .chat-left { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; /* 约束 Flex 子项高度,防止长历史记录撑破 100vh 导致输入栏被挤出屏幕 */ } /* 竖向工具条 */ .chat-toolbar { width: 28px; background: var(--bg-toolbar); display: flex; flex-direction: column; align-items: center; padding-top: 58px; /* 与标题栏+公告栏底部对齐 */ padding-bottom: 75px; /* 与输入栏顶部对齐 */ border-left: 1px solid var(--border-blue); border-right: 1px solid var(--border-blue); flex-shrink: 0; } .chat-toolbar .tool-btn { writing-mode: vertical-rl; text-orientation: upright; font-size: 11px; color: #ddd; cursor: pointer; padding: 4px 0; text-align: center; transition: all 0.15s; width: 100%; flex: 1; display: flex; align-items: center; justify-content: center; user-select: none; letter-spacing: 2px; } .chat-toolbar .tool-btn:hover { color: #fff; background: #5599cc; } /* 右侧用户列表面板 */ .chat-right { width: 175px; display: flex; flex-direction: column; border-left: 1px solid var(--border-blue); background: var(--bg-main); flex-shrink: 0; padding-top: 2px; } /* ── 标题栏 ─────────────────────────────────────── */ .room-title-bar { background: var(--bg-header); color: var(--text-white); text-align: center; padding: 6px 10px; font-size: 12px; line-height: 1.6; flex-shrink: 0; border-bottom: 1px solid var(--border-blue); } .room-title-bar .room-name { font-weight: bold; font-size: 14px; } .room-title-bar .room-desc { color: #cee8ff; font-size: 11px; } /* 公告/祝福语滚动条(复刻原版 marquee) */ .room-announcement-bar { background: linear-gradient(to right, #a8d8a8, #c8f0c8, #a8d8a8); padding: 2px 6px; border-bottom: 1px solid var(--border-blue); flex-shrink: 0; height: 20px; line-height: 20px; overflow: hidden; } /* ── 消息窗格 ───────────────────────────────────── */ .message-panes { flex: 1; display: flex; flex-direction: column; min-height: 0; } .message-pane { flex: 1; overflow-y: auto; padding: 5px 8px; background: var(--bg-main); font-size: 10pt; line-height: 170%; min-height: 0; } .message-pane.say1 { border-bottom: 2px solid var(--border-blue); } .message-pane.say2 { display: block; flex: 0.4; border-top: 2px solid var(--border-blue); } .message-pane.say1 { flex: 0.6; } /* 分屏模式下两个窗格各占一半 */ .message-panes.split-h .message-pane.say1, .message-panes.split-h .message-pane.say2 { flex: 1; } .message-panes.split-h .message-pane.say2 { flex: 1; } .message-panes.split-h .message-pane.say1 { flex: 1; border-bottom: 2px solid var(--border-blue); } /* 消息行样式 */ .msg-line { margin: 2px 0; word-wrap: break-word; word-break: break-all; } .msg-line .msg-time { font-size: 9px; color: #999; } .msg-line .msg-user { cursor: pointer; font-weight: bold; } .msg-line .msg-user:hover { text-decoration: underline; } .msg-line .msg-action { color: #009900; } .msg-line .msg-secret { color: #cc00cc; font-style: italic; } .msg-line .msg-content { margin-left: 4px; } .msg-line.sys-msg { color: #cc0000; text-align: center; font-size: 9pt; } /* ── 底部输入工具栏 ─────────────────────────────── */ .input-bar { height: auto; min-height: 75px; background: var(--bg-bar); border-top: 2px solid var(--border-blue); padding: 3px 6px; flex-shrink: 0; display: flex; flex-direction: column; gap: 3px; } .input-bar select, .input-bar input[type="text"], .input-bar input[type="checkbox"] { font-size: 12px; border: 1px solid navy; color: #224466; padding: 1px 2px; background: #fff; } .input-bar select { max-width: 100px; } .input-bar .input-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; } .input-bar .say-input { flex: 1; min-width: 200px; font-size: 12px; border: 1px solid navy; color: #224466; padding: 3px 5px; outline: none; } .input-bar .say-input:focus { border-color: #0066cc; box-shadow: 0 0 3px rgba(0, 102, 204, 0.3); } .input-bar .send-btn { background: var(--bg-header); color: white; border: 1px solid var(--border-blue); padding: 3px 12px; font-size: 12px; font-weight: bold; cursor: pointer; transition: background 0.15s; } .input-bar .send-btn:hover { background: #336699; } .input-bar .send-btn:disabled { opacity: 0.5; cursor: not-allowed; } .input-bar label { font-size: 12px; cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 2px; } /* ── 右侧用户列表 Tab 栏 ──────────────────────── */ .right-tabs { display: flex; background: var(--bg-bar); border-bottom: 2px solid navy; flex-shrink: 0; } .right-tabs .tab-btn { flex: 1; text-align: center; font-size: 12px; padding: 3px 0; cursor: pointer; color: navy; background: var(--bg-bar); border: none; font-family: inherit; transition: all 0.15s; user-select: none; } .right-tabs .tab-btn.active { background: navy; color: white; } .right-tabs .tab-btn:hover:not(.active) { background: #99c8ee; } /* 用户列表内容 */ .user-list-content { flex: 1; overflow-y: auto; padding: 4px; } .user-item { display: flex; align-items: center; gap: 4px; padding: 3px 4px; cursor: pointer; font-size: 12px; border-bottom: 1px dotted #cde; transition: background 0.15s; } .user-item:hover { background: #d0e8ff; } .user-item .user-head { width: 36px; height: 36px; border-radius: 2px; object-fit: cover; background: transparent; mix-blend-mode: multiply; flex-shrink: 0; } .user-item .user-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-link); font-weight: bold; } .user-item .user-sex { font-size: 10px; } .user-item .user-level { font-size: 9px; color: #999; } /* 在线人数统计 */ .online-stats { background: var(--bg-bar); text-align: center; font-size: 11px; padding: 3px; border-top: 1px solid var(--border-blue); color: navy; flex-shrink: 0; } /* ── 用户名片弹窗 ───────────────────────────────── */ .modal-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 1000; display: flex; align-items: center; justify-content: center; } .modal-card { background: white; border: 2px solid var(--border-blue); border-radius: 8px; width: 340px; max-width: 90vw; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3); overflow: hidden; } .modal-header { background: linear-gradient(135deg, var(--bg-header), var(--border-blue)); color: white; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; } .modal-header h3 { font-size: 16px; font-weight: bold; } .modal-close { background: none; border: none; color: white; font-size: 20px; cursor: pointer; opacity: 0.8; } .modal-close:hover { opacity: 1; } .modal-body { padding: 16px; } .modal-body .profile-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; } .modal-body .profile-avatar { width: 56px; height: 56px; border-radius: 6px; object-fit: cover; border: 2px solid var(--bg-bar); background: #eee; } .modal-body .profile-info h4 { font-size: 16px; font-weight: bold; color: var(--text-navy); } .modal-body .profile-info .level-badge { display: inline-block; background: var(--bg-bar); color: var(--border-blue); font-size: 11px; padding: 1px 6px; border-radius: 10px; font-weight: bold; margin-left: 4px; } .modal-body .profile-info .sex-badge { font-size: 11px; margin-left: 2px; } .modal-body .profile-detail { background: #f5f9ff; border: 1px solid #e0ecff; border-radius: 6px; padding: 8px 12px; font-size: 12px; color: #666; margin-bottom: 12px; } .modal-actions { padding: 0 16px 16px; display: flex; gap: 8px; } .modal-actions button, .modal-actions a { flex: 1; text-align: center; padding: 6px 0; border-radius: 6px; font-size: 12px; font-weight: bold; cursor: pointer; border: 1px solid; transition: all 0.15s; text-decoration: none; display: block; } .btn-kick { background: #fee; color: #c00; border-color: #fcc; } .btn-kick:hover { background: #fcc; } .btn-mute { background: #fff8e6; color: #b86e00; border-color: #ffe0a0; } .btn-mute:hover { background: #ffe0a0; } .btn-mail { background: #f0e8ff; color: #6633cc; border-color: #d8c8ff; } .btn-mail:hover { background: #d8c8ff; } .btn-whisper { background: #e8f5ff; color: var(--text-link); border-color: var(--bg-bar); } .btn-whisper:hover { background: var(--bg-bar); } /* 禁言输入行 */ .mute-form { display: flex; align-items: center; gap: 6px; padding: 0 16px 12px; } .mute-form input { width: 60px; border: 1px solid #ffe0a0; border-radius: 4px; padding: 3px 6px; font-size: 12px; } .mute-form button { background: #b86e00; color: white; border: none; border-radius: 4px; padding: 4px 10px; font-size: 12px; cursor: pointer; } /* ── 头像选择器 ─────────────────────────────────── */ .avatar-option { width: 36px; height: 36px; cursor: pointer; border: 2px solid transparent; border-radius: 3px; transition: border-color 0.15s, transform 0.15s; } .avatar-option:hover { border-color: #88bbdd; transform: scale(1.15); } .avatar-option.selected { border-color: #336699; box-shadow: 0 0 6px rgba(51, 102, 153, 0.5); } /* 送花礼物弹跳动画 */ @keyframes giftBounce { 0% { transform: scale(0.3) rotate(-15deg); opacity: 0; } 50% { transform: scale(1.3) rotate(5deg); opacity: 1; } 70% { transform: scale(0.9) rotate(-3deg); } 100% { transform: scale(1) rotate(0deg); } }