/* ===================================================================
   usr-dash.css — v4 高可读性深色主题
   重点：文字清晰、对比度足够、干净
   =================================================================== */

/* ── 色盘 ── */
:root {
  --bg-main: #161b22;
  --bg-surface: #1c2128;
  --bg-elevated: #22272e;
  --bg-inset: #0d1117;
  --border-subtle: #2d333b;
  --border-default: #373e47;
  --accent: #539bf5;
  --accent2: #6c8ed4;
  --text-primary: #d9e2ef;
  --text-secondary: #a0aec0;
  --text-muted: #768390;
  --success: #57ab5a;
  --danger: #e5534b;
  --warning: #c69026;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --transition-fast: 0.15s ease;
  --transition-smooth: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --sidebar-w: 220px;
  --sidebar-w-mobile: 240px;
}

/* ── 字体 ── */
body {
  font-family: -apple-system, 'Noto Sans SC', 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: 0.01em;
  color: var(--text-primary);
  background: var(--bg-main) !important;
}

/* ── 滚动条 ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-subtle); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-default); }

/* ═══════════════════════════════════════════
   登录页
   ═══════════════════════════════════════════ */
body.login-page {
  background: linear-gradient(135deg, #161b22 0%, #1c2742 50%, #161b22 100%) fixed !important;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 16px;
}
.login-card {
  background: rgba(28, 33, 40, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 40px rgba(0,0,0,.4);
}
.login-card h3 { text-align: center; margin-bottom: 4px; font-weight: 600; }
.login-card .sub-title { text-align: center; color: var(--text-secondary); font-size: 13px; margin-bottom: 24px; }
@media (max-width: 480px) {
  .login-card { padding: 28px 20px; }
}

/* 提交按钮 */
.btn-submit { position: relative; }
.btn-submit.loading { pointer-events: none; opacity: .7; }
.btn-submit.loading .btn-text { visibility: hidden; }
.btn-submit.loading::after {
  content: '';
  position: absolute; top: 50%; left: 50%;
  width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border: 2px solid rgba(255,255,255,.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════
   侧栏
   ═══════════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition-smooth);
}
.sidebar .brand {
  padding: 20px 16px 14px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.3px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 4px;
}
.sidebar .nav-items { flex: 1; overflow-y: auto; padding: 4px 0; }
.sidebar .nav-item a {
  position: relative;
  display: flex;
  align-items: center; gap: 8px;
  padding: 9px 14px;
  margin: 1px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  color: var(--text-secondary);
  font-size: 14px;
}
.sidebar .nav-item a:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,.04);
}
.sidebar .nav-item a.active {
  color: var(--accent);
  background: rgba(83,155,245,.1);
  font-weight: 500;
}
.sidebar .nav-item a.active::before {
  content: '';
  position: absolute; left: -8px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.sidebar .sidebar-footer {
  padding: 12px;
  margin: 4px 8px 8px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
}
.sidebar .sidebar-footer .user-line { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.sidebar .sidebar-footer .user-line .name { font-weight: 600; font-size: 13px; }
.sidebar .sidebar-footer .user-line .persona { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 侧栏遮罩(手机) */
.sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 99;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition-smooth);
}
.sidebar-overlay.show { opacity: 1; pointer-events: auto; }

/* ── 内容区 ── */
.content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding: 20px 24px 80px;
  transition: margin-left var(--transition-smooth);
}

/* 手机顶栏 */
.mobile-header {
  display: none;
  position: sticky; top: 0; z-index: 50;
  background: rgba(22,27,34,.92);
  backdrop-filter: blur(8px);
  padding: 10px 16px;
  margin: -20px -24px 12px;
  border-bottom: 1px solid var(--border-subtle);
  align-items: center; gap: 10px;
}
.mobile-header .hamburger {
  background: none; border: none; color: var(--text-primary);
  font-size: 20px; cursor: pointer; padding: 4px 6px;
  border-radius: var(--radius-sm);
}
.mobile-header .hamburger:hover { background: rgba(255,255,255,.06); }
.mobile-header .page-title { font-size: 15px; font-weight: 600; flex: 1; }

