/* ═══════════════════════════════════
   青训业务智能体 v3.0 — 深灰高级感 (DeepSeek风格)
   ═══════════════════════════════════ */
:root {
  --bg-primary: #0d0d0d;
  --bg-secondary: #141414;
  --bg-sidebar: #1a1a1a;
  --bg-card: #1e1e1e;
  --bg-card-hover: #262626;
  --bg-input: #1a1a1a;
  --bg-hover: #262626;
  --border: rgba(255,255,255,0.06);
  --border-strong: rgba(255,255,255,0.10);
  --accent: #4a4a4a;
  --accent-light: #6a6a6a;
  --accent-hover: #808080;
  --text-primary: #f5f5f5;
  --text-secondary: #a0a0a0;
  --text-muted: #666666;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 2px 12px rgba(0,0,0,0.5);
  --glass: rgba(255,255,255,0.02);
  --transition: 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }

/* ═══ 登录页 ═══ */
.login-container {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--bg-primary);
}
.login-box {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 48px 40px; width: 400px;
  box-shadow: var(--shadow); text-align: center;
}
.login-box .logo { font-size: 48px; margin-bottom: 16px; }
.login-box h1 { font-size: 24px; color: var(--text-primary); margin-bottom: 8px; font-weight: 600; }
.login-box .subtitle { color: var(--text-secondary); font-size: 14px; margin-bottom: 32px; }
.login-box input {
  width: 100%; padding: 12px 14px; margin-bottom: 12px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; color: var(--text-primary);
  outline: none; transition: var(--transition);
}
.login-box input:focus { border-color: var(--accent-light); }
.login-box input::placeholder { color: var(--text-muted); }
.login-box button {
  width: 100%; padding: 12px; background: var(--text-primary);
  border: none; border-radius: var(--radius-sm); color: var(--bg-primary);
  font-size: 15px; font-weight: 600; cursor: pointer; transition: var(--transition);
  margin-top: 8px;
}
.login-box button:hover { background: var(--text-secondary); }

/* 登录选项（记住账号/密码） */
.login-options {
  display: flex; justify-content: space-between; margin-bottom: 14px;
}
.login-options label {
  font-size: 13px; color: var(--text-secondary); cursor: pointer;
  display: flex; align-items: center; gap: 4px;
}
.login-options input[type=checkbox] {
  accent-color: var(--text-primary); cursor: pointer;
}

.login-error { color: var(--danger); margin-top: 12px; font-size: 13px; display: none; }

