html, body {
  width: 100vw;
  min-width: 100vw;
  max-width: 100vw;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

.page-container {
  width: 100vw;
  min-width: 100vw;
  max-width: 100vw;
  margin: 0;
  padding: 0;
}

@media (max-width: 615px) {
    .navigation-wrapper {
     flex-direction: column;
     height: 100%;
    }

    /* Title length with specific characters, e.g., _ */
    h3 {
        word-break: break-all;
        max-width: 100%;
    }
    h2 {
        word-break: break-all;
        max-width: 100%;
    }

    h1 {
        word-break: break-all;
        max-width: 100%;
    }

    /* Home page phone layout */
   .navigation-wrapper > .left-column {
        order: 1;
        margin-top: 10px;
        margin-bottom: 15px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
   }

   .navigation-wrapper > .left-column > .lab-name {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    }

   .navigation-wrapper > .left-column > .labs-logo img {
    width: 80px;
    height: auto;
    }

   .navigation-wrapper > .center-column {
        order: 2;
        width: 100%;
   }

   .navigation-wrapper > .right-column {
        order: 3;
   }

   .links-wrapper {
        flex-direction: column;
        margin-bottom: 20px;
   }

   .links-wrapper > .nav-link {
        margin-top: 5px;
        margin-bottom: 5px;
        font-size: 1.1em;
        width: auto;
        text-align: center;
    }

    .background-fig-section {
        width: 100%;
        height: 70px;
    }

    .background-fig-section > .heading {
        color: transparent;
        font-size: 1.5em;
        text-align: center;
    }

  /* ### footer logo */

  .footer {
    height: 500px;
    width: 100%;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    }

  .footer > .logo-footer {
    display: flex;
    flex-direction: column;
    }

    .footer > .logo-footer img {
    width: 150px; 
    height: 100%;
    margin-top: 10px;
    }

    .LABS-creation-section {
        height: 580px;
    }

    .page-container > .content-wrapper {
        width: 300px;
        height: 100%;
    }

    /* Organ interaction container mobile layout */
    #organ-interaction-container {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    #organ-interaction-container svg {
        width: 300px;
        height: auto;
        display: block;
        margin: 0 auto;
    }

    /* Multiorgan container mobile layout */
    .multiorgan-container {
        width: 300px;
        margin: 0 auto;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    /* webm video */
    .page-container > .content-wrapper > .webm-wrapper {
        flex-direction: column;
    }
    
    .page-container > .content-wrapper > .webm-wrapper > .video {
        flex: 0 0 auto;
        width: 100%; /* Adjust the width as necessary */
        max-width: 300px; /* Optional: Limit the maximum width of each video */
        /* margin: 0 5px;  */
    }

    /* Research page phone layout */

    .overall-fig img {
        width: 300px;
        height: 100%;
    }

    .reproducible-ml-fig img {
        width: 300px;
        height: 100%;
    }

    .heterogeneity-fig img {
        width: 300px;
        height: 100%;
    }

    .multiomics-fig img {
        width: 300px;
        height: 100%;
    }

    /* Team page layout */
    .team-member-wrapper {
        height: auto;
    }

    .person-pi {
        flex-direction: column;
    }


    .team-member-wrapper > .person-collaborator-wrapper {
        flex-direction: column;
    }

    /* Publication page layout */
    .publication-container {
        width: 300px;
        height: 100%;
    }
    
    .multiorgan-fig img {
        width: 300px;
        height: 100%;
    }

    /* Contact page layout */
    .contact-grid-wrapper {
        width: 300px;
        height: 1200px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .page-container > .contact-grid-wrapper {
        margin-bottom: -40px;
    }

    .form {
        margin-top: -100px;
    }

    .form > .center-btn-wrapper {
        margin-top: -20px;
    }

    .lab-metadata-sidebar-wrapper {
        margin-top: -100px;
    }

    /* Organ GWAS figure page layout */
    .gwas-fig img {
        width: 300px;
        height: auto;
        display: block;
        margin-left: auto;
        margin-right: auto;
        border: 1px solid #cea135;
    }

    /* paper figure page layout */
    .paper-fig img {
        width: 300px;
        height: auto;
        display: block;
        margin-left: auto;
        margin-right: auto;
        border: 1px solid #cea135;
    }


    /* Loading text mobile layout */
    .loading {
        text-align: center;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .navigation-wrapper {
      flex-direction: column;
      height: 100%;
      width: 100vw;
      min-width: 100vw;
      max-width: 100vw;
      box-sizing: border-box;
      padding: 0;
      margin: 0;
    }

    .navigation-wrapper > .left-column {
      order: 1;
      margin-top: 10px;
      margin-bottom: 10px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
    }

    .navigation-wrapper > .left-column > .labs-logo img {
      width: 80px;
      height: auto;
    }

    .navigation-wrapper > .left-column > .lab-name {
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
    }

    .navigation-wrapper > .center-column {
      order: 2;
      width: 100%;
    }

    .navigation-wrapper > .right-column {
      order: 3;
      margin-bottom: 10px;
    }

    .links-wrapper {
      flex-direction: column;
      margin-bottom: 10px;
      gap: 0;
      align-items: center;
    }

    .links-wrapper > .nav-link {
      margin: 4px 0;
      font-size: 1.1em;
      width: auto;
      text-align: center;
      padding: 6px 0;
      line-height: 1.2;
    }

    .chart-section,
    .table-section {
      width: 300px !important;
      max-width: 100vw !important;
      padding: 8px !important;
      box-sizing: border-box !important;
    }
    #sleepChart,
    #summaryTable {
      width: 100% !important;
      min-width: 0 !important;
      max-width: 100% !important;
      box-sizing: border-box !important;
      overflow-x: auto !important;
    }

    #sleepChart {
      width: 100% !important;
      max-width: 100% !important;
      aspect-ratio: 4/3 !important; /* 或 3/2、16/9，根据你想要的比例调整 */
      height: auto !important;
      min-height: 200px !important; /* 可选，防止太扁 */
      max-height: 400px !important; /* 可选，防止太高 */
      box-sizing: border-box !important;
      overflow-x: auto !important;
    }

    .gwas-img {
      width: 100% !important;
      max-width: 300px !important;
      height: auto !important;
      display: block !important;
      margin-left: auto !important;
      margin-right: auto !important;
      box-sizing: border-box !important;
    }

    .gwas-main {
      width: 100% !important;
      max-width: 320px !important;
      margin: 0 auto !important;
      box-sizing: border-box !important;
      padding: 0 0 !important;
    }

    .chart-section img,
    #sleepChart img {
      width: 100% !important;
      max-width: 100% !important;
      height: auto !important;
      display: block !important;
      margin: 0 auto !important;
    }

    .table-section {
      box-sizing: border-box !important;
      width: 300px !important;
      max-width: 100vw !important;
      overflow-x: visible !important;
    }

    .table-section table {
      width: 100% !important;
      font-size: 1em !important;
      border-collapse: collapse !important;
      table-layout: fixed !important;
    }

    .table-section th, .table-section td {
      padding: 4px !important;
      font-size: 1em !important;
      border: 1px solid #ccc !important;
      word-break: break-all !important;
      white-space: normal !important;
    }
    h1 {
      font-size: 1.3em !important;
    }
    h2 {
      font-size: 1.1em !important;
    }
    h3 {
      font-size: 1em !important;
    }
    h4 {
      font-size: 0.95em !important;
    }
    p, li, td, th, .loading, .gwas-desc, .gwas-summary-block {
      font-size: 0.95em !important;
    }
    /* academic-table-container 表格标题 */
    .academic-table-container h3 {
      font-size: 0.7em !important;
      text-align: left !important;
      margin-bottom: 8px !important;
    }
    .academic-table-container th, .academic-table-container td {
      font-size: 0.65em !important;
    }
    @media (max-width: 615px) {
      .table-section {
        margin-top: 4px !important;  /* 或 0，根据你想要的紧凑程度 */
      }
    }
    @media (max-width: 615px) {
      h4 {
        margin-bottom: 4px !important;  /* 或 0，根据实际效果调整 */
      }
    }
}