/* 手机底部导航 */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--bottombar, 60px);
  background: var(--bg-surface);
  border-top: 1px solid var(--border-default);
  display: flex; align-items: stretch;
  z-index: 90;
  display: none;
}
.bottom-nav .bn-item {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px;
  background: none; border: none;
  color: var(--text-muted);
  font-size: 10px; cursor: pointer;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav .bn-item .bn-icon { font-size: 18px; line-height: 1; }
.bottom-nav .bn-item.active { color: var(--accent); }
.bottom-nav .bn-item.active::after {
  content: '';
  position: absolute; top: 2px; left: 50%;
  transform: translateX(-50%);
  width: 24px; height: 3px;
  background: var(--accent);
  border-radius: 3px;
}
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .bottom-nav { height: calc(60px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); }
  .content { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
}

/* ═══════════════════════════════════════════
   卡片 ── 干净线框，高可读
   ═══════════════════════════════════════════ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast);
}

/* ═══════════════════════════════════════════
   按钮
   ═══════════════════════════════════════════ */
.btn { transition: all var(--transition-fast); font-weight: 500; }
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--accent);
  border: none;
}
.btn-primary:hover {
  background: #6cb2ff;
}
.btn-outline-secondary {
  border-color: var(--border-default);
  color: var(--text-secondary);
}
.btn-outline-secondary:hover {
  background: rgba(255,255,255,.05);
  color: var(--text-primary);
  border-color: var(--border-default);
}

/* ═══════════════════════════════════════════
   表单
   ═══════════════════════════════════════════ */
.form-control, .form-select {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
}
.form-control:focus, .form-select:focus {
  background: var(--bg-elevated);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(83,155,245,.15);
  color: var(--text-primary);
}
.form-select option { background: var(--bg-surface); color: var(--text-primary); }
.form-label { font-size: 12px; font-weight: 500; color: var(--text-secondary); margin-bottom: 4px; }

/* ═══════════════════════════════════════════
   聊天
   ═══════════════════════════════════════════ */
.chat-window {
  height: 400px;
  overflow-y: auto;
  padding: 12px;
  background: var(--bg-inset);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  display: flex; flex-direction: column; gap: 6px;
}
.chat-msg {
  max-width: 80%;
  padding: 8px 14px;
  border-radius: 14px;
  line-height: 1.5;
  font-size: 13.5px;
  animation: msgEnter .2s ease;
}
.chat-msg.user {
  background: var(--accent);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.chat-msg.assistant {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
@keyframes msgEnter {
  from { opacity: 0; transform: translateY(4px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ═══════════════════════════════════════════
   图库/画图
   ═══════════════════════════════════════════ */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px,1fr));
  gap: 10px;
  min-height: 80px;
}
.image-grid .img-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 3/4;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.image-grid .img-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-grid .img-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
  border-color: rgba(83,155,245,.2);
}
.save-btn {
  position: absolute; bottom: 6px; right: 6px;
  background: rgba(0,0,0,.7); color: #fff;
  border: none; font-size: 11px; padding: 3px 8px; border-radius: 4px;
  cursor: pointer; opacity: 0;
  transition: opacity var(--transition-fast);
}
.img-item:hover .save-btn { opacity: 1; }

.img-skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-surface) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s ease infinite;
}
@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 预览 */
.preview-modal {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
}
.preview-modal img {
  max-width: 92vw; max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
  cursor: default;
  animation: previewEnter .25s ease;
}
.preview-modal .dl-btn {
  position: absolute; bottom: 24px; left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,.1);
  color: #fff; padding: 8px 16px; border-radius: 8px;
  text-decoration: none; font-size: 13px;
}
.preview-modal .dl-btn:hover { background: rgba(255,255,255,.2); }
@keyframes previewEnter {
  from { opacity: 0; transform: scale(.92); }
  to   { opacity: 1; transform: scale(1); }
}

/* ═══════════════════════════════════════════
   通用 UI 元素
   ═══════════════════════════════════════════ */

/* 字体尺寸快捷类 */
.fs-14 { font-size: 14px; }
.fs-13 { font-size: 13px; }
.fs-12 { font-size: 12px; }
.fs-11 { font-size: 11px; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.status-dot {
  width: 10px; height: 10px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}
.status-dot.online { background: var(--success); box-shadow: 0 0 6px rgba(87,171,90,.3); }
.status-dot.offline { background: var(--danger); box-shadow: 0 0 6px rgba(229,83,75,.3); }

.persona-card {
  cursor: pointer; transition: all var(--transition-fast);
  border: 2px solid transparent; border-radius: var(--radius-md);
  background: var(--bg-surface);
}
.persona-card:hover {
  border-color: rgba(83,155,245,.25);
  background: rgba(83,155,245,.03);
  transform: translateY(-1px);
}
.persona-card.active { border-color: var(--accent); background: rgba(83,155,245,.08); }

pre.code {
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  overflow-x: auto;
  font-size: 12px;
  color: var(--text-primary);
}

.tag {
  display: inline-block; padding: 1px 8px; border-radius: 10px;
  font-size: 11px; background: rgba(83,155,245,.12); color: var(--accent);
}

/* ── 加载状态 ── */
[x-cloak] { display: none !important; }
.app-loading {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--bg-main);
  flex-direction: column; gap: 16px;
}
.app-loading .spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.app-loading .hint { color: var(--text-muted); font-size: 13px; }

