}
* { margin:0; padding:0; box-sizing:border-box; }
html, body { height:100%; }
body { font-family:"Microsoft YaHei",system-ui,sans-serif; background:#f0f2f5; }
.btn { padding:10px 22px; border:none; border-radius:10px; font-size:14px; cursor:pointer; }
.btn.primary { background:#4f7cff; color:#fff; }
.btn.primary:hover { background:#3d68e0; }
.btn.ghost { background:#f0f1f3; color:#666; }
.btn.ghost:hover { background:#e4e6ea; }
.btn.warn { background:#fff3e0; color:#e65100; }
.btn.small { padding:6px 14px; font-size:12px; }

.avatar { width:38px; height:38px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-weight:bold; color:#fff; flex-shrink:0; font-size:15px; }
.avatar-img { object-fit:cover; }
.avatar-text { background:#ff7043; }
.avatar.sm, .avatar-text.sm { width:32px; height:32px; font-size:13px; }
.avatar.small-font { font-size:11px; }
.avatar-wrap { display:flex; align-items:flex-end; }

/* 访客聊天页（全屏） */
.chat-page { height:100vh; height:100dvh; display:flex; flex-direction:column; padding:0; overflow:hidden; }
.chat-panel { width:100%; max-width:none; height:100%; background:#fff; border-radius:0; display:flex; flex-direction:column; box-shadow:none; overflow:hidden; flex:1; min-height:0; }
.chat-header { padding:14px 18px; border-bottom:1px solid #eee; display:flex; align-items:center; gap:10px; background:#fff; flex-shrink:0; }
.chat-title { font-size:15px; font-weight:600; }
.chat-status { font-size:12px; color:#999; }
.chat-status.ai { color:#7c4dff; }
.chat-status.on { color:#4caf50; }
.chat-body { flex:1; overflow-y:auto; padding:18px; display:flex; flex-direction:column; gap:12px; background:#fafbfc; min-height:0; }
.msg-row { display:flex; align-items:flex-end; gap:8px; }
.msg-row.me { justify-content:flex-end; }
.bubble { max-width:70%; padding:10px 14px; border-radius:12px; font-size:14px; line-height:1.6; word-break:break-all; white-space:pre-wrap; }
.msg-row.me .bubble { background:#4f7cff; color:#fff; border-bottom-right-radius:4px; }
.msg-row.other .bubble { background:#eef0f3; color:#333; border-bottom-left-radius:4px; }
.msg-row.ai-row .bubble { background:#f3efff; border:1px solid #e5dcff; }
.chat-input { padding:12px 16px; border-top:1px solid #eee; display:flex; gap:10px; background:#fff; flex-shrink:0; }
.chat-input input { flex:1; padding:11px 14px; border:1px solid #ddd; border-radius:10px; font-size:14px; outline:none; }
.chat-input input:focus { border-color:#4f7cff; }

/* 登录页 */
.login-page { min-height:100vh; display:flex; align-items:center; justify-content:center; }
.login-box { width:340px; background:#fff; border-radius:16px; padding:32px; display:flex; flex-direction:column; gap:14px; box-shadow:0 6px 24px rgba(0,0,0,.08); }
.login-title { font-size:18px; font-weight:600; text-align:center; margin-bottom:6px; }
.login-box input { padding:12px 14px; border:1px solid #ddd; border-radius:10px; font-size:14px; outline:none; }
.login-err { color:#c62828; font-size:13px; text-align:center; }
.login-ok { color:#2e7d32; font-size:13px; text-align:center; padding:8px; background:#f0f9f1; border-radius:8px; }

/* 工作台 */
.admin-page { height:100vh; display:flex; }
.admin-side { width:300px; background:#fff; border-right:1px solid #eee; display:flex; flex-direction:column; }
.admin-side-header { padding:14px 16px; border-bottom:1px solid #eee; display:flex; align-items:center; justify-content:space-between; font-weight:600; font-size:14px; gap:6px; }
.session-list { flex:1; overflow-y:auto; padding:8px; }
.session-item { display:flex; align-items:center; gap:10px; padding:10px; border-radius:10px; cursor:pointer; }
.session-item:hover { background:#f5f7ff; }
.session-item.active { background:#f0f4ff; }
.session-info { flex:1; min-width:0; }
.session-name { font-size:13px; font-weight:600; }
.session-last { font-size:12px; color:#999; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.badge { background:#f44336; color:#fff; font-size:10px; border-radius:10px; padding:1px 6px; margin-left:4px; }
.session-status { font-size:11px; color:#999; }
.session-status.st1 { color:#4caf50; }
.admin-main { flex:1; display:flex; flex-direction:column; background:#fff; }
.header-actions { display:flex; gap:8px; }
.empty { text-align:center; color:#999; font-size:13px; padding:30px 0; }

/* 设置页 */
.settings-page { min-height:100vh; display:flex; align-items:flex-start; justify-content:center; padding:40px 16px; }
.settings-box { width:100%; max-width:560px; background:#fff; border-radius:16px; box-shadow:0 6px 24px rgba(0,0,0,.08); overflow:hidden; padding-bottom:24px; }
.settings-box form { padding:20px 24px; display:flex; flex-direction:column; gap:14px; }
.form-group { display:flex; flex-direction:column; gap:6px; }
.form-group label { font-size:13px; color:#666; }
.form-group input, .form-group textarea { padding:10px 12px; border:1px solid #ddd; border-radius:8px; font-size:14px; outline:none; font-family:inherit; }
.form-group input:focus, .form-group textarea:focus { border-color:#4f7cff; }
.switch-label { display:flex; align-items:center; gap:8px; font-size:14px; color:#333; cursor:pointer; }
.switch-label input { accent-color:#4f7cff; width:16px; height:16px; }

/* 移动端适配 */
@media (max-width:720px) {
  .admin-page { flex-direction:column; height:auto; }
  .admin-side { width:100%; height:280px; }
  .admin-main { height:70vh; }
  .chat-header { padding:10px 12px; }
  .chat-header .btn.ghost.small { padding:6px 10px; font-size:12px; }
  .chat-title { font-size:14px; }
  .chat-body { padding:10px; }
  .chat-input { padding:8px 10px; gap:8px; }
  .chat-input input { font-size:16px; padding:10px 12px; }
  .chat-input .btn { padding:10px 18px; }
}
