/* 自定义滚动条 */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #1f2937; }
::-webkit-scrollbar-thumb { background: #4b5563; border-radius: 3px; }

@supports (height: 100dvh) {
  body {
    height: 100dvh !important;
  }
}

/* 消息气泡动画 */
@keyframes slideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.message-bubble {
  animation: slideIn 0.3s ease-out;
}

.ai-bubble .ai-source-link {
  color: #93c5fd;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.ai-bubble .ai-source-link:hover {
  color: #bfdbfe;
}
.ai-bubble .ai-source-link:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 3px;
  border-radius: 2px;
}

/* 欢迎区淡入+上浮动画 */
@keyframes welcomeFloatIn {
  from {
    opacity: 0;
    transform: translateY(32px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
#welcome-area.welcome-animate {
  animation: welcomeFloatIn 0.55s cubic-bezier(0.23, 1, 0.32, 1) both;
}

/* 加载动画 */
@keyframes typing {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
.typing-dot {
  animation: typing 1.4s infinite;
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #9ca3af;
  margin: 0 1px;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* 用户消息气泡 */
.user-bubble {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-radius: 16px 16px 4px 16px;
  max-width: 80%;
  margin-left: auto;
}
#chat-messages .user-bubble { font-size: 16px; }

/* AI消息气泡 */
.ai-bubble {
  background: #374151;
  border-radius: 16px 16px 16px 4px;
  max-width: 90%;
}
#chat-messages .ai-bubble { font-size: 16px; }

.ai-bubble.fixed-vehicle-guide-bubble { width: min(100%, 960px); max-width: 96%; }
.fixed-vehicle-guide-figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 12px;
  margin: 18px 0 16px;
}
.fixed-vehicle-guide-figures figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid #607083;
  border-radius: 10px;
  background: #1d2939;
}
.fixed-vehicle-guide-figures img { display: block; width: 100%; height: auto; }
.fixed-vehicle-guide-image-btn { display: block; width: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.fixed-vehicle-guide-image-btn:focus-visible { outline: 3px solid #a8d6ff; outline-offset: -3px; }
.fixed-vehicle-guide-figures figcaption {
  padding: 9px 11px;
  color: #d8e6f5;
  font-size: 13px;
  line-height: 1.4;
}
.fixed-vehicle-guide-upload-btn {
  display: flex;
  width: fit-content;
  margin-top: 12px;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid #64adff;
  border-radius: 7px;
  background: #1477db;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.notification-bell { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border: 1px solid #36516b; border-radius: 10px; background: #122b42; color: #cceaff; cursor: pointer; }
.notification-badge { position: absolute; top: -5px; right: -8px; min-width: 20px; padding: 1px 4px; border-radius: 12px; background: #e45454; color: white; font-size: 11px; }
.notification-panel { position: fixed; z-index: 70; top: 78px; right: 20px; width: min(430px,calc(100vw - 24px)); max-height: calc(100dvh - 160px); overflow: auto; padding: 18px; border: 1px solid #38546e; border-radius: 14px; background: #102237; color: #e3effb; box-shadow: 0 16px 45px #0007; }
.notification-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.notification-heading h2 { font-size: 16px; margin: 0; }
.notification-panel button { min-height: 40px; padding: 6px 12px; border-radius: 8px; border: 1px solid #36516b; background: #183850; color: #d5ebff; cursor: pointer; }
.notification-panel button:disabled { opacity: .5; cursor: default; }
#notification-status { white-space: pre-wrap; font-size: 12px; line-height: 1.7; margin: 12px 0; color: #acd4f2; }
.notification-note { font-size: 12px; color: #93abc1; line-height: 1.6; margin: 10px 0; }
.notification-item { padding: 12px 0; border-bottom: 1px solid #2c4258; font-size: 13px; overflow-wrap: anywhere; }
.notification-item summary { cursor: pointer; }
.notification-unread-dot { display:inline-block; width:7px; height:7px; margin-right:6px; border-radius:50%; background:#ef4444; vertical-align:middle; }
.notification-unread-dot[hidden] { display:none; }
.notification-item p { margin-top: 10px; line-height: 1.8; color: #b4c9df; white-space: pre-wrap; }
.notification-toast { position: fixed; z-index: 75; right: 20px; bottom: 100px; max-width: min(430px,calc(100vw - 24px)); border: 1px solid #5181a5; border-radius: 12px; padding: 14px 18px; background: #163952; color: #e3f5ff; box-shadow: 0 8px 24px #0005; }
.notification-panel[hidden], .notification-toast[hidden], .notification-badge[hidden] { display: none; }
@media (max-width:768px) { .notification-panel { right: 12px; top: 130px; max-height: calc(100dvh - 160px); } .notification-bell { width: 36px; height: 36px; } .notification-panel button { min-height: 44px; } }
.fixed-vehicle-guide-upload-btn:hover { background: #0967c7; }
.fixed-vehicle-guide-upload-btn:focus-visible { outline: 3px solid #a8d6ff; outline-offset: 3px; }

.fixed-vehicle-image-card { width: min(100%, 1100px); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; overflow: hidden; }
.fixed-vehicle-image-card .fixed-vehicle-dialog-header { flex: 0 0 auto; }
.fixed-vehicle-image-body { min-height: 0; overflow: auto; padding: 16px; text-align: center; }
.fixed-vehicle-image-body img { display: block; width: 100%; height: auto; max-height: calc(100dvh - 145px); object-fit: contain; margin: auto; border-radius: 9px; }

/* 图表容器 —— 科幻风格 */
.chart-container {
  width: 100%;
  min-height: 360px;
  margin-top: 12px;
  background: linear-gradient(180deg, rgba(8, 16, 40, 0.92) 0%, rgba(2, 6, 23, 0.95) 100%);
  border: 1px solid rgba(30, 58, 95, 0.45);
  border-radius: 12px;
  overflow: visible;
  box-shadow: 0 0 30px rgba(14, 165, 233, 0.08), inset 0 1px 0 rgba(14, 165, 233, 0.06);
}
.chart-inner {
  width: 100%;
  height: 360px;
}

/* 数字卡片 */
.number-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 32px;
  background: linear-gradient(135deg, #1e3a5f, #1a365d);
  border: 1px solid #2d5a8e;
  border-radius: 12px;
  margin-top: 12px;
}
.number-card .value {
  font-size: 2rem;
  font-weight: 700;
  color: #60a5fa;
}
.number-card .label {
  font-size: 0.85rem;
  color: #93c5fd;
  margin-top: 4px;
}

/* 快捷问题按钮 */
.quick-btn {
  display: block;
  padding: 8px 14px;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
  font-size: 0.93rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  color: #d1d5db;
}
.quick-btn:hover {
  background: #374151;
  border-color: #4b5563;
  color: #fff;
}

/* 查看大屏按钮 */
.screen-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  border: 1px solid #8b5cf6;
  border-radius: 8px;
  color: #ddd6fe;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}
.screen-btn:hover {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  border-color: #a78bfa;
  color: #fff;
}

/* 流式输出进度指示器 */
@keyframes progressPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}
.stream-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}
.progress-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #60a5fa;
  animation: progressPulse 1.2s infinite;
}
.stream-content {
  white-space: pre-wrap;
  word-break: break-word;
}

/* 大屏下拉框 */
.screen-dropdown {
  position: relative;
  display: inline-block;
}
.screen-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #374151;
  border: 1px solid #4b5563;
  border-radius: 6px;
  color: #d1d5db;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}
.screen-dropdown-btn:hover {
  background: #4b5563;
  color: #fff;
}
.dropdown-arrow {
  transition: transform 0.2s;
}
.screen-dropdown-btn.open .dropdown-arrow {
  transform: rotate(180deg);
}
.screen-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  z-index: 100;
  overflow: hidden;
  animation: dropdownIn 0.15s ease-out;
}
@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.screen-dropdown-item {
  display: flex;
  justify-content: center !important;
  align-items: center;
  padding: 10px 14px;
  cursor: pointer;
  color: #d1d5db;
  font-size: 0.8rem;
  transition: all 0.15s;
  border-bottom: 1px solid #374151;
}
.screen-dropdown-item:last-child {
  border-bottom: none;
}
.screen-dropdown-item:hover {
  background: #374151;
  color: #fff;
}
.screen-dropdown-file {
  display: none !important;
  font-size: 0.65rem;
  color: #6b7280;
}

/* AI回复智能排版 */
.ai-heading {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fbbf24;
  margin: 14px 0 8px 0;
  padding-bottom: 4px;
  border-bottom: 1px solid #4b5563;
}
h3.ai-heading { font-size: 1rem; }
h4.ai-heading { font-size: 0.9rem; }
.ai-bubble .ai-heading {
  color: #76d9ff;
  font-weight: 750;
  line-height: 1.5;
  margin: 22px 0 10px;
  padding-bottom: 8px;
  border-bottom-color: rgba(148, 184, 215, .22);
}
.ai-bubble h3.ai-heading { font-size: 1.15em; }
.ai-bubble h4.ai-heading { font-size: 1.06em; }
.ai-bubble strong { font-weight: 700; }
.ai-bubble strong.text-yellow-300 { color: #a7e8d7; }
.ai-bubble .ai-data { font-weight: 750; }
.ai-bubble .ai-data-money { color: #ffd078; }
.ai-bubble .ai-data-count { color: #85c7ff; }
.ai-bubble .ai-data-percent { color: #d4b4ff; }
.ai-bubble .ai-data-duration { color: #8edbd5; }
@media (max-width: 768px) {
  .ai-bubble h3.ai-heading { font-size: 1.12em !important; }
  .ai-bubble h4.ai-heading { font-size: 1.06em !important; }
}
.ai-list {
  margin: 6px 0 10px 0;
  padding-left: 8px;
  list-style: none;
}
.ai-list-item {
  position: relative;
  padding: 2px 0 2px 16px;
  line-height: 1.7;
}
.ai-list-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #60a5fa;
}

/* 兜底回复快捷按钮（行内） */
.inline-quick-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #4b5563;
}
.inline-quick-btn {
  padding: 5px 10px;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 6px;
  color: #93c5fd;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}
.inline-quick-btn:hover {
  background: #374151;
  border-color: #60a5fa;
  color: #bfdbfe;
}

/* 思考过程区域（DeepSeek风格） */
.thinking-section {
  margin-bottom: 12px;
  border: 1px solid #374151;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(31, 41, 55, 0.6);
}
.thinking-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 0.78rem;
  color: #9ca3af;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}
.thinking-header:hover {
  color: #d1d5db;
}
.thinking-arrow {
  display: inline-block;
  transition: transform 0.2s;
  font-size: 0.65rem;
}
.thinking-section.collapsed .thinking-arrow {
  transform: rotate(-90deg);
}
.thinking-status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #fbbf24;
  animation: progressPulse 1.2s infinite;
  flex-shrink: 0;
}
.thinking-content {
  padding: 0 12px 10px;
  font-size: 0.75rem;
  color: #6b7280;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 260px;
  overflow-y: auto;
}
.thinking-section.collapsed .thinking-content {
  display: none;
}
/* 思考内容滚动条 */
.thinking-content::-webkit-scrollbar { width: 4px; }
.thinking-content::-webkit-scrollbar-thumb { background: #4b5563; border-radius: 2px; }

/* monitor-stats: 监测统计展示（已禁用） */
/*
.monitor-stats {
  margin-top: 14px;
  border: 1px solid #374151;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(31, 41, 55, 0.5);
}
.monitor-stats-header {
  font-size: 0.68rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 6px 10px;
  border-bottom: 1px solid #374151;
}
.monitor-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: #374151;
}
.monitor-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  background: rgba(31, 41, 55, 0.7);
  gap: 2px;
}
.monitor-stat-label {
  font-size: 0.6rem;
  color: #6b7280;
}
.monitor-stat-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: #e5e7eb;
}
.monitor-stat-unit {
  font-size: 0.65rem;
  font-weight: 400;
  color: #6b7280;
}
.monitor-stat-sub {
  font-size: 0.58rem;
  color: #4b5563;
}
*/

/* ── 车场选择下拉框 ── */
.app-header .parking-lot-dropdown {
  margin-left: 12px;
}
.app-header .header-actions {
  margin-left: auto;
}
.parking-lot-dropdown {
  position: relative;
  display: inline-block;
}
.mobile-parking-label,
.mobile-parking-mark,
.mobile-parking-search-icon,
.mobile-header-btn,
.mobile-user-dropdown {
  display: none;
}
.parking-lot-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #374151;
  border: 1px solid #4b5563;
  border-radius: 6px;
  color: #d1d5db;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.parking-lot-dropdown-btn:hover {
  background: #4b5563;
  color: #fff;
}
.parking-lot-dropdown-btn .dropdown-arrow {
  transition: transform 0.2s;
}
.parking-lot-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 260px;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  z-index: 100;
  overflow: hidden;
  animation: dropdownIn 0.15s ease-out;
}
.parking-lot-dropdown-menu.hidden { display: none; }
.parking-lot-search {
  padding: 8px 10px;
  border-bottom: 1px solid #374151;
}
.parking-lot-search input {
  width: 100%;
  padding: 6px 10px;
  background: #374151;
  border: 1px solid #4b5563;
  border-radius: 6px;
  color: #e5e7eb;
  font-size: 0.78rem;
  outline: none;
  transition: all 0.15s;
}
.parking-lot-search input:focus {
  border-color: #60a5fa;
}
.parking-lot-search input::placeholder {
  color: #6b7280;
}
.parking-lot-list {
  max-height: 240px;
  overflow-y: auto;
}
.parking-lot-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  cursor: pointer;
  color: #d1d5db;
  font-size: 0.8rem;
  transition: all 0.15s;
  border-bottom: 1px solid #374151;
}
.parking-lot-item:last-child { border-bottom: none; }
.parking-lot-item:hover {
  background: #374151;
  color: #fff;
}
.parking-lot-item.selected {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}
.parking-lot-item.disabled {
  color: #4b5563;
  cursor: default;
  pointer-events: none;
}
.parking-lot-item .lot-spaces {
  font-size: 0.7rem;
  color: #6b7280;
}

/* ── 移动端车场选择下拉适配 ── */
@media (max-width: 768px) {
  .parking-lot-dropdown-btn {
    padding: 4px 7px !important;
    font-size: 0.68rem !important;
    gap: 3px !important;
  }
  .parking-lot-dropdown-menu {
    left: 0 !important;
    right: auto !important;
    min-width: 220px !important;
  }
}

/* ── 历史记录按钮 ── */
.history-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #374151;
  border: 1px solid #4b5563;
  border-radius: 6px;
  color: #d1d5db;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}
.history-btn:hover {
  background: #4b5563;
  color: #fff;
}

/* ── 手机端用户菜单与退出确认 ── */
.mobile-user-menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  min-width: 150px;
  padding: 7px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .2);
  color: #111827;
}
.mobile-user-menu.hidden,
.logout-confirm-overlay.hidden {
  display: none !important;
}
.mobile-user-name {
  display: block;
  padding: 7px 10px;
  overflow: hidden;
  color: #6b7280;
  font-size: .72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mobile-user-menu button {
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #dc2626;
  text-align: left;
}
.logout-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, .5);
  backdrop-filter: blur(2px);
}
.logout-confirm-card {
  width: min(88vw, 320px);
  padding: 22px 20px 18px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 22px 55px rgba(15, 23, 42, .28);
  color: #111827;
}
.logout-confirm-card h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
}
.logout-confirm-card p {
  margin: 0;
  color: #6b7280;
  font-size: .86rem;
  line-height: 1.55;
}
.logout-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.logout-confirm-actions button {
  min-width: 88px;
  padding: 9px 14px;
  border-radius: 20px;
  font-size: .82rem;
  font-weight: 600;
}
.logout-cancel-btn {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
}
.logout-confirm-btn {
  border: 1px solid #2563eb;
  background: #2563eb;
  color: #fff;
}

/* ── 对话记录删除确认 ── */
.history-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 360;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 7, 18, .72);
  backdrop-filter: blur(5px);
}
.history-confirm-overlay.hidden { display: none !important; }
.history-confirm-card {
  width: min(100%, 430px);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  padding: 22px;
  border: 1px solid #374151;
  border-radius: 16px;
  background: linear-gradient(145deg, #1f2937, #111827);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .42);
  color: #f9fafb;
  animation: fixed-vehicle-dialog-in .18s ease-out;
}
.history-confirm-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(251, 146, 60, .36);
  border-radius: 11px;
  background: rgba(154, 52, 18, .2);
  color: #fbbf24;
}
.history-confirm-eyebrow {
  margin: 1px 0 4px;
  color: #93c5fd;
  font-size: .69rem;
  font-weight: 600;
  letter-spacing: .04em;
}
.history-confirm-card h2 {
  margin: 0;
  color: #f9fafb;
  font-size: 1.05rem;
  font-weight: 650;
}
.history-confirm-card p:not(.history-confirm-eyebrow) {
  margin: 7px 0 0;
  color: #9ca3af;
  font-size: .84rem;
  line-height: 1.55;
}
.history-confirm-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 2px;
}
.history-confirm-actions button {
  min-width: 94px;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .15s;
}
.history-confirm-cancel-btn {
  border: 1px solid #4b5563;
  background: #1f2937;
  color: #d1d5db;
}
.history-confirm-cancel-btn:hover,
.history-confirm-cancel-btn:focus-visible {
  border-color: #6b7280;
  background: #374151;
  color: #fff;
  outline: none;
}
.history-confirm-danger-btn {
  border: 1px solid #dc2626;
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 5px 14px rgba(220, 38, 38, .2);
  color: #fff;
}
.history-confirm-danger-btn:hover,
.history-confirm-danger-btn:focus-visible {
  border-color: #f87171;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  outline: none;
}
.history-confirm-danger-btn:active { transform: translateY(1px); }

/* ── 固定车 Excel 导入 ── */
.fixed-vehicle-overlay {
  position: fixed;
  inset: 0;
  z-index: 350;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 7, 18, .72);
  backdrop-filter: blur(5px);
}
.fixed-vehicle-overlay.hidden { display: none !important; }
.fixed-vehicle-dialog-card {
  width: min(100%, 520px);
  border: 1px solid #374151;
  border-radius: 16px;
  background: linear-gradient(160deg, #1f2937 0%, #111827 100%);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .55), 0 0 0 1px rgba(96, 165, 250, .05) inset;
  color: #f3f4f6;
  animation: fixedVehicleDialogIn .18s ease-out;
}
@keyframes fixedVehicleDialogIn {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.fixed-vehicle-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid #374151;
}
.fixed-vehicle-dialog-header h2 {
  margin: 0;
  color: #f9fafb;
  font-size: 1.05rem;
  font-weight: 650;
}
.fixed-vehicle-dialog-header p {
  margin: 5px 0 0;
  color: #9ca3af;
  font-size: .79rem;
  line-height: 1.5;
}
.fixed-vehicle-dialog-header .fixed-vehicle-dialog-eyebrow {
  margin: 0 0 4px;
  color: #60a5fa;
  font-size: .69rem;
  font-weight: 600;
  letter-spacing: .04em;
}
.fixed-vehicle-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  margin: -4px -6px 0 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #9ca3af;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.fixed-vehicle-close-btn:hover,
.fixed-vehicle-close-btn:focus-visible {
  border-color: #4b5563;
  background: #374151;
  color: #fff;
  outline: none;
}
.fixed-vehicle-drop-zone {
  display: flex;
  width: calc(100% - 44px);
  min-height: 190px;
  margin: 20px 22px 12px;
  padding: 24px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 7px;
  border: 1px dashed #4b6f9f;
  border-radius: 12px;
  background: rgba(30, 58, 95, .22);
  color: #93c5fd;
  cursor: pointer;
  transition: border-color .18s, background .18s, transform .18s;
}
.fixed-vehicle-drop-zone:hover,
.fixed-vehicle-drop-zone:focus-visible,
.fixed-vehicle-drop-zone.is-dragging {
  border-color: #60a5fa;
  background: rgba(37, 99, 235, .2);
  outline: none;
}
.fixed-vehicle-drop-zone.is-dragging { transform: scale(1.01); }
.fixed-vehicle-drop-zone strong {
  margin-top: 3px;
  color: #dbeafe;
  font-size: .92rem;
}
.fixed-vehicle-drop-zone span { color: #9ca3af; font-size: .77rem; }
.fixed-vehicle-drop-zone small { color: #6b7280; font-size: .69rem; }
.fixed-vehicle-selected-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 22px;
  padding: 10px 12px;
  border: 1px solid #27496f;
  border-radius: 9px;
  background: rgba(30, 58, 95, .36);
  color: #bfdbfe;
  font-size: .76rem;
}
.fixed-vehicle-selected-file.hidden { display: none; }
.fixed-vehicle-file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fixed-vehicle-selected-file button {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #93c5fd;
  font-size: .75rem;
  cursor: pointer;
}
.fixed-vehicle-selected-file button:hover { color: #fff; text-decoration: underline; }
.fixed-vehicle-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 20px 22px 22px;
}
.fixed-vehicle-dialog-actions button {
  min-width: 100px;
  padding: 9px 15px;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .15s;
}
.fixed-vehicle-secondary-btn {
  border: 1px solid #4b5563;
  background: #1f2937;
  color: #d1d5db;
}
.fixed-vehicle-secondary-btn:hover,
.fixed-vehicle-secondary-btn:focus-visible {
  border-color: #6b7280;
  background: #374151;
  color: #fff;
  outline: none;
}
.fixed-vehicle-primary-btn {
  border: 1px solid #2563eb;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 5px 14px rgba(37, 99, 235, .22);
  color: #fff;
}
.fixed-vehicle-primary-btn:hover,
.fixed-vehicle-primary-btn:focus-visible {
  border-color: #60a5fa;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  outline: none;
}
.fixed-vehicle-primary-btn:active { transform: translateY(1px); }
.fixed-vehicle-primary-btn:disabled {
  border-color: #374151;
  background: #374151;
  box-shadow: none;
  color: #6b7280;
  cursor: not-allowed;
}
.fixed-vehicle-confirm-card { width: min(100%, 450px); }
.fixed-vehicle-confirm-notice {
  display: flex;
  gap: 10px;
  margin: 20px 22px 0;
  padding: 13px;
  border: 1px solid rgba(245, 158, 11, .34);
  border-radius: 10px;
  background: rgba(146, 64, 14, .18);
  color: #fbbf24;
}
.fixed-vehicle-confirm-notice svg { flex: 0 0 auto; margin-top: 1px; }
.fixed-vehicle-confirm-notice p {
  margin: 0;
  color: #d1d5db;
  font-size: .82rem;
  line-height: 1.6;
}
.fixed-vehicle-confirm-notice strong {
  color: #4ade80;
  text-shadow: 0 0 12px rgba(74, 222, 128, .22);
}
@media (max-width: 640px) {
  .history-confirm-overlay { padding: 14px; }
  .history-confirm-card { padding: 20px 18px 18px; }
  .history-confirm-actions button { flex: 1; min-width: 0; }
  .fixed-vehicle-overlay { padding: 14px; }
  .fixed-vehicle-dialog-header { padding: 18px 18px 14px; }
  .fixed-vehicle-drop-zone { width: calc(100% - 36px); margin: 18px 18px 12px; }
  .fixed-vehicle-selected-file,
  .fixed-vehicle-confirm-notice { margin-left: 18px; margin-right: 18px; }
  .fixed-vehicle-dialog-actions { padding: 18px; }
  .fixed-vehicle-dialog-actions button { flex: 1; min-width: 0; }
}

/* ── 历史记录侧边栏 ── */
:root {
  --conversation-sidebar-width: 288px;
  --conversation-sidebar-collapsed-width: 44px;
}

#chat-messages,
body > footer {
  margin-left: var(--conversation-sidebar-width);
  transition: margin-left 0.22s ease;
}

body.history-sidebar-collapsed #chat-messages,
body.history-sidebar-collapsed > footer {
  margin-left: var(--conversation-sidebar-collapsed-width);
}

.history-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 150;
  transition: opacity 0.25s;
}
.history-overlay.hidden { display: none; }

.history-drawer-overlay {
  display: none;
}

.history-panel {
  position: fixed;
  top: 65px;
  bottom: 0;
  left: 0;
  width: var(--conversation-sidebar-width);
  max-width: 90vw;
  background: #111827;
  border-right: 1px solid #273244;
  z-index: 49;
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  overflow: visible;
  transition: width 0.22s ease, max-width 0.22s ease, box-shadow 0.22s ease;
  box-shadow: 8px 0 24px rgba(0,0,0,0.12);
}
body.history-sidebar-collapsed .history-panel {
  width: var(--conversation-sidebar-collapsed-width);
  max-width: var(--conversation-sidebar-collapsed-width);
  transform: none;
  box-shadow: none;
}

body.history-sidebar-collapsed .history-panel > :not(.history-rail-toggle) {
  display: none;
}

.history-rail-toggle {
  position: absolute;
  top: 16px;
  right: -15px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid #374151;
  border-radius: 8px;
  background: #1f2937;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  color: #9ca3af;
  cursor: pointer;
  transition: right 0.22s ease, color 0.15s ease, background 0.15s ease;
}
.history-rail-toggle:hover {
  border-color: #4b5563;
  background: #273244;
  color: #fff;
}
.history-toggle-expand-icon {
  display: none;
}
body.history-sidebar-collapsed .history-rail-toggle {
  top: 12px;
  right: 6px;
  border-color: #3b82f6;
  background: #2563eb;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  color: #fff;
}
body.history-sidebar-collapsed .history-toggle-collapse-icon {
  display: none;
}
body.history-sidebar-collapsed .history-toggle-expand-icon {
  display: block;
}
body.history-sidebar-collapsed .history-rail-toggle:hover {
  border-color: #60a5fa;
  background: #1d4ed8;
}

.history-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 14px 11px;
  flex-shrink: 0;
}
.history-panel-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #e5e7eb;
  margin: 0;
}
.history-panel-heading {
  min-width: 0;
}
.history-panel-heading p {
  max-width: 190px;
  margin: 3px 0 0;
  overflow: hidden;
  color: #6b7280;
  font-size: 0.69rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-panel-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  transition: all 0.15s;
}
.history-panel-close:hover { background: #374151; color: #fff; }

.history-panel-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.history-delete-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: #9ca3af;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.15s;
}
.history-delete-all-btn:hover {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* ── 开启新对话按钮（历史面板头部）── */
.history-new-chat-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: #9ca3af;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.15s;
}
.history-new-chat-btn:hover {
  border-color: #60a5fa;
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
}
.history-new-chat-primary {
  justify-content: flex-start;
  margin: 3px 12px 6px;
  padding: 9px 11px;
  border: 1px solid #374151;
  background: #1f2937;
  color: #e5e7eb;
  font-size: 0.79rem;
}
.history-new-chat-primary:hover {
  border-color: #4b5563;
  background: #273244;
  color: #fff;
}

.history-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
}

.history-filter-bar {
  display: block;
  padding: 7px 12px 10px;
}
.history-filter-bar input,
.history-filter-bar select {
  min-width: 0;
  border: 1px solid #4b5563;
  border-radius: 7px;
  background: #111827;
  color: #d1d5db;
  padding: 7px 9px;
  font-size: 0.76rem;
  outline: none;
}
.history-filter-bar input:focus,
.history-filter-bar select:focus { border-color: #60a5fa; }

.history-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 15px 5px;
  color: #6b7280;
  font-size: 0.69rem;
}
.history-section-label button {
  border: 0;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-size: 0.67rem;
}
.history-section-label button:hover { color: #f87171; }

.quality-panel {
  position: fixed;
  z-index: 210;
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid #374151;
  border-radius: 14px;
  background: #111827;
  box-shadow: 0 24px 70px rgba(0,0,0,.55);
}
.quality-panel.hidden { display: none; }
.quality-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid #374151;
}
.quality-panel-header h3 { margin: 0; font-size: 1rem; }
.quality-panel-header p { margin: 3px 0 0; color: #6b7280; font-size: .72rem; }
.quality-panel-body { padding: 16px; }
.quality-section-title { margin: 16px 0 8px; color: #e5e7eb; font-size: .9rem; }
.quality-section-title:first-child { margin-top: 0; }
.quality-note { color: #9ca3af; font-size: .76rem; line-height: 1.65; margin: 10px 0; }
.quality-warning { color: #fbbf24; font-size: .78rem; line-height: 1.6; }
.quality-table-wrap { overflow: auto; max-height: 300px; margin-top: 14px; border: 1px solid #374151; border-radius: 8px; }
.quality-token-table { width: 100%; border-collapse: collapse; font-size: .72rem; white-space: nowrap; }
.quality-token-table caption { text-align: left; padding: 10px; color: #9ca3af; }
.quality-token-table th, .quality-token-table td { padding: 9px 10px; text-align: right; border-top: 1px solid #273244; }
.quality-token-table th { position: sticky; top: 0; background: #1f2937; color: #d1d5db; }
.quality-token-table td { color: #d1d5db; }
.quality-token-table th:first-child, .quality-token-table td:first-child { text-align: left; }
.quality-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.quality-card {
  padding: 13px;
  border: 1px solid #374151;
  border-radius: 9px;
  background: #1f2937;
}
.quality-card span { display: block; color: #9ca3af; font-size: .72rem; }
.quality-card strong { display: block; margin-top: 5px; color: #f3f4f6; font-size: 1.25rem; }
.quality-card small { margin-left: 3px; color: #6b7280; font-size: .65rem; font-weight: 400; }
.quality-failures { margin-top: 16px; }
.quality-failures h4 { margin: 0 0 8px; color: #d1d5db; font-size: .8rem; }
.quality-failures > div {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid #273244;
  color: #9ca3af;
  font-size: .72rem;
}
.quality-failures code { color: #60a5fa; overflow-wrap: anywhere; }
.quality-failures p { color: #6b7280; font-size: .76rem; }

@media (max-width: 640px) {
  .quality-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-filter-bar { grid-template-columns: 1fr; }
}
.history-loading {
  text-align: center;
  color: #6b7280;
  padding: 40px 0;
  font-size: 0.85rem;
}
.history-empty {
  text-align: center;
  color: #6b7280;
  padding: 40px 0;
  font-size: 0.85rem;
}

/* ── 历史会话卡片 ── */
.history-session-card {
  position: relative;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  margin-bottom: 2px;
  cursor: pointer;
  transition: all 0.15s;
  background: transparent;
}
.history-session-card:hover {
  background: #1a2332;
}
.history-session-card.active {
  border-color: rgba(96, 165, 250, 0.2);
  background: rgba(59, 130, 246, 0.12);
}
.history-session-preview {
  color: #d1d5db;
  font-size: 0.78rem;
  line-height: 1.4;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-session-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  color: #6b7280;
}
.history-lot-tag {
  display: inline-block;
  padding: 1px 6px;
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border-radius: 3px;
  font-size: 0.62rem;
  margin-left: auto;
  margin-right: 8px;
  white-space: nowrap;
}
.history-session-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  border-radius: 4px;
  background: transparent;
  border: none;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.history-session-delete:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* ── 快捷提问下拉（底部输入框左侧，菜单向上弹出） ── */
.quick-dropdown {
  position: relative;
  flex-shrink: 0;
}
.quick-dropdown-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  background: #374151;
  border: 1px solid #4b5563;
  border-radius: 8px;
  color: #9ca3af;
  cursor: pointer;
  transition: all 0.2s;
}
.quick-dropdown-btn:hover {
  background: #4b5563;
  color: #fff;
  border-color: #60a5fa;
}
.quick-dropdown-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  min-width: 240px;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
  box-shadow: 0 -8px 25px rgba(0,0,0,0.5);
  z-index: 100;
  overflow: hidden;
  animation: dropdownUp 0.15s ease-out;
}
@keyframes dropdownUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.quick-dropdown-menu.hidden { display: none; }
.quick-dropdown-item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-bottom: 1px solid #374151;
  color: #d1d5db;
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
}
.quick-dropdown-item:last-child { border-bottom: none; }
.quick-dropdown-item:hover {
  background: #374151;
  color: #fff;
}

/* ====== 移动端响应式 ====== */
@media (max-width: 768px) {
  /* ── 顶部导航栏：品牌与操作在第一行，车场独占第二行 ── */
  header.app-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 40px 46px;
    gap: 8px 6px;
    padding: 8px 14px 9px !important;
    border-color: #374151 !important;
    background: #1f2937 !important;
    color: #fff;
  }
  .header-brand {
    min-width: 0;
    gap: 8px !important;
  }
  .header-logo {
    width: 34px !important;
    height: 34px !important;
    flex-shrink: 0;
  }
  .header-logo img {
    width: 31px !important;
    height: 31px !important;
  }
  header h1 {
    overflow: hidden;
    color: #fff;
    font-size: 1.15rem !important;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .header-actions {
    gap: 2px !important;
    flex-wrap: nowrap !important;
    margin-left: 0;
  }
  .parking-lot-dropdown {
    grid-column: 1 / -1;
    grid-row: 2;
    display: block;
    justify-self: end;
    width: calc(100% - 8px);
    max-width: 520px;
    margin: 0;
  }
  .mobile-parking-label {
    position: absolute;
    top: -7px;
    left: 10px;
    z-index: 1;
    display: block;
    padding: 0 5px;
    background: #1f2937;
    color: #9ca3af;
    font-size: .65rem;
    line-height: 1;
  }
  .parking-lot-dropdown-btn {
    width: 100%;
    height: 46px;
    max-width: none;
    justify-content: flex-start;
    gap: 10px !important;
    padding: 0 12px !important;
    border-color: #4b5563;
    border-radius: 5px;
    background: #1f2937;
    color: #d1d5db;
    font-size: .9rem !important;
  }
  .parking-lot-dropdown-btn:hover {
    background: #1f2937;
    color: #fff;
  }
  .desktop-parking-icon,
  .parking-lot-dropdown-btn .dropdown-arrow {
    display: none;
  }
  .mobile-parking-mark {
    display: inline-block;
    flex-shrink: 0;
    font-size: 1rem;
    font-weight: 700;
  }
  .mobile-parking-search-icon {
    display: block;
    flex-shrink: 0;
    width: 19px;
    height: 19px;
  }
  #selected-parking-lot-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .parking-lot-dropdown-menu {
    right: 0 !important;
    left: 0 !important;
    min-width: 0 !important;
    width: 100%;
  }
  /* 系统状态：完全隐藏 */
  #status-indicator {
    display: none !important;
  }
  /* 质量概览属于桌面端运维信息，手机端隐藏以释放顶部空间 */
  .history-btn {
    display: none !important;
  }
  .mobile-header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #d1d5db;
  }
  .mobile-header-btn:active {
    background: #374151;
  }
  .mobile-user-dropdown {
    position: relative;
    display: block;
  }
  .screen-dropdown-btn {
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0 !important;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #d1d5db;
  }
  .screen-dropdown-btn:hover {
    background: #374151;
    color: #fff;
  }
  .screen-dropdown-btn > span {
    display: none;
  }
  .screen-dropdown-btn > svg:first-child {
    width: 24px;
    height: 24px;
  }
  .mobile-header-btn svg {
    width: 24px;
    height: 24px;
  }
  .screen-dropdown-btn .dropdown-arrow {
    display: none;
  }

  /* ── 主内容区 ── */
  main,
  body > footer,
  body.history-sidebar-collapsed main,
  body.history-sidebar-collapsed > footer {
    margin-left: 0 !important;
  }
  main {
    padding: 8px 8px !important;
    gap: 10px !important;
  }

  /* 欢迎区 */
  #welcome-area h2 {
    font-size: 1rem !important;
    margin-bottom: 8px !important;
  }
  #quick-questions {
    display: none !important;
  }
  #welcome-area .w-16 {
    width: 40px !important;
    height: 40px !important;
    font-size: 1.5rem !important;
  }

  /* ── 聊天气泡：缩小字号 ── */
  #chat-messages .user-bubble,
  #chat-messages .ai-bubble {
    font-size: 14px !important;
    padding: 8px 12px !important;
    line-height: 1.55 !important;
  }
  .user-bubble { max-width: 88% !important; }
  .ai-bubble { max-width: 95% !important; }

  /* ── 图表容器：缩小高度 ── */
  .chart-container {
    min-height: 240px !important;
    border-radius: 8px !important;
  }
  .chart-inner {
    height: 240px !important;
  }

  /* ── 数字卡片：缩小 ── */
  .number-card {
    padding: 14px 20px !important;
    border-radius: 8px !important;
  }
  .number-card .value {
    font-size: 1.5rem !important;
  }
  .number-card .label {
    font-size: 0.75rem !important;
  }

  /* ── 大屏按钮：缩小 ── */
  .screen-btn {
    padding: 6px 12px !important;
    font-size: 0.75rem !important;
    margin-top: 8px !important;
  }

  /* ── 思考区域 ── */
  .thinking-content {
    max-height: 160px !important;
    font-size: 0.7rem !important;
  }
  .thinking-header {
    font-size: 0.72rem !important;
    padding: 6px 10px !important;
  }

  /* ── 底部输入区 ── */
  footer {
    padding: 10px 6px calc(10px + env(safe-area-inset-bottom)) !important;
  }
  footer .max-w-3xl {
    gap: 4px !important;
    flex-wrap: nowrap !important;
  }
  /* 保留舒适的触控面积 */
  .quick-dropdown-btn {
    width: 44px !important;
    height: 44px !important;
    flex-shrink: 0;
  }
  .quick-dropdown-btn svg {
    width: 20px;
    height: 20px;
  }
  #user-input {
    min-height: 44px;
    padding: 8px 10px !important;
    font-size: 0.95rem !important;
    min-width: 0;
  }
  #send-btn {
    min-height: 44px;
    padding: 8px 12px !important;
    font-size: 0.9rem !important;
    white-space: nowrap !important;
    flex-shrink: 0;
  }
  /* 功能开放前不占用移动端输入栏空间 */
  #voice-btn {
    display: none !important;
  }

  /* ── 历史面板：覆盖式抽屉，关闭时不再挤占聊天区 ── */
  .history-drawer-overlay:not(.hidden) {
    position: fixed;
    top: 111px;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 148;
    display: block;
    background: rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(2px);
  }
  .history-panel {
    top: 111px !important;
    width: min(86vw, 320px) !important;
    max-width: 320px !important;
    z-index: 149 !important;
    box-shadow: 12px 0 35px rgba(0,0,0,0.45) !important;
  }
  body.history-sidebar-collapsed .history-panel {
    width: 0 !important;
    max-width: 0 !important;
    border-right: 0;
    background: transparent;
    box-shadow: none !important;
  }
  .history-rail-toggle,
  body.history-sidebar-collapsed .history-rail-toggle {
    display: none !important;
  }

  /* ── 大屏灯箱 ── */
  .screen-lightbox-container {
    width: 100vw !important;
    height: 100dvh !important;
    max-width: none !important;
    border-radius: 0 !important;
  }
  .screen-lightbox-header {
    padding: 8px 12px !important;
  }
  .screen-lightbox-title {
    font-size: 0.8rem !important;
  }

  /* ── 大屏下拉菜单：右边界对齐按钮右边界 ── */
  .screen-dropdown-menu {
    right: 0 !important;
    left: auto !important;
    min-width: 160px !important;
  }

  /* ── 快捷提问下拉 ── */
  .quick-dropdown-menu {
    min-width: 200px !important;
  }
  .quick-dropdown-item {
    padding: 8px 12px !important;
    font-size: 0.75rem !important;
  }

  /* ── AI 回复排版 ── */
  .ai-heading {
    font-size: 0.82rem !important;
  }
  h3.ai-heading { font-size: 0.88rem !important; }
  h4.ai-heading { font-size: 0.8rem !important; }

  /* ── 兜底快捷按钮 ── */
  .inline-quick-btns {
    gap: 4px !important;
  }
  .inline-quick-btn {
    padding: 4px 8px !important;
    font-size: 0.72rem !important;
  }
}

/* 更小屏幕（~iPhone SE） */
@media (max-width: 400px) {
  header h1 {
    font-size: 1rem !important;
    max-width: 100px;
  }
  #quick-questions {
    grid-template-columns: 1fr !important;
  }
  .chart-container {
    min-height: 200px !important;
  }
  .chart-inner {
    height: 200px !important;
  }
  footer .max-w-3xl {
    gap: 4px !important;
  }
  #send-btn {
    padding: 8px 10px !important;
    font-size: 0.86rem !important;
  }
  #user-input {
    font-size: 0.9rem !important;
  }
}

/* ====== 大屏预览灯箱 ====== */
.screen-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.screen-lightbox.hidden {
  display: none;
}
.screen-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}
.screen-lightbox-container {
  position: relative;
  width: 95vw;
  height: 90vh;
  max-width: 1400px;
  background: #111827;
  border: 1px solid #374151;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: lightboxIn 0.2s ease-out;
}
@keyframes lightboxIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.screen-lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #1f2937;
  border-bottom: 1px solid #374151;
  flex-shrink: 0;
}
.screen-lightbox-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #e5e7eb;
}
.screen-lightbox-actions {
  display: flex;
  gap: 6px;
}
.screen-lightbox-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  transition: all 0.15s;
}
.screen-lightbox-btn:hover {
  background: #374151;
  color: #fff;
}
.screen-lightbox-body {
  flex: 1;
  overflow: hidden;
  background: #fff;  /* 大屏页面通常为浅色背景 */
}
.screen-lightbox-body iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ── 数据预览卡片（LLM思考期间即时展示）── */
.data-preview {
  margin-bottom: 8px;
  animation: slideIn 0.3s ease-out;
}
.data-preview.hidden {
  display: none;
}
.preview-header {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}
.preview-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 6px;
}
.preview-card {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
}
.preview-card-label {
  display: block;
  font-size: 11px;
  color: #9ca3af;
  margin-bottom: 2px;
}
.preview-card-value {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: #60a5fa;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .preview-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .preview-card-value {
    font-size: 16px;
  }
}

