/* 海讯 IM —— 粉色主题 */
* { margin: 0; padding: 0; box-sizing: border-box; }
[v-cloak] { display: none; }
html, body, #app { height: 100%; font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif; }
body { background: #fdf2f5; color: #4a2c35; }
button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; outline: none; }

/* ---------- 头像 ---------- */
.avatar { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px; font-weight: 600; flex-shrink: 0; user-select: none; }
.avatar.sm { width: 36px; height: 36px; font-size: 15px; }
.avatar.c1 { background: linear-gradient(135deg,#ec407a,#ad1457); }
.avatar.c2 { background: linear-gradient(135deg,#ab47bc,#6a1b9a); }
.avatar.c3 { background: linear-gradient(135deg,#5c6bc0,#283593); }
.avatar.c4 { background: linear-gradient(135deg,#26a69a,#00695c); }
.avatar.c5 { background: linear-gradient(135deg,#ffa726,#ef6c00); }
.avatar.c6 { background: linear-gradient(135deg,#78909c,#37474f); }
.avatar-wrap { position: relative; }
.online-dot { position: absolute; right: 0; bottom: 0; width: 11px; height: 11px; border-radius: 50%;
  background: #c4c4c4; border: 2px solid #fff; }
.online-dot.on { background: #2ecc71; }

/* ---------- 登录页 ---------- */
.login-wrap { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(160deg,#fce4ec 0%,#f8bbd0 45%,#f48fb1 100%); }
.login-card { width: 380px; background: rgba(255,255,255,.92); border-radius: 18px; padding: 36px 34px 30px;
  box-shadow: 0 18px 50px rgba(173,20,87,.18); backdrop-filter: blur(6px); }
.login-brand { text-align: center; margin-bottom: 22px; }
.login-logo { width: 66px; height: 66px; margin: 0 auto 12px; display: block;
  filter: drop-shadow(0 8px 18px rgba(173,20,87,.25)); }
.login-title { font-size: 20px; font-weight: 700; color: #880e4f; }
.login-sub { font-size: 12px; color: #ad6885; margin-top: 5px; }
.login-tabs { display: flex; background: #fce4ec; border-radius: 10px; padding: 4px; margin-bottom: 18px; }
.login-tabs span { flex: 1; text-align: center; padding: 8px 0; border-radius: 8px; font-size: 14px;
  color: #ad6885; cursor: pointer; transition: all .2s; }
.login-tabs span.active { background: #fff; color: #c2185b; font-weight: 600; box-shadow: 0 2px 8px rgba(194,24,91,.15); }
.ipt { width: 100%; height: 44px; border: 1.5px solid #f3c6d5; border-radius: 10px; padding: 0 14px;
  font-size: 14px; margin-bottom: 14px; background: #fff; transition: border-color .2s; }
.ipt:focus { border-color: #ec407a; }
.btn-primary { width: 100%; height: 44px; border: none; border-radius: 10px; font-size: 15px; font-weight: 600;
  color: #fff; background: linear-gradient(135deg,#ec407a,#c2185b); transition: opacity .2s, transform .1s; }
.btn-primary:hover { opacity: .92; }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.login-err { margin-top: 12px; font-size: 13px; color: #d32f2f; text-align: center; }
.login-foot { margin-top: 26px; font-size: 12px; color: rgba(136,14,79,.55); }

/* ---------- 主框架 ---------- */
.main-wrap { height: 100%; display: flex; flex-direction: column; }
.topbar { height: 58px; background: linear-gradient(90deg,#fff,#fff5f8); border-bottom: 1px solid #f6d5df;
  display: flex; align-items: center; padding: 0 18px; flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 38px; height: 38px; display: block; }
.brand-name { font-size: 15px; font-weight: 700; color: #880e4f; }
.brand-sub { font-size: 11px; color: #b77a91; }
.module-chip { margin: 0 auto; background: #fde7ee; color: #c2185b; font-size: 12.5px; padding: 5px 16px;
  border-radius: 999px; border: 1px solid #f6c9d8; }
.me { display: flex; align-items: center; gap: 9px; }
.me-name { font-size: 13.5px; color: #6d3046; }
.ws-dot { width: 9px; height: 9px; border-radius: 50%; background: #ccc; }
.ws-dot.open { background: #2ecc71; box-shadow: 0 0 6px rgba(46,204,113,.7); }
.ws-dot.connecting { background: #f5a623; }

.body { flex: 1; display: flex; min-height: 0; }

/* 左图标栏 */
.rail { width: 62px; background: linear-gradient(180deg,#f9dfe8,#f5d0dc); display: flex; flex-direction: column;
  align-items: center; padding-top: 14px; gap: 6px; flex-shrink: 0; }
.rail-item { width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative; transition: background .2s; }
.rail-item:hover { background: rgba(255,255,255,.55); }
.rail-item.active { background: #fff; box-shadow: 0 3px 10px rgba(173,20,87,.15); }
.ric { font-size: 20px; }
.rail-bottom { margin-top: auto; margin-bottom: 14px; }
.rbadge { position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: #e53935; color: #fff; font-size: 10.5px; display: flex; align-items: center; justify-content: center; }

/* 列表列 */
.list-col { width: 290px; background: #fff; border-right: 1px solid #f6d5df; display: flex; flex-direction: column; flex-shrink: 0; }
.search-box { padding: 12px 14px 8px; }
.search-box input { width: 100%; height: 36px; border-radius: 999px; border: none; background: #f7e9ee;
  padding: 0 16px; font-size: 13px; }
.list { flex: 1; overflow-y: auto; padding: 4px 8px 10px; }
.list-empty { padding: 40px 16px; text-align: center; font-size: 13px; color: #b98a9b; }
.list-item { display: flex; align-items: center; gap: 10px; padding: 10px 10px; border-radius: 12px;
  cursor: pointer; position: relative; transition: background .15s; }
.list-item:hover { background: #fdf0f4; }
.list-item.active { background: #fce4ec; }
.li-main { flex: 1; min-width: 0; }
.li-top { display: flex; justify-content: space-between; align-items: baseline; }
.li-name { font-size: 14.5px; font-weight: 600; color: #51202f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-time { font-size: 11px; color: #c08fa1; flex-shrink: 0; margin-left: 6px; }
.li-preview { font-size: 12.5px; color: #a06d7e; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: #e53935; color: #fff;
  font-size: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* 聊天列 */
.chat-col { flex: 1; display: flex; flex-direction: column; min-width: 0; background: #fdf2f5; }
.chat-col.empty { align-items: center; justify-content: center; }
.empty-hint { text-align: center; color: #c08fa1; font-size: 14px; }
.empty-icon { font-size: 46px; margin-bottom: 12px; }
.chat-head { height: 62px; background: rgba(255,255,255,.85); border-bottom: 1px solid #f6d5df;
  display: flex; align-items: center; gap: 11px; padding: 0 18px; flex-shrink: 0; }
.ch-info { flex: 1; min-width: 0; }
.ch-name { font-size: 15.5px; font-weight: 700; color: #51202f; }
.ch-sub { font-size: 11.5px; color: #b77a91; margin-top: 2px; }
.btn-ghost { border: 1.5px solid #f3b8cb; background: #fff; color: #c2185b; border-radius: 999px;
  font-size: 13px; padding: 7px 16px; transition: all .2s; }
.btn-ghost:hover { background: #fce4ec; }
.btn-ghost:disabled { opacity: .5; cursor: not-allowed; }

/* 消息区 */
.msg-area { flex: 1; overflow-y: auto; padding: 18px 22px; }
.msg-loading, .msg-empty { text-align: center; font-size: 13px; color: #b98a9b; padding: 30px 0; }
.msg-row { display: flex; gap: 9px; margin-bottom: 14px; align-items: flex-start; }
.msg-row.self { flex-direction: row-reverse; }
.msg-bubble-wrap { max-width: 62%; display: flex; flex-direction: column; }
.msg-row.self .msg-bubble-wrap { align-items: flex-end; }
.msg-time { font-size: 11px; color: #c08fa1; text-align: center; margin: 4px 0 8px; align-self: center; }
.bubble { padding: 10px 14px; border-radius: 14px; font-size: 14.5px; line-height: 1.55; word-break: break-word;
  white-space: pre-wrap; background: #fff; color: #4a2c35; border-top-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(173,20,87,.08); }
.msg-row.self .bubble { background: linear-gradient(135deg,#f06292,#e0457b); color: #fff;
  border-top-left-radius: 14px; border-top-right-radius: 4px; }
.bubble.image { padding: 5px; background: #fff; }
.msg-img { max-width: 260px; max-height: 260px; border-radius: 10px; display: block; cursor: zoom-in; }

/* 输入区 */
.input-bar { background: #fff; border-top: 1px solid #f6d5df; padding: 8px 14px 12px; position: relative; flex-shrink: 0; }
.toolbar { display: flex; gap: 4px; margin-bottom: 6px; }
.tool-btn { width: 34px; height: 30px; border: none; background: transparent; font-size: 18px; border-radius: 8px; }
.tool-btn:hover { background: #fce4ec; }
.msg-input { width: 100%; height: 74px; border: none; resize: none; font-size: 14.5px; line-height: 1.5;
  padding: 4px 2px; background: transparent; }
.send-row { display: flex; justify-content: flex-end; }
.send-btn { width: 96px; height: 36px; font-size: 14px; }
.emoji-panel { position: absolute; left: 10px; bottom: 100%; width: 342px; max-height: 218px; overflow-y: auto;
  background: #fff; border: 1px solid #f3c6d5; border-radius: 14px; padding: 10px; display: flex; flex-wrap: wrap;
  box-shadow: 0 10px 30px rgba(173,20,87,.18); z-index: 30; margin-bottom: 8px; }
.emoji-cell { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  font-size: 22px; cursor: pointer; border-radius: 8px; }
.emoji-cell:hover { background: #fce4ec; }

/* 情感分析 */
.senti-area { flex: 1; overflow-y: auto; padding: 18px 22px; }
.senti-summary { background: #fff; border-radius: 14px; padding: 16px 18px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 14px; box-shadow: 0 1px 6px rgba(173,20,87,.07); }
.sum-card { text-align: center; min-width: 58px; }
.sum-num { font-size: 22px; font-weight: 700; }
.sum-card.pos .sum-num { color: #2e9e5b; } .sum-card.neu .sum-num { color: #8a8a8a; } .sum-card.neg .sum-num { color: #d32f2f; }
.sum-label { font-size: 12px; color: #a06d7e; margin-top: 2px; }
.sum-bar { flex: 1; }
.sum-bar-inner { height: 12px; border-radius: 6px; overflow: hidden; display: flex; background: #f3e2e8; }
.seg.pos { background: #66bb6a; } .seg.neu { background: #bdbdbd; } .seg.neg { background: #ef5350; }
.sum-tip { font-size: 11.5px; color: #b98a9b; margin-top: 7px; }
.senti-item { background: #fff; border-radius: 14px; padding: 14px 16px; margin-bottom: 12px;
  box-shadow: 0 1px 6px rgba(173,20,87,.07); }
.senti-text { font-size: 14px; color: #4a2c35; line-height: 1.6; }
.senti-meta { display: flex; align-items: center; gap: 8px; margin-top: 9px; flex-wrap: wrap; }
.senti-label { font-size: 12px; font-weight: 600; padding: 3px 12px; border-radius: 999px; }
.senti-label.pos { background: #e8f5e9; color: #2e7d32; }
.senti-label.neg { background: #ffebee; color: #c62828; }
.senti-label.neu { background: #f2f2f2; color: #616161; }
.senti-score { font-size: 12px; color: #a06d7e; }
.senti-kw { font-size: 11.5px; background: #fdeef3; color: #ad1457; padding: 2px 9px; border-radius: 999px; }
.senti-sugg { margin-top: 10px; font-size: 12.8px; color: #6d4c41; background: #fff8e1; border-radius: 10px;
  padding: 9px 12px; line-height: 1.6; }

/* 图片预览 */
.img-preview { position: fixed; inset: 0; background: rgba(0,0,0,.78); z-index: 100; display: flex;
  align-items: center; justify-content: center; cursor: zoom-out; }
.img-preview img { max-width: 92%; max-height: 92%; border-radius: 8px; }

/* toast */
.toast { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); background: rgba(80,20,40,.92);
  color: #fff; font-size: 13.5px; padding: 10px 22px; border-radius: 999px; z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); }

/* 滚动条 */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-thumb { background: #e8b7c7; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }
