/* ==========================================================
   云客服系统 · 统一设计系统（仿 MineAdmin 后台风格）
   ========================================================== */
:root {
  --primary: #409eff;
  --primary-dark: #2d8cf0;
  --primary-light: #ecf5ff;
  --success: #67c23a;
  --warning: #e6a23c;
  --danger: #f56c6c;
  --info: #909399;
  --text-main: #303133;
  --text-regular: #606266;
  --text-secondary: #909399;
  --text-placeholder: #c0c4cc;
  --border: #dcdfe6;
  --border-light: #e4e7ed;
  --bg-page: #f0f2f5;
  --bg-card: #ffffff;
  --bg-hover: #f5f7fa;
  --sidebar-bg: #1d2129;
  --sidebar-bg-dark: #15181e;
  --sidebar-text: #a9b2c3;
  --sidebar-active: #409eff;
  --radius: 6px;
  --shadow-sm: 0 1px 4px rgba(0, 21, 41, .08);
  --shadow: 0 4px 16px rgba(0, 21, 41, .12);
  --shadow-lg: 0 12px 40px rgba(0, 21, 41, .18);
  --sidebar-width: 210px;
  --topbar-height: 58px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg-page);
  color: var(--text-main);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font-family: inherit; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #c8ccd4; border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 基础控件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  height: 32px; padding: 0 14px; border-radius: var(--radius);
  border: 1px solid var(--border); background: #fff; color: var(--text-regular);
  font-size: 13px; cursor: pointer; transition: all .18s; white-space: nowrap; user-select: none;
}
.btn:hover { color: var(--primary); border-color: #a9d3ff; background: var(--primary-light); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { opacity: .88; color:#fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .88; color:#fff; }
.btn-plain-danger { color: var(--danger); border-color: #fbc4c4; background: #fef0f0; }
.btn-plain-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-text { border: none; background: transparent; color: var(--primary); padding: 0 6px; height: 26px; }
.btn-text:hover { background: transparent; color: var(--primary-dark); text-decoration: underline; }
.btn-sm { height: 26px; padding: 0 10px; font-size: 12px; }
.btn-lg { height: 40px; padding: 0 22px; font-size: 14px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.input, .textarea, .select {
  width: 100%; height: 32px; padding: 0 10px; border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-regular); background: #fff; font-size: 13px;
  outline: none; transition: border-color .18s, box-shadow .18s;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(64,158,255,.14); }
.textarea { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: var(--text-placeholder); }
.input-sm { height: 28px; font-size: 12px; }
.input-group { display: flex; align-items: center; gap: 8px; }

.form-item { margin-bottom: 16px; }
.form-item label { display: block; margin-bottom: 6px; color: var(--text-regular); font-size: 13px; }
.form-item .hint { margin-top: 4px; font-size: 12px; color: var(--text-secondary); line-height: 1.6; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.required::before { content: "*"; color: var(--danger); margin-right: 3px; }

.switch { position: relative; display: inline-block; width: 40px; height: 20px; cursor: pointer; vertical-align: middle; }
.switch input { display: none; }
.switch .slider { position: absolute; inset: 0; background: #dcdfe6; border-radius: 20px; transition: .2s; }
.switch .slider::before { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(20px); }

.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 3px; font-size: 12px; background: var(--primary-light); color: var(--primary); border: 1px solid #d9ecff; white-space: nowrap; }
.tag-success { background: #f0f9eb; color: var(--success); border-color: #e1f3d8; }
.tag-warning { background: #fdf6ec; color: var(--warning); border-color: #faecd8; }
.tag-danger { background: #fef0f0; color: var(--danger); border-color: #fde2e2; }
.tag-info { background: #f4f4f5; color: var(--info); border-color: #e9e9eb; }
.tag-close { margin-left: 4px; cursor: pointer; font-size: 12px; opacity: .65; }
.tag-close:hover { opacity: 1; }

.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 12px; line-height: 1; }
.dot-status { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.dot-online { background: var(--success); box-shadow: 0 0 0 2px rgba(103,194,58,.18); }
.dot-offline { background: #c0c4cc; }

/* ---------- 布局 ---------- */
.layout { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: var(--sidebar-width); flex-shrink: 0; height: 100%; background: var(--sidebar-bg);
  display: flex; flex-direction: column; transition: width .2s; overflow: hidden;
}
.sidebar-header { height: var(--topbar-height); display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid rgba(255,255,255,.06); flex-shrink: 0; }
.sidebar-logo { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg,#409eff,#2d7ff9); color: #fff; font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(64,158,255,.4); }
.sidebar-title { color: #fff; font-size: 15px; font-weight: 600; letter-spacing: .5px; }
.sidebar-sub { color: #6b7688; font-size: 11px; margin-top: 2px; }
.sidebar-menu { flex: 1; overflow-y: auto; padding: 10px 0; }
.menu-group-label { padding: 10px 18px 6px; font-size: 11px; color: #5c6878; letter-spacing: 1px; }
.menu-item {
  display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 18px; margin: 2px 10px;
  color: var(--sidebar-text); font-size: 13px; cursor: pointer; border-radius: 6px;
  transition: background .15s, color .15s; position: relative; user-select: none;
}
.menu-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.menu-item.active { background: rgba(64,158,255,.14); color: #fff; }
.menu-item.active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; background: var(--primary); border-radius: 0 3px 3px 0; }
.menu-item .icon { width: 18px; text-align: center; font-size: 15px; opacity: .9; }
.menu-item .badge-dot { margin-left: auto; }
.sidebar-footer { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.06); color: #5c6878; font-size: 11px; line-height: 1.7; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--topbar-height); flex-shrink: 0; background: #fff; border-bottom: 1px solid #ebeef5;
  display: flex; align-items: center; gap: 16px; padding: 0 20px; box-shadow: 0 1px 4px rgba(0,21,41,.04); z-index: 10;
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.breadcrumb { display: flex; align-items: center; gap: 6px; color: var(--text-secondary); font-size: 13px; }
.breadcrumb .current { color: var(--text-main); font-weight: 500; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.topbar-btn { width: 34px; height: 34px; border-radius: 6px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-regular); position: relative; transition: .15s; }
.topbar-btn:hover { background: var(--bg-hover); color: var(--primary); }
.topbar-btn .badge { position: absolute; top: 2px; right: 0; }
.user-chip { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.user-chip:hover { background: var(--bg-hover); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #dbe7ff; color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; overflow: hidden; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 48px; height: 48px; font-size: 18px; }
.avatar-sm { width: 24px; height: 24px; font-size: 11px; }
.user-meta { line-height: 1.3; }
.user-meta .name { font-size: 13px; color: var(--text-main); }
.user-meta .role { font-size: 11px; color: var(--text-secondary); }

.page { flex: 1; overflow-y: auto; padding: 16px 20px 24px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.page-head h2 { font-size: 17px; font-weight: 600; color: var(--text-main); }
.page-head p { margin-top: 4px; font-size: 12px; color: var(--text-secondary); line-height: 1.6; max-width: 700px; }
.page-actions { display: flex; gap: 8px; flex-shrink: 0; }

.card { background: var(--bg-card); border-radius: 8px; box-shadow: var(--shadow-sm); margin-bottom: 16px; }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #f0f2f5; }
.card-title { font-size: 14px; font-weight: 600; color: var(--text-main); display: flex; align-items: center; gap: 8px; }
.card-title::before { content: ""; width: 3px; height: 14px; background: var(--primary); border-radius: 2px; }
.card-body { padding: 16px 18px; }
.card-body-flush { padding: 0; }

/* ---------- 数据表格 ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { background: #fafafa; color: var(--text-secondary); font-weight: 500; text-align: left; padding: 10px 12px; border-bottom: 1px solid #ebeef5; white-space: nowrap; font-size: 12px; }
.table td { padding: 11px 12px; border-bottom: 1px solid #f2f3f5; color: var(--text-regular); vertical-align: middle; }
.table tr:hover td { background: #f8fafc; }
.table td .actions { display: flex; gap: 4px; flex-wrap: wrap; }
.table-empty { padding: 50px 0; text-align: center; color: var(--text-secondary); font-size: 13px; }
.table-empty .icon { font-size: 30px; display: block; margin-bottom: 8px; opacity: .4; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid #f0f2f5; }
.toolbar .input { width: 220px; }
.toolbar .select { width: 140px; }
.toolbar .spacer { margin-left: auto; }

.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 14px 18px; color: var(--text-secondary); font-size: 12px; }
.pagination .info { margin-right: auto; }
.page-btn { min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: 4px; background: #fff; cursor: pointer; color: var(--text-regular); font-size: 12px; }
.page-btn:hover:not(:disabled) { color: var(--primary); border-color: #a9d3ff; }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- 统计卡片 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stat-card { background: #fff; border-radius: 8px; padding: 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; transition: transform .2s, box-shadow .2s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card .label { font-size: 12px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
.stat-card .value { font-size: 26px; font-weight: 600; color: var(--text-main); margin: 10px 0 4px; font-variant-numeric: tabular-nums; }
.stat-card .sub { font-size: 12px; color: var(--text-secondary); }
.stat-card .icon-wrap { position: absolute; right: 14px; top: 16px; width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; background: var(--primary-light); color: var(--primary); }
.stat-card.green .icon-wrap { background: #f0f9eb; color: var(--success); }
.stat-card.orange .icon-wrap { background: #fdf6ec; color: var(--warning); }
.stat-card.red .icon-wrap { background: #fef0f0; color: var(--danger); }

.chart { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding: 10px 4px 0; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart-bars { display: flex; align-items: flex-end; gap: 3px; height: 100%; width: 100%; justify-content: center; }
.chart-bar { width: 10px; border-radius: 3px 3px 0 0; background: var(--primary); min-height: 2px; transition: height .5s; opacity: .85; }
.chart-bar.in { background: #79bbff; }
.chart-bar.out { background: #67c23a; }
.chart-label { font-size: 11px; color: var(--text-secondary); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-secondary); }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1000; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 20px; overflow-y: auto; animation: fadeIn .18s; }
.modal { width: 100%; max-width: 640px; background: #fff; border-radius: 10px; box-shadow: var(--shadow-lg); animation: slideDown .22s; }
.modal-lg { max-width: 860px; }
.modal-sm { max-width: 420px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid #f0f2f5; }
.modal-title { font-size: 15px; font-weight: 600; color: var(--text-main); }
.modal-close { width: 28px; height: 28px; border: none; background: transparent; cursor: pointer; color: var(--text-secondary); font-size: 16px; border-radius: 4px; }
.modal-close:hover { background: var(--bg-hover); color: var(--text-main); }
.modal-body { padding: 20px; max-height: 66vh; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid #f0f2f5; }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideDown { from { transform: translateY(-16px); opacity: .4 } to { transform: translateY(0); opacity: 1 } }

.toast-wrap { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 6px; background: #fff; box-shadow: var(--shadow); font-size: 13px; border-left: 3px solid var(--primary); animation: toastIn .2s; }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
@keyframes toastIn { from { transform: translateY(-12px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }

/* ---------- 会话监控 / 聊天 ---------- */
.chat-layout { flex: 1; display: flex; min-height: 0; overflow: hidden; background: #fff; }
.conv-col { width: 290px; flex-shrink: 0; border-right: 1px solid #ebeef5; display: flex; flex-direction: column; min-height: 0; background: #fafbfc; }
.conv-search { padding: 12px; border-bottom: 1px solid #f0f2f5; }
.conv-tabs { display: flex; gap: 2px; padding: 6px 8px; border-bottom: 1px solid #f0f2f5; overflow-x: auto; }
.conv-tab { padding: 5px 10px; border-radius: 4px; font-size: 12px; color: var(--text-secondary); cursor: pointer; white-space: nowrap; }
.conv-tab.active { background: var(--primary-light); color: var(--primary); font-weight: 500; }
.conv-tab .cnt { opacity: .7; margin-left: 2px; }
.conv-list { flex: 1; overflow-y: auto; }
.conv-item { display: flex; gap: 10px; padding: 12px; cursor: pointer; border-bottom: 1px solid #f5f6f8; transition: background .12s; position: relative; }
.conv-item:hover { background: #fff; }
.conv-item.active { background: #fff; box-shadow: inset 3px 0 0 var(--primary); }
.conv-item .avatar { width: 38px; height: 38px; }
.conv-item-main { flex: 1; min-width: 0; }
.conv-item-top { display: flex; align-items: center; gap: 6px; }
.conv-item-top .name { font-size: 13px; color: var(--text-main); font-weight: 500; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-item-top .time { margin-left: auto; font-size: 11px; color: var(--text-placeholder); }
.conv-item-bottom { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.conv-item-bottom .preview { font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.conv-item .badge { flex-shrink: 0; }
.conv-item .status-dot { position: absolute; left: 38px; bottom: 14px; width: 8px; height: 8px; border-radius: 50%; }
.conv-item .status-dot.online { background: var(--success); }
.conv-item .status-dot.pending { background: var(--warning); }

.chat-col { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-header { height: 60px; flex-shrink: 0; padding: 0 18px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #ebeef5; }
.chat-header .avatar { width: 36px; height: 36px; }
.chat-header .info { line-height: 1.35; }
.chat-header .info .name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.chat-header .info .sub { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.chat-header .actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.chat-body { flex: 1; overflow-y: auto; padding: 18px; background: #f5f7fa; min-height: 0; }
.chat-tip { text-align: center; font-size: 11px; color: var(--text-placeholder); margin: 10px 0; }
.msg-row { display: flex; gap: 8px; margin-bottom: 16px; align-items: flex-start; }
.msg-row.out { flex-direction: row-reverse; }
.msg-row .avatar { width: 32px; height: 32px; }
.msg-main { max-width: 64%; }
.msg-row.out .msg-main { display: flex; flex-direction: column; align-items: flex-end; }
.msg-meta { font-size: 11px; color: var(--text-placeholder); margin-bottom: 4px; display: flex; gap: 6px; align-items: center; }
.msg-row.out .msg-meta { flex-direction: row-reverse; }
.bubble { padding: 9px 13px; border-radius: 6px; font-size: 13px; line-height: 1.65; background: #fff; color: var(--text-main); box-shadow: 0 1px 2px rgba(0,0,0,.05); word-break: break-word; white-space: pre-wrap; }
.msg-row.out .bubble { background: #d9ecff; color: #1f2d3d; }
.msg-row.system { justify-content: center; }
.msg-row.system .bubble { background: transparent; box-shadow: none; color: var(--text-secondary); font-size: 12px; text-align: center; padding: 2px 0; }
.bubble img { max-width: 220px; max-height: 220px; border-radius: 4px; display: block; cursor: pointer; object-fit: cover; }
.bubble .file-box { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.msg-status { font-size: 11px; color: var(--danger); margin-top: 3px; }
.msg-status.pending { color: var(--text-secondary); }
.msg-row .time { font-size: 11px; color: var(--text-placeholder); }

.chat-composer { flex-shrink: 0; border-top: 1px solid #ebeef5; background: #fff; }
.composer-toolbar { display: flex; align-items: center; gap: 4px; padding: 8px 12px 0; flex-wrap: wrap; }
.tool-btn { height: 28px; padding: 0 9px; border: none; background: transparent; border-radius: 4px; cursor: pointer; color: var(--text-regular); font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }
.tool-btn:hover { background: var(--bg-hover); color: var(--primary); }
.tool-btn.ai { color: #7b61ff; }
.tool-btn.ai:hover { background: #f3f0ff; }
.composer-input { width: 100%; border: none; outline: none; resize: none; padding: 10px 14px; font-size: 13px; line-height: 1.65; min-height: 74px; max-height: 150px; color: var(--text-main); background: transparent; }
.composer-bottom { display: flex; align-items: center; justify-content: space-between; padding: 0 12px 10px; }
.composer-hint { font-size: 11px; color: var(--text-placeholder); }

.suggest-pop { position: absolute; bottom: 100%; left: 12px; right: 12px; background: #fff; border: 1px solid #ebeef5; border-radius: 8px; box-shadow: var(--shadow); max-height: 240px; overflow-y: auto; z-index: 20; display: none; }
.suggest-pop.show { display: block; }
.suggest-item { padding: 9px 12px; cursor: pointer; border-bottom: 1px solid #f7f8fa; }
.suggest-item:hover { background: var(--primary-light); }
.suggest-item .t { font-size: 12px; color: var(--primary); margin-bottom: 2px; }
.suggest-item .c { font-size: 12px; color: var(--text-regular); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-empty { padding: 14px; text-align: center; color: var(--text-placeholder); font-size: 12px; }

/* 右侧客户信息 */
.profile-col { width: 290px; flex-shrink: 0; border-left: 1px solid #ebeef5; background: #fff; display: flex; flex-direction: column; min-height: 0; }
.profile-scroll { flex: 1; overflow-y: auto; }
.profile-head { padding: 18px; text-align: center; border-bottom: 1px solid #f0f2f5; }
.profile-head .avatar { width: 56px; height: 56px; margin: 0 auto 10px; font-size: 20px; }
.profile-head .name { font-size: 14px; font-weight: 600; }
.profile-head .level { margin-top: 6px; }
.profile-section { padding: 14px 16px; border-bottom: 1px solid #f5f6f8; }
.profile-section h4 { font-size: 12px; color: var(--text-secondary); margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.profile-field { display: flex; justify-content: space-between; font-size: 12px; padding: 5px 0; gap: 10px; }
.profile-field .k { color: var(--text-secondary); flex-shrink: 0; }
.profile-field .v { color: var(--text-regular); text-align: right; word-break: break-all; }
.profile-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.quick-list { padding: 8px 12px 16px; }
.quick-item { padding: 8px 10px; border-radius: 4px; cursor: pointer; border: 1px solid transparent; margin-bottom: 4px; }
.quick-item:hover { background: var(--primary-light); border-color: #d9ecff; }
.quick-item .t { font-size: 12px; color: var(--primary); margin-bottom: 3px; }
.quick-item .c { font-size: 11px; color: var(--text-secondary); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- 空状态 / 加载 ---------- */
.empty { padding: 60px 20px; text-align: center; color: var(--text-secondary); }
.empty .icon { font-size: 40px; opacity: .35; display: block; margin-bottom: 12px; }
.empty p { font-size: 13px; }
.loading { padding: 40px; text-align: center; color: var(--text-secondary); font-size: 13px; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid #e4e7ed; border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; vertical-align: middle; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg) } }

/* ---------- 登录页 ---------- */
.login-page { min-height: 100vh; display: flex; background: #0f1420; }
.login-left { flex: 1; padding: 60px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; background: radial-gradient(800px 500px at 20% 10%, rgba(64,158,255,.22), transparent 60%), radial-gradient(700px 400px at 80% 90%, rgba(103,194,58,.12), transparent 60%), #10151f; }
.login-left::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px); background-size: 40px 40px; pointer-events: none; }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 40px; position: relative; z-index: 1; }
.login-brand .logo { width: 48px; height: 48px; border-radius: 12px; background: linear-gradient(135deg,#409eff,#2d7ff9); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; color: #fff; box-shadow: 0 10px 30px rgba(64,158,255,.4); }
.login-brand h1 { font-size: 24px; color: #f5f8ff; font-weight: 600; letter-spacing: .5px; }
.login-brand p { font-size: 12px; color: #6b7688; margin-top: 4px; }
.login-features { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 18px; max-width: 460px; }
.login-feature { display: flex; gap: 14px; align-items: flex-start; }
.login-feature .ico { width: 40px; height: 40px; border-radius: 10px; background: rgba(64,158,255,.12); border: 1px solid rgba(64,158,255,.25); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.login-feature h3 { font-size: 14px; color: #dfe6f1; font-weight: 500; margin-bottom: 4px; }
.login-feature p { font-size: 12px; color: #6b7688; line-height: 1.7; }
.login-stats { display: flex; gap: 36px; margin-top: 44px; position: relative; z-index: 1; }
.login-stats .item .n { font-size: 26px; font-weight: 600; color: #fff; }
.login-stats .item .l { font-size: 12px; color: #6b7688; margin-top: 2px; }
.login-right { width: 460px; flex-shrink: 0; background: #fff; display: flex; flex-direction: column; justify-content: center; padding: 50px 48px; }
.login-right h2 { font-size: 22px; font-weight: 600; color: var(--text-main); }
.login-right p.sub { font-size: 13px; color: var(--text-secondary); margin: 8px 0 28px; }
.role-tabs { display: flex; gap: 8px; margin-bottom: 22px; }
.role-tab { flex: 1; text-align: center; padding: 9px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; cursor: pointer; color: var(--text-regular); transition: .18s; }
.role-tab.active { border-color: var(--primary); color: var(--primary); background: var(--primary-light); font-weight: 500; }
.login-right .input { height: 42px; font-size: 14px; }
.login-right .form-item label { font-size: 13px; }
.login-right .btn-primary { height: 42px; font-size: 14px; margin-top: 6px; }
.login-error { background: #fef0f0; border: 1px solid #fde2e2; color: var(--danger); padding: 9px 12px; border-radius: 6px; font-size: 12px; margin-bottom: 14px; display: none; }
.login-tip { margin-top: 18px; font-size: 11px; color: var(--text-placeholder); line-height: 1.8; }
.login-tip strong { color: var(--text-secondary); font-weight: 500; }
.copyright { margin-top: 30px; font-size: 11px; color: var(--text-placeholder); }
@media (max-width: 900px) { .login-left { display: none } .login-right { width: 100% } }

/* ---------- 快捷回复弹窗 / 其他 ---------- */
.qr-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.qr-card { border: 1px solid #ebeef5; border-radius: 6px; padding: 10px 12px; cursor: pointer; transition: .15s; }
.qr-card:hover { border-color: var(--primary); background: var(--primary-light); }
.qr-card .t { font-size: 12px; font-weight: 500; margin-bottom: 4px; color: var(--text-main); }
.qr-card .c { font-size: 11px; color: var(--text-secondary); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.settings-nav { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; }
.settings-nav .item { padding: 7px 14px; border-radius: 6px; font-size: 13px; color: var(--text-regular); cursor: pointer; background: #fff; border: 1px solid #ebeef5; }
.settings-nav .item.active { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }
.settings-section h3 { font-size: 14px; margin-bottom: 4px; }
.settings-section p.desc { font-size: 12px; color: var(--text-secondary); margin-bottom: 18px; line-height: 1.7; }

.kv-list { display: flex; flex-direction: column; gap: 0; }
.kv-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f5f6f8; font-size: 13px; }
.kv-row .k { color: var(--text-secondary); }
.kv-row .v { color: var(--text-main); font-weight: 500; }

.alert { padding: 10px 14px; border-radius: 6px; font-size: 12px; line-height: 1.7; margin-bottom: 14px; }
.alert-info { background: #ecf5ff; border: 1px solid #d9ecff; color: #4076b6; }
.alert-warning { background: #fdf6ec; border: 1px solid #faecd8; color: #b8862c; }
.alert-danger { background: #fef0f0; border: 1px solid #fde2e2; color: #c45656; }

.code-box { background: #0f1420; border-radius: 6px; padding: 12px 14px; font-family: Consolas, Monaco, monospace; font-size: 12px; color: #93c5fd; overflow-x: auto; white-space: pre-wrap; line-height: 1.7; }

@media (max-width: 1280px) {
  .profile-col { width: 250px; }
  .conv-col { width: 260px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
  .profile-col { display: none; }
  .sidebar { width: 64px; }
  .sidebar .sidebar-title, .sidebar .sidebar-sub, .sidebar .menu-item span.label, .sidebar .menu-group-label, .sidebar-footer { display: none; }
  .sidebar .menu-item { justify-content: center; padding: 0; margin: 4px 8px; }
  .sidebar .menu-item .icon { font-size: 18px; }
}