/* ── 反馈按钮 ── */
.feedback-btns {
  opacity: 0;
  transition: opacity 0.2s;
}
.ai-bubble:hover .feedback-btns {
  opacity: 1;
}
.feedback-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #6b7280;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  opacity: 0.5;
}
.feedback-btn:hover {
  color: #e5e7eb;
  background: rgba(255,255,255,0.08);
  opacity: 1;
}

/* ── 运营建议匹配得分说明 ── */
.ops-score-help-action {
  margin-top: 12px;
}
.ops-score-help-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid rgba(96, 165, 250, 0.35);
  border-radius: 8px;
  background: rgba(30, 64, 175, 0.14);
  color: #93c5fd;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ops-score-help-btn:hover,
.ops-score-help-btn:focus-visible {
  border-color: rgba(96, 165, 250, 0.7);
  background: rgba(30, 64, 175, 0.28);
  color: #dbeafe;
  outline: none;
}
.ops-score-help-overlay {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(3px);
}
.ops-score-help-overlay.hidden {
  display: none;
}
.ops-score-help-dialog {
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid #334155;
  border-radius: 14px;
  background: #111827;
  color: #e5e7eb;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.58);
}
.ops-score-help-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 18px;
  border-bottom: 1px solid #273244;
}
.ops-score-help-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}
.ops-score-help-header p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
}
.ops-score-help-close {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #94a3b8;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.ops-score-help-close:hover,
.ops-score-help-close:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  outline: none;
}
.ops-score-help-body {
  padding: 18px;
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.75;
}
.ops-score-help-body p {
  margin: 0;
}
.ops-score-help-note {
  margin: 14px 0;
  padding: 11px 13px;
  border-left: 3px solid #60a5fa;
  border-radius: 6px;
  background: rgba(30, 64, 175, 0.13);
  color: #dbeafe;
}
.ops-score-help-body h4 {
  margin: 16px 0 6px;
  color: #f3f4f6;
  font-size: 14px;
}
.ops-score-help-body ul {
  margin: 0;
  padding-left: 20px;
  color: #94a3b8;
}
.ops-score-help-footnote {
  margin-top: 14px !important;
  color: #94a3b8;
  font-size: 12px;
}