/* ═══════════════════════════════════════════
   无障碍
   ═══════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .chat-msg, .preview-modal img { animation: none !important; }
}

/* ═══════════════════════════════════════════
   手机端
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-w-mobile);
    box-shadow: 4px 0 24px rgba(0,0,0,.4);
  }
  .sidebar.open { transform: translateX(0); }
  .content { margin-left: 0; padding: 16px 16px 72px; }
  .mobile-header { display: flex; }
  .bottom-nav { display: flex; }
  .chat-window { height: 320px; }
  .chat-right { height: calc(100vh - 160px) !important; }
  .image-grid { grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: 8px; }
  .card-body { padding: 12px !important; }
  .preview-modal img { max-width: 96vw; max-height: 75vh; }
  .form-control, .form-select { font-size: 16px; }
}

@media (max-width: 480px) {
  .content { padding: 12px 12px 68px; }
  .chat-right { height: calc(100vh - 156px) !important; }
  .image-grid { grid-template-columns: repeat(2,1fr); gap: 6px; }
  .chat-msg { max-width: 90%; font-size: 13px; }
  .bottom-nav .bn-item { font-size: 9px; }
  .bottom-nav .bn-item .bn-icon { font-size: 16px; }
}

@media (min-width: 769px) {
  .sidebar { transform: translateX(0) !important; }
  .sidebar-overlay { display: none !important; }
  .chat-right { height: calc(100vh - 20px) !important; }
}

/* ── 用户画像面板 ── */
.profile-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: none;
  padding: 0;
  overflow: hidden;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from { opacity: 0; max-height: 0; }
  to   { opacity: 1; max-height: 600px; }
}

.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.profile-body {
  padding: 12px 14px;
}

.profile-section {
  margin-bottom: 14px;
}

.profile-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.profile-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  background: color-mix(in srgb, var(--accent) calc(var(--weight, 0.3) * 60% + 10%), var(--bg-elevated));
  color: var(--text-primary);
  border: 1px solid color-mix(in srgb, var(--accent) calc(var(--weight, 0.3) * 40%), var(--border-subtle));
  transition: all var(--transition-fast);
}

.profile-tag:hover {
  background: color-mix(in srgb, var(--accent) calc(var(--weight, 0.3) * 80% + 10%), var(--bg-elevated));
}

.profile-tag-count {
  font-size: 10px;
  color: var(--text-muted);
}

.profile-style-note {
  padding: 4px 10px;
  margin-bottom: 3px;
  border-radius: 6px;
  background: var(--bg-elevated);
  font-size: 12px;
  color: var(--text-secondary);
  border-left: 3px solid var(--accent);
}

.profile-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
}

.stat-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.profile-actions {
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
}

/* ═══════════════════════════════════════════
   触控反馈（移动端优先）
   ═══════════════════════════════════════════ */
.touch-feedback {
  position: relative;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(83, 155, 245, 0.25);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease;
  user-select: none;
  -webkit-user-select: none;
}
.touch-feedback:active {
  transform: scale(0.96);
  box-shadow: 0 0 0 2px rgba(83, 155, 245, 0.3);
}
.touch-feedback.btn-primary:active {
  background: #3b82d6 !important;
}
.touch-feedback.btn-outline-secondary:active,
.touch-feedback.btn-outline-danger:active,
.touch-feedback.btn-outline-info:active {
  background: rgba(83, 155, 245, 0.15) !important;
}

/* 开关/复选框触控反馈 */
input[type="checkbox"] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(83, 155, 245, 0.25);
  transition: transform 0.08s ease, filter 0.08s ease;
}
input[type="checkbox"]:active {
  transform: scale(0.9);
  filter: brightness(1.3);
}

/* Toast */
.toast-touch {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s ease;
}
.toast-touch:active {
  transform: scale(0.95);
}

