/* web-kefu 工作台 pages.css —— 三栏壳布局、子页面布局、登录页、响应式（<1024 收起右栏，<768 列表 / 聊天切换） */

/* ---- 壳 ---- */
.shell { display: flex; height: 100%; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.main-body { flex: 1; display: flex; min-height: 0; position: relative; }

/* ---- 子页面（快捷回复 / 客服 / 设置） ---- */
.page { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.page-head { display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.page-title { font-size: var(--fs-lg); }
.page-body { flex: 1; overflow: auto; padding: 20px 24px 32px; width: 100%; max-width: 1080px; }

/* ---- 登录页 ---- */
.login { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: var(--bg); }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-md); padding: 32px 28px 28px; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 24px; text-align: center; }
.login-logo { width: 52px; height: 52px; border-radius: 14px; background: var(--brand-600); color: var(--brand-contrast); display: flex; align-items: center; justify-content: center; font-size: var(--fs-2xl); font-weight: 600; }
.login-title { font-size: var(--fs-xl); font-weight: 600; }
.login-sub { font-size: var(--fs-sm); color: var(--text-muted); }
.login .field + .field { margin-top: 14px; }
.login .input { height: var(--h-control); font-size: 15px; }
.login-submit { margin-top: 22px; height: var(--h-control); font-size: 15px; }
.login-alert { display: flex; align-items: flex-start; gap: 8px; margin-top: 14px; padding: 10px 12px; border-radius: var(--r-btn); font-size: var(--fs-sm); background: var(--danger-soft); color: var(--danger); line-height: 1.5; }
.login-alert.is-locked { background: var(--accent-soft); color: var(--text); }
.login-alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.login-foot { margin-top: 18px; text-align: center; font-size: var(--fs-xs); color: var(--text-muted); }
.login-card.is-shake { animation: kf-shake .32s var(--ease); }
@keyframes kf-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* ---- 响应式 ---- */
@media (max-width: 1279px) {
  .convlist { width: 288px; }
}
@media (max-width: 1023px) {
  /* 右栏默认收起；打开时作为浮层盖在聊天区右侧 */
  .vpanel { position: absolute; top: 0; right: 0; bottom: 0; z-index: 20; box-shadow: var(--shadow-md); }
  .settings-grid { grid-template-columns: 1fr; }
  .page-search { width: 160px; }
}
@media (max-width: 767px) {
  .shell { flex-direction: column-reverse; }
  .rail { width: 100%; height: 56px; flex-direction: row; justify-content: space-around; padding: 0 8px; gap: 0; border-right: 0; border-top: 1px solid var(--border); }
  .rail-brand, .rail-spacer, .rail-me, .rail-mute { display: none; }
  .rail-item { width: auto; min-width: 64px; height: 48px; }
  .shell.view-chat.pane-chat .rail { display: none; }
  .convlist { width: 100%; border-right: 0; }
  .chat { display: none; }
  .shell.pane-chat .convlist { display: none; }
  .shell.pane-chat .chat { display: flex; }
  .chat-back { display: inline-flex; }
  .chat-head { padding: 0 8px 0 8px; gap: 8px; height: 56px; }
  .chat-body { padding: 10px 12px 14px; }
  .msg-main { max-width: 82%; }
  .vpanel { width: min(100%, 320px); }
  .page-head { padding: 0 14px; gap: 8px; flex-wrap: wrap; height: auto; min-height: 56px; padding-top: 8px; padding-bottom: 8px; }
  .page-body { padding: 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .toast-container { top: 8px; right: 8px; left: 8px; width: auto; }
  .chat-jump { bottom: 120px; }
  .drop-hint { margin: -10px -12px -14px; }
}
@media (max-width: 479px) {
  /* 360px 基准：头部按钮只留图标，保证不溢出 */
  .chat-actions .btn span { display: none; }
  .chat-actions .btn { width: 32px; padding: 0; }
  .page-search { width: 100%; order: 10; }
  .bubble-img img, .bubble-img { max-width: 220px; }
  .bubble-video { max-width: 240px; }
  .audio { min-width: 170px; }
  .bubble-file { min-width: 170px; }
  .composer-main { padding: 6px 8px 8px; }
  .composer-send span { display: none; }
  .composer-send { width: 34px; padding: 0; }
  .login-card { padding: 24px 18px 20px; }
  .td-actions .btn span { display: none; }
  .quick-pop { left: 6px; right: 6px; }
}
@media (min-width: 768px) {
  /* 桌面：聊天区始终显示，移动端的 pane 切换不生效 */
  .shell.pane-chat .convlist { display: flex; }
}
@media print { .rail, .convlist, .composer, .vpanel { display: none !important; } }
