/* 手机端（≤620px）：
   1. 导航收成一根竖着的小药丸，悬浮在右下角边上，只留图标，不再占底部。
   2. 字号、间距、头部、卡片整体缩小一档，同一屏能看到更多内容。 */
@media (max-width: 620px) {
  body { font-size: 14px; }
  .wrap { width: calc(100% - 20px) !important; }

  /* 顶栏 */
  .mast-inner { height: 50px !important; gap: 8px !important; }
  .brand::before { width: 8px; height: 20px; }
  .brand-type b { font-size: 16px !important; }
  .brand-type i { font-size: 7px !important; letter-spacing: .16em; }
  .searchbox { height: 32px !important; width: clamp(120px, 38vw, 180px) !important; padding: 0 8px !important; }
  .searchbox svg { width: 14px; height: 14px; }
  .searchbox input { font-size: 16px; } /* 低于 16px 时 iOS 点输入框会自动放大页面 */
  .searchbox input::placeholder { font-size: 12.5px; }
  .account-login, .account-btn { height: 32px !important; padding: 0 6px !important; }
  .account-btn .avatar { width: 24px; height: 24px; font-size: 13px; }

  /* 首屏和话题 */
  .main { padding-top: 10px !important; padding-bottom: calc(40px + env(safe-area-inset-bottom)) !important; }
  .hero { --c: 14px !important; aspect-ratio: 1.9 !important; }
  .hero::before, .hero::after { width: 22px !important; height: 22px !important; border-width: 2px !important; }
  .hero::before { left: 10px; top: 10px; } .hero::after { right: 10px; bottom: 10px; }
  .topic-strip { padding-top: 10px !important; gap: 8px !important; }
  .topic-strip h2 { font-size: 12px !important; }
  .topic-link { font-size: 12px !important; padding: 4px 10px !important; }

  /* 栏目标题、筛选 */
  .board-grid { margin-top: 16px !important; }
  .feed-heading { padding-bottom: 8px !important; }
  .feed-heading h1 { font-size: 20px !important; }
  .count { font-size: 11px !important; }
  .sort-segments button { font-size: 12px !important; min-height: 28px !important; padding: 2px 10px !important; }
  .image-filter { font-size: 12px !important; min-height: 28px !important; }
  .filters { margin: 10px 0 !important; gap: 4px !important; }
  .filter { font-size: 12px !important; padding: 5px 10px !important; min-height: 0 !important; }

  /* 投稿卡片 */
  .feed-list { gap: 8px !important; }
  .post { --c: 8px; padding: 12px 12px 4px 14px !important; }
  .post::before { right: 12px !important; top: 11px !important; font-size: 10px !important; }
  .post:has(.post-thumb)::before { top: 12px !important; right: 12px !important; padding: 1px 6px !important; }
  .post-copy.with-image .post-thumb { margin-bottom: 9px !important; }
  .post-title, .post-copy.with-image .post-title { font-size: 15px !important; line-height: 1.45 !important; }
  .excerpt { font-size: 13px !important; line-height: 1.65 !important; }
  .post-meta { margin-top: 8px !important; gap: 7px !important; }
  .avatar { width: 22px !important; height: 22px !important; font-size: 12px !important; }
  .authorline strong { font-size: 12px !important; }
  .authorline time { font-size: 10.5px !important; }
  .cat-mark { font-size: 10.5px !important; padding: 0 6px !important; }
  .cat-mark svg { width: 11px; height: 11px; }
  .post .tag { font-size: 11px !important; margin-top: 6px !important; }
  .post-actions { gap: 6px !important; }
  .post-actions button { font-size: 12px !important; min-height: 30px !important; padding: 2px 4px !important; }
  .post-actions button svg { width: 15px; height: 15px; }
  .spoiler-label { font-size: 12px; padding: 4px 8px; }
  .more-button { font-size: 13px; padding: 8px 22px; }
  .rail-box.ranking-box .rail-head h2 { font-size: 16px !important; }
  .rank-text b { font-size: 13px !important; }

  /* 侧边竖排导航：右下角的一根小药丸，只有图标 */
  .mobile-nav {
    display: flex !important; flex-direction: column; gap: 4px;
    inset: auto calc(10px + env(safe-area-inset-right)) calc(22px + env(safe-area-inset-bottom)) auto !important;
    width: auto !important; transform: none !important;
    padding: 5px !important; border-radius: 999px !important;
    background: rgba(26, 27, 32, .82) !important;
    -webkit-backdrop-filter: blur(14px) saturate(1.5); backdrop-filter: blur(14px) saturate(1.5);
    border: 1px solid rgba(255, 255, 255, .08) !important;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .28) !important;
  }
  .mobile-nav button {
    width: 38px; height: 38px; min-height: 0 !important; padding: 0 !important;
    border-radius: 50%; color: #b4b7c0 !important; transition: background .16s, color .16s;
  }
  .mobile-nav button > span { width: auto !important; height: auto !important; background: none !important; }
  .mobile-nav button svg { width: 18px !important; height: 18px !important; }
  .mobile-nav b { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .mobile-nav button[aria-current=page] { background: var(--y) !important; color: var(--ink) !important; }
  .mobile-nav .mobile-compose { background: #fff !important; color: var(--ink) !important; order: -1; } /* 投稿用白色，和当前页的黄色区分开 */
  .mobile-nav .mobile-compose > span { background: none !important; color: inherit !important; }

  #toast { bottom: calc(20px + env(safe-area-inset-bottom)) !important; font-size: 13px; max-width: calc(100vw - 90px) !important; }

  /* 弹窗 */
  #sheet h2 { font-size: 21px !important; }
  #sheet .sheet-bodytext { font-size: 15px; line-height: 1.8; }
}
@media (max-width: 620px) and (prefers-reduced-motion: reduce) {
  .mobile-nav button { transition: none; }
}
