.mobile-header, #mobile-backdrop { display: none; }
#main { min-width: 0; }
@media (max-width: 800px) {
  html, body { height: 100%; overflow: hidden; }
  .mobile-header { display: flex; height: 52px; padding-top: env(safe-area-inset-top); align-items: center; justify-content: space-between; background: #1e1f1c; border-bottom: 1px solid #414339; color: #eee; }
  .mobile-header a { color: inherit; text-decoration: none; font-size: 16px; font-weight: 600; }
  .mobile-header button { width: 48px; height: 48px; padding: 12px; border: 0; background: transparent; cursor: pointer; }
  .mobile-header img { width: 24px; height: 24px; }
  #app { height: calc(100dvh - 52px - env(safe-area-inset-top)); }
  #nav-bar { display: none; }
  #sidebar { display: none; position: fixed; top: calc(52px + env(safe-area-inset-top)); bottom: 0; left: 0; width: min(340px, 86vw); z-index: 301; box-sizing: border-box; padding-bottom: env(safe-area-inset-bottom); }
  body.mobile-menu-open #sidebar { display: flex; flex-direction: column; }
  #mobile-backdrop:not([hidden]) { display: block; position: fixed; inset: calc(52px + env(safe-area-inset-top)) 0 0; background: rgb(0 0 0 / 55%); border: 0; z-index: 300; }
  .sidebar-body { min-height: 0; min-width: 0; font-size: 14px; overflow-y: auto; overflow-x: hidden; }
  #sidebar .post-link, #sidebar .folder { padding-top: 10px; padding-bottom: 10px; }
  #sidebar .folder { display: flex; align-items: center; gap: 7px; white-space: nowrap; width: 100%; min-width: 0; box-sizing: border-box; }
  #sidebar .folder > .arrow { flex: 0 0 14px; width: 14px; height: 14px; }
  #sidebar .folder-name { flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #tree-view, #search-tree { width: 100%; min-width: 0; }
  #sidebar .post-link { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  #search-input { font-size: 16px; padding: 12px; }
  #main { width: 100%; }
  #tabs-area { height: 44px; }
  .tab { flex-shrink: 0; box-sizing: border-box; height: 44px; max-width: 260px; }
  .tab .close-btn { opacity: 1; width: 28px; height: 28px; background-size: 16px; flex-shrink: 0; }
  #content { padding: 8px 16px calc(28px + env(safe-area-inset-bottom)); overflow-x: hidden; font-size: 16px; line-height: 1.75; overflow-wrap: anywhere; }
  #content h1 { font-size: 26px; line-height: 1.4; }
  #content h2 { font-size: 21px; line-height: 1.5; }
  #content h3 { font-size: 18px; }
  #content img, #content video { max-width: 100%; height: auto; }
  #content pre { max-width: 100%; overflow-x: auto; white-space: pre; box-sizing: border-box; }
  #content .code-block { max-width: 100%; box-sizing: border-box; padding: 12px; font-size: 13px; overflow-x: auto; }
  #content .code-block pre { margin: 0; }
  #content table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
  #content td, #content th { min-width: 110px; }
  #content :is(.dev-note,.dev-warning,.dev-summary,.dev-problem,.dev-solution) { padding: 12px; }
  #content input, #content textarea, #content select { max-width: 100%; box-sizing: border-box; font-size: 16px; }
  #footer { display: none; }
}
