/* Mobile navigation and touch targets; loaded after the main stylesheets. */
@media (max-width: 760px) {
  html, body { max-width: 100%; }
  .workspace { margin-left: 0; min-width: 0; padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
  .sidebar {
    inset: auto 0 0; width: 100%; height: calc(68px + env(safe-area-inset-bottom, 0px));
    padding: 0 0 env(safe-area-inset-bottom, 0px); display: flex; flex-direction: row;
    align-items: stretch; border: 0; border-top: 1px solid #34363b; z-index: 30;
    background: #17181c; box-shadow: 0 -4px 20px #0004;
  }
  .sidebar > .brand, .sidebar > .side-label, .sidebar > .side-challenge { display: none; }
  .sidebar nav { width: auto; min-width: 0; flex: 5 1 0; margin: 0; display: flex; align-items: stretch; }
  .sidebar nav a {
    flex: 1 1 0; min-width: 0; margin: 0; padding: 5px 1px; border-radius: 0;
    display: flex; flex-direction: column; justify-content: center; gap: 2px;
    font-size: 9px; line-height: 1.25; white-space: nowrap;
  }
  .sidebar nav a svg { width: 20px; height: 20px; }
  .sidebar .sidebar-bottom { display: flex; flex: 1 1 0; min-width: 0; width: auto; margin: 0; }
  .sidebar-bottom .side-user { width: 100%; height: 100%; margin: 0; padding: 0; border: 0; }
  .side-user-main { width: 100%; height: 100%; min-height: 44px; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
  .side-user-main::after { content: '账号'; color: #a9aab3; font-size: 9px; line-height: 1.25; }
  .side-user-main .avatar { width: 22px; height: 22px; font-size: 9px; }
  .sidebar-bottom .account-menu-toggle { display: none; }
  .account-menu { position: fixed; left: auto; right: 8px; bottom: calc(75px + env(safe-area-inset-bottom, 0px)); width: min(300px, calc(100vw - 16px)); max-height: calc(100dvh - 90px); overflow-y: auto; z-index: 31; }
  .account-menu > button, .account-menu > a { min-height: 44px; }
  .cards { grid-template-columns: minmax(0,1fr); }
  .card-cover { aspect-ratio: 1.75; }
  .card-title { white-space: normal; overflow-wrap: anywhere; line-height: 1.5; }
  .video-layout, .content-grid, .feed { min-width: 0; }
  .player-wrap, .player-wrap video { width: 100%; max-width: 100%; }
  .player-wrap video { object-fit: contain; }
  .video-dialog { width: min(100%, 700px); max-width: 100%; max-height: 100dvh; }
  .video-dialog .modal-close { z-index: 4; }
  .player-tools button, .vote-options button, .filter, .feed-tab,
  .card-cta button, .profile-tabs button, .topbar button { min-height: 44px; }
  .filters { align-items: center; }
  .filter { padding-left: 10px; padding-right: 10px; }
  .feed-tabs { gap: 18px; }
  .toast { left: 50%; bottom: calc(82px + env(safe-area-inset-bottom, 0px)); max-width: calc(100vw - 24px); }
  .analytics-banner { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); width: calc(100vw - 26px); }
  .page-footer { flex-wrap: wrap; }
}
