/* ============================================================================
   Verba 移动端深度专属响应式适配与极简紧凑布局 (public/mobile.css)
   核心铁律：
   1. 手机端所有按钮与标签文字严禁折行（强制 white-space: nowrap !important）
   2. 触屏端隐藏无意义的物理键盘快捷键标签（如 ⌘↵）
   3. 头部导航、画布操作栏、时间流头部采用自适应双行与高质感紧凑排版
   ============================================================================ */

@media (max-width: 640px) {
  /* 移动端全局按钮与标签防折行铁律 */
  button,
  .btn-subtle,
  .btn-primary,
  .btn-speech-toggle,
  .btn-copy,
  .btn-archive,
  .btn-ai-organize,
  .btn-save-revision,
  .status-pill,
  .status-label,
  .live-target-project-chip,
  .mobile-project-pill,
  .timeline-count-badge,
  .metric-chip,
  .card-project-tag,
  .card-revision-badge,
  .user-btn,
  .brand-title,
  .speech-text,
  .copy-text,
  #archiveBtnText,
  #saveRevisionText {
    white-space: nowrap !important;
  }

  /* 隐藏移动端无意义的物理键盘快捷键提示 */
  .shortcut-kbd {
    display: none !important;
  }

  /* 1. 顶部导航栏紧凑优化 */
  .navbar {
    padding: 8px 12px;
    gap: 6px;
  }

  .brand-tag {
    display: none !important; /* 手机端隐藏以节省空间 */
  }

  .nav-brand {
    gap: 6px;
    flex-shrink: 0;
  }

  .brand-title {
    font-size: 15px;
  }

  .status-pill {
    padding: 4px 8px;
    font-size: 11px;
    gap: 5px;
    flex-shrink: 0;
  }

  .nav-controls {
    gap: 6px;
    flex-shrink: 0;
  }

  .user-btn {
    padding: 4px 8px;
    font-size: 11px;
  }

  /* 2. 主体工作区 */
  .app-layout {
    margin: 8px auto;
    padding: 0 10px 60px;
    gap: 12px;
  }

  /* 3. 实时画布头部精简 */
  .live-card {
    padding: 12px;
  }

  .live-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 8px;
  }

  .live-badge {
    font-size: 12px;
    flex-shrink: 0;
  }

  .live-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }

  .live-target-project-chip {
    padding: 3px 8px;
    font-size: 11px;
    flex-shrink: 0;
  }

  .live-meta {
    display: none !important; /* 手机端隐藏冗余状态文本，状态胶囊已表达连接状态 */
  }

  /* 4. 输入框字号自适应 */
  .live-editor {
    min-height: 120px;
    font-size: 15px;
    padding: 10px;
  }

  /* 5. 画布底部操作栏（关键：单行紧凑排列，绝不折行，四等分自适应） */
  .live-action-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
  }

  .live-metrics {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
  }

  .metric-chip {
    padding: 2px 7px;
    font-size: 10px;
  }

  .live-btn-group {
    display: grid !important;
    grid-template-columns: 1.15fr 0.85fr 1.15fr 1.25fr !important;
    gap: 5px !important;
    width: 100% !important;
    padding: 0 !important;
  }

  .live-btn-group button {
    min-width: 0 !important;
    width: 100% !important;
    padding: 7px 4px !important;
    font-size: 12px !important;
    justify-content: center !important;
    gap: 3px !important;
    white-space: nowrap !important;
  }

  .speech-wave-bars {
    display: none !important; /* 手机端隐藏占用空间的波动条，保留麦克风图标即可 */
  }

  /* 6. 时间流头部结构（双行结构，各元素绝不挤压） */
  .timeline-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
  }

  .timeline-heading {
    display: grid !important;
    grid-template-areas:
      "title count project"
      "ai ai trash" !important;
    grid-template-columns: auto auto 1fr !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .timeline-heading > svg {
    display: none !important; /* 手机端精简冗余大图标 */
  }

  .timeline-heading h2 {
    grid-area: title !important;
    font-size: 15px !important;
    margin: 0 !important;
    white-space: nowrap !important;
  }

  .timeline-count-badge {
    grid-area: count !important;
    font-size: 11px !important;
    padding: 2px 6px !important;
    white-space: nowrap !important;
  }

  .mobile-project-pill {
    grid-area: project !important;
    justify-self: end !important;
    font-size: 11px !important;
    padding: 4px 8px !important;
    max-width: 140px !important;
    white-space: nowrap !important;
  }

  .mobile-project-pill #mobileProjectName {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    max-width: 80px !important;
    display: inline-block !important;
    vertical-align: middle !important;
  }

  .btn-ai-organize {
    grid-area: ai !important;
    font-size: 12px !important;
    padding: 7px 10px !important;
    justify-content: center !important;
    white-space: nowrap !important;
  }

  .btn-trash-toggle {
    grid-area: trash !important;
    justify-self: end !important;
    font-size: 12px !important;
    padding: 7px 10px !important;
    justify-content: center !important;
    white-space: nowrap !important;
  }

  .search-box {
    width: 100%;
  }

  .search-box input {
    width: 100% !important;
    font-size: 13px;
    padding: 7px 10px 7px 32px;
  }

  /* 7. 卡片列表紧凑化 */
  .card-capsule {
    padding: 12px;
  }

  .card-content {
    font-size: 14px;
    line-height: 1.5;
  }

  /* 8. 弹窗类移动端全屏响应式 */
  .modal-card {
    width: 94vw !important;
    max-width: 94vw !important;
    padding: 16px;
  }
}