/* ── 简道云售后资料卡片 ── */
.support-documents {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.support-documents-title {
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 700;
}
.support-doc-card {
  padding: 13px 14px;
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: 10px;
  background: rgba(8, 47, 73, 0.2);
}
.support-doc-module {
  color: #38bdf8;
  font-size: 11px;
  font-weight: 600;
}
.support-doc-card h4 {
  margin: 4px 0 5px;
  color: #f1f5f9;
  font-size: 14px;
}
.support-doc-card p {
  margin: 0;
  color: #aebccd;
  font-size: 12px;
  line-height: 1.65;
}
.support-doc-extra,
.support-doc-updated,
.support-doc-no-link {
  margin-top: 7px;
  color: #718096;
  font-size: 11px;
}
.support-doc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.support-doc-link {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid rgba(56, 189, 248, 0.42);
  border-radius: 7px;
  background: rgba(2, 132, 199, 0.13);
  color: #7dd3fc;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.support-doc-link:hover {
  border-color: #38bdf8;
  background: rgba(2, 132, 199, 0.26);
  color: #e0f2fe;
}

/* ── V3.1 数据口径与证据链 ── */
.evidence-panel {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(96, 165, 250, 0.22);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.45);
  font-size: 12px;
  color: #cbd5e1;
}
.evidence-panel summary {
  cursor: pointer;
  color: #93c5fd;
  font-weight: 600;
  user-select: none;
}
.tool-monitor {
  margin-top: 8px;
  padding: 7px 10px;
  border: 1px solid rgba(34, 211, 238, 0.25);
  border-radius: 7px;
  background: rgba(8, 47, 73, 0.22);
  font-size: 12px;
  color: #cbd5e1;
}
.tool-monitor summary {
  cursor: pointer;
  color: #67e8f9;
  font-weight: 600;
  user-select: none;
}
.tool-monitor-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.tool-monitor-judgment {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.tool-monitor-judgment span {
  color: #94a3b8;
}
.tool-monitor-judgment code {
  color: #fef08a;
  overflow-wrap: anywhere;
}
.tool-monitor-tag {
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(14, 116, 144, 0.35);
  color: #a5f3fc;
  overflow-wrap: anywhere;
}
.tool-monitor-empty {
  color: #94a3b8;
}
.evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  margin-top: 9px;
}
.evidence-grid div {
  min-width: 0;
}
.evidence-grid span {
  display: block;
  color: #64748b;
  margin-bottom: 2px;
}
.evidence-grid strong,
.evidence-grid code {
  display: block;
  overflow-wrap: anywhere;
  color: #e2e8f0;
}
.evidence-summary {
  margin-top: 8px;
  color: #94a3b8;
  line-height: 1.55;
}
.evidence-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: #94a3b8;
}
.evidence-id {
  display: block;
  color: #64748b;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .evidence-grid {
    grid-template-columns: 1fr;
  }
}
.cloud-record-table-wrap {
  width: 100%;
  max-height: 360px;
  overflow: auto;
  border: 1px solid rgba(56, 189, 248, 0.16);
  border-radius: 10px;
  background: rgba(8, 16, 40, 0.5);
}

.cloud-record-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 12px;
  color: #cbd5e1;
}

.cloud-record-table th,
.cloud-record-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.45);
  text-align: left;
  white-space: nowrap;
}

.cloud-record-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #7dd3fc;
  background: #0b1830;
  font-weight: 600;
}

.cloud-record-table tbody tr:hover {
  background: rgba(14, 165, 233, 0.08);
}

.cloud-record-table-empty {
  padding: 34px 16px;
  border: 1px dashed rgba(56, 189, 248, 0.18);
  border-radius: 10px;
  color: #64748b;
  text-align: center;
  font-size: 13px;
}

.chart-container.chart-table-container {
  min-height: 0 !important;
  padding: 10px;
  overflow: hidden;
}

.chart-container.chart-table-container .chart-inner {
  height: auto !important;
}