/* ═══ 顶部导航 ═══ */
.app-header {
  background: var(--bg-secondary);
  padding: 0 24px; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.app-header .brand {
  font-size: 17px; font-weight: 600; color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}
.app-header .brand .icon { font-size: 22px; }
.app-header .nav { display: flex; gap: 4px; align-items: center; height: 100%; }
.app-header .nav a, .app-header .nav span.user-info {
  padding: 6px 12px; border-radius: var(--radius-sm); text-decoration: none;
  font-size: 13px; font-weight: 500; cursor: pointer; transition: var(--transition);
  color: var(--text-secondary); display: flex; align-items: center; gap: 4px;
}
.app-header .nav a:hover { background: var(--bg-hover); color: var(--text-primary); }
.app-header .nav a.active { background: var(--bg-hover); color: var(--text-primary); font-weight: 600; }
.app-header .nav .logout { color: var(--text-muted); }
.app-header .nav .logout:hover { color: var(--danger); }
.app-header .user-info { font-size: 12px; color: var(--text-muted); padding: 0 6px; }

/* ═══ 整体布局 ═══ */
.app-body { display: flex; height: calc(100vh - 56px); position: relative; }

/* ═══ 侧边栏 ═══ */
.chat-sidebar {
  width: 260px; background: var(--bg-sidebar);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  flex-shrink: 0;
}
.chat-sidebar .sidebar-header { padding: 16px 14px 10px; }
.chat-sidebar .sidebar-header button {
  width: 100%; padding: 9px; background: var(--text-primary);
  border: none; border-radius: var(--radius-sm); color: var(--bg-primary);
  font-size: 13px; font-weight: 600; cursor: pointer; transition: var(--transition);
}
.chat-sidebar .sidebar-header button:hover { background: var(--text-secondary); }
.chat-sidebar .sidebar-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-muted); padding: 10px 14px 6px; font-weight: 600;
}
.chat-sidebar .session-list { flex: 1; overflow-y: auto; padding: 0 6px 10px; }
.chat-sidebar .session-item {
  padding: 9px 12px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 13px; margin-bottom: 1px;
  display: flex; justify-content: space-between; align-items: center;
  transition: var(--transition); color: var(--text-secondary);
}
.chat-sidebar .session-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.chat-sidebar .session-item.active {
  background: var(--bg-hover); color: var(--text-primary); font-weight: 500;
}
.chat-sidebar .session-item span:first-child {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-sidebar .session-item .del-btn {
  visibility: hidden; color: var(--text-muted); font-size: 14px; cursor: pointer;
  padding: 2px 5px; border-radius: 3px; transition: var(--transition);
}
.chat-sidebar .session-item .del-btn:hover { color: var(--danger); }
.chat-sidebar .session-item:hover .del-btn { visibility: visible; }
.chat-sidebar .edit-btn {
  visibility: hidden; cursor: pointer; font-size: 11px; margin-right: 3px;
  padding: 2px 4px; opacity: 0.5; color: var(--text-muted);
}
.chat-sidebar .session-item:hover .edit-btn { visibility: visible; }

/* ═══ 聊天主区域 ═══ */
.chat-main {
  flex: 1; display: flex; flex-direction: column; background: var(--bg-primary);
}
.chat-messages {
  flex: 1; overflow-y: auto; padding: 20px 24px;
}
.chat-msg { margin-bottom: 18px; display: flex; flex-direction: column; }
.chat-msg.user { align-items: flex-end; }
.chat-msg.assistant { align-items: flex-start; }
.chat-msg .bubble {
  max-width: 75%; padding: 10px 16px; border-radius: 14px;
  font-size: 14px; line-height: 1.6; word-break: break-word;
}
.chat-msg.user .bubble {
  background: var(--text-primary); color: var(--bg-primary);
  border-bottom-right-radius: 3px;
}
.chat-msg.assistant .bubble {
  background: var(--bg-card); color: var(--text-primary);
  border: 1px solid var(--border); border-bottom-left-radius: 3px;
}
.chat-msg .file-tag {
  font-size: 11px; color: var(--text-secondary); margin-bottom: 5px;
  padding: 2px 8px; background: var(--glass); border-radius: 16px;
  display: inline-block; border: 1px solid var(--border);
}

/* 聊天输入区 */
.chat-input-area {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; align-items: flex-end; background: var(--bg-primary);
}
.chat-input-area textarea {
  flex: 1; padding: 10px 14px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 14px; color: var(--text-primary); outline: none;
  resize: none; font-family: inherit; min-height: 42px; max-height: 120px;
  transition: var(--transition);
}
.chat-input-area textarea:focus { border-color: var(--accent-light); }
.chat-input-area textarea::placeholder { color: var(--text-muted); }
.chat-input-area .btn-send {
  padding: 10px 24px; background: var(--text-primary);
  border: none; border-radius: var(--radius); color: var(--bg-primary);
  font-size: 14px; font-weight: 600; cursor: pointer; transition: var(--transition);
  flex-shrink: 0;
}
.chat-input-area .btn-send:hover { background: var(--text-secondary); }
.chat-input-area .btn-send:disabled { opacity: 0.3; cursor: not-allowed; }

/* 思考过程 */
.thinking-block {
  margin-bottom: 6px; border-radius: var(--radius-sm);
  background: var(--bg-secondary); border: 1px solid var(--border);
  padding: 8px 12px; font-size: 12px;
}
.thinking-header {
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  color: var(--text-muted); user-select: none;
}
.thinking-header:hover { color: var(--text-secondary); }
.thinking-body {
  padding-top: 8px; line-height: 1.6; white-space: pre-wrap;
  color: var(--text-secondary); max-height: 350px; overflow-y: auto;
  border-top: 1px solid var(--border); margin-top: 6px; font-size: 12px;
}
.thinking-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--bg-hover); color: var(--text-secondary); font-size: 11px;
  padding: 2px 8px; border-radius: 8px; font-weight: 500;
}
.thinking-badge .dot {
  width: 5px; height: 5px; background: var(--text-muted); border-radius: 50%;
  animation: blink 1s infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }
.stream-cursor::after {
  content: '▍'; animation: blink 0.7s infinite; color: var(--text-muted);
}

