@media (min-width: 1280px) {
  .synthwave-article {
    padding: 2rem 4rem;
  }
}



@media (max-width: 1279px) {
  :root {
    --toc-width: 200px;
  }

  .synthwave-toc ul ul {
    display: none;
  }
}



@media (max-width: 1023px) {
  .synthwave-toc {
    display: none;
  }

  .synthwave-article {
    max-width: 100%;
    padding: 1.5rem 2rem;
  }
}



@media (max-width: 767px) {
  :root {
    --sidebar-width: 280px;
    --header-height: 56px;
  }

  .sidebar-toggle {
    display: flex;
  }

  .synthwave-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    height: calc(100vh - var(--header-height));
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-soft);
    z-index: 200;
    pointer-events: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior: contain;
  }

  .synthwave-sidebar.open {
    transform: translateX(0);
    z-index: 1001;
  }

  .synthwave-main {
    margin-left: 0;
  }

  .synthwave-footer {
    margin-left: 0;
  }

  .synthwave-article {
    padding: 1.5rem;
  }


  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    top: var(--header-height);
    left: var(--sidebar-width);
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
  }

  .sidebar-overlay.active {
    display: block;
  }


  .page-nav {
    flex-direction: column;
  }

  .nav-next {
    margin-left: 0;
    align-items: flex-start;
  }


  .footer-inner {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}



@media (max-width: 639px) {
  html {
    font-size: 12px;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  .header-inner {
    padding: 0 1rem;
  }

  .header-logo .logo-text {
    font-size: 1.125rem;
  }

  .synthwave-article {
    padding: 1rem;
  }

  .synthwave-footer {
    padding: 1.5rem 1rem;
  }


  .page-content table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }


  pre {
    max-width: calc(100vw - 2rem);
  }


  .breadcrumbs {
    display: none;
  }
}



@media print {
  .synthwave-header,
  .synthwave-sidebar,
  .synthwave-toc,
  .synthwave-footer,
  .page-nav,
  .theme-toggle-wrapper,
  .effects-toggle-wrapper,
  .performance-hint,
  .performance-console,
  .back-to-top {
    display: none !important;
  }

  .synthwave-main {
    margin-left: 0;
  }

  .synthwave-article {
    max-width: 100%;
    padding: 0;
  }

  body {
    background: white;
    color: black;
  }

  a {
    color: black;
    text-decoration: underline;
  }

  pre, code {
    background: #f5f5f5;
    border: 1px solid #ddd;
  }
}
