/* ============================================================
   2026-11 C · 手机/平板第三轮精修（只在小屏生效）
   重点：论坛标题与按钮、我的导航条、AI 对话建议、课件云盘行、可聚焦态
   ============================================================ */

/* ---------- 手机 ≤720 ---------- */
@media (max-width: 720px) {
  /* 可聚焦元素统一描边，键盘/触屏都看得见 */
  a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
  [tabindex]:focus-visible { outline: 2px solid #245fcf; outline-offset: 2px; border-radius: 8px; }

  /* 论坛：标题更收敛，发帖按钮占到整行 */
  .forum-hero h1 { font-size: clamp(30px, 8.6vw, 40px); line-height: 1.14; letter-spacing: -.01em; }
  .forum-hero-main { flex-direction: column; align-items: stretch; gap: 16px; }
  .forum-hero p { font-size: 15px; line-height: 1.75; }
  #composeButton { width: 100%; min-height: 48px; border-radius: 14px; }
  .forum-search input { font-size: 16px; min-height: 46px; }
  .hot-tags { gap: 8px; }
  .hot-tags button { min-height: 38px; }

  /* 我的：横向导航条更好点，带边缘渐隐提示还能滑 */
  .dashboard-nav {
    gap: 6px;
    padding: 2px 2px 10px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(to right, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
  }
  .dashboard-nav button { min-height: 44px; padding: 0 14px; font-size: 13px; border-radius: 11px; scroll-snap-align: start; }
  .dashboard-nav button.active { box-shadow: inset 0 0 0 1px #d5e2f7; }
  .guest-gate-card > p { max-width: 32em; text-wrap: pretty; }
  .profile-block { padding: 2px 2px 14px; }

  /* AI 对话：建议改成单列大按钮，手指好点（选择器带 .ai-chat-page，压过原两列规则） */
  .ai-chat-page .chat-suggestions { grid-template-columns: 1fr; gap: 10px; }
  .ai-chat-page .chat-suggestion { min-height: 52px; font-size: 15px; padding: 0 16px; border-radius: 14px; justify-content: flex-start; }
  .ai-chat-page .chat-suggestion [data-icon] { font-size: 17px; }

  /* 课件云盘：文件名最多两行，操作按钮换到下一行 */
  .cd-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.4; }
  .cd-item { flex-wrap: wrap; padding: 14px; }
  .cd-ops { width: 100%; justify-content: flex-end; gap: 8px; }
  .cd-ops button { min-height: 38px; padding: 0 12px; }
  .cd-switch { width: 100%; justify-content: center; }
  .cd-switch a { flex: 1; text-align: center; }
}

/* ---------- 平板 721–1024 ---------- */
@media (min-width: 721px) and (max-width: 1024px) {
  /* 论坛：大标题按平板收敛，按钮下移，避免和标题抢位置 */
  .forum-hero h1 { font-size: clamp(34px, 5.2vw, 46px); line-height: 1.12; }
  .forum-hero-main { flex-direction: column; align-items: flex-start; gap: 18px; }
  #composeButton { width: auto; min-width: 148px; min-height: 46px; }
  .forum-hero p { font-size: 16px; }

  /* 我的：侧栏略窄一点，把空间让给内容 */
  .dashboard-sidebar { padding: 24px 16px; }
  .dashboard-nav button { font-size: 12.5px; }

  /* 首页：四张智能体卡片在平板上两列更稳 */
  .agent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* 地图：地图与信息卡间距更松 */
  .map-layout { gap: 20px; }
}
/* ---------- 手机端导航：竖向列表，逐项铺满，滚动可达 ---------- */
@media (max-width: 860px) {
  .main-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    max-height: calc(100dvh - 92px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .main-nav > a,
  .main-nav .nav-drop-trigger {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
    padding: 11px 14px;
    font-size: 14px;
    border-radius: 10px;
  }
  .main-nav .nav-drop { display: block; width: 100%; }
  .main-nav .nav-drop-panel {
    position: static;
    width: auto;
    transform: none;
    display: grid;
    gap: 2px;
    padding: 2px 0 2px 14px;
    margin: 0;
    border: 0;
    box-shadow: none;
    opacity: 1;
    visibility: inherit;
  }
  .main-nav .nav-drop-panel a { width: auto; padding: 9px 12px; font-size: 13px; }
}
/* 下拉子项只在导航打开时可见，避免关闭状态挡住页面点击 */
@media (max-width: 860px) {
  .main-nav .nav-drop-panel { display: none; }
  .nav-open .main-nav .nav-drop-panel { display: grid; }
}