/* ============================================
   mobile.css - 移动端响应式适配
   纯 CSS 方案，不要求 HTML 结构改动
   ============================================ */

/* 手机 (<768px) */
@media (max-width: 768px) {
  /* 布局：侧边栏在上方，内容在下方 */
  .app-container {
    flex-direction: column !important;
  }

  .sidebar {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    padding: 10px 0 !important;
    overflow: visible !important;
  }

  /* Logo 和侧边栏头部合并成一行 */
  .app-logo {
    flex-direction: row !important;
    padding: 8px 16px !important;
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
  }

  .app-logo h1 {
    font-size: 16px !important;
  }

  .app-logo i {
    font-size: 22px !important;
    margin-right: 8px !important;
  }

  /* 用户信息简化 */
  .sidebar-profile {
    display: none !important;
  }

  /* 导航菜单改为水平滚动 */
  .nav-menu {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    margin-top: 0 !important;
    padding: 6px 10px !important;
    gap: 2px !important;
    -webkit-overflow-scrolling: touch;
  }

  .nav-menu::-webkit-scrollbar {
    display: none !important;
  }

  .nav-item {
    display: inline-flex !important;
    padding: 8px 12px !important;
    border-left: none !important;
    border-bottom: 2px solid transparent !important;
    font-size: 13px !important;
    flex-shrink: 0 !important;
    min-width: auto !important;
  }

  .nav-item.active {
    border-left: none !important;
    border-bottom: 2px solid var(--accent-color, #f26b4f) !important;
    background: transparent !important;
  }

  .nav-item i {
    font-size: 16px !important;
    margin-right: 6px !important;
  }

  .nav-item span {
    font-size: 12px !important;
  }

  /* 主内容区 */
  .main-content {
    width: 100% !important;
    padding: 14px !important;
  }

  /* 页面内容网格堆叠 */
  .page-hero {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .stat-card {
    padding: 12px !important;
  }

  .module-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .hero-actions {
    flex-direction: column !important;
    gap: 8px !important;
  }

  .hero-actions .btn {
    width: 100% !important;
    text-align: center !important;
  }

  /* 嵌入的创作台页面 */
  #creator-content-frame {
    height: calc(100vh - 180px) !important;
  }

  /* 命令面板调整 */
  .command-trigger {
    right: 12px !important;
    bottom: 12px !important;
    width: 44px !important;
    height: 44px !important;
  }

  .command-trigger span {
    display: none !important;
  }

  .command-palette {
    padding-top: 5vh !important;
  }

  .command-panel {
    max-height: 85vh !important;
  }

  /* 表格水平滚动 */
  table {
    display: block !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
  }

  /* 弹窗全屏 */
  .modal-overlay {
    padding: 10px !important;
  }

  .modal {
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 12px !important;
  }
}

/* 小手机 (<480px) */
@media (max-width: 480px) {
  html { font-size: 14px; }
  body { font-size: 14px; }

  .main-content {
    padding: 10px !important;
  }

  .hero-title {
    font-size: 1.2rem !important;
  }

  .section-card {
    padding: 12px !important;
  }

  .nav-item {
    padding: 6px 10px !important;
    font-size: 12px !important;
  }

  .nav-item span {
    font-size: 11px !important;
  }
}

/* 平板 (768-1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .sidebar {
    width: 220px !important;
  }

  .main-content {
    padding: 20px !important;
  }

  .nav-item {
    padding: 12px 14px !important;
    font-size: 13px !important;
  }

  .module-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