/* ═══ 管理页面通用 ═══ */
.admin-page {
  flex: 1; padding: 28px; overflow-y: auto; max-width: 960px; margin: 0 auto;
}
.admin-page .page-header { margin-bottom: 24px; }
.admin-page .page-header h2 {
  font-size: 22px; font-weight: 600; color: var(--text-primary);
}
.admin-page .page-header p {
  font-size: 13px; color: var(--text-secondary); margin-top: 4px;
}
.admin-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px;
  box-shadow: var(--shadow); margin-bottom: 20px;
}
.admin-card h3 {
  font-size: 15px; font-weight: 600; margin-bottom: 16px;
  color: var(--text-primary);
}
.admin-card label {
  display: block; font-size: 12px; color: var(--text-secondary);
  margin-bottom: 5px; font-weight: 500;
}
.admin-card input[type=text],
.admin-card input[type=password],
.admin-card input[type=number],
.admin-card select,
.admin-card textarea {
  width: 100%; padding: 9px 12px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-primary); outline: none;
  margin-bottom: 14px; font-family: inherit; transition: var(--transition);
}
.admin-card input:focus, .admin-card select:focus, .admin-card textarea:focus {
  border-color: var(--accent-light);
}
.admin-card input::placeholder, .admin-card textarea::placeholder { color: var(--text-muted); }
.admin-card select { cursor: pointer; }
.admin-card select option { background: var(--bg-card); color: var(--text-primary); }
.admin-card textarea { min-height: 90px; resize: vertical; }
.admin-card button, .admin-card a.btn {
  padding: 9px 18px; background: var(--text-primary);
  border: none; border-radius: var(--radius-sm); color: var(--bg-primary);
  font-size: 13px; font-weight: 600; cursor: pointer; transition: var(--transition);
  text-decoration: none; display: inline-flex; align-items: center; gap: 5px;
}
.admin-card button:hover { background: var(--text-secondary); }
.admin-card button:disabled { opacity: 0.3; cursor: not-allowed; }
.admin-card button.danger { background: var(--danger); color: #fff; }
.admin-card button.small { padding: 5px 12px; font-size: 11px; }
.admin-card button.secondary {
  background: var(--bg-hover); border: 1px solid var(--border); color: var(--text-secondary);
}
.admin-card button.secondary:hover { color: var(--text-primary); border-color: var(--text-muted); }
.admin-card .form-hint { font-size: 11px; color: var(--text-muted); margin-top: -8px; margin-bottom: 12px; }
.admin-card .form-row { display: flex; gap: 10px; }
.admin-card .form-row > * { flex: 1; }
.admin-card .status-badge {
  display: inline-block; padding: 2px 8px; border-radius: 16px;
  font-size: 11px; font-weight: 600;
}
.admin-card .status-badge.enabled { background: rgba(34,197,94,0.12); color: var(--success); }
.admin-card .status-badge.disabled { background: rgba(239,68,68,0.12); color: var(--danger); }

/* 表格 */
.admin-table-wrapper { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td {
  padding: 10px 14px; text-align: left; font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.admin-table th {
  font-weight: 600; color: var(--text-muted); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.5px;
  background: var(--bg-secondary); position: sticky; top: 0;
}
.admin-table td { color: var(--text-secondary); }
.admin-table tr:hover td { background: var(--glass); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table td .actions { display: flex; gap: 6px; }
.admin-table .empty-row td { text-align: center; padding: 32px; color: var(--text-muted); }

/* 搜索 */
.search-bar { display: flex; gap: 8px; margin-bottom: 16px; align-items: center; }
.search-bar input {
  flex: 1; padding: 8px 12px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-primary); outline: none;
  transition: var(--transition);
}
.search-bar input:focus { border-color: var(--accent-light); }
.search-bar select {
  padding: 8px 12px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-primary); outline: none;
  cursor: pointer;
}

/* Toast 通知 */
.toast { position: fixed; top: 20px; right: 20px; z-index: 999; }
.toast-msg {
  padding: 10px 18px; border-radius: var(--radius-sm); font-size: 13px;
  color: #fff; margin-bottom: 6px; animation: fadeIn 0.3s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
.toast-msg.success { background: var(--success); }
.toast-msg.error { background: var(--danger); }
.toast-msg.info { background: #3b82f6; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* 分页 */
.pagination { display: flex; gap: 5px; justify-content: center; margin-top: 16px; }
.pagination button {
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 5px;
  background: var(--bg-card); color: var(--text-secondary); cursor: pointer;
  font-size: 12px; transition: var(--transition);
}
.pagination button:hover { border-color: var(--accent-light); color: var(--text-primary); }
.pagination button.active { background: var(--text-primary); color: var(--bg-primary); border-color: var(--text-primary); }
.pagination button:disabled { opacity: 0.3; cursor: not-allowed; }

/* 加载动画 */
.loading { text-align: center; padding: 20px; color: var(--text-muted); font-size: 13px; }

/* 分割线 */
.section-divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ═══ 空状态聊天页 ═══ */
.empty-chat {
  text-align: center; padding-top: 100px;
}
.empty-chat .empty-icon {
  font-size: 48px; opacity: 0.3;
}
.empty-chat .empty-title {
  font-size: 18px; margin-top: 14px; color: var(--text-secondary);
  font-weight: 600;
}
.empty-chat .empty-desc {
  font-size: 13px; margin-top: 6px; color: var(--text-muted);
}
.empty-chat .empty-hints {
  font-size: 12px; margin-top: 14px; color: var(--text-muted);
  padding: 6px 14px; display: inline-block;
  background: var(--glass); border-radius: 16px; border: 1px solid var(--border);
}

/* ═══ 消息气泡增强 ═══ */
.chat-msg.assistant .bubble {
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* ═══ 语音按钮 ═══ */
.mic-btn {
  padding: 10px 14px; border: none; border-radius: var(--radius);
  font-size: 18px; cursor: pointer; transition: all 0.25s ease;
  background: var(--bg-input); color: var(--text-muted);
  flex-shrink: 0; line-height: 1;
}
.mic-btn:hover { background: var(--bg-hover); color: var(--text-primary); transform: scale(1.05); }
.mic-btn.recording {
  background: var(--danger); color: #fff;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.2);
  animation: micPulse 1.2s ease-in-out infinite; transform: none;
}
@keyframes micPulse {
  0%,100% { box-shadow: 0 0 0 3px rgba(239,68,68,0.2); }
  50% { box-shadow: 0 0 0 8px rgba(239,68,68,0.05); }
}
.mic-status {
  font-size: 12px; color: var(--danger); text-align: center;
  padding: 3px 0; display: none;
}
.mic-status.active { display: block; animation: fadeIn 0.3s; }

/* ═══ 编辑会话标题 ═══ */
.edit-name-btn {
  visibility: hidden; cursor: pointer; font-size: 11px;
  padding: 2px 5px; border-radius: 3px; opacity: 0.4; flex-shrink: 0;
  border: none; background: none; color: var(--text-muted);
  transition: var(--transition);
}
.session-item:hover .edit-name-btn { visibility: visible; }
.edit-name-btn:hover { opacity: 1; color: var(--text-primary); background: var(--bg-hover); }
.session-edit-form {
  display: flex; gap: 3px; align-items: center; width: 100%;
}
.session-edit-form input {
  flex: 1; padding: 3px 6px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: 3px;
  font-size: 12px; color: var(--text-primary); outline: none;
}
.session-edit-form input:focus { border-color: var(--accent-light); }
.session-edit-form button {
  padding: 3px 8px; border: none; border-radius: 3px;
  font-size: 10px; cursor: pointer; font-weight: 600;
}
.session-edit-form .save-btn { background: var(--text-primary); color: var(--bg-primary); }
.session-edit-form .save-btn:hover { background: var(--text-secondary); }
.session-edit-form .cancel-btn { background: var(--bg-hover); color: var(--text-secondary); border: 1px solid var(--border); }
.session-edit-form .cancel-btn:hover { color: var(--text-primary); }

/* ═══ Toast 固定 ═══ */
.toast {
  position: fixed; top: 20px; right: 20px; z-index: 999;
  display: flex; flex-direction: column; gap: 6px;
}

/* ═══ 思考过程增强 ═══ */
.thinking-body::-webkit-scrollbar { width: 4px; }
.thinking-body::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 2px; }

/* ═══ 模型徽章 ═══ */
.model-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; background: var(--bg-hover);
  border-radius: 5px; font-size: 11px; color: var(--text-muted);
  margin-bottom: 6px;
}
.model-badge .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--text-muted); }

/* ═══════════════════════════════════

/* ═══════════════════════════════════
   响应式 - 移动端/平板适配 (v3 iOS)
   ═══════════════════════════════════ */

/* 汉堡菜单按钮（PC端隐藏，移动端显示） */
.menu-btn {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: none; background: none;
  color: var(--text-secondary); font-size: 24px; cursor: pointer;
  border-radius: 8px; flex-shrink: 0; transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.menu-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.menu-btn:active { background: var(--bg-hover); }

/* 侧边栏遮罩层 */
.sidebar-overlay {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 199;
  -webkit-tap-highlight-color: transparent;
}
.sidebar-overlay.active { display: block; }

/* ═══ 平板/手机 (<768px) ═══ */
@media (max-width: 768px) {
  /* 聊天页：用 fixed+absolute 替代 dvh，锚定视口边缘，绕开 iOS dvh bug */
  /* 仅影响含 .app-body 的页面（chat.html），其他页不受影响 */
  .app-body {
    position: fixed;
    top: 56px; bottom: 0; left: 0; right: 0;
    height: auto;
    display: flex;
  }

  /* 隐藏桌面端 ◀ 折叠按钮 */
  .sidebar-toggle { display: none !important; }

  /* 汉堡菜单 */
  .menu-btn { display: flex !important; z-index: 300; }

  /* 导航栏 */
  .app-header { padding: 0 12px; }
  .app-header .brand { font-size: 15px; gap: 4px; }
  .app-header .brand .icon { font-size: 18px; }
  .app-header .nav a { font-size: 12px; padding: 5px 8px; }
  .app-header .nav .user-info { font-size: 11px; padding: 0 4px; }

  /* 侧边栏 → 左侧滑入覆盖层 */
  .chat-sidebar {
    position: fixed !important;
    top: 0; left: 0; bottom: 0;
    z-index: 200 !important;
    transform: translateX(-100%);
    -webkit-transform: translateX(-100%);
    transition: transform 0.25s ease;
    -webkit-transition: -webkit-transform 0.25s ease;
    width: 280px; max-width: 80vw;
    flex-shrink: unset;
    box-shadow: none;
  }
  .chat-sidebar.open {
    transform: translateX(0) !important;
    -webkit-transform: translateX(0) !important;
    box-shadow: 4px 0 20px rgba(0,0,0,0.5);
  }
  .chat-sidebar.open.collapsed {
    width: 280px; max-width: 80vw;
    min-width: unset; overflow: visible;
    border-right: 1px solid var(--border); padding: 0;
  }

  /* 聊天主区域占满 */
  .chat-main { width: 100%; flex: 1; }
  .chat-messages {
    padding: 14px 10px;
    flex: 1; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 输入框固定在底部 + iOS 安全区 */
  .chat-input-area {
    flex-shrink: 0;
    padding: 10px 10px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    gap: 6px;
    background: var(--bg-primary);
  }

  /* 聊天气泡 */
  .chat-msg .bubble { max-width: 88%; font-size: 14px; }
  .chat-input-area textarea { font-size: 16px; }
  .chat-input-area .btn-send { padding: 10px 18px; font-size: 13px; min-height: 44px; }

  /* 登录页 */
  .login-container {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .login-box { width: 90%; max-width: 400px; padding: 36px 24px; }
  .login-box h1 { font-size: 20px; }
  .login-box .logo { font-size: 40px; }

  /* 管理页面 */
  .admin-page { padding: 16px 12px; max-width: 100%; overflow-y: auto; }
  .admin-page .page-header h2 { font-size: 20px; }
  .admin-card { padding: 16px; border-radius: 10px; }
  .admin-card .form-row { flex-direction: column; gap: 0; }
  .search-bar { flex-wrap: wrap; }
  .search-bar input { min-width: 140px; }

  /* Toast */
  .toast { top: 10px; right: 10px; left: 10px; }
  .toast-msg { font-size: 12px; }

  /* 空状态 */
  .empty-chat { padding-top: 60px; }
  .empty-chat .empty-icon { font-size: 36px; }
  .empty-chat .empty-title { font-size: 16px; }
  .empty-chat .empty-desc { font-size: 12px; }
  .empty-chat .empty-hints { font-size: 11px; }
}

/* ═══ 小屏手机 (<480px) ═══ */
@media (max-width: 480px) {
  .menu-btn { width: 48px; height: 48px; font-size: 26px; }

  .app-header { padding: 0 8px; }
  .app-header .brand { font-size: 14px; }
  .app-header .brand .icon { font-size: 16px; }
  .app-header .nav a { padding: 4px 6px; font-size: 11px; }

  .chat-messages { padding: 10px 6px; }
  .chat-msg .bubble { max-width: 92%; font-size: 13px; }

  .chat-input-area { padding: 8px 6px; padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); gap: 5px; }
  .chat-input-area textarea { font-size: 16px; min-height: 38px; }
  .chat-input-area .btn-send { padding: 8px 16px; font-size: 12px; min-height: 44px; }

  .login-box { width: 94%; padding: 28px 16px; border-radius: 12px; }
  .login-box h1 { font-size: 18px; }
  .login-box .subtitle { font-size: 12px; }
  .login-box input { padding: 10px 12px; font-size: 16px; }

  .thinking-body { max-height: 180px; font-size: 11px; }
  .thinking-block { padding: 6px 10px; }

  .admin-page { padding: 12px 8px; }
  .admin-page .page-header h2 { font-size: 18px; }
  .admin-card h3 { font-size: 14px; }
  .admin-table th, .admin-table td { padding: 8px 6px; font-size: 11px; }
  .pagination button { padding: 5px 8px; font-size: 11px; }
}
