/* AnkerYe-Chat 工作台 · 深色侧栏 + 白色聊天区 */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --side: #1a1d2e; --side2: #232740; --acc: #6d5dfc; --acc2: #a86bff;
  --grad: linear-gradient(135deg, #6d5dfc, #a86bff);
  --bg: #f4f6fb; --card: #fff; --txt: #2a2d3e; --sub: #6b7090; --line: #e6e9f2;
}
body { font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--txt); }
button { font: inherit; cursor: pointer; border: none; }
input, textarea { font: inherit; outline: none; }
.hidden { display: none !important; }

/* 登录 */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--side); }
.login-box { width: 100%; max-width: 340px; background: var(--side2); border-radius: 18px; padding: 34px 30px; }
.login-box .logo { font-size: 1.5rem; color: #fff; text-align: center; }
.login-box .sub { color: #8a90b8; text-align: center; margin: 6px 0 22px; font-size: .9rem; }
.login-box input { width: 100%; height: 44px; border-radius: 10px; border: 1px solid #343a5c; background: #1d2136;
  color: #fff; padding: 0 14px; margin-bottom: 12px; }
.login-box input:focus { border-color: var(--acc); }
.login-box button { width: 100%; height: 44px; border-radius: 10px; background: var(--grad); color: #fff; font-weight: 700; }

/* 布局 */
.app { display: flex; height: 100vh; }
.side { width: 320px; flex-shrink: 0; background: var(--side); color: #cfd3ec; display: flex; flex-direction: column; }
.side-hd { display: flex; align-items: center; gap: 8px; padding: 16px 14px 10px; }
.side-hd .dot { width: 10px; height: 10px; border-radius: 50%; background: #2ecc71; box-shadow: 0 0 8px #2ecc71; }
.side-hd b { flex: 1; color: #fff; font-size: .98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-hd button { background: none; color: #8a90b8; font-size: 1rem; padding: 4px 6px; border-radius: 6px; }
.side-hd button:hover { background: var(--side2); color: #fff; }
.side-key { margin: 0 14px 10px; padding: 7px 10px; background: var(--side2); border-radius: 8px; font-size: .74rem;
  color: #8a90b8; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-key:hover { color: #fff; }

/* 会话列表 */
.slist { flex: 1; overflow-y: auto; padding: 4px 8px 14px; }
.sitem { display: flex; gap: 10px; padding: 11px 10px; border-radius: 12px; cursor: pointer; align-items: center; transition: .12s; }
.sitem:hover { background: var(--side2); }
.sitem.on { background: var(--acc); }
.sitem.on .sname, .sitem.on .smsg, .sitem.on .stime { color: #fff; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--grad); color: #fff; display: grid;
  place-items: center; font-weight: 800; flex-shrink: 0; }
.sinfo { flex: 1; min-width: 0; }
.sname { color: #fff; font-size: .9rem; font-weight: 600; display: flex; justify-content: space-between; }
.stime { color: #6b7090; font-size: .72rem; font-weight: 400; }
.smsg { color: #8a90b8; font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; }
.sunread { min-width: 19px; height: 19px; border-radius: 10px; background: #e74c3c; color: #fff; font-size: .7rem;
  font-weight: 700; display: grid; place-items: center; padding: 0 5px; flex-shrink: 0; }
.sclosed { font-size: .68rem; color: #6b7090; border: 1px solid #3a3f63; padding: 1px 6px; border-radius: 6px; flex-shrink: 0; }

/* 聊天区 */
.chat { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-empty { flex: 1; display: grid; place-items: center; color: var(--sub); font-size: 1.05rem; }
.chat-main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-hd { background: var(--card); border-bottom: 1px solid var(--line); padding: 14px 20px; display: flex;
  align-items: center; justify-content: space-between; }
.chat-hd b { font-size: 1rem; }
.chat-hd span { display: block; color: var(--sub); font-size: .76rem; margin-top: 2px; max-width: 480px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-close { background: #fdeeee; color: #e74c3c; border-radius: 9px; padding: 8px 14px; font-size: .85rem; font-weight: 600; }
.b-close:hover { background: #e74c3c; color: #fff; }
.msgs { flex: 1; overflow-y: auto; padding: 20px 22px; }
.mrow { display: flex; margin-bottom: 14px; }
.mrow.me { justify-content: flex-end; }
.bb { max-width: 62%; padding: 10px 14px; border-radius: 14px; font-size: .92rem; line-height: 1.55;
  word-break: break-word; white-space: pre-wrap; }
.mrow.me .bb { background: var(--acc); color: #fff; border-bottom-right-radius: 4px; }
.mrow.ta .bb { background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.mrow.sys { justify-content: center; }
.mrow.sys .bb { background: #eef0f6; color: var(--sub); font-size: .8rem; padding: 5px 12px; border-radius: 9px; }
.mt { font-size: .68rem; color: #a9aec4; margin-top: 4px; }
.mrow.me .mt { text-align: right; }
.chat-ft { background: var(--card); border-top: 1px solid var(--line); padding: 12px 16px; display: flex; gap: 10px; }
.chat-ft textarea { flex: 1; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; resize: none; }
.chat-ft textarea:focus { border-color: var(--acc); }
.chat-ft button { background: var(--grad); color: #fff; border-radius: 12px; padding: 0 26px; font-weight: 700; }

/* 弹窗 / 提示 */
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 440px; padding: 26px; max-height: 90vh; overflow-y: auto; }
.modal h3 { margin-bottom: 16px; }
.fld { margin-bottom: 12px; }
.fld label { display: block; font-size: .82rem; color: var(--sub); margin-bottom: 5px; }
.fld input, .fld textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; }
.fld input:focus, .fld textarea:focus { border-color: var(--acc); }
.modal .act { display: flex; gap: 10px; margin-top: 18px; }
.modal .act button { flex: 1; height: 42px; border-radius: 10px; font-weight: 600; }
.modal .act .ok { background: var(--grad); color: #fff; }
.modal .act .no { background: #eef0f6; color: var(--txt); }
.toast { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); background: #2a2d3e; color: #fff;
  padding: 10px 22px; border-radius: 10px; z-index: 999; font-size: .9rem; box-shadow: 0 6px 20px rgba(0,0,0,.25); }

/* 手机端:列表/聊天 两屏切换 */
@media (max-width: 760px) {
  .side { width: 100vw; }
  .app.chatting .side { display: none; }
  .chat { display: none; }
  .app.chatting .chat { display: flex; width: 100vw; }
  .chat-hd { padding: 10px 12px; }
  .chat-hd b::before { content: "‹ "; color: var(--acc); font-weight: 800; }
  .bb { max-width: 82%; }
}