/* ═══════════════════════════════════════════
   LLM App 风格交互优化（2026-08-13 v2）
   对齐 ChatGPT/DeepSeek/Kimi 移动端交互逻辑
   ═══════════════════════════════════════════ */

/* ── 底部输入栏（composer）── */
.chat-composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 8px 8px 8px 14px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.chat-composer:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(83, 155, 245, .15);
}
.chat-textarea {
  flex: 1;
  border: none;
  background: transparent;
  resize: none;
  outline: none;
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.5;
  max-height: 140px;
  padding: 6px 0;
  min-height: 32px;
}
.chat-textarea::placeholder { color: var(--text-muted); }
.chat-send-btn {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: transform .1s ease, opacity .15s ease, background .15s ease;
}
.chat-send-btn:hover:not(:disabled) { background: var(--accent-hover, #4a90e2); }
.chat-send-btn:active:not(:disabled) { transform: scale(.92); }
.chat-send-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ── 消息气泡 ── */
.msg-bubble-wrap { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.msg-bubble-wrap.user { flex-direction: row-reverse; }
.msg-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
  white-space: pre-wrap;
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
  animation: msgIn .2s ease both;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.msg-bubble.user {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 6px;
}
.msg-bubble.assistant {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-bottom-left-radius: 6px;
}
.msg-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
  background: var(--bg-elevated);
  border: 2px solid var(--border-subtle);
  overflow: hidden;
  cursor: pointer;
  user-select: none;
}
.msg-avatar.user { background: var(--accent); color: #fff; border-color: transparent; }
.msg-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  opacity: .85;
}
.msg-bubble-wrap.user .msg-time { text-align: right; }

/* ── 打字指示器 ── */
.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 12px 16px;
}
.typing-indicator span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1.2s infinite ease-in-out;
}
.typing-indicator span:nth-child(2) { animation-delay: .15s; }
.typing-indicator span:nth-child(3) { animation-delay: .3s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* ── 空状态引导 ── */
.chat-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
}
.chat-empty-icon { font-size: 48px; margin-bottom: 12px; opacity: .6; }
.chat-empty-title { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.chat-empty-sub { font-size: 13px; margin-bottom: 20px; }
.chat-suggest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 480px;
}
.chat-suggest-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s ease, transform .1s ease, background .15s ease;
}
.chat-suggest-card:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  transform: translateY(-1px);
}
.chat-suggest-card:active { transform: scale(.98); }

/* ── 会话列表抽屉（移动端）── */
.chat-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1040;
}
.chat-drawer-backdrop.show { display: block; }
@media (max-width: 767.98px) {
  .chat-conversation-panel {
    position: fixed !important;
    left: 0; top: 0; bottom: 0;
    width: min(82vw, 320px) !important;
    z-index: 1050;
    transform: translateX(-105%);
    transition: transform .25s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,.4);
  }
  .chat-conversation-panel.open { transform: translateX(0); }
}
.conversation-item {
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 6px;
  cursor: pointer;
  background: var(--bg-elevated);
  border: 1px solid transparent;
  transition: background .15s ease, border-color .15s ease;
}
.conversation-item:hover { border-color: var(--border-subtle); }
.conversation-item.active {
  background: var(--accent) !important;
  color: #fff;
}
.conversation-item.active .conversation-meta,
.conversation-item.active .conversation-preview { color: rgba(255,255,255,.8); }
.conversation-title { font-size: 14px; font-weight: 500; }
.conversation-meta { font-size: 12px; color: var(--text-muted); }
.conversation-preview {
  font-size: 11px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conversation-delete {
  font-size: 11px;
  color: var(--danger);
  opacity: 0;
  transition: opacity .15s ease;
}
.conversation-item:hover .conversation-delete { opacity: 1; }

/* ── 底部导航按压反馈 ── */
.bn-item:active { transform: scale(.94); }
.bn-item { transition: transform .1s ease, color .15s ease; }

/* ── 移动端消息区 padding 优化 ── */
@media (max-width: 767.98px) {
  #chat-messages { padding: 10px !important; }
  .msg-bubble { max-width: 88%; }
}

/* 会话列表滚动容器 */
.conversation-list {
  min-height: 0;
  scrollbar-width: thin;
}
.conversation-list::-webkit-scrollbar { width: 4px; }
.conversation-list::-webkit-scrollbar-thumb { background: var(--border-subtle); border-radius: 4px; }
.new-conversation-btn { border-radius: 10px !important; }
.chat-mode-switch { flex-shrink: 0; }
