/*
 * Quark 2 - user customizations
 *
 * This file is safe to edit. It is loaded last so anything here overrides
 * theme.css without having to mark rules !important.
 */

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

#header,
#page-wrapper,
#body-wrapper,
.content-item {
  max-width: 100%;
}

.navbar {
  min-width: 0;
}

.navbar .logo,
.navbar .navbar-section {
  min-width: 0;
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
}

.navbar-brand svg {
  display: block;
  width: min(220px, 48vw);
  max-width: 100%;
  height: auto;
}

.content-item {
  overflow-wrap: anywhere;
  word-break: normal;
}

.content-item p,
.content-item li,
.content-item blockquote {
  line-height: 1.75;
}

.content-item pre {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  -webkit-overflow-scrolling: touch;
}

.content-item code {
  white-space: normal;
  overflow-wrap: anywhere;
}

.content-item pre code {
  white-space: pre-wrap;
}

.content-item table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  -webkit-overflow-scrolling: touch;
}

.content-item table th,
.content-item table td {
  white-space: nowrap;
  vertical-align: top;
}

@media (max-width: 700px) {
  #header .container,
  #body-wrapper .container {
    width: 100%;
    max-width: 100%;
    padding-right: 1rem;
    padding-left: 1rem;
  }

  #header .container {
    min-height: 3.75rem;
  }

  .navbar-brand svg {
    width: min(170px, 56vw);
  }

  .content-item {
    font-size: 0.98rem;
  }

  .content-item h1 {
    font-size: clamp(1.75rem, 9vw, 2.35rem);
    line-height: 1.15;
  }

  .content-item h2 {
    font-size: clamp(1.35rem, 6.5vw, 1.8rem);
    line-height: 1.2;
  }

  .content-item h3 {
    font-size: 1.12rem;
    line-height: 1.3;
  }

  .content-item blockquote {
    margin-right: 0;
    margin-left: 0;
    padding: 0.75rem 1rem;
  }

  .content-item ol,
  .content-item ul {
    padding-left: 1.25rem;
  }

  .content-item pre {
    padding: 0.875rem;
    font-size: 0.88rem;
  }

  .content-item table {
    display: table;
    margin-right: 0;
    padding-bottom: 0;
    overflow: visible;
    border: 0;
  }

  .content-item table thead {
    display: none;
  }

  .content-item table tbody,
  .content-item table tr,
  .content-item table td {
    display: block;
    width: 100%;
  }

  .content-item table tr {
    margin: 0 0 0.75rem;
    padding: 0.75rem;
    border: 1px solid color-mix(in oklab, currentColor 14%, transparent);
    border-radius: 0.5rem;
    background: color-mix(in oklab, canvas 96%, currentColor 4%);
  }

  .content-item table th,
  .content-item table td {
    white-space: normal;
    font-size: 0.88rem;
  }

  .content-item table td {
    display: grid;
    grid-template-columns: 4.25rem minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.25rem 0;
    overflow-wrap: anywhere;
  }

  .content-item table td::before {
    color: color-mix(in oklab, currentColor 62%, transparent);
    font-weight: 700;
  }

  .content-item table td:nth-child(1)::before {
    content: "Mod";
  }

  .content-item table td:nth-child(2)::before {
    content: "版本";
  }

  .content-item table td:nth-child(3)::before {
    content: "作用";
  }
}

@media (max-width: 420px) {
  .navbar-brand svg {
    width: min(145px, 52vw);
  }

  .content-item {
    font-size: 0.95rem;
  }
}
